!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.YASR=t()}}(function(){var t;return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a0;try{r=sessionStorage}catch(m){}a.append("");var v=function(t,e){var n=i(t);if(e.disable)return y(n);var r=n.id=n.attr(c)||h+u++;n.p=e.postbackSafe;if(n.is("table")&&!l[r]){n.addClass(h).attr(c,r).before('
');n.opt=e;n.g=[];n.c=[];n.w=n.width();n.gc=n.prev();e.marginLeft&&n.gc.css("marginLeft",e.marginLeft);e.marginRight&&n.gc.css("marginRight",e.marginRight);n.cs=d(g?t.cellSpacing||t.currentStyle.borderSpacing:n.css("border-spacing"))||2;n.b=d(g?t.border||t.currentStyle.borderLeftWidth:n.css("border-left-width"))||1;l[r]=n;b(n)}},y=function(t){var e=t.attr(c),t=l[e];if(t&&t.is("table")){t.removeClass(h).gc.remove();delete l[e]}},b=function(t){var e=t.find(">thead>tr>th,>thead>tr>td");e.length||(e=t.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td"));t.cg=t.find("col");t.ln=e.length;t.p&&r&&r[t.id]&&w(t,e);e.each(function(e){var n=i(this),r=i(t.gc.append('
')[0].lastChild);r.t=t;r.i=e;r.c=n;n.w=n.width();t.g.push(r);t.c.push(n);n.width(n.w).removeAttr("width");e
'):r.addClass("JCLRLastGrip").removeClass("JCLRgrip");r.data(h,{i:e,t:t.attr(c)})});t.cg.removeAttr("width");x(t);t.find("td, th").not(e).not("table th, table td").each(function(){i(this).removeAttr("width")})},w=function(t,e){var n,i=0,o=0,a=[];if(e){t.cg.removeAttr("width");if(t.opt.flush){r[t.id]="";return}n=r[t.id].split(";");for(;o*{cursor:"+n.opt.dragCursor+"!important}");r.addClass(n.opt.draggingClass);s=r;if(n.c[e.i].l)for(var u,c=0;c=e.end&&(c=!0);e.state.rowNum++;e.state.colNum=1}}function r(){if(void 0===e.onParseValue)s.push(u);else{var t=e.onParseValue(u,e.state);t!==!1&&s.push(t)}u="";l=0;e.state.colNum++}var i=e.separator,o=e.delimiter;e.state.rowNum||(e.state.rowNum=1);e.state.colNum||(e.state.colNum=1);var a=[],s=[],l=0,u="",c=!1,f=RegExp.escape(i),h=RegExp.escape(o),d=/(D|S|\n|\r|[^DS\r\n]+)/,p=d.source;p=p.replace(/S/g,f);p=p.replace(/D/g,h);d=RegExp(p,"gm");t.replace(d,function(t){if(!c)switch(l){case 0:if(t===i){u+="";r();break}if(t===o){l=1;break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;u+=t;l=3;break;case 1:if(t===o){l=2;break}u+=t;l=1;break;case 2:if(t===o){u+=t;l=1;break}if(t===i){r();break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;throw new Error("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case 3:if(t===i){r();break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;if(t===o)throw new Error("CSVDataError: Illegal Quote [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]")}});if(0!==s.length){r();n()}return a},splitLines:function(t,e){function n(){a=0;if(e.start&&e.state.rowNum=e.end&&(l=!0);e.state.rowNum++}}var r=e.separator,i=e.delimiter;e.state.rowNum||(e.state.rowNum=1);var o=[],a=0,s="",l=!1,u=RegExp.escape(r),c=RegExp.escape(i),f=/(D|S|\n|\r|[^DS\r\n]+)/,h=f.source;h=h.replace(/S/g,u);h=h.replace(/D/g,c);f=RegExp(h,"gm");t.replace(f,function(t){if(!l)switch(a){case 0:if(t===r){s+=t;a=0;break}if(t===i){s+=t;a=1;break}if("\n"===t){n();break}if(/^\r$/.test(t))break;s+=t;a=3;break;case 1:if(t===i){s+=t;a=2;break}s+=t;a=1;break;case 2:var o=s.substr(s.length-1);if(t===i&&o===i){s+=t;a=1;break}if(t===r){s+=t;a=0;break}if("\n"===t){n();break}if("\r"===t)break;throw new Error("CSVDataError: Illegal state [Row:"+e.state.rowNum+"]");case 3:if(t===r){s+=t;a=0;break}if("\n"===t){n();break}if("\r"===t)break;if(t===i)throw new Error("CSVDataError: Illegal quote [Row:"+e.state.rowNum+"]");throw new Error("CSVDataError: Illegal state [Row:"+e.state.rowNum+"]");default:throw new Error("CSVDataError: Unknown state [Row:"+e.state.rowNum+"]")}});""!==s&&n();return o},parseEntry:function(t,e){function n(){if(void 0===e.onParseValue)o.push(s);else{var t=e.onParseValue(s,e.state);t!==!1&&o.push(t)}s="";a=0;e.state.colNum++}var r=e.separator,i=e.delimiter;e.state.rowNum||(e.state.rowNum=1);e.state.colNum||(e.state.colNum=1);var o=[],a=0,s="";if(!e.match){var l=RegExp.escape(r),u=RegExp.escape(i),c=/(D|S|\n|\r|[^DS\r\n]+)/,f=c.source;f=f.replace(/S/g,l);f=f.replace(/D/g,u);e.match=RegExp(f,"gm")}t.replace(e.match,function(t){switch(a){case 0:if(t===r){s+="";n();break}if(t===i){a=1;break}if("\n"===t||"\r"===t)break;s+=t;a=3;break;case 1:if(t===i){a=2;break}s+=t;a=1;break;case 2:if(t===i){s+=t;a=1;break}if(t===r){n();break}if("\n"===t||"\r"===t)break;throw new Error("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case 3:if(t===r){n();break}if("\n"===t||"\r"===t)break;if(t===i)throw new Error("CSVDataError: Illegal Quote [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]")}});n();return o}},toArray:function(t,e,n){var e=void 0!==e?e:{},i={};i.callback=void 0!==n&&"function"==typeof n?n:!1;i.separator="separator"in e?e.separator:r.csv.defaults.separator;i.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;var o=void 0!==e.state?e.state:{},e={delimiter:i.delimiter,separator:i.separator,onParseEntry:e.onParseEntry,onParseValue:e.onParseValue,state:o},a=r.csv.parsers.parseEntry(t,e);if(!i.callback)return a;i.callback("",a);return void 0},toArrays:function(t,e,n){var e=void 0!==e?e:{},i={};i.callback=void 0!==n&&"function"==typeof n?n:!1;i.separator="separator"in e?e.separator:r.csv.defaults.separator;i.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;var o=[],e={delimiter:i.delimiter,separator:i.separator,onParseEntry:e.onParseEntry,onParseValue:e.onParseValue,start:e.start,end:e.end,state:{rowNum:1,colNum:1}};o=r.csv.parsers.parse(t,e);if(!i.callback)return o;i.callback("",o);return void 0},toObjects:function(t,e,n){var e=void 0!==e?e:{},i={};i.callback=void 0!==n&&"function"==typeof n?n:!1;i.separator="separator"in e?e.separator:r.csv.defaults.separator;i.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;i.headers="headers"in e?e.headers:r.csv.defaults.headers;e.start="start"in e?e.start:1;i.headers&&e.start++;e.end&&i.headers&&e.end++;var o=[],a=[],e={delimiter:i.delimiter,separator:i.separator,onParseEntry:e.onParseEntry,onParseValue:e.onParseValue,start:e.start,end:e.end,state:{rowNum:1,colNum:1},match:!1},s={delimiter:i.delimiter,separator:i.separator,start:1,end:1,state:{rowNum:1,colNum:1}},l=r.csv.parsers.splitLines(t,s),u=r.csv.toArray(l[0],e),o=r.csv.parsers.splitLines(t,e);e.state.colNum=1;e.state.rowNum=u?2:1;for(var c=0,f=o.length;f>c;c++){var h=r.csv.toArray(o[c],e),d={};for(var p in u)d[u[p]]=h[p];a.push(d);e.state.rowNum++}if(!i.callback)return a;i.callback("",a);return void 0},fromArrays:function(t,e,n){var e=void 0!==e?e:{},o={};o.callback=void 0!==n&&"function"==typeof n?n:!1;o.separator="separator"in e?e.separator:r.csv.defaults.separator;o.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;o.escaper="escaper"in e?e.escaper:r.csv.defaults.escaper;o.experimental="experimental"in e?e.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(t[i]);if(!o.callback)return a;o.callback("",a);return void 0},fromObjects2CSV:function(t,e,n){var e=void 0!==e?e:{},o={};o.callback=void 0!==n&&"function"==typeof n?n:!1;o.separator="separator"in e?e.separator:r.csv.defaults.separator;o.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;o.experimental="experimental"in e?e.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(arrays[i]);if(!o.callback)return a;o.callback("",a);return void 0}};r.csvEntry2Array=r.csv.toArray;r.csv2Array=r.csv.toArrays;r.csv2Dictionary=r.csv.toObjects},{jquery:19}],4:[function(t,e,n){function r(){this._events=this._events||{};this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function o(t){return"number"==typeof t}function a(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=r;r.EventEmitter=r;r.prototype._events=void 0;r.prototype._maxListeners=void 0;r.defaultMaxListeners=10;r.prototype.setMaxListeners=function(t){if(!o(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");this._maxListeners=t;return this};r.prototype.emit=function(t){var e,n,r,o,l,u;this._events||(this._events={});if("error"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){e=arguments[1];if(e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}n=this._events[t];if(s(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:r=arguments.length;o=new Array(r-1);for(l=1;r>l;l++)o[l-1]=arguments[l];n.apply(this,o)}else if(a(n)){r=arguments.length;o=new Array(r-1);for(l=1;r>l;l++)o[l-1]=arguments[l];u=n.slice();r=u.length;for(l=0;r>l;l++)u[l].apply(this,o)}return!0};r.prototype.addListener=function(t,e){var n;if(!i(e))throw TypeError("listener must be a function");this._events||(this._events={});this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e);this._events[t]?a(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e;if(a(this._events[t])&&!this._events[t].warned){var n;n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners;if(n&&n>0&&this._events[t].length>n){this._events[t].warned=!0;console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length);"function"==typeof console.trace&&console.trace()}}return this};r.prototype.on=r.prototype.addListener;r.prototype.once=function(t,e){function n(){this.removeListener(t,n);if(!r){r=!0;e.apply(this,arguments)}}if(!i(e))throw TypeError("listener must be a function");var r=!1;n.listener=e;this.on(t,n);return this};r.prototype.removeListener=function(t,e){var n,r,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;n=this._events[t];o=n.length;r=-1;if(n===e||i(n.listener)&&n.listener===e){delete this._events[t];this._events.removeListener&&this.emit("removeListener",t,e)}else if(a(n)){for(s=o;s-->0;)if(n[s]===e||n[s].listener&&n[s].listener===e){r=s;break}if(0>r)return this;if(1===n.length){n.length=0;delete this._events[t]}else n.splice(r,1);this._events.removeListener&&this.emit("removeListener",t,e)}return this};r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener){0===arguments.length?this._events={}:this._events[t]&&delete this._events[t];return this}if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);this.removeAllListeners("removeListener");this._events={};return this}n=this._events[t];if(i(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);delete this._events[t];return this};r.prototype.listeners=function(t){var e;e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[];return e};r.listenerCount=function(t,e){var n;n=t._events&&t._events[e]?i(t._events[e])?1:t._events[e].length:0;return n}},{}],5:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){function e(t,e,r,i){var o=t.getLineHandle(e.line),l=e.ch-1,u=l>=0&&s[o.text.charAt(l)]||s[o.text.charAt(++l)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(r&&c>0!=(l==e.ch))return null;var f=t.getTokenTypeAt(a(e.line,l+1)),h=n(t,a(e.line,l+(c>0?1:0)),c,f||null,i);return null==h?null:{from:a(e.line,l),to:h&&h.pos,match:h&&h.ch==u.charAt(0),forward:c>0}}function n(t,e,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,u=[],c=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),h=e.line;h!=f;h+=n){var d=t.getLine(h);if(d){var p=n>0?0:d.length-1,g=n>0?d.length:-1;if(!(d.length>o)){h==e.line&&(p=e.ch-(0>n?1:0));for(;p!=g;p+=n){var m=d.charAt(p);if(c.test(m)&&(void 0===r||t.getTokenTypeAt(a(h,p+1))==r)){var v=s[m];if(">"==v.charAt(1)==n>0)u.push(m);else{if(!u.length)return{pos:a(h,p),ch:m};u.pop()}}}}}}return h-n==(n>0?t.lastLine():t.firstLine())?!1:null}function r(t,n,r){for(var i=t.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=t.listSelections(),u=0;u",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;t.defineOption("matchBrackets",!1,function(e,n,r){r&&r!=t.Init&&e.off("cursorActivity",i);if(n){e.state.matchBrackets="object"==typeof n?n:{};e.on("cursorActivity",i)}});t.defineExtension("matchBrackets",function(){r(this,!0)});t.defineExtension("findMatchingBracket",function(t,n,r){return e(this,t,n,r)});t.defineExtension("scanForBracket",function(t,e,r,i){return n(this,t,e,r,i)})})},{"../../lib/codemirror":10}],6:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.registerHelper("fold","brace",function(e,n){function r(r){for(var i=n.ch,l=0;;){var u=0>=i?-1:s.lastIndexOf(r,i-1);if(-1!=u){if(1==l&&u=p;++p)for(var g=e.getLine(p),m=p==a?i:0;;){var v=g.indexOf(l,m),y=g.indexOf(u,m);0>v&&(v=g.length);0>y&&(y=g.length);m=Math.min(v,y);if(m==g.length)break;if(e.getTokenTypeAt(t.Pos(p,m+1))==o)if(m==v)++h;else if(!--h){c=p;f=m;break t}++m}if(null!=c&&(a!=c||f!=i))return{from:t.Pos(a,i),to:t.Pos(c,f)}}});t.registerHelper("fold","import",function(e,n){function r(n){if(ne.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1)));if("keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(e.lastLine(),n+10);o>=i;++i){var a=e.getLine(i),s=a.indexOf(";");if(-1!=s)return{startCh:r.end,end:t.Pos(i,s)}}}var i,n=n.line,o=r(n);if(!o||r(n-1)||(i=r(n-2))&&i.end.line==n-1)return null;for(var a=o.end;;){var s=r(a.line+1);if(null==s)break;a=s.end}return{from:e.clipPos(t.Pos(n,o.startCh+1)),to:a}});t.registerHelper("fold","include",function(e,n){function r(n){if(ne.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1)));return"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var n=n.line,i=r(n);if(null==i||null!=r(n-1))return null;for(var o=n;;){var a=r(o+1);if(null==a)break;++o}return{from:t.Pos(n,i+1),to:e.clipPos(t.Pos(o))}})})},{"../../lib/codemirror":10}],7:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";function e(e,i,o,a){function s(t){var n=l(e,i);if(!n||n.to.line-n.from.linee.firstLine();){i=t.Pos(i.line-1,0);c=s(!1)}if(c&&!c.cleared&&"unfold"!==a){var f=n(e,o);t.on(f,"mousedown",function(e){h.clear();t.e_preventDefault(e)});var h=e.markText(c.from,c.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});h.on("clear",function(n,r){t.signal(e,"unfold",e,n,r)});t.signal(e,"fold",e,c.from,c.to)}}function n(t,e){var n=r(t,e,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span");n.appendChild(i);n.className="CodeMirror-foldmarker"}return n}function r(t,e,n){if(e&&void 0!==e[n])return e[n];var r=t.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}t.newFoldFunction=function(t,n){return function(r,i){e(r,i,{rangeFinder:t,widget:n})}};t.defineExtension("foldCode",function(t,n,r){e(this,t,n,r)});t.defineExtension("isFolded",function(t){for(var e=this.findMarksAt(t),n=0;n=n;n++)e.foldCode(t.Pos(n,0),null,"fold")})};t.commands.unfoldAll=function(e){e.operation(function(){for(var n=e.firstLine(),r=e.lastLine();r>=n;n++)e.foldCode(t.Pos(n,0),null,"unfold")})};t.registerHelper("fold","combine",function(){var t=Array.prototype.slice.call(arguments,0);return function(e,n){for(var r=0;r=s&&(n=i(o.indicatorOpen))}t.setGutterMarker(e,o.gutter,n);++a})}function a(t){var e=t.getViewport(),n=t.state.foldGutter;if(n){t.operation(function(){o(t,e.from,e.to)});n.from=e.from;n.to=e.to}}function s(t,e,n){var r=t.state.foldGutter;if(r){var i=r.options;n==i.gutter&&t.foldCode(f(e,0),i.rangeFinder)}}function l(t){var e=t.state.foldGutter;if(e){var n=e.options;e.from=e.to=0;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout(function(){a(t)},n.foldOnChangeTimeSpan||600)}}function u(t){var e=t.state.foldGutter;if(e){var n=e.options;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout(function(){var n=t.getViewport();e.from==e.to||n.from-e.to>20||e.from-n.to>20?a(t):t.operation(function(){if(n.frome.to){o(t,e.to,n.to);e.to=n.to}})},n.updateViewportTimeSpan||400)}}function c(t,e){var n=t.state.foldGutter;if(n){var r=e.line;r>=n.from&&r=t.max)){t.ch=0;t.text=t.cm.getLine(++t.line);return!0}}function o(t){if(!(t.line<=t.min)){t.text=t.cm.getLine(--t.line);t.ch=t.text.length;return!0}}function a(t){for(;;){var e=t.text.indexOf(">",t.ch);if(-1==e){if(i(t))continue;return}if(r(t,e+1)){var n=t.text.lastIndexOf("/",e),o=n>-1&&!/\S/.test(t.text.slice(n+1,e));t.ch=e+1;return o?"selfClose":"regular"}t.ch=e+1}}function s(t){for(;;){var e=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(-1==e){if(o(t))continue;return}if(r(t,e+1)){g.lastIndex=e;t.ch=e;var n=g.exec(t.text);if(n&&n.index==e)return n}else t.ch=e}}function l(t){for(;;){g.lastIndex=t.ch;var e=g.exec(t.text);if(!e){if(i(t))continue;return}if(r(t,e.index+1)){t.ch=e.index+e[0].length;return e}t.ch=e.index+1}}function u(t){for(;;){var e=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(-1==e){if(o(t))continue;return}if(r(t,e+1)){var n=t.text.lastIndexOf("/",e),i=n>-1&&!/\S/.test(t.text.slice(n+1,e));t.ch=e+1;return i?"selfClose":"regular"}t.ch=e}}function c(t,e){for(var n=[];;){var r,i=l(t),o=t.line,s=t.ch-(i?i[0].length:0);if(!i||!(r=a(t)))return;if("selfClose"!=r)if(i[1]){for(var u=n.length-1;u>=0;--u)if(n[u]==i[2]){n.length=u;break}if(0>u&&(!e||e==i[2]))return{tag:i[2],from:h(o,s),to:h(t.line,t.ch)}}else n.push(i[2])}}function f(t,e){for(var n=[];;){var r=u(t);if(!r)return;if("selfClose"!=r){var i=t.line,o=t.ch,a=s(t);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(0>l&&(!e||e==a[2]))return{tag:a[2],from:h(t.line,t.ch),to:h(i,o)}}}else s(t)}}var h=t.Pos,d="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+d+"]["+p+"]*)","g");t.registerHelper("fold","xml",function(t,e){for(var r=new n(t,e.line,0);;){var i,o=l(r);if(!o||r.line!=e.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var e=h(r.line,r.ch),s=c(r,o[2]);return s&&{from:e,to:s.from}}}});t.findMatchingTag=function(t,r,i){var o=new n(t,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var l=a(o),u=l&&h(o.line,o.ch),d=l&&s(o);if(l&&d&&!(e(o,r)>0)){var p={from:h(o.line,o.ch),to:u,tag:d[2]};if("selfClose"==l)return{open:p,close:null,at:"open"};if(d[1])return{open:f(o,d[2]),close:p,at:"close"};o=new n(t,u.line,u.ch,i);return{open:p,close:c(o,d[2]),at:"open"}}}};t.findEnclosingTag=function(t,e,r){for(var i=new n(t,e.line,e.ch,r);;){var o=f(i);if(!o)break;var a=new n(t,e.line,e.ch,r),s=c(a,o.tag);if(s)return{open:o,close:s}}};t.scanForClosingTag=function(t,e,r,i){var o=new n(t,e.line,e.ch,i?{from:0,to:i}:null);return c(o,r)}})},{"../../lib/codemirror":10}],10:[function(e,n,r){(function(e){if("object"==typeof r&&"object"==typeof n)n.exports=e();else{if("function"==typeof t&&t.amd)return t([],e);this.CodeMirror=e()}})(function(){"use strict";function t(n,r){if(!(this instanceof t))return new t(n,r);this.options=r=r?Si(r):{};Si(Ro,r,!1);d(r);var i=r.value;"string"==typeof i&&(i=new la(i,r.mode));this.doc=i;var o=this.display=new e(n,i);o.wrapper.CodeMirror=this;u(this);s(this);r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");r.autofocus&&!po&&Ae(this);v(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new mi,keySeq:null};no&&11>ro&&setTimeout(Ti(Le,this,!0),20);Pe(this);Ii();ie(this);this.curOp.forceUpdate=!0;Or(this,i);r.autofocus&&!po||Ni()==o.input?setTimeout(Ti(rn,this),20):on(this);for(var a in Fo)Fo.hasOwnProperty(a)&&Fo[a](this,r[a],Wo);C(this);r.finishInit&&r.finishInit(this);for(var l=0;lro){n.gutters.style.zIndex=-1;n.scroller.style.paddingRight=0}ho&&(r.style.width="0px");io||(n.scroller.draggable=!0);if(uo){n.inputDiv.style.height="1px";n.inputDiv.style.position="absolute"}t&&(t.appendChild?t.appendChild(n.wrapper):t(n.wrapper));n.viewFrom=n.viewTo=e.first;n.reportedViewFrom=n.reportedViewTo=e.first;n.view=[];n.renderedView=null;n.externalMeasured=null;n.viewOffset=0;n.lastWrapHeight=n.lastWrapWidth=0;n.updateLineNumbers=null;n.nativeBarWidth=n.barHeight=n.barWidth=0;n.scrollbarsClipped=!1;n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null;n.prevInput="";n.alignWidgets=!1;n.pollingFast=!1;n.poll=new mi;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null;n.inaccurateSelection=!1;n.maxLine=null;n.maxLineLength=0;n.maxLineChanged=!1;n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null;n.shift=!1;n.selForContextMenu=null}function n(e){e.doc.mode=t.getMode(e.options,e.doc.modeOption); r(e)}function r(t){t.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null);t.styles&&(t.styles=null)});t.doc.frontier=t.doc.first;Tt(t,100);t.state.modeGen++;t.curOp&&be(t)}function i(t){if(t.options.lineWrapping){ja(t.display.wrapper,"CodeMirror-wrap");t.display.sizer.style.minWidth="";t.display.sizerWidth=null}else{Pa(t.display.wrapper,"CodeMirror-wrap");h(t)}a(t);be(t);Vt(t);setTimeout(function(){y(t)},100)}function o(t){var e=ne(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/re(t.display)-3);return function(i){if(ur(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;ae.maxLineLength){e.maxLineLength=n;e.maxLine=t}})}function d(t){var e=wi(t.gutters,"CodeMirror-linenumbers");if(-1==e&&t.lineNumbers)t.gutters=t.gutters.concat(["CodeMirror-linenumbers"]);else if(e>-1&&!t.lineNumbers){t.gutters=t.gutters.slice(0);t.gutters.splice(e,1)}}function p(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Lt(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Nt(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}function g(t,e,n){this.cm=n;var r=this.vert=Di("div",[Di("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Di("div",[Di("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");t(r);t(i);pa(r,"scroll",function(){r.clientHeight&&e(r.scrollTop,"vertical")});pa(i,"scroll",function(){i.clientWidth&&e(i.scrollLeft,"horizontal")});this.checkedOverlay=!1;no&&8>ro&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function m(){}function v(e){if(e.display.scrollbars){e.display.scrollbars.clear();e.display.scrollbars.addClass&&Pa(e.display.wrapper,e.display.scrollbars.addClass)}e.display.scrollbars=new t.scrollbarModel[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller);pa(t,"mousedown",function(){e.state.focused&&setTimeout(Ti(Ae,e),0)});t.setAttribute("not-content","true")},function(t,n){"horizontal"==n?Xe(e,t):Ve(e,t)},e);e.display.scrollbars.addClass&&ja(e.display.wrapper,e.display.scrollbars.addClass)}function y(t,e){e||(e=p(t));var n=t.display.barWidth,r=t.display.barHeight;b(t,e);for(var i=0;4>i&&n!=t.display.barWidth||r!=t.display.barHeight;i++){n!=t.display.barWidth&&t.options.lineWrapping&&N(t);b(t,p(t));n=t.display.barWidth;r=t.display.barHeight}}function b(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px";n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px";if(r.right&&r.bottom){n.scrollbarFiller.style.display="block";n.scrollbarFiller.style.height=r.bottom+"px";n.scrollbarFiller.style.width=r.right+"px"}else n.scrollbarFiller.style.display="";if(r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter){n.gutterFiller.style.display="block";n.gutterFiller.style.height=r.bottom+"px";n.gutterFiller.style.width=e.gutterWidth+"px"}else n.gutterFiller.style.display=""}function w(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-Dt(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,o=Ur(e,r),a=Ur(e,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;if(o>s){o=s;a=Ur(e,Br(Rr(e,s))+t.wrapper.clientHeight)}else if(Math.min(l,e.lastLine())>=a){o=Ur(e,Br(Rr(e,l))-t.wrapper.clientHeight);a=l}}return{from:o,to:Math.max(a,o+1)}}function x(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=T(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;a=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==ke(t))return!1;if(C(t)){xe(t);e.dims=P(t)}var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo));if(xo){o=sr(t.doc,o);a=lr(t.doc,a)}var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Te(t,o,a);n.viewOffset=Br(Rr(t.doc,n.viewFrom));t.display.mover.style.top=n.viewOffset+"px";var l=ke(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Ni();l>4&&(n.lineDiv.style.display="none");j(t,n.updateLineNumbers,e.dims);l>4&&(n.lineDiv.style.display="");n.renderedView=n.view;u&&Ni()!=u&&u.offsetHeight&&u.focus();Li(n.cursorDiv);Li(n.selectionDiv);n.gutters.style.height=0;if(s){n.lastWrapHeight=e.wrapperHeight;n.lastWrapWidth=e.wrapperWidth;Tt(t,400)}n.updateLineNumbers=null;return!0}function D(t,e){for(var n=e.force,r=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Et(t))n=!0;else{n=!1;r&&null!=r.top&&(r={top:Math.min(t.doc.height+Lt(t.display)-Pt(t),r.top)});e.visible=w(t.display,t.doc,r);if(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break}if(!_(t,e))break;N(t);var o=p(t);wt(t);A(t,o);y(t,o)}e.signal(t,"update",t);if(t.display.viewFrom!=t.display.reportedViewFrom||t.display.viewTo!=t.display.reportedViewTo){e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo);t.display.reportedViewFrom=t.display.viewFrom;t.display.reportedViewTo=t.display.viewTo}}function L(t,e){var n=new k(t,e);if(_(t,n)){N(t);D(t,n);var r=p(t);wt(t);A(t,r);y(t,r);n.finish()}}function A(t,e){t.display.sizer.style.minHeight=e.docHeight+"px";var n=e.docHeight+t.display.barHeight;t.display.heightForcer.style.top=n+"px";t.display.gutters.style.height=Math.max(n+Nt(t),e.clientHeight)+"px"}function N(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;rro){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n;n=a}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var l=o.line.height-i;2>i&&(i=ne(e));if(l>.001||-.001>l){zr(o.line,i);E(o.line);if(o.rest)for(var u=0;u=e&&f.lineNumber;if(f.changes){wi(f.changes,"gutter")>-1&&(h=!1);I(t,f,u,n)}if(h){Li(f.lineNumber);f.lineNumber.appendChild(document.createTextNode(S(t.options,u)))}s=f.node.nextSibling}else{var d=U(t,f,u,n);a.insertBefore(d,s)}u+=f.size}for(;s;)s=r(s)}function I(t,e,n,r){for(var i=0;iro&&(t.node.style.zIndex=2)}return t.node}function O(t){var e=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;e&&(e+=" CodeMirror-linebackground");if(t.background)if(e)t.background.className=e;else{t.background.parentNode.removeChild(t.background);t.background=null}else if(e){var n=H(t);t.background=n.insertBefore(Di("div",null,e),n.firstChild)}}function R(t,e){var n=t.display.externalMeasured;if(n&&n.line==e.line){t.display.externalMeasured=null;e.measure=n.measure;return n.built}return kr(t,e)}function F(t,e){var n=e.text.className,r=R(t,e);e.text==e.node&&(e.node=r.pre);e.text.parentNode.replaceChild(r.pre,e.text);e.text=r.pre;if(r.bgClass!=e.bgClass||r.textClass!=e.textClass){e.bgClass=r.bgClass;e.textClass=r.textClass;W(e)}else n&&(e.text.className=n)}function W(t){O(t);t.line.wrapClass?H(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var e=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=e||""}function z(t,e,n,r){if(e.gutter){e.node.removeChild(e.gutter);e.gutter=null}var i=e.line.gutterMarkers;if(t.options.lineNumbers||i){var o=H(e),a=e.gutter=o.insertBefore(Di("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.text);e.line.gutterClass&&(a.className+=" "+e.line.gutterClass);!t.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(e.lineNumber=a.appendChild(Di("div",S(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px")));if(i)for(var s=0;s=0){var a=$(o.from(),i.from()),s=Y(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;e>=r&&--e;t.splice(--r,2,new K(l?s:a,l?a:s))}}return new J(t,e)}function Q(t,e){return new J([new K(t,e||t)],0)}function tt(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function et(t,e){if(e.linen?Co(n,Rr(t,n).text.length):nt(e,Rr(t,e.line).text.length)}function nt(t,e){var n=t.ch;return null==n||n>e?Co(t.line,e):0>n?Co(t.line,0):t}function rt(t,e){return e>=t.first&&e=o.ch:u.to>o.ch))){if(r){ma(c,"beforeCursorEnter");if(c.explicitlyCleared){if(s.markedSpans){--l;continue}break}}if(!c.atomic)continue;var f=c.find(0>a?-1:1);if(0==So(f,o)){f.ch+=a;f.ch<0?f=f.line>t.first?et(t,Co(f.line-1)):null:f.ch>s.text.length&&(f=f.linee&&(e=0);e=Math.round(e);r=Math.round(r);s.appendChild(Di("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px; top: "+e+"px; width: "+(null==n?c-t:n)+"px; height: "+(r-e)+"px"))}function i(e,n,i){function o(n,r){return Jt(t,Co(e,n),"div",f,r)}var s,l,f=Rr(a,e),h=f.text.length;Wi(Vr(f),n||0,null==i?h:i,function(t,e,a){var f,d,p,g=o(t,"left");if(t==e){f=g;d=p=g.left}else{f=o(e-1,"right");if("rtl"==a){var m=g;g=f;f=m}d=g.left;p=f.right}null==n&&0==t&&(d=u);if(f.top-g.top>3){r(d,g.top,null,g.bottom);d=u;g.bottoml.bottom||f.bottom==l.bottom&&f.right>l.right)&&(l=f);u+1>d&&(d=u);r(d,f.top,p-d,f.bottom)});return{start:s,end:l}}var o=t.display,a=t.doc,s=document.createDocumentFragment(),l=At(t.display),u=l.left,c=Math.max(o.sizerWidth,Et(t)-o.sizer.offsetLeft)-l.right,f=e.from(),h=e.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Rr(a,f.line),p=Rr(a,h.line),g=or(d)==or(p),m=i(f.line,f.ch,g?d.text.length+1:null).end,v=i(h.line,g?0:null,h.ch).start;if(g)if(m.top0?e.blinker=setInterval(function(){e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Tt(t,e){t.doc.mode.startState&&t.doc.frontier=t.display.viewTo)){var n=+new Date+t.options.workTime,r=Xo(e.mode,_t(t,e.frontier)),i=[];e.iter(e.frontier,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(e.frontier>=t.display.viewFrom){var a=o.styles,s=xr(t,o,r,!0);o.styles=s.styles;var l=o.styleClasses,u=s.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!c&&fn){Tt(t,t.options.workDelay);return!0}});i.length&&de(t,function(){for(var e=0;ea;--s){if(s<=o.first)return o.first;var l=Rr(o,s-1);if(l.stateAfter&&(!n||s<=o.frontier))return s;var u=Sa(l.text,null,t.options.tabSize);if(null==i||r>u){i=s-1;r=u}}return i}function _t(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return!0;var o=Mt(t,e,n),a=o>r.first&&Rr(r,o-1).stateAfter;a=a?Xo(r.mode,a):Go(r.mode);r.iter(o,e,function(n){Sr(t,n.text,a);var s=o==e-1||o%5==0||o>=i.viewFrom&&o2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function It(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;rn)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function Ht(t,e){e=or(e);var n=qr(e),r=t.display.externalMeasured=new ve(t.doc,e,n);r.lineN=n;var i=r.built=kr(t,r);r.text=i.pre;Ai(t.display.lineMeasure,i.pre);return r}function Ot(t,e,n,r){return Wt(t,Ft(t,e),n,r)}function Rt(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&en){o=0;a=1;s="left"}else if(f>n){o=n-c;a=o+1}else if(u==l.length-3||n==f&&l[u+3]>n){a=f-c;o=a-1;n>=f&&(s="right")}if(null!=o){i=l[u+2];c==f&&r==(i.insertLeft?"left":"right")&&(s=r);if("left"==r&&0==o)for(;u&&l[u-2]==l[u-3]&&l[u-1].insertLeft;){i=l[(u-=3)+2];s="left"}if("right"==r&&o==f-c)for(;uu;u++){for(;o&&_i(e.line.text.charAt(c+o));)--o;for(;f>c+a&&_i(e.line.text.charAt(c+a));)++a;if(no&&9>ro&&0==o&&a==f-c)h=i.parentNode.getBoundingClientRect();else if(no&&t.options.lineWrapping){var d=Ma(i,o,a).getClientRects();h=d.length?d["right"==r?d.length-1:0]:_o}else h=Ma(i,o,a).getBoundingClientRect()||_o;if(h.left||h.right||0==o)break;a=o;o-=1;s="right"}no&&11>ro&&(h=qt(t.display.measure,h))}else{o>0&&(s=r="right");var d;h=t.options.lineWrapping&&(d=i.getClientRects()).length>1?d["right"==r?d.length-1:0]:i.getBoundingClientRect()}if(no&&9>ro&&!o&&(!h||!h.left&&!h.right)){var p=i.parentNode.getClientRects()[0];h=p?{left:p.left,right:p.left+re(t.display),top:p.top,bottom:p.bottom}:_o}for(var g=h.top-e.rect.top,m=h.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,u=0;un.from?a(t-1):a(t,r)}r=r||Rr(t.doc,e.line);i||(i=Ft(t,r));var l=Vr(r),u=e.ch;if(!l)return a(u);var c=$i(l,u),f=s(u,c);null!=qa&&(f.other=s(u,qa));return f}function Zt(t,e){var n=0,e=et(t.doc,e);t.options.lineWrapping||(n=re(t.display)*e.ch);var r=Rr(t.doc,e.line),i=Br(r)+Dt(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Qt(t,e,n,r){var i=Co(t,e);i.xRel=r;n&&(i.outside=!0);return i}function te(t,e,n){var r=t.doc;n+=t.display.viewOffset;if(0>n)return Qt(r.first,0,!0,-1);var i=Ur(r,n),o=r.first+r.size-1;if(i>o)return Qt(r.first+r.size-1,Rr(r,o).text.length,!0,1);0>e&&(e=0);for(var a=Rr(r,i);;){var s=ee(t,a,i,e,n),l=rr(a),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=qr(a=u.to.line)}}function ee(t,e,n,r,i){function o(r){var i=Kt(t,Co(n,r),"line",e,u);s=!0;if(a>i.bottom)return i.left-l;if(am)return Qt(n,d,v,1);for(;;){if(c?d==h||d==Ki(e,h,1):1>=d-h){for(var y=p>r||m-r>=r-p?h:d,b=r-(y==h?p:m);_i(e.text.charAt(y));)++y;var w=Qt(n,y,y==h?g:v,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(f/2),C=h+x;if(c){C=h;for(var S=0;x>S;++S)C=Ki(e,C,1)}var T=o(C);if(T>r){d=C;m=T;(v=s)&&(m+=1e3);f=x}else{h=C;p=T;g=s;f-=x}}}function ne(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==To){To=Di("pre");for(var e=0;49>e;++e){To.appendChild(document.createTextNode("x"));To.appendChild(Di("br"))}To.appendChild(document.createTextNode("x"))}Ai(t.measure,To);var n=To.offsetHeight/50;n>3&&(t.cachedTextHeight=n);Li(t.measure);return n||1}function re(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=Di("span","xxxxxxxxxx"),n=Di("pre",[e]);Ai(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;i>2&&(t.cachedCharWidth=i);return i||10}function ie(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Lo};Do?Do.ops.push(t.curOp):t.curOp.ownsGroup=Do={ops:[t.curOp],delayedCallbacks:[]}}function oe(t){var e=t.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping;t.update=t.mustUpdate&&new k(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function ue(t){t.updatedDisplay=t.mustUpdate&&_(t.cm,t.update)}function ce(t){var e=t.cm,n=e.display;t.updatedDisplay&&N(e);t.barMeasure=p(e);if(n.maxLineChanged&&!e.options.lineWrapping){t.adjustWidthTo=Ot(e,n.maxLine,n.maxLine.text.length).left+3;e.display.sizerWidth=t.adjustWidthTo;t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Nt(e)+e.display.barWidth);t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Et(e))}(t.updatedDisplay||t.selectionChanged)&&(t.newSelectionNodes=yt(e))}function fe(t){var e=t.cm;if(null!=t.adjustWidthTo){e.display.sizer.style.minWidth=t.adjustWidthTo+"px";t.maxScrollLefto;o=r){var a=new ve(t.doc,Rr(t.doc,o),o);r=o+a.size;i.push(a)}return i}function be(t,e,n,r){null==e&&(e=t.doc.first);null==n&&(n=t.doc.first+t.doc.size);r||(r=0);var i=t.display;r&&ne)&&(i.updateLineNumbers=e);t.curOp.viewChanged=!0;if(e>=i.viewTo)xo&&sr(t.doc,e)i.viewFrom)xe(t);else{i.viewFrom+=r;i.viewTo+=r}else if(e<=i.viewFrom&&n>=i.viewTo)xe(t);else if(e<=i.viewFrom){var o=Se(t,n,n+r,1);if(o){i.view=i.view.slice(o.index);i.viewFrom=o.lineN;i.viewTo+=r}else xe(t)}else if(n>=i.viewTo){var o=Se(t,e,e,-1);if(o){i.view=i.view.slice(0,o.index);i.viewTo=o.lineN}else xe(t)}else{var a=Se(t,e,e,-1),s=Se(t,n,n+r,1);if(a&&s){i.view=i.view.slice(0,a.index).concat(ye(t,a.lineN,s.lineN)).concat(i.view.slice(s.index));i.viewTo+=r}else xe(t)}var l=i.externalMeasured;l&&(n=i.lineN&&e=r.viewTo)){var o=r.view[Ce(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==wi(a,n)&&a.push(n)}}}function xe(t){t.display.viewFrom=t.display.viewTo=t.doc.first;t.display.view=[];t.display.viewOffset=0}function Ce(t,e){if(e>=t.display.viewTo)return null;e-=t.display.viewFrom;if(0>e)return null;for(var n=t.display.view,r=0;re)return r}}function Se(t,e,n,r){var i,o=Ce(t,e),a=t.display.view;if(!xo||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=0,l=t.display.viewFrom;o>s;s++)l+=a[s].size;if(l!=e){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-e;o++}else i=l-e;e+=i;n+=i}for(;sr(t.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size;o+=r}return{index:o,lineN:n}}function Te(t,e,n){var r=t.display,i=r.view;if(0==i.length||e>=r.viewTo||n<=r.viewFrom){r.view=ye(t,e,n);r.viewFrom=e}else{r.viewFrom>e?r.view=ye(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Ce(t,n)))}r.viewTo=n}function ke(t){for(var e=t.display.view,n=0,r=0;r=9&&t.display.inputHasSelection===i||go&&/[\uf700-\uf7ff]/.test(i)){Le(t);return!1}var o=!t.curOp;o&&ie(t);t.display.shift=!1;8203!=i.charCodeAt(0)||r.sel!=t.display.selForContextMenu||n||(n="​");for(var a=0,s=Math.min(n.length,i.length);s>a&&n.charCodeAt(a)==i.charCodeAt(a);)++a;var l=i.slice(a),u=Oa(l),c=null;t.state.pasteIncoming&&r.sel.ranges.length>1&&(Ao&&Ao.join("\n")==l?c=r.sel.ranges.length%Ao.length==0&&xi(Ao,Oa):u.length==r.sel.ranges.length&&(c=xi(u,function(t){return[t]})));for(var f=r.sel.ranges.length-1;f>=0;f--){var h=r.sel.ranges[f],d=h.from(),p=h.to();a-1){_n(t,y.line,"smart");break}}else v.electricInput&&v.electricInput.test(Rr(r,y.line).text.slice(0,y.ch))&&_n(t,y.line,"smart")}}kn(t);t.curOp.updateInput=g;t.curOp.typing=!0;i.length>1e3||i.indexOf("\n")>-1?e.value=t.display.prevInput="":t.display.prevInput=i;o&&ae(t);t.state.pasteIncoming=t.state.cutIncoming=!1;return!0}function Le(t,e){if(!t.display.contextMenuPending){var n,r,i=t.doc;if(t.somethingSelected()){t.display.prevInput="";var o=i.sel.primary();n=Fa&&(o.to().line-o.from().line>100||(r=t.getSelection()).length>1e3);var a=n?"-":r||t.getSelection();t.display.input.value=a;t.state.focused&&ka(t.display.input);no&&ro>=9&&(t.display.inputHasSelection=a)}else if(!e){t.display.prevInput=t.display.input.value="";no&&ro>=9&&(t.display.inputHasSelection=null)}t.display.inaccurateSelection=n}}function Ae(t){if("nocursor"!=t.options.readOnly&&(!po||Ni()!=t.display.input))try{t.display.input.focus()}catch(e){}}function Ne(t){if(!t.state.focused){Ae(t);rn(t)}}function Ee(t){return t.options.readOnly||t.doc.cantEdit}function Pe(t){function e(e){hi(t,e)||da(e)}function n(e){if(t.somethingSelected()){Ao=t.getSelections();if(r.inaccurateSelection){r.prevInput="";r.inaccurateSelection=!1;r.input.value=Ao.join("\n");ka(r.input)}}else{for(var n=[],i=[],o=0;oro?pa(r.scroller,"dblclick",pe(t,function(e){if(!hi(t,e)){var n=He(t,e);if(n&&!qe(t,e)&&!Ie(t.display,e)){fa(e);var r=t.findWordAt(n);at(t.doc,r.anchor,r.head)}}})):pa(r.scroller,"dblclick",function(e){hi(t,e)||fa(e)});pa(r.lineSpace,"selectstart",function(t){Ie(r,t)||fa(t)});bo||pa(r.scroller,"contextmenu",function(e){an(t,e)});pa(r.scroller,"scroll",function(){if(r.scroller.clientHeight){Ve(t,r.scroller.scrollTop);Xe(t,r.scroller.scrollLeft,!0);ma(t,"scroll",t)}});pa(r.scroller,"mousewheel",function(e){Ge(t,e)});pa(r.scroller,"DOMMouseScroll",function(e){Ge(t,e)});pa(r.wrapper,"scroll",function(){r.wrapper.scrollTop=r.wrapper.scrollLeft=0});pa(r.input,"keyup",function(e){en.call(t,e)});pa(r.input,"input",function(){no&&ro>=9&&t.display.inputHasSelection&&(t.display.inputHasSelection=null);De(t)});pa(r.input,"keydown",pe(t,Qe));pa(r.input,"keypress",pe(t,nn));pa(r.input,"focus",Ti(rn,t));pa(r.input,"blur",Ti(on,t));if(t.options.dragDrop){pa(r.scroller,"dragstart",function(e){Be(t,e)});pa(r.scroller,"dragenter",e);pa(r.scroller,"dragover",e);pa(r.scroller,"drop",pe(t,Ue))}pa(r.scroller,"paste",function(e){if(!Ie(r,e)){t.state.pasteIncoming=!0;Ae(t);_e(t)}});pa(r.input,"paste",function(){if(io&&!t.state.fakedLastChar&&!(new Date-t.state.lastMiddleDown<200)){var e=r.input.selectionStart,n=r.input.selectionEnd;r.input.value+="$";r.input.selectionEnd=n;r.input.selectionStart=e;t.state.fakedLastChar=!0}t.state.pasteIncoming=!0;_e(t)});pa(r.input,"cut",n);pa(r.input,"copy",n);uo&&pa(r.sizer,"mouseup",function(){Ni()==r.input&&r.input.blur();Ae(t)})}function je(t){var e=t.display;if(e.lastWrapHeight!=e.wrapper.clientHeight||e.lastWrapWidth!=e.wrapper.clientWidth){e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null;e.scrollbarsClipped=!1;t.setSize()}}function Ie(t,e){for(var n=li(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function He(t,e,n,r){var i=t.display;if(!n&&"true"==li(e).getAttribute("not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left;a=e.clientY-s.top}catch(e){return null}var l,u=te(t,o,a);if(r&&1==u.xRel&&(l=Rr(t.doc,u.line).text).length==u.ch){var c=Sa(l,l.length,t.options.tabSize)-l.length;u=Co(u.line,Math.max(0,Math.round((o-At(t.display).left)/re(t.display))-c))}return u}function Oe(t){if(!hi(this,t)){var e=this,n=e.display;n.shift=t.shiftKey;if(Ie(n,t)){if(!io){n.scroller.draggable=!1;setTimeout(function(){n.scroller.draggable=!0},100)}}else if(!qe(e,t)){var r=He(e,t);window.focus();switch(ui(t)){case 1:r?Re(e,t,r):li(t)==n.scroller&&fa(t);break;case 2:io&&(e.state.lastMiddleDown=+new Date);r&&at(e.doc,r);setTimeout(Ti(Ae,e),20);fa(t);break;case 3:bo&&an(e,t)}}}}function Re(t,e,n){setTimeout(Ti(Ne,t),0);var r,i=+new Date;if(Mo&&Mo.time>i-400&&0==So(Mo.pos,n))r="triple";else if(ko&&ko.time>i-400&&0==So(ko.pos,n)){r="double";Mo={time:i,pos:n}}else{r="single";ko={time:i,pos:n}}var o,a=t.doc.sel,s=go?e.metaKey:e.ctrlKey;t.options.dragDrop&&Ha&&!Ee(t)&&"single"==r&&(o=a.contains(n))>-1&&!a.ranges[o].empty()?Fe(t,e,n,s):We(t,e,n,r,s)}function Fe(t,e,n,r){var i=t.display,o=pe(t,function(a){io&&(i.scroller.draggable=!1);t.state.draggingText=!1;ga(document,"mouseup",o);ga(i.scroller,"drop",o);if(Math.abs(e.clientX-a.clientX)+Math.abs(e.clientY-a.clientY)<10){fa(a);r||at(t.doc,n);Ae(t);no&&9==ro&&setTimeout(function(){document.body.focus();Ae(t)},20)}});io&&(i.scroller.draggable=!0);t.state.draggingText=o;i.scroller.dragDrop&&i.scroller.dragDrop();pa(document,"mouseup",o);pa(i.scroller,"drop",o)}function We(t,e,n,r,i){function o(e){if(0!=So(m,e)){m=e;if("rect"==r){for(var i=[],o=t.options.tabSize,a=Sa(Rr(u,n.line).text,n.ch,o),s=Sa(Rr(u,e.line).text,e.ch,o),l=Math.min(a,s),d=Math.max(a,s),p=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));g>=p;p++){var v=Rr(u,p).text,y=vi(v,l,o);l==d?i.push(new K(Co(p,y),Co(p,y))):v.length>y&&i.push(new K(Co(p,y),Co(p,vi(v,d,o))))}i.length||i.push(new K(n,n));ht(u,Z(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1});t.scrollIntoView(e)}else{var b=c,w=b.anchor,x=e;if("single"!=r){if("double"==r)var C=t.findWordAt(e);else var C=new K(Co(e.line,0),et(u,Co(e.line+1,0)));if(So(C.anchor,w)>0){x=C.head;w=$(b.from(),C.anchor)}else{x=C.anchor;w=Y(b.to(),C.head)}}var i=h.ranges.slice(0);i[f]=new K(et(u,w),x);ht(u,Z(i,f),xa)}}}function a(e){var n=++y,i=He(t,e,!0,"rect"==r);if(i)if(0!=So(i,m)){Ne(t);o(i);var s=w(l,u);(i.line>=s.to||i.linev.bottom?20:0;c&&setTimeout(pe(t,function(){if(y==n){l.scroller.scrollTop+=c;a(e)}}),50)}}function s(e){y=1/0;fa(e);Ae(t);ga(document,"mousemove",b);ga(document,"mouseup",x);u.history.lastSelOrigin=null}var l=t.display,u=t.doc;fa(e);var c,f,h=u.sel,d=h.ranges;if(i&&!e.shiftKey){f=u.sel.contains(n);c=f>-1?d[f]:new K(n,n)}else c=u.sel.primary();if(e.altKey){r="rect";i||(c=new K(n,n));n=He(t,e,!0,!0);f=-1}else if("double"==r){var p=t.findWordAt(n);c=t.display.shift||u.extend?ot(u,c,p.anchor,p.head):p}else if("triple"==r){var g=new K(Co(n.line,0),et(u,Co(n.line+1,0)));c=t.display.shift||u.extend?ot(u,c,g.anchor,g.head):g}else c=ot(u,c,n);if(i)if(-1==f){f=d.length;ht(u,Z(d.concat([c]),f),{scroll:!1,origin:"*mouse"})}else if(d.length>1&&d[f].empty()&&"single"==r){ht(u,Z(d.slice(0,f).concat(d.slice(f+1)),0));h=u.sel}else lt(u,f,c,xa);else{f=0;ht(u,new J([c],0),xa);h=u.sel}var m=n,v=l.wrapper.getBoundingClientRect(),y=0,b=pe(t,function(t){ui(t)?a(t):s(t)}),x=pe(t,s);pa(document,"mousemove",b);pa(document,"mouseup",x)}function ze(t,e,n,r,i){try{var o=e.clientX,a=e.clientY}catch(e){return!1}if(o>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&fa(e);var s=t.display,l=s.lineDiv.getBoundingClientRect();if(a>l.bottom||!pi(t,n))return si(e);a-=l.top-s.viewOffset;for(var u=0;u=o){var f=Ur(t.doc,a),h=t.options.gutters[u];i(t,n,t,f,h,e);return si(e)}}}function qe(t,e){return ze(t,e,"gutterClick",!0,ci)}function Ue(t){var e=this;if(!hi(e,t)&&!Ie(e.display,t)){fa(t);no&&(No=+new Date);var n=He(e,t,!0),r=t.dataTransfer.files;if(n&&!Ee(e))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(t,r){var s=new FileReader;s.onload=pe(e,function(){o[r]=s.result;if(++a==i){n=et(e.doc,n);var t={from:n,to:n,text:Oa(o.join("\n")),origin:"paste"};dn(e.doc,t);ft(e.doc,Q(n,Oo(t)))}});s.readAsText(t)},l=0;i>l;++l)s(r[l],l);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1){e.state.draggingText(t);setTimeout(Ti(Ae,e),20);return}try{var o=t.dataTransfer.getData("Text");if(o){if(e.state.draggingText&&!(go?t.metaKey:t.ctrlKey))var u=e.listSelections();dt(e.doc,Q(n,n));if(u)for(var l=0;la.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&go&&io)t:for(var s=e.target,l=o.view;s!=a;s=s.parentNode)for(var u=0;uc?f=Math.max(0,f+c-50):h=Math.min(t.doc.height,h+c+50);L(t,{top:f,bottom:h})}if(20>Eo)if(null==o.wheelStartX){o.wheelStartX=a.scrollLeft;o.wheelStartY=a.scrollTop;o.wheelDX=r;o.wheelDY=i;setTimeout(function(){if(null!=o.wheelStartX){var t=a.scrollLeft-o.wheelStartX,e=a.scrollTop-o.wheelStartY,n=e&&o.wheelDY&&e/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null;if(n){Po=(Po*Eo+n)/(Eo+1);++Eo}}},200)}else{o.wheelDX+=r;o.wheelDY+=i}}else{i&&Ve(t,Math.max(0,Math.min(a.scrollTop+i*Po,a.scrollHeight-a.clientHeight)));Xe(t,Math.max(0,Math.min(a.scrollLeft+r*Po,a.scrollWidth-a.clientWidth)));fa(e);o.wheelStartX=null}}}function Ye(t,e,n){if("string"==typeof e){e=Yo[e];if(!e)return!1}t.display.pollingFast&&De(t)&&(t.display.pollingFast=!1);var r=t.display.shift,i=!1;try{Ee(t)&&(t.state.suppressEdits=!0);n&&(t.display.shift=!1);i=e(t)!=ba}finally{t.display.shift=r;t.state.suppressEdits=!1}return i}function $e(t,e,n){for(var r=0;rro&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var r=Ke(e,t);if(so){Ho=r?n:null;!r&&88==n&&!Fa&&(go?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")}18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||tn(e)}}function tn(t){function e(t){if(18==t.keyCode||!t.altKey){Pa(n,"CodeMirror-crosshair");ga(document,"keyup",e);ga(document,"mouseover",e)}}var n=t.display.lineDiv;ja(n,"CodeMirror-crosshair");pa(document,"keyup",e);pa(document,"mouseover",e)}function en(t){16==t.keyCode&&(this.doc.sel.shift=!1);hi(this,t)}function nn(t){var e=this;if(!(hi(e,t)||t.ctrlKey&&!t.altKey||go&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(so&&n==Ho){Ho=null;fa(t)}else if(!(so&&(!t.which||t.which<10)||uo)||!Ke(e,t)){var i=String.fromCharCode(null==r?n:r);if(!Ze(e,t,i)){no&&ro>=9&&(e.display.inputHasSelection=null);_e(e)}}}}function rn(t){if("nocursor"!=t.options.readOnly){if(!t.state.focused){ma(t,"focus",t);t.state.focused=!0;ja(t.display.wrapper,"CodeMirror-focused");if(!t.curOp&&t.display.selForContextMenu!=t.doc.sel){Le(t);io&&setTimeout(Ti(Le,t,!0),0)}}Me(t);St(t)}}function on(t){if(t.state.focused){ma(t,"blur",t);t.state.focused=!1;Pa(t.display.wrapper,"CodeMirror-focused")}clearInterval(t.display.blinker);setTimeout(function(){t.state.focused||(t.display.shift=!1)},150)}function an(t,e){function n(){if(null!=i.input.selectionStart){var e=t.somethingSelected(),n=i.input.value="​"+(e?i.input.value:"");i.prevInput=e?"":"​";i.input.selectionStart=1;i.input.selectionEnd=n.length;i.selForContextMenu=t.doc.sel}}function r(){i.contextMenuPending=!1;i.inputDiv.style.position="relative";i.input.style.cssText=l;no&&9>ro&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a);Me(t);if(null!=i.input.selectionStart){(!no||no&&9>ro)&&n();var e=0,r=function(){i.selForContextMenu==t.doc.sel&&0==i.input.selectionStart?pe(t,Yo.selectAll)(t):e++<10?i.detectingSelectAll=setTimeout(r,500):Le(t)};i.detectingSelectAll=setTimeout(r,200)}}if(!hi(t,e,"contextmenu")){var i=t.display;if(!Ie(i,e)&&!sn(t,e)){var o=He(t,e),a=i.scroller.scrollTop;if(o&&!so){var s=t.options.resetSelectionOnContextMenu;s&&-1==t.doc.sel.contains(o)&&pe(t,ht)(t.doc,Q(o),wa);var l=i.input.style.cssText;i.inputDiv.style.position="absolute";i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(no?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(io)var u=window.scrollY;Ae(t);io&&window.scrollTo(null,u);Le(t);t.somethingSelected()||(i.input.value=i.prevInput=" ");i.contextMenuPending=!0;i.selForContextMenu=t.doc.sel;clearTimeout(i.detectingSelectAll);no&&ro>=9&&n();if(bo){da(e);var c=function(){ga(window,"mouseup",c);setTimeout(r,20)};pa(window,"mouseup",c)}else setTimeout(r,50)}}}}function sn(t,e){return pi(t,"gutterContextMenu")?ze(t,e,"gutterContextMenu",!1,ma):!1}function ln(t,e){if(So(t,e.from)<0)return t;if(So(t,e.to)<=0)return Oo(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;t.line==e.to.line&&(r+=Oo(e).ch-e.to.ch);return Co(n,r)}function un(t,e){for(var n=[],r=0;r=0;--i)pn(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text});else pn(t,e)}function pn(t,e){if(1!=e.text.length||""!=e.text[0]||0!=So(e.from,e.to)){var n=un(t,e);Jr(t,e,n,t.cm?t.cm.curOp.id:0/0);vn(t,e,n,Xn(t,e));var r=[];Hr(t,function(t,n){if(!n&&-1==wi(r,t.history)){ai(t.history,e);r.push(t.history)}vn(t,e,null,Xn(t,e))})}}function gn(t,e,n){if(!t.cm||!t.cm.state.suppressEdits){for(var r,i=t.history,o=t.sel,a="undo"==e?i.done:i.undone,s="undo"==e?i.undone:i.done,l=0;l=0;--l){var f=r.changes[l];f.origin=e;if(c&&!hn(t,f,!1)){a.length=0;return}u.push(Gr(t,f));var h=l?un(t,f):bi(a);vn(t,f,h,Yn(t,f));!l&&t.cm&&t.cm.scrollIntoView({from:f.from,to:Oo(f)});var d=[];Hr(t,function(t,e){if(!e&&-1==wi(d,t.history)){ai(t.history,f);d.push(t.history)}vn(t,f,null,Yn(t,f))})}}}}function mn(t,e){if(0!=e){t.first+=e;t.sel=new J(xi(t.sel.ranges,function(t){return new K(Co(t.anchor.line+e,t.anchor.ch),Co(t.head.line+e,t.head.ch))}),t.sel.primIndex);if(t.cm){be(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.lineo&&(e={from:e.from,to:Co(o,Rr(t,o).text.length),text:[e.text[0]],origin:e.origin});e.removed=Fr(t,e.from,e.to);n||(n=un(t,e));t.cm?yn(t.cm,e,r):Pr(t,e,r);dt(t,n,wa)}}function yn(t,e,n){var r=t.doc,i=t.display,a=e.from,s=e.to,l=!1,u=a.line;if(!t.options.lineWrapping){u=qr(or(Rr(r,a.line)));r.iter(u,s.line+1,function(t){if(t==i.maxLine){l=!0;return!0}})}r.sel.contains(e.from,e.to)>-1&&di(t);Pr(r,e,n,o(t));if(!t.options.lineWrapping){r.iter(u,a.line+e.text.length,function(t){var e=f(t);if(e>i.maxLineLength){i.maxLine=t;i.maxLineLength=e;i.maxLineChanged=!0;l=!1}});l&&(t.curOp.updateMaxLine=!0)}r.frontier=Math.min(r.frontier,a.line);Tt(t,400);var c=e.text.length-(s.line-a.line)-1;e.full?be(t):a.line!=s.line||1!=e.text.length||Er(t.doc,e)?be(t,a.line,s.line+1,c):we(t,a.line,"text");var h=pi(t,"changes"),d=pi(t,"change");if(d||h){var p={from:a,to:s,text:e.text,removed:e.removed,origin:e.origin};d&&ci(t,"change",t,p);h&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(p)}t.display.selForContextMenu=null}function bn(t,e,n,r,i){r||(r=n);if(So(r,n)<0){var o=r;r=n;n=o}"string"==typeof e&&(e=Oa(e));dn(t,{from:n,to:r,text:e,origin:i})}function wn(t,e){if(!hi(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1);if(null!=i&&!fo){var o=Di("div","​",null,"position: absolute; top: "+(e.top-n.viewOffset-Dt(t.display))+"px; height: "+(e.bottom-e.top+Nt(t)+n.barHeight)+"px; left: "+e.left+"px; width: 2px;");t.display.lineSpace.appendChild(o);o.scrollIntoView(i);t.display.lineSpace.removeChild(o)}}}function xn(t,e,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=Kt(t,e),s=n&&n!=e?Kt(t,n):a,l=Sn(t,Math.min(a.left,s.left),Math.min(a.top,s.top)-r,Math.max(a.left,s.left),Math.max(a.bottom,s.bottom)+r),u=t.doc.scrollTop,c=t.doc.scrollLeft;if(null!=l.scrollTop){Ve(t,l.scrollTop);Math.abs(t.doc.scrollTop-u)>1&&(o=!0)}if(null!=l.scrollLeft){Xe(t,l.scrollLeft);Math.abs(t.doc.scrollLeft-c)>1&&(o=!0)}if(!o)break}return a}function Cn(t,e,n,r,i){var o=Sn(t,e,n,r,i);null!=o.scrollTop&&Ve(t,o.scrollTop);null!=o.scrollLeft&&Xe(t,o.scrollLeft)}function Sn(t,e,n,r,i){var o=t.display,a=ne(t.display);0>n&&(n=0);var s=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:o.scroller.scrollTop,l=Pt(t),u={};i-n>l&&(i=n+l);var c=t.doc.height+Lt(o),f=a>n,h=i>c-a;if(s>n)u.scrollTop=f?0:n;else if(i>s+l){var d=Math.min(n,(h?c:i)-l);d!=s&&(u.scrollTop=d)}var p=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:o.scroller.scrollLeft,g=Et(t)-(t.options.fixedGutter?o.gutters.offsetWidth:0),m=r-e>g;m&&(r=e+g);10>e?u.scrollLeft=0:p>e?u.scrollLeft=Math.max(0,e-(m?0:10)):r>g+p-3&&(u.scrollLeft=r+(m?0:10)-g);return u}function Tn(t,e,n){(null!=e||null!=n)&&Mn(t);null!=e&&(t.curOp.scrollLeft=(null==t.curOp.scrollLeft?t.doc.scrollLeft:t.curOp.scrollLeft)+e);null!=n&&(t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+n)}function kn(t){Mn(t);var e=t.getCursor(),n=e,r=e;if(!t.options.lineWrapping){n=e.ch?Co(e.line,e.ch-1):e;r=Co(e.line,e.ch+1)}t.curOp.scrollToPos={from:n,to:r,margin:t.options.cursorScrollMargin,isCursor:!0}}function Mn(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=Zt(t,e.from),r=Zt(t,e.to),i=Sn(t,Math.min(n.left,r.left),Math.min(n.top,r.top)-e.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+e.margin);t.scrollTo(i.scrollLeft,i.scrollTop)}}function _n(t,e,n,r){var i,o=t.doc;null==n&&(n="add");"smart"==n&&(o.mode.indent?i=_t(t,e):n="prev");var a=t.options.tabSize,s=Rr(o,e),l=Sa(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n){u=o.mode.indent(i,s.text.slice(c.length),s.text);if(u==ba||u>150){if(!r)return;n="prev"}}}else{u=0;n="not"}"prev"==n?u=e>o.first?Sa(Rr(o,e-1).text,null,a):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n);u=Math.max(0,u);var f="",h=0;if(t.options.indentWithTabs)for(var d=Math.floor(u/a);d;--d){h+=a;f+=" "}u>h&&(f+=yi(u-h));if(f!=c)bn(o,f,Co(e,0),Co(e,c.length),"+input");else for(var d=0;d=0;e--)bn(t.doc,"",r[e].from,r[e].to,"+delete");kn(t)})}function An(t,e,n,r,i){function o(){var e=s+n;if(e=t.first+t.size)return f=!1;s=e;return c=Rr(t,e)}function a(t){var e=(i?Ki:Zi)(c,l,n,!0);if(null==e){if(t||!o())return f=!1;l=i?(0>n?Bi:Ui)(c):0>n?c.text.length:0}else l=e;return!0}var s=e.line,l=e.ch,u=n,c=Rr(t,s),f=!0;if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var h=null,d="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),g=!0;!(0>n)||a(!g);g=!1){var m=c.text.charAt(l)||"\n",v=ki(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";!d||g||v||(v="s");if(h&&h!=v){if(0>n){n=1;a()}break}v&&(h=v);if(n>0&&!a(!g))break}var y=vt(t,Co(s,l),u,!0);f||(y.hitSide=!0);return y}function Nn(t,e,n,r){var i,o=t.doc,a=e.left;if("page"==r){var s=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=e.top+n*(s-(0>n?1.5:.5)*ne(t.display))}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;;){var l=te(t,a,i);if(!l.outside)break;if(0>n?0>=i:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}function En(e,n,r,i){t.defaults[e]=n;r&&(Fo[e]=i?function(t,e,n){n!=Wo&&r(t,e,n)}:r)}function Pn(t){for(var e,n,r,i,o=t.split(/-(?!$)/),t=o[o.length-1],a=0;a0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith){o.collapsed=!0;o.widgetNode=Di("span",[o.replacedWith],"CodeMirror-widget");r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true");r.insertLeft&&(o.widgetNode.insertLeft=!0)}if(o.collapsed){if(ir(t,e.line,e,n,o)||e.line!=n.line&&ir(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");xo=!0}o.addToHistory&&Jr(t,{from:e,to:n,origin:"markText"},t.sel,0/0);var s,l=e.line,u=t.cm;t.iter(l,n.line+1,function(t){u&&o.collapsed&&!u.options.lineWrapping&&or(t)==u.display.maxLine&&(s=!0);o.collapsed&&l!=e.line&&zr(t,0);Un(t,new Wn(o,l==e.line?e.ch:null,l==n.line?n.ch:null));++l});o.collapsed&&t.iter(e.line,n.line+1,function(e){ur(t,e)&&zr(e,0)});o.clearOnEnter&&pa(o,"beforeCursorEnter",function(){o.clear()});if(o.readOnly){wo=!0;(t.history.done.length||t.history.undone.length)&&t.clearHistory()}if(o.collapsed){o.id=++ea;o.atomic=!0}if(u){s&&(u.curOp.updateMaxLine=!0);if(o.collapsed)be(u,e.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=e.line;c<=n.line;c++)we(u,c,"text");o.atomic&>(u.doc);ci(u,"markerAdded",u,o)}return o}function Hn(t,e,n,r,i){r=Si(r);r.shared=!1;var o=[In(t,e,n,r,i)],a=o[0],s=r.widgetNode;Hr(t,function(t){s&&(r.widgetNode=s.cloneNode(!0));o.push(In(t,et(t,e),et(t,n),r,i));for(var l=0;l=e:o.to>e);(r||(r=[])).push(new Wn(a,o.from,l?null:o.to))}}return r}function Vn(t,e,n){if(t)for(var r,i=0;i=e:o.to>e);if(s||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){ var l=null==o.from||(a.inclusiveLeft?o.from<=e:o.from0&&s)for(var f=0;ff;++f)p.push(g);p.push(l)}return p}function Gn(t){for(var e=0;e0)){var c=[l,1],f=So(u.from,s.from),h=So(u.to,s.to);(0>f||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from});(h>0||!a.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to});i.splice.apply(i,c);l+=c.length-1}}return i}function Jn(t){var e=t.markedSpans;if(e){for(var n=0;n=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(So(u.to,n)>0||l.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(So(u.from,r)<0||l.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function or(t){for(var e;e=nr(t);)t=e.find(-1,!0).line;return t}function ar(t){for(var e,n;e=rr(t);){t=e.find(1,!0).line;(n||(n=[])).push(t)}return n}function sr(t,e){var n=Rr(t,e),r=or(n);return n==r?e:qr(r)}function lr(t,e){if(e>t.lastLine())return e;var n,r=Rr(t,e);if(!ur(t,r))return e;for(;n=rr(r);)r=n.find(1,!0).line;return qr(r)+1}function ur(t,e){var n=xo&&e.markedSpans;if(n)for(var r,i=0;io;o++){i&&(i[0]=t.innerMode(e,r).mode);var a=e.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}function br(t,e,n,r){function i(t){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:t?Xo(a.mode,c):c}}var o,a=t.doc,s=a.mode;e=et(a,e);var l,u=Rr(a,e.line),c=_t(t,e.line,n),f=new Qo(u.text,t.options.tabSize);r&&(l=[]);for(;(r||f.post.options.maxHighlightLength){s=!1;a&&Sr(t,e,r,f.pos);f.pos=e.length;l=null}else l=mr(yr(n,f,r,h),o);if(h){var d=h[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;uu;){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r);l+=2;u=Math.min(t,r)}if(e)if(s.opaque){i.splice(n,l-n,t,"cm-overlay "+e);l=n+2}else for(;l>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+e}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Cr(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=xr(t,e,e.stateAfter=_t(t,qr(e)));e.styles=r.styles;r.classes?e.styleClasses=r.classes:e.styleClasses&&(e.styleClasses=null);n===t.doc.frontier&&t.doc.frontier++}return e.styles}function Sr(t,e,n,r){var i=t.doc.mode,o=new Qo(e,t.options.tabSize);o.start=o.pos=r||0;""==e&&vr(i,n);for(;!o.eol()&&o.pos<=t.options.maxHighlightLength;){yr(i,o,n);o.start=o.pos}}function Tr(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?aa:oa;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function kr(t,e){var n=Di("span",null,null,io?"padding-right: .1px":null),r={pre:Di("pre",[n]),content:n,col:0,pos:0,cm:t};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o,a=i?e.rest[i-1]:e.line;r.pos=0;r.addToken=_r;(no||io)&&t.getOption("lineWrapping")&&(r.addToken=Dr(r.addToken));Ri(t.display.measure)&&(o=Vr(a))&&(r.addToken=Lr(r.addToken,o));r.map=[];var s=e!=t.display.externalMeasured&&qr(a);Nr(a,r,Cr(t,a,s));if(a.styleClasses){a.styleClasses.bgClass&&(r.bgClass=Pi(a.styleClasses.bgClass,r.bgClass||""));a.styleClasses.textClass&&(r.textClass=Pi(a.styleClasses.textClass,r.textClass||""))}0==r.map.length&&r.map.push(0,0,r.content.appendChild(Oi(t.display.measure)));if(0==i){e.measure.map=r.map;e.measure.cache={}}else{(e.measure.maps||(e.measure.maps=[])).push(r.map);(e.measure.caches||(e.measure.caches=[])).push({})}}io&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack");ma(t,"renderLine",t,e.line,r.pre);r.pre.className&&(r.textClass=Pi(r.pre.className,r.textClass||""));return r}function Mr(t){var e=Di("span","•","cm-invalidchar");e.title="\\u"+t.charCodeAt(0).toString(16);e.setAttribute("aria-label",e.title);return e}function _r(t,e,n,r,i,o,a){if(e){var s=t.cm.options.specialChars,l=!1;if(s.test(e))for(var u=document.createDocumentFragment(),c=0;;){s.lastIndex=c;var f=s.exec(e),h=f?f.index-c:e.length-c;if(h){var d=document.createTextNode(e.slice(c,c+h));u.appendChild(no&&9>ro?Di("span",[d]):d);t.map.push(t.pos,t.pos+h,d);t.col+=h;t.pos+=h}if(!f)break;c+=h+1;if(" "==f[0]){var p=t.cm.options.tabSize,g=p-t.col%p,d=u.appendChild(Di("span",yi(g),"cm-tab"));d.setAttribute("role","presentation");t.col+=g}else{var d=t.cm.options.specialCharPlaceholder(f[0]);u.appendChild(no&&9>ro?Di("span",[d]):d);t.col+=1}t.map.push(t.pos,t.pos+1,d);t.pos++}else{t.col+=e.length;var u=document.createTextNode(e);t.map.push(t.pos,t.pos+e.length,u);no&&9>ro&&(l=!0);t.pos+=e.length}if(n||r||i||l||a){var m=n||"";r&&(m+=r);i&&(m+=i);var v=Di("span",[u],m,a);o&&(v.title=o);return t.content.appendChild(v)}t.content.appendChild(u)}}function Dr(t){function e(t){for(var e=" ",n=0;nl&&f.from<=l)break}if(f.to>=u)return t(n,r,i,o,a,s);t(n,r.slice(0,f.to-l),i,o,null,s);o=null;r=r.slice(f.to-l);l=f.to}}}function Ar(t,e,n,r){var i=!r&&n.widgetNode;if(i){t.map.push(t.pos,t.pos+e,i);t.content.appendChild(i)}t.pos+=e}function Nr(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,u,c,f,h,d=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=f=s="";h=null;v=1/0;for(var y=[],b=0;bp)){if(null!=w.to&&v>w.to){v=w.to;u=""}x.className&&(l+=" "+x.className);x.css&&(s=x.css);x.startStyle&&w.from==p&&(c+=" "+x.startStyle);x.endStyle&&w.to==v&&(u+=" "+x.endStyle);x.title&&!f&&(f=x.title);x.collapsed&&(!h||tr(h.marker,x)<0)&&(h=w)}else w.from>p&&v>w.from&&(v=w.from);"bookmark"==x.type&&w.from==p&&x.widgetNode&&y.push(x)}if(h&&(h.from||0)==p){Ar(e,(null==h.to?d+1:h.to)-p,h.marker,null==h.from);if(null==h.to)return}if(!h&&y.length)for(var b=0;b=d)break;for(var C=Math.min(d,v);;){if(m){var S=p+m.length;if(!h){var T=S>C?m.slice(0,C-p):m;e.addToken(e,T,a?a+l:l,c,p+T.length==v?u:"",f,s)}if(S>=C){m=m.slice(C-p);p=C;break}p=S;c=""}m=i.slice(o,o=n[g++]);a=Tr(n[g++],e.cm.options)}}else for(var g=1;gn;++n)o.push(new ia(u[n],i(n),r));return o}var s=e.from,l=e.to,u=e.text,c=Rr(t,s.line),f=Rr(t,l.line),h=bi(u),d=i(u.length-1),p=l.line-s.line;if(e.full){t.insert(0,a(0,u.length));t.remove(u.length,t.size-u.length)}else if(Er(t,e)){var g=a(0,u.length-1);o(f,f.text,d);p&&t.remove(s.line,p);g.length&&t.insert(s.line,g)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(l.ch),d);else{var g=a(1,u.length-1);g.push(new ia(h+c.text.slice(l.ch),d,r));o(c,c.text.slice(0,s.ch)+u[0],i(0));t.insert(s.line+1,g)}else if(1==u.length){o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(l.ch),i(0));t.remove(s.line+1,p)}else{o(c,c.text.slice(0,s.ch)+u[0],i(0));o(f,h+f.text.slice(l.ch),d);var g=a(1,u.length-1);p>1&&t.remove(s.line+1,p-1);t.insert(s.line+1,g)}ci(t,"change",t,e)}function jr(t){this.lines=t;this.parent=null;for(var e=0,n=0;ee||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>e){n=i;break}e-=o}return n.lines[e]}function Fr(t,e,n){var r=[],i=e.line;t.iter(e.line,n.line+1,function(t){var o=t.text;i==n.line&&(o=o.slice(0,n.ch));i==e.line&&(o=o.slice(e.ch));r.push(o);++i});return r}function Wr(t,e,n){var r=[];t.iter(e,n,function(t){r.push(t.text)});return r}function zr(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function qr(t){if(null==t.parent)return null;for(var e=t.parent,n=wi(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function Ur(t,e){var n=t.first;t:do{for(var r=0;re){t=i;continue t}e-=o;n+=i.chunkSize()}return n}while(!t.lines);for(var r=0;re)break;e-=s}return n+r}function Br(t){t=or(t);for(var e=0,n=t.parent,r=0;r1&&!t.done[t.done.length-2].ranges){t.done.pop();return bi(t.done)}}function Jr(t,e,n,r){var i=t.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&t.cm&&i.lastModTime>a-t.cm.options.historyEventDelay||"*"==e.origin.charAt(0)))&&(o=$r(i,i.lastOp==r))){var s=bi(o.changes);0==So(e.from,e.to)&&0==So(e.from,s.to)?s.to=Oo(e):o.changes.push(Gr(t,e))}else{var l=bi(i.done);l&&l.ranges||Qr(t.sel,i.done);o={changes:[Gr(t,e)],generation:i.generation};i.done.push(o);for(;i.done.length>i.undoDepth;){i.done.shift();i.done[0].ranges||i.done.shift()}}i.done.push(n);i.generation=++i.maxGeneration;i.lastModTime=i.lastSelTime=a;i.lastOp=i.lastSelOp=r;i.lastOrigin=i.lastSelOrigin=e.origin;s||ma(t,"historyAdded")}function Kr(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Zr(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Kr(t,o,bi(i.done),e))?i.done[i.done.length-1]=e:Qr(e,i.done);i.lastSelTime=+new Date;i.lastSelOrigin=o;i.lastSelOp=n;r&&r.clearRedo!==!1&&Yr(i.undone)}function Qr(t,e){var n=bi(e);n&&n.ranges&&n.equals(t)||e.push(t)}function ti(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans);++o})}function ei(t){if(!t)return null;for(var e,n=0;n-1){bi(s)[f]=c[f];delete c[f]}}}}return i}function ii(t,e,n,r){if(n0}function gi(t){t.prototype.on=function(t,e){pa(this,t,e)};t.prototype.off=function(t,e){ga(this,t,e)}}function mi(){this.id=null}function vi(t,e,n){for(var r=0,i=0;;){var o=t.indexOf(" ",r);-1==o&&(o=t.length);var a=o-r;if(o==t.length||i+a>=e)return r+Math.min(a,e-i);i+=o-r;i+=n-i%n;r=o+1;if(i>=e)return r}}function yi(t){for(;Ta.length<=t;)Ta.push(bi(Ta)+" ");return Ta[t]}function bi(t){return t[t.length-1]}function wi(t,e){for(var n=0;n-1&&Da(t)?!0:e.test(t):Da(t)}function Mi(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}function _i(t){return t.charCodeAt(0)>=768&&La.test(t)}function Di(t,e,n,r){var i=document.createElement(t);n&&(i.className=n);r&&(i.style.cssText=r);if("string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o0;--e)t.removeChild(t.firstChild);return t}function Ai(t,e){return Li(t).appendChild(e)}function Ni(){return document.activeElement}function Ei(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}function Pi(t,e){for(var n=t.split(" "),r=0;r2&&!(no&&8>ro))}return Na?Di("span","​"):Di("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function Ri(t){if(null!=Ea)return Ea;var e=Ai(t,document.createTextNode("AخA")),n=Ma(e,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Ma(e,1,2).getBoundingClientRect();return Ea=r.right-n.right<3}function Fi(t){if(null!=Wa)return Wa;var e=Ai(t,Di("span","x")),n=e.getBoundingClientRect(),r=Ma(e,0,1).getBoundingClientRect();return Wa=Math.abs(n.left-r.left)>1}function Wi(t,e,n,r){if(!t)return r(e,n,"ltr");for(var i=!1,o=0;oe||e==n&&a.to==e){r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr");i=!0}}i||r(e,n,"ltr")}function zi(t){return t.level%2?t.to:t.from}function qi(t){return t.level%2?t.from:t.to}function Ui(t){var e=Vr(t);return e?zi(e[0]):0}function Bi(t){var e=Vr(t);return e?qi(bi(e)):t.text.length}function Vi(t,e){var n=Rr(t.doc,e),r=or(n);r!=n&&(e=qr(r));var i=Vr(r),o=i?i[0].level%2?Bi(r):Ui(r):0;return Co(e,o)}function Xi(t,e){for(var n,r=Rr(t.doc,e);n=rr(r);){r=n.find(1,!0).line;e=null}var i=Vr(r),o=i?i[0].level%2?Ui(r):Bi(r):r.text.length;return Co(null==e?qr(r):e,o)}function Gi(t,e){var n=Vi(t,e.line),r=Rr(t.doc,n.line),i=Vr(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return Co(n.line,a?0:o)}return n}function Yi(t,e,n){var r=t[0].level;return e==r?!0:n==r?!1:n>e}function $i(t,e){qa=null;for(var n,r=0;re)return r;if(i.from==e||i.to==e){if(null!=n){if(Yi(t,i.level,t[n].level)){i.from!=i.to&&(qa=n);return r}i.from!=i.to&&(qa=r);return n}n=r}}return n}function Ji(t,e,n,r){if(!r)return e+n;do e+=n;while(e>0&&_i(t.text.charAt(e)));return e}function Ki(t,e,n,r){var i=Vr(t);if(!i)return Zi(t,e,n,r);for(var o=$i(i,e),a=i[o],s=Ji(t,e,a.level%2?-n:n,r);;){if(s>a.from&&s0==a.level%2?a.to:a.from}a=i[o+=n];if(!a)return null;s=n>0==a.level%2?Ji(t,a.to,-1,r):Ji(t,a.from,1,r)}}function Zi(t,e,n,r){var i=e+n;if(r)for(;i>0&&_i(t.text.charAt(i));)i+=n;return 0>i||i>t.text.length?null:i}var Qi=/gecko\/\d/i.test(navigator.userAgent),to=/MSIE \d/.test(navigator.userAgent),eo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),no=to||eo,ro=no&&(to?document.documentMode||6:eo[1]),io=/WebKit\//.test(navigator.userAgent),oo=io&&/Qt\/\d+\.\d+/.test(navigator.userAgent),ao=/Chrome\//.test(navigator.userAgent),so=/Opera\//.test(navigator.userAgent),lo=/Apple Computer/.test(navigator.vendor),uo=/KHTML\//.test(navigator.userAgent),co=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),fo=/PhantomJS/.test(navigator.userAgent),ho=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),po=ho||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),go=ho||/Mac/.test(navigator.platform),mo=/win/i.test(navigator.platform),vo=so&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);vo&&(vo=Number(vo[1]));if(vo&&vo>=15){so=!1;io=!0}var yo=go&&(oo||so&&(null==vo||12.11>vo)),bo=Qi||no&&ro>=9,wo=!1,xo=!1;g.prototype=Si({update:function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block";this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(e){this.horiz.style.display="block";this.horiz.style.right=n?r+"px":"0";this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=t.scrollWidth-t.clientWidth+o+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&t.clientHeight>0){0==r&&this.overlayHack();this.checkedOverlay=!0}return{right:n?r:0,bottom:e?r:0}},setScrollLeft:function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t)},setScrollTop:function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t)},overlayHack:function(){var t=go&&!co?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=t;var e=this,n=function(t){li(t)!=e.vert&&li(t)!=e.horiz&&pe(e.cm,Oe)(t)};pa(this.vert,"mousedown",n);pa(this.horiz,"mousedown",n)},clear:function(){var t=this.horiz.parentNode;t.removeChild(this.horiz);t.removeChild(this.vert)}},g.prototype);m.prototype=Si({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},m.prototype);t.scrollbarModel={"native":g,"null":m};k.prototype.signal=function(t,e){pi(t,e)&&this.events.push(arguments)};k.prototype.finish=function(){for(var t=0;t=0&&So(t,r.to())<=0)return n}return-1}};K.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return Y(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var To,ko,Mo,_o={left:0,right:0,top:0,bottom:0},Do=null,Lo=0,Ao=null,No=0,Eo=0,Po=null;no?Po=-.53:Qi?Po=15:ao?Po=-.7:lo&&(Po=-1/3);var jo=function(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail);null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta);return{x:e,y:n}};t.wheelEventPixels=function(t){var e=jo(t);e.x*=Po;e.y*=Po;return e};var Io=new mi,Ho=null,Oo=t.changeEnd=function(t){return t.text?Co(t.from.line+t.text.length-1,bi(t.text).length+(1==t.text.length?t.from.ch:0)):t.to};t.prototype={constructor:t,focus:function(){window.focus();Ae(this);_e(this)},setOption:function(t,e){var n=this.options,r=n[t];if(n[t]!=e||"mode"==t){n[t]=e;Fo.hasOwnProperty(t)&&pe(this,Fo[t])(this,e,r)}},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](jn(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;nn){_n(this,i.head.line,t,!0);n=i.head.line;r==this.doc.sel.primIndex&&kn(this)}}else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;n>l;++l)_n(this,l,t);var u=this.doc.sel.ranges;0==o.ch&&e.length==u.length&&u[r].from().ch>0&<(this.doc,r,new K(o,u[r].to()),wa)}}}),getTokenAt:function(t,e){return br(this,t,e)},getLineTokens:function(t,e){return br(this,Co(t),e,!0)},getTokenTypeAt:function(t){t=et(this.doc,t);var e,n=Cr(this,Rr(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]s?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var n=[];if(!Vo.hasOwnProperty(e))return Vo;var r=Vo[e],i=this.getModeAt(t);if("string"==typeof i[e])r[i[e]]&&n.push(r[i[e]]);else if(i[e])for(var o=0;or){t=r;n=!0}var i=Rr(this.doc,t);return Yt(this,i,{top:0,left:0},e||"page").top+(n?this.doc.height-Br(i):0)},defaultTextHeight:function(){return ne(this.display)},defaultCharWidth:function(){return re(this.display)},setGutterMarker:ge(function(t,e,n){return Dn(this.doc,t,"gutter",function(t){var r=t.gutterMarkers||(t.gutterMarkers={});r[e]=n;!n&&Mi(r)&&(t.gutterMarkers=null);return!0})}),clearGutter:ge(function(t){var e=this,n=e.doc,r=n.first;n.iter(function(n){if(n.gutterMarkers&&n.gutterMarkers[t]){n.gutterMarkers[t]=null;we(e,r,"gutter");Mi(n.gutterMarkers)&&(n.gutterMarkers=null)}++r})}),addLineWidget:ge(function(t,e,n){return dr(this,t,e,n)}),removeLineWidget:function(t){t.clear()},lineInfo:function(t){if("number"==typeof t){if(!rt(this.doc,t))return null;var e=t;t=Rr(this.doc,t);if(!t)return null}else{var e=qr(t);if(null==e)return null}return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display;t=Kt(this,et(this.doc,t));var a=t.bottom,s=t.left;e.style.position="absolute";e.setAttribute("cm-ignore-events","true");o.sizer.appendChild(e);if("over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom);s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px";e.style.left=e.style.right="";if("right"==i){s=o.sizer.clientWidth-e.offsetWidth;e.style.right="0px"; }else{"left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2);e.style.left=s+"px"}n&&Cn(this,s,a,s+e.offsetWidth,a+e.offsetHeight)},triggerOnKeyDown:ge(Qe),triggerOnKeyPress:ge(nn),triggerOnKeyUp:en,execCommand:function(t){return Yo.hasOwnProperty(t)?Yo[t](this):void 0},findPosH:function(t,e,n,r){var i=1;if(0>e){i=-1;e=-e}for(var o=0,a=et(this.doc,t);e>o;++o){a=An(this.doc,a,i,n,r);if(a.hitSide)break}return a},moveH:ge(function(t,e){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?An(n.doc,r.head,t,e,n.options.rtlMoveVisually):0>t?r.from():r.to()},Ca)}),deleteH:ge(function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ln(this,function(n){var i=An(r,n.head,t,e,!1);return 0>t?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(t,e,n,r){var i=1,o=r;if(0>e){i=-1;e=-e}for(var a=0,s=et(this.doc,t);e>a;++a){var l=Kt(this,s,"div");null==o?o=l.left:l.left=o;s=Nn(this,l,i,n);if(s.hitSide)break}return s},moveV:ge(function(t,e){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();r.extendSelectionsBy(function(a){if(o)return 0>t?a.from():a.to();var s=Kt(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn);i.push(s.left);var l=Nn(n,s,t,e);"page"==e&&a==r.sel.primary()&&Tn(n,null,Jt(n,l,"div").top-s.top);return l},Ca);if(i.length)for(var a=0;a0&&s(n.charAt(r-1));)--r;for(;i.5)&&a(this);ma(this,"refresh",this)}),swapDoc:ge(function(t){var e=this.doc;e.cm=null;Or(this,t);Vt(this);Le(this);this.scrollTo(t.scrollLeft,t.scrollTop);this.curOp.forceScroll=!0;ci(this,"swapDoc",this,e);return e}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};gi(t);var Ro=t.defaults={},Fo=t.optionHandlers={},Wo=t.Init={toString:function(){return"CodeMirror.Init"}};En("value","",function(t,e){t.setValue(e)},!0);En("mode",null,function(t,e){t.doc.modeOption=e;n(t)},!0);En("indentUnit",2,n,!0);En("indentWithTabs",!1);En("smartIndent",!0);En("tabSize",4,function(t){r(t);Vt(t);be(t)},!0);En("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e){t.options.specialChars=new RegExp(e.source+(e.test(" ")?"":"| "),"g");t.refresh()},!0);En("specialCharPlaceholder",Mr,function(t){t.refresh()},!0);En("electricChars",!0);En("rtlMoveVisually",!mo);En("wholeLineUpdateBefore",!0);En("theme","default",function(t){s(t);l(t)},!0);En("keyMap","default",function(e,n,r){var i=jn(n),o=r!=t.Init&&jn(r);o&&o.detach&&o.detach(e,i);i.attach&&i.attach(e,o||null)});En("extraKeys",null);En("lineWrapping",!1,i,!0);En("gutters",[],function(t){d(t.options);l(t)},!0);En("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?T(t.display)+"px":"0";t.refresh()},!0);En("coverGutterNextToScrollbar",!1,function(t){y(t)},!0);En("scrollbarStyle","native",function(t){v(t);y(t);t.display.scrollbars.setScrollTop(t.doc.scrollTop);t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0);En("lineNumbers",!1,function(t){d(t.options);l(t)},!0);En("firstLineNumber",1,l,!0);En("lineNumberFormatter",function(t){return t},l,!0);En("showCursorWhenSelecting",!1,wt,!0);En("resetSelectionOnContextMenu",!0);En("readOnly",!1,function(t,e){if("nocursor"==e){on(t);t.display.input.blur();t.display.disabled=!0}else{t.display.disabled=!1;e||Le(t)}});En("disableInput",!1,function(t,e){e||Le(t)},!0);En("dragDrop",!0);En("cursorBlinkRate",530);En("cursorScrollMargin",0);En("cursorHeight",1,wt,!0);En("singleCursorHeightPerLine",!0,wt,!0);En("workTime",100);En("workDelay",100);En("flattenSpans",!0,r,!0);En("addModeClass",!1,r,!0);En("pollInterval",100);En("undoDepth",200,function(t,e){t.doc.history.undoDepth=e});En("historyEventDelay",1250);En("viewportMargin",10,function(t){t.refresh()},!0);En("maxHighlightLength",1e4,r,!0);En("moveInputWithCursor",!0,function(t,e){e||(t.display.inputDiv.style.top=t.display.inputDiv.style.left=0)});En("tabindex",null,function(t,e){t.display.input.tabIndex=e||""});En("autofocus",null);var zo=t.modes={},qo=t.mimeModes={};t.defineMode=function(e,n){t.defaults.mode||"null"==e||(t.defaults.mode=e);arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2));zo[e]=n};t.defineMIME=function(t,e){qo[t]=e};t.resolveMode=function(e){if("string"==typeof e&&qo.hasOwnProperty(e))e=qo[e];else if(e&&"string"==typeof e.name&&qo.hasOwnProperty(e.name)){var n=qo[e.name];"string"==typeof n&&(n={name:n});e=Ci(n,e);e.name=n.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return t.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}};t.getMode=function(e,n){var n=t.resolveMode(n),r=zo[n.name];if(!r)return t.getMode(e,"text/plain");var i=r(e,n);if(Uo.hasOwnProperty(n.name)){var o=Uo[n.name];for(var a in o)if(o.hasOwnProperty(a)){i.hasOwnProperty(a)&&(i["_"+a]=i[a]);i[a]=o[a]}}i.name=n.name;n.helperType&&(i.helperType=n.helperType);if(n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i};t.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}});t.defineMIME("text/plain","null");var Uo=t.modeExtensions={};t.extendMode=function(t,e){var n=Uo.hasOwnProperty(t)?Uo[t]:Uo[t]={};Si(e,n)};t.defineExtension=function(e,n){t.prototype[e]=n};t.defineDocExtension=function(t,e){la.prototype[t]=e};t.defineOption=En;var Bo=[];t.defineInitHook=function(t){Bo.push(t)};var Vo=t.helpers={};t.registerHelper=function(e,n,r){Vo.hasOwnProperty(e)||(Vo[e]=t[e]={_global:[]});Vo[e][n]=r};t.registerGlobalHelper=function(e,n,r,i){t.registerHelper(e,n,i);Vo[e]._global.push({pred:r,val:i})};var Xo=t.copyState=function(t,e){if(e===!0)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([]));n[r]=i}return n},Go=t.startState=function(t,e,n){return t.startState?t.startState(e,n):!0};t.innerMode=function(t,e){for(;t.innerMode;){var n=t.innerMode(e);if(!n||n.mode==t)break;e=n.state;t=n.mode}return n||{mode:t,state:e}};var Yo=t.commands={selectAll:function(t){t.setSelection(Co(t.firstLine(),0),Co(t.lastLine()),wa)},singleSelection:function(t){t.setSelection(t.getCursor("anchor"),t.getCursor("head"),wa)},killLine:function(t){Ln(t,function(e){if(e.empty()){var n=Rr(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0){i=new Co(i.line,i.ch+1);t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Co(i.line,i.ch-2),i,"+transpose")}else if(i.line>t.doc.first){var a=Rr(t.doc,i.line-1).text;a&&t.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),Co(i.line-1,a.length-1),Co(i.line,1),"+transpose")}}n.push(new K(i,i))}t.setSelections(n)})},newlineAndIndent:function(t){de(t,function(){for(var e=t.listSelections().length,n=0;e>n;n++){var r=t.listSelections()[n];t.replaceRange("\n",r.anchor,r.head,"+input");t.indentLine(r.from().line+1,null,!0);kn(t)}})},toggleOverwrite:function(t){t.toggleOverwrite()}},$o=t.keyMap={};$o.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};$o.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};$o.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};$o.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};$o["default"]=go?$o.macDefault:$o.pcDefault;t.normalizeKeyMap=function(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=xi(n.split(" "),Pn),o=0;o=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pose},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1){this.pos=e;return!0}},backUp:function(t){this.pos-=t},column:function(){if(this.lastColumnPos0)return null;r&&e!==!1&&(this.pos+=r[0].length);return r}var i=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(i(o)==i(t)){e!==!1&&(this.pos+=t.length);return!0}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}}};var ta=t.TextMarker=function(t,e){this.lines=[];this.type=e;this.doc=t};gi(ta);ta.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;e&&ie(t);if(pi(this,"clear")){var n=this.find();n&&ci(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;ot.display.maxLineLength){t.display.maxLine=l;t.display.maxLineLength=u;t.display.maxLineChanged=!0}}null!=r&&t&&this.collapsed&&be(t,r,i+1);this.lines.length=0;this.explicitlyCleared=!0;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=!1;t&>(t.doc)}t&&ci(t,"markerCleared",t,this);e&&ae(t);this.parent&&this.parent.clear()}};ta.prototype.find=function(t,e){null==t&&"bookmark"==this.type&&(t=1);for(var n,r,i=0;in;++n){var i=this.lines[n];this.height-=i.height;gr(i);ci(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n;this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0;rt;++t)if(n(this.lines[t]))return!0}};Ir.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;nt){var o=Math.min(e,i-t),a=r.height;r.removeInner(t,o);this.height-=a-r.height;if(i==o){this.children.splice(n--,1);r.parent=null}if(0==(e-=o))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof jr))){var s=[];this.collapse(s);this.children=[new jr(s)];this.children[0].parent=this}},collapse:function(t){for(var e=0;e=t){i.insertInner(t,e,n);if(i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),s=new jr(a);i.height-=s.height;this.children.splice(r+1,0,s);s.parent=this}this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new Ir(e);if(t.parent){t.size-=n.size;t.height-=n.height;var r=wi(t.parent.children,t);t.parent.children.splice(r+1,0,n)}else{var i=new Ir(t.children);i.parent=t;t.children=[i,n];t=i}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;rt){var a=Math.min(e,o-t);if(i.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=o}}};var sa=0,la=t.Doc=function(t,e,n){if(!(this instanceof la))return new la(t,e,n);null==n&&(n=0);Ir.call(this,[new jr([new ia("",null)])]);this.first=n;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=n;var r=Co(n,0);this.sel=Q(r);this.history=new Xr(null);this.id=++sa;this.modeOption=e;"string"==typeof t&&(t=Oa(t));Pr(this,{from:r,to:r,text:t});ht(this,Q(r),wa)};la.prototype=Ci(Ir.prototype,{constructor:la,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,r=0;r=0;o--)dn(this,r[o]);s?ft(this,s):this.cm&&kn(this.cm)}),undo:me(function(){gn(this,"undo")}),redo:me(function(){gn(this,"redo")}),undoSelection:me(function(){gn(this,"undo",!0)}),redoSelection:me(function(){gn(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=et(this,t);e=et(this,e);var r=[],i=t.line;this.iter(t.line,e.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;sl.to||null==l.from&&i!=t.line||i==e.line&&l.from>e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i});return r},getAllMarks:function(){var t=[];this.iter(function(e){var n=e.markedSpans;if(n)for(var r=0;rt){e=t;return!0}t-=i;++n});return et(this,Co(n,e))},indexFromPos:function(t){t=et(this,t);var e=t.ch;if(t.linee&&(e=t.from);null!=t.to&&t.tos||s>=e)return a+(e-o);a+=s-o;a+=n-a%n;o=s+1}},Ta=[""],ka=function(t){t.select()};ho?ka=function(t){t.selectionStart=0;t.selectionEnd=t.value.length}:no&&(ka=function(t){try{t.select()}catch(e){}});var Ma,_a=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Da=t.isWordChar=function(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||_a.test(t))},La=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Ma=document.createRange?function(t,e,n){var r=document.createRange();r.setEnd(t,n);r.setStart(t,e);return r}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(i){return r}r.collapse(!0);r.moveEnd("character",n);r.moveStart("character",e);return r};var Aa=t.contains=function(t,e){if(t.contains)return t.contains(e);for(;e=e.parentNode;){11==e.nodeType&&(e=e.host);if(e==t)return!0}};no&&11>ro&&(Ni=function(){try{return document.activeElement}catch(t){return document.body}});var Na,Ea,Pa=t.rmClass=function(t,e){var n=t.className,r=Ei(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}},ja=t.addClass=function(t,e){var n=t.className;Ei(e).test(n)||(t.className+=(n?" ":"")+e)},Ia=!1,Ha=function(){if(no&&9>ro)return!1;var t=Di("div");return"draggable"in t||"dragDrop"in t}(),Oa=t.splitLines=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;r>=e;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");if(-1!=a){n.push(o.slice(0,a));e+=a+1}else{n.push(o);e=i+1}}return n}:function(t){return t.split(/\r\n?|\n/)},Ra=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){try{var e=t.ownerDocument.selection.createRange()}catch(n){}return e&&e.parentElement()==t?0!=e.compareEndPoints("StartToEnd",e):!1},Fa=function(){var t=Di("div");if("oncopy"in t)return!0;t.setAttribute("oncopy","return;");return"function"==typeof t.oncopy}(),Wa=null,za={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};t.keyNames=za;(function(){for(var t=0;10>t;t++)za[t+48]=za[t+96]=String(t);for(var t=65;90>=t;t++)za[t]=String.fromCharCode(t);for(var t=1;12>=t;t++)za[t+111]=za[t+63235]="F"+t})();var qa,Ua=function(){function t(t){return 247>=t?n.charAt(t):t>=1424&&1524>=t?"R":t>=1536&&1773>=t?r.charAt(t-1536):t>=1774&&2220>=t?"r":t>=8192&&8203>=t?"w":8204==t?"b":"L"}function e(t,e,n){this.level=t;this.from=e;this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,u="L";return function(n){if(!i.test(n))return!1;for(var r,c=n.length,f=[],h=0;c>h;++h)f.push(r=t(n.charCodeAt(h)));for(var h=0,d=u;c>h;++h){var r=f[h];"m"==r?f[h]=d:d=r}for(var h=0,p=u;c>h;++h){var r=f[h];if("1"==r&&"r"==p)f[h]="n";else if(a.test(r)){p=r;"r"==r&&(f[h]="R")}}for(var h=1,d=f[0];c-1>h;++h){var r=f[h];"+"==r&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=r||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d);d=r}for(var h=0;c>h;++h){var r=f[h];if(","==r)f[h]="N";else if("%"==r){for(var g=h+1;c>g&&"%"==f[g];++g);for(var m=h&&"!"==f[h-1]||c>g&&"1"==f[g]?"1":"N",v=h;g>v;++v)f[v]=m;h=g-1}}for(var h=0,p=u;c>h;++h){var r=f[h];"L"==p&&"1"==r?f[h]="L":a.test(r)&&(p=r)}for(var h=0;c>h;++h)if(o.test(f[h])){for(var g=h+1;c>g&&o.test(f[g]);++g);for(var y="L"==(h?f[h-1]:u),b="L"==(c>g?f[g]:u),m=y||b?"L":"R",v=h;g>v;++v)f[v]=m;h=g-1}for(var w,x=[],h=0;c>h;)if(s.test(f[h])){var C=h;for(++h;c>h&&s.test(f[h]);++h);x.push(new e(0,C,h))}else{var S=h,T=x.length;for(++h;c>h&&"L"!=f[h];++h);for(var v=S;h>v;)if(l.test(f[v])){v>S&&x.splice(T,0,new e(1,S,v));var k=v;for(++v;h>v&&l.test(f[v]);++v);x.splice(T,0,new e(2,k,v));S=v}else++v;h>S&&x.splice(T,0,new e(1,S,h))}if(1==x[0].level&&(w=n.match(/^\s+/))){x[0].from=w[0].length;x.unshift(new e(0,0,w[0].length))}if(1==bi(x).level&&(w=n.match(/\s+$/))){bi(x).to-=w[0].length;x.push(new e(0,c-w[0].length,c))}x[0].level!=bi(x).level&&x.push(new e(x[0].level,c,c));return x}}();t.version="4.13.0";return t})},{}],11:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.defineMode("javascript",function(e,n){function r(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}function i(t,e,n){gt=t;mt=n;return e}function o(t,e){var n=t.next();if('"'==n||"'"==n){e.tokenize=a(n);return e.tokenize(t,e)}if("."==n&&t.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&t.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&t.eat(">"))return i("=>","operator");if("0"==n&&t.eat(/x/i)){t.eatWhile(/[\da-f]/i);return i("number","number")}if(/\d/.test(n)){t.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return i("number","number")}if("/"==n){if(t.eat("*")){e.tokenize=s;return s(t,e)}if(t.eat("/")){t.skipToEnd();return i("comment","comment")}if("operator"==e.lastType||"keyword c"==e.lastType||"sof"==e.lastType||/^[\[{}\(,;:]$/.test(e.lastType)){r(t);t.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return i("regexp","string-2")}t.eatWhile(Tt);return i("operator","operator",t.current())}if("`"==n){e.tokenize=l;return l(t,e)}if("#"==n){t.skipToEnd();return i("error","error")}if(Tt.test(n)){t.eatWhile(Tt);return i("operator","operator",t.current())}if(Ct.test(n)){t.eatWhile(Ct);var o=t.current(),u=St.propertyIsEnumerable(o)&&St[o];return u&&"."!=e.lastType?i(u.type,u.style,o):i("variable","variable",o)}}function a(t){return function(e,n){var r,a=!1;if(bt&&"@"==e.peek()&&e.match(kt)){n.tokenize=o;return i("jsonld-keyword","meta")}for(;null!=(r=e.next())&&(r!=t||a);)a=!a&&"\\"==r;a||(n.tokenize=o);return i("string","string")}}function s(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",t.current())}function u(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=t.string.charAt(o),s=Mt.indexOf(a);if(s>=0&&3>s){if(!r){++o;break}if(0==--r)break}else if(s>=3&&6>s)++r;else if(Ct.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(e.fatArrowAt=o)}}function c(t,e,n,r,i,o){this.indented=t;this.column=e;this.type=n;this.prev=i;this.info=o;null!=r&&(this.align=r)}function f(t,e){for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==e)return!0}function h(t,e,n,r,i){var o=t.cc;Dt.state=t;Dt.stream=i;Dt.marked=null,Dt.cc=o;Dt.style=e;t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);for(;;){var a=o.length?o.pop():wt?C:x;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Dt.marked?Dt.marked:"variable"==n&&f(t,r)?"variable-2":e}}}function d(){for(var t=arguments.length-1;t>=0;t--)Dt.cc.push(arguments[t])}function p(){d.apply(null,arguments);return!0}function g(t){function e(e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}var r=Dt.state;if(r.context){Dt.marked="def";if(e(r.localVars))return;r.localVars={name:t,next:r.localVars}}else{if(e(r.globalVars))return;n.globalVars&&(r.globalVars={name:t,next:r.globalVars})}}function m(){Dt.state.context={prev:Dt.state.context,vars:Dt.state.localVars};Dt.state.localVars=Lt}function v(){Dt.state.localVars=Dt.state.context.vars;Dt.state.context=Dt.state.context.prev}function y(t,e){var n=function(){var n=Dt.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new c(r,Dt.stream.column(),t,null,n.lexical,e)};n.lex=!0;return n}function b(){var t=Dt.state;if(t.lexical.prev){")"==t.lexical.type&&(t.indented=t.lexical.indented);t.lexical=t.lexical.prev}}function w(t){function e(n){return n==t?p():";"==t?d():p(e)}return e}function x(t,e){if("var"==t)return p(y("vardef",e.length),U,w(";"),b);if("keyword a"==t)return p(y("form"),C,x,b);if("keyword b"==t)return p(y("form"),x,b);if("{"==t)return p(y("}"),W,b);if(";"==t)return p();if("if"==t){"else"==Dt.state.lexical.info&&Dt.state.cc[Dt.state.cc.length-1]==b&&Dt.state.cc.pop()();return p(y("form"),C,x,b,Y)}return"function"==t?p(tt):"for"==t?p(y("form"),$,x,b):"variable"==t?p(y("stat"),P):"switch"==t?p(y("form"),C,y("}","switch"),w("{"),W,b,b):"case"==t?p(C,w(":")):"default"==t?p(w(":")):"catch"==t?p(y("form"),m,w("("),et,w(")"),x,b,v):"module"==t?p(y("form"),m,at,v,b):"class"==t?p(y("form"),nt,b):"export"==t?p(y("form"),st,b):"import"==t?p(y("form"),lt,b):d(y("stat"),C,w(";"),b)}function C(t){return T(t,!1)}function S(t){return T(t,!0)}function T(t,e){if(Dt.state.fatArrowAt==Dt.stream.start){var n=e?E:N;if("("==t)return p(m,y(")"),R(B,")"),b,w("=>"),n,v);if("variable"==t)return d(m,B,w("=>"),n,v)}var r=e?D:_;return _t.hasOwnProperty(t)?p(r):"function"==t?p(tt,r):"keyword c"==t?p(e?M:k):"("==t?p(y(")"),k,dt,w(")"),b,r):"operator"==t||"spread"==t?p(e?S:C):"["==t?p(y("]"),ft,b,r):"{"==t?F(I,"}",null,r):"quasi"==t?d(L,r):p()}function k(t){return t.match(/[;\}\)\],]/)?d():d(C)}function M(t){return t.match(/[;\}\)\],]/)?d():d(S)}function _(t,e){return","==t?p(C):D(t,e,!1)}function D(t,e,n){var r=0==n?_:D,i=0==n?C:S;return"=>"==t?p(m,n?E:N,v):"operator"==t?/\+\+|--/.test(e)?p(r):"?"==e?p(C,w(":"),i):p(i):"quasi"==t?d(L,r):";"!=t?"("==t?F(S,")","call",r):"."==t?p(j,r):"["==t?p(y("]"),k,w("]"),b,r):void 0:void 0}function L(t,e){return"quasi"!=t?d():"${"!=e.slice(e.length-2)?p(L):p(C,A)}function A(t){if("}"==t){Dt.marked="string-2";Dt.state.tokenize=l;return p(L)}}function N(t){u(Dt.stream,Dt.state);return d("{"==t?x:C)}function E(t){u(Dt.stream,Dt.state);return d("{"==t?x:S)}function P(t){return":"==t?p(b,x):d(_,w(";"),b)}function j(t){if("variable"==t){Dt.marked="property";return p()}}function I(t,e){if("variable"==t||"keyword"==Dt.style){Dt.marked="property";return p("get"==e||"set"==e?H:O)}if("number"==t||"string"==t){Dt.marked=bt?"property":Dt.style+" property";return p(O)}return"jsonld-keyword"==t?p(O):"["==t?p(C,w("]"),O):void 0}function H(t){if("variable"!=t)return d(O);Dt.marked="property";return p(tt)}function O(t){return":"==t?p(S):"("==t?d(tt):void 0}function R(t,e){function n(r){if(","==r){var i=Dt.state.lexical;"call"==i.info&&(i.pos=(i.pos||0)+1);return p(t,n)}return r==e?p():p(w(e))}return function(r){return r==e?p():d(t,n)}}function F(t,e,n){for(var r=3;r!?|~^]/,kt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Mt="([{}])",_t={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Dt={state:null,column:null,marked:null,cc:null},Lt={name:"this",next:{name:"arguments"}};b.lex=!0;return{startState:function(t){var e={tokenize:o,lastType:"sof",cc:[],lexical:new c((t||0)-vt,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars);return e},token:function(t,e){if(t.sol()){e.lexical.hasOwnProperty("align")||(e.lexical.align=!1);e.indented=t.indentation();u(t,e)}if(e.tokenize!=s&&t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"==gt)return n;e.lastType="operator"!=gt||"++"!=mt&&"--"!=mt?gt:"incdec";return h(e,n,gt,mt,t)},indent:function(e,r){if(e.tokenize==s)return t.Pass;if(e.tokenize!=o)return 0;var i=r&&r.charAt(0),a=e.lexical;if(!/^\s*else\b/.test(r))for(var l=e.cc.length-1;l>=0;--l){var u=e.cc[l];if(u==b)a=a.prev;else if(u!=Y)break}"stat"==a.type&&"}"==i&&(a=a.prev);yt&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var c=a.type,f=i==c;return"vardef"==c?a.indented+("operator"==e.lastType||","==e.lastType?a.info+1:0):"form"==c&&"{"==i?a.indented:"form"==c?a.indented+vt:"stat"==c?a.indented+(pt(e,r)?yt||vt:0):"switch"!=a.info||f||0==n.doubleIndentSwitch?a.align?a.column+(f?0:1):a.indented+(f?0:vt):a.indented+(/^(?:case|default)\b/.test(r)?vt:2*vt)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:wt?null:"/*",blockCommentEnd:wt?null:"*/",lineComment:wt?null:"//",fold:"brace",helperType:wt?"json":"javascript",jsonldMode:bt,jsonMode:wt}});t.registerHelper("wordChars","javascript",/[\w$]/);t.defineMIME("text/javascript","javascript");t.defineMIME("text/ecmascript","javascript");t.defineMIME("application/javascript","javascript");t.defineMIME("application/x-javascript","javascript");t.defineMIME("application/ecmascript","javascript");t.defineMIME("application/json",{name:"javascript",json:!0});t.defineMIME("application/x-json",{name:"javascript",json:!0});t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});t.defineMIME("text/typescript",{name:"javascript",typescript:!0});t.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":10}],12:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.defineMode("xml",function(e,n){function r(t,e){function n(n){e.tokenize=n;return n(t,e)}var r=t.next();if("<"==r){if(t.eat("!")){if(t.eat("["))return t.match("CDATA[")?n(a("atom","]]>")):null;if(t.match("--"))return n(a("comment","-->"));if(t.match("DOCTYPE",!0,!0)){t.eatWhile(/[\w\._\-]/);return n(s(1))}return null}if(t.eat("?")){t.eatWhile(/[\w\._\-]/);e.tokenize=a("meta","?>");return"meta"}S=t.eat("/")?"closeTag":"openTag";e.tokenize=i;return"tag bracket"}if("&"==r){var o;o=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";");return o?"atom":"error"}t.eatWhile(/[^&<]/);return null}function i(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">")){e.tokenize=r;S=">"==n?"endTag":"selfcloseTag";return"tag bracket"}if("="==n){S="equals";return null}if("<"==n){e.tokenize=r;e.state=f;e.tagName=e.tagStart=null;var i=e.tokenize(t,e);return i?i+" tag error":"tag error"}if(/[\'\"]/.test(n)){e.tokenize=o(n);e.stringStartCol=t.column();return e.tokenize(t,e)}t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}function o(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=i;break}return"string"};e.isInAttribute=!0;return e}function a(t,e){return function(n,i){for(;!n.eol();){if(n.match(e)){i.tokenize=r;break}n.next()}return t}}function s(t){return function(e,n){for(var i;null!=(i=e.next());){if("<"==i){n.tokenize=s(t+1);return n.tokenize(e,n)}if(">"==i){if(1==t){n.tokenize=r;break}n.tokenize=s(t-1);return n.tokenize(e,n)}}return"meta"}}function l(t,e,n){this.prev=t.context;this.tagName=e;this.indent=t.indented;this.startOfLine=n;(k.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function u(t){t.context&&(t.context=t.context.prev)}function c(t,e){for(var n;;){if(!t.context)return;n=t.context.tagName;if(!k.contextGrabbers.hasOwnProperty(n)||!k.contextGrabbers[n].hasOwnProperty(e))return;u(t)}}function f(t,e,n){if("openTag"==t){n.tagStart=e.column();return h}return"closeTag"==t?d:f}function h(t,e,n){if("word"==t){n.tagName=e.current();T="tag";return m}T="error";return h}function d(t,e,n){if("word"==t){var r=e.current();n.context&&n.context.tagName!=r&&k.implicitlyClosed.hasOwnProperty(n.context.tagName)&&u(n);if(n.context&&n.context.tagName==r){T="tag";return p}T="tag error";return g}T="error";return g}function p(t,e,n){if("endTag"!=t){T="error";return p}u(n);return f}function g(t,e,n){T="error";return p(t,e,n)}function m(t,e,n){if("word"==t){T="attribute";return v}if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;n.tagName=n.tagStart=null;if("selfcloseTag"==t||k.autoSelfClosers.hasOwnProperty(r))c(n,r);else{c(n,r);n.context=new l(n,r,i==n.indented)}return f}T="error";return m}function v(t,e,n){if("equals"==t)return y;k.allowMissing||(T="error");return m(t,e,n)}function y(t,e,n){if("string"==t)return b;if("word"==t&&k.allowUnquoted){T="string";return m}T="error";return m(t,e,n)}function b(t,e,n){return"string"==t?b:m(t,e,n)}var w=e.indentUnit,x=n.multilineTagIndentFactor||1,C=n.multilineTagIndentPastTag;null==C&&(C=!0);var S,T,k=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},M=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(t,e){!e.tagName&&t.sol()&&(e.indented=t.indentation());if(t.eatSpace())return null;S=null;var n=e.tokenize(t,e);if((n||S)&&"comment"!=n){T=null;e.state=e.state(S||n,t,e);T&&(n="error"==T?n+" error":T)}return n},indent:function(e,n,o){var a=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+w;if(a&&a.noIndent)return t.Pass;if(e.tokenize!=i&&e.tokenize!=r)return o?o.match(/^(\s*)/)[0].length:0;if(e.tagName)return C?e.tagStart+e.tagName.length+2:e.tagStart+w*x;if(M&&/$/,blockCommentStart:"",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}});t.defineMIME("text/xml","xml");t.defineMIME("application/xml","xml");t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":10}],13:[function(e,n,r){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function o(t){return null===t?0/0:+t}function a(t){return!isNaN(t)}function s(t){return{left:function(e,n,r,i){arguments.length<3&&(r=0);arguments.length<4&&(i=e.length);for(;i>r;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){arguments.length<3&&(r=0);arguments.length<4&&(i=e.length);for(;i>r;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function f(){this._=Object.create(null)}function h(t){return(t+="")===va||t[0]===ya?ya+t:t}function d(t){return(t+="")[0]===ya?t.slice(1):t}function p(t){return h(t)in this._}function g(t){return(t=h(t))in this._&&delete this._[t]}function m(){var t=[];for(var e in this._)t.push(d(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function w(t){return t}function x(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function C(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=ba.length;r>n;++n){var i=ba[n]+e;if(i in t)return i}}function S(){}function T(){}function k(t){function e(){for(var e,r=n,i=-1,o=r.length;++in;n++)for(var i,o=t[n],a=0,s=o.length;s>a;a++)(i=o[a])&&e(i,a,n);return t}function X(t){xa(t,_a);return t}function G(t){var e,n;return function(r,i,o){var a,s=t[o].update,l=s.length;o!=n&&(n=o,e=0);i>=e&&(e=i+1);for(;!(a=s[e])&&++e0&&(t=t.slice(0,s));var u=Da.get(t);u&&(t=u,l=J);return s?e?i:r:e?S:o}function $(t,e){return function(n){var r=ia.event;ia.event=n;e[0]=this.__data__;try{t.apply(this,e)}finally{ia.event=r}}}function J(t,e){var n=$(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function K(t){var n=".dragsuppress-"+ ++Aa,i="click"+n,o=ia.select(r(t)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);null==La&&(La="onselectstart"in t?!1:C(t.style,"userSelect"));if(La){var a=e(t).style,s=a[La];a[La]="none"}return function(t){o.on(n,null);La&&(a[La]=s);if(t){var e=function(){o.on(i,null)};o.on(i,function(){M();e()},!0);setTimeout(e,0)}}}function Z(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(0>Na){var o=r(t);if(o.scrollX||o.scrollY){n=ia.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=n[0][0].getScreenCTM();Na=!(a.f||a.e);n.remove()}}Na?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY);i=i.matrixTransform(t.getScreenCTM().inverse());return[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function Q(){return ia.event.changedTouches[0].identifier}function tt(t){return t>0?1:0>t?-1:0}function et(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function nt(t){return t>1?0:-1>t?ja:Math.acos(t); }function rt(t){return t>1?Oa:-1>t?-Oa:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function ot(t){return((t=Math.exp(t))+1/t)/2}function at(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,n){return this instanceof ut?void(this.h=+t,this.s=+e,this.l=+n):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):St(""+t,Tt,ut):new ut(t,e,n)}function ct(t,e,n){function r(t){t>360?t-=360:0>t&&(t+=360);return 60>t?o+(a-o)*t/60:180>t?a:240>t?o+(a-o)*(240-t)/60:o}function i(t){return Math.round(255*r(t))}var o,a;t=isNaN(t)?0:(t%=360)<0?t+360:t;e=isNaN(e)?0:0>e?0:e>1?1:e;n=0>n?0:n>1?1:n;a=.5>=n?n*(1+e):n+e-n*e;o=2*n-a;return new bt(i(t+120),i(t),i(t-120))}function ft(t,e,n){return this instanceof ft?void(this.h=+t,this.c=+e,this.l=+n):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof dt?gt(t.l,t.a,t.b):gt((t=kt((t=ia.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,n)}function ht(t,e,n){isNaN(t)&&(t=0);isNaN(e)&&(e=0);return new dt(n,Math.cos(t*=Ra)*e,Math.sin(t)*e)}function dt(t,e,n){return this instanceof dt?void(this.l=+t,this.a=+e,this.b=+n):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ft?ht(t.h,t.c,t.l):kt((t=bt(t)).r,t.g,t.b):new dt(t,e,n)}function pt(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;i=mt(i)*$a;r=mt(r)*Ja;o=mt(o)*Ka;return new bt(yt(3.2404542*i-1.5371385*r-.4985314*o),yt(-.969266*i+1.8760108*r+.041556*o),yt(.0556434*i-.2040259*r+1.0572252*o))}function gt(t,e,n){return t>0?new ft(Math.atan2(n,e)*Fa,Math.sqrt(e*e+n*n),t):new ft(0/0,0/0,t)}function mt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function vt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,e,n){return this instanceof bt?void(this.r=~~t,this.g=~~e,this.b=~~n):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):St(""+t,bt,ct):new bt(t,e,n)}function wt(t){return new bt(t>>16,t>>8&255,255&t)}function xt(t){return wt(t)+""}function Ct(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function St(t,e,n){var r,i,o,a=0,s=0,l=0;r=/([a-z]+)\((.*)\)/i.exec(t);if(r){i=r[2].split(",");switch(r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(_t(i[0]),_t(i[1]),_t(i[2]))}}if(o=ts.get(t.toLowerCase()))return e(o.r,o.g,o.b);if(null!=t&&"#"===t.charAt(0)&&!isNaN(o=parseInt(t.slice(1),16)))if(4===t.length){a=(3840&o)>>4;a=a>>4|a;s=240&o;s=s>>4|s;l=15&o;l=l<<4|l}else if(7===t.length){a=(16711680&o)>>16;s=(65280&o)>>8;l=255&o}return e(a,s,l)}function Tt(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-o,l=(a+o)/2;if(s){i=.5>l?s/(a+o):s/(2-a-o);r=t==a?(e-n)/s+(n>e?6:0):e==a?(n-t)/s+2:(t-e)/s+4;r*=60}else{r=0/0;i=l>0&&1>l?0:r}return new ut(r,i,l)}function kt(t,e,n){t=Mt(t);e=Mt(e);n=Mt(n);var r=vt((.4124564*t+.3575761*e+.1804375*n)/$a),i=vt((.2126729*t+.7151522*e+.072175*n)/Ja),o=vt((.0193339*t+.119192*e+.9503041*n)/Ka);return dt(116*i-16,500*(r-i),200*(i-o))}function Mt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _t(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Dt(t){return"function"==typeof t?t:function(){return t}}function Lt(t){return function(e,n,r){2===arguments.length&&"function"==typeof n&&(r=n,n=null);return At(e,n,t,r)}}function At(t,e,n,r){function i(){var t,e=l.status;if(!e&&Et(l)||e>=200&&300>e||304===e){try{t=n.call(o,l)}catch(r){a.error.call(o,r);return}a.load.call(o,t)}else a.error.call(o,l)}var o={},a=ia.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest);"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()};l.onprogress=function(t){var e=ia.event;ia.event=t;try{a.progress.call(o,l)}finally{ia.event=e}};o.header=function(t,e){t=(t+"").toLowerCase();if(arguments.length<2)return s[t];null==e?delete s[t]:s[t]=e+"";return o};o.mimeType=function(t){if(!arguments.length)return e;e=null==t?null:t+"";return o};o.responseType=function(t){if(!arguments.length)return u;u=t;return o};o.response=function(t){n=t;return o};["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(aa(arguments)))}});o.send=function(n,r,i){2===arguments.length&&"function"==typeof r&&(i=r,r=null);l.open(n,t,!0);null==e||"accept"in s||(s.accept=e+",*/*");if(l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);null!=e&&l.overrideMimeType&&l.overrideMimeType(e);null!=u&&(l.responseType=u);null!=i&&o.on("error",i).on("load",function(t){i(null,t)});a.beforesend.call(o,l);l.send(null==r?null:r);return o};o.abort=function(){l.abort();return o};ia.rebind(o,a,"on");return null==r?o:o.get(Nt(r))}function Nt(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Et(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(){var t=jt(),e=It()-t;if(e>24){if(isFinite(e)){clearTimeout(is);is=setTimeout(Pt,e)}rs=0}else{rs=1;as(Pt)}}function jt(){var t=Date.now();os=es;for(;os;){t>=os.t&&(os.f=os.c(t-os.t));os=os.n}return t}function It(){for(var t,e=es,n=1/0;e;)if(e.f)e=t?t.n=e.n:es=e.n;else{e.t8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Rt(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,o=r&&n?function(t,e){for(var i=t.length,o=[],a=0,s=r[0],l=0;i>0&&s>0;){l+s+1>e&&(s=Math.max(1,e-l));o.push(t.substring(i-=s,i+s));if((l+=s+1)>e)break;s=r[a=(a+1)%r.length]}return o.reverse().join(n)}:w;return function(t){var n=ls.exec(t),r=n[1]||" ",a=n[2]||">",s=n[3]||"-",l=n[4]||"",u=n[5],c=+n[6],f=n[7],h=n[8],d=n[9],p=1,g="",m="",v=!1,y=!0;h&&(h=+h.substring(1));if(u||"0"===r&&"="===a){u=r="0";a="="}switch(d){case"n":f=!0;d="g";break;case"%":p=100;m="%";d="f";break;case"p":p=100;m="%";d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0;h=0;break;case"s":p=-1;d="r"}"$"===l&&(g=i[0],m=i[1]);"r"!=d||h||(d="g");null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):("e"==d||"f"==d)&&(h=Math.max(0,Math.min(20,h))));d=us.get(d)||Ft;var b=u&&f;return function(t){var n=m;if(v&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===s?"":s;if(0>p){var l=ia.formatPrefix(t,h);t=l.scale(t);n=l.symbol+m}else t*=p;t=d(t,h);var w,x,C=t.lastIndexOf(".");if(0>C){var S=y?t.lastIndexOf("e"):-1;0>S?(w=t,x=""):(w=t.substring(0,S),x=t.substring(S))}else{w=t.substring(0,C);x=e+t.substring(C+1)}!u&&f&&(w=o(w,1/0));var T=g.length+w.length+x.length+(b?0:i.length),k=c>T?new Array(T=c-T+1).join(r):"";b&&(w=o(k+w,k.length?c-x.length:1/0));i+=g;t=w+x;return("<"===a?i+t+k:">"===a?k+i+t:"^"===a?k.substring(0,T>>=1)+i+t+k.substring(T):i+(b?t:k+t))+n}}}function Ft(t){return t+""}function Wt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function zt(t,e,n){function r(e){var n=t(e),r=o(n,1);return r-e>e-n?n:r}function i(n){e(n=t(new fs(n-1)),1);return n}function o(t,n){e(t=new fs(+t),n);return t}function a(t,r,o){var a=i(t),s=[];if(o>1)for(;r>a;){n(a)%o||s.push(new Date(+a));e(a,1)}else for(;r>a;)s.push(new Date(+a)),e(a,1);return s}function s(t,e,n){try{fs=Wt;var r=new Wt;r._=t;return a(r,e,n)}finally{fs=Date}}t.floor=t;t.round=r;t.ceil=i;t.offset=o;t.range=a;var l=t.utc=qt(t);l.floor=l;l.round=qt(r);l.ceil=qt(i);l.offset=qt(o);l.range=s;return t}function qt(t){return function(e,n){try{fs=Wt;var r=new Wt;r._=e;return t(r,n)._}finally{fs=Date}}}function Ut(t){function e(t){function e(e){for(var n,i,o,a=[],s=-1,l=0;++ss;){if(r>=u)return-1;i=e.charCodeAt(s++);if(37===i){a=e.charAt(s++);o=L[a in ds?e.charAt(s++):a];if(!o||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){C.lastIndex=0;var r=C.exec(e.slice(n));return r?(t.w=S.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=x.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,n){M.lastIndex=0;var r=M.exec(e.slice(n));return r?(t.m=_.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){T.lastIndex=0;var r=T.exec(e.slice(n));return r?(t.m=k.get(r[0].toLowerCase()),n+r[0].length):-1}function s(t,e,r){return n(t,D.c.toString(),e,r)}function l(t,e,r){return n(t,D.x.toString(),e,r)}function u(t,e,r){return n(t,D.X.toString(),e,r)}function c(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,h=t.date,d=t.time,p=t.periods,g=t.days,m=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function n(t){try{fs=Wt;var e=new fs;e._=t;return r(e)}finally{fs=Date}}var r=e(t);n.parse=function(t){try{fs=Wt;var e=r.parse(t);return e&&e._}finally{fs=Date}};n.toString=r.toString;return n};e.multi=e.utc.multi=ue;var b=ia.map(),w=Vt(g),x=Xt(g),C=Vt(m),S=Xt(m),T=Vt(v),k=Xt(v),M=Vt(y),_=Xt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var D={a:function(t){return m[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(f),d:function(t,e){return Bt(t.getDate(),e,2)},e:function(t,e){return Bt(t.getDate(),e,2)},H:function(t,e){return Bt(t.getHours(),e,2)},I:function(t,e){return Bt(t.getHours()%12||12,e,2)},j:function(t,e){return Bt(1+cs.dayOfYear(t),e,3)},L:function(t,e){return Bt(t.getMilliseconds(),e,3)},m:function(t,e){return Bt(t.getMonth()+1,e,2)},M:function(t,e){return Bt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Bt(t.getSeconds(),e,2)},U:function(t,e){return Bt(cs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Bt(cs.mondayOfYear(t),e,2)},x:e(h),X:e(d),y:function(t,e){return Bt(t.getFullYear()%100,e,2)},Y:function(t,e){return Bt(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},L={a:r,A:i,b:o,B:a,c:s,d:ee,e:ee,H:re,I:re,j:ne,L:ae,m:te,M:ie,p:c,S:oe,U:Yt,w:Gt,W:$t,x:l,X:u,y:Kt,Y:Jt,Z:Zt,"%":le};return e}function Bt(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",o=i.length;return r+(n>o?new Array(n-o+1).join(e)+i:i)}function Vt(t){return new RegExp("^(?:"+t.map(ia.requote).join("|")+")","i")}function Xt(t){for(var e=new f,n=-1,r=t.length;++n68?1900:2e3)}function te(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ee(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ne(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function re(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function ie(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function oe(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function ae(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function se(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=ma(e)/60|0,i=ma(e)%60;return n+Bt(r,"0",2)+Bt(i,"0",2)}function le(t,e,n){gs.lastIndex=0;var r=gs.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ue(t){for(var e=t.length,n=-1;++n=0?1:-1,s=a*n,l=Math.cos(e),u=Math.sin(e),c=o*u,f=i*l+c*Math.cos(s),h=c*a*Math.sin(s);xs.add(Math.atan2(h,f));r=t,i=l,o=u}var e,n,r,i,o;Cs.point=function(a,s){Cs.point=t;r=(e=a)*Ra,i=Math.cos(s=(n=s)*Ra/2+ja/4),o=Math.sin(s)};Cs.lineEnd=function(){t(e,n)}}function me(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function ve(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function be(t,e){t[0]+=e[0];t[1]+=e[1];t[2]+=e[2]}function we(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function xe(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e;t[1]/=e;t[2]/=e}function Ce(t){return[Math.atan2(t[1],t[0]),rt(t[2])]}function Se(t,e){return ma(t[0]-e[0])s;++s)i.point((n=t[s])[0],n[1]);i.lineEnd()}else{var l=new Pe(n,t,null,!0),u=new Pe(n,null,l,!1);l.o=u;o.push(l);a.push(u);l=new Pe(r,t,null,!1);u=new Pe(r,null,l,!0);l.o=u;o.push(l);a.push(u)}}});a.sort(e);Ee(o);Ee(a);if(o.length){for(var s=0,l=n,u=a.length;u>s;++s)a[s].e=l=!l;for(var c,f,h=o[0];;){for(var d=h,p=!0;d.v;)if((d=d.n)===h)return;c=d.z;i.lineStart();do{d.v=d.o.v=!0;if(d.e){if(p)for(var s=0,u=c.length;u>s;++s)i.point((f=c[s])[0],f[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o;c=d.z;p=!p}while(!d.v);i.lineEnd()}}}function Ee(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0){x||(o.polygonStart(),x=!0);o.lineStart();for(;++a1&&2&e&&n.push(n.pop().concat(n.shift()));d.push(n.filter(Ie))}}var d,p,g,m=e(o),v=i.invert(r[0],r[1]),y={point:a,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c;y.lineStart=f;y.lineEnd=h;d=[];p=[]},polygonEnd:function(){y.point=a;y.lineStart=l;y.lineEnd=u;d=ia.merge(d);var t=ze(v,p);if(d.length){x||(o.polygonStart(),x=!0);Ne(d,Oe,t,n,o)}else if(t){x||(o.polygonStart(),x=!0);o.lineStart();n(null,null,1,o);o.lineEnd()}x&&(o.polygonEnd(),x=!1);d=p=null},sphere:function(){o.polygonStart();o.lineStart();n(null,null,1,o);o.lineEnd();o.polygonEnd()}},b=He(),w=e(b),x=!1;return y}}function Ie(t){return t.length>1}function He(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:S,buffer:function(){var n=e;e=[];t=null;return n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Oe(t,e){return((t=t.x)[0]<0?t[1]-Oa-Ea:Oa-t[1])-((e=e.x)[0]<0?e[1]-Oa-Ea:Oa-e[1])}function Re(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart();e=1},point:function(o,a){var s=o>0?ja:-ja,l=ma(o-n);if(ma(l-ja)0?Oa:-Oa);t.point(i,r);t.lineEnd();t.lineStart();t.point(s,r);t.point(o,r);e=0}else if(i!==s&&l>=ja){ma(n-i)Ea?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}function We(t,e,n,r){var i;if(null==t){i=n*Oa;r.point(-ja,i);r.point(0,i);r.point(ja,i);r.point(ja,0);r.point(ja,-i);r.point(0,-i);r.point(-ja,-i);r.point(-ja,0);r.point(-ja,i)}else if(ma(t[0]-e[0])>Ea){var o=t[0]s;++s){var u=e[s],c=u.length;if(c)for(var f=u[0],h=f[0],d=f[1]/2+ja/4,p=Math.sin(d),g=Math.cos(d),m=1;;){m===c&&(m=0);t=u[m];var v=t[0],y=t[1]/2+ja/4,b=Math.sin(y),w=Math.cos(y),x=v-h,C=x>=0?1:-1,S=C*x,T=S>ja,k=p*b;xs.add(Math.atan2(k*C*Math.sin(S),g*w+k*Math.cos(S)));o+=T?x+C*Ia:x;if(T^h>=n^v>=n){var M=ye(me(f),me(t));xe(M);var _=ye(i,M);xe(_);var D=(T^x>=0?-1:1)*rt(_[2]);(r>D||r===D&&(M[0]||M[1]))&&(a+=T^x>=0?1:-1)}if(!m++)break;h=v,p=b,g=w,f=t}}return(-Ea>o||Ea>o&&0>xs)^1&a}function qe(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function n(t){var n,o,l,u,c;return{lineStart:function(){u=l=!1;c=1},point:function(f,h){var d,p=[f,h],g=e(f,h),m=a?g?0:i(f,h):g?i(f+(0>f?ja:-ja),h):0;!n&&(u=l=g)&&t.lineStart();if(g!==l){d=r(n,p);if(Se(n,d)||Se(p,d)){p[0]+=Ea;p[1]+=Ea;g=e(p[0],p[1])}}if(g!==l){c=0;if(g){t.lineStart();d=r(p,n);t.point(d[0],d[1])}else{d=r(n,p);t.point(d[0],d[1]);t.lineEnd()}n=d}else if(s&&n&&a^g){var v;if(!(m&o)&&(v=r(p,n,!0))){c=0;if(a){t.lineStart();t.point(v[0][0],v[0][1]);t.point(v[1][0],v[1][1]);t.lineEnd()}else{t.point(v[1][0],v[1][1]);t.lineEnd();t.lineStart();t.point(v[0][0],v[0][1])}}}!g||n&&Se(n,p)||t.point(p[0],p[1]);n=p,l=g,o=m},lineEnd:function(){l&&t.lineEnd();n=null},clean:function(){return c|(u&&l)<<1}}}function r(t,e,n){var r=me(t),i=me(e),a=[1,0,0],s=ye(r,i),l=ve(s,s),u=s[0],c=l-u*u;if(!c)return!n&&t;var f=o*l/c,h=-o*u/c,d=ye(a,s),p=we(a,f),g=we(s,h);be(p,g);var m=d,v=ve(p,m),y=ve(m,m),b=v*v-y*(ve(p,p)-1);if(!(0>b)){var w=Math.sqrt(b),x=we(m,(-v-w)/y);be(x,p);x=Ce(x);if(!n)return x;var C,S=t[0],T=e[0],k=t[1],M=e[1];S>T&&(C=S,S=T,T=C);var _=T-S,D=ma(_-ja)_;!D&&k>M&&(C=k,k=M,M=C);if(L?D?k+M>0^x[1]<(ma(x[0]-S)ja^(S<=x[0]&&x[0]<=T)){var A=we(m,(-v+w)/y);be(A,p);return[x,Ce(A)]}}}function i(e,n){var r=a?t:ja-t,i=0;-r>e?i|=1:e>r&&(i|=2);-r>n?i|=4:n>r&&(i|=8);return i}var o=Math.cos(t),a=o>0,s=ma(o)>Ea,l=mn(t,6*Ra);return je(e,n,l,a?[0,-t]:[-ja,t-ja])}function Ue(t,e,n,r){return function(i){var o,a=i.a,s=i.b,l=a.x,u=a.y,c=s.x,f=s.y,h=0,d=1,p=c-l,g=f-u;o=t-l;if(p||!(o>0)){o/=p;if(0>p){if(h>o)return;d>o&&(d=o)}else if(p>0){if(o>d)return;o>h&&(h=o)}o=n-l;if(p||!(0>o)){o/=p;if(0>p){if(o>d)return;o>h&&(h=o)}else if(p>0){if(h>o)return;d>o&&(d=o)}o=e-u;if(g||!(o>0)){o/=g;if(0>g){if(h>o)return;d>o&&(d=o)}else if(g>0){if(o>d)return;o>h&&(h=o)}o=r-u;if(g||!(0>o)){o/=g;if(0>g){if(o>d)return;o>h&&(h=o)}else if(g>0){if(h>o)return;d>o&&(d=o)}h>0&&(i.a={x:l+h*p,y:u+h*g});1>d&&(i.b={x:l+d*p,y:u+d*g});return i}}}}}}function Be(t,e,n,r){function i(r,i){return ma(r[0]-t)0?0:3:ma(r[0]-n)0?2:1:ma(r[1]-e)0?1:0:i>0?3:2}function o(t,e){return a(t.x,e.x)}function a(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,n=m.length,r=t[1],i=0;n>i;++i)for(var o,a=1,s=m[i],l=s.length,u=s[0];l>a;++a){o=s[a];u[1]<=r?o[1]>r&&et(u,o,t)>0&&++e:o[1]<=r&&et(u,o,t)<0&&--e;u=o}return 0!==e}function u(o,s,l,u){var c=0,f=0;if(null==o||(c=i(o,l))!==(f=i(s,l))||a(o,s)<0^l>0){do u.point(0===c||3===c?t:n,c>1?r:e);while((c=(c+l+4)%4)!==f)}else u.point(s[0],s[1])}function c(i,o){return i>=t&&n>=i&&o>=e&&r>=o}function f(t,e){c(t,e)&&s.point(t,e)}function h(){L.point=p;m&&m.push(v=[]);T=!0;S=!1;x=C=0/0}function d(){if(g){p(y,b);w&&S&&_.rejoin();g.push(_.buffer())}L.point=f;S&&s.lineEnd()}function p(t,e){t=Math.max(-Hs,Math.min(Hs,t));e=Math.max(-Hs,Math.min(Hs,e));var n=c(t,e);m&&v.push([t,e]);if(T){y=t,b=e,w=n;T=!1;if(n){s.lineStart();s.point(t,e)}}else if(n&&S)s.point(t,e);else{var r={a:{x:x,y:C},b:{x:t,y:e}};if(D(r)){if(!S){s.lineStart();s.point(r.a.x,r.a.y)}s.point(r.b.x,r.b.y);n||s.lineEnd();k=!1}else if(n){s.lineStart();s.point(t,e);k=!1}}x=t,C=e,S=n}var g,m,v,y,b,w,x,C,S,T,k,M=s,_=He(),D=Ue(t,e,n,r),L={point:f,lineStart:h,lineEnd:d,polygonStart:function(){s=_;g=[];m=[];k=!0},polygonEnd:function(){s=M;g=ia.merge(g);var e=l([t,r]),n=k&&e,i=g.length;if(n||i){s.polygonStart();if(n){s.lineStart();u(null,null,1,s);s.lineEnd()}i&&Ne(g,o,e,u,s);s.polygonEnd()}g=m=v=null}};return L}}function Ve(t){var e=0,n=ja/3,r=ln(t),i=r(e,n);i.parallels=function(t){return arguments.length?r(e=t[0]*ja/180,n=t[1]*ja/180):[e/ja*180,n/ja*180]};return i}function Xe(t,e){function n(t,e){var n=Math.sqrt(o-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,o=1+r*(2*i-r),a=Math.sqrt(o)/i;n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,rt((o-(t*t+n*n)*i*i)/(2*i))]};return n}function Ge(){function t(t,e){Rs+=i*t-r*e;r=t,i=e}var e,n,r,i;Us.point=function(o,a){Us.point=t;e=r=o,n=i=a};Us.lineEnd=function(){t(e,n)}}function Ye(t,e){Fs>t&&(Fs=t);t>zs&&(zs=t);Ws>e&&(Ws=e);e>qs&&(qs=e)}function $e(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e);s.point=n}function n(t,e){a.push("L",t,",",e)}function r(){s.point=t}function i(){a.push("Z")}var o=Je(4.5),a=[],s={point:t,lineStart:function(){s.point=e},lineEnd:r,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=r;s.point=t},pointRadius:function(t){o=Je(t);return s},result:function(){if(a.length){var t=a.join("");a=[];return t}}};return s}function Je(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ke(t,e){ks+=t;Ms+=e;++_s}function Ze(){function t(t,r){var i=t-e,o=r-n,a=Math.sqrt(i*i+o*o);Ds+=a*(e+t)/2;Ls+=a*(n+r)/2;As+=a;Ke(e=t,n=r)}var e,n;Vs.point=function(r,i){Vs.point=t;Ke(e=r,n=i)}}function Qe(){Vs.point=Ke}function tn(){function t(t,e){var n=t-r,o=e-i,a=Math.sqrt(n*n+o*o);Ds+=a*(r+t)/2;Ls+=a*(i+e)/2;As+=a;a=i*t-r*e;Ns+=a*(r+t);Es+=a*(i+e);Ps+=3*a;Ke(r=t,i=e)}var e,n,r,i;Vs.point=function(o,a){Vs.point=t;Ke(e=r=o,n=i=a)};Vs.lineEnd=function(){t(e,n)}}function en(t){function e(e,n){t.moveTo(e+a,n);t.arc(e,n,a,0,Ia)}function n(e,n){t.moveTo(e,n);s.point=r}function r(e,n){t.lineTo(e,n)}function i(){s.point=e}function o(){t.closePath()}var a=4.5,s={point:e,lineStart:function(){s.point=n},lineEnd:i,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=i;s.point=e},pointRadius:function(t){a=t;return s},result:S};return s}function nn(t){function e(t){return(s?r:n)(t)}function n(e){return an(e,function(n,r){n=t(n,r);e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r);e.point(n[0],n[1])}function r(){b=0/0;T.point=o;e.lineStart()}function o(n,r){var o=me([n,r]),a=t(n,r);i(b,w,y,x,C,S,b=a[0],w=a[1],y=n,x=o[0],C=o[1],S=o[2],s,e);e.point(b,w)}function a(){T.point=n;e.lineEnd()}function l(){r();T.point=u;T.lineEnd=c}function u(t,e){o(f=t,h=e),d=b,p=w,g=x,m=C,v=S;T.point=o}function c(){i(b,w,y,x,C,S,d,p,f,g,m,v,s,e);T.lineEnd=a;a()}var f,h,d,p,g,m,v,y,b,w,x,C,S,T={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart();T.lineStart=l},polygonEnd:function(){e.polygonEnd();T.lineStart=r}};return T}function i(e,n,r,s,l,u,c,f,h,d,p,g,m,v){var y=c-e,b=f-n,w=y*y+b*b;if(w>4*o&&m--){var x=s+d,C=l+p,S=u+g,T=Math.sqrt(x*x+C*C+S*S),k=Math.asin(S/=T),M=ma(ma(S)-1)o||ma((y*A+b*N)/w-.5)>.3||a>s*d+l*p+u*g){i(e,n,r,s,l,u,D,L,M,x/=T,C/=T,S,m,v);v.point(D,L);i(D,L,M,x,C,S,c,f,h,d,p,g,m,v)}}}var o=.5,a=Math.cos(30*Ra),s=16;e.precision=function(t){if(!arguments.length)return Math.sqrt(o);s=(o=t*t)>0&&16;return e};return e}function rn(t){var e=nn(function(e,n){return t([e*Fa,n*Fa])});return function(t){return un(e(t))}}function on(t){this.stream=t}function an(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sn(t){return ln(function(){return t})()}function ln(t){function e(t){t=s(t[0]*Ra,t[1]*Ra);return[t[0]*h+l,u-t[1]*h]}function n(t){t=s.invert((t[0]-l)/h,(u-t[1])/h);return t&&[t[0]*Fa,t[1]*Fa]}function r(){s=Le(a=hn(v,y,b),o);var t=o(g,m);l=d-t[0]*h;u=p+t[1]*h;return i()}function i(){c&&(c.valid=!1,c=null);return e}var o,a,s,l,u,c,f=nn(function(t,e){t=o(t,e);return[t[0]*h+l,u-t[1]*h]}),h=150,d=480,p=250,g=0,m=0,v=0,y=0,b=0,x=Is,C=w,S=null,T=null;e.stream=function(t){c&&(c.valid=!1);c=un(x(a,f(C(t))));c.valid=!0;return c};e.clipAngle=function(t){if(!arguments.length)return S;x=null==t?(S=t,Is):qe((S=+t)*Ra);return i()};e.clipExtent=function(t){if(!arguments.length)return T;T=t;C=t?Be(t[0][0],t[0][1],t[1][0],t[1][1]):w;return i()};e.scale=function(t){if(!arguments.length)return h;h=+t;return r()};e.translate=function(t){if(!arguments.length)return[d,p];d=+t[0];p=+t[1];return r()};e.center=function(t){if(!arguments.length)return[g*Fa,m*Fa];g=t[0]%360*Ra;m=t[1]%360*Ra;return r()};e.rotate=function(t){if(!arguments.length)return[v*Fa,y*Fa,b*Fa];v=t[0]%360*Ra;y=t[1]%360*Ra;b=t.length>2?t[2]%360*Ra:0;return r()};ia.rebind(e,f,"precision");return function(){o=t.apply(this,arguments);e.invert=o.invert&&n;return r()}}function un(t){return an(t,function(e,n){t.point(e*Ra,n*Ra)})}function cn(t,e){return[t,e]}function fn(t,e){return[t>ja?t-Ia:-ja>t?t+Ia:t,e]}function hn(t,e,n){return t?e||n?Le(pn(t),gn(e,n)):pn(t):e||n?gn(e,n):fn}function dn(t){return function(e,n){return e+=t,[e>ja?e-Ia:-ja>e?e+Ia:e,n]}}function pn(t){var e=dn(t);e.invert=dn(-t);return e}function gn(t,e){function n(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*r+s*i;return[Math.atan2(l*o-c*a,s*r-u*i),rt(c*o+l*a)]}var r=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e);n.invert=function(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*o-l*a;return[Math.atan2(l*o+u*a,s*r+c*i),rt(c*r-s*i)]};return n}function mn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,s){var l=a*e;if(null!=i){i=vn(n,i);o=vn(n,o);(a>0?o>i:i>o)&&(i+=a*Ia)}else{i=t+a*Ia;o=t-.5*l}for(var u,c=i;a>0?c>o:o>c;c-=l)s.point((u=Ce([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],u[1])}}function vn(t,e){var n=me(e);n[0]-=t;xe(n);var r=nt(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Ea)%(2*Math.PI)}function yn(t,e,n){var r=ia.range(t,e-Ea,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function bn(t,e,n){var r=ia.range(t,e-Ea,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function wn(t){return t.source}function xn(t){return t.target}function Cn(t,e,n,r){var i=Math.cos(e),o=Math.sin(e),a=Math.cos(r),s=Math.sin(r),l=i*Math.cos(t),u=i*Math.sin(t),c=a*Math.cos(n),f=a*Math.sin(n),h=2*Math.asin(Math.sqrt(st(r-e)+i*a*st(n-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,n=Math.sin(h-t)*d,r=n*l+e*c,i=n*u+e*f,a=n*o+e*s;return[Math.atan2(i,r)*Fa,Math.atan2(a,Math.sqrt(r*r+i*i))*Fa]}:function(){return[t*Fa,e*Fa]};p.distance=h;return p}function Sn(){function t(t,i){var o=Math.sin(i*=Ra),a=Math.cos(i),s=ma((t*=Ra)-e),l=Math.cos(s);Xs+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=r*o-n*a*l)*s),n*o+r*a*l);e=t,n=o,r=a}var e,n,r;Gs.point=function(i,o){e=i*Ra,n=Math.sin(o*=Ra),r=Math.cos(o);Gs.point=t};Gs.lineEnd=function(){Gs.point=Gs.lineEnd=S}}function Tn(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),o=t(r*i);return[o*i*Math.sin(e),o*Math.sin(n)]}n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,r*a),Math.asin(r&&n*o/r)]};return n}function kn(t,e){function n(t,e){a>0?-Oa+Ea>e&&(e=-Oa+Ea):e>Oa-Ea&&(e=Oa-Ea);var n=a/Math.pow(i(e),o);return[n*Math.sin(o*t),a-n*Math.cos(o*t)]}var r=Math.cos(t),i=function(t){return Math.tan(ja/4+t/2)},o=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),a=r*Math.pow(i(t),o)/o;if(!o)return _n;n.invert=function(t,e){var n=a-e,r=tt(o)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/o,2*Math.atan(Math.pow(a/r,1/o))-Oa]};return n}function Mn(t,e){function n(t,e){var n=o-e;return[n*Math.sin(i*t),o-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),o=r/i+t;if(ma(i)i;i++){for(;r>1&&et(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Pn(t,e){return t[0]-e[0]||t[1]-e[1]}function jn(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function In(t,e,n,r){var i=t[0],o=n[0],a=e[0]-i,s=r[0]-o,l=t[1],u=n[1],c=e[1]-l,f=r[1]-u,h=(s*(l-u)-f*(i-o))/(f*a-s*c);return[i+h*a,l+h*c]}function Hn(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function On(){ir(this);this.edge=this.site=this.circle=null}function Rn(t){var e=ol.pop()||new On;e.site=t;return e}function Fn(t){ $n(t);nl.remove(t);ol.push(t);ir(t)}function Wn(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},o=t.P,a=t.N,s=[t];Fn(t);for(var l=o;l.circle&&ma(n-l.circle.x)c;++c){u=s[c];l=s[c-1];er(u.edge,l.site,u.site,i)}l=s[0];u=s[f-1];u.edge=Qn(l.site,u.site,null,i);Yn(l);Yn(u)}function zn(t){for(var e,n,r,i,o=t.x,a=t.y,s=nl._;s;){r=qn(s,a)-o;if(r>Ea)s=s.L;else{i=o-Un(s,a);if(!(i>Ea)){if(r>-Ea){e=s.P;n=s}else if(i>-Ea){e=s;n=s.N}else e=n=s;break}if(!s.R){e=s;break}s=s.R}}var l=Rn(t);nl.insert(e,l);if(e||n)if(e!==n)if(n){$n(e);$n(n);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=n.site,g=p.x-c,m=p.y-f,v=2*(h*m-d*g),y=h*h+d*d,b=g*g+m*m,w={x:(m*y-d*b)/v+c,y:(h*b-g*y)/v+f};er(n.edge,u,p,w);l.edge=Qn(u,t,null,w);n.edge=Qn(t,p,null,w);Yn(e);Yn(n)}else l.edge=Qn(e.site,l.site);else{$n(e);n=Rn(e.site);nl.insert(l,n);l.edge=n.edge=Qn(e.site,l.site);Yn(e);Yn(n)}}function qn(t,e){var n=t.site,r=n.x,i=n.y,o=i-e;if(!o)return r;var a=t.P;if(!a)return-(1/0);n=a.site;var s=n.x,l=n.y,u=l-e;if(!u)return s;var c=s-r,f=1/o-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-o/2)))/f+r:(r+s)/2}function Un(t,e){var n=t.N;if(n)return qn(n,e);var r=t.site;return r.y===e?r.x:1/0}function Bn(t){this.site=t;this.edges=[]}function Vn(t){for(var e,n,r,i,o,a,s,l,u,c,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],g=el,m=g.length;m--;){o=g[m];if(o&&o.prepare()){s=o.edges;l=s.length;a=0;for(;l>a;){c=s[a].end(),r=c.x,i=c.y;u=s[++a%l].start(),e=u.x,n=u.y;if(ma(r-e)>Ea||ma(i-n)>Ea){s.splice(a,0,new nr(tr(o.site,c,ma(r-f)Ea?{x:f,y:ma(e-f)Ea?{x:ma(n-p)Ea?{x:h,y:ma(e-h)Ea?{x:ma(n-d)=-Pa)){var d=l*l+u*u,p=c*c+f*f,g=(f*d-u*p)/h,m=(l*p-c*d)/h,f=m+s,v=al.pop()||new Gn;v.arc=t;v.site=i;v.x=g+a;v.y=f+Math.sqrt(g*g+m*m);v.cy=f;t.circle=v;for(var y=null,b=il._;b;)if(v.ym||m>=s)return;if(h>p){if(o){if(o.y>=u)return}else o={x:m,y:l};n={x:m,y:u}}else{if(o){if(o.yr||r>1)if(h>p){if(o){if(o.y>=u)return}else o={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(o){if(o.yd){if(o){if(o.x>=s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}else{if(o){if(o.xo||f>a||r>h||i>d)){if(p=t.point){var p,g=e-t.x,m=n-t.y,v=g*g+m*m;if(l>v){var y=Math.sqrt(l=v);r=e-y,i=n-y;o=e+y,a=n+y;s=p}}for(var b=t.nodes,w=.5*(c+h),x=.5*(f+d),C=e>=w,S=n>=x,T=S<<1|C,k=T+4;k>T;++T)if(t=b[3&T])switch(3&T){case 0:u(t,c,f,w,x);break;case 1:u(t,w,f,h,x);break;case 2:u(t,c,x,w,d);break;case 3:u(t,w,x,h,d)}}})(t,r,i,o,a);return s}function mr(t,e){t=ia.rgb(t);e=ia.rgb(e);var n=t.r,r=t.g,i=t.b,o=e.r-n,a=e.g-r,s=e.b-i;return function(t){return"#"+Ct(Math.round(n+o*t))+Ct(Math.round(r+a*t))+Ct(Math.round(i+s*t))}}function vr(t,e){var n,r={},i={};for(n in t)n in e?r[n]=wr(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function yr(t,e){t=+t,e=+e;return function(n){return t*(1-n)+e*n}}function br(t,e){var n,r,i,o=ll.lastIndex=ul.lastIndex=0,a=-1,s=[],l=[];t+="",e+="";for(;(n=ll.exec(t))&&(r=ul.exec(e));){if((i=r.index)>o){i=e.slice(o,i);s[a]?s[a]+=i:s[++a]=i}if((n=n[0])===(r=r[0]))s[a]?s[a]+=r:s[++a]=r;else{s[++a]=null;l.push({i:a,x:yr(n,r)})}o=ul.lastIndex}if(or;++r)s[(n=l[r]).i]=n.x(t);return s.join("")})}function wr(t,e){for(var n,r=ia.interpolators.length;--r>=0&&!(n=ia.interpolators[r](t,e)););return n}function xr(t,e){var n,r=[],i=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;s>n;++n)r.push(wr(t[n],e[n]));for(;o>n;++n)i[n]=t[n];for(;a>n;++n)i[n]=e[n];return function(t){for(n=0;s>n;++n)i[n]=r[n](t);return i}}function Cr(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function Sr(t){return function(e){return 1-t(1-e)}}function Tr(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function kr(t){return t*t}function Mr(t){return t*t*t}function _r(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Dr(t){return function(e){return Math.pow(e,t)}}function Lr(t){return 1-Math.cos(t*Oa)}function Ar(t){return Math.pow(2,10*(t-1))}function Nr(t){return 1-Math.sqrt(1-t*t)}function Er(t,e){var n;arguments.length<2&&(e=.45);arguments.length?n=e/Ia*Math.asin(1/t):(t=1,n=e/4);return function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Ia/e)}}function Pr(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}}function jr(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Ir(t,e){t=ia.hcl(t);e=ia.hcl(e);var n=t.h,r=t.c,i=t.l,o=e.h-n,a=e.c-r,s=e.l-i;isNaN(a)&&(a=0,r=isNaN(r)?e.c:r);isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360);return function(t){return ht(n+o*t,r+a*t,i+s*t)+""}}function Hr(t,e){t=ia.hsl(t);e=ia.hsl(e);var n=t.h,r=t.s,i=t.l,o=e.h-n,a=e.s-r,s=e.l-i;isNaN(a)&&(a=0,r=isNaN(r)?e.s:r);isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360);return function(t){return ct(n+o*t,r+a*t,i+s*t)+""}}function Or(t,e){t=ia.lab(t);e=ia.lab(e);var n=t.l,r=t.a,i=t.b,o=e.l-n,a=e.a-r,s=e.b-i;return function(t){return pt(n+o*t,r+a*t,i+s*t)+""}}function Rr(t,e){e-=t;return function(n){return Math.round(t+e*n)}}function Fr(t){var e=[t.a,t.b],n=[t.c,t.d],r=zr(e),i=Wr(e,n),o=zr(qr(n,e,-i))||0;if(e[0]*n[1]180?c+=360:c-u>180&&(u+=360);i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:yr(u,c)})}else c&&r.push(r.pop()+"rotate("+c+")");f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:yr(f,h)}):h&&r.push(r.pop()+"skewX("+h+")");if(d[0]!=p[0]||d[1]!=p[1]){n=r.push(r.pop()+"scale(",null,",",null,")");i.push({i:n-4,x:yr(d[0],p[0])},{i:n-2,x:yr(d[1],p[1])})}else(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")");n=i.length;return function(t){for(var e,o=-1;++o=0;)n.push(i[r])}}function ni(t,e){for(var n=[t],r=[];null!=(t=n.pop());){r.push(t);if((o=t.children)&&(i=o.length))for(var i,o,a=-1;++an;++n)if((e=t[n][1])>i){r=n;i=e}return r}function di(t){return t.reduce(pi,0)}function pi(t,e){return t+e[1]}function gi(t,e){return mi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function mi(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function vi(t){return[ia.min(t),ia.max(t)]}function yi(t,e){return t.value-e.value}function bi(t,e){var n=t._pack_next;t._pack_next=e;e._pack_prev=t;e._pack_next=n;n._pack_prev=e}function wi(t,e){t._pack_next=e;e._pack_prev=t}function xi(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function Ci(t){function e(t){c=Math.min(t.x-t.r,c);f=Math.max(t.x+t.r,f);h=Math.min(t.y-t.r,h);d=Math.max(t.y+t.r,d)}if((n=t.children)&&(u=n.length)){var n,r,i,o,a,s,l,u,c=1/0,f=-(1/0),h=1/0,d=-(1/0);n.forEach(Si);r=n[0];r.x=-r.r;r.y=0;e(r);if(u>1){i=n[1];i.x=i.r;i.y=0;e(i);if(u>2){o=n[2];Mi(r,i,o);e(o);bi(r,o);r._pack_prev=o;bi(o,i);i=r._pack_next;for(a=3;u>a;a++){Mi(r,i,o=n[a]);var p=0,g=1,m=1;for(s=i._pack_next;s!==i;s=s._pack_next,g++)if(xi(s,o)){p=1;break}if(1==p)for(l=r._pack_prev;l!==s._pack_prev&&!xi(l,o);l=l._pack_prev,m++);if(p){m>g||g==m&&i.ra;a++){o=n[a];o.x-=v;o.y-=y;b=Math.max(b,o.r+Math.sqrt(o.x*o.x+o.y*o.y))}t.r=b;n.forEach(Ti)}}function Si(t){t._pack_next=t._pack_prev=t}function Ti(t){delete t._pack_next;delete t._pack_prev}function ki(t,e,n,r){var i=t.children;t.x=e+=r*t.x;t.y=n+=r*t.y;t.r*=r;if(i)for(var o=-1,a=i.length;++o=0;){e=i[o];e.z+=n;e.m+=n;n+=e.s+(r+=e.c)}}function Ei(t,e,n){return t.a.parent===e.parent?t.a:n}function Pi(t){return 1+ia.max(t,function(t){return t.y})}function ji(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ii(t){var e=t.children;return e&&e.length?Ii(e[0]):t}function Hi(t){var e,n=t.children;return n&&(e=n.length)?Hi(n[e-1]):t}function Oi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ri(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];if(0>i){n+=i/2;i=0}if(0>o){r+=o/2;o=0}return{x:n,y:r,dx:i,dy:o}}function Fi(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Wi(t){return t.rangeExtent?t.rangeExtent():Fi(t.range())}function zi(t,e,n,r){var i=n(t[0],t[1]),o=r(e[0],e[1]);return function(t){return o(i(t))}}function qi(t,e){var n,r=0,i=t.length-1,o=t[r],a=t[i];if(o>a){n=r,r=i,i=n;n=o,o=a,a=n}t[r]=e.floor(o);t[i]=e.ceil(a);return t}function Ui(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:wl}function Bi(t,e,n,r){var i=[],o=[],a=0,s=Math.min(t.length,e.length)-1;if(t[s]2?Bi:zi,l=r?Vr:Br;a=i(t,e,l,n);s=i(e,t,l,wr);return o}function o(t){return a(t)}var a,s;o.invert=function(t){return s(t)};o.domain=function(e){if(!arguments.length)return t;t=e.map(Number);return i()};o.range=function(t){if(!arguments.length)return e;e=t;return i()};o.rangeRound=function(t){return o.range(t).interpolate(Rr)};o.clamp=function(t){if(!arguments.length)return r;r=t;return i()};o.interpolate=function(t){if(!arguments.length)return n;n=t;return i()};o.ticks=function(e){return $i(t,e)};o.tickFormat=function(e,n){return Ji(t,e,n)};o.nice=function(e){Gi(t,e);return i()};o.copy=function(){return Vi(t,e,n,r)};return i()}function Xi(t,e){return ia.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Gi(t,e){return qi(t,Ui(Yi(t,e)[2]))}function Yi(t,e){null==e&&(e=10);var n=Fi(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*i;.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2);n[0]=Math.ceil(n[0]/i)*i;n[1]=Math.floor(n[1]/i)*i+.5*i;n[2]=i;return n}function $i(t,e){return ia.range.apply(ia,Yi(t,e))}function Ji(t,e,n){var r=Yi(t,e);if(n){var i=ls.exec(n);i.shift();if("s"===i[8]){var o=ia.formatPrefix(Math.max(ma(r[0]),ma(r[1])));i[7]||(i[7]="."+Ki(o.scale(r[2])));i[8]="f";n=ia.format(i.join(""));return function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+Zi(i[8],r));n=i.join("")}else n=",."+Ki(r[2])+"f";return ia.format(n)}function Ki(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Zi(t,e){var n=Ki(e[2]);return t in xl?Math.abs(n-Ki(Math.max(ma(e[0]),ma(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Qi(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}a.invert=function(e){return o(t.invert(e))};a.domain=function(e){if(!arguments.length)return r;n=e[0]>=0;t.domain((r=e.map(Number)).map(i));return a};a.base=function(n){if(!arguments.length)return e;e=+n;t.domain(r.map(i));return a};a.nice=function(){var e=qi(r.map(i),n?Math:Sl);t.domain(e);r=e.map(o);return a};a.ticks=function(){var t=Fi(r),a=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(c-u)){if(n){for(;c>u;u++)for(var h=1;f>h;h++)a.push(o(u)*h);a.push(o(u))}else{a.push(o(u));for(;u++0;h--)a.push(o(u)*h)}for(u=0;a[u]l;c--);a=a.slice(u,c)}return a};a.tickFormat=function(t,e){if(!arguments.length)return Cl;arguments.length<2?e=Cl:"function"!=typeof e&&(e=ia.format(e));var r,s=Math.max(.1,t/a.ticks().length),l=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/o(l(i(t)+r))<=s?e(t):""}};a.copy=function(){return Qi(t.copy(),e,n,r)};return Xi(a,t)}function to(t,e,n){function r(e){return t(i(e))}var i=eo(e),o=eo(1/e);r.invert=function(e){return o(t.invert(e))};r.domain=function(e){if(!arguments.length)return n;t.domain((n=e.map(Number)).map(i));return r};r.ticks=function(t){return $i(n,t)};r.tickFormat=function(t,e){return Ji(n,t,e)};r.nice=function(t){return r.domain(Gi(n,t))};r.exponent=function(a){if(!arguments.length)return e;i=eo(e=a);o=eo(1/e);t.domain(n.map(i));return r};r.copy=function(){return to(t.copy(),e,n)};return Xi(r,t)}function eo(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function no(t,e){function n(n){return o[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%o.length]}function r(e,n){return ia.range(t.length).map(function(t){return e+n*t})}var i,o,a;n.domain=function(r){if(!arguments.length)return t;t=[];i=new f;for(var o,a=-1,s=r.length;++an?[0/0,0/0]:[n>0?s[n-1]:t[0],ne?0/0:e/o+t;return[e,e+1/o]};r.copy=function(){return io(t,e,n)};return i()}function oo(t,e){function n(n){return n>=n?e[ia.bisect(t,n)]:void 0}n.domain=function(e){if(!arguments.length)return t;t=e;return n};n.range=function(t){if(!arguments.length)return e;e=t;return n};n.invertExtent=function(n){n=e.indexOf(n);return[t[n-1],t[n]]};n.copy=function(){return oo(t,e)};return n}function ao(t){function e(t){return+t}e.invert=e;e.domain=e.range=function(n){if(!arguments.length)return t;t=n.map(e);return e};e.ticks=function(e){return $i(t,e)};e.tickFormat=function(e,n){return Ji(t,e,n)};e.copy=function(){return ao(t)};return e}function so(){return 0}function lo(t){return t.innerRadius}function uo(t){return t.outerRadius}function co(t){return t.startAngle}function fo(t){return t.endAngle}function ho(t){return t&&t.padAngle}function po(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function go(t,e,n,r,i){var o=t[0]-e[0],a=t[1]-e[1],s=(i?r:-r)/Math.sqrt(o*o+a*a),l=s*a,u=-s*o,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,m=h-c,v=d-f,y=m*m+v*v,b=n-r,w=c*d-h*f,x=(0>v?-1:1)*Math.sqrt(b*b*y-w*w),C=(w*v-m*x)/y,S=(-w*m-v*x)/y,T=(w*v+m*x)/y,k=(-w*m+v*x)/y,M=C-p,_=S-g,D=T-p,L=k-g;M*M+_*_>D*D+L*L&&(C=T,S=k);return[[C-l,S-u],[C*n/b,S*n/b]]}function mo(t){function e(e){function a(){u.push("M",o(t(c),s))}for(var l,u=[],c=[],f=-1,h=e.length,d=Dt(n),p=Dt(r);++f1&&i.push("H",r[0]);return i.join("")}function wo(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e1){s=e[1];o=t[l];l++;r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u9){i=3*e/Math.sqrt(i);a[s]=i*n;a[s+1]=i*r}}}s=-1;for(;++s<=l;){i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s]));o.push([i||0,a[s]*i||0])}return o}function Ho(t){return t.length<3?vo(t):t[0]+ko(t,Io(t))}function Oo(t){for(var e,n,r,i=-1,o=t.length;++ir)return c();var i=o[o.active];if(i){--o.count;delete o[o.active];i.event&&i.event.interrupt.call(t,t.__data__,i.index)}o.active=r;a.event&&a.event.start.call(t,t.__data__,e);a.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)});h=a.ease;f=a.duration;ia.timer(function(){p.c=u(n||1)?Ae:u;return 1},0,s)}function u(n){if(o.active!==r)return 1;for(var i=n/f,s=h(i),l=g.length;l>0;)g[--l].call(t,s);if(i>=1){a.event&&a.event.end.call(t,t.__data__,e);return c()}}function c(){--o.count?delete o[r]:delete t[n];return 1}var f,h,d=a.delay,p=os,g=[];p.t=d+s;if(i>=d)return l(i-d);p.c=l;return void 0},0,s)}}function Ko(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Zo(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Qo(t){return t.toISOString()}function ta(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,o=ia.bisect(Yl,i);return o==Yl.length?[e.year,Yi(t.map(function(t){return t/31536e6}),n)[2]]:o?e[i/Yl[o-1]1?{floor:function(e){for(;n(e=t.floor(e));)e=ea(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=ea(+e+1);return e}}:t))};r.ticks=function(t,e){var n=Fi(r.domain()),o=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];o&&(t=o[0],e=o[1]);return t.range(n[0],ea(+n[1]+1),1>e?1:e)};r.tickFormat=function(){return n};r.copy=function(){return ta(t.copy(),e,n)};return Xi(r,t)}function ea(t){return new Date(t)}function na(t){return JSON.parse(t.responseText)}function ra(t){var e=sa.createRange();e.selectNode(sa.body);return e.createContextualFragment(t.responseText)}var ia={version:"3.5.5"},oa=[].slice,aa=function(t){return oa.call(t)},sa=this.document;if(sa)try{aa(sa.documentElement.childNodes)[0].nodeType}catch(la){aa=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}Date.now||(Date.now=function(){return+new Date});if(sa)try{sa.createElement("DIV").style.setProperty("opacity",0,"")}catch(ua){var ca=this.Element.prototype,fa=ca.setAttribute,ha=ca.setAttributeNS,da=this.CSSStyleDeclaration.prototype,pa=da.setProperty;ca.setAttribute=function(t,e){fa.call(this,t,e+"")};ca.setAttributeNS=function(t,e,n){ha.call(this,t,e,n+"")};da.setProperty=function(t,e,n){pa.call(this,t,e+"",n)}}ia.ascending=i;ia.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0};ia.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++ir&&(n=r)}else{for(;++i=r){n=r;break}for(;++ir&&(n=r)}return n};ia.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i=r){n=r;break}for(;++in&&(n=r)}else{for(;++i=r){n=r;break}for(;++in&&(n=r)}return n};ia.extent=function(t,e){var n,r,i,o=-1,a=t.length;if(1===arguments.length){for(;++o=r){n=i=r;break}for(;++or&&(n=r);r>i&&(i=r)}}else{for(;++o=r){n=i=r;break}for(;++or&&(n=r);r>i&&(i=r)}}return[n,i]};ia.sum=function(t,e){var n,r=0,i=t.length,o=-1;if(1===arguments.length)for(;++o1?l/(c-1):void 0};ia.deviation=function(){var t=ia.variance.apply(this,arguments);return t?Math.sqrt(t):t};var ga=s(i);ia.bisectLeft=ga.left;ia.bisect=ia.bisectRight=ga.right;ia.bisector=function(t){return s(1===t.length?function(e,n){return i(t(e),n)}:t)};ia.shuffle=function(t,e,n){if((o=arguments.length)<3){n=t.length;2>o&&(e=0)}for(var r,i,o=n-e;o;){i=Math.random()*o--|0;r=t[o+e],t[o+e]=t[i+e],t[i+e]=r}return t};ia.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r};ia.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],o=new Array(0>r?0:r);r>n;)o[n]=[e=i,i=t[++n]];return o};ia.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=ia.min(arguments,l),n=new Array(e);++t=0;){r=t[i];e=r.length;for(;--e>=0;)n[--a]=r[e]}return n};var ma=Math.abs;ia.range=function(t,e,n){if(arguments.length<3){n=1;if(arguments.length<2){e=t;t=0}}if((e-t)/n===1/0)throw new Error("infinite range");var r,i=[],o=u(ma(n)),a=-1;t*=o,e*=o,n*=o;if(0>n)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)=o.length)return r?r.call(i,a):n?a.sort(n):a;for(var l,u,c,h,d=-1,p=a.length,g=o[s++],m=new f;++d=o.length)return t;var r=[],i=a[n++];t.forEach(function(t,i){r.push({key:t,values:e(i,n)})});return i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},o=[],a=[];i.map=function(e,n){return t(n,e,0)};i.entries=function(n){return e(t(ia.map,n,0),0)};i.key=function(t){o.push(t);return i};i.sortKeys=function(t){a[o.length-1]=t;return i};i.sortValues=function(t){n=t;return i};i.rollup=function(t){r=t;return i};return i};ia.set=function(t){var e=new b;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e};c(b,{has:p,add:function(t){this._[h(t+="")]=!0;return t},remove:g,values:m,size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}});ia.behavior={};ia.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r=0){r=t.slice(n+1);t=t.slice(0,n)}if(t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}};ia.event=null;ia.requote=function(t){return t.replace(wa,"\\$&")};var wa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,xa={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},Ca=function(t,e){return e.querySelector(t)},Sa=function(t,e){return e.querySelectorAll(t)},Ta=function(t,e){var n=t.matches||t[C(t,"matchesSelector")];Ta=function(t,e){return n.call(t,e)};return Ta(t,e)};if("function"==typeof Sizzle){Ca=function(t,e){return Sizzle(t,e)[0]||null};Sa=Sizzle;Ta=Sizzle.matchesSelector}ia.selection=function(){return ia.select(sa.documentElement)};var ka=ia.selection.prototype=[];ka.select=function(t){var e,n,r,i,o=[];t=A(t);for(var a=-1,s=this.length;++a=0){n=t.slice(0,e);t=t.slice(e+1)}return Ma.hasOwnProperty(n)?{space:Ma[n],local:t}:t}};ka.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();t=ia.ns.qualify(t);return t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(E(e,t[e]));return this}return this.each(E(t,e))};ka.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=I(t)).length,i=-1;if(e=n.classList){for(;++ii){if("string"!=typeof t){2>i&&(e="");for(n in t)this.each(R(n,t[n],e));return this}if(2>i){var o=this.node();return r(o).getComputedStyle(o,null).getPropertyValue(t)}n=""}return this.each(R(t,e,n))};ka.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))};ka.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent};ka.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML};ka.append=function(t){t=W(t);return this.select(function(){return this.appendChild(t.apply(this,arguments))})};ka.insert=function(t,e){t=W(t);e=A(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})};ka.remove=function(){return this.each(z)};ka.data=function(t,e){function n(t,n){var r,i,o,a=t.length,c=n.length,h=Math.min(a,c),d=new Array(c),p=new Array(c),g=new Array(a);if(e){var m,v=new f,y=new Array(a);for(r=-1;++rr;++r)p[r]=q(n[r]);for(;a>r;++r)g[r]=t[r]}p.update=d;p.parentNode=d.parentNode=g.parentNode=t.parentNode;s.push(p);l.push(d);u.push(g)}var r,i,o=-1,a=this.length;if(!arguments.length){t=new Array(a=(r=this[0]).length);for(;++oo;o++){i.push(e=[]);e.parentNode=(n=this[o]).parentNode;for(var s=0,l=n.length;l>s;s++)(r=n[s])&&t.call(r,r.__data__,s,o)&&e.push(r)}return L(i)};ka.order=function(){for(var t=-1,e=this.length;++t=0;)if(n=r[i]){o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o);o=n}return this};ka.sort=function(t){t=B.apply(this,arguments);for(var e=-1,n=this.length;++et;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var o=n[r];if(o)return o}return null};ka.size=function(){var t=0;V(this,function(){++t});return t};var _a=[];ia.selection.enter=X;ia.selection.enter.prototype=_a;_a.append=ka.append;_a.empty=ka.empty;_a.node=ka.node;_a.call=ka.call;_a.size=ka.size;_a.select=function(t){for(var e,n,r,i,o,a=[],s=-1,l=this.length;++sr){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(Y(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(Y(t,e,n))};var Da=ia.map({mouseenter:"mouseover",mouseleave:"mouseout"});sa&&Da.forEach(function(t){"on"+t in sa&&Da.remove(t)});var La,Aa=0;ia.mouse=function(t){return Z(t,_())};var Na=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ia.touch=function(t,e,n){arguments.length<3&&(n=e,e=_().changedTouches);if(e)for(var r,i=0,o=e.length;o>i;++i)if((r=e[i]).identifier===n)return Z(t,r)};ia.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function e(t,e,r,o,a){return function(){function s(){var t,n,r=e(h,g);if(r){t=r[0]-b[0];n=r[1]-b[1];p|=t|n;b=r;d({type:"drag",x:r[0]+u[0],y:r[1]+u[1],dx:t,dy:n})}}function l(){if(e(h,g)){v.on(o+m,null).on(a+m,null);y(p&&ia.event.target===f);d({type:"dragend"})}}var u,c=this,f=ia.event.target,h=c.parentNode,d=n.of(c,arguments),p=0,g=t(),m=".drag"+(null==g?"":"-"+g),v=ia.select(r(f)).on(o+m,s).on(a+m,l),y=K(f),b=e(h,g);if(i){u=i.apply(c,arguments);u=[u.x-b[0],u.y-b[1]]}else u=[0,0];d({type:"dragstart"})}}var n=D(t,"drag","dragstart","dragend"),i=null,o=e(S,ia.mouse,r,"mousemove","mouseup"),a=e(Q,ia.touch,w,"touchmove","touchend");t.origin=function(e){if(!arguments.length)return i;i=e;return t};return ia.rebind(t,n,"on")};ia.touches=function(t,e){arguments.length<2&&(e=_().touches);return e?aa(e).map(function(e){var n=Z(t,e);n.identifier=e.identifier;return n}):[]};var Ea=1e-6,Pa=Ea*Ea,ja=Math.PI,Ia=2*ja,Ha=Ia-Ea,Oa=ja/2,Ra=ja/180,Fa=180/ja,Wa=Math.SQRT2,za=2,qa=4;ia.interpolateZoom=function(t,e){function n(t){var e=t*y;if(v){var n=ot(g),a=o/(za*h)*(n*at(Wa*e+g)-it(g));return[r+a*u,i+a*c,o*n/ot(Wa*e+g)]}return[r+t*u,i+t*c,o*Math.exp(Wa*e)]}var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1],l=e[2],u=a-r,c=s-i,f=u*u+c*c,h=Math.sqrt(f),d=(l*l-o*o+qa*f)/(2*o*za*h),p=(l*l-o*o-qa*f)/(2*l*za*h),g=Math.log(Math.sqrt(d*d+1)-d),m=Math.log(Math.sqrt(p*p+1)-p),v=m-g,y=(v||Math.log(l/o))/Wa;n.duration=1e3*y;return n};ia.behavior.zoom=function(){function t(t){t.on(N,f).on(Ba+".zoom",d).on("dblclick.zoom",p).on(j,h)}function e(t){return[(t[0]-T.x)/T.k,(t[1]-T.y)/T.k]}function n(t){return[t[0]*T.k+T.x,t[1]*T.k+T.y]}function i(t){T.k=Math.max(_[0],Math.min(_[1],t))}function o(t,e){e=n(e);T.x+=t[0]-e[0];T.y+=t[1]-e[1]}function a(e,n,r,a){e.__chart__={x:T.x,y:T.y,k:T.k};i(Math.pow(2,a));o(m=n,r);e=ia.select(e);L>0&&(e=e.transition().duration(L));e.call(t.event)}function s(){x&&x.domain(w.range().map(function(t){return(t-T.x)/T.k}).map(w.invert));S&&S.domain(C.range().map(function(t){return(t-T.y)/T.k}).map(C.invert))}function l(t){A++||t({type:"zoomstart"})}function u(t){s();t({type:"zoom",scale:T.k,translate:[T.x,T.y]})}function c(t){--A||t({type:"zoomend"});m=null}function f(){function t(){f=1;o(ia.mouse(i),d);u(s)}function n(){h.on(E,null).on(P,null);p(f&&ia.event.target===a);c(s)}var i=this,a=ia.event.target,s=I.of(i,arguments),f=0,h=ia.select(r(i)).on(E,t).on(P,n),d=e(ia.mouse(i)),p=K(i);Rl.call(i);l(s)}function h(){function t(){var t=ia.touches(p);d=T.k;t.forEach(function(t){t.identifier in m&&(m[t.identifier]=e(t))});return t}function n(){var e=ia.event.target;ia.select(e).on(w,r).on(x,s);C.push(e);for(var n=ia.event.changedTouches,i=0,o=n.length;o>i;++i)m[n[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(500>u-b){var c=l[0];a(p,c,m[c.identifier],Math.floor(Math.log(T.k)/Math.LN2)+1);M()}b=u}else if(l.length>1){var c=l[0],f=l[1],h=c[0]-f[0],d=c[1]-f[1];v=h*h+d*d}}function r(){var t,e,n,r,a=ia.touches(p);Rl.call(p);for(var s=0,l=a.length;l>s;++s,r=null){n=a[s];if(r=m[n.identifier]){if(e)break;t=n,e=r}}if(r){var c=(c=n[0]-t[0])*c+(c=n[1]-t[1])*c,f=v&&Math.sqrt(c/v);t=[(t[0]+n[0])/2,(t[1]+n[1])/2];e=[(e[0]+r[0])/2,(e[1]+r[1])/2];i(f*d)}b=null;o(t,e);u(g)}function s(){if(ia.event.touches.length){for(var e=ia.event.changedTouches,n=0,r=e.length;r>n;++n)delete m[e[n].identifier];for(var i in m)return void t()}ia.selectAll(C).on(y,null);S.on(N,f).on(j,h);k();c(g)}var d,p=this,g=I.of(p,arguments),m={},v=0,y=".zoom-"+ia.event.changedTouches[0].identifier,w="touchmove"+y,x="touchend"+y,C=[],S=ia.select(p),k=K(p);n();l(g);S.on(N,null).on(j,n)}function d(){var t=I.of(this,arguments);y?clearTimeout(y):(g=e(m=v||ia.mouse(this)),Rl.call(this),l(t));y=setTimeout(function(){y=null;c(t)},50);M();i(Math.pow(2,.002*Ua())*T.k);o(m,g);u(t)}function p(){var t=ia.mouse(this),n=Math.log(T.k)/Math.LN2;a(this,t,e(t),ia.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,m,v,y,b,w,x,C,S,T={x:0,y:0,k:1},k=[960,500],_=Va,L=250,A=0,N="mousedown.zoom",E="mousemove.zoom",P="mouseup.zoom",j="touchstart.zoom",I=D(t,"zoomstart","zoom","zoomend");Ba||(Ba="onwheel"in sa?(Ua=function(){return-ia.event.deltaY*(ia.event.deltaMode?120:1)},"wheel"):"onmousewheel"in sa?(Ua=function(){return ia.event.wheelDelta},"mousewheel"):(Ua=function(){return-ia.event.detail},"MozMousePixelScroll"));t.event=function(t){t.each(function(){var t=I.of(this,arguments),e=T;if(Hl)ia.select(this).transition().each("start.zoom",function(){T=this.__chart__||{x:0,y:0,k:1};l(t)}).tween("zoom:zoom",function(){var n=k[0],r=k[1],i=m?m[0]:n/2,o=m?m[1]:r/2,a=ia.interpolateZoom([(i-T.x)/T.k,(o-T.y)/T.k,n/T.k],[(i-e.x)/e.k,(o-e.y)/e.k,n/e.k]);return function(e){var r=a(e),s=n/r[2];this.__chart__=T={x:i-r[0]*s,y:o-r[1]*s,k:s};u(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)});else{this.__chart__=T;l(t);u(t);c(t)}})};t.translate=function(e){if(!arguments.length)return[T.x,T.y];T={x:+e[0],y:+e[1],k:T.k};s();return t};t.scale=function(e){if(!arguments.length)return T.k;T={x:T.x,y:T.y,k:+e};s();return t};t.scaleExtent=function(e){if(!arguments.length)return _;_=null==e?Va:[+e[0],+e[1]];return t};t.center=function(e){if(!arguments.length)return v;v=e&&[+e[0],+e[1]];return t};t.size=function(e){if(!arguments.length)return k;k=e&&[+e[0],+e[1]];return t};t.duration=function(e){if(!arguments.length)return L;L=+e;return t};t.x=function(e){if(!arguments.length)return x;x=e;w=e.copy();T={x:0,y:0,k:1};return t};t.y=function(e){if(!arguments.length)return S;S=e;C=e.copy();T={x:0,y:0,k:1};return t};return ia.rebind(t,I,"on")};var Ua,Ba,Va=[0,1/0];ia.color=lt;lt.prototype.toString=function(){return this.rgb()+""};ia.hsl=ut;var Xa=ut.prototype=new lt;Xa.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);return new ut(this.h,this.s,this.l/t)};Xa.darker=function(t){t=Math.pow(.7,arguments.length?t:1);return new ut(this.h,this.s,t*this.l)};Xa.rgb=function(){return ct(this.h,this.s,this.l)};ia.hcl=ft;var Ga=ft.prototype=new lt;Ga.brighter=function(t){return new ft(this.h,this.c,Math.min(100,this.l+Ya*(arguments.length?t:1)))};Ga.darker=function(t){return new ft(this.h,this.c,Math.max(0,this.l-Ya*(arguments.length?t:1)))};Ga.rgb=function(){return ht(this.h,this.c,this.l).rgb()};ia.lab=dt;var Ya=18,$a=.95047,Ja=1,Ka=1.08883,Za=dt.prototype=new lt;Za.brighter=function(t){return new dt(Math.min(100,this.l+Ya*(arguments.length?t:1)),this.a,this.b)};Za.darker=function(t){return new dt(Math.max(0,this.l-Ya*(arguments.length?t:1)),this.a,this.b)};Za.rgb=function(){return pt(this.l,this.a,this.b)};ia.rgb=bt;var Qa=bt.prototype=new lt;Qa.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;if(!e&&!n&&!r)return new bt(i,i,i);e&&i>e&&(e=i);n&&i>n&&(n=i);r&&i>r&&(r=i);return new bt(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))};Qa.darker=function(t){t=Math.pow(.7,arguments.length?t:1);return new bt(t*this.r,t*this.g,t*this.b)};Qa.hsl=function(){return Tt(this.r,this.g,this.b)};Qa.toString=function(){return"#"+Ct(this.r)+Ct(this.g)+Ct(this.b)};var ts=ia.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ts.forEach(function(t,e){ts.set(t,wt(e))});ia.functor=Dt;ia.xhr=Lt(w);ia.dsv=function(t,e){function n(t,n,o){arguments.length<3&&(o=n,n=null);var a=At(t,e,null==n?r:i(n),o);a.row=function(t){return arguments.length?a.response(null==(n=t)?r:i(t)):n};return a}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function o(e){return e.map(a).join(t)}function a(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})};n.parseRows=function(t,e){function n(){if(c>=u)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++c;){var r=t.charCodeAt(c++),s=1;if(10===r)i=!0;else if(13===r){i=!0;10===t.charCodeAt(c)&&(++c,++s)}else if(r!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var r,i,o={},a={},s=[],u=t.length,c=0,f=0;(r=n())!==a;){for(var h=[];r!==o&&r!==a;){h.push(r);r=n()}e&&null==(h=e(h,f++))||s.push(h)}return s};n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new b,i=[];e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))});return[i.map(a).join(t)].concat(e.map(function(e){return i.map(function(t){return a(e[t])}).join(t)})).join("\n")};n.formatRows=function(t){return t.map(o).join("\n")};return n};ia.csv=ia.dsv(",","text/csv");ia.tsv=ia.dsv(" ","text/tab-separated-values");var es,ns,rs,is,os,as=this[C(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};ia.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0);3>r&&(n=Date.now());var i=n+e,o={c:t,t:i,f:!1,n:null};ns?ns.n=o:es=o;ns=o;if(!rs){is=clearTimeout(is);rs=1;as(Pt)}};ia.timer.flush=function(){jt();It()};ia.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ss=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ot);ia.formatPrefix=function(t,e){var n=0;if(t){0>t&&(t*=-1);e&&(t=ia.round(t,Ht(t,e)));n=1+Math.floor(1e-12+Math.log(t)/Math.LN10);n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))}return ss[8+n/3]};var ls=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,us=ia.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=ia.round(t,Ht(t,e))).toFixed(Math.max(0,Math.min(20,Ht(t*(1+1e-15),e))))}}),cs=ia.time={},fs=Date;Wt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){hs.setUTCDate.apply(this._,arguments)},setDay:function(){hs.setUTCDay.apply(this._,arguments)},setFullYear:function(){hs.setUTCFullYear.apply(this._,arguments)},setHours:function(){hs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){hs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){hs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){hs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){hs.setUTCSeconds.apply(this._,arguments)},setTime:function(){hs.setTime.apply(this._,arguments)}};var hs=Date.prototype;cs.year=zt(function(t){t=cs.day(t);t.setMonth(0,1);return t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()});cs.years=cs.year.range;cs.years.utc=cs.year.utc.range;cs.day=zt(function(t){var e=new fs(2e3,0);e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate());return e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1});cs.days=cs.day.range;cs.days.utc=cs.day.utc.range;cs.dayOfYear=function(t){var e=cs.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)};["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=cs[t]=zt(function(t){(t=cs.day(t)).setDate(t.getDate()-(t.getDay()+e)%7);return t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});cs[t+"s"]=n.range;cs[t+"s"].utc=n.utc.range;cs[t+"OfYear"]=function(t){var n=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(n+e)%7)/7)}});cs.week=cs.sunday;cs.weeks=cs.sunday.range;cs.weeks.utc=cs.sunday.utc.range;cs.weekOfYear=cs.sundayOfYear;var ds={"-":"",_:" ",0:"0"},ps=/^\s*\d+/,gs=/^%/;ia.locale=function(t){return{numberFormat:Rt(t),timeFormat:Ut(t)}};var ms=ia.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ia.format=ms.numberFormat;ia.geo={};ce.prototype={s:0,t:0,add:function(t){fe(t,this.t,vs);fe(vs.s,this.s,this);this.s?this.t+=vs.t:this.s=vs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vs=new ce;ia.geo.stream=function(t,e){t&&ys.hasOwnProperty(t.type)?ys[t.type](t,e):he(t,e)};var ys={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rt?4*ja+t:t;Cs.lineStart=Cs.lineEnd=Cs.point=S}};ia.geo.bounds=function(){function t(t,e){b.push(w=[c=t,h=t]);f>e&&(f=e);e>d&&(d=e)}function e(e,n){var r=me([e*Ra,n*Ra]);if(v){var i=ye(v,r),o=[i[1],-i[0],0],a=ye(o,i);xe(a);a=Ce(a);var l=e-p,u=l>0?1:-1,g=a[0]*Fa*u,m=ma(l)>180;if(m^(g>u*p&&u*e>g)){var y=a[1]*Fa;y>d&&(d=y)}else if(g=(g+360)%360-180,m^(g>u*p&&u*e>g)){var y=-a[1]*Fa;f>y&&(f=y)}else{f>n&&(f=n);n>d&&(d=n)}if(m)p>e?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e);else if(h>=c){c>e&&(c=e);e>h&&(h=e)}else e>p?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e)}else t(e,n);v=r,p=e}function n(){x.point=e}function r(){w[0]=c,w[1]=h;x.point=t;v=null}function i(t,n){if(v){var r=t-p;y+=ma(r)>180?r+(r>0?360:-360):r}else g=t,m=n;Cs.point(t,n);e(t,n)}function o(){Cs.lineStart()}function a(){i(g,m);Cs.lineEnd();ma(y)>Ea&&(c=-(h=180));w[0]=c,w[1]=h;v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:txs?(c=-(h=180),f=-(d=90)):y>Ea?d=90:-Ea>y&&(f=-90);w[0]=c,w[1]=h}};return function(t){d=h=-(c=f=1/0);b=[];ia.geo.stream(t,x);var e=b.length;if(e){b.sort(l);for(var n,r=1,i=b[0],o=[i];e>r;++r){n=b[r];if(u(n[0],i)||u(n[1],i)){s(i[0],n[1])>s(i[0],i[1])&&(i[1]=n[1]);s(n[0],i[1])>s(i[0],i[1])&&(i[0]=n[0])}else o.push(i=n)}for(var a,n,p=-(1/0),e=o.length-1,r=0,i=o[e];e>=r;i=n,++r){n=o[r];(a=s(i[1],n[0]))>p&&(p=a,c=n[0],h=i[1])}}b=w=null;return c===1/0||f===1/0?[[0/0,0/0],[0/0,0/0]]:[[c,f],[h,d]]}}();ia.geo.centroid=function(t){Ss=Ts=ks=Ms=_s=Ds=Ls=As=Ns=Es=Ps=0;ia.geo.stream(t,js);var e=Ns,n=Es,r=Ps,i=e*e+n*n+r*r;if(Pa>i){e=Ds,n=Ls,r=As;Ea>Ts&&(e=ks,n=Ms,r=_s);i=e*e+n*n+r*r;if(Pa>i)return[0/0,0/0]}return[Math.atan2(n,e)*Fa,rt(r/Math.sqrt(i))*Fa]};var Ss,Ts,ks,Ms,_s,Ds,Ls,As,Ns,Es,Ps,js={sphere:S,point:Te,lineStart:Me,lineEnd:_e,polygonStart:function(){js.lineStart=De},polygonEnd:function(){js.lineStart=Me}},Is=je(Ae,Re,We,[-ja,-ja/2]),Hs=1e9;ia.geo.clipExtent=function(){var t,e,n,r,i,o,a={stream:function(t){i&&(i.valid=!1);i=o(t);i.valid=!0;return i},extent:function(s){if(!arguments.length)return[[t,e],[n,r]];o=Be(t=+s[0][0],e=+s[0][1],n=+s[1][0],r=+s[1][1]);i&&(i.valid=!1,i=null);return a}};return a.extent([[0,0],[960,500]])};(ia.geo.conicEqualArea=function(){return Ve(Xe)}).raw=Xe;ia.geo.albers=function(){return ia.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)};ia.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];e=null;(n(o,a),e)||(r(o,a),e)||i(o,a);return e}var e,n,r,i,o=ia.geo.albers(),a=ia.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=ia.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};t.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?s:o).invert(t)};t.stream=function(t){var e=o.stream(t),n=a.stream(t),r=s.stream(t);return{point:function(t,i){e.point(t,i);n.point(t,i);r.point(t,i)},sphere:function(){e.sphere();n.sphere();r.sphere()},lineStart:function(){e.lineStart();n.lineStart();r.lineStart()},lineEnd:function(){e.lineEnd();n.lineEnd();r.lineEnd()},polygonStart:function(){e.polygonStart();n.polygonStart();r.polygonStart()},polygonEnd:function(){e.polygonEnd();n.polygonEnd();r.polygonEnd()}}};t.precision=function(e){if(!arguments.length)return o.precision();o.precision(e);a.precision(e);s.precision(e);return t};t.scale=function(e){if(!arguments.length)return o.scale();o.scale(e);a.scale(.35*e);s.scale(e);return t.translate(o.translate())};t.translate=function(e){if(!arguments.length)return o.translate();var u=o.scale(),c=+e[0],f=+e[1];n=o.translate(e).clipExtent([[c-.455*u,f-.238*u],[c+.455*u,f+.238*u]]).stream(l).point;r=a.translate([c-.307*u,f+.201*u]).clipExtent([[c-.425*u+Ea,f+.12*u+Ea],[c-.214*u-Ea,f+.234*u-Ea]]).stream(l).point;i=s.translate([c-.205*u,f+.212*u]).clipExtent([[c-.214*u+Ea,f+.166*u+Ea],[c-.115*u-Ea,f+.234*u-Ea]]).stream(l).point;return t};return t.scale(1070)};var Os,Rs,Fs,Ws,zs,qs,Us={point:S,lineStart:S,lineEnd:S,polygonStart:function(){Rs=0;Us.lineStart=Ge},polygonEnd:function(){Us.lineStart=Us.lineEnd=Us.point=S;Os+=ma(Rs/2)}},Bs={point:Ye,lineStart:S,lineEnd:S,polygonStart:S,polygonEnd:S},Vs={point:Ke,lineStart:Ze, lineEnd:Qe,polygonStart:function(){Vs.lineStart=tn},polygonEnd:function(){Vs.point=Ke;Vs.lineStart=Ze;Vs.lineEnd=Qe}};ia.geo.path=function(){function t(t){if(t){"function"==typeof s&&o.pointRadius(+s.apply(this,arguments));a&&a.valid||(a=i(o));ia.geo.stream(t,a)}return o.result()}function e(){a=null;return t}var n,r,i,o,a,s=4.5;t.area=function(t){Os=0;ia.geo.stream(t,i(Us));return Os};t.centroid=function(t){ks=Ms=_s=Ds=Ls=As=Ns=Es=Ps=0;ia.geo.stream(t,i(Vs));return Ps?[Ns/Ps,Es/Ps]:As?[Ds/As,Ls/As]:_s?[ks/_s,Ms/_s]:[0/0,0/0]};t.bounds=function(t){zs=qs=-(Fs=Ws=1/0);ia.geo.stream(t,i(Bs));return[[Fs,Ws],[zs,qs]]};t.projection=function(t){if(!arguments.length)return n;i=(n=t)?t.stream||rn(t):w;return e()};t.context=function(t){if(!arguments.length)return r;o=null==(r=t)?new $e:new en(t);"function"!=typeof s&&o.pointRadius(s);return e()};t.pointRadius=function(e){if(!arguments.length)return s;s="function"==typeof e?e:(o.pointRadius(+e),+e);return t};return t.projection(ia.geo.albersUsa()).context(null)};ia.geo.transform=function(t){return{stream:function(e){var n=new on(e);for(var r in t)n[r]=t[r];return n}}};on.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};ia.geo.projection=sn;ia.geo.projectionMutator=ln;(ia.geo.equirectangular=function(){return sn(cn)}).raw=cn.invert=cn;ia.geo.rotation=function(t){function e(e){e=t(e[0]*Ra,e[1]*Ra);return e[0]*=Fa,e[1]*=Fa,e}t=hn(t[0]%360*Ra,t[1]*Ra,t.length>2?t[2]*Ra:0);e.invert=function(e){e=t.invert(e[0]*Ra,e[1]*Ra);return e[0]*=Fa,e[1]*=Fa,e};return e};fn.invert=cn;ia.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hn(-t[0]*Ra,-t[1]*Ra,0).invert,i=[];n(null,null,1,{point:function(t,n){i.push(t=e(t,n));t[0]*=Fa,t[1]*=Fa}});return{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;t.origin=function(e){if(!arguments.length)return r;r=e;return t};t.angle=function(r){if(!arguments.length)return e;n=mn((e=+r)*Ra,i*Ra);return t};t.precision=function(r){if(!arguments.length)return i;n=mn(e*Ra,(i=+r)*Ra);return t};return t.angle(90)};ia.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Ra,i=t[1]*Ra,o=e[1]*Ra,a=Math.sin(r),s=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*a)*n+(n=u*c-l*f*s)*n),l*c+u*f*s)};ia.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ia.range(Math.ceil(o/m)*m,i,m).map(h).concat(ia.range(Math.ceil(u/v)*v,l,v).map(d)).concat(ia.range(Math.ceil(r/p)*p,n,p).filter(function(t){return ma(t%m)>Ea}).map(c)).concat(ia.range(Math.ceil(s/g)*g,a,g).filter(function(t){return ma(t%v)>Ea}).map(f))}var n,r,i,o,a,s,l,u,c,f,h,d,p=10,g=p,m=90,v=360,y=2.5;t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})};t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(d(l).slice(1),h(i).reverse().slice(1),d(u).reverse().slice(1))]}};t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()};t.majorExtent=function(e){if(!arguments.length)return[[o,u],[i,l]];o=+e[0][0],i=+e[1][0];u=+e[0][1],l=+e[1][1];o>i&&(e=o,o=i,i=e);u>l&&(e=u,u=l,l=e);return t.precision(y)};t.minorExtent=function(e){if(!arguments.length)return[[r,s],[n,a]];r=+e[0][0],n=+e[1][0];s=+e[0][1],a=+e[1][1];r>n&&(e=r,r=n,n=e);s>a&&(e=s,s=a,a=e);return t.precision(y)};t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()};t.majorStep=function(e){if(!arguments.length)return[m,v];m=+e[0],v=+e[1];return t};t.minorStep=function(e){if(!arguments.length)return[p,g];p=+e[0],g=+e[1];return t};t.precision=function(e){if(!arguments.length)return y;y=+e;c=yn(s,a,90);f=bn(r,n,y);h=yn(u,l,90);d=bn(o,i,y);return t};return t.majorExtent([[-180,-90+Ea],[180,90-Ea]]).minorExtent([[-180,-80-Ea],[180,80+Ea]])};ia.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=wn,i=xn;t.distance=function(){return ia.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))};t.source=function(n){if(!arguments.length)return r;r=n,e="function"==typeof n?null:n;return t};t.target=function(e){if(!arguments.length)return i;i=e,n="function"==typeof e?null:e;return t};t.precision=function(){return arguments.length?t:0};return t};ia.geo.interpolate=function(t,e){return Cn(t[0]*Ra,t[1]*Ra,e[0]*Ra,e[1]*Ra)};ia.geo.length=function(t){Xs=0;ia.geo.stream(t,Gs);return Xs};var Xs,Gs={sphere:S,point:S,lineStart:Sn,lineEnd:S,polygonStart:S,polygonEnd:S},Ys=Tn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ia.geo.azimuthalEqualArea=function(){return sn(Ys)}).raw=Ys;var $s=Tn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},w);(ia.geo.azimuthalEquidistant=function(){return sn($s)}).raw=$s;(ia.geo.conicConformal=function(){return Ve(kn)}).raw=kn;(ia.geo.conicEquidistant=function(){return Ve(Mn)}).raw=Mn;var Js=Tn(function(t){return 1/t},Math.atan);(ia.geo.gnomonic=function(){return sn(Js)}).raw=Js;_n.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Oa]};(ia.geo.mercator=function(){return Dn(_n)}).raw=_n;var Ks=Tn(function(){return 1},Math.asin);(ia.geo.orthographic=function(){return sn(Ks)}).raw=Ks;var Zs=Tn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ia.geo.stereographic=function(){return sn(Zs)}).raw=Zs;Ln.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Oa]};(ia.geo.transverseMercator=function(){var t=Dn(Ln),e=t.center,n=t.rotate;t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])};t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])};return n([0,0,90])}).raw=Ln;ia.geom={};ia.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Dt(n),o=Dt(r),a=t.length,s=[],l=[];for(e=0;a>e;e++)s.push([+i.call(this,t[e],e),+o.call(this,t[e],e),e]);s.sort(Pn);for(e=0;a>e;e++)l.push([s[e][0],-s[e][1]]);var u=En(s),c=En(l),f=c[0]===u[0],h=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+f;e=r&&u.x<=o&&u.y>=i&&u.y<=a?[[r,a],[o,a],[o,i],[r,i]]:[];c.point=t[s]});return e}function n(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/Ea)*Ea,y:Math.round(a(t,e)/Ea)*Ea,i:e}})}var r=An,i=Nn,o=r,a=i,s=sl;if(t)return e(t);e.links=function(t){return lr(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})};e.triangles=function(t){var e=[];lr(n(t)).cells.forEach(function(n,r){for(var i,o,a=n.site,s=n.edges.sort(Xn),l=-1,u=s.length,c=s[u-1].edge,f=c.l===a?c.r:c.l;++l=u,h=r>=c,d=h<<1|f;t.leaf=!1;t=t.nodes[d]||(t.nodes[d]=dr());f?i=u:s=u;h?a=c:l=c;o(t,e,n,r,i,a,s,l)}var c,f,h,d,p,g,m,v,y,b=Dt(s),w=Dt(l);if(null!=e)g=e,m=n,v=r,y=i;else{v=y=-(g=m=1/0);f=[],h=[];p=t.length;if(a)for(d=0;p>d;++d){c=t[d];c.xv&&(v=c.x);c.y>y&&(y=c.y);f.push(c.x);h.push(c.y)}else for(d=0;p>d;++d){var x=+b(c=t[d],d),C=+w(c,d);g>x&&(g=x);m>C&&(m=C);x>v&&(v=x);C>y&&(y=C);f.push(x);h.push(C)}}var S=v-g,T=y-m;S>T?y=m+S:v=g+T;var k=dr();k.add=function(t){o(k,t,+b(t,++d),+w(t,d),g,m,v,y)};k.visit=function(t){pr(t,k,g,m,v,y)};k.find=function(t){return gr(k,t[0],t[1],g,m,v,y)};d=-1;if(null==e){for(;++d=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";n=fl.get(n)||cl;r=hl.get(r)||w;return Cr(r(n.apply(null,oa.call(arguments,1))))};ia.interpolateHcl=Ir;ia.interpolateHsl=Hr;ia.interpolateLab=Or;ia.interpolateRound=Rr;ia.transform=function(t){var e=sa.createElementNS(ia.ns.prefix.svg,"g");return(ia.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Fr(n?n.matrix:dl)})(t)};Fr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var dl={a:1,b:0,c:0,d:1,e:0,f:0};ia.interpolateTransform=Ur;ia.layout={};ia.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++ns*s/m){if(p>l){var u=e.charge/l;t.px-=o*u;t.py-=a*u}return!0}if(e.point&&l&&p>l){var u=e.pointCharge/l;t.px-=o*u;t.py-=a*u}}return!e.charge}}function e(t){t.px=ia.event.x,t.py=ia.event.y;s.resume()}var n,r,i,o,a,s={},l=ia.dispatch("start","tick","end"),u=[1,1],c=.9,f=pl,h=gl,d=-30,p=ml,g=.1,m=.64,v=[],y=[];s.tick=function(){if((r*=.99)<.005){l.end({type:"end",alpha:r=0});return!0}var e,n,s,f,h,p,m,b,w,x=v.length,C=y.length;for(n=0;C>n;++n){s=y[n];f=s.source;h=s.target;b=h.x-f.x;w=h.y-f.y;if(p=b*b+w*w){p=r*o[n]*((p=Math.sqrt(p))-i[n])/p;b*=p;w*=p;h.x-=b*(m=f.weight/(h.weight+f.weight));h.y-=w*m;f.x+=b*(m=1-m);f.y+=w*m}}if(m=r*g){b=u[0]/2;w=u[1]/2;n=-1;if(m)for(;++n0?t:0;else if(t>0){l.start({type:"start",alpha:r=t});ia.timer(s.tick)}return s};s.start=function(){function t(t,r){if(!n){n=new Array(l);for(s=0;l>s;++s)n[s]=[];for(s=0;c>s;++s){var i=y[s];n[i.source.index].push(i.target);n[i.target.index].push(i.source)}}for(var o,a=n[e],s=-1,u=a.length;++se;++e){(r=v[e]).index=e;r.weight=0}for(e=0;c>e;++e){r=y[e];"number"==typeof r.source&&(r.source=v[r.source]);"number"==typeof r.target&&(r.target=v[r.target]);++r.source.weight;++r.target.weight}for(e=0;l>e;++e){r=v[e];isNaN(r.x)&&(r.x=t("x",p));isNaN(r.y)&&(r.y=t("y",g));isNaN(r.px)&&(r.px=r.x);isNaN(r.py)&&(r.py=r.y)}i=[];if("function"==typeof f)for(e=0;c>e;++e)i[e]=+f.call(this,y[e],e);else for(e=0;c>e;++e)i[e]=f;o=[];if("function"==typeof h)for(e=0;c>e;++e)o[e]=+h.call(this,y[e],e);else for(e=0;c>e;++e)o[e]=h;a=[];if("function"==typeof d)for(e=0;l>e;++e)a[e]=+d.call(this,v[e],e);else for(e=0;l>e;++e)a[e]=d;return s.resume()};s.resume=function(){return s.alpha(.1)};s.stop=function(){return s.alpha(0)};s.drag=function(){n||(n=ia.behavior.drag().origin(w).on("dragstart.force",$r).on("drag.force",e).on("dragend.force",Jr));if(!arguments.length)return n;this.on("mouseover.force",Kr).on("mouseout.force",Zr).call(n);return void 0};return ia.rebind(s,l,"on")};var pl=20,gl=1,ml=1/0;ia.layout.hierarchy=function(){function t(i){var o,a=[i],s=[];i.depth=0;for(;null!=(o=a.pop());){s.push(o);if((u=n.call(t,o,o.depth))&&(l=u.length)){for(var l,u,c;--l>=0;){a.push(c=u[l]);c.parent=o;c.depth=o.depth+1}r&&(o.value=0);o.children=u}else{r&&(o.value=+r.call(t,o,o.depth)||0);delete o.children}}ni(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e);r&&(i=t.parent)&&(i.value+=t.value)});return s}var e=oi,n=ri,r=ii;t.sort=function(n){if(!arguments.length)return e;e=n;return t};t.children=function(e){if(!arguments.length)return n;n=e;return t};t.value=function(e){if(!arguments.length)return r;r=e;return t};t.revalue=function(e){if(r){ei(e,function(t){t.children&&(t.value=0)});ni(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0);(n=e.parent)&&(n.value+=e.value)})}return e};return t};ia.layout.partition=function(){function t(e,n,r,i){var o=e.children;e.x=n;e.y=e.depth*i;e.dx=r;e.dy=i;if(o&&(a=o.length)){var a,s,l,u=-1;r=e.value?r/e.value:0;for(;++uf?-1:1),p=(f-l*d)/ia.sum(u),g=ia.range(l),m=[];null!=n&&g.sort(n===vl?function(t,e){return u[e]-u[t]}:function(t,e){return n(a[t],a[e])});g.forEach(function(t){m[t]={data:a[t],value:s=u[t],startAngle:c,endAngle:c+=s*p+d,padAngle:h}});return m}var e=Number,n=vl,r=0,i=Ia,o=0;t.value=function(n){if(!arguments.length)return e;e=n;return t};t.sort=function(e){if(!arguments.length)return n;n=e;return t};t.startAngle=function(e){if(!arguments.length)return r;r=e;return t};t.endAngle=function(e){if(!arguments.length)return i;i=e;return t};t.padAngle=function(e){if(!arguments.length)return o;o=e;return t};return t};var vl={};ia.layout.stack=function(){function t(s,l){if(!(h=s.length))return s;var u=s.map(function(n,r){return e.call(t,n,r)}),c=u.map(function(e){return e.map(function(e,n){return[o.call(t,e,n),a.call(t,e,n)]})}),f=n.call(t,c,l);u=ia.permute(u,f);c=ia.permute(c,f);var h,d,p,g,m=r.call(t,c,l),v=u[0].length;for(p=0;v>p;++p){i.call(t,u[0][p],g=m[p],c[0][p][1]);for(d=1;h>d;++d)i.call(t,u[d][p],g+=c[d-1][p][1],c[d][p][1])}return s}var e=w,n=ci,r=fi,i=ui,o=si,a=li;t.values=function(n){if(!arguments.length)return e;e=n;return t};t.order=function(e){if(!arguments.length)return n;n="function"==typeof e?e:yl.get(e)||ci;return t};t.offset=function(e){if(!arguments.length)return r;r="function"==typeof e?e:bl.get(e)||fi;return t};t.x=function(e){if(!arguments.length)return o;o=e;return t};t.y=function(e){if(!arguments.length)return a;a=e;return t};t.out=function(e){if(!arguments.length)return i;i=e;return t};return t};var yl=ia.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(hi),o=t.map(di),a=ia.range(r).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;r>e;++e){n=a[e];if(l>s){s+=o[n];u.push(n)}else{l+=o[n];c.push(n)}}return c.reverse().concat(u)},reverse:function(t){return ia.range(t.length).reverse()},"default":ci}),bl=ia.map({silhouette:function(t){var e,n,r,i=t.length,o=t[0].length,a=[],s=0,l=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>s&&(s=r);a.push(r)}for(n=0;o>n;++n)l[n]=(s-a[n])/2;return l},wiggle:function(t){var e,n,r,i,o,a,s,l,u,c=t.length,f=t[0],h=f.length,d=[];d[0]=l=u=0;for(n=1;h>n;++n){for(e=0,i=0;c>e;++e)i+=t[e][n][1];for(e=0,o=0,s=f[n][0]-f[n-1][0];c>e;++e){for(r=0,a=(t[e][n][1]-t[e][n-1][1])/(2*s);e>r;++r)a+=(t[r][n][1]-t[r][n-1][1])/s;o+=a*t[e][n][1]}d[n]=l-=i?o/i*s:0;u>l&&(u=l)}for(n=0;h>n;++n)d[n]-=u;return d},expand:function(t){var e,n,r,i=t.length,o=t[0].length,a=1/i,s=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=a}for(n=0;o>n;++n)s[n]=0;return s},zero:fi});ia.layout.histogram=function(){function t(t,o){for(var a,s,l=[],u=t.map(n,this),c=r.call(this,u,o),f=i.call(this,c,u,o),o=-1,h=u.length,d=f.length-1,p=e?1:1/h;++o0){o=-1;for(;++o=c[0]&&s<=c[1]){a=l[ia.bisect(f,s,1,d)-1];a.y+=p;a.push(t[o])}}}return l}var e=!0,n=Number,r=vi,i=gi;t.value=function(e){if(!arguments.length)return n;n=e;return t};t.range=function(e){if(!arguments.length)return r;r=Dt(e);return t};t.bins=function(e){if(!arguments.length)return i;i="number"==typeof e?function(t){return mi(t,e)}:Dt(e);return t};t.frequency=function(n){if(!arguments.length)return e;e=!!n;return t};return t};ia.layout.pack=function(){function t(t,o){var a=n.call(this,t,o),s=a[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};s.x=s.y=0;ni(s,function(t){t.r=+c(t.value)});ni(s,Ci);if(r){var f=r*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;ni(s,function(t){t.r+=f});ni(s,Ci);ni(s,function(t){t.r-=f})}ki(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u));return a}var e,n=ia.layout.hierarchy().sort(yi),r=0,i=[1,1];t.size=function(e){if(!arguments.length)return i;i=e;return t};t.radius=function(n){if(!arguments.length)return e;e=null==n||"function"==typeof n?n:+n;return t};t.padding=function(e){if(!arguments.length)return r;r=+e;return t};return ti(t,n)};ia.layout.tree=function(){function t(t,i){var c=a.call(this,t,i),f=c[0],h=e(f);ni(h,n),h.parent.m=-h.z;ei(h,r);if(u)ei(f,o);else{var d=f,p=f,g=f;ei(f,function(t){t.xp.x&&(p=t);t.depth>g.depth&&(g=t)});var m=s(d,p)/2-d.x,v=l[0]/(p.x+s(p,d)/2+m),y=l[1]/(g.depth||1);ei(f,function(t){t.x=(t.x+m)*v;t.y=t.depth*y})}return c}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,o=e.children,a=0,s=o.length;s>a;++a)r.push((o[a]=i={_:o[a],parent:e,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Ni(t);var o=(e[0].z+e[e.length-1].z)/2;if(r){t.z=r.z+s(t._,r._);t.m=t.z-o}else t.z=o}else r&&(t.z=r.z+s(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m;t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,o=t,a=e,l=i.parent.children[0],u=i.m,c=o.m,f=a.m,h=l.m;a=Li(a),i=Di(i),a&&i;){l=Di(l);o=Li(o);o.a=t;r=a.z+f-i.z-u+s(a._,i._);if(r>0){Ai(Ei(a,t,n),t,r);u+=r;c+=r}f+=a.m;u+=i.m;h+=l.m;c+=o.m}if(a&&!Li(o)){o.t=a;o.m+=f-c}if(i&&!Di(l)){l.t=i;l.m+=u-h;n=t}}return n}function o(t){t.x*=l[0];t.y=t.depth*l[1]}var a=ia.layout.hierarchy().sort(null).value(null),s=_i,l=[1,1],u=null;t.separation=function(e){if(!arguments.length)return s;s=e;return t};t.size=function(e){if(!arguments.length)return u?null:l;u=null==(l=e)?o:null;return t};t.nodeSize=function(e){if(!arguments.length)return u?l:null;u=null==(l=e)?null:o;return t};return ti(t,a)};ia.layout.cluster=function(){function t(t,o){var a,s=e.call(this,t,o),l=s[0],u=0;ni(l,function(t){var e=t.children;if(e&&e.length){t.x=ji(e);t.y=Pi(e)}else{t.x=a?u+=n(t,a):0;t.y=0;a=t}});var c=Ii(l),f=Hi(l),h=c.x-n(c,f)/2,d=f.x+n(f,c)/2;ni(l,i?function(t){t.x=(t.x-l.x)*r[0];t.y=(l.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(d-h)*r[0];t.y=(1-(l.y?t.y/l.y:1))*r[1]});return s}var e=ia.layout.hierarchy().sort(null).value(null),n=_i,r=[1,1],i=!1;t.separation=function(e){if(!arguments.length)return n;n=e;return t};t.size=function(e){if(!arguments.length)return i?null:r;i=null==(r=e);return t};t.nodeSize=function(e){if(!arguments.length)return i?r:null;i=null!=(r=e);return t};return ti(t,e)};ia.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,o=t.length;++ie?0:e);n.area=isNaN(r)||0>=r?0:r}}function e(n){var o=n.children;if(o&&o.length){var a,s,l,u=f(n),c=[],h=o.slice(),p=1/0,g="slice"===d?u.dx:"dice"===d?u.dy:"slice-dice"===d?1&n.depth?u.dy:u.dx:Math.min(u.dx,u.dy);t(h,u.dx*u.dy/n.value);c.area=0;for(;(l=h.length)>0;){c.push(a=h[l-1]);c.area+=a.area;if("squarify"!==d||(s=r(c,g))<=p){h.pop();p=s}else{c.area-=c.pop().area;i(c,g,u,!1);g=Math.min(u.dx,u.dy);c.length=c.area=0;p=1/0}}if(c.length){i(c,g,u,!0);c.length=c.area=0}o.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=f(e),s=r.slice(),l=[];t(s,a.dx*a.dy/e.value);l.area=0;for(;o=s.pop();){l.push(o);l.area+=o.area;if(null!=o.z){i(l,o.z?a.dx:a.dy,a,!s.length);l.length=l.area=0}}r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,s=t.length;++an&&(o=n);n>i&&(i=n)}r*=r;e*=e;return r?Math.max(e*i*p/r,r/(e*o*p)):1/0}function i(t,e,n,r){var i,o=-1,a=t.length,s=n.x,u=n.y,c=e?l(t.area/e):0;if(e==n.dx){(r||c>n.dy)&&(c=n.dy);for(;++on.dx)&&(c=n.dx);for(;++on&&(e=1);1>n&&(t=0);return function(){var n,r,i;do{n=2*Math.random()-1;r=2*Math.random()-1;i=n*n+r*r}while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=ia.random.normal.apply(ia,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ia.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}};ia.scale={};var wl={floor:w,ceil:w};ia.scale.linear=function(){return Vi([0,1],[0,1],wr,!1)};var xl={s:1,g:1,p:1,r:1,e:1};ia.scale.log=function(){return Qi(ia.scale.linear().domain([0,1]),10,!0,[1,10])};var Cl=ia.format(".0e"),Sl={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};ia.scale.pow=function(){return to(ia.scale.linear(),1,[0,1])};ia.scale.sqrt=function(){return ia.scale.pow().exponent(.5)};ia.scale.ordinal=function(){return no([],{t:"range",a:[[]]})};ia.scale.category10=function(){return ia.scale.ordinal().range(Tl)};ia.scale.category20=function(){return ia.scale.ordinal().range(kl)};ia.scale.category20b=function(){return ia.scale.ordinal().range(Ml)};ia.scale.category20c=function(){return ia.scale.ordinal().range(_l)};var Tl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xt),kl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xt),Ml=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xt),_l=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xt);ia.scale.quantile=function(){return ro([],[])};ia.scale.quantize=function(){return io(0,1,[0,1])};ia.scale.threshold=function(){return oo([.5],[0,1])};ia.scale.identity=function(){return ao([0,1])};ia.svg={};ia.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),u=Math.max(0,+r.apply(this,arguments)),c=a.apply(this,arguments)-Oa,f=s.apply(this,arguments)-Oa,h=Math.abs(f-c),d=c>f?0:1;t>u&&(p=u,u=t,t=p);if(h>=Ha)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,g,m,v,y,b,w,x,C,S,T,k,M=0,_=0,D=[];if(v=(+l.apply(this,arguments)||0)/2){m=o===Dl?Math.sqrt(t*t+u*u):+o.apply(this,arguments);d||(_*=-1);u&&(_=rt(m/u*Math.sin(v)));t&&(M=rt(m/t*Math.sin(v)))}if(u){y=u*Math.cos(c+_);b=u*Math.sin(c+_);w=u*Math.cos(f-_);x=u*Math.sin(f-_);var L=Math.abs(f-c-2*_)<=ja?0:1;if(_&&po(y,b,w,x)===d^L){var A=(c+f)/2;y=u*Math.cos(A);b=u*Math.sin(A);w=x=null}}else y=b=0;if(t){C=t*Math.cos(f-M);S=t*Math.sin(f-M);T=t*Math.cos(c+M);k=t*Math.sin(c+M);var N=Math.abs(c-f+2*M)<=ja?0:1;if(M&&po(C,S,T,k)===1-d^N){var E=(c+f)/2;C=t*Math.cos(E);S=t*Math.sin(E);T=k=null}}else C=S=0;if((p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){g=u>t^d?0:1;var P=null==T?[C,S]:null==w?[y,b]:In([y,b],[T,k],[w,x],[C,S]),j=y-P[0],I=b-P[1],H=w-P[0],O=x-P[1],R=1/Math.sin(Math.acos((j*H+I*O)/(Math.sqrt(j*j+I*I)*Math.sqrt(H*H+O*O)))/2),F=Math.sqrt(P[0]*P[0]+P[1]*P[1]);if(null!=w){var W=Math.min(p,(u-F)/(R+1)),z=go(null==T?[C,S]:[T,k],[y,b],u,W,d),q=go([w,x],[C,S],u,W,d);p===W?D.push("M",z[0],"A",W,",",W," 0 0,",g," ",z[1],"A",u,",",u," 0 ",1-d^po(z[1][0],z[1][1],q[1][0],q[1][1]),",",d," ",q[1],"A",W,",",W," 0 0,",g," ",q[0]):D.push("M",z[0],"A",W,",",W," 0 1,",g," ",q[0])}else D.push("M",y,",",b);if(null!=T){var U=Math.min(p,(t-F)/(R-1)),B=go([y,b],[T,k],t,-U,d),V=go([C,S],null==w?[y,b]:[w,x],t,-U,d);p===U?D.push("L",V[0],"A",U,",",U," 0 0,",g," ",V[1],"A",t,",",t," 0 ",d^po(V[1][0],V[1][1],B[1][0],B[1][1]),",",1-d," ",B[1],"A",U,",",U," 0 0,",g," ",B[0]):D.push("L",V[0],"A",U,",",U," 0 0,",g," ",B[0])}else D.push("L",C,",",S)}else{D.push("M",y,",",b);null!=w&&D.push("A",u,",",u," 0 ",L,",",d," ",w,",",x);D.push("L",C,",",S);null!=T&&D.push("A",t,",",t," 0 ",N,",",1-d," ",T,",",k)}D.push("Z");return D.join("")}function e(t,e){ return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=lo,r=uo,i=so,o=Dl,a=co,s=fo,l=ho;t.innerRadius=function(e){if(!arguments.length)return n;n=Dt(e);return t};t.outerRadius=function(e){if(!arguments.length)return r;r=Dt(e);return t};t.cornerRadius=function(e){if(!arguments.length)return i;i=Dt(e);return t};t.padRadius=function(e){if(!arguments.length)return o;o=e==Dl?Dl:Dt(e);return t};t.startAngle=function(e){if(!arguments.length)return a;a=Dt(e);return t};t.endAngle=function(e){if(!arguments.length)return s;s=Dt(e);return t};t.padAngle=function(e){if(!arguments.length)return l;l=Dt(e);return t};t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-Oa;return[Math.cos(e)*t,Math.sin(e)*t]};return t};var Dl="auto";ia.svg.line=function(){return mo(w)};var Ll=ia.map({linear:vo,"linear-closed":yo,step:bo,"step-before":wo,"step-after":xo,basis:_o,"basis-open":Do,"basis-closed":Lo,bundle:Ao,cardinal:To,"cardinal-open":Co,"cardinal-closed":So,monotone:Ho});Ll.forEach(function(t,e){e.key=t;e.closed=/-closed$/.test(t)});var Al=[0,2/3,1/3,0],Nl=[0,1/3,2/3,0],El=[0,1/6,2/3,1/6];ia.svg.line.radial=function(){var t=mo(Oo);t.radius=t.x,delete t.x;t.angle=t.y,delete t.y;return t};wo.reverse=xo;xo.reverse=wo;ia.svg.area=function(){return Ro(w)};ia.svg.area.radial=function(){var t=Ro(Oo);t.radius=t.x,delete t.x;t.innerRadius=t.x0,delete t.x0;t.outerRadius=t.x1,delete t.x1;t.angle=t.y,delete t.y;t.startAngle=t.y0,delete t.y0;t.endAngle=t.y1,delete t.y1;return t};ia.svg.chord=function(){function t(t,s){var l=e(this,o,t,s),u=e(this,a,t,s);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(n(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+r(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),o=s.call(t,i,r),a=l.call(t,i,r)-Oa,c=u.call(t,i,r)-Oa;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>ja)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var o=wn,a=xn,s=Fo,l=co,u=fo;t.radius=function(e){if(!arguments.length)return s;s=Dt(e);return t};t.source=function(e){if(!arguments.length)return o;o=Dt(e);return t};t.target=function(e){if(!arguments.length)return a;a=Dt(e);return t};t.startAngle=function(e){if(!arguments.length)return l;l=Dt(e);return t};t.endAngle=function(e){if(!arguments.length)return u;u=Dt(e);return t};return t};ia.svg.diagonal=function(){function t(t,i){var o=e.call(this,t,i),a=n.call(this,t,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];l=l.map(r);return"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=wn,n=xn,r=Wo;t.source=function(n){if(!arguments.length)return e;e=Dt(n);return t};t.target=function(e){if(!arguments.length)return n;n=Dt(e);return t};t.projection=function(e){if(!arguments.length)return r;r=e;return t};return t};ia.svg.diagonal.radial=function(){var t=ia.svg.diagonal(),e=Wo,n=t.projection;t.projection=function(t){return arguments.length?n(zo(e=t)):e};return t};ia.svg.symbol=function(){function t(t,r){return(Pl.get(e.call(this,t,r))||Bo)(n.call(this,t,r))}var e=Uo,n=qo;t.type=function(n){if(!arguments.length)return e;e=Dt(n);return t};t.size=function(e){if(!arguments.length)return n;n=Dt(e);return t};return t};var Pl=ia.map({circle:Bo,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Il)),n=e*Il;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/jl),n=e*jl/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/jl),n=e*jl/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});ia.svg.symbolTypes=Pl.keys();var jl=Math.sqrt(3),Il=Math.tan(30*Ra);ka.transition=function(t){for(var e,n,r=Hl||++Wl,i=$o(t),o=[],a=Ol||{time:Date.now(),ease:_r,delay:0,duration:250},s=-1,l=this.length;++so;o++){i.push(e=[]);for(var n=this[o],s=0,l=n.length;l>s;s++)(r=n[s])&&t.call(r,r.__data__,s,o)&&e.push(r)}return Xo(i,this.namespace,this.id)};Fl.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):V(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})};Fl.attr=function(t,e){function n(){this.removeAttribute(s)}function r(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(s);return n!==t&&(e=a(n,t),function(t){this.setAttribute(s,e(t))})})}function o(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(s.space,s.local);return n!==t&&(e=a(n,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var a="transform"==t?Ur:wr,s=ia.ns.qualify(t);return Go(this,"attr."+t,e,s.local?o:i)};Fl.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=ia.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)};Fl.style=function(t,e,n){function i(){this.style.removeProperty(t)}function o(e){return null==e?i:(e+="",function(){var i,o=r(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=wr(o,e),function(e){this.style.setProperty(t,i(e),n)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(n in t)this.style(n,t[n],e);return this}n=""}return Go(this,"style."+t,e,o)};Fl.styleTween=function(t,e,n){function i(i,o){var a=e.call(this,i,o,r(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),n)}}arguments.length<3&&(n="");return this.tween("style."+t,i)};Fl.text=function(t){return Go(this,"text",t,Yo)};Fl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})};Fl.ease=function(t){var e=this.id,n=this.namespace;if(arguments.length<1)return this.node()[n][e].ease;"function"!=typeof t&&(t=ia.ease.apply(ia,arguments));return V(this,function(r){r[n][e].ease=t})};Fl.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:V(this,"function"==typeof t?function(r,i,o){r[n][e].delay=+t.call(r,r.__data__,i,o)}:(t=+t,function(r){r[n][e].delay=t}))};Fl.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:V(this,"function"==typeof t?function(r,i,o){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,o))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))};Fl.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Ol,o=Hl;try{Hl=n;V(this,function(e,i,o){Ol=e[r][n];t.call(e,e.__data__,i,o)})}finally{Ol=i;Hl=o}}else V(this,function(i){var o=i[r][n];(o.event||(o.event=ia.dispatch("start","end","interrupt"))).on(t,e)});return this};Fl.transition=function(){for(var t,e,n,r,i=this.id,o=++Wl,a=this.namespace,s=[],l=0,u=this.length;u>l;l++){s.push(t=[]);for(var e=this[l],c=0,f=e.length;f>c;c++){if(n=e[c]){r=n[a][i];Jo(n,c,a,o,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})}t.push(n)}}return Xo(s,a,o)};ia.svg.axis=function(){function t(t){t.each(function(){var t,u=ia.select(this),c=this.__chart__||n,f=this.__chart__=n.copy(),h=null==l?f.ticks?f.ticks.apply(f,s):f.domain():l,d=null==e?f.tickFormat?f.tickFormat.apply(f,s):w:e,p=u.selectAll(".tick").data(h,f),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ea),m=ia.transition(p.exit()).style("opacity",Ea).remove(),v=ia.transition(p.order()).style("opacity",1),y=Math.max(i,0)+a,b=Wi(f),x=u.selectAll(".domain").data([0]),C=(x.enter().append("path").attr("class","domain"),ia.transition(x));g.append("line");g.append("text");var S,T,k,M,_=g.select("line"),D=v.select("line"),L=p.select("text").text(d),A=g.select("text"),N=v.select("text"),E="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r){t=Ko,S="x",k="y",T="x2",M="y2";L.attr("dy",0>E?"0em":".71em").style("text-anchor","middle");C.attr("d","M"+b[0]+","+E*o+"V0H"+b[1]+"V"+E*o)}else{t=Zo,S="y",k="x",T="y2",M="x2";L.attr("dy",".32em").style("text-anchor",0>E?"end":"start");C.attr("d","M"+E*o+","+b[0]+"H0V"+b[1]+"H"+E*o)}_.attr(M,E*i);A.attr(k,E*y);D.attr(T,0).attr(M,E*i);N.attr(S,0).attr(k,E*y);if(f.rangeBand){var P=f,j=P.rangeBand()/2;c=f=function(t){return P(t)+j}}else c.rangeBand?c=f:m.call(t,f,c);g.call(t,c,f);v.call(t,f,f)})}var e,n=ia.scale.linear(),r=zl,i=6,o=6,a=3,s=[10],l=null;t.scale=function(e){if(!arguments.length)return n;n=e;return t};t.orient=function(e){if(!arguments.length)return r;r=e in ql?e+"":zl;return t};t.ticks=function(){if(!arguments.length)return s;s=arguments;return t};t.tickValues=function(e){if(!arguments.length)return l;l=e;return t};t.tickFormat=function(n){if(!arguments.length)return e;e=n;return t};t.tickSize=function(e){var n=arguments.length;if(!n)return i;i=+e;o=+arguments[n-1];return t};t.innerTickSize=function(e){if(!arguments.length)return i;i=+e;return t};t.outerTickSize=function(e){if(!arguments.length)return o;o=+e;return t};t.tickPadding=function(e){if(!arguments.length)return a;a=+e;return t};t.tickSubdivide=function(){return arguments.length&&t};return t};var zl="bottom",ql={top:1,right:1,bottom:1,left:1};ia.svg.brush=function(){function t(r){r.each(function(){var r=ia.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=r.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");r.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=r.selectAll(".resize").data(g,w);s.exit().remove();s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ul[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");s.style("display",t.empty()?"none":null);var l,f=ia.transition(r),h=ia.transition(a);if(u){l=Wi(u);h.attr("x",l[0]).attr("width",l[1]-l[0]);n(f)}if(c){l=Wi(c);h.attr("y",l[0]).attr("height",l[1]-l[0]);i(f)}e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function n(t){t.select(".extent").attr("x",f[0]);t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]);t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function o(){function o(){if(32==ia.event.keyCode){if(!L){b=null;N[0]-=f[1];N[1]-=h[1];L=2}M()}}function g(){if(32==ia.event.keyCode&&2==L){N[0]+=f[1];N[1]+=h[1];L=0;M()}}function m(){var t=ia.mouse(x),r=!1;if(w){t[0]+=w[0];t[1]+=w[1]}if(!L)if(ia.event.altKey){b||(b=[(f[0]+f[1])/2,(h[0]+h[1])/2]);N[0]=f[+(t[0]c){i=r;r=c}else i=c}if(g[0]!=r||g[1]!=i){n?s=null:a=null;g[0]=r;g[1]=i;return!0}}function y(){m();T.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null);ia.select("body").style("cursor",null);E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);A();S({type:"brushend"})}var b,w,x=this,C=ia.select(ia.event.target),S=l.of(x,arguments),T=ia.select(x),k=C.datum(),_=!/^(n|s)$/.test(k)&&u,D=!/^(e|w)$/.test(k)&&c,L=C.classed("extent"),A=K(x),N=ia.mouse(x),E=ia.select(r(x)).on("keydown.brush",o).on("keyup.brush",g);ia.event.changedTouches?E.on("touchmove.brush",m).on("touchend.brush",y):E.on("mousemove.brush",m).on("mouseup.brush",y);T.interrupt().selectAll("*").interrupt();if(L){N[0]=f[0]-N[0];N[1]=h[0]-N[1]}else if(k){var P=+/w$/.test(k),j=+/^n/.test(k);w=[f[1-P]-N[0],h[1-j]-N[1]];N[0]=f[P];N[1]=h[j]}else ia.event.altKey&&(b=N.slice());T.style("pointer-events","none").selectAll(".resize").style("display",null);ia.select("body").style("cursor",C.style("cursor"));S({type:"brushstart"});m()}var a,s,l=D(t,"brushstart","brush","brushend"),u=null,c=null,f=[0,0],h=[0,0],d=!0,p=!0,g=Bl[0];t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:f,y:h,i:a,j:s},n=this.__chart__||e;this.__chart__=e;if(Hl)ia.select(this).transition().each("start.brush",function(){a=n.i;s=n.j;f=n.x;h=n.y;t({type:"brushstart"})}).tween("brush:brush",function(){var n=xr(f,e.x),r=xr(h,e.y);a=s=null;return function(i){f=e.x=n(i);h=e.y=r(i);t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i;s=e.j;t({type:"brush",mode:"resize"});t({type:"brushend"})});else{t({type:"brushstart"});t({type:"brush",mode:"resize"});t({type:"brushend"})}})};t.x=function(e){if(!arguments.length)return u;u=e;g=Bl[!u<<1|!c];return t};t.y=function(e){if(!arguments.length)return c;c=e;g=Bl[!u<<1|!c];return t};t.clamp=function(e){if(!arguments.length)return u&&c?[d,p]:u?d:c?p:null;u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e);return t};t.extent=function(e){var n,r,i,o,l;if(!arguments.length){if(u)if(a)n=a[0],r=a[1];else{n=f[0],r=f[1];u.invert&&(n=u.invert(n),r=u.invert(r));n>r&&(l=n,n=r,r=l)}if(c)if(s)i=s[0],o=s[1];else{i=h[0],o=h[1];c.invert&&(i=c.invert(i),o=c.invert(o));i>o&&(l=i,i=o,o=l)}return u&&c?[[n,i],[r,o]]:u?[n,r]:c&&[i,o]}if(u){n=e[0],r=e[1];c&&(n=n[0],r=r[0]);a=[n,r];u.invert&&(n=u(n),r=u(r));n>r&&(l=n,n=r,r=l);(n!=f[0]||r!=f[1])&&(f=[n,r])}if(c){i=e[0],o=e[1];u&&(i=i[1],o=o[1]);s=[i,o];c.invert&&(i=c(i),o=c(o));i>o&&(l=i,i=o,o=l);(i!=h[0]||o!=h[1])&&(h=[i,o])}return t};t.clear=function(){if(!t.empty()){f=[0,0],h=[0,0];a=s=null}return t};t.empty=function(){return!!u&&f[0]==f[1]||!!c&&h[0]==h[1]};return ia.rebind(t,l,"on")};var Ul={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vl=cs.format=ms.timeFormat,Xl=Vl.utc,Gl=Xl("%Y-%m-%dT%H:%M:%S.%LZ");Vl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Qo:Gl;Qo.parse=function(t){var e=new Date(t);return isNaN(e)?null:e};Qo.toString=Gl.toString;cs.second=zt(function(t){return new fs(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()});cs.seconds=cs.second.range;cs.seconds.utc=cs.second.utc.range;cs.minute=zt(function(t){return new fs(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()});cs.minutes=cs.minute.range;cs.minutes.utc=cs.minute.utc.range;cs.hour=zt(function(t){var e=t.getTimezoneOffset()/60;return new fs(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()});cs.hours=cs.hour.range;cs.hours.utc=cs.hour.utc.range;cs.month=zt(function(t){t=cs.day(t);t.setDate(1);return t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()});cs.months=cs.month.range;cs.months.utc=cs.month.utc.range;var Yl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],$l=[[cs.second,1],[cs.second,5],[cs.second,15],[cs.second,30],[cs.minute,1],[cs.minute,5],[cs.minute,15],[cs.minute,30],[cs.hour,1],[cs.hour,3],[cs.hour,6],[cs.hour,12],[cs.day,1],[cs.day,2],[cs.week,1],[cs.month,1],[cs.month,3],[cs.year,1]],Jl=Vl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Ae]]),Kl={range:function(t,e,n){return ia.range(Math.ceil(t/n)*n,+e,n).map(ea)},floor:w,ceil:w};$l.year=cs.year;cs.scale=function(){return ta(ia.scale.linear(),$l,Jl)};var Zl=$l.map(function(t){return[t[0].utc,t[1]]}),Ql=Xl.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Ae]]);Zl.year=cs.year.utc;cs.scale.utc=function(){return ta(ia.scale.linear(),Zl,Ql)};ia.text=Lt(function(t){return t.responseText});ia.json=function(t,e){return At(t,"application/json",na,e)};ia.html=function(t,e){return At(t,"text/html",ra,e)};ia.xml=Lt(function(t){return t.responseXML});"function"==typeof t&&t.amd?t(ia):"object"==typeof n&&n.exports&&(n.exports=ia);this.d3=ia}()},{}],14:[function(e,n,r){(function(i,o,a){(function(i){"use strict";"function"==typeof t&&t.amd?t("datatables",["jquery"],i):"object"==typeof r?n.exports=i(e("jquery")):jQuery&&!jQuery.fn.dataTable&&i(jQuery)})(function(t){"use strict";function e(n){var r,i,o="a aa ai ao as b fn i m o s ",a={};t.each(n,function(t,s){r=t.match(/^([^A-Z]+?)([A-Z])/);if(r&&-1!==o.indexOf(r[1]+" ")){i=t.replace(r[0],r[2].toLowerCase());a[i]=t;"o"===r[1]&&e(n[t])}});n._hungarianMap=a}function n(r,i,o){r._hungarianMap||e(r);var s;t.each(i,function(e,l){s=r._hungarianMap[e];if(s!==a&&(o||i[s]===a))if("o"===s.charAt(0)){i[s]||(i[s]={});t.extend(!0,i[s],i[e]);n(r[s],i[s],o)}else i[s]=i[e]})}function r(t){var e=Yt.defaults.oLanguage,n=t.sZeroRecords;!t.sEmptyTable&&n&&"No data available in table"===e.sEmptyTable&&Ot(t,t,"sZeroRecords","sEmptyTable");!t.sLoadingRecords&&n&&"Loading..."===e.sLoadingRecords&&Ot(t,t,"sZeroRecords","sLoadingRecords");t.sInfoThousands&&(t.sThousands=t.sInfoThousands);var r=t.sDecimal;r&&Xt(r)}function s(t){ye(t,"ordering","bSort");ye(t,"orderMulti","bSortMulti");ye(t,"orderClasses","bSortClasses");ye(t,"orderCellsTop","bSortCellsTop");ye(t,"order","aaSorting");ye(t,"orderFixed","aaSortingFixed");ye(t,"paging","bPaginate");ye(t,"pagingType","sPaginationType");ye(t,"pageLength","iDisplayLength");ye(t,"searching","bFilter");var e=t.aoSearchCols;if(e)for(var r=0,i=e.length;i>r;r++)e[r]&&n(Yt.models.oSearch,e[r])}function l(e){ye(e,"orderable","bSortable");ye(e,"orderData","aDataSort");ye(e,"orderSequence","asSorting");ye(e,"orderDataType","sortDataType");var n=e.aDataSort;n&&!t.isArray(n)&&(e.aDataSort=[n])}function u(e){var n=e.oBrowser,r=t("
").css({position:"absolute",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(t("
").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(t('
').css({width:"100%",height:10}))).appendTo("body"),i=r.find(".test");n.bScrollOversize=100===i[0].offsetWidth;n.bScrollbarLeft=1!==Math.round(i.offset().left);r.remove()}function c(t,e,n,r,i,o){var s,l=r,u=!1;if(n!==a){s=n;u=!0}for(;l!==i;)if(t.hasOwnProperty(l)){s=u?e(s,t[l],l,t):t[l];u=!0;l+=o}return s}function f(e,n){var r=Yt.defaults.column,i=e.aoColumns.length,a=t.extend({},Yt.models.oColumn,r,{nTh:n?n:o.createElement("th"),sTitle:r.sTitle?r.sTitle:n?n.innerHTML:"",aDataSort:r.aDataSort?r.aDataSort:[i],mData:r.mData?r.mData:i,idx:i});e.aoColumns.push(a);var s=e.aoPreSearchCols;s[i]=t.extend({},Yt.models.oSearch,s[i]);h(e,i,t(n).data())}function h(e,r,i){var o=e.aoColumns[r],s=e.oClasses,u=t(o.nTh);if(!o.sWidthOrig){o.sWidthOrig=u.attr("width")||null;var c=(u.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);c&&(o.sWidthOrig=c[1])}if(i!==a&&null!==i){l(i);n(Yt.defaults.column,i);i.mDataProp===a||i.mData||(i.mData=i.mDataProp);i.sType&&(o._sManualType=i.sType);i.className&&!i.sClass&&(i.sClass=i.className);t.extend(o,i);Ot(o,i,"sWidth","sWidthOrig");i.iDataSort!==a&&(o.aDataSort=[i.iDataSort]);Ot(o,i,"aDataSort")}var f=o.mData,h=_(f),d=o.mRender?_(o.mRender):null,p=function(t){return"string"==typeof t&&-1!==t.indexOf("@")};o._bAttrSrc=t.isPlainObject(f)&&(p(f.sort)||p(f.type)||p(f.filter));o.fnGetData=function(t,e,n){var r=h(t,e,a,n);return d&&e?d(r,e,t,n):r};o.fnSetData=function(t,e,n){return D(f)(t,e,n)};"number"!=typeof f&&(e._rowReadObject=!0);if(!e.oFeatures.bSort){o.bSortable=!1;u.addClass(s.sSortableNone)}var g=-1!==t.inArray("asc",o.asSorting),m=-1!==t.inArray("desc",o.asSorting);if(o.bSortable&&(g||m))if(g&&!m){o.sSortingClass=s.sSortableAsc;o.sSortingClassJUI=s.sSortJUIAscAllowed}else if(!g&&m){o.sSortingClass=s.sSortableDesc;o.sSortingClassJUI=s.sSortJUIDescAllowed}else{o.sSortingClass=s.sSortable;o.sSortingClassJUI=s.sSortJUI}else{o.sSortingClass=s.sSortableNone;o.sSortingClassJUI=""}}function d(t){if(t.oFeatures.bAutoWidth!==!1){var e=t.aoColumns;yt(t);for(var n=0,r=e.length;r>n;n++)e[n].nTh.style.width=e[n].sWidth}var i=t.oScroll;(""!==i.sY||""!==i.sX)&&mt(t);zt(t,null,"column-sizing",[t])}function p(t,e){var n=v(t,"bVisible");return"number"==typeof n[e]?n[e]:null}function g(e,n){var r=v(e,"bVisible"),i=t.inArray(n,r);return-1!==i?i:null}function m(t){return v(t,"bVisible").length}function v(e,n){var r=[];t.map(e.aoColumns,function(t,e){t[n]&&r.push(e)});return r}function y(t){var e,n,r,i,o,s,l,u,c,f=t.aoColumns,h=t.aoData,d=Yt.ext.type.detect;for(e=0,n=f.length;n>e;e++){l=f[e];c=[];if(!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){for(r=0,i=d.length;i>r;r++){for(o=0,s=h.length;s>o;o++){c[o]===a&&(c[o]=T(t,o,e,"type"));u=d[r](c[o],t);if(!u&&r!==d.length-1)break;if("html"===u)break}if(u){l.sType=u;break}}l.sType||(l.sType="string")}}}function b(e,n,r,i){var o,s,l,u,c,h,d,p=e.aoColumns;if(n)for(o=n.length-1;o>=0;o--){d=n[o];var g=d.targets!==a?d.targets:d.aTargets;t.isArray(g)||(g=[g]);for(l=0,u=g.length;u>l;l++)if("number"==typeof g[l]&&g[l]>=0){for(;p.length<=g[l];)f(e);i(g[l],d)}else if("number"==typeof g[l]&&g[l]<0)i(p.length+g[l],d);else if("string"==typeof g[l])for(c=0,h=p.length;h>c;c++)("_all"==g[l]||t(p[c].nTh).hasClass(g[l]))&&i(c,d)}if(r)for(o=0,s=r.length;s>o;o++)i(o,r[o])}function w(e,n,r,i){var o=e.aoData.length,a=t.extend(!0,{},Yt.models.oRow,{src:r?"dom":"data"});a._aData=n;e.aoData.push(a);for(var s=e.aoColumns,l=0,u=s.length;u>l;l++){r&&k(e,o,l,T(e,o,l));s[l].sType=null}e.aiDisplayMaster.push(o);(r||!e.oFeatures.bDeferRender)&&j(e,o,r,i);return o}function x(e,n){var r;n instanceof t||(n=t(n));return n.map(function(t,n){r=P(e,n);return w(e,r.data,n,r.cells)})}function C(t,e){return e._DT_RowIndex!==a?e._DT_RowIndex:null}function S(e,n,r){return t.inArray(r,e.aoData[n].anCells)}function T(t,e,n,r){var i=t.iDraw,o=t.aoColumns[n],s=t.aoData[e]._aData,l=o.sDefaultContent,u=o.fnGetData(s,r,{settings:t,row:e,col:n});if(u===a){if(t.iDrawError!=i&&null===l){Ht(t,0,"Requested unknown parameter "+("function"==typeof o.mData?"{function}":"'"+o.mData+"'")+" for row "+e,4);t.iDrawError=i}return l}if(u!==s&&null!==u||null===l){if("function"==typeof u)return u.call(s)}else u=l;return null===u&&"display"==r?"":u}function k(t,e,n,r){var i=t.aoColumns[n],o=t.aoData[e]._aData;i.fnSetData(o,r,{settings:t,row:e,col:n})}function M(e){return t.map(e.match(/(\\.|[^\.])+/g),function(t){return t.replace(/\\./g,".")})}function _(e){if(t.isPlainObject(e)){var n={};t.each(e,function(t,e){e&&(n[t]=_(e))});return function(t,e,r,i){var o=n[e]||n._;return o!==a?o(t,e,r,i):t}}if(null===e)return function(t){return t};if("function"==typeof e)return function(t,n,r,i){return e(t,n,r,i)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,n){return t[e]};var r=function(t,e,n){var i,o,s,l;if(""!==n)for(var u=M(n),c=0,f=u.length;f>c;c++){i=u[c].match(be);o=u[c].match(we);if(i){u[c]=u[c].replace(be,"");""!==u[c]&&(t=t[u[c]]);s=[];u.splice(0,c+1);l=u.join(".");for(var h=0,d=t.length;d>h;h++)s.push(r(t[h],e,l));var p=i[0].substring(1,i[0].length-1);t=""===p?s:s.join(p);break}if(o){u[c]=u[c].replace(we,"");t=t[u[c]]()}else{if(null===t||t[u[c]]===a)return a;t=t[u[c]]}}return t};return function(t,n){return r(t,n,e)}}function D(e){if(t.isPlainObject(e))return D(e._);if(null===e)return function(){};if("function"==typeof e)return function(t,n,r){e(t,"set",n,r)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,n){t[e]=n};var n=function(t,e,r){for(var i,o,s,l,u,c=M(r),f=c[c.length-1],h=0,d=c.length-1;d>h;h++){o=c[h].match(be);s=c[h].match(we);if(o){c[h]=c[h].replace(be,"");t[c[h]]=[];i=c.slice();i.splice(0,h+1);u=i.join(".");for(var p=0,g=e.length;g>p;p++){l={};n(l,e[p],u);t[c[h]].push(l)}return}if(s){c[h]=c[h].replace(we,"");t=t[c[h]](e)}(null===t[c[h]]||t[c[h]]===a)&&(t[c[h]]={});t=t[c[h]]}f.match(we)?t=t[f.replace(we,"")](e):t[f.replace(be,"")]=e};return function(t,r){return n(t,r,e)}}function L(t){return he(t.aoData,"_aData")}function A(t){t.aoData.length=0;t.aiDisplayMaster.length=0;t.aiDisplay.length=0}function N(t,e,n){for(var r=-1,i=0,o=t.length;o>i;i++)t[i]==e?r=i:t[i]>e&&t[i]--;-1!=r&&n===a&&t.splice(r,1)}function E(t,e,n,r){var i,o,s=t.aoData[e],l=function(n,r){for(;n.childNodes.length;)n.removeChild(n.firstChild);n.innerHTML=T(t,e,r,"display")};if("dom"!==n&&(n&&"auto"!==n||"dom"!==s.src)){var u=s.anCells;if(u)if(r!==a)l(u[r],r);else for(i=0,o=u.length;o>i;i++)l(u[i],i)}else s._aData=P(t,s,r,r===a?a:s._aData).data;s._aSortData=null;s._aFilterData=null;var c=t.aoColumns;if(r!==a)c[r].sType=null;else{for(i=0,o=c.length;o>i;i++)c[i].sType=null;I(s)}}function P(e,n,r,i){var o,s,l,u=[],c=n.firstChild,f=0,h=e.aoColumns,d=e._rowReadObject;i=i||d?{}:[];var p=function(t,e){if("string"==typeof t){var n=t.indexOf("@");if(-1!==n){var r=t.substring(n+1),o=D(t);o(i,e.getAttribute(r))}}},g=function(e){if(r===a||r===f){s=h[f];l=t.trim(e.innerHTML);if(s&&s._bAttrSrc){var n=D(s.mData._);n(i,l);p(s.mData.sort,e);p(s.mData.type,e);p(s.mData.filter,e)}else if(d){s._setter||(s._setter=D(s.mData));s._setter(i,l)}else i[f]=l}f++};if(c)for(;c;){o=c.nodeName.toUpperCase();if("TD"==o||"TH"==o){g(c);u.push(c)}c=c.nextSibling}else{u=n.anCells;for(var m=0,v=u.length;v>m;m++)g(u[m])}return{data:i,cells:u}}function j(t,e,n,r){var i,a,s,l,u,c=t.aoData[e],f=c._aData,h=[];if(null===c.nTr){i=n||o.createElement("tr");c.nTr=i;c.anCells=h;i._DT_RowIndex=e;I(c);for(l=0,u=t.aoColumns.length;u>l;l++){s=t.aoColumns[l];a=n?r[l]:o.createElement(s.sCellType);h.push(a);(!n||s.mRender||s.mData!==l)&&(a.innerHTML=T(t,e,l,"display"));s.sClass&&(a.className+=" "+s.sClass);s.bVisible&&!n?i.appendChild(a):!s.bVisible&&n&&a.parentNode.removeChild(a);s.fnCreatedCell&&s.fnCreatedCell.call(t.oInstance,a,T(t,e,l),f,e,l)}zt(t,"aoRowCreatedCallback",null,[i,f,e])}c.nTr.setAttribute("role","row")}function I(e){var n=e.nTr,r=e._aData;if(n){r.DT_RowId&&(n.id=r.DT_RowId);if(r.DT_RowClass){var i=r.DT_RowClass.split(" ");e.__rowc=e.__rowc?ve(e.__rowc.concat(i)):i;t(n).removeClass(e.__rowc.join(" ")).addClass(r.DT_RowClass)}r.DT_RowAttr&&t(n).attr(r.DT_RowAttr);r.DT_RowData&&t(n).data(r.DT_RowData)}}function H(e){var n,r,i,o,a,s=e.nTHead,l=e.nTFoot,u=0===t("th, td",s).length,c=e.oClasses,f=e.aoColumns;u&&(o=t("").appendTo(s));for(n=0,r=f.length;r>n;n++){a=f[n];i=t(a.nTh).addClass(a.sClass);u&&i.appendTo(o);if(e.oFeatures.bSort){i.addClass(a.sSortingClass);if(a.bSortable!==!1){i.attr("tabindex",e.iTabIndex).attr("aria-controls",e.sTableId);At(e,a.nTh,n)}}a.sTitle!=i.html()&&i.html(a.sTitle);Ut(e,"header")(e,i,a,c)}u&&z(e.aoHeader,s);t(s).find(">tr").attr("role","row");t(s).find(">tr>th, >tr>td").addClass(c.sHeaderTH);t(l).find(">tr>th, >tr>td").addClass(c.sFooterTH);if(null!==l){var h=e.aoFooter[0];for(n=0,r=h.length;r>n;n++){a=f[n];a.nTf=h[n].cell;a.sClass&&t(a.nTf).addClass(a.sClass)}}}function O(e,n,r){var i,o,s,l,u,c,f,h,d,p=[],g=[],m=e.aoColumns.length;if(n){r===a&&(r=!1);for(i=0,o=n.length;o>i;i++){p[i]=n[i].slice();p[i].nTr=n[i].nTr;for(s=m-1;s>=0;s--)e.aoColumns[s].bVisible||r||p[i].splice(s,1);g.push([])}for(i=0,o=p.length;o>i;i++){f=p[i].nTr;if(f)for(;c=f.firstChild;)f.removeChild(c);for(s=0,l=p[i].length;l>s;s++){h=1;d=1;if(g[i][s]===a){f.appendChild(p[i][s].cell);g[i][s]=1;for(;p[i+h]!==a&&p[i][s].cell==p[i+h][s].cell;){g[i+h][s]=1;h++}for(;p[i][s+d]!==a&&p[i][s].cell==p[i][s+d].cell;){for(u=0;h>u;u++)g[i+u][s+d]=1;d++}t(p[i][s].cell).attr("rowspan",h).attr("colspan",d)}}}}}function R(e){var n=zt(e,"aoPreDrawCallback","preDraw",[e]);if(-1===t.inArray(!1,n)){var r=[],i=0,o=e.asStripeClasses,s=o.length,l=(e.aoOpenRows.length,e.oLanguage),u=e.iInitDisplayStart,c="ssp"==Bt(e),f=e.aiDisplay;e.bDrawing=!0;if(u!==a&&-1!==u){e._iDisplayStart=c?u:u>=e.fnRecordsDisplay()?0:u;e.iInitDisplayStart=-1}var h=e._iDisplayStart,d=e.fnDisplayEnd();if(e.bDeferLoading){e.bDeferLoading=!1;e.iDraw++;pt(e,!1)}else if(c){if(!e.bDestroying&&!B(e))return}else e.iDraw++;if(0!==f.length)for(var p=c?0:h,g=c?e.aoData.length:d,v=p;g>v;v++){var y=f[v],b=e.aoData[y];null===b.nTr&&j(e,y);var w=b.nTr;if(0!==s){var x=o[i%s];if(b._sRowStripe!=x){t(w).removeClass(b._sRowStripe).addClass(x);b._sRowStripe=x}}zt(e,"aoRowCallback",null,[w,b._aData,i,v]);r.push(w);i++}else{var C=l.sZeroRecords;1==e.iDraw&&"ajax"==Bt(e)?C=l.sLoadingRecords:l.sEmptyTable&&0===e.fnRecordsTotal()&&(C=l.sEmptyTable);r[0]=t("",{"class":s?o[0]:""}).append(t("",{valign:"top",colSpan:m(e),"class":e.oClasses.sRowEmpty}).html(C))[0]}zt(e,"aoHeaderCallback","header",[t(e.nTHead).children("tr")[0],L(e),h,d,f]);zt(e,"aoFooterCallback","footer",[t(e.nTFoot).children("tr")[0],L(e),h,d,f]);var S=t(e.nTBody);S.children().detach();S.append(t(r));zt(e,"aoDrawCallback","draw",[e]);e.bSorted=!1;e.bFiltered=!1;e.bDrawing=!1}else pt(e,!1)}function F(t,e){var n=t.oFeatures,r=n.bSort,i=n.bFilter;r&&_t(t);i?$(t,t.oPreviousSearch):t.aiDisplay=t.aiDisplayMaster.slice();e!==!0&&(t._iDisplayStart=0);t._drawHold=e;R(t);t._drawHold=!1}function W(e){var n=e.oClasses,r=t(e.nTable),i=t("
").insertBefore(r),o=e.oFeatures,a=t("
",{id:e.sTableId+"_wrapper","class":n.sWrapper+(e.nTFoot?"":" "+n.sNoFooter)});e.nHolding=i[0];e.nTableWrapper=a[0];e.nTableReinsertBefore=e.nTable.nextSibling;for(var s,l,u,c,f,h,d=e.sDom.split(""),p=0;p")[0];c=d[p+1];if("'"==c||'"'==c){f="";h=2;for(;d[p+h]!=c;){f+=d[p+h];h++}"H"==f?f=n.sJUIHeader:"F"==f&&(f=n.sJUIFooter);if(-1!=f.indexOf(".")){var g=f.split(".");u.id=g[0].substr(1,g[0].length-1);u.className=g[1]}else"#"==f.charAt(0)?u.id=f.substr(1,f.length-1):u.className=f; p+=h}a.append(u);a=t(u)}else if(">"==l)a=a.parent();else if("l"==l&&o.bPaginate&&o.bLengthChange)s=ct(e);else if("f"==l&&o.bFilter)s=Y(e);else if("r"==l&&o.bProcessing)s=dt(e);else if("t"==l)s=gt(e);else if("i"==l&&o.bInfo)s=it(e);else if("p"==l&&o.bPaginate)s=ft(e);else if(0!==Yt.ext.feature.length)for(var m=Yt.ext.feature,v=0,y=m.length;y>v;v++)if(l==m[v].cFeature){s=m[v].fnInit(e);break}if(s){var b=e.aanFeatures;b[l]||(b[l]=[]);b[l].push(s);a.append(s)}}i.replaceWith(a)}function z(e,n){var r,i,o,a,s,l,u,c,f,h,d,p=t(n).children("tr"),g=function(t,e,n){for(var r=t[e];r[n];)n++;return n};e.splice(0,e.length);for(o=0,l=p.length;l>o;o++)e.push([]);for(o=0,l=p.length;l>o;o++){r=p[o];c=0;i=r.firstChild;for(;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){f=1*i.getAttribute("colspan");h=1*i.getAttribute("rowspan");f=f&&0!==f&&1!==f?f:1;h=h&&0!==h&&1!==h?h:1;u=g(e,o,c);d=1===f?!0:!1;for(s=0;f>s;s++)for(a=0;h>a;a++){e[o+a][u+s]={cell:i,unique:d};e[o+a].nTr=r}}i=i.nextSibling}}}function q(t,e,n){var r=[];if(!n){n=t.aoHeader;if(e){n=[];z(n,e)}}for(var i=0,o=n.length;o>i;i++)for(var a=0,s=n[i].length;s>a;a++)!n[i][a].unique||r[a]&&t.bSortCellsTop||(r[a]=n[i][a].cell);return r}function U(e,n,r){zt(e,"aoServerParams","serverParams",[n]);if(n&&t.isArray(n)){var i={},o=/(.*?)\[\]$/;t.each(n,function(t,e){var n=e.name.match(o);if(n){var r=n[0];i[r]||(i[r]=[]);i[r].push(e.value)}else i[e.name]=e.value});n=i}var a,s=e.ajax,l=e.oInstance,u=function(t){zt(e,null,"xhr",[e,t,e.jqXHR]);r(t)};if(t.isPlainObject(s)&&s.data){a=s.data;var c=t.isFunction(a)?a(n,e):a;n=t.isFunction(a)&&c?c:t.extend(!0,n,c);delete s.data}var f={data:n,success:function(t){var n=t.error||t.sError;n&&Ht(e,0,n);e.json=t;u(t)},dataType:"json",cache:!1,type:e.sServerMethod,error:function(n,r,i){var o=zt(e,null,"xhr",[e,null,e.jqXHR]);-1===t.inArray(!0,o)&&("parsererror"==r?Ht(e,0,"Invalid JSON response",1):4===n.readyState&&Ht(e,0,"Ajax error",7));pt(e,!1)}};e.oAjaxData=n;zt(e,null,"preXhr",[e,n]);if(e.fnServerData)e.fnServerData.call(l,e.sAjaxSource,t.map(n,function(t,e){return{name:e,value:t}}),u,e);else if(e.sAjaxSource||"string"==typeof s)e.jqXHR=t.ajax(t.extend(f,{url:s||e.sAjaxSource}));else if(t.isFunction(s))e.jqXHR=s.call(l,n,u,e);else{e.jqXHR=t.ajax(t.extend(f,s));s.data=a}}function B(t){if(t.bAjaxDataGet){t.iDraw++;pt(t,!0);U(t,V(t),function(e){X(t,e)});return!1}return!0}function V(e){var n,r,i,o,a=e.aoColumns,s=a.length,l=e.oFeatures,u=e.oPreviousSearch,c=e.aoPreSearchCols,f=[],h=Mt(e),d=e._iDisplayStart,p=l.bPaginate!==!1?e._iDisplayLength:-1,g=function(t,e){f.push({name:t,value:e})};g("sEcho",e.iDraw);g("iColumns",s);g("sColumns",he(a,"sName").join(","));g("iDisplayStart",d);g("iDisplayLength",p);var m={draw:e.iDraw,columns:[],order:[],start:d,length:p,search:{value:u.sSearch,regex:u.bRegex}};for(n=0;s>n;n++){i=a[n];o=c[n];r="function"==typeof i.mData?"function":i.mData;m.columns.push({data:r,name:i.sName,searchable:i.bSearchable,orderable:i.bSortable,search:{value:o.sSearch,regex:o.bRegex}});g("mDataProp_"+n,r);if(l.bFilter){g("sSearch_"+n,o.sSearch);g("bRegex_"+n,o.bRegex);g("bSearchable_"+n,i.bSearchable)}l.bSort&&g("bSortable_"+n,i.bSortable)}if(l.bFilter){g("sSearch",u.sSearch);g("bRegex",u.bRegex)}if(l.bSort){t.each(h,function(t,e){m.order.push({column:e.col,dir:e.dir});g("iSortCol_"+t,e.col);g("sSortDir_"+t,e.dir)});g("iSortingCols",h.length)}var v=Yt.ext.legacy.ajax;return null===v?e.sAjaxSource?f:m:v?f:m}function X(t,e){var n=function(t,n){return e[t]!==a?e[t]:e[n]},r=G(t,e),i=n("sEcho","draw"),o=n("iTotalRecords","recordsTotal"),s=n("iTotalDisplayRecords","recordsFiltered");if(i){if(1*il;l++)w(t,r[l]);t.aiDisplay=t.aiDisplayMaster.slice();t.bAjaxDataGet=!1;R(t);t._bInitComplete||lt(t,e);t.bAjaxDataGet=!0;pt(t,!1)}function G(e,n){var r=t.isPlainObject(e.ajax)&&e.ajax.dataSrc!==a?e.ajax.dataSrc:e.sAjaxDataProp;return"data"===r?n.aaData||n[r]:""!==r?_(r)(n):n}function Y(e){var n=e.oClasses,r=e.sTableId,i=e.oLanguage,a=e.oPreviousSearch,s=e.aanFeatures,l='',u=i.sSearch;u=u.match(/_INPUT_/)?u.replace("_INPUT_",l):u+l;var c=t("
",{id:s.f?null:r+"_filter","class":n.sFilter}).append(t("