summaryrefslogtreecommitdiff
path: root/site/public/assets/js/dist
diff options
context:
space:
mode:
authorAdam Harvey <adam@ahprojects.com>2019-06-05 10:44:12 -0500
committerAdam Harvey <adam@ahprojects.com>2019-06-05 10:44:12 -0500
commitb3ed0f95eb94a4e7cb5e137bb8196db8c36aa50d (patch)
tree8eb5ce503f805bbd58c4565cd845ac196b1a30dd /site/public/assets/js/dist
parent7919ecc1a760f611efbe1283096482a8ec99efef (diff)
fix?
Diffstat (limited to 'site/public/assets/js/dist')
-rw-r--r--site/public/assets/js/dist/index.js88
1 files changed, 88 insertions, 0 deletions
diff --git a/site/public/assets/js/dist/index.js b/site/public/assets/js/dist/index.js
new file mode 100644
index 00000000..a1c2304c
--- /dev/null
+++ b/site/public/assets/js/dist/index.js
@@ -0,0 +1,88 @@
+!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=183)}([function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===t)return new Date(NaN);var n=e||{},c=null==n.additionalDigits?s:Object(i.a)(n.additionalDigits);if(2!==c&&1!==c&&0!==c)throw new RangeError("additionalDigits must be 0, 1 or 2");if(t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))return new Date(t.getTime());if("number"==typeof t||"[object Number]"===Object.prototype.toString.call(t))return new Date(t);if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var h=function(t){var e,n={},i=t.split(l.dateTimeDelimeter);l.plainTime.test(i[0])?(n.date=null,e=i[0]):(n.date=i[0],e=i[1],l.timeZoneDelimeter.test(n.date)&&(n.date=t.split(l.timeZoneDelimeter)[0],e=t.substr(n.date.length,t.length)));if(e){var o=l.timezone.exec(e);o?(n.time=e.replace(o[1],""),n.timezone=o[1]):n.time=e}return n}(t),v=function(t,e){var n,i=l.YYY[e],o=l.YYYYY[e];if(n=l.YYYY.exec(t)||o.exec(t)){var r=n[1];return{year:parseInt(r,10),restDateString:t.slice(r.length)}}if(n=l.YY.exec(t)||i.exec(t)){var a=n[1];return{year:100*parseInt(a,10),restDateString:t.slice(a.length)}}return{year:null}}(h.date,c),y=v.year,b=function(t,e){if(null===e)return null;var n,i,o,r;if(0===t.length)return(i=new Date(0)).setUTCFullYear(e),i;if(n=l.MM.exec(t))return i=new Date(0),o=parseInt(n[1],10)-1,f(e,o)?(i.setUTCFullYear(e,o),i):new Date(NaN);if(n=l.DDD.exec(t)){i=new Date(0);var a=parseInt(n[1],10);return function(t,e){if(e<1)return!1;var n=d(t);if(n&&e>366)return!1;if(!n&&e>365)return!1;return!0}(e,a)?(i.setUTCFullYear(e,0,a),i):new Date(NaN)}if(n=l.MMDD.exec(t)){i=new Date(0),o=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return f(e,o,s)?(i.setUTCFullYear(e,o,s),i):new Date(NaN)}if(n=l.Www.exec(t))return r=parseInt(n[1],10)-1,p(e,r)?u(e,r):new Date(NaN);if(n=l.WwwD.exec(t)){r=parseInt(n[1],10)-1;var c=parseInt(n[2],10)-1;return p(e,r,c)?u(e,r,c):new Date(NaN)}return null}(v.restDateString,y);if(isNaN(b))return new Date(NaN);if(b){var w,_=b.getTime(),x=0;if(h.time&&(x=function(t){var e,n,i;if(e=l.HH.exec(t))return g(n=parseFloat(e[1].replace(",",".")))?n%24*r:NaN;if(e=l.HHMM.exec(t))return n=parseInt(e[1],10),i=parseFloat(e[2].replace(",",".")),g(n,i)?n%24*r+i*a:NaN;if(e=l.HHMMSS.exec(t)){n=parseInt(e[1],10),i=parseInt(e[2],10);var o=parseFloat(e[3].replace(",","."));return g(n,i,o)?n%24*r+i*a+1e3*o:NaN}return null}(h.time),isNaN(x)))return new Date(NaN);if(h.timezone){if(w=function(t){var e,n,i;if(e=l.timezoneZ.exec(t))return 0;if(e=l.timezoneHH.exec(t))return m(i=parseInt(e[2],10))?(n=i*r,"+"===e[1]?-n:n):NaN;if(e=l.timezoneHHMM.exec(t)){i=parseInt(e[2],10);var o=parseInt(e[3],10);return m(i,o)?(n=i*r+o*a,"+"===e[1]?-n:n):NaN}return 0}(h.timezone),isNaN(w))return new Date(NaN)}else w=Object(o.a)(new Date(_+x)),w=Object(o.a)(new Date(_+x+w));return new Date(_+x+w)}return new Date(NaN)};var i=n(1),o=n(19),r=36e5,a=6e4,s=2,l={dateTimeDelimeter:/[T ]/,plainTime:/:/,timeZoneDelimeter:/[Z ]/i,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-])(\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function u(t,e,n){e=e||0,n=n||0;var i=new Date(0);i.setUTCFullYear(t,0,4);var o=7*e+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+o),i}var c=[31,28,31,30,31,30,31,31,30,31,30,31],h=[31,29,31,30,31,30,31,31,30,31,30,31];function d(t){return t%400==0||t%4==0&&t%100!=0}function f(t,e,n){if(e<0||e>11)return!1;if(null!=n){if(n<1)return!1;var i=d(t);if(i&&n>h[e])return!1;if(!i&&n>c[e])return!1}return!0}function p(t,e,n){return!(e<0||e>52)&&(null==n||!(n<0||n>6))}function g(t,e,n){return(null==t||!(t<0||t>=25))&&((null==e||!(e<0||e>=60))&&(null==n||!(n<0||n>=60)))}function m(t,e){return null==e||!(e<0||e>59)}},function(t,e,n){"use strict";e.a=function(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);if(isNaN(e))return e;return e<0?Math.ceil(e):Math.floor(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"version",function(){return a}),n.d(e,"DOM",function(){return P}),n.d(e,"Children",function(){return T}),n.d(e,"render",function(){return y}),n.d(e,"createClass",function(){return H}),n.d(e,"createPortal",function(){return x}),n.d(e,"createFactory",function(){return M}),n.d(e,"createElement",function(){return k}),n.d(e,"cloneElement",function(){return R}),n.d(e,"isValidElement",function(){return D}),n.d(e,"findDOMNode",function(){return I}),n.d(e,"unmountComponentAtNode",function(){return S}),n.d(e,"Component",function(){return Y}),n.d(e,"PureComponent",function(){return X}),n.d(e,"unstable_renderSubtreeIntoContainer",function(){return w}),n.d(e,"unstable_batchedUpdates",function(){return Z}),n.d(e,"__spread",function(){return z});var i=n(33),o=n.n(i);n.d(e,"PropTypes",function(){return o.a});var r=n(207),a="15.1.0",s="a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan".split(" "),l="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,u="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("__preactCompatWrapper"):"__preactCompatWrapper",c={constructor:1,render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},h=/^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vector|vert|word|writing|x)[A-Z]/,d={},f=!1;try{f=!1}catch(t){}function p(){return null}var g=Object(r.c)("a",null).constructor;g.prototype.$$typeof=l,g.prototype.preactCompatUpgraded=!1,g.prototype.preactCompatNormalized=!1,Object.defineProperty(g.prototype,"type",{get:function(){return this.nodeName},set:function(t){this.nodeName=t},configurable:!0}),Object.defineProperty(g.prototype,"props",{get:function(){return this.attributes},set:function(t){this.attributes=t},configurable:!0});var m=r.d.event;r.d.event=function(t){return m&&(t=m(t)),t.persist=Object,t.nativeEvent=t,t};var v=r.d.vnode;function y(t,e,n){var i=e&&e._preactCompatRendered&&e._preactCompatRendered.base;i&&i.parentNode!==e&&(i=null),!i&&e&&(i=e.firstElementChild);for(var o=e.childNodes.length;o--;)e.childNodes[o]!==i&&e.removeChild(e.childNodes[o]);var a=Object(r.e)(t,e,i);return e&&(e._preactCompatRendered=a&&(a._component||{base:a})),"function"==typeof n&&n(),a&&a._component||a}r.d.vnode=function(t){if(!t.preactCompatUpgraded){t.preactCompatUpgraded=!0;var e=t.nodeName,n=t.attributes=null==t.attributes?{}:z({},t.attributes);"function"==typeof e?(!0===e[u]||e.prototype&&"isReactComponent"in e.prototype)&&(t.children&&""===String(t.children)&&(t.children=void 0),t.children&&(n.children=t.children),t.preactCompatNormalized||O(t),function(t){var e=t.nodeName,n=t.attributes;t.attributes={},e.defaultProps&&z(t.attributes,e.defaultProps);n&&z(t.attributes,n)}(t)):(t.children&&""===String(t.children)&&(t.children=void 0),t.children&&(n.children=t.children),n.defaultValue&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),function(t,e){var n,i,o;if(e){for(o in e)if(n=h.test(o))break;if(n)for(o in i=t.attributes={},e)e.hasOwnProperty(o)&&(i[h.test(o)?o.replace(/([A-Z0-9])/,"-$1").toLowerCase():o]=e[o])}}(t,n))}v&&v(t)};var b=function(){};function w(t,e,n,i){var o=y(Object(r.c)(b,{context:t.context},e),n),a=o._component||o.base;return i&&i.call(a,o),a}function _(t){w(this,t.vnode,t.container)}function x(t,e){return Object(r.c)(_,{vnode:t,container:e})}function S(t){var e=t._preactCompatRendered&&t._preactCompatRendered.base;return!(!e||e.parentNode!==t)&&(Object(r.e)(Object(r.c)(p),t,e),!0)}b.prototype.getChildContext=function(){return this.props.context},b.prototype.render=function(t){return t.children[0]};var E,C=[],T={map:function(t,e,n){return null==t?null:(t=T.toArray(t),n&&n!==t&&(e=e.bind(n)),t.map(e))},forEach:function(t,e,n){if(null==t)return null;t=T.toArray(t),n&&n!==t&&(e=e.bind(n)),t.forEach(e)},count:function(t){return t&&t.length||0},only:function(t){if(1!==(t=T.toArray(t)).length)throw new Error("Children.only() expects only one child.");return t[0]},toArray:function(t){return null==t?[]:C.concat(t)}};function M(t){return k.bind(null,t)}for(var P={},L=s.length;L--;)P[s[L]]=M(s[L]);function A(t){var e=t[u];return e?!0===e?t:e:(e=function(t){return H({displayName:t.displayName||t.name,render:function(){return t(this.props,this.context)}})}(t),Object.defineProperty(e,u,{configurable:!0,value:!0}),e.displayName=t.displayName,e.propTypes=t.propTypes,e.defaultProps=t.defaultProps,Object.defineProperty(t,u,{configurable:!0,value:e}),e)}function k(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function t(e,n){for(var i=n||0;i<e.length;i++){var o=e[i];Array.isArray(o)?t(o):o&&"object"==typeof o&&!D(o)&&(o.props&&o.type||o.attributes&&o.nodeName||o.children)&&(e[i]=k(o.type||o.nodeName,o.props||o.attributes,o.children))}}(t,2),O(r.c.apply(void 0,t))}function O(t){t.preactCompatNormalized=!0,function(t){var e=t.attributes||(t.attributes={});j.enumerable="className"in e,e.className&&(e.class=e.className);Object.defineProperty(e,"className",j)}(t),function(t){return"function"==typeof t&&!(t.prototype&&t.prototype.render)}(t.nodeName)&&(t.nodeName=A(t.nodeName));var e=t.attributes.ref,n=e&&typeof e;return!E||"string"!==n&&"number"!==n||(t.attributes.ref=function(t,e){return e._refProxies[t]||(e._refProxies[t]=function(n){e&&e.refs&&(e.refs[t]=n,null===n&&(delete e._refProxies[t],e=null))})}(e,E)),function(t){var e=t.nodeName,n=t.attributes;if(!n||"string"!=typeof e)return;var i={};for(var o in n)i[o.toLowerCase()]=o;i.ondoubleclick&&(n.ondblclick=n[i.ondoubleclick],delete n[i.ondoubleclick]);if(i.onchange&&("textarea"===e||"input"===e.toLowerCase()&&!/^fil|che|rad/i.test(n.type))){var r=i.oninput||"oninput";n[r]||(n[r]=V([n[r],n[i.onchange]]),delete n[i.onchange])}}(t),t}function R(t,e){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];if(!D(t))return t;var o=t.attributes||t.props,a=[Object(r.c)(t.nodeName||t.type,z({},o),t.children||o&&o.children),e];return n&&n.length?a.push(n):e&&e.children&&a.push(e.children),O(r.b.apply(void 0,a))}function D(t){return t&&(t instanceof g||t.$$typeof===l)}var j={configurable:!0,get:function(){return this.class},set:function(t){this.class=t}};function z(t,e){for(var n=arguments,i=1,o=void 0;i<arguments.length;i++)if(o=n[i])for(var r in o)o.hasOwnProperty(r)&&(t[r]=o[r]);return t}function N(t,e){for(var n in t)if(!(n in e))return!0;for(var i in e)if(t[i]!==e[i])return!0;return!1}function I(t){return t&&(t.base||1===t.nodeType&&t)||null}function F(){}function H(t){function e(t,e){!function(t){for(var e in t){var n=t[e];"function"!=typeof n||n.__bound||c.hasOwnProperty(e)||((t[e]=n.bind(t)).__bound=!0)}}(this),Y.call(this,t,e,d),B.call(this,t,e)}return(t=z({constructor:e},t)).mixins&&function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=V(e[n].concat(t[n]||C),"getDefaultProps"===n||"getInitialState"===n||"getChildContext"===n))}(t,function(t){for(var e={},n=0;n<t.length;n++){var i=t[n];for(var o in i)i.hasOwnProperty(o)&&"function"==typeof i[o]&&(e[o]||(e[o]=[])).push(i[o])}return e}(t.mixins)),t.statics&&z(e,t.statics),t.propTypes&&(e.propTypes=t.propTypes),t.defaultProps&&(e.defaultProps=t.defaultProps),t.getDefaultProps&&(e.defaultProps=t.getDefaultProps.call(e)),F.prototype=Y.prototype,e.prototype=z(new F,t),e.displayName=t.displayName||"Component",e}function G(t,e,n){if("string"==typeof e&&(e=t.constructor.prototype[e]),"function"==typeof e)return e.apply(t,n)}function V(t,e){return function(){for(var n,i=arguments,o=0;o<t.length;o++){var r=G(this,t[o],i);if(e&&null!=r)for(var a in n||(n={}),r)r.hasOwnProperty(a)&&(n[a]=r[a]);else void 0!==r&&(n=r)}return n}}function B(t,e){U.call(this,t,e),this.componentWillReceiveProps=V([U,this.componentWillReceiveProps||"componentWillReceiveProps"]),this.render=V([U,W,this.render||"render",q])}function U(t,e){if(t){var n=t.children;if(n&&Array.isArray(n)&&1===n.length&&("string"==typeof n[0]||"function"==typeof n[0]||n[0]instanceof g)&&(t.children=n[0],t.children&&"object"==typeof t.children&&(t.children.length=1,t.children[0]=t.children)),f){var i="function"==typeof this?this:this.constructor,r=this.propTypes||i.propTypes,a=this.displayName||i.name;r&&o.a.checkPropTypes(r,t,"prop",a)}}}function W(t){E=this}function q(){E===this&&(E=null)}function Y(t,e,n){r.a.call(this,t,e),this.state=this.getInitialState?this.getInitialState():{},this.refs={},this._refProxies={},n!==d&&B.call(this,t,e)}function X(t,e){Y.call(this,t,e)}function Z(t){t()}z(Y.prototype=new r.a,{constructor:Y,isReactComponent:{},replaceState:function(t,e){for(var n in this.setState(t,e),this.state)n in t||delete this.state[n]},getDOMNode:function(){return this.base},isMounted:function(){return!!this.base}}),F.prototype=Y.prototype,X.prototype=new F,X.prototype.isPureReactComponent=!0,X.prototype.shouldComponentUpdate=function(t,e){return N(this.props,t)||N(this.state,e)};var Q={version:a,DOM:P,PropTypes:o.a,Children:T,render:y,createClass:H,createPortal:x,createFactory:M,createElement:k,cloneElement:R,isValidElement:D,findDOMNode:I,unmountComponentAtNode:S,Component:Y,PureComponent:X,unstable_renderSubtreeIntoContainer:w,unstable_batchedUpdates:Z,__spread:z};e.default=Q},function(t,e){var n=t.exports={version:"2.6.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){var i=n(5),o=n(3),r=n(18),a=n(20),s=n(24),l=function(t,e,n){var u,c,h,d=t&l.F,f=t&l.G,p=t&l.S,g=t&l.P,m=t&l.B,v=t&l.W,y=f?o:o[e]||(o[e]={}),b=y.prototype,w=f?i:p?i[e]:(i[e]||{}).prototype;for(u in f&&(n=e),n)(c=!d&&w&&void 0!==w[u])&&s(y,u)||(h=c?w[u]:n[u],y[u]=f&&"function"!=typeof w[u]?n[u]:m&&c?r(h,i):v&&w[u]==h?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(h):g&&"function"==typeof h?r(Function.call,h):h,g&&((y.virtual||(y.virtual={}))[u]=h,t&l.R&&b&&!b[u]&&a(b,u,h)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var i=n(74)("wks"),o=n(54),r=n(5).Symbol,a="function"==typeof r;(t.exports=function(t){return i[t]||(i[t]=a&&r[t]||(a?r:o)("Symbol."+t))}).store=i},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(n(235));e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),(0,i.default)(t,o.key,o)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}()},function(t,e,n){var i=n(15),o=n(102),r=n(71),a=Object.defineProperty;e.f=n(16)?Object.defineProperty:function(t,e,n){if(i(t),e=r(e,!0),i(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.post=e.get=e.preloadImage=e.domainFromUrl=e.clamp=e.px=e.percent=e.timestamp=e.padSeconds=e.courtesyS=e.pad=e.formatName=e.widths=e.toTuples=e.choice=e.toArray=e.isFirefox=e.isDesktop=e.isMobile=e.isAndroid=e.isiPad=e.isiPhone=void 0;var i=r(n(228)),o=r(n(45));function r(t){return t&&t.__esModule?t:{default:t}}var a=e.isiPhone=!(!navigator.userAgent.match(/iPhone/i)&&!navigator.userAgent.match(/iPod/i)),s=e.isiPad=!!navigator.userAgent.match(/iPad/i),l=e.isAndroid=!!navigator.userAgent.match(/Android/i),u=e.isMobile=a||s||l,c=e.isDesktop=!u,h=e.isFirefox="undefined"!=typeof InstallTrigger,d=(e.toArray=function(t){return Array.prototype.slice.apply(t)},e.choice=function(t){return t[Math.floor(Math.random()*t.length)]},e.toTuples=function(t){return(0,o.default)(t).map(function(e){return[e,t[e]]})},document.body.parentNode.classList);d.add(c?"desktop":"mobile"),h&&d.add("firefox");e.widths={th:160,sm:320,md:640,lg:1280};var f="id url cc sa fp md5 sha256".split(" ").map(function(t){return"_"+t}),p=f.map(function(t){return t.toUpperCase()}),g=(e.formatName=function(t){return f.forEach(function(e,n){return t=t.replace(e,p[n])}),t.replace(/_/g," ")},e.pad=function(t,e){for(var n=String(t||0);n.length<e;)n="0"+n;return n},e.courtesyS=function(t,e){return t+" "+(1===t?e:e+"s")},e.padSeconds=function(t){return t<10?"0"+t:t});e.timestamp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;t/=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25;var e=g(Math.round(t)%60);return(t=Math.floor(t/60))>60?Math.floor(t/60)+":"+g(t%60)+":"+e:t%60+":"+e},e.percent=function(t){return(100*t).toFixed(1)+"%"},e.px=function(t,e){return Math.round(t*e)+"px"},e.clamp=function(t,e,n){return t<e?e:t<n?t:n},e.domainFromUrl=function(t){var e=t.split("/")[2].split(".");return e.length>2&&2==e[e.length-2].length?e.slice(-3).join("."):e.slice(-2).join(".")},e.preloadImage=function(t){var e=t.verified,n=t.hash,i=t.frame,o=t.url;n&&i&&(o=imageUrl(e,n,i,"md"));var r=new Image,a=!1;r.onload=function(){a||(a=!0,r.onload=null)},r.crossOrigin="anonymous",r.src=o,r.complete&&r.onload()},e.get=function(t,e){return fetch(t,{method:"GET",body:e,headers:{Accept:"application/json, application/xml, text/play, text/html, *.*"}}).then(function(t){return t.json()})},e.post=function(t,e){var n=void 0;return e instanceof FormData?n={Accept:"application/json, application/xml, text/play, text/html, *.*"}:(n={Accept:"application/json, application/xml, text/play, text/html, *.*","Content-Type":"application/json; charset=utf-8"},e=(0,i.default)(e)),fetch(t,{method:"POST",body:e,headers:n}).then(function(t){return t.json()})}},function(t,e,n){t.exports={default:n(233),__esModule:!0}},function(t,e,n){"use strict";e.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(n(56));e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,i.default)(e))&&"function"!=typeof e?t:e}},function(t,e,n){"use strict";e.__esModule=!0;var i=a(n(247)),o=a(n(251)),r=a(n(56));function a(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,r.default)(e)));t.prototype=(0,o.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(i.default?(0,i.default)(t,e):t.__proto__=e)}},function(t,e,n){var i=n(10);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(23)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(210),o=n(117),r=n(216);n.d(e,"Provider",function(){return i.b}),n.d(e,"createProvider",function(){return i.a}),n.d(e,"connectAdvanced",function(){return o.a}),n.d(e,"connect",function(){return r.a})},function(t,e,n){var i=n(40);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";e.a=function(t){var e=new Date(t.getTime()),n=e.getTimezoneOffset();e.setSeconds(0,0);var o=e.getTime()%i;return n*i+o};var i=6e4},function(t,e,n){var i=n(9),o=n(41);t.exports=n(16)?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"createStore",function(){return s}),n.d(e,"combineReducers",function(){return u}),n.d(e,"bindActionCreators",function(){return h}),n.d(e,"applyMiddleware",function(){return p}),n.d(e,"compose",function(){return f}),n.d(e,"__DO_NOT_USE__ActionTypes",function(){return r});var i=n(219),o=function(){return Math.random().toString(36).substring(7).split("").join(".")},r={INIT:"@@redux/INIT"+o(),REPLACE:"@@redux/REPLACE"+o(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+o()}};function a(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function s(t,e,n){var o;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function");if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(s)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var l=t,u=e,c=[],h=c,d=!1;function f(){h===c&&(h=c.slice())}function p(){if(d)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return u}function g(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(d)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var e=!0;return f(),h.push(t),function(){if(e){if(d)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");e=!1,f();var n=h.indexOf(t);h.splice(n,1)}}}function m(t){if(!a(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,u=l(u,t)}finally{d=!1}for(var e=c=h,n=0;n<e.length;n++){(0,e[n])()}return t}return m({type:r.INIT}),(o={dispatch:m,subscribe:g,getState:p,replaceReducer:function(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");l=t,m({type:r.REPLACE})}})[i.a]=function(){var t,e=g;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function n(){t.next&&t.next(p())}return n(),{unsubscribe:e(n)}}})[i.a]=function(){return this},t},o}function l(t,e){var n=e&&e.type;return"Given "+(n&&'action "'+String(n)+'"'||"an action")+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function u(t){for(var e=Object.keys(t),n={},i=0;i<e.length;i++){var o=e[i];0,"function"==typeof t[o]&&(n[o]=t[o])}var a,s=Object.keys(n);try{!function(t){Object.keys(t).forEach(function(e){var n=t[e];if(void 0===n(void 0,{type:r.INIT}))throw new Error('Reducer "'+e+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:r.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+e+"\" returned undefined when probed with a random type. Don't try to handle "+r.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(n)}catch(t){a=t}return function(t,e){if(void 0===t&&(t={}),a)throw a;for(var i=!1,o={},r=0;r<s.length;r++){var u=s[r],c=n[u],h=t[u],d=c(h,e);if(void 0===d){var f=l(u,e);throw new Error(f)}o[u]=d,i=i||d!==h}return i?o:t}}function c(t,e){return function(){return e(t.apply(this,arguments))}}function h(t,e){if("function"==typeof t)return c(t,e);if("object"!=typeof t||null===t)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===t?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(t),i={},o=0;o<n.length;o++){var r=n[o],a=t[r];"function"==typeof a&&(i[r]=c(a,e))}return i}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})}function p(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),i=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:n.getState,dispatch:function(){return i.apply(void 0,arguments)}},r=e.map(function(t){return t(o)});return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(e){d(t,e,n[e])})}return t}({},n,{dispatch:i=f.apply(void 0,r)(n.dispatch)})}}}},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=e||{},r=n.locale,a=r&&r.options&&r.options.weekStartsOn,s=null==a?0:Object(i.a)(a),l=null==n.weekStartsOn?s:Object(i.a)(n.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Object(o.a)(t,n),c=u.getDay(),h=(c<l?7:0)+c-l;return u.setDate(u.getDate()-h),u.setHours(0,0,0,0),u};var i=n(1),o=n(0)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var o=function(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}(i),r=i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"});return[n].concat(r).concat([o]).join("\n")}return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},o=0;o<this.length;o++){var r=this[o][0];"number"==typeof r&&(i[r]=!0)}for(o=0;o<t.length;o++){var a=t[o];"number"==typeof a[0]&&i[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){var i={},o=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),r=function(t){var e={};return function(t){if("function"==typeof t)return t();if(void 0===e[t]){var n=function(t){return document.querySelector(t)}.call(this,t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}}(),a=null,s=0,l=[],u=n(259);function c(t,e){for(var n=0;n<t.length;n++){var o=t[n],r=i[o.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](o.parts[a]);for(;a<o.parts.length;a++)r.parts.push(m(o.parts[a],e))}else{var s=[];for(a=0;a<o.parts.length;a++)s.push(m(o.parts[a],e));i[o.id]={id:o.id,refs:1,parts:s}}}}function h(t,e){for(var n=[],i={},o=0;o<t.length;o++){var r=t[o],a=e.base?r[0]+e.base:r[0],s={css:r[1],media:r[2],sourceMap:r[3]};i[a]?i[a].parts.push(s):n.push(i[a]={id:a,parts:[s]})}return n}function d(t,e){var n=r(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=l[l.length-1];if("top"===t.insertAt)i?i.nextSibling?n.insertBefore(e,i.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),l.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=r(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,o)}}function f(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=l.indexOf(t);e>=0&&l.splice(e,1)}function p(t){var e=document.createElement("style");return void 0===t.attrs.type&&(t.attrs.type="text/css"),g(e,t.attrs),d(t,e),e}function g(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function m(t,e){var n,i,o,r;if(e.transform&&t.css){if(!(r=e.transform(t.css)))return function(){};t.css=r}if(e.singleton){var l=s++;n=a||(a=p(e)),i=y.bind(null,n,l,!1),o=y.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),d(t,e),e}(e),i=function(t,e,n){var i=n.css,o=n.sourceMap,r=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||r)&&(i=u(i));o&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([i],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),o=function(){f(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(e),i=function(t,e){var n=e.css,i=e.media;i&&t.setAttribute("media",i);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){f(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return c(n,e),function(t){for(var o=[],r=0;r<n.length;r++){var a=n[r];(s=i[a.id]).refs--,o.push(s)}t&&c(h(t,e),e);for(r=0;r<o.length;r++){var s;if(0===(s=o[r]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete i[s.id]}}}};var v=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}();function y(t,e,n,i){var o=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=v(e,o);else{var r=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(o.a)(e);return n.weekStartsOn=1,Object(i.a)(t,n)};var i=n(22),o=n(35)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n),a=o.getTime()-r.getTime();return a<0?-1:a>0?1:a};var i=n(0)},function(t,e){t.exports={}},function(t,e,n){var i=n(67),o=n(68);t.exports=function(t){return i(o(t))}},function(t,e,n){var i=n(68);t.exports=function(t){return Object(i(t))}},function(t,e,n){"use strict";var i=n(192)(!0);n(69)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){t.exports=n(205)()},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),r=n.getFullYear(),a=new Date(0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);var s=Object(o.a)(a,e),l=new Date(0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);var u=Object(o.a)(l,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1};var i=n(0),o=n(27)},function(t,e,n){"use strict";e.a=function(t){t=t||{};var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(o.a)(e,n),l=a.getTime()-Object(i.a)(a),u=s.getTime()-Object(i.a)(s);return Math.round((l-u)/r)};var i=n(19),o=n(90),r=864e5},function(t,e,n){n(186);for(var i=n(5),o=n(20),r=n(29),a=n(6)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var u=s[l],c=i[u],h=c&&c.prototype;h&&!h[a]&&o(h,a,u),r[u]=r.Array}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=!0},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var i=n(104),o=n(75);t.exports=Object.keys||function(t){return i(t,o)}},function(t,e,n){var i=n(9).f,o=n(24),r=n(6)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,r)&&i(t,r,{configurable:!0,value:e})}},function(t,e,n){var i=n(18),o=n(107),r=n(108),a=n(15),s=n(53),l=n(76),u={},c={};(e=t.exports=function(t,e,n,h,d){var f,p,g,m,v=d?function(){return t}:l(t),y=i(n,h,e?2:1),b=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(r(v)){for(f=s(t.length);f>b;b++)if((m=e?y(a(p=t[b])[0],p[1]):y(t[b]))===u||m===c)return m}else for(g=v.call(t);!(p=g.next()).done;)if((m=o(g,y,p.value,e))===u||m===c)return m}).BREAK=u,e.RETURN=c},function(t,e,n){t.exports={default:n(230),__esModule:!0}},function(t,e,n){"use strict";e.__esModule=!0;var i=n(2),o=n(2);e.clone=function(t){return JSON.parse(JSON.stringify(t))},e.isSameArray=function(t,e){var n=t.length;if(n!==e.length)return!1;for(;n--;)if(t[n]!==e[n])return!1;return!0},e.reactFormatter=function(t){return function(e,n,r){return r(function(){var n=e.getElement(),r=i.cloneElement(t,{cell:e});o.render(r,n.querySelector(".formatterCell"))}),'<div class="formatterCell"></div>'}}},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n),a=Object(i.a)(e);return r.setDate(r.getDate()+a),r};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n).getTime(),a=Object(i.a)(e);return new Date(r+a)};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),r=new Date(0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Object(o.a)(r,e)};var i=n(34),o=n(27)},function(t,e,n){"use strict";var i=n(311),o=n(312),r=n(314),a=n(315),s=n(317),l={formatDistance:i.a,formatLong:o.a,formatRelative:r.a,localize:a.a,match:s.a,options:{weekStartsOn:0,firstWeekContainsDate:1}};e.a=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Video=e.DetectionBoxes=e.DetectionList=e.Classifier=e.TableCell=e.TableRow=e.TableTuples=e.TableArray=e.TableObject=e.Gate=e.UploadImage=e.Loader=e.Sidebar=void 0;var i=d(n(408)),o=d(n(409)),r=d(n(410)),a=d(n(411)),s=d(n(414)),l=d(n(430)),u=d(n(431)),c=d(n(436)),h=n(437);function d(t){return t&&t.__esModule?t:{default:t}}n(439),e.Sidebar=l.default,e.Loader=a.default,e.UploadImage=s.default,e.Gate=u.default,e.TableObject=h.TableObject,e.TableArray=h.TableArray,e.TableTuples=h.TableTuples,e.TableRow=h.TableRow,e.TableCell=h.TableCell,e.Classifier=i.default,e.DetectionList=r.default,e.DetectionBoxes=o.default,e.Video=c.default},function(t,e,n){var i=n(15),o=n(189),r=n(75),a=n(73)("IE_PROTO"),s=function(){},l=function(){var t,e=n(70)("iframe"),i=r.length;for(e.style.display="none",n(105).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;i--;)delete l.prototype[r[i]];return l()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=i(t),n=new s,s.prototype=null,n[a]=t):n=l(),void 0===e?n:o(n,e)}},function(t,e,n){var i=n(72),o=Math.min;t.exports=function(t){return t>0?o(i(t),9007199254740991):0}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e,n){var i=n(38),o=n(6)("toStringTag"),r="Arguments"==i(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:r?i(e):"Object"==(a=i(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){"use strict";e.__esModule=!0;var i=a(n(238)),o=a(n(240)),r="function"==typeof o.default&&"symbol"==typeof i.default?function(t){return typeof t}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":typeof t};function a(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof o.default&&"symbol"===r(i.default)?function(t){return void 0===t?"undefined":r(t)}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":void 0===t?"undefined":r(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(i.a)(e),l=a.getMonth()+s,u=new Date(0);u.setFullYear(a.getFullYear(),l,1),u.setHours(0,0,0,0);var c=Object(r.a)(u,n);return a.setMonth(l,Math.min(c,a.getDate())),a};var i=n(1),o=n(0),r=n(91)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=7*Object(i.a)(e);return Object(o.a)(t,r,n)};var i=n(1),o=n(47)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()-r.getTime()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return n.setDate(1),n.setHours(0,0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getUTCDay(),r=(o<1?7:0)+o-1;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=e||{},r=n.locale,a=r&&r.options&&r.options.weekStartsOn,s=null==a?0:Object(i.a)(a),l=null==n.weekStartsOn?s:Object(i.a)(n.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Object(o.a)(t,n),c=u.getUTCDay(),h=(c<l?7:0)+c-l;return u.setUTCDate(u.getUTCDate()-h),u.setUTCHours(0,0,0,0),u};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(48)},function(t,e,n){"use strict";e.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(n(432));e.default=i.default||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}},function(t,e,n){"use strict";e.__esModule=!0;var i=r(n(184)),o=r(n(194));function r(t){return t&&t.__esModule?t:{default:t}}e.default=function(){return function(t,e){if(Array.isArray(t))return t;if((0,i.default)(Object(t)))return function(t,e){var n=[],i=!0,r=!1,a=void 0;try{for(var s,l=(0,o.default)(t);!(i=(s=l.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{!i&&l.return&&l.return()}finally{if(r)throw a}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(t,e,n){var i=n(38);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";var i=n(39),o=n(4),r=n(103),a=n(20),s=n(29),l=n(188),u=n(43),c=n(106),h=n(6)("iterator"),d=!([].keys&&"next"in[].keys()),f=function(){return this};t.exports=function(t,e,n,p,g,m,v){l(n,e,p);var y,b,w,_=function(t){if(!d&&t in C)return C[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",S="values"==g,E=!1,C=t.prototype,T=C[h]||C["@@iterator"]||g&&C[g],M=T||_(g),P=g?S?_("entries"):M:void 0,L="Array"==e&&C.entries||T;if(L&&(w=c(L.call(new t)))!==Object.prototype&&w.next&&(u(w,x,!0),i||"function"==typeof w[h]||a(w,h,f)),S&&T&&"values"!==T.name&&(E=!0,M=function(){return T.call(this)}),i&&!v||!d&&!E&&C[h]||a(C,h,M),s[e]=M,s[x]=f,g)if(y={values:S?M:_("values"),keys:m?M:_("keys"),entries:P},v)for(b in y)b in C||r(C,b,y[b]);else o(o.P+o.F*(d||E),e,y);return y}},function(t,e,n){var i=n(10),o=n(5).document,r=i(o)&&i(o.createElement);t.exports=function(t){return r?o.createElement(t):{}}},function(t,e,n){var i=n(10);t.exports=function(t,e){if(!i(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!i(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(74)("keys"),o=n(54);t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e,n){var i=n(3),o=n(5),r=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:i.version,mode:n(39)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(55),o=n(6)("iterator"),r=n(29);t.exports=n(3).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||r[i(t)]}},function(t,e){},function(t,e){t.exports=function(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){"use strict";var i=n(40);t.exports.f=function(t){return new function(t){var e,n;this.promise=new t(function(t,i){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=i}),this.resolve=i(e),this.reject=i(n)}(t)}},function(t,e,n){var i=n(20);t.exports=function(t,e,n){for(var o in e)n&&t[o]?t[o]=e[o]:i(t,o,e[o]);return t}},function(t,e,n){"use strict";e.a=function(t){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t);try{throw new Error(t)}catch(t){}}},function(t,e,n){"use strict";function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}e.a=i},function(t,e,n){"use strict";e.a=function(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||(o[n]=t[n]);return o}},function(t,e,n){e.f=n(6)},function(t,e,n){var i=n(54)("meta"),o=n(10),r=n(24),a=n(9).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(23)(function(){return l(Object.preventExtensions({}))}),c=function(t){a(t,i,{value:{i:"O"+ ++s,w:{}}})},h=t.exports={KEY:i,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!r(t,i)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[i].i},getWeak:function(t,e){if(!r(t,i)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[i].w},onFreeze:function(t){return u&&h.NEED&&l(t)&&!r(t,i)&&c(t),t}}},function(t,e,n){var i=n(5),o=n(3),r=n(39),a=n(84),s=n(9).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=r?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){t.exports={default:n(265),__esModule:!0}},function(t,e,n){"use strict";e.__esModule=!0;var i=n(128),o=n(285),r=n(286),a=n(46);t.exports={ReactTabulator:i.default,React15Tabulator:o.default,ReactTabulatorExample:r.default,reactFormatter:a.reactFormatter}},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return n.setHours(0,0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getFullYear(),r=n.getMonth(),a=new Date(0);return a.setFullYear(o,r+1,0),a.setHours(0,0,0,0),a.getDate()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(i.a)(t,n),s=Object(i.a)(e,n),l=Object(r.a)(a,s,n),u=Math.abs(Object(o.a)(a,s,n));a.setMonth(a.getMonth()-l*u);var c=Object(r.a)(a,s,n)===-l,h=l*(u-c);return 0===h?0:h};var i=n(0),o=n(140),r=n(28)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,e,n)/1e3;return o>0?Math.floor(o):Math.ceil(o)};var i=n(60)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=e||{},l=n.locale,u=l&&l.options&&l.options.weekStartsOn,c=null==u?0:Object(o.a)(u),h=null==n.weekStartsOn?c:Object(o.a)(n.weekStartsOn);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=t||{},f=Object(i.a)(d.start,e),p=Object(i.a)(d.end,e).getTime();if(!(f.getTime()<=p))throw new RangeError("Invalid interval");var g=Object(r.a)(d),m=[],v=0;for(;v++<g.length;){var y=g[v];Object(s.a)(y)&&(m.push(new Date(y)),Object(a.a)(y)&&(v+=5))}return m};var i=n(0),o=n(1),r=n(146),a=n(147),s=n(148)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=new Date(0);return o.setFullYear(n.getFullYear(),0,1),o.setHours(0,0,0,0),o};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(o.a)(t,e),a=n.getUTCFullYear(),s=e||{},l=s.locale,u=l&&l.options&&l.options.firstWeekContainsDate,c=null==u?1:Object(i.a)(u),h=null==s.firstWeekContainsDate?c:Object(i.a)(s.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(a+1,0,h),d.setUTCHours(0,0,0,0);var f=Object(r.a)(d,e),p=new Date(0);p.setUTCFullYear(a,0,h),p.setUTCHours(0,0,0,0);var g=Object(r.a)(p,e);return n.getTime()>=f.getTime()?a+1:n.getTime()>=g.getTime()?a:a-1};var i=n(1),o=n(0),r=n(63)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=e||{},a=n.locale,s=a&&a.options&&a.options.firstWeekContainsDate,l=null==s?1:Object(i.a)(s),u=null==n.firstWeekContainsDate?l:Object(i.a)(n.firstWeekContainsDate),c=Object(o.a)(t,e),h=new Date(0);return h.setFullYear(c,0,u),h.setHours(0,0,0,0),Object(r.a)(h,e)};var i=n(1),o=n(165),r=n(22)},function(t,e,n){"use strict";function i(t){return t.map(t=>String.fromCharCode(t)).join("")}e.b=i,e.a=function(t){if(t.length>=8){const e=i(t.slice(0,8));if("ASCII\0\0\0"===e)return i(t.slice(8));if("JIS\0\0\0\0\0"===e)return"[JIS encoded text]";if("UNICODE\0"===e)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===e)return"[Undefined encoding]"}return"Undefined"}},function(t,e,n){"use strict";var i=n(442);function o(t,e){for(var n in e)r(e,n)&&(t[n]=e[n])}function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t){i(t)||(t={});for(var e=arguments.length,n=1;n<e;n++){var r=arguments[n];i(r)&&o(t,r)}return t}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports=!n(16)&&!n(23)(function(){return 7!=Object.defineProperty(n(70)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){t.exports=n(20)},function(t,e,n){var i=n(24),o=n(30),r=n(190)(!1),a=n(73)("IE_PROTO");t.exports=function(t,e){var n,s=o(t),l=0,u=[];for(n in s)n!=a&&i(s,n)&&u.push(n);for(;e.length>l;)i(s,n=e[l++])&&(~r(u,n)||u.push(n));return u}},function(t,e,n){var i=n(5).document;t.exports=i&&i.documentElement},function(t,e,n){var i=n(24),o=n(31),r=n(73)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),i(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){var i=n(15);t.exports=function(t,e,n,o){try{return o?e(i(n)[0],n[1]):e(n)}catch(e){var r=t.return;throw void 0!==r&&i(r.call(t)),e}}},function(t,e,n){var i=n(29),o=n(6)("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||r[o]===t)}},function(t,e,n){var i=n(15),o=n(40),r=n(6)("species");t.exports=function(t,e){var n,a=i(t).constructor;return void 0===a||void 0==(n=i(a)[r])?e:o(n)}},function(t,e,n){var i,o,r,a=n(18),s=n(200),l=n(105),u=n(70),c=n(5),h=c.process,d=c.setImmediate,f=c.clearImmediate,p=c.MessageChannel,g=c.Dispatch,m=0,v={},y=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},b=function(t){y.call(t.data)};d&&f||(d=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return v[++m]=function(){s("function"==typeof t?t:Function(t),e)},i(m),m},f=function(t){delete v[t]},"process"==n(38)(h)?i=function(t){h.nextTick(a(y,t,1))}:g&&g.now?i=function(t){g.now(a(y,t,1))}:p?(r=(o=new p).port2,o.port1.onmessage=b,i=a(r.postMessage,r,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(i=function(t){c.postMessage(t+"","*")},c.addEventListener("message",b,!1)):i="onreadystatechange"in u("script")?function(t){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),y.call(t)}}:function(t){setTimeout(a(y,t,1),0)}),t.exports={set:d,clear:f}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var i=n(15),o=n(10),r=n(79);t.exports=function(t,e){if(i(t),o(e)&&e.constructor===t)return e;var n=r.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";var i=n(5),o=n(3),r=n(9),a=n(16),s=n(6)("species");t.exports=function(t){var e="function"==typeof o[t]?o[t]:i[t];a&&e&&!e[s]&&r.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var i=n(6)("iterator"),o=!1;try{var r=[7][i]();r.return=function(){o=!0},Array.from(r,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var r=[7],a=r[i]();a.next=function(){return{done:n=!0}},r[i]=function(){return a},t(r)}catch(t){}return n}},function(t,e,n){"use strict";e.a=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}},function(t,e,n){"use strict";n.d(e,"b",function(){return r}),n.d(e,"a",function(){return a});var i=n(33),o=n.n(i),r=o.a.shape({trySubscribe:o.a.func.isRequired,tryUnsubscribe:o.a.func.isRequired,notifyNestedSubs:o.a.func.isRequired,isSubscribed:o.a.func.isRequired}),a=o.a.shape({subscribe:o.a.func.isRequired,dispatch:o.a.func.isRequired,getState:o.a.func.isRequired})},function(t,e,n){"use strict";e.a=function(t,e){var n,s;void 0===e&&(e={});var u=e,y=u.getDisplayName,b=void 0===y?function(t){return"ConnectAdvanced("+t+")"}:y,w=u.methodName,_=void 0===w?"connectAdvanced":w,x=u.renderCountProp,S=void 0===x?void 0:x,E=u.shouldHandleStateChanges,C=void 0===E||E,T=u.storeKey,M=void 0===T?"store":T,P=u.withRef,L=void 0!==P&&P,A=Object(a.a)(u,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),k=M+"Subscription",O=g++,R=((n={})[M]=p.a,n[k]=p.b,n),D=((s={})[k]=p.b,s);return function(e){c()(Object(d.isValidElementType)(e),"You must pass a component to the function returned by "+_+". Instead received "+JSON.stringify(e));var n=e.displayName||e.name||"Component",a=b(n),s=Object(r.a)({},A,{getDisplayName:b,methodName:_,renderCountProp:S,shouldHandleStateChanges:C,storeKey:M,withRef:L,displayName:a,wrappedComponentName:n,WrappedComponent:e}),u=function(n){function l(t,e){var i;return(i=n.call(this,t,e)||this).version=O,i.state={},i.renderCount=0,i.store=t[M]||e[M],i.propsMode=Boolean(t[M]),i.setWrappedInstance=i.setWrappedInstance.bind(Object(o.a)(Object(o.a)(i))),c()(i.store,'Could not find "'+M+'" in either the context or props of "'+a+'". Either wrap the root component in a <Provider>, or explicitly pass "'+M+'" as a prop to "'+a+'".'),i.initSelector(),i.initSubscription(),i}Object(i.a)(l,n);var u=l.prototype;return u.getChildContext=function(){var t,e=this.propsMode?null:this.subscription;return(t={})[k]=e||this.context[k],t},u.componentDidMount=function(){C&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},u.componentWillReceiveProps=function(t){this.selector.run(t)},u.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},u.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=v,this.store=null,this.selector.run=v,this.selector.shouldComponentUpdate=!1},u.getWrappedInstance=function(){return c()(L,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+_+"() call."),this.wrappedInstance},u.setWrappedInstance=function(t){this.wrappedInstance=t},u.initSelector=function(){var e=t(this.store.dispatch,s);this.selector=function(t,e){var n={run:function(i){try{var o=t(e.getState(),i);(o!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=o,n.error=null)}catch(t){n.shouldComponentUpdate=!0,n.error=t}}};return n}(e,this.store),this.selector.run(this.props)},u.initSubscription=function(){if(C){var t=(this.propsMode?this.props:this.context)[k];this.subscription=new f.a(this.store,t,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},u.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(m)):this.notifyNestedSubs()},u.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},u.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},u.addExtraProps=function(t){if(!(L||S||this.propsMode&&this.subscription))return t;var e=Object(r.a)({},t);return L&&(e.ref=this.setWrappedInstance),S&&(e[S]=this.renderCount++),this.propsMode&&this.subscription&&(e[k]=this.subscription),e},u.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return Object(h.createElement)(e,this.addExtraProps(t.props))},l}(h.Component);return u.WrappedComponent=e,u.displayName=a,u.childContextTypes=D,u.contextTypes=R,u.propTypes=R,l()(u,e)}};var i=n(115),o=n(211),r=n(82),a=n(83),s=n(212),l=n.n(s),u=n(214),c=n.n(u),h=n(2),d=n(118),f=(n.n(d),n(215)),p=n(116),g=0,m={};function v(){}},function(t,e,n){"use strict";t.exports=n(213)},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";e.a=function(t){return function(e,n){var i=t(e,n);function o(){return i}return o.dependsOnOwnProps=!1,o}},e.b=function(t,e){return function(e,n){n.displayName;var o=function(t,e){return o.dependsOnOwnProps?o.mapToProps(t,e):o.mapToProps(t)};return o.dependsOnOwnProps=!0,o.mapToProps=function(e,n){o.mapToProps=t,o.dependsOnOwnProps=i(t);var r=o(e,n);return"function"==typeof r&&(o.mapToProps=r,o.dependsOnOwnProps=i(r),r=o(e,n)),r},o}};n(121);function i(t){return null!==t.dependsOnOwnProps&&void 0!==t.dependsOnOwnProps?Boolean(t.dependsOnOwnProps):1!==t.length}},function(t,e,n){"use strict";n(222),n(81)},function(t,e,n){var i=n(4),o=n(3),r=n(23);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],a={};a[t]=e(n),i(i.S+i.F*r(function(){n(1)}),"Object",a)}},function(t,e,n){var i=n(38);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){var i=n(104),o=n(75).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,o)}},function(t,e,n){var i=n(57),o=n(41),r=n(30),a=n(71),s=n(24),l=n(102),u=Object.getOwnPropertyDescriptor;e.f=n(16)?u:function(t,e){if(t=r(t),e=a(e,!0),l)try{return u(t,e)}catch(t){}if(s(t,e))return o(!i.f.call(t,e),t[e])}},function(t,e,n){"use strict";e.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(n(88));e.default=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return(0,i.default)(t)}},function(t,e,n){var i=n(10);t.exports=function(t,e){if(!i(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};e.__esModule=!0;var r=n(2),a=n(2),s=n(129),l=n(130),u=n(46),c=n(131),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={data:[]},e.ref=null,e.htmlProps=null,e.mainId="tabulator-"+ +new Date+"-"+Math.floor(9999999*Math.random()),e.table=null,e.pickValidHTMLProps=function(){e.htmlProps||(e.htmlProps=s.pickHTMLProps(e.props),delete e.htmlProps.data,delete e.htmlProps.columns)},e}return i(e,t),e.prototype.componentDidMount=function(){var t=a.findDOMNode(this.ref),e=this,n=this.props,i=n.columns,r=n.data,s=n.options,u=l.propsToOptions(this.props);new c(t,o({columns:i},u,{layout:"fitColumns",tableBuilding:function(){e.table=this,e.props.tableBuilding&&e.props.tableBuilding()},dataLoaded:function(){e.props.dataLoaded&&e.props.dataLoaded()}},s,{data:r})),r&&r.length>0&&this.setState({data:r})},e.prototype.componentWillUnmount=function(){this.table.destroy()},e.getDerivedStateFromProps=function(t,e){var n=!t.data||0===t.data.length;return!e&&n?null:e&&0===e.data.length&&0===t.data.length?null:e&&t.data&&!u.isSameArray(e.data,t.data)?o({},e,{data:t.data}):{}},e.prototype.componentDidUpdate=function(){this.table.setData(this.state.data)},e.prototype.render=function(){var t=this;this.pickValidHTMLProps();var e=this.props.className;return r.createElement("div",o({ref:function(e){return t.ref=e},"data-instance":this.mainId},this.htmlProps,{className:e}))},e}(r.Component);e.default=h},function(t,e){t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=t,n.c=e,n.p="",n(0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.pickSVGProps=e.pickHTMLProps=void 0;var i=r(n(1)),o=r(n(5));function r(t){return t&&t.__esModule?t:{default:t}}e.pickHTMLProps=i.default,e.pickSVGProps=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=a(n(2)),r=a(n(3));function a(t){return t&&t.__esModule?t:{default:t}}var s=i({},o.default,["about","datatype","defaultChecked","defaultValue","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","color","itemProp","itemScope","itemType","itemRef","itemID","security","unselectable","results","autoSave","allowtransparency","charSet","ismap","typemustmatch","onBlur","onChange","onClick","onContextMenu","onCopy","onCut","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onFocus","onInput","onKeyDown","onKeyPress","onKeyUp","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPaste","onScroll","onSubmit","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onWheel","onCompositionEnd","onCompositionStart","onCompositionUpdate","onInvalid","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onSelect","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onLoad","onError","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd","onToggle"].reduce(function(t,e){return t[e]=e,t},{}));e.default=(0,r.default)(function(t){return Boolean(s[t])||/^(data|aria)-/.test(t)})},function(t,e){
+/*!
+ * html-attributes
+ * https://github.com/alexmingoia/html-attributes
+ */
+"use strict";t.exports={abbr:"abbr",accept:"accept",acceptCharset:"accept-charset",accessKey:"accesskey",action:"action",allowFullScreen:"allowfullscreen",allowTransparency:"allowtransparency",alt:"alt",async:"async",autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",cellPadding:"cellpadding",cellSpacing:"cellspacing",challenge:"challenge",charset:"charset",checked:"checked",cite:"cite",class:"class",className:"class",cols:"cols",colSpan:"colspan",command:"command",content:"content",contentEditable:"contenteditable",contextMenu:"contextmenu",controls:"controls",coords:"coords",crossOrigin:"crossorigin",data:"data",dateTime:"datetime",default:"default",defer:"defer",dir:"dir",disabled:"disabled",download:"download",draggable:"draggable",dropzone:"dropzone",encType:"enctype",for:"for",form:"form",formAction:"formaction",formEncType:"formenctype",formMethod:"formmethod",formNoValidate:"formnovalidate",formTarget:"formtarget",frameBorder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hrefLang:"hreflang",htmlFor:"for",httpEquiv:"http-equiv",icon:"icon",id:"id",inputMode:"inputmode",isMap:"ismap",itemId:"itemid",itemProp:"itemprop",itemRef:"itemref",itemScope:"itemscope",itemType:"itemtype",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",manifest:"manifest",max:"max",maxLength:"maxlength",media:"media",mediaGroup:"mediagroup",method:"method",min:"min",minLength:"minlength",multiple:"multiple",muted:"muted",name:"name",noValidate:"novalidate",open:"open",optimum:"optimum",pattern:"pattern",ping:"ping",placeholder:"placeholder",poster:"poster",preload:"preload",radioGroup:"radiogroup",readOnly:"readonly",rel:"rel",required:"required",role:"role",rows:"rows",rowSpan:"rowspan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",sortable:"sortable",span:"span",spellCheck:"spellcheck",src:"src",srcDoc:"srcdoc",srcSet:"srcset",start:"start",step:"step",style:"style",tabIndex:"tabindex",target:"target",title:"title",translate:"translate",type:"type",typeMustMatch:"typemustmatch",useMap:"usemap",value:"value",width:"width",wmode:"wmode",wrap:"wrap"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(n(4));e.default=function(t){return function(e){if(!(0,i.default)(e))throw new Error("props should be a plain object");var n={};for(var o in e)e.hasOwnProperty(o)&&t(o)&&(n[o]=e[o]);return n}}},function(t,e){var n="[object Object]";var i=Function.prototype,o=Object.prototype,r=i.toString,a=o.hasOwnProperty,s=r.call(Object),l=o.toString,u=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);t.exports=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||l.call(t)!=n||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=u(t);if(null===e)return!0;var i=a.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&r.call(i)==s}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(3)),o=r(n(6));function r(t){return t&&t.__esModule?t:{default:t}}e.default=(0,i.default)(function(t){return Boolean(o.default[t])})},function(t,e){
+/*!
+ * svg-attributes
+ * https://github.com/alexmingoia/svg-attributes
+ */
+"use strict";t.exports={accentHeight:"accent-height",accumulate:"accumulate",additive:"additive",alphabetic:"alphabetic",amplitude:"amplitude",arabicForm:"arabic-form",ascent:"ascent",attributeName:"attributeName",attributeType:"attributeType",azimuth:"azimuth",baseFrequency:"baseFrequency",baseProfile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcMode:"calcMode",capHeight:"cap-height",class:"class",clipPathUnits:"clipPathUnits",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cx:"cx",cy:"cy",d:"d",descent:"descent",diffuseConstant:"diffuseConstant",divisor:"divisor",dur:"dur",dx:"dx",dy:"dy",edgeMode:"edgeMode",elevation:"elevation",end:"end",exponent:"exponent",externalResourcesRequired:"externalResourcesRequired",fill:"fill",filterRes:"filterRes",filterUnits:"filterUnits",fontFamily:"font-family",fontSize:"font-size",fontStretch:"font-stretch",fontStyle:"font-style",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphame:"glyph-name",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:"hanging",height:"height",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",id:"id",ideographic:"ideographic",in:"in",in2:"in2",intercept:"intercept",k:"k",k1:"k1",k2:"k2",k3:"k3",k4:"k4",kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lang:"lang",lengthAdjust:"lengthAdjust",limitingConeAngle:"limitingConeAngle",local:"local",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:"mathematical",max:"max",media:"media",method:"method",min:"min",mode:"mode",name:"name",numOctaves:"numOctaves",offset:"offset",onAbort:"onabort",onActivate:"onactivate",onBegin:"onbegin",onClick:"onclick",onEnd:"onend",onError:"onerror",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onLoad:"onload",onMouseDown:"onmousedown",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onRepeat:"onrepeat",onResize:"onresize",onScroll:"onscroll",onUnload:"onunload",onZoom:"onzoom",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overlinePosition:"overline-position",overlineThickness:"overline-thickness",panose1:"panose-1",path:"path",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",points:"points",pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:"r",radius:"radius",refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:"restart",result:"result",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",seed:"seed",slope:"slope",spacing:"spacing",specularConstant:"specularConstant",specularExponent:"specularExponent",spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchTiles:"stitchTiles",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:"string",style:"style",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",target:"target",targetX:"targetX",targetY:"targetY",textLength:"textLength",title:"title",to:"to",transform:"transform",type:"type",u1:"u1",u2:"u2",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:"unicode",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:"values",version:"version",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",width:"width",widths:"widths",x:"x",xHeight:"x-height",x1:"x1",x2:"x2",xChannelSelector:"xChannelSelector",xlink:"xlink",xml:"xml",y:"y",y1:"y1",y2:"y2",yChannelSelector:"yChannelSelector",z:"z",zoomAndPan:"zoomAndPan",alignmentBaseline:"alignment-baseline",baselineShift:"baseline-shift",clipPath:"clip-path",clipRule:"clip-rule",clip:"clip",colorInterpolationFilters:"color-interpolation-filters",colorInterpolation:"color-interpolation",colorProfile:"color-profile",colorRendering:"color-rendering",color:"color",cursor:"cursor",direction:"direction",display:"display",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:"filter",floodColor:"flood-color",floodOpacity:"flood-opacity",fontSizeAdjust:"font-size-adjust",fontVariant:"font-variant",fontWeight:"font-weight",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",imageRendering:"image-rendering",kerning:"kerning",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",mask:"mask",opacity:"opacity",overflow:"overflow",pointerEvents:"pointer-events",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",stroke:"stroke",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",unicodeBidi:"unicode-bidi",visibility:"visibility",wordSpacing:"word-spacing",writingMode:"writing-mode"}}])},function(t,e,n){"use strict";e.__esModule=!0;var i=n(283),o=function(){};e.propsToOptions=function(t){for(var e={},n=0,r=["height","layout","layoutColumnsOnNewData","columnMinWidth","columnVertAlign","resizableColumns","resizableRows","autoResize","tooltips","tooltipsHeader","tooltipGenerationMode","initialSort","initialFilter","footerElement","index","keybindings","clipboard","clipboardCopyStyled","clipboardCopySelector","clipboardCopyFormatter","clipboardCopyHeader","clipboardPasteParser","clipboardPasteAction","rowFormatter","placeholder"];n<r.length;n++){var a=r[n];void 0!==t[a]&&(e[a]=t[a])}for(var s=0,l=["tableBuilt","rowClick","rowDblClick","rowContext","rowTap","rowDblTap","rowTapHold","rowAdded","rowDeleted","rowMoved","rowUpdated","rowSelectionChanged","rowSelected","rowDeselected","rowResized","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellEditing","cellEdited","cellEditCancelled","columnMoved","columnResized","columnTitleChanged","columnVisibilityChanged","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","htmlImporting","htmlImported","dataLoading","dataLoaded","dataEdited","ajaxRequesting","ajaxResponse","ajaxError","dataFiltering","dataFiltered","dataSorting","dataSorted","renderStarted","renderComplete","pageLoaded","localized","dataGrouping","dataGrouped","groupVisibilityChanged","groupClick","groupDblClick","groupContext","groupTap","groupDblTap","groupTapHold","movableRowsSendingStart","movableRowsSent","movableRowsSentFailed","movableRowsSendingStop","movableRowsReceivingStart","movableRowsReceived","movableRowsReceivedFailed","movableRowsReceivingStop","validationFailed","clipboardCopied","clipboardPasted","clipboardPasteError","downloadDataFormatter","downloadReady","downloadComplete"];s<l.length;s++){var u=l[s];e[u]=t[u]||o}return"object"==typeof t.footerElement&&(e.footerElement=i.renderToString(t.footerElement)),e}},function(t,n,i){var o,r,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(e,s){"object"===a(n)&&void 0!==t?t.exports=s():void 0===(r="function"==typeof(o=s)?o.call(n,i,n,t):o)||(t.exports=r)}(0,function(){"use strict";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],o=0;o<n;){var r=e[o];if(t.call(i,r,o,e))return o;o++}return-1}}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],o=0;o<n;){var r=e[o];if(t.call(i,r,o,e))return r;o++}}});var t=function(t){this.table=t,this.blockHozScrollEvent=!1,this.headersElement=this.createHeadersElement(),this.element=this.createHeaderElement(),this.rowManager=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.element.insertBefore(this.headersElement,this.element.firstChild)};t.prototype.createHeadersElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-headers"),t},t.prototype.createHeaderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-header"),t},t.prototype.initialize=function(){var t=this;t.element.addEventListener("scroll",function(e){t.blockHozScrollEvent||t.table.rowManager.scrollHorizontal(t.element.scrollLeft)})},t.prototype.setRowManager=function(t){this.rowManager=t},t.prototype.getElement=function(){return this.element},t.prototype.getHeadersElement=function(){return this.headersElement},t.prototype.scrollHorizontal=function(t){var e=this,n=0,i=this.element.scrollWidth-this.table.element.clientWidth;clearTimeout(this.blockHozScrollEvent),this.blockHozScrollEvent=setTimeout(function(){e.blockHozScrollEvent=!1},10),this.element.scrollLeft=t,t>i?(n=t-i,this.element.style.marginLeft=-n+"px"):this.element.style.marginLeft=0,this.scrollLeft=t,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()},t.prototype.generateColumnsFromRowData=function(t){var e,n,i=[];if(t&&t.length){for(var o in e=t[0]){var r={field:o,title:o},s=e[o];switch(void 0===s?"undefined":a(s)){case"undefined":n="string";break;case"boolean":n="boolean";break;case"object":n=Array.isArray(s)?"array":"string";break;default:n=isNaN(s)||""===s?s.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}r.sorter=n,i.push(r)}this.table.options.columns=i,this.setColumns(this.table.options.columns)}},t.prototype.setColumns=function(t,e){for(var n=this;n.headersElement.firstChild;)n.headersElement.removeChild(n.headersElement.firstChild);n.columns=[],n.columnsByIndex=[],n.columnsByField={},n.table.modExists("frozenColumns")&&n.table.modules.frozenColumns.reset(),t.forEach(function(t,e){n._addColumn(t)}),n._reIndexColumns(),n.table.options.responsiveLayout&&n.table.modExists("responsiveLayout",!0)&&n.table.modules.responsiveLayout.initialize(),n.redraw(!0)},t.prototype._addColumn=function(t,e,n){var o=new i(t,this),r=o.getElement(),a=n?this.findColumnIndex(n):n;if(n&&a>-1){var s=this.columns.indexOf(n.getTopColumn()),l=n.getElement();e?(this.columns.splice(s,0,o),l.parentNode.insertBefore(r,l)):(this.columns.splice(s+1,0,o),l.parentNode.insertBefore(r,l.nextSibling))}else e?(this.columns.unshift(o),this.headersElement.insertBefore(o.getElement(),this.headersElement.firstChild)):(this.columns.push(o),this.headersElement.appendChild(o.getElement()));return o},t.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},t.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},t.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})},t.prototype._verticalAlignHeaders=function(){var t=this,e=0;t.columns.forEach(function(t){var n;t.clearVerticalAlign(),(n=t.getHeight())>e&&(e=n)}),t.columns.forEach(function(n){n.verticalAlign(t.table.options.columnVertAlign,e)}),t.rowManager.adjustTableSize()},t.prototype.findColumn=function(t){return"object"!=(void 0===t?"undefined":a(t))?this.columnsByField[t]||!1:t instanceof i?t:t instanceof n?t._getSelf()||!1:t instanceof HTMLElement&&this.columns.find(function(e){return e.element===t})||!1},t.prototype.getColumnByField=function(t){return this.columnsByField[t]},t.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]},t.prototype.getFirstVisibileColumn=function(t){return(t=this.columnsByIndex.findIndex(function(t){return t.visible}))>-1&&this.columnsByIndex[t]},t.prototype.getColumns=function(){return this.columns},t.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(e){return t===e})},t.prototype.getRealColumns=function(){return this.columnsByIndex},t.prototype.traverse=function(t){this.columnsByIndex.forEach(function(e,n){t(e,n)})},t.prototype.getDefinitions=function(t){var e=[];return this.columnsByIndex.forEach(function(n){(!t||t&&n.visible)&&e.push(n.getDefinition())}),e},t.prototype.getDefinitionTree=function(){var t=[];return this.columns.forEach(function(e){t.push(e.getDefinition(!0))}),t},t.prototype.getComponents=function(t){var e=[];return(t?this.columns:this.columnsByIndex).forEach(function(t){e.push(t.getComponent())}),e},t.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach(function(e){e.visible&&(t+=e.getWidth())}),t},t.prototype.moveColumn=function(t,e,n){this._moveColumnInArray(this.columns,t,e,n),this._moveColumnInArray(this.columnsByIndex,t,e,n,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,t.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistentLayout&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("columns")},t.prototype._moveColumnInArray=function(t,e,n,i,o){var r,a=t.indexOf(e);a>-1&&(t.splice(a,1),(r=t.indexOf(n))>-1?i&&(r+=1):r=a,t.splice(r,0,e),o&&this.table.rowManager.rows.forEach(function(t){if(t.cells.length){var e=t.cells.splice(a,1)[0];t.cells.splice(r,0,e)}}))},t.prototype.scrollToColumn=function(t,e,n){var i=this,o=0,r=0,a=0,s=t.getElement();return new Promise(function(l,u){if(void 0===e&&(e=i.table.options.scrollToColumnPosition),void 0===n&&(n=i.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":a=-i.element.clientWidth/2;break;case"right":a=s.clientWidth-i.headersElement.clientWidth}if(!n&&(r=s.offsetLeft)>0&&r+s.offsetWidth<i.element.clientWidth)return!1;o=s.offsetLeft+i.element.scrollLeft+a,o=Math.max(Math.min(o,i.table.rowManager.element.scrollWidth-i.table.rowManager.element.clientWidth),0),i.table.rowManager.scrollHorizontal(o),i.scrollHorizontal(o),l()}else console.warn("Scroll Error - Column not visible"),u("Scroll Error - Column not visible")})},t.prototype.generateCells=function(t){var e=[];return this.columnsByIndex.forEach(function(n){e.push(n.generateCell(t))}),e},t.prototype.getFlexBaseWidth=function(){var t=this,e=t.table.element.clientWidth,n=0;return t.rowManager.element.scrollHeight>t.rowManager.element.clientHeight&&(e-=t.rowManager.element.offsetWidth-t.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var o,r,a;i.visible&&(o=i.definition.width||0,r=void 0===i.minWidth?t.table.options.columnMinWidth:parseInt(i.minWidth),a="string"==typeof o?o.indexOf("%")>-1?e/100*parseInt(o):parseInt(o):o,n+=a>r?a:r)}),n},t.prototype.addColumn=function(t,e,n){var i=this._addColumn(t,e,n);this._reIndexColumns(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),this.redraw(),"fitColumns"!=this.table.modules.layout.getMode()&&i.reinitializeWidth(),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},t.prototype.deregisterColumn=function(t){var e,n=t.getField();n&&delete this.columnsByField[n],(e=this.columnsByIndex.indexOf(t))>-1&&this.columnsByIndex.splice(e,1),(e=this.columns.indexOf(t))>-1&&this.columns.splice(e,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.redraw()},t.prototype.redraw=function(t){t&&(h.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),"fitColumns"==this.table.modules.layout.getMode()?this.table.modules.layout.layout():t?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t&&(this.table.options.persistentLayout&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};var n=function(t){this._column=t,this.type="ColumnComponent"};n.prototype.getElement=function(){return this._column.getElement()},n.prototype.getDefinition=function(){return this._column.getDefinition()},n.prototype.getField=function(){return this._column.getField()},n.prototype.getCells=function(){var t=[];return this._column.cells.forEach(function(e){t.push(e.getComponent())}),t},n.prototype.getVisibility=function(){return this._column.visible},n.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()},n.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()},n.prototype.toggle=function(){this._column.visible?this.hide():this.show()},n.prototype.delete=function(){this._column.delete()},n.prototype.getSubColumns=function(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(e){t.push(e.getComponent())}),t},n.prototype.getParentColumn=function(){return this._column.parent instanceof i&&this._column.parent.getComponent()},n.prototype._getSelf=function(){return this._column},n.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},n.prototype.getTable=function(){return this._column.table},n.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},n.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},n.prototype.setHeaderFilterValue=function(t){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,t)},n.prototype.getNextColumn=function(){return this._column.nextColumn().getComponent()},n.prototype.getPrevColumn=function(){return this._column.prevColumn().getComponent()};var i=function t(e,n){var i=this;this.table=n.table,this.definition=e,this.parent=n,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.setField(this.definition.field),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,e.columns?(this.isGroup=!0,e.columns.forEach(function(e,n){var o=new t(e,i);i.attachColumn(o)}),i.checkColumnVisibility()):n.registerColumnField(this),e.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader()};i.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),t},i.prototype.createGroupElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t},i.prototype.setField=function(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNesteData:this._setFlatData},i.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)},i.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)},i.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)},i.prototype.setTooltip=function(){var t=this,e=t.definition,n=e.headerTooltip||!1===e.tooltip?e.headerTooltip:t.table.options.tooltipsHeader;n?!0===n?e.field?t.table.modules.localize.bind("columns|"+e.field,function(n){t.element.setAttribute("title",n||e.title)}):t.element.setAttribute("title",e.title):("function"==typeof n&&!1===(n=n(t.getComponent()))&&(n=""),t.element.setAttribute("title",n)):t.element.setAttribute("title","")},i.prototype._buildHeader=function(){for(var t=this,e=t.definition;t.element.firstChild;)t.element.removeChild(t.element.firstChild);e.headerVertical&&(t.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&t.element.classList.add("tabulator-col-vertical-flip")),t.contentElement=t._bindEvents(),t.contentElement=t._buildColumnHeaderContent(),t.element.appendChild(t.contentElement),t.isGroup?t._buildGroupHeader():t._buildColumnHeader(),t.setTooltip(),t.table.options.resizableColumns&&t.table.modExists("resizeColumns")&&t.table.modules.resizeColumns.initializeColumn("header",t,t.element),e.headerFilter&&t.table.modExists("filter")&&t.table.modExists("edit")&&(void 0!==e.headerFilterPlaceholder&&e.field&&t.table.modules.localize.setHeaderFilterColumnPlaceholder(e.field,e.headerFilterPlaceholder),t.table.modules.filter.initializeColumn(t)),t.table.modExists("frozenColumns")&&t.table.modules.frozenColumns.initializeColumn(t),t.table.options.movableColumns&&!t.isGroup&&t.table.modExists("moveColumn")&&t.table.modules.moveColumn.initializeColumn(t),(e.topCalc||e.bottomCalc)&&t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.initializeColumn(t),t.element.addEventListener("mouseenter",function(e){t.setTooltip()})},i.prototype._bindEvents=function(){var t,e,n,i=this,o=i.definition;"function"==typeof o.headerClick&&i.element.addEventListener("click",function(t){o.headerClick(t,i.getComponent())}),"function"==typeof o.headerDblClick&&i.element.addEventListener("dblclick",function(t){o.headerDblClick(t,i.getComponent())}),"function"==typeof o.headerContext&&i.element.addEventListener("contextmenu",function(t){o.headerContext(t,i.getComponent())}),"function"==typeof o.headerTap&&(n=!1,i.element.addEventListener("touchstart",function(t){n=!0}),i.element.addEventListener("touchend",function(t){n&&o.headerTap(t,i.getComponent()),n=!1})),"function"==typeof o.headerDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,o.headerDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),"function"==typeof o.headerTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,n=!1,o.headerTapHold(t,i.getComponent())},1e3)}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null})),"function"==typeof o.cellClick&&(i.cellEvents.cellClick=o.cellClick),"function"==typeof o.cellDblClick&&(i.cellEvents.cellDblClick=o.cellDblClick),"function"==typeof o.cellContext&&(i.cellEvents.cellContext=o.cellContext),"function"==typeof o.cellMouseEnter&&(i.cellEvents.cellMouseEnter=o.cellMouseEnter),"function"==typeof o.cellMouseLeave&&(i.cellEvents.cellMouseLeave=o.cellMouseLeave),"function"==typeof o.cellMouseOver&&(i.cellEvents.cellMouseOver=o.cellMouseOver),"function"==typeof o.cellMouseOut&&(i.cellEvents.cellMouseOut=o.cellMouseOut),"function"==typeof o.cellMouseMove&&(i.cellEvents.cellMouseMove=o.cellMouseMove),"function"==typeof o.cellTap&&(i.cellEvents.cellTap=o.cellTap),"function"==typeof o.cellDblTap&&(i.cellEvents.cellDblTap=o.cellDblTap),"function"==typeof o.cellTapHold&&(i.cellEvents.cellTapHold=o.cellTapHold),"function"==typeof o.cellEdited&&(i.cellEvents.cellEdited=o.cellEdited),"function"==typeof o.cellEditing&&(i.cellEvents.cellEditing=o.cellEditing),"function"==typeof o.cellEditCancelled&&(i.cellEvents.cellEditCancelled=o.cellEditCancelled)},i.prototype._buildColumnHeader=function(){var t=this,e=t.definition,n=t.table;(n.modExists("sort")&&n.modules.sort.initializeColumn(t,t.contentElement),n.modExists("format")&&n.modules.format.initializeColumn(t),void 0!==e.editor&&n.modExists("edit")&&n.modules.edit.initializeColumn(t),void 0!==e.validator&&n.modExists("validate")&&n.modules.validate.initializeColumn(t),n.modExists("mutator")&&n.modules.mutator.initializeColumn(t),n.modExists("accessor")&&n.modules.accessor.initializeColumn(t),a(n.options.responsiveLayout)&&n.modExists("responsiveLayout")&&n.modules.responsiveLayout.initializeColumn(t),void 0!==e.visible&&(e.visible?t.show(!0):t.hide(!0)),e.cssClass)&&e.cssClass.split(" ").forEach(function(e){t.element.classList.add(e)});e.field&&this.element.setAttribute("tabulator-field",e.field),t.setMinWidth(void 0===e.minWidth?t.table.options.columnMinWidth:parseInt(e.minWidth)),t.reinitializeWidth(),t.tooltip=t.definition.tooltip||!1===t.definition.tooltip?t.definition.tooltip:t.table.options.tooltips,t.hozAlign=void 0===t.definition.align?"":t.definition.align},i.prototype._buildColumnHeaderContent=function(){this.definition,this.table;var t=document.createElement("div");return t.classList.add("tabulator-col-content"),t.appendChild(this._buildColumnHeaderTitle()),t},i.prototype._buildColumnHeaderTitle=function(){var t=this,e=t.definition,n=t.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),e.editableTitle){var o=document.createElement("input");o.classList.add("tabulator-title-editor"),o.addEventListener("click",function(t){t.stopPropagation(),o.focus()}),o.addEventListener("change",function(){e.title=o.value,n.options.columnTitleChanged.call(t.table,t.getComponent())}),i.appendChild(o),e.field?n.modules.localize.bind("columns|"+e.field,function(t){o.value=t||e.title||"&nbsp"}):o.value=e.title||"&nbsp"}else e.field?n.modules.localize.bind("columns|"+e.field,function(n){t._formatColumnHeaderTitle(i,n||e.title||"&nbsp")}):t._formatColumnHeaderTitle(i,e.title||"&nbsp");return i},i.prototype._formatColumnHeaderTitle=function(t,e){var n,i,o,r;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(n=this.table.modules.format.getFormatter(this.definition.titleFormatter),r={getValue:function(){return e},getElement:function(){return t}},o="function"==typeof(o=this.definition.titleFormatterParams||{})?o():o,void 0===(i=n.call(this.table.modules.format,r,o))?"undefined":a(i)){case"object":i instanceof Node?this.element.appendChild(i):(this.element.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":case"null":this.element.innerHTML="";break;default:this.element.innerHTML=i}else t.innerHTML=e},i.prototype._buildGroupHeader=function(){this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.element.appendChild(this.groupElement)},i.prototype._getFlatData=function(t){return t[this.field]},i.prototype._getNestedData=function(t){for(var e,n=t,i=this.fieldStructure,o=i.length,r=0;r<o&&(e=n=n[i[r]],n);r++);return e},i.prototype._setFlatData=function(t,e){this.field&&(t[this.field]=e)},i.prototype._setNesteData=function(t,e){for(var n=t,i=this.fieldStructure,o=i.length,r=0;r<o;r++)r==o-1?n[i[r]]=e:(n[i[r]]||(n[i[r]]={}),n=n[i[r]])},i.prototype.attachColumn=function(t){this.groupElement?(this.columns.push(t),this.groupElement.appendChild(t.getElement())):console.warn("Column Warning - Column being attached to another column instead of column group")},i.prototype.verticalAlign=function(t,e){var n=this.parent.isGroup?this.parent.getGroupElement().clientHeight:e||this.parent.getHeadersElement().clientHeight;this.element.style.height=n+"px",this.isGroup&&(this.groupElement.style.minHeight=n-this.contentElement.offsetHeight+"px"),this.isGroup||"top"===t||(this.element.style.paddingTop="bottom"===t?this.element.clientHeight-this.contentElement.offsetHeight+"px":(this.element.clientHeight-this.contentElement.offsetHeight)/2+"px"),this.columns.forEach(function(e){e.verticalAlign(t)})},i.prototype.clearVerticalAlign=function(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach(function(t){t.clearVerticalAlign()})},i.prototype.getElement=function(){return this.element},i.prototype.getGroupElement=function(){return this.groupElement},i.prototype.getField=function(){return this.field},i.prototype.getFirstColumn=function(){return this.isGroup?!!this.columns.length&&this.columns[0].getFirstColumn():this},i.prototype.getLastColumn=function(){return this.isGroup?!!this.columns.length&&this.columns[this.columns.length-1].getLastColumn():this},i.prototype.getColumns=function(){return this.columns},i.prototype.getCells=function(){return this.cells},i.prototype.getTopColumn=function(){return this.parent.isGroup?this.parent.getTopColumn():this},i.prototype.getDefinition=function(t){var e=[];return this.isGroup&&t&&(this.columns.forEach(function(t){e.push(t.getDefinition(!0))}),this.definition.columns=e),this.definition},i.prototype.checkColumnVisibility=function(){var t=!1;this.columns.forEach(function(e){e.visible&&(t=!0)}),t?(this.show(),this.parent.table.options.columnVisibilityChanged.call(this.table,this.getComponent(),!1)):this.hide()},i.prototype.show=function(t,e){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(t){t.show()}),this.isGroup||null!==this.width||this.reinitializeWidth(),this.table.columnManager._verticalAlignHeaders(),this.table.options.persistentLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.persistence.save("columns"),!e&&this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.updateColumnVisibility(this,this.visible),t||this.table.options.columnVisibilityChanged.call(this.table,this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths())},i.prototype.hide=function(t,e){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager._verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(t){t.hide()}),this.table.options.persistentLayout&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("columns"),!e&&this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.updateColumnVisibility(this,this.visible),t||this.table.options.columnVisibilityChanged.call(this.table,this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths())},i.prototype.matchChildWidths=function(){var t=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(e){e.visible&&(t+=e.getWidth())}),this.contentElement.style.maxWidth=t-1+"px")},i.prototype.setWidth=function(t){this.widthFixed=!0,this.setWidthActual(t)},i.prototype.setWidthActual=function(t){isNaN(t)&&(t=Math.floor(this.table.element.clientWidth/100*parseInt(t))),t=Math.max(this.minWidth,t),this.width=t,this.widthStyled=t?t+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()},i.prototype.checkCellHeights=function(){var t=[];this.cells.forEach(function(e){e.row.heightInitialized&&(null!==e.row.getElement().offsetParent?(t.push(e.row),e.row.clearCellHeight()):e.row.heightInitialized=!1)}),t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()})},i.prototype.getWidth=function(){return this.width},i.prototype.getHeight=function(){return this.element.offsetHeight},i.prototype.setMinWidth=function(t){this.minWidth=t,this.minWidthStyled=t?t+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})},i.prototype.delete=function(){this.isGroup&&this.columns.forEach(function(t){t.delete()});for(var t=this.cells.length,e=0;e<t;e++)this.cells[0].delete();this.element.parentNode.removeChild(this.element),this.table.columnManager.deregisterColumn(this)},i.prototype.generateCell=function(t){var e=new u(this,t);return this.cells.push(e),e},i.prototype.nextColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this.table.columnManager.getColumnByIndex(t+1)},i.prototype.prevColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this.table.columnManager.getColumnByIndex(t-1)},i.prototype.reinitializeWidth=function(t){this.widthFixed=!1,void 0===this.definition.width||t||this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()},i.prototype.fitToData=function(){this.widthFixed||(this.element.style.width="",this.cells.forEach(function(t){t.clearWidth()}));var t=this.element.offsetWidth;this.width&&this.widthFixed||(this.cells.forEach(function(e){var n=e.getWidth();n>t&&(t=n)}),t&&this.setWidthActual(t+1))},i.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},i.prototype.defaultOptionList=["title","field","visible","align","width","minWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter"],i.prototype.getComponent=function(){return new n(this)};var o=function(t){this.table=t,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="classic",this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]};o.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t},o.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t},o.prototype.getElement=function(){return this.element},o.prototype.getTableElement=function(){return this.tableElement},o.prototype.getRowPosition=function(t,e){return e?this.activeRows.indexOf(t):this.rows.indexOf(t)},o.prototype.setColumnManager=function(t){this.columnManager=t},o.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.appendChild(t.tableElement),t.firstRender=!0,t.element.addEventListener("scroll",function(){var e=t.element.scrollLeft;t.scrollLeft!=e&&(t.columnManager.scrollHorizontal(e),t.table.options.groupBy&&t.table.modules.groupRows.scrollHeaders(e),t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.scrollHorizontal(e)),t.scrollLeft=e}),"virtual"===this.renderMode&&t.element.addEventListener("scroll",function(){var e=t.element.scrollTop,n=t.scrollTop>e;t.scrollTop!=e?(t.scrollTop=e,t.scrollVertical(n),"scroll"==t.table.options.ajaxProgressiveLoad&&t.table.modules.ajax.nextPage(t.element.scrollHeight-t.element.clientHeight-e)):t.scrollTop=e})},o.prototype.findRow=function(t){var e=this;if("object"==(void 0===t?"undefined":a(t))){if(t instanceof s)return t;if(t instanceof r)return t._getSelf()||!1;if(t instanceof HTMLElement)return e.rows.find(function(e){return e.element===t})||!1}else{return void 0!==t&&null!==t&&(e.rows.find(function(n){return n.data[e.table.options.index]==t})||!1)}return!1},o.prototype.getRowFromDataObject=function(t){return this.rows.find(function(e){return e.data===t})||!1},o.prototype.getRowFromPosition=function(t,e){return e?this.activeRows[t]:this.rows[t]},o.prototype.scrollToRow=function(t,e,n){var i,o=this,r=this.getDisplayRows().indexOf(t),a=t.getElement(),s=0;return new Promise(function(t,l){if(r>-1){if(void 0===e&&(e=o.table.options.scrollToRowPosition),void 0===n&&(n=o.table.options.scrollToRowIfVisible),"nearest"===e)switch(o.renderMode){case"classic":i=h.prototype.helpers.elOffset(a).top,e=Math.abs(o.element.scrollTop-i)>Math.abs(o.element.scrollTop+o.element.clientHeight-i)?"bottom":"top";break;case"virtual":e=Math.abs(o.vDomTop-r)>Math.abs(o.vDomBottom-r)?"bottom":"top"}if(!n&&h.prototype.helpers.elVisible(a)&&(s=h.prototype.helpers.elOffset(a).top-h.prototype.helpers.elOffset(o.element).top)>0&&s<o.element.clientHeight-a.offsetHeight)return!1;switch(o.renderMode){case"classic":o.element.scrollTop=h.prototype.helpers.elOffset(a).top-h.prototype.helpers.elOffset(o.element).top+o.element.scrollTop;break;case"virtual":o._virtualRenderFill(r,!0)}switch(e){case"middle":case"center":o.element.scrollTop=o.element.scrollTop-o.element.clientHeight/2;break;case"bottom":o.element.scrollTop=o.element.scrollTop-o.element.clientHeight+a.offsetHeight}t()}else console.warn("Scroll Error - Row not visible"),l("Scroll Error - Row not visible")})},o.prototype.setData=function(t,e){var n=this,i=this;return new Promise(function(o,r){e&&n.getDisplayRows().length?i.table.options.pagination?i._setDataActual(t,!0):n.reRenderInPosition(function(){i._setDataActual(t)}):(n.table.options.autoColumns&&n.table.columnManager.generateColumnsFromRowData(t),n.resetScroll(),n._setDataActual(t)),o()})},o.prototype._setDataActual=function(t,e){var n=this;n.table.options.dataLoading.call(this.table,t),n.rows.forEach(function(t){t.wipe()}),n.rows=[],this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.clear(),Array.isArray(t)?(this.table.modExists("selectRow")&&this.table.modules.selectRow.clearSelectionData(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchData(t),t.forEach(function(t,e){if(t&&"object"===(void 0===t?"undefined":a(t))){var i=new s(t,n);n.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",t)}),n.table.options.dataLoaded.call(this.table,t),n.refreshActiveData(!1,!1,e)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",void 0===t?"undefined":a(t),"\nData: ",t)},o.prototype.deleteRow=function(t,e){var n=this.rows.indexOf(t),i=this.activeRows.indexOf(t);i>-1&&this.activeRows.splice(i,1),n>-1&&this.rows.splice(n,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(e){var n=e.indexOf(t);n>-1&&e.splice(n,1)}),e||this.reRenderInPosition(),this.table.options.rowDeleted.call(this.table,t.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")},o.prototype.addRow=function(t,e,n,i){var o=this.addRowActual(t,e,n,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",o,{data:t,pos:e,index:n}),o},o.prototype.addRows=function(t,e,n){var i=this,o=this,r=[];return new Promise(function(a,s){e=i.findAddRowPos(e),Array.isArray(t)||(t=[t]),t.length-1,(void 0===n&&e||void 0!==n&&!e)&&t.reverse(),t.forEach(function(t,i){var a=o.addRow(t,e,n,!0);r.push(a)}),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),a(r)})},o.prototype.findAddRowPos=function(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t},o.prototype.addRowActual=function(t,e,n,i){var o,r=t instanceof s?t:new s(t||{},this),a=this.findAddRowPos(e);if(!n&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(o=this.getDisplayRows(),a?o.length?n=o[0]:this.activeRows.length&&(n=this.activeRows[this.activeRows.length-1],a=!1):o.length&&(n=o[o.length-1],a=!(o.length<this.table.modules.page.getPageSize()))),n&&(n=this.findRow(n)),this.table.options.groupBy&&this.table.modExists("groupRows")){this.table.modules.groupRows.assignRowToGroup(r);var l=r.getGroup().rows;l.length>1&&(!n||n&&-1==l.indexOf(n)?a?l[0]!==r&&(n=l[0],this._moveRowInArray(r.getGroup().rows,r,n,a)):l[l.length-1]!==r&&(n=l[l.length-1],this._moveRowInArray(r.getGroup().rows,r,n,a)):this._moveRowInArray(r.getGroup().rows,r,n,a))}if(n){var u=this.rows.indexOf(n),c=this.activeRows.indexOf(n);this.displayRowIterator(function(t){var e=t.indexOf(n);e>-1&&t.splice(a?e:e+1,0,r)}),c>-1&&this.activeRows.splice(a?c:c+1,0,r),u>-1&&this.rows.splice(a?u:u+1,0,r)}else a?(this.displayRowIterator(function(t){t.unshift(r)}),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator(function(t){t.push(r)}),this.activeRows.push(r),this.rows.push(r));return this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,r.getComponent()),this.table.options.dataEdited.call(this.table,this.getData()),i||this.reRenderInPosition(),r},o.prototype.moveRow=function(t,e,n){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",t,{pos:this.getRowPosition(t),to:e,after:n}),this.moveRowActual(t,e,n),this.table.options.rowMoved.call(this.table,t.getComponent())},o.prototype.moveRowActual=function(t,e,n){var i=this;if(this._moveRowInArray(this.rows,t,e,n),this._moveRowInArray(this.activeRows,t,e,n),this.displayRowIterator(function(o){i._moveRowInArray(o,t,e,n)}),this.table.options.groupBy&&this.table.modExists("groupRows")){var o=e.getGroup(),r=t.getGroup();o===r?this._moveRowInArray(o.rows,t,e,n):(r&&r.removeRow(t),o.insertRow(t,e,n))}},o.prototype._moveRowInArray=function(t,e,n,i){var o,r,a;if(e!==n&&((o=t.indexOf(e))>-1&&(t.splice(o,1),(r=t.indexOf(n))>-1?i?t.splice(r+1,0,e):t.splice(r,0,e):t.splice(o,0,e)),t===this.getDisplayRows())){a=r>o?r:o+1;for(var s=o<r?o:r;s<=a;s++)t[s]&&this.styleRow(t[s],s)}},o.prototype.clearData=function(){this.setData([])},o.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)},o.prototype.getDisplayRowIndex=function(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e},o.prototype.nextDisplayRow=function(t,e){var n=this.getDisplayRowIndex(t),i=!1;return!1!==n&&n<this.displayRowsCount-1&&(i=this.getDisplayRows()[n+1]),!i||i instanceof s&&"row"==i.type?i:this.nextDisplayRow(i,e)},o.prototype.prevDisplayRow=function(t,e){var n=this.getDisplayRowIndex(t),i=!1;return n&&(i=this.getDisplayRows()[n-1]),!i||i instanceof s&&"row"==i.type?i:this.prevDisplayRow(i,e)},o.prototype.findRowIndex=function(t,e){var n;return!!((t=this.findRow(t))&&(n=e.indexOf(t))>-1)&&n},o.prototype.getData=function(t,e){var n=[];return(t?this.activeRows:this.rows).forEach(function(t){n.push(t.getData(e||"data"))}),n},o.prototype.getHtml=function(t){var e=this.getData(t),n=[],i="",o="";return this.table.columnManager.getColumns().forEach(function(t){var e=t.getDefinition();t.visible&&!e.hideInHtml&&(i+="<th>"+(e.title||"")+"</th>",n.push(t))}),e.forEach(function(t){var e="";n.forEach(function(n){var i=n.getFieldValue(t);void 0!==i&&null!==i||(i=":"),e+="<td>"+i+"</td>"}),o+="<tr>"+e+"</tr>"}),"<table>\n\n\t\t\t<thead>\n\n\t\t\t<tr>"+i+"</tr>\n\n\t\t\t</thead>\n\n\t\t\t<tbody>"+o+"</tbody>\n\n\t\t\t</table>"},o.prototype.getComponents=function(t){var e=[];return(t?this.activeRows:this.rows).forEach(function(t){e.push(t.getComponent())}),e},o.prototype.getDataCount=function(t){return t?this.rows.length:this.activeRows.length},o.prototype._genRemoteRequest=function(){var t=this,e=t.table,n=e.options,i={};if(e.modExists("page")){if(n.ajaxSorting){var o=t.table.modules.sort.getSort();o.forEach(function(t){delete t.column}),i[t.table.modules.page.paginationDataSentNames.sorters]=o}if(n.ajaxFiltering){var r=t.table.modules.filter.getFilters(!0,!0);i[t.table.modules.page.paginationDataSentNames.filters]=r}t.table.modules.ajax.setParams(i,!0)}e.modules.ajax.sendRequest().then(function(e){t.setData(e)}).catch(function(t){})},o.prototype.filterRefresh=function(){var t=this.table,e=t.options,n=this.scrollLeft;e.ajaxFiltering?"remote"==e.pagination&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):e.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(n)},o.prototype.sorterRefresh=function(t){var e=this.table,n=this.table.options,i=this.scrollLeft;n.ajaxSorting?("remote"==n.pagination||n.progressiveLoad)&&e.modExists("page")?(e.modules.page.reset(!0),e.modules.page.setPage(1).then(function(){}).catch(function(){})):n.ajaxProgressiveLoad?e.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(t?"filter":"sort"),this.scrollHorizontal(i)},o.prototype.scrollHorizontal=function(t){this.scrollLeft=t,this.element.scrollLeft=t,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(t),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(t)},o.prototype.refreshActiveData=function(t,e,n){var i,o=this.table;switch(this.table.modExists("edit")&&this.table.modules.edit.cancelEdit(),t||(t="all"),o.options.selectable&&!o.options.selectablePersistence&&o.modExists("selectRow")&&o.modules.selectRow.deselectRows(),t){case"all":case"filter":e?e=!1:o.modExists("filter")?this.setActiveRows(o.modules.filter.filter(this.rows)):this.setActiveRows(this.rows.slice(0));case"sort":e?e=!1:o.modExists("sort")&&o.modules.sort.sort(this.activeRows);case"display":this.resetDisplayRows();case"freeze":e?e=!1:this.table.modExists("frozenRows")&&o.modules.frozenRows.isFrozen()&&(o.modules.frozenRows.getDisplayIndex()||o.modules.frozenRows.setDisplayIndex(this.getNextDisplayIndex()),i=o.modules.frozenRows.getDisplayIndex(),!0!==(i=this.setDisplayRows(o.modules.frozenRows.getRows(this.getDisplayRows(i-1)),i))&&o.modules.frozenRows.setDisplayIndex(i));case"group":e?e=!1:o.options.groupBy&&o.modExists("groupRows")&&(o.modules.groupRows.getDisplayIndex()||o.modules.groupRows.setDisplayIndex(this.getNextDisplayIndex()),i=o.modules.groupRows.getDisplayIndex(),!0!==(i=this.setDisplayRows(o.modules.groupRows.getRows(this.getDisplayRows(i-1)),i))&&o.modules.groupRows.setDisplayIndex(i));case"tree":e?e=!1:o.options.dataTree&&o.modExists("dataTree")&&(o.modules.dataTree.getDisplayIndex()||o.modules.dataTree.setDisplayIndex(this.getNextDisplayIndex()),i=o.modules.dataTree.getDisplayIndex(),!0!==(i=this.setDisplayRows(o.modules.dataTree.getRows(this.getDisplayRows(i-1)),i))&&o.modules.dataTree.setDisplayIndex(i)),o.options.pagination&&o.modExists("page")&&!n&&"local"==o.modules.page.getMode()&&o.modules.page.reset();case"page":e?e=!1:o.options.pagination&&o.modExists("page")&&(o.modules.page.getDisplayIndex()||o.modules.page.setDisplayIndex(this.getNextDisplayIndex()),i=o.modules.page.getDisplayIndex(),"local"==o.modules.page.getMode()&&o.modules.page.setMaxRows(this.getDisplayRows(i-1).length),!0!==(i=this.setDisplayRows(o.modules.page.getRows(this.getDisplayRows(i-1)),i))&&o.modules.page.setDisplayIndex(i))}h.prototype.helpers.elVisible(this.element)&&(n?this.reRenderInPosition():(this.renderTable(),o.options.layoutColumnsOnNewData&&this.table.columnManager.redraw(!0))),o.modExists("columnCalcs")&&o.modules.columnCalcs.recalc(this.activeRows)},o.prototype.setActiveRows=function(t){this.activeRows=t,this.activeRowsCount=this.activeRows.length},o.prototype.resetDisplayRows=function(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length,this.table.modExists("frozenRows")&&this.table.modules.frozenRows.setDisplayIndex(0),this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.setDisplayIndex(0),this.table.options.pagination&&this.table.modExists("page")&&this.table.modules.page.setDisplayIndex(0)},o.prototype.getNextDisplayIndex=function(){return this.displayRows.length},o.prototype.setDisplayRows=function(t,e){var n=!0;return e&&void 0!==this.displayRows[e]?(this.displayRows[e]=t,n=!0):(this.displayRows.push(t),n=e=this.displayRows.length-1),e==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length),n},o.prototype.getDisplayRows=function(t){return void 0===t?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[t]||[]},o.prototype.displayRowIterator=function(t){this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length},o.prototype.getRows=function(){return this.rows},o.prototype.reRenderInPosition=function(t){if("virtual"==this.getRenderMode()){for(var e=this.element.scrollTop,n=!1,i=!1,o=this.scrollLeft,r=this.getDisplayRows(),a=this.vDomTop;a<=this.vDomBottom;a++)if(r[a]){var s=e-r[a].getElement().offsetTop;if(!(!1===i||Math.abs(s)<i))break;i=s,n=a}t&&t(),this._virtualRenderFill(!1===n?this.displayRowsCount-1:n,!0,i||0),this.scrollHorizontal(o)}else this.renderTable(),t&&t()},o.prototype.setRenderMode=function(){(this.table.element.clientHeight||this.table.options.height)&&this.table.options.virtualDom?this.renderMode="virtual":this.renderMode="classic"},o.prototype.getRenderMode=function(){return this.renderMode},o.prototype.renderTable=function(){switch(this.table.options.renderStarted.call(this.table),this.element.scrollTop=0,this.renderMode){case"classic":this._simpleRender();break;case"virtual":this._virtualRenderFill()}this.firstRender&&(this.displayRowsCount?(this.firstRender=!1,this.table.modules.layout.layout()):this.renderEmptyScroll()),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.displayRowsCount||this.table.options.placeholder&&(this.renderMode&&this.table.options.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.table.options.placeholder)),this.table.options.renderComplete.call(this.table)},o.prototype._simpleRender=function(){this._clearVirtualDom(),this.displayRowsCount?this.checkClassicModeGroupHeaderWidth():this.renderEmptyScroll()},o.prototype.checkClassicModeGroupHeaderWidth=function(){var t=this,e=this.tableElement,n=!0;t.getDisplayRows().forEach(function(i,o){t.styleRow(i,o),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(n=!1)}),e.style.minWidth=n?t.table.columnManager.getWidth()+"px":""},o.prototype.renderEmptyScroll=function(){this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px",this.tableElement.style.minHeight="1px",this.tableElement.style.visibility="hidden"},o.prototype._clearVirtualDom=function(){var t=this.tableElement;for(this.table.options.placeholder&&this.table.options.placeholder.parentNode&&this.table.options.placeholder.parentNode.removeChild(this.table.options.placeholder);t.firstChild;)t.removeChild(t.firstChild);t.style.paddingTop="",t.style.paddingBottom="",t.style.minWidth="",t.style.minHeight="",t.style.visibility="",this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0},o.prototype.styleRow=function(t,e){var n=t.getElement();e%2?(n.classList.add("tabulator-row-even"),n.classList.remove("tabulator-row-odd")):(n.classList.add("tabulator-row-odd"),n.classList.remove("tabulator-row-even"))},o.prototype._virtualRenderFill=function(t,e,n){var i=this.tableElement,o=this.element,r=0,a=0,s=0,l=0,u=!0,c=this.getDisplayRows();if(t=t||0,n=n||0,t){for(;i.firstChild;)i.removeChild(i.firstChild);var d=(this.displayRowsCount-t+1)*this.vDomRowHeight;d<this.height&&(t-=Math.ceil((this.height-d)/this.vDomRowHeight))<0&&(t=0),t-=r=Math.min(Math.max(Math.floor(this.vDomWindowBuffer/this.vDomRowHeight),this.vDomWindowMinMarginRows),t)}else this._clearVirtualDom();if(this.displayRowsCount&&h.prototype.helpers.elVisible(this.element)){for(this.vDomTop=t,this.vDomBottom=t-1;(a<=this.height+this.vDomWindowBuffer||l<this.vDomWindowMinTotalRows)&&this.vDomBottom<this.displayRowsCount-1;){var f,p=this.vDomBottom+1,g=c[p];this.styleRow(g,p),i.appendChild(g.getElement()),g.initialized?g.heightInitialized||g.normalizeHeight(!0):g.initialize(!0),f=g.getHeight(),l<r?s+=f:a+=f,f>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*f),"group"!==g.type&&(u=!1),this.vDomBottom++,l++}t?(this.vDomTopPad=e?this.vDomRowHeight*this.vDomTop+n:this.scrollTop-s,this.vDomBottomPad=this.vDomBottom==this.displayRowsCount-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-a-s,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((a+s)/l),this.vDomBottomPad=this.vDomRowHeight*(this.displayRowsCount-this.vDomBottom-1),this.vDomScrollHeight=s+a+this.vDomBottomPad-this.height),i.style.paddingTop=this.vDomTopPad+"px",i.style.paddingBottom=this.vDomBottomPad+"px",e&&(this.scrollTop=this.vDomTopPad+s+n-(this.element.scrollWidth>this.element.clientWidth?this.element.offsetHeight-this.element.clientHeight:0)),this.scrollTop=Math.min(this.scrollTop,this.element.scrollHeight-this.height),this.element.scrollWidth>this.element.offsetWidth&&e&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,o.scrollTop=this.scrollTop,i.style.minWidth=u?this.table.columnManager.getWidth()+"px":"",this.table.options.groupBy&&"fitDataFill"!=this.table.modules.layout.getMode()&&this.displayRowsCount==this.table.modules.groupRows.countGroups()&&(this.tableElement.style.minWidth=this.table.columnManager.getWidth())}else this.renderEmptyScroll()},o.prototype.scrollVertical=function(t){var e=this.scrollTop-this.vDomScrollPosTop,n=this.scrollTop-this.vDomScrollPosBottom,i=2*this.vDomWindowBuffer;if(-e>i||n>i){var o=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(o)}else t?(e<0&&this._addTopRow(-e),n<0&&this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer&&this._removeBottomRow(-n)):(e>=0&&this.scrollTop>this.vDomWindowBuffer&&this._removeTopRow(e),n>=0&&this._addBottomRow(n))},o.prototype._addTopRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.tableElement,i=this.getDisplayRows();if(this.vDomTop){var o=this.vDomTop-1,r=i[o],a=r.getHeight()||this.vDomRowHeight;t>=a&&(this.styleRow(r,o),n.insertBefore(r.getElement(),n.firstChild),r.initialized&&r.heightInitialized||(this.vDomTopNewRows.push(r),r.heightInitialized||r.clearCellHeight()),r.initialize(),this.vDomTopPad-=a,this.vDomTopPad<0&&(this.vDomTopPad=o*this.vDomRowHeight),o||(this.vDomTopPad=0),n.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=a,this.vDomTop--),t=-(this.scrollTop-this.vDomScrollPosTop),r.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*r.getHeight()),e<this.vDomMaxRenderChain&&this.vDomTop&&t>=(i[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(t,e+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}},o.prototype._removeTopRow=function(t){var e=this.tableElement,n=this.getDisplayRows()[this.vDomTop],i=n.getHeight()||this.vDomRowHeight;if(t>=i){var o=n.getElement();o.parentNode.removeChild(o),this.vDomTopPad+=i,e.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer,this.vDomTop++,t=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(t)}},o.prototype._addBottomRow=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.tableElement,i=this.getDisplayRows();if(this.vDomBottom<this.displayRowsCount-1){var o=this.vDomBottom+1,r=i[o],a=r.getHeight()||this.vDomRowHeight;t>=a&&(this.styleRow(r,o),n.appendChild(r.getElement()),r.initialized&&r.heightInitialized||(this.vDomBottomNewRows.push(r),r.heightInitialized||r.clearCellHeight()),r.initialize(),this.vDomBottomPad-=a,(this.vDomBottomPad<0||o==this.displayRowsCount-1)&&(this.vDomBottomPad=0),n.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=a,this.vDomBottom++),t=this.scrollTop-this.vDomScrollPosBottom,r.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*r.getHeight()),e<this.vDomMaxRenderChain&&this.vDomBottom<this.displayRowsCount-1&&t>=(i[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(t,e+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}},o.prototype._removeBottomRow=function(t){var e=this.tableElement,n=this.getDisplayRows()[this.vDomBottom],i=n.getHeight()||this.vDomRowHeight;if(t>=i){var o=n.getElement();o.parentNode&&o.parentNode.removeChild(o),this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),e.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i,this.vDomBottom--,t=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(t)}},o.prototype._quickNormalizeRowHeight=function(t){t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()}),t.length=0},o.prototype.normalizeHeight=function(){this.activeRows.forEach(function(t){t.normalizeHeight()})},o.prototype.adjustTableSize=function(){if("virtual"===this.renderMode){this.height=this.element.clientHeight,this.vDomWindowBuffer=this.table.options.virtualDomBuffer||this.height;var t=this.columnManager.getElement().offsetHeight+(this.table.footerManager&&!this.table.footerManager.external?this.table.footerManager.getElement().offsetHeight:0);this.element.style.minHeight="calc(100% - "+t+"px)",this.element.style.height="calc(100% - "+t+"px)",this.element.style.maxHeight="calc(100% - "+t+"px)"}},o.prototype.reinitialize=function(){this.rows.forEach(function(t){t.reinitialize()})},o.prototype.redraw=function(t){var e=this.scrollLeft;this.adjustTableSize(),t?this.renderTable():("classic"==self.renderMode?self.table.options.groupBy?self.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(e)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))},o.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var t=document.createEvent("Event");t.initEvent("scroll",!1,!0),this.element.dispatchEvent(t)}else this.element.dispatchEvent(new Event("scroll"))};var r=function(t){this._row=t};r.prototype.getData=function(t){return this._row.getData(t)},r.prototype.getElement=function(){return this._row.getElement()},r.prototype.getCells=function(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t},r.prototype.getCell=function(t){var e=this._row.getCell(t);return!!e&&e.getComponent()},r.prototype.getIndex=function(){return this._row.getData("data")[this._row.table.options.index]},r.prototype.getPosition=function(t){return this._row.table.rowManager.getRowPosition(this._row,t)},r.prototype.delete=function(){return this._row.delete()},r.prototype.scrollTo=function(){return this._row.table.rowManager.scrollToRow(this._row)},r.prototype.pageTo=function(){if(this._row.table.modExists("page",!0))return this._row.table.modules.page.setPageToRow(this._row)},r.prototype.move=function(t,e){this._row.moveToRow(t,e)},r.prototype.update=function(t){return this._row.updateData(t)},r.prototype.normalizeHeight=function(){this._row.normalizeHeight(!0)},r.prototype.select=function(){this._row.table.modules.selectRow.selectRows(this._row)},r.prototype.deselect=function(){this._row.table.modules.selectRow.deselectRows(this._row)},r.prototype.toggleSelect=function(){this._row.table.modules.selectRow.toggleRow(this._row)},r.prototype.isSelected=function(){return this._row.table.modules.selectRow.isRowSelected(this._row)},r.prototype._getSelf=function(){return this._row},r.prototype.freeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.freezeRow(this._row)},r.prototype.unfreeze=function(){this._row.table.modExists("frozenRows",!0)&&this._row.table.modules.frozenRows.unfreezeRow(this._row)},r.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)},r.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)},r.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)},r.prototype.getTreeParent=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeParent(this._row)},r.prototype.getTreeChildren=function(){return!!this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.getTreeChildren(this._row)},r.prototype.reformat=function(){return this._row.reinitialize()},r.prototype.getGroup=function(){return this._row.getGroup().getComponent()},r.prototype.getTable=function(){return this._row.table},r.prototype.getNextRow=function(){var t=this._row.nextRow();return t?t.getComponent():t},r.prototype.getPrevRow=function(){var t=this._row.prevRow();return t?t.getComponent():t};var s=function(t,e){this.table=e.table,this.parent=e,this.data={},this.type="row",this.element=this.createElement(),this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.setData(t),this.generateElement()};s.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.setAttribute("role","row"),t},s.prototype.getElement=function(){return this.element},s.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},s.prototype.generateElement=function(){var t,e,n,i=this;!1!==i.table.options.selectable&&i.table.modExists("selectRow")&&i.table.modules.selectRow.initializeRow(this),!1!==i.table.options.movableRows&&i.table.modExists("moveRow")&&i.table.modules.moveRow.initializeRow(this),!1!==i.table.options.dataTree&&i.table.modExists("dataTree")&&i.table.modules.dataTree.initializeRow(this),i.table.options.rowClick&&i.element.addEventListener("click",function(t){i.table.options.rowClick(t,i.getComponent())}),i.table.options.rowDblClick&&i.element.addEventListener("dblclick",function(t){i.table.options.rowDblClick(t,i.getComponent())}),i.table.options.rowContext&&i.element.addEventListener("contextmenu",function(t){i.table.options.rowContext(t,i.getComponent())}),i.table.options.rowMouseEnter&&i.element.addEventListener("mouseenter",function(t){i.table.options.rowMouseEnter(t,i.getComponent())}),i.table.options.rowMouseLeave&&i.element.addEventListener("mouseleave",function(t){i.table.options.rowMouseLeave(t,i.getComponent())}),i.table.options.rowMouseOver&&i.element.addEventListener("mouseover",function(t){i.table.options.rowMouseOver(t,i.getComponent())}),i.table.options.rowMouseOut&&i.element.addEventListener("mouseout",function(t){i.table.options.rowMouseOut(t,i.getComponent())}),i.table.options.rowMouseMove&&i.element.addEventListener("mousemove",function(t){i.table.options.rowMouseMove(t,i.getComponent())}),i.table.options.rowTap&&(n=!1,i.element.addEventListener("touchstart",function(t){n=!0}),i.element.addEventListener("touchend",function(t){n&&i.table.options.rowTap(t,i.getComponent()),n=!1})),i.table.options.rowDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,i.table.options.rowDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.table.options.rowTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,n=!1,i.table.options.rowTapHold(t,i.getComponent())},1e3)}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null}))},s.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)},s.prototype.initialize=function(t){var e=this;if(!e.initialized||t){for(e.deleteCells();e.element.firstChild;)e.element.removeChild(e.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),e.cells.forEach(function(t){e.element.appendChild(t.getElement()),t.cellRendered()}),t&&e.normalizeHeight(),e.table.options.dataTree&&e.table.modExists("dataTree")&&e.table.modules.dataTree.layoutRow(this),"collapse"===e.table.options.responsiveLayout&&e.table.modExists("responsiveLayout")&&e.table.modules.responsiveLayout.layoutRow(this),e.table.options.rowFormatter&&e.table.options.rowFormatter(e.getComponent()),e.table.options.resizableRows&&e.table.modExists("resizeRows")&&e.table.modules.resizeRows.initializeRow(e),e.initialized=!0}},s.prototype.reinitializeHeight=function(){this.heightInitialized=!1,null!==this.element.offsetParent&&this.normalizeHeight(!0)},s.prototype.reinitialize=function(){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),null!==this.element.offsetParent&&this.initialize(!0)},s.prototype.calcHeight=function(t){var e=0,n=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(t){var n=t.getHeight();n>e&&(e=n)}),this.height=t?Math.max(e,n):this.manualHeight?this.height:Math.max(e,n),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight},s.prototype.setCellHeight=function(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0},s.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})},s.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()},s.prototype.setHeight=function(t,e){(this.height!=t||e)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)},s.prototype.getHeight=function(){return this.outerHeight},s.prototype.getWidth=function(){return this.element.offsetWidth},s.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},s.prototype.setData=function(t){this.table.modExists("mutator")&&(t=this.table.modules.mutator.transformRow(t,"data")),this.data=t,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)},s.prototype.updateData=function(t){var e=this,n=this,i=h.prototype.helpers.elVisible(this.element);return new Promise(function(o,r){for(var a in"string"==typeof t&&(t=JSON.parse(t)),e.table.options.reactiveData&&e.table.modExists("reactiveData",!0)&&e.table.modules.reactiveData.block(),n.table.modExists("mutator")&&(t=n.table.modules.mutator.transformRow(t,"data",!0)),t)n.data[a]=t[a];for(var a in e.table.options.reactiveData&&e.table.modExists("reactiveData",!0)&&e.table.modules.reactiveData.unblock(),t){var s=e.getCell(a);s&&s.getValue()!=t[a]&&(s.setValueProcessData(t[a]),i&&s.cellRendered())}i?(n.normalizeHeight(),n.table.options.rowFormatter&&n.table.options.rowFormatter(n.getComponent())):(e.initialized=!1,e.height=0,e.heightStyled=""),!1!==n.table.options.dataTree&&n.table.modExists("dataTree")&&void 0!==t[e.table.modules.dataTree.getChildField()]&&(e.table.modules.dataTree.initializeRow(e),e.table.rowManager.refreshActiveData("tree",!1,!0)),n.table.options.rowUpdated.call(e.table,n.getComponent()),o()})},s.prototype.getData=function(t){return t?this.table.modExists("accessor")?this.table.modules.accessor.transformRow(this.data,t):void 0:this.data},s.prototype.getCell=function(t){return t=this.table.columnManager.findColumn(t),this.cells.find(function(e){return e.column===t})},s.prototype.getCellIndex=function(t){return this.cells.findIndex(function(e){return e===t})},s.prototype.findNextEditableCell=function(t){var e=!1;if(t<this.cells.length-1)for(var n=t+1;n<this.cells.length;n++){var i=this.cells[n];if(i.column.modules.edit&&h.prototype.helpers.elVisible(i.getElement())){var o=!0;if("function"==typeof i.column.modules.edit.check&&(o=i.column.modules.edit.check(i.getComponent())),o){e=i;break}}}return e},s.prototype.findPrevEditableCell=function(t){var e=!1;if(t>0)for(var n=t-1;n>=0;n--){var i=this.cells[n],o=!0;if(i.column.modules.edit&&h.prototype.helpers.elVisible(i.getElement())&&("function"==typeof i.column.modules.edit.check&&(o=i.column.modules.edit.check(i.getComponent())),o)){e=i;break}}return e},s.prototype.getCells=function(){return this.cells},s.prototype.nextRow=function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1},s.prototype.prevRow=function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1},s.prototype.moveToRow=function(t,e){var n=this.table.rowManager.findRow(t);n?(this.table.rowManager.moveRowActual(this,n,!e),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)},s.prototype.delete=function(){var t=this;return new Promise(function(e,n){var i=t.table.rowManager.getRowIndex(t);t.deleteActual(),t.table.options.history&&t.table.modExists("history")&&(i&&(i=t.table.rowManager.rows[i-1]),t.table.modules.history.action("rowDelete",t,{data:t.getData(),pos:!i,index:i})),e()})},s.prototype.deleteActual=function(t){this.table.rowManager.getRowIndex(this);this.table.modExists("selectRow")&&this.table.modules.selectRow._deselectRow(this,!0),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.modules.group&&this.modules.group.removeRow(this),this.table.modExists("columnCalcs")&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows))},s.prototype.deleteCells=function(){for(var t=this.cells.length,e=0;e<t;e++)this.cells[0].delete()},s.prototype.wipe=function(){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.parentNode&&this.element.parentNode.removeChild(this.element)},s.prototype.getGroup=function(){return this.modules.group||!1},s.prototype.getComponent=function(){return new r(this)};var l=function(t){this._cell=t};l.prototype.getValue=function(){return this._cell.getValue()},l.prototype.getOldValue=function(){return this._cell.getOldValue()},l.prototype.getElement=function(){return this._cell.getElement()},l.prototype.getRow=function(){return this._cell.row.getComponent()},l.prototype.getData=function(){return this._cell.row.getData()},l.prototype.getField=function(){return this._cell.column.getField()},l.prototype.getColumn=function(){return this._cell.column.getComponent()},l.prototype.setValue=function(t,e){void 0===e&&(e=!0),this._cell.setValue(t,e)},l.prototype.restoreOldValue=function(){this._cell.setValueActual(this._cell.getOldValue())},l.prototype.edit=function(t){return this._cell.edit(t)},l.prototype.cancelEdit=function(){this._cell.cancelEdit()},l.prototype.nav=function(){return this._cell.nav()},l.prototype.checkHeight=function(){this._cell.checkHeight()},l.prototype.getTable=function(){return this._cell.table},l.prototype._getSelf=function(){return this._cell};var u=function(t,e){this.table=t.table,this.column=t,this.row=e,this.element=null,this.value=null,this.oldValue=null,this.height=null,this.width=null,this.minWidth=null,this.build()};u.prototype.build=function(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data))},u.prototype.generateElement=function(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.element=this.element},u.prototype._configureCell=function(){var t=this,e=t.column.cellEvents,n=t.element,i=this.column.getField();(n.style.textAlign=t.column.hozAlign,i&&n.setAttribute("tabulator-field",i),t.column.definition.cssClass)&&t.column.definition.cssClass.split(" ").forEach(function(t){n.classList.add(t)});"hover"===this.table.options.tooltipGenerationMode&&n.addEventListener("mouseenter",function(e){t._generateTooltip()}),t._bindClickEvents(e),t._bindTouchEvents(e),t._bindMouseEvents(e),t.column.modules.edit&&t.table.modules.edit.bindEditor(t),t.column.definition.rowHandle&&!1!==t.table.options.movableRows&&t.table.modExists("moveRow")&&t.table.modules.moveRow.initializeCell(t),t.column.visible||t.hide()},u.prototype._bindClickEvents=function(t){var e=this,n=e.element;(t.cellClick||e.table.options.cellClick)&&n.addEventListener("click",function(n){var i=e.getComponent();t.cellClick&&t.cellClick.call(e.table,n,i),e.table.options.cellClick&&e.table.options.cellClick.call(e.table,n,i)}),(t.cellDblClick||this.table.options.cellDblClick)&&n.addEventListener("dblclick",function(n){var i=e.getComponent();t.cellDblClick&&t.cellDblClick.call(e.table,n,i),e.table.options.cellDblClick&&e.table.options.cellDblClick.call(e.table,n,i)}),(t.cellContext||this.table.options.cellContext)&&n.addEventListener("contextmenu",function(n){var i=e.getComponent();t.cellContext&&t.cellContext.call(e.table,n,i),e.table.options.cellContext&&e.table.options.cellContext.call(e.table,n,i)})},u.prototype._bindMouseEvents=function(t){var e=this,n=e.element;(t.cellMouseEnter||e.table.options.cellMouseEnter)&&n.addEventListener("mouseenter",function(n){var i=e.getComponent();t.cellMouseEnter&&t.cellMouseEnter.call(e.table,n,i),e.table.options.cellMouseEnter&&e.table.options.cellMouseEnter.call(e.table,n,i)}),(t.cellMouseLeave||e.table.options.cellMouseLeave)&&n.addEventListener("mouseleave",function(n){var i=e.getComponent();t.cellMouseLeave&&t.cellMouseLeave.call(e.table,n,i),e.table.options.cellMouseLeave&&e.table.options.cellMouseLeave.call(e.table,n,i)}),(t.cellMouseOver||e.table.options.cellMouseOver)&&n.addEventListener("mouseover",function(n){var i=e.getComponent();t.cellMouseOver&&t.cellMouseOver.call(e.table,n,i),e.table.options.cellMouseOver&&e.table.options.cellMouseOver.call(e.table,n,i)}),(t.cellMouseOut||e.table.options.cellMouseOut)&&n.addEventListener("mouseout",function(n){var i=e.getComponent();t.cellMouseOut&&t.cellMouseOut.call(e.table,n,i),e.table.options.cellMouseOut&&e.table.options.cellMouseOut.call(e.table,n,i)}),(t.cellMouseMove||e.table.options.cellMouseMove)&&n.addEventListener("mousemove",function(n){var i=e.getComponent();t.cellMouseMove&&t.cellMouseMove.call(e.table,n,i),e.table.options.cellMouseMove&&e.table.options.cellMouseMove.call(e.table,n,i)})},u.prototype._bindTouchEvents=function(t){var e,n,i,o=this,r=o.element;(t.cellTap||this.table.options.cellTap)&&(i=!1,r.addEventListener("touchstart",function(t){i=!0}),r.addEventListener("touchend",function(e){if(i){var n=o.getComponent();t.cellTap&&t.cellTap.call(o.table,e,n),o.table.options.cellTap&&o.table.options.cellTap.call(o.table,e,n)}i=!1})),(t.cellDblTap||this.table.options.cellDblTap)&&(e=null,r.addEventListener("touchend",function(n){if(e){clearTimeout(e),e=null;var i=o.getComponent();t.cellDblTap&&t.cellDblTap.call(o.table,n,i),o.table.options.cellDblTap&&o.table.options.cellDblTap.call(o.table,n,i)}else e=setTimeout(function(){clearTimeout(e),e=null},300)})),(t.cellTapHold||this.table.options.cellTapHold)&&(n=null,r.addEventListener("touchstart",function(e){clearTimeout(n),n=setTimeout(function(){clearTimeout(n),n=null,i=!1;var r=o.getComponent();t.cellTapHold&&t.cellTapHold.call(o.table,e,r),o.table.options.cellTapHold&&o.table.options.cellTapHold.call(o.table,e,r)},1e3)}),r.addEventListener("touchend",function(t){clearTimeout(n),n=null}))},u.prototype._generateContents=function(){var t;switch(void 0===(t=this.table.modExists("format")?this.table.modules.format.formatValue(this):this.element.innerHTML=this.value)?"undefined":a(t)){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",null!=t&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":case"null":this.element.innerHTML="";break;default:this.element.innerHTML=t}},u.prototype.cellRendered=function(){this.table.modExists("format")&&this.table.modules.format.cellRendered&&this.table.modules.format.cellRendered(this)},u.prototype._generateTooltip=function(){var t=this.column.tooltip;t?(!0===t?t=this.value:"function"==typeof t&&!1===(t=t(this.getComponent()))&&(t=""),void 0===t&&(t=""),this.element.setAttribute("title",t)):this.element.setAttribute("title","")},u.prototype.getElement=function(){return this.element},u.prototype.getValue=function(){return this.value},u.prototype.getOldValue=function(){return this.oldValue},u.prototype.setValue=function(t,e){var n;this.setValueProcessData(t,e)&&(this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("cellEdit",this,{oldValue:this.oldValue,newValue:this.value}),n=this.getComponent(),this.column.cellEvents.cellEdited&&this.column.cellEvents.cellEdited.call(this.table,n),this.table.options.cellEdited.call(this.table,n),this.table.options.dataEdited.call(this.table,this.table.rowManager.getData()))},u.prototype.setValueProcessData=function(t,e){var n=!1;return this.value!=t&&(n=!0,e&&this.column.modules.mutate&&(t=this.table.modules.mutator.transformCell(this,t))),this.setValueActual(t),n&&this.table.modExists("columnCalcs")&&(this.column.definition.topCalc||this.column.definition.bottomCalc)&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this.row):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows)),n},u.prototype.setValueActual=function(t){this.oldValue=this.value,this.value=t,this.table.options.reactiveData&&this.table.modExists("reactiveData")&&this.table.modules.reactiveData.block(),this.column.setFieldValue(this.row.data,t),this.table.options.reactiveData&&this.table.modExists("reactiveData")&&this.table.modules.reactiveData.unblock(),this._generateContents(),this._generateTooltip(),this.table.options.resizableColumns&&this.table.modExists("resizeColumns")&&this.table.modules.resizeColumns.initializeColumn("cell",this.column,this.element),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutElement(this.element,this.column)},u.prototype.setWidth=function(){this.width=this.column.width,this.element.style.width=this.column.widthStyled},u.prototype.clearWidth=function(){this.width="",this.element.style.width=""},u.prototype.getWidth=function(){return this.width||this.element.offsetWidth},u.prototype.setMinWidth=function(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled},u.prototype.checkHeight=function(){this.row.reinitializeHeight()},u.prototype.clearHeight=function(){this.element.style.height="",this.height=null},u.prototype.setHeight=function(){this.height=this.row.height,this.element.style.height=this.row.heightStyled},u.prototype.getHeight=function(){return this.height||this.element.offsetHeight},u.prototype.show=function(){this.element.style.display=""},u.prototype.hide=function(){this.element.style.display="none"},u.prototype.edit=function(t){if(this.table.modExists("edit",!0))return this.table.modules.edit.editCell(this,t)},u.prototype.cancelEdit=function(){if(this.table.modExists("edit",!0)){var t=this.table.modules.edit.getCurrentCell();t&&t._getSelf()===this?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}},u.prototype.delete=function(){this.element.parentNode.removeChild(this.element),this.column.deleteCell(this),this.row.deleteCell(this)},u.prototype.nav=function(){var t=this,e=!1,n=this.row.getCellIndex(this);return{next:function(){var e,n=this.right();return!!n||!(!(e=t.table.rowManager.nextDisplayRow(t.row,!0))||!(n=e.findNextEditableCell(-1)))&&(n.edit(),!0)},prev:function(){var e,n=this.left();return!!n||!(!(e=t.table.rowManager.prevDisplayRow(t.row,!0))||!(n=e.findPrevEditableCell(e.cells.length)))&&(n.edit(),!0)},left:function(){return!!(e=t.row.findPrevEditableCell(n))&&(e.edit(),!0)},right:function(){return!!(e=t.row.findNextEditableCell(n))&&(e.edit(),!0)},up:function(){var e=t.table.rowManager.prevDisplayRow(t.row,!0);e&&e.cells[n].edit()},down:function(){var e=t.table.rowManager.nextDisplayRow(t.row,!0);e&&e.cells[n].edit()}}},u.prototype.getIndex=function(){this.row.getCellIndex(this)},u.prototype.getComponent=function(){return new l(this)};var c=function(t){this.table=t,this.active=!1,this.element=this.createElement(),this.external=!1,this.links=[],this._initialize()};c.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-footer"),t},c.prototype._initialize=function(t){if(this.table.options.footerElement)switch(a(this.table.options.footerElement)){case"string":"<"===this.table.options.footerElement[0]?this.element.innerHTML=this.table.options.footerElement:(this.external=!0,this.element=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement}},c.prototype.getElement=function(){return this.element},c.prototype.append=function(t,e){this.activate(e),this.element.appendChild(t),this.table.rowManager.adjustTableSize()},c.prototype.prepend=function(t,e){this.activate(e),this.element.insertBefore(t,this.element.firstChild),this.table.rowManager.adjustTableSize()},c.prototype.remove=function(t){t.parentNode.removeChild(t),this.deactivate()},c.prototype.deactivate=function(t){this.element.firstChild&&!t||(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)},c.prototype.activate=function(t){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display="")),t&&this.links.push(t)},c.prototype.redraw=function(){this.links.forEach(function(t){t.footerRedraw()})};var h=function t(e,n){this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.browser="",this.browserSlow=!1,this.modules={},this.initializeElement(e),this.initializeOptions(n||{}),this._create(),t.prototype.comms.register(this)};h.prototype.defaultOptions={height:!1,layout:"fitData",layoutColumnsOnNewData:!1,columnMinWidth:40,columnVertAlign:"top",resizableColumns:!0,resizableRows:!1,autoResize:!0,columns:[],data:[],autoColumns:!1,reactiveData:!1,nestedFieldSeparator:".",tooltips:!1,tooltipsHeader:!1,tooltipGenerationMode:"load",initialSort:!1,initialFilter:!1,initialHeaderFilter:!1,columnHeaderSortMulti:!0,sortOrderReverse:!1,footerElement:!1,index:"id",keybindings:[],clipboard:!1,clipboardCopyStyled:!0,clipboardCopySelector:"active",clipboardCopyFormatter:"table",clipboardPasteParser:"table",clipboardPasteAction:"insert",clipboardCopyConfig:!1,clipboardCopied:function(){},clipboardPasted:function(){},clipboardPasteError:function(){},downloadDataFormatter:!1,downloadReady:function(t,e){return e},downloadComplete:!1,downloadConfig:!1,dataTree:!1,dataTreeElementColumn:!1,dataTreeBranchElement:!0,dataTreeChildIndent:9,dataTreeChildField:"_children",dataTreeCollapseElement:!1,dataTreeExpandElement:!1,dataTreeStartExpanded:!1,dataTreeRowExpanded:function(){},dataTreeRowCollapsed:function(){},addRowPos:"bottom",selectable:"highlight",selectableRangeMode:"drag",selectableRollingSelection:!0,selectablePersistence:!0,selectableCheck:function(t,e){return!0},headerFilterPlaceholder:!1,history:!1,locale:!1,langs:{},virtualDom:!0,persistentLayout:!1,persistentSort:!1,persistentFilter:!1,persistenceID:"",persistenceMode:!0,responsiveLayout:!1,responsiveLayoutCollapseStartOpen:!0,responsiveLayoutCollapseUseFormatters:!0,responsiveLayoutCollapseFormatter:!1,pagination:!1,paginationSize:!1,paginationButtonCount:5,paginationSizeSelector:!1,paginationElement:!1,paginationDataSent:{},paginationDataReceived:{},paginationAddRow:"page",ajaxURL:!1,ajaxURLGenerator:!1,ajaxParams:{},ajaxConfig:"get",ajaxContentType:"form",ajaxRequestFunc:!1,ajaxLoader:!0,ajaxLoaderLoading:!1,ajaxLoaderError:!1,ajaxFiltering:!1,ajaxSorting:!1,ajaxProgressiveLoad:!1,ajaxProgressiveLoadDelay:0,ajaxProgressiveLoadScrollMargin:0,groupBy:!1,groupStartOpen:!0,groupValues:!1,groupHeader:!1,movableColumns:!1,movableRows:!1,movableRowsConnectedTables:!1,movableRowsSender:!1,movableRowsReceiver:"insert",movableRowsSendingStart:function(){},movableRowsSent:function(){},movableRowsSentFailed:function(){},movableRowsSendingStop:function(){},movableRowsReceivingStart:function(){},movableRowsReceived:function(){},movableRowsReceivedFailed:function(){},movableRowsReceivingStop:function(){},scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,placeholder:!1,tableBuilding:function(){},tableBuilt:function(){},renderStarted:function(){},renderComplete:function(){},rowClick:!1,rowDblClick:!1,rowContext:!1,rowTap:!1,rowDblTap:!1,rowTapHold:!1,rowMouseEnter:!1,rowMouseLeave:!1,rowMouseOver:!1,rowMouseOut:!1,rowMouseMove:!1,rowAdded:function(){},rowDeleted:function(){},rowMoved:function(){},rowUpdated:function(){},rowSelectionChanged:function(){},rowSelected:function(){},rowDeselected:function(){},rowResized:function(){},cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1,cellEditing:function(){},cellEdited:function(){},cellEditCancelled:function(){},columnMoved:!1,columnResized:function(){},columnTitleChanged:function(){},columnVisibilityChanged:function(){},htmlImporting:function(){},htmlImported:function(){},dataLoading:function(){},dataLoaded:function(){},dataEdited:function(){},ajaxRequesting:function(){},ajaxResponse:!1,ajaxError:function(){},dataFiltering:!1,dataFiltered:!1,dataSorting:function(){},dataSorted:function(){},groupToggleElement:"arrow",groupClosedShowCalcs:!1,dataGrouping:function(){},dataGrouped:!1,groupVisibilityChanged:function(){},groupClick:!1,groupDblClick:!1,groupContext:!1,groupTap:!1,groupDblTap:!1,groupTapHold:!1,columnCalcs:!0,pageLoaded:function(){},localized:function(){},validationFailed:function(){},historyUndo:function(){},historyRedo:function(){}},h.prototype.initializeOptions=function(t){for(var e in this.defaultOptions)e in t?this.options[e]=t[e]:Array.isArray(this.defaultOptions[e])?this.options[e]=[]:"object"===a(this.defaultOptions[e])?this.options[e]={}:this.options[e]=this.defaultOptions[e]},h.prototype.initializeElement=function(t){return t instanceof HTMLElement?(this.element=t,!0):"string"==typeof t?(this.element=document.querySelector(t),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",t),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",t),!1)},h.prototype._mapDepricatedFunctionality=function(){},h.prototype._create=function(){this._clearObjectPointers(),this._mapDepricatedFunctionality(),this.bindModules(),"TABLE"===this.element.tagName&&this.modExists("htmlTableImport",!0)&&this.modules.htmlTableImport.parseTable(),this.columnManager=new t(this),this.rowManager=new o(this),this.footerManager=new c(this),this.columnManager.setRowManager(this.rowManager),this.rowManager.setColumnManager(this.columnManager),this._buildElement(),this._loadInitialData()},h.prototype._clearObjectPointers=function(){this.options.columns=this.options.columns.slice(0),this.options.reactiveData||(this.options.data=this.options.data.slice(0))},h.prototype._buildElement=function(){var t=this,e=this.element,n=this.modules,i=this.options;for(i.tableBuilding.call(this),e.classList.add("tabulator"),e.setAttribute("role","grid");e.firstChild;)e.removeChild(e.firstChild);for(var o in i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",e.style.height=i.height),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modExists("layout",!0)&&n.layout.initialize(i.layout),!1!==i.headerFilterPlaceholder&&n.localize.setHeaderFilterPlaceholder(i.headerFilterPlaceholder),i.langs)n.localize.installLang(o,i.langs[o]);if(n.localize.setLocale(i.locale),"string"==typeof i.placeholder){var r=document.createElement("div");r.classList.add("tabulator-placeholder");var a=document.createElement("span");a.innerHTML=i.placeholder,r.appendChild(a),i.placeholder=r}if(e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),i.footerElement&&this.footerManager.activate(),(i.persistentLayout||i.persistentSort||i.persistentFilter)&&this.modExists("persistence",!0)&&n.persistence.initialize(i.persistenceMode,i.persistenceID),i.persistentLayout&&this.modExists("persistence",!0)&&(i.columns=n.persistence.load("columns",i.columns)),i.movableRows&&this.modExists("moveRow")&&n.moveRow.initialize(),i.autoColumns&&this.options.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modExists("columnCalcs")&&n.columnCalcs.initialize(),this.columnManager.setColumns(i.columns),i.dataTree&&this.modExists("dataTree",!0)&&n.dataTree.initialize(),this.modExists("frozenRows")&&this.modules.frozenRows.initialize(),(i.persistentSort||i.initialSort)&&this.modExists("sort",!0)){var s=[];i.persistentSort&&this.modExists("persistence",!0)?!1===(s=n.persistence.load("sort"))&&i.initialSort&&(s=i.initialSort):i.initialSort&&(s=i.initialSort),n.sort.setSort(s)}if((i.persistentFilter||i.initialFilter)&&this.modExists("filter",!0)){var l=[];i.persistentFilter&&this.modExists("persistence",!0)?!1===(l=n.persistence.load("filter"))&&i.initialFilter&&(l=i.initialFilter):i.initialFilter&&(l=i.initialFilter),n.filter.setFilter(l)}i.initialHeaderFilter&&this.modExists("filter",!0)&&i.initialHeaderFilter.forEach(function(e){var i=t.columnManager.findColumn(e.field);if(!i)return console.warn("Column Filter Error - No matching column found:",e.field),!1;n.filter.setHeaderFilterValue(i,e.value)}),this.modExists("ajax")&&n.ajax.initialize(),i.pagination&&this.modExists("page",!0)&&n.page.initialize(),i.groupBy&&this.modExists("groupRows",!0)&&n.groupRows.initialize(),this.modExists("keybindings")&&n.keybindings.initialize(),this.modExists("selectRow")&&n.selectRow.clearSelectionData(!0),i.autoResize&&this.modExists("resizeTable")&&n.resizeTable.initialize(),this.modExists("clipboard")&&n.clipboard.initialize(),i.tableBuilt.call(this)},h.prototype._loadInitialData=function(){this.options.pagination&&this.modExists("page")?(this.modules.page.reset(!0),"local"==this.options.pagination?this.options.data.length?this.rowManager.setData(this.options.data):(this.options.ajaxURL||this.options.ajaxURLGenerator)&&this.modExists("ajax")?this.modules.ajax.loadData().then(function(){}).catch(function(){}):this.rowManager.setData(this.options.data):this.options.ajaxURL?this.modules.page.setPage(1).then(function(){}).catch(function(){}):this.rowManager.setData([])):this.options.data.length?this.rowManager.setData(this.options.data):(this.options.ajaxURL||this.options.ajaxURLGenerator)&&this.modExists("ajax")?this.modules.ajax.loadData().then(function(){}).catch(function(){}):this.rowManager.setData(this.options.data)},h.prototype.destroy=function(){var t=this.element;for(h.prototype.comms.deregister(this),this.options.reactiveData&&this.modExists("reactiveData",!0)&&this.modules.reactiveData.unwatchData(),this.rowManager.rows.forEach(function(t){t.wipe()}),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[],this.options.autoResize&&this.modExists("resizeTable")&&this.modules.resizeTable.clearBindings(),this.modExists("keybindings")&&this.modules.keybindings.clearBindings();t.firstChild;)t.removeChild(t.firstChild);t.classList.remove("tabulator")},h.prototype._detectBrowser=function(){var t=navigator.userAgent;t.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):t.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1)},h.prototype.setDataFromLocalFile=function(t){var e=this;return new Promise(function(n,i){var o=document.createElement("input");o.type="file",o.accept=t||".json,application/json",o.addEventListener("change",function(t){var r,a=o.files[0],s=new FileReader;s.readAsText(a),s.onload=function(t){try{r=JSON.parse(s.result)}catch(t){return console.warn("File Load Error - File contents is invalid JSON",t),void i(t)}e._setData(r).then(function(t){n(t)}).catch(function(t){n(t)})},s.onerror=function(t){console.warn("File Load Error - Unable to read file"),i()}}),o.click()})},h.prototype.setData=function(t,e,n){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,n)},h.prototype._setData=function(t,e,n,i){return"string"!=typeof t?t?this.rowManager.setData(t,i):this.modExists("ajax")&&(this.modules.ajax.getUrl||this.options.ajaxURLGenerator)?"remote"==this.options.pagination&&this.modExists("page",!0)?(this.modules.page.reset(!0),this.modules.page.setPage(1)):this.modules.ajax.loadData(i):this.rowManager.setData([],i):0==t.indexOf("{")||0==t.indexOf("[")?this.rowManager.setData(JSON.parse(t),i):this.modExists("ajax",!0)?(e&&this.modules.ajax.setParams(e),n&&this.modules.ajax.setConfig(n),this.modules.ajax.setUrl(t),"remote"==this.options.pagination&&this.modExists("page",!0)?(this.modules.page.reset(!0),this.modules.page.setPage(1)):this.modules.ajax.loadData(i)):void 0},h.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()},h.prototype.getData=function(t){return this.rowManager.getData(t)},h.prototype.getDataCount=function(t){return this.rowManager.getDataCount(t)},h.prototype.searchRows=function(t,e,n){if(this.modExists("filter",!0))return this.modules.filter.search("rows",t,e,n)},h.prototype.searchData=function(t,e,n){if(this.modExists("filter",!0))return this.modules.filter.search("data",t,e,n)},h.prototype.getHtml=function(t){return this.rowManager.getHtml(t)},h.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()},h.prototype.replaceData=function(t,e,n){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,e,n,!0)},h.prototype.updateData=function(t){var e=this,n=this,i=0;return new Promise(function(o,r){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=n.rowManager.findRow(t[n.options.index]);e&&(i++,e.updateData(t).then(function(){--i||o()}))}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})},h.prototype.addData=function(t,e,n){var i=this;return new Promise(function(o,r){i.modExists("ajax")&&i.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?i.rowManager.addRows(t,e,n).then(function(t){var e=[];t.forEach(function(t){e.push(t.getComponent())}),o(e)}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})},h.prototype.updateOrAddData=function(t){var e=this,n=this,i=[],o=0;return new Promise(function(r,a){e.modExists("ajax")&&e.modules.ajax.blockActiveRequest(),"string"==typeof t&&(t=JSON.parse(t)),t?t.forEach(function(t){var e=n.rowManager.findRow(t[n.options.index]);o++,e?e.updateData(t).then(function(){o--,i.push(e.getComponent()),o||r(i)}):n.rowManager.addRows(t).then(function(t){o--,i.push(t[0].getComponent()),o||r(i)})}):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))})},h.prototype.getRow=function(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},h.prototype.getRowFromPosition=function(t,e){var n=this.rowManager.getRowFromPosition(t,e);return n?n.getComponent():(console.warn("Find Error - No matching row found:",t),!1)},h.prototype.deleteRow=function(t){var e=this;return new Promise(function(n,i){var o=e.rowManager.findRow(t);o?o.delete().then(function(){n()}).catch(function(t){i(t)}):(console.warn("Delete Error - No matching row found:",t),i("Delete Error - No matching row found"))})},h.prototype.addRow=function(t,e,n){var i=this;return new Promise(function(o,r){"string"==typeof t&&(t=JSON.parse(t)),i.rowManager.addRows(t,e,n).then(function(t){i.modExists("columnCalcs")&&i.modules.columnCalcs.recalc(i.rowManager.activeRows),o(t[0].getComponent())})})},h.prototype.updateOrAddRow=function(t,e){var n=this;return new Promise(function(i,o){var r=n.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),r?r.updateData(e).then(function(){n.modExists("columnCalcs")&&n.modules.columnCalcs.recalc(n.rowManager.activeRows),i(r.getComponent())}).catch(function(t){o(t)}):r=n.rowManager.addRows(e).then(function(t){n.modExists("columnCalcs")&&n.modules.columnCalcs.recalc(n.rowManager.activeRows),i(t[0].getComponent())}).catch(function(t){o(t)})})},h.prototype.updateRow=function(t,e){var n=this;return new Promise(function(i,o){var r=n.rowManager.findRow(t);"string"==typeof e&&(e=JSON.parse(e)),r?r.updateData(e).then(function(){i(r.getComponent())}).catch(function(t){o(t)}):(console.warn("Update Error - No matching row found:",t),o("Update Error - No matching row found"))})},h.prototype.scrollToRow=function(t,e,n){var i=this;return new Promise(function(o,r){var a=i.rowManager.findRow(t);a?i.rowManager.scrollToRow(a,e,n).then(function(){o()}).catch(function(t){r(t)}):(console.warn("Scroll Error - No matching row found:",t),r("Scroll Error - No matching row found"))})},h.prototype.moveRow=function(t,e,n){var i=this.rowManager.findRow(t);i?i.moveToRow(e,n):console.warn("Move Error - No matching row found:",t)},h.prototype.getRows=function(t){return this.rowManager.getComponents(t)},h.prototype.getRowPosition=function(t,e){var n=this.rowManager.findRow(t);return n?this.rowManager.getRowPosition(n,e):(console.warn("Position Error - No matching row found:",t),!1)},h.prototype.copyToClipboard=function(t,e,n,i){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(t,e,n,i)},h.prototype.setColumns=function(t){this.columnManager.setColumns(t)},h.prototype.getColumns=function(t){return this.columnManager.getComponents(t)},h.prototype.getColumn=function(t){var e=this.columnManager.findColumn(t);return e?e.getComponent():(console.warn("Find Error - No matching column found:",t),!1)},h.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()},h.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())},h.prototype.setColumnLayout=function(t){return!!this.modExists("persistence",!0)&&(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,t)),!0)},h.prototype.showColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Show Error - No matching column found:",t),!1;e.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},h.prototype.hideColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Hide Error - No matching column found:",t),!1;e.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update()},h.prototype.toggleColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1;e.visible?e.hide():e.show()},h.prototype.addColumn=function(t,e,n){var i=this.columnManager.findColumn(n);this.columnManager.addColumn(t,e,i)},h.prototype.deleteColumn=function(t){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Delete Error - No matching column found:",t),!1;e.delete()},h.prototype.scrollToColumn=function(t,e,n){var i=this;return new Promise(function(o,r){var a=i.columnManager.findColumn(t);a?i.columnManager.scrollToColumn(a,e,n).then(function(){o()}).catch(function(t){r(t)}):(console.warn("Scroll Error - No matching column found:",t),r("Scroll Error - No matching column found"))})},h.prototype.setLocale=function(t){this.modules.localize.setLocale(t)},h.prototype.getLocale=function(){return this.modules.localize.getLocale()},h.prototype.getLang=function(t){return this.modules.localize.getLang(t)},h.prototype.redraw=function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)},h.prototype.setHeight=function(t){this.options.height=isNaN(t)?t:t+"px",this.element.style.height=this.options.height,this.rowManager.redraw()},h.prototype.setSort=function(t,e){this.modExists("sort",!0)&&(this.modules.sort.setSort(t,e),this.rowManager.sorterRefresh())},h.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()},h.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())},h.prototype.setFilter=function(t,e,n){this.modExists("filter",!0)&&(this.modules.filter.setFilter(t,e,n),this.rowManager.filterRefresh())},h.prototype.addFilter=function(t,e,n){this.modExists("filter",!0)&&(this.modules.filter.addFilter(t,e,n),this.rowManager.filterRefresh())},h.prototype.getFilters=function(t){if(this.modExists("filter",!0))return this.modules.filter.getFilters(t)},h.prototype.setHeaderFilterFocus=function(t){if(this.modExists("filter",!0)){var e=this.columnManager.findColumn(t);if(!e)return console.warn("Column Filter Focus Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterFocus(e)}},h.prototype.setHeaderFilterValue=function(t,e){if(this.modExists("filter",!0)){var n=this.columnManager.findColumn(t);if(!n)return console.warn("Column Filter Error - No matching column found:",t),!1;this.modules.filter.setHeaderFilterValue(n,e)}},h.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()},h.prototype.removeFilter=function(t,e,n){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(t,e,n),this.rowManager.filterRefresh())},h.prototype.clearFilter=function(t){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(t),this.rowManager.filterRefresh())},h.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())},h.prototype.selectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.selectRows(t)},h.prototype.deselectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(t)},h.prototype.toggleSelectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(t)},h.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()},h.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()},h.prototype.setMaxPage=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setMaxPage(t)},h.prototype.setPage=function(t){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(t):new Promise(function(t,e){e()})},h.prototype.setPageToRow=function(t){var e=this;return new Promise(function(n,i){e.options.pagination&&e.modExists("page")&&(t=e.rowManager.findRow(t))?e.modules.page.setPageToRow(t).then(function(){n()}).catch(function(){i()}):i()})},h.prototype.setPageSize=function(t){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.setPageSize(t),this.modules.page.setPage(1).then(function(){}).catch(function(){})},h.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()},h.prototype.previousPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.previousPage()},h.prototype.nextPage=function(){if(!this.options.pagination||!this.modExists("page"))return!1;this.modules.page.nextPage()},h.prototype.getPage=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPage()},h.prototype.getPageMax=function(){return!(!this.options.pagination||!this.modExists("page"))&&this.modules.page.getPageMax()},h.prototype.setGroupBy=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupBy=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display")},h.prototype.setGroupStartOpen=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupStartOpen=t,this.modules.groupRows.initialize(),this.options.groupBy?this.rowManager.refreshActiveData("group"):console.warn("Grouping Update - cant refresh view, no groups have been set")},h.prototype.setGroupHeader=function(t){if(!this.modExists("groupRows",!0))return!1;this.options.groupHeader=t,this.modules.groupRows.initialize(),this.options.groupBy?this.rowManager.refreshActiveData("group"):console.warn("Grouping Update - cant refresh view, no groups have been set")},h.prototype.getGroups=function(t){return!!this.modExists("groupRows",!0)&&this.modules.groupRows.getGroups(!0)},h.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()},h.prototype.getCalcResults=function(){return!!this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.getResults()},h.prototype.navigatePrev=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().prev()},h.prototype.navigateNext=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&t.nav().next()},h.prototype.navigateLeft=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().left())},h.prototype.navigateRight=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().right())},h.prototype.navigateUp=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().up())},h.prototype.navigateDown=function(){var t=!1;return!(!this.modExists("edit",!0)||!(t=this.modules.edit.currentCell))&&(e.preventDefault(),t.nav().dpwn())},h.prototype.undo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.undo()},h.prototype.redo=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.redo()},h.prototype.getHistoryUndoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryUndoSize()},h.prototype.getHistoryRedoSize=function(){return!(!this.options.history||!this.modExists("history",!0))&&this.modules.history.getHistoryRedoSize()},h.prototype.download=function(t,e,n){this.modExists("download",!0)&&this.modules.download.download(t,e,n)},h.prototype.downloadToTab=function(t,e,n){this.modExists("download",!0)&&this.modules.download.download(t,e,n,!0)},h.prototype.tableComms=function(t,e,n,i){this.modules.comms.receive(t,e,n,i)},h.prototype.moduleBindings={},h.prototype.extendModule=function(t,e,n){if(h.prototype.moduleBindings[t]){var i=h.prototype.moduleBindings[t].prototype[e];if(i)if("object"==(void 0===n?"undefined":a(n)))for(var o in n)i[o]=n[o];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",e)}else console.warn("Module Error - module does not exist:",t)},h.prototype.registerModule=function(t,e){h.prototype.moduleBindings[t]=e},h.prototype.bindModules=function(){for(var t in this.modules={},h.prototype.moduleBindings)this.modules[t]=new h.prototype.moduleBindings[t](this)},h.prototype.modExists=function(t,e){return!!this.modules[t]||(e&&console.error("Tabulator Module Not Installed: "+t),!1)},h.prototype.helpers={elVisible:function(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)},elOffset:function(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(t){var e=Array.isArray(t)?[]:{};for(var n in t)null!=t[n]&&"object"===a(t[n])?t[n]instanceof Date?e[n]=new Date(t[n]):e[n]=this.deepClone(t[n]):e[n]=t[n];return e}},h.prototype.comms={tables:[],register:function(t){h.prototype.comms.tables.push(t)},deregister:function(t){var e=h.prototype.comms.tables.indexOf(t);e>-1&&h.prototype.comms.tables.splice(e,1)},lookupTable:function(t){var e,n,i=[];if("string"==typeof t){if((e=document.querySelectorAll(t)).length)for(var o=0;o<e.length;o++)(n=h.prototype.comms.matchElement(e[o]))&&i.push(n)}else t instanceof HTMLElement||t instanceof h?(n=h.prototype.comms.matchElement(t))&&i.push(n):Array.isArray(t)?t.forEach(function(t){i=i.concat(h.prototype.comms.lookupTable(t))}):console.warn("Table Connection Error - Invalid Selector",t);return i},matchElement:function(t){return h.prototype.comms.tables.find(function(e){return t instanceof h?e===t:e.element===t})}};var d=function(t){this.table=t,this.mode=null};d.prototype.initialize=function(t){this.modes[t]?this.mode=t:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+t),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)},d.prototype.getMode=function(){return this.mode},d.prototype.layout=function(){this.modes[this.mode].call(this,this.table.columnManager.columnsByIndex)},d.prototype.modes={fitData:function(t){t.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:function(t){t.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(t){var e,n,i=this.table.element.clientWidth,o=0,r=0,a=0,s=[],l=[],u=0,c=0;function h(t){return"string"==typeof t?t.indexOf("%")>-1?i/100*parseInt(t):parseInt(t):t}function d(t,e,n,i){var o=[],r=0,a=0,s=0,l=0,u=0,c=[];function f(t){return n*(t.column.definition.widthGrow||1)}function p(t){return h(t.width)-n*(t.column.definition.widthShrink||0)}return t.forEach(function(t,e){var n=i?p(t):f(t);t.column.minWidth>=n?o.push(t):(c.push(t),u+=i?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1)}),o.length?(o.forEach(function(t){r+=i?t.width-t.column.minWidth:t.column.minWidth,t.width=t.column.minWidth}),l=(a=e-r)-(s=u?Math.floor(a/u):a)*u,l+=d(c,a,s,i)):(l=u?e-Math.floor(e/u)*u:e,c.forEach(function(t){t.width=i?p(t):f(t)})),l}this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(i-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),t.forEach(function(t){var e,n,i;t.visible&&(e=t.definition.width,n=parseInt(t.minWidth),e?(i=h(e),o+=i>n?i:n,t.definition.widthShrink&&(l.push({column:t,width:i>n?i:n}),u+=t.definition.widthShrink)):(s.push({column:t,width:0}),a+=t.definition.widthGrow||1))}),r=i-o,e=Math.floor(r/a);c=d(s,r,e,!1);s.length&&c>0&&(s[s.length-1].width+=+c),s.forEach(function(t){r-=t.width}),(n=Math.abs(c)+r)>0&&u&&(c=d(l,n,Math.floor(n/u),!0)),l.length&&(l[l.length-1].width-=c),s.forEach(function(t){t.column.setWidth(t.width)}),l.forEach(function(t){t.column.setWidth(t.width)})}},h.prototype.registerModule("layout",d);var f=function(t){this.table=t,this.locale="default",this.lang=!1,this.bindings={}};f.prototype.setHeaderFilterPlaceholder=function(t){this.langs.default.headerFilters.default=t},f.prototype.setHeaderFilterColumnPlaceholder=function(t,e){this.langs.default.headerFilters.columns[t]=e,this.lang&&!this.lang.headerFilters.columns[t]&&(this.lang.headerFilters.columns[t]=e)},f.prototype.installLang=function(t,e){this.langs[t]?this._setLangProp(this.langs[t],e):this.langs[t]=e},f.prototype._setLangProp=function(t,e){for(var n in e)t[n]&&"object"==a(t[n])?this._setLangProp(t[n],e[n]):t[n]=e[n]},f.prototype.setLocale=function(t){if(!0===(t=t||"default")&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!this.langs[t]){var e=t.split("-")[0];this.langs[e]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,e),t=e):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}this.locale=t,this.lang=h.prototype.helpers.deepClone(this.langs.default||{}),"default"!=t&&function t(e,n){for(var i in e)"object"==a(e[i])?(n[i]||(n[i]={}),t(e[i],n[i])):n[i]=e[i]}(this.langs[t],this.lang),this.table.options.localized.call(this.table,this.locale,this.lang),this._executeBindings()},f.prototype.getLocale=function(t){return self.locale},f.prototype.getLang=function(t){return t?this.langs[t]:this.lang},f.prototype.getText=function(t,e){var n=(t=e?t+"|"+e:t).split("|");return this._getLangElement(n,this.locale)||""},f.prototype._getLangElement=function(t,e){var n=this.lang;return t.forEach(function(t){var e;n&&(e=n[t],n=void 0!==e&&e)}),n},f.prototype.bind=function(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)},f.prototype._executeBindings=function(){var t=this,e=function(e){t.bindings[e].forEach(function(n){n(t.getText(e),t.lang)})};for(var n in t.bindings)e(n)},f.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page"},headerFilters:{default:"filter column...",columns:{}}}},h.prototype.registerModule("localize",f);var p=function(t){this.table=t};p.prototype.getConnections=function(t){var e=this,n=[];return h.prototype.comms.lookupTable(t).forEach(function(t){e.table!==t&&n.push(t)}),n},p.prototype.send=function(t,e,n,i){var o=this,r=this.getConnections(t);r.forEach(function(t){t.tableComms(o.table.element,e,n,i)}),!r.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)},p.prototype.receive=function(t,e,n,i){if(this.table.modExists(e))return this.table.modules[e].commsReceived(t,n,i);console.warn("Inter-table Comms Error - no such module:",e)},h.prototype.registerModule("comms",p);var g=function(t){this.table=t,this.allowedTypes=["","data","download","clipboard"]};g.prototype.initializeColumn=function(t){var e=this,n=!1,i={};this.allowedTypes.forEach(function(o){var r,a="accessor"+(o.charAt(0).toUpperCase()+o.slice(1));t.definition[a]&&(r=e.lookupAccessor(t.definition[a]))&&(n=!0,i[a]={accessor:r,params:t.definition[a+"Params"]||{}})}),n&&(t.modules.accessor=i)},g.prototype.lookupAccessor=function(t){var e=!1;switch(void 0===t?"undefined":a(t)){case"string":this.accessors[t]?e=this.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":e=t}return e},g.prototype.transformRow=function(t,e){var n="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),i=h.prototype.helpers.deepClone(t||{});return this.table.columnManager.traverse(function(t){var o,r,a,s;t.modules.accessor&&(r=t.modules.accessor[n]||t.modules.accessor.accessor||!1)&&"undefined"!=(o=t.getFieldValue(i))&&(s=t.getComponent(),a="function"==typeof r.params?r.params(o,i,e,s):r.params,t.setFieldValue(i,r.accessor(o,i,e,a,s)))}),i},g.prototype.accessors={},h.prototype.registerModule("accessor",g);var m=function(t){this.table=t,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};m.prototype.initialize=function(){var t;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&("string"==typeof this.table.options.ajaxLoaderLoading?((t=document.createElement("template")).innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=t.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&(this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},m.prototype.createLoaderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader"),t},m.prototype.createMsgElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader-msg"),t.setAttribute("role","alert"),t},m.prototype.setParams=function(t,e){if(e)for(var n in this.params=this.params||{},t)this.params[n]=t[n];else this.params=t},m.prototype.getParams=function(){return this.params||{}},m.prototype.setConfig=function(t){if(this._loadDefaultConfig(),"string"==typeof t)this.config.method=t;else for(var e in t)this.config[e]=t[e]},m.prototype._loadDefaultConfig=function(t){if(!this.config||t)for(var e in this.config={},this.defaultConfig)this.config[e]=this.defaultConfig[e]},m.prototype.setUrl=function(t){this.url=t},m.prototype.getUrl=function(){return this.url},m.prototype.loadData=function(t){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(t)},m.prototype.nextPage=function(t){this.loading||t<(this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight)&&this.table.modules.page.nextPage().then(function(){}).catch(function(){})},m.prototype.blockActiveRequest=function(){this.requestOrder++},m.prototype._loadDataProgressive=function(){return this.table.rowManager.setData([]),this.table.modules.page.setPage(1)},m.prototype._loadDataStandard=function(t){var e=this;return new Promise(function(n,i){e.sendRequest(t).then(function(o){e.table.rowManager.setData(o,t).then(function(){n()}).catch(function(t){i(t)})}).catch(function(t){i(t)})})},m.prototype.generateParamsList=function(t,e){var n=this,i=[];if(e=e||"",Array.isArray(t))t.forEach(function(t,o){i=i.concat(n.generateParamsList(t,e?e+"["+o+"]":o))});else if("object"===(void 0===t?"undefined":a(t)))for(var o in t)i=i.concat(n.generateParamsList(t[o],e?e+"["+o+"]":o));else i.push({key:e,value:t});return i},m.prototype.serializeParams=function(t){var e=[];return this.generateParamsList(t).forEach(function(t){e.push(encodeURIComponent(t.key)+"="+encodeURIComponent(t.value))}),e.join("&")},m.prototype.sendRequest=function(t){var e,n=this,i=this,o=i.url;return i.requestOrder++,e=i.requestOrder,i._loadDefaultConfig(),new Promise(function(r,a){!1!==i.table.options.ajaxRequesting.call(n.table,i.url,i.params)?(i.loading=!0,t||i.showLoader(),n.loaderPromise(o,i.config,i.params).then(function(t){e===i.requestOrder?(i.table.options.ajaxResponse&&(t=i.table.options.ajaxResponse.call(i.table,i.url,i.params,t)),r(t)):console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made"),i.hideLoader(),i.loading=!1}).catch(function(t){console.error("Ajax Load Error: ",t),i.table.options.ajaxError.call(i.table,t),i.showError(),setTimeout(function(){i.hideLoader()},3e3),i.loading=!1,a()})):a()})},m.prototype.showLoader=function(){if("function"==typeof this.table.options.ajaxLoader?this.table.options.ajaxLoader():this.table.options.ajaxLoader){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-error"),this.msgElement.classList.add("tabulator-loading"),this.loadingElement?this.msgElement.appendChild(this.loadingElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|loading"),this.table.element.appendChild(this.loaderElement)}},m.prototype.showError=function(){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-loading"),this.msgElement.classList.add("tabulator-error"),this.errorElement?this.msgElement.appendChild(this.errorElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|error"),this.table.element.appendChild(this.loaderElement)},m.prototype.hideLoader=function(){this.loaderElement.parentNode&&this.loaderElement.parentNode.removeChild(this.loaderElement)},m.prototype.defaultConfig={method:"GET"},m.prototype.defaultURLGenerator=function(t,e,n){return t&&n&&Object.keys(n).length&&(e.method&&"get"!=e.method.toLowerCase()||(e.method="get",t+="?"+this.serializeParams(n))),t},m.prototype.defaultLoaderPromise=function(t,e,n){var i,o=this;return new Promise(function(r,s){if(t=o.urlGenerator(t,e,n),"GET"!=e.method.toUpperCase())if(i="object"===a(o.table.options.ajaxContentType)?o.table.options.ajaxContentType:o.contentTypeFormatters[o.table.options.ajaxContentType]){for(var l in i.headers)e.headers||(e.headers={}),void 0===e.headers[l]&&(e.headers[l]=i.headers[l]);e.body=i.body.call(o,t,e,n)}else console.warn("Ajax Error - Invalid ajaxContentType value:",o.table.options.ajaxContentType);t?(void 0===e.headers&&(e.headers={}),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),void 0===e.headers["X-Requested-With"]&&(e.headers["X-Requested-With"]="XMLHttpRequest"),void 0===e.mode&&(e.mode="cors"),"cors"==e.mode?(void 0===e.headers["Access-Control-Allow-Origin"]&&(e.headers["Access-Control-Allow-Origin"]=window.location.origin),void 0===e.credentials&&(e.credentials="same-origin")):void 0===e.credentials&&(e.credentials="include"),fetch(t,e).then(function(t){t.ok?t.json().then(function(t){r(t)}).catch(function(t){s(t),console.warn("Ajax Load Error - Invalid JSON returned",t)}):(console.error("Ajax Load Error - Connection Error: "+t.status,t.statusText),s(t))}).catch(function(t){console.error("Ajax Load Error - Connection Error: ",t),s(t)})):(console.warn("Ajax Load Error - No URL Set"),r([]))})},m.prototype.contentTypeFormatters={json:{headers:{"Content-Type":"application/json"},body:function(t,e,n){return JSON.stringify(n)}},form:{headers:{},body:function(t,e,n){var i=this.generateParamsList(n),o=new FormData;return i.forEach(function(t){o.append(t.key,t.value)}),o}}},h.prototype.registerModule("ajax",m);var v=function(t){this.table=t,this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.initialize()};v.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t},v.prototype.initialize=function(){this.genColumn=new i({field:"value"},this)},v.prototype.registerColumnField=function(){},v.prototype.initializeColumn=function(t){var e=t.definition,n={topCalcParams:e.topCalcParams||{},botCalcParams:e.bottomCalcParams||{}};if(e.topCalc){switch(a(e.topCalc)){case"string":this.calculations[e.topCalc]?n.topCalc=this.calculations[e.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.topCalc);break;case"function":n.topCalc=e.topCalc}n.topCalc&&(t.modules.columnCalcs=n,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(e.bottomCalc){switch(a(e.bottomCalc)){case"string":this.calculations[e.bottomCalc]?n.botCalc=this.calculations[e.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.bottomCalc);break;case"function":n.botCalc=e.bottomCalc}n.botCalc&&(t.modules.columnCalcs=n,this.botCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}},v.prototype.removeCalcs=function(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()},v.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)},v.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)},v.prototype.scrollHorizontal=function(t){this.table.columnManager.getElement().scrollWidth,this.table.element.clientWidth;this.botInitialized&&(this.botRow.getElement().style.marginLeft=-t+"px")},v.prototype.recalc=function(t){var e;if(this.topInitialized||this.botInitialized){if(this.rowsToData(t),this.topInitialized){for(e=this.generateRow("top",this.rowsToData(t)),this.topRow=e;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(e.getElement()),e.initialize(!0)}if(this.botInitialized){for(e=this.generateRow("bottom",this.rowsToData(t)),this.botRow=e;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(e.getElement()),e.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}},v.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))},v.prototype.recalcGroup=function(t){var e,n;t&&t.calcs&&(t.calcs.bottom&&(e=this.rowsToData(t.rows),n=this.generateRowData("bottom",e),t.calcs.bottom.updateData(n),t.calcs.bottom.reinitialize()),t.calcs.top&&(e=this.rowsToData(t.rows),n=this.generateRowData("top",e),t.calcs.top.updateData(n),t.calcs.top.reinitialize()))},v.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))},v.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))},v.prototype.rowsToData=function(t){var e=[];return t.forEach(function(t){e.push(t.getData())}),e},v.prototype.generateRow=function(t,e){var n,i=this,o=this.generateRowData(t,e);return i.table.modExists("mutator")&&i.table.modules.mutator.disable(),n=new s(o,this),i.table.modExists("mutator")&&i.table.modules.mutator.enable(),n.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),n.type="calc",n.generateCells=function(){var e=[];i.table.columnManager.columnsByIndex.forEach(function(o){if(o.visible){i.genColumn.setField(o.getField()),i.genColumn.hozAlign=o.hozAlign,o.definition[t+"CalcFormatter"]&&i.table.modExists("format")?i.genColumn.modules.format={formatter:i.table.modules.format.getFormatter(o.definition[t+"CalcFormatter"]),params:o.definition[t+"CalcFormatterParams"]}:i.genColumn.modules.format={formatter:i.table.modules.format.getFormatter("plaintext"),params:{}},i.genColumn.definition.cssClass=o.definition.cssClass;var r=new u(i.genColumn,n);r.column=o,r.setWidth(),o.cells.push(r),e.push(r)}}),this.cells=e},n},v.prototype.generateRowData=function(t,e){var n,i,o={},r="top"==t?this.topCalcs:this.botCalcs,a="top"==t?"topCalc":"botCalc";return r.forEach(function(t){var r=[];t.modules.columnCalcs&&t.modules.columnCalcs[a]&&(e.forEach(function(e){r.push(t.getFieldValue(e))}),i=a+"Params",n="function"==typeof t.modules.columnCalcs[i]?t.modules.columnCalcs[i](value,e):t.modules.columnCalcs[i],t.setFieldValue(o,t.modules.columnCalcs[a](r,e,n)))}),o},v.prototype.hasTopCalcs=function(){return!!this.topCalcs.length},v.prototype.hasBottomCalcs=function(){return!!this.botCalcs.length},v.prototype.redraw=function(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)},v.prototype.getResults=function(){var t=this,e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach(function(n){e[n.getKey()]=t.getGroupResults(n)}):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e},v.prototype.getGroupResults=function(t){var e=this,n=t._getSelf(),i={};return t.getSubGroups().forEach(function(t){i[t.getKey()]=e.getGroupResults(t)}),{top:n.calcs.top?n.calcs.top.getData():{},bottom:n.calcs.bottom?n.calcs.bottom.getData():{},groups:i}},v.prototype.calculations={avg:function(t,e,n){var i=0,o=void 0!==n.precision?n.precision:2;return t.length&&(i=t.reduce(function(t,e){return t+(e=Number(e))}),i/=t.length,i=!1!==o?i.toFixed(o):i),parseFloat(i).toString()},max:function(t,e,n){var i=null,o=void 0!==n.precision&&n.precision;return t.forEach(function(t){((t=Number(t))>i||null===i)&&(i=t)}),null!==i?!1!==o?i.toFixed(o):i:""},min:function(t,e,n){var i=null,o=void 0!==n.precision&&n.precision;return t.forEach(function(t){((t=Number(t))<i||null===i)&&(i=t)}),null!==i?!1!==o?i.toFixed(o):i:""},sum:function(t,e,n){var i=0,o=void 0!==n.precision&&n.precision;return t.length&&t.forEach(function(t){t=Number(t),i+=isNaN(t)?0:Number(t)}),!1!==o?i.toFixed(o):i},concat:function(t,e,n){var i=0;return t.length&&(i=t.reduce(function(t,e){return String(t)+String(e)})),i},count:function(t,e,n){var i=0;return t.length&&t.forEach(function(t){t&&i++}),i}},h.prototype.registerModule("columnCalcs",v);var y=function(t){this.table=t,this.mode=!0,this.copySelector=!1,this.copySelectorParams={},this.copyFormatter=!1,this.copyFormatterParams={},this.pasteParser=function(){},this.pasteAction=function(){},this.htmlElement=!1,this.config={},this.blocked=!0};y.prototype.initialize=function(){var t=this;this.mode=this.table.options.clipboard,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",function(e){var n;t.processConfig(),t.blocked||(e.preventDefault(),n=t.generateContent(),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",n):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",n),t.htmlElement&&e.clipboardData.setData("text/html",t.htmlElement.outerHTML)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",n),t.htmlElement&&e.originalEvent.clipboardData.setData("text/html",t.htmlElement.outerHTML)),t.table.options.clipboardCopied.call(this.table,n),t.reset())}),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",function(e){t.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction)},y.prototype.processConfig=function(){var t={columnHeaders:"groups",rowGroups:!0,columnCalcs:!0};if(void 0!==this.table.options.clipboardCopyHeader&&(t.columnHeaders=this.table.options.clipboardCopyHeader,console.warn("DEPRECATION WANRING - clipboardCopyHeader option has been depricated, please use the columnHeaders property on the clipboardCopyConfig option")),this.table.options.clipboardCopyConfig)for(var e in this.table.options.clipboardCopyConfig)t[e]=this.table.options.clipboardCopyConfig[e];t.rowGroups&&this.table.options.groupBy&&this.table.modExists("groupRows")&&(this.config.rowGroups=!0),t.columnHeaders?"groups"!==t.columnHeaders&&!0!==t||this.table.columnManager.columns.length==this.table.columnManager.columnsByIndex.length?this.config.columnHeaders="columns":this.config.columnHeaders="groups":this.config.columnHeaders=!1,t.columnCalcs&&this.table.modExists("columnCalcs")&&(this.config.columnCalcs=!0)},y.prototype.reset=function(){this.blocked=!1,this.originalSelectionText=""},y.prototype.setPasteAction=function(t){switch(void 0===t?"undefined":a(t)){case"string":this.pasteAction=this.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}},y.prototype.setPasteParser=function(t){switch(void 0===t?"undefined":a(t)){case"string":this.pasteParser=this.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}},y.prototype.paste=function(t){var e,n,i;this.checkPaseOrigin(t)&&(e=this.getPasteData(t),(n=this.pasteParser.call(this,e))?(t.preventDefault(),this.table.modExists("mutator")&&(n=this.mutateData(n)),i=this.pasteAction.call(this,n),this.table.options.clipboardPasted.call(this.table,e,n,i)):this.table.options.clipboardPasteError.call(this.table,e))},y.prototype.mutateData=function(t){var e=this,n=[];return Array.isArray(t)?t.forEach(function(t){n.push(e.table.modules.mutator.transformRow(t,"clipboard"))}):n=t,n},y.prototype.checkPaseOrigin=function(t){var e=!0;return("DIV"!=t.target.tagName||this.table.modules.edit.currentCell)&&(e=!1),e},y.prototype.getPasteData=function(t){var e;return window.clipboardData&&window.clipboardData.getData?e=window.clipboardData.getData("Text"):t.clipboardData&&t.clipboardData.getData?e=t.clipboardData.getData("text/plain"):t.originalEvent&&t.originalEvent.clipboardData.getData&&(e=t.originalEvent.clipboardData.getData("text/plain")),e},y.prototype.copy=function(t,e,n,i,o){var r,a;this.blocked=!1,!0!==this.mode&&"copy"!==this.mode||(void 0!==window.getSelection&&void 0!==document.createRange?((r=document.createRange()).selectNodeContents(this.table.element),(a=window.getSelection()).toString()&&o&&(t="userSelection",n="raw",e=a.toString()),a.removeAllRanges(),a.addRange(r)):void 0!==document.selection&&void 0!==document.body.createTextRange&&(textRange=document.body.createTextRange(),textRange.moveToElementText(this.table.element),textRange.select()),this.setSelector(t),this.copySelectorParams=void 0!==e&&null!=e?e:this.config.columnHeaders,this.setFormatter(n),this.copyFormatterParams=void 0!==i&&null!=i?i:{},document.execCommand("copy"),a&&a.removeAllRanges())},y.prototype.setSelector=function(t){switch(void 0===(t=t||this.table.options.clipboardCopySelector)?"undefined":a(t)){case"string":this.copySelectors[t]?this.copySelector=this.copySelectors[t]:console.warn("Clipboard Error - No such selector found:",t);break;case"function":this.copySelector=t}},y.prototype.setFormatter=function(t){switch(void 0===(t=t||this.table.options.clipboardCopyFormatter)?"undefined":a(t)){case"string":this.copyFormatters[t]?this.copyFormatter=this.copyFormatters[t]:console.warn("Clipboard Error - No such formatter found:",t);break;case"function":this.copyFormatter=t}},y.prototype.generateContent=function(){var t;return this.htmlElement=!1,t=this.copySelector.call(this,this.config,this.copySelectorParams),this.copyFormatter.call(this,t,this.config,this.copyFormatterParams)},y.prototype.generateSimpleHeaders=function(t){var e=[];return t.forEach(function(t){e.push(t.definition.title)}),e},y.prototype.generateColumnGroupHeaders=function(t){var e=this,n=[];return this.table.columnManager.columns.forEach(function(t){var i=e.processColumnGroup(t);i&&n.push(i)}),n},y.prototype.processColumnGroup=function(t){var e=this,n=t.columns,i={type:"group",title:t.definition.title,column:t};if(n.length){if(i.subGroups=[],i.width=0,n.forEach(function(t){var n=e.processColumnGroup(t);n&&(i.width+=n.width,i.subGroups.push(n))}),!i.width)return!1}else{if(!t.field||!t.visible)return!1;i.width=1}return i},y.prototype.groupHeadersToRows=function(t){var e=[];function n(t,i){void 0===e[i]&&(e[i]=[]),e[i].push(t.title),t.subGroups?t.subGroups.forEach(function(t){n(t,i+1)}):function(){var t=0;e.forEach(function(e){var n=e.length;n>t&&(t=n)}),e.forEach(function(e){var n=e.length;if(n<t)for(var i=n;i<t;i++)e.push("")})}()}return t.forEach(function(t){n(t,0)}),e},y.prototype.rowsToData=function(t,e,n){var i=this.table.columnManager.columnsByIndex,o=[];return t.forEach(function(t){var e=[],n=t instanceof r?t.getData("clipboard"):t;i.forEach(function(t){var i=t.getFieldValue(n);switch(void 0===i?"undefined":a(i)){case"object":i=JSON.stringify(i);break;case"undefined":case"null":i="";break;default:i=i}e.push(i)}),o.push(e)}),o},y.prototype.buildComplexRows=function(t){var e=this,n=[];return this.table.modules.groupRows.getGroups().forEach(function(t){n.push(e.processGroupData(t))}),n},y.prototype.processGroupData=function(t){var e=this,n=t.getSubGroups(),i={type:"group",key:t.key};return n.length?(i.subGroups=[],n.forEach(function(t){i.subGroups.push(e.processGroupData(t))})):i.rows=t.getRows(!0),i},y.prototype.getCalcRow=function(t,e,n){var i=t[e];return i&&(n&&(i=i[n]),Object.keys(i).length)?this.rowsToData([i]):[]},y.prototype.buildOutput=function(t,e,n){var i,o=this,r=[],a=this.table.columnManager.columnsByIndex;return e.columnHeaders&&("groups"==e.columnHeaders?(a=this.generateColumnGroupHeaders(this.table.columnManager.columns),r=r.concat(this.groupHeadersToRows(a))):r.push(this.generateSimpleHeaders(a))),this.config.columnCalcs&&(i=this.table.getCalcResults()),this.table.options.clipboardCopyStyled&&this.generateHTML(t,a,i,e,n),e.rowGroups?t.forEach(function(t){r=r.concat(o.parseRowGroupData(t,e,n,i||{}))}):(e.columnCalcs&&(r=r.concat(this.getCalcRow(i,"top"))),r=r.concat(this.rowsToData(t,e,n)),e.columnCalcs&&(r=r.concat(this.getCalcRow(i,"bottom")))),r},y.prototype.parseRowGroupData=function(t,e,n,i){var o=this,r=[];return r.push([t.key]),t.subGroups?t.subGroups.forEach(function(a){r=r.concat(o.parseRowGroupData(a,e,n,i[t.key]&&i[t.key].groups||{}))}):(e.columnCalcs&&(r=r.concat(this.getCalcRow(i,t.key,"top"))),r=r.concat(this.rowsToData(t.rows,e,n)),e.columnCalcs&&(r=r.concat(this.getCalcRow(i,t.key,"bottom")))),r},y.prototype.generateHTML=function(t,e,n,i,o){var s,l,u,c,h,d,f,p,g=this,m=[];function v(t,e,n){var i=t[e];i&&(n&&(i=i[n]),Object.keys(i).length&&y([i]))}function y(t){t.forEach(function(t,n){var i,o=document.createElement("tr"),f=h,p=!1;t instanceof r?i=t.getData("clipboard"):(i=t,p=!0),e.forEach(function(t,n){var r=document.createElement("td"),s=t.getFieldValue(i);switch(void 0===s?"undefined":a(s)){case"object":s=JSON.stringify(s);break;case"undefined":case"null":s="";break;default:s=s}r.innerHTML=s,t.definition.align&&(r.style.textAlign=t.definition.align),e.length,d&&g.mapElementStyles(d,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),o.appendChild(r)}),p?f=c:(n%2||!l||(f=l),n%2&&u&&(f=u)),f&&g.mapElementStyles(f,o,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(o)})}this.htmlElement=document.createElement("table"),g.mapElementStyles(this.table.element,this.htmlElement,["border-top","border-left","border-right","border-bottom"]),i.columnHeaders&&("groups"==i.columnHeaders?(e.forEach(function(t){!function t(e,n){void 0===m[n]&&(m[n]=[]),m[n].push({title:e.title,width:e.width,height:1,children:!!e.subGroups,element:e.column.getElement()}),e.subGroups&&e.subGroups.forEach(function(e){t(e,n+1)})}(t,0)}),m.forEach(function(t,e){t.forEach(function(t){t.children||(t.height=m.length-e)})}),function(t){var e=document.createElement("thead");t.forEach(function(t){var n=document.createElement("tr");t.forEach(function(t){var e=document.createElement("th");t.width>1&&(e.colSpan=t.width),t.height>1&&(e.rowSpan=t.height),e.innerHTML=t.title,g.mapElementStyles(t.element,e,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),n.appendChild(e)}),g.mapElementStyles(g.table.columnManager.getHeadersElement(),n,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.appendChild(n)}),g.htmlElement.appendChild(e)}(m)):function(){var t=document.createElement("tr");e.forEach(function(e){var n=document.createElement("th");n.innerHTML=e.definition.title,g.mapElementStyles(e.getElement(),n,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.appendChild(n)}),g.mapElementStyles(g.table.columnManager.getHeadersElement(),t,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),g.htmlElement.appendChild(document.createElement("thead").appendChild(t))}()),e=this.table.columnManager.columnsByIndex,s=document.createElement("tbody"),window.getComputedStyle&&(l=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),u=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),c=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),h=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),f=this.table.element.getElementsByClassName("tabulator-group")[0],h&&(p=h.getElementsByClassName("tabulator-cell"),d=p[0],p[p.length-1])),i.rowGroups?t.forEach(function(t){!function t(n,o){var r=document.createElement("tr"),a=document.createElement("td");a.colSpan=e.length,a.innerHTML=n.key,r.appendChild(a),s.appendChild(r),g.mapElementStyles(f,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n.subGroups?n.subGroups.forEach(function(e){t(e,o[n.key]&&o[n.key].groups||{})}):(i.columnCalcs&&v(o,n.key,"top"),y(n.rows),i.columnCalcs&&v(o,n.key,"bottom"))}(t,n||{})}):(i.columnCalcs&&v(n,"top"),y(t),i.columnCalcs&&v(n,"bottom")),this.htmlElement.appendChild(s)},y.prototype.mapElementStyles=function(t,e,n){var i={"background-color":"backgroundColor",color:"fontColor","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(t);n.forEach(function(t){e.style[i[t]]=o.getPropertyValue(t)})}},y.prototype.copySelectors={userSelection:function(t,e){return e},selected:function(t,e){var n=[];return this.table.modExists("selectRow",!0)&&(n=this.table.modules.selectRow.getSelectedRows()),t.rowGroups&&console.warn("Clipboard Warning - select coptSelector does not support row groups"),this.buildOutput(n,t,e)},table:function(t,e){return t.rowGroups&&console.warn("Clipboard Warning - table coptSelector does not support row groups"),this.buildOutput(this.table.rowManager.getComponents(),t,e)},active:function(t,e){var n;return n=t.rowGroups?this.buildComplexRows(t):this.table.rowManager.getComponents(!0),this.buildOutput(n,t,e)}},y.prototype.copyFormatters={raw:function(t,e){return t},table:function(t,e){var n=[];return t.forEach(function(t){t.forEach(function(t){void 0===t&&(t=""),(t=void 0===t||null===t?"":t.toString()).match(/\r|\n/)&&(t='"'+(t=t.split('"').join('""'))+'"')}),n.push(t.join("\t"))}),n.join("\n")}},y.prototype.pasteParsers={table:function(t){var e=[],n=!0,i=this.table.columnManager.columns,o=[],r=[];return(t=t.split("\n")).forEach(function(t){e.push(t.split("\t"))}),!(!e.length||1===e.length&&e[0].length<2)&&(!0,e[0].forEach(function(t){var e=i.find(function(e){return t&&e.definition.title&&t.trim()&&e.definition.title.trim()===t.trim()});e?o.push(e):n=!1}),n||(n=!0,o=[],e[0].forEach(function(t){var e=i.find(function(e){return t&&e.field&&t.trim()&&e.field.trim()===t.trim()});e?o.push(e):n=!1}),n||(o=this.table.columnManager.columnsByIndex)),n&&e.shift(),e.forEach(function(t){var e={};t.forEach(function(t,n){o[n]&&(e[o[n].field]=t)}),r.push(e)}),r)}},y.prototype.pasteActions={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)}},h.prototype.registerModule("clipboard",y);var b=function(t){this.table=t,this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.displayIndex=0};b.prototype.initialize=function(){var t=null,e=this.table.columnManager.getFirstVisibileColumn(),n=this.table.options;switch(this.field=n.dataTreeChildField,this.indent=n.dataTreeChildIndent,this.elementField=n.dataTreeElementColumn||!!e&&e.field,n.dataTreeBranchElement&&(!0===n.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof n.dataTreeBranchElement?((t=document.createElement("div")).innerHTML=n.dataTreeBranchElement,this.branchEl=t.firstChild):this.branchEl=n.dataTreeBranchElement),n.dataTreeCollapseElement?"string"==typeof n.dataTreeCollapseElement?((t=document.createElement("div")).innerHTML=n.dataTreeCollapseElement,this.collapseEl=t.firstChild):this.collapseEl=n.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),n.dataTreeExpandElement?"string"==typeof n.dataTreeExpandElement?((t=document.createElement("div")).innerHTML=n.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=n.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),a(n.dataTreeStartExpanded)){case"boolean":this.startOpen=function(t,e){return n.dataTreeStartExpanded};break;case"function":this.startOpen=n.dataTreeStartExpanded;break;default:this.startOpen=function(t,e){return n.dataTreeStartExpanded[e]}}},b.prototype.initializeRow=function(t){var e=t.getData()[this.field],n=Array.isArray(e),i=n||!n&&"object"===(void 0===e?"undefined":a(e))&&null!==e;t.modules.dataTree={index:0,open:!!i&&this.startOpen(t.getComponent(),0),controlEl:!1,branchEl:!1,parent:!1,children:i}},b.prototype.layoutRow=function(t){var e=(this.elementField?t.getCell(this.elementField):t.getCells()[0]).getElement(),n=t.modules.dataTree;n.branchEl&&n.branchEl.parentNode.removeChild(n.branchEl),this.generateControlElement(t,e),n.index&&(this.branchEl?(n.branchEl=this.branchEl.cloneNode(!0),e.insertBefore(n.branchEl,e.firstChild),n.branchEl.style.marginLeft=(n.branchEl.offsetWidth+n.branchEl.style.marginRight)*(n.index-1)+n.index*this.indent+"px"):e.style.paddingLeft=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-left"))+n.index*this.indent+"px")},b.prototype.generateControlElement=function(t,e){var n=this,i=t.modules.dataTree,o=(e=e||t.getCells()[0].getElement(),i.controlEl);!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",function(e){e.stopPropagation(),n.collapseRow(t)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",function(e){e.stopPropagation(),n.expandRow(t)})),i.controlEl.addEventListener("mousedown",function(t){t.stopPropagation()}),o&&o.parentNode===e?o.parentNode.replaceChild(i.controlEl,o):e.insertBefore(i.controlEl,e.firstChild))},b.prototype.setDisplayIndex=function(t){this.displayIndex=t},b.prototype.getDisplayIndex=function(){return this.displayIndex},b.prototype.getRows=function(t){var e=this,n=[];return t.forEach(function(t,i){var o;n.push(t),t instanceof s&&((o=t.modules.dataTree.children).index||!1===o.children||e.getChildren(t).forEach(function(t){n.push(t)}))}),n},b.prototype.getChildren=function(t){var e=this,n=t.modules.dataTree,i=[],o=[];return!1!==n.children&&n.open&&(Array.isArray(n.children)||(n.children=this.generateChildren(t)),i=this.table.modExists("filter")?this.table.modules.filter.filter(n.children):n.children,this.table.modExists("sort")&&this.table.modules.sort.sort(i),i.forEach(function(t){o.push(t),e.getChildren(t).forEach(function(t){o.push(t)})})),o},b.prototype.generateChildren=function(t){var e=this,n=[],i=t.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(function(i){var o=new s(i||{},e.table.rowManager);o.modules.dataTree.index=t.modules.dataTree.index+1,o.modules.dataTree.parent=t,o.modules.dataTree.children&&(o.modules.dataTree.open=e.startOpen(o.getComponent(),o.modules.dataTree.index)),n.push(o)}),n},b.prototype.expandRow=function(t,e){var n=t.modules.dataTree;!1!==n.children&&(n.open=!0,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(t.getComponent(),t.modules.dataTree.index))},b.prototype.collapseRow=function(t){var e=t.modules.dataTree;!1!==e.children&&(e.open=!1,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(t.getComponent(),t.modules.dataTree.index))},b.prototype.toggleRow=function(t){var e=t.modules.dataTree;!1!==e.children&&(e.open?this.collapseRow(t):this.expandRow(t))},b.prototype.getTreeParent=function(t){return!!t.modules.dataTree.parent&&t.modules.dataTree.parent.getComponent()},b.prototype.getTreeChildren=function(t){var e=t.modules.dataTree,n=[];return e.children&&(Array.isArray(e.children)||(e.children=this.generateChildren(t)),e.children.forEach(function(t){t instanceof s&&n.push(t.getComponent())})),n},b.prototype.checkForRestyle=function(t){t.row.cells.indexOf(t)||!1!==t.row.modules.dataTree.children&&t.row.reinitialize()},b.prototype.getChildField=function(){return this.field},h.prototype.registerModule("dataTree",b);var w=function(t){this.table=t,this.fields={},this.columnsByIndex=[],this.columnsByField={},this.config={}};w.prototype.download=function(t,e,n,i){var o=this,r=!1;this.processConfig(),"function"==typeof t?r=t:o.downloaders[t]?r=o.downloaders[t]:console.warn("Download Error - No such download type found: ",t),this.processColumns(),r&&r.call(this,o.processDefinitions(),o.processData(),n||{},function(n,r){i?!0===i?o.triggerDownload(n,r,t,e,!0):i(n):o.triggerDownload(n,r,t,e)},this.config)},w.prototype.processConfig=function(){var t={columnGroups:!0,rowGroups:!0,columnCalcs:!0};if(this.table.options.downloadConfig)for(var e in this.table.options.downloadConfig)t[e]=this.table.options.downloadConfig[e];t.rowGroups&&this.table.options.groupBy&&this.table.modExists("groupRows")&&(this.config.rowGroups=!0),t.columnGroups&&this.table.columnManager.columns.length!=this.table.columnManager.columnsByIndex.length&&(this.config.columnGroups=!0),t.columnCalcs&&this.table.modExists("columnCalcs")&&(this.config.columnCalcs=!0)},w.prototype.processColumns=function(){var t=this;t.columnsByIndex=[],t.columnsByField={},t.table.columnManager.columnsByIndex.forEach(function(e){e.field&&!1!==e.definition.download&&(e.visible||!e.visible&&e.definition.download)&&(t.columnsByIndex.push(e),t.columnsByField[e.field]=e)})},w.prototype.processDefinitions=function(){var t=this,e=[];return this.config.columnGroups?t.table.columnManager.columns.forEach(function(n){var i=t.processColumnGroup(n);i&&e.push(i)}):t.columnsByIndex.forEach(function(n){!1!==n.download&&e.push(t.processDefinition(n))}),e},w.prototype.processColumnGroup=function(t){var e=this,n=t.columns,i=0,o={type:"group",title:t.definition.title,depth:1};if(n.length){if(o.subGroups=[],o.width=0,n.forEach(function(t){var n=e.processColumnGroup(t);n.depth>i&&(i=n.depth),n&&(o.width+=n.width,o.subGroups.push(n))}),o.depth+=i,!o.width)return!1}else{if(!t.field||!1===t.definition.download||!(t.visible||!t.visible&&t.definition.download))return!1;o.width=1,o.definition=this.processDefinition(t)}return o},w.prototype.processDefinition=function(t){var e={};for(var n in t.definition)e[n]=t.definition[n];return void 0!==t.definition.downloadTitle&&(e.title=t.definition.downloadTitle),e},w.prototype.processData=function(){var t=this,e=[],n={};return this.config.rowGroups?this.table.modules.groupRows.getGroups().forEach(function(n){e.push(t.processGroupData(n))}):e=this.table.rowManager.getData(!0,"download"),this.config.columnCalcs&&(n=this.table.getCalcResults(),e={calcs:n,data:e}),"function"==typeof this.table.options.downloadDataFormatter&&(e=this.table.options.downloadDataFormatter(e)),e},w.prototype.processGroupData=function(t){var e=this,n=t.getSubGroups(),i={type:"group",key:t.key};return n.length?(i.subGroups=[],n.forEach(function(t){i.subGroups.push(e.processGroupData(t))})):i.rows=t.getData(!0,"download"),i},w.prototype.triggerDownload=function(t,e,n,i,o){var r=document.createElement("a"),a=new Blob([t],{type:e});i=i||"Tabulator."+("function"==typeof n?"txt":n);(a=this.table.options.downloadReady.call(this.table,t,a))&&(o?window.open(window.URL.createObjectURL(a)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(a,i):(r.setAttribute("href",window.URL.createObjectURL(a)),r.setAttribute("download",i),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},w.prototype.getFieldValue=function(t,e){var n=this.columnsByField[t];return!!n&&n.getFieldValue(e)},w.prototype.commsReceived=function(t,e,n){switch(e){case"intercept":this.download(n.type,"",n.options,n.intercept)}},w.prototype.downloaders={csv:function(t,e,n,i,o){var r,s,l=this,u=[],c=[],h=n&&n.delimiter?n.delimiter:",";function d(t){t.forEach(function(t){var e=[];c.forEach(function(n){var i=l.getFieldValue(n,t);switch(void 0===i?"undefined":a(i)){case"object":i=JSON.stringify(i);break;case"undefined":case"null":i="";break;default:i=i}e.push('"'+String(i).split('"').join('""')+'"')}),r.push(e.join(h))})}o.columnGroups?(console.warn("Download Warning - CSV downloader cannot process column groups"),t.forEach(function(t){!function t(e,n){e.subGroups?e.subGroups.forEach(function(e){t(e,n+1)}):(u.push('"'+String(e.title).split('"').join('""')+'"'),c.push(e.definition.field))}(t,0)})):t.forEach(function(t){u.push('"'+String(t.title).split('"').join('""')+'"'),c.push(t.field)}),r=[u.join(h)],o.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),e=e.data),o.rowGroups?(console.warn("Download Warning - CSV downloader cannot process row groups"),e.forEach(function(t){!function t(e){e.subGroups?e.subGroups.forEach(function(e){t(e)}):d(e.rows)}(t)})):d(e),s=r.join("\n"),n.bom&&(s="\ufeff"+s),i(s,"text/csv")},json:function(t,e,n,i,o){o.columnCalcs&&(console.warn("Download Warning - CSV downloader cannot process column calculations"),e=e.data),i(JSON.stringify(e,null,"\t"),"application/json")},pdf:function(t,e,n,i,o){var r=this,s=[],l=[],u=[],c={},h=1,d={},f=n.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},p=n.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},g=n.jsPDF||{},m=n&&n.title?n.title:"";if(o.columnCalcs&&(c=e.calcs,e=e.data),g.orientation||(g.orientation=n.orientation||"landscape"),g.unit||(g.unit="pt"),o.columnGroups){t.forEach(function(t){t.depth>h&&(h=t.depth)});for(var v=0;v<h;v++)l.push([]);t.forEach(function(t){!function t(e,n){var i=e.width,o=1,r={content:e.title||""};if(e.subGroups?(e.subGroups.forEach(function(e){t(e,n+1)}),o=1):(s.push(e.definition.field),o=h-n),r.rowSpan=o,l[n].push(r),i--,o>1)for(var a=n+1;a<h;a++)l[a].push("");for(a=0;a<i;a++)l[n].push("")}(t,0)})}else t.forEach(function(t){t.field&&(l.push(t.title||""),s.push(t.field))}),l=[l];function y(t){switch(void 0===t?"undefined":a(t)){case"object":t=JSON.stringify(t);break;case"undefined":case"null":t="";break;default:t=t}return t}function b(t){t.forEach(function(t){u.push(w(t))})}function w(t,e){var n=[];return s.forEach(function(i){var o=r.getFieldValue(i,t);o=y(o),e?n.push({content:o,styles:e}):n.push(o)}),n}function _(t,e,n){var i=t[e];i&&(n&&(i=i[n]),Object.keys(i).length&&u.push(w(i,p)))}o.rowGroups?e.forEach(function(t){!function t(e,n){var i=[];i.push({content:y(e.key),colSpan:s.length,styles:f}),u.push(i),e.subGroups?e.subGroups.forEach(function(i){t(i,n[e.key]&&n[e.key].groups||{})}):(o.columnCalcs&&_(n,e.key,"top"),b(e.rows),o.columnCalcs&&_(n,e.key,"bottom"))}(t,c)}):(o.columnCalcs&&_(c,"top"),b(e),o.columnCalcs&&_(c,"bottom"));var x=new jsPDF(g);n&&n.autoTable&&(d="function"==typeof n.autoTable?n.autoTable(x)||{}:n.autoTable),m&&(d.addPageContent=function(t){x.text(m,40,30)}),d.head=l,d.body=u,x.autoTable(d),i(x.output("arraybuffer"),"application/pdf")},xlsx:function(t,e,n,i,o){var r=this,s=n.sheetName||"Sheet1",l={SheetNames:[],Sheets:{}},u={},c=[],h=[],d=[];function f(){var n=[],i=[],s=[];function l(t,e){void 0===n[e]&&(n[e]=[]),void 0===h[e]&&(h[e]=[]),t.width>1&&h[e].push({type:"hoz",start:n[e].length,end:n[e].length+t.width-1}),n[e].push(t.title),t.subGroups?t.subGroups.forEach(function(t){l(t,e+1)}):(i.push(t.definition.field),function(){var t=0;n.forEach(function(e){var n=e.length;n>t&&(t=n)}),n.forEach(function(e){var n=e.length;if(n<t)for(var i=n;i<t;i++)e.push("")})}(i.length),h[e].push({type:"vert",start:i.length-1}))}function f(t){t.forEach(function(t){s.push(p(t))})}function p(t){var e=[];return i.forEach(function(n){var i=r.getFieldValue(n,t);e.push(i instanceof Date||"object"!==(void 0===i?"undefined":a(i))?i:JSON.stringify(i))}),e}function g(t,e,n){var i=t[e];i&&(n&&(i=i[n]),Object.keys(i).length&&(d.push(s.length),s.push(p(i))))}return o.columnGroups?(t.forEach(function(t){l(t,0)}),n.forEach(function(t){s.push(t)})):(t.forEach(function(t){n.push(t.title),i.push(t.field)}),s.push(n)),o.rowGroups?e.forEach(function(t){!function t(e,n){var i=[];i.push(e.key),c.push(s.length),s.push(i),e.subGroups?e.subGroups.forEach(function(i){t(i,n[e.key]&&n[e.key].groups||{})}):(o.columnCalcs&&g(n,e.key,"top"),f(e.rows),o.columnCalcs&&g(n,e.key,"bottom"))}(t,u)}):(o.columnCalcs&&g(u,"top"),f(e),o.columnCalcs&&g(u,"bottom")),function(){var t={},e={s:{c:0,r:0},e:{c:i.length,r:s.length}};XLSX.utils.sheet_add_aoa(t,s),t["!ref"]=XLSX.utils.encode_range(e);var o=function(){var t=[];return c.forEach(function(e){t.push({s:{r:e,c:0},e:{r:e,c:i.length-1}})}),h.forEach(function(e,i){e.forEach(function(e){"hoz"===e.type?t.push({s:{r:i,c:e.start},e:{r:i,c:e.end}}):i!=n.length-1&&t.push({s:{r:i,c:e.start},e:{r:n.length-1,c:e.start}})})}),t}();return o.length&&(t["!merges"]=o),t}()}if(o.columnCalcs&&(u=e.calcs,e=e.data),n.sheetOnly)i(f());else{if(n.sheets)for(var p in n.sheets)!0===n.sheets[p]?(l.SheetNames.push(p),l.Sheets[p]=f()):(l.SheetNames.push(p),this.table.modules.comms.send(n.sheets[p],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},intercept:function(t){l.Sheets[p]=t}}));else l.SheetNames.push(s),l.Sheets[s]=f();i(function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),i=0;i!=t.length;++i)n[i]=255&t.charCodeAt(i);return e}(XLSX.write(l,{bookType:"xlsx",bookSST:!0,type:"binary"})),"application/octet-stream")}}},h.prototype.registerModule("download",w);var _=function(t){this.table=t,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1};_.prototype.initializeColumn=function(t){var e={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{}};switch(a(t.definition.editor)){case"string":"tick"===t.definition.editor&&(t.definition.editor="tickCross",console.warn("DEPRECATION WANRING - the tick editor has been depricated, please use the tickCross editor")),this.editors[t.definition.editor]?e.editor=this.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":e.editor=t.definition.editor;break;case"boolean":!0===t.definition.editor&&("function"!=typeof t.definition.formatter?("tick"===t.definition.formatter&&(t.definition.formatter="tickCross",console.warn("DEPRECATION WANRING - the tick editor has been depricated, please use the tickCross editor")),this.editors[t.definition.formatter]?e.editor=this.editors[t.definition.formatter]:e.editor=this.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}e.editor&&(t.modules.edit=e)},_.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},_.prototype.clearEditor=function(){var t,e=this.currentCell;if(this.invalidEdit=!1,e){for(this.currentCell=!1,(t=e.getElement()).classList.remove("tabulator-validation-fail"),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);e.row.getElement().classList.remove("tabulator-row-editing")}},_.prototype.cancelEdit=function(){if(this.currentCell){var t=this.currentCell,e=this.currentCell.getComponent();this.clearEditor(),t.setValueActual(t.getValue()),t.column.cellEvents.cellEditCancelled&&t.column.cellEvents.cellEditCancelled.call(this.table,e),this.table.options.cellEditCancelled.call(this.table,e)}},_.prototype.bindEditor=function(t){var e=this,n=t.getElement();n.setAttribute("tabindex",0),n.addEventListener("click",function(t){n.classList.contains("tabulator-editing")||n.focus()}),n.addEventListener("mousedown",function(t){e.mouseClick=!0}),n.addEventListener("focus",function(n){e.recursionBlock||e.edit(t,n,!1)})},_.prototype.focusCellNoEvent=function(t){this.recursionBlock=!0,"ie"!==this.table.browser&&t.getElement().focus(),this.recursionBlock=!1},_.prototype.editCell=function(t,e){this.focusCellNoEvent(t),this.edit(t,!1,e)},_.prototype.edit=function(t,e,n){var i,o,r,s=this,l=!0,u=function(){},c=t.getElement();if(!this.currentCell){if(t.column.modules.edit.blocked)return this.mouseClick=!1,c.blur(),!1;switch(e&&e.stopPropagation(),a(t.column.modules.edit.check)){case"function":l=t.column.modules.edit.check(t.getComponent());break;case"boolean":l=t.column.modules.edit.check}if(l||n){if(s.cancelEdit(),s.currentCell=t,o=t.getComponent(),this.mouseClick&&(this.mouseClick=!1,t.column.cellEvents.cellClick&&t.column.cellEvents.cellClick.call(this.table,e,o)),t.column.cellEvents.cellEditing&&t.column.cellEvents.cellEditing.call(this.table,o),s.table.options.cellEditing.call(this.table,o),r="function"==typeof t.column.modules.edit.params?t.column.modules.edit.params(o):t.column.modules.edit.params,!1===(i=t.column.modules.edit.editor.call(s,o,function(t){u=t},function(e){if(s.currentCell===t){var n=!0;t.column.modules.validate&&s.table.modExists("validate")&&(n=s.table.modules.validate.validate(t.column.modules.validate,t.getComponent(),e)),!0===n?(s.clearEditor(),t.setValue(e,!0),s.table.options.dataTree&&s.table.modExists("dataTree")&&s.table.modules.dataTree.checkForRestyle(t)):(s.invalidEdit=!0,c.classList.add("tabulator-validation-fail"),s.focusCellNoEvent(t),u(),s.table.options.validationFailed.call(s.table,t.getComponent(),e,n))}},function(){s.currentCell===t&&(s.cancelEdit(),s.table.options.dataTree&&s.table.modExists("dataTree")&&s.table.modules.dataTree.checkForRestyle(t))},r)))return c.blur(),!1;if(!(i instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",i),c.blur(),!1;for(c.classList.add("tabulator-editing"),t.row.getElement().classList.add("tabulator-row-editing");c.firstChild;)c.removeChild(c.firstChild);c.appendChild(i),u();for(var h=c.children,d=0;d<h.length;d++)h[d].addEventListener("click",function(t){t.stopPropagation()});return!0}return this.mouseClick=!1,c.blur(),!1}this.invalidEdit||this.cancelEdit()},_.prototype.editors={input:function(t,e,n,i,o){var r=t.getValue(),a=document.createElement("input");function s(t){(null===r||void 0===r)&&""!==a.value||a.value!=r?n(a.value):i()}return a.setAttribute("type","text"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",a.value=void 0!==r?r:"",e(function(){a.focus(),a.style.height="100%"}),a.addEventListener("change",s),a.addEventListener("blur",s),a.addEventListener("keydown",function(t){switch(t.keyCode){case 13:n(a.value);break;case 27:i()}}),a},textarea:function(t,e,n,i,o){var r=t.getValue(),a=String(null!==r&&"undefined"!==r?r:""),s=((a.match(/(?:\r\n|\r|\n)/g)||[]).length,document.createElement("textarea")),l=0;function u(e){(null===r||void 0===r)&&""!==s.value||s.value!=r?(n(s.value),setTimeout(function(){t.getRow().normalizeHeight()},300)):i()}return s.style.display="block",s.style.padding="2px",s.style.height="100%",s.style.width="100%",s.style.boxSizing="border-box",s.style.whiteSpace="pre-wrap",s.style.resize="none",s.value=a,e(function(){s.focus(),s.style.height="100%"}),s.addEventListener("change",u),s.addEventListener("blur",u),s.addEventListener("keyup",function(){s.style.height="";var e=s.scrollHeight;s.style.height=e+"px",e!=l&&(l=e,t.getRow().normalizeHeight())}),s.addEventListener("keydown",function(t){27==t.keyCode&&i()}),s},number:function(t,e,n,i,o){var r=t.getValue(),a=document.createElement("input");function s(){var t=a.value;isNaN(t)||""===t||(t=Number(t)),t!=r?n(t):i()}return a.setAttribute("type","number"),void 0!==o.max&&a.setAttribute("max",o.max),void 0!==o.min&&a.setAttribute("min",o.min),void 0!==o.step&&a.setAttribute("step",o.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",a.value=r,e(function(){a.focus(),a.style.height="100%",a.addEventListener("blur",function(t){s()})}),a.addEventListener("keydown",function(t){switch(t.keyCode){case 13:case 9:s();break;case 27:i()}}),a},range:function(t,e,n,i,o){var r=t.getValue(),a=document.createElement("input");function s(){var t=a.value;isNaN(t)||""===t||(t=Number(t)),t!=r?n(t):i()}return a.setAttribute("type","range"),void 0!==o.max&&a.setAttribute("max",o.max),void 0!==o.min&&a.setAttribute("min",o.min),void 0!==o.step&&a.setAttribute("step",o.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",a.value=r,e(function(){a.focus(),a.style.height="100%"}),a.addEventListener("blur",function(t){s()}),a.addEventListener("keydown",function(t){switch(t.keyCode){case 13:case 9:s();break;case 27:i()}}),a},select:function(t,e,n,i,o){var r=this,s=t.getElement(),l=t.getValue(),u=document.createElement("input"),c=document.createElement("div"),d=[],f=[],p={},g=!0;function m(){var e={},n=t.getColumn()._getSelf();return r.table.getData().forEach(function(t){var i=n.getFieldValue(t);null!==i&&void 0!==i&&""!==i&&(e[i]=!0)}),e=o.sortValuesList?"asc"==o.sortValuesList?Object.keys(e).sort():Object.keys(e).sort().reverse():Object.keys(e)}function v(e,n){var i=[],r=[];function s(t){return(t={label:o.listItemFormatter?o.listItemFormatter(t.value,t.label):t.label,value:t.value,element:!1}).value!==n&&(isNaN(parseFloat(t.value))||isNaN(parseFloat(t.value))||parseFloat(t.value)!==parseFloat(n))||y(t),i.push(t),r.push(t),t}if("function"==typeof e&&(e=e(t)),Array.isArray(e))e.forEach(function(t){var e;"object"===(void 0===t?"undefined":a(t))?t.options?(e={label:t.label,group:!0,element:!1},r.push(e),t.options.forEach(function(t){s(t)})):s(t):((e={label:o.listItemFormatter?o.listItemFormatter(t,t):t,value:t,element:!1}).value!==n&&(isNaN(parseFloat(e.value))||isNaN(parseFloat(e.value))||parseFloat(e.value)!==parseFloat(n))||y(e),i.push(e),r.push(e))});else for(var l in e){var u={label:o.listItemFormatter?o.listItemFormatter(l,e[l]):e[l],value:l,element:!1};u.value!==n&&(isNaN(parseFloat(u.value))||isNaN(parseFloat(u.value))||parseFloat(u.value)!==parseFloat(n))||y(u),i.push(u),r.push(u)}d=i,f=r,function(){for(;c.firstChild;)c.removeChild(c.firstChild);f.forEach(function(t){var e=t.element;e||(t.group?((e=document.createElement("div")).classList.add("tabulator-edit-select-list-group"),e.tabIndex=0,e.innerHTML=""===t.label?"&nbsp;":t.label):((e=document.createElement("div")).classList.add("tabulator-edit-select-list-item"),e.tabIndex=0,e.innerHTML=""===t.label?"&nbsp;":t.label,e.addEventListener("click",function(){y(t),b()}),t===p&&e.classList.add("active")),e.addEventListener("mousedown",function(){g=!1,setTimeout(function(){g=!0},10)}),t.element=e),c.appendChild(e)})}()}function y(t){p&&p.element&&p.element.classList.remove("active"),p=t,u.value="&nbsp;"===t.label?"":t.label,t.element&&t.element.classList.add("active")}function b(){_(),l!==p.value?(l=p.value,n(p.value)):i()}function w(){_(),i()}function _(){c.parentNode&&c.parentNode.removeChild(c)}return(Array.isArray(o)||!Array.isArray(o)&&"object"===(void 0===o?"undefined":a(o))&&!o.values)&&(console.warn("DEPRECATION WANRING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),o={values:o}),u.setAttribute("type","text"),u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",u.readOnly=!0,u.value=l,!0===o.values?v(m(),l):v(o.values||[],l),u.addEventListener("keydown",function(t){var e;switch(t.keyCode){case 38:t.stopImmediatePropagation(),t.stopPropagation(),(e=d.indexOf(p))>0&&y(d[e-1]);break;case 40:t.stopImmediatePropagation(),t.stopPropagation(),(e=d.indexOf(p))<d.length-1&&y(-1==e?d[0]:d[e+1]);break;case 13:b();break;case 27:w()}}),u.addEventListener("blur",function(t){g&&w()}),u.addEventListener("focus",function(t){!function(){if(!c.parentNode){!0===o.values?v(m(),l):v(o.values||[],l);var t=h.prototype.helpers.elOffset(s);c.style.minWidth=s.offsetWidth+"px",c.style.top=t.top+s.offsetHeight+"px",c.style.left=t.left+"px",document.body.appendChild(c)}}()}),(c=document.createElement("div")).classList.add("tabulator-edit-select-list"),e(function(){u.style.height="100%",u.focus()}),u},autocomplete:function(t,e,n,i,o){var r=this,a=t.getElement(),s=t.getValue(),l=document.createElement("input"),u=document.createElement("div"),c=[],d=[],f=[],p={},g=!0;function m(t,e){var n=[];o.searchFunc?n=o.searchFunc(t,f):""===t?o.showListOnEmpty&&c.forEach(function(t){n.push(t)}):c.forEach(function(e){null===e.value&&void 0===e.value||(String(e.value).toLowerCase().indexOf(String(t).toLowerCase())>-1||String(e.title).toLowerCase().indexOf(String(t).toLowerCase())>-1)&&n.push(e)}),d=n,function(t){var e=!1;for(;u.firstChild;)u.removeChild(u.firstChild);d.forEach(function(n){var i=n.element;i||((i=document.createElement("div")).classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=n.title,i.addEventListener("click",function(){v(n),y()}),i.addEventListener("mousedown",function(){g=!1,setTimeout(function(){g=!0},10)}),n.element=i,t&&n.value==s&&(l.value=n.title,n.element.classList.add("active"),e=!0),n===p&&(n.element.classList.add("active"),e=!0)),u.appendChild(i)}),e||v(!1)}(e)}function v(t,e){p&&p.element&&p.element.classList.remove("active"),p=t,t&&t.element&&t.element.classList.add("active")}function y(){w(),p?s!==p.value?(s=p.value,l.value=p.value,n(l.value)):i():o.freetext?(s=l.value,n(l.value)):o.allowEmpty&&""===l.value?(s=l.value,n(l.value)):i()}function b(){if(!u.parentNode){for(;u.firstChild;)u.removeChild(u.firstChild);(function(t,e){var n=[];if(Array.isArray(t))t.forEach(function(t){var i={title:o.listItemFormatter?o.listItemFormatter(t,t):t,value:t,element:!1};i.value!==e&&(isNaN(parseFloat(i.value))||isNaN(parseFloat(i.value))||parseFloat(i.value)!==parseFloat(e))||v(i),n.push(i)});else for(var i in t){var r={title:o.listItemFormatter?o.listItemFormatter(i,t[i]):t[i],value:i,element:!1};r.value!==e&&(isNaN(parseFloat(r.value))||isNaN(parseFloat(r.value))||parseFloat(r.value)!==parseFloat(e))||v(r),n.push(r)}c=n})(f=!0===o.values?function(){var e={},n=t.getColumn()._getSelf();return r.table.getData().forEach(function(t){var i=n.getFieldValue(t);null!==i&&void 0!==i&&""!==i&&(e[i]=!0)}),e=o.sortValuesList?"asc"==o.sortValuesList?Object.keys(e).sort():Object.keys(e).sort().reverse():Object.keys(e)}():o.values||[],s);var e=h.prototype.helpers.elOffset(a);u.style.minWidth=a.offsetWidth+"px",u.style.top=e.top+a.offsetHeight+"px",u.style.left=e.left+"px",document.body.appendChild(u)}}function w(){u.parentNode&&u.parentNode.removeChild(u)}return l.setAttribute("type","search"),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",l.addEventListener("keydown",function(t){var e;switch(t.keyCode){case 38:t.stopImmediatePropagation(),t.stopPropagation(),v((e=d.indexOf(p))>0&&d[e-1]);break;case 40:t.stopImmediatePropagation(),t.stopPropagation(),(e=d.indexOf(p))<d.length-1&&v(-1==e?d[0]:d[e+1]);break;case 13:y();break;case 27:w(),i();break;case 36:case 35:t.stopImmediatePropagation()}}),l.addEventListener("keyup",function(t){switch(t.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:m(l.value)}}),l.addEventListener("search",function(t){m(l.value)}),l.addEventListener("blur",function(t){g&&y()}),l.addEventListener("focus",function(t){b(),l.value=s,m(s,!0)}),(u=document.createElement("div")).classList.add("tabulator-edit-select-list"),e(function(){l.style.height="100%",l.focus()}),l},star:function(t,e,n,i,o){var r=this,a=t.getElement(),s=t.getValue(),l=a.getElementsByTagName("svg").length||5,u=a.getElementsByTagName("svg")[0]?a.getElementsByTagName("svg")[0].getAttribute("width"):14,c=[],h=document.createElement("div"),d=document.createElementNS("http://www.w3.org/2000/svg","svg");function f(t){c.forEach(function(e,n){n<t?("ie"==r.table.browser?e.setAttribute("class","tabulator-star-active"):e.classList.replace("tabulator-star-inactive","tabulator-star-active"),e.innerHTML='<polygon fill="#488CE9" stroke="#014AAE" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'):("ie"==r.table.browser?e.setAttribute("class","tabulator-star-inactive"):e.classList.replace("tabulator-star-active","tabulator-star-inactive"),e.innerHTML='<polygon fill="#010155" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>')})}function p(t){var e=document.createElement("span"),i=d.cloneNode(!0);c.push(i),e.addEventListener("mouseenter",function(e){e.stopPropagation(),e.stopImmediatePropagation(),f(t)}),e.addEventListener("mousemove",function(t){t.stopPropagation(),t.stopImmediatePropagation()}),e.addEventListener("click",function(e){e.stopPropagation(),e.stopImmediatePropagation(),n(t)}),e.appendChild(i),h.appendChild(e)}function g(t){s=t,f(t)}a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",h.style.verticalAlign="middle",h.style.display="inline-block",h.style.padding="4px",d.setAttribute("width",u),d.setAttribute("height",u),d.setAttribute("viewBox","0 0 512 512"),d.setAttribute("xml:space","preserve"),d.style.padding="0 1px";for(var m=1;m<=l;m++)p(m);return f(s=Math.min(parseInt(s),l)),h.addEventListener("mousemove",function(t){f(0)}),h.addEventListener("click",function(t){n(0)}),a.addEventListener("blur",function(t){i()}),a.addEventListener("keydown",function(t){switch(t.keyCode){case 39:g(s+1);break;case 37:g(s-1);break;case 13:n(s);break;case 27:i()}}),h},progress:function(t,e,n,i,o){var r,a,s=t.getElement(),l=void 0===o.max?s.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,u=void 0===o.min?s.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,c=(l-u)/100,h=t.getValue()||0,d=document.createElement("div"),f=document.createElement("div");function p(){var t=c*Math.round(f.offsetWidth/(s.clientWidth/100))+u;n(t),s.setAttribute("aria-valuenow",t),s.setAttribute("aria-label",h)}return d.style.position="absolute",d.style.right="0",d.style.top="0",d.style.bottom="0",d.style.width="5px",d.classList.add("tabulator-progress-handle"),f.style.display="inline-block",f.style.position="relative",f.style.height="100%",f.style.backgroundColor="#488CE9",f.style.maxWidth="100%",f.style.minWidth="0%",s.style.padding="4px 4px",h=Math.min(parseFloat(h),l),h=Math.max(parseFloat(h),u),h=Math.round((h-u)/c),f.style.width=h+"%",s.setAttribute("aria-valuemin",u),s.setAttribute("aria-valuemax",l),f.appendChild(d),d.addEventListener("mousedown",function(t){r=t.screenX,a=f.offsetWidth}),d.addEventListener("mouseover",function(){d.style.cursor="ew-resize"}),s.addEventListener("mousemove",function(t){r&&(f.style.width=a+t.screenX-r+"px")}),s.addEventListener("mouseup",function(t){r&&(t.stopPropagation(),t.stopImmediatePropagation(),r=!1,a=!1,p())}),s.addEventListener("keydown",function(t){switch(t.keyCode){case 39:f.style.width=f.clientWidth+s.clientWidth/100+"px";break;case 37:f.style.width=f.clientWidth-s.clientWidth/100+"px";break;case 13:p();break;case 27:i()}}),s.addEventListener("blur",function(){i()}),f},tickCross:function(t,e,n,i,o){var r=t.getValue(),a=document.createElement("input"),s=o.tristate,l=void 0===o.indeterminateValue?null:o.indeterminateValue,u=!1;function c(t){return s?t?u?l:a.checked:a.checked&&!u?(a.checked=!1,a.indeterminate=!0,u=!0,l):(u=!1,a.checked):a.checked}return a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",a.value=r,!s||void 0!==r&&r!==l&&""!==r||(u=!0,a.indeterminate=!0),"firefox"!=this.table.browser&&e(function(){a.focus()}),a.checked=!0===r||"true"===r||"True"===r||1===r,a.addEventListener("change",function(t){n(c())}),a.addEventListener("blur",function(t){n(c(!0))}),a.addEventListener("keydown",function(t){13==t.keyCode&&n(c()),27==t.keyCode&&i()}),a}},h.prototype.registerModule("edit",_);var x=function(t){this.table=t,this.filterList=[],this.headerFilters={},this.headerFilterElements=[],this.headerFilterColumns=[],this.changed=!1};x.prototype.initializeColumn=function(t,e){var n,i=this,o=t.getField();t.modules.filter={success:function(e){var r,s="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",l="";if(void 0===n||n!==e){if(n=e,t.modules.filter.emptyFunc(e))delete i.headerFilters[o];else{switch(t.modules.filter.value=e,a(t.definition.headerFilterFunc)){case"string":i.filters[t.definition.headerFilterFunc]?(l=t.definition.headerFilterFunc,r=function(n){var o=t.definition.headerFilterFuncParams||{},r=t.getFieldValue(n);return o="function"==typeof o?o(e,r,n):o,i.filters[t.definition.headerFilterFunc](e,r,n,o)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":l=r=function(n){var i=t.definition.headerFilterFuncParams||{},o=t.getFieldValue(n);return i="function"==typeof i?i(e,o,n):i,t.definition.headerFilterFunc(e,o,n,i)}}if(!r)switch(s){case"partial":r=function(n){return String(t.getFieldValue(n)).toLowerCase().indexOf(String(e).toLowerCase())>-1},l="like";break;default:r=function(n){return t.getFieldValue(n)==e},l="="}i.headerFilters[o]={value:e,func:r,type:l}}i.changed=!0,i.table.rowManager.filterRefresh()}},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)},x.prototype.generateHeaderFilterElement=function(t,e){var n,i,o,r,s,l,u,c=this,h=t.modules.filter.success,d=t.getField();if(t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode){var f=t.modules.filter.headerElement.parentNode,p=c.headerFilterElements.indexOf(f);p>=0&&c.headerFilterElements.splice(p,1);var g=c.headerFilterColumns.indexOf(g);g>=0&&c.headerFilterColumns.splice(g,1),t.contentElement.removeChild(f)}if(d){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(t){return!t&&"0"!==t},(n=document.createElement("div")).classList.add("tabulator-header-filter"),a(t.definition.headerFilter)){case"string":c.table.modules.edit.editors[t.definition.headerFilter]?(i=c.table.modules.edit.editors[t.definition.headerFilter],"tick"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":i=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?i=t.modules.edit.editor:t.definition.formatter&&c.table.modules.edit.editors[t.definition.formatter]?(i=c.table.modules.edit.editors[t.definition.formatter],"tick"!==t.definition.formatter&&"tickCross"!==t.definition.formatter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):i=c.table.modules.edit.editors.input}if(i){if(r={getValue:function(){return void 0!==e?e:""},getField:function(){return t.definition.field},getElement:function(){return n},getColumn:function(){return t.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},u="function"==typeof(u=t.definition.headerFilterParams||{})?u.call(c.table):u,!(o=i.call(this.table.modules.edit,r,function(){},h,function(){},u)))return void console.warn("Filter Error - Cannot add filter to "+d+" column, editor returned a value of false");if(!(o instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+d+" column, editor should return an instance of Node, the editor returned:",o);d?c.table.modules.localize.bind("headerFilters|columns|"+t.definition.field,function(t){o.setAttribute("placeholder",void 0!==t&&t?t:c.table.modules.localize.getText("headerFilters|default"))}):c.table.modules.localize.bind("headerFilters|default",function(t){o.setAttribute("placeholder",void 0!==c.column.definition.headerFilterPlaceholder&&c.column.definition.headerFilterPlaceholder?c.column.definition.headerFilterPlaceholder:t)}),o.addEventListener("click",function(t){t.stopPropagation(),o.focus()}),s=!1,l=function(t){s&&clearTimeout(s),s=setTimeout(function(){h(o.value)},300)},t.modules.filter.headerElement=o,t.modules.filter.attrType=o.hasAttribute("type")?o.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=o.tagName.toLowerCase(),!1!==t.definition.headerFilterLiveFilter&&("autocomplete"===t.definition.headerFilter||"autocomplete"===t.definition.editor&&!0===t.definition.headerFilter||(o.addEventListener("keyup",l),o.addEventListener("search",l),"number"==t.modules.filter.attrType&&o.addEventListener("change",function(t){h(o.value)}),"text"==t.modules.filter.attrType&&"ie"!==this.table.browser&&o.setAttribute("type","search")),"input"!=t.modules.filter.tagType&&"select"!=t.modules.filter.tagType&&"textarea"!=t.modules.filter.tagType||o.addEventListener("mousedown",function(t){t.stopPropagation()})),n.appendChild(o),t.contentElement.appendChild(n),c.headerFilterElements.push(o),c.headerFilterColumns.push(t)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)},x.prototype.hideHeaderFilterElements=function(){this.headerFilterElements.forEach(function(t){t.style.display="none"})},x.prototype.showHeaderFilterElements=function(){this.headerFilterElements.forEach(function(t){t.style.display=""})},x.prototype.setHeaderFilterFocus=function(t){t.modules.filter&&t.modules.filter.headerElement?t.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",t.getField())},x.prototype.setHeaderFilterValue=function(t,e){t&&(t.modules.filter&&t.modules.filter.headerElement?(this.generateHeaderFilterElement(t,e),t.modules.filter.success(e)):console.warn("Column Filter Error - No header filter set on column:",t.getField()))},x.prototype.reloadHeaderFilter=function(t){t&&(t.modules.filter&&t.modules.filter.headerElement?this.generateHeaderFilterElement(t,t.modules.filter.value):console.warn("Column Filter Error - No header filter set on column:",t.getField()))},x.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},x.prototype.setFilter=function(t,e,n){this.filterList=[],Array.isArray(t)||(t=[{field:t,type:e,value:n}]),this.addFilter(t)},x.prototype.addFilter=function(t,e,n){var i=this;Array.isArray(t)||(t=[{field:t,type:e,value:n}]),t.forEach(function(t){(t=i.findFilter(t))&&(i.filterList.push(t),i.changed=!0)}),this.table.options.persistentFilter&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("filter")},x.prototype.findFilter=function(t){var e,n=this;if(Array.isArray(t))return this.findSubFilters(t);var i=!1;return"function"==typeof t.field?i=function(e){return t.field(e,t.type||{})}:n.filters[t.type]?i=(e=n.table.columnManager.getColumnByField(t.field))?function(i){return n.filters[t.type](t.value,e.getFieldValue(i))}:function(e){return n.filters[t.type](t.value,e[t.field])}:console.warn("Filter Error - No such filter type found, ignoring: ",t.type),t.func=i,!!t.func&&t},x.prototype.findSubFilters=function(t){var e=this,n=[];return t.forEach(function(t){(t=e.findFilter(t))&&n.push(t)}),!!n.length&&n},x.prototype.getFilters=function(t,e){var n=[];return t&&(n=this.getHeaderFilters()),this.filterList.forEach(function(t){n.push({field:t.field,type:t.type,value:t.value})}),e&&n.forEach(function(t){"function"==typeof t.type&&(t.type="function")}),n},x.prototype.getHeaderFilters=function(){var t=[];for(var e in this.headerFilters)t.push({field:e,type:this.headerFilters[e].type,value:this.headerFilters[e].value});return t},x.prototype.removeFilter=function(t,e,n){var i=this;Array.isArray(t)||(t=[{field:t,type:e,value:n}]),t.forEach(function(t){var e=-1;(e="object"==a(t.field)?i.filterList.findIndex(function(e){return t===e}):i.filterList.findIndex(function(e){return t.field===e.field&&t.type===e.type&&t.value===e.value}))>-1?(i.filterList.splice(e,1),i.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)}),this.table.options.persistentFilter&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("filter")},x.prototype.clearFilter=function(t){this.filterList=[],t&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistentFilter&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("filter")},x.prototype.clearHeaderFilter=function(){var t=this;this.headerFilters={},this.headerFilterColumns.forEach(function(e){e.modules.filter.value=null,t.reloadHeaderFilter(e)}),this.changed=!0},x.prototype.search=function(t,e,n,i){var o=this,r=[],a=[];return Array.isArray(e)||(e=[{field:e,type:n,value:i}]),e.forEach(function(t){(t=o.findFilter(t))&&a.push(t)}),this.table.rowManager.rows.forEach(function(e){var n=!0;a.forEach(function(t){o.filterRecurse(t,e.getData())||(n=!1)}),n&&r.push("data"===t?e.getData("data"):e.getComponent())}),r},x.prototype.filter=function(t,e){var n=this,i=[],o=[];return n.table.options.dataFiltering&&n.table.options.dataFiltering.call(n.table,n.getFilters()),n.table.options.ajaxFiltering||!n.filterList.length&&!Object.keys(n.headerFilters).length?i=t.slice(0):t.forEach(function(t){n.filterRow(t)&&i.push(t)}),n.table.options.dataFiltered&&(i.forEach(function(t){o.push(t.getComponent())}),n.table.options.dataFiltered.call(n.table,n.getFilters(),o)),i},x.prototype.filterRow=function(t,e){var n=this,i=!0,o=t.getData();for(var r in n.filterList.forEach(function(t){n.filterRecurse(t,o)||(i=!1)}),n.headerFilters)n.headerFilters[r].func(o)||(i=!1);return i},x.prototype.filterRecurse=function(t,e){var n=this,i=!1;return Array.isArray(t)?t.forEach(function(t){n.filterRecurse(t,e)&&(i=!0)}):i=t.func(e),i},x.prototype.filters={"=":function(t,e,n,i){return e==t},"<":function(t,e,n,i){return e<t},"<=":function(t,e,n,i){return e<=t},">":function(t,e,n,i){return e>t},">=":function(t,e,n,i){return e>=t},"!=":function(t,e,n,i){return e!=t},regex:function(t,e,n,i){return"string"==typeof t&&(t=new RegExp(t)),t.test(e)},like:function(t,e,n,i){return null===t||void 0===t?e===t:void 0!==e&&null!==e&&String(e).toLowerCase().indexOf(t.toLowerCase())>-1},in:function(t,e,n,i){return Array.isArray(t)?t.indexOf(e)>-1:(console.warn("Filter Error - filter value is not an array:",t),!1)}},h.prototype.registerModule("filter",x);var S=function(t){this.table=t};S.prototype.initializeColumn=function(t){var e={params:t.definition.formatterParams||{}};switch(a(t.definition.formatter)){case"string":"tick"===t.definition.formatter&&(t.definition.formatter="tickCross",void 0===e.params.crossElement&&(e.params.crossElement=!1),console.warn("DEPRECATION WANRING - the tick formatter has been depricated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[t.definition.formatter]?e.formatter=this.formatters[t.definition.formatter]:(console.warn("Formatter Error - No such formatter found: ",t.definition.formatter),e.formatter=this.formatters.plaintext);break;case"function":e.formatter=t.definition.formatter;break;default:e.formatter=this.formatters.plaintext}t.modules.format=e},S.prototype.cellRendered=function(t){t.column.modules.format.renderedCallback&&t.column.modules.format.renderedCallback()},S.prototype.formatValue=function(t){var e=t.getComponent(),n="function"==typeof t.column.modules.format.params?t.column.modules.format.params(e):t.column.modules.format.params;return t.column.modules.format.formatter.call(this,e,n,function(e){t.column.modules.format.renderedCallback=e})},S.prototype.sanitizeHTML=function(t){if(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}return t},S.prototype.emptyToSpace=function(t){return null===t||void 0===t?"&nbsp":t},S.prototype.getFormatter=function(t){switch(void 0===t?"undefined":a(t)){case"string":this.formatters[t]?t=this.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=this.formatters.plaintext);break;case"function":t=t;break;default:t=this.formatters.plaintext}return t},S.prototype.formatters={plaintext:function(t,e,n){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))},html:function(t,e,n){return t.getValue()},textarea:function(t,e,n){return t.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(t.getValue()))},money:function(t,e,n){var i,o,r,a,s=parseFloat(t.getValue()),l=e.decimal||".",u=e.thousand||",",c=e.symbol||"",h=!!e.symbolAfter,d=void 0!==e.precision?e.precision:2;if(isNaN(s))return this.emptyToSpace(this.sanitizeHTML(t.getValue()));for(i=!1!==d?s.toFixed(d):s,o=(i=String(i).split("."))[0],r=i.length>1?l+i[1]:"",a=/(\d+)(\d{3})/;a.test(o);)o=o.replace(a,"$1"+u+"$2");return h?o+r+c:c+o+r},link:function(t,e,n){var i=t.getValue(),o=e.urlPrefix||"",r=this.emptyToSpace(i),s=document.createElement("a");if(e.labelField&&(r=t.getData()[e.labelField]),e.label)switch(a(e.label)){case"string":r=e.label;break;case"function":r=e.label(t)}if(e.urlField&&(i=t.getData()[e.urlField]),e.url)switch(a(e.url)){case"string":i=e.url;break;case"function":i=e.url(t)}return s.setAttribute("href",o+i),e.target&&s.setAttribute("target",e.target),s.innerHTML=this.emptyToSpace(this.sanitizeHTML(r)),s},image:function(t,e,n){var i=document.createElement("img");switch(i.setAttribute("src",t.getValue()),a(e.height)){case"number":i.style.height=e.height+"px";break;case"string":i.style.height=e.height}switch(a(e.width)){case"number":i.style.width=e.width+"px";break;case"string":i.style.width=e.width}return i.addEventListener("load",function(){t.getRow().normalizeHeight()}),i},tickCross:function(t,e,n){var i=t.getValue(),o=t.getElement(),r=e.allowEmpty,a=e.allowTruthy,s=void 0!==e.tickElement?e.tickElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>',l=void 0!==e.crossElement?e.crossElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';return a&&i||!0===i||"true"===i||"True"===i||1===i||"1"===i?(o.setAttribute("aria-checked",!0),s||""):!r||"null"!==i&&""!==i&&null!==i&&void 0!==i?(o.setAttribute("aria-checked",!1),l||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(t,e,n){var i=e.inputFormat||"YYYY-MM-DD hh:mm:ss",o=e.outputFormat||"DD/MM/YYYY hh:mm:ss",r=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",a=t.getValue(),s=moment(a,i);return s.isValid()?s.format(o):!0===r?a:"function"==typeof r?r(a):r},datetimediff:function(t,e,n){var i=e.inputFormat||"YYYY-MM-DD hh:mm:ss",o=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",r=void 0!==e.suffix&&e.suffix,a=void 0!==e.unit?e.unit:void 0,s=void 0!==e.humanize&&e.humanize,l=void 0!==e.date?e.date:moment(),u=t.getValue(),c=moment(u,i);return c.isValid()?s?moment.duration(c.diff(l)).humanize(r):c.diff(l,a)+(r?" "+r:""):!0===o?u:"function"==typeof o?o(u):o},lookup:function(t,e,n){var i=t.getValue();return void 0===e[i]?(console.warn("Missing display value for "+i),i):e[i]},star:function(t,e,n){var i=t.getValue(),o=t.getElement(),r=e&&e.stars?e.stars:5,a=document.createElement("span"),s=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.verticalAlign="middle",s.setAttribute("width","14"),s.setAttribute("height","14"),s.setAttribute("viewBox","0 0 512 512"),s.setAttribute("xml:space","preserve"),s.style.padding="0 1px",i=parseInt(i)<r?parseInt(i):r;for(var l=1;l<=r;l++){var u=s.cloneNode(!0);u.innerHTML=l<=i?'<polygon fill="#FFEA00" stroke="#C1AB60" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>':'<polygon fill="#D2D2D2" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>',a.appendChild(u)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",i),a},traffic:function(t,e,n){var i,o,r=this.sanitizeHTML(t.getValue())||0,s=document.createElement("span"),l=e&&e.max?e.max:100,u=e&&e.min?e.min:0,c=e&&void 0!==e.color?e.color:["red","orange","green"],h="#666666";if(!isNaN(r)&&void 0!==t.getValue()){switch(s.classList.add("tabulator-traffic-light"),o=parseFloat(r)<=l?parseFloat(r):l,o=parseFloat(o)>=u?parseFloat(o):u,i=(l-u)/100,o=Math.round((o-u)/i),void 0===c?"undefined":a(c)){case"string":h=c;break;case"function":h=c(r);break;case"object":if(Array.isArray(c)){var d=100/c.length,f=Math.floor(o/d);f=Math.min(f,c.length-1),h=c[f=Math.max(f,0)];break}}return s.style.backgroundColor=h,s}},progress:function(t,e,n){var i,o,r,s,l,u=this.sanitizeHTML(t.getValue())||0,c=t.getElement(),h=e&&e.max?e.max:100,d=e&&e.min?e.min:0,f=e&&e.legendAlign?e.legendAlign:"center";switch(o=parseFloat(u)<=h?parseFloat(u):h,o=parseFloat(o)>=d?parseFloat(o):d,i=(h-d)/100,o=Math.round((o-d)/i),a(e.color)){case"string":r=e.color;break;case"function":r=e.color(u);break;case"object":if(Array.isArray(e.color)){var p=100/e.color.length,g=Math.floor(o/p);g=Math.min(g,e.color.length-1),g=Math.max(g,0),r=e.color[g];break}default:r="#2DC214"}switch(a(e.legend)){case"string":s=e.legend;break;case"function":s=e.legend(u);break;case"boolean":s=u;break;default:s=!1}switch(a(e.legendColor)){case"string":l=e.legendColor;break;case"function":l=e.legendColor(u);break;case"object":if(Array.isArray(e.legendColor)){p=100/e.legendColor.length,g=Math.floor(o/p);g=Math.min(g,e.legendColor.length-1),g=Math.max(g,0),l=e.legendColor[g]}break;default:l="#000"}return c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",o),"<div style='position:realtive; height:100%;' data-max='"+h+"' data-min='"+d+"'><div style='position:relative; height:100%; width:calc("+o+"%); background-color:"+r+"; display:inline-block;'></div></div>"+(s?"<div style='position:absolute; top:4px; left:0; text-align:"+f+"; width:100%; color:"+l+";'>"+s+"</div>":"")},color:function(t,e,n){return t.getElement().style.backgroundColor=this.sanitizeHTML(t.getValue()),""},buttonTick:function(t,e,n){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>'},buttonCross:function(t,e,n){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>'},rownum:function(t,e,n){return this.table.rowManager.activeRows.indexOf(t.getRow()._getSelf())+1},handle:function(t,e,n){return t.getElement().classList.add("tabulator-row-handle"),"<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>"},responsiveCollapse:function(t,e,n){var i=!1,o=document.createElement("div");function r(e){var n=t.getRow().getElement().getElementsByClassName("tabulator-responsive-collapse")[0];(i=e)?(o.classList.add("open"),n&&(n.style.display="")):(o.classList.remove("open"),n&&(n.style.display="none"))}return o.classList.add("tabulator-responsive-collapse-toggle"),o.innerHTML="<span class='tabulator-responsive-collapse-toggle-open'>+</span><span class='tabulator-responsive-collapse-toggle-close'>-</span>",t.getElement().classList.add("tabulator-row-handle"),this.table.options.responsiveLayoutCollapseStartOpen&&(i=!0),o.addEventListener("click",function(t){t.stopImmediatePropagation(),r(!i)}),r(i),o}},h.prototype.registerModule("format",S);var E=function(t){this.table=t,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.initializationMode="left",this.active=!1};E.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1},E.prototype.initializeColumn=function(t){var e={margin:0,edge:!1};t.definition.frozen?t.parent.isGroup?console.warn("Frozen Column Error - Grouped columns cannot be frozen"):t.isGroup?console.warn("Frozen Column Error - Column Groups cannot be frozen"):(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=e):this.initializationMode="right"},E.prototype.layout=function(){var t=this,e=(this.table.rowManager.element,0);t.active&&(t.leftMargin=t._calcSpace(t.leftColumns,t.leftColumns.length),t.table.columnManager.headersElement.style.marginLeft=t.leftMargin+"px",t.rightMargin=t._calcSpace(t.rightColumns,t.rightColumns.length),t.table.columnManager.element.style.paddingRight=t.rightMargin+"px",t.table.rowManager.activeRows.forEach(function(e){t.layoutRow(e)}),t.table.options.dataTree&&t.table.rowManager.getDisplayRows().forEach(function(e){t.layoutRow(e)}),t.table.modExists("columnCalcs")&&(t.table.modules.columnCalcs.topInitialized&&t.table.modules.columnCalcs.topRow&&t.layoutRow(t.table.modules.columnCalcs.topRow),t.table.modules.columnCalcs.botInitialized&&t.table.modules.columnCalcs.botRow&&t.layoutRow(t.table.modules.columnCalcs.botRow)),t.leftColumns.forEach(function(e,n){e.modules.frozen.margin=t._calcSpace(t.leftColumns,n)+t.table.columnManager.scrollLeft,n==t.leftColumns.length-1?e.modules.frozen.edge=!0:e.modules.frozen.edge=!1,t.layoutColumn(e)}),e=t.table.rowManager.element.clientWidth+t.table.columnManager.scrollLeft,t.rightColumns.forEach(function(n,i){n.modules.frozen.margin=e-t._calcSpace(t.rightColumns,i+1),i==t.rightColumns.length-1?n.modules.frozen.edge=!0:n.modules.frozen.edge=!1,t.layoutColumn(n)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin+"px")},E.prototype.layoutColumn=function(t){var e=this;e.layoutElement(t.getElement(),t),t.cells.forEach(function(n){e.layoutElement(n.getElement(),t)})},E.prototype.layoutRow=function(t){t.getElement().style.paddingLeft=this.leftMargin+"px"},E.prototype.layoutElement=function(t,e){e.modules.frozen&&(t.style.position="absolute",t.style.left=e.modules.frozen.margin+"px",t.classList.add("tabulator-frozen"),e.modules.frozen.edge&&t.classList.add("tabulator-frozen-"+e.modules.frozen.position))},E.prototype._calcSpace=function(t,e){for(var n=0,i=0;i<e;i++)t[i].visible&&(n+=t[i].getWidth());return n},h.prototype.registerModule("frozenColumns",E);var C=function(t){this.table=t,this.topElement=document.createElement("div"),this.rows=[],this.displayIndex=0};C.prototype.initialize=function(){this.rows=[],this.topElement.classList.add("tabulator-frozen-rows-holder"),this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling)},C.prototype.setDisplayIndex=function(t){this.displayIndex=t},C.prototype.getDisplayIndex=function(){return this.displayIndex},C.prototype.isFrozen=function(){return!!this.rows.length},C.prototype.getRows=function(t){var e=t.slice(0);return this.rows.forEach(function(t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}),e},C.prototype.freezeRow=function(t){t.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(t.modules.frozen=!0,this.topElement.appendChild(t.getElement()),t.initialize(),t.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(t),this.table.rowManager.refreshActiveData("display"),this.styleRows())},C.prototype.unfreezeRow=function(t){var e=this.rows.indexOf(t);if(t.modules.frozen){t.modules.frozen=!1;var n=t.getElement();n.parentNode.removeChild(n),this.table.rowManager.adjustTableSize(),this.rows.splice(e,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},C.prototype.styleRows=function(t){var e=this;this.rows.forEach(function(t,n){e.table.rowManager.styleRow(t,n)})},h.prototype.registerModule("frozenRows",C);var T=function(t){this._group=t,this.type="GroupComponent"};T.prototype.getKey=function(){return this._group.key},T.prototype.getElement=function(){return this._group.element},T.prototype.getRows=function(){return this._group.getRows(!0)},T.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},T.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},T.prototype.getVisibility=function(){return this._group.visible},T.prototype.show=function(){this._group.show()},T.prototype.hide=function(){this._group.hide()},T.prototype.toggle=function(){this._group.toggleVisibility()},T.prototype._getSelf=function(){return this._group},T.prototype.getTable=function(){return this._group.groupManager.table};var M=function(t,e,n,i,o,r,a){this.groupManager=t,this.parent=e,this.key=i,this.level=n,this.field=o,this.hasSubGroups=n<t.groupIDLookups.length-1,this.addRow=this.hasSubGroups?this._addRowToGroup:this._addRow,this.type="group",this.old=a,this.rows=[],this.groups=[],this.groupList=[],this.generator=r,this.elementContents=!1,this.height=0,this.outerHeight=0,this.initialized=!1,this.calcs={},this.initialized=!1,this.modules={},this.arrowElement=!1,this.visible=a?a.visible:void 0!==t.startOpen[n]?t.startOpen[n]:t.startOpen[0],this.createElements(),this.addBindings(),this.createValueGroups()};M.prototype.createElements=function(){this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-arrow"),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)},M.prototype.createValueGroups=function(){var t=this,e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach(function(n){t._createGroup(n,e)})},M.prototype.addBindings=function(){var t,e,n,i=this;i.groupManager.table.options.groupClick&&i.element.addEventListener("click",function(t){i.groupManager.table.options.groupClick(t,i.getComponent())}),i.groupManager.table.options.groupDblClick&&i.element.addEventListener("dblclick",function(t){i.groupManager.table.options.groupDblClick(t,i.getComponent())}),i.groupManager.table.options.groupContext&&i.element.addEventListener("contextmenu",function(t){i.groupManager.table.options.groupContext(t,i.getComponent())}),i.groupManager.table.options.groupTap&&(n=!1,i.element.addEventListener("touchstart",function(t){n=!0}),i.element.addEventListener("touchend",function(t){n&&i.groupManager.table.options.groupTap(t,i.getComponent()),n=!1})),i.groupManager.table.options.groupDblTap&&(t=null,i.element.addEventListener("touchend",function(e){t?(clearTimeout(t),t=null,i.groupManager.table.options.groupDblTap(e,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.groupManager.table.options.groupTapHold&&(e=null,i.element.addEventListener("touchstart",function(t){clearTimeout(e),e=setTimeout(function(){clearTimeout(e),e=null,n=!1,i.groupManager.table.options.groupTapHold(t,i.getComponent())},1e3)}),i.element.addEventListener("touchend",function(t){clearTimeout(e),e=null})),i.groupManager.table.options.groupToggleElement&&("arrow"==i.groupManager.table.options.groupToggleElement?i.arrowElement:i.element).addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),i.toggleVisibility()})},M.prototype._createGroup=function(t,e){var n=e+"_"+t,i=new M(this.groupManager,this,e,t,this.groupManager.groupIDLookups[e].field,this.groupManager.headerGenerator[e]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[n]);this.groups[n]=i,this.groupList.push(i)},M.prototype._addRowToGroup=function(t){var e=this.level+1;if(this.hasSubGroups){var n=this.groupManager.groupIDLookups[e].func(t.getData()),i=e+"_"+n;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]?this.groups[i]&&this.groups[i].addRow(t):(this.groups[i]||this._createGroup(n,e),this.groups[i].addRow(t))}},M.prototype._addRow=function(t){this.rows.push(t),t.modules.group=this},M.prototype.insertRow=function(t,e,n){var i=this.conformRowData({});t.updateData(i);var o=this.rows.indexOf(e);o>-1?n?this.rows.splice(o+1,0,t):this.rows.splice(o,0,t):n?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)},M.prototype.scrollHeader=function(t){this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(e){e.scrollHeader(t)})},M.prototype.getRowIndex=function(t){},M.prototype.conformRowData=function(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t},M.prototype.removeRow=function(t){var e=this.rows.indexOf(t);e>-1&&this.rows.splice(e,1),this.groupManager.table.options.groupValues||this.rows.length?(this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},M.prototype.removeGroup=function(t){var e,n=t.level+"_"+t.key;this.groups[n]&&(delete this.groups[n],(e=this.groupList.indexOf(t))>-1&&this.groupList.splice(e,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},M.prototype.getHeadersAndRows=function(t){var e=[];return e.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(n){e=e.concat(n.getHeadersAndRows(t))}):(!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&this.calcs.top.detachElement(),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),e=e.concat(this.rows),!t&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&this.calcs.bottom.detachElement(),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))):!this.groupList.length&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.options.groupClosedShowCalcs&&this.groupManager.table.modExists("columnCalcs")&&(!t&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&this.calcs.top.detachElement(),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),!t&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&this.calcs.bottom.detachElement(),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))),e},M.prototype.getData=function(t,e){var n=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(t){n.push(t.getData(e||"data"))}),n},M.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(e){t+=e.getRowCount()}):t=this.rows.length,t},M.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},M.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){t.detachElement()})}):this.rows.forEach(function(t){var e=t.getElement();e.parentNode.removeChild(e)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},M.prototype.show=function(){if(this.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var t=this.getElement();this.groupList.length?this.groupList.forEach(function(e){e.getHeadersAndRows().forEach(function(e){var n=e.getElement();t.parentNode.insertBefore(n,t.nextSibling),e.initialize(),t=n})}):this.rows.forEach(function(e){var n=e.getElement();t.parentNode.insertBefore(n,t.nextSibling),e.initialize(),t=n}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},M.prototype._visSet=function(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(e){t.push(e.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))},M.prototype.getRowGroup=function(t){var e=!1;return this.groupList.length?this.groupList.forEach(function(n){var i=n.getRowGroup(t);i&&(e=i)}):this.rows.find(function(e){return e===t})&&(e=this),e},M.prototype.getSubGroups=function(t){var e=[];return this.groupList.forEach(function(n){e.push(t?n.getComponent():n)}),e},M.prototype.getRows=function(t){var e=[];return this.rows.forEach(function(n){e.push(t?n.getComponent():n)}),e},M.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(e){t.push(e.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},M.prototype.getElement=function(){this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var t=0;t<this.element.childNodes.length;++t)this.element.childNodes[t].parentNode.removeChild(this.element.childNodes[t]);return this.generateGroupHeaderContents(),this.element},M.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},M.prototype.normalizeHeight=function(){this.setHeight(this.element.clientHeight)},M.prototype.initialize=function(t){this.initialized&&!t||(this.normalizeHeight(),this.initialized=!0)},M.prototype.reinitialize=function(){this.initialized=!1,this.height=0,h.prototype.helpers.elVisible(this.element)&&this.initialize(!0)},M.prototype.setHeight=function(t){this.height!=t&&(this.height=t,this.outerHeight=this.element.offsetHeight)},M.prototype.getHeight=function(){return this.outerHeight},M.prototype.getGroup=function(){return this},M.prototype.reinitializeHeight=function(){},M.prototype.calcHeight=function(){},M.prototype.setCellHeight=function(){},M.prototype.clearCellHeight=function(){},M.prototype.getComponent=function(){return new T(this)};var P=function(t){this.table=t,this.groupIDLookups=!1,this.startOpen=[function(){return!1}],this.headerGenerator=[function(){return""}],this.groupList=[],this.allowedValues=!1,this.groups={},this.displayIndex=0};P.prototype.initialize=function(){var t=this,e=t.table.options.groupBy,n=t.table.options.groupStartOpen,i=t.table.options.groupHeader;(this.allowedValues=t.table.options.groupValues,t.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],t.table.modules.localize.bind("groups|item",function(e,n){t.headerGenerator[0]=function(t,i,o){return(void 0===t?"":t)+"<span>("+i+" "+(1===i?e:n.groups.items)+")</span>"}}),this.groupIDLookups=[],Array.isArray(e)||e)?this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs():this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs&&this.table.columnManager.getRealColumns().forEach(function(e){e.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()});Array.isArray(e)||(e=[e]),e.forEach(function(e,n){var i,o;i="function"==typeof e?e:(o=t.table.columnManager.getColumnByField(e))?function(t){return o.getFieldValue(t)}:function(t){return t[e]},t.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!t.allowedValues&&t.allowedValues[n]})}),n&&(Array.isArray(n)||(n=[n]),n.forEach(function(t){t="function"==typeof t?t:function(){return!0}}),t.startOpen=n),i&&(t.headerGenerator=Array.isArray(i)?i:[i]),this.initialized=!0},P.prototype.setDisplayIndex=function(t){this.displayIndex=t},P.prototype.getDisplayIndex=function(){return this.displayIndex},P.prototype.getRows=function(t){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(t),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):t.slice(0)},P.prototype.getGroups=function(t){var e=[];return this.groupList.forEach(function(n){e.push(t?n.getComponent():n)}),e},P.prototype.pullGroupListData=function(t){var e=this,n=[];return t.forEach(function(t){var i={level:0,rowCount:0,headerContent:""},o=[];t.hasSubGroups?(o=e.pullGroupListData(t.groupList),i.level=t.level,i.rowCount=o.length-t.groupList.length,i.headerContent=t.generator(t.key,i.rowCount,t.rows,t),n.push(i),n=n.concat(o)):(i.level=t.level,i.headerContent=t.generator(t.key,t.rows.length,t.rows,t),i.rowCount=t.getRows().length,n.push(i),t.getRows().forEach(function(t){n.push(t.getData("data"))}))}),n},P.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},P.prototype.getRowGroup=function(t){var e=!1;return this.groupList.forEach(function(n){var i=n.getRowGroup(t);i&&(e=i)}),e},P.prototype.countGroups=function(){return this.groupList.length},P.prototype.generateGroups=function(t){var e=this,n=e.groups;e.groups={},e.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(t){e.createGroup(t,0,n)}),t.forEach(function(t){e.assignRowToExistingGroup(t,n)})):t.forEach(function(t){e.assignRowToGroup(t,n)})},P.prototype.createGroup=function(t,e,n){var i,o=e+"_"+t;n=n||[],i=new M(this,!1,e,t,this.groupIDLookups[0].field,this.headerGenerator[0],n[o]),this.groups[o]=i,this.groupList.push(i)},P.prototype.assignRowToGroup=function(t,e){var n=this.groupIDLookups[0].func(t.getData()),i="0_"+n;this.groups[i]||this.createGroup(n,0,e),this.groups[i].addRow(t)},P.prototype.assignRowToExistingGroup=function(t,e){var n="0_"+this.groupIDLookups[0].func(t.getData());this.groups[n]&&this.groups[n].addRow(t)},P.prototype.assignRowToGroup=function(t,e){var n=this.groupIDLookups[0].func(t.getData()),i=!this.groups["0_"+n];return i&&this.createGroup(n,0,e),this.groups["0_"+n].addRow(t),!i},P.prototype.updateGroupRows=function(t){var e=[];if(this.groupList.forEach(function(t){e=e.concat(t.getHeadersAndRows())}),t){var n=this.table.rowManager.setDisplayRows(e,this.getDisplayIndex());!0!==n&&this.setDisplayIndex(n),this.table.rowManager.refreshActiveData("group",!0,!0)}return e},P.prototype.scrollHeaders=function(t){t+="px",this.groupList.forEach(function(e){e.scrollHeader(t)})},P.prototype.removeGroup=function(t){var e,n=t.level+"_"+t.key;this.groups[n]&&(delete this.groups[n],(e=this.groupList.indexOf(t))>-1&&this.groupList.splice(e,1))},h.prototype.registerModule("groupRows",P);var L=function(t){this.table=t,this.history=[],this.index=-1};L.prototype.clear=function(){this.history=[],this.index=-1},L.prototype.action=function(t,e,n){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:e,data:n}),this.index++},L.prototype.getHistoryUndoSize=function(){return this.index+1},L.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},L.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.options.historyUndo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},L.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},L.prototype.undoers={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue)},rowAdd:function(t){t.component.deleteActual()},rowDelete:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this._rebindRow(t.component,e)},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.pos],!1),this.table.rowManager.redraw()}},L.prototype.redoers={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue)},rowAdd:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this._rebindRow(t.component,e)},rowDelete:function(t){t.component.deleteActual()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.pos],!1),this.table.rowManager.redraw()}},L.prototype._rebindRow=function(t,e){this.history.forEach(function(n){if(n.component instanceof s)n.component===t&&(n.component=e);else if(n.component instanceof u&&n.component.row===t){var i=n.component.column.getField();i&&(n.component=e.getCell(i))}})},h.prototype.registerModule("history",L);var A=function(t){this.table=t,this.fieldIndex=[],this.hasIndex=!1};A.prototype.parseTable=function(){var t=this.table.element,e=this.table.options,n=(e.columns,t.getElementsByTagName("th")),i=t.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.table.options.htmlImporting.call(this.table),i=i?i.getElementsByTagName("tr"):[],this._extractOptions(t,e),n.length?this._extractHeaders(n,i):this._generateBlankHeaders(n,i);for(var r=0;r<i.length;r++){var s=i[r].getElementsByTagName("td"),l={};this.hasIndex||(l[e.index]=r);for(var u=0;u<s.length;u++){var c=s[u];void 0!==this.fieldIndex[u]&&(l[this.fieldIndex[u]]=c.innerHTML)}o.push(l)}var h=document.createElement("div"),d=t.attributes;for(var u in d)"object"==a(d[u])&&h.setAttribute(d[u].name,d[u].value);t.parentNode.replaceChild(h,t),e.data=o,this.table.options.htmlImported.call(this.table),this.table.element=h},A.prototype._extractOptions=function(t,e,n){var i=t.attributes,o=n?Object.assign([],n):Object.keys(e),r={};for(var s in o.forEach(function(t){r[t.toLowerCase()]=t}),i){var l,u=i[s];u&&"object"==(void 0===u?"undefined":a(u))&&u.name&&0===u.name.indexOf("tabulator-")&&(l=u.name.replace("tabulator-",""),void 0!==r[l]&&(e[r[l]]=this._attribValue(u.value)))}},A.prototype._attribValue=function(t){return"true"===t||"false"!==t&&t},A.prototype._findCol=function(t){return this.table.options.columns.find(function(e){return e.title===t})||!1},A.prototype._extractHeaders=function(t,e){for(var n=0;n<t.length;n++){var o,r,s=t[n],l=!1,u=this._findCol(s.textContent);for(var c in u?l=!0:u={title:s.textContent.trim()},u.field||(u.field=s.textContent.trim().toLowerCase().replace(" ","_")),(o=s.getAttribute("width"))&&!u.width&&(u.width=o),r=s.attributes,this._extractOptions(s,u,i.prototype.defaultOptionList),r){var h=r[c];h&&"object"==(void 0===h?"undefined":a(h))&&h.name&&0===h.name.indexOf("tabulator-")&&(u[h.name.replace("tabulator-","")]=this._attribValue(h.value))}this.fieldIndex[n]=u.field,u.field==this.table.options.index&&(this.hasIndex=!0),l||this.table.options.columns.push(u)}},A.prototype._generateBlankHeaders=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],o={title:"",field:"col"+n};this.fieldIndex[n]=o.field;var r=i.getAttribute("width");r&&(o.width=r),this.table.options.columns.push(o)}},h.prototype.registerModule("htmlTableImport",A);var k=function(t){this.table=t,this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1};k.prototype.initialize=function(){var t=this.table.options.keybindings,e={};if(this.watchKeys={},this.pressedKeys=[],!1!==t){for(var n in this.bindings)e[n]=this.bindings[n];if(Object.keys(t).length)for(var i in t)e[i]=t[i];this.mapBindings(e),this.bindEvents()}},k.prototype.mapBindings=function(t){var e=this,n=this,i=function(i){e.actions[i]?t[i]&&("object"!==a(t[i])&&(t[i]=[t[i]]),t[i].forEach(function(t){n.mapBinding(i,t)})):console.warn("Key Binding Error - no such action:",i)};for(var o in t)i(o)},k.prototype.mapBinding=function(t,e){var n=this,i={action:this.actions[t],keys:[],ctrl:!1,shift:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach(function(t){switch(t){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;default:t=parseInt(t),i.keys.push(t),n.watchKeys[t]||(n.watchKeys[t]=[]),n.watchKeys[t].push(i)}})},k.prototype.bindEvents=function(){var t=this;this.keyupBinding=function(e){var n=e.keyCode,i=t.watchKeys[n];i&&(t.pressedKeys.push(n),i.forEach(function(n){t.checkBinding(e,n)}))},this.keydownBinding=function(e){var n=e.keyCode;if(t.watchKeys[n]){var i=t.pressedKeys.indexOf(n);i>-1&&t.pressedKeys.splice(i,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},k.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},k.prototype.checkBinding=function(t,e){var n=this,i=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&(e.keys.forEach(function(t){-1==n.pressedKeys.indexOf(t)&&(i=!1)}),i&&e.action.call(n,t),!0)},k.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},k.prototype.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,n=e.scrollTop-e.height;e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(n>=0?e.element.scrollTop=n:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,n=e.scrollTop+e.height,i=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(n<=i?e.element.scrollTop=n:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().prev())},navNext:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().next())},navLeft:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().left())},navRight:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().right())},navUp:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().up())},navDown:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().down())},undo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.undo()))},redo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(this.table.options.selectable&&"highlight"!=this.table.options.selectable?"selected":"active",null,null,null,!0)}},h.prototype.registerModule("keybindings",k);var O=function(t){this.table=t,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};O.prototype.createPlaceholderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.classList.add("tabulator-col-placeholder"),t},O.prototype.initializeColumn=function(t){var e,n=this,i={};t.modules.frozen||(e=t.getElement(),i.mousemove=function(i){t.parent===n.moving.parent&&((n.touchMove?i.touches[0].pageX:i.pageX)-h.prototype.helpers.elOffset(e).left+n.table.columnManager.element.scrollLeft>t.getWidth()/2?n.toCol===t&&n.toColAfter||(e.parentNode.insertBefore(n.placeholderElement,e.nextSibling),n.moveColumn(t,!0)):(n.toCol!==t||n.toColAfter)&&(e.parentNode.insertBefore(n.placeholderElement,e),n.moveColumn(t,!1)))}.bind(n),e.addEventListener("mousedown",function(e){n.touchMove=!1,1===e.which&&(n.checkTimeout=setTimeout(function(){n.startMove(e,t)},n.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&n.checkTimeout&&clearTimeout(n.checkTimeout)}),n.bindTouchEvents(t)),t.modules.moveColumn=i},O.prototype.bindTouchEvents=function(t){var e,n,i,o,r,a,s=this,l=t.getElement(),u=!1;l.addEventListener("touchstart",function(l){s.checkTimeout=setTimeout(function(){s.touchMove=!0,t,e=t.nextColumn(),i=e?e.getWidth()/2:0,n=t.prevColumn(),o=n?n.getWidth()/2:0,r=0,a=0,u=!1,s.startMove(l,t)},s.checkPeriod)}),l.addEventListener("touchmove",function(l){var c,h;s.moving&&(s.moveHover(l),u||(u=l.touches[0].pageX),(c=l.touches[0].pageX-u)>0?e&&c-r>i&&(h=e)!==t&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(s.placeholderElement,h.getElement().nextSibling),s.moveColumn(h,!0)):n&&-c-a>o&&(h=n)!==t&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(s.placeholderElement,h.getElement()),s.moveColumn(h,!1)),h&&(h,e=h.nextColumn(),r=i,i=e?e.getWidth()/2:0,n=h.prevColumn(),a=o,o=n?n.getWidth()/2:0))}),l.addEventListener("touchend",function(t){s.checkTimeout&&clearTimeout(s.checkTimeout),s.moving&&s.endMove(t)})},O.prototype.startMove=function(t,e){var n=e.getElement();this.moving=e,this.startX=(this.touchMove?t.touches[0].pageX:t.pageX)-h.prototype.helpers.elOffset(n).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",n.parentNode.insertBefore(this.placeholderElement,n),n.parentNode.removeChild(n),this.hoverElement=n.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(t)},O.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().addEventListener("mousemove",t.modules.moveColumn.mousemove)})},O.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().removeEventListener("mousemove",t.modules.moveColumn.mousemove)})},O.prototype.moveColumn=function(t,e){var n=this.moving.getCells();this.toCol=t,this.toColAfter=e,e?t.getCells().forEach(function(t,e){var i=t.getElement();i.parentNode.insertBefore(n[e].getElement(),i.nextSibling)}):t.getCells().forEach(function(t,e){var i=t.getElement();i.parentNode.insertBefore(n[e].getElement(),i)})},O.prototype.endMove=function(t){(1===t.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumn(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))},O.prototype.moveHover=function(t){var e,n=this,i=n.table.columnManager.getElement(),o=i.scrollLeft,r=(n.touchMove?t.touches[0].pageX:t.pageX)-h.prototype.helpers.elOffset(i).left+o;n.hoverElement.style.left=r-n.startX+"px",r-o<n.autoScrollMargin&&(n.autoScrollTimeout||(n.autoScrollTimeout=setTimeout(function(){e=Math.max(0,o-5),n.table.rowManager.getElement().scrollLeft=e,n.autoScrollTimeout=!1},1))),o+i.clientWidth-r<n.autoScrollMargin&&(n.autoScrollTimeout||(n.autoScrollTimeout=setTimeout(function(){e=Math.min(i.clientWidth,o+5),n.table.rowManager.getElement().scrollLeft=e,n.autoScrollTimeout=!1},1)))},h.prototype.registerModule("moveColumn",O);var R=function(t){this.table=t,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connections=[],this.connectedTable=!1,this.connectedRow=!1};R.prototype.createPlaceholderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.classList.add("tabulator-row-placeholder"),t},R.prototype.initialize=function(t){this.connection=this.table.options.movableRowsConnectedTables},R.prototype.setHandle=function(t){this.hasHandle=t},R.prototype.initializeGroupHeader=function(t){var e=this,n={};n.mouseup=function(t){e.tableRowDrop(t,row)}.bind(e),n.mousemove=function(n){var i;n.pageY-h.prototype.helpers.elOffset(t.element).top+e.table.rowManager.element.scrollTop>t.getHeight()/2?e.toRow===t&&e.toRowAfter||((i=t.getElement()).parentNode.insertBefore(e.placeholderElement,i.nextSibling),e.moveRow(t,!0)):(e.toRow!==t||e.toRowAfter)&&(i=t.getElement()).previousSibling&&(i.parentNode.insertBefore(e.placeholderElement,i),e.moveRow(t,!1))}.bind(e),t.modules.moveRow=n},R.prototype.initializeRow=function(t){var e,n=this,i={};i.mouseup=function(e){n.tableRowDrop(e,t)}.bind(n),i.mousemove=function(e){var i;e.pageY-h.prototype.helpers.elOffset(t.element).top+n.table.rowManager.element.scrollTop>t.getHeight()/2?n.toRow===t&&n.toRowAfter||((i=t.getElement()).parentNode.insertBefore(n.placeholderElement,i.nextSibling),n.moveRow(t,!0)):(n.toRow!==t||n.toRowAfter)&&((i=t.getElement()).parentNode.insertBefore(n.placeholderElement,i),n.moveRow(t,!1))}.bind(n),this.hasHandle||((e=t.getElement()).addEventListener("mousedown",function(e){1===e.which&&(n.checkTimeout=setTimeout(function(){n.startMove(e,t)},n.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&n.checkTimeout&&clearTimeout(n.checkTimeout)}),this.bindTouchEvents(t,t.getElement())),t.modules.moveRow=i},R.prototype.initializeCell=function(t){var e=this,n=t.getElement();n.addEventListener("mousedown",function(n){1===n.which&&(e.checkTimeout=setTimeout(function(){e.startMove(n,t.row)},e.checkPeriod))}),n.addEventListener("mouseup",function(t){1===t.which&&e.checkTimeout&&clearTimeout(e.checkTimeout)}),this.bindTouchEvents(t.row,t.getElement())},R.prototype.bindTouchEvents=function(t,e){var n,i,o,r,a,s,l=this,u=!1;e.addEventListener("touchstart",function(e){l.checkTimeout=setTimeout(function(){l.touchMove=!0,t,n=t.nextRow(),o=n?n.getHeight()/2:0,i=t.prevRow(),r=i?i.getHeight()/2:0,a=0,s=0,u=!1,l.startMove(e,t)},l.checkPeriod)}),this.moving,this.toRow,this.toRowAfter,e.addEventListener("touchmove",function(e){var c,h;l.moving&&(e.preventDefault(),l.moveHover(e),u||(u=e.touches[0].pageY),(c=e.touches[0].pageY-u)>0?n&&c-a>o&&(h=n)!==t&&(u=e.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveRow(h,!0)):i&&-c-s>r&&(h=i)!==t&&(u=e.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveRow(h,!1)),h&&(h,n=h.nextRow(),a=o,o=n?n.getHeight()/2:0,i=h.prevRow(),s=r,r=i?i.getHeight()/2:0))}),e.addEventListener("touchend",function(t){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&(l.endMove(t),l.touchMove=!1)})},R.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(t){"row"!==t.type&&"group"!==t.type||!t.modules.moveRow.mousemove||t.getElement().addEventListener("mousemove",t.modules.moveRow.mousemove)})},R.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(t){"row"!==t.type&&"group"!==t.type||!t.modules.moveRow.mousemove||t.getElement().removeEventListener("mousemove",t.modules.moveRow.mousemove)})},R.prototype.startMove=function(t,e){var n=e.getElement();this.setStartPosition(t,e),this.moving=e,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(e)):(n.parentNode.insertBefore(this.placeholderElement,n),n.parentNode.removeChild(n)),this.hoverElement=n.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(t)},R.prototype.setStartPosition=function(t,e){var n,i,o=this.touchMove?t.touches[0].pageX:t.pageX,r=this.touchMove?t.touches[0].pageY:t.pageY;n=e.getElement(),this.connection?(i=n.getBoundingClientRect(),this.startX=i.left-o+window.scrollX,this.startY=i.top-r+window.scrollY):this.startY=r-n.getBoundingClientRect().top},R.prototype.endMove=function(t){t&&1!==t.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))},R.prototype.moveRow=function(t,e){this.toRow=t,this.toRowAfter=e},R.prototype.moveHover=function(t){this.connection?this.moveHoverConnections.call(this,t):this.moveHoverTable.call(this,t)},R.prototype.moveHoverTable=function(t){var e=this.table.rowManager.getElement(),n=e.scrollTop,i=(this.touchMove?t.touches[0].pageY:t.pageY)-e.getBoundingClientRect().top+n;this.hoverElement.style.top=i-this.startY+"px"},R.prototype.moveHoverConnections=function(t){this.hoverElement.style.left=this.startX+(this.touchMove?t.touches[0].pageX:t.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?t.touches[0].pageY:t.pageY)+"px"},R.prototype.connectToTables=function(t){var e=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStart.call(this.table,e),this.table.modules.comms.send(this.connection,"moveRow","connect",{row:t})},R.prototype.disconnectFromTables=function(){var t=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStop.call(this.table,t),this.table.modules.comms.send(this.connection,"moveRow","disconnect")},R.prototype.connect=function(t,e){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=t,this.connectedRow=e,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().addEventListener("mouseup",t.modules.moveRow.mouseup)}),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,e,t),!0)},R.prototype.disconnect=function(t){t===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(function(t){"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().removeEventListener("mouseup",t.modules.moveRow.mouseup)}),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,t)):console.warn("Move Row Error - trying to disconnect from non connected table")},R.prototype.dropComplete=function(t,e,n){var i=!1;if(n){switch(a(this.table.options.movableRowsSender)){case"string":i=this.senders[this.table.options.movableRowsSender];break;case"function":i=this.table.options.movableRowsSender}i?i.call(this,this.moving.getComponent(),e?e.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),e?e.getComponent():void 0,t)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),e?e.getComponent():void 0,t);this.endMove()},R.prototype.tableRowDrop=function(t,e){var n=!1,i=!1;switch(t.stopImmediatePropagation(),a(this.table.options.movableRowsReceiver)){case"string":n=this.receivers[this.table.options.movableRowsReceiver];break;case"function":n=this.table.options.movableRowsReceiver}n?i=n.call(this,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),i?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:e,success:i})},R.prototype.receivers={insert:function(t,e,n){return this.table.addRow(t.getData(),void 0,e),!0},add:function(t,e,n){return this.table.addRow(t.getData()),!0},update:function(t,e,n){return!!e&&(e.update(t.getData()),!0)},replace:function(t,e,n){return!!e&&(this.table.addRow(t.getData(),void 0,e),e.delete(),!0)}},R.prototype.senders={delete:function(t,e,n){t.delete()}},R.prototype.commsReceived=function(t,e,n){switch(e){case"connect":return this.connect(t,n.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,n.row,n.success)}},h.prototype.registerModule("moveRow",R);var D=function(t){this.table=t,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};D.prototype.initializeColumn=function(t){var e=this,n=!1,i={};this.allowedTypes.forEach(function(o){var r,a="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));t.definition[a]&&(r=e.lookupMutator(t.definition[a]))&&(n=!0,i[a]={mutator:r,params:t.definition[a+"Params"]||{}})}),n&&(t.modules.mutate=i)},D.prototype.lookupMutator=function(t){var e=!1;switch(void 0===t?"undefined":a(t)){case"string":this.mutators[t]?e=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":e=t}return e},D.prototype.transformRow=function(t,e,n){var i,o="mutator"+(e.charAt(0).toUpperCase()+e.slice(1));return this.enabled&&this.table.columnManager.traverse(function(r){var a,s,l;r.modules.mutate&&(a=r.modules.mutate[o]||r.modules.mutate.mutator||!1)&&(i=r.getFieldValue(t),(!n||n&&void 0!==i)&&(l=r.getComponent(),s="function"==typeof a.params?a.params(i,t,e,l):a.params,r.setFieldValue(t,a.mutator(i,t,e,s,l))))}),t},D.prototype.transformCell=function(t,e){var n=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1;return n?n.mutator(e,t.row.getData(),"edit",n.params,t.getComponent()):e},D.prototype.enable=function(){this.enabled=!0},D.prototype.disable=function(){this.enabled=!1},D.prototype.mutators={},h.prototype.registerModule("mutator",D);var j=function(t){this.table=t,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.pageSizes=[],this.createElements()};j.prototype.createElements=function(){var t;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),(t=document.createElement("button")).classList.add("tabulator-page"),t.setAttribute("type","button"),t.setAttribute("role","button"),t.setAttribute("aria-label",""),t.setAttribute("title",""),this.firstBut=t.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=t.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=t.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=t.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))},j.prototype.generatePageSizeSelectList=function(){var t=this,e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(var n=1;n<5;n++)e.push(this.size*n);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach(function(e){var n=document.createElement("option");n.value=e,n.innerHTML=e,t.pageSizeSelect.appendChild(n)}),this.pageSizeSelect.value=this.size}},j.prototype.initialize=function(t){var e,n=this;for(var i in n.table.options.paginationDataSent)n.paginationDataSentNames[i]=n.table.options.paginationDataSent[i];for(var o in n.table.options.paginationDataReceived)n.paginationDataReceivedNames[o]=n.table.options.paginationDataReceived[o];n.table.modules.localize.bind("pagination|first",function(t){n.firstBut.innerHTML=t}),n.table.modules.localize.bind("pagination|first_title",function(t){n.firstBut.setAttribute("aria-label",t),n.firstBut.setAttribute("title",t)}),n.table.modules.localize.bind("pagination|prev",function(t){n.prevBut.innerHTML=t}),n.table.modules.localize.bind("pagination|prev_title",function(t){n.prevBut.setAttribute("aria-label",t),n.prevBut.setAttribute("title",t)}),n.table.modules.localize.bind("pagination|next",function(t){n.nextBut.innerHTML=t}),n.table.modules.localize.bind("pagination|next_title",function(t){n.nextBut.setAttribute("aria-label",t),n.nextBut.setAttribute("title",t)}),n.table.modules.localize.bind("pagination|last",function(t){n.lastBut.innerHTML=t}),n.table.modules.localize.bind("pagination|last_title",function(t){n.lastBut.setAttribute("aria-label",t),n.lastBut.setAttribute("title",t)}),n.firstBut.addEventListener("click",function(){n.setPage(1)}),n.prevBut.addEventListener("click",function(){n.previousPage()}),n.nextBut.addEventListener("click",function(){n.nextPage().then(function(){}).catch(function(){})}),n.lastBut.addEventListener("click",function(){n.setPage(n.max)}),n.table.options.paginationElement&&(n.element=n.table.options.paginationElement),this.pageSizeSelect&&(e=document.createElement("label"),n.table.modules.localize.bind("pagination|page_size",function(t){n.pageSizeSelect.setAttribute("aria-label",t),n.pageSizeSelect.setAttribute("title",t),e.innerHTML=t}),n.element.appendChild(e),n.element.appendChild(n.pageSizeSelect),n.pageSizeSelect.addEventListener("change",function(t){n.setPageSize(n.pageSizeSelect.value),n.setPage(1).then(function(){}).catch(function(){})})),n.element.appendChild(n.firstBut),n.element.appendChild(n.prevBut),n.element.appendChild(n.pagesElement),n.element.appendChild(n.nextBut),n.element.appendChild(n.lastBut),n.table.options.paginationElement||t||n.table.footerManager.append(n.element,n),n.mode=n.table.options.pagination,n.size=n.table.options.paginationSize||Math.floor(n.table.rowManager.getElement().clientHeight/24),n.count=n.table.options.paginationButtonCount,n.generatePageSizeSelectList()},j.prototype.initializeProgressive=function(t){this.initialize(!0),this.mode="progressive_"+t,this.progressiveLoad=!0},j.prototype.setDisplayIndex=function(t){this.displayIndex=t},j.prototype.getDisplayIndex=function(){return this.displayIndex},j.prototype.setMaxRows=function(t){this.max=t?Math.ceil(t/this.size):1,this.page>this.max&&(this.page=this.max)},j.prototype.reset=function(t){return("local"==this.mode||t)&&(this.page=1),!0},j.prototype.setMaxPage=function(t){t=parseInt(t),this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())},j.prototype.setPage=function(t){var e=this;return new Promise(function(n,i){(t=parseInt(t))>0&&t<=e.max?(e.page=t,e.trigger().then(function(){n()}).catch(function(){i()})):(console.warn("Pagination Error - Requested page is out of range of 1 - "+e.max+":",t),i())})},j.prototype.setPageToRow=function(t){var e=this;return new Promise(function(n,i){var o=e.table.rowManager.getDisplayRows(e.displayIndex-1).indexOf(t);if(o>-1){var r=Math.ceil((o+1)/e.size);e.setPage(r).then(function(){n()}).catch(function(){i()})}else console.warn("Pagination Error - Requested row is not visible"),i()})},j.prototype.setPageSize=function(t){(t=parseInt(t))>0&&(this.size=t),this.pageSizeSelect&&this.generatePageSizeSelectList()},j.prototype._setPageButtons=function(){for(var t=Math.floor((this.count-1)/2),e=Math.ceil((this.count-1)/2),n=this.max-this.page+t+1<this.count?this.max-this.count+1:Math.max(this.page-t,1),i=this.page<=e?Math.min(this.count,this.max):Math.min(this.page+e,this.max);this.pagesElement.firstChild;)this.pagesElement.removeChild(this.pagesElement.firstChild);1==this.page?(this.firstBut.disabled=!0,this.prevBut.disabled=!0):(this.firstBut.disabled=!1,this.prevBut.disabled=!1),this.page==this.max?(this.lastBut.disabled=!0,this.nextBut.disabled=!0):(this.lastBut.disabled=!1,this.nextBut.disabled=!1);for(var o=n;o<=i;o++)o>0&&o<=this.max&&this.pagesElement.appendChild(this._generatePageButton(o));this.footerRedraw()},j.prototype._generatePageButton=function(t){var e=this,n=document.createElement("button");return n.classList.add("tabulator-page"),t==e.page&&n.classList.add("active"),n.setAttribute("type","button"),n.setAttribute("role","button"),n.setAttribute("aria-label","Show Page "+t),n.setAttribute("title","Show Page "+t),n.setAttribute("data-page",t),n.textContent=t,n.addEventListener("click",function(n){e.setPage(t)}),n},j.prototype.previousPage=function(){var t=this;return new Promise(function(e,n){t.page>1?(t.page--,t.trigger().then(function(){e()}).catch(function(){n()})):(console.warn("Pagination Error - Previous page would be less than page 1:",0),n())})},j.prototype.nextPage=function(){var t=this;return new Promise(function(e,n){t.page<t.max?(t.page++,t.trigger().then(function(){e()}).catch(function(){n()})):(t.progressiveLoad||console.warn("Pagination Error - Next page would be greater than maximum page of "+t.max+":",t.max+1),n())})},j.prototype.getPage=function(){return this.page},j.prototype.getPageMax=function(){return this.max},j.prototype.getPageSize=function(t){return this.size},j.prototype.getMode=function(){return this.mode},j.prototype.getRows=function(t){var e,n,i;if("local"==this.mode){e=[],i=(n=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(var o=n;o<i;o++)t[o]&&e.push(t[o]);return e}return this._setPageButtons(),t.slice(0)},j.prototype.trigger=function(){var t,e=this;return new Promise(function(n,i){switch(e.mode){case"local":t=e.table.rowManager.scrollLeft,e.table.rowManager.refreshActiveData("page"),e.table.rowManager.scrollHorizontal(t),e.table.options.pageLoaded.call(e.table,e.getPage()),n();break;case"remote":case"progressive_load":case"progressive_scroll":e.table.modules.ajax.blockActiveRequest(),e._getRemotePage().then(function(){n()}).catch(function(){i()});break;default:console.warn("Pagination Error - no such pagination mode:",e.mode),i()}})},j.prototype._getRemotePage=function(){var t,e,n=this,i=this;return new Promise(function(o,r){if(i.table.modExists("ajax",!0)||r(),t=h.prototype.helpers.deepClone(i.table.modules.ajax.getParams()||{}),(e=i.table.modules.ajax.getParams())[n.paginationDataSentNames.page]=i.page,n.size&&(e[n.paginationDataSentNames.size]=n.size),n.table.options.ajaxSorting&&n.table.modExists("sort")){var a=i.table.modules.sort.getSort();a.forEach(function(t){delete t.column}),e[n.paginationDataSentNames.sorters]=a}if(n.table.options.ajaxFiltering&&n.table.modExists("filter")){var s=i.table.modules.filter.getFilters(!0,!0);e[n.paginationDataSentNames.filters]=s}i.table.modules.ajax.setParams(e),i.table.modules.ajax.sendRequest(n.progressiveLoad).then(function(t){i._parseRemoteData(t),o()}).catch(function(t){r()}),i.table.modules.ajax.setParams(t)})},j.prototype._parseRemoteData=function(t){var e,n,i=this;if(void 0===t[this.paginationDataReceivedNames.last_page]&&console.warn("Remote Pagination Error - Server response missing '"+this.paginationDataReceivedNames.last_page+"' property"),t[this.paginationDataReceivedNames.data])if(this.max=parseInt(t[this.paginationDataReceivedNames.last_page])||1,this.progressiveLoad)switch(this.mode){case"progressive_load":this.table.rowManager.addRows(t[this.paginationDataReceivedNames.data]),this.page<this.max&&setTimeout(function(){i.nextPage().then(function(){}).catch(function(){})},i.table.options.ajaxProgressiveLoadDelay);break;case"progressive_scroll":t=this.table.rowManager.getData().concat(t[this.paginationDataReceivedNames.data]),this.table.rowManager.setData(t,!0),n=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,i.table.rowManager.element.scrollHeight<=i.table.rowManager.element.clientHeight+n&&i.nextPage().then(function(){}).catch(function(){})}else e=this.table.rowManager.scrollLeft,this.table.rowManager.setData(t[this.paginationDataReceivedNames.data]),this.table.rowManager.scrollHorizontal(e),this.table.columnManager.scrollHorizontal(e),this.table.options.pageLoaded.call(this.table,this.getPage());else console.warn("Remote Pagination Error - Server response missing '"+this.paginationDataReceivedNames.data+"' property")},j.prototype.footerRedraw=function(){var t=this.table.footerManager.element;Math.ceil(t.clientWidth)-t.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(t.clientWidth)-t.scrollWidth<0&&(this.pagesElement.style.display="none"))},j.prototype.paginationDataSentNames={page:"page",size:"size",sorters:"sorters",filters:"filters"},j.prototype.paginationDataReceivedNames={current_page:"current_page",last_page:"last_page",data:"data"},h.prototype.registerModule("page",j);var z=function(t){this.table=t,this.mode="",this.id="",this.persistProps=["field","width","visible"]};z.prototype.initialize=function(t,e){this.mode=!0!==t?t:void 0!==window.localStorage?"local":"cookie",this.id="tabulator-"+(e||this.table.element.getAttribute("id")||"")},z.prototype.load=function(t,e){var n=this.retreiveData(t);return e&&(n=n?this.mergeDefinition(e,n):e),n},z.prototype.retreiveData=function(t){var e="",n=this.id+("columns"===t?"":"-"+t);switch(this.mode){case"local":e=localStorage.getItem(n);break;case"cookie":var i=document.cookie,o=i.indexOf(n+"="),r=void 0;o>-1&&((r=(i=i.substr(o)).indexOf(";"))>-1&&(i=i.substr(0,r)),e=i.replace(n+"=",""));break;default:console.warn("Persistance Load Error - invalid mode selected",this.mode)}return!!e&&JSON.parse(e)},z.prototype.mergeDefinition=function(t,e){var n=this,i=[];return(e=e||[]).forEach(function(e,o){var r=n._findColumn(t,e);r&&(r.width=e.width,r.visible=e.visible,r.columns&&(r.columns=n.mergeDefinition(r.columns,e.columns)),i.push(r))}),t.forEach(function(t,o){n._findColumn(e,t)||(i.length>o?i.splice(o,0,t):i.push(t))}),i},z.prototype._findColumn=function(t,e){var n=e.columns?"group":e.field?"field":"object";return t.find(function(t){switch(n){case"group":return t.title===e.title&&t.columns.length===e.columns.length;case"field":return t.field===e.field;case"object":return t===e}})},z.prototype.save=function(t){var e={};switch(t){case"columns":e=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":e=this.table.modules.filter.getFilters();break;case"sort":e=this.validateSorters(this.table.modules.sort.getSort())}var n=this.id+("columns"===t?"":"-"+t);this.saveData(n,e)},z.prototype.validateSorters=function(t){return t.forEach(function(t){t.column=t.field,delete t.field}),t},z.prototype.saveData=function(t,e){switch(e=JSON.stringify(e),this.mode){case"local":localStorage.setItem(t,e);break;case"cookie":var n=new Date;n.setDate(n.getDate()+1e4),document.cookie=t+"="+e+"; expires="+n.toUTCString();break;default:console.warn("Persistance Save Error - invalid mode selected",this.mode)}},z.prototype.parseColumns=function(t){var e=this,n=[];return t.forEach(function(t){var i={};t.isGroup?(i.title=t.getDefinition().title,i.columns=e.parseColumns(t.getColumns())):(i.title=t.getDefinition().title,i.field=t.getField(),i.width=t.getWidth(),i.visible=t.visible),n.push(i)}),n},h.prototype.registerModule("persistence",z);var N=function(t){this.table=t,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};N.prototype.watchData=function(t){var e,n=this;this.currentVersion++,e=this.currentVersion,n.unwatchData(),n.data=t,n.origFuncs.push=t.push,Object.defineProperty(n.data,"push",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return n.blocked||e!==n.currentVersion||i.forEach(function(t){n.table.rowManager.addRowActual(t,!1)}),n.origFuncs.push.apply(t,arguments)}}),n.origFuncs.unshift=t.unshift,Object.defineProperty(n.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i=Array.from(arguments);return n.blocked||e!==n.currentVersion||i.forEach(function(t){n.table.rowManager.addRowActual(t,!0)}),n.origFuncs.unshift.apply(t,arguments)}}),n.origFuncs.shift=t.shift,Object.defineProperty(n.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i;return n.blocked||e!==n.currentVersion||n.data.length&&(i=n.table.rowManager.getRowFromDataObject(n.data[0]))&&i.deleteActual(),n.origFuncs.shift.call(t)}}),n.origFuncs.pop=t.pop,Object.defineProperty(n.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i;return n.blocked||e!==n.currentVersion||n.data.length&&(i=n.table.rowManager.getRowFromDataObject(n.data[n.data.length-1]))&&i.deleteActual(),n.origFuncs.pop.call(t)}}),n.origFuncs.splice=t.splice,Object.defineProperty(n.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,o=Array.from(arguments),r=o[0]<0?t.length+o[0]:o[0],a=o[1],s=!!o[2]&&o.slice(2);if(!n.blocked&&e===n.currentVersion){if(s&&((i=!!t[r]&&n.table.rowManager.getRowFromDataObject(t[r]))?s.forEach(function(t){n.table.rowManager.addRowActual(t,!0,i,!0)}):(s=s.slice().reverse()).forEach(function(t){n.table.rowManager.addRowActual(t,!0,!1,!0)})),0!==a)t.slice(r,void 0===o[1]?o[1]:r+a).forEach(function(t){var e=n.table.rowManager.getRowFromDataObject(t);e&&e.deleteActual(!0)});(s||0!==a)&&n.table.rowManager.reRenderInPosition()}return n.origFuncs.splice.apply(t,arguments)}})},N.prototype.unwatchData=function(){if(!1!==this.data)for(var t in this.origFuncs)Object.defineProperty(this.data,t,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})},N.prototype.watchRow=function(t){var e=t.getData();for(var n in this.blocked=!0,e)this.watchKey(t,e,n);this.blocked=!1},N.prototype.watchKey=function(t,e,n){var i=this,o=Object.getOwnPropertyDescriptor(e,n),r=e[n],a=this.currentVersion;Object.defineProperty(e,n,{set:function(e){if(r=e,!i.blocked&&a===i.currentVersion){var s={};s[n]=e,t.updateData(s)}o.set&&o.set(e)},get:function(){return o.get&&o.get(),r}})},N.prototype.unwatchRow=function(t){var e=t.getData();for(var n in e)Object.defineProperty(e,n,{value:e[n]})},N.prototype.block=function(){this.blocked=!0},N.prototype.unblock=function(){this.blocked=!1},h.prototype.registerModule("reactiveData",N);var I=function(t){this.table=t,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};I.prototype.initializeColumn=function(t,e,n){var i=this,o=!1,r=this.table.options.resizableColumns;if("header"===t&&(o="textarea"==e.definition.formatter||e.definition.variableHeight,e.modules.resize={variableHeight:o}),!0===r||r==t){var a=document.createElement("div");a.className="tabulator-col-resize-handle";var s=document.createElement("div");s.className="tabulator-col-resize-handle prev",a.addEventListener("click",function(t){t.stopPropagation()});var l=function(t){var n=e.getLastColumn();n&&i._checkResizability(n)&&(i.startColumn=e,i._mouseDown(t,n,a))};a.addEventListener("mousedown",l),a.addEventListener("touchstart",l),a.addEventListener("dblclick",function(t){i._checkResizability(e)&&e.reinitializeWidth(!0)}),s.addEventListener("click",function(t){t.stopPropagation()});var u=function(t){var n,o,r;(n=e.getFirstColumn())&&(r=(o=i.table.columnManager.findColumnIndex(n))>0&&i.table.columnManager.getColumnByIndex(o-1))&&i._checkResizability(r)&&(i.startColumn=e,i._mouseDown(t,r,s))};s.addEventListener("mousedown",u),s.addEventListener("touchstart",u),s.addEventListener("dblclick",function(t){var n,o,r;(n=e.getFirstColumn())&&(r=(o=i.table.columnManager.findColumnIndex(n))>0&&i.table.columnManager.getColumnByIndex(o-1))&&i._checkResizability(r)&&r.reinitializeWidth(!0)}),n.appendChild(a),n.appendChild(s)}},I.prototype._checkResizability=function(t){return void 0!==t.definition.resizable?t.definition.resizable:this.table.options.resizableColumns},I.prototype._mouseDown=function(t,e,n){var i=this;function o(t){e.setWidth(i.startWidth+((void 0===t.screenX?t.touches[0].screenX:t.screenX)-i.startX)),!i.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights()}function r(t){i.startColumn.modules.edit&&(i.startColumn.modules.edit.blocked=!1),i.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights(),document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mousemove",o),n.removeEventListener("touchmove",o),n.removeEventListener("touchend",r),i.table.element.classList.remove("tabulator-block-select"),i.table.options.persistentLayout&&i.table.modExists("persistence",!0)&&i.table.modules.persistence.save("columns"),i.table.options.columnResized.call(i.table,e.getComponent())}i.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),i.startColumn.modules.edit&&(i.startColumn.modules.edit.blocked=!0),i.startX=void 0===t.screenX?t.touches[0].screenX:t.screenX,i.startWidth=e.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",r),n.addEventListener("touchmove",o),n.addEventListener("touchend",r)},h.prototype.registerModule("resizeColumns",I);var F=function(t){this.table=t,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};F.prototype.initializeRow=function(t){var e=this,n=t.getElement(),i=document.createElement("div");i.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",i.addEventListener("click",function(t){t.stopPropagation()});var r=function(n){e.startRow=t,e._mouseDown(n,t,i)};i.addEventListener("mousedown",r),i.addEventListener("touchstart",r),o.addEventListener("click",function(t){t.stopPropagation()});var a=function(n){var i=e.table.rowManager.prevDisplayRow(t);i&&(e.startRow=i,e._mouseDown(n,i,o))};o.addEventListener("mousedown",a),o.addEventListener("touchstart",a),n.appendChild(i),n.appendChild(o)},F.prototype._mouseDown=function(t,e,n){var i=this;function o(t){e.setHeight(i.startHeight+((void 0===t.screenY?t.touches[0].screenY:t.screenY)-i.startY))}function r(t){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),n.removeEventListener("touchmove",o),n.removeEventListener("touchend",r),i.table.element.classList.remove("tabulator-block-select"),i.table.options.rowResized.call(this.table,e.getComponent())}i.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),i.startY=void 0===t.screenY?t.touches[0].screenY:t.screenY,i.startHeight=e.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",r),n.addEventListener("touchmove",o),n.addEventListener("touchend",r)},h.prototype.registerModule("resizeRows",F);var H=function(t){this.table=t,this.binding=!1,this.observer=!1};H.prototype.initialize=function(t){var e=this.table;"undefined"!=typeof ResizeObserver&&"virtual"===e.rowManager.getRenderMode()?(this.observer=new ResizeObserver(function(t){e.redraw()}),this.observer.observe(e.element)):(this.binding=function(){e.redraw()},window.addEventListener("resize",this.binding))},H.prototype.clearBindings=function(t){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element)},h.prototype.registerModule("resizeTable",H);var G=function(t){this.table=t,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0};G.prototype.initialize=function(){var t=this,e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(n,i){n.modules.responsive&&n.modules.responsive.order&&n.modules.responsive.visible&&(n.modules.responsive.index=i,e.push(n),n.visible||"collapse"!==t.mode||t.hiddenColumns.push(n))}),e=(e=e.reverse()).sort(function(t,e){return e.modules.responsive.order-t.modules.responsive.order||e.modules.responsive.index-t.modules.responsive.index}),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent()},G.prototype.initializeColumn=function(t){var e=t.getDefinition();t.modules.responsive={order:void 0===e.responsive?1:e.responsive,visible:!1!==e.visible}},G.prototype.layoutRow=function(t){var e=t.getElement(),n=document.createElement("div");n.classList.add("tabulator-responsive-collapse"),e.classList.contains("tabulator-calcs")||(t.modules.responsiveLayout={element:n},this.collapseStartOpen||(n.style.display="none"),e.appendChild(n),this.generateCollapsedRowContent(t))},G.prototype.updateColumnVisibility=function(t,e){t.modules.responsive&&(t.modules.responsive.visible=e,this.initialize())},G.prototype.hideColumn=function(t){t.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(t),this.generateCollapsedContent())},G.prototype.showColumn=function(t){var e;t.show(!1,!0),t.setWidth(t.getWidth()),"collapse"===this.mode&&((e=this.hiddenColumns.indexOf(t))>-1&&this.hiddenColumns.splice(e,1),this.generateCollapsedContent())},G.prototype.update=function(){for(var t=!0;t;){var e="fitColumns"==this.table.modules.layout.getMode()?this.table.columnManager.getFlexBaseWidth():this.table.columnManager.getWidth(),n=this.table.columnManager.element.clientWidth-e;if(n<0){var i=this.columns[this.index];i?(this.hideColumn(i),this.index++):t=!1}else{var o=this.columns[this.index-1];o&&n>0&&n>=o.getWidth()?(this.showColumn(o),this.index--):t=!1}this.table.rowManager.activeRowsCount||this.table.rowManager.renderEmptyScroll()}},G.prototype.generateCollapsedContent=function(){var t=this;this.table.rowManager.getDisplayRows().forEach(function(e){t.generateCollapsedRowContent(e)})},G.prototype.generateCollapsedRowContent=function(t){var e,n;if(t.modules.responsiveLayout){for(e=t.modules.responsiveLayout.element;e.firstChild;)e.removeChild(e.firstChild);(n=this.collapseFormatter(this.generateCollapsedRowData(t)))&&e.appendChild(n)}},G.prototype.generateCollapsedRowData=function(t){var e,n=this,i=t.getData(),o={};return this.hiddenColumns.forEach(function(r){var a=r.getFieldValue(i);r.definition.title&&r.field&&(r.modules.format&&n.table.options.responsiveLayoutCollapseUseFormatters?(e={value:!1,data:{},getValue:function(){return a},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return t.getComponent()},getColumn:function(){return r.getComponent()}},o[r.definition.title]=r.modules.format.formatter.call(n.table.modules.format,e,r.modules.format.params)):o[r.definition.title]=a)}),o},G.prototype.formatCollapsedData=function(t){var e=document.createElement("table"),n="";for(var i in t)n+="<tr><td><strong>"+i+"</strong></td><td>"+t[i]+"</td></tr>";return e.innerHTML=n,Object.keys(t).length?e:""},h.prototype.registerModule("responsiveLayout",G);var V=function(t){this.table=t,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[]};V.prototype.clearSelectionData=function(t){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t||this._rowSelectionChanged()},V.prototype.initializeRow=function(t){var e=this,n=t.getElement(),i=function t(){setTimeout(function(){e.selecting=!1},50),document.body.removeEventListener("mouseup",t)};t.modules.select={selected:!1},e.table.options.selectableCheck.call(this.table,t.getComponent())?(n.classList.add("tabulator-selectable"),n.classList.remove("tabulator-unselectable"),e.table.options.selectable&&"highlight"!=e.table.options.selectable&&(e.table.options.selectableRangeMode&&"click"===e.table.options.selectableRangeMode?n.addEventListener("click",function(n){if(n.shiftKey){e.lastClickedRow=e.lastClickedRow||t;var i=e.table.rowManager.getDisplayRowIndex(e.lastClickedRow),o=e.table.rowManager.getDisplayRowIndex(t),r=i<=o?i:o,a=i>=o?i:o,s=e.table.rowManager.getDisplayRows().slice(0).splice(r,a-r+1);n.ctrlKey?(s.forEach(function(t){t!==e.lastClickedRow&&e.toggleRow(t)}),e.lastClickedRow=t):(e.deselectRows(),e.selectRows(s))}else n.ctrlKey?(e.toggleRow(t),e.lastClickedRow=t):(e.deselectRows(),e.selectRows(t),e.lastClickedRow=t)}):(n.addEventListener("click",function(n){e.selecting||e.toggleRow(t)}),n.addEventListener("mousedown",function(n){if(n.shiftKey)return e.selecting=!0,e.selectPrev=[],document.body.addEventListener("mouseup",i),document.body.addEventListener("keyup",i),e.toggleRow(t),!1}),n.addEventListener("mouseenter",function(n){e.selecting&&(e.toggleRow(t),e.selectPrev[1]==t&&e.toggleRow(e.selectPrev[0]))}),n.addEventListener("mouseout",function(n){e.selecting&&e.selectPrev.unshift(t)})))):(n.classList.add("tabulator-unselectable"),n.classList.remove("tabulator-selectable"))},V.prototype.toggleRow=function(t){this.table.options.selectableCheck.call(this.table,t.getComponent())&&(t.modules.select&&t.modules.select.selected?this._deselectRow(t):this._selectRow(t))},V.prototype.selectRows=function(t){var e=this;switch(void 0===t?"undefined":a(t)){case"undefined":e.table.rowManager.rows.forEach(function(t){e._selectRow(t,!0,!0)}),e._rowSelectionChanged();break;case"boolean":!0===t&&(e.table.rowManager.activeRows.forEach(function(t){e._selectRow(t,!0,!0)}),e._rowSelectionChanged());break;default:Array.isArray(t)?(t.forEach(function(t){e._selectRow(t,!0,!0)}),e._rowSelectionChanged()):e._selectRow(t,!1,!0)}},V.prototype._selectRow=function(t,e,n){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!n&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var i=this.table.rowManager.findRow(t);i?-1==this.selectedRows.indexOf(i)&&(i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.getElement().classList.add("tabulator-selected"),this.selectedRows.push(i),e||(this.table.options.rowSelected.call(this.table,i.getComponent()),this._rowSelectionChanged())):e||console.warn("Selection Error - No such row found, ignoring selection:"+t)},V.prototype.isRowSelected=function(t){return-1!==this.selectedRows.indexOf(t)},V.prototype.deselectRows=function(t){var e,n=this;if(void 0===t){e=n.selectedRows.length;for(var i=0;i<e;i++)n._deselectRow(n.selectedRows[0],!0);n._rowSelectionChanged()}else Array.isArray(t)?(t.forEach(function(t){n._deselectRow(t,!0)}),n._rowSelectionChanged()):n._deselectRow(t)},V.prototype._deselectRow=function(t,e){var n,i=this.table.rowManager.findRow(t);i?(n=this.selectedRows.findIndex(function(t){return t==i}))>-1&&(i.modules.select||(i.modules.select={}),i.modules.select.selected=!1,i.getElement().classList.remove("tabulator-selected"),this.selectedRows.splice(n,1),e||(this.table.options.rowDeselected.call(this.table,i.getComponent()),this._rowSelectionChanged())):e||console.warn("Deselection Error - No such row found, ignoring selection:"+t)},V.prototype.getSelectedData=function(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getData())}),t},V.prototype.getSelectedRows=function(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getComponent())}),t},V.prototype._rowSelectionChanged=function(){this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},h.prototype.registerModule("selectRow",V);var B=function(t){this.table=t,this.sortList=[],this.changed=!1};B.prototype.initializeColumn=function(t,e){var n,i,o=this,r=!1;switch(a(t.definition.sorter)){case"string":o.sorters[t.definition.sorter]?r=o.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":r=t.definition.sorter}t.modules.sort={sorter:r,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:t.definition.headerSortTristate},!1!==t.definition.headerSort&&((n=t.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-arrow"),e.appendChild(i),n.addEventListener("click",function(e){var n="",i=[],r=!1;if(t.modules.sort){if(t.modules.sort.tristate)n="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":n="desc";break;case"desc":n="asc";break;default:n=t.modules.sort.startingDir}o.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?((r=(i=o.getSort()).findIndex(function(e){return e.field===t.getField()}))>-1?(i[r].dir=n,r!=i.length-1&&(r=i.splice(r,1)[0],"none"!=n&&i.push(r))):"none"!=n&&i.push({column:t,dir:n}),o.setSort(i)):"none"==n?o.clear():o.setSort(t,n),o.table.rowManager.sorterRefresh(!o.sortList.length)}}))},B.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},B.prototype.getSort=function(){var t=[];return this.sortList.forEach(function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})}),t},B.prototype.setSort=function(t,e){var n=this,i=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach(function(t){var e;(e=n.table.columnManager.findColumn(t.column))?(t.column=e,i.push(t),n.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),n.sortList=i,this.table.options.persistentSort&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("sort")},B.prototype.clear=function(){this.setSort([])},B.prototype.findSorter=function(t){var e,n=this.table.rowManager.activeRows[0],i="string";if(n&&(n=n.getData(),t.getField()))switch(void 0===(e=t.getFieldValue(n))?"undefined":a(e)){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return this.sorters[i]},B.prototype.sort=function(t){var e,n=this;e=this.table.options.sortOrderReverse?n.sortList.slice().reverse():n.sortList,n.table.options.dataSorting&&n.table.options.dataSorting.call(n.table,n.getSort()),n.clearColumnHeaders(),n.table.options.ajaxSorting?e.forEach(function(t,e){n.setColumnHeader(t.column,t.dir)}):e.forEach(function(i,o){i.column&&i.column.modules.sort&&(i.column.modules.sort.sorter||(i.column.modules.sort.sorter=n.findSorter(i.column)),n._sortItem(t,i.column,i.dir,e,o)),n.setColumnHeader(i.column,i.dir)}),n.table.options.dataSorted&&n.table.options.dataSorted.call(n.table,n.getSort(),n.table.rowManager.getComponents(!0))},B.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"))})},B.prototype.setColumnHeader=function(t,e){t.modules.sort.dir=e,t.getElement().setAttribute("aria-sort",e)},B.prototype._sortItem=function(t,e,n,i,o){var r=this,a="function"==typeof e.modules.sort.params?e.modules.sort.params(e.getComponent(),n):e.modules.sort.params;t.sort(function(t,s){var l=r._sortRow(t,s,e,n,a);if(0===l&&o)for(var u=o-1;u>=0&&0===(l=r._sortRow(t,s,i[u].column,i[u].dir,a));u--);return l})},B.prototype._sortRow=function(t,e,n,i,o){var r,a,s="asc"==i?t:e,l="asc"==i?e:t;return t=n.getFieldValue(s.getData()),e=n.getFieldValue(l.getData()),t=void 0!==t?t:"",e=void 0!==e?e:"",r=s.getComponent(),a=l.getComponent(),n.modules.sort.sorter.call(this,t,e,r,a,n.getComponent(),i,o)},B.prototype.sorters={number:function(t,e,n,i,o,r,a){var s=a.alignEmptyValues,l=a.decimalSeparator||".",u=a.thousandSeparator||",",c=0;if(t=parseFloat(String(t).split(u).join("").split(l).join(".")),e=parseFloat(String(e).split(u).join("").split(l).join(".")),isNaN(t))c=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;c=1}return("top"===s&&"desc"===r||"bottom"===s&&"asc"===r)&&(c*=-1),c},string:function(t,e,n,i,o,r,s){var l,u=s.alignEmptyValues,c=0;if(t){if(e){switch(a(s.locale)){case"boolean":s.locale&&(l=this.table.modules.localize.getLocale());break;case"string":l=s.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),l)}c=1}else c=e?-1:0;return("top"===u&&"desc"===r||"bottom"===u&&"asc"===r)&&(c*=-1),c},date:function(t,e,n,i,o,r,a){return a.format||(a.format="DD/MM/YYYY"),this.sorters.datetime.call(this,t,e,n,i,o,r,a)},time:function(t,e,n,i,o,r,a){return a.format||(a.format="hh:mm"),this.sorters.datetime.call(this,t,e,n,i,o,r,a)},datetime:function(t,e,n,i,o,r,a){var s=a.format||"DD/MM/YYYY hh:mm:ss",l=a.alignEmptyValues,u=0;if("undefined"!=typeof moment){if(t=moment(t,s),e=moment(e,s),t.isValid()){if(e.isValid())return t-e;u=1}else u=e.isValid()?-1:0;return("top"===l&&"desc"===r||"bottom"===l&&"asc"===r)&&(u*=-1),u}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(t,e,n,i,o,r,a){return(!0===t||"true"===t||"True"===t||1===t?1:0)-(!0===e||"true"===e||"True"===e||1===e?1:0)},array:function(t,e,n,i,o,r,a){var s=a.type||"length",l=a.alignEmptyValues,u=0;function c(t){switch(s){case"length":return t.length;case"sum":return t.reduce(function(t,e){return t+e});case"max":return Math.max.apply(null,t);case"min":return Math.min.apply(null,t);case"avg":return t.reduce(function(t,e){return t+e})/t.length}}if(Array.isArray(t)){if(Array.isArray(e))return(t?c(t):0)-(e?c(e):0);l=1}else l=Array.isArray(e)?-1:0;return("top"===l&&"desc"===r||"bottom"===l&&"asc"===r)&&(u*=-1),u},exists:function(t,e,n,i,o,r,a){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,n,i,o,r,a){var s,l,u,c,h,d=0,f=/(\d+)|(\D+)/g,p=/\d/,g=a.alignEmptyValues,m=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if((s=String(t).toLowerCase())===(l=String(e).toLowerCase()))return 0;if(!p.test(s)||!p.test(l))return s>l?1:-1;for(s=s.match(f),l=l.match(f),h=s.length>l.length?l.length:s.length;d<h;)if((u=s[d])!==(c=l[d++]))return isFinite(u)&&isFinite(c)?("0"===u.charAt(0)&&(u="."+u),"0"===c.charAt(0)&&(c="."+c),u-c):u>c?1:-1;return s.length>l.length}m=1}else m=e||0===e?-1:0;return("top"===g&&"desc"===r||"bottom"===g&&"asc"===r)&&(m*=-1),m}},h.prototype.registerModule("sort",B);var U=function(t){this.table=t};return U.prototype.initializeColumn=function(t){var e,n=this,i=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(t){(e=n._extractValidator(t))&&i.push(e)}):(e=this._extractValidator(t.definition.validator))&&i.push(e),t.modules.validate=!!i.length&&i)},U.prototype._extractValidator=function(t){var e,n,i;switch(void 0===t?"undefined":a(t)){case"string":return n=(e=t.split(":",2)).shift(),i=e[0],this._buildValidator(n,i);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}},U.prototype._buildValidator=function(t,e){var n="function"==typeof t?t:this.validators[t];return n?{type:"function"==typeof t?"function":t,func:n,params:e}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)},U.prototype.validate=function(t,e,n){var i=this,o=[];return t&&t.forEach(function(t){t.func.call(i,e,n,t.params)||o.push({type:t.type,parameters:t.params})}),!o.length||o},U.prototype.validators={integer:function(t,e,n){return""===e||null===e||void 0===e||"number"==typeof(e=Number(e))&&isFinite(e)&&Math.floor(e)===e},float:function(t,e,n){return""===e||null===e||void 0===e||"number"==typeof(e=Number(e))&&isFinite(e)&&e%1!=0},numeric:function(t,e,n){return""===e||null===e||void 0===e||!isNaN(e)},string:function(t,e,n){return""===e||null===e||void 0===e||isNaN(e)},max:function(t,e,n){return""===e||null===e||void 0===e||parseFloat(e)<=n},min:function(t,e,n){return""===e||null===e||void 0===e||parseFloat(e)>=n},minLength:function(t,e,n){return""===e||null===e||void 0===e||String(e).length>=n},maxLength:function(t,e,n){return""===e||null===e||void 0===e||String(e).length<=n},in:function(t,e,n){return""===e||null===e||void 0===e||("string"==typeof n&&(n=n.split("|")),""===e||n.indexOf(e)>-1)},regex:function(t,e,n){return""===e||null===e||void 0===e||new RegExp(n).test(e)},unique:function(t,e,n){if(""===e||null===e||void 0===e)return!0;var i=!0,o=t.getData(),r=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var n=t.getData();n!==o&&e==r.getFieldValue(n)&&(i=!1)}),i},required:function(t,e,n){return""!==e&null!==e&&void 0!==e}},h.prototype.registerModule("validate",U),h})},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(i.a)(e);return Object(o.a)(t,a*r,n)};var i=n(1),o=n(48),r=36e5},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(i.a)(e);return Object(r.a)(t,Object(o.a)(t,n)+a,n)};var i=n(1),o=n(34),r=n(134)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var s=Object(o.a)(t,n),l=Object(i.a)(e),u=Object(a.a)(s,Object(r.a)(s,n),n),c=new Date(0);return c.setFullYear(l,0,4),c.setHours(0,0,0,0),(s=Object(r.a)(c,n)).setDate(s.getDate()+u),s};var i=n(1),o=n(0),r=n(49),a=n(36)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(i.a)(e);return Object(o.a)(t,a*r,n)};var i=n(1),o=n(48),r=6e4},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=3*Object(i.a)(e);return Object(o.a)(t,r,n)};var i=n(1),o=n(58)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,1e3*r,n)};var i=n(1),o=n(48)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,12*r,n)};var i=n(1),o=n(58)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return Object(i.a)(t,n)-Object(i.a)(e,n)};var i=n(34)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n),a=o.getFullYear()-r.getFullYear(),s=o.getMonth()-r.getMonth();return 12*a+s};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return Math.floor(n.getMonth()/3)+1};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(o.a)(e,n),l=a.getTime()-Object(i.a)(a),u=s.getTime()-Object(i.a)(s);return Math.round((l-u)/r)};var i=n(19),o=n(22),r=6048e5},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getFullYear()-r.getFullYear()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(i.a)(t,n),s=Object(i.a)(e,n),l=Object(r.a)(a,s,n),u=Math.abs(Object(o.a)(a,s,n));a.setDate(a.getDate()-l*u);var c=Object(r.a)(a,s,n)===-l,h=l*(u-c);return 0===h?0:h};var i=n(0),o=n(36),r=n(28)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(133)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=t||{},o=Object(i.a)(n.start,e),r=Object(i.a)(n.end,e).getTime();if(!(o.getTime()<=r))throw new RangeError("Invalid interval");var a=[],s=o;s.setHours(0,0,0,0);for(;s.getTime()<=r;)a.push(Object(i.a)(s,e)),s.setDate(s.getDate()+1);return a};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 0===Object(i.a)(t,e).getDay()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e).getDay();return 0===n||6===n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return n.setHours(23,59,59,999),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=e||{},r=n.locale,a=r&&r.options&&r.options.weekStartsOn,s=null==a?0:Object(i.a)(a),l=null==n.weekStartsOn?s:Object(i.a)(n.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Object(o.a)(t,n),c=u.getDay(),h=6+(c<l?-7:0)-(c-l);return u.setDate(u.getDate()+h),u.setHours(23,59,59,999),u};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var m=String(e),v=n||{},y=v.locale||s.a,b=y.options&&y.options.firstWeekContainsDate,w=null==b?1:Object(i.a)(b),_=null==v.firstWeekContainsDate?w:Object(i.a)(v.firstWeekContainsDate);if(!(_>=1&&_<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=y.options&&y.options.weekStartsOn,S=null==x?0:Object(i.a)(x),E=null==v.weekStartsOn?S:Object(i.a)(v.weekStartsOn);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!y.localize)throw new RangeError("locale must contain localize property");if(!y.formatLong)throw new RangeError("locale must contain formatLong property");var C=Object(r.a)(t,v);if(!Object(a.a)(C,v))return"Invalid Date";var T=Object(o.a)(C),M=Object(c.a)(C,T,v),P={firstWeekContainsDate:_,weekStartsOn:E,locale:y,_originalDate:C};return m.match(f).map(function(t){var e=t[0];if("p"===e||"P"===e){var n=u.a[e];return n(t,y.formatLong,P)}return t}).join("").match(d).map(function(t){if("''"===t)return"'";var e=t[0];if("'"===e)return function(t){return t.match(p)[1].replace(g,"'")}(t);var n=l.a[e];return n?(!v.awareOfUnicodeTokens&&Object(h.a)(t)&&Object(h.b)(t),n(M,t,y.localize,P)):t}).join("")};var i=n(1),o=n(19),r=n(0),a=n(153),s=n(50),l=n(320),u=n(324),c=n(64),h=n(157),d=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,f=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,p=/^'(.*?)'?$/,g=/''/g},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return!isNaN(n)};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),s=Object(o.a)(n,e).getTime()-Object(r.a)(n,e).getTime();return Math.round(s/a)+1};var i=n(0),o=n(62),r=n(322),a=6048e5},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),r=n.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(r+1,0,4),a.setUTCHours(0,0,0,0);var s=Object(o.a)(a,e),l=new Date(0);l.setUTCFullYear(r,0,4),l.setUTCHours(0,0,0,0);var u=Object(o.a)(l,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1};var i=n(0),o=n(62)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),s=Object(o.a)(n,e).getTime()-Object(r.a)(n,e).getTime();return Math.round(s/a)+1};var i=n(0),o=n(63),r=n(323),a=6048e5},function(t,e,n){"use strict";e.a=function(t){return-1!==i.indexOf(t)},e.b=function(t){throw new RangeError("`options.awareOfUnicodeTokens` must be set to `true` to use `"+t+"` token; see: https://git.io/fxCyr")};var i=["D","DD","YY","YYYY"]},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(t,e).getDate()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(t,e).getDay()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e).getFullYear();return n%400==0||n%4==0&&n%100!=0};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e).getDay();0===n&&(n=7);return n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),s=Object(o.a)(n,e).getTime()-Object(r.a)(n,e).getTime();return Math.round(s/a)+1};var i=n(0),o=n(27),r=n(49),a=6048e5},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(t,e).getTime()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),s=Object(o.a)(n,e).getTime()-Object(r.a)(n,e).getTime();return Math.round(s/a)+1};var i=n(0),o=n(22),r=n(98),a=6048e5},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(o.a)(t,e),a=n.getFullYear(),s=e||{},l=s.locale,u=l&&l.options&&l.options.firstWeekContainsDate,c=null==u?1:Object(i.a)(u),h=null==s.firstWeekContainsDate?c:Object(i.a)(s.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setFullYear(a+1,0,h),d.setHours(0,0,0,0);var f=Object(r.a)(d,e),p=new Date(0);p.setFullYear(a,0,h),p.setHours(0,0,0,0);var g=Object(r.a)(p,e);return n.getTime()>=f.getTime()?a+1:n.getTime()>=g.getTime()?a:a-1};var i=n(1),o=n(0),r=n(22)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(0,0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return n.setMinutes(0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()===r.getTime()};var i=n(22)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return n.setSeconds(0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getMonth(),r=o-o%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return n.setMilliseconds(0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=e||{},r=n.locale,a=r&&r.options&&r.options.weekStartsOn,s=null==a?0:Object(i.a)(a),l=null==n.weekStartsOn?s:Object(i.a)(n.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var u=Object(o.a)(t,e),c=u.getDay(),h=6+(c<l?-7:0)-(c-l);return u.setHours(0,0,0,0),u.setDate(u.getDate()+h),u};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(i.a)(e),l=a.getFullYear(),u=a.getDate(),c=new Date(0);c.setFullYear(l,s,15),c.setHours(0,0,0,0);var h=Object(r.a)(c,n);return a.setMonth(s,Math.min(u,h)),a};var i=n(1),o=n(0),r=n(91)},function(t,e,n){"use strict";e.a=function(t,e,n){const i=[];for(let o=0;o<n&&e+o<t.byteLength;o++)i.push(t.getUint8(e+o,!1));return function(t){return t.map(t=>String.fromCharCode(t))}(i).join("")}},function(t,e,n){"use strict";const i=18761,o=19789;e.a={BIG_ENDIAN:o,LITTLE_ENDIAN:i,getByteOrder:function(t,e){if(t.getUint16(e)===i)return i;if(t.getUint16(e)===o)return o;throw new Error("Illegal byte order value. Faulty image.")}}},function(t,e,n){"use strict";
+/*!
+ * parse-csv <https://github.com/jonschlinkert/parse-csv>
+ *
+ * Copyright (c) 2014-2016 Jon Schlinkert, contributors.
+ * Licensed under the MIT license.
+ */var i=n(100),o=n(443),r=n(450);function a(t,e,n){if("string"!=typeof e&&(n=e,e=t,t=null),"string"!=typeof e)throw new TypeError("expected csv to be a string");var a=i({renderer:"json"},n);t=t||a.renderer;var s=new r(n),l=new o(n),u=s.parse(e);return l.render(t,u)}t.exports=a,t.exports.toJSON=function(t,e,n){if("string"==typeof e&&!/^json/.test(t))throw new Error("a json* renderer must be specified with the .toJSON method");return JSON.parse(a.apply(null,arguments))},t.exports.Renderer=o,t.exports.Parser=r},function(t,e,n){"use strict";var i=n(446),o=n(449);function r(t,e){for(var n=arguments.length,i=0;++i<n;){var r=arguments[i];s(r)&&o(r,a,t)}return t}function a(t,e){if("__proto__"!==e){var n=this[e];s(t)&&s(n)?r(n,t):this[e]=t}}function s(t){return i(t)&&!Array.isArray(t)}t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=l(n(2)),a=l(n(33)),s=n(2);function l(t){return t&&t.__esModule?t:{default:t}}var u=void 0,c=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.default.Component),o(e,[{key:"componentDidMount",value:function(){u=n(456),this.updateChart(this.props)}},{key:"componentWillReceiveProps",value:function(t){this.updateChart(t)}},{key:"componentWillUnmount",value:function(){this.destroyChart()}},{key:"destroyChart",value:function(){try{this.chart=this.chart.destroy()}catch(t){throw new Error("Internal C3 error",t)}}},{key:"generateChart",value:function(t,e){var n=i({bindto:t},e);return u.generate(n)}},{key:"loadNewData",value:function(t){this.chart.load(t)}},{key:"unloadData",value:function(){this.chart.unload()}},{key:"updateChart",value:function(t){this.chart||(this.chart=this.generateChart((0,s.findDOMNode)(this),t)),t.unloadBeforeLoad&&this.unloadData(),this.loadNewData(t.data)}},{key:"render",value:function(){var t=this.props.className?" "+this.props.className:"",e=this.props.style?this.props.style:{};return r.default.createElement("div",{className:t,style:e})}}],[{key:"displayName",get:function(){return"C3Chart"}},{key:"propTypes",get:function(){return{data:a.default.object.isRequired,title:a.default.object,size:a.default.object,padding:a.default.object,color:a.default.object,interaction:a.default.object,transition:a.default.object,oninit:a.default.func,onrendered:a.default.func,onmouseover:a.default.func,onmouseout:a.default.func,onresize:a.default.func,onresized:a.default.func,axis:a.default.object,grid:a.default.object,regions:a.default.array,legend:a.default.object,tooltip:a.default.object,subchart:a.default.object,zoom:a.default.object,point:a.default.object,line:a.default.object,area:a.default.object,bar:a.default.object,pie:a.default.object,donut:a.default.object,gauge:a.default.object,className:a.default.string,style:a.default.object,unloadBeforeLoad:a.default.bool}}}]),e}();e.default=c},function(t,e,n){var i=n(458);"string"==typeof i&&(i=[[t.i,i,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(26)(i,o);i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(459);"string"==typeof i&&(i=[[t.i,i,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(26)(i,o);i.locals&&(t.exports=i.locals)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.rainbow=["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],e.colorblindSafeRainbow=["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],e.institutionColors=["#f2f293","#3264f6","#f30000"],e.topCountryCount=10,e.otherCountriesLabel="Other Countries",e.initialInstitutionLookup={edu:0,company:0,gov:0},e.institutionOrder={edu:0,company:1,gov:2},e.institutionLabels={edu:"Academic",company:"Commercial",gov:"Military / Government",mil:"Military / Government"}},function(t,e,n){
+/* @preserve
+ * Leaflet 1.3.4, a JS library for interactive maps. http://leafletjs.com
+ * (c) 2010-2018 Vladimir Agafonkin, (c) 2010-2011 CloudMade
+ */
+!function(t,n){n(e)}(0,function(t){"use strict";var e=Object.freeze;function n(t){var e,n,i,o;for(n=1,i=arguments.length;n<i;n++)for(e in o=arguments[n])t[e]=o[e];return t}Object.freeze=function(t){return t};var i=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function o(t,e){var n=Array.prototype.slice;if(t.bind)return t.bind.apply(t,n.call(arguments,1));var i=n.call(arguments,2);return function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)}}var r=0;function a(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function s(t,e,n){var i,o,r,a;return a=function(){i=!1,o&&(r.apply(n,o),o=!1)},r=function(){i?o=arguments:(t.apply(n,arguments),setTimeout(a,e),i=!0)}}function l(t,e,n){var i=e[1],o=e[0],r=i-o;return t===i&&n?t:((t-o)%r+r)%r+o}function u(){return!1}function c(t,e){var n=Math.pow(10,void 0===e?6:e);return Math.round(t*n)/n}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return h(t).split(/\s+/)}function f(t,e){for(var n in t.hasOwnProperty("options")||(t.options=t.options?i(t.options):{}),e)t.options[n]=e[n];return t.options}function p(t,e,n){var i=[];for(var o in t)i.push(encodeURIComponent(n?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")}var g=/\{ *([\w_-]+) *\}/g;function m(t,e){return t.replace(g,function(t,n){var i=e[n];if(void 0===i)throw new Error("No value provided for variable "+t);return"function"==typeof i&&(i=i(e)),i})}var v=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}var b="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function w(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var _=0;function x(t){var e=+new Date,n=Math.max(0,16-(e-_));return _=e+n,window.setTimeout(t,n)}var S=window.requestAnimationFrame||w("RequestAnimationFrame")||x,E=window.cancelAnimationFrame||w("CancelAnimationFrame")||w("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,n){if(!n||S!==x)return S.call(window,o(t,e));t.call(e)}function T(t){t&&E.call(window,t)}var M=(Object.freeze||Object)({freeze:e,extend:n,create:i,bind:o,lastId:r,stamp:a,throttle:s,wrapNum:l,falseFn:u,formatNum:c,trim:h,splitWords:d,setOptions:f,getParamString:p,template:m,isArray:v,indexOf:y,emptyImageUrl:b,requestFn:S,cancelFn:E,requestAnimFrame:C,cancelAnimFrame:T});function P(){}P.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=e.__super__=this.prototype,r=i(o);for(var a in r.constructor=e,e.prototype=r,this)this.hasOwnProperty(a)&&"prototype"!==a&&"__super__"!==a&&(e[a]=this[a]);return t.statics&&(n(e,t.statics),delete t.statics),t.includes&&(!function(t){if("undefined"==typeof L||!L||!L.Mixin)return;t=v(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}(t.includes),n.apply(null,[r].concat(t.includes)),delete t.includes),r.options&&(t.options=n(i(r.options),t.options)),n(r,t),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},P.include=function(t){return n(this.prototype,t),this},P.mergeOptions=function(t){return n(this.prototype.options,t),this},P.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),n="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var A={on:function(t,e,n){if("object"==typeof t)for(var i in t)this._on(i,t[i],e);else for(var o=0,r=(t=d(t)).length;o<r;o++)this._on(t[o],e,n);return this},off:function(t,e,n){if(t)if("object"==typeof t)for(var i in t)this._off(i,t[i],e);else for(var o=0,r=(t=d(t)).length;o<r;o++)this._off(t[o],e,n);else delete this._events;return this},_on:function(t,e,n){this._events=this._events||{};var i=this._events[t];i||(i=[],this._events[t]=i),n===this&&(n=void 0);for(var o={fn:e,ctx:n},r=i,a=0,s=r.length;a<s;a++)if(r[a].fn===e&&r[a].ctx===n)return;r.push(o)},_off:function(t,e,n){var i,o,r;if(this._events&&(i=this._events[t]))if(e){if(n===this&&(n=void 0),i)for(o=0,r=i.length;o<r;o++){var a=i[o];if(a.ctx===n&&a.fn===e)return a.fn=u,this._firingCount&&(this._events[t]=i=i.slice()),void i.splice(o,1)}}else{for(o=0,r=i.length;o<r;o++)i[o].fn=u;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var o=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var a=0,s=r.length;a<s;a++){var l=r[a];l.fn.call(l.ctx||this,o)}this._firingCount--}}return i&&this._propagateEvent(o),this},listens:function(t,e){var n=this._events&&this._events[t];if(n&&n.length)return!0;if(e)for(var i in this._eventParents)if(this._eventParents[i].listens(t,e))return!0;return!1},once:function(t,e,n){if("object"==typeof t){for(var i in t)this.once(i,t[i],e);return this}var r=o(function(){this.off(t,e,n).off(t,r,n)},this);return this.on(t,e,n).on(t,r,n)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};A.addEventListener=A.on,A.removeEventListener=A.clearAllEventListeners=A.off,A.addOneTimeEventListener=A.once,A.fireEvent=A.fire,A.hasEventListeners=A.listens;var k=P.extend(A);function O(t,e,n){this.x=n?Math.round(t):t,this.y=n?Math.round(e):e}var R=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function D(t,e,n){return t instanceof O?t:v(t)?new O(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new O(t.x,t.y):new O(t,e,n)}function j(t,e){if(t)for(var n=e?[t,e]:t,i=0,o=n.length;i<o;i++)this.extend(n[i])}function z(t,e){return!t||t instanceof j?t:new j(t,e)}function N(t,e){if(t)for(var n=e?[t,e]:t,i=0,o=n.length;i<o;i++)this.extend(n[i])}function I(t,e){return t instanceof N?t:new N(t,e)}function F(t,e,n){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==n&&(this.alt=+n)}function H(t,e,n){return t instanceof F?t:v(t)&&"object"!=typeof t[0]?3===t.length?new F(t[0],t[1],t[2]):2===t.length?new F(t[0],t[1]):null:void 0===t||null===t?t:"object"==typeof t&&"lat"in t?new F(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new F(t,e,n)}O.prototype={clone:function(){return new O(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new O(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new O(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=R(this.x),this.y=R(this.y),this},distanceTo:function(t){var e=(t=D(t)).x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return(t=D(t)).x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+c(this.x)+", "+c(this.y)+")"}},j.prototype={extend:function(t){return t=D(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new O((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new O(this.min.x,this.max.y)},getTopRight:function(){return new O(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return(t="number"==typeof t[0]||t instanceof O?D(t):z(t))instanceof j?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=z(t);var e=this.min,n=this.max,i=t.min,o=t.max,r=o.x>=e.x&&i.x<=n.x,a=o.y>=e.y&&i.y<=n.y;return r&&a},overlaps:function(t){t=z(t);var e=this.min,n=this.max,i=t.min,o=t.max,r=o.x>e.x&&i.x<n.x,a=o.y>e.y&&i.y<n.y;return r&&a},isValid:function(){return!(!this.min||!this.max)}},N.prototype={extend:function(t){var e,n,i=this._southWest,o=this._northEast;if(t instanceof F)e=t,n=t;else{if(!(t instanceof N))return t?this.extend(H(t)||I(t)):this;if(e=t._southWest,n=t._northEast,!e||!n)return this}return i||o?(i.lat=Math.min(e.lat,i.lat),i.lng=Math.min(e.lng,i.lng),o.lat=Math.max(n.lat,o.lat),o.lng=Math.max(n.lng,o.lng)):(this._southWest=new F(e.lat,e.lng),this._northEast=new F(n.lat,n.lng)),this},pad:function(t){var e=this._southWest,n=this._northEast,i=Math.abs(e.lat-n.lat)*t,o=Math.abs(e.lng-n.lng)*t;return new N(new F(e.lat-i,e.lng-o),new F(n.lat+i,n.lng+o))},getCenter:function(){return new F((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new F(this.getNorth(),this.getWest())},getSouthEast:function(){return new F(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof F||"lat"in t?H(t):I(t);var e,n,i=this._southWest,o=this._northEast;return t instanceof N?(e=t.getSouthWest(),n=t.getNorthEast()):e=n=t,e.lat>=i.lat&&n.lat<=o.lat&&e.lng>=i.lng&&n.lng<=o.lng},intersects:function(t){t=I(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&i.lat<=n.lat,a=o.lng>=e.lng&&i.lng<=n.lng;return r&&a},overlaps:function(t){t=I(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&i.lat<n.lat,a=o.lng>e.lng&&i.lng<n.lng;return r&&a},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=I(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},F.prototype={equals:function(t,e){return!!t&&(t=H(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return V.distance(this,H(t))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return I([this.lat-e,this.lng-n],[this.lat+e,this.lng+n])},clone:function(){return new F(this.lat,this.lng,this.alt)}};var G={latLngToPoint:function(t,e){var n=this.projection.project(t),i=this.scale(e);return this.transformation._transform(n,i)},pointToLatLng:function(t,e){var n=this.scale(e),i=this.transformation.untransform(t,n);return this.projection.unproject(i)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,n=this.scale(t);return new j(this.transformation.transform(e.min,n),this.transformation.transform(e.max,n))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new F(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),n=this.wrapLatLng(e),i=e.lat-n.lat,o=e.lng-n.lng;if(0===i&&0===o)return t;var r=t.getSouthWest(),a=t.getNorthEast();return new N(new F(r.lat-i,r.lng-o),new F(a.lat-i,a.lng-o))}},V=n({},G,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var n=Math.PI/180,i=t.lat*n,o=e.lat*n,r=Math.sin((e.lat-t.lat)*n/2),a=Math.sin((e.lng-t.lng)*n/2),s=r*r+Math.cos(i)*Math.cos(o)*a*a,l=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s));return this.R*l}}),B={R:6378137,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,n=this.MAX_LATITUDE,i=Math.max(Math.min(n,t.lat),-n),o=Math.sin(i*e);return new O(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new F((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=6378137*Math.PI;return new j([-t,-t],[t,t])}()};function U(t,e,n,i){if(v(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=n,this._d=i}function W(t,e,n,i){return new U(t,e,n,i)}U.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new O((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var q=n({},V,{code:"EPSG:3857",projection:B,transformation:function(){var t=.5/(Math.PI*B.R);return W(t,.5,-t,.5)}()}),Y=n({},q,{code:"EPSG:900913"});function X(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Z(t,e){var n,i,o,r,a,s,l="";for(n=0,o=t.length;n<o;n++){for(i=0,r=(a=t[n]).length;i<r;i++)s=a[i],l+=(i?"L":"M")+s.x+" "+s.y;l+=e?Tt?"z":"x":""}return l||"M0 0"}var Q=document.documentElement.style,K="ActiveXObject"in window,$=K&&!document.addEventListener,J="msLaunchUri"in navigator&&!("documentMode"in document),tt=Pt("webkit"),et=Pt("android"),nt=Pt("android 2")||Pt("android 3"),it=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ot=et&&Pt("Google")&&it<537&&!("AudioNode"in window),rt=!!window.opera,at=Pt("chrome"),st=Pt("gecko")&&!tt&&!rt&&!K,lt=!at&&Pt("safari"),ut=Pt("phantom"),ct="OTransition"in Q,ht=0===navigator.platform.indexOf("Win"),dt=K&&"transition"in Q,ft="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!nt,pt="MozPerspective"in Q,gt=!window.L_DISABLE_3D&&(dt||ft||pt)&&!ct&&!ut,mt="undefined"!=typeof orientation||Pt("mobile"),vt=mt&&tt,yt=mt&&ft,bt=!window.PointerEvent&&window.MSPointerEvent,wt=!(!window.PointerEvent&&!bt),_t=!window.L_NO_TOUCH&&(wt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),xt=mt&&rt,St=mt&&st,Et=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ct=!!document.createElement("canvas").getContext,Tt=!(!document.createElementNS||!X("svg").createSVGRect),Mt=!Tt&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Pt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Lt=(Object.freeze||Object)({ie:K,ielt9:$,edge:J,webkit:tt,android:et,android23:nt,androidStock:ot,opera:rt,chrome:at,gecko:st,safari:lt,phantom:ut,opera12:ct,win:ht,ie3d:dt,webkit3d:ft,gecko3d:pt,any3d:gt,mobile:mt,mobileWebkit:vt,mobileWebkit3d:yt,msPointer:bt,pointer:wt,touch:_t,mobileOpera:xt,mobileGecko:St,retina:Et,canvas:Ct,svg:Tt,vml:Mt}),At=bt?"MSPointerDown":"pointerdown",kt=bt?"MSPointerMove":"pointermove",Ot=bt?"MSPointerUp":"pointerup",Rt=bt?"MSPointerCancel":"pointercancel",Dt=["INPUT","SELECT","OPTION"],jt={},zt=!1,Nt=0;function It(t,e,n,i){return"touchstart"===e?function(t,e,n){var i=o(function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Dt.indexOf(t.target.tagName)<0))return;je(t)}Vt(t,e)});t["_leaflet_touchstart"+n]=i,t.addEventListener(At,i,!1),zt||(document.documentElement.addEventListener(At,Ft,!0),document.documentElement.addEventListener(kt,Ht,!0),document.documentElement.addEventListener(Ot,Gt,!0),document.documentElement.addEventListener(Rt,Gt,!0),zt=!0)}(t,n,i):"touchmove"===e?function(t,e,n){var i=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Vt(t,e)};t["_leaflet_touchmove"+n]=i,t.addEventListener(kt,i,!1)}(t,n,i):"touchend"===e&&function(t,e,n){var i=function(t){Vt(t,e)};t["_leaflet_touchend"+n]=i,t.addEventListener(Ot,i,!1),t.addEventListener(Rt,i,!1)}(t,n,i),this}function Ft(t){jt[t.pointerId]=t,Nt++}function Ht(t){jt[t.pointerId]&&(jt[t.pointerId]=t)}function Gt(t){delete jt[t.pointerId],Nt--}function Vt(t,e){for(var n in t.touches=[],jt)t.touches.push(jt[n]);t.changedTouches=[t],e(t)}var Bt=bt?"MSPointerDown":wt?"pointerdown":"touchstart",Ut=bt?"MSPointerUp":wt?"pointerup":"touchend",Wt="_leaflet_";function qt(t,e,n){var i,o,r=!1,a=250;function s(t){var e;if(wt){if(!J||"mouse"===t.pointerType)return;e=Nt}else e=t.touches.length;if(!(e>1)){var n=Date.now(),s=n-(i||n);o=t.touches?t.touches[0]:t,r=s>0&&s<=a,i=n}}function l(t){if(r&&!o.cancelBubble){if(wt){if(!J||"mouse"===t.pointerType)return;var n,a,s={};for(a in o)n=o[a],s[a]=n&&n.bind?n.bind(o):n;o=s}o.type="dblclick",e(o),i=null}}return t[Wt+Bt+n]=s,t[Wt+Ut+n]=l,t[Wt+"dblclick"+n]=e,t.addEventListener(Bt,s,!1),t.addEventListener(Ut,l,!1),t.addEventListener("dblclick",e,!1),this}function Yt(t,e){var n=t[Wt+Bt+e],i=t[Wt+Ut+e],o=t[Wt+"dblclick"+e];return t.removeEventListener(Bt,n,!1),t.removeEventListener(Ut,i,!1),J||t.removeEventListener("dblclick",o,!1),this}var Xt,Zt,Qt,Kt,$t,Jt=ge(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),te=ge(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ee="webkitTransition"===te||"OTransition"===te?te+"End":"transitionend";function ne(t){return"string"==typeof t?document.getElementById(t):t}function ie(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function oe(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function re(t){var e=t.parentNode;e&&e.removeChild(t)}function ae(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function se(t){var e=t.parentNode;e.lastChild!==t&&e.appendChild(t)}function le(t){var e=t.parentNode;e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ue(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=fe(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function ce(t,e){if(void 0!==t.classList)for(var n=d(e),i=0,o=n.length;i<o;i++)t.classList.add(n[i]);else if(!ue(t,e)){var r=fe(t);de(t,(r?r+" ":"")+e)}}function he(t,e){void 0!==t.classList?t.classList.remove(e):de(t,h((" "+fe(t)+" ").replace(" "+e+" "," ")))}function de(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function fe(t){return void 0===t.className.baseVal?t.className:t.className.baseVal}function pe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&function(t,e){var n=!1,i="DXImageTransform.Microsoft.Alpha";try{n=t.filters.item(i)}catch(t){if(1===e)return}e=Math.round(100*e),n?(n.Enabled=100!==e,n.Opacity=e):t.style.filter+=" progid:"+i+"(opacity="+e+")"}(t,e)}function ge(t){for(var e=document.documentElement.style,n=0;n<t.length;n++)if(t[n]in e)return t[n];return!1}function me(t,e,n){var i=e||new O(0,0);t.style[Jt]=(dt?"translate("+i.x+"px,"+i.y+"px)":"translate3d("+i.x+"px,"+i.y+"px,0)")+(n?" scale("+n+")":"")}function ve(t,e){t._leaflet_pos=e,gt?me(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function ye(t){return t._leaflet_pos||new O(0,0)}if("onselectstart"in document)Xt=function(){Me(window,"selectstart",je)},Zt=function(){Le(window,"selectstart",je)};else{var be=ge(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Xt=function(){if(be){var t=document.documentElement.style;Qt=t[be],t[be]="none"}},Zt=function(){be&&(document.documentElement.style[be]=Qt,Qt=void 0)}}function we(){Me(window,"dragstart",je)}function _e(){Le(window,"dragstart",je)}function xe(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Se(),Kt=t,$t=t.style.outline,t.style.outline="none",Me(window,"keydown",Se))}function Se(){Kt&&(Kt.style.outline=$t,Kt=void 0,$t=void 0,Le(window,"keydown",Se))}function Ee(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Ce(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Te=(Object.freeze||Object)({TRANSFORM:Jt,TRANSITION:te,TRANSITION_END:ee,get:ne,getStyle:ie,create:oe,remove:re,empty:ae,toFront:se,toBack:le,hasClass:ue,addClass:ce,removeClass:he,setClass:de,getClass:fe,setOpacity:pe,testProp:ge,setTransform:me,setPosition:ve,getPosition:ye,disableTextSelection:Xt,enableTextSelection:Zt,disableImageDrag:we,enableImageDrag:_e,preventOutline:xe,restoreOutline:Se,getSizedParentNode:Ee,getScale:Ce});function Me(t,e,n,i){if("object"==typeof e)for(var o in e)Ae(t,o,e[o],n);else for(var r=0,a=(e=d(e)).length;r<a;r++)Ae(t,e[r],n,i);return this}var Pe="_leaflet_events";function Le(t,e,n,i){if("object"==typeof e)for(var o in e)ke(t,o,e[o],n);else if(e)for(var r=0,a=(e=d(e)).length;r<a;r++)ke(t,e[r],n,i);else{for(var s in t[Pe])ke(t,s,t[Pe][s]);delete t[Pe]}return this}function Ae(t,e,n,i){var o=e+a(n)+(i?"_"+a(i):"");if(t[Pe]&&t[Pe][o])return this;var r=function(e){return n.call(i||t,e||window.event)},s=r;wt&&0===e.indexOf("touch")?It(t,e,r,o):!_t||"dblclick"!==e||!qt||wt&&at?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",r,!1):"mouseenter"===e||"mouseleave"===e?(r=function(e){e=e||window.event,Ue(t,e)&&s(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",r,!1)):("click"===e&&et&&(r=function(t){!function(t,e){var n=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,i=He&&n-He;if(i&&i>100&&i<500||t.target._simulatedClick&&!t._simulated)return void ze(t);He=n,e(t)}(t,s)}),t.addEventListener(e,r,!1)):"attachEvent"in t&&t.attachEvent("on"+e,r):qt(t,r,o),t[Pe]=t[Pe]||{},t[Pe][o]=r}function ke(t,e,n,i){var o=e+a(n)+(i?"_"+a(i):""),r=t[Pe]&&t[Pe][o];if(!r)return this;wt&&0===e.indexOf("touch")?function(t,e,n){var i=t["_leaflet_"+e+n];"touchstart"===e?t.removeEventListener(At,i,!1):"touchmove"===e?t.removeEventListener(kt,i,!1):"touchend"===e&&(t.removeEventListener(Ot,i,!1),t.removeEventListener(Rt,i,!1))}(t,e,o):!_t||"dblclick"!==e||!Yt||wt&&at?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",r,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r):Yt(t,o),t[Pe][o]=null}function Oe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Be(t),this}function Re(t){return Ae(t,"mousewheel",Oe),this}function De(t){return Me(t,"mousedown touchstart dblclick",Oe),Ae(t,"click",Ve),this}function je(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function ze(t){return je(t),Oe(t),this}function Ne(t,e){if(!e)return new O(t.clientX,t.clientY);var n=Ce(e),i=n.boundingClientRect;return new O((t.clientX-i.left)/n.x-e.clientLeft,(t.clientY-i.top)/n.y-e.clientTop)}var Ie=ht&&at?2*window.devicePixelRatio:st?window.devicePixelRatio:1;function Fe(t){return J?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ie:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var He,Ge={};function Ve(t){Ge[t.type]=!0}function Be(t){var e=Ge[t.type];return Ge[t.type]=!1,e}function Ue(t,e){var n=e.relatedTarget;if(!n)return!0;try{for(;n&&n!==t;)n=n.parentNode}catch(t){return!1}return n!==t}var We=(Object.freeze||Object)({on:Me,off:Le,stopPropagation:Oe,disableScrollPropagation:Re,disableClickPropagation:De,preventDefault:je,stop:ze,getMousePosition:Ne,getWheelDelta:Fe,fakeStop:Ve,skipped:Be,isExternalTarget:Ue,addListener:Me,removeListener:Le}),qe=k.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=ye(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;e<n?this._runFrame(this._easeOut(e/n),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var n=this._startPos.add(this._offset.multiplyBy(t));e&&n._round(),ve(this._el,n),this.fire("step")},_complete:function(){T(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Ye=k.extend({options:{crs:q,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=f(this,e),this._initContainer(t),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(H(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this.callInitHooks(),this._zoomAnimated=te&&gt&&!xt&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Me(this._proxy,ee,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if((e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(H(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i)&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan)))return clearTimeout(this._sizeTimer),this;return this._resetView(t,e),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(gt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(gt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,n){var i=this.getZoomScale(e),o=this.getSize().divideBy(2),r=(t instanceof O?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/i),a=this.containerPointToLatLng(o.add(r));return this.setView(a,e,{zoom:n})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():I(t);var n=D(e.paddingTopLeft||e.padding||[0,0]),i=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,n.add(i));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var r=i.subtract(n).divideBy(2),a=this.project(t.getSouthWest(),o),s=this.project(t.getNorthEast(),o);return{center:this.unproject(a.add(s).divideBy(2).add(r),o),zoom:o}},fitBounds:function(t,e){if(!(t=I(t)).isValid())throw new Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(t,e);return this.setView(n.center,n.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(t=D(t).round(),e=e||{},!t.x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new qe,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ce(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,n,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,n){if(!1===(n=n||{}).animate||!gt)return this.setView(t,e,n);this._stop();var i=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),a=this._zoom;t=H(t),e=void 0===e?a:e;var s=Math.max(r.x,r.y),l=s*this.getZoomScale(a,e),u=o.distanceTo(i)||1,c=1.42,h=c*c;function d(t){var e=(l*l-s*s+(t?-1:1)*h*h*u*u)/(2*(t?l:s)*h*u),n=Math.sqrt(e*e+1)-e;return n<1e-9?-18:Math.log(n)}function f(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var g=d(0);function m(t){return s*(p(g)*function(t){return f(t)/p(t)}(g+c*t)-f(g))/h}var v=Date.now(),y=(d(1)-g)/c,b=n.duration?1e3*n.duration:1e3*y*.8;return this._moveStart(!0,n.noMoveStart),function n(){var r=(Date.now()-v)/b,l=function(t){return 1-Math.pow(1-t,1.5)}(r)*y;r<=1?(this._flyToFrame=C(n,this),this._move(this.unproject(i.add(o.subtract(i).multiplyBy(m(l)/u)),a),this.getScaleZoom(s/function(t){return s*(p(g)/p(g+c*t))}(l),a),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,e){var n=this._getBoundsCenterZoom(t,e);return this.flyTo(n.center,n.zoom,e)},setMaxBounds:function(t){return(t=I(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,I(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),r=e.divideBy(2).round(),a=i.divideBy(2).round(),s=r.subtract(a);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),i=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})},_handleGeolocationResponse:function(t){var e=new F(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),i=this._locateOptions;if(i.setView){var o=this.getBoundsZoom(n);this.setView(e,i.maxZoom?Math.min(o,i.maxZoom):o)}var r={latlng:e,bounds:n,timestamp:t.timestamp};for(var a in t.coords)"number"==typeof t.coords[a]&&(r[a]=t.coords[a]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),re(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)re(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=oe("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new N(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=I(t),n=D(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),l=this.getSize().subtract(n),u=z(this.project(s,i),this.project(a,i)).getSize(),c=gt?this.options.zoomSnap:1,h=l.x/u.x,d=l.y/u.y,f=e?Math.max(h,d):Math.min(h,d);return i=this.getScaleZoom(f,i),c&&(i=Math.round(i/(c/100))*(c/100),i=e?Math.ceil(i/c)*c:Math.floor(i/c)*c),Math.max(o,Math.min(r,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new O(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new j(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=void 0===e?this._zoom:e;var i=n.zoom(t*n.scale(e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(H(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(D(t),e)},layerPointToLatLng:function(t){var e=D(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(H(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(H(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(I(t))},distance:function(t,e){return this.options.crs.distance(H(t),H(e))},containerPointToLayerPoint:function(t){return D(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return D(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(D(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(H(t)))},mouseEventToContainerPoint:function(t){return Ne(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ne(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Me(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&gt,ce(t,"leaflet-container"+(_t?" leaflet-touch":"")+(Et?" leaflet-retina":"")+($?" leaflet-oldie":"")+(lt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ie(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ve(this._mapPane,new O(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ce(t.markerPane,"leaflet-zoom-hide"),ce(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){ve(this._mapPane,new O(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var i=this._zoom!==e;this._moveStart(i,!1)._move(t,e)._moveEnd(i),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n){void 0===e&&(e=this._zoom);var i=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(i||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){ve(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[a(this._container)]=this;var e=t?Le:Me;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),gt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=C(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,i=[],o="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,s=!1;r;){if((n=this._targets[a(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(o&&!Ue(r,t))break;if(i.push(n),o)break}if(r===this._container)break;r=r.parentNode}return i.length||s||o||!Ue(r,t)||(i=[this]),i},_handleDOMEvent:function(t){if(this._loaded&&!Be(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e||xe(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var o=n({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var r=i[0];"contextmenu"===e&&r.listens(e,!0)&&je(t);var a={originalEvent:t};if("keypress"!==t.type){var s=r.getLatLng&&(!r._radius||r._radius<=10);a.containerPoint=s?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),a.layerPoint=this.containerPointToLayerPoint(a.containerPoint),a.latlng=s?r.getLatLng():this.layerPointToLatLng(a.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,a,!0),a.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return ye(this._mapPane)||new O(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var n=this.getSize()._divideBy(2);return this.project(t,e)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return z([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,n){if(!n)return t;var i=this.project(t,e),o=this.getSize().divideBy(2),r=new j(i.subtract(o),i.add(o)),a=this._getBoundsOffset(r,n,e);return a.round().equals([0,0])?t:this.unproject(i.add(a),e)},_limitOffset:function(t,e){if(!e)return t;var n=this.getPixelBounds(),i=new j(n.min.add(t),n.max.add(t));return t.add(this._getBoundsOffset(i,e))},_getBoundsOffset:function(t,e,n){var i=z(this.project(e.getNorthEast(),n),this.project(e.getSouthWest(),n)),o=i.min.subtract(t.min),r=i.max.subtract(t.max);return new O(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=gt?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){he(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n))&&(this.panBy(n,e),!0)},_createAnimProxy:function(){var t=this._proxy=oe("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=Jt,n=this._proxy.style[e];me(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",function(){var t=this.getCenter(),e=this.getZoom();me(this._proxy,this.project(t,e),this.getZoomScale(e,1))},this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){re(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(o))&&(C(function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ce(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&he(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C(function(){this._moveEnd(!0)},this))}});var Xe=P.extend({options:{position:"topright"},initialize:function(t){f(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return ce(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this},remove:function(){return this._map?(re(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Ze=function(t){return new Xe(t)};Ye.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",n=this._controlContainer=oe("div",e+"control-container",this._container);function i(i,o){var r=e+i+" "+e+o;t[i+o]=oe("div",r,n)}i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)re(this._controlCorners[t]);re(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Qe=Xe.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n<i?-1:i<n?1:0}},initialize:function(t,e,n){for(var i in f(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[i],i);for(i in e)this._addLayer(e[i],i,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return Xe.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ce(this._container,"leaflet-control-layers-expanded"),this._form.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._form.clientHeight?(ce(this._form,"leaflet-control-layers-scrollbar"),this._form.style.height=t+"px"):he(this._form,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return he(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=oe("div",t),n=this.options.collapsed;e.setAttribute("aria-haspopup",!0),De(e),Re(e);var i=this._form=oe("form",t+"-list");n&&(this._map.on("click",this.collapse,this),et||Me(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=oe("a",t+"-toggle",e);o.href="#",o.title="Layers",_t?(Me(o,"click",ze),Me(o,"click",this.expand,this)):Me(o,"focus",this.expand,this),n||this.expand(),this._baseLayersList=oe("div",t+"-base",i),this._separator=oe("div",t+"-separator",i),this._overlaysList=oe("div",t+"-overlays",i),e.appendChild(i)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,n){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:n}),this.options.sortLayers&&this._layers.sort(o(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ae(this._baseLayersList),ae(this._overlaysList),this._layerControlInputs=[];var t,e,n,i,o=0;for(n=0;n<this._layers.length;n++)i=this._layers[n],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,o+=i.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(a(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),i=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=i):e=this._createRadioElement("leaflet-base-layers",i),this._layerControlInputs.push(e),e.layerId=a(t.layer),Me(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("div");return n.appendChild(r),r.appendChild(e),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var t,e,n=this._layerControlInputs,i=[],o=[];this._handlingClick=!0;for(var r=n.length-1;r>=0;r--)t=n[r],e=this._getLayer(t.layerId).layer,t.checked?i.push(e):t.checked||o.push(e);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<i.length;r++)this._map.hasLayer(i[r])||this._map.addLayer(i[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,n=this._layerControlInputs,i=this._map.getZoom(),o=n.length-1;o>=0;o--)t=n[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&i<e.options.minZoom||void 0!==e.options.maxZoom&&i>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),Ke=Xe.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=oe("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){var r=oe("a",n,i);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),De(r),Me(r,"click",ze),Me(r,"click",o,this),Me(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";he(this._zoomInButton,e),he(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ce(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ce(this._zoomInButton,e)}});Ye.mergeOptions({zoomControl:!0}),Ye.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ke,this.addControl(this.zoomControl))});var $e=Xe.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e=oe("div","leaflet-control-scale"),n=this.options;return this._addScales(n,"leaflet-control-scale-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=oe("div",e,n)),t.imperial&&(this._iScale=oe("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},_updateImperial:function(t){var e,n,i,o=3.2808399*t;o>5280?(e=o/5280,n=this._getRoundNum(e),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(o),this._updateScale(this._iScale,i+" ft",i/o))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Je=Xe.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){f(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=oe("div","leaflet-control-attribution"),De(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(" | ")}}});Ye.mergeOptions({attributionControl:!0}),Ye.addInitHook(function(){this.options.attributionControl&&(new Je).addTo(this)});Xe.Layers=Qe,Xe.Zoom=Ke,Xe.Scale=$e,Xe.Attribution=Je,Ze.layers=function(t,e,n){return new Qe(t,e,n)},Ze.zoom=function(t){return new Ke(t)},Ze.scale=function(t){return new $e(t)},Ze.attribution=function(t){return new Je(t)};var tn=P.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});tn.addTo=function(t,e){return t.addHandler(e,this),this};var en,nn={Events:A},on=_t?"touchstart mousedown":"mousedown",rn={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},an={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},sn=k.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){f(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(Me(this._dragStartTarget,on,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(sn._dragging===this&&this.finishDrag(),Le(this._dragStartTarget,on,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ue(this._element,"leaflet-zoom-anim")&&!(sn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(sn._dragging=this,this._preventOutline&&xe(this._element),we(),Xt(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,n=Ee(this._element);this._startPoint=new O(e.clientX,e.clientY),this._parentScale=Ce(n),Me(document,an[t.type],this._onMove,this),Me(document,rn[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new O(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,je(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=ye(this._element).subtract(n),ce(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ce(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,T(this._animRequest),this._lastEvent=t,this._animRequest=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),ve(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in he(document.body,"leaflet-dragging"),this._lastTarget&&(he(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),an)Le(document,an[t],this._onMove,this),Le(document,rn[t],this._onUp,this);_e(),Zt(),this._moved&&this._moving&&(T(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,sn._dragging=!1}});function ln(t,e){if(!e||!t.length)return t.slice();var n=e*e;return t=function(t,e){var n=t.length,i=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(n);i[0]=i[n-1]=1,function t(e,n,i,o,r){var a,s,l,u=0;for(s=o+1;s<=r-1;s++)(l=pn(e[s],e[o],e[r],!0))>u&&(a=s,u=l);u>i&&(n[a]=1,t(e,n,i,o,a),t(e,n,i,a,r))}(t,i,e,0,n-1);var o,r=[];for(o=0;o<n;o++)i[o]&&r.push(t[o]);return r}(t=function(t,e){for(var n=[t[0]],i=1,o=0,r=t.length;i<r;i++)fn(t[i],t[o])>e&&(n.push(t[i]),o=i);o<r-1&&n.push(t[r-1]);return n}(t,n),n)}function un(t,e,n){return Math.sqrt(pn(t,e,n,!0))}function cn(t,e,n,i,o){var r,a,s,l=i?en:dn(t,n),u=dn(e,n);for(en=u;;){if(!(l|u))return[t,e];if(l&u)return!1;s=dn(a=hn(t,e,r=l||u,n,o),n),r===l?(t=a,l=s):(e=a,u=s)}}function hn(t,e,n,i,o){var r,a,s=e.x-t.x,l=e.y-t.y,u=i.min,c=i.max;return 8&n?(r=t.x+s*(c.y-t.y)/l,a=c.y):4&n?(r=t.x+s*(u.y-t.y)/l,a=u.y):2&n?(r=c.x,a=t.y+l*(c.x-t.x)/s):1&n&&(r=u.x,a=t.y+l*(u.x-t.x)/s),new O(r,a,o)}function dn(t,e){var n=0;return t.x<e.min.x?n|=1:t.x>e.max.x&&(n|=2),t.y<e.min.y?n|=4:t.y>e.max.y&&(n|=8),n}function fn(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function pn(t,e,n,i){var o,r=e.x,a=e.y,s=n.x-r,l=n.y-a,u=s*s+l*l;return u>0&&((o=((t.x-r)*s+(t.y-a)*l)/u)>1?(r=n.x,a=n.y):o>0&&(r+=s*o,a+=l*o)),s=t.x-r,l=t.y-a,i?s*s+l*l:new O(r,a)}function gn(t){return!v(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function mn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),gn(t)}var vn=(Object.freeze||Object)({simplify:ln,pointToSegmentDistance:un,closestPointOnSegment:function(t,e,n){return pn(t,e,n)},clipSegment:cn,_getEdgeIntersection:hn,_getBitCode:dn,_sqClosestPointOnSegment:pn,isFlat:gn,_flat:mn});function yn(t,e,n){var i,o,r,a,s,l,u,c,h,d=[1,4,2,8];for(o=0,u=t.length;o<u;o++)t[o]._code=dn(t[o],e);for(a=0;a<4;a++){for(c=d[a],i=[],o=0,r=(u=t.length)-1;o<u;r=o++)s=t[o],l=t[r],s._code&c?l._code&c||((h=hn(l,s,c,e,n))._code=dn(h,e),i.push(h)):(l._code&c&&((h=hn(l,s,c,e,n))._code=dn(h,e),i.push(h)),i.push(s));t=i}return t}var bn=(Object.freeze||Object)({clipPolygon:yn}),wn={project:function(t){return new O(t.lng,t.lat)},unproject:function(t){return new F(t.y,t.x)},bounds:new j([-180,-90],[180,90])},_n={R:6378137,R_MINOR:6356752.314245179,bounds:new j([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,n=this.R,i=t.lat*e,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),a=r*Math.sin(i),s=Math.tan(Math.PI/4-i/2)/Math.pow((1-a)/(1+a),r/2);return i=-n*Math.log(Math.max(s,1e-10)),new O(t.lng*e*n,i)},unproject:function(t){for(var e,n=180/Math.PI,i=this.R,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),a=Math.exp(-t.y/i),s=Math.PI/2-2*Math.atan(a),l=0,u=.1;l<15&&Math.abs(u)>1e-7;l++)e=r*Math.sin(s),e=Math.pow((1-e)/(1+e),r/2),s+=u=Math.PI/2-2*Math.atan(a*e)-s;return new F(s*n,t.x*n/i)}},xn=(Object.freeze||Object)({LonLat:wn,Mercator:_n,SphericalMercator:B}),Sn=n({},V,{code:"EPSG:3395",projection:_n,transformation:function(){var t=.5/(Math.PI*_n.R);return W(t,.5,-t,.5)}()}),En=n({},V,{code:"EPSG:4326",projection:wn,transformation:W(1/180,1,-1/180,.5)}),Cn=n({},G,{projection:wn,transformation:W(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});G.Earth=V,G.EPSG3395=Sn,G.EPSG3857=q,G.EPSG900913=Y,G.EPSG4326=En,G.Simple=Cn;var Tn=k.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",function(){e.off(n,this)},this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});Ye.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&a(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?v(t)?t:[t]:[]).length;e<n;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,n=this._getZoomSpan();for(var i in this._zoomBoundLayers){var o=this._zoomBoundLayers[i].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Mn=Tn.extend({initialize:function(t,e){var n,i;if(f(this,e),this._layers={},t)for(n=0,i=t.length;n<i;n++)this.addLayer(t[n])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,n,i=Array.prototype.slice.call(arguments,1);for(e in this._layers)(n=this._layers[e])[t]&&n[t].apply(n,i);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),Pn=Mn.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Mn.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Mn.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new N;for(var e in this._layers){var n=this._layers[e];t.extend(n.getBounds?n.getBounds():n.getLatLng())}return t}}),Ln=P.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){f(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var n=this._getIconUrl(t);if(!n){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(n,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(i,t),i},_setIconStyles:function(t,e){var n=this.options,i=n[e+"Size"];"number"==typeof i&&(i=[i,i]);var o=D(i),r=D("shadow"===e&&n.shadowAnchor||n.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(n.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Et&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});var An=Ln.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return An.imagePath||(An.imagePath=this._detectIconPath()),(this.options.imagePath||An.imagePath)+Ln.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=oe("div","leaflet-default-icon-path",document.body),e=ie(t,"background-image")||ie(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),kn=tn.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new sn(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ce(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&he(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,n=e._map,i=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=ye(e._icon),a=n.getPixelBounds(),s=n.getPixelOrigin(),l=z(a.min._subtract(s).add(o),a.max._subtract(s).subtract(o));if(!l.contains(r)){var u=D((Math.max(l.max.x,r.x)-l.max.x)/(a.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(a.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(a.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(a.min.y-l.min.y)).multiplyBy(i);n.panBy(u,{animate:!1}),this._draggable._newPos._add(u),this._draggable._startPos._add(u),ve(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(T(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,n=e._shadow,i=ye(e._icon),o=e._map.layerPointToLatLng(i);n&&ve(n,i),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){T(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),On=Tn.extend({options:{icon:new An,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){f(this,e),this._latlng=H(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=H(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=t.icon.createIcon(this._icon),i=!1;n!==this._icon&&(this._icon&&this._removeIcon(),i=!0,t.title&&(n.title=t.title),"IMG"===n.tagName&&(n.alt=t.alt||"")),ce(n,e),t.keyboard&&(n.tabIndex="0"),this._icon=n,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(ce(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),i&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane("shadowPane").appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),re(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&re(this._shadow),this._shadow=null},_setPos:function(t){ve(this._icon,t),this._shadow&&ve(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ce(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),kn)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new kn(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;pe(this._icon,t),this._shadow&&pe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});var Rn=Tn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return f(this,t),this._renderer&&this._renderer._updateStyle(this),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),Dn=Rn.extend({options:{fill:!0,radius:10},initialize:function(t,e){f(this,e),this._latlng=H(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=H(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return Rn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,n=this._clickTolerance(),i=[t+n,e+n];this._pxBounds=new j(this._point.subtract(i),this._point.add(i))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});var jn=Dn.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=n({},i,{radius:e})),f(this,e),this._latlng=H(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new N(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Rn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,n=this._map,i=n.options.crs;if(i.distance===V.distance){var o=Math.PI/180,r=this._mRadius/V.R/o,a=n.project([e+r,t]),s=n.project([e-r,t]),l=a.add(s).divideBy(2),u=n.unproject(l).lat,c=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(u*o))/(Math.cos(e*o)*Math.cos(u*o)))/o;(isNaN(c)||0===c)&&(c=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(n.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-n.project([u,t-c]).x,this._radiusY=l.y-a.y}else{var h=i.unproject(i.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(h).x}this._updateBounds()}});var zn=Rn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){f(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,n,i=1/0,o=null,r=pn,a=0,s=this._parts.length;a<s;a++)for(var l=this._parts[a],u=1,c=l.length;u<c;u++){var h=r(t,e=l[u-1],n=l[u],!0);h<i&&(i=h,o=r(t,e,n))}return o&&(o.distance=Math.sqrt(i)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,n,i,o,r,a,s=this._rings[0],l=s.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=s[t].distanceTo(s[t+1])/2;if(0===e)return this._map.layerPointToLatLng(s[0]);for(t=0,i=0;t<l-1;t++)if(o=s[t],r=s[t+1],(i+=n=o.distanceTo(r))>e)return a=(i-e)/n,this._map.layerPointToLatLng([r.x-a*(r.x-o.x),r.y-a*(r.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=H(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new N,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return gn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],n=gn(t),i=0,o=t.length;i<o;i++)n?(e[i]=H(t[i]),this._bounds.extend(e[i])):e[i]=this._convertLatLngs(t[i]);return e},_project:function(){var t=new j;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t);var e=this._clickTolerance(),n=new O(e,e);this._bounds.isValid()&&t.isValid()&&(t.min._subtract(n),t.max._add(n),this._pxBounds=t)},_projectLatlngs:function(t,e,n){var i,o,r=t[0]instanceof F,a=t.length;if(r){for(o=[],i=0;i<a;i++)o[i]=this._map.latLngToLayerPoint(t[i]),n.extend(o[i]);e.push(o)}else for(i=0;i<a;i++)this._projectLatlngs(t[i],e,n)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,n,i,o,r,a,s,l=this._parts;for(e=0,i=0,o=this._rings.length;e<o;e++)for(n=0,r=(s=this._rings[e]).length;n<r-1;n++)(a=cn(s[n],s[n+1],t,n,!0))&&(l[i]=l[i]||[],l[i].push(a[0]),a[1]===s[n+1]&&n!==r-2||(l[i].push(a[1]),i++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,n=0,i=t.length;n<i;n++)t[n]=ln(t[n],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var n,i,o,r,a,s,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,r=this._parts.length;n<r;n++)for(i=0,o=(a=(s=this._parts[n]).length)-1;i<a;o=i++)if((e||0!==i)&&un(t,s[o],s[i])<=l)return!0;return!1}});zn._flat=mn;var Nn=zn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,n,i,o,r,a,s,l,u=this._rings[0],c=u.length;if(!c)return null;for(r=a=s=0,t=0,e=c-1;t<c;e=t++)n=u[t],i=u[e],o=n.y*i.x-i.y*n.x,a+=(n.x+i.x)*o,s+=(n.y+i.y)*o,r+=3*o;return l=0===r?u[0]:[a/r,s/r],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=zn.prototype._convertLatLngs.call(this,t),n=e.length;return n>=2&&e[0]instanceof F&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){zn.prototype._setLatLngs.call(this,t),gn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return gn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new O(e,e);if(t=new j(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,o=0,r=this._rings.length;o<r;o++)(i=yn(this._rings[o],t,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,n,i,o,r,a,s,l,u=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,s=this._parts.length;o<s;o++)for(r=0,a=(l=(e=this._parts[o]).length)-1;r<l;a=r++)n=e[r],i=e[a],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(u=!u);return u||zn.prototype._containsPoint.call(this,t,!0)}});var In=Pn.extend({initialize:function(t,e){f(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,o=v(t)?t:t.features;if(o){for(e=0,n=o.length;e<n;e++)((i=o[e]).geometries||i.geometry||i.features||i.coordinates)&&this.addData(i);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var a=Fn(t,r);return a?(a.feature=Wn(t),a.defaultOptions=a.options,this.resetStyle(a),r.onEachFeature&&r.onEachFeature(t,a),this.addLayer(a)):this},resetStyle:function(t){return t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}});function Fn(t,e){var n,i,o,r,a="Feature"===t.type?t.geometry:t,s=a?a.coordinates:null,l=[],u=e&&e.pointToLayer,c=e&&e.coordsToLatLng||Hn;if(!s&&!a)return null;switch(a.type){case"Point":return n=c(s),u?u(t,n):new On(n);case"MultiPoint":for(o=0,r=s.length;o<r;o++)n=c(s[o]),l.push(u?u(t,n):new On(n));return new Pn(l);case"LineString":case"MultiLineString":return i=Gn(s,"LineString"===a.type?0:1,c),new zn(i,e);case"Polygon":case"MultiPolygon":return i=Gn(s,"Polygon"===a.type?1:2,c),new Nn(i,e);case"GeometryCollection":for(o=0,r=a.geometries.length;o<r;o++){var h=Fn({geometry:a.geometries[o],type:"Feature",properties:t.properties},e);h&&l.push(h)}return new Pn(l);default:throw new Error("Invalid GeoJSON object.")}}function Hn(t){return new F(t[1],t[0],t[2])}function Gn(t,e,n){for(var i,o=[],r=0,a=t.length;r<a;r++)i=e?Gn(t[r],e-1,n):(n||Hn)(t[r]),o.push(i);return o}function Vn(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[c(t.lng,e),c(t.lat,e),c(t.alt,e)]:[c(t.lng,e),c(t.lat,e)]}function Bn(t,e,n,i){for(var o=[],r=0,a=t.length;r<a;r++)o.push(e?Bn(t[r],e-1,n,i):Vn(t[r],i));return!e&&n&&o.push(o[0]),o}function Un(t,e){return t.feature?n({},t.feature,{geometry:e}):Wn(e)}function Wn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var qn={toGeoJSON:function(t){return Un(this,{type:"Point",coordinates:Vn(this.getLatLng(),t)})}};function Yn(t,e){return new In(t,e)}On.include(qn),jn.include(qn),Dn.include(qn),zn.include({toGeoJSON:function(t){var e=!gn(this._latlngs),n=Bn(this._latlngs,e?1:0,!1,t);return Un(this,{type:(e?"Multi":"")+"LineString",coordinates:n})}}),Nn.include({toGeoJSON:function(t){var e=!gn(this._latlngs),n=e&&!gn(this._latlngs[0]),i=Bn(this._latlngs,n?2:e?1:0,!0,t);return e||(i=[i]),Un(this,{type:(n?"Multi":"")+"Polygon",coordinates:i})}}),Mn.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(n){e.push(n.toGeoJSON(t).geometry.coordinates)}),Un(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var n="GeometryCollection"===e,i=[];return this.eachLayer(function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(n)i.push(o.geometry);else{var r=Wn(o);"FeatureCollection"===r.type?i.push.apply(i,r.features):i.push(r)}}}),n?Un(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});var Xn=Yn,Zn=Tn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,n){this._url=t,this._bounds=I(e),f(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ce(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){re(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&se(this._image),this},bringToBack:function(){return this._map&&le(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=I(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:oe("img");ce(e,"leaflet-image-layer"),this._zoomAnimated&&ce(e,"leaflet-zoom-animated"),this.options.className&&ce(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;me(this._image,n,e)},_reset:function(){var t=this._image,e=new j(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=e.getSize();ve(t,e.min),t.style.width=n.x+"px",t.style.height=n.y+"px"},_updateOpacity:function(){pe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),Qn=Zn.extend({options:{autoplay:!0,loop:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:oe("video");if(ce(e,"leaflet-image-layer"),this._zoomAnimated&&ce(e,"leaflet-zoom-animated"),e.onselectstart=u,e.onmousemove=u,e.onloadeddata=o(this.fire,this,"load"),t){for(var n=e.getElementsByTagName("source"),i=[],r=0;r<n.length;r++)i.push(n[r].src);this._url=n.length>0?i:[e.src]}else{v(this._url)||(this._url=[this._url]),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var a=0;a<this._url.length;a++){var s=oe("source");s.src=this._url[a],e.appendChild(s)}}}});var Kn=Tn.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){f(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&pe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&pe(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(pe(this._container,0),this._removeTimeout=setTimeout(o(re,void 0,this._container),200)):re(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=H(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&se(this._container),this},bringToBack:function(){return this._map&&le(this._container),this},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=D(this.options.offset),n=this._getAnchor();this._zoomAnimated?ve(this._container,t.add(n)):e=e.add(t).add(n);var i=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=i+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),$n=Kn.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Kn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Rn||this._source.on("preclick",Oe))},onRemove:function(t){Kn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Rn||this._source.off("preclick",Oe))},getEvents:function(){var t=Kn.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=oe("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=oe("div",t+"-content-wrapper",e);if(this._contentNode=oe("div",t+"-content",n),De(n),Re(this._contentNode),Me(n,"contextmenu",Oe),this._tipContainer=oe("div",t+"-tip-container",e),this._tip=oe("div",t+"-tip",this._tipContainer),this.options.closeButton){var i=this._closeButton=oe("a",t+"-close-button",e);i.href="#close",i.innerHTML="&#215;",Me(i,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var n=t.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),e.width=n+1+"px",e.whiteSpace="",e.height="";var i=t.offsetHeight,o=this.options.maxHeight;o&&i>o?(e.height=o+"px",ce(t,"leaflet-popup-scrolled")):he(t,"leaflet-popup-scrolled"),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();ve(this._container,e.add(n))},_adjustPan:function(){if(!(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)){var t=this._map,e=parseInt(ie(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,o=new O(this._containerLeft,-n-this._containerBottom);o._add(ye(this._container));var r=t.layerPointToContainerPoint(o),a=D(this.options.autoPanPadding),s=D(this.options.autoPanPaddingTopLeft||a),l=D(this.options.autoPanPaddingBottomRight||a),u=t.getSize(),c=0,h=0;r.x+i+l.x>u.x&&(c=r.x+i-u.x+l.x),r.x-c-s.x<0&&(c=r.x-s.x),r.y+n+l.y>u.y&&(h=r.y+n-u.y+l.y),r.y-h-s.y<0&&(h=r.y-s.y),(c||h)&&t.fire("autopanstart").panBy([c,h])}},_onCloseButtonClick:function(t){this._close(),ze(t)},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ye.mergeOptions({closePopupOnClick:!0}),Ye.include({openPopup:function(t,e,n){return t instanceof $n||(t=new $n(n).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Tn.include({bindPopup:function(t,e){return t instanceof $n?(f(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new $n(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){if(t instanceof Tn||(e=t,t=this),t instanceof Pn)for(var n in this._layers){t=this._layers[n];break}return e||(e=t.getCenter?t.getCenter():t.getLatLng()),this._popup&&this._map&&(this._popup._source=t,this._popup.update(),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(ze(t),e instanceof Rn?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Jn=Kn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Kn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Kn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Kn.prototype.getEvents.call(this);return _t&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=oe("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,n=this._container,i=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),r=this.options.direction,a=n.offsetWidth,s=n.offsetHeight,l=D(this.options.offset),u=this._getAnchor();"top"===r?t=t.add(D(-a/2+l.x,-s+l.y+u.y,!0)):"bottom"===r?t=t.subtract(D(a/2-l.x,-l.y,!0)):"center"===r?t=t.subtract(D(a/2+l.x,s/2-u.y+l.y,!0)):"right"===r||"auto"===r&&o.x<i.x?(r="right",t=t.add(D(l.x+u.x,u.y-s/2+l.y,!0))):(r="left",t=t.subtract(D(a+u.x-l.x,s/2-u.y-l.y,!0))),he(n,"leaflet-tooltip-right"),he(n,"leaflet-tooltip-left"),he(n,"leaflet-tooltip-top"),he(n,"leaflet-tooltip-bottom"),ce(n,"leaflet-tooltip-"+r),ve(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&pe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});Ye.include({openTooltip:function(t,e,n){return t instanceof Jn||(t=new Jn(n).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Tn.include({bindTooltip:function(t,e){return t instanceof Jn?(f(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Jn(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),_t&&(n.click=this._openTooltip)),this[e](n),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){if(t instanceof Tn||(e=t,t=this),t instanceof Pn)for(var n in this._layers){t=this._layers[n];break}return e||(e=t.getCenter?t.getCenter():t.getLatLng()),this._tooltip&&this._map&&(this._tooltip._source=t,this._tooltip.update(),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ce(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(he(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,n,i=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),n=this._map.containerPointToLayerPoint(e),i=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(i)}});var ti=Ln.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),n=this.options;if(e.innerHTML=!1!==n.html?n.html:"",n.bgPos){var i=D(n.bgPos);e.style.backgroundPosition=-i.x+"px "+-i.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});Ln.Default=An;var ei=Tn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:mt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){f(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),re(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(se(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(le(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=s(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof O?t:new O(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,n=this.getPane().children,i=-t(-1/0,1/0),o=0,r=n.length;o<r;o++)e=n[o].style.zIndex,n[o]!==this._container&&e&&(i=t(i,+e));isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!$){pe(this._container,this.options.opacity);var t=+new Date,e=!1,n=!1;for(var i in this._tiles){var o=this._tiles[i];if(o.current&&o.loaded){var r=Math.min(1,(t-o.loaded)/200);pe(o.el,r),r<1?e=!0:(o.active?n=!0:this._onOpaqueTile(o),o.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),e&&(T(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:u,_initContainer:function(){this._container||(this._container=oe("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var n in this._levels)this._levels[n].el.children.length||n===t?(this._levels[n].el.style.zIndex=e-Math.abs(t-n),this._onUpdateLevel(n)):(re(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var i=this._levels[t],o=this._map;return i||((i=this._levels[t]={}).el=oe("div","leaflet-tile-container leaflet-zoom-animated",this._container),i.el.style.zIndex=e,i.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),i.zoom=t,this._setZoomTransform(i,o.getCenter(),o.getZoom()),i.el.offsetWidth,this._onCreateLevel(i)),this._level=i,i}},_onUpdateLevel:u,_onRemoveLevel:u,_onCreateLevel:u,_pruneTiles:function(){if(this._map){var t,e,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var i=e.coords;this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)re(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,n,i){var o=Math.floor(t/2),r=Math.floor(e/2),a=n-1,s=new O(+o,+r);s.z=+a;var l=this._tileCoordsToKey(s),u=this._tiles[l];return u&&u.active?(u.retain=!0,!0):(u&&u.loaded&&(u.retain=!0),a>i&&this._retainParent(o,r,a,i))},_retainChildren:function(t,e,n,i){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var a=new O(o,r);a.z=n+1;var s=this._tileCoordsToKey(a),l=this._tiles[s];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1<i&&this._retainChildren(o,r,n+1,i))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,n,i){var o=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var r=this.options.updateWhenZooming&&o!==this._tileZoom;i&&!r||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var n in this._levels)this._setZoomTransform(this._levels[n],t,e)},_setZoomTransform:function(t,e,n){var i=this._map.getZoomScale(n,t.zoom),o=t.origin.multiplyBy(i).subtract(this._map._getNewPixelOrigin(e,n)).round();gt?me(t.el,o,i):ve(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,n=this._tileSize=this.getTileSize(),i=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],i).x/n.x),Math.ceil(t.project([0,e.wrapLng[1]],i).x/n.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],i).y/n.x),Math.ceil(t.project([e.wrapLat[1],0],i).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,n=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(n,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*i);return new j(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var n=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var i=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(i),r=o.getCenter(),a=[],s=this.options.keepBuffer,l=new j(o.getBottomLeft().subtract([s,-s]),o.getTopRight().add([s,-s]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var u in this._tiles){var c=this._tiles[u].coords;c.z===this._tileZoom&&l.contains(new O(c.x,c.y))||(this._tiles[u].current=!1)}if(Math.abs(n-this._tileZoom)>1)this._setView(t,n);else{for(var h=o.min.y;h<=o.max.y;h++)for(var d=o.min.x;d<=o.max.x;d++){var f=new O(d,h);if(f.z=this._tileZoom,this._isValidTile(f)){var p=this._tiles[this._tileCoordsToKey(f)];p?p.current=!0:a.push(f)}}if(a.sort(function(t,e){return t.distanceTo(r)-e.distanceTo(r)}),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var g=document.createDocumentFragment();for(d=0;d<a.length;d++)this._addTile(a[d],g);this._level.el.appendChild(g)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var n=this._globalTileRange;if(!e.wrapLng&&(t.x<n.min.x||t.x>n.max.x)||!e.wrapLat&&(t.y<n.min.y||t.y>n.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return I(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),o=i.add(n);return[e.unproject(i,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new N(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new O(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(re(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ce(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,$&&this.options.opacity<1&&pe(t,this.options.opacity),et&&!nt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&C(o(this._tileReady,this,t,null,r)),ve(r,n),this._tiles[i]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);(n=this._tiles[i])&&(n.loaded=+new Date,this._map._fadeAnimated?(pe(n.el,0),T(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(ce(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),$||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new O(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new j(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var ni=ei.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=f(this,e)).detectRetina&&Et&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),et||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},createTile:function(t,e){var n=document.createElement("img");return Me(n,"load",o(this._tileOnLoad,this,e,n)),Me(n,"error",o(this._tileOnError,this,e,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:Et?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return m(this._url,n(e,this.options))},_tileOnLoad:function(t,e){$?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,n=this.options.zoomReverse,i=this.options.zoomOffset;return n&&(t=e-t),t+i},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=u,e.onerror=u,e.complete||(e.src=b,re(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return ot||e.el.setAttribute("src",b),ei.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==b))return ei.prototype._tileReady.call(this,t,e,n)}});function ii(t,e){return new ni(t,e)}var oi=ni.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var o in e)o in this.options||(i[o]=e[o]);var r=(e=f(this,e)).detectRetina&&Et?2:1,a=this.getTileSize();i.width=a.x*r,i.height=a.y*r,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,ni.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=z(n.project(e[0]),n.project(e[1])),o=i.min,r=i.max,a=(this._wmsVersion>=1.3&&this._crs===En?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),s=ni.prototype.getTileUrl.call(this,t);return s+p(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});ni.WMS=oi,ii.wms=function(t,e){return new oi(t,e)};var ri=Tn.extend({options:{padding:.1,tolerance:0},initialize:function(t){f(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ce(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=ye(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),a=this._map.project(t,e).subtract(r),s=o.multiplyBy(-n).add(i).add(o).subtract(a);gt?me(this._container,s,n):ve(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new j(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ai=ri.extend({getEvents:function(){var t=ri.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ri.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Me(t,"mousemove",s(this._onMouseMove,32,this),this),Me(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Me(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,re(this._container),Le(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){this._drawnLayers={},ri.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=Et?2:1;ve(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Et&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ri.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,i=e.prev;n?n.prev=i:this._drawLast=i,i?i.next=n:this._drawFirst=n,delete this._drawnLayers[t._leaflet_id],delete t._order,delete this._layers[a(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n=t.options.dashArray.split(/[, ]+/),i=[];for(e=0;e<n.length;e++)i.push(Number(n[e]));t.options._dashArray=i}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new j,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var n=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var i=this._drawFirst;i;i=i.next)t=i.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var n,i,o,r,a=t._parts,s=a.length,l=this._ctx;if(s){for(this._drawnLayers[t._leaflet_id]=t,l.beginPath(),n=0;n<s;n++){for(i=0,o=a[n].length;i<o;i++)r=a[n][i],l[i?"lineTo":"moveTo"](r.x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,n=this._ctx,i=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||i)/i;this._drawnLayers[t._leaflet_id]=t,1!==o&&(n.save(),n.scale(1,o)),n.beginPath(),n.arc(e.x,e.y/o,i,0,2*Math.PI,!1),1!==o&&n.restore(),this._fillStroke(n,t)}},_fillStroke:function(t,e){var n=e.options;n.fill&&(t.globalAlpha=n.fillOpacity,t.fillStyle=n.fillColor||n.color,t.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=n.opacity,t.lineWidth=n.weight,t.strokeStyle=n.color,t.lineCap=n.lineCap,t.lineJoin=n.lineJoin,t.stroke())},_onClick:function(t){for(var e,n,i=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(i)&&!this._map._draggableMoved(e)&&(n=e);n&&(Ve(t),this._fireEvent([n],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(he(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var n,i,o=this._drawFirst;o;o=o.next)(n=o.layer).options.interactive&&n._containsPoint(e)&&(i=n);i!==this._hoveredLayer&&(this._handleMouseOut(t),i&&(ce(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseover"),this._hoveredLayer=i)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,n){this._map._fireDOMEvent(e,n||e.type,t)},_bringToFront:function(t){var e=t._order,n=e.next,i=e.prev;n&&(n.prev=i,i?i.next=n:n&&(this._drawFirst=n),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))},_bringToBack:function(t){var e=t._order,n=e.next,i=e.prev;i&&(i.next=n,n?n.prev=i:i&&(this._drawLast=i),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}});function si(t){return Ct?new ai(t):null}var li=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),ui={_initContainer:function(){this._container=oe("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ri.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=li("shape");ce(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=li("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;re(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e||(e=t._stroke=li("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=v(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=li("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){se(t._container)},_bringToBack:function(t){le(t._container)}},ci=Mt?li:X,hi=ri.extend({getEvents:function(){var t=ri.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=ci("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ci("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){re(this._container),Le(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){ri.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),ve(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=ci("path");t.options.className&&ce(e,t.options.className),t.options.interactive&&ce(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){re(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,Z(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){se(t._path)},_bringToBack:function(t){le(t._path)}});function di(t){return Tt||Mt?new hi(t):null}Mt&&hi.include(ui),Ye.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&si(t)||di(t)}});var fi=Nn.extend({initialize:function(t,e){Nn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=I(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});hi.create=ci,hi.pointsToPath=Z,In.geometryToLayer=Fn,In.coordsToLatLng=Hn,In.coordsToLatLngs=Gn,In.latLngToCoords=Vn,In.latLngsToCoords=Bn,In.getFeature=Un,In.asFeature=Wn,Ye.mergeOptions({boxZoom:!0});var pi=tn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Me(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Le(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){re(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Xt(),we(),this._startPoint=this._map.mouseEventToContainerPoint(t),Me(document,{contextmenu:ze,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=oe("div","leaflet-zoom-box",this._container),ce(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new j(this._point,this._startPoint),n=e.getSize();ve(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(re(this._box),he(this._container,"leaflet-crosshair")),Zt(),_e(),Le(document,{contextmenu:ze,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});Ye.addInitHook("addHandler","boxZoom",pi),Ye.mergeOptions({doubleClickZoom:!0});var gi=tn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,o=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});Ye.addInitHook("addHandler","doubleClickZoom",gi),Ye.mergeOptions({dragging:!0,inertia:!nt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var mi=tn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new sn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ce(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){he(this._map._container,"leaflet-grab"),he(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=I(this._map.options.maxBounds);this._offsetLimit=z(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,o=(i-e+n)%t+e-n,r=(i+e+n)%t-e-n,a=Math.abs(o+n)<Math.abs(r+n)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=a},_onDragEnd:function(t){var e=this._map,n=e.options,i=!n.inertia||this._times.length<2;if(e.fire("dragend",t),i)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,a=n.easeLinearity,s=o.multiplyBy(a/r),l=s.distanceTo([0,0]),u=Math.min(n.inertiaMaxSpeed,l),c=s.multiplyBy(u/l),h=u/(n.inertiaDeceleration*a),d=c.multiplyBy(-h/2).round();d.x||d.y?(d=e._limitOffset(d,e.options.maxBounds),C(function(){e.panBy(d,{duration:h,easeLinearity:a,noMoveStart:!0,animate:!0})})):e.fire("moveend")}}});Ye.addInitHook("addHandler","dragging",mi),Ye.mergeOptions({keyboard:!0,keyboardPanDelta:80});var vi=tn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Me(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Le(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,n=t.scrollTop||e.scrollTop,i=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(i,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,n,i=this._panKeys={},o=this.keyCodes;for(e=0,n=o.left.length;e<n;e++)i[o.left[e]]=[-1*t,0];for(e=0,n=o.right.length;e<n;e++)i[o.right[e]]=[t,0];for(e=0,n=o.down.length;e<n;e++)i[o.down[e]]=[0,t];for(e=0,n=o.up.length;e<n;e++)i[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,n,i=this._zoomKeys={},o=this.keyCodes;for(e=0,n=o.zoomIn.length;e<n;e++)i[o.zoomIn[e]]=t;for(e=0,n=o.zoomOut.length;e<n;e++)i[o.zoomOut[e]]=-t},_addHooks:function(){Me(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Le(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,n=t.keyCode,i=this._map;if(n in this._panKeys)i._panAnim&&i._panAnim._inProgress||(e=this._panKeys[n],t.shiftKey&&(e=D(e).multiplyBy(3)),i.panBy(e),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds));else if(n in this._zoomKeys)i.setZoom(i.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!i._popup||!i._popup.options.closeOnEscapeKey)return;i.closePopup()}ze(t)}}});Ye.addInitHook("addHandler","keyboard",vi),Ye.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var yi=tn.extend({addHooks:function(){Me(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Le(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Fe(t),n=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),i),ze(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),n=this._map.options.zoomSnap||0;t._stop();var i=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(i))))/Math.LN2,r=n?Math.ceil(o/n)*n:o,a=t._limitZoom(e+(this._delta>0?r:-r))-e;this._delta=0,this._startTime=null,a&&("center"===t.options.scrollWheelZoom?t.setZoom(e+a):t.setZoomAround(this._lastMousePos,e+a))}});Ye.addInitHook("addHandler","scrollWheelZoom",yi),Ye.mergeOptions({tap:!0,tapTolerance:15});var bi=tn.extend({addHooks:function(){Me(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Le(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(je(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],n=e.target;this._startPos=this._newPos=new O(e.clientX,e.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&ce(n,"leaflet-active"),this._holdTimeout=setTimeout(o(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))},this),1e3),this._simulateEvent("mousedown",e),Me(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Le(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],n=e.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&he(n,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new O(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var n=document.createEvent("MouseEvents");n._simulated=!0,e.target._simulatedClick=!0,n.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(n)}});_t&&!wt&&Ye.addInitHook("addHandler","tap",bi),Ye.mergeOptions({touchZoom:_t&&!nt,bounceAtZoomLimits:!0});var wi=tn.extend({addHooks:function(){ce(this._map._container,"leaflet-touch-zoom"),Me(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){he(this._map._container,"leaflet-touch-zoom"),Le(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Me(document,"touchmove",this._onTouchMove,this),Me(document,"touchend",this._onTouchEnd,this),je(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]),r=n.distanceTo(i)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var a=n._add(i)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),T(this._animRequest);var s=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=C(s,this,!0),je(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,T(this._animRequest),Le(document,"touchmove",this._onTouchMove),Le(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});Ye.addInitHook("addHandler","touchZoom",wi),Ye.BoxZoom=pi,Ye.DoubleClickZoom=gi,Ye.Drag=mi,Ye.Keyboard=vi,Ye.ScrollWheelZoom=yi,Ye.Tap=bi,Ye.TouchZoom=wi,Object.freeze=e,t.version="1.3.4",t.Control=Xe,t.control=Ze,t.Browser=Lt,t.Evented=k,t.Mixin=nn,t.Util=M,t.Class=P,t.Handler=tn,t.extend=n,t.bind=o,t.stamp=a,t.setOptions=f,t.DomEvent=We,t.DomUtil=Te,t.PosAnimation=qe,t.Draggable=sn,t.LineUtil=vn,t.PolyUtil=bn,t.Point=O,t.point=D,t.Bounds=j,t.bounds=z,t.Transformation=U,t.transformation=W,t.Projection=xn,t.LatLng=F,t.latLng=H,t.LatLngBounds=N,t.latLngBounds=I,t.CRS=G,t.GeoJSON=In,t.geoJSON=Yn,t.geoJson=Xn,t.Layer=Tn,t.LayerGroup=Mn,t.layerGroup=function(t,e){return new Mn(t,e)},t.FeatureGroup=Pn,t.featureGroup=function(t){return new Pn(t)},t.ImageOverlay=Zn,t.imageOverlay=function(t,e,n){return new Zn(t,e,n)},t.VideoOverlay=Qn,t.videoOverlay=function(t,e,n){return new Qn(t,e,n)},t.DivOverlay=Kn,t.Popup=$n,t.popup=function(t,e){return new $n(t,e)},t.Tooltip=Jn,t.tooltip=function(t,e){return new Jn(t,e)},t.Icon=Ln,t.icon=function(t){return new Ln(t)},t.DivIcon=ti,t.divIcon=function(t){return new ti(t)},t.Marker=On,t.marker=function(t,e){return new On(t,e)},t.TileLayer=ni,t.tileLayer=ii,t.GridLayer=ei,t.gridLayer=function(t){return new ei(t)},t.SVG=hi,t.svg=di,t.Renderer=ri,t.Canvas=ai,t.canvas=si,t.Path=Rn,t.CircleMarker=Dn,t.circleMarker=function(t,e){return new Dn(t,e)},t.Circle=jn,t.circle=function(t,e,n){return new jn(t,e,n)},t.Polyline=zn,t.polyline=function(t,e){return new zn(t,e)},t.Polygon=Nn,t.polygon=function(t,e){return new Nn(t,e)},t.Rectangle=fi,t.rectangle=function(t,e){return new fi(t,e)},t.Map=Ye,t.map=function(t,e){return new Ye(t,e)};var _i=window.L;t.noConflict=function(){return window.L=_i,this},window.L=t})},function(t,e,n){"use strict";var i=p(n(66)),o=p(n(197)),r=p(n(2)),a=p(n(2)),s=n(208),l=n(17);n(227);var u=n(11),c=p(n(232)),h=n(461),d=p(n(463)),f=n(468);function p(t){return t&&t.__esModule?t:{default:t}}function g(t,e){a.default.render(r.default.createElement(s.AppContainer,null,r.default.createElement(l.Provider,{store:h.store},r.default.createElement(c.default,{payload:e}))),t)}function m(t){t.forEach(function(t){var e=(0,i.default)(t,2),n=e[0],o=e[1];switch(n.parentNode.classList.add(o.cmd),o.cmd){case"citations":case"load_file":n.parentNode.classList.add("wide"),g(n,o),n.classList.add("loaded");break;case"map":n.parentNode.classList.add("wide"),(0,d.default)(n,o),n.classList.add("loaded");break;default:g(n,o),n.classList.add("loaded")}})}function v(){var t=(0,u.toArray)(document.querySelectorAll(".applet")).map(function(t){var e=void 0;try{e=JSON.parse(t.dataset.payload)}catch(t){return null}var n=e.command.split(" "),i=n.shift(),o=e.dataset||null,r=null,a=null;if(e.cmd=i,e.partz=n,"load_file"===e.cmd)return e.url="https://nyc3.digitaloceanspaces.com/megapixels/v1"+n.shift(),[t,e];if(e.partz.length&&(0===(a=e.partz.shift().trim()).indexOf("http")?(o=null,r=a):0===a.indexOf("assets")?o=null:(o=a,r=null)),"datasets"in e&&!o&&!r||window.location.pathname.match("datasets")){var s=window.location.pathname.split("/").filter(function(t){return!!t});if(!(s.length>1))return[t,e];"index.html"===(o=s.pop())&&(o=s.pop())}return e.dataset=o,e.url=r,[t,e]}).filter(function(t){return!!t}),e=t.map(function(t){return t[1].dataset?t[1]:null}).filter(function(t){return!!t});e.length?function(t){if("face_analysis"===t.command)return new o.default(function(t){return t()});if("info"===t.dataset)return new o.default(function(t){return t()});var e="https://megapixels.nyc3.digitaloceanspaces.com/v1/citations/verified/"+t.dataset+".json";return fetch(e,{mode:"cors"}).then(function(t){return t.json()})}(e[0]).then(function(n){e.forEach(function(t){return t.data=n}),m(t)}):m(t)}!function(){var t="",e=window.location.href;t=e.match("news")?"news":e.match("about")?"about":e.match("datasets")?"datasets":e,(0,u.toArray)(document.querySelectorAll("header .links a")).some(function(e){return!!e.href.match(t)&&(e.classList.add("active"),!0)}),v(),function(){var t=document.querySelector(".content section:nth-child(2)");t&&new Waypoint({element:t,handler:function(t){"down"===t?document.body.classList.add("scrolled"):document.body.classList.remove("scrolled")}})}(),function(){var t=document.createElement("div");document.body.appendChild(t),a.default.render(r.default.createElement(f.ModalImage,null),t)}()}()},function(t,e,n){t.exports={default:n(185),__esModule:!0}},function(t,e,n){n(37),n(32),t.exports=n(193)},function(t,e,n){"use strict";var i=n(187),o=n(101),r=n(29),a=n(30);t.exports=n(69)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},function(t,e){t.exports=function(){}},function(t,e,n){"use strict";var i=n(52),o=n(41),r=n(43),a={};n(20)(a,n(6)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(a,{next:o(1,n)}),r(t,e+" Iterator")}},function(t,e,n){var i=n(9),o=n(15),r=n(42);t.exports=n(16)?Object.defineProperties:function(t,e){o(t);for(var n,a=r(e),s=a.length,l=0;s>l;)i.f(t,n=a[l++],e[n]);return t}},function(t,e,n){var i=n(30),o=n(53),r=n(191);t.exports=function(t){return function(e,n,a){var s,l=i(e),u=o(l.length),c=r(a,u);if(t&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},function(t,e,n){var i=n(72),o=Math.max,r=Math.min;t.exports=function(t,e){return(t=i(t))<0?o(t+e,0):r(t,e)}},function(t,e,n){var i=n(72),o=n(68);t.exports=function(t){return function(e,n){var r,a,s=String(o(e)),l=i(n),u=s.length;return l<0||l>=u?t?"":void 0:(r=s.charCodeAt(l))<55296||r>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):r:t?s.slice(l,l+2):a-56320+(r-55296<<10)+65536}}},function(t,e,n){var i=n(55),o=n(6)("iterator"),r=n(29);t.exports=n(3).isIterable=function(t){var e=Object(t);return void 0!==e[o]||"@@iterator"in e||r.hasOwnProperty(i(e))}},function(t,e,n){t.exports={default:n(195),__esModule:!0}},function(t,e,n){n(37),n(32),t.exports=n(196)},function(t,e,n){var i=n(15),o=n(76);t.exports=n(3).getIterator=function(t){var e=o(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return i(e.call(t))}},function(t,e,n){t.exports={default:n(198),__esModule:!0}},function(t,e,n){n(77),n(32),n(37),n(199),n(203),n(204),t.exports=n(3).Promise},function(t,e,n){"use strict";var i,o,r,a,s=n(39),l=n(5),u=n(18),c=n(55),h=n(4),d=n(10),f=n(40),p=n(78),g=n(44),m=n(109),v=n(110).set,y=n(201)(),b=n(79),w=n(111),_=n(202),x=n(112),S=l.TypeError,E=l.process,C=E&&E.versions,T=C&&C.v8||"",M=l.Promise,P="process"==c(E),L=function(){},A=o=b.f,k=!!function(){try{var t=M.resolve(1),e=(t.constructor={})[n(6)("species")]=function(t){t(L,L)};return(P||"function"==typeof PromiseRejectionEvent)&&t.then(L)instanceof e&&0!==T.indexOf("6.6")&&-1===_.indexOf("Chrome/66")}catch(t){}}(),O=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},R=function(t,e){if(!t._n){t._n=!0;var n=t._c;y(function(){for(var i=t._v,o=1==t._s,r=0,a=function(e){var n,r,a,s=o?e.ok:e.fail,l=e.resolve,u=e.reject,c=e.domain;try{s?(o||(2==t._h&&z(t),t._h=1),!0===s?n=i:(c&&c.enter(),n=s(i),c&&(c.exit(),a=!0)),n===e.promise?u(S("Promise-chain cycle")):(r=O(n))?r.call(n,l,u):l(n)):u(i)}catch(t){c&&!a&&c.exit(),u(t)}};n.length>r;)a(n[r++]);t._c=[],t._n=!1,e&&!t._h&&D(t)})}},D=function(t){v.call(l,function(){var e,n,i,o=t._v,r=j(t);if(r&&(e=w(function(){P?E.emit("unhandledRejection",o,t):(n=l.onunhandledrejection)?n({promise:t,reason:o}):(i=l.console)&&i.error&&i.error("Unhandled promise rejection",o)}),t._h=P||j(t)?2:1),t._a=void 0,r&&e.e)throw e.v})},j=function(t){return 1!==t._h&&0===(t._a||t._c).length},z=function(t){v.call(l,function(){var e;P?E.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})})},N=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),R(e,!0))},I=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=O(t))?y(function(){var i={_w:n,_d:!1};try{e.call(t,u(I,i,1),u(N,i,1))}catch(t){N.call(i,t)}}):(n._v=t,n._s=1,R(n,!1))}catch(t){N.call({_w:n,_d:!1},t)}}};k||(M=function(t){p(this,M,"Promise","_h"),f(t),i.call(this);try{t(u(I,this,1),u(N,this,1))}catch(t){N.call(this,t)}},(i=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(80)(M.prototype,{then:function(t,e){var n=A(m(this,M));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=P?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&R(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new i;this.promise=t,this.resolve=u(I,t,1),this.reject=u(N,t,1)},b.f=A=function(t){return t===M||t===a?new r(t):o(t)}),h(h.G+h.W+h.F*!k,{Promise:M}),n(43)(M,"Promise"),n(113)("Promise"),a=n(3).Promise,h(h.S+h.F*!k,"Promise",{reject:function(t){var e=A(this);return(0,e.reject)(t),e.promise}}),h(h.S+h.F*(s||!k),"Promise",{resolve:function(t){return x(s&&this===a?M:this,t)}}),h(h.S+h.F*!(k&&n(114)(function(t){M.all(t).catch(L)})),"Promise",{all:function(t){var e=this,n=A(e),i=n.resolve,o=n.reject,r=w(function(){var n=[],r=0,a=1;g(t,!1,function(t){var s=r++,l=!1;n.push(void 0),a++,e.resolve(t).then(function(t){l||(l=!0,n[s]=t,--a||i(n))},o)}),--a||i(n)});return r.e&&o(r.v),n.promise},race:function(t){var e=this,n=A(e),i=n.reject,o=w(function(){g(t,!1,function(t){e.resolve(t).then(n.resolve,i)})});return o.e&&i(o.v),n.promise}})},function(t,e){t.exports=function(t,e,n){var i=void 0===n;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var i=n(5),o=n(110).set,r=i.MutationObserver||i.WebKitMutationObserver,a=i.process,s=i.Promise,l="process"==n(38)(a);t.exports=function(){var t,e,n,u=function(){var i,o;for(l&&(i=a.domain)&&i.exit();t;){o=t.fn,t=t.next;try{o()}catch(i){throw t?n():e=void 0,i}}e=void 0,i&&i.enter()};if(l)n=function(){a.nextTick(u)};else if(!r||i.navigator&&i.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);n=function(){c.then(u)}}else n=function(){o.call(i,u)};else{var h=!0,d=document.createTextNode("");new r(u).observe(d,{characterData:!0}),n=function(){d.data=h=!h}}return function(i){var o={fn:i,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},function(t,e,n){var i=n(5).navigator;t.exports=i&&i.userAgent||""},function(t,e,n){"use strict";var i=n(4),o=n(3),r=n(5),a=n(109),s=n(112);i(i.P+i.R,"Promise",{finally:function(t){var e=a(this,o.Promise||r.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then(function(){return n})}:t,n?function(n){return s(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){"use strict";var i=n(4),o=n(79),r=n(111);i(i.S,"Promise",{try:function(t){var e=o.f(this),n=r(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){"use strict";var i=n(206);function o(){}t.exports=function(){function t(t,e,n,o,r,a){if(a!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=o,n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";n.d(e,"c",function(){return s}),n.d(e,"b",function(){return h}),n.d(e,"a",function(){return N}),n.d(e,"e",function(){return I}),n.d(e,"d",function(){return o});var i=function(){},o={},r=[],a=[];function s(t,e){var n,s,l,u,c=a;for(u=arguments.length;u-- >2;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(l="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(l=!1)),l&&n?c[c.length-1]+=s:c===a?c=[s]:c.push(s),n=l;var h=new i;return h.nodeName=t,h.children=c,h.attributes=null==e?void 0:e,h.key=null==e?void 0:e.key,void 0!==o.vnode&&o.vnode(h),h}function l(t,e){for(var n in e)t[n]=e[n];return t}function u(t,e){null!=t&&("function"==typeof t?t(e):t.current=e)}var c="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function h(t,e){return s(t.nodeName,l(l({},t.attributes),e),arguments.length>2?[].slice.call(arguments,2):t.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function p(t){!t._dirty&&(t._dirty=!0)&&1==f.push(t)&&(o.debounceRendering||c)(g)}function g(){for(var t;t=f.pop();)t._dirty&&j(t)}function m(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&v(t,e.nodeName):n||t._componentConstructor===e.nodeName}function v(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function y(t){var e=l({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===e[i]&&(e[i]=n[i]);return e}function b(t){var e=t.parentNode;e&&e.removeChild(t)}function w(t,e,n,i,o){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)u(n,null),u(i,t);else if("class"!==e||o)if("style"===e){if(i&&"string"!=typeof i&&"string"!=typeof n||(t.style.cssText=i||""),i&&"object"==typeof i){if("string"!=typeof n)for(var r in n)r in i||(t.style[r]="");for(var r in i)t.style[r]="number"==typeof i[r]&&!1===d.test(r)?i[r]+"px":i[r]}}else if("dangerouslySetInnerHTML"===e)i&&(t.innerHTML=i.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),i?n||t.addEventListener(e,_,a):t.removeEventListener(e,_,a),(t._listeners||(t._listeners={}))[e]=i}else if("list"!==e&&"type"!==e&&!o&&e in t){try{t[e]=null==i?"":i}catch(t){}null!=i&&!1!==i||"spellcheck"==e||t.removeAttribute(e)}else{var s=o&&e!==(e=e.replace(/^xlink:?/,""));null==i||!1===i?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof i&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),i):t.setAttribute(e,i))}else t.className=i||""}function _(t){return this._listeners[t.type](o.event&&o.event(t)||t)}var x=[],S=0,E=!1,C=!1;function T(){for(var t;t=x.shift();)o.afterMount&&o.afterMount(t),t.componentDidMount&&t.componentDidMount()}function M(t,e,n,i,o,r){S++||(E=null!=o&&void 0!==o.ownerSVGElement,C=null!=t&&!("__preactattr_"in t));var a=P(t,e,n,i,r);return o&&a.parentNode!==o&&o.appendChild(a),--S||(C=!1,r||T()),a}function P(t,e,n,i,o){var r=t,a=E;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||o)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),L(t,!0))),r.__preactattr_=!0,r;var s=e.nodeName;if("function"==typeof s)return function(t,e,n,i){var o=t&&t._component,r=o,a=t,s=o&&t._componentConstructor===e.nodeName,l=s,u=y(e);for(;o&&!l&&(o=o._parentComponent);)l=o.constructor===e.nodeName;o&&l&&(!i||o._component)?(D(o,u,3,n,i),t=o.base):(r&&!s&&(z(r),t=a=null),o=O(e.nodeName,u,n),t&&!o.nextBase&&(o.nextBase=t,a=null),D(o,u,1,n,i),t=o.base,a&&t!==a&&(a._component=null,L(a,!1)));return t}(t,e,n,i);if(E="svg"===s||"foreignObject"!==s&&E,s=String(s),(!t||!v(t,s))&&(r=function(t,e){var n=e?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t);return n.normalizedNodeName=t,n}(s,E),t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),L(t,!0)}var l=r.firstChild,u=r.__preactattr_,c=e.children;if(null==u){u=r.__preactattr_={};for(var h=r.attributes,d=h.length;d--;)u[h[d].name]=h[d].value}return!C&&c&&1===c.length&&"string"==typeof c[0]&&null!=l&&void 0!==l.splitText&&null==l.nextSibling?l.nodeValue!=c[0]&&(l.nodeValue=c[0]):(c&&c.length||null!=l)&&function(t,e,n,i,o){var r,a,s,l,u,c=t.childNodes,h=[],d={},f=0,p=0,g=c.length,v=0,y=e?e.length:0;if(0!==g)for(var w=0;w<g;w++){var _=c[w],x=_.__preactattr_,S=y&&x?_._component?_._component.__key:x.key:null;null!=S?(f++,d[S]=_):(x||(void 0!==_.splitText?!o||_.nodeValue.trim():o))&&(h[v++]=_)}if(0!==y)for(var w=0;w<y;w++){l=e[w],u=null;var S=l.key;if(null!=S)f&&void 0!==d[S]&&(u=d[S],d[S]=void 0,f--);else if(p<v)for(r=p;r<v;r++)if(void 0!==h[r]&&m(a=h[r],l,o)){u=a,h[r]=void 0,r===v-1&&v--,r===p&&p++;break}u=P(u,l,n,i),s=c[w],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?b(s):t.insertBefore(u,s))}if(f)for(var w in d)void 0!==d[w]&&L(d[w],!1);for(;p<=v;)void 0!==(u=h[v--])&&L(u,!1)}(r,c,n,i,C||null!=u.dangerouslySetInnerHTML),function(t,e,n){var i;for(i in n)e&&null!=e[i]||null==n[i]||w(t,i,n[i],n[i]=void 0,E);for(i in e)"children"===i||"innerHTML"===i||i in n&&e[i]===("value"===i||"checked"===i?t[i]:n[i])||w(t,i,n[i],n[i]=e[i],E)}(r,e.attributes,u),E=a,r}function L(t,e){var n=t._component;n?z(n):(null!=t.__preactattr_&&u(t.__preactattr_.ref,null),!1!==e&&null!=t.__preactattr_||b(t),A(t))}function A(t){for(t=t.lastChild;t;){var e=t.previousSibling;L(t,!0),t=e}}var k=[];function O(t,e,n){var i,o=k.length;for(t.prototype&&t.prototype.render?(i=new t(e,n),N.call(i,e,n)):((i=new N(e,n)).constructor=t,i.render=R);o--;)if(k[o].constructor===t)return i.nextBase=k[o].nextBase,k.splice(o,1),i;return i}function R(t,e,n){return this.constructor(t,n)}function D(t,e,n,i,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,i)),i&&i!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=i),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==n&&(1!==n&&!1===o.syncComponentUpdates&&t.base?p(t):j(t,1,r)),u(t.__ref,t))}function j(t,e,n,i){if(!t._disable){var r,a,s,u=t.props,c=t.state,h=t.context,d=t.prevProps||u,f=t.prevState||c,p=t.prevContext||h,g=t.base,m=t.nextBase,v=g||m,b=t._component,w=!1,_=p;if(t.constructor.getDerivedStateFromProps&&(c=l(l({},c),t.constructor.getDerivedStateFromProps(u,c)),t.state=c),g&&(t.props=d,t.state=f,t.context=p,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,c,h)?w=!0:t.componentWillUpdate&&t.componentWillUpdate(u,c,h),t.props=u,t.state=c,t.context=h),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!w){r=t.render(u,c,h),t.getChildContext&&(h=l(l({},h),t.getChildContext())),g&&t.getSnapshotBeforeUpdate&&(_=t.getSnapshotBeforeUpdate(d,f));var E,C,P=r&&r.nodeName;if("function"==typeof P){var A=y(r);(a=b)&&a.constructor===P&&A.key==a.__key?D(a,A,1,h,!1):(E=a,t._component=a=O(P,A,h),a.nextBase=a.nextBase||m,a._parentComponent=t,D(a,A,0,h,!1),j(a,1,n,!0)),C=a.base}else s=v,(E=b)&&(s=t._component=null),(v||1===e)&&(s&&(s._component=null),C=M(s,r,h,n||!g,v&&v.parentNode,!0));if(v&&C!==v&&a!==b){var k=v.parentNode;k&&C!==k&&(k.replaceChild(C,v),E||(v._component=null,L(v,!1)))}if(E&&z(E),t.base=C,C&&!i){for(var R=t,N=t;N=N._parentComponent;)(R=N).base=C;C._component=R,C._componentConstructor=R.constructor}}for(!g||n?x.push(t):w||(t.componentDidUpdate&&t.componentDidUpdate(d,f,_),o.afterUpdate&&o.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);S||i||T()}}function z(t){o.beforeUnmount&&o.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var n=t._component;n?z(n):e&&(null!=e.__preactattr_&&u(e.__preactattr_.ref,null),t.nextBase=e,b(e),k.push(t),A(e)),u(t.__ref,null)}function N(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function I(t,e,n){return M(n,t,{},!1,e,!1)}l(N.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),p(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),j(this,2)},render:function(){}})},function(module,exports,__webpack_require__){"use strict";var evalAllowed=!1;try{eval("evalAllowed = true")}catch(t){}var platformSupported=!!Object.setPrototypeOf&&evalAllowed;module.exports=__webpack_require__(209)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(n(2)),o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},a=function(t){function e(){return o(this,e),r(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.render=function(){return i.Children.only(this.props.children)},e}(i.Component);e.AppContainer=a,e.hot=function(){return function(t){return t}},e.areComponentsEqual=function(t,e){return t===e},e.setConfig=function(){},e.cold=function(t){return t},e.configureComponent=function(){}},function(t,e,n){"use strict";e.a=l;var i=n(115),o=n(2),r=n(33),a=n.n(r),s=n(116);n(81);function l(t){var e;void 0===t&&(t="store");var n=t+"Subscription",r=function(e){Object(i.a)(a,e);var r=a.prototype;function a(n,i){var o;return(o=e.call(this,n,i)||this)[t]=n.store,o}return r.getChildContext=function(){var e;return(e={})[t]=this[t],e[n]=null,e},r.render=function(){return o.Children.only(this.props.children)},a}(o.Component);return r.propTypes={store:s.a.isRequired,children:a.a.element.isRequired},r.childContextTypes=((e={})[t]=s.a.isRequired,e[n]=s.b,e),r}e.b=l()},function(t,e,n){"use strict";e.a=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){"use strict";var i=n(118),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={};a[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var s=Object.defineProperty,l=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,d=Object.prototype;t.exports=function t(e,n,i){if("string"!=typeof n){if(d){var f=h(n);f&&f!==d&&t(e,f,i)}var p=l(n);u&&(p=p.concat(u(n)));for(var g=a[e.$$typeof]||o,m=a[n.$$typeof]||o,v=0;v<p.length;++v){var y=p[v];if(!(r[y]||i&&i[y]||m&&m[y]||g&&g[y])){var b=c(n,y);try{s(e,y,b)}catch(t){}}}return e}return e}},function(t,e,n){"use strict";
+/** @license React v16.6.1
+ * react-is.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,r=i?Symbol.for("react.portal"):60106,a=i?Symbol.for("react.fragment"):60107,s=i?Symbol.for("react.strict_mode"):60108,l=i?Symbol.for("react.profiler"):60114,u=i?Symbol.for("react.provider"):60109,c=i?Symbol.for("react.context"):60110,h=i?Symbol.for("react.async_mode"):60111,d=i?Symbol.for("react.concurrent_mode"):60111,f=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,g=i?Symbol.for("react.memo"):60115,m=i?Symbol.for("react.lazy"):60116;function v(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case h:case d:case a:case l:case s:return t;default:switch(t=t&&t.$$typeof){case c:case f:case u:return t;default:return e}}case r:return e}}}function y(t){return v(t)===d}e.typeOf=v,e.AsyncMode=h,e.ConcurrentMode=d,e.ContextConsumer=c,e.ContextProvider=u,e.Element=o,e.ForwardRef=f,e.Fragment=a,e.Profiler=l,e.Portal=r,e.StrictMode=s,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===a||t===d||t===l||t===s||t===p||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===g||t.$$typeof===u||t.$$typeof===c||t.$$typeof===f)},e.isAsyncMode=function(t){return y(t)||v(t)===h},e.isConcurrentMode=y,e.isContextConsumer=function(t){return v(t)===c},e.isContextProvider=function(t){return v(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return v(t)===f},e.isFragment=function(t){return v(t)===a},e.isProfiler=function(t){return v(t)===l},e.isPortal=function(t){return v(t)===r},e.isStrictMode=function(t){return v(t)===s}},function(t,e,n){"use strict";t.exports=function(t,e,n,i,o,r,a,s){if(!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,i,o,r,a,s],c=0;(l=new Error(e.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var i=null,o={notify:function(){}};var r=function(){function t(t,e,n){this.store=t,this.parentSub=e,this.onStateChange=n,this.unsubscribe=null,this.listeners=o}var e=t.prototype;return e.addNestedSub=function(t){return this.trySubscribe(),this.listeners.subscribe(t)},e.notifyNestedSubs=function(){this.listeners.notify()},e.isSubscribed=function(){return Boolean(this.unsubscribe)},e.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=function(){var t=[],e=[];return{clear:function(){e=i,t=i},notify:function(){for(var n=t=e,i=0;i<n.length;i++)n[i]()},get:function(){return e},subscribe:function(n){var o=!0;return e===t&&(e=t.slice()),e.push(n),function(){o&&t!==i&&(o=!1,e===t&&(e=t.slice()),e.splice(e.indexOf(n),1))}}}}())},e.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=o)},t}()},function(t,e,n){"use strict";var i=n(82),o=n(83),r=n(117),a=n(217),s=n(218),l=n(223),u=n(224),c=n(225);function h(t,e,n){for(var i=e.length-1;i>=0;i--){var o=e[i](t);if(o)return o}return function(e,i){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+i.wrappedComponentName+".")}}function d(t,e){return t===e}e.a=function(t){var e=void 0===t?{}:t,n=e.connectHOC,f=void 0===n?r.a:n,p=e.mapStateToPropsFactories,g=void 0===p?l.a:p,m=e.mapDispatchToPropsFactories,v=void 0===m?s.a:m,y=e.mergePropsFactories,b=void 0===y?u.a:y,w=e.selectorFactory,_=void 0===w?c.a:w;return function(t,e,n,r){void 0===r&&(r={});var s=r,l=s.pure,u=void 0===l||l,c=s.areStatesEqual,p=void 0===c?d:c,m=s.areOwnPropsEqual,y=void 0===m?a.a:m,w=s.areStatePropsEqual,x=void 0===w?a.a:w,S=s.areMergedPropsEqual,E=void 0===S?a.a:S,C=Object(o.a)(s,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),T=h(t,g,"mapStateToProps"),M=h(e,v,"mapDispatchToProps"),P=h(n,b,"mergeProps");return f(_,Object(i.a)({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:Boolean(t),initMapStateToProps:T,initMapDispatchToProps:M,initMergeProps:P,pure:u,areStatesEqual:p,areOwnPropsEqual:y,areStatePropsEqual:x,areMergedPropsEqual:E},C))}}()},function(t,e,n){"use strict";e.a=function(t,e){if(o(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var a=0;a<n.length;a++)if(!i.call(e,n[a])||!o(t[n[a]],e[n[a]]))return!1;return!0};var i=Object.prototype.hasOwnProperty;function o(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}},function(t,e,n){"use strict";var i=n(21),o=n(120);e.a=[function(t){return"function"==typeof t?Object(o.b)(t,"mapDispatchToProps"):void 0},function(t){return t?void 0:Object(o.a)(function(t){return{dispatch:t}})},function(t){return t&&"object"==typeof t?Object(o.a)(function(e){return Object(i.bindActionCreators)(t,e)}):void 0}]},function(t,e,n){"use strict";(function(t,i){var o,r=n(221);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:i;var a=Object(r.a)(o);e.a=a}).call(e,n(119),n(220)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,n){"use strict";e.a=function(t){var e,n=t.Symbol;"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable";return e}},function(t,e,n){"use strict";e.a=function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n}},function(t,e,n){"use strict";var i=n(120);e.a=[function(t){return"function"==typeof t?Object(i.b)(t,"mapStateToProps"):void 0},function(t){return t?void 0:Object(i.a)(function(){return{}})}]},function(t,e,n){"use strict";var i=n(82);n(121);function o(t,e,n){return Object(i.a)({},n,t,e)}e.a=[function(t){return"function"==typeof t?function(t){return function(e,n){n.displayName;var i,o=n.pure,r=n.areMergedPropsEqual,a=!1;return function(e,n,s){var l=t(e,n,s);return a?o&&r(l,i)||(i=l):(a=!0,i=l),i}}}(t):void 0},function(t){return t?void 0:function(){return o}}]},function(t,e,n){"use strict";e.a=function(t,e){var n=e.initMapStateToProps,a=e.initMapDispatchToProps,s=e.initMergeProps,l=Object(i.a)(e,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),u=n(t,l),c=a(t,l),h=s(t,l);0;return(l.pure?r:o)(u,c,h,t,l)};var i=n(83);n(226);function o(t,e,n,i){return function(o,r){return n(t(o,r),e(i,r),r)}}function r(t,e,n,i,o){var r,a,s,l,u,c=o.areStatesEqual,h=o.areOwnPropsEqual,d=o.areStatePropsEqual,f=!1;function p(o,f){var p=!h(f,a),g=!c(o,r);return r=o,a=f,p&&g?(s=t(r,a),e.dependsOnOwnProps&&(l=e(i,a)),u=n(s,l,a)):p?(t.dependsOnOwnProps&&(s=t(r,a)),e.dependsOnOwnProps&&(l=e(i,a)),u=n(s,l,a)):g?function(){var e=t(r,a),i=!d(e,s);return s=e,i&&(u=n(s,l,a)),u}():u}return function(o,c){return f?p(o,c):function(o,c){return s=t(r=o,a=c),l=e(i,a),u=n(s,l,a),f=!0,u}(o,c)}}},function(t,e,n){"use strict";n(81)},function(t,e){
+/*!
+Waypoints - 4.0.1
+Copyright © 2011-2016 Caleb Troughton
+Licensed under the MIT license.
+https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
+*/
+!function(){"use strict";function t(i){if(!i)throw new Error("No options passed to Waypoint constructor");if(!i.element)throw new Error("No element option passed to Waypoint constructor");if(!i.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,i),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=i.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),n[this.key]=this,e+=1}var e=0,n={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete n[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var i in n)e.push(n[i]);for(var o=0,r=e.length;r>o;o++)e[o][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){for(var e in t.Context.refreshAll(),n)n[e].enabled=!0;return this},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=o.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+n,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,i[t.waypointContextKey]=this,n+=1,o.windowContext||(o.windowContext=!0,o.windowContext=new e(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var n=0,i={},o=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),n=this.element==this.element.window;t&&e&&!n&&(this.adapter.off(".waypoints"),delete i[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,o.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||o.isTouch)&&(e.didScroll=!0,o.requestAnimationFrame(t))})},e.prototype.handleResize=function(){o.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var n in e){var i=e[n],o=i.newScroll>i.oldScroll?i.forward:i.backward;for(var r in this.waypoints[n]){var a=this.waypoints[n][r];if(null!==a.triggerPoint){var s=i.oldScroll<a.triggerPoint,l=i.newScroll>=a.triggerPoint;(s&&l||!s&&!l)&&(a.queueTrigger(o),t[a.group.id]=a.group)}}}for(var u in t)t[u].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?o.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?o.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var n in this.waypoints[e])t.push(this.waypoints[e][n]);for(var i=0,o=t.length;o>i;i++)t[i].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,n=e?void 0:this.adapter.offset(),i={};for(var r in this.handleScroll(),t={horizontal:{contextOffset:e?0:n.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:n.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}}){var a=t[r];for(var s in this.waypoints[r]){var l,u,c,h,d=this.waypoints[r][s],f=d.options.offset,p=d.triggerPoint,g=0,m=null==p;d.element!==d.element.window&&(g=d.adapter.offset()[a.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(a.contextDimension*f/100))),l=a.contextScroll-a.contextOffset,d.triggerPoint=Math.floor(g+l-f),u=p<a.oldScroll,c=d.triggerPoint>=a.oldScroll,h=!u&&!c,!m&&(u&&c)?(d.queueTrigger(a.backward),i[d.group.id]=d.group):!m&&h?(d.queueTrigger(a.forward),i[d.group.id]=d.group):m&&a.oldScroll>=d.triggerPoint&&(d.queueTrigger(a.forward),i[d.group.id]=d.group)}}return o.requestAnimationFrame(function(){for(var t in i)i[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in i)i[t].refresh()},e.findByElement=function(t){return i[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},o.requestAnimationFrame=function(e){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t).call(window,e)},o.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function n(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),i[this.axis][this.name]=this}var i={vertical:{},horizontal:{}},o=window.Waypoint;n.prototype.add=function(t){this.waypoints.push(t)},n.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},n.prototype.flushTriggers=function(){for(var n in this.triggerQueues){var i=this.triggerQueues[n],o="up"===n||"left"===n;i.sort(o?e:t);for(var r=0,a=i.length;a>r;r+=1){var s=i[r];(s.options.continuous||r===i.length-1)&&s.trigger([n])}}this.clearTriggerQueues()},n.prototype.next=function(e){this.waypoints.sort(t);var n=o.Adapter.inArray(e,this.waypoints);return n===this.waypoints.length-1?null:this.waypoints[n+1]},n.prototype.previous=function(e){this.waypoints.sort(t);var n=o.Adapter.inArray(e,this.waypoints);return n?this.waypoints[n-1]:null},n.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},n.prototype.remove=function(t){var e=o.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},n.prototype.first=function(){return this.waypoints[0]},n.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},n.findOrCreate=function(t){return i[t.axis][t.name]||new n(t)},o.Group=n}(),function(){"use strict";function t(t){return t===t.window}function e(e){return t(e)?e:e.defaultView}function n(t){this.element=t,this.handlers={}}var i=window.Waypoint;n.prototype.innerHeight=function(){return t(this.element)?this.element.innerHeight:this.element.clientHeight},n.prototype.innerWidth=function(){return t(this.element)?this.element.innerWidth:this.element.clientWidth},n.prototype.off=function(t,e){function n(t,e,n){for(var i=0,o=e.length-1;o>i;i++){var r=e[i];n&&n!==r||t.removeEventListener(r)}}var i=t.split("."),o=i[0],r=i[1],a=this.element;if(r&&this.handlers[r]&&o)n(a,this.handlers[r][o],e),this.handlers[r][o]=[];else if(o)for(var s in this.handlers)n(a,this.handlers[s][o]||[],e),this.handlers[s][o]=[];else if(r&&this.handlers[r]){for(var l in this.handlers[r])n(a,this.handlers[r][l],e);this.handlers[r]={}}},n.prototype.offset=function(){if(!this.element.ownerDocument)return null;var t=this.element.ownerDocument.documentElement,n=e(this.element.ownerDocument),i={top:0,left:0};return this.element.getBoundingClientRect&&(i=this.element.getBoundingClientRect()),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}},n.prototype.on=function(t,e){var n=t.split("."),i=n[0],o=n[1]||"__default",r=this.handlers[o]=this.handlers[o]||{};(r[i]=r[i]||[]).push(e),this.element.addEventListener(i,e)},n.prototype.outerHeight=function(e){var n,i=this.innerHeight();return e&&!t(this.element)&&(n=window.getComputedStyle(this.element),i+=parseInt(n.marginTop,10),i+=parseInt(n.marginBottom,10)),i},n.prototype.outerWidth=function(e){var n,i=this.innerWidth();return e&&!t(this.element)&&(n=window.getComputedStyle(this.element),i+=parseInt(n.marginLeft,10),i+=parseInt(n.marginRight,10)),i},n.prototype.scrollLeft=function(){var t=e(this.element);return t?t.pageXOffset:this.element.scrollLeft},n.prototype.scrollTop=function(){var t=e(this.element);return t?t.pageYOffset:this.element.scrollTop},n.extend=function(){function t(t,e){if("object"==typeof t&&"object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}for(var e=Array.prototype.slice.call(arguments),n=1,i=e.length;i>n;n++)t(e[0],e[n]);return e[0]},n.inArray=function(t,e,n){return null==e?-1:e.indexOf(t,n)},n.isEmptyObject=function(t){for(var e in t)return!1;return!0},i.adapters.push({name:"noframework",Adapter:n}),i.Adapter=n}()},function(t,e,n){t.exports={default:n(229),__esModule:!0}},function(t,e,n){var i=n(3),o=i.JSON||(i.JSON={stringify:JSON.stringify});t.exports=function(t){return o.stringify.apply(o,arguments)}},function(t,e,n){n(231),t.exports=n(3).Object.keys},function(t,e,n){var i=n(31),o=n(42);n(122)("keys",function(){return function(t){return o(i(t))}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=f(n(12)),o=f(n(7)),r=f(n(8)),a=f(n(13)),s=f(n(14)),l=n(2),u=f(l),c=n(254),h=n(256),d=n(454);function f(t){return t&&t.__esModule?t:{default:t}}var p=function(t){function e(){return(0,o.default)(this,e),(0,a.default)(this,(e.__proto__||(0,i.default)(e)).apply(this,arguments))}return(0,s.default)(e,t),(0,r.default)(e,[{key:"render",value:function(){switch(this.props.payload.cmd){case"dataset_list":return u.default.createElement(c.Container,this.props);case"chart":return u.default.createElement(d.CountriesByYear,this.props);case"piechart":return u.default.createElement(d.PieCharts,this.props);case"citations":return u.default.createElement(h.CitationsTable,this.props);case"load_file":return u.default.createElement(h.FileTable,this.props);default:return u.default.createElement("pre",{style:{color:"#0f0"}},"Megapixels")}}}]),e}(l.Component);e.default=p},function(t,e,n){n(234),t.exports=n(3).Object.getPrototypeOf},function(t,e,n){var i=n(31),o=n(106);n(122)("getPrototypeOf",function(){return function(t){return o(i(t))}})},function(t,e,n){t.exports={default:n(236),__esModule:!0}},function(t,e,n){n(237);var i=n(3).Object;t.exports=function(t,e,n){return i.defineProperty(t,e,n)}},function(t,e,n){var i=n(4);i(i.S+i.F*!n(16),"Object",{defineProperty:n(9).f})},function(t,e,n){t.exports={default:n(239),__esModule:!0}},function(t,e,n){n(32),n(37),t.exports=n(84).f("iterator")},function(t,e,n){t.exports={default:n(241),__esModule:!0}},function(t,e,n){n(242),n(77),n(245),n(246),t.exports=n(3).Symbol},function(t,e,n){"use strict";var i=n(5),o=n(24),r=n(16),a=n(4),s=n(103),l=n(85).KEY,u=n(23),c=n(74),h=n(43),d=n(54),f=n(6),p=n(84),g=n(86),m=n(243),v=n(123),y=n(15),b=n(10),w=n(30),_=n(71),x=n(41),S=n(52),E=n(244),C=n(125),T=n(9),M=n(42),P=C.f,L=T.f,A=E.f,k=i.Symbol,O=i.JSON,R=O&&O.stringify,D=f("_hidden"),j=f("toPrimitive"),z={}.propertyIsEnumerable,N=c("symbol-registry"),I=c("symbols"),F=c("op-symbols"),H=Object.prototype,G="function"==typeof k,V=i.QObject,B=!V||!V.prototype||!V.prototype.findChild,U=r&&u(function(){return 7!=S(L({},"a",{get:function(){return L(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=P(H,e);i&&delete H[e],L(t,e,n),i&&t!==H&&L(H,e,i)}:L,W=function(t){var e=I[t]=S(k.prototype);return e._k=t,e},q=G&&"symbol"==typeof k.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof k},Y=function(t,e,n){return t===H&&Y(F,e,n),y(t),e=_(e,!0),y(n),o(I,e)?(n.enumerable?(o(t,D)&&t[D][e]&&(t[D][e]=!1),n=S(n,{enumerable:x(0,!1)})):(o(t,D)||L(t,D,x(1,{})),t[D][e]=!0),U(t,e,n)):L(t,e,n)},X=function(t,e){y(t);for(var n,i=m(e=w(e)),o=0,r=i.length;r>o;)Y(t,n=i[o++],e[n]);return t},Z=function(t){var e=z.call(this,t=_(t,!0));return!(this===H&&o(I,t)&&!o(F,t))&&(!(e||!o(this,t)||!o(I,t)||o(this,D)&&this[D][t])||e)},Q=function(t,e){if(t=w(t),e=_(e,!0),t!==H||!o(I,e)||o(F,e)){var n=P(t,e);return!n||!o(I,e)||o(t,D)&&t[D][e]||(n.enumerable=!0),n}},K=function(t){for(var e,n=A(w(t)),i=[],r=0;n.length>r;)o(I,e=n[r++])||e==D||e==l||i.push(e);return i},$=function(t){for(var e,n=t===H,i=A(n?F:w(t)),r=[],a=0;i.length>a;)!o(I,e=i[a++])||n&&!o(H,e)||r.push(I[e]);return r};G||(s((k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:void 0),e=function(n){this===H&&e.call(F,n),o(this,D)&&o(this[D],t)&&(this[D][t]=!1),U(this,t,x(1,n))};return r&&B&&U(H,t,{configurable:!0,set:e}),W(t)}).prototype,"toString",function(){return this._k}),C.f=Q,T.f=Y,n(124).f=E.f=K,n(57).f=Z,n(87).f=$,r&&!n(39)&&s(H,"propertyIsEnumerable",Z,!0),p.f=function(t){return W(f(t))}),a(a.G+a.W+a.F*!G,{Symbol:k});for(var J="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;J.length>tt;)f(J[tt++]);for(var et=M(f.store),nt=0;et.length>nt;)g(et[nt++]);a(a.S+a.F*!G,"Symbol",{for:function(t){return o(N,t+="")?N[t]:N[t]=k(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var e in N)if(N[e]===t)return e},useSetter:function(){B=!0},useSimple:function(){B=!1}}),a(a.S+a.F*!G,"Object",{create:function(t,e){return void 0===e?S(t):X(S(t),e)},defineProperty:Y,defineProperties:X,getOwnPropertyDescriptor:Q,getOwnPropertyNames:K,getOwnPropertySymbols:$}),O&&a(a.S+a.F*(!G||u(function(){var t=k();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t))})),"JSON",{stringify:function(t){for(var e,n,i=[t],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=e=i[1],(b(e)||void 0!==t)&&!q(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!q(e))return e}),i[1]=e,R.apply(O,i)}}),k.prototype[j]||n(20)(k.prototype,j,k.prototype.valueOf),h(k,"Symbol"),h(Math,"Math",!0),h(i.JSON,"JSON",!0)},function(t,e,n){var i=n(42),o=n(87),r=n(57);t.exports=function(t){var e=i(t),n=o.f;if(n)for(var a,s=n(t),l=r.f,u=0;s.length>u;)l.call(t,a=s[u++])&&e.push(a);return e}},function(t,e,n){var i=n(30),o=n(124).f,r={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==r.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(i(t))}},function(t,e,n){n(86)("asyncIterator")},function(t,e,n){n(86)("observable")},function(t,e,n){t.exports={default:n(248),__esModule:!0}},function(t,e,n){n(249),t.exports=n(3).Object.setPrototypeOf},function(t,e,n){var i=n(4);i(i.S,"Object",{setPrototypeOf:n(250).set})},function(t,e,n){var i=n(10),o=n(15),r=function(t,e){if(o(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{(i=n(18)(Function.call,n(125).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return r(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:r}},function(t,e,n){t.exports={default:n(252),__esModule:!0}},function(t,e,n){n(253);var i=n(3).Object;t.exports=function(t,e){return i.create(t,e)}},function(t,e,n){var i=n(4);i(i.S,"Object",{create:n(52)})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var i=function(t){return t&&t.__esModule?t:{default:t}}(n(255));e.Container=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=h(n(12)),o=h(n(7)),r=h(n(8)),a=h(n(13)),s=h(n(14)),l=n(2),u=h(l),c=(n(21),n(17),n(11));function h(t){return t&&t.__esModule?t:{default:t}}var d={string:function(t){return t.toLowerCase()},number:function(t){return parseInt((t||"0").replace(/,/g,"").trim())}},f={string:function(t,e){return t[0].localeCompare(e[0])},number:function(t,e){return t[0]-e[0]}},p=[{field:"title",title:"Name",type:"string"},{field:"year",title:"Year",type:"number"},{field:"purpose",title:"Purpose",type:"string"}],g=function(t){function e(){(0,o.default)(this,e);var t=(0,a.default)(this,(e.__proto__||(0,i.default)(e)).call(this));t.state={sort:p[0],reversed:!1,displayField:"year"};var n=document.querySelector(".dataset-intro .dataset-list");return t.parent=n,t.els=(0,c.toArray)(n.children),t}return(0,s.default)(e,t),(0,r.default)(e,[{key:"sortBy",value:function(t){var e=this,n=this.state,i=n.sort,o=n.reversed,r=n.displayField;o=i===t?!o:!!t.reversed;var a=d[t.type],s=f[t.type],l=this.els.map(function(e){return[a(e.querySelector("."+t.field).innerText),e]}).sort(s);l=l.map(function(t){return t[1]}),o&&l.reverse(),"title"===t.field||(r=t.field),l.forEach(function(t){e.parent.removeChild(t),e.parent.appendChild(t);var n=t.querySelector(".visible");n&&n.classList.remove("visible"),t.querySelector("."+r).classList.add("visible")}),this.setState({sort:t,reversed:o,displayField:r})}},{key:"render",value:function(){var t=this;this.props.payload;return u.default.createElement("div",{className:"dataset-list"},u.default.createElement("ul",{className:"sort-options"},p.map(function(e){return u.default.createElement("li",{key:e.field,className:e.field===t.state.sort.field?"active":"",onClick:function(){return t.sortBy(e)}},e.title)})))}}]),e}(l.Component);e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTable=e.CitationsTable=void 0,n(257),n(260),n(262);var i=r(n(264)),o=r(n(441));function r(t){return t&&t.__esModule?t:{default:t}}e.CitationsTable=i.default,e.FileTable=o.default},function(t,e,n){var i=n(258);"string"==typeof i&&(i=[[t.i,i,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(26)(i,o);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(25)(!1)).push([t.i,".multi-value-formatter-content span {\n padding: 2px 4px;\n border-radius: 2px;\n border: 1px solid lightgrey;\n margin-right: 4px;\n}\n\n/* --------- customized react-tags styles */\n.react-tags {\n padding: 0px 0 0 6px !important;\n border: none !important;\n}\n.react-tags__selected-tag:after {\n /* TODO: for now, don't show the delete icon \"X\" for react-tags */\n display: none !important;\n}\n.react-tags__selected-tag {\n padding: 2px 4px !important;\n}\n\n/* --------- default react-tags styles */\n.react-tags__search input {\n width: 100% !important;\n}\n\n.react-tags {\n position: relative;\n padding: 6px 0 0 6px;\n border: 1px solid #D1D1D1;\n border-radius: 1px;\n\n /* shared font styles */\n font-size: 1em;\n line-height: 1.2;\n\n /* clicking anywhere will focus the input */\n cursor: text;\n}\n\n.react-tags.is-focused {\n border-color: #B1B1B1;\n}\n\n.react-tags__selected {\n display: inline;\n}\n\n.react-tags__selected-tag {\n display: inline-block;\n box-sizing: border-box;\n margin: 0 6px 6px 0;\n padding: 6px 8px;\n border: 1px solid #D1D1D1;\n border-radius: 2px;\n background: #F1F1F1;\n\n /* match the font styles */\n font-size: inherit;\n line-height: inherit;\n}\n\n.react-tags__selected-tag:after {\n content: '\\2715';\n color: #AAA;\n margin-left: 8px;\n}\n\n.react-tags__selected-tag:hover,\n.react-tags__selected-tag:focus {\n border-color: #B1B1B1;\n}\n\n.react-tags__search {\n display: inline-block;\n\n /* match tag layout */\n padding: 7px 2px;\n margin-bottom: 6px;\n\n /* prevent autoresize overflowing the container */\n max-width: 100%;\n}\n\n@media screen and (min-width: 30em) {\n\n .react-tags__search {\n /* this will become the offsetParent for suggestions */\n position: relative;\n }\n\n}\n\n.react-tags__search input {\n /* prevent autoresize overflowing the container */\n max-width: 100%;\n\n /* remove styles and layout from this element */\n margin: 0;\n padding: 0;\n border: 0;\n outline: none;\n\n /* match the font styles */\n font-size: inherit;\n line-height: inherit;\n}\n\n.react-tags__search input::-ms-clear {\n display: none;\n}\n\n.react-tags__suggestions {\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n}\n\n@media screen and (min-width: 30em) {\n\n .react-tags__suggestions {\n width: 240px;\n }\n\n}\n\n.react-tags__suggestions ul {\n margin: 4px -1px;\n padding: 0;\n list-style: none;\n background: white;\n border: 1px solid #D1D1D1;\n border-radius: 2px;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\n}\n\n.react-tags__suggestions li {\n border-bottom: 1px solid #ddd;\n padding: 6px 8px;\n}\n\n.react-tags__suggestions li mark {\n text-decoration: underline;\n background: none;\n font-weight: 600;\n}\n\n.react-tags__suggestions li:hover {\n cursor: pointer;\n background: #eee;\n}\n\n.react-tags__suggestions li.is-active {\n background: #b7cfe0;\n}\n\n.react-tags__suggestions li.is-disabled {\n opacity: 0.5;\n cursor: auto;\n}",""])},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var o,r=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?t:(o=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:i+r.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},function(t,e,n){var i=n(261);"string"==typeof i&&(i=[[t.i,i,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(26)(i,o);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(25)(!1)).push([t.i,'/* Tabulator v4.2.3 (c) Oliver Folkerd */\n.tabulator {\n position: relative;\n border: 1px solid #333;\n background-color: #222;\n overflow: hidden;\n font-size: 14px;\n text-align: left;\n -ms-transform: translatez(0);\n transform: translatez(0);\n}\n\n.tabulator[tabulator-layout="fitDataFill"] .tabulator-tableHolder .tabulator-table {\n min-width: 100%;\n}\n\n.tabulator.tabulator-block-select {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.tabulator .tabulator-header {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n border-bottom: 1px solid #999;\n background-color: #333;\n color: #fff;\n font-weight: bold;\n white-space: nowrap;\n overflow: hidden;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none;\n}\n\n.tabulator .tabulator-header .tabulator-col {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n border-right: 1px solid #aaa;\n background-color: #333;\n text-align: left;\n vertical-align: bottom;\n overflow: hidden;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-moving {\n position: absolute;\n border: 1px solid #999;\n background: #1a1a1a;\n pointer-events: none;\n}\n\n.tabulator .tabulator-header .tabulator-col .tabulator-col-content {\n box-sizing: border-box;\n position: relative;\n padding: 4px;\n}\n\n.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {\n box-sizing: border-box;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: bottom;\n}\n\n.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor {\n box-sizing: border-box;\n width: 100%;\n border: 1px solid #999;\n padding: 1px;\n background: #444;\n color: #fff;\n}\n\n.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow {\n display: inline-block;\n position: absolute;\n top: 9px;\n right: 8px;\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #bbb;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols {\n position: relative;\n display: -ms-flexbox;\n display: flex;\n border-top: 1px solid #aaa;\n overflow: hidden;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols .tabulator-col:last-child {\n margin-right: -1px;\n}\n\n.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev {\n display: none;\n}\n\n.tabulator .tabulator-header .tabulator-col.ui-sortable-helper {\n position: absolute;\n background-color: #1a1a1a !important;\n border: 1px solid #aaa;\n}\n\n.tabulator .tabulator-header .tabulator-col .tabulator-header-filter {\n position: relative;\n box-sizing: border-box;\n margin-top: 2px;\n width: 100%;\n text-align: center;\n}\n\n.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea {\n height: auto !important;\n}\n\n.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg {\n margin-top: 3px;\n}\n\n.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input, .tabulator .tabulator-header .tabulator-col .tabulator-header-filter select {\n border: 1px solid #999;\n background: #444;\n color: #fff;\n}\n\n.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear {\n width: 0;\n height: 0;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {\n padding-right: 25px;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {\n cursor: pointer;\n background-color: #1a1a1a;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #bbb;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="asc"] .tabulator-col-content .tabulator-arrow {\n border-top: none;\n border-bottom: 6px solid #666;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="desc"] .tabulator-col-content .tabulator-arrow {\n border-top: 6px solid #666;\n border-bottom: none;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title {\n -webkit-writing-mode: vertical-rl;\n -ms-writing-mode: tb-rl;\n writing-mode: vertical-rl;\n text-orientation: mixed;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title {\n -ms-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title {\n padding-right: 0;\n padding-top: 20px;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title {\n padding-right: 0;\n padding-bottom: 20px;\n}\n\n.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-arrow {\n right: calc(50% - 6px);\n}\n\n.tabulator .tabulator-header .tabulator-frozen {\n display: inline-block;\n position: absolute;\n z-index: 10;\n}\n\n.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #888;\n}\n\n.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #888;\n}\n\n.tabulator .tabulator-header .tabulator-calcs-holder {\n box-sizing: border-box;\n min-width: 400%;\n background: #1a1a1a !important;\n border-top: 1px solid #888;\n border-bottom: 1px solid #aaa;\n overflow: hidden;\n}\n\n.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row {\n background: #1a1a1a !important;\n}\n\n.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none;\n}\n\n.tabulator .tabulator-header .tabulator-frozen-rows-holder {\n min-width: 400%;\n}\n\n.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty {\n display: none;\n}\n\n.tabulator .tabulator-tableHolder {\n position: relative;\n width: 100%;\n white-space: nowrap;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n.tabulator .tabulator-tableHolder:focus {\n outline: none;\n}\n\n.tabulator .tabulator-tableHolder .tabulator-placeholder {\n box-sizing: border-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n width: 100%;\n}\n\n.tabulator .tabulator-tableHolder .tabulator-placeholder[tabulator-render-mode="virtual"] {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n}\n\n.tabulator .tabulator-tableHolder .tabulator-placeholder span {\n display: inline-block;\n margin: 0 auto;\n padding: 10px;\n color: #eee;\n font-weight: bold;\n font-size: 20px;\n}\n\n.tabulator .tabulator-tableHolder .tabulator-table {\n position: relative;\n display: inline-block;\n background-color: #666;\n white-space: nowrap;\n overflow: visible;\n color: #fff;\n}\n\n.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs {\n font-weight: bold;\n background: #373737 !important;\n}\n\n.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {\n border-bottom: 2px solid #888;\n}\n\n.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom {\n border-top: 2px solid #888;\n}\n\n.tabulator .tabulator-col-resize-handle {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n width: 5px;\n}\n\n.tabulator .tabulator-col-resize-handle.prev {\n left: 0;\n right: auto;\n}\n\n.tabulator .tabulator-col-resize-handle:hover {\n cursor: ew-resize;\n}\n\n.tabulator .tabulator-footer {\n padding: 5px 10px;\n border-top: 1px solid #999;\n background-color: #333;\n text-align: right;\n color: #333;\n font-weight: bold;\n white-space: nowrap;\n -ms-user-select: none;\n user-select: none;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none;\n}\n\n.tabulator .tabulator-footer .tabulator-calcs-holder {\n box-sizing: border-box;\n width: calc(100% + 20px);\n margin: -5px -10px 5px -10px;\n text-align: left;\n background: #262626 !important;\n border-bottom: 1px solid #888;\n border-top: 1px solid #888;\n overflow: hidden;\n}\n\n.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row {\n background: #262626 !important;\n color: #fff;\n}\n\n.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle {\n display: none;\n}\n\n.tabulator .tabulator-footer .tabulator-calcs-holder:only-child {\n margin-bottom: -5px;\n border-bottom: none;\n}\n\n.tabulator .tabulator-footer .tabulator-paginator label {\n color: #fff;\n}\n\n.tabulator .tabulator-footer .tabulator-page-size {\n display: inline-block;\n margin: 0 5px;\n padding: 2px 5px;\n border: 1px solid #aaa;\n border-radius: 3px;\n}\n\n.tabulator .tabulator-footer .tabulator-pages {\n margin: 0 7px;\n}\n\n.tabulator .tabulator-footer .tabulator-page {\n display: inline-block;\n margin: 0 2px;\n padding: 2px 5px;\n border: 1px solid #aaa;\n border-radius: 3px;\n background: rgba(255, 255, 255, 0.2);\n color: #333;\n font-family: inherit;\n font-weight: inherit;\n font-size: inherit;\n}\n\n.tabulator .tabulator-footer .tabulator-page.active {\n color: #fff;\n}\n\n.tabulator .tabulator-footer .tabulator-page:disabled {\n opacity: .5;\n}\n\n.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2);\n color: #fff;\n}\n\n.tabulator .tabulator-loader {\n position: absolute;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n top: 0;\n left: 0;\n z-index: 100;\n height: 100%;\n width: 100%;\n background: rgba(0, 0, 0, 0.4);\n text-align: center;\n}\n\n.tabulator .tabulator-loader .tabulator-loader-msg {\n display: inline-block;\n margin: 0 auto;\n padding: 10px 20px;\n border-radius: 10px;\n background: #fff;\n font-weight: bold;\n font-size: 16px;\n}\n\n.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading {\n border: 4px solid #333;\n color: #000;\n}\n\n.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error {\n border: 4px solid #D00;\n color: #590000;\n}\n\n.tabulator-row {\n position: relative;\n box-sizing: border-box;\n min-height: 22px;\n background-color: #666;\n}\n\n.tabulator-row:nth-child(even) {\n background-color: #444;\n}\n\n.tabulator-row.tabulator-selectable:hover {\n background-color: #999;\n cursor: pointer;\n}\n\n.tabulator-row.tabulator-selected {\n background-color: #000;\n}\n\n.tabulator-row.tabulator-selected:hover {\n background-color: #888;\n cursor: pointer;\n}\n\n.tabulator-row.tabulator-moving {\n position: absolute;\n border-top: 1px solid #888;\n border-bottom: 1px solid #888;\n pointer-events: none !important;\n z-index: 15;\n}\n\n.tabulator-row .tabulator-row-resize-handle {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n height: 5px;\n}\n\n.tabulator-row .tabulator-row-resize-handle.prev {\n top: 0;\n bottom: auto;\n}\n\n.tabulator-row .tabulator-row-resize-handle:hover {\n cursor: ns-resize;\n}\n\n.tabulator-row .tabulator-frozen {\n display: inline-block;\n position: absolute;\n background-color: inherit;\n z-index: 10;\n}\n\n.tabulator-row .tabulator-frozen.tabulator-frozen-left {\n border-right: 2px solid #888;\n}\n\n.tabulator-row .tabulator-frozen.tabulator-frozen-right {\n border-left: 2px solid #888;\n}\n\n.tabulator-row .tabulator-responsive-collapse {\n box-sizing: border-box;\n padding: 5px;\n border-top: 1px solid #888;\n border-bottom: 1px solid #888;\n}\n\n.tabulator-row .tabulator-responsive-collapse:empty {\n display: none;\n}\n\n.tabulator-row .tabulator-responsive-collapse table {\n font-size: 14px;\n}\n\n.tabulator-row .tabulator-responsive-collapse table tr td {\n position: relative;\n}\n\n.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type {\n padding-right: 10px;\n}\n\n.tabulator-row .tabulator-cell {\n display: inline-block;\n position: relative;\n box-sizing: border-box;\n padding: 4px;\n border-right: 1px solid #888;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.tabulator-row .tabulator-cell.tabulator-editing {\n border: 1px solid #999;\n padding: 0;\n}\n\n.tabulator-row .tabulator-cell.tabulator-editing input, .tabulator-row .tabulator-cell.tabulator-editing select {\n border: 1px;\n background: transparent;\n}\n\n.tabulator-row .tabulator-cell.tabulator-validation-fail {\n border: 1px solid #dd0000;\n}\n\n.tabulator-row .tabulator-cell.tabulator-validation-fail input, .tabulator-row .tabulator-cell.tabulator-validation-fail select {\n border: 1px;\n background: transparent;\n color: #dd0000;\n}\n\n.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev {\n display: none;\n}\n\n.tabulator-row .tabulator-cell.tabulator-row-handle {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: center;\n align-items: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none;\n}\n\n.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box {\n width: 80%;\n}\n\n.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar {\n width: 100%;\n height: 3px;\n margin-top: 2px;\n background: #666;\n}\n\n.tabulator-row .tabulator-cell .tabulator-data-tree-branch {\n display: inline-block;\n vertical-align: middle;\n height: 9px;\n width: 7px;\n margin-top: -9px;\n margin-right: 5px;\n border-bottom-left-radius: 1px;\n border-left: 2px solid #888;\n border-bottom: 2px solid #888;\n}\n\n.tabulator-row .tabulator-cell .tabulator-data-tree-control {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-align: center;\n align-items: center;\n vertical-align: middle;\n height: 11px;\n width: 11px;\n margin-right: 5px;\n border: 1px solid #fff;\n border-radius: 2px;\n background: rgba(0, 0, 0, 0.1);\n overflow: hidden;\n}\n\n.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.2);\n}\n\n.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: transparent;\n}\n\n.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after {\n position: absolute;\n content: "";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #fff;\n}\n\n.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand {\n display: inline-block;\n position: relative;\n height: 7px;\n width: 1px;\n background: #fff;\n}\n\n.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after {\n position: absolute;\n content: "";\n left: -3px;\n top: 3px;\n height: 1px;\n width: 7px;\n background: #fff;\n}\n\n.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n -moz-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -o-user-select: none;\n height: 15px;\n width: 15px;\n border-radius: 20px;\n background: #fff;\n color: #666;\n font-weight: bold;\n font-size: 1.1em;\n}\n\n.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover {\n opacity: .7;\n}\n\n.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close {\n display: initial;\n}\n\n.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open {\n display: none;\n}\n\n.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close {\n display: none;\n}\n\n.tabulator-row .tabulator-cell .tabulator-traffic-light {\n display: inline-block;\n height: 14px;\n width: 14px;\n border-radius: 14px;\n}\n\n.tabulator-row.tabulator-group {\n box-sizing: border-box;\n border-bottom: 1px solid #999;\n border-right: 1px solid #888;\n border-top: 1px solid #999;\n padding: 5px;\n padding-left: 10px;\n background: #ccc;\n font-weight: bold;\n color: #333;\n min-width: 100%;\n}\n\n.tabulator-row.tabulator-group:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.1);\n}\n\n.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow {\n margin-right: 10px;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #666;\n border-bottom: 0;\n}\n\n.tabulator-row.tabulator-group.tabulator-group-level-1 {\n padding-left: 30px;\n}\n\n.tabulator-row.tabulator-group.tabulator-group-level-2 {\n padding-left: 50px;\n}\n\n.tabulator-row.tabulator-group.tabulator-group-level-3 {\n padding-left: 70px;\n}\n\n.tabulator-row.tabulator-group.tabulator-group-level-4 {\n padding-left: 90px;\n}\n\n.tabulator-row.tabulator-group.tabulator-group-level-5 {\n padding-left: 110px;\n}\n\n.tabulator-row.tabulator-group .tabulator-arrow {\n display: inline-block;\n width: 0;\n height: 0;\n margin-right: 16px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 0;\n border-left: 6px solid #666;\n vertical-align: middle;\n}\n\n.tabulator-row.tabulator-group span {\n margin-left: 10px;\n color: #666;\n}\n\n.tabulator-edit-select-list {\n position: absolute;\n display: inline-block;\n box-sizing: border-box;\n max-height: 200px;\n background: #fff;\n border: 1px solid #888;\n font-size: 14px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n z-index: 10000;\n}\n\n.tabulator-edit-select-list .tabulator-edit-select-list-item {\n padding: 4px;\n color: #666;\n}\n\n.tabulator-edit-select-list .tabulator-edit-select-list-item.active {\n color: #999;\n background: #444;\n}\n\n.tabulator-edit-select-list .tabulator-edit-select-list-item:hover {\n cursor: pointer;\n color: #999;\n background: #666;\n}\n\n.tabulator-edit-select-list .tabulator-edit-select-list-group {\n border-bottom: 1px solid #888;\n padding: 4px;\n padding-top: 6px;\n color: #fff;\n font-weight: bold;\n}\n',""])},function(t,e,n){var i=n(263);"string"==typeof i&&(i=[[t.i,i,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(26)(i,o);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(25)(!1)).push([t.i,".tabulator {\n border-left: 1px solid #333;\n border-bottom: 1px solid #333;\n}\n.tabulator-row.tabulator-row-odd {\n background-color: #222;\n}\n.tabulator-row.tabulator-row-even {\n background-color: #333;\n}\n.desktop .tabulator-row.tabulator-selectable.tabulator-row-even:hover {\n cursor: arrow;\n background-color: #333;\n}\n.desktop .tabulator-row.tabulator-selectable.tabulator-row-odd:hover {\n cursor: arrow;\n background-color: #222;\n}\n.tabulator-row .tabulator-cell {\n border-right: 1px solid #444;\n padding: 8px;\n}\n.tabulator .tabulator-header {\n border-bottom: 0;\n}\n.tabulator .tabulator-header .tabulator-col {\n border-right: 1px solid #444;\n}\n.tabulator .tabulator-tableHolder .tabulator-table {\n background-color: #333;\n}\n.multi-value-formatter-content span {\n border: 0;\n padding: 0 5px 0 0;\n}\n\n.citationBrowser {\n}\n.citationBrowser .q {\n max-width: 400px;\n margin-bottom: 10px;\n background-image: url(/assets/img/icon-search.png);\n background-position: 380px center;\n background-repeat: no-repeat;\n box-shadow: 0px 2px 4px rgba(0,0,0,0.2);\n border: 0;\n}\n\n.citationHeader {\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n}\nspan.download {\n display: block;\n font-size: 13px;\n color: #ddd;\n cursor: pointer;\n background: #333;\n padding: 5px 8px;\n border-radius: 5px;\n transition: all 0.2s;\n}\n.desktop span.download:hover {\n color: #fff;\n background: #666;\n}",""])},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.citationsColumns=void 0;var i=y(n(126)),o=y(n(56)),r=y(n(268)),a=y(n(88)),s=y(n(12)),l=y(n(7)),u=y(n(8)),c=y(n(13)),h=y(n(14)),d=n(2),f=y(d),p=(n(21),n(17),n(89)),g=n(407),m=n(51),v=n(11);function y(t){return t&&t.__esModule?t:{default:t}}var b=e.citationsColumns=[{title:"Title",field:"title",sorter:"string"},{title:"Institution",field:"institution",sorter:"string"},{title:"Country",field:"country",sorter:"string",width:140},{title:"Year",field:"year",sorter:"number",width:70},{title:"PDF",field:"pdf_text",formatter:"link",formatterParams:{target:"_blank",urlField:"pdf_link"},sorter:"string",width:100}],w=function(t){function e(){var t,n,i,o;(0,l.default)(this,e);for(var r=arguments.length,a=Array(r),u=0;u<r;u++)a[u]=arguments[u];return n=i=(0,c.default)(this,(t=e.__proto__||(0,s.default)(e)).call.apply(t,[this].concat(a))),i.state={q:"",formattedCitations:[],filteredCitations:[]},o=n,(0,c.default)(i,o)}return(0,h.default)(e,t),(0,u.default)(e,[{key:"componentDidMount",value:function(){this.updateCitations()}},{key:"componentDidUpdate",value:function(t){this.props.payload.data.citations!==t.payload.data.citations&&this.updateCitations()}},{key:"updateCitations",value:function(){var t=this.props.payload.data,e=(t.paper,t.citations);e.length||this.setState({formattedCitations:[]});var n=e.sort(function(t,e){return t.title.localeCompare(e.title)}).map(function(t){var e=t.pdf&&t.pdf.length?t.pdf[0]:t.doi&&t.doi.length?t.doi[0]:"https://www.semanticscholar.org/paper/"+t.id,n=(0,v.domainFromUrl)(e);return{title:t.title,institution:t.addresses.map(function(t){return t.name}).sort().join("; "),country:(0,a.default)(new r.default(t.addresses.map(function(t){return t.country}))).sort().join("; "),year:t.year,pdf_link:e,pdf_text:n}});this.setState({formattedCitations:n,filteredCitations:n})}},{key:"updateFilter",value:function(t){var e=this.state.formattedCitations;if(t.length){var n=new RegExp("("+t.replace(/\s+/g," ").trim().replace(" ","|")+")","gi"),i=e.filter(function(t){return t.title.match(n)||t.institution.match(n)||t.country.match(n)});this.setState({q:t,filteredCitations:i})}else this.setState({q:t,filteredCitations:e})}},{key:"download",value:function(){var t=this.state.formattedCitations,e=this.props.payload.data.paper.key+".csv",n=b.map(function(t){return t.title}),r=b.map(function(t){return t.formatterParams?t.formatterParams.urlField:t.field}),a=t.map(function(t){return r.map(function(e){return t[e]}).map(function(t){switch(void 0===t?"undefined":(0,o.default)(t)){case"number":return String(t);default:return'"'+String(t)+'"'}}).join(",")}),s=new Blob([[n.join(",")].concat((0,i.default)(a)).join("\n")],{type:"text/csv;charset=utf-8"});(0,g.saveAs)(s,e)}},{key:"render",value:function(){var t=this,e=this.state,n=e.formattedCitations,i=e.filteredCitations;return n.length?f.default.createElement("div",{className:"citationBrowser"},f.default.createElement("div",{className:"citationHeader"},f.default.createElement("input",{type:"text",value:this.state.q,onChange:function(e){return t.updateFilter(e.target.value)},className:"q",placeholder:"Enter text to search citations..."}),f.default.createElement("span",{className:"download",onClick:function(){return t.download()}},"Download CSV")),f.default.createElement(p.ReactTabulator,{columns:b,data:i,options:{height:Math.max(104,Math.min(37*n.length+29,311)),layout:"fitColumns",placeholder:n.length?"":"Nothing matches your query"}})):f.default.createElement(m.Loader,null)}}]),e}(d.Component);e.default=w},function(t,e,n){n(32),n(266),t.exports=n(3).Array.from},function(t,e,n){"use strict";var i=n(18),o=n(4),r=n(31),a=n(107),s=n(108),l=n(53),u=n(267),c=n(76);o(o.S+o.F*!n(114)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,o,h,d=r(t),f="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,m=void 0!==g,v=0,y=c(d);if(m&&(g=i(g,p>2?arguments[2]:void 0,2)),void 0==y||f==Array&&s(y))for(n=new f(e=l(d.length));e>v;v++)u(n,v,m?g(d[v],v):d[v]);else for(h=y.call(d),n=new f;!(o=h.next()).done;v++)u(n,v,m?a(h,g,[o.value,v],!0):o.value);return n.length=v,n}})},function(t,e,n){"use strict";var i=n(9),o=n(41);t.exports=function(t,e,n){e in t?i.f(t,e,o(0,n)):t[e]=n}},function(t,e,n){t.exports={default:n(269),__esModule:!0}},function(t,e,n){n(77),n(32),n(37),n(270),n(276),n(279),n(281),t.exports=n(3).Set},function(t,e,n){"use strict";var i=n(271),o=n(127);t.exports=n(272)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return i.def(o(this,"Set"),t=0===t?0:t,t)}},i)},function(t,e,n){"use strict";var i=n(9).f,o=n(52),r=n(80),a=n(18),s=n(78),l=n(44),u=n(69),c=n(101),h=n(113),d=n(16),f=n(85).fastKey,p=n(127),g=d?"_s":"size",m=function(t,e){var n,i=f(e);if("F"!==i)return t._i[i];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,u){var c=t(function(t,i){s(t,c,e,"_i"),t._t=e,t._i=o(null),t._f=void 0,t._l=void 0,t[g]=0,void 0!=i&&l(i,n,t[u],t)});return r(c.prototype,{clear:function(){for(var t=p(this,e),n=t._i,i=t._f;i;i=i.n)i.r=!0,i.p&&(i.p=i.p.n=void 0),delete n[i.i];t._f=t._l=void 0,t[g]=0},delete:function(t){var n=p(this,e),i=m(n,t);if(i){var o=i.n,r=i.p;delete n._i[i.i],i.r=!0,r&&(r.n=o),o&&(o.p=r),n._f==i&&(n._f=o),n._l==i&&(n._l=r),n[g]--}return!!i},forEach:function(t){p(this,e);for(var n,i=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(i(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!m(p(this,e),t)}}),d&&i(c.prototype,"size",{get:function(){return p(this,e)[g]}}),c},def:function(t,e,n){var i,o,r=m(t,e);return r?r.v=n:(t._l=r={i:o=f(e,!0),k:e,v:n,p:i=t._l,n:void 0,r:!1},t._f||(t._f=r),i&&(i.n=r),t[g]++,"F"!==o&&(t._i[o]=r)),t},getEntry:m,setStrong:function(t,e,n){u(t,e,function(t,n){this._t=p(t,e),this._k=n,this._l=void 0},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?c(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,c(1))},n?"entries":"values",!n,!0),h(e)}}},function(t,e,n){"use strict";var i=n(5),o=n(4),r=n(85),a=n(23),s=n(20),l=n(80),u=n(44),c=n(78),h=n(10),d=n(43),f=n(9).f,p=n(273)(0),g=n(16);t.exports=function(t,e,n,m,v,y){var b=i[t],w=b,_=v?"set":"add",x=w&&w.prototype,S={};return g&&"function"==typeof w&&(y||x.forEach&&!a(function(){(new w).entries().next()}))?(w=e(function(e,n){c(e,w,t,"_c"),e._c=new b,void 0!=n&&u(n,v,e[_],e)}),p("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(t){var e="add"==t||"set"==t;t in x&&(!y||"clear"!=t)&&s(w.prototype,t,function(n,i){if(c(this,w,t),!e&&y&&!h(n))return"get"==t&&void 0;var o=this._c[t](0===n?0:n,i);return e?this:o})}),y||f(w.prototype,"size",{get:function(){return this._c.size}})):(w=m.getConstructor(e,t,v,_),l(w.prototype,n),r.NEED=!0),d(w,t),S[t]=w,o(o.G+o.W+o.F,S),y||m.setStrong(w,t,v),w}},function(t,e,n){var i=n(18),o=n(67),r=n(31),a=n(53),s=n(274);t.exports=function(t,e){var n=1==t,l=2==t,u=3==t,c=4==t,h=6==t,d=5==t||h,f=e||s;return function(e,s,p){for(var g,m,v=r(e),y=o(v),b=i(s,p,3),w=a(y.length),_=0,x=n?f(e,w):l?f(e,0):void 0;w>_;_++)if((d||_ in y)&&(m=b(g=y[_],_,v),t))if(n)x[_]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return _;case 2:x.push(g)}else if(c)return!1;return h?-1:u||c?c:x}}},function(t,e,n){var i=n(275);t.exports=function(t,e){return new(i(t))(e)}},function(t,e,n){var i=n(10),o=n(123),r=n(6)("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)||(e=void 0),i(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){var i=n(4);i(i.P+i.R,"Set",{toJSON:n(277)("Set")})},function(t,e,n){var i=n(55),o=n(278);t.exports=function(t){return function(){if(i(this)!=t)throw TypeError(t+"#toJSON isn't generic");return o(this)}}},function(t,e,n){var i=n(44);t.exports=function(t,e){var n=[];return i(t,!1,n.push,n,e),n}},function(t,e,n){n(280)("Set")},function(t,e,n){"use strict";var i=n(4);t.exports=function(t){i(i.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,n){n(282)("Set")},function(t,e,n){"use strict";var i=n(4),o=n(40),r=n(18),a=n(44);t.exports=function(t){i(i.S,t,{from:function(t){var e,n,i,s,l=arguments[1];return o(this),(e=void 0!==l)&&o(l),void 0==t?new this:(n=[],e?(i=0,s=r(l,arguments[2],2),a(t,!1,function(t){n.push(s(t,i++))})):a(t,!1,n.push,n),new this(n))}})}},function(t,e,n){var i=function(t){return t.default||t}(n(284));t.exports={renderToString:i,renderToStaticMarkup:i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"render",function(){return g}),n.d(e,"renderToString",function(){return g}),n.d(e,"shallowRender",function(){return p});var i=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,o=Object.keys||function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e},r=function(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},a=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},s=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},l={};function u(t){var e="";for(var n in t){var o=t[n];null!=o&&(e&&(e+=" "),e+=l[n]||(l[n]=n.replace(/([A-Z])/g,"-$1").toLowerCase()),e+=": ",e+=o,"number"==typeof o&&!1===i.test(n)&&(e+="px"),e+=";")}return e||void 0}function c(t,e){for(var n in e)t[n]=e[n];return t}var h={shallow:!0},d=[],f=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;g.render=g;var p=function(t,e){return g(t,e,h)};function g(t,e,n,i,l){if(null==t||"boolean"==typeof t)return"";var h=t.nodeName,p=t.attributes,m=!1;e=e||{};var v,y=(n=n||{}).pretty,b="string"==typeof y?y:"\t";if("object"!=typeof t&&!h)return r(t);if("function"==typeof h){if(m=!0,!n.shallow||!i&&!1!==n.renderRootComponent){var w,_=function(t){var e=c({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===e[i]&&(e[i]=n[i]);return e}(t);if(h.prototype&&"function"==typeof h.prototype.render){var x=new h(_,e);x._disable=x.__x=!0,x.props=_,x.context=e,x.componentWillMount&&x.componentWillMount(),w=x.render(x.props,x.state,x.context),x.getChildContext&&(e=c(c({},e),x.getChildContext()))}else w=h(_,e);return g(w,e,n,!1!==n.shallowHighOrder)}h=(v=h).displayName||v!==Function&&v.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,i=d.length;i--;)if(d[i]===t){n=i;break}n<0&&(n=d.push(t)-1),e="UnnamedComponent"+n}return e}(v)}var S,E="";if(p){var C=o(p);n&&!0===n.sortAttributes&&C.sort();for(var T=0;T<C.length;T++){var M=C[T],P=p[M];if("children"!==M&&!M.match(/[\s\n\\/='"\0<>]/)&&(n&&n.allAttributes||"key"!==M&&"ref"!==M)){if("className"===M){if(p.class)continue;M="class"}else l&&M.match(/^xlink:?./)&&(M=M.toLowerCase().replace(/^xlink:?/,"xlink:"));"style"===M&&P&&"object"==typeof P&&(P=u(P));var L=n.attributeHook&&n.attributeHook(M,P,e,n,m);if(L||""===L)E+=L;else if("dangerouslySetInnerHTML"===M)S=P&&P.__html;else if((P||0===P||""===P)&&"function"!=typeof P){if(!(!0!==P&&""!==P||(P=M,n&&n.xml))){E+=" "+M;continue}E+=" "+M+'="'+r(P)+'"'}}}}var A=E.replace(/^\n\s*/," ");if(A===E||~A.indexOf("\n")?y&&~E.indexOf("\n")&&(E+="\n"):E=A,E="<"+h+E+">",String(h).match(/[\s\n\\/='"\0<>]/))throw E;var k=String(h).match(f);k&&(E=E.replace(/>$/," />"));var O=[];if(S)y&&s(S)&&(S="\n"+b+a(S,b)),E+=S;else if(t.children){for(var R=~E.indexOf("\n"),D=0;D<t.children.length;D++){var j=t.children[D];if(null!=j&&!1!==j){var z=g(j,e,n,!0,"svg"===h||"foreignObject"!==h&&l);!R&&y&&s(z)&&(R=!0),z&&O.push(z)}}if(y&&R)for(var N=O.length;N--;)O[N]="\n"+b+a(O[N],b)}if(O.length)E+=O.join("");else if(n&&n.xml)return E.substring(0,E.length-1)+" />";return k||(y&&~E.indexOf("\n")&&(E+="\n"),E+="</"+h+">"),E}g.shallowRender=p,e.default=g},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};e.__esModule=!0;var r=n(2),a=n(2),s=n(129),l=n(130),u=n(46),c=n(131),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={data:[]},e.ref=null,e.htmlProps=null,e.mainId="tabulator-"+ +new Date+"-"+Math.floor(9999999*Math.random()),e.table=null,e.pickValidHTMLProps=function(){e.htmlProps||(e.htmlProps=s.pickHTMLProps(e.props),delete e.htmlProps.data,delete e.htmlProps.columns)},e}return i(e,t),e.prototype.componentDidMount=function(){var t=a.findDOMNode(this.ref),e=this,n=this.props,i=n.columns,r=n.data,s=n.options,u=l.propsToOptions(this.props);new c(t,o({columns:i},u,{layout:"fitColumns",tableBuilding:function(){e.table=this,e.props.tableBuilding&&e.props.tableBuilding()},dataLoaded:function(){e.props.dataLoaded&&e.props.dataLoaded()}},s,{data:r})),r&&r.length>0&&this.setState({data:r})},e.prototype.componentWillUnmount=function(){this.table.destroy()},e.prototype.componentWillReceiveProps=function(t){var e=this;u.isSameArray(this.state.data,t.data)||this.setState({data:t.data},function(){e.table.setData(e.state.data)})},e.prototype.render=function(){var t=this;this.pickValidHTMLProps();var e=this.props.className;return r.createElement("div",o({ref:function(e){return t.ref=e},"data-instance":this.mainId},this.htmlProps,{className:e}))},e}(r.Component);e.default=h},function(t,e,n){"use strict";var i,o=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();e.__esModule=!0;var r=n(2),a=n(128),s=n(287),l=n(401),u=n(406);var c=[{title:"Name",field:"name",width:150},{title:"Age",field:"age",align:"left",formatter:"progress"},{title:"Favourite Color",field:"color"},{title:"Date Of Birth",field:"dob"},{title:"Rating",field:"rating",align:"center",formatter:"star"},{title:"Passed?",field:"passed",align:"center",formatter:"tickCross"},{title:"Custom",field:"custom",align:"center",formatter:n(46).reactFormatter(r.createElement(function(t){var e=t.cell._cell.row.data;return r.createElement("button",{onClick:function(){return alert(e.name)}},"Show")},null))}],h=[{id:1,name:"Oli Bob",age:"12",color:"red",dob:"01/01/1980",rating:5,passed:!0,pets:["cat","dog"]},{id:2,name:"Mary May",age:"1",color:"green",dob:"12/05/1989",rating:4,passed:!0,pets:["cat"]},{id:3,name:"Christine Lobowski",age:"42",color:"green",dob:"10/05/1985",rating:4,passed:!1},{id:4,name:"Brendon Philips",age:"125",color:"red",dob:"01/08/1980",rating:4.5,passed:!0},{id:5,name:"Margret Marmajuke",age:"16",color:"yellow",dob:"07/01/1999",rating:4,passed:!1},{id:6,name:"Van Ng",age:"37",color:"green",dob:"06/10/1982",rating:4,passed:!0,pets:["dog","fish"]},{id:7,name:"Duc Ng",age:"37",color:"yellow",dob:"10/10/1982",rating:4,passed:!0,pets:["dog"]}],d=((i={})[""]="&nbsp;",i.red="red",i.green="green",i.yellow="yellow",i),f=[{title:"Name",field:"name",width:150,editor:"input",headerFilter:"input"},{title:"Age",field:"age",align:"left",formatter:"progress",editor:"progress"},{title:"Favourite Color",field:"color",editor:"select",editorParams:{allowEmpty:!0,showListOnEmpty:!0,values:d},headerFilter:"select",headerFilterParams:{values:d}},{title:"Date Of Birth",field:"dob",editor:s.default,editorParams:{format:"MM/dd/yyyy"}},{title:"Pets",field:"pets",editor:l.default,editorParams:{values:[{id:"cat",name:"cat"},{id:"dog",name:"dog"},{id:"fish",name:"fish"}]},formatter:u.default,formatterParams:{style:"PILL"}},{title:"Passed?",field:"passed",align:"center",formatter:"tickCross",editor:!0}],p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={data:[]},e.ref=null,e.rowClick=function(t,n){console.log("ref table: ",e.ref.table),console.log("rowClick id: ${row.getData().id}",n,t)},e.setData=function(){e.setState({data:h})},e.clearData=function(){e.setState({data:[]})},e}return o(e,t),e.prototype.render=function(){var t=this;return r.createElement("div",null,r.createElement(a.default,{ref:function(e){return t.ref=e},columns:c,data:h,rowClick:this.rowClick,options:{height:150,movableRows:!0},"data-custom-attr":"test-custom-attribute",className:"custom-css-class"}),r.createElement("h3",null,"Asynchronous data: (e.g. fetch) - ",r.createElement("button",{onClick:this.setData},"Set Data")," ",r.createElement("button",{onClick:this.clearData},"Clear")),r.createElement(a.default,{columns:c,data:this.state.data}),r.createElement("h3",null,"Editable Table"),r.createElement(a.default,{columns:f,data:h,cellEdited:function(t){return console.log("cellEdited",t)},dataEdited:function(t){return console.log("dataEdited",t)},footerElement:r.createElement("span",null,"Footer")}),r.createElement("p",null,r.createElement("a",{href:"https://github.com/ngduc/react-tabulator",target:"_blank"},"Back to: Github Repo: react-tabulator")),r.createElement("p",null,r.createElement("a",{href:"http://tabulator.info/examples/4.0",target:"_blank"},"More Tabulator's Examples")))},e}(r.Component);e.default=p},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();e.__esModule=!0;var o=n(2),r=n(2),a=n(288),s={width:"100%",height:"100%",fontSize:"1em",fontFamily:"inherit"},l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={value:""},e.ref=null,e.format=e.props.editorParams.format||"MM/dd/yyyy",e.setValueOnSuccess=function(t){void 0===t&&(t=e.state.value);var n=e.props.success,i=t;i.indexOf("-")>0&&(i=a.format(t,e.format)),n(i)},e.onChange=function(t){var n=t.target.value;e.setState({value:n})},e.onKeyPress=function(t){var n=e.props.cancel;13===t.keyCode?e.setValueOnSuccess():27===t.keyCode&&n()},e.onBlur=function(){e.setValueOnSuccess()},e}return i(e,t),e.prototype.componentDidMount=function(){var t=this;this.props.onRendered(function(){var e=t.props.cell.getValue();t.setState({value:e}),t.ref.focus()})},e.prototype.render=function(){var t=this,e=this.props.cell,n=a.parse(e.getValue(),this.format,new Date,{awareOfUnicodeTokens:!0}),i=a.format(n,"yyyy-MM-dd");return o.createElement("input",{type:"date",ref:function(e){return t.ref=e},defaultValue:i,onBlur:this.onBlur,onChange:this.onChange,onKeyUp:this.onKeyPress,style:s})},e}(o.Component);e.default=function(t,e,n,i,a){var s=document.createElement("div");return s.style.height="100%",r.render(o.createElement(l,{cell:t,onRendered:e,success:n,cancel:i,editorParams:a}),s),s}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(47);n.d(e,"addDays",function(){return i.a});var o=n(132);n.d(e,"addHours",function(){return o.a});var r=n(133);n.d(e,"addISOWeekYears",function(){return r.a});var a=n(48);n.d(e,"addMilliseconds",function(){return a.a});var s=n(135);n.d(e,"addMinutes",function(){return s.a});var l=n(58);n.d(e,"addMonths",function(){return l.a});var u=n(136);n.d(e,"addQuarters",function(){return u.a});var c=n(137);n.d(e,"addSeconds",function(){return c.a});var h=n(59);n.d(e,"addWeeks",function(){return h.a});var d=n(138);n.d(e,"addYears",function(){return d.a});var f=n(289);n.d(e,"areIntervalsOverlapping",function(){return f.a});var p=n(290);n.d(e,"closestIndexTo",function(){return p.a});var g=n(291);n.d(e,"closestTo",function(){return g.a});var m=n(28);n.d(e,"compareAsc",function(){return m.a});var v=n(292);n.d(e,"compareDesc",function(){return v.a});var y=n(36);n.d(e,"differenceInCalendarDays",function(){return y.a});var b=n(139);n.d(e,"differenceInCalendarISOWeekYears",function(){return b.a});var w=n(293);n.d(e,"differenceInCalendarISOWeeks",function(){return w.a});var _=n(140);n.d(e,"differenceInCalendarMonths",function(){return _.a});var x=n(294);n.d(e,"differenceInCalendarQuarters",function(){return x.a});var S=n(142);n.d(e,"differenceInCalendarWeeks",function(){return S.a});var E=n(143);n.d(e,"differenceInCalendarYears",function(){return E.a});var C=n(144);n.d(e,"differenceInDays",function(){return C.a});var T=n(295);n.d(e,"differenceInHours",function(){return T.a});var M=n(296);n.d(e,"differenceInISOWeekYears",function(){return M.a});var P=n(60);n.d(e,"differenceInMilliseconds",function(){return P.a});var L=n(297);n.d(e,"differenceInMinutes",function(){return L.a});var A=n(92);n.d(e,"differenceInMonths",function(){return A.a});var k=n(298);n.d(e,"differenceInQuarters",function(){return k.a});var O=n(93);n.d(e,"differenceInSeconds",function(){return O.a});var R=n(299);n.d(e,"differenceInWeeks",function(){return R.a});var D=n(300);n.d(e,"differenceInYears",function(){return D.a});var j=n(146);n.d(e,"eachDayOfInterval",function(){return j.a});var z=n(301);n.d(e,"eachWeekOfInterval",function(){return z.a});var N=n(94);n.d(e,"eachWeekendOfInterval",function(){return N.a});var I=n(302);n.d(e,"eachWeekendOfMonth",function(){return I.a});var F=n(303);n.d(e,"eachWeekendOfYear",function(){return F.a});var H=n(150);n.d(e,"endOfDay",function(){return H.a});var G=n(304);n.d(e,"endOfDecade",function(){return G.a});var V=n(305);n.d(e,"endOfHour",function(){return V.a});var B=n(306);n.d(e,"endOfISOWeek",function(){return B.a});var U=n(307);n.d(e,"endOfISOWeekYear",function(){return U.a});var W=n(308);n.d(e,"endOfMinute",function(){return W.a});var q=n(95);n.d(e,"endOfMonth",function(){return q.a});var Y=n(309);n.d(e,"endOfQuarter",function(){return Y.a});var X=n(310);n.d(e,"endOfSecond",function(){return X.a});var Z=n(151);n.d(e,"endOfWeek",function(){return Z.a});var Q=n(149);n.d(e,"endOfYear",function(){return Q.a});var K=n(152);n.d(e,"format",function(){return K.a});var $=n(325);n.d(e,"formatDistance",function(){return $.a});var J=n(326);n.d(e,"formatDistanceStrict",function(){return J.a});var tt=n(327);n.d(e,"formatRelative",function(){return tt.a});var et=n(328);n.d(e,"fromUnixTime",function(){return et.a});var nt=n(158);n.d(e,"getDate",function(){return nt.a});var it=n(159);n.d(e,"getDay",function(){return it.a});var ot=n(329);n.d(e,"getDayOfYear",function(){return ot.a});var rt=n(91);n.d(e,"getDaysInMonth",function(){return rt.a});var at=n(330);n.d(e,"getDaysInYear",function(){return at.a});var st=n(331);n.d(e,"getDecade",function(){return st.a});var lt=n(332);n.d(e,"getHours",function(){return lt.a});var ut=n(161);n.d(e,"getISODay",function(){return ut.a});var ct=n(162);n.d(e,"getISOWeek",function(){return ct.a});var ht=n(34);n.d(e,"getISOWeekYear",function(){return ht.a});var dt=n(333);n.d(e,"getISOWeeksInYear",function(){return dt.a});var ft=n(334);n.d(e,"getMilliseconds",function(){return ft.a});var pt=n(335);n.d(e,"getMinutes",function(){return pt.a});var gt=n(336);n.d(e,"getMonth",function(){return gt.a});var mt=n(337);n.d(e,"getOverlappingDaysInIntervals",function(){return mt.a});var vt=n(141);n.d(e,"getQuarter",function(){return vt.a});var yt=n(338);n.d(e,"getSeconds",function(){return yt.a});var bt=n(163);n.d(e,"getTime",function(){return bt.a});var wt=n(339);n.d(e,"getUnixTime",function(){return wt.a});var _t=n(164);n.d(e,"getWeek",function(){return _t.a});var xt=n(340);n.d(e,"getWeekOfMonth",function(){return xt.a});var St=n(165);n.d(e,"getWeekYear",function(){return St.a});var Et=n(341);n.d(e,"getWeeksInMonth",function(){return Et.a});var Ct=n(342);n.d(e,"getYear",function(){return Ct.a});var Tt=n(343);n.d(e,"isAfter",function(){return Tt.a});var Mt=n(344);n.d(e,"isBefore",function(){return Mt.a});var Pt=n(345);n.d(e,"isDate",function(){return Pt.a});var Lt=n(346);n.d(e,"isEqual",function(){return Lt.a});var At=n(347);n.d(e,"isFirstDayOfMonth",function(){return At.a});var kt=n(348);n.d(e,"isFriday",function(){return kt.a});var Ot=n(349);n.d(e,"isLastDayOfMonth",function(){return Ot.a});var Rt=n(160);n.d(e,"isLeapYear",function(){return Rt.a});var Dt=n(350);n.d(e,"isMonday",function(){return Dt.a});var jt=n(351);n.d(e,"isSameDay",function(){return jt.a});var zt=n(352);n.d(e,"isSameHour",function(){return zt.a});var Nt=n(353);n.d(e,"isSameISOWeek",function(){return Nt.a});var It=n(354);n.d(e,"isSameISOWeekYear",function(){return It.a});var Ft=n(355);n.d(e,"isSameMinute",function(){return Ft.a});var Ht=n(356);n.d(e,"isSameMonth",function(){return Ht.a});var Gt=n(357);n.d(e,"isSameQuarter",function(){return Gt.a});var Vt=n(358);n.d(e,"isSameSecond",function(){return Vt.a});var Bt=n(168);n.d(e,"isSameWeek",function(){return Bt.a});var Ut=n(359);n.d(e,"isSameYear",function(){return Ut.a});var Wt=n(360);n.d(e,"isSaturday",function(){return Wt.a});var qt=n(147);n.d(e,"isSunday",function(){return qt.a});var Yt=n(361);n.d(e,"isThursday",function(){return Yt.a});var Xt=n(362);n.d(e,"isTuesday",function(){return Xt.a});var Zt=n(153);n.d(e,"isValid",function(){return Zt.a});var Qt=n(363);n.d(e,"isWednesday",function(){return Qt.a});var Kt=n(148);n.d(e,"isWeekend",function(){return Kt.a});var $t=n(364);n.d(e,"isWithinInterval",function(){return $t.a});var Jt=n(365);n.d(e,"lastDayOfDecade",function(){return Jt.a});var te=n(366);n.d(e,"lastDayOfISOWeek",function(){return te.a});var ee=n(367);n.d(e,"lastDayOfISOWeekYear",function(){return ee.a});var ne=n(166);n.d(e,"lastDayOfMonth",function(){return ne.a});var ie=n(368);n.d(e,"lastDayOfQuarter",function(){return ie.a});var oe=n(172);n.d(e,"lastDayOfWeek",function(){return oe.a});var re=n(369);n.d(e,"lastDayOfYear",function(){return re.a});var ae=n(370);n.d(e,"max",function(){return ae.a});var se=n(371);n.d(e,"min",function(){return se.a});var le=n(372);n.d(e,"parse",function(){return le.a});var ue=n(378);n.d(e,"roundToNearestMinutes",function(){return ue.a});var ce=n(379);n.d(e,"setDate",function(){return ce.a});var he=n(380);n.d(e,"setDay",function(){return he.a});var de=n(381);n.d(e,"setDayOfYear",function(){return de.a});var fe=n(382);n.d(e,"setHours",function(){return fe.a});var pe=n(383);n.d(e,"setISODay",function(){return pe.a});var ge=n(384);n.d(e,"setISOWeek",function(){return ge.a});var me=n(134);n.d(e,"setISOWeekYear",function(){return me.a});var ve=n(385);n.d(e,"setMilliseconds",function(){return ve.a});var ye=n(386);n.d(e,"setMinutes",function(){return ye.a});var be=n(173);n.d(e,"setMonth",function(){return be.a});var we=n(387);n.d(e,"setQuarter",function(){return we.a});var _e=n(388);n.d(e,"setSeconds",function(){return _e.a});var xe=n(389);n.d(e,"setWeek",function(){return xe.a});var Se=n(390);n.d(e,"setWeekYear",function(){return Se.a});var Ee=n(391);n.d(e,"setYear",function(){return Ee.a});var Ce=n(90);n.d(e,"startOfDay",function(){return Ce.a});var Te=n(392);n.d(e,"startOfDecade",function(){return Te.a});var Me=n(167);n.d(e,"startOfHour",function(){return Me.a});var Pe=n(27);n.d(e,"startOfISOWeek",function(){return Pe.a});var Le=n(49);n.d(e,"startOfISOWeekYear",function(){return Le.a});var Ae=n(169);n.d(e,"startOfMinute",function(){return Ae.a});var ke=n(61);n.d(e,"startOfMonth",function(){return ke.a});var Oe=n(170);n.d(e,"startOfQuarter",function(){return Oe.a});var Re=n(171);n.d(e,"startOfSecond",function(){return Re.a});var De=n(22);n.d(e,"startOfWeek",function(){return De.a});var je=n(98);n.d(e,"startOfWeekYear",function(){return je.a});var ze=n(96);n.d(e,"startOfYear",function(){return ze.a});var Ne=n(393);n.d(e,"subDays",function(){return Ne.a});var Ie=n(394);n.d(e,"subHours",function(){return Ie.a});var Fe=n(145);n.d(e,"subISOWeekYears",function(){return Fe.a});var He=n(64);n.d(e,"subMilliseconds",function(){return He.a});var Ge=n(395);n.d(e,"subMinutes",function(){return Ge.a});var Ve=n(396);n.d(e,"subMonths",function(){return Ve.a});var Be=n(397);n.d(e,"subQuarters",function(){return Be.a});var Ue=n(398);n.d(e,"subSeconds",function(){return Ue.a});var We=n(399);n.d(e,"subWeeks",function(){return We.a});var qe=n(400);n.d(e,"subYears",function(){return qe.a});var Ye=n(0);n.d(e,"toDate",function(){return Ye.a})},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=t||{},r=e||{},a=Object(i.a)(o.start,n).getTime(),s=Object(i.a)(o.end,n).getTime(),l=Object(i.a)(r.start,n).getTime(),u=Object(i.a)(r.end,n).getTime();if(!(a<=s&&l<=u))throw new RangeError("Invalid interval");return a<u&&l<s};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n);if(isNaN(o))return NaN;var r,a,s,l=o.getTime();r=null==e?[]:"function"==typeof e.forEach?e:Array.prototype.slice.call(e);return r.forEach(function(t,e){var o=Object(i.a)(t,n);if(isNaN(o))return a=NaN,void(s=NaN);var r=Math.abs(l-o.getTime());(null==a||r<s)&&(a=e,s=r)}),a};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n);if(isNaN(o))return new Date(NaN);var r,a,s,l=o.getTime();r=null==e?[]:"function"==typeof e.forEach?e:Array.prototype.slice.call(e);return r.forEach(function(t){var e=Object(i.a)(t,n);if(isNaN(e))return a=new Date(NaN),void(s=NaN);var o=Math.abs(l-e.getTime());(null==a||o<s)&&(a=e,s=o)}),a};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n),a=o.getTime()-r.getTime();return a>0?-1:a<0?1:a};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(o.a)(e,n),l=a.getTime()-Object(i.a)(a),u=s.getTime()-Object(i.a)(s);return Math.round((l-u)/r)};var i=n(19),o=n(27),r=6048e5},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n),a=Object(o.a)(e,n),s=r.getFullYear()-a.getFullYear(),l=Object(i.a)(r,n)-Object(i.a)(a,n);return 4*s+l};var i=n(141),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t,e,n)/o;return r>0?Math.floor(r):Math.ceil(r)};var i=n(60),o=36e5},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var s=Object(i.a)(t,n),l=Object(i.a)(e,n),u=Object(r.a)(s,l,n),c=Math.abs(Object(o.a)(s,l,n));s=Object(a.a)(s,u*c,n);var h=Object(r.a)(s,l,n)===-u,d=u*(c-h);return 0===d?0:d};var i=n(0),o=n(139),r=n(28),a=n(145)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t,e,n)/o;return r>0?Math.floor(r):Math.ceil(r)};var i=n(60),o=6e4},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,e,n)/3;return o>0?Math.floor(o):Math.ceil(o)};var i=n(92)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,e,n)/7;return o>0?Math.floor(o):Math.ceil(o)};var i=n(144)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(i.a)(t,n),s=Object(i.a)(e,n),l=Object(r.a)(a,s,n),u=Math.abs(Object(o.a)(a,s,n));a.setFullYear(a.getFullYear()-l*u);var c=Object(r.a)(a,s,n)===-l,h=l*(u-c);return 0===h?0:h};var i=n(0),o=n(143),r=n(28)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=t||{},a=Object(i.a)(n.start,e),s=Object(i.a)(n.end,e),l=s.getTime();if(!(a.getTime()<=l))throw new RangeError("Invalid interval");var u=Object(o.a)(a,e),c=Object(o.a)(s,e);u.setHours(15),c.setHours(15),l=c.getTime();var h=[],d=u;for(;d.getTime()<=l;)d.setHours(0),h.push(Object(i.a)(d,e)),(d=Object(r.a)(d,1)).setHours(15);return h};var i=n(0),o=n(22),r=n(59)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 arguments required, but only "+arguments.length+" present");var n=Object(o.a)(t,e),a=Object(r.a)(t,e);return Object(i.a)({start:n,end:a})};var i=n(94),o=n(61),r=n(95)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 arguments required, but only "+arguments.length+" present");var n=Object(o.a)(t,e),a=Object(r.a)(t,e);return Object(i.a)({start:n,end:a})};var i=n(94),o=n(96),r=n(149)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getFullYear(),r=9+10*Math.floor(o/10);return n.setFullYear(r,11,31),n.setHours(23,59,59,999),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return n.setMinutes(59,59,999),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(o.a)(e);return n.weekStartsOn=1,Object(i.a)(t,n)};var i=n(151),o=n(35)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var a=Object(o.a)(r,e);return a.setMilliseconds(a.getMilliseconds()-1),a};var i=n(34),o=n(27)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return n.setSeconds(59,999),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getMonth(),r=o-o%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return n.setMilliseconds(999),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){var o;n=n||{},o="string"==typeof i[t]?i[t]:1===e?i[t].one:i[t].other.replace("{{count}}",e);if(n.addSuffix)return n.comparison>0?"in "+o:o+" ago";return o};var i={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}}},function(t,e,n){"use strict";var i=n(313),o={date:Object(i.a)({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Object(i.a)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Object(i.a)({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};e.a=o},function(t,e,n){"use strict";e.a=function(t){return function(e){var n=e||{},i=n.width?String(n.width):t.defaultWidth,o=t.formats[i]||t.formats[t.defaultWidth];return o}}},function(t,e,n){"use strict";e.a=function(t,e,n,o){return i[t]};var i={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"}},function(t,e,n){"use strict";var i=n(316);var o={ordinalNumber:function(t,e){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Object(i.a)({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Object(i.a)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return Number(t)-1}}),month:Object(i.a)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Object(i.a)({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Object(i.a)({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaulFormattingWidth:"wide"})};e.a=o},function(t,e,n){"use strict";e.a=function(t){return function(e,n){var i,o=n||{},r=o.width?String(o.width):t.defaultWidth,a=o.context?String(o.context):"standalone";i="formatting"===a&&t.formattingValues?t.formattingValues[r]||t.formattingValues[t.defaultFormattingWidth]:t.values[r]||t.values[t.defaultWidth];var s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}},function(t,e,n){"use strict";var i=n(318),o=n(319),r={ordinalNumber:Object(i.a)({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}}),era:Object(o.a)({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Object(o.a)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Object(o.a)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Object(o.a)({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Object(o.a)({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};e.a=r},function(t,e,n){"use strict";e.a=function(t){return function(e,n){var i=String(e),o=n||{},r=i.match(t.matchPattern);if(!r)return null;var a=r[0],s=i.match(t.parsePattern);if(!s)return null;var l=t.valueCallback?t.valueCallback(s[0]):s[0];return{value:l=o.valueCallback?o.valueCallback(l):l,rest:i.slice(a.length)}}}},function(t,e,n){"use strict";e.a=function(t){return function(e,n){var i=String(e),o=n||{},r=o.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=i.match(a);if(!s)return null;var l,u=s[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth];return l="[object Array]"===Object.prototype.toString.call(c)?c.findIndex(function(t){return t.test(i)}):function(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}(c,function(t){return t.test(i)}),l=t.valueCallback?t.valueCallback(l):l,{value:l=o.valueCallback?o.valueCallback(l):l,rest:i.slice(u.length)}}}},function(t,e,n){"use strict";var i=n(321),o=n(154),r=n(155),a=n(156),s=n(97),l="midnight",u="noon",c="morning",h="afternoon",d="evening",f="night",p={G:function(t,e,n){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n,i){var o=t.getUTCFullYear(),r=o>0?o:1-o;return"yy"===e?g(r%100,2):"yo"===e?n.ordinalNumber(r,{unit:"year"}):g(r,e.length)},Y:function(t,e,n,i){var o=Object(s.a)(t,i),r=o>0?o:1-o;return"YY"===e?g(r%100,2):"Yo"===e?n.ordinalNumber(r,{unit:"year"}):g(r,e.length)},R:function(t,e,n,i){return g(Object(r.a)(t,i),e.length)},u:function(t,e,n,i){return g(t.getUTCFullYear(),e.length)},Q:function(t,e,n,i){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return g(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,n,i){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return g(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,n,i){var o=t.getUTCMonth();switch(e){case"M":return String(o+1);case"MM":return g(o+1,2);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,n,i){var o=t.getUTCMonth();switch(e){case"L":return String(o+1);case"LL":return g(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){var o=Object(a.a)(t,i);return"wo"===e?n.ordinalNumber(o,{unit:"week"}):g(o,e.length)},I:function(t,e,n,i){var r=Object(o.a)(t,i);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):g(r,e.length)},d:function(t,e,n,i){var o=t.getUTCDate();return"do"===e?n.ordinalNumber(o,{unit:"date"}):g(o,e.length)},D:function(t,e,n,o){var r=Object(i.a)(t,o);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):g(r,e.length)},E:function(t,e,n,i){var o=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});case"EEEE":default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){var o=t.getUTCDay(),r=(o-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return g(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){var o=t.getUTCDay(),r=(o-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return g(r,e.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,n,i){var o=t.getUTCDay(),r=0===o?7:o;switch(e){case"i":return String(r);case"ii":return g(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});case"iiii":default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,n){var i=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){var i,o=t.getUTCHours();switch(i=12===o?u:0===o?l:o/12>=1?"pm":"am",e){case"b":case"bb":case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){var i,o=t.getUTCHours();switch(i=o>=17?d:o>=12?h:o>=4?c:f,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n,i){var o=t.getUTCHours()%12;return 0===o&&(o=12),"ho"===e?n.ordinalNumber(o,{unit:"hour"}):g(o,e.length)},H:function(t,e,n,i){var o=t.getUTCHours();return"Ho"===e?n.ordinalNumber(o,{unit:"hour"}):g(o,e.length)},K:function(t,e,n,i){var o=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(o,{unit:"hour"}):g(o,e.length)},k:function(t,e,n,i){var o=t.getUTCHours();return 0===o&&(o=24),"ko"===e?n.ordinalNumber(o,{unit:"hour"}):g(o,e.length)},m:function(t,e,n,i){var o=t.getUTCMinutes();return"mo"===e?n.ordinalNumber(o,{unit:"minute"}):g(o,e.length)},s:function(t,e,n,i){var o=t.getUTCSeconds();return"so"===e?n.ordinalNumber(o,{unit:"second"}):g(o,e.length)},S:function(t,e,n,i){var o=e.length,r=t.getUTCMilliseconds();return g(Math.floor(r*Math.pow(10,o-3)),o)},X:function(t,e,n,i){var o=(i._originalDate||t).getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return v(o);case"XXXX":case"XX":return m(o);case"XXXXX":case"XXX":default:return m(o,":")}},x:function(t,e,n,i){var o=(i._originalDate||t).getTimezoneOffset();switch(e){case"x":return v(o);case"xxxx":case"xx":return m(o);case"xxxxx":case"xxx":default:return m(o,":")}},O:function(t,e,n,i){var o=(i._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+y(o,":");case"OOOO":default:return"GMT"+m(o,":")}},z:function(t,e,n,i){var o=(i._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+y(o,":");case"zzzz":default:return"GMT"+m(o,":")}},t:function(t,e,n,i){var o=i._originalDate||t;return g(Math.floor(o.getTime()/1e3),e.length)},T:function(t,e,n,i){return g((i._originalDate||t).getTime(),e.length)}};function g(t,e){for(var n=t<0?"-":"",i=Math.abs(t).toString();i.length<e;)i="0"+i;return n+i}function m(t,e){var n=e||"",i=t>0?"-":"+",o=Math.abs(t);return i+g(Math.floor(o/60),2)+n+g(o%60,2)}function v(t,e){return t%60==0?(t>0?"-":"+")+g(Math.abs(t)/60,2):m(t,e)}function y(t,e){var n=t>0?"-":"+",i=Math.abs(t),o=Math.floor(i/60),r=i%60;if(0===r)return n+String(o);var a=e||"";return n+String(o)+a+g(r,2)}e.a=p},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),r=n.getTime();n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0);var a=n.getTime(),s=r-a;return Math.floor(s/o)+1};var i=n(0),o=864e5},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),r=new Date(0);return r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0),Object(o.a)(r,e)};var i=n(155),o=n(62)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=e||{},a=n.locale,s=a&&a.options&&a.options.firstWeekContainsDate,l=null==s?1:Object(i.a)(s),u=null==n.firstWeekContainsDate?l:Object(i.a)(n.firstWeekContainsDate),c=Object(o.a)(t,e),h=new Date(0);return h.setUTCFullYear(c,0,u),h.setUTCHours(0,0,0,0),Object(r.a)(h,e)};var i=n(1),o=n(97),r=n(63)},function(t,e,n){"use strict";function i(t,e,n){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}function o(t,e,n){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}var r={p:o,P:function(t,e,n){var r,a=t.match(/(P+)(p+)?/),s=a[1],l=a[2];if(!l)return i(t,e);switch(s){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"})}return r.replace("{{date}}",i(s,e)).replace("{{time}}",o(l,e))}};e.a=r},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var p=n||{},g=p.locale||u.a;if(!g.formatDistance)throw new RangeError("locale must contain formatDistance property");var m=Object(o.a)(t,e,p);if(isNaN(m))return"Invalid Date";var v,y,b=Object(l.a)(p);b.addSuffix=Boolean(p.addSuffix),b.comparison=m,m>0?(v=Object(r.a)(e,p),y=Object(r.a)(t,p)):(v=Object(r.a)(t,p),y=Object(r.a)(e,p));var w,_=Object(a.a)(y,v,p),x=(Object(i.a)(y)-Object(i.a)(v))/1e3,S=Math.round((_-x)/60);if(S<2)return p.includeSeconds?_<5?g.formatDistance("lessThanXSeconds",5,b):_<10?g.formatDistance("lessThanXSeconds",10,b):_<20?g.formatDistance("lessThanXSeconds",20,b):_<40?g.formatDistance("halfAMinute",null,b):_<60?g.formatDistance("lessThanXMinutes",1,b):g.formatDistance("xMinutes",1,b):0===S?g.formatDistance("lessThanXMinutes",1,b):g.formatDistance("xMinutes",S,b);if(S<45)return g.formatDistance("xMinutes",S,b);if(S<90)return g.formatDistance("aboutXHours",1,b);if(S<c){var E=Math.round(S/60);return g.formatDistance("aboutXHours",E,b)}if(S<h)return g.formatDistance("xDays",1,b);if(S<d){var C=Math.round(S/c);return g.formatDistance("xDays",C,b)}if(S<f)return w=Math.round(S/d),g.formatDistance("aboutXMonths",w,b);if((w=Object(s.a)(y,v,p))<12){var T=Math.round(S/d);return g.formatDistance("xMonths",T,b)}var M=w%12,P=Math.floor(w/12);return M<3?g.formatDistance("aboutXYears",P,b):M<9?g.formatDistance("overXYears",P,b):g.formatDistance("almostXYears",P+1,b)};var i=n(19),o=n(28),r=n(0),a=n(93),s=n(92),l=n(35),u=n(50),c=1440,h=2520,d=43200,f=86400},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var d=n||{},f=d.locale||l.a;if(!f.formatDistance)throw new RangeError("locale must contain localize.formatDistance property");var p=Object(o.a)(t,e,d);if(isNaN(p))return"Invalid Date";var g,m,v=Object(s.a)(d);v.addSuffix=Boolean(d.addSuffix),v.comparison=p,p>0?(g=Object(r.a)(e,d),m=Object(r.a)(t,d)):(g=Object(r.a)(t,d),m=Object(r.a)(e,d));var y,b=null==d.roundingMethod?"round":String(d.roundingMethod);if("floor"===b)y=Math.floor;else if("ceil"===b)y=Math.ceil;else{if("round"!==b)throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");y=Math.round}var w,_=Object(a.a)(m,g,n),x=(Object(i.a)(m)-Object(i.a)(g))/1e3,S=y((_-x)/60);w=null==d.unit?S<1?"second":S<60?"minute":S<u?"hour":S<c?"day":S<h?"month":"year":String(d.unit);if("second"===w)return f.formatDistance("xSeconds",_,v);if("minute"===w)return f.formatDistance("xMinutes",S,v);if("hour"===w){var E=y(S/60);return f.formatDistance("xHours",E,v)}if("day"===w){var C=y(S/u);return f.formatDistance("xDays",C,v)}if("month"===w){var T=y(S/c);return f.formatDistance("xMonths",T,v)}if("year"===w){var M=y(S/h);return f.formatDistance("xYears",M,v)}throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'")};var i=n(19),o=n(28),r=n(0),a=n(93),s=n(35),l=n(50),u=1440,c=43200,h=525600},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var u=Object(o.a)(t,n),c=Object(o.a)(e,n),h=n||{},d=h.locale||s.a;if(!d.localize)throw new RangeError("locale must contain localize property");if(!d.formatLong)throw new RangeError("locale must contain formatLong property");if(!d.formatRelative)throw new RangeError("locale must contain formatRelative property");var f,p=Object(a.a)(u,c,h);if(isNaN(p))return"Invalid Date";f=p<-6?"other":p<-1?"lastWeek":p<0?"yesterday":p<1?"today":p<2?"tomorrow":p<7?"nextWeek":"other";var g=Object(l.a)(u,Object(i.a)(u),h),m=Object(l.a)(c,Object(i.a)(c),h),v=d.formatRelative(f,g,m,h);return Object(r.a)(u,v,h)};var i=n(19),o=n(0),r=n(152),a=n(36),s=n(50),l=n(64)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(o.a)(t);return Object(i.a)(1e3*n,e)};var i=n(0),o=n(1)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return Object(r.a)(n,Object(o.a)(n,e),e)+1};var i=n(0),o=n(96),r=n(36)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);if(isNaN(n))return NaN;return Object(o.a)(n,e)?366:365};var i=n(0),o=n(160)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e).getFullYear();return 10*Math.floor(n/10)};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(t,e).getHours()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),a=Object(i.a)(Object(o.a)(n,60,e),e).valueOf()-n.valueOf();return Math.round(a/r)};var i=n(49),o=n(59),r=6048e5},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(t,e).getMilliseconds()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(t,e).getMinutes()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(t,e).getMonth()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=t||{},a=e||{},s=Object(i.a)(r.start,n).getTime(),l=Object(i.a)(r.end,n).getTime(),u=Object(i.a)(a.start,n).getTime(),c=Object(i.a)(a.end,n).getTime();if(!(s<=l&&u<=c))throw new RangeError("Invalid interval");if(!(s<c&&u<l))return 0;var h=(c>l?l:c)-(u<s?s:u);return Math.ceil(h/o)};var i=n(0),o=864e5},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(t,e).getSeconds()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Math.floor(Object(i.a)(t,e)/1e3)};var i=n(163)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=e||{},s=n.locale,l=s&&s.options&&s.options.weekStartsOn,u=null==l?0:Object(i.a)(l),c=null==n.weekStartsOn?u:Object(i.a)(n.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Object(a.a)(Object(r.a)(t,e),e),d=Object(a.a)(t,e),f=(h<c?7-c:h)>d?7-c:0;return Math.ceil((Object(o.a)(t,e)+f)/7)};var i=n(1),o=n(158),r=n(61),a=n(159)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(Object(o.a)(t,e),Object(r.a)(t,e),e)+1};var i=n(142),o=n(166),r=n(61)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Object(i.a)(t,e).getFullYear()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()>r.getTime()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()<r.getTime()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()===r.getTime()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 1===Object(i.a)(t,e).getDate()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 5===Object(i.a)(t,e).getDay()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e);return Object(o.a)(n,e).getTime()===Object(r.a)(n,e).getTime()};var i=n(0),o=n(150),r=n(95)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 1===Object(i.a)(t,e).getDay()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()===r.getTime()};var i=n(90)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()===r.getTime()};var i=n(167)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(n);return r.weekStartsOn=1,Object(i.a)(t,e,r)};var i=n(168),o=n(35)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()===r.getTime()};var i=n(49)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()===r.getTime()};var i=n(169)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getFullYear()===r.getFullYear()&&o.getMonth()===r.getMonth()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()===r.getTime()};var i=n(170)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getTime()===r.getTime()};var i=n(171)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=Object(i.a)(t,n),r=Object(i.a)(e,n);return o.getFullYear()===r.getFullYear()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 6===Object(i.a)(t,e).getDay()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 4===Object(i.a)(t,e).getDay()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 2===Object(i.a)(t,e).getDay()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 3===Object(i.a)(t,e).getDay()};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=e||{},r=Object(i.a)(t,n).getTime(),a=Object(i.a)(o.start,n).getTime(),s=Object(i.a)(o.end,n).getTime();if(!(a<=s))throw new RangeError("Invalid interval");return r>=a&&r<=s};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getFullYear(),r=9+10*Math.floor(o/10);return n.setFullYear(r+1,0,0),n.setHours(0,0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(o.a)(e);return n.weekStartsOn=1,Object(i.a)(t,n)};var i=n(172),o=n(35)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var a=Object(o.a)(r,e);return a.setDate(a.getDate()-1),a};var i=n(34),o=n(27)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getMonth(),r=o-o%3+3;return n.setMonth(r,0),n.setHours(0,0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(0,0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n,o;n=null==t?[]:"function"==typeof t.forEach?t:Array.prototype.slice.call(t);return n.forEach(function(t){var n=Object(i.a)(t,e);(void 0===o||o<n||isNaN(n))&&(o=n)}),o};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n,o;n=null==t?[]:"function"==typeof t.forEach?t:Array.prototype.slice.call(t);return n.forEach(function(t){var n=Object(i.a)(t,e);(void 0===o||o>n||isNaN(n))&&(o=n)}),o};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n,d){if(arguments.length<3)throw new TypeError("3 arguments required, but only "+arguments.length+" present");var f=String(t),v=String(e),y=d||{},b=y.locale||s.a;if(!b.match)throw new RangeError("locale must contain match property");var w=b.options&&b.options.firstWeekContainsDate,_=null==w?1:Object(i.a)(w),x=null==y.firstWeekContainsDate?_:Object(i.a)(y.firstWeekContainsDate);if(!(x>=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var S=b.options&&b.options.weekStartsOn,E=null==S?0:Object(i.a)(S),C=null==y.weekStartsOn?E:Object(i.a)(y.weekStartsOn);if(!(C>=0&&C<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===v)return""===f?Object(r.a)(n,y):new Date(NaN);var T,M={firstWeekContainsDate:x,weekStartsOn:C,locale:b},P=[{priority:c,set:g,index:0}],L=v.match(h);for(T=0;T<L.length;T++){var A=L[T];!y.awareOfUnicodeTokens&&Object(u.a)(A)&&Object(u.b)(A);var k=A[0],O=l.a[k];if(O){var R=O.parse(f,A,b.match,M);if(!R)return new Date(NaN);P.push({priority:O.priority,set:O.set,validate:O.validate,value:R.value,index:P.length}),f=R.rest}else{if("''"===A?A="'":"'"===k&&(A=m(A)),0!==f.indexOf(A))return new Date(NaN);f=f.slice(A.length)}}if(f.length>0&&p.test(f))return new Date(NaN);var D=P.map(function(t){return t.priority}).sort(function(t,e){return e-t}).filter(function(t,e,n){return n.indexOf(t)===e}).map(function(t){return P.filter(function(e){return e.priority===t}).reverse()}).map(function(t){return t[0]}),j=Object(r.a)(n,y);if(isNaN(j))return new Date(NaN);var z=Object(a.a)(j,Object(o.a)(j));for(T=0;T<D.length;T++){var N=D[T];if(N.validate&&!N.validate(z,N.value,M))return new Date(NaN);z=N.set(z,N.value,M)}return z};var i=n(1),o=n(19),r=n(0),a=n(64),s=n(50),l=n(373),u=n(157),c=20,h=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,d=/^'(.*?)'?$/,f=/''/g,p=/\S/;function g(t){var e=new Date(0);return e.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),e.setHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),e}function m(t){return t.match(d)[1].replace(f,"'")}},function(t,e,n){"use strict";var i=n(97),o=n(374),r=n(375),a=n(63),s=n(376),l=n(377),u=n(62),c=36e5,h=6e4,d=1e3,f={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},p=/^([+-])(\d{2})(\d{2})?|Z/,g=/^([+-])(\d{2})(\d{2})|Z/,m=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,v=/^([+-])(\d{2}):(\d{2})|Z/,y=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function b(t,e,n){var i=e.match(t);if(!i)return null;var o=parseInt(i[0],10);return{value:n?n(o):o,rest:e.slice(i[0].length)}}function w(t,e){var n=e.match(t);if(!n)return null;if("Z"===n[0])return{value:0,rest:e.slice(1)};var i="+"===n[1]?1:-1,o=n[2]?parseInt(n[2],10):0,r=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(o*c+r*h+a*d),rest:e.slice(n[0].length)}}function _(t,e){return b(f.anyDigitsSigned,t,e)}function x(t,e,n){switch(t){case 1:return b(f.singleDigit,e,n);case 2:return b(f.twoDigits,e,n);case 3:return b(f.threeDigits,e,n);case 4:return b(f.fourDigits,e,n);default:return b(new RegExp("^\\d{1,"+t+"}"),e,n)}}function S(t,e,n){switch(t){case 1:return b(f.singleDigitSigned,e,n);case 2:return b(f.twoDigitsSigned,e,n);case 3:return b(f.threeDigitsSigned,e,n);case 4:return b(f.fourDigitsSigned,e,n);default:return b(new RegExp("^-?\\d{1,"+t+"}"),e,n)}}function E(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function C(t,e){var n,i=e>0,o=i?e:1-e;if(o<=50)n=t||100;else{var r=o+50;n=t+100*Math.floor(r/100)-(t>=r%100?100:0)}return i?n:1-n}var T=[31,28,31,30,31,30,31,31,30,31,30,31],M=[31,29,31,30,31,30,31,31,30,31,30,31];function P(t){return t%400==0||t%4==0&&t%100!=0}var L={G:{priority:140,parse:function(t,e,n,i){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});case"GGGG":default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}},set:function(t,e,n){return t.setUTCFullYear(1===e?10:-9,0,1),t.setUTCHours(0,0,0,0),t}},y:{priority:130,parse:function(t,e,n,i){var o=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return x(4,t,o);case"yo":return n.ordinalNumber(t,{unit:"year",valueCallback:o});default:return x(e.length,t,o)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n){var o=Object(i.a)(t,n);if(e.isTwoDigitYear){var r=C(e.year,o);return t.setUTCFullYear(r,0,1),t.setUTCHours(0,0,0,0),t}var a=o>0?e.year:1-e.year;return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t}},Y:{priority:130,parse:function(t,e,n,i){var o=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return x(4,t,o);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:o});default:return x(e.length,t,o)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n){var i=t.getUTCFullYear();if(e.isTwoDigitYear){var o=C(e.year,i);return t.setUTCFullYear(o,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),Object(a.a)(t,n)}var r=i>0?e.year:1-e.year;return t.setUTCFullYear(r,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),Object(a.a)(t,n)}},R:{priority:130,parse:function(t,e,n,i){return S("R"===e?4:e.length,t)},set:function(t,e,n){var i=new Date(0);return i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0),Object(u.a)(i)}},u:{priority:130,parse:function(t,e,n,i){return S("u"===e?4:e.length,t)},set:function(t,e,n){return t.setUTCFullYear(e,0,1),t.setUTCHours(0,0,0,0),t}},Q:{priority:120,parse:function(t,e,n,i){switch(e){case"Q":case"QQ":return x(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n){return t.setUTCMonth(3*(e-1),1),t.setUTCHours(0,0,0,0),t}},q:{priority:120,parse:function(t,e,n,i){switch(e){case"q":case"qq":return x(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n){return t.setUTCMonth(3*(e-1),1),t.setUTCHours(0,0,0,0),t}},M:{priority:110,parse:function(t,e,n,i){var o=function(t){return t-1};switch(e){case"M":return b(f.month,t,o);case"MM":return x(2,t,o);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:o});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n){return t.setUTCMonth(e,1),t.setUTCHours(0,0,0,0),t}},L:{priority:110,parse:function(t,e,n,i){var o=function(t){return t-1};switch(e){case"L":return b(f.month,t,o);case"LL":return x(2,t,o);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:o});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n){return t.setUTCMonth(e,1),t.setUTCHours(0,0,0,0),t}},w:{priority:100,parse:function(t,e,n,i){switch(e){case"w":return b(f.week,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return x(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n){return Object(a.a)(Object(r.a)(t,e,n),n)}},I:{priority:100,parse:function(t,e,n,i){switch(e){case"I":return b(f.week,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return x(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n){return Object(u.a)(Object(l.a)(t,e,n),n)}},d:{priority:90,parse:function(t,e,n,i){switch(e){case"d":return b(f.date,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return x(e.length,t)}},validate:function(t,e,n){var i=P(t.getUTCFullYear()),o=t.getUTCMonth();return i?e>=1&&e<=M[o]:e>=1&&e<=T[o]},set:function(t,e,n){return t.setUTCDate(e),t.setUTCHours(0,0,0,0),t}},D:{priority:90,parse:function(t,e,n,i){switch(e){case"D":case"DD":return b(f.dayOfYear,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return x(e.length,t)}},validate:function(t,e,n){return P(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n){return t.setUTCMonth(0,e),t.setUTCHours(0,0,0,0),t}},E:{priority:90,parse:function(t,e,n,i){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n){return(t=Object(o.a)(t,e,n)).setUTCHours(0,0,0,0),t}},e:{priority:90,parse:function(t,e,n,i){var o=function(t){var e=7*Math.floor((t-1)/7);return(t+i.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return x(e.length,t,o);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:o});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n){return(t=Object(o.a)(t,e,n)).setUTCHours(0,0,0,0),t}},c:{priority:90,parse:function(t,e,n,i){var o=function(t){var e=7*Math.floor((t-1)/7);return(t+i.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return x(e.length,t,o);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:o});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n){return(t=Object(o.a)(t,e,n)).setUTCHours(0,0,0,0),t}},i:{priority:90,parse:function(t,e,n,i){var o=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return x(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:o})||n.day(t,{width:"short",context:"formatting",valueCallback:o})||n.day(t,{width:"narrow",context:"formatting",valueCallback:o});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:o});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:o})||n.day(t,{width:"narrow",context:"formatting",valueCallback:o});case"iiii":default:return n.day(t,{width:"wide",context:"formatting",valueCallback:o})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:o})||n.day(t,{width:"short",context:"formatting",valueCallback:o})||n.day(t,{width:"narrow",context:"formatting",valueCallback:o})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n){return(t=Object(s.a)(t,e,n)).setUTCHours(0,0,0,0),t}},a:{priority:80,parse:function(t,e,n,i){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n){return t.setUTCHours(E(e),0,0,0),t}},b:{priority:80,parse:function(t,e,n,i){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n){return t.setUTCHours(E(e),0,0,0),t}},B:{priority:80,parse:function(t,e,n,i){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n){return t.setUTCHours(E(e),0,0,0),t}},h:{priority:70,parse:function(t,e,n,i){switch(e){case"h":return b(f.hour12h,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return x(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=12},set:function(t,e,n){var i=t.getUTCHours()>=12;return i&&e<12?t.setUTCHours(e+12,0,0,0):i||12!==e?t.setUTCHours(e,0,0,0):t.setUTCHours(0,0,0,0),t}},H:{priority:70,parse:function(t,e,n,i){switch(e){case"H":return b(f.hour23h,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return x(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n){return t.setUTCHours(e,0,0,0),t}},K:{priority:70,parse:function(t,e,n,i){switch(e){case"K":return b(f.hour11h,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return x(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n){return t.getUTCHours()>=12&&e<12?t.setUTCHours(e+12,0,0,0):t.setUTCHours(e,0,0,0),t}},k:{priority:70,parse:function(t,e,n,i){switch(e){case"k":return b(f.hour24h,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return x(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n){var i=e<=24?e%24:e;return t.setUTCHours(i,0,0,0),t}},m:{priority:60,parse:function(t,e,n,i){switch(e){case"m":return b(f.minute,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return x(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n){return t.setUTCMinutes(e,0,0),t}},s:{priority:50,parse:function(t,e,n,i){switch(e){case"s":return b(f.second,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return x(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n){return t.setUTCSeconds(e,0),t}},S:{priority:40,parse:function(t,e,n,i){return x(e.length,t,function(t){return Math.floor(t*Math.pow(10,3-e.length))})},set:function(t,e,n){return t.setUTCMilliseconds(e),t}},X:{priority:20,parse:function(t,e,n,i){switch(e){case"X":return w(p,t);case"XX":return w(g,t);case"XXXX":return w(m,t);case"XXXXX":return w(y,t);case"XXX":default:return w(v,t)}},set:function(t,e,n){return new Date(t.getTime()-e)}},x:{priority:20,parse:function(t,e,n,i){switch(e){case"x":return w(p,t);case"xx":return w(g,t);case"xxxx":return w(m,t);case"xxxxx":return w(y,t);case"xxx":default:return w(v,t)}},set:function(t,e,n){return new Date(t.getTime()-e)}},t:{priority:10,parse:function(t,e,n,i){return _(t)},set:function(t,e,n){return new Date(1e3*e)}},T:{priority:10,parse:function(t,e,n,i){return _(t)},set:function(t,e,n){return new Date(e)}}};e.a=L},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=n||{},a=r.locale,s=a&&a.options&&a.options.weekStartsOn,l=null==s?0:Object(i.a)(s),u=null==r.weekStartsOn?l:Object(i.a)(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=Object(o.a)(t,n),h=Object(i.a)(e),d=c.getUTCDay(),f=((h%7+7)%7<u?7:0)+h-d;return c.setUTCDate(c.getUTCDate()+f),c};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(i.a)(e),l=Object(r.a)(a,n)-s;return a.setUTCDate(a.getUTCDate()-7*l),a};var i=n(1),o=n(0),r=n(156)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);r%7==0&&(r-=7);var a=Object(o.a)(t,n),s=a.getUTCDay(),l=((r%7+7)%7<1?7:0)+r-s;return a.setUTCDate(a.getUTCDate()+l),a};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(i.a)(e),l=Object(r.a)(a,n)-s;return a.setUTCDate(a.getUTCDate()-7*l),a};var i=n(1),o=n(0),r=n(154)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<1)throw new TypeError("1 argument required, but only none provided present");var r=1===arguments.length?1:Object(o.a)(e);2===arguments.length&&"number"!=typeof e&&"string"!=typeof e&&(n=e,r=1);if(!r||r>30||r<1)throw new RangeError("nearestTo must be between 1 and 30");var a=Object(i.a)(t,n),s=a.getSeconds(),l=a.getMinutes()+s/60,u=Math.floor(l/r)*r,c=l%r,h=Math.round(c/r)*r;return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),u+h)};var i=n(0),o=n(1)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n),a=Object(i.a)(e);return r.setDate(a),r};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=n||{},s=a.locale,l=s&&s.options&&s.options.weekStartsOn,u=null==l?0:Object(i.a)(l),c=null==a.weekStartsOn?u:Object(i.a)(a.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Object(o.a)(t,a),d=Object(i.a)(e),f=h.getDay(),p=((d%7+7)%7<c?7:0)+d-f;return Object(r.a)(h,p,a)};var i=n(1),o=n(0),r=n(47)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n),a=Object(i.a)(e);return r.setMonth(0),r.setDate(a),r};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n),a=Object(i.a)(e);return r.setHours(a),r};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var s=Object(o.a)(t,n),l=Object(i.a)(e),u=Object(a.a)(s,n),c=l-u;return Object(r.a)(s,c,n)};var i=n(1),o=n(0),r=n(47),a=n(161)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(i.a)(e),l=Object(r.a)(a,n)-s;return a.setDate(a.getDate()-7*l),a};var i=n(1),o=n(0),r=n(162)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n),a=Object(i.a)(e);return r.setMilliseconds(a),r};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n),a=Object(i.a)(e);return r.setMinutes(a),r};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(i.a)(e),l=Math.floor(a.getMonth()/3)+1,u=s-l;return Object(r.a)(a,a.getMonth()+3*u,n)};var i=n(1),o=n(0),r=n(173)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n),a=Object(i.a)(e);return r.setSeconds(a),r};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var a=Object(o.a)(t,n),s=Object(i.a)(e),l=Object(r.a)(a,n)-s;return a.setDate(a.getDate()-7*l),a};var i=n(1),o=n(0),r=n(164)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var s=n||{},l=s.locale,u=l&&l.options&&l.options.firstWeekContainsDate,c=null==u?1:Object(i.a)(u),h=null==s.firstWeekContainsDate?c:Object(i.a)(s.firstWeekContainsDate),d=Object(o.a)(t,n),f=Object(i.a)(e),p=Object(a.a)(d,Object(r.a)(d,n),n),g=new Date(0);return g.setFullYear(f,0,h),g.setHours(0,0,0,0),(d=Object(r.a)(g,n)).setDate(d.getDate()+p),d};var i=n(1),o=n(0),r=n(98),a=n(36)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(o.a)(t,n),a=Object(i.a)(e);if(isNaN(r))return new Date(NaN);return r.setFullYear(a),r};var i=n(1),o=n(0)},function(t,e,n){"use strict";e.a=function(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=Object(i.a)(t,e),o=n.getFullYear(),r=10*Math.floor(o/10);return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n};var i=n(0)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(47)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(132)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(135)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(58)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(136)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(137)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(59)},function(t,e,n){"use strict";e.a=function(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e);return Object(o.a)(t,-r,n)};var i=n(1),o=n(138)},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();e.__esModule=!0;var o=n(2),r=n(2),a=n(46),s=n(402),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={value:"",values:[],autofocus:!1},e.ref=null,e.setValueOnSuccess=function(t){void 0===t&&(t=e.state.values);var n=e.props,i=n.success;n.cancel;i(t)},e.handleDelete=function(t){var n=e.state.values.filter(function(e,n){return n!==t});e.setState({values:n},function(){e.setValueOnSuccess(n)})},e.handleAddition=function(t){var n=e.state.values;t.name&&(n.push({id:t.name,name:t.name}),e.setState({values:n},function(){e.setValueOnSuccess(n)}))},e.handleBlur=function(){var t=e.props.cancel,n=e.ref.input.input.value;if(n){var i=a.clone(e.state.values);i.push({id:n,name:n}),e.setValueOnSuccess(i)}else t();var o=r.findDOMNode(e.ref);o&&o.parentElement.parentElement.parentElement&&(o.parentElement.parentElement.parentElement.style.overflow="hidden")},e}return i(e,t),e.prototype.componentDidMount=function(){var t=this;this.props.onRendered(function(){var e=r.findDOMNode(t.ref);e.style.zIndex=1,e.parentElement.parentElement.parentElement.style.overflow="inherit",e.querySelector("input").focus();var n=(t.props.cell.getValue()||[]).map(function(t){return"string"==typeof t?{id:t,name:t}:t});t.setState({values:n})})},e.prototype.render=function(){var t=this,e=this.props.editorParams,n=this.state.values,i=e.values;return o.createElement("div",null,o.createElement(s,{ref:function(e){return t.ref=e},placeholder:"Select or Type",tags:n,suggestions:i,allowNew:!0,autoresize:!0,autofocus:this.state.autofocus,handleAddition:this.handleAddition,handleDelete:this.handleDelete,handleBlur:this.handleBlur,minQueryLength:0}))},e}(o.Component);e.default=function(t,e,n,i,a){var s=document.createElement("div");return s.style.height="100%",r.render(o.createElement(l,{cell:t,onRendered:e,success:n,cancel:i,editorParams:a}),s),s}},function(t,e,n){"use strict";var i=n(2),o=n(33),r=n(403),a=n(404),s=n(405),l=13,u=9,c=8,h=38,d=40,f={root:"react-tags",rootFocused:"is-focused",selected:"react-tags__selected",selectedTag:"react-tags__selected-tag",selectedTagName:"react-tags__selected-tag-name",search:"react-tags__search",searchInput:"react-tags__search-input",suggestions:"react-tags__suggestions",suggestionActive:"is-active",suggestionDisabled:"is-disabled"},p=function(t){function e(e){t.call(this,e),this.state={query:"",focused:!1,expandable:!1,selectedIndex:-1,classNames:Object.assign({},f,this.props.classNames)},this.inputEventHandlers={onChange:function(){},onBlur:this.handleBlur.bind(this),onFocus:this.handleFocus.bind(this),onInput:this.handleInput.bind(this),onKeyDown:this.handleKeyDown.bind(this)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.componentWillReceiveProps=function(t){this.setState({classNames:Object.assign({},f,t.classNames)})},e.prototype.handleInput=function(t){var e=t.target.value;this.props.handleInputChange&&this.props.handleInputChange(e),this.setState({query:e})},e.prototype.handleKeyDown=function(t){var e=this.state,n=e.query,i=e.selectedIndex,o=this.props,r=o.delimiters,a=o.delimiterChars;(r.indexOf(t.keyCode)>-1||a.indexOf(t.key)>-1)&&((n||i>-1)&&t.preventDefault(),this.handleDelimiter()),t.keyCode===c&&0===n.length&&this.props.allowBackspace&&this.deleteTag(this.props.tags.length-1),t.keyCode===h&&(t.preventDefault(),i<=0?this.setState({selectedIndex:this.suggestions.state.options.length-1}):this.setState({selectedIndex:i-1})),t.keyCode===d&&(t.preventDefault(),this.setState({selectedIndex:(i+1)%this.suggestions.state.options.length}))},e.prototype.handleDelimiter=function(){var t=this.state,e=t.query,n=t.selectedIndex;if(e.length>=this.props.minQueryLength){var i=this.suggestions.state.options.findIndex(function(t){return 0===t.name.search(new RegExp("^"+e+"$","i"))}),o=-1===n?i:n;o>-1?this.addTag(this.suggestions.state.options[o]):this.props.allowNew&&this.addTag({name:e})}},e.prototype.handleClick=function(t){document.activeElement!==t.target&&this.input.input.focus()},e.prototype.handleBlur=function(){this.setState({focused:!1,selectedIndex:-1}),this.props.handleBlur&&this.props.handleBlur(),this.props.addOnBlur&&this.handleDelimiter()},e.prototype.handleFocus=function(){this.setState({focused:!0}),this.props.handleFocus&&this.props.handleFocus()},e.prototype.addTag=function(t){t.disabled||("function"!=typeof this.props.handleValidate||this.props.handleValidate(t))&&(this.props.handleAddition(t),this.setState({query:"",selectedIndex:-1}))},e.prototype.deleteTag=function(t){this.props.handleDelete(t),this.setState({query:""})},e.prototype.render=function(){var t=this,e=this.props.tagComponent||r,n=this.props.tags.map(function(n,o){return i.createElement(e,{key:o,tag:n,classNames:t.state.classNames,onDelete:t.deleteTag.bind(t,o)})}),o=this.state.focused&&this.state.query.length>=this.props.minQueryLength,l=[this.state.classNames.root];return this.state.focused&&l.push(this.state.classNames.rootFocused),i.createElement("div",{className:l.join(" "),onClick:this.handleClick.bind(this)},i.createElement("div",{className:this.state.classNames.selected,"aria-live":"polite","aria-relevant":"additions removals"},n),i.createElement("div",{className:this.state.classNames.search},i.createElement(a,Object.assign({},this.state,{inputAttributes:this.props.inputAttributes,inputEventHandlers:this.inputEventHandlers,ref:function(e){t.input=e},listboxId:"ReactTags-listbox",autofocus:this.props.autofocus,autoresize:this.props.autoresize,expandable:o,placeholder:this.props.placeholder})),i.createElement(s,Object.assign({},this.state,{ref:function(e){t.suggestions=e},listboxId:"ReactTags-listbox",expandable:o,suggestions:this.props.suggestions,addTag:this.addTag.bind(this),maxSuggestionsLength:this.props.maxSuggestionsLength}))))},e}(i.Component);p.defaultProps={tags:[],placeholder:"Add new tag",suggestions:[],autofocus:!0,autoresize:!0,delimiters:[u,l],delimiterChars:[],minQueryLength:2,maxSuggestionsLength:6,allowNew:!1,allowBackspace:!0,tagComponent:null,inputAttributes:{},addOnBlur:!1},p.propTypes={tags:o.arrayOf(o.object),placeholder:o.string,suggestions:o.arrayOf(o.object),autofocus:o.bool,autoresize:o.bool,delimiters:o.arrayOf(o.number),delimiterChars:o.arrayOf(o.string),handleDelete:o.func.isRequired,handleAddition:o.func.isRequired,handleInputChange:o.func,handleFocus:o.func,handleBlur:o.func,handleValidate:o.func,minQueryLength:o.number,maxSuggestionsLength:o.number,classNames:o.object,allowNew:o.bool,allowBackspace:o.bool,tagComponent:o.oneOfType([o.func,o.element]),inputAttributes:o.object,addOnBlur:o.bool},t.exports=p},function(t,e,n){"use strict";var i=n(2);t.exports=function(t){return i.createElement("button",{type:"button",className:t.classNames.selectedTag,title:"Click to remove tag",onClick:t.onDelete},i.createElement("span",{className:t.classNames.selectedTagName},t.tag.name))}},function(t,e,n){"use strict";var i=n(2),o={position:"absolute",width:0,height:0,visibility:"hidden",overflow:"scroll",whiteSpace:"pre"},r=["fontSize","fontFamily","fontWeight","fontStyle","letterSpacing"],a=function(t){function e(e){t.call(this,e),this.state={inputWidth:null}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.componentDidMount=function(){this.props.autoresize&&(this.copyInputStyles(),this.updateInputWidth()),this.props.autofocus&&this.input.focus()},e.prototype.componentDidUpdate=function(){this.updateInputWidth()},e.prototype.copyInputStyles=function(){var t=this,e=window.getComputedStyle(this.input);r.forEach(function(n){t.sizer.style[n]=e[n]})},e.prototype.updateInputWidth=function(){var t;this.props.autoresize&&(t=Math.ceil(this.sizer.scrollWidth)+2),t!==this.state.inputWidth&&this.setState({inputWidth:t})},e.prototype.render=function(){var t=this,e=this.props,n=e.inputAttributes,r=e.inputEventHandlers,a=e.query,s=e.placeholder,l=e.expandable,u=e.listboxId,c=e.selectedIndex;return i.createElement("div",{className:this.props.classNames.searchInput},i.createElement("input",Object.assign({},n,r,{ref:function(e){t.input=e},value:a,placeholder:s,role:"combobox","aria-autocomplete":"list","aria-label":s,"aria-owns":u,"aria-activedescendant":c>-1?u+"-"+c:null,"aria-expanded":l,style:{width:this.state.inputWidth}})),i.createElement("div",{ref:function(e){t.sizer=e},style:o},a||s))},e}(i.Component);t.exports=a},function(t,e,n){"use strict";var i=n(2);function o(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")}function r(t,e,n){var i=new RegExp("(?:^|\\s)"+o(t),"i");return e.filter(function(t){return i.test(t.name)}).slice(0,n)}var a=function(t){function e(e){t.call(this,e),this.state={options:r(this.props.query,this.props.suggestions,this.props.maxSuggestionsLength)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.componentWillReceiveProps=function(t){this.setState({options:r(t.query,t.suggestions,t.maxSuggestionsLength)})},e.prototype.handleMouseDown=function(t,e){e.preventDefault(),this.props.addTag(t)},e.prototype.render=function(){var t=this;if(!this.props.expandable||!this.state.options.length)return null;var e=this.state.options.map(function(e,n){var r=t.props.listboxId+"-"+n,a=[];return t.props.selectedIndex===n&&a.push(t.props.classNames.suggestionActive),e.disabled&&a.push(t.props.classNames.suggestionDisabled),i.createElement("li",{id:r,key:r,role:"option",className:a.join(" "),"aria-disabled":!0===e.disabled,onMouseDown:t.handleMouseDown.bind(t,e)},i.createElement("span",{dangerouslySetInnerHTML:function(t,e){var n=RegExp(o(e),"gi");return{__html:t.replace(n,"<mark>$&</mark>")}}(e.name,t.props.query)}))});return i.createElement("div",{className:this.props.classNames.suggestions},i.createElement("ul",{role:"listbox",id:this.props.listboxId},e))},e}(i.Component);t.exports=a},function(t,e,n){"use strict";e.__esModule=!0;var i=n(2),o=n(2),r=function(){var t=document.createElement("div");return t.style.height="100%",t};e.default=function(t,e,n){var a=e.style||"",s=t.getValue()||[],l=s&&s.length>0&&"string"==typeof s[0]?i.createElement("span",null,s.join(", ")):i.createElement("span",null);"PILL"===a&&(l=i.createElement("div",null,s.map(function(t){return"string"==typeof t?i.createElement("span",{key:t},t):i.createElement("span",{key:t.name},t.name)})));var u=r();return u.className="multi-value-formatter-content",u.title=s&&s.length>0&&"string"==typeof s[0]?s.join(", "):"",o.render(l,u),u}},function(t,e,n){(function(n){var i,o,r;!function(n,a){o=[],void 0===(r="function"==typeof(i=a)?i.apply(e,o):i)||(t.exports=r)}(0,function(){"use strict";function e(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){a(i.response,e,n)},i.onerror=function(){console.error("could not download file")},i.send()}function i(t){var e=new XMLHttpRequest;return e.open("HEAD",t,!1),e.send(),200<=e.status&&299>=e.status}function o(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,a=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype?function(t,n,a){var s=r.URL||r.webkitURL,l=document.createElement("a");n=n||t.name||"download",l.download=n,l.rel="noopener","string"==typeof t?(l.href=t,l.origin===location.origin?o(l):i(l.href)?e(t,n,a):o(l,l.target="_blank")):(l.href=s.createObjectURL(t),setTimeout(function(){s.revokeObjectURL(l.href)},4e4),setTimeout(function(){o(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,n,r){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,r),n);else if(i(t))e(t,n,r);else{var a=document.createElement("a");a.href=t,a.target="_blank",setTimeout(function(){o(a)})}}:function(t,n,i,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,i);var a="application/octet-stream"===t.type,s=/constructor/i.test(r.HTMLElement)||r.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||a&&s)&&"object"==typeof FileReader){var u=new FileReader;u.onloadend=function(){var t=u.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location=t,o=null},u.readAsDataURL(t)}else{var c=r.URL||r.webkitURL,h=c.createObjectURL(t);o?o.location=h:location.href=h,o=null,setTimeout(function(){c.revokeObjectURL(h)},4e4)}});r.saveAs=a.saveAs=a,void 0!==t&&(t.exports=a)})}).call(e,n(119))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=f(n(45)),o=f(n(12)),r=f(n(7)),a=f(n(8)),s=f(n(13)),l=f(n(14)),u=n(2),c=f(u),h=n(11),d=n(51);function f(t){return t&&t.__esModule?t:{default:t}}var p=function(t){function e(){return(0,r.default)(this,e),(0,s.default)(this,(e.__proto__||(0,o.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,a.default)(e,[{key:"render",value:function(){var t=this.props,e=t.tag,n=t.sha256,o=t.verified,r=t.keyframes,a=void 0===r?{}:r,s=t.labels,l=t.summary,u=t.aspectRatio,f=void 0===u?1.777:u,p=t.showAll,g=0,m=(0,i.default)(a).map(function(t){return parseInt(t,10)}),v=m.sort(function(t,e){return t-e}).map(function(t){var e=a[t];return e.length||p?(g+=e.length,{frame:t,detections:e}):null}).filter(function(t){return!!t}),y=v.reduce(function(t,e){return e.detections.reduce(function(t,e){var n=e.idx;return n in t||(t[n]=[s[n],0]),t[n][1]+=1,t},t),t},{}),b=(0,i.default)(y).map(function(t){return y[t]}).sort(function(t,e){return e[1]-t[1]});return l?c.default.createElement("div",null,c.default.createElement("h3",null,e," Detections"),c.default.createElement(d.TableTuples,{list:b})):c.default.createElement("div",null,c.default.createElement("h2",null,e),c.default.createElement("h3",null,"Detections"),c.default.createElement(d.TableTuples,{list:b}),c.default.createElement("h3",null,"Frames"),c.default.createElement("ul",{className:"meta"},c.default.createElement("li",null,"Displaying ",v.length," / ",(0,h.courtesyS)(m.length,"frame")),c.default.createElement("li",null,(0,h.courtesyS)(g,"detection")," found")),c.default.createElement("div",{className:"thumbnails"},v.map(function(t){var e=t.frame,i=t.detections;return c.default.createElement(d.Keyframe,{key:e,sha256:n,frame:e,verified:o,size:"th",showFrame:!0,showTimestamp:!0,aspectRatio:f,detectionList:[{labels:s,detections:i}]},c.default.createElement(d.DetectionList,{labels:s,detections:i,width:160,height:90}))})))}}]),e}(u.Component);e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.detections,n=t.width,r=t.height;return e.map(function(t,e){var a=t.rect;return a&&i.default.createElement("div",{className:"rect",key:e,style:{left:(0,o.px)(a[0],n),top:(0,o.px)(a[1],r),width:(0,o.px)(a[2]-a[0],n),height:(0,o.px)(a[3]-a[1],r)}})})};var i=function(t){return t&&t.__esModule?t:{default:t}}(n(2)),o=n(11)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.detections,n=t.labels,o=t.tag,r=t.showEmpty;return i.default.createElement("span",{className:"detectionList"},o&&i.default.createElement("h3",null,o),!e.length&&r&&i.default.createElement("label",null,i.default.createElement("small",null,"No detections")),e.map(function(t,e){var o=t.idx,r=t.score;t.rect;return i.default.createElement("label",{key:e},i.default.createElement("small",{className:"title"},(n[o]||"Unknown").replace(/_/," ")),i.default.createElement("small",null,r.toFixed(2)))}))};var i=function(t){return t&&t.__esModule?t:{default:t}}(n(2))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return i.default.createElement(o.default,{config:{width:5,radius:20,color:"white"}})};var i=r(n(2)),o=r(n(412));function r(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";e.__esModule=!0;var i=r(n(2)),o=r(n(413));function r(t){return t&&t.__esModule?t:{default:t}}var a=i.default.createClass({displayName:"ReactSpinner",propTypes:{config:i.default.PropTypes.object,stopped:i.default.PropTypes.bool},componentDidMount:function(){this.spinner=new o.default(this.props.config),this.props.stopped||this.spinner.spin(this.refs.container)},componentWillReceiveProps:function(t){!0!==t.stopped||this.props.stopped?t.stopped||!0!==this.props.stopped||this.spinner.spin(this.refs.container):this.spinner.stop()},componentWillUnmount:function(){this.spinner.stop()},render:function(){return i.default.createElement("span",{ref:"container"})}});e.default=a},function(t,e,n){var i,o;!function(r,a){"object"==typeof t&&t.exports?t.exports=a():void 0===(o="function"==typeof(i=a)?i.call(e,n,e,t):i)||(t.exports=o)}(0,function(){"use strict";var t,e,n=["webkit","Moz","ms","O"],i={};function o(t,e){var n,i=document.createElement(t||"div");for(n in e)i[n]=e[n];return i}function r(t){for(var e=1,n=arguments.length;e<n;e++)t.appendChild(arguments[e]);return t}function a(n,o,r,a){var s=["opacity",o,~~(100*n),r,a].join("-"),l=.01+r/a*100,u=Math.max(1-(1-n)/o*(100-l),n),c=t.substring(0,t.indexOf("Animation")).toLowerCase(),h=c&&"-"+c+"-"||"";return i[s]||(e.insertRule("@"+h+"keyframes "+s+"{0%{opacity:"+u+"}"+l+"%{opacity:"+n+"}"+(l+.01)+"%{opacity:1}"+(l+o)%100+"%{opacity:"+n+"}100%{opacity:"+u+"}}",e.cssRules.length),i[s]=1),s}function s(t,e){var i,o,r=t.style;if(void 0!==r[e=e.charAt(0).toUpperCase()+e.slice(1)])return e;for(o=0;o<n.length;o++)if(void 0!==r[i=n[o]+e])return i}function l(t,e){for(var n in e)t.style[s(t,n)||n]=e[n];return t}function u(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)void 0===t[i]&&(t[i]=n[i])}return t}function c(t,e){return"string"==typeof t?t:t[e%t.length]}var h={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",opacity:.25,rotate:0,direction:1,speed:1,trail:100,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"absolute"};function d(t){this.opts=u(t||{},d.defaults,h)}if(d.defaults={},u(d.prototype,{spin:function(e){this.stop();var n=this,i=n.opts,r=n.el=o(null,{className:i.className});if(l(r,{position:i.position,width:0,zIndex:i.zIndex,left:i.left,top:i.top}),e&&e.insertBefore(r,e.firstChild||null),r.setAttribute("role","progressbar"),n.lines(r,n.opts),!t){var a,s=0,u=(i.lines-1)*(1-i.direction)/2,c=i.fps,h=c/i.speed,d=(1-i.opacity)/(h*i.trail/100),f=h/i.lines;!function t(){s++;for(var e=0;e<i.lines;e++)a=Math.max(1-(s+(i.lines-e)*f)%h*d,i.opacity),n.opacity(r,e*i.direction+u,a,i);n.timeout=n.el&&setTimeout(t,~~(1e3/c))}()}return n},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=void 0),this},lines:function(e,n){var i,s=0,u=(n.lines-1)*(1-n.direction)/2;function h(t,e){return l(o(),{position:"absolute",width:n.scale*(n.length+n.width)+"px",height:n.scale*n.width+"px",background:t,boxShadow:e,transformOrigin:"left",transform:"rotate("+~~(360/n.lines*s+n.rotate)+"deg) translate("+n.scale*n.radius+"px,0)",borderRadius:(n.corners*n.scale*n.width>>1)+"px"})}for(;s<n.lines;s++)i=l(o(),{position:"absolute",top:1+~(n.scale*n.width/2)+"px",transform:n.hwaccel?"translate3d(0,0,0)":"",opacity:n.opacity,animation:t&&a(n.opacity,n.trail,u+s*n.direction,n.lines)+" "+1/n.speed+"s linear infinite"}),n.shadow&&r(i,l(h("#000","0 0 4px #000"),{top:"2px"})),r(e,r(i,h(c(n.color,s),"0 0 1px rgba(0,0,0,.1)")));return e},opacity:function(t,e,n){e<t.childNodes.length&&(t.childNodes[e].style.opacity=n)}}),"undefined"!=typeof document){e=function(){var t=o("style",{type:"text/css"});return r(document.getElementsByTagName("head")[0],t),t.sheet||t.styleSheet}();var f=l(o("group"),{behavior:"url(#default#VML)"});!s(f,"transform")&&f.adj?function(){function t(t,e){return o("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',e)}e.addRule(".spin-vml","behavior:url(#default#VML)"),d.prototype.lines=function(e,n){var i=n.scale*(n.length+n.width),o=2*n.scale*i;function a(){return l(t("group",{coordsize:o+" "+o,coordorigin:-i+" "+-i}),{width:o,height:o})}var s,u=-(n.width+n.length)*n.scale*2+"px",h=l(a(),{position:"absolute",top:u,left:u});function d(e,o,s){r(h,r(l(a(),{rotation:360/n.lines*e+"deg",left:~~o}),r(l(t("roundrect",{arcsize:n.corners}),{width:i,height:n.scale*n.width,left:n.scale*n.radius,top:-n.scale*n.width>>1,filter:s}),t("fill",{color:c(n.color,e),opacity:n.opacity}),t("stroke",{opacity:0}))))}if(n.shadow)for(s=1;s<=n.lines;s++)d(s,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(s=1;s<=n.lines;s++)d(s);return r(e,h)},d.prototype.opacity=function(t,e,n,i){var o=t.firstChild;i=i.shadow&&i.lines||0,o&&e+i<o.childNodes.length&&(o=(o=(o=o.childNodes[e+i])&&o.firstChild)&&o.firstChild)&&(o.opacity=n)}}():t=s(f,"animation")}return d})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=h(n(12)),o=h(n(7)),r=h(n(8)),a=h(n(13)),s=h(n(14)),l=n(2),u=h(l),c=n(415);function h(t){return t&&t.__esModule?t:{default:t}}var d=function(t){function e(){return(0,o.default)(this,e),(0,a.default)(this,(e.__proto__||(0,i.default)(e)).apply(this,arguments))}return(0,s.default)(e,t),(0,r.default)(e,[{key:"upload",value:function(t){var e=this,n=t.dataTransfer?t.dataTransfer.files:t.target.files,i=void 0,o=void 0;for(i=0;i<n.length&&(!(o=n[i])||!o.type.match("image.*"));i++);if(o){var r=new FileReader;r.onload=function(t){r.onload=null;var n=new Image;n.onload=function(){n.onload=null,e.resizeAndUpload(n)},n.src=t.target.result},r.readAsDataURL(n[0])}}},{key:"resizeAndUpload",value:function(t){var e=this;(0,c.renderThumbnail)(t).toBlob(function(t){e.props.onUpload(t)},"image/jpeg",80)}},{key:"render",value:function(){return u.default.createElement("input",{type:"file",name:"img",accept:"image/*",onChange:this.upload.bind(this),required:!0})}}]),e}(l.Component);e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_SIDE=void 0,e.renderToCanvas=l,e.renderThumbnail=function(t){return l(t,{correctOrientation:!0})};var i=function(t){return t&&t.__esModule?t:{default:t}}(n(416));var o=e.MAX_SIDE=256;function r(t){var e=function(t,e,n){e=e||0,n=n||t.length;for(var i=atob(t),o=new Uint8Array(i.length),r=e;r<n;r++)o[r]=i.charCodeAt(r);return o}(t.split(",")[1],0,Math.pow(2,17));try{return i.default.load(e.buffer).Orientation}catch(t){return 1}}var a={1:{rotation:0,mirror:!1},2:{rotation:0,mirror:!0},3:{rotation:180,mirror:!1},4:{rotation:180,mirror:!0},5:{rotation:90,mirror:!0},6:{rotation:90,mirror:!1},7:{rotation:270,mirror:!0},8:{rotation:270,mirror:!1}};function s(t,e,n){var i=r(n);if(i&&1!==i){var o=a[i].rotation;(90===o||270===o)&&(t.width=t.height+t.width,t.height=t.width-t.height,t.width-=t.height),o>0&&function(t,e,n){var i=n*(Math.PI/180);90===n?e.translate(t.width,0):180===n?e.translate(t.width,t.height):270===n&&e.translate(0,t.height),e.rotate(i)}(t,e,o)}}function l(t,e){if(!t)return null;e=e||{};var n=o,i=document.createElement("canvas"),r=i.getContext("2d"),a=e.scale||1,l=function(t,e,n,i,o){function r(){return n/t}function a(){return i/e}if(o=!!o,t/e>n/i){if(o)return a();if(t>n)return r()}else{if(o)return r();if(e>i)return a()}return 1}(t.naturalWidth*a,t.naturalHeight*a,n,n,!0);l*=a,i.width=Math.round(t.naturalWidth*l),i.height=Math.round(t.naturalHeight*l);var u=e.correctOrientation,c=!!t.src.match(/data:image\/jpeg|\.jpeg$|\.jpg$/i),h=!!t.src.match(/^data:/);return r.save(),u&&c&&h&&s(i,r,t.src),1!==l&&r.scale(l,l),r.drawImage(t,0,0),r.restore(),i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load=l,e.loadView=u;var i=n(417),o=n(418),r=n(425),a=n(427),s=n(429);function l(t,e={expanded:!1}){let n;try{n=new DataView(t)}catch(t){return console.warn("Warning: A full DataView implementation is not available. If you're using Node.js you probably want to do this:\n 1. Install a DataView polyfill, e.g. jdataview: npm install --save jdataview\n 2. Require that at the top of your script: global.DataView = require('jdataview');\nSee an example of this in the ExifReader example directory."),{}}return u(n,e)}function u(t,e={expanded:!1}){let n=!1,l={};i.a.check(t);const{tiffHeaderOffset:u,iptcDataOffset:c,xmpDataOffset:h,xmpFieldLength:d}=i.a.parseAppMarkers(t);if(function(t){return void 0!==t}(u)){n=!0;const i=o.a.read(t,u);e.expanded?l.exif=i:l=Object.assign({},l,i)}if(function(t){return void 0!==t}(c)){n=!0;const i=r.a.read(t,c);e.expanded?l.iptc=i:l=Object.assign({},l,i)}if(function(t){return void 0!==t}(h)){n=!0;const i=a.a.read(t,h,d);e.expanded?l.xmp=i:l=Object.assign({},l,i)}if(!n)throw new s.a.MetadataMissingError;return l}e.default={load:l,loadView:u,errors:s.a}},function(t,e,n){"use strict";var i=n(174);const o=2,r=65496,a=2,s=4,l=2,u=10,c=18,h=33,d=65504,f=65505,p=65517,g=65519,m=65534,v="Exif",y="http://ns.adobe.com/xap/1.0/",b="Photoshop 3.0";function w(t,e){const n=v.length;return t.getUint16(e,!1)===f&&Object(i.a)(t,e+s,n)===v&&0===t.getUint8(e+s+n,!1)}function _(t,e){const n=y.length;return t.getUint16(e,!1)===f&&Object(i.a)(t,e+s,n)===y&&0===t.getUint8(e+s+n,!1)}function x(t,e){const n=b.length;return t.getUint16(e,!1)===p&&Object(i.a)(t,e+s,n)===b&&0===t.getUint8(e+s+n,!1)}function S(t,e){const n=t.getUint16(e,!1);return n>=d&&n<=g||n===m}e.a={check:function(t){if(t.byteLength<o||t.getUint16(0,!1)!==r)throw new Error("Invalid image format")},parseAppMarkers:function(t){let e,n,i,o,r,d=a;for(;d+s+5<=t.byteLength;){if(w(t,d))e=t.getUint16(d+l,!1),n=d+u;else if(_(t,d))e=t.getUint16(d+l,!1),o=d+h,r=e-(h-l);else if(x(t,d))e=t.getUint16(d+l,!1),i=d+c;else{if(!S(t,d))break;e=t.getUint16(d+l,!1)}d+=l+e}return{hasAppMarkers:d>a,tiffHeaderOffset:n,iptcDataOffset:i,xmpDataOffset:o,xmpFieldLength:r}}}},function(t,e,n){"use strict";var i=n(175),o=n(419),r=n(420);const a="Exif IFD Pointer",s="GPS Info IFD Pointer",l="Interoperability IFD Pointer",u={1:o.a.getByteAt,2:o.a.getAsciiAt,3:o.a.getShortAt,4:o.a.getLongAt,5:o.a.getRationalAt,7:o.a.getUndefinedAt,9:o.a.getSlongAt,10:o.a.getSrationalAt};function c(t,e,n,i,r){const a=o.a.getTypeSize("SHORT"),s={},l=o.a.getShortAt(t,i,r);i+=a;for(let o=0;o<l;o++){const o=h(t,e,n,i,r);void 0!==o&&(s[o.name]={value:o.value,description:o.description}),i+=12}return s}function h(t,e,n,i,a){const s=o.a.getTypeSize("SHORT"),l=s+o.a.getTypeSize("SHORT"),u=l+o.a.getTypeSize("LONG"),c=o.a.getShortAt(t,i,a),h=o.a.getShortAt(t,i+s,a),f=o.a.getLongAt(t,i+l,a);let p;if(void 0!==o.a.typeSizes[h]){if(function(t,e){return o.a.typeSizes[t]*e<=o.a.getTypeSize("LONG")}(h,f))p=d(t,i+u,h,f,a);else{const e=o.a.getLongAt(t,i+u,a);p=function(t,e,n,i,r){return e+n+o.a.typeSizes[i]*r<=t.byteLength}(t,n,e,h,f)?d(t,n+e,h,f,a):"<faulty value>"}if(h===o.a.tagTypes.ASCII&&(p=function(t){try{return t.map(t=>decodeURIComponent(escape(t)))}catch(e){return t}}(p=function(t){const e=[];let n=0;for(const i of t)"\0"!==i?(void 0===e[n]&&(e[n]=""),e[n]+=i):n++;return e}(p))),void 0!==r.a[e][c]){let t,n;return void 0!==r.a[e][c].name&&void 0!==r.a[e][c].description?(t=r.a[e][c].name,n=r.a[e][c].description(p)):(t=r.a[e][c],n=p instanceof Array?p.join(", "):p),{name:t,value:p,description:n}}return{name:`undefined-${c}`,value:p,description:p}}}function d(t,e,n,i,r){let a=[];for(let s=0;s<i;s++)a.push(u[n](t,e,r)),e+=o.a.typeSizes[n];return n===o.a.tagTypes.ASCII?a=o.a.getAsciiValue(a):1===a.length&&(a=a[0]),a}e.a={read:function(t,e){const n=i.a.getByteOrder(t,e);let r=function(t,e,n){return c(t,"0th",e,function(t,e,n){return e+o.a.getLongAt(t,e+4,n)}(t,e,n),n)}(t,e,n);return r=function(t,e,n,i){return void 0!==t[l]?Object.assign(t,c(e,"interoperability",n,n+t[l].value,i)):t}(r=function(t,e,n,i){return void 0!==t[s]?Object.assign(t,c(e,"gps",n,n+t[s].value,i)):t}(r=function(t,e,n,i){return void 0!==t[a]?Object.assign(t,c(e,"exif",n,n+t[a].value,i)):t}(r,t,e,n),t,e,n),t,e,n)}}},function(t,e,n){"use strict";var i=n(175);const o={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8},r={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10};function a(t,e){return t.getUint8(e)}function s(t,e,n){return t.getUint32(e,n===i.a.LITTLE_ENDIAN)}function l(t,e,n){return t.getInt32(e,n===i.a.LITTLE_ENDIAN)}e.a={getAsciiValue:function(t){return t.map(t=>String.fromCharCode(t))},getByteAt:a,getAsciiAt:function(t,e){return t.getUint8(e)},getShortAt:function(t,e,n){return t.getUint16(e,n===i.a.LITTLE_ENDIAN)},getLongAt:s,getRationalAt:function(t,e,n){return s(t,e,n)/s(t,e+4,n)},getUndefinedAt:function(t,e){return a(t,e)},getSlongAt:l,getSrationalAt:function(t,e,n){return l(t,e,n)/l(t,e+4,n)},typeSizes:o,tagTypes:r,getTypeSize:function(t){if(void 0===r[t])throw new Error("No such type found.");return o[r[t]]}}},function(t,e,n){"use strict";var i=n(421),o=n(422),r=n(423),a=n(424);e.a={"0th":i.a,exif:o.a,gps:r.a,interoperability:a.a}},function(t,e,n){"use strict";e.a={256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:{name:"Orientation",description:t=>1===t?"top-left":2===t?"top-right":3===t?"bottom-right":4===t?"bottom-left":5===t?"left-top":6===t?"right-top":7===t?"right-bottom":8===t?"left-bottom":"Undefined"},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",296:{name:"ResolutionUnit",description:t=>2===t?"inches":3===t?"centimeters":"Unknown"},301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",318:"WhitePoint",319:"PrimaryChromaticities",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:t=>1===t?"centered":2===t?"co-sited":"undefined "+t},532:"ReferenceBlackWhite",33432:{name:"Copyright",description:t=>t.join("; ")},34665:"Exif IFD Pointer",34853:"GPS Info IFD Pointer"}},function(t,e,n){"use strict";var i=n(99);e.a={33434:"ExposureTime",33437:"FNumber",34850:{name:"ExposureProgram",description:t=>0===t?"Undefined":1===t?"Manual":2===t?"Normal program":3===t?"Aperture priority":4===t?"Shutter priority":5===t?"Creative program":6===t?"Action program":7===t?"Portrait mode":8===t?"Landscape mode":"Unknown"},34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:{name:"OECF",description:()=>"[Raw OECF table data]"},36864:{name:"ExifVersion",description:t=>Object(i.b)(t)},36867:"DateTimeOriginal",36868:"DateTimeDigitized",37121:{name:"ComponentsConfiguration",description:t=>t.map(t=>49===t?"Y":50===t?"Cb":51===t?"Cr":52===t?"R":53===t?"G":54===t?"B":void 0).join("")},37122:"CompressedBitsPerPixel",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBiasValue",37381:"MaxApertureValue",37382:"SubjectDistance",37383:{name:"MeteringMode",description:t=>1===t?"Average":2===t?"CenterWeightedAverage":3===t?"Spot":4===t?"MultiSpot":5===t?"Pattern":6===t?"Partial":255===t?"Other":"Unknown"},37384:{name:"LightSource",description:t=>1===t?"Daylight":2===t?"Fluorescent":3===t?"Tungsten (incandescent light)":4===t?"Flash":9===t?"Fine weather":10===t?"Cloudy weather":11===t?"Shade":12===t?"Daylight fluorescent (D 5700 – 7100K)":13===t?"Day white fluorescent (N 4600 – 5400K)":14===t?"Cool white fluorescent (W 3900 – 4500K)":15===t?"White fluorescent (WW 3200 – 3700K)":17===t?"Standard light A":18===t?"Standard light B":19===t?"Standard light C":20===t?"D55":21===t?"D65":22===t?"D75":23===t?"D50":24===t?"ISO studio tungsten":255===t?"Other light source":"Unknown"},37385:{name:"Flash",description:t=>0===t?"Flash did not fire":1===t?"Flash fired":5===t?"Strobe return light not detected":7===t?"Strobe return light detected":9===t?"Flash fired, compulsory flash mode":13===t?"Flash fired, compulsory flash mode, return light not detected":15===t?"Flash fired, compulsory flash mode, return light detected":16===t?"Flash did not fire, compulsory flash mode":24===t?"Flash did not fire, auto mode":25===t?"Flash fired, auto mode":29===t?"Flash fired, auto mode, return light not detected":31===t?"Flash fired, auto mode, return light detected":32===t?"No flash function":65===t?"Flash fired, red-eye reduction mode":69===t?"Flash fired, red-eye reduction mode, return light not detected":71===t?"Flash fired, red-eye reduction mode, return light detected":73===t?"Flash fired, compulsory flash mode, red-eye reduction mode":77===t?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":79===t?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":89===t?"Flash fired, auto mode, red-eye reduction mode":93===t?"Flash fired, auto mode, return light not detected, red-eye reduction mode":95===t?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"},37386:"FocalLength",37396:{name:"SubjectArea",description:t=>2===t.length?`Location; X: ${t[0]}, Y: ${t[1]}`:3===t.length?`Circle; X: ${t[0]}, Y: ${t[1]}, diameter: ${t[2]}`:4===t.length?`Rectangle; X: ${t[0]}, Y: ${t[1]}, width: ${t[2]}, height: ${t[3]}`:"Unknown"},37500:{name:"MakerNote",description:()=>"[Raw maker note data]"},37510:{name:"UserComment",description:i.a},37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",40960:{name:"FlashpixVersion",description:t=>t.map(t=>String.fromCharCode(t)).join("")},40961:{name:"ColorSpace",description:t=>1===t?"sRGB":65535===t?"Uncalibrated":"Unknown"},40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",40965:"Interoperability IFD Pointer",41483:"FlashEnergy",41484:{name:"SpatialFrequencyResponse",description:()=>"[Raw SFR table data]"},41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:{name:"FocalPlaneResolutionUnit",description:t=>2===t?"inches":3===t?"centimeters":"Unknown"},41492:{name:"SubjectLocation",description:([t,e])=>`X: ${t}, Y: ${e}`},41493:"ExposureIndex",41495:{name:"SensingMethod",description:t=>1===t?"Undefined":2===t?"One-chip color area sensor":3===t?"Two-chip color area sensor":4===t?"Three-chip color area sensor":5===t?"Color sequential area sensor":7===t?"Trilinear sensor":8===t?"Color sequential linear sensor":"Unknown"},41728:{name:"FileSource",description:t=>3===t?"DSC":"Unknown"},41729:{name:"SceneType",description:t=>1===t?"A directly photographed image":"Unknown"},41730:{name:"CFAPattern",description:()=>"[Raw CFA pattern table data]"},41985:{name:"CustomRendered",description:t=>0===t?"Normal process":1===t?"Custom process":"Unknown"},41986:{name:"ExposureMode",description:t=>0===t?"Auto exposure":1===t?"Manual exposure":2===t?"Auto bracket":"Unknown"},41987:{name:"WhiteBalance",description:t=>0===t?"Auto white balance":1===t?"Manual white balance":"Unknown"},41988:{name:"DigitalZoomRatio",description:t=>0===t?"Digital zoom was not used":t},41989:{name:"FocalLengthIn35mmFilm",description:t=>0===t?"Unknown":t},41990:{name:"SceneCaptureType",description:t=>0===t?"Standard":1===t?"Landscape":2===t?"Portrait":3===t?"Night scene":"Unknown"},41991:{name:"GainControl",description:t=>0===t?"None":1===t?"Low gain up":2===t?"High gain up":3===t?"Low gain down":4===t?"High gain down":"Unknown"},41992:{name:"Contrast",description:t=>0===t?"Normal":1===t?"Soft":2===t?"Hard":"Unknown"},41993:{name:"Saturation",description:t=>0===t?"Normal":1===t?"Low saturation":2===t?"High saturation":"Unknown"},41994:{name:"Sharpness",description:t=>0===t?"Normal":1===t?"Soft":2===t?"Hard":"Unknown"},41995:{name:"DeviceSettingDescription",description:()=>"[Raw device settings table data]"},41996:{name:"SubjectDistanceRange",description:t=>1===t?"Macro":2===t?"Close view":3===t?"Distant view":"Unknown"},42016:"ImageUniqueID"}},function(t,e,n){"use strict";var i=n(99);e.a={0:{name:"GPSVersionID",description:t=>2===t[0]&&2===t[1]&&0===t[2]&&0===t[3]?"Version 2.2":"Unknown"},1:{name:"GPSLatitudeRef",description:t=>{const e=t.join("");return"N"===e?"North latitude":"S"===e?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:t=>t[0]+t[1]/60+t[2]/3600},3:{name:"GPSLongitudeRef",description:t=>{const e=t.join("");return"E"===e?"East longitude":"W"===e?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:t=>t[0]+t[1]/60+t[2]/3600},5:{name:"GPSAltitudeRef",description:t=>0===t?"Sea level":1===t?"Sea level reference (negative value)":"Unknown"},6:{name:"GPSAltitude",description:t=>t+" m"},7:{name:"GPSTimeStamp",description:t=>t.map(t=>1===`${t}`.length?`0${t}`:t).join(":")},8:"GPSSatellites",9:{name:"GPSStatus",description:t=>{const e=t.join("");return"A"===e?"Measurement in progress":"V"===e?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:t=>{const e=t.join("");return"2"===e?"2-dimensional measurement":"3"===e?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:t=>{const e=t.join("");return"K"===e?"Kilometers per hour":"M"===e?"Miles per hour":"N"===e?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:t=>{const e=t.join("");return"T"===e?"True direction":"M"===e?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:t=>{const e=t.join("");return"T"===e?"True direction":"M"===e?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:t=>{const e=t.join("");return"N"===e?"North latitude":"S"===e?"South latitude":"Unknown"}},20:{name:"GPSDestLatitude",description:t=>t[0]+t[1]/60+t[2]/3600},21:{name:"GPSDestLongitudeRef",description:t=>{const e=t.join("");return"E"===e?"East longitude":"W"===e?"West longitude":"Unknown"}},22:{name:"GPSDestLongitude",description:t=>t[0]+t[1]/60+t[2]/3600},23:{name:"GPSDestBearingRef",description:t=>{const e=t.join("");return"T"===e?"True direction":"M"===e?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:t=>{const e=t.join("");return"K"===e?"Kilometers":"M"===e?"Miles":"N"===e?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:i.a},28:{name:"GPSAreaInformation",description:i.a},29:"GPSDateStamp",30:{name:"GPSDifferential",description:t=>0===t?"Measurement without differential correction":1===t?"Differential correction applied":"Unknown"}}},function(t,e,n){"use strict";e.a={1:"InteroperabilityIndex"}},function(t,e,n){"use strict";var i=n(426);const o=943868237,r=4,a=r+8,s=1028,l=5;function u(t,e){if(t.getUint32(e,!1)!==o)throw new Error("Not an IPTC resource block.");return{type:t.getUint16(e+r,!1),size:t.getUint16(e+10,!1)}}function c(t){return t.type===s}function h(t){return t%2!=0?1:0}function d(t,e,n){const o=t.getUint16(e+1,!1),r=t.getUint16(e+3,!1),a=function(t,e,n){const i=[];for(let o=0;o<n;o++)i.push(t.getUint8(e+o));return i}(t,e+l,r);let s;if(void 0!==i.a.iptc[o]){let t,e;void 0!==i.a.iptc[o].name&&void 0!==i.a.iptc[o].description?(t=i.a.iptc[o].name,e=i.a.iptc[o].description(a,n)):(t=void 0!==i.a.iptc[o].name?i.a.iptc[o].name:i.a.iptc[o],e=a instanceof Array?function(t){try{return decodeURIComponent(escape(t))}catch(e){return t}}(e=a.map(t=>String.fromCharCode(t)).join("")):a),s={name:t,value:a,description:e},void 0!==i.a.iptc[o].repeatable&&(s.repeatable=!0)}else s={name:`undefined-${o}`,value:a,description:a};return{tag:s,tagSize:r}}e.a={read:function(t,e){try{const{naaBlock:n,dataOffset:i}=function(t,e){for(;e+a<=t.byteLength;){const n=u(t,e);if(c(n))return{naaBlock:n,dataOffset:e};e+=a+n.size+h(n.size)}throw new Error("No IPTC NAA resource block.")}(t,e);return function(t,e,n){const i={},o=(n+=a)+e.size;for(;n<o&&n<t.byteLength;){const{tag:e,tagSize:o}=d(t,n,i);void 0===i[e.name]||void 0===e.repeatable?i[e.name]={value:e.value,description:e.description}:(i[e.name]instanceof Array||(i[e.name]=[{value:i[e.name].value,description:i[e.name].description}]),i[e.name].push({value:e.value,description:e.description})),n+=l+o}return i}(t,n,i)}catch(t){return{}}}}},function(t,e,n){"use strict";var i=n(99);function o(t){const e=Object(i.b)(t);return e.length>=8?e.substr(0,4)+"-"+e.substr(4,2)+"-"+e.substr(6,2):e}function r(t){const e=Object(i.b)(t);let n=e;return e.length>=6&&(n=e.substr(0,2)+":"+e.substr(2,2)+":"+e.substr(4,2),11===e.length&&(n+=e.substr(6,1)+e.substr(7,2)+":"+e.substr(9,2))),n}e.a={iptc:{346:{name:"Coded Character Set",description:t=>{const e=Object(i.b)(t);return"%G"===e?"UTF-8":"%/G"===e?"UTF-8 Level 1":"%/H"===e?"UTF-8 Level 2":"%/I"===e?"UTF-8 Level 3":"Unknown"}},512:{name:"Record Version",description:t=>((t[0]<<8)+t[1]).toString()},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:t=>"01"===Object(i.b)(t)?"Additional Language":"Unknown"},522:"Urgency",524:{name:"Subject Reference",repeatable:!0,description:t=>{const e=Object(i.b)(t).split(":");return e[2]+(e[3]?"/"+e[3]:"")+(e[4]?"/"+e[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:!0},534:"Fixture Identifier",537:{name:"Keywords",repeatable:!0},538:{name:"Content Location Code",repeatable:!0},539:{name:"Content Location Name",repeatable:!0},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:t=>{const e=Object(i.b)(t);return"01"===e?"Object Kill":"02"===e?"Object Replace":"03"===e?"Object Append":"04"===e?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:!0},559:{name:"Reference Date",repeatable:!0},562:{name:"Reference Number",repeatable:!0},567:{name:"Date Created",description:o},572:{name:"Time Created",description:r},574:{name:"Digital Creation Date",description:o},575:{name:"Digital Creation Time",description:r},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:t=>{const e=Object(i.b)(t);return"a"===e?"morning":"p"===e?"evening":"b"===e?"both":"Unknown"}},592:{name:"By-line",repeatable:!0},597:{name:"By-line Title",repeatable:!0},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:!0},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:!0},637:{name:"Rasterized Caption",description:t=>t},642:"Image Type",643:{name:"Image Orientation",description:t=>{const e=Object(i.b)(t);return"P"===e?"Portrait":"L"===e?"Landscape":"S"===e?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:t=>{const e=Object(i.b)(t),n=e.charAt(0),o=e.charAt(1);let r="";return"1"===n?r+="Mono":"2"===n&&(r+="Stereo"),"A"===o?r+=", actuality":"C"===o?r+=", question and answer session":"M"===o?r+=", music, transmitted by itself":"Q"===o?r+=", response to a question":"R"===o?r+=", raw sound":"S"===o?r+=", scener":"V"===o?r+=", voicer":"W"===o&&(r+=", wrap"),""!==r?r:e}},663:{name:"Audio Sampling Rate",description:t=>parseInt(Object(i.b)(t),10)+" Hz"},664:{name:"Audio Sampling Resolution",description:t=>{const e=parseInt(Object(i.b)(t),10);return e+(1===e?" bit":" bits")}},665:{name:"Audio Duration",description:t=>{const e=Object(i.b)(t);return e.length>=6?e.substr(0,2)+":"+e.substr(2,2)+":"+e.substr(4,2):e}},666:"Audio Outcue",712:{name:"ObjectData Preview File Format",description:t=>{const e=Object(i.b)(t);return"00"===e?"No ObjectData":"01"===e?"IPTC-NAA Digital Newsphoto Parameter Record":"02"===e?"IPTC7901 Recommended Message Format":"03"===e?"Tagged Image File Format (Adobe/Aldus Image data)":"04"===e?"Illustrator (Adobe Graphics data)":"05"===e?"AppleSingle (Apple Computer Inc)":"06"===e?"NAA 89-3 (ANPA 1312)":"07"===e?"MacBinary II":"08"===e?"IPTC Unstructured Character Oriented File Format (UCOFF)":"09"===e?"United Press International ANPA 1312 variant":"10"===e?"United Press International Down-Load Message":"11"===e?"JPEG File Interchange (JFIF)":"12"===e?"Photo-CD Image-Pac (Eastman Kodak)":"13"===e?"Microsoft Bit Mapped Graphics File [*.BMP]":"14"===e?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":"15"===e?"Audio plus Moving Video [*.AVI] (Microsoft)":"16"===e?"PC DOS/Windows Executable Files [*.COM][*.EXE]":"17"===e?"Compressed Binary File [*.ZIP] (PKWare Inc)":"18"===e?"Audio Interchange File Format AIFF (Apple Computer Inc)":"19"===e?"RIFF Wave (Microsoft Corporation)":"20"===e?"Freehand (Macromedia/Aldus)":"21"===e?'Hypertext Markup Language "HTML" (The Internet Society)':"22"===e?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":"23"===e?"MPEG 2 Audio Layer 3, ISO/IEC":"24"===e?"Portable Document File (*.PDF) Adobe":"25"===e?"News Industry Text Format (NITF)":"26"===e?"Tape Archive (*.TAR)":"27"===e?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":"28"===e?"Ritzaus Bureau NITF version (RBNITF DTD)":"29"===e?"Corel Draw [*.CDR]":"Unknown format "+e}},713:{name:"ObjectData Preview File Format Version",description:(t,e)=>{const n={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},o=Object(i.b)(t);if(e["ObjectData Preview File Format"]){const t=Object(i.b)(e["ObjectData Preview File Format"].value);if(n[t]&&n[t][o])return n[t][o]}return o}},714:"ObjectData Preview Data"}}},function(t,e,n){"use strict";var i=n(174),o=n(428);function r(t,e=!1){const n=function(t){const e=[];for(let n=0;n<t.childNodes.length;n++)e.push(t.childNodes[n]);return e}(t);return function(t){return 1===t.length&&"#text"===t[0].nodeName}(n)?e?{}:function(t){return t.nodeValue}(n[0]):function(t){const e={};return t.forEach(t=>{if(function(t){return t.nodeName&&"#text"!==t.nodeName}(t)){const n=function(t){return{attributes:function(t){const e={};for(let n=0;n<t.attributes.length;n++)e[t.attributes[n].nodeName]=t.attributes[n].value;return e}(t),value:r(t)}}(t);void 0!==e[t.nodeName]?(Array.isArray(e[t.nodeName])||(e[t.nodeName]=[e[t.nodeName]]),e[t.nodeName].push(n)):e[t.nodeName]=n}}),e}(n)}function a(t){const e={};if("string"==typeof t)return t;for(const n in t){let i=t[n];Array.isArray(i)||(i=[i]),i.forEach(t=>{Object.assign(e,s(t.attributes)),"object"==typeof t.value&&Object.assign(e,f(t.value))})}return e}function s(t){const e={};for(const n in t)l(n)&&(e[c(n)]={value:t[n],attributes:{},description:h(t[n],n)});return e}function l(t){return"rdf:parseType"!==t&&!u(t)}function u(t){return"xmlns"===t.split(":")[0]}function c(t){return t.split(":")[1]}function h(t,e){if(Array.isArray(t))return function(t){return t.map(t=>void 0!==t.value?h(t.value):h(t)).join(", ")}(t);if("object"==typeof t)return function(t){const e=[];for(const n in t)e.push(`${d(n)}: ${t[n].value}`);return e.join("; ")}(t);try{return e&&"function"==typeof o.a[e]?o.a[e](t):decodeURIComponent(escape(t))}catch(e){return t}}function d(t){return"CiAdrCity"===t?"CreatorCity":"CiAdrCtry"===t?"CreatorCountry":"CiAdrExtadr"===t?"CreatorAddress":"CiAdrPcode"===t?"CreatorPostalCode":"CiAdrRegion"===t?"CreatorRegion":"CiEmailWork"===t?"CreatorWorkEmail":"CiTelWork"===t?"CreatorWorkPhone":"CiUrlWork"===t?"CreatorWorkUrl":t}function f(t){const e={};for(const n in t)u(n)||(e[c(n)]=p(t[n],n));return e}function p(t,e){return g(t)?m(t,e):function(t){return"Resource"===t.attributes["rdf:parseType"]||void 0!==t.value["rdf:Description"]&&void 0===t.value["rdf:Description"].value["rdf:value"]}(t)?function(t,e){const n={value:{},attributes:{}};void 0!==t.value["rdf:Description"]&&(Object.assign(n.value,s(t.value["rdf:Description"].attributes)),Object.assign(n.attributes,v(t)),t=t.value["rdf:Description"]);return Object.assign(n.value,f(t.value)),n.description=h(n.value,e),n}(t,e):function(t){return 0===Object.keys(t.value).length&&void 0===t.attributes["rdf:resource"]}(t)?function(t,e){const n=s(t.attributes);return{value:n,attributes:{},description:h(n,e)}}(t,e):function(t){return void 0!==y(t.value)}(t)?function(t,e){let n=y(t.value).value["rdf:li"];const i=v(t),o=[];Array.isArray(n)||(n=[n]);return n.forEach(t=>{o.push(function(t){return g(t)?m(t):function(t){return"Resource"===t.attributes["rdf:parseType"]}(t)?f(t.value):{value:t.value,attributes:v(t),description:h(t.value)}}(t))}),{value:o,attributes:i,description:h(o,e)}}(t,e):function(t,e){const n=b(t)||a(t.value);return{value:n,attributes:v(t),description:h(n,e)}}(t,e)}function g(t){return"Resource"===t.attributes["rdf:parseType"]&&void 0!==t.value["rdf:value"]||void 0!==t.value["rdf:Description"]&&void 0!==t.value["rdf:Description"].value["rdf:value"]}function m(t,e){const n=v(t);void 0!==t.value["rdf:Description"]&&(t=t.value["rdf:Description"]),Object.assign(n,v(t),function(t){const e={};for(const n in t.value)"rdf:value"===n||u(n)||(e[c(n)]=t.value[n].value);return e}(t));const i=function(t){return b(t.value["rdf:value"])||t.value["rdf:value"].value}(t);return{value:i,attributes:n,description:h(i,e)}}function v(t){const e={};for(const n in t.attributes)"rdf:parseType"===n||"rdf:resource"===n||u(n)||(e[c(n)]=t.attributes[n]);return e}function y(t){return t["rdf:Bag"]||t["rdf:Seq"]||t["rdf:Alt"]}function b(t){return t.attributes&&t.attributes["rdf:resource"]}e.a={read:function(t,e,n){try{const o=function(t,e,n){if("undefined"==typeof DOMParser)throw console.warn("Warning: DOMParser is not available. If you're using Node.js you probably want to do this:\n 1. Install a DOM parser, e.g. xmldom: npm install --save xmldom\n 2. Require that at the top of your script: global.DOMParser = require('xmldom').DOMParser;\nSee an example of this in the ExifReader example directory."),new Error;const o=new DOMParser,r=Object(i.a)(t,e,n),a=o.parseFromString(r,"application/xml");if("parsererror"===a.documentElement.nodeName)throw new Error;return a}(t,e,n),s=function t(e){for(let n=0;n<e.childNodes.length;n++){if("x:xmpmeta"===e.childNodes[n].tagName)return t(e.childNodes[n]);if("rdf:RDF"===e.childNodes[n].tagName)return e.childNodes[n]}throw new Error}(o);return a(r(s,!0))}catch(t){return{}}}}},function(t,e,n){"use strict";function i(t){const[e,n]=t.split(",");if(void 0!==e&&void 0!==n){const t=parseFloat(e),i=parseFloat(n),o=n.charAt(n.length-1);if(!Number.isNaN(t)&&!Number.isNaN(i))return""+(t+i/60)+o}return t}e.a={"tiff:Orientation":t=>"1"===t?"Horizontal (normal)":"2"===t?"Mirror horizontal":"3"===t?"Rotate 180":"4"===t?"Mirror vertical":"5"===t?"Mirror horizontal and rotate 270 CW":"6"===t?"Rotate 90 CW":"7"===t?"Mirror horizontal and rotate 90 CW":"8"===t?"Rotate 270 CW":t,"exif:GPSLatitude":i,"exif:GPSLongitude":i}},function(t,e,n){"use strict";function i(t){this.name="MetadataMissingError",this.message=t||"No Exif data",this.stack=(new Error).stack}i.prototype=new Error,e.a={MetadataMissingError:i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=h(n(12)),o=h(n(7)),r=h(n(8)),a=h(n(13)),s=h(n(14)),l=n(2),u=h(l),c=n(17);function h(t){return t&&t.__esModule?t:{default:t}}var d=function(t){function e(){return(0,o.default)(this,e),(0,a.default)(this,(e.__proto__||(0,i.default)(e)).apply(this,arguments))}return(0,s.default)(e,t),(0,r.default)(e,[{key:"render",value:function(){return u.default.createElement("div",{className:"sidebar"})}}]),e}(l.Component);e.default=(0,c.connect)(function(t){return{hash:t.metadata.hash}})(d)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a(n(65)),o=a(n(2)),r=n(17);function a(t){return t&&t.__esModule?t:{default:t}}e.default=(0,r.connect)(function(t){return{app:t.metadata}})(function(t){var e=t.app,n=t.tag,r=t.View,a=e[n];return a?"loading"===a?o.default.createElement("div",{className:"tableObject loading"},n,": Loading"):a.err?o.default.createElement("div",{className:"tableObject error"},n," Error: ",a.err):o.default.createElement(r,(0,i.default)({data:a},t)):null})},function(t,e,n){t.exports={default:n(433),__esModule:!0}},function(t,e,n){n(434),t.exports=n(3).Object.assign},function(t,e,n){var i=n(4);i(i.S+i.F,"Object",{assign:n(435)})},function(t,e,n){"use strict";var i=n(42),o=n(87),r=n(57),a=n(31),s=n(67),l=Object.assign;t.exports=!l||n(23)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=l({},t)[n]||Object.keys(l({},e)).join("")!=i})?function(t,e){for(var n=a(t),l=arguments.length,u=1,c=o.f,h=r.f;l>u;)for(var d,f=s(arguments[u++]),p=c?i(f).concat(c(f)):i(f),g=p.length,m=0;g>m;)h.call(f,d=p[m++])&&(n[d]=f[d]);return n}:l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=p(n(65)),o=p(n(12)),r=p(n(7)),a=p(n(8)),s=p(n(13)),l=p(n(14)),u=n(2),c=p(u),h=n(17),d=n(11),f=n(51);function p(t){return t&&t.__esModule?t:{default:t}}var g=function(t){function e(){var t,n,i,a;(0,r.default)(this,e);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=i=(0,s.default)(this,(t=e.__proto__||(0,o.default)(e)).call.apply(t,[this].concat(u))),i.state={playing:!1},a=n,(0,s.default)(i,a)}return(0,l.default)(e,t),(0,a.default)(e,[{key:"render",value:function(){var t=this,e=this.props,n=e.app,i=e.data,o=e.size,r=this.state.playing,a=i.metadata.sugarcube.fp.replace("/var/www/files/","https://cube.syrianarchive.org/"),s=n.mediainfo,l=s.sha256,u=s.verified,h=n.mediainfo.metadata.mediainfo.video,f=n.keyframe.metadata.keyframe.basic[0];return c.default.createElement("div",{className:"video"},r?c.default.createElement("video",{src:a,autoPlay:!0,controls:!0,muted:!0}):c.default.createElement("div",{className:"bg",style:{width:d.widths[o||"sm"],height:d.widths[o||"sm"]/h.aspect_ratio,backgroundImage:"url("+(0,d.imageUrl)(u,l,f,o)+")"},onClick:function(){return t.setState({playing:!0})}},c.default.createElement("div",{className:"play"})))}}]),e}(u.Component);e.default=(0,h.connect)(function(){return{tag:"sugarcube"}})(function(t){return c.default.createElement(f.Gate,(0,i.default)({View:g},t))})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=u(n(56)),o=u(n(438)),r=u(n(66)),a=u(n(45));e.TableObject=h,e.TableArray=d,e.TableTuples=function(t){var e=t.tag,n=t.list;return n?s.default.createElement("div",null,e&&s.default.createElement("h3",null,e),s.default.createElement("table",{className:"tableTuples "+e},s.default.createElement("tbody",null,n.map(function(t,n){var i=(0,o.default)(t),r=i[0],a=i.slice(1);return s.default.createElement("tr",{key:e+"_"+n},s.default.createElement("th",null,(0,l.formatName)(r)),a.map(function(t,e){return s.default.createElement(p,{key:n+"_"+e,value:t})}))})))):null},e.TableRow=f,e.TableCell=p;var s=u(n(2)),l=n(11);function u(t){return t&&t.__esModule?t:{default:t}}var c="__HR__";function h(t){var e=t.tag,n=t.object,i=t.order,o=t.summary;if(!n)return null;if("loading"===n)return s.default.createElement("div",{className:"tableObject loading"},e,": Loading");if(n.err)return s.default.createElement("div",{className:"tableObject error"},e," Error: ",n.err);var l=(0,a.default)(n);if(i){var u=l.reduce(function(t,e){var n=i.indexOf(e);return-1!==n?t.order.push([n,e]):t.alpha.push(e),t},{order:[],alpha:[]});l=u.order.sort(function(t,e){return t[0]-e[0]}).map(function(t){var e=(0,r.default)(t,2);e[0];return e[1]}),o||(l=l.concat(u.alpha.sort()))}else l=l.sort();return s.default.createElement("div",null,e&&s.default.createElement("h3",null,e),s.default.createElement("table",{className:"tableObject "+e},s.default.createElement("tbody",null,l.map(function(t,e){return s.default.createElement(f,{key:t+"_"+e,name:t,value:n[t]})}))))}function d(t){var e=t.tag,n=t.list;return n?s.default.createElement("div",null,e&&s.default.createElement("h3",null,e),s.default.createElement("table",{className:"tableArray "+e},s.default.createElement("tbody",null,n.map(function(t,n){return s.default.createElement("tr",{key:e+"_"+n},s.default.createElement(p,{value:t}))})))):null}function f(t){var e=t.name,n=t.value;return e===c?s.default.createElement("tr",null,s.default.createElement("th",{className:"tr"},s.default.createElement("hr",null))):s.default.createElement("tr",null,s.default.createElement("th",null,(0,l.formatName)(e)),s.default.createElement(p,{name:e,value:n}))}function p(t){var e=t.value;return e&&"object"===(void 0===e?"undefined":(0,i.default)(e))&&(e=e._raw?e.value:e.length?s.default.createElement(d,{nested:!0,tag:"",list:e}):s.default.createElement(h,{nested:!0,tag:"",object:e})),s.default.createElement("td",null,e)}},function(t,e,n){"use strict";e.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(n(88));e.default=function(t){return Array.isArray(t)?t:(0,i.default)(t)}},function(t,e,n){var i=n(440);"string"==typeof i&&(i=[[t.i,i,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(26)(i,o);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(25)(!1)).push([t.i,"* {}",""])},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=p(n(12)),o=p(n(7)),r=p(n(8)),a=p(n(13)),s=p(n(14)),l=n(2),u=p(l),c=(n(21),n(17),n(89)),h=n(11),d=n(51),f=p(n(176));function p(t){return t&&t.__esModule?t:{default:t}}var g=function(t){function e(){var t,n,r,s;(0,o.default)(this,e);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=r=(0,a.default)(this,(t=e.__proto__||(0,i.default)(e)).call.apply(t,[this].concat(u))),r.state={keys:[],data:[],columns:[]},s=n,(0,a.default)(r,s)}return(0,s.default)(e,t),(0,r.default)(e,[{key:"componentDidMount",value:function(){var t=this,e=this.props.payload;console.log(e.url),fetch(e.url,{mode:"cors"}).then(function(t){return t.text()}).then(function(n){try{var i=n.split("\n")[0].split(",").map(function(t){return t.trim().replace(/\"/,"")}),o=f.default.toJSON(n,{headers:{included:!0}}),r=t.getColumns(i,o,e.fields);t.setState({keys:i,data:o,columns:r})}catch(t){console.error("error making json:",e.url),console.error(t)}})}},{key:"getColumns",value:function(t,e,n){var i=n.length?n[0].split(", "):t;return t.map(function(t,n){var o=i[n]||t;if(t.match("url")){var r=t.replace("url","label");return e.forEach(function(e){return e[r]=(0,h.domainFromUrl)(e[t])}),{title:o,field:r,formatter:"link",formatterParams:{target:"_blank",urlField:t},sorter:"string"}}switch(t){case"images":case"year":return{title:o,field:t.toLowerCase(),sorter:"number"};default:return{title:o,field:t.toLowerCase(),sorter:"string"}}})}},{key:"render",value:function(){this.props.payload;return this.state.data.length?u.default.createElement(c.ReactTabulator,{columns:this.state.columns,data:this.state.data,options:{height:Math.min(37*this.state.data.length+29,311),layout:"fitColumns",placeholder:"No Data Set"}}):u.default.createElement(d.Loader,null)}}]),e}(l.Component);e.default=g},function(t,e,n){"use strict";
+/*!
+ * is-extendable <https://github.com/jonschlinkert/is-extendable>
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */t.exports=function(t){return void 0!==t&&null!==t&&("object"==typeof t||"function"==typeof t)}},function(t,e,n){"use strict";n(444);var i=n(100),o=n(177);function r(t){this.options=o({},{headers:{included:!0,downcase:!0,upcase:!0},delimiter:"tab",decimalSign:"comma",outputDataType:"json",columnDelimiter:"\t",rowDelimiter:"\n",inputHeader:{},outputHeader:{},dataSelect:{},outputText:"",newline:"\n",indent:" ",commentLine:"//",commentLineEnd:"",tableName:"converter",useUnderscores:!0,includeWhiteSpace:!0,useTabsForIndent:!1},t),this.options.includeWhiteSpace?this.options.newline="\n":(this.options.indent="",this.options.newline="")}r.prototype.render=function(t){var e=[].slice.call(arguments,1);return this[t].apply(this,e)},r.prototype.json=function(t,e){for(var n,o=i({},this.options,e),r=(t=i({},t)).data,a=t.header||o.header,s=o.newline,l=r.length,u=a.names.length,c="[",h=0;h<l;h++){var d=r[h];c+="{";for(var f=0;f<u;f++)n="int"==a.types[f]||"float"==a.types[f]?d[f]||"null":'"'+(d[f]||"")+'"',c+='"'+a.names[f]+'":'+n,f<u-1&&(c+=",");c+="}",h<l-1&&(c+=","+s)}return c+="]"},r.prototype.jsonArrayCols=function(t,e){var n=i({},this.options,e),o=(t=i({},t)).data,r=t.header||n.header,a=n.indent,s=n.newline,l="",u=o.length,c=r.names.length;l+="{"+s;for(var h=0;h<c;h++){l+=a+'"'+r.names[h]+'":[';for(var d=0;d<u;d++)"int"==r.types[h]||"float"==r.types[h]?l+=o[d][h]||0:l+='"'+(o[d][h]||"")+'"',d<u-1&&(l+=",");l+="]",h<c-1&&(l+=","+s)}return l+=s+"}"},r.prototype.jsonArrayRows=function(t,e){var n=i({},this.options,e),o=(t=i({},t)).data,r=t.header||n.header,a=n.indent,s=n.newline,l="",u=o.length,c=r.names.length;l+="["+s;for(var h=0;h<u;h++){l+=a+"[";for(var d=0;d<c;d++)"int"==r.types[d]||"float"==r.types[d]?l+=o[h][d]||0:l+='"'+(o[h][d]||"")+'"',d<c-1&&(l+=",");l+="]",h<u-1&&(l+=","+s)}return l+=s+"]"},r.prototype.jsonDict=function(t,e){var n=i({},this.options,e),o=(t=i({},t)).data,r=t.header||n.header,a=n.indent,s=n.newline,l="",u=o.length,c=r.names.length;l+="{"+s;for(var h=0;h<u;h++){if(l+=a+'"'+o[h][0]+'": ',2==c)l+=f(h,1);else{l+="{ ";for(var d=1;d<c;d++)d>1&&(l+=", "),l+='"'+r.names[d]+'":'+f(h,d);l+="}"}h<u-1&&(l+=","+s)}function f(t,e){return"int"==r.types[e]||"float"==r.types[e]?o[t][e]||0:'"'+(o[t][e]||"")+'"'}return l+=s+"}"},r.prototype.as=function(t,e){for(var n,o=i({},this.options,e),r=(t=i({},t)).data,a=t.header||o.header,s=o.newline,l="[",u=r.length,c=a.names.length,h=0;h<u;h++){var d=r[h];l+="{";for(var f=0;f<c;f++)n="int"==a.types[f]||"float"==a.types[f]?d[f]||"null":'"'+(d[f]||"")+'"',l+=a.names[f]+":"+n,f<c-1&&(l+=",");l+="}",h<u-1&&(l+=","+s)}return l+="];"},r.prototype.asp=function(t,e){for(var n=i({},this.options,e),o=(t=i({},t)).data,r=t.header||n.header,a=n.newline,s="",l=o.length,u=r.names.length,c=0;c<l;c++){for(var h=o[c],d=0;d<u;d++)s+="myArray("+d+","+c+") = "+("int"==r.types[d]||"float"==r.types[d]?h[d]||"null":'"'+(h[d]||"")+'"')+a;s="Dim myArray("+(d-1)+","+(c-1)+")"+a+s}return s},r.prototype.html=function(t,e){var n=i({},this.options,e),o=(t=i({},t)).data,r=t.header||n.header,a=n.indent,s=n.newline,l="",u=o.length,c=r.names.length;l+="<table>"+s,l+=a+"<thead>"+s,l+=a+a+"<tr>"+s;for(var h=0;h<c;h++)l+=a+a+a+'<th class="'+r.names[h]+'-cell">',l+=r.names[h],l+="</th>"+s;l+=a+a+"</tr>"+s,l+=a+"</thead>"+s,l+=a+"<tbody>"+s;for(var d=0;d<u;d++){var f=o[d],p="";d===u-1?p=' class="lastRow"':0===d&&(p=' class="firstRow"'),l+=a+a+"<tr"+p+">"+s;for(var g=0;g<c;g++)l+=a+a+a+'<td class="'+r.names[g]+'-cell">',l+=f[g],l+="</td>"+s;l+=a+a+"</tr>"+s}return l+=a+"</tbody>"+s,l+="</table>"},r.prototype.mysql=function(t,e){var n=i({},this.options,e),o=(t=i({},t)).data,r=t.header||n.header,a=n.indent,s=n.newline,l="",u=o.length,c=r.names.length;l+="CREATE TABLE converter ("+s,l+=a+"id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,"+s;for(var h=0;h<c;h++){var d="VARCHAR(255)";"int"!=r.types[h]&&"float"!=r.types[h]||(d=r.types[h].toUpperCase()),l+=a+""+r.names[h]+" "+d,h<c-1&&(l+=","),l+=s}l+=");"+s,l+="INSERT INTO converter "+s+a+"(";for(var f=0;f<c;f++)l+=r.names[f],f<c-1&&(l+=",");l+=") "+s+"VALUES "+s;for(var p=0;p<u;p++){l+=a+"(";for(var g=0;g<c;g++)"int"==r.types[g]||"float"==r.types[g]?l+=o[p][g]||"null":l+="'"+(o[p][g]||"")+"'",g<c-1&&(l+=",");l+=")",p<u-1&&(l+=","+s)}return l+=";"},r.prototype.php=function(t,e){var n,o=i({},this.options,e),r=(t=i({},t)).data,a=t.header||o.header,s=o.indent,l=o.newline,u="",c=r.length,h=a.names.length;u+="array("+l;for(var d=0;d<c;d++){var f=r[d];u+=s+"array(";for(var p=0;p<h;p++)n="int"==a.types[p]||"float"==a.types[p]?f[p]||"null":'"'+(f[p]||"")+'"',u+='"'+a.names[p]+'"=>'+n,p<h-1&&(u+=",");u+=")",d<c-1&&(u+=","+l)}return u+=l+");"},r.prototype.python=function(t,e){for(var n,o=i({},this.options,e),r=(t=i({},t)).data,a=t.header||o.header,s=o.newline,l="[",u=r.length,c=a.names.length,h=0;h<u;h++){var d=r[h];l+="{";for(var f=0;f<c;f++)n="int"==a.types[f]||"float"==a.types[f]?d[f]||"None":'"'+(d[f]||"")+'"',l+='"'+a.names[f]+'":'+n,f<c-1&&(l+=",");l+="}",h<u-1&&(l+=","+s)}return l+="];"},r.prototype.ruby=function(t,e){var n,o=i({},this.options,e),r=(t=i({},t)).data,a=t.header||o.header,s=o.newline,l="",u=r.length,c=a.names.length;l+="[";for(var h=0;h<u;h++){var d=r[h];l+="{";for(var f=0;f<c;f++)n="int"==a.types[f]||"float"==a.types[f]?d[f]||"nil":'"'+(d[f]||"")+'"',l+='"'+a.names[f]+'"=>'+n,f<c-1&&(l+=",");l+="}",h<u-1&&(l+=","+s)}return l+="];"},r.prototype.xml=function(t,e){var n=i({},this.options,e),o=(t=i({},t)).data,r=t.header||n.header,a=n.indent,s=n.newline,l="",u=o.length,c=r.names.length;l='<?xml version="1.0" encoding="UTF-8"?>'+s,l+="<rows>"+s;for(var h=0;h<u;h++){var d=o[h];l+=a+"<row>"+s;for(var f=0;f<c;f++)l+=a+a+"<"+r.names[f]+">",l+=d[f]||"",l+="</"+r.names[f]+">"+s;l+=a+"</row>"+s}return l+="</rows>"},r.prototype.xmlProperties=function(t,e){var n=i({},this.options,e),o=(t=i({},t)).data,r=t.header||n.header,a=n.indent,s=n.newline,l="",u=o.length,c=r.names.length;l='<?xml version="1.0" encoding="UTF-8"?>'+s,l+="<rows>"+s;for(var h=0;h<u;h++){var d=o[h];l+=a+"<row ";for(var f=0;f<c;f++)l+=r.names[f]+"=",l+='"'+d[f]+'" ';l+="></row>"+s}return l+="</rows>"},r.prototype.xmlIllustrator=function(t,e){var n=i({},this.options,e),o=(t=i({},t)).data,r=t.header||n.header,a=n.indent,s=n.newline,l="",u=o.length,c=r.names.length;l='<?xml version="1.0" encoding="utf-8"?>'+s,l+='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd" ['+s,l+=a+'<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">'+s,l+=a+'<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">'+s,l+=a+'<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">'+s,l+=a+'<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">'+s,l+=a+'<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">'+s,l+=a+'<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">'+s,l+="]>"+s,l+="<svg>"+s,l+='<variableSets xmlns="&ns_vars;">'+s,l+=a+'<variableSet varSetName="binding1" locked="none">'+s,l+=a+a+"<variables>"+s;for(var h=0;h<c;h++)l+=a+a+a+'<variable varName="'+r.names[h]+'" trait="textcontent" category="&ns_flows;"></variable>'+s;l+=a+a+"</variables>"+s,l+=a+a+'<v:sampleDataSets xmlns:v="http://ns.adobe.com/Variables/1.0/" xmlns="http://ns.adobe.com/GenericCustomNamespace/1.0/">'+s;for(var d=0;d<u;d++){var f=o[d];l+=a+a+a+'<v:sampleDataSet dataSetName="'+f[0]+'">'+s;for(var p=0;p<c;p++)l+=a+a+a+a+"<"+r.names[p]+">"+s,l+=a+a+a+a+a+"<p>"+f[p]+"</p>"+s,l+=a+a+a+a+"</"+r.names[p]+">"+s;l+=a+a+a+"</v:sampleDataSet>"+s}return l+=a+a+"</v:sampleDataSets>"+s,l+=a+"</variableSet>"+s,l+="</variableSets>"+s,l+="</svg>"+s},t.exports=r},function(t,e,n){"use strict";
+/*!
+ * isobject <https://github.com/jonschlinkert/isobject>
+ *
+ * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */var i=n(445);t.exports=function(t){return null!=t&&"object"==typeof t&&!1===i(t)}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";
+/*!
+ * is-extendable <https://github.com/jonschlinkert/is-extendable>
+ *
+ * Copyright (c) 2015-2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */var i=n(447);t.exports=function(t){return i(t)||"function"==typeof t||Array.isArray(t)}},function(t,e,n){"use strict";
+/*!
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
+ *
+ * Copyright (c) 2014-2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */var i=n(448);function o(t){return!0===i(t)&&"[object Object]"===Object.prototype.toString.call(t)}t.exports=function(t){var e,n;return!1!==o(t)&&("function"==typeof(e=t.constructor)&&(!1!==o(n=e.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))}},function(t,e,n){"use strict";
+/*!
+ * isobject <https://github.com/jonschlinkert/isobject>
+ *
+ * Copyright (c) 2014-2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */t.exports=function(t){return null!=t&&"object"==typeof t&&!1===Array.isArray(t)}},function(t,e,n){"use strict";
+/*!
+ * for-in <https://github.com/jonschlinkert/for-in>
+ *
+ * Copyright (c) 2014-2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */t.exports=function(t,e,n){for(var i in t)if(!1===e.call(n,t[i],i,t))break}},function(t,e,n){"use strict";var i=n(451),o=n(100),r=n(177),a=/^\s*(\+|-)?((\d+([,\.]\d+)?)|([,\.]\d+))\s*$/;function s(t){this.options=r({},{headers:{included:!1,downcase:!0,upcase:!0},delimiter:"tab",decimalSign:"comma"},t)}s.prototype.parse=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");var n=o({},this.options,e),r=[],s=((t=t.replace(/(\r|\r\n)/g,"")).match(/,/g)||[]).length,l=(t.match(/\t/g)||[]).length;n.delimiter;for(var u=(r=function(t,e){var n,i=o({delim:","},e),r=new RegExp("(\\"+i.delim+'|\\n|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+i.delim+"\\n]*))","gi"),a=[[]],s=null;for(;s=r.exec(t);){var l=s[1];l.length&&l!=i.delim&&a.push([]),n=s[2]?s[2].replace(/""/g,'"'):s[3],a[a.length-1].push(n)}return a}(t=t.replace(/^\n+|\n+$/g,""),n)).length-1;u>=0;u--)for(var c=r[u].length-1;c>=0;c--)r[u][c]=r[u][c].replace(/([\t\n])/,"\\$1");var h=[],d=[],f=r[0].length;r.length;if(n.headers.included)h=r.splice(0,1)[0],r.length;else for(var p=0;p<f;p++)h.push("val"+String(p)),d.push("");if(n.headers.upcase)for(var g=h.length-1;g>=0;g--)h[g]=h[g].toUpperCase();if(n.headers.downcase)for(var m=h.length-1;m>=0;m--)h[m]=h[m].toLowerCase();for(var v=0;v<r.length;v++){r[v].length!=f&&this.log("Error parsing row "+String(v)+". Wrong number of columns.")}for(var y=r.length,b=0;b<h.length;b++){for(var w=0,_=0,x=0;x<y;x++)r[x]&&("comma"===n.decimalSign&&a.test(r[x][b])&&(r[x][b]=r[x][b].replace(",",".")),i(r[x][b])&&(_++,String(r[x][b]).indexOf(".")>0&&w++));d[u]=_/y>.9?w>0?"float":"int":"string"}return{data:r,header:{names:h,types:d}}},t.exports=s},function(t,e,n){"use strict";
+/*!
+ * is-number <https://github.com/jonschlinkert/is-number>
+ *
+ * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */var i=n(452);t.exports=function(t){var e=i(t);if("number"!==e&&"string"!==e)return!1;var n=+t;return n-n+1>=0&&""!==t}},function(t,e,n){var i=n(453),o=Object.prototype.toString;t.exports=function(t){if(void 0===t)return"undefined";if(null===t)return"null";if(!0===t||!1===t||t instanceof Boolean)return"boolean";if("string"==typeof t||t instanceof String)return"string";if("number"==typeof t||t instanceof Number)return"number";if("function"==typeof t||t instanceof Function)return"function";if(void 0!==Array.isArray&&Array.isArray(t))return"array";if(t instanceof RegExp)return"regexp";if(t instanceof Date)return"date";var e=o.call(t);return"[object RegExp]"===e?"regexp":"[object Date]"===e?"date":"[object Arguments]"===e?"arguments":"[object Error]"===e?"error":i(t)?"buffer":"[object Set]"===e?"set":"[object WeakSet]"===e?"weakset":"[object Map]"===e?"map":"[object WeakMap]"===e?"weakmap":"[object Symbol]"===e?"symbol":"[object Int8Array]"===e?"int8array":"[object Uint8Array]"===e?"uint8array":"[object Uint8ClampedArray]"===e?"uint8clampedarray":"[object Int16Array]"===e?"int16array":"[object Uint16Array]"===e?"uint16array":"[object Int32Array]"===e?"int32array":"[object Uint32Array]"===e?"uint32array":"[object Float32Array]"===e?"float32array":"[object Float64Array]"===e?"float64array":"object"}},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
+/*!
+ * Determine if an object is a Buffer
+ *
+ * @author Feross Aboukhadijeh <https://feross.org>
+ * @license MIT
+ */
+t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PieCharts=e.CountriesByYear=void 0;var i=r(n(455)),o=r(n(460));function r(t){return t&&t.__esModule?t:{default:t}}e.CountriesByYear=i.default,e.PieCharts=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=g(n(126)),o=g(n(66)),r=g(n(45)),a=g(n(12)),s=g(n(7)),l=g(n(8)),u=g(n(13)),c=g(n(14)),h=n(2),d=g(h),f=(n(21),n(17),n(11),g(n(178)));n(179),n(180);var p=n(181);function g(t){return t&&t.__esModule?t:{default:t}}var m=function(t){function e(){return(0,s.default)(this,e),(0,u.default)(this,(e.__proto__||(0,a.default)(e)).apply(this,arguments))}return(0,c.default)(e,t),(0,l.default)(e,[{key:"render",value:function(){var t=this.props.payload.data,e=t.paper,n=t.citations;if(!n.length)return null;var a={},s={};n.forEach(function(t){var e=t.year,n=t.addresses;e&&parseInt(e)&&(e=parseInt(e),a[e]=a[e]||{},n.forEach(function(t){var n=t.country;n&&(n in s?s[n]+=1:s[n]=1,n in a[e]?a[e][n]+=1:a[e][n]=1)}))});for(var l=(0,r.default)(a).map(function(t){return parseInt(t)}).sort(),u=l[0];u<l[-1];u++)u in a||(a[u]={});l=(0,r.default)(a).map(function(t){return parseInt(t)}).sort(),(0,r.default)(s).forEach(function(t){l.forEach(function(e){t in a[e]||(a[e][t]=0)})});var c=(0,r.default)(s).sort(function(t,e){return s[e]-s[t]}),h=c.slice(0,p.topCountryCount),g=c.slice(p.topCountryCount),m=[["x"].concat(l.map(function(t){return String(t)}))].concat(h.map(function(t){return[t].concat(l.map(function(e){return a[e][t]}))}));g.length&&m.push([p.otherCountriesLabel].concat(l.map(function(t){return g.reduce(function(e,n){return e+a[t][n]},0)})));for(var v=0,y=0,b=1;b<m[0].length;b++){y=0;for(var w=1;w<m.length;w++)y+=m[w][b];v=Math.max(y,v)}for(var _=[],x=0;x<v;x+=50)_.push(x);_[_.length-1]<v&&_.push("");var S=p.rainbow;return d.default.createElement("div",{className:"chart"},d.default.createElement(f.default,{data:{x:"x",columns:m,type:"bar",groups:[h.concat(p.otherCountriesLabel)]},axis:{x:{type:"category"},y:{show:!1},y2:{tick:{values:_},default:[0,286*v/261],show:!0}},legend:{position:"right"},color:{pattern:S},tooltip:{contents:function(t){var e=a[l[t[0].x]],n=(0,r.default)(e).map(function(t){return[t,e[t]]}).sort(function(t,e){return e[1]-t[1]}),s=n.slice(0,p.topCountryCount),u=n.slice(p.topCountryCount).reduce(function(t,e){return t+e[1]},0);s.push([p.otherCountriesLabel,u]);var c=s.filter(function(t){return!!t[1]}).map(function(t){var e=(0,o.default)(t,2),n=e[0],i=e[1],r=h.indexOf(n);return r<0&&(r=S.length-1),["<tr>","<td>","<span style='background-color:"+S[r]+"' class='swatch'></span>",n,"</td>","<td>",i,"</td>","</tr>"].join("")});return["<table class='c3-tooltip'>"].concat((0,i.default)(c),["</table>"]).join("")}}}),e.vetting&&d.default.createElement("div",{className:"caption"},e.name," dataset citations per country per year. We confirmed use of the dataset in ",n.length," papers, out of ",e.vetting.total," citations vetted."))}}]),e}(h.Component);e.default=m},function(t,e,n){
+/* @license C3.js v0.4.23 | (c) C3 Team and other contributors | http://c3js.org/ */
+!function(e,n){t.exports=n()}(0,function(){"use strict";var t,e,i={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcLabelLine:"c3-arc-label-line",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},s=function(t){return t||0===t},l=function(t){return"function"==typeof t},u=function(t){return Array.isArray(t)},c=function(t){return"string"==typeof t},h=function(t){return void 0===t},d=function(t){return void 0!==t},f=function(t){return 10*Math.ceil(t/10)},p=function(t){return Math.ceil(t)+.5},g=function(t){return t[1]-t[0]},m=function(t){return void 0===t||null===t||c(t)&&0===t.length||"object"===(void 0===t?"undefined":o(t))&&0===Object.keys(t).length},v=function(t){return!C.isEmpty(t)},y=function(t,e,n){return d(t[e])?t[e]:n},b=function(t,e){var n=!1;return Object.keys(t).forEach(function(i){t[i]===e&&(n=!0)}),n},w=function(t){return"string"==typeof t?t.replace(/</g,"&lt;").replace(/>/g,"&gt;"):t},_=function(t){var e=t.getBoundingClientRect(),n=[t.pathSegList.getItem(0),t.pathSegList.getItem(1)];return{x:n[0].x,y:Math.min(n[0].y,n[1].y),width:e.width,height:e.height}};function x(t,e){this.component=t,this.params=e||{},this.d3=t.d3,this.scale=this.d3.scale.linear(),this.range,this.orient="bottom",this.innerTickSize=6,this.outerTickSize=this.params.withOuterTick?6:0,this.tickPadding=3,this.tickValues=null,this.tickFormat,this.tickArguments,this.tickOffset=0,this.tickCulling=!0,this.tickCentered,this.tickTextCharSize,this.tickTextRotate=this.params.tickTextRotate,this.tickLength,this.axis=this.generateAxis()}(e=x.prototype).axisX=function(t,e,n){t.attr("transform",function(t){return"translate("+Math.ceil(e(t)+n)+", 0)"})},e.axisY=function(t,e){t.attr("transform",function(t){return"translate(0,"+Math.ceil(e(t))+")"})},e.scaleExtent=function(t){var e=t[0],n=t[t.length-1];return e<n?[e,n]:[n,e]},e.generateTicks=function(t){var e,n,i=[];if(t.ticks)return t.ticks.apply(t,this.tickArguments);for(n=t.domain(),e=Math.ceil(n[0]);e<n[1];e++)i.push(e);return i.length>0&&i[0]>0&&i.unshift(i[0]-(i[1]-i[0])),i},e.copyScale=function(){var t,e=this.scale.copy();return this.params.isCategory&&(t=this.scale.domain(),e.domain([t[0],t[1]-1])),e},e.textFormatted=function(t){var e=this.tickFormat?this.tickFormat(t):t;return void 0!==e?e:""},e.updateRange=function(){return this.range=this.scale.rangeExtent?this.scale.rangeExtent():this.scaleExtent(this.scale.range()),this.range},e.updateTickTextCharSize=function(t){var e=this;if(e.tickTextCharSize)return e.tickTextCharSize;var n={h:11.5,w:5.5};return t.select("text").text(function(t){return e.textFormatted(t)}).each(function(t){var i=this.getBoundingClientRect(),o=e.textFormatted(t),r=i.height,a=o?i.width/o.length:void 0;r&&a&&(n.h=r,n.w=a)}).text(""),e.tickTextCharSize=n,n},e.transitionise=function(t){return this.params.withoutTransition?t:this.d3.transition(t)},e.isVertical=function(){return"left"===this.orient||"right"===this.orient},e.tspanData=function(t,e,n,i){var o=this.params.tickMultiline?this.splitTickText(t,n,i):[].concat(this.textFormatted(t));return this.params.tickMultiline&&this.params.tickMultilineMax>0&&(o=this.ellipsify(o,this.params.tickMultilineMax)),o.map(function(t){return{index:e,splitted:t,length:o.length}})},e.splitTickText=function(t,e,n){var i,o,r,a=this,s=a.textFormatted(t),l=a.params.tickWidth;if("[object Array]"===Object.prototype.toString.call(s))return s;return(!l||l<=0)&&(l=a.isVertical()?95:a.params.isCategory?Math.ceil(n(e[1])-n(e[0]))-12:110),function t(e,n){o=void 0;for(var s=1;s<n.length;s++)if(" "===n.charAt(s)&&(o=s),i=n.substr(0,s+1),r=a.tickTextCharSize.w*i.length,l<r)return t(e.concat(n.substr(0,o||s)),n.slice(o?o+1:s));return e.concat(n)}([],s+"")},e.ellipsify=function(t,e){if(t.length<=e)return t;for(var n=t.slice(0,e),i=3,o=e-1;o>=0;o--){var r=n[o].length;if(n[o]=n[o].substr(0,r-i).padEnd(r,"."),(i-=r)<=0)break}return n},e.updateTickLength=function(){this.tickLength=Math.max(this.innerTickSize,0)+this.tickPadding},e.lineY2=function(t){var e=this.scale(t)+(this.tickCentered?0:this.tickOffset);return this.range[0]<e&&e<this.range[1]?this.innerTickSize:0},e.textY=function(){var t=this.tickTextRotate;return t?11.5-t/15*2.5*(t>0?1:-1):this.tickLength},e.textTransform=function(){var t=this.tickTextRotate;return t?"rotate("+t+")":""},e.textTextAnchor=function(){var t=this.tickTextRotate;return t?t>0?"start":"end":"middle"},e.tspanDx=function(){var t=this.tickTextRotate;return t?8*Math.sin(Math.PI*(t/180)):0},e.tspanDy=function(t,e){var n=this.tickTextCharSize.h;return 0===e&&(n=this.isVertical()?-((t.length-1)*(this.tickTextCharSize.h/2)-3):".71em"),n},e.generateAxis=function(){var t=this,e=t.d3,n=t.params;function i(o){o.each(function(){var o,r,a,s=i.g=e.select(this),l=this.__chart__||t.scale,u=this.__chart__=t.copyScale(),c=t.tickValues?t.tickValues:t.generateTicks(u),h=s.selectAll(".tick").data(c,u),d=h.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),f=h.exit().remove(),p=t.transitionise(h).style("opacity",1);n.isCategory?(t.tickOffset=Math.ceil((u(1)-u(0))/2),r=t.tickCentered?0:t.tickOffset,a=t.tickCentered?t.tickOffset:0):t.tickOffset=r=0,d.append("line"),d.append("text"),t.updateRange(),t.updateTickLength(),t.updateTickTextCharSize(s.select(".tick"));var g=p.select("line"),m=p.select("text"),v=h.select("text").selectAll("tspan").data(function(e,n){return t.tspanData(e,n,c,u)});v.enter().append("tspan"),v.exit().remove(),v.text(function(t){return t.splitted});var y=s.selectAll(".domain").data([0]),b=(y.enter().append("path").attr("class","domain"),t.transitionise(y));switch(t.orient){case"bottom":o=t.axisX,g.attr("x1",r).attr("x2",r).attr("y2",function(e,n){return t.lineY2(e,n)}),m.attr("x",0).attr("y",function(e,n){return t.textY(e,n)}).attr("transform",function(e,n){return t.textTransform(e,n)}).style("text-anchor",function(e,n){return t.textTextAnchor(e,n)}),v.attr("x",0).attr("dy",function(e,n){return t.tspanDy(e,n)}).attr("dx",function(e,n){return t.tspanDx(e,n)}),b.attr("d","M"+t.range[0]+","+t.outerTickSize+"V0H"+t.range[1]+"V"+t.outerTickSize);break;case"top":o=t.axisX,g.attr("x1",r).attr("x2",r).attr("y2",function(e,n){return-1*t.lineY2(e,n)}),m.attr("x",0).attr("y",function(e,i){return-1*t.textY(e,i)-(n.isCategory?2:t.tickLength-2)}).attr("transform",function(e,n){return t.textTransform(e,n)}).style("text-anchor",function(e,n){return t.textTextAnchor(e,n)}),v.attr("x",0).attr("dy",function(e,n){return t.tspanDy(e,n)}).attr("dx",function(e,n){return t.tspanDx(e,n)}),b.attr("d","M"+t.range[0]+","+-t.outerTickSize+"V0H"+t.range[1]+"V"+-t.outerTickSize);break;case"left":o=t.axisY,g.attr("x2",-t.innerTickSize).attr("y1",a).attr("y2",a),m.attr("x",-t.tickLength).attr("y",t.tickOffset).style("text-anchor","end"),v.attr("x",-t.tickLength).attr("dy",function(e,n){return t.tspanDy(e,n)}),b.attr("d","M"+-t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+-t.outerTickSize);break;case"right":o=t.axisY,g.attr("x2",t.innerTickSize).attr("y1",a).attr("y2",a),m.attr("x",t.tickLength).attr("y",t.tickOffset).style("text-anchor","start"),v.attr("x",t.tickLength).attr("dy",function(e,n){return t.tspanDy(e,n)}),b.attr("d","M"+t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+t.outerTickSize)}if(u.rangeBand){var w=u,_=w.rangeBand()/2;l=u=function(t){return w(t)+_}}else l.rangeBand?l=u:f.call(o,u,t.tickOffset);d.call(o,l,t.tickOffset),p.call(o,u,t.tickOffset)})}return i.scale=function(e){return arguments.length?(t.scale=e,i):t.scale},i.orient=function(e){return arguments.length?(t.orient=e in{top:1,right:1,bottom:1,left:1}?e+"":"bottom",i):t.orient},i.tickFormat=function(e){return arguments.length?(t.tickFormat=e,i):t.tickFormat},i.tickCentered=function(e){return arguments.length?(t.tickCentered=e,i):t.tickCentered},i.tickOffset=function(){return t.tickOffset},i.tickInterval=function(){var e;return(e=n.isCategory?2*t.tickOffset:(i.g.select("path.domain").node().getTotalLength()-2*t.outerTickSize)/i.g.selectAll("line").size())===1/0?0:e},i.ticks=function(){return arguments.length?(t.tickArguments=arguments,i):t.tickArguments},i.tickCulling=function(e){return arguments.length?(t.tickCulling=e,i):t.tickCulling},i.tickValues=function(e){if("function"==typeof e)t.tickValues=function(){return e(t.scale.domain())};else{if(!arguments.length)return t.tickValues;t.tickValues=e}return i},i};var S=function(n){function i(n){r(this,i);var o={fn:t,internal:{fn:e}},s=a(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,n,"axis",o));return s.d3=n.d3,s.internal=x,s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(i,M),i}();(t=S.prototype).init=function(){var t=this.owner,e=t.config,n=t.main;t.axes.x=n.append("g").attr("class",i.axis+" "+i.axisX).attr("clip-path",e.axis_x_inner?"":t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",e.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",i.axisXLabel).attr("transform",e.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=n.append("g").attr("class",i.axis+" "+i.axisY).attr("clip-path",e.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",e.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",i.axisYLabel).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=n.append("g").attr("class",i.axis+" "+i.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",e.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",i.axisY2Label).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},t.getXAxis=function(t,e,n,i,o,r,a){var s=this.owner,l=s.config,u={isCategory:s.isCategorized(),withOuterTick:o,tickMultiline:l.axis_x_tick_multiline,tickMultilineMax:l.axis_x_tick_multiline?Number(l.axis_x_tick_multilineMax):0,tickWidth:l.axis_x_tick_width,tickTextRotate:a?0:l.axis_x_tick_rotate,withoutTransition:r},c=new this.internal(this,u).axis.scale(t).orient(e);return s.isTimeSeries()&&i&&"function"!=typeof i&&(i=i.map(function(t){return s.parseDate(t)})),c.tickFormat(n).tickValues(i),s.isCategorized()&&(c.tickCentered(l.axis_x_tick_centered),m(l.axis_x_tick_culling)&&(l.axis_x_tick_culling=!1)),c},t.updateXAxisTickValues=function(t,e){var n,i=this.owner,o=i.config;return(o.axis_x_tick_fit||o.axis_x_tick_count)&&(n=this.generateTickValues(i.mapTargetsToUniqueXs(t),o.axis_x_tick_count,i.isTimeSeries())),e?e.tickValues(n):(i.xAxis.tickValues(n),i.subXAxis.tickValues(n)),n},t.getYAxis=function(t,e,n,i,o,r,a){var s=this.owner,l=s.config,u={withOuterTick:o,withoutTransition:r,tickTextRotate:a?0:l.axis_y_tick_rotate},c=new this.internal(this,u).axis.scale(t).orient(e).tickFormat(n);return s.isTimeSeriesY()?c.ticks(s.d3.time[l.axis_y_tick_time_value],l.axis_y_tick_time_interval):c.tickValues(i),c},t.getId=function(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"},t.getXAxisTickFormat=function(){var t=this.owner,e=t.config,n=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(t){return t<0?t.toFixed(0):t};return e.axis_x_tick_format&&(l(e.axis_x_tick_format)?n=e.axis_x_tick_format:t.isTimeSeries()&&(n=function(n){return n?t.axisTimeFormat(e.axis_x_tick_format)(n):""})),l(n)?function(e){return n.call(t,e)}:n},t.getTickValues=function(t,e){return t||(e?e.tickValues():void 0)},t.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},t.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},t.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},t.getLabelOptionByAxisId=function(t){var e,n=this.owner.config;return"y"===t?e=n.axis_y_label:"y2"===t?e=n.axis_y2_label:"x"===t&&(e=n.axis_x_label),e},t.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return c(e)?e:e?e.text:null},t.setLabelText=function(t,e){var n=this.owner.config,i=this.getLabelOptionByAxisId(t);c(i)?"y"===t?n.axis_y_label=e:"y2"===t?n.axis_y2_label=e:"x"===t&&(n.axis_x_label=e):i&&(i.text=e)},t.getLabelPosition=function(t,e){var n=this.getLabelOptionByAxisId(t),i=n&&"object"===(void 0===n?"undefined":o(n))&&n.position?n.position:e;return{isInner:i.indexOf("inner")>=0,isOuter:i.indexOf("outer")>=0,isLeft:i.indexOf("left")>=0,isCenter:i.indexOf("center")>=0,isRight:i.indexOf("right")>=0,isTop:i.indexOf("top")>=0,isMiddle:i.indexOf("middle")>=0,isBottom:i.indexOf("bottom")>=0}},t.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},t.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},t.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},t.getLabelPositionById=function(t){return"y2"===t?this.getY2AxisLabelPosition():"y"===t?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},t.textForXAxisLabel=function(){return this.getLabelText("x")},t.textForYAxisLabel=function(){return this.getLabelText("y")},t.textForY2AxisLabel=function(){return this.getLabelText("y2")},t.xForAxisLabel=function(t,e){var n=this.owner;return t?e.isLeft?0:e.isCenter?n.width/2:n.width:e.isBottom?-n.height:e.isMiddle?-n.height/2:0},t.dxForAxisLabel=function(t,e){return t?e.isLeft?"0.5em":e.isRight?"-0.5em":"0":e.isTop?"-0.5em":e.isBottom?"0.5em":"0"},t.textAnchorForAxisLabel=function(t,e){return t?e.isLeft?"start":e.isCenter?"middle":"end":e.isBottom?"start":e.isMiddle?"middle":"end"},t.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},t.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},t.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},t.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},t.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},t.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},t.dyForXAxisLabel=function(){var t=this.owner,e=t.config,n=this.getXAxisLabelPosition();return e.axis_rotated?n.isInner?"1.2em":-25-(t.config.axis_x_inner?0:this.getMaxTickWidth("x")):n.isInner?"-0.5em":e.axis_x_height?e.axis_x_height-10:"3em"},t.dyForYAxisLabel=function(){var t=this.owner,e=this.getYAxisLabelPosition();return t.config.axis_rotated?e.isInner?"-0.5em":"3em":e.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},t.dyForY2AxisLabel=function(){var t=this.owner,e=this.getY2AxisLabelPosition();return t.config.axis_rotated?e.isInner?"1.2em":"-2.2em":e.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},t.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},t.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},t.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},t.getMaxTickWidth=function(t,e){var n,i,o,r,a=this.owner,s=a.config,l=0;return e&&a.currentMaxTickWidths[t]?a.currentMaxTickWidths[t]:(a.svg&&(n=a.filterTargetsToShow(a.data.targets),"y"===t?(i=a.y.copy().domain(a.getYDomain(n,"y")),o=this.getYAxis(i,a.yOrient,s.axis_y_tick_format,a.yAxisTickValues,!1,!0,!0)):"y2"===t?(i=a.y2.copy().domain(a.getYDomain(n,"y2")),o=this.getYAxis(i,a.y2Orient,s.axis_y2_tick_format,a.y2AxisTickValues,!1,!0,!0)):(i=a.x.copy().domain(a.getXDomain(n)),o=this.getXAxis(i,a.xOrient,a.xAxisTickFormat,a.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(n,o)),(r=a.d3.select("body").append("div").classed("c3",!0)).append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0).append("g").call(o).each(function(){a.d3.select(this).selectAll("text").each(function(){var t=this.getBoundingClientRect();l<t.width&&(l=t.width)}),r.remove()})),a.currentMaxTickWidths[t]=l<=0?a.currentMaxTickWidths[t]:l,a.currentMaxTickWidths[t])},t.updateLabels=function(t){var e=this.owner,n=e.main.select("."+i.axisX+" ."+i.axisXLabel),o=e.main.select("."+i.axisY+" ."+i.axisYLabel),r=e.main.select("."+i.axisY2+" ."+i.axisY2Label);(t?n.transition():n).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(t?o.transition():o).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(t?r.transition():r).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},t.getPadding=function(t,e,n,i){var o="number"==typeof t?t:t[e];return s(o)?"ratio"===t.unit?t[e]*i:this.convertPixelsToAxisPadding(o,i):n},t.convertPixelsToAxisPadding=function(t,e){var n=this.owner;return e*(t/(n.config.axis_rotated?n.width:n.height))},t.generateTickValues=function(t,e,n){var i,o,r,a,s,u,c,h=t;if(e)if(1===(i=l(e)?e():e))h=[t[0]];else if(2===i)h=[t[0],t[t.length-1]];else if(i>2){for(a=i-2,o=t[0],s=((r=t[t.length-1])-o)/(a+1),h=[o],u=0;u<a;u++)c=+o+s*(u+1),h.push(n?new Date(c):c);h.push(r)}return n||(h=h.sort(function(t,e){return t-e})),h},t.generateTransitions=function(t){var e=this.owner.axes;return{axisX:t?e.x.transition().duration(t):e.x,axisY:t?e.y.transition().duration(t):e.y,axisY2:t?e.y2.transition().duration(t):e.y2,axisSubX:t?e.subx.transition().duration(t):e.subx}},t.redraw=function(t,e){var n=this.owner;n.axes.x.style("opacity",e?0:1),n.axes.y.style("opacity",e?0:1),n.axes.y2.style("opacity",e?0:1),n.axes.subx.style("opacity",e?0:1),t.axisX.call(n.xAxis),t.axisY.call(n.yAxis),t.axisY2.call(n.y2Axis),t.axisSubX.call(n.subXAxis)};var E,C,T={version:"0.4.23"};function M(t,e,n){this.owner=t,T.chart.internal[e]=n}function P(t){var e=this.internal=new L(this);e.loadConfig(t),e.beforeInit(t),e.init(),e.afterInit(t),function t(e,n,i){Object.keys(e).forEach(function(o){n[o]=e[o].bind(i),Object.keys(e[o]).length>0&&t(e[o],n[o],i)})}(E,this,this)}function L(t){var e=this;e.d3=window.d3?window.d3:n(457),e.api=t,e.config=e.getDefaultConfig(),e.data={},e.cache={},e.axes={}}return T.generate=function(t){return new P(t)},T.chart={fn:P.prototype,internal:{fn:L.prototype}},E=T.chart.fn,(C=T.chart.internal.fn).beforeInit=function(){},C.afterInit=function(){},C.init=function(){var t=this,e=t.config;if(t.initParams(),e.data_url)t.convertUrlToData(e.data_url,e.data_mimeType,e.data_headers,e.data_keys,t.initWithData);else if(e.data_json)t.initWithData(t.convertJsonToData(e.data_json,e.data_keys));else if(e.data_rows)t.initWithData(t.convertRowsToData(e.data_rows));else{if(!e.data_columns)throw Error("url or json or rows or columns is required.");t.initWithData(t.convertColumnsToData(e.data_columns))}},C.initParams=function(){var t=this,e=t.d3,n=t.config;t.clipId="c3-"+ +new Date+"-clip",t.clipIdForXAxis=t.clipId+"-xaxis",t.clipIdForYAxis=t.clipId+"-yaxis",t.clipIdForGrid=t.clipId+"-grid",t.clipIdForSubchart=t.clipId+"-subchart",t.clipPath=t.getClipPath(t.clipId),t.clipPathForXAxis=t.getClipPath(t.clipIdForXAxis),t.clipPathForYAxis=t.getClipPath(t.clipIdForYAxis),t.clipPathForGrid=t.getClipPath(t.clipIdForGrid),t.clipPathForSubchart=t.getClipPath(t.clipIdForSubchart),t.dragStart=null,t.dragging=!1,t.flowing=!1,t.cancelClick=!1,t.mouseover=!1,t.transiting=!1,t.color=t.generateColor(),t.levelColor=t.generateLevelColor(),t.dataTimeFormat=n.data_xLocaltime?e.time.format:e.time.format.utc,t.axisTimeFormat=n.axis_x_localtime?e.time.format:e.time.format.utc,t.defaultAxisTimeFormat=t.axisTimeFormat.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()}],["%-m/%-d",function(t){return t.getDay()&&1!==t.getDate()}],["%-m/%-d",function(t){return 1!==t.getDate()}],["%-m/%-d",function(t){return t.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),t.hiddenTargetIds=[],t.hiddenLegendIds=[],t.focusedTargetIds=[],t.defocusedTargetIds=[],t.xOrient=n.axis_rotated?n.axis_x_inner?"right":"left":n.axis_x_inner?"top":"bottom",t.yOrient=n.axis_rotated?n.axis_y_inner?"top":"bottom":n.axis_y_inner?"right":"left",t.y2Orient=n.axis_rotated?n.axis_y2_inner?"bottom":"top":n.axis_y2_inner?"left":"right",t.subXOrient=n.axis_rotated?"left":"bottom",t.isLegendRight="right"===n.legend_position,t.isLegendInset="inset"===n.legend_position,t.isLegendTop="top-left"===n.legend_inset_anchor||"top-right"===n.legend_inset_anchor,t.isLegendLeft="top-left"===n.legend_inset_anchor||"bottom-left"===n.legend_inset_anchor,t.legendStep=0,t.legendItemWidth=0,t.legendItemHeight=0,t.currentMaxTickWidths={x:0,y:0,y2:0},t.rotated_padding_left=30,t.rotated_padding_right=n.axis_rotated&&!n.axis_x_show?0:30,t.rotated_padding_top=5,t.withoutFadeIn={},t.intervalForObserveInserted=void 0,t.axes.subx=e.selectAll([])},C.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},C.initWithData=function(t){var e,n,o=this,r=o.d3,a=o.config,s=!0;o.axis=new S(o),o.initPie&&o.initPie(),o.initBrush&&o.initBrush(),o.initZoom&&o.initZoom(),a.bindto?"function"==typeof a.bindto.node?o.selectChart=a.bindto:o.selectChart=r.select(a.bindto):o.selectChart=r.selectAll([]),o.selectChart.empty()&&(o.selectChart=r.select(document.createElement("div")).style("opacity",0),o.observeInserted(o.selectChart),s=!1),o.selectChart.html("").classed("c3",!0),o.data.xs={},o.data.targets=o.convertDataToTargets(t),a.data_filter&&(o.data.targets=o.data.targets.filter(a.data_filter)),a.data_hide&&o.addHiddenTargetIds(!0===a.data_hide?o.mapToIds(o.data.targets):a.data_hide),a.legend_hide&&o.addHiddenLegendIds(!0===a.legend_hide?o.mapToIds(o.data.targets):a.legend_hide),o.updateSizes(),o.updateScales(),o.x.domain(r.extent(o.getXDomain(o.data.targets))),o.y.domain(o.getYDomain(o.data.targets,"y")),o.y2.domain(o.getYDomain(o.data.targets,"y2")),o.subX.domain(o.x.domain()),o.subY.domain(o.y.domain()),o.subY2.domain(o.y2.domain()),o.orgXDomain=o.x.domain(),o.brush&&o.brush.scale(o.subX),a.zoom_enabled&&o.zoom.scale(o.x),o.svg=o.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return a.onmouseover.call(o)}).on("mouseleave",function(){return a.onmouseout.call(o)}),o.config.svg_classname&&o.svg.attr("class",o.config.svg_classname),e=o.svg.append("defs"),o.clipChart=o.appendClip(e,o.clipId),o.clipXAxis=o.appendClip(e,o.clipIdForXAxis),o.clipYAxis=o.appendClip(e,o.clipIdForYAxis),o.clipGrid=o.appendClip(e,o.clipIdForGrid),o.clipSubchart=o.appendClip(e,o.clipIdForSubchart),o.updateSvgSize(),n=o.main=o.svg.append("g").attr("transform",o.getTranslate("main")),o.initSubchart&&o.initSubchart(),o.initTooltip&&o.initTooltip(),o.initLegend&&o.initLegend(),o.initTitle&&o.initTitle(),n.append("text").attr("class",i.text+" "+i.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),o.initRegion(),o.initGrid(),n.append("g").attr("clip-path",o.clipPath).attr("class",i.chart),a.grid_lines_front&&o.initGridLines(),o.initEventRect(),o.initChartElements(),n.insert("rect",a.zoom_privileged?null:"g."+i.regions).attr("class",i.zoomRect).attr("width",o.width).attr("height",o.height).style("opacity",0).on("dblclick.zoom",null),a.axis_x_extent&&o.brush.extent(o.getDefaultExtent()),o.axis.init(),o.updateTargets(o.data.targets),s&&(o.updateDimension(),o.config.oninit.call(o),o.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),o.bindResize(),o.api.element=o.selectChart.node()},C.smoothLines=function(t,e){var n=this;"grid"===e&&t.each(function(){var t=n.d3.select(this),e=t.attr("x1"),i=t.attr("x2"),o=t.attr("y1"),r=t.attr("y2");t.attr({x1:Math.ceil(e),x2:Math.ceil(i),y1:Math.ceil(o),y2:Math.ceil(r)})})},C.updateSizes=function(){var t=this,e=t.config,n=t.legend?t.getLegendHeight():0,i=t.legend?t.getLegendWidth():0,o=t.isLegendRight||t.isLegendInset?0:n,r=t.hasArcType(),a=e.axis_rotated||r?0:t.getHorizontalAxisHeight("x"),s=e.subchart_show&&!r?e.subchart_size_height+a:0;t.currentWidth=t.getCurrentWidth(),t.currentHeight=t.getCurrentHeight(),t.margin=e.axis_rotated?{top:t.getHorizontalAxisHeight("y2")+t.getCurrentPaddingTop(),right:r?0:t.getCurrentPaddingRight(),bottom:t.getHorizontalAxisHeight("y")+o+t.getCurrentPaddingBottom(),left:s+(r?0:t.getCurrentPaddingLeft())}:{top:4+t.getCurrentPaddingTop(),right:r?0:t.getCurrentPaddingRight(),bottom:a+s+o+t.getCurrentPaddingBottom(),left:r?0:t.getCurrentPaddingLeft()},t.margin2=e.axis_rotated?{top:t.margin.top,right:NaN,bottom:20+o,left:t.rotated_padding_left}:{top:t.currentHeight-s-o,right:NaN,bottom:a+o,left:t.margin.left},t.margin3={top:0,right:NaN,bottom:0,left:0},t.updateSizeForLegend&&t.updateSizeForLegend(n,i),t.width=t.currentWidth-t.margin.left-t.margin.right,t.height=t.currentHeight-t.margin.top-t.margin.bottom,t.width<0&&(t.width=0),t.height<0&&(t.height=0),t.width2=e.axis_rotated?t.margin.left-t.rotated_padding_left-t.rotated_padding_right:t.width,t.height2=e.axis_rotated?t.height:t.currentHeight-t.margin2.top-t.margin2.bottom,t.width2<0&&(t.width2=0),t.height2<0&&(t.height2=0),t.arcWidth=t.width-(t.isLegendRight?i+10:0),t.arcHeight=t.height-(t.isLegendRight?0:10),t.hasType("gauge")&&!e.gauge_fullCircle&&(t.arcHeight+=t.height-t.getGaugeLabelHeight()),t.updateRadius&&t.updateRadius(),t.isLegendRight&&r&&(t.margin3.left=t.arcWidth/2+1.1*t.radiusExpanded)},C.updateTargets=function(t){var e=this;e.updateTargetsForText(t),e.updateTargetsForBar(t),e.updateTargetsForLine(t),e.hasArcType()&&e.updateTargetsForArc&&e.updateTargetsForArc(t),e.updateTargetsForSubchart&&e.updateTargetsForSubchart(t),e.showTargets()},C.showTargets=function(){var t=this;t.svg.selectAll("."+i.target).filter(function(e){return t.isTargetToShow(e.id)}).transition().duration(t.config.transition_duration).style("opacity",1)},C.redraw=function(t,e){var n,o,r,a,s,l,u,c,h,d,f,p,g,m,v,b,w,_,x,S,E,C,T,M,P,L,A,k,O,R=this,D=R.main,j=R.d3,z=R.config,N=R.getShapeIndices(R.isAreaType),I=R.getShapeIndices(R.isBarType),F=R.getShapeIndices(R.isLineType),H=R.hasArcType(),G=R.filterTargetsToShow(R.data.targets),V=R.xv.bind(R);if(n=y(t=t||{},"withY",!0),o=y(t,"withSubchart",!0),r=y(t,"withTransition",!0),l=y(t,"withTransform",!1),u=y(t,"withUpdateXDomain",!1),c=y(t,"withUpdateOrgXDomain",!1),h=y(t,"withTrimXDomain",!0),g=y(t,"withUpdateXAxis",u),d=y(t,"withLegend",!1),f=y(t,"withEventRect",!0),p=y(t,"withDimension",!0),a=y(t,"withTransitionForExit",r),s=y(t,"withTransitionForAxis",r),x=r?z.transition_duration:0,S=a?x:0,E=s?x:0,e=e||R.axis.generateTransitions(E),d&&z.legend_show?R.updateLegend(R.mapToIds(R.data.targets),t,e):p&&R.updateDimension(!0),R.isCategorized()&&0===G.length&&R.x.domain([0,R.axes.x.selectAll(".tick").size()]),G.length?(R.updateXDomain(G,u,c,h),z.axis_x_tick_values||(M=R.axis.updateXAxisTickValues(G))):(R.xAxis.tickValues([]),R.subXAxis.tickValues([])),z.zoom_rescale&&!t.flow&&(A=R.x.orgDomain()),R.y.domain(R.getYDomain(G,"y",A)),R.y2.domain(R.getYDomain(G,"y2",A)),!z.axis_y_tick_values&&z.axis_y_tick_count&&R.yAxis.tickValues(R.axis.generateTickValues(R.y.domain(),z.axis_y_tick_count)),!z.axis_y2_tick_values&&z.axis_y2_tick_count&&R.y2Axis.tickValues(R.axis.generateTickValues(R.y2.domain(),z.axis_y2_tick_count)),R.axis.redraw(e,H),R.axis.updateLabels(r),(u||g)&&G.length)if(z.axis_x_tick_culling&&M){for(P=1;P<M.length;P++)if(M.length/P<z.axis_x_tick_culling_max){L=P;break}R.svg.selectAll("."+i.axisX+" .tick text").each(function(t){var e=M.indexOf(t);e>=0&&j.select(this).style("display",e%L?"none":"block")})}else R.svg.selectAll("."+i.axisX+" .tick text").style("display","block");m=R.generateDrawArea?R.generateDrawArea(N,!1):void 0,v=R.generateDrawBar?R.generateDrawBar(I):void 0,b=R.generateDrawLine?R.generateDrawLine(F,!1):void 0,w=R.generateXYForText(N,I,F,!0),_=R.generateXYForText(N,I,F,!1),n&&(R.subY.domain(R.getYDomain(G,"y")),R.subY2.domain(R.getYDomain(G,"y2"))),R.updateXgridFocus(),D.select("text."+i.text+"."+i.empty).attr("x",R.width/2).attr("y",R.height/2).text(z.data_empty_label_text).transition().style("opacity",G.length?0:1),R.updateGrid(x),R.updateRegion(x),R.updateBar(S),R.updateLine(S),R.updateArea(S),R.updateCircle(),R.hasDataLabel()&&R.updateText(S),R.redrawTitle&&R.redrawTitle(),R.redrawArc&&R.redrawArc(x,S,l),R.redrawSubchart&&R.redrawSubchart(o,e,x,S,N,I,F),D.selectAll("."+i.selectedCircles).filter(R.isBarType.bind(R)).selectAll("circle").remove(),z.interaction_enabled&&!t.flow&&f&&(R.redrawEventRect(),R.updateZoom&&R.updateZoom()),R.updateCircleY(),k=(R.config.axis_rotated?R.circleY:R.circleX).bind(R),O=(R.config.axis_rotated?R.circleX:R.circleY).bind(R),t.flow&&(T=R.generateFlow({targets:G,flow:t.flow,duration:t.flow.duration,drawBar:v,drawLine:b,drawArea:m,cx:k,cy:O,xv:V,xForText:w,yForText:_})),(x||T)&&R.isTabVisible()?j.transition().duration(x).each(function(){var e=[];[R.redrawBar(v,!0),R.redrawLine(b,!0),R.redrawArea(m,!0),R.redrawCircle(k,O,!0),R.redrawText(w,_,t.flow,!0),R.redrawRegion(!0),R.redrawGrid(!0)].forEach(function(t){t.forEach(function(t){e.push(t)})}),C=R.generateWait(),e.forEach(function(t){C.add(t)})}).call(C,function(){T&&T(),z.onrendered&&z.onrendered.call(R)}):(R.redrawBar(v),R.redrawLine(b),R.redrawArea(m),R.redrawCircle(k,O),R.redrawText(w,_,t.flow),R.redrawRegion(),R.redrawGrid(),z.onrendered&&z.onrendered.call(R)),R.mapToIds(R.data.targets).forEach(function(t){R.withoutFadeIn[t]=!0})},C.updateAndRedraw=function(t){var e,n=this,i=n.config;(t=t||{}).withTransition=y(t,"withTransition",!0),t.withTransform=y(t,"withTransform",!1),t.withLegend=y(t,"withLegend",!1),t.withUpdateXDomain=!0,t.withUpdateOrgXDomain=!0,t.withTransitionForExit=!1,t.withTransitionForTransform=y(t,"withTransitionForTransform",t.withTransition),n.updateSizes(),t.withLegend&&i.legend_show||(e=n.axis.generateTransitions(t.withTransitionForAxis?i.transition_duration:0),n.updateScales(),n.updateSvgSize(),n.transformAll(t.withTransitionForTransform,e)),n.redraw(t,e)},C.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},C.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},C.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},C.isCustomX=function(){var t=this.config;return!this.isTimeSeries()&&(t.data_x||v(t.data_xs))},C.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},C.getTranslate=function(t){var e,n,i=this,o=i.config;return"main"===t?(e=p(i.margin.left),n=p(i.margin.top)):"context"===t?(e=p(i.margin2.left),n=p(i.margin2.top)):"legend"===t?(e=i.margin3.left,n=i.margin3.top):"x"===t?(e=0,n=o.axis_rotated?0:i.height):"y"===t?(e=0,n=o.axis_rotated?i.height:0):"y2"===t?(e=o.axis_rotated?0:i.width,n=o.axis_rotated?1:0):"subx"===t?(e=0,n=o.axis_rotated?0:i.height2):"arc"===t&&(e=i.arcWidth/2,n=i.arcHeight/2-(i.hasType("gauge")?6:0)),"translate("+e+","+n+")"},C.initialOpacity=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?1:0},C.initialOpacityForCircle=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?this.opacityForCircle(t):0},C.opacityForCircle=function(t){var e=(l(this.config.point_show)?this.config.point_show(t):this.config.point_show)?1:0;return s(t.value)?this.isScatterType(t)?.5:e:0},C.opacityForText=function(){return this.hasDataLabel()?1:0},C.xx=function(t){return t?this.x(t.x):null},C.xv=function(t){var e=this,n=t.value;return e.isTimeSeries()?n=e.parseDate(t.value):e.isCategorized()&&"string"==typeof t.value&&(n=e.config.axis_x_categories.indexOf(t.value)),Math.ceil(e.x(n))},C.yv=function(t){var e=t.axis&&"y2"===t.axis?this.y2:this.y;return Math.ceil(e(t.value))},C.subxx=function(t){return t?this.subX(t.x):null},C.transformMain=function(t,e){var n,o,r,a=this;e&&e.axisX?n=e.axisX:(n=a.main.select("."+i.axisX),t&&(n=n.transition())),e&&e.axisY?o=e.axisY:(o=a.main.select("."+i.axisY),t&&(o=o.transition())),e&&e.axisY2?r=e.axisY2:(r=a.main.select("."+i.axisY2),t&&(r=r.transition())),(t?a.main.transition():a.main).attr("transform",a.getTranslate("main")),n.attr("transform",a.getTranslate("x")),o.attr("transform",a.getTranslate("y")),r.attr("transform",a.getTranslate("y2")),a.main.select("."+i.chartArcs).attr("transform",a.getTranslate("arc"))},C.transformAll=function(t,e){var n=this;n.transformMain(t,e),n.config.subchart_show&&n.transformContext(t,e),n.legend&&n.transformLegend(t)},C.updateSvgSize=function(){var t=this,e=t.svg.select(".c3-brush .background");t.svg.attr("width",t.currentWidth).attr("height",t.currentHeight),t.svg.selectAll(["#"+t.clipId,"#"+t.clipIdForGrid]).select("rect").attr("width",t.width).attr("height",t.height),t.svg.select("#"+t.clipIdForXAxis).select("rect").attr("x",t.getXAxisClipX.bind(t)).attr("y",t.getXAxisClipY.bind(t)).attr("width",t.getXAxisClipWidth.bind(t)).attr("height",t.getXAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForYAxis).select("rect").attr("x",t.getYAxisClipX.bind(t)).attr("y",t.getYAxisClipY.bind(t)).attr("width",t.getYAxisClipWidth.bind(t)).attr("height",t.getYAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForSubchart).select("rect").attr("width",t.width).attr("height",e.size()?e.attr("height"):0),t.svg.select("."+i.zoomRect).attr("width",t.width).attr("height",t.height),t.selectChart.style("max-height",t.currentHeight+"px")},C.updateDimension=function(t){var e=this;t||(e.config.axis_rotated?(e.axes.x.call(e.xAxis),e.axes.subx.call(e.subXAxis)):(e.axes.y.call(e.yAxis),e.axes.y2.call(e.y2Axis))),e.updateSizes(),e.updateScales(),e.updateSvgSize(),e.transformAll(!1)},C.observeInserted=function(t){var e,n=this;"undefined"!=typeof MutationObserver?(e=new MutationObserver(function(i){i.forEach(function(i){"childList"===i.type&&i.previousSibling&&(e.disconnect(),n.intervalForObserveInserted=window.setInterval(function(){t.node().parentNode&&(window.clearInterval(n.intervalForObserveInserted),n.updateDimension(),n.brush&&n.brush.update(),n.config.oninit.call(n),n.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity",1))},10))})})).observe(t.node(),{attributes:!0,childList:!0,characterData:!0}):window.console.error("MutationObserver not defined.")},C.bindResize=function(){var t=this,e=t.config;if(t.resizeFunction=t.generateResize(),t.resizeFunction.add(function(){e.onresize.call(t)}),e.resize_auto&&t.resizeFunction.add(function(){void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),t.resizeTimeout=window.setTimeout(function(){delete t.resizeTimeout,t.api.flush()},100)}),t.resizeFunction.add(function(){e.onresized.call(t)}),t.resizeIfElementDisplayed=function(){null!=t.api&&t.api.element.offsetParent&&t.resizeFunction()},window.attachEvent)window.attachEvent("onresize",t.resizeIfElementDisplayed);else if(window.addEventListener)window.addEventListener("resize",t.resizeIfElementDisplayed,!1);else{var n=window.onresize;n?n.add&&n.remove||(n=t.generateResize()).add(window.onresize):n=t.generateResize(),n.add(t.resizeFunction),window.onresize=function(){t.api.element.offsetParent&&n()}}},C.generateResize=function(){var t=[];function e(){t.forEach(function(t){t()})}return e.add=function(e){t.push(e)},e.remove=function(e){for(var n=0;n<t.length;n++)if(t[n]===e){t.splice(n,1);break}},e},C.endall=function(t,e){var n=0;t.each(function(){++n}).each("end",function(){--n||e.apply(this,arguments)})},C.generateWait=function(){var t=[],e=function(e,n){var i=setInterval(function(){var e=0;t.forEach(function(t){if(t.empty())e+=1;else try{t.transition()}catch(t){e+=1}}),e===t.length&&(clearInterval(i),n&&n())},10)};return e.add=function(e){t.push(e)},e},C.parseDate=function(t){var e;return t instanceof Date?e=t:"string"==typeof t?e=this.dataTimeFormat(this.config.data_xFormat).parse(t):"object"===(void 0===t?"undefined":o(t))?e=new Date(+t):"number"!=typeof t||isNaN(t)||(e=new Date(+t)),e&&!isNaN(+e)||window.console.error("Failed to parse x '"+t+"' to Date object"),e},C.isTabVisible=function(){var t;return void 0!==document.hidden?t="hidden":void 0!==document.mozHidden?t="mozHidden":void 0!==document.msHidden?t="msHidden":void 0!==document.webkitHidden&&(t="webkitHidden"),!document[t]},C.isValue=s,C.isFunction=l,C.isString=c,C.isUndefined=h,C.isDefined=d,C.ceil10=f,C.asHalfPixel=p,C.diffDomain=g,C.isEmpty=m,C.notEmpty=v,C.notEmpty=v,C.getOption=y,C.hasValue=b,C.sanitise=w,C.getPathBox=_,C.CLASS=i,Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,i=function(){},o=function(){return n.apply(this instanceof i?this:t,e.concat(Array.prototype.slice.call(arguments)))};return i.prototype=this.prototype,o.prototype=new i,o}),"SVGPathSeg"in window||(window.SVGPathSeg=function(t,e,n){this.pathSegType=t,this.pathSegTypeAsLetter=e,this._owningPathSegList=n},window.SVGPathSeg.prototype.classname="SVGPathSeg",window.SVGPathSeg.PATHSEG_UNKNOWN=0,window.SVGPathSeg.PATHSEG_CLOSEPATH=1,window.SVGPathSeg.PATHSEG_MOVETO_ABS=2,window.SVGPathSeg.PATHSEG_MOVETO_REL=3,window.SVGPathSeg.PATHSEG_LINETO_ABS=4,window.SVGPathSeg.PATHSEG_LINETO_REL=5,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,window.SVGPathSeg.PATHSEG_ARC_ABS=10,window.SVGPathSeg.PATHSEG_ARC_REL=11,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,window.SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},window.SVGPathSegClosePath=function(t){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CLOSEPATH,"z",t)},window.SVGPathSegClosePath.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},window.SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},window.SVGPathSegClosePath.prototype.clone=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathSegMovetoAbs=function(t,e,n){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_ABS,"M",t),this._x=e,this._y=n},window.SVGPathSegMovetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},window.SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoAbs.prototype.clone=function(){return new window.SVGPathSegMovetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegMovetoRel=function(t,e,n){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_REL,"m",t),this._x=e,this._y=n},window.SVGPathSegMovetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},window.SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoRel.prototype.clone=function(){return new window.SVGPathSegMovetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoAbs=function(t,e,n){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_ABS,"L",t),this._x=e,this._y=n},window.SVGPathSegLinetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},window.SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegLinetoAbs.prototype.clone=function(){return new window.SVGPathSegLinetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoRel=function(t,e,n){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_REL,"l",t),this._x=e,this._y=n},window.SVGPathSegLinetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},window.SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegLinetoRel.prototype.clone=function(){return new window.SVGPathSegLinetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicAbs=function(t,e,n,i,o,r,a){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",t),this._x=e,this._y=n,this._x1=i,this._y1=o,this._x2=r,this._y2=a},window.SVGPathSegCurvetoCubicAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},window.SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicAbs(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicRel=function(t,e,n,i,o,r,a){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",t),this._x=e,this._y=n,this._x1=i,this._y1=o,this._x2=r,this._y2=a},window.SVGPathSegCurvetoCubicRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},window.SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicRel(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticAbs=function(t,e,n,i,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",t),this._x=e,this._y=n,this._x1=i,this._y1=o},window.SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticRel=function(t,e,n,i,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",t),this._x=e,this._y=n,this._x1=i,this._y1=o},window.SVGPathSegCurvetoQuadraticRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticRel(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcAbs=function(t,e,n,i,o,r,a,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_ABS,"A",t),this._x=e,this._y=n,this._r1=i,this._r2=o,this._angle=r,this._largeArcFlag=a,this._sweepFlag=s},window.SVGPathSegArcAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},window.SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},window.SVGPathSegArcAbs.prototype.clone=function(){return new window.SVGPathSegArcAbs(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcRel=function(t,e,n,i,o,r,a,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_REL,"a",t),this._x=e,this._y=n,this._r1=i,this._r2=o,this._angle=r,this._largeArcFlag=a,this._sweepFlag=s},window.SVGPathSegArcRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},window.SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},window.SVGPathSegArcRel.prototype.clone=function(){return new window.SVGPathSegArcRel(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",t),this._x=e},window.SVGPathSegLinetoHorizontalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},window.SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalAbs(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",t),this._x=e},window.SVGPathSegLinetoHorizontalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},window.SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},window.SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalRel(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",t),this._y=e},window.SVGPathSegLinetoVerticalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},window.SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},window.SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalAbs(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",t),this._y=e},window.SVGPathSegLinetoVerticalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},window.SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},window.SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalRel(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothAbs=function(t,e,n,i,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",t),this._x=e,this._y=n,this._x2=i,this._y2=o},window.SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothRel=function(t,e,n,i,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",t),this._x=e,this._y=n,this._x2=i,this._y2=o},window.SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothAbs=function(t,e,n){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",t),this._x=e,this._y=n},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothRel=function(t,e,n){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",t),this._x=e,this._y=n},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(t,e){return new window.SVGPathSegMovetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegMovetoRel=function(t,e){return new window.SVGPathSegMovetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(t,e){return new window.SVGPathSegLinetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoRel=function(t,e){return new window.SVGPathSegLinetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(t,e,n,i,o,r){return new window.SVGPathSegCurvetoCubicAbs(void 0,t,e,n,i,o,r)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(t,e,n,i,o,r){return new window.SVGPathSegCurvetoCubicRel(void 0,t,e,n,i,o,r)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(t,e,n,i){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,t,e,n,i)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(t,e,n,i){return new window.SVGPathSegCurvetoQuadraticRel(void 0,t,e,n,i)},window.SVGPathElement.prototype.createSVGPathSegArcAbs=function(t,e,n,i,o,r,a){return new window.SVGPathSegArcAbs(void 0,t,e,n,i,o,r,a)},window.SVGPathElement.prototype.createSVGPathSegArcRel=function(t,e,n,i,o,r,a){return new window.SVGPathSegArcRel(void 0,t,e,n,i,o,r,a)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(t){return new window.SVGPathSegLinetoHorizontalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(t){return new window.SVGPathSegLinetoHorizontalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(t){return new window.SVGPathSegLinetoVerticalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(t){return new window.SVGPathSegLinetoVerticalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(t,e,n,i){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,t,e,n,i)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(t,e,n,i){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,t,e,n,i)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,t,e)},"getPathSegAtLength"in window.SVGPathElement.prototype||(window.SVGPathElement.prototype.getPathSegAtLength=function(t){if(void 0===t||!isFinite(t))throw"Invalid arguments.";var e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",this.getAttribute("d"));var n=e.pathSegList.numberOfItems-1;if(n<=0)return 0;do{if(e.pathSegList.removeItem(n),t>e.getTotalLength())break;n--}while(n>0);return n})),"SVGPathSegList"in window||(window.SVGPathSegList=function(t){this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.classname="SVGPathSegList",Object.defineProperty(window.SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new window.SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),window.SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},window.SVGPathSegList.prototype._updateListFromPathMutations=function(t){if(this._pathElement){var e=!1;t.forEach(function(t){"d"==t.attributeName&&(e=!0)}),e&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}},window.SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",window.SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.segmentChanged=function(t){this._writeListToPath()},window.SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(t){t._owningPathSegList=null}),this._list=[],this._writeListToPath()},window.SVGPathSegList.prototype.initialize=function(t){return this._checkPathSynchronizedToList(),this._list=[t],t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype._checkValidIndex=function(t){if(isNaN(t)||t<0||t>=this.numberOfItems)throw"INDEX_SIZE_ERR"},window.SVGPathSegList.prototype.getItem=function(t){return this._checkPathSynchronizedToList(),this._checkValidIndex(t),this._list[t]},window.SVGPathSegList.prototype.insertItemBefore=function(t,e){return this._checkPathSynchronizedToList(),e>this.numberOfItems&&(e=this.numberOfItems),t._owningPathSegList&&(t=t.clone()),this._list.splice(e,0,t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),this._list[e]=t,t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.removeItem=function(t){this._checkPathSynchronizedToList(),this._checkValidIndex(t);var e=this._list[t];return this._list.splice(t,1),this._writeListToPath(),e},window.SVGPathSegList.prototype.appendItem=function(t){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._list.push(t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList._pathSegArrayAsString=function(t){var e="",n=!0;return t.forEach(function(t){n?(n=!1,e+=t._asPathString()):e+=" "+t._asPathString()}),e},window.SVGPathSegList.prototype._parsePath=function(t){if(!t||0==t.length)return[];var e=this,n=function(){this.pathSegList=[]};n.prototype.appendSegment=function(t){this.pathSegList.push(t)};var i=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};i.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},i.prototype._skipOptionalSpaces=function(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex++;return this._currentIndex<this._endIndex},i.prototype._skipOptionalSpacesOrDelimiter=function(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!=this._string.charAt(this._currentIndex))&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","==this._string.charAt(this._currentIndex)&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},i.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},i.prototype.peekSegmentType=function(){var t=this._string[this._currentIndex];return this._pathSegTypeFromChar(t)},i.prototype._pathSegTypeFromChar=function(t){switch(t){case"Z":case"z":return window.SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return window.SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return window.SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return window.SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return window.SVGPathSeg.PATHSEG_LINETO_REL;case"C":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return window.SVGPathSeg.PATHSEG_ARC_ABS;case"a":return window.SVGPathSeg.PATHSEG_ARC_REL;case"H":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return window.SVGPathSeg.PATHSEG_UNKNOWN}},i.prototype._nextCommandHelper=function(t,e){return("+"==t||"-"==t||"."==t||t>="0"&&t<="9")&&e!=window.SVGPathSeg.PATHSEG_CLOSEPATH?e==window.SVGPathSeg.PATHSEG_MOVETO_ABS?window.SVGPathSeg.PATHSEG_LINETO_ABS:e==window.SVGPathSeg.PATHSEG_MOVETO_REL?window.SVGPathSeg.PATHSEG_LINETO_REL:e:window.SVGPathSeg.PATHSEG_UNKNOWN},i.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var t=this.peekSegmentType();return t==window.SVGPathSeg.PATHSEG_MOVETO_ABS||t==window.SVGPathSeg.PATHSEG_MOVETO_REL},i.prototype._parseNumber=function(){var t=0,e=0,n=1,i=0,o=1,r=1,a=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:this._currentIndex<this._endIndex&&"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,o=-1),!(this._currentIndex==this._endIndex||(this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")&&"."!=this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=s)for(var l=this._currentIndex-1,u=1;l>=s;)e+=u*(this._string.charAt(l--)-"0"),u*=10;if(this._currentIndex<this._endIndex&&"."==this._string.charAt(this._currentIndex)){if(this._currentIndex++,this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)n*=10,i+=(this._string.charAt(this._currentIndex)-"0")/n,this._currentIndex+=1}if(this._currentIndex!=a&&this._currentIndex+1<this._endIndex&&("e"==this._string.charAt(this._currentIndex)||"E"==this._string.charAt(this._currentIndex))&&"x"!=this._string.charAt(this._currentIndex+1)&&"m"!=this._string.charAt(this._currentIndex+1)){if(this._currentIndex++,"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,r=-1),this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)t*=10,t+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var c=e+i;if(c*=o,t&&(c*=Math.pow(10,r*t)),a!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),c}},i.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var t=!1,e=this._string.charAt(this._currentIndex++);if("0"==e)t=!1;else{if("1"!=e)return;t=!0}return this._skipOptionalSpacesOrDelimiter(),t}},i.prototype.parseSegment=function(){var t=this._string[this._currentIndex],n=this._pathSegTypeFromChar(t);if(n==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((n=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=n,n){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(e);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(e,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(e,i.x,i.y,i.x1,i.y1,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(e,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return i={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(e,i.x,i.y,i.x2,i.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(e,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(e,i.x,i.y,i.x1,i.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(e,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return i={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(e,i.x,i.y,i.x1,i.y1,i.arcAngle,i.arcLarge,i.arcSweep);default:throw"Unknown path seg type."}};var o=new n,r=new i(t);if(!r.initialCommandIsMoveTo())return[];for(;r.hasMoreData();){var a=r.parseSegment();if(!a)return[];o.appendSegment(a)}return o.pathSegList}),String.prototype.padEnd||(String.prototype.padEnd=function(t,e){return t>>=0,e=String(void 0!==e?e:" "),this.length>t?String(this):((t-=this.length)>e.length&&(e+=e.repeat(t/e.length)),String(this)+e.slice(0,t))}),E.axis=function(){},E.axis.labels=function(t){var e=this.internal;arguments.length&&(Object.keys(t).forEach(function(n){e.axis.setLabelText(n,t[n])}),e.axis.updateLabels())},E.axis.max=function(t){var e=this.internal,n=e.config;if(!arguments.length)return{x:n.axis_x_max,y:n.axis_y_max,y2:n.axis_y2_max};"object"===(void 0===t?"undefined":o(t))?(s(t.x)&&(n.axis_x_max=t.x),s(t.y)&&(n.axis_y_max=t.y),s(t.y2)&&(n.axis_y2_max=t.y2)):n.axis_y_max=n.axis_y2_max=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},E.axis.min=function(t){var e=this.internal,n=e.config;if(!arguments.length)return{x:n.axis_x_min,y:n.axis_y_min,y2:n.axis_y2_min};"object"===(void 0===t?"undefined":o(t))?(s(t.x)&&(n.axis_x_min=t.x),s(t.y)&&(n.axis_y_min=t.y),s(t.y2)&&(n.axis_y2_min=t.y2)):n.axis_y_min=n.axis_y2_min=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},E.axis.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};d(t.max)&&this.axis.max(t.max),d(t.min)&&this.axis.min(t.min)},E.category=function(t,e){var n=this.internal,i=n.config;return arguments.length>1&&(i.axis_x_categories[t]=e,n.redraw()),i.axis_x_categories[t]},E.categories=function(t){var e=this.internal,n=e.config;return arguments.length?(n.axis_x_categories=t,e.redraw(),n.axis_x_categories):n.axis_x_categories},E.resize=function(t){var e=this.internal.config;e.size_width=t?t.width:null,e.size_height=t?t.height:null,this.flush()},E.flush=function(){this.internal.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},E.destroy=function(){var t=this.internal;if(window.clearInterval(t.intervalForObserveInserted),void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),window.detachEvent)window.detachEvent("onresize",t.resizeIfElementDisplayed);else if(window.removeEventListener)window.removeEventListener("resize",t.resizeIfElementDisplayed);else{var e=window.onresize;e&&e.add&&e.remove&&e.remove(t.resizeFunction)}return t.resizeFunction.remove(),t.selectChart.classed("c3",!1).html(""),Object.keys(t).forEach(function(e){t[e]=null}),null},E.color=function(t){return this.internal.color(t)},E.data=function(t){var e=this.internal.data.targets;return void 0===t?e:e.filter(function(e){return[].concat(t).indexOf(e.id)>=0})},E.data.shown=function(t){return this.internal.filterTargetsToShow(this.data(t))},E.data.values=function(t){var e,n=null;return t&&(n=(e=this.data(t))[0]?e[0].values.map(function(t){return t.value}):null),n},E.data.names=function(t){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",t)},E.data.colors=function(t){return this.internal.updateDataAttributes("colors",t)},E.data.axes=function(t){return this.internal.updateDataAttributes("axes",t)},E.flow=function(t){var e,n,i,o,r,a,l,u=this.internal,c=[],h=u.getMaxDataCount(),f=0,p=0;if(t.json)n=u.convertJsonToData(t.json,t.keys);else if(t.rows)n=u.convertRowsToData(t.rows);else{if(!t.columns)return;n=u.convertColumnsToData(t.columns)}e=u.convertDataToTargets(n,!0),u.data.targets.forEach(function(t){var n,i,o=!1;for(n=0;n<e.length;n++)if(t.id===e[n].id){for(o=!0,t.values[t.values.length-1]&&(p=t.values[t.values.length-1].index+1),f=e[n].values.length,i=0;i<f;i++)e[n].values[i].index=p+i,u.isTimeSeries()||(e[n].values[i].x=p+i);t.values=t.values.concat(e[n].values),e.splice(n,1);break}o||c.push(t.id)}),u.data.targets.forEach(function(t){var e,n;for(e=0;e<c.length;e++)if(t.id===c[e])for(p=t.values[t.values.length-1].index+1,n=0;n<f;n++)t.values.push({id:t.id,index:p+n,x:u.isTimeSeries()?u.getOtherTargetX(p+n):p+n,value:null})}),u.data.targets.length&&e.forEach(function(t){var e,n=[];for(e=u.data.targets[0].values[0].index;e<p;e++)n.push({id:t.id,index:e,x:u.isTimeSeries()?u.getOtherTargetX(e):e,value:null});t.values.forEach(function(t){t.index+=p,u.isTimeSeries()||(t.x+=p)}),t.values=n.concat(t.values)}),u.data.targets=u.data.targets.concat(e),u.getMaxDataCount(),r=(o=u.data.targets[0]).values[0],d(t.to)?(f=0,l=u.isTimeSeries()?u.parseDate(t.to):t.to,o.values.forEach(function(t){t.x<l&&f++})):d(t.length)&&(f=t.length),h?1===h&&u.isTimeSeries()&&(a=(o.values[o.values.length-1].x-r.x)/2,i=[new Date(+r.x-a),new Date(+r.x+a)],u.updateXDomain(null,!0,!0,!1,i)):(a=u.isTimeSeries()?o.values.length>1?o.values[o.values.length-1].x-r.x:r.x-u.getXDomain(u.data.targets)[0]:1,i=[r.x-a,r.x],u.updateXDomain(null,!0,!0,!1,i)),u.updateTargets(u.data.targets),u.redraw({flow:{index:r.index,length:f,duration:s(t.duration)?t.duration:u.config.transition_duration,done:t.done,orgDataCount:h},withLegend:!0,withTransition:h>1,withTrimXDomain:!1,withUpdateXAxis:!0})},C.generateFlow=function(t){var e=this,n=e.config,o=e.d3;return function(){var r,a,s,l,u=t.targets,c=t.flow,h=t.drawBar,d=t.drawLine,f=t.drawArea,p=t.cx,m=t.cy,v=t.xv,y=t.xForText,b=t.yForText,w=t.duration,_=c.index,x=c.length,S=e.getValueOnIndex(e.data.targets[0].values,_),E=e.getValueOnIndex(e.data.targets[0].values,_+x),C=e.x.domain(),T=c.duration||w,M=c.done||function(){},P=e.generateWait(),L=e.xgrid||o.selectAll([]),A=e.xgridLines||o.selectAll([]),k=e.mainRegion||o.selectAll([]),O=e.mainText||o.selectAll([]),R=e.mainBar||o.selectAll([]),D=e.mainLine||o.selectAll([]),j=e.mainArea||o.selectAll([]),z=e.mainCircle||o.selectAll([]);e.flowing=!0,e.data.targets.forEach(function(t){t.values.splice(0,x)}),l=e.updateXDomain(u,!0,!0),e.updateXGrid&&e.updateXGrid(!0),c.orgDataCount?r=1===c.orgDataCount||(S&&S.x)===(E&&E.x)?e.x(C[0])-e.x(l[0]):e.isTimeSeries()?e.x(C[0])-e.x(l[0]):e.x(S.x)-e.x(E.x):1!==e.data.targets[0].values.length?r=e.x(C[0])-e.x(l[0]):e.isTimeSeries()?(S=e.getValueOnIndex(e.data.targets[0].values,0),E=e.getValueOnIndex(e.data.targets[0].values,e.data.targets[0].values.length-1),r=e.x(S.x)-e.x(E.x)):r=g(l)/2,a=g(C)/g(l),s="translate("+r+",0) scale("+a+",1)",e.hideXGridFocus(),o.transition().ease("linear").duration(T).each(function(){P.add(e.axes.x.transition().call(e.xAxis)),P.add(R.transition().attr("transform",s)),P.add(D.transition().attr("transform",s)),P.add(j.transition().attr("transform",s)),P.add(z.transition().attr("transform",s)),P.add(O.transition().attr("transform",s)),P.add(k.filter(e.isRegionOnX).transition().attr("transform",s)),P.add(L.transition().attr("transform",s)),P.add(A.transition().attr("transform",s))}).call(P,function(){var t,o=[],r=[],a=[];if(x){for(t=0;t<x;t++)o.push("."+i.shape+"-"+(_+t)),r.push("."+i.text+"-"+(_+t)),a.push("."+i.eventRect+"-"+(_+t));e.svg.selectAll("."+i.shapes).selectAll(o).remove(),e.svg.selectAll("."+i.texts).selectAll(r).remove(),e.svg.selectAll("."+i.eventRects).selectAll(a).remove(),e.svg.select("."+i.xgrid).remove()}L.attr("transform",null).attr(e.xgridAttr),A.attr("transform",null),A.select("line").attr("x1",n.axis_rotated?0:v).attr("x2",n.axis_rotated?e.width:v),A.select("text").attr("x",n.axis_rotated?e.width:0).attr("y",v),R.attr("transform",null).attr("d",h),D.attr("transform",null).attr("d",d),j.attr("transform",null).attr("d",f),z.attr("transform",null).attr("cx",p).attr("cy",m),O.attr("transform",null).attr("x",y).attr("y",b).style("fill-opacity",e.opacityForText.bind(e)),k.attr("transform",null),k.select("rect").filter(e.isRegionOnX).attr("x",e.regionX.bind(e)).attr("width",e.regionWidth.bind(e)),n.interaction_enabled&&e.redrawEventRect(),M(),e.flowing=!1})}},E.focus=function(t){var e,n=this.internal;t=n.mapToTargetIds(t),e=n.svg.selectAll(n.selectorTargets(t.filter(n.isTargetToShow,n))),this.revert(),this.defocus(),e.classed(i.focused,!0).classed(i.defocused,!1),n.hasArcType()&&n.expandArc(t),n.toggleFocusLegend(t,!0),n.focusedTargetIds=t,n.defocusedTargetIds=n.defocusedTargetIds.filter(function(e){return t.indexOf(e)<0})},E.defocus=function(t){var e=this.internal;t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t.filter(e.isTargetToShow,e))).classed(i.focused,!1).classed(i.defocused,!0),e.hasArcType()&&e.unexpandArc(t),e.toggleFocusLegend(t,!1),e.focusedTargetIds=e.focusedTargetIds.filter(function(e){return t.indexOf(e)<0}),e.defocusedTargetIds=t},E.revert=function(t){var e=this.internal;t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t)).classed(i.focused,!1).classed(i.defocused,!1),e.hasArcType()&&e.unexpandArc(t),e.config.legend_show&&(e.showLegend(t.filter(e.isLegendToShow.bind(e))),e.legend.selectAll(e.selectorLegends(t)).filter(function(){return e.d3.select(this).classed(i.legendItemFocused)}).classed(i.legendItemFocused,!1)),e.focusedTargetIds=[],e.defocusedTargetIds=[]},E.xgrids=function(t){var e=this.internal,n=e.config;return t?(n.grid_x_lines=t,e.redrawWithoutRescale(),n.grid_x_lines):n.grid_x_lines},E.xgrids.add=function(t){var e=this.internal;return this.xgrids(e.config.grid_x_lines.concat(t||[]))},E.xgrids.remove=function(t){this.internal.removeGridLines(t,!0)},E.ygrids=function(t){var e=this.internal,n=e.config;return t?(n.grid_y_lines=t,e.redrawWithoutRescale(),n.grid_y_lines):n.grid_y_lines},E.ygrids.add=function(t){var e=this.internal;return this.ygrids(e.config.grid_y_lines.concat(t||[]))},E.ygrids.remove=function(t){this.internal.removeGridLines(t,!1)},E.groups=function(t){var e=this.internal,n=e.config;return h(t)?n.data_groups:(n.data_groups=t,e.redraw(),n.data_groups)},E.legend=function(){},E.legend.show=function(t){var e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},E.legend.hide=function(t){var e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},E.load=function(t){var e=this.internal,n=e.config;t.xs&&e.addXs(t.xs),"names"in t&&E.data.names.bind(this)(t.names),"classes"in t&&Object.keys(t.classes).forEach(function(e){n.data_classes[e]=t.classes[e]}),"categories"in t&&e.isCategorized()&&(n.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach(function(e){n.data_axes[e]=t.axes[e]}),"colors"in t&&Object.keys(t.colors).forEach(function(e){n.data_colors[e]=t.colors[e]}),"cacheIds"in t&&e.hasCaches(t.cacheIds)?e.load(e.getCaches(t.cacheIds),t.done):"unload"in t?e.unload(e.mapToTargetIds("boolean"==typeof t.unload&&t.unload?null:t.unload),function(){e.loadFromArgs(t)}):e.loadFromArgs(t)},E.unload=function(t){var e=this.internal;(t=t||{})instanceof Array?t={ids:t}:"string"==typeof t&&(t={ids:[t]}),e.unload(e.mapToTargetIds(t.ids),function(){e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),t.done&&t.done()})},E.regions=function(t){var e=this.internal,n=e.config;return t?(n.regions=t,e.redrawWithoutRescale(),n.regions):n.regions},E.regions.add=function(t){var e=this.internal,n=e.config;return t?(n.regions=n.regions.concat(t),e.redrawWithoutRescale(),n.regions):n.regions},E.regions.remove=function(t){var e,n,o,r=this.internal,a=r.config;return t=t||{},e=r.getOption(t,"duration",a.transition_duration),n=r.getOption(t,"classes",[i.region]),o=r.main.select("."+i.regions).selectAll(n.map(function(t){return"."+t})),(e?o.transition().duration(e):o).style("opacity",0).remove(),a.regions=a.regions.filter(function(t){var e=!1;return!t.class||(t.class.split(" ").forEach(function(t){n.indexOf(t)>=0&&(e=!0)}),!e)}),a.regions},E.selected=function(t){var e=this.internal,n=e.d3;return n.merge(e.main.selectAll("."+i.shapes+e.getTargetSelectorSuffix(t)).selectAll("."+i.shape).filter(function(){return n.select(this).classed(i.SELECTED)}).map(function(t){return t.map(function(t){var e=t.__data__;return e.data?e.data:e})}))},E.select=function(t,e,n){var o=this.internal,r=o.d3,a=o.config;a.data_selection_enabled&&o.main.selectAll("."+i.shapes).selectAll("."+i.shape).each(function(s,l){var u=r.select(this),c=s.data?s.data.id:s.id,h=o.getToggle(this,s).bind(o),f=a.data_selection_grouped||!t||t.indexOf(c)>=0,p=!e||e.indexOf(l)>=0,g=u.classed(i.SELECTED);u.classed(i.line)||u.classed(i.area)||(f&&p?a.data_selection_isselectable(s)&&!g&&h(!0,u.classed(i.SELECTED,!0),s,l):d(n)&&n&&g&&h(!1,u.classed(i.SELECTED,!1),s,l))})},E.unselect=function(t,e){var n=this.internal,o=n.d3,r=n.config;r.data_selection_enabled&&n.main.selectAll("."+i.shapes).selectAll("."+i.shape).each(function(a,s){var l=o.select(this),u=a.data?a.data.id:a.id,c=n.getToggle(this,a).bind(n),h=r.data_selection_grouped||!t||t.indexOf(u)>=0,d=!e||e.indexOf(s)>=0,f=l.classed(i.SELECTED);l.classed(i.line)||l.classed(i.area)||h&&d&&r.data_selection_isselectable(a)&&f&&c(!1,l.classed(i.SELECTED,!1),a,s)})},E.show=function(t,e){var n,i=this.internal;t=i.mapToTargetIds(t),e=e||{},i.removeHiddenTargetIds(t),(n=i.svg.selectAll(i.selectorTargets(t))).transition().style("opacity",1,"important").call(i.endall,function(){n.style("opacity",null).style("opacity",1)}),e.withLegend&&i.showLegend(t),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},E.hide=function(t,e){var n,i=this.internal;t=i.mapToTargetIds(t),e=e||{},i.addHiddenTargetIds(t),(n=i.svg.selectAll(i.selectorTargets(t))).transition().style("opacity",0,"important").call(i.endall,function(){n.style("opacity",null).style("opacity",0)}),e.withLegend&&i.hideLegend(t),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},E.toggle=function(t,e){var n=this,i=this.internal;i.mapToTargetIds(t).forEach(function(t){i.isTargetToShow(t)?n.hide(t,e):n.show(t,e)})},E.tooltip=function(){},E.tooltip.show=function(t){var e,n,i=this.internal;t.mouse&&(n=t.mouse),t.data?i.isMultipleX()?(n=[i.x(t.data.x),i.getYScale(t.data.id)(t.data.value)],e=null):e=s(t.data.index)?t.data.index:i.getIndexByX(t.data.x):void 0!==t.x?e=i.getIndexByX(t.x):void 0!==t.index&&(e=t.index),i.dispatchEvent("mouseover",e,n),i.dispatchEvent("mousemove",e,n),i.config.tooltip_onshow.call(i,t.data)},E.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)},E.transform=function(t,e){var n=this.internal,i=["pie","donut"].indexOf(t)>=0?{withTransform:!0}:null;n.transformTo(e,t,i)},C.transformTo=function(t,e,n){var i=this,o=!i.hasArcType(),r=n||{withTransitionForAxis:o};r.withTransitionForTransform=!1,i.transiting=!1,i.setTargetType(t,e),i.updateTargets(i.data.targets),i.updateAndRedraw(r)},E.x=function(t){var e=this.internal;return arguments.length&&(e.updateTargetX(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},E.xs=function(t){var e=this.internal;return arguments.length&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},E.zoom=function(t){var e=this.internal;return t&&(e.isTimeSeries()&&(t=t.map(function(t){return e.parseDate(t)})),e.brush.extent(t),e.redraw({withUpdateXDomain:!0,withY:e.config.zoom_rescale}),e.config.zoom_onzoom.call(this,e.x.orgDomain())),e.brush.extent()},E.zoom.enable=function(t){var e=this.internal;e.config.zoom_enabled=t,e.updateAndRedraw()},E.unzoom=function(){var t=this.internal;t.brush.clear().update(),t.redraw({withUpdateXDomain:!0})},E.zoom.max=function(t){var e=this.internal,n=e.config,i=e.d3;if(0!==t&&!t)return n.zoom_x_max;n.zoom_x_max=i.max([e.orgXDomain[1],t])},E.zoom.min=function(t){var e=this.internal,n=e.config,i=e.d3;if(0!==t&&!t)return n.zoom_x_min;n.zoom_x_min=i.min([e.orgXDomain[0],t])},E.zoom.range=function(t){if(!arguments.length)return{max:this.domain.max(),min:this.domain.min()};d(t.max)&&this.domain.max(t.max),d(t.min)&&this.domain.min(t.min)},C.initPie=function(){var t=this.d3;this.pie=t.layout.pie().value(function(t){return t.values.reduce(function(t,e){return t+e.value},0)}),this.pie.sort(this.getOrderFunction()||null)},C.updateRadius=function(){var t=this,e=t.config,n=e.gauge_width||e.donut_width,i=t.filterTargetsToShow(t.data.targets).length*t.config.gauge_arcs_minWidth;t.radiusExpanded=Math.min(t.arcWidth,t.arcHeight)/2*(t.hasType("gauge")?.85:1),t.radius=.95*t.radiusExpanded,t.innerRadiusRatio=n?(t.radius-n)/t.radius:.6,t.innerRadius=t.hasType("donut")||t.hasType("gauge")?t.radius*t.innerRadiusRatio:0,t.gaugeArcWidth=n||(i<=t.radius-t.innerRadius?t.radius-t.innerRadius:i<=t.radius?i:t.radius)},C.updateArc=function(){var t=this;t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded(),t.svgArcExpandedSub=t.getSvgArcExpanded(.98)},C.updateAngle=function(t){var e,n,i,o,r=this,a=r.config,s=!1,l=0;return a?(r.pie(r.filterTargetsToShow(r.data.targets)).forEach(function(e){s||e.data.id!==t.data.id||(s=!0,(t=e).index=l),l++}),isNaN(t.startAngle)&&(t.startAngle=0),isNaN(t.endAngle)&&(t.endAngle=t.startAngle),r.isGaugeType(t.data)&&(e=a.gauge_min,n=a.gauge_max,i=Math.PI*(a.gauge_fullCircle?2:1)/(n-e),o=t.value<e?0:t.value<n?t.value-e:n-e,t.startAngle=a.gauge_startingAngle,t.endAngle=t.startAngle+i*o),s?t:null):null},C.getSvgArc=function(){var t=this,e=t.hasType("gauge"),n=t.gaugeArcWidth/t.filterTargetsToShow(t.data.targets).length,i=t.d3.svg.arc().outerRadius(function(i){return e?t.radius-n*i.index:t.radius}).innerRadius(function(i){return e?t.radius-n*(i.index+1):t.innerRadius}),o=function(e,n){var o;return n?i(e):(o=t.updateAngle(e))?i(o):"M 0 0"};return o.centroid=i.centroid,o},C.getSvgArcExpanded=function(t){t=t||1;var e=this,n=e.hasType("gauge"),i=e.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length,o=Math.min(e.radiusExpanded*t-e.radius,.8*i-100*(1-t)),r=e.d3.svg.arc().outerRadius(function(r){return n?e.radius-i*r.index+o:e.radiusExpanded*t}).innerRadius(function(t){return n?e.radius-i*(t.index+1):e.innerRadius});return function(t){var n=e.updateAngle(t);return n?r(n):"M 0 0"}},C.getArc=function(t,e,n){return n||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},C.transformForArcLabel=function(t){var e,n,i,o,r,a=this,s=a.config,u=a.updateAngle(t),c="",h=a.hasType("gauge");if(u&&!h)e=this.svgArc.centroid(u),n=isNaN(e[0])?0:e[0],i=isNaN(e[1])?0:e[1],o=Math.sqrt(n*n+i*i),c="translate("+n*(r=a.hasType("donut")&&s.donut_label_ratio?l(s.donut_label_ratio)?s.donut_label_ratio(t,a.radius,o):s.donut_label_ratio:a.hasType("pie")&&s.pie_label_ratio?l(s.pie_label_ratio)?s.pie_label_ratio(t,a.radius,o):s.pie_label_ratio:a.radius&&o?(36/a.radius>.375?1.175-36/a.radius:.8)*a.radius/o:0)+","+i*r+")";else if(u&&h&&a.filterTargetsToShow(a.data.targets).length>1){var d=Math.sin(u.endAngle-Math.PI/2);c="translate("+(n=Math.cos(u.endAngle-Math.PI/2)*(a.radiusExpanded+25))+","+(i=d*(a.radiusExpanded+15-Math.abs(10*d))+3)+")"}return c},C.getArcRatio=function(t){var e=this.config,n=Math.PI*(this.hasType("gauge")&&!e.gauge_fullCircle?1:2);return t?(t.endAngle-t.startAngle)/n:null},C.convertToArcData=function(t){return this.addName({id:t.data.id,value:t.value,ratio:this.getArcRatio(t),index:t.index})},C.textForArcLabel=function(t){var e,n,i,o,r,a=this;return a.shouldShowArcLabel()?(n=(e=a.updateAngle(t))?e.value:null,i=a.getArcRatio(e),o=t.data.id,a.hasType("gauge")||a.meetsArcLabelThreshold(i)?(r=a.getArcLabelFormat())?r(n,i,o):a.defaultArcValueFormat(n,i):""):""},C.textForGaugeMinMax=function(t,e){var n=this.getGaugeLabelExtents();return n?n(t,e):t},C.expandArc=function(t){var e,n=this;n.transiting?e=window.setInterval(function(){n.transiting||(window.clearInterval(e),n.legend.selectAll(".c3-legend-item-focused").size()>0&&n.expandArc(t))},10):(t=n.mapToTargetIds(t),n.svg.selectAll(n.selectorTargets(t,"."+i.chartArc)).each(function(t){n.shouldExpand(t.data.id)&&n.d3.select(this).selectAll("path").transition().duration(n.expandDuration(t.data.id)).attr("d",n.svgArcExpanded).transition().duration(2*n.expandDuration(t.data.id)).attr("d",n.svgArcExpandedSub).each(function(t){n.isDonutType(t.data)})}))},C.unexpandArc=function(t){var e=this;e.transiting||(t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t,"."+i.chartArc)).selectAll("path").transition().duration(function(t){return e.expandDuration(t.data.id)}).attr("d",e.svgArc),e.svg.selectAll("."+i.arc))},C.expandDuration=function(t){var e=this.config;return this.isDonutType(t)?e.donut_expand_duration:this.isGaugeType(t)?e.gauge_expand_duration:this.isPieType(t)?e.pie_expand_duration:50},C.shouldExpand=function(t){var e=this.config;return this.isDonutType(t)&&e.donut_expand||this.isGaugeType(t)&&e.gauge_expand||this.isPieType(t)&&e.pie_expand},C.shouldShowArcLabel=function(){var t=this.config,e=!0;return this.hasType("donut")?e=t.donut_label_show:this.hasType("pie")&&(e=t.pie_label_show),e},C.meetsArcLabelThreshold=function(t){var e=this.config;return t>=(this.hasType("donut")?e.donut_label_threshold:e.pie_label_threshold)},C.getArcLabelFormat=function(){var t=this.config,e=t.pie_label_format;return this.hasType("gauge")?e=t.gauge_label_format:this.hasType("donut")&&(e=t.donut_label_format),e},C.getGaugeLabelExtents=function(){return this.config.gauge_label_extents},C.getArcTitle=function(){return this.hasType("donut")?this.config.donut_title:""},C.updateTargetsForArc=function(t){var e,n=this,o=n.main,r=n.classChartArc.bind(n),a=n.classArcs.bind(n),s=n.classFocus.bind(n);(e=o.select("."+i.chartArcs).selectAll("."+i.chartArc).data(n.pie(t)).attr("class",function(t){return r(t)+s(t.data)}).enter().append("g").attr("class",r)).append("g").attr("class",a),e.append("text").attr("dy",n.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},C.initArc=function(){var t=this;t.arcs=t.main.select("."+i.chart).append("g").attr("class",i.chartArcs).attr("transform",t.getTranslate("arc")),t.arcs.append("text").attr("class",i.chartArcsTitle).style("text-anchor","middle").text(t.getArcTitle())},C.redrawArc=function(t,e,n){var o,r,a,s=this,l=s.d3,u=s.config,c=s.main,h=s.hasType("gauge");if((o=c.selectAll("."+i.arcs).selectAll("."+i.arc).data(s.arcData.bind(s))).enter().append("path").attr("class",s.classArc.bind(s)).style("fill",function(t){return s.color(t.data)}).style("cursor",function(t){return u.interaction_enabled&&u.data_selection_isselectable(t)?"pointer":null}).each(function(t){s.isGaugeType(t.data)&&(t.startAngle=t.endAngle=u.gauge_startingAngle),this._current=t}),h&&((a=c.selectAll("."+i.arcs).selectAll("."+i.arcLabelLine).data(s.arcData.bind(s))).enter().append("rect").attr("class",function(t){return i.arcLabelLine+" "+i.target+" "+i.target+"-"+t.data.id}),1===s.filterTargetsToShow(s.data.targets).length?a.style("display","none"):a.style("fill",function(t){return u.color_pattern.length>0?s.levelColor(t.data.values[0].value):s.color(t.data)}).style("display",u.gauge_labelLine_show?"":"none").each(function(t){var e=0,n=0,i=0,o="";if(s.hiddenTargetIds.indexOf(t.data.id)<0){var r=s.updateAngle(t),a=s.gaugeArcWidth/s.filterTargetsToShow(s.data.targets).length*(r.index+1),u=r.endAngle-Math.PI/2,c=s.radius-a,h=u-(0===c?0:1/c);e=s.radiusExpanded-s.radius+a,n=Math.cos(h)*c,i=Math.sin(h)*c,o="rotate("+180*u/Math.PI+", "+n+", "+i+")"}l.select(this).attr({x:n,y:i,width:e,height:2,transform:o}).style("stroke-dasharray","0, "+(e+2)+", 0")})),o.attr("transform",function(t){return!s.isGaugeType(t.data)&&n?"scale(0)":""}).on("mouseover",u.interaction_enabled?function(t){var e,n;s.transiting||(e=s.updateAngle(t))&&(n=s.convertToArcData(e),s.expandArc(e.data.id),s.api.focus(e.data.id),s.toggleFocusLegend(e.data.id,!0),s.config.data_onmouseover(n,this))}:null).on("mousemove",u.interaction_enabled?function(t){var e,n=s.updateAngle(t);n&&(e=[s.convertToArcData(n)],s.showTooltip(e,this))}:null).on("mouseout",u.interaction_enabled?function(t){var e,n;s.transiting||(e=s.updateAngle(t))&&(n=s.convertToArcData(e),s.unexpandArc(e.data.id),s.api.revert(),s.revertLegend(),s.hideTooltip(),s.config.data_onmouseout(n,this))}:null).on("click",u.interaction_enabled?function(t,e){var n,i=s.updateAngle(t);i&&(n=s.convertToArcData(i),s.toggleShape&&s.toggleShape(this,n,e),s.config.data_onclick.call(s.api,n,this))}:null).each(function(){s.transiting=!0}).transition().duration(t).attrTween("d",function(t){var e,n=s.updateAngle(t);return n?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),e=l.interpolate(this._current,n),this._current=e(0),function(n){var i=e(n);return i.data=t.data,s.getArc(i,!0)}):function(){return"M 0 0"}}).attr("transform",n?"scale(1)":"").style("fill",function(t){return s.levelColor?s.levelColor(t.data.values[0].value):s.color(t.data.id)}).call(s.endall,function(){s.transiting=!1}),o.exit().transition().duration(e).style("opacity",0).remove(),c.selectAll("."+i.chartArc).select("text").style("opacity",0).attr("class",function(t){return s.isGaugeType(t.data)?i.gaugeValue:""}).text(s.textForArcLabel.bind(s)).attr("transform",s.transformForArcLabel.bind(s)).style("font-size",function(t){return s.isGaugeType(t.data)&&1===s.filterTargetsToShow(s.data.targets).length?Math.round(s.radius/5)+"px":""}).transition().duration(t).style("opacity",function(t){return s.isTargetToShow(t.data.id)&&s.isArcType(t.data)?1:0}),c.select("."+i.chartArcsTitle).style("opacity",s.hasType("donut")||h?1:0),h){var d=0;(r=s.arcs.select("g."+i.chartArcsBackground).selectAll("path."+i.chartArcsBackground).data(s.data.targets)).enter().append("path"),r.attr("class",function(t,e){return i.chartArcsBackground+" "+i.chartArcsBackground+"-"+e}).attr("d",function(t){if(s.hiddenTargetIds.indexOf(t.id)>=0)return"M 0 0";var e={data:[{value:u.gauge_max}],startAngle:u.gauge_startingAngle,endAngle:-1*u.gauge_startingAngle*(u.gauge_fullCircle?Math.PI:1),index:d++};return s.getArc(e,!0,!0)}),r.exit().remove(),s.arcs.select("."+i.chartArcsGaugeUnit).attr("dy",".75em").text(u.gauge_label_show?u.gauge_units:""),s.arcs.select("."+i.chartArcsGaugeMin).attr("dx",-1*(s.innerRadius+(s.radius-s.innerRadius)/(u.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(u.gauge_label_show?s.textForGaugeMinMax(u.gauge_min,!1):""),s.arcs.select("."+i.chartArcsGaugeMax).attr("dx",s.innerRadius+(s.radius-s.innerRadius)/(u.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(u.gauge_label_show?s.textForGaugeMinMax(u.gauge_max,!0):"")}},C.initGauge=function(){var t=this.arcs;this.hasType("gauge")&&(t.append("g").attr("class",i.chartArcsBackground),t.append("text").attr("class",i.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",i.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",i.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},C.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},C.hasCaches=function(t){for(var e=0;e<t.length;e++)if(!(t[e]in this.cache))return!1;return!0},C.addCache=function(t,e){this.cache[t]=this.cloneTarget(e)},C.getCaches=function(t){var e,n=[];for(e=0;e<t.length;e++)t[e]in this.cache&&n.push(this.cloneTarget(this.cache[t[e]]));return n},C.categoryName=function(t){var e=this.config;return t<e.axis_x_categories.length?e.axis_x_categories[t]:t},C.generateClass=function(t,e){return" "+t+" "+t+this.getTargetSelectorSuffix(e)},C.classText=function(t){return this.generateClass(i.text,t.index)},C.classTexts=function(t){return this.generateClass(i.texts,t.id)},C.classShape=function(t){return this.generateClass(i.shape,t.index)},C.classShapes=function(t){return this.generateClass(i.shapes,t.id)},C.classLine=function(t){return this.classShape(t)+this.generateClass(i.line,t.id)},C.classLines=function(t){return this.classShapes(t)+this.generateClass(i.lines,t.id)},C.classCircle=function(t){return this.classShape(t)+this.generateClass(i.circle,t.index)},C.classCircles=function(t){return this.classShapes(t)+this.generateClass(i.circles,t.id)},C.classBar=function(t){return this.classShape(t)+this.generateClass(i.bar,t.index)},C.classBars=function(t){return this.classShapes(t)+this.generateClass(i.bars,t.id)},C.classArc=function(t){return this.classShape(t.data)+this.generateClass(i.arc,t.data.id)},C.classArcs=function(t){return this.classShapes(t.data)+this.generateClass(i.arcs,t.data.id)},C.classArea=function(t){return this.classShape(t)+this.generateClass(i.area,t.id)},C.classAreas=function(t){return this.classShapes(t)+this.generateClass(i.areas,t.id)},C.classRegion=function(t,e){return this.generateClass(i.region,e)+" "+("class"in t?t.class:"")},C.classEvent=function(t){return this.generateClass(i.eventRect,t.index)},C.classTarget=function(t){var e=this.config.data_classes[t],n="";return e&&(n=" "+i.target+"-"+e),this.generateClass(i.target,t)+n},C.classFocus=function(t){return this.classFocused(t)+this.classDefocused(t)},C.classFocused=function(t){return" "+(this.focusedTargetIds.indexOf(t.id)>=0?i.focused:"")},C.classDefocused=function(t){return" "+(this.defocusedTargetIds.indexOf(t.id)>=0?i.defocused:"")},C.classChartText=function(t){return i.chartText+this.classTarget(t.id)},C.classChartLine=function(t){return i.chartLine+this.classTarget(t.id)},C.classChartBar=function(t){return i.chartBar+this.classTarget(t.id)},C.classChartArc=function(t){return i.chartArc+this.classTarget(t.data.id)},C.getTargetSelectorSuffix=function(t){return t||0===t?("-"+t).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},C.selectorTarget=function(t,e){return(e||"")+"."+i.target+this.getTargetSelectorSuffix(t)},C.selectorTargets=function(t,e){var n=this;return(t=t||[]).length?t.map(function(t){return n.selectorTarget(t,e)}):null},C.selectorLegend=function(t){return"."+i.legendItem+this.getTargetSelectorSuffix(t)},C.selectorLegends=function(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null},C.getClipPath=function(t){return"url("+(window.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0?"":document.URL.split("#")[0])+"#"+t+")"},C.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},C.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},C.getAxisClipY=function(t){return t?-20:-this.margin.top},C.getXAxisClipX=function(){return this.getAxisClipX(!this.config.axis_rotated)},C.getXAxisClipY=function(){return this.getAxisClipY(!this.config.axis_rotated)},C.getYAxisClipX=function(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},C.getYAxisClipY=function(){return this.getAxisClipY(this.config.axis_rotated)},C.getAxisClipWidth=function(t){var e=Math.max(30,this.margin.left),n=Math.max(30,this.margin.right);return t?this.width+2+e+n:this.margin.left+20},C.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},C.getXAxisClipWidth=function(){return this.getAxisClipWidth(!this.config.axis_rotated)},C.getXAxisClipHeight=function(){return this.getAxisClipHeight(!this.config.axis_rotated)},C.getYAxisClipWidth=function(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},C.getYAxisClipHeight=function(){return this.getAxisClipHeight(this.config.axis_rotated)},C.generateColor=function(){var t=this.config,e=this.d3,n=t.data_colors,i=v(t.color_pattern)?t.color_pattern:e.scale.category10().range(),o=t.data_color,r=[];return function(t){var e,a=t.id||t.data&&t.data.id||t;return n[a]instanceof Function?e=n[a](t):n[a]?e=n[a]:(r.indexOf(a)<0&&r.push(a),e=i[r.indexOf(a)%i.length],n[a]=e),o instanceof Function?o(e,t):e}},C.generateLevelColor=function(){var t=this.config,e=t.color_pattern,n=t.color_threshold,i="value"===n.unit,o=n.values&&n.values.length?n.values:[],r=n.max||100;return v(t.color_threshold)?function(t){var n,a=e[e.length-1];for(n=0;n<o.length;n++)if((i?t:100*t/r)<o[n]){a=e[n];break}return a}:null},C.getDefaultConfig=function(){var t={bindto:"#chart",svg_classname:void 0,size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,zoom_enabled:!1,zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:void 0,zoom_x_max:void 0,interaction_brighten:!0,interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(t){return t},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_multilineMax:0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_x_inner:void 0,axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:void 0,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_time_value:void 0,axis_y_tick_time_interval:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:void 0,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_padding:{},axis_y2_default:void 0,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,bar_space:0,area_zerobased:!0,area_above:!1,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_duration:50,gauge_fullCircle:!1,gauge_label_show:!0,gauge_labelLine_show:!0,gauge_label_format:void 0,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_label_extents:void 0,gauge_units:void 0,gauge_width:void 0,gauge_arcs_minWidth:5,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_duration:50,spline_interpolation_type:"cardinal",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_order:void 0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:function(t,e,n,i){return this.getTooltipContent?this.getTooltipContent(t,e,n,i):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"};return Object.keys(this.additionalConfig).forEach(function(e){t[e]=this.additionalConfig[e]},this),t},C.additionalConfig={},C.loadConfig=function(t){var e,n,i,r=this.config;Object.keys(r).forEach(function(a){e=t,n=a.split("_"),i=function t(){var i=n.shift();return i&&e&&"object"===(void 0===e?"undefined":o(e))&&i in e?(e=e[i],t()):i?void 0:e}(),d(i)&&(r[a]=i)})},C.convertUrlToData=function(t,e,n,i,o){var r=this,a=e||"csv",s=r.d3.xhr(t);n&&Object.keys(n).forEach(function(t){s.header(t,n[t])}),s.get(function(t,e){var n,s=e.response||e.responseText;if(!e)throw new Error(t.responseURL+" "+t.status+" ("+t.statusText+")");n="json"===a?r.convertJsonToData(JSON.parse(s),i):"tsv"===a?r.convertTsvToData(s):r.convertCsvToData(s),o.call(r,n)})},C.convertXsvToData=function(t,e){var n,i=e.parseRows(t);return 1===i.length?(n=[{}],i[0].forEach(function(t){n[0][t]=null})):n=e.parse(t),n},C.convertCsvToData=function(t){return this.convertXsvToData(t,this.d3.csv)},C.convertTsvToData=function(t){return this.convertXsvToData(t,this.d3.tsv)},C.convertJsonToData=function(t,e){var n,i,o=this,r=[];return e?(e.x?(n=e.value.concat(e.x),o.config.data_x=e.x):n=e.value,r.push(n),t.forEach(function(t){var e=[];n.forEach(function(n){var i=o.findValueInJson(t,n);h(i)&&(i=null),e.push(i)}),r.push(e)}),i=o.convertRowsToData(r)):(Object.keys(t).forEach(function(e){r.push([e].concat(t[e]))}),i=o.convertColumnsToData(r)),i},C.findValueInJson=function(t,e){for(var n=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),i=0;i<n.length;++i){var o=n[i];if(!(o in t))return;t=t[o]}return t},C.convertRowsToData=function(t){for(var e=[],n=t[0],i=1;i<t.length;i++){for(var o={},r=0;r<t[i].length;r++){if(h(t[i][r]))throw new Error("Source data is missing a component at ("+i+","+r+")!");o[n[r]]=t[i][r]}e.push(o)}return e},C.convertColumnsToData=function(t){for(var e=[],n=0;n<t.length;n++)for(var i=t[n][0],o=1;o<t[n].length;o++){if(h(e[o-1])&&(e[o-1]={}),h(t[n][o]))throw new Error("Source data is missing a component at ("+n+","+o+")!");e[o-1][i]=t[n][o]}return e},C.convertDataToTargets=function(t,e){var n,i=this,o=i.config,r=i.d3.keys(t[0]).filter(i.isNotX,i),a=i.d3.keys(t[0]).filter(i.isX,i);return r.forEach(function(n){var r=i.getXKey(n);i.isCustomX()||i.isTimeSeries()?a.indexOf(r)>=0?i.data.xs[n]=(e&&i.data.xs[n]?i.data.xs[n]:[]).concat(t.map(function(t){return t[r]}).filter(s).map(function(t,e){return i.generateTargetX(t,n,e)})):o.data_x?i.data.xs[n]=i.getOtherTargetXs():v(o.data_xs)&&(i.data.xs[n]=i.getXValuesOfXKey(r,i.data.targets)):i.data.xs[n]=t.map(function(t,e){return e})}),r.forEach(function(t){if(!i.data.xs[t])throw new Error('x is not defined for id = "'+t+'".')}),(n=r.map(function(e,n){var r=o.data_idConverter(e);return{id:r,id_org:e,values:t.map(function(t,a){var s,l=t[i.getXKey(e)],u=null===t[e]||isNaN(t[e])?null:+t[e];return i.isCustomX()&&i.isCategorized()&&!h(l)?(0===n&&0===a&&(o.axis_x_categories=[]),-1===(s=o.axis_x_categories.indexOf(l))&&(s=o.axis_x_categories.length,o.axis_x_categories.push(l))):s=i.generateTargetX(l,e,a),(h(t[e])||i.data.xs[e].length<=a)&&(s=void 0),{x:s,value:u,id:r}}).filter(function(t){return d(t.x)})}})).forEach(function(t){var e;o.data_xSort&&(t.values=t.values.sort(function(t,e){return(t.x||0===t.x?t.x:1/0)-(e.x||0===e.x?e.x:1/0)})),e=0,t.values.forEach(function(t){t.index=e++}),i.data.xs[t.id].sort(function(t,e){return t-e})}),i.hasNegativeValue=i.hasNegativeValueInTargets(n),i.hasPositiveValue=i.hasPositiveValueInTargets(n),o.data_type&&i.setTargetType(i.mapToIds(n).filter(function(t){return!(t in o.data_types)}),o.data_type),n.forEach(function(t){i.addCache(t.id_org,t)}),n},C.isX=function(t){var e=this.config;return e.data_x&&t===e.data_x||v(e.data_xs)&&b(e.data_xs,t)},C.isNotX=function(t){return!this.isX(t)},C.getXKey=function(t){var e=this.config;return e.data_x?e.data_x:v(e.data_xs)?e.data_xs[t]:null},C.getXValuesOfXKey=function(t,e){var n,i=this;return(e&&v(e)?i.mapToIds(e):[]).forEach(function(e){i.getXKey(e)===t&&(n=i.data.xs[e])}),n},C.getIndexByX=function(t){var e=this.filterByX(this.data.targets,t);return e.length?e[0].index:null},C.getXValue=function(t,e){return t in this.data.xs&&this.data.xs[t]&&s(this.data.xs[t][e])?this.data.xs[t][e]:e},C.getOtherTargetXs=function(){var t=Object.keys(this.data.xs);return t.length?this.data.xs[t[0]]:null},C.getOtherTargetX=function(t){var e=this.getOtherTargetXs();return e&&t<e.length?e[t]:null},C.addXs=function(t){var e=this;Object.keys(t).forEach(function(n){e.config.data_xs[n]=t[n]})},C.hasMultipleX=function(t){return this.d3.set(Object.keys(t).map(function(e){return t[e]})).size()>1},C.isMultipleX=function(){return v(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},C.addName=function(t){var e;return t&&(e=this.config.data_names[t.id],t.name=void 0!==e?e:t.id),t},C.getValueOnIndex=function(t,e){var n=t.filter(function(t){return t.index===e});return n.length?n[0]:null},C.updateTargetX=function(t,e){var n=this;t.forEach(function(t){t.values.forEach(function(i,o){i.x=n.generateTargetX(e[o],t.id,o)}),n.data.xs[t.id]=e})},C.updateTargetXs=function(t,e){var n=this;t.forEach(function(t){e[t.id]&&n.updateTargetX([t],e[t.id])})},C.generateTargetX=function(t,e,n){var i=this;return i.isTimeSeries()?t?i.parseDate(t):i.parseDate(i.getXValue(e,n)):i.isCustomX()&&!i.isCategorized()?s(t)?+t:i.getXValue(e,n):n},C.cloneTarget=function(t){return{id:t.id,id_org:t.id_org,values:t.values.map(function(t){return{x:t.x,value:t.value,id:t.id}})}},C.updateXs=function(){var t=this;t.data.targets.length&&(t.xs=[],t.data.targets[0].values.forEach(function(e){t.xs[e.index]=e.x}))},C.getPrevX=function(t){var e=this.xs[t-1];return void 0!==e?e:null},C.getNextX=function(t){var e=this.xs[t+1];return void 0!==e?e:null},C.getMaxDataCount=function(){return this.d3.max(this.data.targets,function(t){return t.values.length})},C.getMaxDataCountTarget=function(t){var e,n=t.length,i=0;return n>1?t.forEach(function(t){t.values.length>i&&(e=t,i=t.values.length)}):e=n?t[0]:null,e},C.getEdgeX=function(t){return t.length?[this.d3.min(t,function(t){return t.values[0].x}),this.d3.max(t,function(t){return t.values[t.values.length-1].x})]:[0,0]},C.mapToIds=function(t){return t.map(function(t){return t.id})},C.mapToTargetIds=function(t){return t?[].concat(t):this.mapToIds(this.data.targets)},C.hasTarget=function(t,e){var n,i=this.mapToIds(t);for(n=0;n<i.length;n++)if(i[n]===e)return!0;return!1},C.isTargetToShow=function(t){return this.hiddenTargetIds.indexOf(t)<0},C.isLegendToShow=function(t){return this.hiddenLegendIds.indexOf(t)<0},C.filterTargetsToShow=function(t){var e=this;return t.filter(function(t){return e.isTargetToShow(t.id)})},C.mapTargetsToUniqueXs=function(t){var e=this.d3.set(this.d3.merge(t.map(function(t){return t.values.map(function(t){return+t.x})}))).values();return(e=this.isTimeSeries()?e.map(function(t){return new Date(+t)}):e.map(function(t){return+t})).sort(function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN})},C.addHiddenTargetIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e<t.length;e++)this.hiddenTargetIds.indexOf(t[e])<0&&(this.hiddenTargetIds=this.hiddenTargetIds.concat(t[e]))},C.removeHiddenTargetIds=function(t){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(e){return t.indexOf(e)<0})},C.addHiddenLegendIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e<t.length;e++)this.hiddenLegendIds.indexOf(t[e])<0&&(this.hiddenLegendIds=this.hiddenLegendIds.concat(t[e]))},C.removeHiddenLegendIds=function(t){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(e){return t.indexOf(e)<0})},C.getValuesAsIdKeyed=function(t){var e={};return t.forEach(function(t){e[t.id]=[],t.values.forEach(function(n){e[t.id].push(n.value)})}),e},C.checkValueInTargets=function(t,e){var n,i,o,r=Object.keys(t);for(n=0;n<r.length;n++)for(o=t[r[n]].values,i=0;i<o.length;i++)if(e(o[i].value))return!0;return!1},C.hasNegativeValueInTargets=function(t){return this.checkValueInTargets(t,function(t){return t<0})},C.hasPositiveValueInTargets=function(t){return this.checkValueInTargets(t,function(t){return t>0})},C.isOrderDesc=function(){var t=this.config;return"string"==typeof t.data_order&&"desc"===t.data_order.toLowerCase()},C.isOrderAsc=function(){var t=this.config;return"string"==typeof t.data_order&&"asc"===t.data_order.toLowerCase()},C.getOrderFunction=function(){var t=this.config,e=this.isOrderAsc(),n=this.isOrderDesc();if(e||n)return function(t,e){var i=function(t,e){return t+Math.abs(e.value)},o=t.values.reduce(i,0),r=e.values.reduce(i,0);return n?r-o:o-r};if(l(t.data_order))return t.data_order;if(u(t.data_order)){var i=t.data_order;return function(t,e){return i.indexOf(t.id)-i.indexOf(e.id)}}},C.orderTargets=function(t){var e=this.getOrderFunction();return e&&(t.sort(e),(this.isOrderAsc()||this.isOrderDesc())&&t.reverse()),t},C.filterByX=function(t,e){return this.d3.merge(t.map(function(t){return t.values})).filter(function(t){return t.x-e==0})},C.filterRemoveNull=function(t){return t.filter(function(t){return s(t.value)})},C.filterByXDomain=function(t,e){return t.map(function(t){return{id:t.id,id_org:t.id_org,values:t.values.filter(function(t){return e[0]<=t.x&&t.x<=e[1]})}})},C.hasDataLabel=function(){var t=this.config;return!("boolean"!=typeof t.data_labels||!t.data_labels)||!("object"!==o(t.data_labels)||!v(t.data_labels))},C.getDataLabelLength=function(t,e,n){var i=this,o=[0,0];return i.selectChart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text(function(t){return i.dataLabelFormat(t.id)(t)}).each(function(t,e){o[e]=1.3*this.getBoundingClientRect()[n]}).remove(),o},C.isNoneArc=function(t){return this.hasTarget(this.data.targets,t.id)},C.isArc=function(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},C.findSameXOfValues=function(t,e){var n,i=t[e].x,o=[];for(n=e-1;n>=0&&i===t[n].x;n--)o.push(t[n]);for(n=e;n<t.length&&i===t[n].x;n++)o.push(t[n]);return o},C.findClosestFromTargets=function(t,e){var n,i=this;return n=t.map(function(t){return i.findClosest(t.values,e)}),i.findClosest(n,e)},C.findClosest=function(t,e){var n,o=this,r=o.config.point_sensitivity;return t.filter(function(t){return t&&o.isBarType(t.id)}).forEach(function(t){var e=o.main.select("."+i.bars+o.getTargetSelectorSuffix(t.id)+" ."+i.bar+"-"+t.index).node();!n&&o.isWithinBar(e)&&(n=t)}),t.filter(function(t){return t&&!o.isBarType(t.id)}).forEach(function(t){var i=o.dist(t,e);i<r&&(r=i,n=t)}),n},C.dist=function(t,e){var n=this.config,i=n.axis_rotated?1:0,o=n.axis_rotated?0:1,r=this.circleY(t,t.index),a=this.x(t.x);return Math.sqrt(Math.pow(a-e[i],2)+Math.pow(r-e[o],2))},C.convertValuesToStep=function(t){var e,n=[].concat(t);if(!this.isCategorized())return t;for(e=t.length+1;0<e;e--)n[e]=n[e-1];return n[0]={x:n[0].x-1,value:n[0].value,id:n[0].id},n[t.length+1]={x:n[t.length].x+1,value:n[t.length].value,id:n[t.length].id},n},C.updateDataAttributes=function(t,e){var n=this.config["data_"+t];return void 0===e?n:(Object.keys(e).forEach(function(t){n[t]=e[t]}),this.redraw({withLegend:!0}),n)},C.load=function(t,e){var n=this;t&&(e.filter&&(t=t.filter(e.filter)),(e.type||e.types)&&t.forEach(function(t){var i=e.types&&e.types[t.id]?e.types[t.id]:e.type;n.setTargetType(t.id,i)}),n.data.targets.forEach(function(e){for(var n=0;n<t.length;n++)if(e.id===t[n].id){e.values=t[n].values,t.splice(n,1);break}}),n.data.targets=n.data.targets.concat(t)),n.updateTargets(n.data.targets),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.done&&e.done()},C.loadFromArgs=function(t){var e=this;t.data?e.load(e.convertDataToTargets(t.data),t):t.url?e.convertUrlToData(t.url,t.mimeType,t.headers,t.keys,function(n){e.load(e.convertDataToTargets(n),t)}):t.json?e.load(e.convertDataToTargets(e.convertJsonToData(t.json,t.keys)),t):t.rows?e.load(e.convertDataToTargets(e.convertRowsToData(t.rows)),t):t.columns?e.load(e.convertDataToTargets(e.convertColumnsToData(t.columns)),t):e.load(null,t)},C.unload=function(t,e){var n=this;e||(e=function(){}),(t=t.filter(function(t){return n.hasTarget(n.data.targets,t)}))&&0!==t.length?(n.svg.selectAll(t.map(function(t){return n.selectorTarget(t)})).transition().style("opacity",0).remove().call(n.endall,e),t.forEach(function(t){n.withoutFadeIn[t]=!1,n.legend&&n.legend.selectAll("."+i.legendItem+n.getTargetSelectorSuffix(t)).remove(),n.data.targets=n.data.targets.filter(function(e){return e.id!==t})})):e()},C.getYDomainMin=function(t){var e,n,i,o,r,a,s=this,l=s.config,u=s.mapToIds(t),c=s.getValuesAsIdKeyed(t);if(l.data_groups.length>0)for(a=s.hasNegativeValueInTargets(t),e=0;e<l.data_groups.length;e++)if(0!==(o=l.data_groups[e].filter(function(t){return u.indexOf(t)>=0})).length)for(i=o[0],a&&c[i]&&c[i].forEach(function(t,e){c[i][e]=t<0?t:0}),n=1;n<o.length;n++)r=o[n],c[r]&&c[r].forEach(function(t,e){s.axis.getId(r)!==s.axis.getId(i)||!c[i]||a&&+t>0||(c[i][e]+=+t)});return s.d3.min(Object.keys(c).map(function(t){return s.d3.min(c[t])}))},C.getYDomainMax=function(t){var e,n,i,o,r,a,s=this,l=s.config,u=s.mapToIds(t),c=s.getValuesAsIdKeyed(t);if(l.data_groups.length>0)for(a=s.hasPositiveValueInTargets(t),e=0;e<l.data_groups.length;e++)if(0!==(o=l.data_groups[e].filter(function(t){return u.indexOf(t)>=0})).length)for(i=o[0],a&&c[i]&&c[i].forEach(function(t,e){c[i][e]=t>0?t:0}),n=1;n<o.length;n++)r=o[n],c[r]&&c[r].forEach(function(t,e){s.axis.getId(r)!==s.axis.getId(i)||!c[i]||a&&+t<0||(c[i][e]+=+t)});return s.d3.max(Object.keys(c).map(function(t){return s.d3.max(c[t])}))},C.getYDomain=function(t,e,n){var i,o,r,a,l,u,c,h,d,f,p=this,m=p.config,y=t.filter(function(t){return p.axis.getId(t.id)===e}),b=n?p.filterByXDomain(y,n):y,w="y2"===e?m.axis_y2_min:m.axis_y_min,_="y2"===e?m.axis_y2_max:m.axis_y_max,x=p.getYDomainMin(b),S=p.getYDomainMax(b),E="y2"===e?m.axis_y2_center:m.axis_y_center,C=p.hasType("bar",b)&&m.bar_zerobased||p.hasType("area",b)&&m.area_zerobased,T="y2"===e?m.axis_y2_inverted:m.axis_y_inverted,M=p.hasDataLabel()&&m.axis_rotated,P=p.hasDataLabel()&&!m.axis_rotated;return x=s(w)?w:s(_)?x<_?x:_-10:x,S=s(_)?_:s(w)?w<S?S:w+10:S,0===b.length?"y2"===e?p.y2.domain():p.y.domain():(isNaN(x)&&(x=0),isNaN(S)&&(S=x),x===S&&(x<0?S=0:x=0),d=x>=0&&S>=0,f=x<=0&&S<=0,(s(w)&&d||s(_)&&f)&&(C=!1),C&&(d&&(x=0),f&&(S=0)),r=a=.1*(o=Math.abs(S-x)),void 0!==E&&(S=E+(l=Math.max(Math.abs(x),Math.abs(S))),x=E-l),M?(u=p.getDataLabelLength(x,S,"width"),c=g(p.y.range()),r+=o*((h=[u[0]/c,u[1]/c])[1]/(1-h[0]-h[1])),a+=o*(h[0]/(1-h[0]-h[1]))):P&&(u=p.getDataLabelLength(x,S,"height"),r+=p.axis.convertPixelsToAxisPadding(u[1],o),a+=p.axis.convertPixelsToAxisPadding(u[0],o)),"y"===e&&v(m.axis_y_padding)&&(r=p.axis.getPadding(m.axis_y_padding,"top",r,o),a=p.axis.getPadding(m.axis_y_padding,"bottom",a,o)),"y2"===e&&v(m.axis_y2_padding)&&(r=p.axis.getPadding(m.axis_y2_padding,"top",r,o),a=p.axis.getPadding(m.axis_y2_padding,"bottom",a,o)),C&&(d&&(a=x),f&&(r=-S)),i=[x-a,S+r],T?i.reverse():i)},C.getXDomainMin=function(t){var e=this,n=e.config;return d(n.axis_x_min)?e.isTimeSeries()?this.parseDate(n.axis_x_min):n.axis_x_min:e.d3.min(t,function(t){return e.d3.min(t.values,function(t){return t.x})})},C.getXDomainMax=function(t){var e=this,n=e.config;return d(n.axis_x_max)?e.isTimeSeries()?this.parseDate(n.axis_x_max):n.axis_x_max:e.d3.max(t,function(t){return e.d3.max(t.values,function(t){return t.x})})},C.getXDomainPadding=function(t){var e,n,i,r,a=this.config,l=t[1]-t[0];return n=this.isCategorized()?0:this.hasType("bar")?(e=this.getMaxDataCount())>1?l/(e-1)/2:.5:.01*l,"object"===o(a.axis_x_padding)&&v(a.axis_x_padding)?(i=s(a.axis_x_padding.left)?a.axis_x_padding.left:n,r=s(a.axis_x_padding.right)?a.axis_x_padding.right:n):i=r="number"==typeof a.axis_x_padding?a.axis_x_padding:n,{left:i,right:r}},C.getXDomain=function(t){var e=this,n=[e.getXDomainMin(t),e.getXDomainMax(t)],i=n[0],o=n[1],r=e.getXDomainPadding(n),a=0,s=0;return i-o!=0||e.isCategorized()||(e.isTimeSeries()?(i=new Date(.5*i.getTime()),o=new Date(1.5*o.getTime())):(i=0===i?1:.5*i,o=0===o?-1:1.5*o)),(i||0===i)&&(a=e.isTimeSeries()?new Date(i.getTime()-r.left):i-r.left),(o||0===o)&&(s=e.isTimeSeries()?new Date(o.getTime()+r.right):o+r.right),[a,s]},C.updateXDomain=function(t,e,n,i,o){var r=this,a=r.config;return n&&(r.x.domain(o||r.d3.extent(r.getXDomain(t))),r.orgXDomain=r.x.domain(),a.zoom_enabled&&r.zoom.scale(r.x).updateScaleExtent(),r.subX.domain(r.x.domain()),r.brush&&r.brush.scale(r.subX)),e&&(r.x.domain(o||(!r.brush||r.brush.empty()?r.orgXDomain:r.brush.extent())),a.zoom_enabled&&r.zoom.scale(r.x).updateScaleExtent()),i&&r.x.domain(r.trimXDomain(r.x.orgDomain())),r.x.domain()},C.trimXDomain=function(t){var e=this.getZoomDomain(),n=e[0],i=e[1];return t[0]<=n&&(t[1]=+t[1]+(n-t[0]),t[0]=n),i<=t[1]&&(t[0]=+t[0]-(t[1]-i),t[1]=i),t},C.drag=function(t){var e,n,o,r,a,s,l,u,c=this,h=c.config,d=c.main,f=c.d3;c.hasArcType()||h.data_selection_enabled&&(h.zoom_enabled&&!c.zoom.altDomain||h.data_selection_multiple&&(e=c.dragStart[0],n=c.dragStart[1],o=t[0],r=t[1],a=Math.min(e,o),s=Math.max(e,o),l=h.data_selection_grouped?c.margin.top:Math.min(n,r),u=h.data_selection_grouped?c.height:Math.max(n,r),d.select("."+i.dragarea).attr("x",a).attr("y",l).attr("width",s-a).attr("height",u-l),d.selectAll("."+i.shapes).selectAll("."+i.shape).filter(function(t){return h.data_selection_isselectable(t)}).each(function(t,e){var n,o,r,h,d,p,g=f.select(this),m=g.classed(i.SELECTED),v=g.classed(i.INCLUDED),y=!1;if(g.classed(i.circle))n=1*g.attr("cx"),o=1*g.attr("cy"),d=c.togglePoint,y=a<n&&n<s&&l<o&&o<u;else{if(!g.classed(i.bar))return;n=(p=_(this)).x,o=p.y,r=p.width,h=p.height,d=c.togglePath,y=!(s<n||n+r<a||u<o||o+h<l)}y^v&&(g.classed(i.INCLUDED,!v),g.classed(i.SELECTED,!m),d.call(c,!m,g,t,e))})))},C.dragstart=function(t){var e=this,n=e.config;e.hasArcType()||n.data_selection_enabled&&(e.dragStart=t,e.main.select("."+i.chart).append("rect").attr("class",i.dragarea).style("opacity",.1),e.dragging=!0)},C.dragend=function(){var t=this,e=t.config;t.hasArcType()||e.data_selection_enabled&&(t.main.select("."+i.dragarea).transition().duration(100).style("opacity",0).remove(),t.main.selectAll("."+i.shape).classed(i.INCLUDED,!1),t.dragging=!1)},C.getYFormat=function(t){var e=this,n=t&&!e.hasType("gauge")?e.defaultArcValueFormat:e.yFormat,i=t&&!e.hasType("gauge")?e.defaultArcValueFormat:e.y2Format;return function(t,o,r){return("y2"===e.axis.getId(r)?i:n).call(e,t,o)}},C.yFormat=function(t){var e=this.config;return(e.axis_y_tick_format?e.axis_y_tick_format:this.defaultValueFormat)(t)},C.y2Format=function(t){var e=this.config;return(e.axis_y2_tick_format?e.axis_y2_tick_format:this.defaultValueFormat)(t)},C.defaultValueFormat=function(t){return s(t)?+t:""},C.defaultArcValueFormat=function(t,e){return(100*e).toFixed(1)+"%"},C.dataLabelFormat=function(t){var e=this.config.data_labels,n=function(t){return s(t)?+t:""};return"function"==typeof e.format?e.format:"object"===o(e.format)?e.format[t]?!0===e.format[t]?n:e.format[t]:function(){return""}:n},C.initGrid=function(){var t=this,e=t.config,n=t.d3;t.grid=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",i.grid),e.grid_x_show&&t.grid.append("g").attr("class",i.xgrids),e.grid_y_show&&t.grid.append("g").attr("class",i.ygrids),e.grid_focus_show&&t.grid.append("g").attr("class",i.xgridFocus).append("line").attr("class",i.xgridFocus),t.xgrid=n.selectAll([]),e.grid_lines_front||t.initGridLines()},C.initGridLines=function(){var t=this,e=t.d3;t.gridLines=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",i.grid+" "+i.gridLines),t.gridLines.append("g").attr("class",i.xgridLines),t.gridLines.append("g").attr("class",i.ygridLines),t.xgridLines=e.selectAll([])},C.updateXGrid=function(t){var e=this,n=e.config,o=e.d3,r=e.generateGridData(n.grid_x_type,e.x),a=e.isCategorized()?e.xAxis.tickOffset():0;e.xgridAttr=n.axis_rotated?{x1:0,x2:e.width,y1:function(t){return e.x(t)-a},y2:function(t){return e.x(t)-a}}:{x1:function(t){return e.x(t)+a},x2:function(t){return e.x(t)+a},y1:0,y2:e.height},e.xgrid=e.main.select("."+i.xgrids).selectAll("."+i.xgrid).data(r),e.xgrid.enter().append("line").attr("class",i.xgrid),t||e.xgrid.attr(e.xgridAttr).style("opacity",function(){return+o.select(this).attr(n.axis_rotated?"y1":"x1")===(n.axis_rotated?e.height:0)?0:1}),e.xgrid.exit().remove()},C.updateYGrid=function(){var t=this,e=t.config,n=t.yAxis.tickValues()||t.y.ticks(e.grid_y_ticks);t.ygrid=t.main.select("."+i.ygrids).selectAll("."+i.ygrid).data(n),t.ygrid.enter().append("line").attr("class",i.ygrid),t.ygrid.attr("x1",e.axis_rotated?t.y:0).attr("x2",e.axis_rotated?t.y:t.width).attr("y1",e.axis_rotated?0:t.y).attr("y2",e.axis_rotated?t.height:t.y),t.ygrid.exit().remove(),t.smoothLines(t.ygrid,"grid")},C.gridTextAnchor=function(t){return t.position?t.position:"end"},C.gridTextDx=function(t){return"start"===t.position?4:"middle"===t.position?0:-4},C.xGridTextX=function(t){return"start"===t.position?-this.height:"middle"===t.position?-this.height/2:0},C.yGridTextX=function(t){return"start"===t.position?0:"middle"===t.position?this.width/2:this.width},C.updateGrid=function(t){var e,n,o,r=this,a=r.main,s=r.config;r.grid.style("visibility",r.hasArcType()?"hidden":"visible"),a.select("line."+i.xgridFocus).style("visibility","hidden"),s.grid_x_show&&r.updateXGrid(),r.xgridLines=a.select("."+i.xgridLines).selectAll("."+i.xgridLine).data(s.grid_x_lines),(e=r.xgridLines.enter().append("g").attr("class",function(t){return i.xgridLine+(t.class?" "+t.class:"")})).append("line").style("opacity",0),e.append("text").attr("text-anchor",r.gridTextAnchor).attr("transform",s.axis_rotated?"":"rotate(-90)").attr("dx",r.gridTextDx).attr("dy",-5).style("opacity",0),r.xgridLines.exit().transition().duration(t).style("opacity",0).remove(),s.grid_y_show&&r.updateYGrid(),r.ygridLines=a.select("."+i.ygridLines).selectAll("."+i.ygridLine).data(s.grid_y_lines),(n=r.ygridLines.enter().append("g").attr("class",function(t){return i.ygridLine+(t.class?" "+t.class:"")})).append("line").style("opacity",0),n.append("text").attr("text-anchor",r.gridTextAnchor).attr("transform",s.axis_rotated?"rotate(-90)":"").attr("dx",r.gridTextDx).attr("dy",-5).style("opacity",0),o=r.yv.bind(r),r.ygridLines.select("line").transition().duration(t).attr("x1",s.axis_rotated?o:0).attr("x2",s.axis_rotated?o:r.width).attr("y1",s.axis_rotated?0:o).attr("y2",s.axis_rotated?r.height:o).style("opacity",1),r.ygridLines.select("text").transition().duration(t).attr("x",s.axis_rotated?r.xGridTextX.bind(r):r.yGridTextX.bind(r)).attr("y",o).text(function(t){return t.text}).style("opacity",1),r.ygridLines.exit().transition().duration(t).style("opacity",0).remove()},C.redrawGrid=function(t){var e=this,n=e.config,i=e.xv.bind(e),o=e.xgridLines.select("line"),r=e.xgridLines.select("text");return[(t?o.transition():o).attr("x1",n.axis_rotated?0:i).attr("x2",n.axis_rotated?e.width:i).attr("y1",n.axis_rotated?i:0).attr("y2",n.axis_rotated?i:e.height).style("opacity",1),(t?r.transition():r).attr("x",n.axis_rotated?e.yGridTextX.bind(e):e.xGridTextX.bind(e)).attr("y",i).text(function(t){return t.text}).style("opacity",1)]},C.showXGridFocus=function(t){var e=this,n=e.config,o=t.filter(function(t){return t&&s(t.value)}),r=e.main.selectAll("line."+i.xgridFocus),a=e.xx.bind(e);n.tooltip_show&&(e.hasType("scatter")||e.hasArcType()||(r.style("visibility","visible").data([o[0]]).attr(n.axis_rotated?"y1":"x1",a).attr(n.axis_rotated?"y2":"x2",a),e.smoothLines(r,"grid")))},C.hideXGridFocus=function(){this.main.select("line."+i.xgridFocus).style("visibility","hidden")},C.updateXgridFocus=function(){var t=this.config;this.main.select("line."+i.xgridFocus).attr("x1",t.axis_rotated?0:-10).attr("x2",t.axis_rotated?this.width:-10).attr("y1",t.axis_rotated?-10:0).attr("y2",t.axis_rotated?-10:this.height)},C.generateGridData=function(t,e){var n,o,r,a,s=[],l=this.main.select("."+i.axisX).selectAll(".tick").size();if("year"===t)for(o=(n=this.getXDomain())[0].getFullYear(),r=n[1].getFullYear(),a=o;a<=r;a++)s.push(new Date(a+"-01-01 00:00:00"));else(s=e.ticks(10)).length>l&&(s=s.filter(function(t){return(""+t).indexOf(".")<0}));return s},C.getGridFilterToRemove=function(t){return t?function(e){var n=!1;return[].concat(t).forEach(function(t){("value"in t&&e.value===t.value||"class"in t&&e.class===t.class)&&(n=!0)}),n}:function(){return!0}},C.removeGridLines=function(t,e){var n=this.config,o=this.getGridFilterToRemove(t),r=function(t){return!o(t)},a=e?i.xgridLines:i.ygridLines,s=e?i.xgridLine:i.ygridLine;this.main.select("."+a).selectAll("."+s).filter(o).transition().duration(n.transition_duration).style("opacity",0).remove(),e?n.grid_x_lines=n.grid_x_lines.filter(r):n.grid_y_lines=n.grid_y_lines.filter(r)},C.initEventRect=function(){this.main.select("."+i.chart).append("g").attr("class",i.eventRects).style("fill-opacity",0)},C.redrawEventRect=function(){var t,e,n=this,o=n.config,r=n.isMultipleX(),a=n.main.select("."+i.eventRects).style("cursor",o.zoom_enabled?o.axis_rotated?"ns-resize":"ew-resize":null).classed(i.eventRectsMultiple,r).classed(i.eventRectsSingle,!r);a.selectAll("."+i.eventRect).remove(),n.eventRect=a.selectAll("."+i.eventRect),r?(t=n.eventRect.data([0]),n.generateEventRectsForMultipleXs(t.enter()),n.updateEventRect(t)):(e=n.getMaxDataCountTarget(n.data.targets),a.datum(e?e.values:[]),n.eventRect=a.selectAll("."+i.eventRect),t=n.eventRect.data(function(t){return t}),n.generateEventRectsForSingleX(t.enter()),n.updateEventRect(t),t.exit().remove())},C.updateEventRect=function(t){var e,n,i,o,r,a,s=this,l=s.config;t=t||s.eventRect.data(function(t){return t}),s.isMultipleX()?(e=0,n=0,i=s.width,o=s.height):(!s.isCustomX()&&!s.isTimeSeries()||s.isCategorized()?(r=s.getEventRectWidth(),a=function(t){return s.x(t.x)-r/2}):(s.updateXs(),r=function(t){var e=s.getPrevX(t.index),n=s.getNextX(t.index);return null===e&&null===n?l.axis_rotated?s.height:s.width:(null===e&&(e=s.x.domain()[0]),null===n&&(n=s.x.domain()[1]),Math.max(0,(s.x(n)-s.x(e))/2))},a=function(t){var e=s.getPrevX(t.index),n=s.getNextX(t.index),i=s.data.xs[t.id][t.index];return null===e&&null===n?0:(null===e&&(e=s.x.domain()[0]),(s.x(i)+s.x(e))/2)}),e=l.axis_rotated?0:a,n=l.axis_rotated?a:0,i=l.axis_rotated?s.width:r,o=l.axis_rotated?r:s.height),t.attr("class",s.classEvent.bind(s)).attr("x",e).attr("y",n).attr("width",i).attr("height",o)},C.generateEventRectsForSingleX=function(t){var e=this,n=e.d3,o=e.config;t.append("rect").attr("class",e.classEvent.bind(e)).style("cursor",o.data_selection_enabled&&o.data_selection_grouped?"pointer":null).on("mouseover",function(t){var n=t.index;e.dragging||e.flowing||e.hasArcType()||(o.point_focus_expand_enabled&&e.expandCircles(n,null,!0),e.expandBars(n,null,!0),e.main.selectAll("."+i.shape+"-"+n).each(function(t){o.data_onmouseover.call(e.api,t)}))}).on("mouseout",function(t){var n=t.index;e.config&&(e.hasArcType()||(e.hideXGridFocus(),e.hideTooltip(),e.unexpandCircles(),e.unexpandBars(),e.main.selectAll("."+i.shape+"-"+n).each(function(t){o.data_onmouseout.call(e.api,t)})))}).on("mousemove",function(t){var r,a=t.index,s=e.svg.select("."+i.eventRect+"-"+a);e.dragging||e.flowing||e.hasArcType()||(e.isStepType(t)&&"step-after"===e.config.line_step_type&&n.mouse(this)[0]<e.x(e.getXValue(t.id,a))&&(a-=1),r=e.filterTargetsToShow(e.data.targets).map(function(t){return e.addName(e.getValueOnIndex(t.values,a))}),o.tooltip_grouped&&(e.showTooltip(r,this),e.showXGridFocus(r)),(!o.tooltip_grouped||o.data_selection_enabled&&!o.data_selection_grouped)&&e.main.selectAll("."+i.shape+"-"+a).each(function(){n.select(this).classed(i.EXPANDED,!0),o.data_selection_enabled&&s.style("cursor",o.data_selection_grouped?"pointer":null),o.tooltip_grouped||(e.hideXGridFocus(),e.hideTooltip(),o.data_selection_grouped||(e.unexpandCircles(a),e.unexpandBars(a)))}).filter(function(t){return e.isWithinShape(this,t)}).each(function(t){o.data_selection_enabled&&(o.data_selection_grouped||o.data_selection_isselectable(t))&&s.style("cursor","pointer"),o.tooltip_grouped||(e.showTooltip([t],this),e.showXGridFocus([t]),o.point_focus_expand_enabled&&e.expandCircles(a,t.id,!0),e.expandBars(a,t.id,!0))}))}).on("click",function(t){var r=t.index;!e.hasArcType()&&e.toggleShape&&(e.cancelClick?e.cancelClick=!1:(e.isStepType(t)&&"step-after"===o.line_step_type&&n.mouse(this)[0]<e.x(e.getXValue(t.id,r))&&(r-=1),e.main.selectAll("."+i.shape+"-"+r).each(function(t){(o.data_selection_grouped||e.isWithinShape(this,t))&&(e.toggleShape(this,t,r),e.config.data_onclick.call(e.api,t,this))})))}).call(o.data_selection_draggable&&e.drag?n.behavior.drag().origin(Object).on("drag",function(){e.drag(n.mouse(this))}).on("dragstart",function(){e.dragstart(n.mouse(this))}).on("dragend",function(){e.dragend()}):function(){})},C.generateEventRectsForMultipleXs=function(t){var e=this,n=e.d3,o=e.config;function r(){e.svg.select("."+i.eventRect).style("cursor",null),e.hideXGridFocus(),e.hideTooltip(),e.unexpandCircles(),e.unexpandBars()}t.append("rect").attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height).attr("class",i.eventRect).on("mouseout",function(){e.config&&(e.hasArcType()||r())}).on("mousemove",function(){var t,a,s,l=e.filterTargetsToShow(e.data.targets);e.dragging||e.hasArcType(l)||(t=n.mouse(this),a=e.findClosestFromTargets(l,t),!e.mouseover||a&&a.id===e.mouseover.id||(o.data_onmouseout.call(e.api,e.mouseover),e.mouseover=void 0),a?(s=(e.isScatterType(a)||!o.tooltip_grouped?[a]:e.filterByX(l,a.x)).map(function(t){return e.addName(t)}),e.showTooltip(s,this),o.point_focus_expand_enabled&&e.expandCircles(a.index,a.id,!0),e.expandBars(a.index,a.id,!0),e.showXGridFocus(s),(e.isBarType(a.id)||e.dist(a,t)<o.point_sensitivity)&&(e.svg.select("."+i.eventRect).style("cursor","pointer"),e.mouseover||(o.data_onmouseover.call(e.api,a),e.mouseover=a))):r())}).on("click",function(){var t,r,a=e.filterTargetsToShow(e.data.targets);e.hasArcType(a)||(t=n.mouse(this),(r=e.findClosestFromTargets(a,t))&&(e.isBarType(r.id)||e.dist(r,t)<o.point_sensitivity)&&e.main.selectAll("."+i.shapes+e.getTargetSelectorSuffix(r.id)).selectAll("."+i.shape+"-"+r.index).each(function(){(o.data_selection_grouped||e.isWithinShape(this,r))&&(e.toggleShape(this,r,r.index),e.config.data_onclick.call(e.api,r,this))}))}).call(o.data_selection_draggable&&e.drag?n.behavior.drag().origin(Object).on("drag",function(){e.drag(n.mouse(this))}).on("dragstart",function(){e.dragstart(n.mouse(this))}).on("dragend",function(){e.dragend()}):function(){})},C.dispatchEvent=function(t,e,n){var o="."+i.eventRect+(this.isMultipleX()?"":"-"+e),r=this.main.select(o).node(),a=r.getBoundingClientRect(),s=a.left+(n?n[0]:0),l=a.top+(n?n[1]:0),u=document.createEvent("MouseEvents");u.initMouseEvent(t,!0,!0,window,0,s,l,s,l,!1,!1,!1,!1,0,null),r.dispatchEvent(u)},C.initLegend=function(){var t=this;if(t.legendItemTextBox={},t.legendHasRendered=!1,t.legend=t.svg.append("g").attr("transform",t.getTranslate("legend")),!t.config.legend_show)return t.legend.style("visibility","hidden"),void(t.hiddenLegendIds=t.mapToIds(t.data.targets));t.updateLegendWithDefaults()},C.updateLegendWithDefaults=function(){this.updateLegend(this.mapToIds(this.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},C.updateSizeForLegend=function(t,e){var n=this,i=n.config,o={top:n.isLegendTop?n.getCurrentPaddingTop()+i.legend_inset_y+5.5:n.currentHeight-t-n.getCurrentPaddingBottom()-i.legend_inset_y,left:n.isLegendLeft?n.getCurrentPaddingLeft()+i.legend_inset_x+.5:n.currentWidth-e-n.getCurrentPaddingRight()-i.legend_inset_x+.5};n.margin3={top:n.isLegendRight?0:n.isLegendInset?o.top:n.currentHeight-t,right:NaN,bottom:0,left:n.isLegendRight?n.currentWidth-e:n.isLegendInset?o.left:0}},C.transformLegend=function(t){(t?this.legend.transition():this.legend).attr("transform",this.getTranslate("legend"))},C.updateLegendStep=function(t){this.legendStep=t},C.updateLegendItemWidth=function(t){this.legendItemWidth=t},C.updateLegendItemHeight=function(t){this.legendItemHeight=t},C.getLegendWidth=function(){var t=this;return t.config.legend_show?t.isLegendRight||t.isLegendInset?t.legendItemWidth*(t.legendStep+1):t.currentWidth:0},C.getLegendHeight=function(){var t=this,e=0;return t.config.legend_show&&(e=t.isLegendRight?t.currentHeight:Math.max(20,t.legendItemHeight)*(t.legendStep+1)),e},C.opacityForLegend=function(t){return t.classed(i.legendItemHidden)?null:1},C.opacityForUnfocusedLegend=function(t){return t.classed(i.legendItemHidden)?null:.3},C.toggleFocusLegend=function(t,e){var n=this;t=n.mapToTargetIds(t),n.legend.selectAll("."+i.legendItem).filter(function(e){return t.indexOf(e)>=0}).classed(i.legendItemFocused,e).transition().duration(100).style("opacity",function(){return(e?n.opacityForLegend:n.opacityForUnfocusedLegend).call(n,n.d3.select(this))})},C.revertLegend=function(){var t=this,e=t.d3;t.legend.selectAll("."+i.legendItem).classed(i.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return t.opacityForLegend(e.select(this))})},C.showLegend=function(t){var e=this,n=e.config;n.legend_show||(n.legend_show=!0,e.legend.style("visibility","visible"),e.legendHasRendered||e.updateLegendWithDefaults()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",function(){return e.opacityForLegend(e.d3.select(this))})},C.hideLegend=function(t){var e=this,n=e.config;n.legend_show&&m(t)&&(n.legend_show=!1,e.legend.style("visibility","hidden")),e.addHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("opacity",0).style("visibility","hidden")},C.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},C.updateLegend=function(t,e,n){var o,r,a,s,l,u,c,h,f,p,g,m,v,b,w,_,x=this,S=x.config,E=4,C=10,T=0,M=0,P=10,L=S.legend_item_tile_width+5,A=0,k={},O={},R={},D=[0],j={},z=0;function N(e,n,o){var r,a,s=0===o,l=o===t.length-1,u=function(t,e){return x.legendItemTextBox[e]||(x.legendItemTextBox[e]=x.getTextRect(t.textContent,i.legendItem,t)),x.legendItemTextBox[e]}(e,n),c=u.width+L+(!l||x.isLegendRight||x.isLegendInset?C:0)+S.legend_padding,h=u.height+E,d=x.isLegendRight||x.isLegendInset?h:c,f=x.isLegendRight||x.isLegendInset?x.getLegendHeight():x.getLegendWidth();function p(t,e){e||(r=(f-A-d)/2)<P&&(r=(f-d)/2,A=0,z++),j[t]=z,D[z]=x.isLegendInset?10:r,k[t]=A,A+=d}s&&(A=0,z=0,T=0,M=0),!S.legend_show||x.isLegendToShow(n)?(O[n]=c,R[n]=h,(!T||c>=T)&&(T=c),(!M||h>=M)&&(M=h),a=x.isLegendRight||x.isLegendInset?M:T,S.legend_equally?(Object.keys(O).forEach(function(t){O[t]=T}),Object.keys(R).forEach(function(t){R[t]=M}),(r=(f-a*t.length)/2)<P?(A=0,z=0,t.forEach(function(t){p(t)})):p(n,!0)):p(n)):O[n]=R[n]=j[n]=k[n]=0}t=t.filter(function(t){return!d(S.data_names[t])||null!==S.data_names[t]}),g=y(e=e||{},"withTransition",!0),m=y(e,"withTransitionForTransform",!0),x.isLegendInset&&(z=S.legend_inset_step?S.legend_inset_step:t.length,x.updateLegendStep(z)),x.isLegendRight?(o=function(t){return T*j[t]},s=function(t){return D[j[t]]+k[t]}):x.isLegendInset?(o=function(t){return T*j[t]+10},s=function(t){return D[j[t]]+k[t]}):(o=function(t){return D[j[t]]+k[t]},s=function(t){return M*j[t]}),r=function(t,e){return o(t,e)+4+S.legend_item_tile_width},l=function(t,e){return s(t,e)+9},a=function(t,e){return o(t,e)},u=function(t,e){return s(t,e)-5},c=function(t,e){return o(t,e)-2},h=function(t,e){return o(t,e)-2+S.legend_item_tile_width},f=function(t,e){return s(t,e)+4},(p=x.legend.selectAll("."+i.legendItem).data(t).enter().append("g").attr("class",function(t){return x.generateClass(i.legendItem,t)}).style("visibility",function(t){return x.isLegendToShow(t)?"visible":"hidden"}).style("cursor","pointer").on("click",function(t){S.legend_item_onclick?S.legend_item_onclick.call(x,t):x.d3.event.altKey?(x.api.hide(),x.api.show(t)):(x.api.toggle(t),x.isTargetToShow(t)?x.api.focus(t):x.api.revert())}).on("mouseover",function(t){S.legend_item_onmouseover?S.legend_item_onmouseover.call(x,t):(x.d3.select(this).classed(i.legendItemFocused,!0),!x.transiting&&x.isTargetToShow(t)&&x.api.focus(t))}).on("mouseout",function(t){S.legend_item_onmouseout?S.legend_item_onmouseout.call(x,t):(x.d3.select(this).classed(i.legendItemFocused,!1),x.api.revert())})).append("text").text(function(t){return d(S.data_names[t])?S.data_names[t]:t}).each(function(t,e){N(this,t,e)}).style("pointer-events","none").attr("x",x.isLegendRight||x.isLegendInset?r:-200).attr("y",x.isLegendRight||x.isLegendInset?-200:l),p.append("rect").attr("class",i.legendItemEvent).style("fill-opacity",0).attr("x",x.isLegendRight||x.isLegendInset?a:-200).attr("y",x.isLegendRight||x.isLegendInset?-200:u),p.append("line").attr("class",i.legendItemTile).style("stroke",x.color).style("pointer-events","none").attr("x1",x.isLegendRight||x.isLegendInset?c:-200).attr("y1",x.isLegendRight||x.isLegendInset?-200:f).attr("x2",x.isLegendRight||x.isLegendInset?h:-200).attr("y2",x.isLegendRight||x.isLegendInset?-200:f).attr("stroke-width",S.legend_item_tile_height),_=x.legend.select("."+i.legendBackground+" rect"),x.isLegendInset&&T>0&&0===_.size()&&(_=x.legend.insert("g","."+i.legendItem).attr("class",i.legendBackground).append("rect")),v=x.legend.selectAll("text").data(t).text(function(t){return d(S.data_names[t])?S.data_names[t]:t}).each(function(t,e){N(this,t,e)}),(g?v.transition():v).attr("x",r).attr("y",l),b=x.legend.selectAll("rect."+i.legendItemEvent).data(t),(g?b.transition():b).attr("width",function(t){return O[t]}).attr("height",function(t){return R[t]}).attr("x",a).attr("y",u),w=x.legend.selectAll("line."+i.legendItemTile).data(t),(g?w.transition():w).style("stroke",x.levelColor?function(t){return x.levelColor(x.cache[t].values[0].value)}:x.color).attr("x1",c).attr("y1",f).attr("x2",h).attr("y2",f),_&&(g?_.transition():_).attr("height",x.getLegendHeight()-12).attr("width",T*(z+1)+10),x.legend.selectAll("."+i.legendItem).classed(i.legendItemHidden,function(t){return!x.isTargetToShow(t)}),x.updateLegendItemWidth(T),x.updateLegendItemHeight(M),x.updateLegendStep(z),x.updateSizes(),x.updateScales(),x.updateSvgSize(),x.transformAll(m,n),x.legendHasRendered=!0},C.initRegion=function(){this.region=this.main.append("g").attr("clip-path",this.clipPath).attr("class",i.regions)},C.updateRegion=function(t){var e=this,n=e.config;e.region.style("visibility",e.hasArcType()?"hidden":"visible"),e.mainRegion=e.main.select("."+i.regions).selectAll("."+i.region).data(n.regions),e.mainRegion.enter().append("g").append("rect").style("fill-opacity",0),e.mainRegion.attr("class",e.classRegion.bind(e)),e.mainRegion.exit().transition().duration(t).style("opacity",0).remove()},C.redrawRegion=function(t){var e=this,n=e.mainRegion.selectAll("rect").each(function(){var t=e.d3.select(this.parentNode).datum();e.d3.select(this).datum(t)}),i=e.regionX.bind(e),o=e.regionY.bind(e),r=e.regionWidth.bind(e),a=e.regionHeight.bind(e);return[(t?n.transition():n).attr("x",i).attr("y",o).attr("width",r).attr("height",a).style("fill-opacity",function(t){return s(t.opacity)?t.opacity:.1})]},C.regionX=function(t){var e=this,n=e.config,i="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?n.axis_rotated&&"start"in t?i(t.start):0:n.axis_rotated?0:"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},C.regionY=function(t){var e=this,n=e.config,i="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?n.axis_rotated?0:"end"in t?i(t.end):0:n.axis_rotated&&"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},C.regionWidth=function(t){var e,n=this,i=n.config,o=n.regionX(t),r="y"===t.axis?n.y:n.y2;return(e="y"===t.axis||"y2"===t.axis?i.axis_rotated&&"end"in t?r(t.end):n.width:i.axis_rotated?n.width:"end"in t?n.x(n.isTimeSeries()?n.parseDate(t.end):t.end):n.width)<o?0:e-o},C.regionHeight=function(t){var e,n=this,i=n.config,o=this.regionY(t),r="y"===t.axis?n.y:n.y2;return(e="y"===t.axis||"y2"===t.axis?i.axis_rotated?n.height:"start"in t?r(t.start):n.height:i.axis_rotated&&"end"in t?n.x(n.isTimeSeries()?n.parseDate(t.end):t.end):n.height)<o?0:e-o},C.isRegionOnX=function(t){return!t.axis||"x"===t.axis},C.getScale=function(t,e,n){return(n?this.d3.time.scale():this.d3.scale.linear()).range([t,e])},C.getX=function(t,e,n,i){var o,r=this.getScale(t,e,this.isTimeSeries()),a=n?r.domain(n):r;for(o in this.isCategorized()?(i=i||function(){return 0},r=function(t,e){var n=a(t)+i(t);return e?n:Math.ceil(n)}):r=function(t,e){var n=a(t);return e?n:Math.ceil(n)},a)r[o]=a[o];return r.orgDomain=function(){return a.domain()},this.isCategorized()&&(r.domain=function(t){return arguments.length?(a.domain(t),r):[(t=this.orgDomain())[0],t[1]+1]}),r},C.getY=function(t,e,n){var i=this.getScale(t,e,this.isTimeSeriesY());return n&&i.domain(n),i},C.getYScale=function(t){return"y2"===this.axis.getId(t)?this.y2:this.y},C.getSubYScale=function(t){return"y2"===this.axis.getId(t)?this.subY2:this.subY},C.updateScales=function(){var t=this,e=t.config,n=!t.x;t.xMin=e.axis_rotated?1:0,t.xMax=e.axis_rotated?t.height:t.width,t.yMin=e.axis_rotated?0:t.height,t.yMax=e.axis_rotated?t.width:1,t.subXMin=t.xMin,t.subXMax=t.xMax,t.subYMin=e.axis_rotated?0:t.height2,t.subYMax=e.axis_rotated?t.width2:1,t.x=t.getX(t.xMin,t.xMax,n?void 0:t.x.orgDomain(),function(){return t.xAxis.tickOffset()}),t.y=t.getY(t.yMin,t.yMax,n?e.axis_y_default:t.y.domain()),t.y2=t.getY(t.yMin,t.yMax,n?e.axis_y2_default:t.y2.domain()),t.subX=t.getX(t.xMin,t.xMax,t.orgXDomain,function(e){return e%1?0:t.subXAxis.tickOffset()}),t.subY=t.getY(t.subYMin,t.subYMax,n?e.axis_y_default:t.subY.domain()),t.subY2=t.getY(t.subYMin,t.subYMax,n?e.axis_y2_default:t.subY2.domain()),t.xAxisTickFormat=t.axis.getXAxisTickFormat(),t.xAxisTickValues=t.axis.getXAxisTickValues(),t.yAxisTickValues=t.axis.getYAxisTickValues(),t.y2AxisTickValues=t.axis.getY2AxisTickValues(),t.xAxis=t.axis.getXAxis(t.x,t.xOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer),t.subXAxis=t.axis.getXAxis(t.subX,t.subXOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer),t.yAxis=t.axis.getYAxis(t.y,t.yOrient,e.axis_y_tick_format,t.yAxisTickValues,e.axis_y_tick_outer),t.y2Axis=t.axis.getYAxis(t.y2,t.y2Orient,e.axis_y2_tick_format,t.y2AxisTickValues,e.axis_y2_tick_outer),n||(t.brush&&t.brush.scale(t.subX),e.zoom_enabled&&t.zoom.scale(t.x)),t.updateArc&&t.updateArc()},C.selectPoint=function(t,e,n){var o=this,r=o.config,a=(r.axis_rotated?o.circleY:o.circleX).bind(o),s=(r.axis_rotated?o.circleX:o.circleY).bind(o),l=o.pointSelectR.bind(o);r.data_onselected.call(o.api,e,t.node()),o.main.select("."+i.selectedCircles+o.getTargetSelectorSuffix(e.id)).selectAll("."+i.selectedCircle+"-"+n).data([e]).enter().append("circle").attr("class",function(){return o.generateClass(i.selectedCircle,n)}).attr("cx",a).attr("cy",s).attr("stroke",function(){return o.color(e)}).attr("r",function(t){return 1.4*o.pointSelectR(t)}).transition().duration(100).attr("r",l)},C.unselectPoint=function(t,e,n){this.config.data_onunselected.call(this.api,e,t.node()),this.main.select("."+i.selectedCircles+this.getTargetSelectorSuffix(e.id)).selectAll("."+i.selectedCircle+"-"+n).transition().duration(100).attr("r",0).remove()},C.togglePoint=function(t,e,n,i){t?this.selectPoint(e,n,i):this.unselectPoint(e,n,i)},C.selectPath=function(t,e){var n=this;n.config.data_onselected.call(n,e,t.node()),n.config.interaction_brighten&&t.transition().duration(100).style("fill",function(){return n.d3.rgb(n.color(e)).brighter(.75)})},C.unselectPath=function(t,e){var n=this;n.config.data_onunselected.call(n,e,t.node()),n.config.interaction_brighten&&t.transition().duration(100).style("fill",function(){return n.color(e)})},C.togglePath=function(t,e,n,i){t?this.selectPath(e,n,i):this.unselectPath(e,n,i)},C.getToggle=function(t,e){var n;return"circle"===t.nodeName?n=this.isStepType(e)?function(){}:this.togglePoint:"path"===t.nodeName&&(n=this.togglePath),n},C.toggleShape=function(t,e,n){var o=this,r=o.d3,a=o.config,s=r.select(t),l=s.classed(i.SELECTED),u=o.getToggle(t,e).bind(o);a.data_selection_enabled&&a.data_selection_isselectable(e)&&(a.data_selection_multiple||o.main.selectAll("."+i.shapes+(a.data_selection_grouped?o.getTargetSelectorSuffix(e.id):"")).selectAll("."+i.shape).each(function(t,e){var n=r.select(this);n.classed(i.SELECTED)&&u(!1,n.classed(i.SELECTED,!1),t,e)}),s.classed(i.SELECTED,!l),u(!l,s,e,n))},C.initBar=function(){this.main.select("."+i.chart).append("g").attr("class",i.chartBars)},C.updateTargetsForBar=function(t){var e=this,n=e.config,o=e.classChartBar.bind(e),r=e.classBars.bind(e),a=e.classFocus.bind(e);e.main.select("."+i.chartBars).selectAll("."+i.chartBar).data(t).attr("class",function(t){return o(t)+a(t)}).enter().append("g").attr("class",o).style("pointer-events","none").append("g").attr("class",r).style("cursor",function(t){return n.data_selection_isselectable(t)?"pointer":null})},C.updateBar=function(t){var e=this,n=e.barData.bind(e),o=e.classBar.bind(e),r=e.initialOpacity.bind(e),a=function(t){return e.color(t.id)};e.mainBar=e.main.selectAll("."+i.bars).selectAll("."+i.bar).data(n),e.mainBar.enter().append("path").attr("class",o).style("stroke",a).style("fill",a),e.mainBar.style("opacity",r),e.mainBar.exit().transition().duration(t).remove()},C.redrawBar=function(t,e){return[(e?this.mainBar.transition(Math.random().toString()):this.mainBar).attr("d",t).style("stroke",this.color).style("fill",this.color).style("opacity",1)]},C.getBarW=function(t,e){var n=this.config,i="number"==typeof n.bar_width?n.bar_width:e?t.tickInterval()*n.bar_width_ratio/e:0;return n.bar_width_max&&i>n.bar_width_max?n.bar_width_max:i},C.getBars=function(t,e){return(e?this.main.selectAll("."+i.bars+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+i.bar+(s(t)?"-"+t:""))},C.expandBars=function(t,e,n){n&&this.unexpandBars(),this.getBars(t,e).classed(i.EXPANDED,!0)},C.unexpandBars=function(t){this.getBars(t).classed(i.EXPANDED,!1)},C.generateDrawBar=function(t,e){var n=this.config,i=this.generateGetBarPoints(t,e);return function(t,e){var o=i(t,e),r=n.axis_rotated?1:0,a=n.axis_rotated?0:1;return"M "+o[0][r]+","+o[0][a]+" L"+o[1][r]+","+o[1][a]+" L"+o[2][r]+","+o[2][a]+" L"+o[3][r]+","+o[3][a]+" z"}},C.generateGetBarPoints=function(t,e){var n=this,i=e?n.subXAxis:n.xAxis,o=t.__max__+1,r=n.getBarW(i,o),a=n.getShapeX(r,o,t,!!e),s=n.getShapeY(!!e),l=n.getShapeOffset(n.isBarType,t,!!e),u=r*(n.config.bar_space/2),c=e?n.getSubYScale:n.getYScale;return function(t,e){var i=c.call(n,t.id)(0),o=l(t,e)||i,h=a(t),d=s(t);return n.config.axis_rotated&&(0<t.value&&d<i||t.value<0&&i<d)&&(d=i),[[h+u,o],[h+u,d-(i-o)],[h+r-u,d-(i-o)],[h+r-u,o]]}},C.isWithinBar=function(t){var e=this.d3.mouse(t),n=t.getBoundingClientRect(),i=t.pathSegList.getItem(0),o=t.pathSegList.getItem(1),r=Math.min(i.x,o.x),a=Math.min(i.y,o.y),s=r+n.width+2,l=a+n.height+2,u=a-2;return r-2<e[0]&&e[0]<s&&u<e[1]&&e[1]<l},C.getShapeIndices=function(t){var e,n,i=this.config,o={},r=0;return this.filterTargetsToShow(this.data.targets.filter(t,this)).forEach(function(t){for(e=0;e<i.data_groups.length;e++)if(!(i.data_groups[e].indexOf(t.id)<0))for(n=0;n<i.data_groups[e].length;n++)if(i.data_groups[e][n]in o){o[t.id]=o[i.data_groups[e][n]];break}h(o[t.id])&&(o[t.id]=r++)}),o.__max__=r-1,o},C.getShapeX=function(t,e,n,i){var o=i?this.subX:this.x;return function(i){var r=i.id in n?n[i.id]:0;return i.x||0===i.x?o(i.x)-t*(e/2-r):0}},C.getShapeY=function(t){var e=this;return function(n){return(t?e.getSubYScale(n.id):e.getYScale(n.id))(n.value)}},C.getShapeOffset=function(t,e,n){var i=this,o=i.orderTargets(i.filterTargetsToShow(i.data.targets.filter(t,i))),r=o.map(function(t){return t.id});return function(t,a){var s=n?i.getSubYScale(t.id):i.getYScale(t.id),l=s(0),u=l;return o.forEach(function(n){var o=i.isStepType(t)?i.convertValuesToStep(n.values):n.values;n.id!==t.id&&e[n.id]===e[t.id]&&r.indexOf(n.id)<r.indexOf(t.id)&&(void 0!==o[a]&&+o[a].x==+t.x||(a=-1,o.forEach(function(e,n){e.x===t.x&&(a=n)})),a in o&&o[a].value*t.value>=0&&(u+=s(o[a].value)-l))}),u}},C.isWithinShape=function(t,e){var n,o=this,r=o.d3.select(t);return o.isTargetToShow(e.id)?"circle"===t.nodeName?n=o.isStepType(e)?o.isWithinStep(t,o.getYScale(e.id)(e.value)):o.isWithinCircle(t,1.5*o.pointSelectR(e)):"path"===t.nodeName&&(n=!r.classed(i.bar)||o.isWithinBar(t)):n=!1,n},C.getInterpolate=function(t){var e=this,n=e.isInterpolationType(e.config.spline_interpolation_type)?e.config.spline_interpolation_type:"cardinal";return e.isSplineType(t)?n:e.isStepType(t)?e.config.line_step_type:"linear"},C.initLine=function(){this.main.select("."+i.chart).append("g").attr("class",i.chartLines)},C.updateTargetsForLine=function(t){var e,n=this,o=n.config,r=n.classChartLine.bind(n),a=n.classLines.bind(n),s=n.classAreas.bind(n),l=n.classCircles.bind(n),u=n.classFocus.bind(n);(e=n.main.select("."+i.chartLines).selectAll("."+i.chartLine).data(t).attr("class",function(t){return r(t)+u(t)}).enter().append("g").attr("class",r).style("opacity",0).style("pointer-events","none")).append("g").attr("class",a),e.append("g").attr("class",s),e.append("g").attr("class",function(t){return n.generateClass(i.selectedCircles,t.id)}),e.append("g").attr("class",l).style("cursor",function(t){return o.data_selection_isselectable(t)?"pointer":null}),t.forEach(function(t){n.main.selectAll("."+i.selectedCircles+n.getTargetSelectorSuffix(t.id)).selectAll("."+i.selectedCircle).each(function(e){e.value=t.values[e.index].value})})},C.updateLine=function(t){var e=this;e.mainLine=e.main.selectAll("."+i.lines).selectAll("."+i.line).data(e.lineData.bind(e)),e.mainLine.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color),e.mainLine.style("opacity",e.initialOpacity.bind(e)).style("shape-rendering",function(t){return e.isStepType(t)?"crispEdges":""}).attr("transform",null),e.mainLine.exit().transition().duration(t).style("opacity",0).remove()},C.redrawLine=function(t,e){return[(e?this.mainLine.transition(Math.random().toString()):this.mainLine).attr("d",t).style("stroke",this.color).style("opacity",1)]},C.generateDrawLine=function(t,e){var n=this,i=n.config,o=n.d3.svg.line(),r=n.generateGetLinePoints(t,e),a=e?n.getSubYScale:n.getYScale,s=function(t){return(e?n.subxx:n.xx).call(n,t)},l=function(t,e){return i.data_groups.length>0?r(t,e)[0][1]:a.call(n,t.id)(t.value)};return o=i.axis_rotated?o.x(l).y(s):o.x(s).y(l),i.line_connectNull||(o=o.defined(function(t){return null!=t.value})),function(t){var r,s=i.line_connectNull?n.filterRemoveNull(t.values):t.values,l=e?n.x:n.subX,u=a.call(n,t.id),c=0,h=0;return n.isLineType(t)?i.data_regions[t.id]?r=n.lineWithRegions(s,l,u,i.data_regions[t.id]):(n.isStepType(t)&&(s=n.convertValuesToStep(s)),r=o.interpolate(n.getInterpolate(t))(s)):(s[0]&&(c=l(s[0].x),h=u(s[0].value)),r=i.axis_rotated?"M "+h+" "+c:"M "+c+" "+h),r||"M 0 0"}},C.generateGetLinePoints=function(t,e){var n=this,i=n.config,o=t.__max__+1,r=n.getShapeX(0,o,t,!!e),a=n.getShapeY(!!e),s=n.getShapeOffset(n.isLineType,t,!!e),l=e?n.getSubYScale:n.getYScale;return function(t,e){var o=l.call(n,t.id)(0),u=s(t,e)||o,c=r(t),h=a(t);return i.axis_rotated&&(0<t.value&&h<o||t.value<0&&o<h)&&(h=o),[[c,h-(o-u)],[c,h-(o-u)],[c,h-(o-u)],[c,h-(o-u)]]}},C.lineWithRegions=function(t,e,n,i){var o,r,a,s,l,u,c,f,p,g,m,v=this,y=v.config,b="M",w=v.isCategorized()?.5:0,_=[];function x(t,e){var n;for(n=0;n<e.length;n++)if(e[n].start<t&&t<=e[n].end)return!0;return!1}if(d(i))for(o=0;o<i.length;o++)_[o]={},h(i[o].start)?_[o].start=t[0].x:_[o].start=v.isTimeSeries()?v.parseDate(i[o].start):i[o].start,h(i[o].end)?_[o].end=t[t.length-1].x:_[o].end=v.isTimeSeries()?v.parseDate(i[o].end):i[o].end;function S(t){return"M"+t[0][0]+" "+t[0][1]+" "+t[1][0]+" "+t[1][1]}for(g=y.axis_rotated?function(t){return n(t.value)}:function(t){return e(t.x)},m=y.axis_rotated?function(t){return e(t.x)}:function(t){return n(t.value)},a=v.isTimeSeries()?function(t,i,o,r){var a=t.x.getTime(),s=i.x-t.x,u=new Date(a+s*o),c=new Date(a+s*(o+r));return S(y.axis_rotated?[[n(l(o)),e(u)],[n(l(o+r)),e(c)]]:[[e(u),n(l(o))],[e(c),n(l(o+r))]])}:function(t,i,o,r){return S(y.axis_rotated?[[n(l(o),!0),e(s(o))],[n(l(o+r),!0),e(s(o+r))]]:[[e(s(o),!0),n(l(o))],[e(s(o+r),!0),n(l(o+r))]])},o=0;o<t.length;o++){if(h(_)||!x(t[o].x,_))b+=" "+g(t[o])+" "+m(t[o]);else for(s=v.getScale(t[o-1].x+w,t[o].x+w,v.isTimeSeries()),l=v.getScale(t[o-1].value,t[o].value),u=e(t[o].x)-e(t[o-1].x),c=n(t[o].value)-n(t[o-1].value),p=2*(f=2/Math.sqrt(Math.pow(u,2)+Math.pow(c,2))),r=f;r<=1;r+=p)b+=a(t[o-1],t[o],r,f);t[o].x}return b},C.updateArea=function(t){var e=this,n=e.d3;e.mainArea=e.main.selectAll("."+i.areas).selectAll("."+i.area).data(e.lineData.bind(e)),e.mainArea.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=+n.select(this).style("opacity"),0}),e.mainArea.style("opacity",e.orgAreaOpacity),e.mainArea.exit().transition().duration(t).style("opacity",0).remove()},C.redrawArea=function(t,e){return[(e?this.mainArea.transition(Math.random().toString()):this.mainArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},C.generateDrawArea=function(t,e){var n=this,i=n.config,o=n.d3.svg.area(),r=n.generateGetAreaPoints(t,e),a=e?n.getSubYScale:n.getYScale,s=function(t){return(e?n.subxx:n.xx).call(n,t)},l=function(t,e){return i.data_groups.length>0?r(t,e)[0][1]:a.call(n,t.id)(n.getAreaBaseValue(t.id))},u=function(t,e){return i.data_groups.length>0?r(t,e)[1][1]:a.call(n,t.id)(t.value)};return o=i.axis_rotated?o.x0(l).x1(u).y(s):o.x(s).y0(i.area_above?0:l).y1(u),i.line_connectNull||(o=o.defined(function(t){return null!==t.value})),function(t){var e,r=i.line_connectNull?n.filterRemoveNull(t.values):t.values,a=0,s=0;return n.isAreaType(t)?(n.isStepType(t)&&(r=n.convertValuesToStep(r)),e=o.interpolate(n.getInterpolate(t))(r)):(r[0]&&(a=n.x(r[0].x),s=n.getYScale(t.id)(r[0].value)),e=i.axis_rotated?"M "+s+" "+a:"M "+a+" "+s),e||"M 0 0"}},C.getAreaBaseValue=function(){return 0},C.generateGetAreaPoints=function(t,e){var n=this,i=n.config,o=t.__max__+1,r=n.getShapeX(0,o,t,!!e),a=n.getShapeY(!!e),s=n.getShapeOffset(n.isAreaType,t,!!e),l=e?n.getSubYScale:n.getYScale;return function(t,e){var o=l.call(n,t.id)(0),u=s(t,e)||o,c=r(t),h=a(t);return i.axis_rotated&&(0<t.value&&h<o||t.value<0&&o<h)&&(h=o),[[c,u],[c,h-(o-u)],[c,h-(o-u)],[c,u]]}},C.updateCircle=function(){var t=this;t.mainCircle=t.main.selectAll("."+i.circles).selectAll("."+i.circle).data(t.lineOrScatterData.bind(t)),t.mainCircle.enter().append("circle").attr("class",t.classCircle.bind(t)).attr("r",t.pointR.bind(t)).style("fill",t.color),t.mainCircle.style("opacity",t.initialOpacityForCircle.bind(t)),t.mainCircle.exit().remove()},C.redrawCircle=function(t,e,n){var o=this.main.selectAll("."+i.selectedCircle);return[(n?this.mainCircle.transition(Math.random().toString()):this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",t).attr("cy",e),(n?o.transition(Math.random().toString()):o).attr("cx",t).attr("cy",e)]},C.circleX=function(t){return t.x||0===t.x?this.x(t.x):null},C.updateCircleY=function(){var t,e,n=this;n.config.data_groups.length>0?(t=n.getShapeIndices(n.isLineType),e=n.generateGetLinePoints(t),n.circleY=function(t,n){return e(t,n)[0][1]}):n.circleY=function(t){return n.getYScale(t.id)(t.value)}},C.getCircles=function(t,e){return(e?this.main.selectAll("."+i.circles+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+i.circle+(s(t)?"-"+t:""))},C.expandCircles=function(t,e,n){var o=this.pointExpandedR.bind(this);n&&this.unexpandCircles(),this.getCircles(t,e).classed(i.EXPANDED,!0).attr("r",o)},C.unexpandCircles=function(t){var e=this,n=e.pointR.bind(e);e.getCircles(t).filter(function(){return e.d3.select(this).classed(i.EXPANDED)}).classed(i.EXPANDED,!1).attr("r",n)},C.pointR=function(t){var e=this.config;return this.isStepType(t)?0:l(e.point_r)?e.point_r(t):e.point_r},C.pointExpandedR=function(t){var e=this.config;return e.point_focus_expand_enabled?l(e.point_focus_expand_r)?e.point_focus_expand_r(t):e.point_focus_expand_r?e.point_focus_expand_r:1.75*this.pointR(t):this.pointR(t)},C.pointSelectR=function(t){var e=this.config;return l(e.point_select_r)?e.point_select_r(t):e.point_select_r?e.point_select_r:4*this.pointR(t)},C.isWithinCircle=function(t,e){var n=this.d3,i=n.mouse(t),o=n.select(t),r=+o.attr("cx"),a=+o.attr("cy");return Math.sqrt(Math.pow(r-i[0],2)+Math.pow(a-i[1],2))<e},C.isWithinStep=function(t,e){return Math.abs(e-this.d3.mouse(t)[1])<30},C.getCurrentWidth=function(){var t=this.config;return t.size_width?t.size_width:this.getParentWidth()},C.getCurrentHeight=function(){var t=this.config,e=t.size_height?t.size_height:this.getParentHeight();return e>0?e:320/(this.hasType("gauge")&&!t.gauge_fullCircle?2:1)},C.getCurrentPaddingTop=function(){var t=this.config,e=s(t.padding_top)?t.padding_top:0;return this.title&&this.title.node()&&(e+=this.getTitlePadding()),e},C.getCurrentPaddingBottom=function(){var t=this.config;return s(t.padding_bottom)?t.padding_bottom:0},C.getCurrentPaddingLeft=function(t){var e=this.config;return s(e.padding_left)?e.padding_left:e.axis_rotated?!e.axis_x_show||e.axis_x_inner?1:Math.max(f(this.getAxisWidthByAxisId("x",t)),40):!e.axis_y_show||e.axis_y_inner?this.axis.getYAxisLabelPosition().isOuter?30:1:f(this.getAxisWidthByAxisId("y",t))},C.getCurrentPaddingRight=function(){var t=this,e=t.config,n=t.isLegendRight?t.getLegendWidth()+20:0;return s(e.padding_right)?e.padding_right+1:e.axis_rotated?10+n:!e.axis_y2_show||e.axis_y2_inner?2+n+(t.axis.getY2AxisLabelPosition().isOuter?20:0):f(t.getAxisWidthByAxisId("y2"))+n},C.getParentRectValue=function(t){for(var e,n=this.selectChart.node();n&&"BODY"!==n.tagName;){try{e=n.getBoundingClientRect()[t]}catch(i){"width"===t&&(e=n.offsetWidth)}if(e)break;n=n.parentNode}return e},C.getParentWidth=function(){return this.getParentRectValue("width")},C.getParentHeight=function(){var t=this.selectChart.style("height");return t.indexOf("px")>0?+t.replace("px",""):0},C.getSvgLeft=function(t){var e=this,n=e.config,o=n.axis_rotated||!n.axis_rotated&&!n.axis_y_inner,r=n.axis_rotated?i.axisX:i.axisY,a=e.main.select("."+r).node(),s=a&&o?a.getBoundingClientRect():{right:0},l=e.selectChart.node().getBoundingClientRect(),u=e.hasArcType(),c=s.right-l.left-(u?0:e.getCurrentPaddingLeft(t));return c>0?c:0},C.getAxisWidthByAxisId=function(t,e){var n=this.axis.getLabelPositionById(t);return this.axis.getMaxTickWidth(t,e)+(n.isInner?20:40)},C.getHorizontalAxisHeight=function(t){var e=this,n=e.config,i=30;return"x"!==t||n.axis_x_show?"x"===t&&n.axis_x_height?n.axis_x_height:"y"!==t||n.axis_y_show?"y2"!==t||n.axis_y2_show?("x"===t&&!n.axis_rotated&&n.axis_x_tick_rotate&&(i=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-n.axis_x_tick_rotate)/180)),"y"===t&&n.axis_rotated&&n.axis_y_tick_rotate&&(i=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-n.axis_y_tick_rotate)/180)),i+(e.axis.getLabelPositionById(t).isInner?0:10)+("y2"===t?-10:0)):e.rotated_padding_top:!n.legend_show||e.isLegendRight||e.isLegendInset?1:10:8},C.getEventRectWidth=function(){return Math.max(0,this.xAxis.tickInterval())},C.initBrush=function(){var t=this,e=t.d3;t.brush=e.svg.brush().on("brush",function(){t.redrawForBrush()}),t.brush.update=function(){return t.context&&t.context.select("."+i.brush).call(this),this},t.brush.scale=function(e){return t.config.axis_rotated?this.y(e):this.x(e)}},C.initSubchart=function(){var t=this,e=t.config,n=t.context=t.svg.append("g").attr("transform",t.getTranslate("context")),o=e.subchart_show?"visible":"hidden";n.style("visibility",o),n.append("g").attr("clip-path",t.clipPathForSubchart).attr("class",i.chart),n.select("."+i.chart).append("g").attr("class",i.chartBars),n.select("."+i.chart).append("g").attr("class",i.chartLines),n.append("g").attr("clip-path",t.clipPath).attr("class",i.brush).call(t.brush),t.axes.subx=n.append("g").attr("class",i.axisX).attr("transform",t.getTranslate("subx")).attr("clip-path",e.axis_rotated?"":t.clipPathForXAxis).style("visibility",e.subchart_axis_x_show?o:"hidden")},C.updateTargetsForSubchart=function(t){var e,n=this,o=n.context,r=n.config,a=n.classChartBar.bind(n),s=n.classBars.bind(n),l=n.classChartLine.bind(n),u=n.classLines.bind(n),c=n.classAreas.bind(n);r.subchart_show&&(o.select("."+i.chartBars).selectAll("."+i.chartBar).data(t).attr("class",a).enter().append("g").style("opacity",0).attr("class",a).append("g").attr("class",s),(e=o.select("."+i.chartLines).selectAll("."+i.chartLine).data(t).attr("class",l).enter().append("g").style("opacity",0).attr("class",l)).append("g").attr("class",u),e.append("g").attr("class",c),o.selectAll("."+i.brush+" rect").attr(r.axis_rotated?"width":"height",r.axis_rotated?n.width2:n.height2))},C.updateBarForSubchart=function(t){var e=this;e.contextBar=e.context.selectAll("."+i.bars).selectAll("."+i.bar).data(e.barData.bind(e)),e.contextBar.enter().append("path").attr("class",e.classBar.bind(e)).style("stroke","none").style("fill",e.color),e.contextBar.style("opacity",e.initialOpacity.bind(e)),e.contextBar.exit().transition().duration(t).style("opacity",0).remove()},C.redrawBarForSubchart=function(t,e,n){(e?this.contextBar.transition(Math.random().toString()).duration(n):this.contextBar).attr("d",t).style("opacity",1)},C.updateLineForSubchart=function(t){var e=this;e.contextLine=e.context.selectAll("."+i.lines).selectAll("."+i.line).data(e.lineData.bind(e)),e.contextLine.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color),e.contextLine.style("opacity",e.initialOpacity.bind(e)),e.contextLine.exit().transition().duration(t).style("opacity",0).remove()},C.redrawLineForSubchart=function(t,e,n){(e?this.contextLine.transition(Math.random().toString()).duration(n):this.contextLine).attr("d",t).style("opacity",1)},C.updateAreaForSubchart=function(t){var e=this,n=e.d3;e.contextArea=e.context.selectAll("."+i.areas).selectAll("."+i.area).data(e.lineData.bind(e)),e.contextArea.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=+n.select(this).style("opacity"),0}),e.contextArea.style("opacity",0),e.contextArea.exit().transition().duration(t).style("opacity",0).remove()},C.redrawAreaForSubchart=function(t,e,n){(e?this.contextArea.transition(Math.random().toString()).duration(n):this.contextArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)},C.redrawSubchart=function(t,e,n,i,o,r,a){var s,l,u,c=this,h=c.d3,d=c.config;c.context.style("visibility",d.subchart_show?"visible":"hidden"),d.subchart_show&&(h.event&&"zoom"===h.event.type&&c.brush.extent(c.x.orgDomain()).update(),t&&(c.brush.empty()||c.brush.extent(c.x.orgDomain()).update(),s=c.generateDrawArea(o,!0),l=c.generateDrawBar(r,!0),u=c.generateDrawLine(a,!0),c.updateBarForSubchart(n),c.updateLineForSubchart(n),c.updateAreaForSubchart(n),c.redrawBarForSubchart(l,n,n),c.redrawLineForSubchart(u,n,n),c.redrawAreaForSubchart(s,n,n)))},C.redrawForBrush=function(){var t=this,e=t.x;t.redraw({withTransition:!1,withY:t.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),t.config.subchart_onbrush.call(t.api,e.orgDomain())},C.transformContext=function(t,e){var n;e&&e.axisSubX?n=e.axisSubX:(n=this.context.select("."+i.axisX),t&&(n=n.transition())),this.context.attr("transform",this.getTranslate("context")),n.attr("transform",this.getTranslate("subx"))},C.getDefaultExtent=function(){var t=this,e=t.config,n=l(e.axis_x_extent)?e.axis_x_extent(t.getXDomain(t.data.targets)):e.axis_x_extent;return t.isTimeSeries()&&(n=[t.parseDate(n[0]),t.parseDate(n[1])]),n},C.initText=function(){this.main.select("."+i.chart).append("g").attr("class",i.chartTexts),this.mainText=this.d3.selectAll([])},C.updateTargetsForText=function(t){var e=this,n=e.classChartText.bind(e),o=e.classTexts.bind(e),r=e.classFocus.bind(e);e.main.select("."+i.chartTexts).selectAll("."+i.chartText).data(t).attr("class",function(t){return n(t)+r(t)}).enter().append("g").attr("class",n).style("opacity",0).style("pointer-events","none").append("g").attr("class",o)},C.updateText=function(t){var e=this,n=e.config,o=e.barOrLineData.bind(e),r=e.classText.bind(e);e.mainText=e.main.selectAll("."+i.texts).selectAll("."+i.text).data(o),e.mainText.enter().append("text").attr("class",r).attr("text-anchor",function(t){return n.axis_rotated?t.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(t){return e.color(t)}).style("fill-opacity",0),e.mainText.text(function(t,n,i){return e.dataLabelFormat(t.id)(t.value,t.id,n,i)}),e.mainText.exit().transition().duration(t).style("fill-opacity",0).remove()},C.redrawText=function(t,e,n,i){return[(i?this.mainText.transition():this.mainText).attr("x",t).attr("y",e).style("fill",this.color).style("fill-opacity",n?0:this.opacityForText.bind(this))]},C.getTextRect=function(t,e,n){var i,o=this.d3.select("body").append("div").classed("c3",!0),r=o.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),a=this.d3.select(n).style("font");return r.selectAll(".dummy").data([t]).enter().append("text").classed(e||"",!0).style("font",a).text(t).each(function(){i=this.getBoundingClientRect()}),o.remove(),i},C.generateXYForText=function(t,e,n,i){var o=this,r=o.generateGetAreaPoints(t,!1),a=o.generateGetBarPoints(e,!1),s=o.generateGetLinePoints(n,!1),l=i?o.getXForText:o.getYForText;return function(t,e){var n=o.isAreaType(t)?r:o.isBarType(t)?a:s;return l.call(o,n(t,e),t,this)}},C.getXForText=function(t,e,n){var i,o,r=this,a=n.getBoundingClientRect();return r.config.axis_rotated?(o=r.isBarType(e)?4:6,i=t[2][1]+o*(e.value<0?-1:1)):i=r.hasType("bar")?(t[2][0]+t[0][0])/2:t[0][0],null===e.value&&(i>r.width?i=r.width-a.width:i<0&&(i=4)),i},C.getYForText=function(t,e,n){var i,o=this,r=n.getBoundingClientRect();return o.config.axis_rotated?i=(t[0][0]+t[2][0]+.6*r.height)/2:(i=t[2][1],e.value<0||0===e.value&&!o.hasPositiveValue?(i+=r.height,o.isBarType(e)&&o.isSafari()?i-=3:!o.isBarType(e)&&o.isChrome()&&(i+=3)):i+=o.isBarType(e)?-3:-6),null!==e.value||o.config.axis_rotated||(i<r.height?i=r.height:i>this.height&&(i=this.height-4)),i},C.initTitle=function(){this.title=this.svg.append("text").text(this.config.title_text).attr("class",this.CLASS.title)},C.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},C.xForTitle=function(){var t=this,e=t.config,n=e.title_position||"left";return n.indexOf("right")>=0?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:n.indexOf("center")>=0?(t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2:e.title_padding.left},C.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},C.getTitlePadding=function(){return this.yForTitle()+this.config.title_padding.bottom},C.initTooltip=function(){var t,e=this,n=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",i.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),n.tooltip_init_show){if(e.isTimeSeries()&&c(n.tooltip_init_x)){for(n.tooltip_init_x=e.parseDate(n.tooltip_init_x),t=0;t<e.data.targets[0].values.length&&e.data.targets[0].values[t].x-n.tooltip_init_x!=0;t++);n.tooltip_init_x=t}e.tooltip.html(n.tooltip_contents.call(e,e.data.targets.map(function(t){return e.addName(t.values[n.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType()),e.color)),e.tooltip.style("top",n.tooltip_init_position.top).style("left",n.tooltip_init_position.left).style("display","block")}},C.getTooltipSortFunction=function(){var t=this,e=t.config;if(0!==e.data_groups.length&&void 0===e.tooltip_order){var n=t.orderTargets(t.data.targets).map(function(t){return t.id});return(t.isOrderAsc()||t.isOrderDesc())&&(n=n.reverse()),function(t,e){return n.indexOf(t.id)-n.indexOf(e.id)}}var i=e.tooltip_order;void 0===i&&(i=e.data_order);var o=function(t){return t?t.value:null};if(c(i)&&"asc"===i.toLowerCase())return function(t,e){return o(t)-o(e)};if(c(i)&&"desc"===i.toLowerCase())return function(t,e){return o(e)-o(t)};if(l(i)){var r=i;return void 0===e.tooltip_order&&(r=function(t,e){return i(t?{id:t.id,values:[t]}:null,e?{id:e.id,values:[e]}:null)}),r}return u(i)?function(t,e){return i.indexOf(t.id)-i.indexOf(e.id)}:void 0},C.getTooltipContent=function(t,e,n,i){var o,r,a,s,l,u,c=this,h=c.config,d=h.tooltip_format_title||e,f=h.tooltip_format_name||function(t){return t},p=h.tooltip_format_value||n,g=this.getTooltipSortFunction();for(g&&t.sort(g),r=0;r<t.length;r++)if(t[r]&&(t[r].value||0===t[r].value)&&(o||(a=w(d?d(t[r].x):t[r].x),o="<table class='"+c.CLASS.tooltip+"'>"+(a||0===a?"<tr><th colspan='2'>"+a+"</th></tr>":"")),void 0!==(s=w(p(t[r].value,t[r].ratio,t[r].id,t[r].index,t))))){if(null===t[r].name)continue;l=w(f(t[r].name,t[r].ratio,t[r].id,t[r].index)),u=c.levelColor?c.levelColor(t[r].value):i(t[r].id),o+="<tr class='"+c.CLASS.tooltipName+"-"+c.getTargetSelectorSuffix(t[r].id)+"'>",o+="<td class='name'><span style='background-color:"+u+"'></span>"+l+"</td>",o+="<td class='value'>"+s+"</td>",o+="</tr>"}return o+"</table>"},C.tooltipPosition=function(t,e,n,i){var o,r,a,s,l,u=this,c=u.config,h=u.d3,d=u.hasArcType(),f=h.mouse(i);return d?(r=(u.width-(u.isLegendRight?u.getLegendWidth():0))/2+f[0],s=(u.hasType("gauge")?u.height:u.height/2)+f[1]+20):(o=u.getSvgLeft(!0),c.axis_rotated?(a=(r=o+f[0]+100)+e,l=u.currentWidth-u.getCurrentPaddingRight(),s=u.x(t[0].x)+20):(a=(r=o+u.getCurrentPaddingLeft(!0)+u.x(t[0].x)+20)+e,l=o+u.currentWidth-u.getCurrentPaddingRight(),s=f[1]+15),a>l&&(r-=a-l+20),s+n>u.currentHeight&&(s-=n+30)),s<0&&(s=0),{top:s,left:r}},C.showTooltip=function(t,e){var n,i,o,r=this,a=r.config,l=r.hasArcType(),u=t.filter(function(t){return t&&s(t.value)}),c=a.tooltip_position||C.tooltipPosition;0!==u.length&&a.tooltip_show&&(r.tooltip.html(a.tooltip_contents.call(r,t,r.axis.getXAxisTickFormat(),r.getYFormat(l),r.color)).style("display","block"),n=r.tooltip.property("offsetWidth"),i=r.tooltip.property("offsetHeight"),o=c.call(this,u,n,i,e),r.tooltip.style("top",o.top+"px").style("left",o.left+"px"))},C.hideTooltip=function(){this.tooltip.style("display","none")},C.setTargetType=function(t,e){var n=this,i=n.config;n.mapToTargetIds(t).forEach(function(t){n.withoutFadeIn[t]=e===i.data_types[t],i.data_types[t]=e}),t||(i.data_type=e)},C.hasType=function(t,e){var n=this.config.data_types,i=!1;return(e=e||this.data.targets)&&e.length?e.forEach(function(e){var o=n[e.id];(o&&o.indexOf(t)>=0||!o&&"line"===t)&&(i=!0)}):Object.keys(n).length?Object.keys(n).forEach(function(e){n[e]===t&&(i=!0)}):i=this.config.data_type===t,i},C.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},C.isLineType=function(t){var e=this.config,n=c(t)?t:t.id;return!e.data_types[n]||["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[n])>=0},C.isStepType=function(t){var e=c(t)?t:t.id;return["step","area-step"].indexOf(this.config.data_types[e])>=0},C.isSplineType=function(t){var e=c(t)?t:t.id;return["spline","area-spline"].indexOf(this.config.data_types[e])>=0},C.isAreaType=function(t){var e=c(t)?t:t.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[e])>=0},C.isBarType=function(t){var e=c(t)?t:t.id;return"bar"===this.config.data_types[e]},C.isScatterType=function(t){var e=c(t)?t:t.id;return"scatter"===this.config.data_types[e]},C.isPieType=function(t){var e=c(t)?t:t.id;return"pie"===this.config.data_types[e]},C.isGaugeType=function(t){var e=c(t)?t:t.id;return"gauge"===this.config.data_types[e]},C.isDonutType=function(t){var e=c(t)?t:t.id;return"donut"===this.config.data_types[e]},C.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},C.lineData=function(t){return this.isLineType(t)?[t]:[]},C.arcData=function(t){return this.isArcType(t.data)?[t]:[]},C.barData=function(t){return this.isBarType(t)?t.values:[]},C.lineOrScatterData=function(t){return this.isLineType(t)||this.isScatterType(t)?t.values:[]},C.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},C.isInterpolationType=function(t){return["linear","linear-closed","basis","basis-open","basis-closed","bundle","cardinal","cardinal-open","cardinal-closed","monotone"].indexOf(t)>=0},C.isSafari=function(){var t=window.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},C.isChrome=function(){return window.navigator.userAgent.indexOf("Chrome")>=0},C.initZoom=function(){var t,e=this,n=e.d3,i=e.config;e.zoom=n.behavior.zoom().on("zoomstart",function(){t=n.event.sourceEvent,e.zoom.altDomain=n.event.sourceEvent.altKey?e.x.orgDomain():null,i.zoom_onzoomstart.call(e.api,n.event.sourceEvent)}).on("zoom",function(){e.redrawForZoom.call(e)}).on("zoomend",function(){var o=n.event.sourceEvent;o&&t.clientX===o.clientX&&t.clientY===o.clientY||(e.redrawEventRect(),e.updateZoom(),i.zoom_onzoomend.call(e.api,e.x.orgDomain()))}),e.zoom.scale=function(t){return i.axis_rotated?this.y(t):this.x(t)},e.zoom.orgScaleExtent=function(){var t=i.zoom_extent?i.zoom_extent:[1,10];return[t[0],Math.max(e.getMaxDataCount()/t[1],t[1])]},e.zoom.updateScaleExtent=function(){var t=g(e.x.orgDomain())/g(e.getZoomDomain()),n=this.orgScaleExtent();return this.scaleExtent([n[0]*t,n[1]*t]),this}},C.getZoomDomain=function(){var t=this.config,e=this.d3;return[e.min([this.orgXDomain[0],t.zoom_x_min]),e.max([this.orgXDomain[1],t.zoom_x_max])]},C.updateZoom=function(){var t=this.config.zoom_enabled?this.zoom:function(){};this.main.select("."+i.zoomRect).call(t).on("dblclick.zoom",null),this.main.selectAll("."+i.eventRect).call(t).on("dblclick.zoom",null)},C.redrawForZoom=function(){var t=this,e=t.d3,n=t.config,i=t.zoom,o=t.x;if(n.zoom_enabled&&0!==t.filterTargetsToShow(t.data.targets).length){if("mousemove"===e.event.sourceEvent.type&&i.altDomain)return o.domain(i.altDomain),void i.scale(o).updateScaleExtent();t.isCategorized()&&o.orgDomain()[0]===t.orgXDomain[0]&&o.domain([t.orgXDomain[0]-1e-10,o.orgDomain()[1]]),t.redraw({withTransition:!1,withY:n.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),"mousemove"===e.event.sourceEvent.type&&(t.cancelClick=!0),n.zoom_onzoom.call(t.api,o.orgDomain())}},T})},function(t,e,n){var i,o;!function(){var r={version:"3.5.17"},a=[].slice,s=function(t){return a.call(t)},l=this.document;function u(t){return t&&(t.ownerDocument||t.document||t).documentElement}function c(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(l)try{s(l.documentElement.childNodes)[0].nodeType}catch(t){s=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var h=this.Element.prototype,d=h.setAttribute,f=h.setAttributeNS,p=this.CSSStyleDeclaration.prototype,g=p.setProperty;h.setAttribute=function(t,e){d.call(this,t,e+"")},h.setAttributeNS=function(t,e,n){f.call(this,t,e,n+"")},p.setProperty=function(t,e,n){g.call(this,t,e+"",n)}}function m(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function v(t){return null===t?NaN:+t}function y(t){return!isNaN(t)}function b(t){return{left:function(e,n,i,o){for(arguments.length<3&&(i=0),arguments.length<4&&(o=e.length);i<o;){var r=i+o>>>1;t(e[r],n)<0?i=r+1:o=r}return i},right:function(e,n,i,o){for(arguments.length<3&&(i=0),arguments.length<4&&(o=e.length);i<o;){var r=i+o>>>1;t(e[r],n)>0?o=r:i=r+1}return i}}}r.ascending=m,r.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},r.min=function(t,e){var n,i,o=-1,r=t.length;if(1===arguments.length){for(;++o<r;)if(null!=(i=t[o])&&i>=i){n=i;break}for(;++o<r;)null!=(i=t[o])&&n>i&&(n=i)}else{for(;++o<r;)if(null!=(i=e.call(t,t[o],o))&&i>=i){n=i;break}for(;++o<r;)null!=(i=e.call(t,t[o],o))&&n>i&&(n=i)}return n},r.max=function(t,e){var n,i,o=-1,r=t.length;if(1===arguments.length){for(;++o<r;)if(null!=(i=t[o])&&i>=i){n=i;break}for(;++o<r;)null!=(i=t[o])&&i>n&&(n=i)}else{for(;++o<r;)if(null!=(i=e.call(t,t[o],o))&&i>=i){n=i;break}for(;++o<r;)null!=(i=e.call(t,t[o],o))&&i>n&&(n=i)}return n},r.extent=function(t,e){var n,i,o,r=-1,a=t.length;if(1===arguments.length){for(;++r<a;)if(null!=(i=t[r])&&i>=i){n=o=i;break}for(;++r<a;)null!=(i=t[r])&&(n>i&&(n=i),o<i&&(o=i))}else{for(;++r<a;)if(null!=(i=e.call(t,t[r],r))&&i>=i){n=o=i;break}for(;++r<a;)null!=(i=e.call(t,t[r],r))&&(n>i&&(n=i),o<i&&(o=i))}return[n,o]},r.sum=function(t,e){var n,i=0,o=t.length,r=-1;if(1===arguments.length)for(;++r<o;)y(n=+t[r])&&(i+=n);else for(;++r<o;)y(n=+e.call(t,t[r],r))&&(i+=n);return i},r.mean=function(t,e){var n,i=0,o=t.length,r=-1,a=o;if(1===arguments.length)for(;++r<o;)y(n=v(t[r]))?i+=n:--a;else for(;++r<o;)y(n=v(e.call(t,t[r],r)))?i+=n:--a;if(a)return i/a},r.quantile=function(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),o=+t[i-1],r=n-i;return r?o+r*(t[i]-o):o},r.median=function(t,e){var n,i=[],o=t.length,a=-1;if(1===arguments.length)for(;++a<o;)y(n=v(t[a]))&&i.push(n);else for(;++a<o;)y(n=v(e.call(t,t[a],a)))&&i.push(n);if(i.length)return r.quantile(i.sort(m),.5)},r.variance=function(t,e){var n,i,o=t.length,r=0,a=0,s=-1,l=0;if(1===arguments.length)for(;++s<o;)y(n=v(t[s]))&&(a+=(i=n-r)*(n-(r+=i/++l)));else for(;++s<o;)y(n=v(e.call(t,t[s],s)))&&(a+=(i=n-r)*(n-(r+=i/++l)));if(l>1)return a/(l-1)},r.deviation=function(){var t=r.variance.apply(this,arguments);return t?Math.sqrt(t):t};var w=b(m);function _(t){return t.length}r.bisectLeft=w.left,r.bisect=r.bisectRight=w.right,r.bisector=function(t){return b(1===t.length?function(e,n){return m(t(e),n)}:t)},r.shuffle=function(t,e,n){(r=arguments.length)<3&&(n=t.length,r<2&&(e=0));for(var i,o,r=n-e;r;)o=Math.random()*r--|0,i=t[r+e],t[r+e]=t[o+e],t[o+e]=i;return t},r.permute=function(t,e){for(var n=e.length,i=new Array(n);n--;)i[n]=t[e[n]];return i},r.pairs=function(t){for(var e=0,n=t.length-1,i=t[0],o=new Array(n<0?0:n);e<n;)o[e]=[i,i=t[++e]];return o},r.transpose=function(t){if(!(o=t.length))return[];for(var e=-1,n=r.min(t,_),i=new Array(n);++e<n;)for(var o,a=-1,s=i[e]=new Array(o);++a<o;)s[a]=t[a][e];return i},r.zip=function(){return r.transpose(arguments)},r.keys=function(t){var e=[];for(var n in t)e.push(n);return e},r.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},r.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},r.merge=function(t){for(var e,n,i,o=t.length,r=-1,a=0;++r<o;)a+=t[r].length;for(n=new Array(a);--o>=0;)for(e=(i=t[o]).length;--e>=0;)n[--a]=i[e];return n};var x=Math.abs;function S(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function E(){this._=Object.create(null)}r.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("infinite range");var i,o=[],r=function(t){var e=1;for(;t*e%1;)e*=10;return e}(x(n)),a=-1;if(t*=r,e*=r,(n*=r)<0)for(;(i=t+n*++a)>e;)o.push(i/r);else for(;(i=t+n*++a)<e;)o.push(i/r);return o},r.map=function(t,e){var n=new E;if(t instanceof E)t.forEach(function(t,e){n.set(t,e)});else if(Array.isArray(t)){var i,o=-1,r=t.length;if(1===arguments.length)for(;++o<r;)n.set(o,t[o]);else for(;++o<r;)n.set(e.call(t,i=t[o],o),i)}else for(var a in t)n.set(a,t[a]);return n};var C="__proto__",T="\0";function M(t){return(t+="")===C||t[0]===T?T+t:t}function P(t){return(t+="")[0]===T?t.slice(1):t}function L(t){return M(t)in this._}function A(t){return(t=M(t))in this._&&delete this._[t]}function k(){var t=[];for(var e in this._)t.push(P(e));return t}function O(){var t=0;for(var e in this._)++t;return t}function R(){for(var t in this._)return!1;return!0}function D(){this._=Object.create(null)}function j(t){return t}function z(t,e,n){return function(){var i=n.apply(e,arguments);return i===e?t:i}}function N(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,i=I.length;n<i;++n){var o=I[n]+e;if(o in t)return o}}S(E,{has:L,get:function(t){return this._[M(t)]},set:function(t,e){return this._[M(t)]=e},remove:A,keys:k,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:P(e),value:this._[e]});return t},size:O,empty:R,forEach:function(t){for(var e in this._)t.call(this,P(e),this._[e])}}),r.nest=function(){var t,e,n={},i=[],o=[];function a(o,r,s){if(s>=i.length)return e?e.call(n,r):t?r.sort(t):r;for(var l,u,c,h,d=-1,f=r.length,p=i[s++],g=new E;++d<f;)(h=g.get(l=p(u=r[d])))?h.push(u):g.set(l,[u]);return o?(u=o(),c=function(t,e){u.set(t,a(o,e,s))}):(u={},c=function(t,e){u[t]=a(o,e,s)}),g.forEach(c),u}return n.map=function(t,e){return a(e,t,0)},n.entries=function(t){return function t(e,n){if(n>=i.length)return e;var r=[],a=o[n++];return e.forEach(function(e,i){r.push({key:e,values:t(i,n)})}),a?r.sort(function(t,e){return a(t.key,e.key)}):r}(a(r.map,t,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return o[i.length-1]=t,n},n.sortValues=function(e){return t=e,n},n.rollup=function(t){return e=t,n},n},r.set=function(t){var e=new D;if(t)for(var n=0,i=t.length;n<i;++n)e.add(t[n]);return e},S(D,{has:L,add:function(t){return this._[M(t+="")]=!0,t},remove:A,values:k,size:O,empty:R,forEach:function(t){for(var e in this._)t.call(this,P(e))}}),r.behavior={},r.rebind=function(t,e){for(var n,i=1,o=arguments.length;++i<o;)t[n=arguments[i]]=z(t,e,e[n]);return t};var I=["webkit","ms","moz","Moz","o","O"];function F(){}function H(){}function G(t){var e=[],n=new E;function i(){for(var n,i=e,o=-1,r=i.length;++o<r;)(n=i[o].on)&&n.apply(this,arguments);return t}return i.on=function(i,o){var r,a=n.get(i);return arguments.length<2?a&&a.on:(a&&(a.on=null,e=e.slice(0,r=e.indexOf(a)).concat(e.slice(r+1)),n.remove(i)),o&&e.push(n.set(i,{on:o})),t)},i}function V(){r.event.preventDefault()}function B(){for(var t,e=r.event;t=e.sourceEvent;)e=t;return e}function U(t){for(var e=new H,n=0,i=arguments.length;++n<i;)e[arguments[n]]=G(e);return e.of=function(n,i){return function(o){try{var a=o.sourceEvent=r.event;o.target=t,r.event=o,e[o.type].apply(n,i)}finally{r.event=a}}},e}r.dispatch=function(){for(var t=new H,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=G(t);return t},H.prototype.on=function(t,e){var n=t.indexOf("."),i="";if(n>=0&&(i=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(i):this[t].on(i,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(i,null);return this}},r.event=null,r.requote=function(t){return t.replace(W,"\\$&")};var W=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,q={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]};function Y(t){return q(t,K),t}var X=function(t,e){return e.querySelector(t)},Z=function(t,e){return e.querySelectorAll(t)},Q=function(t,e){var n=t.matches||t[N(t,"matchesSelector")];return(Q=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(X=function(t,e){return Sizzle(t,e)[0]||null},Z=Sizzle,Q=Sizzle.matchesSelector),r.selection=function(){return r.select(l.documentElement)};var K=r.selection.prototype=[];function $(t){return"function"==typeof t?t:function(){return X(t,this)}}function J(t){return"function"==typeof t?t:function(){return Z(t,this)}}K.select=function(t){var e,n,i,o,r=[];t=$(t);for(var a=-1,s=this.length;++a<s;){r.push(e=[]),e.parentNode=(i=this[a]).parentNode;for(var l=-1,u=i.length;++l<u;)(o=i[l])?(e.push(n=t.call(o,o.__data__,l,a)),n&&"__data__"in o&&(n.__data__=o.__data__)):e.push(null)}return Y(r)},K.selectAll=function(t){var e,n,i=[];t=J(t);for(var o=-1,r=this.length;++o<r;)for(var a=this[o],l=-1,u=a.length;++l<u;)(n=a[l])&&(i.push(e=s(t.call(n,n.__data__,l,o))),e.parentNode=n);return Y(i)};var tt="http://www.w3.org/1999/xhtml",et={svg:"http://www.w3.org/2000/svg",xhtml:tt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function nt(t,e){return t=r.ns.qualify(t),null==e?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof e?t.local?function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}:function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}:t.local?function(){this.setAttributeNS(t.space,t.local,e)}:function(){this.setAttribute(t,e)}}function it(t){return t.trim().replace(/\s+/g," ")}function ot(t){return new RegExp("(?:^|\\s+)"+r.requote(t)+"(?:\\s+|$)","g")}function rt(t){return(t+"").trim().split(/^|\s+/)}function at(t,e){var n=(t=rt(t).map(st)).length;return"function"==typeof e?function(){for(var i=-1,o=e.apply(this,arguments);++i<n;)t[i](this,o)}:function(){for(var i=-1;++i<n;)t[i](this,e)}}function st(t){var e=ot(t);return function(n,i){if(o=n.classList)return i?o.add(t):o.remove(t);var o=n.getAttribute("class")||"";i?(e.lastIndex=0,e.test(o)||n.setAttribute("class",it(o+" "+t))):n.setAttribute("class",it(o.replace(e," ")))}}function lt(t,e,n){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}:function(){this.style.setProperty(t,e,n)}}function ut(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}:function(){this[t]=e}}function ct(t){return"function"==typeof t?t:(t=r.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){var e=this.ownerDocument,n=this.namespaceURI;return n===tt&&e.documentElement.namespaceURI===tt?e.createElement(t):e.createElementNS(n,t)}}function ht(){var t=this.parentNode;t&&t.removeChild(this)}function dt(t){return{__data__:t}}function ft(t){return function(){return Q(this,t)}}function pt(t,e){for(var n=0,i=t.length;n<i;n++)for(var o,r=t[n],a=0,s=r.length;a<s;a++)(o=r[a])&&e(o,a,n);return t}function gt(t){return q(t,mt),t}r.ns={prefix:et,qualify:function(t){var e=t.indexOf(":"),n=t;return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),et.hasOwnProperty(n)?{space:et[n],local:t}:t}},K.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=r.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(nt(e,t[e]));return this}return this.each(nt(t,e))},K.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),i=(t=rt(t)).length,o=-1;if(e=n.classList){for(;++o<i;)if(!e.contains(t[o]))return!1}else for(e=n.getAttribute("class");++o<i;)if(!ot(t[o]).test(e))return!1;return!0}for(e in t)this.each(at(e,t[e]));return this}return this.each(at(t,e))},K.style=function(t,e,n){var i=arguments.length;if(i<3){if("string"!=typeof t){for(n in i<2&&(e=""),t)this.each(lt(n,t[n],e));return this}if(i<2){var o=this.node();return c(o).getComputedStyle(o,null).getPropertyValue(t)}n=""}return this.each(lt(t,e,n))},K.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(ut(e,t[e]));return this}return this.each(ut(t,e))},K.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},K.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},K.append=function(t){return t=ct(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},K.insert=function(t,e){return t=ct(t),e=$(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},K.remove=function(){return this.each(ht)},K.data=function(t,e){var n,i,o=-1,r=this.length;if(!arguments.length){for(t=new Array(r=(n=this[0]).length);++o<r;)(i=n[o])&&(t[o]=i.__data__);return t}function a(t,n){var i,o,r,a=t.length,c=n.length,h=Math.min(a,c),d=new Array(c),f=new Array(c),p=new Array(a);if(e){var g,m=new E,v=new Array(a);for(i=-1;++i<a;)(o=t[i])&&(m.has(g=e.call(o,o.__data__,i))?p[i]=o:m.set(g,o),v[i]=g);for(i=-1;++i<c;)(o=m.get(g=e.call(n,r=n[i],i)))?!0!==o&&(d[i]=o,o.__data__=r):f[i]=dt(r),m.set(g,!0);for(i=-1;++i<a;)i in v&&!0!==m.get(v[i])&&(p[i]=t[i])}else{for(i=-1;++i<h;)o=t[i],r=n[i],o?(o.__data__=r,d[i]=o):f[i]=dt(r);for(;i<c;++i)f[i]=dt(n[i]);for(;i<a;++i)p[i]=t[i]}f.update=d,f.parentNode=d.parentNode=p.parentNode=t.parentNode,s.push(f),l.push(d),u.push(p)}var s=gt([]),l=Y([]),u=Y([]);if("function"==typeof t)for(;++o<r;)a(n=this[o],t.call(n,n.parentNode.__data__,o));else for(;++o<r;)a(n=this[o],t);return l.enter=function(){return s},l.exit=function(){return u},l},K.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},K.filter=function(t){var e,n,i,o=[];"function"!=typeof t&&(t=ft(t));for(var r=0,a=this.length;r<a;r++){o.push(e=[]),e.parentNode=(n=this[r]).parentNode;for(var s=0,l=n.length;s<l;s++)(i=n[s])&&t.call(i,i.__data__,s,r)&&e.push(i)}return Y(o)},K.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,i=this[t],o=i.length-1,r=i[o];--o>=0;)(n=i[o])&&(r&&r!==n.nextSibling&&r.parentNode.insertBefore(n,r),r=n);return this},K.sort=function(t){t=function(t){arguments.length||(t=m);return function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},K.each=function(t){return pt(this,function(e,n,i){t.call(e,e.__data__,n,i)})},K.call=function(t){var e=s(arguments);return t.apply(e[0]=this,e),this},K.empty=function(){return!this.node()},K.node=function(){for(var t=0,e=this.length;t<e;t++)for(var n=this[t],i=0,o=n.length;i<o;i++){var r=n[i];if(r)return r}return null},K.size=function(){var t=0;return pt(this,function(){++t}),t};var mt=[];function vt(t,e,n){var i="__on"+t,o=t.indexOf("."),a=bt;o>0&&(t=t.slice(0,o));var l=yt.get(t);function u(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}return l&&(t=l,a=wt),o?e?function(){var o=a(e,s(arguments));u.call(this),this.addEventListener(t,this[i]=o,o.$=n),o._=e}:u:e?F:function(){var e,n=new RegExp("^__on([^.]+)"+r.requote(t)+"$");for(var i in this)if(e=i.match(n)){var o=this[i];this.removeEventListener(e[1],o,o.$),delete this[i]}}}r.selection.enter=gt,r.selection.enter.prototype=mt,mt.append=K.append,mt.empty=K.empty,mt.node=K.node,mt.call=K.call,mt.size=K.size,mt.select=function(t){for(var e,n,i,o,r,a=[],s=-1,l=this.length;++s<l;){i=(o=this[s]).update,a.push(e=[]),e.parentNode=o.parentNode;for(var u=-1,c=o.length;++u<c;)(r=o[u])?(e.push(i[u]=n=t.call(o.parentNode,r.__data__,u,s)),n.__data__=r.__data__):e.push(null)}return Y(a)},mt.insert=function(t,e){return arguments.length<2&&(e=function(t){var e,n;return function(i,o,r){var a,s=t[r].update,l=s.length;for(r!=n&&(n=r,e=0),o>=e&&(e=o+1);!(a=s[e])&&++e<l;);return a}}(this)),K.insert.call(this,t,e)},r.select=function(t){var e;return"string"==typeof t?(e=[X(t,l)]).parentNode=l.documentElement:(e=[t]).parentNode=u(t),Y([e])},r.selectAll=function(t){var e;return"string"==typeof t?(e=s(Z(t,l))).parentNode=l.documentElement:(e=s(t)).parentNode=null,Y([e])},K.on=function(t,e,n){var i=arguments.length;if(i<3){if("string"!=typeof t){for(n in i<2&&(e=!1),t)this.each(vt(n,t[n],e));return this}if(i<2)return(i=this.node()["__on"+t])&&i._;n=!1}return this.each(vt(t,e,n))};var yt=r.map({mouseenter:"mouseover",mouseleave:"mouseout"});function bt(t,e){return function(n){var i=r.event;r.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{r.event=i}}}function wt(t,e){var n=bt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||n.call(this,t)}}l&&yt.forEach(function(t){"on"+t in l&&yt.remove(t)});var _t,xt=0;function St(t){var e=".dragsuppress-"+ ++xt,n="click"+e,i=r.select(c(t)).on("touchmove"+e,V).on("dragstart"+e,V).on("selectstart"+e,V);if(null==_t&&(_t=!("onselectstart"in t)&&N(t.style,"userSelect")),_t){var o=u(t).style,a=o[_t];o[_t]="none"}return function(t){if(i.on(e,null),_t&&(o[_t]=a),t){var r=function(){i.on(n,null)};i.on(n,function(){V(),r()},!0),setTimeout(r,0)}}}r.mouse=function(t){return Ct(t,B())};var Et=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ct(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(Et<0){var o=c(t);if(o.scrollX||o.scrollY){var a=(n=r.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Et=!(a.f||a.e),n.remove()}}return Et?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function Tt(){return r.event.changedTouches[0].identifier}r.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=B().changedTouches),e)for(var i,o=0,r=e.length;o<r;++o)if((i=e[o]).identifier===n)return Ct(t,i)},r.behavior.drag=function(){var t=U(o,"drag","dragstart","dragend"),e=null,n=a(F,r.mouse,c,"mousemove","mouseup"),i=a(Tt,r.touch,j,"touchmove","touchend");function o(){this.on("mousedown.drag",n).on("touchstart.drag",i)}function a(n,i,o,a,s){return function(){var l,u=r.event.target.correspondingElement||r.event.target,c=this.parentNode,h=t.of(this,arguments),d=0,f=n(),p=".drag"+(null==f?"":"-"+f),g=r.select(o(u)).on(a+p,function(){var t,e,n=i(c,f);if(!n)return;t=n[0]-v[0],e=n[1]-v[1],d|=t|e,v=n,h({type:"drag",x:n[0]+l[0],y:n[1]+l[1],dx:t,dy:e})}).on(s+p,function(){if(!i(c,f))return;g.on(a+p,null).on(s+p,null),m(d),h({type:"dragend"})}),m=St(u),v=i(c,f);l=e?[(l=e.apply(this,arguments)).x-v[0],l.y-v[1]]:[0,0],h({type:"dragstart"})}}return o.origin=function(t){return arguments.length?(e=t,o):e},r.rebind(o,t,"on")},r.touches=function(t,e){return arguments.length<2&&(e=B().touches),e?s(e).map(function(e){var n=Ct(t,e);return n.identifier=e.identifier,n}):[]};var Mt=1e-6,Pt=Mt*Mt,Lt=Math.PI,At=2*Lt,kt=At-Mt,Ot=Lt/2,Rt=Lt/180,Dt=180/Lt;function jt(t){return t>0?1:t<0?-1:0}function zt(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:t<-1?Lt:Math.acos(t)}function It(t){return t>1?Ot:t<-1?-Ot:Math.asin(t)}function Ft(t){return((t=Math.exp(t))+1/t)/2}function Ht(t){return(t=Math.sin(t/2))*t}var Gt=Math.SQRT2;r.interpolateZoom=function(t,e){var n,i,o=t[0],r=t[1],a=t[2],s=e[0],l=e[1],u=e[2],c=s-o,h=l-r,d=c*c+h*h;if(d<Pt)i=Math.log(u/a)/Gt,n=function(t){return[o+t*c,r+t*h,a*Math.exp(Gt*t*i)]};else{var f=Math.sqrt(d),p=(u*u-a*a+4*d)/(2*a*2*f),g=(u*u-a*a-4*d)/(2*u*2*f),m=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(g*g+1)-g);i=(v-m)/Gt,n=function(t){var e=t*i,n=Ft(m),s=a/(2*f)*(n*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(Gt*e+m)-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[o+s*c,r+s*h,a*n/Ft(Gt*e+m)]}}return n.duration=1e3*i,n},r.behavior.zoom=function(){var t,e,n,i,o,a,s,u,h,d={x:0,y:0,k:1},f=[960,500],p=Ut,g=250,m=0,v="mousedown.zoom",y="mousemove.zoom",b="mouseup.zoom",w="touchstart.zoom",_=U(x,"zoomstart","zoom","zoomend");function x(t){t.on(v,k).on(Bt+".zoom",R).on("dblclick.zoom",D).on(w,O)}function S(t){return[(t[0]-d.x)/d.k,(t[1]-d.y)/d.k]}function E(t){d.k=Math.max(p[0],Math.min(p[1],t))}function C(t,e){e=function(t){return[t[0]*d.k+d.x,t[1]*d.k+d.y]}(e),d.x+=t[0]-e[0],d.y+=t[1]-e[1]}function T(t,n,i,o){t.__chart__={x:d.x,y:d.y,k:d.k},E(Math.pow(2,o)),C(e=n,i),t=r.select(t),g>0&&(t=t.transition().duration(g)),t.call(x.event)}function M(){s&&s.domain(a.range().map(function(t){return(t-d.x)/d.k}).map(a.invert)),h&&h.domain(u.range().map(function(t){return(t-d.y)/d.k}).map(u.invert))}function P(t){m++||t({type:"zoomstart"})}function L(t){M(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function A(t){--m||(t({type:"zoomend"}),e=null)}function k(){var t=this,e=_.of(t,arguments),n=0,i=r.select(c(t)).on(y,function(){n=1,C(r.mouse(t),o),L(e)}).on(b,function(){i.on(y,null).on(b,null),a(n),A(e)}),o=S(r.mouse(t)),a=St(t);fs.call(t),P(e)}function O(){var t,e=this,n=_.of(e,arguments),i={},a=0,s=".zoom-"+r.event.changedTouches[0].identifier,l="touchmove"+s,u="touchend"+s,c=[],h=r.select(e),f=St(e);function p(){var n=r.touches(e);return t=d.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=S(t))}),n}function g(){var t=r.event.target;r.select(t).on(l,m).on(u,y),c.push(t);for(var n=r.event.changedTouches,s=0,h=n.length;s<h;++s)i[n[s].identifier]=null;var f=p(),g=Date.now();if(1===f.length){if(g-o<500){var v=f[0];T(e,v,i[v.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),V()}o=g}else if(f.length>1){v=f[0];var b=f[1],w=v[0]-b[0],_=v[1]-b[1];a=w*w+_*_}}function m(){var s,l,u,c,h=r.touches(e);fs.call(e);for(var d=0,f=h.length;d<f;++d,c=null)if(u=h[d],c=i[u.identifier]){if(l)break;s=u,l=c}if(c){var p=(p=u[0]-s[0])*p+(p=u[1]-s[1])*p,g=a&&Math.sqrt(p/a);s=[(s[0]+u[0])/2,(s[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],E(g*t)}o=null,C(s,l),L(n)}function y(){if(r.event.touches.length){for(var t=r.event.changedTouches,e=0,o=t.length;e<o;++e)delete i[t[e].identifier];for(var a in i)return void p()}r.selectAll(c).on(s,null),h.on(v,k).on(w,O),f(),A(n)}g(),P(n),h.on(v,null).on(w,g)}function R(){var o=_.of(this,arguments);i?clearTimeout(i):(fs.call(this),t=S(e=n||r.mouse(this)),P(o)),i=setTimeout(function(){i=null,A(o)},50),V(),E(Math.pow(2,.002*Vt())*d.k),C(e,t),L(o)}function D(){var t=r.mouse(this),e=Math.log(d.k)/Math.LN2;T(this,t,S(t),r.event.shiftKey?Math.ceil(e)-1:Math.floor(e)+1)}return Bt||(Bt="onwheel"in l?(Vt=function(){return-r.event.deltaY*(r.event.deltaMode?120:1)},"wheel"):"onmousewheel"in l?(Vt=function(){return r.event.wheelDelta},"mousewheel"):(Vt=function(){return-r.event.detail},"MozMousePixelScroll")),x.event=function(t){t.each(function(){var t=_.of(this,arguments),n=d;ms?r.select(this).transition().each("start.zoom",function(){d=this.__chart__||{x:0,y:0,k:1},P(t)}).tween("zoom:zoom",function(){var i=f[0],o=f[1],a=e?e[0]:i/2,s=e?e[1]:o/2,l=r.interpolateZoom([(a-d.x)/d.k,(s-d.y)/d.k,i/d.k],[(a-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(e){var n=l(e),o=i/n[2];this.__chart__=d={x:a-n[0]*o,y:s-n[1]*o,k:o},L(t)}}).each("interrupt.zoom",function(){A(t)}).each("end.zoom",function(){A(t)}):(this.__chart__=d,P(t),L(t),A(t))})},x.translate=function(t){return arguments.length?(d={x:+t[0],y:+t[1],k:d.k},M(),x):[d.x,d.y]},x.scale=function(t){return arguments.length?(d={x:d.x,y:d.y,k:null},E(+t),M(),x):d.k},x.scaleExtent=function(t){return arguments.length?(p=null==t?Ut:[+t[0],+t[1]],x):p},x.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],x):n},x.size=function(t){return arguments.length?(f=t&&[+t[0],+t[1]],x):f},x.duration=function(t){return arguments.length?(g=+t,x):g},x.x=function(t){return arguments.length?(s=t,a=t.copy(),d={x:0,y:0,k:1},x):s},x.y=function(t){return arguments.length?(h=t,u=t.copy(),d={x:0,y:0,k:1},x):h},r.rebind(x,_,"on")};var Vt,Bt,Ut=[0,1/0];function Wt(){}function qt(t,e,n){return this instanceof qt?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof qt?new qt(t.h,t.s,t.l):pe(""+t,ge,qt):new qt(t,e,n)}r.color=Wt,Wt.prototype.toString=function(){return this.rgb()+""},r.hsl=qt;var Yt=qt.prototype=new Wt;function Xt(t,e,n){var i,o;function r(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?i+(o-i)*t/60:t<180?o:t<240?i+(o-i)*(240-t)/60:i}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,i=2*(n=n<0?0:n>1?1:n)-(o=n<=.5?n*(1+e):n+e-n*e),new ue(r(t+120),r(t),r(t-120))}function Zt(t,e,n){return this instanceof Zt?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof Zt?new Zt(t.h,t.c,t.l):re(t instanceof $t?t.l:(t=me((t=r.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Zt(t,e,n)}Yt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,this.l/t)},Yt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new qt(this.h,this.s,t*this.l)},Yt.rgb=function(){return Xt(this.h,this.s,this.l)},r.hcl=Zt;var Qt=Zt.prototype=new Wt;function Kt(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new $t(n,Math.cos(t*=Rt)*e,Math.sin(t)*e)}function $t(t,e,n){return this instanceof $t?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof $t?new $t(t.l,t.a,t.b):t instanceof Zt?Kt(t.h,t.c,t.l):me((t=ue(t)).r,t.g,t.b):new $t(t,e,n)}Qt.brighter=function(t){return new Zt(this.h,this.c,Math.min(100,this.l+Jt*(arguments.length?t:1)))},Qt.darker=function(t){return new Zt(this.h,this.c,Math.max(0,this.l-Jt*(arguments.length?t:1)))},Qt.rgb=function(){return Kt(this.h,this.c,this.l).rgb()},r.lab=$t;var Jt=18,te=.95047,ee=1,ne=1.08883,ie=$t.prototype=new Wt;function oe(t,e,n){var i=(t+16)/116,o=i+e/500,r=i-n/200;return new ue(le(3.2404542*(o=ae(o)*te)-1.5371385*(i=ae(i)*ee)-.4985314*(r=ae(r)*ne)),le(-.969266*o+1.8760108*i+.041556*r),le(.0556434*o-.2040259*i+1.0572252*r))}function re(t,e,n){return t>0?new Zt(Math.atan2(n,e)*Dt,Math.sqrt(e*e+n*n),t):new Zt(NaN,NaN,t)}function ae(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function se(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function le(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ue(t,e,n){return this instanceof ue?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof ue?new ue(t.r,t.g,t.b):pe(""+t,ue,Xt):new ue(t,e,n)}function ce(t){return new ue(t>>16,t>>8&255,255&t)}function he(t){return ce(t)+""}ie.brighter=function(t){return new $t(Math.min(100,this.l+Jt*(arguments.length?t:1)),this.a,this.b)},ie.darker=function(t){return new $t(Math.max(0,this.l-Jt*(arguments.length?t:1)),this.a,this.b)},ie.rgb=function(){return oe(this.l,this.a,this.b)},r.rgb=ue;var de=ue.prototype=new Wt;function fe(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function pe(t,e,n){var i,o,r,a=0,s=0,l=0;if(i=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(o=i[2].split(","),i[1]){case"hsl":return n(parseFloat(o[0]),parseFloat(o[1])/100,parseFloat(o[2])/100);case"rgb":return e(ye(o[0]),ye(o[1]),ye(o[2]))}return(r=be.get(t))?e(r.r,r.g,r.b):(null==t||"#"!==t.charAt(0)||isNaN(r=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&r)>>4,a|=a>>4,s=240&r,s|=s>>4,l=15&r,l|=l<<4):7===t.length&&(a=(16711680&r)>>16,s=(65280&r)>>8,l=255&r)),e(a,s,l))}function ge(t,e,n){var i,o,r=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-r,l=(a+r)/2;return s?(o=l<.5?s/(a+r):s/(2-a-r),i=t==a?(e-n)/s+(e<n?6:0):e==a?(n-t)/s+2:(t-e)/s+4,i*=60):(i=NaN,o=l>0&&l<1?0:i),new qt(i,o,l)}function me(t,e,n){var i=se((.4124564*(t=ve(t))+.3575761*(e=ve(e))+.1804375*(n=ve(n)))/te),o=se((.2126729*t+.7151522*e+.072175*n)/ee);return $t(116*o-16,500*(i-o),200*(o-se((.0193339*t+.119192*e+.9503041*n)/ne)))}function ve(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ye(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}de.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,i=this.b,o=30;return e||n||i?(e&&e<o&&(e=o),n&&n<o&&(n=o),i&&i<o&&(i=o),new ue(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,i/t))):new ue(o,o,o)},de.darker=function(t){return new ue((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},de.hsl=function(){return ge(this.r,this.g,this.b)},de.toString=function(){return"#"+fe(this.r)+fe(this.g)+fe(this.b)};var be=r.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});function we(t){return"function"==typeof t?t:function(){return t}}function _e(t){return function(e,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=null),xe(e,n,t,i)}}function xe(t,e,n,i){var o={},a=r.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function h(){var t,e=u.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(u)||e>=200&&e<300||304===e){try{t=n.call(o,u)}catch(t){return void a.error.call(o,t)}a.load.call(o,t)}else a.error.call(o,u)}return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(t)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=h:u.onreadystatechange=function(){u.readyState>3&&h()},u.onprogress=function(t){var e=r.event;r.event=t;try{a.progress.call(o,u)}finally{r.event=e}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return n=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(s(arguments)))}}),o.send=function(n,i,r){if(2===arguments.length&&"function"==typeof i&&(r=i,i=null),u.open(n,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),u.setRequestHeader)for(var s in l)u.setRequestHeader(s,l[s]);return null!=e&&u.overrideMimeType&&u.overrideMimeType(e),null!=c&&(u.responseType=c),null!=r&&o.on("error",r).on("load",function(t){r(null,t)}),a.beforesend.call(o,u),u.send(null==i?null:i),o},o.abort=function(){return u.abort(),o},r.rebind(o,a,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}(i))}be.forEach(function(t,e){be.set(t,ce(e))}),r.functor=we,r.xhr=_e(j),r.dsv=function(t,e){var n=new RegExp('["'+t+"\n]"),i=t.charCodeAt(0);function o(t,n,i){arguments.length<3&&(i=n,n=null);var o=xe(t,e,null==n?r:a(n),i);return o.row=function(t){return arguments.length?o.response(null==(n=t)?r:a(t)):n},o}function r(t){return o.parse(t.responseText)}function a(t){return function(e){return o.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return n.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return o.parse=function(t,e){var n;return o.parseRows(t,function(t,i){if(n)return n(t,i-1);var o=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,n){return e(o(t),n)}:o})},o.parseRows=function(t,e){var n,o,r={},a={},s=[],l=t.length,u=0,c=0;function h(){if(u>=l)return a;if(o)return o=!1,r;var e=u;if(34===t.charCodeAt(e)){for(var n=e;n++<l;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}return u=n+2,13===(s=t.charCodeAt(n+1))?(o=!0,10===t.charCodeAt(n+2)&&++u):10===s&&(o=!0),t.slice(e+1,n).replace(/""/g,'"')}for(;u<l;){var s,c=1;if(10===(s=t.charCodeAt(u++)))o=!0;else if(13===s)o=!0,10===t.charCodeAt(u)&&(++u,++c);else if(s!==i)continue;return t.slice(e,u-c)}return t.slice(e)}for(;(n=h())!==a;){for(var d=[];n!==r&&n!==a;)d.push(n),n=h();e&&null==(d=e(d,c++))||s.push(d)}return s},o.format=function(e){if(Array.isArray(e[0]))return o.formatRows(e);var n=new D,i=[];return e.forEach(function(t){for(var e in t)n.has(e)||i.push(n.add(e))}),[i.map(l).join(t)].concat(e.map(function(e){return i.map(function(t){return l(e[t])}).join(t)})).join("\n")},o.formatRows=function(t){return t.map(s).join("\n")},o},r.csv=r.dsv(",","text/csv"),r.tsv=r.dsv("\t","text/tab-separated-values");var Se,Ee,Ce,Te,Me=this[N(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function Pe(t,e,n){var i=arguments.length;i<2&&(e=0),i<3&&(n=Date.now());var o={c:t,t:n+e,n:null};return Ee?Ee.n=o:Se=o,Ee=o,Ce||(Te=clearTimeout(Te),Ce=1,Me(Le)),o}function Le(){var t=Ae(),e=ke()-t;e>24?(isFinite(e)&&(clearTimeout(Te),Te=setTimeout(Le,e)),Ce=0):(Ce=1,Me(Le))}function Ae(){for(var t=Date.now(),e=Se;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function ke(){for(var t,e=Se,n=1/0;e;)e.c?(e.t<n&&(n=e.t),e=(t=e).n):e=t?t.n=e.n:Se=e.n;return Ee=t,n}function Oe(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}r.timer=function(){Pe.apply(this,arguments)},r.timer.flush=function(){Ae(),ke()},r.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Re=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(function(t,e){var n=Math.pow(10,3*x(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}});r.formatPrefix=function(t,e){var n=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=r.round(t,Oe(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)))),Re[8+n/3]};var De=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,je=r.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=r.round(t,Oe(t,e))).toFixed(Math.max(0,Math.min(20,Oe(t*(1+1e-15),e))))}});function ze(t){return t+""}var Ne=r.time={},Ie=Date;function Fe(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Fe.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(){He.setUTCDate.apply(this._,arguments)},setDay:function(){He.setUTCDay.apply(this._,arguments)},setFullYear:function(){He.setUTCFullYear.apply(this._,arguments)},setHours:function(){He.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){He.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){He.setUTCMinutes.apply(this._,arguments)},setMonth:function(){He.setUTCMonth.apply(this._,arguments)},setSeconds:function(){He.setUTCSeconds.apply(this._,arguments)},setTime:function(){He.setTime.apply(this._,arguments)}};var He=Date.prototype;function Ge(t,e,n){function i(e){var n=t(e),i=r(n,1);return e-n<i-e?n:i}function o(n){return e(n=t(new Ie(n-1)),1),n}function r(t,n){return e(t=new Ie(+t),n),t}function a(t,i,r){var a=o(t),s=[];if(r>1)for(;a<i;)n(a)%r||s.push(new Date(+a)),e(a,1);else for(;a<i;)s.push(new Date(+a)),e(a,1);return s}t.floor=t,t.round=i,t.ceil=o,t.offset=r,t.range=a;var s=t.utc=Ve(t);return s.floor=s,s.round=Ve(i),s.ceil=Ve(o),s.offset=Ve(r),s.range=function(t,e,n){try{Ie=Fe;var i=new Fe;return i._=t,a(i,e,n)}finally{Ie=Date}},t}function Ve(t){return function(e,n){try{Ie=Fe;var i=new Fe;return i._=e,t(i,n)._}finally{Ie=Date}}}Ne.year=Ge(function(t){return(t=Ne.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Ne.years=Ne.year.range,Ne.years.utc=Ne.year.utc.range,Ne.day=Ge(function(t){var e=new Ie(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Ne.days=Ne.day.range,Ne.days.utc=Ne.day.utc.range,Ne.dayOfYear=function(t){var e=Ne.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=Ne[t]=Ge(function(t){return(t=Ne.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=Ne.year(t).getDay();return Math.floor((Ne.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});Ne[t+"s"]=n.range,Ne[t+"s"].utc=n.utc.range,Ne[t+"OfYear"]=function(t){var n=Ne.year(t).getDay();return Math.floor((Ne.dayOfYear(t)+(n+e)%7)/7)}}),Ne.week=Ne.sunday,Ne.weeks=Ne.sunday.range,Ne.weeks.utc=Ne.sunday.utc.range,Ne.weekOfYear=Ne.sundayOfYear;var Be={"-":"",_:" ",0:"0"},Ue=/^\s*\d+/,We=/^%/;function qe(t,e,n){var i=t<0?"-":"",o=(i?-t:t)+"",r=o.length;return i+(r<n?new Array(n-r+1).join(e)+o:o)}function Ye(t){return new RegExp("^(?:"+t.map(r.requote).join("|")+")","i")}function Xe(t){for(var e=new E,n=-1,i=t.length;++n<i;)e.set(t[n].toLowerCase(),n);return e}function Ze(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Qe(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n));return i?(t.U=+i[0],n+i[0].length):-1}function Ke(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n));return i?(t.W=+i[0],n+i[0].length):-1}function $e(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Je(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+2));return i?(t.y=function(t){return t+(t>68?1900:2e3)}(+i[0]),n+i[0].length):-1}function tn(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function en(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function nn(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function on(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+3));return i?(t.j=+i[0],n+i[0].length):-1}function rn(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function an(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function sn(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function ln(t,e,n){Ue.lastIndex=0;var i=Ue.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function un(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",i=x(e)/60|0,o=x(e)%60;return n+qe(i,"0",2)+qe(o,"0",2)}function cn(t,e,n){We.lastIndex=0;var i=We.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function hn(t){for(var e=t.length,n=-1;++n<e;)t[n][0]=this(t[n][0]);return function(e){for(var n=0,i=t[n];!i[1](e);)i=t[++n];return i[0](e)}}r.locale=function(t){return{numberFormat:function(t){var e=t.decimal,n=t.thousands,i=t.grouping,o=t.currency,a=i&&n?function(t,e){for(var o=t.length,r=[],a=0,s=i[0],l=0;o>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),r.push(t.substring(o-=s,o+s)),!((l+=s+1)>e));)s=i[a=(a+1)%i.length];return r.reverse().join(n)}:j;return function(t){var n=De.exec(t),i=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],h=+n[6],d=n[7],f=n[8],p=n[9],g=1,m="",v="",y=!1,b=!0;switch(f&&(f=+f.substring(1)),(c||"0"===i&&"="===s)&&(c=i="0",s="="),p){case"n":d=!0,p="g";break;case"%":g=100,v="%",p="f";break;case"p":g=100,v="%",p="r";break;case"b":case"o":case"x":case"X":"#"===u&&(m="0"+p.toLowerCase());case"c":b=!1;case"d":y=!0,f=0;break;case"s":g=-1,p="r"}"$"===u&&(m=o[0],v=o[1]),"r"!=p||f||(p="g"),null!=f&&("g"==p?f=Math.max(1,Math.min(21,f)):"e"!=p&&"f"!=p||(f=Math.max(0,Math.min(20,f)))),p=je.get(p)||ze;var w=c&&d;return function(t){var n=v;if(y&&t%1)return"";var o=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(g<0){var u=r.formatPrefix(t,f);t=u.scale(t),n=u.symbol+v}else t*=g;var _,x,S=(t=p(t,f)).lastIndexOf(".");if(S<0){var E=b?t.lastIndexOf("e"):-1;E<0?(_=t,x=""):(_=t.substring(0,E),x=t.substring(E))}else _=t.substring(0,S),x=e+t.substring(S+1);!c&&d&&(_=a(_,1/0));var C=m.length+_.length+x.length+(w?0:o.length),T=C<h?new Array(C=h-C+1).join(i):"";return w&&(_=a(T+_,T.length?h-x.length:1/0)),o+=m,t=_+x,("<"===s?o+t+T:">"===s?T+o+t:"^"===s?T.substring(0,C>>=1)+o+t+T.substring(C):o+(w?t:T+t))+n}}}(t),timeFormat:function(t){var e=t.dateTime,n=t.date,i=t.time,o=t.periods,a=t.days,s=t.shortDays,l=t.months,u=t.shortMonths;function c(t){var e=t.length;function n(n){for(var i,o,r,a=[],s=-1,l=0;++s<e;)37===t.charCodeAt(s)&&(a.push(t.slice(l,s)),null!=(o=Be[i=t.charAt(++s)])&&(i=t.charAt(++s)),(r=_[i])&&(i=r(n,null==o?"e"===i?" ":"0":o)),a.push(i),l=s+1);return a.push(t.slice(l,s)),a.join("")}return n.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(h(n,t,e,0)!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var i=null!=n.Z&&Ie!==Fe,o=new(i?Fe:Ie);return"j"in n?o.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),o.setFullYear(n.y,0,1),o.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(o.getDay()+5)%7:n.w+7*n.U-(o.getDay()+6)%7)):o.setFullYear(n.y,n.m,n.d),o.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),i?o._:o},n.toString=function(){return t},n}function h(t,e,n,i){for(var o,r,a,s=0,l=e.length,u=n.length;s<l;){if(i>=u)return-1;if(37===(o=e.charCodeAt(s++))){if(a=e.charAt(s++),!(r=x[a in Be?e.charAt(s++):a])||(i=r(t,n,i))<0)return-1}else if(o!=n.charCodeAt(i++))return-1}return i}c.utc=function(t){var e=c(t);function n(t){try{var n=new(Ie=Fe);return n._=t,e(n)}finally{Ie=Date}}return n.parse=function(t){try{Ie=Fe;var n=e.parse(t);return n&&n._}finally{Ie=Date}},n.toString=e.toString,n},c.multi=c.utc.multi=hn;var d=r.map(),f=Ye(a),p=Xe(a),g=Ye(s),m=Xe(s),v=Ye(l),y=Xe(l),b=Ye(u),w=Xe(u);o.forEach(function(t,e){d.set(t.toLowerCase(),e)});var _={a:function(t){return s[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:c(e),d:function(t,e){return qe(t.getDate(),e,2)},e:function(t,e){return qe(t.getDate(),e,2)},H:function(t,e){return qe(t.getHours(),e,2)},I:function(t,e){return qe(t.getHours()%12||12,e,2)},j:function(t,e){return qe(1+Ne.dayOfYear(t),e,3)},L:function(t,e){return qe(t.getMilliseconds(),e,3)},m:function(t,e){return qe(t.getMonth()+1,e,2)},M:function(t,e){return qe(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return qe(t.getSeconds(),e,2)},U:function(t,e){return qe(Ne.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return qe(Ne.mondayOfYear(t),e,2)},x:c(n),X:c(i),y:function(t,e){return qe(t.getFullYear()%100,e,2)},Y:function(t,e){return qe(t.getFullYear()%1e4,e,4)},Z:un,"%":function(){return"%"}},x={a:function(t,e,n){g.lastIndex=0;var i=g.exec(e.slice(n));return i?(t.w=m.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){f.lastIndex=0;var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){b.lastIndex=0;var i=b.exec(e.slice(n));return i?(t.m=w.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){v.lastIndex=0;var i=v.exec(e.slice(n));return i?(t.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,e,n){return h(t,_.c.toString(),e,n)},d:nn,e:nn,H:rn,I:rn,j:on,L:ln,m:en,M:an,p:function(t,e,n){var i=d.get(e.slice(n,n+=2).toLowerCase());return null==i?-1:(t.p=i,n)},S:sn,U:Qe,w:Ze,W:Ke,x:function(t,e,n){return h(t,_.x.toString(),e,n)},X:function(t,e,n){return h(t,_.X.toString(),e,n)},y:Je,Y:$e,Z:tn,"%":cn};return c}(t)}};var dn=r.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"]});function fn(){}r.format=dn.numberFormat,r.geo={},fn.prototype={s:0,t:0,add:function(t){gn(t,this.t,pn),gn(pn.s,this.s,this),this.s?this.t+=pn.t:this.s=pn.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var pn=new fn;function gn(t,e,n){var i=n.s=t+e,o=i-t,r=i-o;n.t=t-r+(e-o)}function mn(t,e){t&&yn.hasOwnProperty(t.type)&&yn[t.type](t,e)}r.geo.stream=function(t,e){t&&vn.hasOwnProperty(t.type)?vn[t.type](t,e):mn(t,e)};var vn={Feature:function(t,e){mn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,o=n.length;++i<o;)mn(n[i].geometry,e)}},yn={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,o=n.length;++i<o;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){bn(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,o=n.length;++i<o;)bn(n[i],e,0)},Polygon:function(t,e){wn(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,o=n.length;++i<o;)wn(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,o=n.length;++i<o;)mn(n[i],e)}};function bn(t,e,n){var i,o=-1,r=t.length-n;for(e.lineStart();++o<r;)i=t[o],e.point(i[0],i[1],i[2]);e.lineEnd()}function wn(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)bn(t[n],e,1);e.polygonEnd()}r.geo.area=function(t){return _n=0,r.geo.stream(t,Dn),_n};var _n,xn,Sn,En,Cn,Tn,Mn,Pn,Ln,An,kn,On,Rn=new fn,Dn={sphere:function(){_n+=4*Lt},point:F,lineStart:F,lineEnd:F,polygonStart:function(){Rn.reset(),Dn.lineStart=jn},polygonEnd:function(){var t=2*Rn;_n+=t<0?4*Lt+t:t,Dn.lineStart=Dn.lineEnd=Dn.point=F}};function jn(){var t,e,n,i,o;function r(t,e){e=e*Rt/2+Lt/4;var r=(t*=Rt)-n,a=r>=0?1:-1,s=a*r,l=Math.cos(e),u=Math.sin(e),c=o*u,h=i*l+c*Math.cos(s),d=c*a*Math.sin(s);Rn.add(Math.atan2(d,h)),n=t,i=l,o=u}Dn.point=function(a,s){Dn.point=r,n=(t=a)*Rt,i=Math.cos(s=(e=s)*Rt/2+Lt/4),o=Math.sin(s)},Dn.lineEnd=function(){r(t,e)}}function zn(t){var e=t[0],n=t[1],i=Math.cos(n);return[i*Math.cos(e),i*Math.sin(e),Math.sin(n)]}function Nn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function In(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 Fn(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Hn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Gn(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 Vn(t){return[Math.atan2(t[1],t[0]),It(t[2])]}function Bn(t,e){return x(t[0]-e[0])<Mt&&x(t[1]-e[1])<Mt}r.geo.bounds=function(){var t,e,n,i,o,a,s,l,u,c,h,d={point:f,lineStart:g,lineEnd:m,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=b,u=0,Dn.polygonStart()},polygonEnd:function(){Dn.polygonEnd(),d.point=f,d.lineStart=g,d.lineEnd=m,Rn<0?(t=-(n=180),e=-(i=90)):u>Mt?i=90:u<-Mt&&(e=-90),h[0]=t,h[1]=n}};function f(o,r){c.push(h=[t=o,n=o]),r<e&&(e=r),r>i&&(i=r)}function p(r,a){var s=zn([r*Rt,a*Rt]);if(l){var u=In(l,s),c=In([u[1],-u[0],0],u);Gn(c),c=Vn(c);var h=r-o,d=h>0?1:-1,p=c[0]*Dt*d,g=x(h)>180;if(g^(d*o<p&&p<d*r))(m=c[1]*Dt)>i&&(i=m);else if(g^(d*o<(p=(p+360)%360-180)&&p<d*r)){var m;(m=-c[1]*Dt)<e&&(e=m)}else a<e&&(e=a),a>i&&(i=a);g?r<o?w(t,r)>w(t,n)&&(n=r):w(r,n)>w(t,n)&&(t=r):n>=t?(r<t&&(t=r),r>n&&(n=r)):r>o?w(t,r)>w(t,n)&&(n=r):w(r,n)>w(t,n)&&(t=r)}else f(r,a);l=s,o=r}function g(){d.point=p}function m(){h[0]=t,h[1]=n,d.point=f,l=null}function v(t,e){if(l){var n=t-o;u+=x(n)>180?n+(n>0?360:-360):n}else a=t,s=e;Dn.point(t,e),p(t,e)}function y(){Dn.lineStart()}function b(){v(a,s),Dn.lineEnd(),x(u)>Mt&&(t=-(n=180)),h[0]=t,h[1]=n,l=null}function w(t,e){return(e-=t)<0?e+360:e}function _(t,e){return t[0]-e[0]}function S(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(o){if(i=n=-(t=e=1/0),c=[],r.geo.stream(o,d),u=c.length){c.sort(_);for(var a=1,s=[g=c[0]];a<u;++a)S((f=c[a])[0],g)||S(f[1],g)?(w(g[0],f[1])>w(g[0],g[1])&&(g[1]=f[1]),w(f[0],g[1])>w(g[0],g[1])&&(g[0]=f[0])):s.push(g=f);for(var l,u,f,p=-1/0,g=(a=0,s[u=s.length-1]);a<=u;g=f,++a)f=s[a],(l=w(g[1],f[0]))>p&&(p=l,t=f[0],n=g[1])}return c=h=null,t===1/0||e===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,e],[n,i]]}}(),r.geo.centroid=function(t){xn=Sn=En=Cn=Tn=Mn=Pn=Ln=An=kn=On=0,r.geo.stream(t,Un);var e=An,n=kn,i=On,o=e*e+n*n+i*i;return o<Pt&&(e=Mn,n=Pn,i=Ln,Sn<Mt&&(e=En,n=Cn,i=Tn),(o=e*e+n*n+i*i)<Pt)?[NaN,NaN]:[Math.atan2(n,e)*Dt,It(i/Math.sqrt(o))*Dt]};var Un={sphere:F,point:Wn,lineStart:Yn,lineEnd:Xn,polygonStart:function(){Un.lineStart=Zn},polygonEnd:function(){Un.lineStart=Yn}};function Wn(t,e){t*=Rt;var n=Math.cos(e*=Rt);qn(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function qn(t,e,n){En+=(t-En)/++xn,Cn+=(e-Cn)/xn,Tn+=(n-Tn)/xn}function Yn(){var t,e,n;function i(i,o){i*=Rt;var r=Math.cos(o*=Rt),a=r*Math.cos(i),s=r*Math.sin(i),l=Math.sin(o),u=Math.atan2(Math.sqrt((u=e*l-n*s)*u+(u=n*a-t*l)*u+(u=t*s-e*a)*u),t*a+e*s+n*l);Sn+=u,Mn+=u*(t+(t=a)),Pn+=u*(e+(e=s)),Ln+=u*(n+(n=l)),qn(t,e,n)}Un.point=function(o,r){o*=Rt;var a=Math.cos(r*=Rt);t=a*Math.cos(o),e=a*Math.sin(o),n=Math.sin(r),Un.point=i,qn(t,e,n)}}function Xn(){Un.point=Wn}function Zn(){var t,e,n,i,o;function r(t,e){t*=Rt;var r=Math.cos(e*=Rt),a=r*Math.cos(t),s=r*Math.sin(t),l=Math.sin(e),u=i*l-o*s,c=o*a-n*l,h=n*s-i*a,d=Math.sqrt(u*u+c*c+h*h),f=n*a+i*s+o*l,p=d&&-Nt(f)/d,g=Math.atan2(d,f);An+=p*u,kn+=p*c,On+=p*h,Sn+=g,Mn+=g*(n+(n=a)),Pn+=g*(i+(i=s)),Ln+=g*(o+(o=l)),qn(n,i,o)}Un.point=function(a,s){t=a,e=s,Un.point=r,a*=Rt;var l=Math.cos(s*=Rt);n=l*Math.cos(a),i=l*Math.sin(a),o=Math.sin(s),qn(n,i,o)},Un.lineEnd=function(){r(t,e),Un.lineEnd=Xn,Un.point=Wn}}function Qn(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function Kn(){return!0}function $n(t,e,n,i,o){var r=[],a=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],i=t[e];if(Bn(n,i)){o.lineStart();for(var s=0;s<e;++s)o.point((n=t[s])[0],n[1]);o.lineEnd()}else{var l=new ti(n,t,null,!0),u=new ti(n,null,l,!1);l.o=u,r.push(l),a.push(u),u=new ti(i,null,l=new ti(i,t,null,!1),!0),l.o=u,r.push(l),a.push(u)}}}),a.sort(e),Jn(r),Jn(a),r.length){for(var s=0,l=n,u=a.length;s<u;++s)a[s].e=l=!l;for(var c,h,d=r[0];;){for(var f=d,p=!0;f.v;)if((f=f.n)===d)return;c=f.z,o.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(s=0,u=c.length;s<u;++s)o.point((h=c[s])[0],h[1]);else i(f.x,f.n.x,1,o);f=f.n}else{if(p)for(s=(c=f.p.z).length-1;s>=0;--s)o.point((h=c[s])[0],h[1]);else i(f.x,f.p.x,-1,o);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);o.lineEnd()}}}function Jn(t){if(e=t.length){for(var e,n,i=0,o=t[0];++i<e;)o.n=n=t[i],n.p=o,o=n;o.n=n=t[0],n.p=o}}function ti(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function ei(t,e,n,i){return function(o,a){var s,l=e(a),u=o.invert(i[0],i[1]),c={point:h,lineStart:f,lineEnd:p,polygonStart:function(){c.point=w,c.lineStart=_,c.lineEnd=x,s=[],g=[]},polygonEnd:function(){c.point=h,c.lineStart=f,c.lineEnd=p,s=r.merge(s);var t=function(t,e){var n=t[0],i=t[1],o=[Math.sin(n),-Math.cos(n),0],r=0,a=0;Rn.reset();for(var s=0,l=e.length;s<l;++s){var u=e[s],c=u.length;if(c)for(var h=u[0],d=h[0],f=h[1]/2+Lt/4,p=Math.sin(f),g=Math.cos(f),m=1;;){m===c&&(m=0);var v=(t=u[m])[0],y=t[1]/2+Lt/4,b=Math.sin(y),w=Math.cos(y),_=v-d,x=_>=0?1:-1,S=x*_,E=S>Lt,C=p*b;if(Rn.add(Math.atan2(C*x*Math.sin(S),g*w+C*Math.cos(S))),r+=E?_+x*At:_,E^d>=n^v>=n){var T=In(zn(h),zn(t));Gn(T);var M=In(o,T);Gn(M);var P=(E^_>=0?-1:1)*It(M[2]);(i>P||i===P&&(T[0]||T[1]))&&(a+=E^_>=0?1:-1)}if(!m++)break;d=v,p=b,g=w,h=t}}return(r<-Mt||r<Mt&&Rn<-Mt)^1&a}(u,g);s.length?(b||(a.polygonStart(),b=!0),$n(s,oi,t,n,a)):t&&(b||(a.polygonStart(),b=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),b&&(a.polygonEnd(),b=!1),s=g=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function h(e,n){var i=o(e,n);t(e=i[0],n=i[1])&&a.point(e,n)}function d(t,e){var n=o(t,e);l.point(n[0],n[1])}function f(){c.point=d,l.lineStart()}function p(){c.point=h,l.lineEnd()}var g,m,v=ii(),y=e(v),b=!1;function w(t,e){m.push([t,e]);var n=o(t,e);y.point(n[0],n[1])}function _(){y.lineStart(),m=[]}function x(){w(m[0][0],m[0][1]),y.lineEnd();var t,e=y.clean(),n=v.buffer(),i=n.length;if(m.pop(),g.push(m),m=null,i)if(1&e){var o,r=-1;if((i=(t=n[0]).length-1)>0){for(b||(a.polygonStart(),b=!0),a.lineStart();++r<i;)a.point((o=t[r])[0],o[1]);a.lineEnd()}}else i>1&&2&e&&n.push(n.pop().concat(n.shift())),s.push(n.filter(ni))}return c}}function ni(t){return t.length>1}function ii(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:F,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function oi(t,e){return((t=t.x)[0]<0?t[1]-Ot-Mt:Ot-t[1])-((e=e.x)[0]<0?e[1]-Ot-Mt:Ot-e[1])}var ri=ei(Kn,function(t){var e,n=NaN,i=NaN,o=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(r,a){var s=r>0?Lt:-Lt,l=x(r-n);x(l-Lt)<Mt?(t.point(n,i=(i+a)/2>0?Ot:-Ot),t.point(o,i),t.lineEnd(),t.lineStart(),t.point(s,i),t.point(r,i),e=0):o!==s&&l>=Lt&&(x(n-o)<Mt&&(n-=o*Mt),x(r-s)<Mt&&(r-=s*Mt),i=function(t,e,n,i){var o,r,a=Math.sin(t-n);return x(a)>Mt?Math.atan((Math.sin(e)*(r=Math.cos(i))*Math.sin(n)-Math.sin(i)*(o=Math.cos(e))*Math.sin(t))/(o*r*a)):(e+i)/2}(n,i,r,a),t.point(o,i),t.lineEnd(),t.lineStart(),t.point(s,i),e=0),t.point(n=r,i=a),o=s},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}},function(t,e,n,i){var o;if(null==t)o=n*Ot,i.point(-Lt,o),i.point(0,o),i.point(Lt,o),i.point(Lt,0),i.point(Lt,-o),i.point(0,-o),i.point(-Lt,-o),i.point(-Lt,0),i.point(-Lt,o);else if(x(t[0]-e[0])>Mt){var r=t[0]<e[0]?Lt:-Lt;o=n*r/2,i.point(-r,o),i.point(0,o),i.point(r,o)}else i.point(e[0],e[1])},[-Lt,-Lt/2]);function ai(t,e,n,i){return function(o){var r,a=o.a,s=o.b,l=a.x,u=a.y,c=0,h=1,d=s.x-l,f=s.y-u;if(r=t-l,d||!(r>0)){if(r/=d,d<0){if(r<c)return;r<h&&(h=r)}else if(d>0){if(r>h)return;r>c&&(c=r)}if(r=n-l,d||!(r<0)){if(r/=d,d<0){if(r>h)return;r>c&&(c=r)}else if(d>0){if(r<c)return;r<h&&(h=r)}if(r=e-u,f||!(r>0)){if(r/=f,f<0){if(r<c)return;r<h&&(h=r)}else if(f>0){if(r>h)return;r>c&&(c=r)}if(r=i-u,f||!(r<0)){if(r/=f,f<0){if(r>h)return;r>c&&(c=r)}else if(f>0){if(r<c)return;r<h&&(h=r)}return c>0&&(o.a={x:l+c*d,y:u+c*f}),h<1&&(o.b={x:l+h*d,y:u+h*f}),o}}}}}}var si=1e9;function li(t,e,n,i){return function(l){var u,c,h,d,f,p,g,m,v,y,b,w=l,_=ii(),x=ai(t,e,n,i),S={point:T,lineStart:function(){S.point=M,c&&c.push(h=[]);y=!0,v=!1,g=m=NaN},lineEnd:function(){u&&(M(d,f),p&&v&&_.rejoin(),u.push(_.buffer()));S.point=T,v&&l.lineEnd()},polygonStart:function(){l=_,u=[],c=[],b=!0},polygonEnd:function(){l=w,u=r.merge(u);var e=function(t){for(var e=0,n=c.length,i=t[1],o=0;o<n;++o)for(var r,a=1,s=c[o],l=s.length,u=s[0];a<l;++a)r=s[a],u[1]<=i?r[1]>i&&zt(u,r,t)>0&&++e:r[1]<=i&&zt(u,r,t)<0&&--e,u=r;return 0!==e}([t,i]),n=b&&e,o=u.length;(n||o)&&(l.polygonStart(),n&&(l.lineStart(),E(null,null,1,l),l.lineEnd()),o&&$n(u,a,e,E,l),l.polygonEnd()),u=c=h=null}};function E(r,a,l,u){var c=0,h=0;if(null==r||(c=o(r,l))!==(h=o(a,l))||s(r,a)<0^l>0)do{u.point(0===c||3===c?t:n,c>1?i:e)}while((c=(c+l+4)%4)!==h);else u.point(a[0],a[1])}function C(o,r){return t<=o&&o<=n&&e<=r&&r<=i}function T(t,e){C(t,e)&&l.point(t,e)}function M(t,e){var n=C(t=Math.max(-si,Math.min(si,t)),e=Math.max(-si,Math.min(si,e)));if(c&&h.push([t,e]),y)d=t,f=e,p=n,y=!1,n&&(l.lineStart(),l.point(t,e));else if(n&&v)l.point(t,e);else{var i={a:{x:g,y:m},b:{x:t,y:e}};x(i)?(v||(l.lineStart(),l.point(i.a.x,i.a.y)),l.point(i.b.x,i.b.y),n||l.lineEnd(),b=!1):n&&(l.lineStart(),l.point(t,e),b=!1)}g=t,m=e,v=n}return S};function o(i,o){return x(i[0]-t)<Mt?o>0?0:3:x(i[0]-n)<Mt?o>0?2:1:x(i[1]-e)<Mt?o>0?1:0:o>0?3:2}function a(t,e){return s(t.x,e.x)}function s(t,e){var n=o(t,1),i=o(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}}function ui(t){var e=0,n=Lt/3,i=ki(t),o=i(e,n);return o.parallels=function(t){return arguments.length?i(e=t[0]*Lt/180,n=t[1]*Lt/180):[e/Lt*180,n/Lt*180]},o}function ci(t,e){var n=Math.sin(t),i=(n+Math.sin(e))/2,o=1+n*(2*i-n),r=Math.sqrt(o)/i;function a(t,e){var n=Math.sqrt(o-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),r-n*Math.cos(t)]}return a.invert=function(t,e){var n=r-e;return[Math.atan2(t,n)/i,It((o-(t*t+n*n)*i*i)/(2*i))]},a}r.geo.clipExtent=function(){var t,e,n,i,o,r,a={stream:function(t){return o&&(o.valid=!1),(o=r(t)).valid=!0,o},extent:function(s){return arguments.length?(r=li(t=+s[0][0],e=+s[0][1],n=+s[1][0],i=+s[1][1]),o&&(o.valid=!1,o=null),a):[[t,e],[n,i]]}};return a.extent([[0,0],[960,500]])},(r.geo.conicEqualArea=function(){return ui(ci)}).raw=ci,r.geo.albers=function(){return r.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},r.geo.albersUsa=function(){var t,e,n,i,o=r.geo.albers(),a=r.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=r.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(e,n){t=[e,n]}};function u(o){var r=o[0],a=o[1];return t=null,e(r,a),t||(n(r,a),t)||i(r,a),t}return u.invert=function(t){var e=o.scale(),n=o.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?a:r>=.166&&r<.234&&i>=-.214&&i<-.115?s:o).invert(t)},u.stream=function(t){var e=o.stream(t),n=a.stream(t),i=s.stream(t);return{point:function(t,o){e.point(t,o),n.point(t,o),i.point(t,o)},sphere:function(){e.sphere(),n.sphere(),i.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),i.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),i.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),i.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),i.polygonEnd()}}},u.precision=function(t){return arguments.length?(o.precision(t),a.precision(t),s.precision(t),u):o.precision()},u.scale=function(t){return arguments.length?(o.scale(t),a.scale(.35*t),s.scale(t),u.translate(o.translate())):o.scale()},u.translate=function(t){if(!arguments.length)return o.translate();var r=o.scale(),c=+t[0],h=+t[1];return e=o.translate(t).clipExtent([[c-.455*r,h-.238*r],[c+.455*r,h+.238*r]]).stream(l).point,n=a.translate([c-.307*r,h+.201*r]).clipExtent([[c-.425*r+Mt,h+.12*r+Mt],[c-.214*r-Mt,h+.234*r-Mt]]).stream(l).point,i=s.translate([c-.205*r,h+.212*r]).clipExtent([[c-.214*r+Mt,h+.166*r+Mt],[c-.115*r-Mt,h+.234*r-Mt]]).stream(l).point,u},u.scale(1070)};var hi,di,fi,pi,gi,mi,vi={point:F,lineStart:F,lineEnd:F,polygonStart:function(){di=0,vi.lineStart=yi},polygonEnd:function(){vi.lineStart=vi.lineEnd=vi.point=F,hi+=x(di/2)}};function yi(){var t,e,n,i;function o(t,e){di+=i*t-n*e,n=t,i=e}vi.point=function(r,a){vi.point=o,t=n=r,e=i=a},vi.lineEnd=function(){o(t,e)}}var bi={point:function(t,e){t<fi&&(fi=t);t>gi&&(gi=t);e<pi&&(pi=e);e>mi&&(mi=e)},lineStart:F,lineEnd:F,polygonStart:F,polygonEnd:F};function wi(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var _i,xi={point:Si,lineStart:Ei,lineEnd:Ci,polygonStart:function(){xi.lineStart=Ti},polygonEnd:function(){xi.point=Si,xi.lineStart=Ei,xi.lineEnd=Ci}};function Si(t,e){En+=t,Cn+=e,++Tn}function Ei(){var t,e;function n(n,i){var o=n-t,r=i-e,a=Math.sqrt(o*o+r*r);Mn+=a*(t+n)/2,Pn+=a*(e+i)/2,Ln+=a,Si(t=n,e=i)}xi.point=function(i,o){xi.point=n,Si(t=i,e=o)}}function Ci(){xi.point=Si}function Ti(){var t,e,n,i;function o(t,e){var o=t-n,r=e-i,a=Math.sqrt(o*o+r*r);Mn+=a*(n+t)/2,Pn+=a*(i+e)/2,Ln+=a,An+=(a=i*t-n*e)*(n+t),kn+=a*(i+e),On+=3*a,Si(n=t,i=e)}xi.point=function(r,a){xi.point=o,Si(t=n=r,e=i=a)},xi.lineEnd=function(){o(t,e)}}function Mi(t){var e=.5,n=Math.cos(30*Rt),i=16;function o(e){return(i?function(e){var n,o,a,s,l,u,c,h,d,f,p,g,m={point:v,lineStart:y,lineEnd:w,polygonStart:function(){e.polygonStart(),m.lineStart=_},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function v(n,i){n=t(n,i),e.point(n[0],n[1])}function y(){h=NaN,m.point=b,e.lineStart()}function b(n,o){var a=zn([n,o]),s=t(n,o);r(h,d,c,f,p,g,h=s[0],d=s[1],c=n,f=a[0],p=a[1],g=a[2],i,e),e.point(h,d)}function w(){m.point=v,e.lineEnd()}function _(){y(),m.point=x,m.lineEnd=S}function x(t,e){b(n=t,e),o=h,a=d,s=f,l=p,u=g,m.point=b}function S(){r(h,d,c,f,p,g,o,a,n,s,l,u,i,e),m.lineEnd=w,w()}return m}:function(e){return Li(e,function(n,i){n=t(n,i),e.point(n[0],n[1])})})(e)}function r(i,o,a,s,l,u,c,h,d,f,p,g,m,v){var y=c-i,b=h-o,w=y*y+b*b;if(w>4*e&&m--){var _=s+f,S=l+p,E=u+g,C=Math.sqrt(_*_+S*S+E*E),T=Math.asin(E/=C),M=x(x(E)-1)<Mt||x(a-d)<Mt?(a+d)/2:Math.atan2(S,_),P=t(M,T),L=P[0],A=P[1],k=L-i,O=A-o,R=b*k-y*O;(R*R/w>e||x((y*k+b*O)/w-.5)>.3||s*f+l*p+u*g<n)&&(r(i,o,a,s,l,u,L,A,M,_/=C,S/=C,E,m,v),v.point(L,A),r(L,A,M,_,S,E,c,h,d,f,p,g,m,v))}}return o.precision=function(t){return arguments.length?(i=(e=t*t)>0&&16,o):Math.sqrt(e)},o}function Pi(t){this.stream=t}function Li(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 Ai(t){return ki(function(){return t})()}function ki(t){var e,n,i,o,a,s,l=Mi(function(t,n){return[(t=e(t,n))[0]*u+o,a-t[1]*u]}),u=150,c=480,h=250,d=0,f=0,p=0,g=0,m=0,v=ri,y=j,b=null,w=null;function _(t){return[(t=i(t[0]*Rt,t[1]*Rt))[0]*u+o,a-t[1]*u]}function S(t){return(t=i.invert((t[0]-o)/u,(a-t[1])/u))&&[t[0]*Dt,t[1]*Dt]}function E(){i=Qn(n=ji(p,g,m),e);var t=e(d,f);return o=c-t[0]*u,a=h+t[1]*u,C()}function C(){return s&&(s.valid=!1,s=null),_}return _.stream=function(t){return s&&(s.valid=!1),(s=Oi(v(n,l(y(t))))).valid=!0,s},_.clipAngle=function(t){return arguments.length?(v=null==t?(b=t,ri):function(t){var e=Math.cos(t),n=e>0,i=x(e)>Mt;return ei(o,function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,d){var f,p=[h,d],g=o(h,d),m=n?g?0:a(h,d):g?a(h+(h<0?Lt:-Lt),d):0;if(!e&&(u=l=g)&&t.lineStart(),g!==l&&(f=r(e,p),(Bn(e,f)||Bn(p,f))&&(p[0]+=Mt,p[1]+=Mt,g=o(p[0],p[1]))),g!==l)c=0,g?(t.lineStart(),f=r(p,e),t.point(f[0],f[1])):(f=r(e,p),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(i&&e&&n^g){var v;m&s||!(v=r(p,e,!0))||(c=0,n?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&Bn(e,p)||t.point(p[0],p[1]),e=p,l=g,s=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}},Fi(t,6*Rt),n?[0,-t]:[-Lt,t-Lt]);function o(t,n){return Math.cos(t)*Math.cos(n)>e}function r(t,n,i){var o=[1,0,0],r=In(zn(t),zn(n)),a=Nn(r,r),s=r[0],l=a-s*s;if(!l)return!i&&t;var u=e*a/l,c=-e*s/l,h=In(o,r),d=Hn(o,u);Fn(d,Hn(r,c));var f=h,p=Nn(d,f),g=Nn(f,f),m=p*p-g*(Nn(d,d)-1);if(!(m<0)){var v=Math.sqrt(m),y=Hn(f,(-p-v)/g);if(Fn(y,d),y=Vn(y),!i)return y;var b,w=t[0],_=n[0],S=t[1],E=n[1];_<w&&(b=w,w=_,_=b);var C=_-w,T=x(C-Lt)<Mt;if(!T&&E<S&&(b=S,S=E,E=b),T||C<Mt?T?S+E>0^y[1]<(x(y[0]-w)<Mt?S:E):S<=y[1]&&y[1]<=E:C>Lt^(w<=y[0]&&y[0]<=_)){var M=Hn(f,(-p+v)/g);return Fn(M,d),[y,Vn(M)]}}}function a(e,i){var o=n?t:Lt-t,r=0;return e<-o?r|=1:e>o&&(r|=2),i<-o?r|=4:i>o&&(r|=8),r}}((b=+t)*Rt),C()):b},_.clipExtent=function(t){return arguments.length?(w=t,y=t?li(t[0][0],t[0][1],t[1][0],t[1][1]):j,C()):w},_.scale=function(t){return arguments.length?(u=+t,E()):u},_.translate=function(t){return arguments.length?(c=+t[0],h=+t[1],E()):[c,h]},_.center=function(t){return arguments.length?(d=t[0]%360*Rt,f=t[1]%360*Rt,E()):[d*Dt,f*Dt]},_.rotate=function(t){return arguments.length?(p=t[0]%360*Rt,g=t[1]%360*Rt,m=t.length>2?t[2]%360*Rt:0,E()):[p*Dt,g*Dt,m*Dt]},r.rebind(_,l,"precision"),function(){return e=t.apply(this,arguments),_.invert=e.invert&&S,E()}}function Oi(t){return Li(t,function(e,n){t.point(e*Rt,n*Rt)})}function Ri(t,e){return[t,e]}function Di(t,e){return[t>Lt?t-At:t<-Lt?t+At:t,e]}function ji(t,e,n){return t?e||n?Qn(Ni(t),Ii(e,n)):Ni(t):e||n?Ii(e,n):Di}function zi(t){return function(e,n){return[(e+=t)>Lt?e-At:e<-Lt?e+At:e,n]}}function Ni(t){var e=zi(t);return e.invert=zi(-t),e}function Ii(t,e){var n=Math.cos(t),i=Math.sin(t),o=Math.cos(e),r=Math.sin(e);function a(t,e){var a=Math.cos(e),s=Math.cos(t)*a,l=Math.sin(t)*a,u=Math.sin(e),c=u*n+s*i;return[Math.atan2(l*o-c*r,s*n-u*i),It(c*o+l*r)]}return a.invert=function(t,e){var a=Math.cos(e),s=Math.cos(t)*a,l=Math.sin(t)*a,u=Math.sin(e),c=u*o-l*r;return[Math.atan2(l*o+u*r,s*n+c*i),It(c*n-s*i)]},a}function Fi(t,e){var n=Math.cos(t),i=Math.sin(t);return function(o,r,a,s){var l=a*e;null!=o?(o=Hi(n,o),r=Hi(n,r),(a>0?o<r:o>r)&&(o+=a*At)):(o=t+a*At,r=t-.5*l);for(var u,c=o;a>0?c>r:c<r;c-=l)s.point((u=Vn([n,-i*Math.cos(c),-i*Math.sin(c)]))[0],u[1])}}function Hi(t,e){var n=zn(e);n[0]-=t,Gn(n);var i=Nt(-n[1]);return((-n[2]<0?-i:i)+2*Math.PI-Mt)%(2*Math.PI)}function Gi(t,e,n){var i=r.range(t,e-Mt,n).concat(e);return function(t){return i.map(function(e){return[t,e]})}}function Vi(t,e,n){var i=r.range(t,e-Mt,n).concat(e);return function(t){return i.map(function(e){return[e,t]})}}function Bi(t){return t.source}function Ui(t){return t.target}r.geo.path=function(){var t,e,n,i,o,a=4.5;function s(t){return t&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=n(i)),r.geo.stream(t,o)),i.result()}function l(){return o=null,s}return s.area=function(t){return hi=0,r.geo.stream(t,n(vi)),hi},s.centroid=function(t){return En=Cn=Tn=Mn=Pn=Ln=An=kn=On=0,r.geo.stream(t,n(xi)),On?[An/On,kn/On]:Ln?[Mn/Ln,Pn/Ln]:Tn?[En/Tn,Cn/Tn]:[NaN,NaN]},s.bounds=function(t){return gi=mi=-(fi=pi=1/0),r.geo.stream(t,n(bi)),[[fi,pi],[gi,mi]]},s.projection=function(e){return arguments.length?(n=(t=e)?e.stream||function(t){var e=Mi(function(e,n){return t([e*Dt,n*Dt])});return function(t){return Oi(e(t))}}(e):j,l()):t},s.context=function(t){return arguments.length?(i=null==(e=t)?new function(){var t=wi(4.5),e=[],n={point:i,lineStart:function(){n.point=o},lineEnd:a,polygonStart:function(){n.lineEnd=s},polygonEnd:function(){n.lineEnd=a,n.point=i},pointRadius:function(e){return t=wi(e),n},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function i(n,i){e.push("M",n,",",i,t)}function o(t,i){e.push("M",t,",",i),n.point=r}function r(t,n){e.push("L",t,",",n)}function a(){n.point=i}function s(){e.push("Z")}return n}:new function(t){var e=4.5,n={point:i,lineStart:function(){n.point=o},lineEnd:a,polygonStart:function(){n.lineEnd=s},polygonEnd:function(){n.lineEnd=a,n.point=i},pointRadius:function(t){return e=t,n},result:F};function i(n,i){t.moveTo(n+e,i),t.arc(n,i,e,0,At)}function o(e,i){t.moveTo(e,i),n.point=r}function r(e,n){t.lineTo(e,n)}function a(){n.point=i}function s(){t.closePath()}return n}(t),"function"!=typeof a&&i.pointRadius(a),l()):e},s.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),s):a},s.projection(r.geo.albersUsa()).context(null)},r.geo.transform=function(t){return{stream:function(e){var n=new Pi(e);for(var i in t)n[i]=t[i];return n}}},Pi.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()}},r.geo.projection=Ai,r.geo.projectionMutator=ki,(r.geo.equirectangular=function(){return Ai(Ri)}).raw=Ri.invert=Ri,r.geo.rotation=function(t){function e(e){return(e=t(e[0]*Rt,e[1]*Rt))[0]*=Dt,e[1]*=Dt,e}return t=ji(t[0]%360*Rt,t[1]*Rt,t.length>2?t[2]*Rt:0),e.invert=function(e){return(e=t.invert(e[0]*Rt,e[1]*Rt))[0]*=Dt,e[1]*=Dt,e},e},Di.invert=Ri,r.geo.circle=function(){var t,e,n=[0,0],i=6;function o(){var t="function"==typeof n?n.apply(this,arguments):n,i=ji(-t[0]*Rt,-t[1]*Rt,0).invert,o=[];return e(null,null,1,{point:function(t,e){o.push(t=i(t,e)),t[0]*=Dt,t[1]*=Dt}}),{type:"Polygon",coordinates:[o]}}return o.origin=function(t){return arguments.length?(n=t,o):n},o.angle=function(n){return arguments.length?(e=Fi((t=+n)*Rt,i*Rt),o):t},o.precision=function(n){return arguments.length?(e=Fi(t*Rt,(i=+n)*Rt),o):i},o.angle(90)},r.geo.distance=function(t,e){var n,i=(e[0]-t[0])*Rt,o=t[1]*Rt,r=e[1]*Rt,a=Math.sin(i),s=Math.cos(i),l=Math.sin(o),u=Math.cos(o),c=Math.sin(r),h=Math.cos(r);return Math.atan2(Math.sqrt((n=h*a)*n+(n=u*c-l*h*s)*n),l*c+u*h*s)},r.geo.graticule=function(){var t,e,n,i,o,a,s,l,u,c,h,d,f=10,p=f,g=90,m=360,v=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return r.range(Math.ceil(i/g)*g,n,g).map(h).concat(r.range(Math.ceil(l/m)*m,s,m).map(d)).concat(r.range(Math.ceil(e/f)*f,t,f).filter(function(t){return x(t%g)>Mt}).map(u)).concat(r.range(Math.ceil(a/p)*p,o,p).filter(function(t){return x(t%m)>Mt}).map(c))}return y.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},y.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(d(s).slice(1),h(n).reverse().slice(1),d(l).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.majorExtent(t).minorExtent(t):y.minorExtent()},y.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),y.precision(v)):[[i,l],[n,s]]},y.minorExtent=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],o=+n[1][1],e>t&&(n=e,e=t,t=n),a>o&&(n=a,a=o,o=n),y.precision(v)):[[e,a],[t,o]]},y.step=function(t){return arguments.length?y.majorStep(t).minorStep(t):y.minorStep()},y.majorStep=function(t){return arguments.length?(g=+t[0],m=+t[1],y):[g,m]},y.minorStep=function(t){return arguments.length?(f=+t[0],p=+t[1],y):[f,p]},y.precision=function(r){return arguments.length?(v=+r,u=Gi(a,o,90),c=Vi(e,t,v),h=Gi(l,s,90),d=Vi(i,n,v),y):v},y.majorExtent([[-180,-90+Mt],[180,90-Mt]]).minorExtent([[-180,-80-Mt],[180,80+Mt]])},r.geo.greatArc=function(){var t,e,n=Bi,i=Ui;function o(){return{type:"LineString",coordinates:[t||n.apply(this,arguments),e||i.apply(this,arguments)]}}return o.distance=function(){return r.geo.distance(t||n.apply(this,arguments),e||i.apply(this,arguments))},o.source=function(e){return arguments.length?(n=e,t="function"==typeof e?null:e,o):n},o.target=function(t){return arguments.length?(i=t,e="function"==typeof t?null:t,o):i},o.precision=function(){return arguments.length?o:0},o},r.geo.interpolate=function(t,e){return function(t,e,n,i){var o=Math.cos(e),r=Math.sin(e),a=Math.cos(i),s=Math.sin(i),l=o*Math.cos(t),u=o*Math.sin(t),c=a*Math.cos(n),h=a*Math.sin(n),d=2*Math.asin(Math.sqrt(Ht(i-e)+o*a*Ht(n-t))),f=1/Math.sin(d),p=d?function(t){var e=Math.sin(t*=d)*f,n=Math.sin(d-t)*f,i=n*l+e*c,o=n*u+e*h,a=n*r+e*s;return[Math.atan2(o,i)*Dt,Math.atan2(a,Math.sqrt(i*i+o*o))*Dt]}:function(){return[t*Dt,e*Dt]};return p.distance=d,p}(t[0]*Rt,t[1]*Rt,e[0]*Rt,e[1]*Rt)},r.geo.length=function(t){return _i=0,r.geo.stream(t,Wi),_i};var Wi={sphere:F,point:F,lineStart:function(){var t,e,n;function i(i,o){var r=Math.sin(o*=Rt),a=Math.cos(o),s=x((i*=Rt)-t),l=Math.cos(s);_i+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=n*r-e*a*l)*s),e*r+n*a*l),t=i,e=r,n=a}Wi.point=function(o,r){t=o*Rt,e=Math.sin(r*=Rt),n=Math.cos(r),Wi.point=i},Wi.lineEnd=function(){Wi.point=Wi.lineEnd=F}},lineEnd:F,polygonStart:F,polygonEnd:F};function qi(t,e){function n(e,n){var i=Math.cos(e),o=Math.cos(n),r=t(i*o);return[r*o*Math.sin(e),r*Math.sin(n)]}return n.invert=function(t,n){var i=Math.sqrt(t*t+n*n),o=e(i),r=Math.sin(o),a=Math.cos(o);return[Math.atan2(t*r,i*a),Math.asin(i&&n*r/i)]},n}var Yi=qi(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(r.geo.azimuthalEqualArea=function(){return Ai(Yi)}).raw=Yi;var Xi=qi(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},j);function Zi(t,e){var n=Math.cos(t),i=function(t){return Math.tan(Lt/4+t/2)},o=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),r=n*Math.pow(i(t),o)/o;if(!o)return $i;function a(t,e){r>0?e<-Ot+Mt&&(e=-Ot+Mt):e>Ot-Mt&&(e=Ot-Mt);var n=r/Math.pow(i(e),o);return[n*Math.sin(o*t),r-n*Math.cos(o*t)]}return a.invert=function(t,e){var n=r-e,i=jt(o)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/o,2*Math.atan(Math.pow(r/i,1/o))-Ot]},a}function Qi(t,e){var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),o=n/i+t;if(x(i)<Mt)return Ri;function r(t,e){var n=o-e;return[n*Math.sin(i*t),o-n*Math.cos(i*t)]}return r.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/i,o-jt(i)*Math.sqrt(t*t+n*n)]},r}(r.geo.azimuthalEquidistant=function(){return Ai(Xi)}).raw=Xi,(r.geo.conicConformal=function(){return ui(Zi)}).raw=Zi,(r.geo.conicEquidistant=function(){return ui(Qi)}).raw=Qi;var Ki=qi(function(t){return 1/t},Math.atan);function $i(t,e){return[t,Math.log(Math.tan(Lt/4+e/2))]}function Ji(t){var e,n=Ai(t),i=n.scale,o=n.translate,r=n.clipExtent;return n.scale=function(){var t=i.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.translate=function(){var t=o.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.clipExtent=function(t){var a=r.apply(n,arguments);if(a===n){if(e=null==t){var s=Lt*i(),l=o();r([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(a=null);return a},n.clipExtent(null)}(r.geo.gnomonic=function(){return Ai(Ki)}).raw=Ki,$i.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ot]},(r.geo.mercator=function(){return Ji($i)}).raw=$i;var to=qi(function(){return 1},Math.asin);(r.geo.orthographic=function(){return Ai(to)}).raw=to;var eo=qi(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function no(t,e){return[Math.log(Math.tan(Lt/4+e/2)),-t]}function io(t){return t[0]}function oo(t){return t[1]}function ro(t){for(var e=t.length,n=[0,1],i=2,o=2;o<e;o++){for(;i>1&&zt(t[n[i-2]],t[n[i-1]],t[o])<=0;)--i;n[i++]=o}return n.slice(0,i)}function ao(t,e){return t[0]-e[0]||t[1]-e[1]}(r.geo.stereographic=function(){return Ai(eo)}).raw=eo,no.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ot]},(r.geo.transverseMercator=function(){var t=Ji(no),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90])}).raw=no,r.geom={},r.geom.hull=function(t){var e=io,n=oo;if(arguments.length)return i(t);function i(t){if(t.length<3)return[];var i,o=we(e),r=we(n),a=t.length,s=[],l=[];for(i=0;i<a;i++)s.push([+o.call(this,t[i],i),+r.call(this,t[i],i),i]);for(s.sort(ao),i=0;i<a;i++)l.push([s[i][0],-s[i][1]]);var u=ro(s),c=ro(l),h=c[0]===u[0],d=c[c.length-1]===u[u.length-1],f=[];for(i=u.length-1;i>=0;--i)f.push(t[s[u[i]][2]]);for(i=+h;i<c.length-d;++i)f.push(t[s[c[i]][2]]);return f}return i.x=function(t){return arguments.length?(e=t,i):e},i.y=function(t){return arguments.length?(n=t,i):n},i},r.geom.polygon=function(t){return q(t,so),t};var so=r.geom.polygon.prototype=[];function lo(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function uo(t,e,n,i){var o=t[0],r=n[0],a=e[0]-o,s=i[0]-r,l=t[1],u=n[1],c=e[1]-l,h=i[1]-u,d=(s*(l-u)-h*(o-r))/(h*a-s*c);return[o+d*a,l+d*c]}function co(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}so.area=function(){for(var t,e=-1,n=this.length,i=this[n-1],o=0;++e<n;)t=i,i=this[e],o+=t[1]*i[0]-t[0]*i[1];return.5*o},so.centroid=function(t){var e,n,i=-1,o=this.length,r=0,a=0,s=this[o-1];for(arguments.length||(t=-1/(6*this.area()));++i<o;)e=s,s=this[i],n=e[0]*s[1]-s[0]*e[1],r+=(e[0]+s[0])*n,a+=(e[1]+s[1])*n;return[r*t,a*t]},so.clip=function(t){for(var e,n,i,o,r,a,s=co(t),l=-1,u=this.length-co(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,o=this[l],r=e[(i=e.length-s)-1],n=-1;++n<i;)lo(a=e[n],c,o)?(lo(r,c,o)||t.push(uo(r,a,c,o)),t.push(a)):lo(r,c,o)&&t.push(uo(r,a,c,o)),r=a;s&&t.push(t[0]),c=o}return t};var ho,fo,po,go,mo,vo=[],yo=[];function bo(t){var e=vo.pop()||new function(){zo(this),this.edge=this.site=this.circle=null};return e.site=t,e}function wo(t){Po(t),po.remove(t),vo.push(t),zo(t)}function _o(t){var e=t.circle,n=e.x,i=e.cy,o={x:n,y:i},r=t.P,a=t.N,s=[t];wo(t);for(var l=r;l.circle&&x(n-l.circle.x)<Mt&&x(i-l.circle.cy)<Mt;)r=l.P,s.unshift(l),wo(l),l=r;s.unshift(l),Po(l);for(var u=a;u.circle&&x(n-u.circle.x)<Mt&&x(i-u.circle.cy)<Mt;)a=u.N,s.push(u),wo(u),u=a;s.push(u),Po(u);var c,h=s.length;for(c=1;c<h;++c)u=s[c],l=s[c-1],Ro(u.edge,l.site,u.site,o);l=s[0],(u=s[h-1]).edge=ko(l.site,u.site,null,o),Mo(l),Mo(u)}function xo(t){for(var e,n,i,o,r=t.x,a=t.y,s=po._;s;)if((i=So(s,a)-r)>Mt)s=s.L;else{if(!((o=r-Eo(s,a))>Mt)){i>-Mt?(e=s.P,n=s):o>-Mt?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}var l=bo(t);if(po.insert(e,l),e||n){if(e===n)return Po(e),n=bo(e.site),po.insert(l,n),l.edge=n.edge=ko(e.site,l.site),Mo(e),void Mo(n);if(n){Po(e),Po(n);var u=e.site,c=u.x,h=u.y,d=t.x-c,f=t.y-h,p=n.site,g=p.x-c,m=p.y-h,v=2*(d*m-f*g),y=d*d+f*f,b=g*g+m*m,w={x:(m*y-f*b)/v+c,y:(d*b-g*y)/v+h};Ro(n.edge,u,p,w),l.edge=ko(u,t,null,w),n.edge=ko(t,p,null,w),Mo(e),Mo(n)}else l.edge=ko(e.site,l.site)}}function So(t,e){var n=t.site,i=n.x,o=n.y,r=o-e;if(!r)return i;var a=t.P;if(!a)return-1/0;var s=(n=a.site).x,l=n.y,u=l-e;if(!u)return s;var c=s-i,h=1/r-1/u,d=c/u;return h?(-d+Math.sqrt(d*d-2*h*(c*c/(-2*u)-l+u/2+o-r/2)))/h+i:(i+s)/2}function Eo(t,e){var n=t.N;if(n)return So(n,e);var i=t.site;return i.y===e?i.x:1/0}function Co(t){this.site=t,this.edges=[]}function To(t,e){return e.angle-t.angle}function Mo(t){var e=t.P,n=t.N;if(e&&n){var i=e.site,o=t.site,r=n.site;if(i!==r){var a=o.x,s=o.y,l=i.x-a,u=i.y-s,c=r.x-a,h=2*(l*(m=r.y-s)-u*c);if(!(h>=-Pt)){var d=l*l+u*u,f=c*c+m*m,p=(m*d-u*f)/h,g=(l*f-c*d)/h,m=g+s,v=yo.pop()||new function(){zo(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=o,v.x=p+a,v.y=m+Math.sqrt(p*p+g*g),v.cy=m,t.circle=v;for(var y=null,b=mo._;b;)if(v.y<b.y||v.y===b.y&&v.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}mo.insert(y,v),y||(go=v)}}}}function Po(t){var e=t.circle;e&&(e.P||(go=e.N),mo.remove(e),yo.push(e),zo(e),t.circle=null)}function Lo(t,e){var n=t.b;if(n)return!0;var i,o,r=t.a,a=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,h=t.r,d=c.x,f=c.y,p=h.x,g=h.y,m=(d+p)/2,v=(f+g)/2;if(g===f){if(m<a||m>=s)return;if(d>p){if(r){if(r.y>=u)return}else r={x:m,y:l};n={x:m,y:u}}else{if(r){if(r.y<l)return}else r={x:m,y:u};n={x:m,y:l}}}else if(o=v-(i=(d-p)/(g-f))*m,i<-1||i>1)if(d>p){if(r){if(r.y>=u)return}else r={x:(l-o)/i,y:l};n={x:(u-o)/i,y:u}}else{if(r){if(r.y<l)return}else r={x:(u-o)/i,y:u};n={x:(l-o)/i,y:l}}else if(f<g){if(r){if(r.x>=s)return}else r={x:a,y:i*a+o};n={x:s,y:i*s+o}}else{if(r){if(r.x<a)return}else r={x:s,y:i*s+o};n={x:a,y:i*a+o}}return t.a=r,t.b=n,!0}function Ao(t,e){this.l=t,this.r=e,this.a=this.b=null}function ko(t,e,n,i){var o=new Ao(t,e);return ho.push(o),n&&Ro(o,t,e,n),i&&Ro(o,e,t,i),fo[t.i].edges.push(new Do(o,t,e)),fo[e.i].edges.push(new Do(o,e,t)),o}function Oo(t,e,n){var i=new Ao(t,null);return i.a=e,i.b=n,ho.push(i),i}function Ro(t,e,n,i){t.a||t.b?t.l===n?t.b=i:t.a=i:(t.a=i,t.l=e,t.r=n)}function Do(t,e,n){var i=t.a,o=t.b;this.edge=t,this.site=e,this.angle=n?Math.atan2(n.y-e.y,n.x-e.x):t.l===e?Math.atan2(o.x-i.x,i.y-o.y):Math.atan2(i.x-o.x,o.y-i.y)}function jo(){this._=null}function zo(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function No(t,e){var n=e,i=e.R,o=n.U;o?o.L===n?o.L=i:o.R=i:t._=i,i.U=o,n.U=i,n.R=i.L,n.R&&(n.R.U=n),i.L=n}function Io(t,e){var n=e,i=e.L,o=n.U;o?o.L===n?o.L=i:o.R=i:t._=i,i.U=o,n.U=i,n.L=i.R,n.L&&(n.L.U=n),i.R=n}function Fo(t){for(;t.L;)t=t.L;return t}function Ho(t,e){var n,i,o,r=t.sort(Go).pop();for(ho=[],fo=new Array(t.length),po=new jo,mo=new jo;;)if(o=go,r&&(!o||r.y<o.y||r.y===o.y&&r.x<o.x))r.x===n&&r.y===i||(fo[r.i]=new Co(r),xo(r),n=r.x,i=r.y),r=t.pop();else{if(!o)break;_o(o.arc)}e&&(function(t){for(var e,n=ho,i=ai(t[0][0],t[0][1],t[1][0],t[1][1]),o=n.length;o--;)(!Lo(e=n[o],t)||!i(e)||x(e.a.x-e.b.x)<Mt&&x(e.a.y-e.b.y)<Mt)&&(e.a=e.b=null,n.splice(o,1))}(e),function(t){for(var e,n,i,o,r,a,s,l,u,c,h=t[0][0],d=t[1][0],f=t[0][1],p=t[1][1],g=fo,m=g.length;m--;)if((r=g[m])&&r.prepare())for(l=(s=r.edges).length,a=0;a<l;)i=(c=s[a].end()).x,o=c.y,e=(u=s[++a%l].start()).x,n=u.y,(x(i-e)>Mt||x(o-n)>Mt)&&(s.splice(a,0,new Do(Oo(r.site,c,x(i-h)<Mt&&p-o>Mt?{x:h,y:x(e-h)<Mt?n:p}:x(o-p)<Mt&&d-i>Mt?{x:x(n-p)<Mt?e:d,y:p}:x(i-d)<Mt&&o-f>Mt?{x:d,y:x(e-d)<Mt?n:f}:x(o-f)<Mt&&i-h>Mt?{x:x(n-f)<Mt?e:h,y:f}:null),r.site,null)),++l)}(e));var a={cells:fo,edges:ho};return po=mo=ho=fo=null,a}function Go(t,e){return e.y-t.y||e.x-t.x}Co.prototype.prepare=function(){for(var t,e=this.edges,n=e.length;n--;)(t=e[n].edge).b&&t.a||e.splice(n,1);return e.sort(To),e.length},Do.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},jo.prototype={insert:function(t,e){var n,i,o;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Fo(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(i=n.U).L?(o=i.R)&&o.C?(n.C=o.C=!1,i.C=!0,t=i):(t===n.R&&(No(this,n),n=(t=n).U),n.C=!1,i.C=!0,Io(this,i)):(o=i.L)&&o.C?(n.C=o.C=!1,i.C=!0,t=i):(t===n.L&&(Io(this,n),n=(t=n).U),n.C=!1,i.C=!0,No(this,i)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,i,o=t.U,r=t.L,a=t.R;if(n=r?a?Fo(a):r:a,o?o.L===t?o.L=n:o.R=n:this._=n,r&&a?(i=n.C,n.C=t.C,n.L=r,r.U=n,n!==a?(o=n.U,n.U=t.U,t=n.R,o.L=t,n.R=a,a.U=n):(n.U=o,o=n,t=n.R)):(i=t.C,t=n),t&&(t.U=o),!i)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===o.L){if((e=o.R).C&&(e.C=!1,o.C=!0,No(this,o),e=o.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Io(this,e),e=o.R),e.C=o.C,o.C=e.R.C=!1,No(this,o),t=this._;break}}else if((e=o.L).C&&(e.C=!1,o.C=!0,Io(this,o),e=o.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,No(this,e),e=o.L),e.C=o.C,o.C=e.L.C=!1,Io(this,o),t=this._;break}e.C=!0,t=o,o=o.U}while(!t.C);t&&(t.C=!1)}}},r.geom.voronoi=function(t){var e=io,n=oo,i=e,o=n,r=Vo;if(t)return a(t);function a(t){var e=new Array(t.length),n=r[0][0],i=r[0][1],o=r[1][0],a=r[1][1];return Ho(s(t),r).cells.forEach(function(r,s){var l=r.edges,u=r.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=n&&u.x<=o&&u.y>=i&&u.y<=a?[[n,a],[o,a],[o,i],[n,i]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(i(t,e)/Mt)*Mt,y:Math.round(o(t,e)/Mt)*Mt,i:e}})}return a.links=function(t){return Ho(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},a.triangles=function(t){var e=[];return Ho(s(t)).cells.forEach(function(n,i){for(var o,r=n.site,a=n.edges.sort(To),s=-1,l=a.length,u=a[l-1].edge,c=u.l===r?u.r:u.l;++s<l;)u,o=c,c=(u=a[s].edge).l===r?u.r:u.l,i<o.i&&i<c.i&&Bo(r,o,c)<0&&e.push([t[i],t[o.i],t[c.i]])}),e},a.x=function(t){return arguments.length?(i=we(e=t),a):e},a.y=function(t){return arguments.length?(o=we(n=t),a):n},a.clipExtent=function(t){return arguments.length?(r=null==t?Vo:t,a):r===Vo?null:r},a.size=function(t){return arguments.length?a.clipExtent(t&&[[0,0],t]):r===Vo?null:r&&r[1]},a};var Vo=[[-1e6,-1e6],[1e6,1e6]];function Bo(t,e,n){return(t.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-t.y)}function Uo(t){return t.x}function Wo(t){return t.y}function qo(t,e){t=r.rgb(t),e=r.rgb(e);var n=t.r,i=t.g,o=t.b,a=e.r-n,s=e.g-i,l=e.b-o;return function(t){return"#"+fe(Math.round(n+a*t))+fe(Math.round(i+s*t))+fe(Math.round(o+l*t))}}function Yo(t,e){var n,i={},o={};for(n in t)n in e?i[n]=$o(t[n],e[n]):o[n]=t[n];for(n in e)n in t||(o[n]=e[n]);return function(t){for(n in i)o[n]=i[n](t);return o}}function Xo(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Zo(t,e){var n,i,o,r=Qo.lastIndex=Ko.lastIndex=0,a=-1,s=[],l=[];for(t+="",e+="";(n=Qo.exec(t))&&(i=Ko.exec(e));)(o=i.index)>r&&(o=e.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Xo(n,i)})),r=Ko.lastIndex;return r<e.length&&(o=e.slice(r),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var n,i=0;i<e;++i)s[(n=l[i]).i]=n.x(t);return s.join("")})}r.geom.delaunay=function(t){return r.geom.voronoi().triangles(t)},r.geom.quadtree=function(t,e,n,i,o){var r,a=io,s=oo;if(r=arguments.length)return a=Uo,s=Wo,3===r&&(o=n,i=e,n=e=0),l(t);function l(t){var l,u,c,h,d,f,p,g,m,v=we(a),y=we(s);if(null!=e)f=e,p=n,g=i,m=o;else if(g=m=-(f=p=1/0),u=[],c=[],d=t.length,r)for(h=0;h<d;++h)(l=t[h]).x<f&&(f=l.x),l.y<p&&(p=l.y),l.x>g&&(g=l.x),l.y>m&&(m=l.y),u.push(l.x),c.push(l.y);else for(h=0;h<d;++h){var b=+v(l=t[h],h),w=+y(l,h);b<f&&(f=b),w<p&&(p=w),b>g&&(g=b),w>m&&(m=w),u.push(b),c.push(w)}var _=g-f,S=m-p;function E(t,e,n,i,o,r,a,s){if(!isNaN(n)&&!isNaN(i))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(x(l-n)+x(u-i)<.01)C(t,e,n,i,o,r,a,s);else{var c=t.point;t.x=t.y=t.point=null,C(t,c,l,u,o,r,a,s),C(t,e,n,i,o,r,a,s)}else t.x=n,t.y=i,t.point=e}else C(t,e,n,i,o,r,a,s)}function C(t,e,n,i,o,r,a,s){var l=.5*(o+a),u=.5*(r+s),c=n>=l,h=i>=u,d=h<<1|c;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){E(T,t,+v(t,++h),+y(t,h),f,p,g,m)}}),c?o=l:a=l,h?r=u:s=u,E(t,e,n,i,o,r,a,s)}_>S?m=p+_:g=f+S;var T={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){E(T,t,+v(t,++h),+y(t,h),f,p,g,m)}};if(T.visit=function(t){!function t(e,n,i,o,r,a){if(!e(n,i,o,r,a)){var s=.5*(i+r),l=.5*(o+a),u=n.nodes;u[0]&&t(e,u[0],i,o,s,l),u[1]&&t(e,u[1],s,o,r,l),u[2]&&t(e,u[2],i,l,s,a),u[3]&&t(e,u[3],s,l,r,a)}}(t,T,f,p,g,m)},T.find=function(t){return function(t,e,n,i,o,r,a){var s,l=1/0;return function t(u,c,h,d,f){if(!(c>r||h>a||d<i||f<o)){if(p=u.point){var p,g=e-u.x,m=n-u.y,v=g*g+m*m;if(v<l){var y=Math.sqrt(l=v);i=e-y,o=n-y,r=e+y,a=n+y,s=p}}for(var b=u.nodes,w=.5*(c+d),_=.5*(h+f),x=(n>=_)<<1|e>=w,S=x+4;x<S;++x)if(u=b[3&x])switch(3&x){case 0:t(u,c,h,w,_);break;case 1:t(u,w,h,d,_);break;case 2:t(u,c,_,w,f);break;case 3:t(u,w,_,d,f)}}}(t,i,o,r,a),s}(T,t[0],t[1],f,p,g,m)},h=-1,null==e){for(;++h<d;)E(T,t[h],u[h],c[h],f,p,g,m);--h}else t.forEach(T.add);return u=c=t=l=null,T}return l.x=function(t){return arguments.length?(a=t,l):a},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=n=i=o=null:(e=+t[0][0],n=+t[0][1],i=+t[1][0],o=+t[1][1]),l):null==e?null:[[e,n],[i,o]]},l.size=function(t){return arguments.length?(null==t?e=n=i=o=null:(e=n=0,i=+t[0],o=+t[1]),l):null==e?null:[i-e,o-n]},l},r.interpolateRgb=qo,r.interpolateObject=Yo,r.interpolateNumber=Xo,r.interpolateString=Zo;var Qo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ko=new RegExp(Qo.source,"g");function $o(t,e){for(var n,i=r.interpolators.length;--i>=0&&!(n=r.interpolators[i](t,e)););return n}function Jo(t,e){var n,i=[],o=[],r=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;n<s;++n)i.push($o(t[n],e[n]));for(;n<r;++n)o[n]=t[n];for(;n<a;++n)o[n]=e[n];return function(t){for(n=0;n<s;++n)o[n]=i[n](t);return o}}r.interpolate=$o,r.interpolators=[function(t,e){var n=typeof e;return("string"===n?be.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?qo:Zo:e instanceof Wt?qo:Array.isArray(e)?Jo:"object"===n&&isNaN(e)?Yo:Xo)(t,e)}],r.interpolateArray=Jo;var tr=function(){return j},er=r.map({linear:tr,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return rr},cubic:function(){return ar},sin:function(){return lr},exp:function(){return ur},circle:function(){return cr},elastic:function(t,e){var n;arguments.length<2&&(e=.45);arguments.length?n=e/At*Math.asin(1/t):(t=1,n=e/4);return function(i){return 1+t*Math.pow(2,-10*i)*Math.sin((i-n)*At/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return hr}}),nr=r.map({in:j,out:ir,"in-out":or,"out-in":function(t){return or(ir(t))}});function ir(t){return function(e){return 1-t(1-e)}}function or(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function rr(t){return t*t}function ar(t){return t*t*t}function sr(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}function lr(t){return 1-Math.cos(t*Ot)}function ur(t){return Math.pow(2,10*(t-1))}function cr(t){return 1-Math.sqrt(1-t*t)}function hr(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function dr(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function fr(t){var e=[t.a,t.b],n=[t.c,t.d],i=gr(e),o=pr(e,n),r=gr(function(t,e,n){return t[0]+=n*e[0],t[1]+=n*e[1],t}(n,e,-o))||0;e[0]*n[1]<n[0]*e[1]&&(e[0]*=-1,e[1]*=-1,i*=-1,o*=-1),this.rotate=(i?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Dt,this.translate=[t.e,t.f],this.scale=[i,r],this.skew=r?Math.atan2(o,r)*Dt:0}function pr(t,e){return t[0]*e[0]+t[1]*e[1]}function gr(t){var e=Math.sqrt(pr(t,t));return e&&(t[0]/=e,t[1]/=e),e}r.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,i=e>=0?t.slice(e+1):"in";return n=er.get(n)||tr,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}((i=nr.get(i)||j)(n.apply(null,a.call(arguments,1))))},r.interpolateHcl=function(t,e){t=r.hcl(t),e=r.hcl(e);var n=t.h,i=t.c,o=t.l,a=e.h-n,s=e.c-i,l=e.l-o;isNaN(s)&&(s=0,i=isNaN(i)?e.c:i);isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:a<-180&&(a+=360);return function(t){return Kt(n+a*t,i+s*t,o+l*t)+""}},r.interpolateHsl=function(t,e){t=r.hsl(t),e=r.hsl(e);var n=t.h,i=t.s,o=t.l,a=e.h-n,s=e.s-i,l=e.l-o;isNaN(s)&&(s=0,i=isNaN(i)?e.s:i);isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:a<-180&&(a+=360);return function(t){return Xt(n+a*t,i+s*t,o+l*t)+""}},r.interpolateLab=function(t,e){t=r.lab(t),e=r.lab(e);var n=t.l,i=t.a,o=t.b,a=e.l-n,s=e.a-i,l=e.b-o;return function(t){return oe(n+a*t,i+s*t,o+l*t)+""}},r.interpolateRound=dr,r.transform=function(t){var e=l.createElementNS(r.ns.prefix.svg,"g");return(r.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new fr(n?n.matrix:mr)})(t)},fr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var mr={a:1,b:0,c:0,d:1,e:0,f:0};function vr(t){return t.length?t.pop()+",":""}function yr(t,e){var n=[],i=[];return t=r.transform(t),e=r.transform(e),function(t,e,n,i){if(t[0]!==e[0]||t[1]!==e[1]){var o=n.push("translate(",null,",",null,")");i.push({i:o-4,x:Xo(t[0],e[0])},{i:o-2,x:Xo(t[1],e[1])})}else(e[0]||e[1])&&n.push("translate("+e+")")}(t.translate,e.translate,n,i),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(vr(n)+"rotate(",null,")")-2,x:Xo(t,e)})):e&&n.push(vr(n)+"rotate("+e+")")}(t.rotate,e.rotate,n,i),function(t,e,n,i){t!==e?i.push({i:n.push(vr(n)+"skewX(",null,")")-2,x:Xo(t,e)}):e&&n.push(vr(n)+"skewX("+e+")")}(t.skew,e.skew,n,i),function(t,e,n,i){if(t[0]!==e[0]||t[1]!==e[1]){var o=n.push(vr(n)+"scale(",null,",",null,")");i.push({i:o-4,x:Xo(t[0],e[0])},{i:o-2,x:Xo(t[1],e[1])})}else 1===e[0]&&1===e[1]||n.push(vr(n)+"scale("+e+")")}(t.scale,e.scale,n,i),t=e=null,function(t){for(var e,o=-1,r=i.length;++o<r;)n[(e=i[o]).i]=e.x(t);return n.join("")}}function br(t,e){return e=(e-=t=+t)||1/e,function(n){return(n-t)/e}}function wr(t,e){return e=(e-=t=+t)||1/e,function(n){return Math.max(0,Math.min(1,(n-t)/e))}}function _r(t){for(var e=t.source,n=t.target,i=function(t,e){if(t===e)return t;var n=xr(t),i=xr(e),o=n.pop(),r=i.pop(),a=null;for(;o===r;)a=o,o=n.pop(),r=i.pop();return a}(e,n),o=[e];e!==i;)e=e.parent,o.push(e);for(var r=o.length;n!==i;)o.splice(r,0,n),n=n.parent;return o}function xr(t){for(var e=[],n=t.parent;null!=n;)e.push(t),t=n,n=n.parent;return e.push(t),e}function Sr(t){t.fixed|=2}function Er(t){t.fixed&=-7}function Cr(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Tr(t){t.fixed&=-5}r.interpolateTransform=yr,r.layout={},r.layout.bundle=function(){return function(t){for(var e=[],n=-1,i=t.length;++n<i;)e.push(_r(t[n]));return e}},r.layout.chord=function(){var t,e,n,i,o,a,s,l={},u=0;function c(){var l,c,d,f,p,g={},m=[],v=r.range(i),y=[];for(t=[],e=[],l=0,f=-1;++f<i;){for(c=0,p=-1;++p<i;)c+=n[f][p];m.push(c),y.push(r.range(i)),l+=c}for(o&&v.sort(function(t,e){return o(m[t],m[e])}),a&&y.forEach(function(t,e){t.sort(function(t,i){return a(n[e][t],n[e][i])})}),l=(At-u*i)/l,c=0,f=-1;++f<i;){for(d=c,p=-1;++p<i;){var b=v[f],w=y[b][p],_=n[b][w],x=c,S=c+=_*l;g[b+"-"+w]={index:b,subindex:w,startAngle:x,endAngle:S,value:_}}e[b]={index:b,startAngle:d,endAngle:c,value:m[b]},c+=u}for(f=-1;++f<i;)for(p=f-1;++p<i;){var E=g[f+"-"+p],C=g[p+"-"+f];(E.value||C.value)&&t.push(E.value<C.value?{source:C,target:E}:{source:E,target:C})}s&&h()}function h(){t.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return l.matrix=function(o){return arguments.length?(i=(n=o)&&n.length,t=e=null,l):n},l.padding=function(n){return arguments.length?(u=n,t=e=null,l):u},l.sortGroups=function(n){return arguments.length?(o=n,t=e=null,l):o},l.sortSubgroups=function(e){return arguments.length?(a=e,t=null,l):a},l.sortChords=function(e){return arguments.length?(s=e,t&&h(),l):s},l.chords=function(){return t||c(),t},l.groups=function(){return e||c(),e},l},r.layout.force=function(){var t,e,n,i,o,a,s={},l=r.dispatch("start","tick","end"),u=[1,1],c=.9,h=Mr,d=Pr,f=-30,p=Lr,g=.1,m=.64,v=[],y=[];function b(t){return function(e,n,i,o){if(e.point!==t){var r=e.cx-t.x,a=e.cy-t.y,s=o-n,l=r*r+a*a;if(s*s/m<l){if(l<p){var u=e.charge/l;t.px-=r*u,t.py-=a*u}return!0}if(e.point&&l&&l<p){u=e.pointCharge/l;t.px-=r*u,t.py-=a*u}}return!e.charge}}function w(t){t.px=r.event.x,t.py=r.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return t=null,l.end({type:"end",alpha:n=0}),!0;var e,s,h,d,p,m,w,_,x,S=v.length,E=y.length;for(s=0;s<E;++s)d=(h=y[s]).source,(m=(_=(p=h.target).x-d.x)*_+(x=p.y-d.y)*x)&&(_*=m=n*o[s]*((m=Math.sqrt(m))-i[s])/m,x*=m,p.x-=_*(w=d.weight+p.weight?d.weight/(d.weight+p.weight):.5),p.y-=x*w,d.x+=_*(w=1-w),d.y+=x*w);if((w=n*g)&&(_=u[0]/2,x=u[1]/2,s=-1,w))for(;++s<S;)(h=v[s]).x+=(_-h.x)*w,h.y+=(x-h.y)*w;if(f)for(!function t(e,n,i){var o=0,r=0;e.charge=0;if(!e.leaf)for(var a,s=e.nodes,l=s.length,u=-1;++u<l;)null!=(a=s[u])&&(t(a,n,i),e.charge+=a.charge,o+=a.charge*a.cx,r+=a.charge*a.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var c=n*i[e.point.index];e.charge+=e.pointCharge=c,o+=c*e.point.x,r+=c*e.point.y}e.cx=o/e.charge;e.cy=r/e.charge}(e=r.geom.quadtree(v),n,a),s=-1;++s<S;)(h=v[s]).fixed||e.visit(b(h));for(s=-1;++s<S;)(h=v[s]).fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*c,h.y-=(h.py-(h.py=h.y))*c);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(v=t,s):v},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.chargeDistance=function(t){return arguments.length?(p=t*t,s):Math.sqrt(p)},s.gravity=function(t){return arguments.length?(g=+t,s):g},s.theta=function(t){return arguments.length?(m=t*t,s):Math.sqrt(m)},s.alpha=function(e){return arguments.length?(e=+e,n?e>0?n=e:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:n=0})):e>0&&(l.start({type:"start",alpha:n=e}),t=Pe(s.tick)),s):n},s.start=function(){var t,e,n,r=v.length,l=y.length,c=u[0],p=u[1];for(t=0;t<r;++t)(n=v[t]).index=t,n.weight=0;for(t=0;t<l;++t)"number"==typeof(n=y[t]).source&&(n.source=v[n.source]),"number"==typeof n.target&&(n.target=v[n.target]),++n.source.weight,++n.target.weight;for(t=0;t<r;++t)n=v[t],isNaN(n.x)&&(n.x=g("x",c)),isNaN(n.y)&&(n.y=g("y",p)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(i=[],"function"==typeof h)for(t=0;t<l;++t)i[t]=+h.call(this,y[t],t);else for(t=0;t<l;++t)i[t]=h;if(o=[],"function"==typeof d)for(t=0;t<l;++t)o[t]=+d.call(this,y[t],t);else for(t=0;t<l;++t)o[t]=d;if(a=[],"function"==typeof f)for(t=0;t<r;++t)a[t]=+f.call(this,v[t],t);else for(t=0;t<r;++t)a[t]=f;function g(n,i){if(!e){for(e=new Array(r),u=0;u<r;++u)e[u]=[];for(u=0;u<l;++u){var o=y[u];e[o.source.index].push(o.target),e[o.target.index].push(o.source)}}for(var a,s=e[t],u=-1,c=s.length;++u<c;)if(!isNaN(a=s[u][n]))return a;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(e||(e=r.behavior.drag().origin(j).on("dragstart.force",Sr).on("drag.force",w).on("dragend.force",Er)),!arguments.length)return e;this.on("mouseover.force",Cr).on("mouseout.force",Tr).call(e)},r.rebind(s,l,"on")};var Mr=20,Pr=1,Lr=1/0;function Ar(t,e){return r.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=zr,t}function kr(t,e){for(var n=[t];null!=(t=n.pop());)if(e(t),(o=t.children)&&(i=o.length))for(var i,o;--i>=0;)n.push(o[i])}function Or(t,e){for(var n=[t],i=[];null!=(t=n.pop());)if(i.push(t),(r=t.children)&&(o=r.length))for(var o,r,a=-1;++a<o;)n.push(r[a]);for(;null!=(t=i.pop());)e(t)}function Rr(t){return t.children}function Dr(t){return t.value}function jr(t,e){return e.value-t.value}function zr(t){return r.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}r.layout.hierarchy=function(){var t=jr,e=Rr,n=Dr;function i(o){var r,a=[o],s=[];for(o.depth=0;null!=(r=a.pop());)if(s.push(r),(u=e.call(i,r,r.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)a.push(c=u[l]),c.parent=r,c.depth=r.depth+1;n&&(r.value=0),r.children=u}else n&&(r.value=+n.call(i,r,r.depth)||0),delete r.children;return Or(o,function(e){var i,o;t&&(i=e.children)&&i.sort(t),n&&(o=e.parent)&&(o.value+=e.value)}),s}return i.sort=function(e){return arguments.length?(t=e,i):t},i.children=function(t){return arguments.length?(e=t,i):e},i.value=function(t){return arguments.length?(n=t,i):n},i.revalue=function(t){return n&&(kr(t,function(t){t.children&&(t.value=0)}),Or(t,function(t){var e;t.children||(t.value=+n.call(i,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},i},r.layout.partition=function(){var t=r.layout.hierarchy(),e=[1,1];function n(n,i){var o=t.call(this,n,i);return function t(e,n,i,o){var r=e.children;if(e.x=n,e.y=e.depth*o,e.dx=i,e.dy=o,r&&(a=r.length)){var a,s,l,u=-1;for(i=e.value?i/e.value:0;++u<a;)t(s=r[u],n,l=s.value*i,o),n+=l}}(o[0],0,e[0],e[1]/function t(e){var n=e.children,i=0;if(n&&(o=n.length))for(var o,r=-1;++r<o;)i=Math.max(i,t(n[r]));return 1+i}(o[0])),o}return n.size=function(t){return arguments.length?(e=t,n):e},Ar(n,t)},r.layout.pie=function(){var t=Number,e=Nr,n=0,i=At,o=0;function a(s){var l,u=s.length,c=s.map(function(e,n){return+t.call(a,e,n)}),h=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof i?i.apply(this,arguments):i)-h,f=Math.min(Math.abs(d)/u,+("function"==typeof o?o.apply(this,arguments):o)),p=f*(d<0?-1:1),g=r.sum(c),m=g?(d-u*p)/g:0,v=r.range(u),y=[];return null!=e&&v.sort(e===Nr?function(t,e){return c[e]-c[t]}:function(t,n){return e(s[t],s[n])}),v.forEach(function(t){y[t]={data:s[t],value:l=c[t],startAngle:h,endAngle:h+=l*m+p,padAngle:f}}),y}return a.value=function(e){return arguments.length?(t=e,a):t},a.sort=function(t){return arguments.length?(e=t,a):e},a.startAngle=function(t){return arguments.length?(n=t,a):n},a.endAngle=function(t){return arguments.length?(i=t,a):i},a.padAngle=function(t){return arguments.length?(o=t,a):o},a};var Nr={};function Ir(t){return t.x}function Fr(t){return t.y}function Hr(t,e,n){t.y0=e,t.y=n}r.layout.stack=function(){var t=j,e=Br,n=Ur,i=Hr,o=Ir,a=Fr;function s(l,u){if(!(f=l.length))return l;var c=l.map(function(e,n){return t.call(s,e,n)}),h=c.map(function(t){return t.map(function(t,e){return[o.call(s,t,e),a.call(s,t,e)]})}),d=e.call(s,h,u);c=r.permute(c,d),h=r.permute(h,d);var f,p,g,m,v=n.call(s,h,u),y=c[0].length;for(g=0;g<y;++g)for(i.call(s,c[0][g],m=v[g],h[0][g][1]),p=1;p<f;++p)i.call(s,c[p][g],m+=h[p-1][g][1],h[p][g][1]);return l}return s.values=function(e){return arguments.length?(t=e,s):t},s.order=function(t){return arguments.length?(e="function"==typeof t?t:Gr.get(t)||Br,s):e},s.offset=function(t){return arguments.length?(n="function"==typeof t?t:Vr.get(t)||Ur,s):n},s.x=function(t){return arguments.length?(o=t,s):o},s.y=function(t){return arguments.length?(a=t,s):a},s.out=function(t){return arguments.length?(i=t,s):i},s};var Gr=r.map({"inside-out":function(t){var e,n,i=t.length,o=t.map(Wr),a=t.map(qr),s=r.range(i).sort(function(t,e){return o[t]-o[e]}),l=0,u=0,c=[],h=[];for(e=0;e<i;++e)n=s[e],l<u?(l+=a[n],c.push(n)):(u+=a[n],h.push(n));return h.reverse().concat(c)},reverse:function(t){return r.range(t.length).reverse()},default:Br}),Vr=r.map({silhouette:function(t){var e,n,i,o=t.length,r=t[0].length,a=[],s=0,l=[];for(n=0;n<r;++n){for(e=0,i=0;e<o;e++)i+=t[e][n][1];i>s&&(s=i),a.push(i)}for(n=0;n<r;++n)l[n]=(s-a[n])/2;return l},wiggle:function(t){var e,n,i,o,r,a,s,l,u,c=t.length,h=t[0],d=h.length,f=[];for(f[0]=l=u=0,n=1;n<d;++n){for(e=0,o=0;e<c;++e)o+=t[e][n][1];for(e=0,r=0,s=h[n][0]-h[n-1][0];e<c;++e){for(i=0,a=(t[e][n][1]-t[e][n-1][1])/(2*s);i<e;++i)a+=(t[i][n][1]-t[i][n-1][1])/s;r+=a*t[e][n][1]}f[n]=l-=o?r/o*s:0,l<u&&(u=l)}for(n=0;n<d;++n)f[n]-=u;return f},expand:function(t){var e,n,i,o=t.length,r=t[0].length,a=1/o,s=[];for(n=0;n<r;++n){for(e=0,i=0;e<o;e++)i+=t[e][n][1];if(i)for(e=0;e<o;e++)t[e][n][1]/=i;else for(e=0;e<o;e++)t[e][n][1]=a}for(n=0;n<r;++n)s[n]=0;return s},zero:Ur});function Br(t){return r.range(t.length)}function Ur(t){for(var e=-1,n=t[0].length,i=[];++e<n;)i[e]=0;return i}function Wr(t){for(var e,n=1,i=0,o=t[0][1],r=t.length;n<r;++n)(e=t[n][1])>o&&(i=n,o=e);return i}function qr(t){return t.reduce(Yr,0)}function Yr(t,e){return t+e[1]}function Xr(t,e){return Zr(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Zr(t,e){for(var n=-1,i=+t[0],o=(t[1]-i)/e,r=[];++n<=e;)r[n]=o*n+i;return r}function Qr(t){return[r.min(t),r.max(t)]}function Kr(t,e){return t.value-e.value}function $r(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function Jr(t,e){t._pack_next=e,e._pack_prev=t}function ta(t,e){var n=e.x-t.x,i=e.y-t.y,o=t.r+e.r;return.999*o*o>n*n+i*i}function ea(t){if((e=t.children)&&(l=e.length)){var e,n,i,o,r,a,s,l,u=1/0,c=-1/0,h=1/0,d=-1/0;if(e.forEach(na),(n=e[0]).x=-n.r,n.y=0,b(n),l>1&&((i=e[1]).x=i.r,i.y=0,b(i),l>2))for(oa(n,i,o=e[2]),b(o),$r(n,o),n._pack_prev=o,$r(o,i),i=n._pack_next,r=3;r<l;r++){oa(n,i,o=e[r]);var f=0,p=1,g=1;for(a=i._pack_next;a!==i;a=a._pack_next,p++)if(ta(a,o)){f=1;break}if(1==f)for(s=n._pack_prev;s!==a._pack_prev&&!ta(s,o);s=s._pack_prev,g++);f?(p<g||p==g&&i.r<n.r?Jr(n,i=a):Jr(n=s,i),r--):($r(n,o),i=o,b(o))}var m=(u+c)/2,v=(h+d)/2,y=0;for(r=0;r<l;r++)(o=e[r]).x-=m,o.y-=v,y=Math.max(y,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=y,e.forEach(ia)}function b(t){u=Math.min(t.x-t.r,u),c=Math.max(t.x+t.r,c),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}}function na(t){t._pack_next=t._pack_prev=t}function ia(t){delete t._pack_next,delete t._pack_prev}function oa(t,e,n){var i=t.r+n.r,o=e.x-t.x,r=e.y-t.y;if(i&&(o||r)){var a=e.r+n.r,s=o*o+r*r,l=.5+((i*=i)-(a*=a))/(2*s),u=Math.sqrt(Math.max(0,2*a*(i+s)-(i-=s)*i-a*a))/(2*s);n.x=t.x+l*o+u*r,n.y=t.y+l*r-u*o}else n.x=t.x+i,n.y=t.y}function ra(t,e){return t.parent==e.parent?1:2}function aa(t){var e=t.children;return e.length?e[0]:t.t}function sa(t){var e,n=t.children;return(e=n.length)?n[e-1]:t.t}function la(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function ua(t,e,n){return t.a.parent===e.parent?t.a:n}function ca(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function ha(t,e){var n=t.x+e[3],i=t.y+e[0],o=t.dx-e[1]-e[3],r=t.dy-e[0]-e[2];return o<0&&(n+=o/2,o=0),r<0&&(i+=r/2,r=0),{x:n,y:i,dx:o,dy:r}}function da(t){var e=t[0],n=t[t.length-1];return e<n?[e,n]:[n,e]}function fa(t){return t.rangeExtent?t.rangeExtent():da(t.range())}function pa(t,e,n,i){var o=n(t[0],t[1]),r=i(e[0],e[1]);return function(t){return r(o(t))}}function ga(t,e){var n,i=0,o=t.length-1,r=t[i],a=t[o];return a<r&&(n=i,i=o,o=n,n=r,r=a,a=n),t[i]=e.floor(r),t[o]=e.ceil(a),t}function ma(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:va}r.layout.histogram=function(){var t=!0,e=Number,n=Qr,i=Xr;function o(o,a){for(var s,l,u=[],c=o.map(e,this),h=n.call(this,c,a),d=i.call(this,h,c,a),f=(a=-1,c.length),p=d.length-1,g=t?1:1/f;++a<p;)(s=u[a]=[]).dx=d[a+1]-(s.x=d[a]),s.y=0;if(p>0)for(a=-1;++a<f;)(l=c[a])>=h[0]&&l<=h[1]&&((s=u[r.bisect(d,l,1,p)-1]).y+=g,s.push(o[a]));return u}return o.value=function(t){return arguments.length?(e=t,o):e},o.range=function(t){return arguments.length?(n=we(t),o):n},o.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return Zr(e,t)}:we(t),o):i},o.frequency=function(e){return arguments.length?(t=!!e,o):t},o},r.layout.pack=function(){var t,e=r.layout.hierarchy().sort(Kr),n=0,i=[1,1];function o(o,r){var a=e.call(this,o,r),s=a[0],l=i[0],u=i[1],c=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,Or(s,function(t){t.r=+c(t.value)}),Or(s,ea),n){var h=n*(t?1:Math.max(2*s.r/l,2*s.r/u))/2;Or(s,function(t){t.r+=h}),Or(s,ea),Or(s,function(t){t.r-=h})}return function t(e,n,i,o){var r=e.children;e.x=n+=o*e.x;e.y=i+=o*e.y;e.r*=o;if(r)for(var a=-1,s=r.length;++a<s;)t(r[a],n,i,o)}(s,l/2,u/2,t?1:1/Math.max(2*s.r/l,2*s.r/u)),a}return o.size=function(t){return arguments.length?(i=t,o):i},o.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,o):t},o.padding=function(t){return arguments.length?(n=+t,o):n},Ar(o,e)},r.layout.tree=function(){var t=r.layout.hierarchy().sort(null).value(null),e=ra,n=[1,1],i=null;function o(o,r){var u=t.call(this,o,r),c=u[0],h=function(t){var e,n={A:null,children:[t]},i=[n];for(;null!=(e=i.pop());)for(var o,r=e.children,a=0,s=r.length;a<s;++a)i.push((r[a]=o={_:r[a],parent:e,children:(o=r[a].children)&&o.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=o);return n.children[0]}(c);if(Or(h,a),h.parent.m=-h.z,kr(h,s),i)kr(c,l);else{var d=c,f=c,p=c;kr(c,function(t){t.x<d.x&&(d=t),t.x>f.x&&(f=t),t.depth>p.depth&&(p=t)});var g=e(d,f)/2-d.x,m=n[0]/(f.x+e(f,d)/2+g),v=n[1]/(p.depth||1);kr(c,function(t){t.x=(t.x+g)*m,t.y=t.depth*v})}return u}function a(t){var n=t.children,i=t.parent.children,o=t.i?i[t.i-1]:null;if(n.length){!function(t){var e,n=0,i=0,o=t.children,r=o.length;for(;--r>=0;)(e=o[r]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(t);var r=(n[0].z+n[n.length-1].z)/2;o?(t.z=o.z+e(t._,o._),t.m=t.z-r):t.z=r}else o&&(t.z=o.z+e(t._,o._));t.parent.A=function(t,n,i){if(n){for(var o,r=t,a=t,s=n,l=r.parent.children[0],u=r.m,c=a.m,h=s.m,d=l.m;s=sa(s),r=aa(r),s&&r;)l=aa(l),(a=sa(a)).a=t,(o=s.z+h-r.z-u+e(s._,r._))>0&&(la(ua(s,t,i),t,o),u+=o,c+=o),h+=s.m,u+=r.m,d+=l.m,c+=a.m;s&&!sa(a)&&(a.t=s,a.m+=h-c),r&&!aa(l)&&(l.t=r,l.m+=u-d,i=t)}return i}(t,o,t.parent.A||i[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(t){return arguments.length?(i=null==(n=t)?l:null,o):i?null:n},o.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,o):i?n:null},Ar(o,t)},r.layout.cluster=function(){var t=r.layout.hierarchy().sort(null).value(null),e=ra,n=[1,1],i=!1;function o(o,a){var s,l=t.call(this,o,a),u=l[0],c=0;Or(u,function(t){var n=t.children;n&&n.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),t.y=function(t){return 1+r.max(t,function(t){return t.y})}(n)):(t.x=s?c+=e(t,s):0,t.y=0,s=t)});var h=function t(e){var n=e.children;return n&&n.length?t(n[0]):e}(u),d=function t(e){var n,i=e.children;return i&&(n=i.length)?t(i[n-1]):e}(u),f=h.x-e(h,d)/2,p=d.x+e(d,h)/2;return Or(u,i?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(p-f)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(t){return arguments.length?(i=null==(n=t),o):i?null:n},o.nodeSize=function(t){return arguments.length?(i=null!=(n=t),o):i?n:null},Ar(o,t)},r.layout.treemap=function(){var t,e=r.layout.hierarchy(),n=Math.round,i=[1,1],o=null,a=ca,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var n,i,o=-1,r=t.length;++o<r;)i=(n=t[o]).value*(e<0?0:e),n.area=isNaN(i)||i<=0?0:i}function h(t){var e=t.children;if(e&&e.length){var n,i,o,r=a(t),s=[],u=e.slice(),d=1/0,g="slice"===l?r.dx:"dice"===l?r.dy:"slice-dice"===l?1&t.depth?r.dy:r.dx:Math.min(r.dx,r.dy);for(c(u,r.dx*r.dy/t.value),s.area=0;(o=u.length)>0;)s.push(n=u[o-1]),s.area+=n.area,"squarify"!==l||(i=f(s,g))<=d?(u.pop(),d=i):(s.area-=s.pop().area,p(s,g,r,!1),g=Math.min(r.dx,r.dy),s.length=s.area=0,d=1/0);s.length&&(p(s,g,r,!0),s.length=s.area=0),e.forEach(h)}}function d(t){var e=t.children;if(e&&e.length){var n,i=a(t),o=e.slice(),r=[];for(c(o,i.dx*i.dy/t.value),r.area=0;n=o.pop();)r.push(n),r.area+=n.area,null!=n.z&&(p(r,n.z?i.dx:i.dy,i,!o.length),r.length=r.area=0);e.forEach(d)}}function f(t,e){for(var n,i=t.area,o=0,r=1/0,a=-1,s=t.length;++a<s;)(n=t[a].area)&&(n<r&&(r=n),n>o&&(o=n));return e*=e,(i*=i)?Math.max(e*o*u/i,i/(e*r*u)):1/0}function p(t,e,i,o){var r,a=-1,s=t.length,l=i.x,u=i.y,c=e?n(t.area/e):0;if(e==i.dx){for((o||c>i.dy)&&(c=i.dy);++a<s;)(r=t[a]).x=l,r.y=u,r.dy=c,l+=r.dx=Math.min(i.x+i.dx-l,c?n(r.area/c):0);r.z=!0,r.dx+=i.x+i.dx-l,i.y+=c,i.dy-=c}else{for((o||c>i.dx)&&(c=i.dx);++a<s;)(r=t[a]).x=l,r.y=u,r.dx=c,u+=r.dy=Math.min(i.y+i.dy-u,c?n(r.area/c):0);r.z=!1,r.dy+=i.y+i.dy-u,i.x+=c,i.dx-=c}}function g(n){var o=t||e(n),r=o[0];return r.x=r.y=0,r.value?(r.dx=i[0],r.dy=i[1]):r.dx=r.dy=0,t&&e.revalue(r),c([r],r.dx*r.dy/r.value),(t?d:h)(r),s&&(t=o),o}return g.size=function(t){return arguments.length?(i=t,g):i},g.padding=function(t){if(!arguments.length)return o;function e(e){return ha(e,t)}var n;return a=null==(o=t)?ca:"function"==(n=typeof t)?function(e){var n=t.call(g,e,e.depth);return null==n?ca(e):ha(e,"number"==typeof n?[n,n,n,n]:n)}:"number"===n?(t=[t,t,t,t],e):e,g},g.round=function(t){return arguments.length?(n=t?Math.round:Number,g):n!=Number},g.sticky=function(e){return arguments.length?(s=e,t=null,g):s},g.ratio=function(t){return arguments.length?(u=t,g):u},g.mode=function(t){return arguments.length?(l=t+"",g):l},Ar(g,e)},r.random={normal:function(t,e){var n=arguments.length;return n<2&&(e=1),n<1&&(t=0),function(){var n,i,o;do{o=(n=2*Math.random()-1)*n+(i=2*Math.random()-1)*i}while(!o||o>1);return t+e*n*Math.sqrt(-2*Math.log(o)/o)}},logNormal:function(){var t=r.random.normal.apply(r,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=r.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;n<t;n++)e+=Math.random();return e}}},r.scale={};var va={floor:j,ceil:j};function ya(t,e,n,i){var o=[],a=[],s=0,l=Math.min(t.length,e.length)-1;for(t[l]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<=l;)o.push(n(t[s-1],t[s])),a.push(i(e[s-1],e[s]));return function(e){var n=r.bisect(t,e,1,l)-1;return a[n](o[n](e))}}function ba(t,e){return r.rebind(t,e,"range","rangeRound","interpolate","clamp")}function wa(t,e){return ga(t,ma(_a(t,e)[2])),ga(t,ma(_a(t,e)[2])),t}function _a(t,e){null==e&&(e=10);var n=da(t),i=n[1]-n[0],o=Math.pow(10,Math.floor(Math.log(i/e)/Math.LN10)),r=e/i*o;return r<=.15?o*=10:r<=.35?o*=5:r<=.75&&(o*=2),n[0]=Math.ceil(n[0]/o)*o,n[1]=Math.floor(n[1]/o)*o+.5*o,n[2]=o,n}function xa(t,e){return r.range.apply(r,_a(t,e))}function Sa(t,e,n){var i=_a(t,e);if(n){var o=De.exec(n);if(o.shift(),"s"===o[8]){var a=r.formatPrefix(Math.max(x(i[0]),x(i[1])));return o[7]||(o[7]="."+Ca(a.scale(i[2]))),o[8]="f",n=r.format(o.join("")),function(t){return n(a.scale(t))+a.symbol}}o[7]||(o[7]="."+function(t,e){var n=Ca(e[2]);return t in Ea?Math.abs(n-Ca(Math.max(x(e[0]),x(e[1]))))+ +("e"!==t):n-2*("%"===t)}(o[8],i)),n=o.join("")}else n=",."+Ca(i[2])+"f";return r.format(n)}r.scale.linear=function(){return function t(e,n,i,o){var r,a;function s(){var t=Math.min(e.length,n.length)>2?ya:pa,s=o?wr:br;return r=t(e,n,s,i),a=t(n,e,s,$o),l}function l(t){return r(t)}l.invert=function(t){return a(t)};l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e};l.range=function(t){return arguments.length?(n=t,s()):n};l.rangeRound=function(t){return l.range(t).interpolate(dr)};l.clamp=function(t){return arguments.length?(o=t,s()):o};l.interpolate=function(t){return arguments.length?(i=t,s()):i};l.ticks=function(t){return xa(e,t)};l.tickFormat=function(t,n){return Sa(e,t,n)};l.nice=function(t){return wa(e,t),s()};l.copy=function(){return t(e,n,i,o)};return s()}([0,1],[0,1],$o,!1)};var Ea={s:1,g:1,p:1,r:1,e:1};function Ca(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}r.scale.log=function(){return function t(e,n,i,o){function a(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return e(a(t))}l.invert=function(t){return s(e.invert(t))};l.domain=function(t){return arguments.length?(i=t[0]>=0,e.domain((o=t.map(Number)).map(a)),l):o};l.base=function(t){return arguments.length?(n=+t,e.domain(o.map(a)),l):n};l.nice=function(){var t=ga(o.map(a),i?Math:Ma);return e.domain(t),o=t.map(s),l};l.ticks=function(){var t=da(o),e=[],r=t[0],l=t[1],u=Math.floor(a(r)),c=Math.ceil(a(l)),h=n%1?2:n;if(isFinite(c-u)){if(i){for(;u<c;u++)for(var d=1;d<h;d++)e.push(s(u)*d);e.push(s(u))}else for(e.push(s(u));u++<c;)for(var d=h-1;d>0;d--)e.push(s(u)*d);for(u=0;e[u]<r;u++);for(c=e.length;e[c-1]>l;c--);e=e.slice(u,c)}return e};l.tickFormat=function(t,e){if(!arguments.length)return Ta;arguments.length<2?e=Ta:"function"!=typeof e&&(e=r.format(e));var i=Math.max(1,n*t/l.ticks().length);return function(t){var o=t/s(Math.round(a(t)));return o*n<n-.5&&(o*=n),o<=i?e(t):""}};l.copy=function(){return t(e.copy(),n,i,o)};return ba(l,e)}(r.scale.linear().domain([0,1]),10,!0,[1,10])};var Ta=r.format(".0e"),Ma={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Pa(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}r.scale.pow=function(){return function t(e,n,i){var o=Pa(n),r=Pa(1/n);function a(t){return e(o(t))}a.invert=function(t){return r(e.invert(t))};a.domain=function(t){return arguments.length?(e.domain((i=t.map(Number)).map(o)),a):i};a.ticks=function(t){return xa(i,t)};a.tickFormat=function(t,e){return Sa(i,t,e)};a.nice=function(t){return a.domain(wa(i,t))};a.exponent=function(t){return arguments.length?(o=Pa(n=t),r=Pa(1/n),e.domain(i.map(o)),a):n};a.copy=function(){return t(e.copy(),n,i)};return ba(a,e)}(r.scale.linear(),1,[0,1])},r.scale.sqrt=function(){return r.scale.pow().exponent(.5)},r.scale.ordinal=function(){return function t(e,n){var i,o,a;function s(t){return o[((i.get(t)||("range"===n.t?i.set(t,e.push(t)):NaN))-1)%o.length]}function l(t,n){return r.range(e.length).map(function(e){return t+n*e})}s.domain=function(t){if(!arguments.length)return e;e=[],i=new E;for(var o,r=-1,a=t.length;++r<a;)i.has(o=t[r])||i.set(o,e.push(o));return s[n.t].apply(s,n.a)};s.range=function(t){return arguments.length?(o=t,a=0,n={t:"range",a:arguments},s):o};s.rangePoints=function(t,i){arguments.length<2&&(i=0);var r=t[0],u=t[1],c=e.length<2?(r=(r+u)/2,0):(u-r)/(e.length-1+i);return o=l(r+c*i/2,c),a=0,n={t:"rangePoints",a:arguments},s};s.rangeRoundPoints=function(t,i){arguments.length<2&&(i=0);var r=t[0],u=t[1],c=e.length<2?(r=u=Math.round((r+u)/2),0):(u-r)/(e.length-1+i)|0;return o=l(r+Math.round(c*i/2+(u-r-(e.length-1+i)*c)/2),c),a=0,n={t:"rangeRoundPoints",a:arguments},s};s.rangeBands=function(t,i,r){arguments.length<2&&(i=0),arguments.length<3&&(r=i);var u=t[1]<t[0],c=t[u-0],h=t[1-u],d=(h-c)/(e.length-i+2*r);return o=l(c+d*r,d),u&&o.reverse(),a=d*(1-i),n={t:"rangeBands",a:arguments},s};s.rangeRoundBands=function(t,i,r){arguments.length<2&&(i=0),arguments.length<3&&(r=i);var u=t[1]<t[0],c=t[u-0],h=t[1-u],d=Math.floor((h-c)/(e.length-i+2*r));return o=l(c+Math.round((h-c-(e.length-i)*d)/2),d),u&&o.reverse(),a=Math.round(d*(1-i)),n={t:"rangeRoundBands",a:arguments},s};s.rangeBand=function(){return a};s.rangeExtent=function(){return da(n.a[0])};s.copy=function(){return t(e,n)};return s.domain(e)}([],{t:"range",a:[[]]})},r.scale.category10=function(){return r.scale.ordinal().range(La)},r.scale.category20=function(){return r.scale.ordinal().range(Aa)},r.scale.category20b=function(){return r.scale.ordinal().range(ka)},r.scale.category20c=function(){return r.scale.ordinal().range(Oa)};var La=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(he),Aa=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(he),ka=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(he),Oa=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(he);function Ra(){return 0}r.scale.quantile=function(){return function t(e,n){var i;function o(){var t=0,o=n.length;for(i=[];++t<o;)i[t-1]=r.quantile(e,t/o);return a}function a(t){if(!isNaN(t=+t))return n[r.bisect(i,t)]}a.domain=function(t){return arguments.length?(e=t.map(v).filter(y).sort(m),o()):e};a.range=function(t){return arguments.length?(n=t,o()):n};a.quantiles=function(){return i};a.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?i[t-1]:e[0],t<i.length?i[t]:e[e.length-1]]};a.copy=function(){return t(e,n)};return o()}([],[])},r.scale.quantize=function(){return function t(e,n,i){var o,r;function a(t){return i[Math.max(0,Math.min(r,Math.floor(o*(t-e))))]}function s(){return o=i.length/(n-e),r=i.length-1,a}a.domain=function(t){return arguments.length?(e=+t[0],n=+t[t.length-1],s()):[e,n]};a.range=function(t){return arguments.length?(i=t,s()):i};a.invertExtent=function(t){return[t=(t=i.indexOf(t))<0?NaN:t/o+e,t+1/o]};a.copy=function(){return t(e,n,i)};return s()}(0,1,[0,1])},r.scale.threshold=function(){return function t(e,n){function i(t){if(t<=t)return n[r.bisect(e,t)]}i.domain=function(t){return arguments.length?(e=t,i):e};i.range=function(t){return arguments.length?(n=t,i):n};i.invertExtent=function(t){return t=n.indexOf(t),[e[t-1],e[t]]};i.copy=function(){return t(e,n)};return i}([.5],[0,1])},r.scale.identity=function(){return function t(e){function n(t){return+t}n.invert=n;n.domain=n.range=function(t){return arguments.length?(e=t.map(n),n):e};n.ticks=function(t){return xa(e,t)};n.tickFormat=function(t,n){return Sa(e,t,n)};n.copy=function(){return t(e)};return n}([0,1])},r.svg={},r.svg.arc=function(){var t=ja,e=za,n=Ra,i=Da,o=Na,r=Ia,a=Fa;function s(){var s=Math.max(0,+t.apply(this,arguments)),u=Math.max(0,+e.apply(this,arguments)),c=o.apply(this,arguments)-Ot,h=r.apply(this,arguments)-Ot,d=Math.abs(h-c),f=c>h?0:1;if(u<s&&(p=u,u=s,s=p),d>=kt)return l(u,f)+(s?l(s,1-f):"")+"Z";var p,g,m,v,y,b,w,_,x,S,E,C,T=0,M=0,P=[];if((v=(+a.apply(this,arguments)||0)/2)&&(m=i===Da?Math.sqrt(s*s+u*u):+i.apply(this,arguments),f||(M*=-1),u&&(M=It(m/u*Math.sin(v))),s&&(T=It(m/s*Math.sin(v)))),u){y=u*Math.cos(c+M),b=u*Math.sin(c+M),w=u*Math.cos(h-M),_=u*Math.sin(h-M);var L=Math.abs(h-c-2*M)<=Lt?0:1;if(M&&Ha(y,b,w,_)===f^L){var A=(c+h)/2;y=u*Math.cos(A),b=u*Math.sin(A),w=_=null}}else y=b=0;if(s){x=s*Math.cos(h-T),S=s*Math.sin(h-T),E=s*Math.cos(c+T),C=s*Math.sin(c+T);var k=Math.abs(c-h+2*T)<=Lt?0:1;if(T&&Ha(x,S,E,C)===1-f^k){var O=(c+h)/2;x=s*Math.cos(O),S=s*Math.sin(O),E=C=null}}else x=S=0;if(d>Mt&&(p=Math.min(Math.abs(u-s)/2,+n.apply(this,arguments)))>.001){g=s<u^f?0:1;var R=p,D=p;if(d<Lt){var j=null==E?[x,S]:null==w?[y,b]:uo([y,b],[E,C],[w,_],[x,S]),z=y-j[0],N=b-j[1],I=w-j[0],F=_-j[1],H=1/Math.sin(Math.acos((z*I+N*F)/(Math.sqrt(z*z+N*N)*Math.sqrt(I*I+F*F)))/2),G=Math.sqrt(j[0]*j[0]+j[1]*j[1]);D=Math.min(p,(s-G)/(H-1)),R=Math.min(p,(u-G)/(H+1))}if(null!=w){var V=Ga(null==E?[x,S]:[E,C],[y,b],u,R,f),B=Ga([w,_],[x,S],u,R,f);p===R?P.push("M",V[0],"A",R,",",R," 0 0,",g," ",V[1],"A",u,",",u," 0 ",1-f^Ha(V[1][0],V[1][1],B[1][0],B[1][1]),",",f," ",B[1],"A",R,",",R," 0 0,",g," ",B[0]):P.push("M",V[0],"A",R,",",R," 0 1,",g," ",B[0])}else P.push("M",y,",",b);if(null!=E){var U=Ga([y,b],[E,C],s,-D,f),W=Ga([x,S],null==w?[y,b]:[w,_],s,-D,f);p===D?P.push("L",W[0],"A",D,",",D," 0 0,",g," ",W[1],"A",s,",",s," 0 ",f^Ha(W[1][0],W[1][1],U[1][0],U[1][1]),",",1-f," ",U[1],"A",D,",",D," 0 0,",g," ",U[0]):P.push("L",W[0],"A",D,",",D," 0 0,",g," ",U[0])}else P.push("L",x,",",S)}else P.push("M",y,",",b),null!=w&&P.push("A",u,",",u," 0 ",L,",",f," ",w,",",_),P.push("L",x,",",S),null!=E&&P.push("A",s,",",s," 0 ",k,",",1-f," ",E,",",C);return P.push("Z"),P.join("")}function l(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return s.innerRadius=function(e){return arguments.length?(t=we(e),s):t},s.outerRadius=function(t){return arguments.length?(e=we(t),s):e},s.cornerRadius=function(t){return arguments.length?(n=we(t),s):n},s.padRadius=function(t){return arguments.length?(i=t==Da?Da:we(t),s):i},s.startAngle=function(t){return arguments.length?(o=we(t),s):o},s.endAngle=function(t){return arguments.length?(r=we(t),s):r},s.padAngle=function(t){return arguments.length?(a=we(t),s):a},s.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+o.apply(this,arguments)+ +r.apply(this,arguments))/2-Ot;return[Math.cos(i)*n,Math.sin(i)*n]},s};var Da="auto";function ja(t){return t.innerRadius}function za(t){return t.outerRadius}function Na(t){return t.startAngle}function Ia(t){return t.endAngle}function Fa(t){return t&&t.padAngle}function Ha(t,e,n,i){return(t-n)*e-(e-i)*t>0?0:1}function Ga(t,e,n,i,o){var r=t[0]-e[0],a=t[1]-e[1],s=(o?i:-i)/Math.sqrt(r*r+a*a),l=s*a,u=-s*r,c=t[0]+l,h=t[1]+u,d=e[0]+l,f=e[1]+u,p=(c+d)/2,g=(h+f)/2,m=d-c,v=f-h,y=m*m+v*v,b=n-i,w=c*f-d*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-w*w)),x=(w*v-m*_)/y,S=(-w*m-v*_)/y,E=(w*v+m*_)/y,C=(-w*m+v*_)/y,T=x-p,M=S-g,P=E-p,L=C-g;return T*T+M*M>P*P+L*L&&(x=E,S=C),[[x-l,S-u],[x*n/b,S*n/b]]}function Va(t){var e=io,n=oo,i=Kn,o=Ua,r=o.key,a=.7;function s(r){var s,l=[],u=[],c=-1,h=r.length,d=we(e),f=we(n);function p(){l.push("M",o(t(u),a))}for(;++c<h;)i.call(this,s=r[c],c)?u.push([+d.call(this,s,c),+f.call(this,s,c)]):u.length&&(p(),u=[]);return u.length&&p(),l.length?l.join(""):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(n=t,s):n},s.defined=function(t){return arguments.length?(i=t,s):i},s.interpolate=function(t){return arguments.length?(r="function"==typeof t?o=t:(o=Ba.get(t)||Ua).key,s):r},s.tension=function(t){return arguments.length?(a=t,s):a},s}r.svg.line=function(){return Va(j)};var Ba=r.map({linear:Ua,"linear-closed":Wa,step:function(t){var e=0,n=t.length,i=t[0],o=[i[0],",",i[1]];for(;++e<n;)o.push("H",(i[0]+(i=t[e])[0])/2,"V",i[1]);n>1&&o.push("H",i[0]);return o.join("")},"step-before":qa,"step-after":Ya,basis:Qa,"basis-open":function(t){if(t.length<4)return Ua(t);var e,n=[],i=-1,o=t.length,r=[0],a=[0];for(;++i<3;)e=t[i],r.push(e[0]),a.push(e[1]);n.push(Ka(ts,r)+","+Ka(ts,a)),--i;for(;++i<o;)e=t[i],r.shift(),r.push(e[0]),a.shift(),a.push(e[1]),es(n,r,a);return n.join("")},"basis-closed":function(t){var e,n,i=-1,o=t.length,r=o+4,a=[],s=[];for(;++i<4;)n=t[i%o],a.push(n[0]),s.push(n[1]);e=[Ka(ts,a),",",Ka(ts,s)],--i;for(;++i<r;)n=t[i%o],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),es(e,a,s);return e.join("")},bundle:function(t,e){var n=t.length-1;if(n)for(var i,o,r=t[0][0],a=t[0][1],s=t[n][0]-r,l=t[n][1]-a,u=-1;++u<=n;)i=t[u],o=u/n,i[0]=e*i[0]+(1-e)*(r+o*s),i[1]=e*i[1]+(1-e)*(a+o*l);return Qa(t)},cardinal:function(t,e){return t.length<3?Ua(t):t[0]+Xa(t,Za(t,e))},"cardinal-open":function(t,e){return t.length<4?Ua(t):t[1]+Xa(t.slice(1,-1),Za(t,e))},"cardinal-closed":function(t,e){return t.length<3?Wa(t):t[0]+Xa((t.push(t[0]),t),Za([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Ua(t):t[0]+Xa(t,function(t){var e,n,i,o,r=[],a=function(t){var e=0,n=t.length-1,i=[],o=t[0],r=t[1],a=i[0]=ns(o,r);for(;++e<n;)i[e]=(a+(a=ns(o=r,r=t[e+1])))/2;return i[e]=a,i}(t),s=-1,l=t.length-1;for(;++s<l;)e=ns(t[s],t[s+1]),x(e)<Mt?a[s]=a[s+1]=0:(n=a[s]/e,i=a[s+1]/e,(o=n*n+i*i)>9&&(o=3*e/Math.sqrt(o),a[s]=o*n,a[s+1]=o*i));s=-1;for(;++s<=l;)o=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),r.push([o||0,a[s]*o||0]);return r}(t))}});function Ua(t){return t.length>1?t.join("L"):t+"Z"}function Wa(t){return t.join("L")+"Z"}function qa(t){for(var e=0,n=t.length,i=t[0],o=[i[0],",",i[1]];++e<n;)o.push("V",(i=t[e])[1],"H",i[0]);return o.join("")}function Ya(t){for(var e=0,n=t.length,i=t[0],o=[i[0],",",i[1]];++e<n;)o.push("H",(i=t[e])[0],"V",i[1]);return o.join("")}function Xa(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Ua(t);var n=t.length!=e.length,i="",o=t[0],r=t[1],a=e[0],s=a,l=1;if(n&&(i+="Q"+(r[0]-2*a[0]/3)+","+(r[1]-2*a[1]/3)+","+r[0]+","+r[1],o=t[1],l=2),e.length>1){s=e[1],r=t[l],l++,i+="C"+(o[0]+a[0])+","+(o[1]+a[1])+","+(r[0]-s[0])+","+(r[1]-s[1])+","+r[0]+","+r[1];for(var u=2;u<e.length;u++,l++)r=t[l],s=e[u],i+="S"+(r[0]-s[0])+","+(r[1]-s[1])+","+r[0]+","+r[1]}if(n){var c=t[l];i+="Q"+(r[0]+2*s[0]/3)+","+(r[1]+2*s[1]/3)+","+c[0]+","+c[1]}return i}function Za(t,e){for(var n,i=[],o=(1-e)/2,r=t[0],a=t[1],s=1,l=t.length;++s<l;)n=r,r=a,a=t[s],i.push([o*(a[0]-n[0]),o*(a[1]-n[1])]);return i}function Qa(t){if(t.length<3)return Ua(t);var e=1,n=t.length,i=t[0],o=i[0],r=i[1],a=[o,o,o,(i=t[1])[0]],s=[r,r,r,i[1]],l=[o,",",r,"L",Ka(ts,a),",",Ka(ts,s)];for(t.push(t[n-1]);++e<=n;)i=t[e],a.shift(),a.push(i[0]),s.shift(),s.push(i[1]),es(l,a,s);return t.pop(),l.push("L",i),l.join("")}function Ka(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Ba.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var $a=[0,2/3,1/3,0],Ja=[0,1/3,2/3,0],ts=[0,1/6,2/3,1/6];function es(t,e,n){t.push("C",Ka($a,e),",",Ka($a,n),",",Ka(Ja,e),",",Ka(Ja,n),",",Ka(ts,e),",",Ka(ts,n))}function ns(t,e){return(e[1]-t[1])/(e[0]-t[0])}function is(t){for(var e,n,i,o=-1,r=t.length;++o<r;)n=(e=t[o])[0],i=e[1]-Ot,e[0]=n*Math.cos(i),e[1]=n*Math.sin(i);return t}function os(t){var e=io,n=io,i=0,o=oo,r=Kn,a=Ua,s=a.key,l=a,u="L",c=.7;function h(s){var h,d,f,p=[],g=[],m=[],v=-1,y=s.length,b=we(e),w=we(i),_=e===n?function(){return d}:we(n),x=i===o?function(){return f}:we(o);function S(){p.push("M",a(t(m),c),u,l(t(g.reverse()),c),"Z")}for(;++v<y;)r.call(this,h=s[v],v)?(g.push([d=+b.call(this,h,v),f=+w.call(this,h,v)]),m.push([+_.call(this,h,v),+x.call(this,h,v)])):g.length&&(S(),g=[],m=[]);return g.length&&S(),p.length?p.join(""):null}return h.x=function(t){return arguments.length?(e=n=t,h):n},h.x0=function(t){return arguments.length?(e=t,h):e},h.x1=function(t){return arguments.length?(n=t,h):n},h.y=function(t){return arguments.length?(i=o=t,h):o},h.y0=function(t){return arguments.length?(i=t,h):i},h.y1=function(t){return arguments.length?(o=t,h):o},h.defined=function(t){return arguments.length?(r=t,h):r},h.interpolate=function(t){return arguments.length?(s="function"==typeof t?a=t:(a=Ba.get(t)||Ua).key,l=a.reverse||a,u=a.closed?"M":"L",h):s},h.tension=function(t){return arguments.length?(c=t,h):c},h}function rs(t){return t.radius}function as(t){return[t.x,t.y]}function ss(){return 64}function ls(){return"circle"}function us(t){var e=Math.sqrt(t/Lt);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}r.svg.line.radial=function(){var t=Va(is);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},qa.reverse=Ya,Ya.reverse=qa,r.svg.area=function(){return os(j)},r.svg.area.radial=function(){var t=os(is);return 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,t},r.svg.chord=function(){var t=Bi,e=Ui,n=rs,i=Na,o=Ia;function r(n,i){var o=a(this,t,n,i),r=a(this,e,n,i);return"M"+o.p0+s(o.r,o.p1,o.a1-o.a0)+(function(t,e){return t.a0==e.a0&&t.a1==e.a1}(o,r)?l(o.r,o.p1,o.r,o.p0):l(o.r,o.p1,r.r,r.p0)+s(r.r,r.p1,r.a1-r.a0)+l(r.r,r.p1,o.r,o.p0))+"Z"}function a(t,e,r,a){var s=e.call(t,r,a),l=n.call(t,s,a),u=i.call(t,s,a)-Ot,c=o.call(t,s,a)-Ot;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function s(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Lt)+",1 "+e}function l(t,e,n,i){return"Q 0,0 "+i}return r.radius=function(t){return arguments.length?(n=we(t),r):n},r.source=function(e){return arguments.length?(t=we(e),r):t},r.target=function(t){return arguments.length?(e=we(t),r):e},r.startAngle=function(t){return arguments.length?(i=we(t),r):i},r.endAngle=function(t){return arguments.length?(o=we(t),r):o},r},r.svg.diagonal=function(){var t=Bi,e=Ui,n=as;function i(i,o){var r=t.call(this,i,o),a=e.call(this,i,o),s=(r.y+a.y)/2,l=[r,{x:r.x,y:s},{x:a.x,y:s},a];return"M"+(l=l.map(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return i.source=function(e){return arguments.length?(t=we(e),i):t},i.target=function(t){return arguments.length?(e=we(t),i):e},i.projection=function(t){return arguments.length?(n=t,i):n},i},r.svg.diagonal.radial=function(){var t=r.svg.diagonal(),e=as,n=t.projection;return t.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),n=e[0],i=e[1]-Ot;return[n*Math.cos(i),n*Math.sin(i)]}}(e=t)):e},t},r.svg.symbol=function(){var t=ls,e=ss;function n(n,i){return(cs.get(t.call(this,n,i))||us)(e.call(this,n,i))}return n.type=function(e){return arguments.length?(t=we(e),n):t},n.size=function(t){return arguments.length?(e=we(t),n):e},n};var cs=r.map({circle:us,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*ds)),n=e*ds;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/hs),n=e*hs/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/hs),n=e*hs/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});r.svg.symbolTypes=cs.keys();var hs=Math.sqrt(3),ds=Math.tan(30*Rt);K.transition=function(t){for(var e,n,i=ms||++bs,o=xs(t),r=[],a=vs||{time:Date.now(),ease:sr,delay:0,duration:250},s=-1,l=this.length;++s<l;){r.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(n=u[c])&&Ss(n,c,o,i,a),e.push(n)}return gs(r,o,i)},K.interrupt=function(t){return this.each(null==t?fs:ps(xs(t)))};var fs=ps(xs());function ps(t){return function(){var e,n,i;(e=this[t])&&(i=e[n=e.active])&&(i.timer.c=null,i.timer.t=NaN,--e.count?delete e[n]:delete this[t],e.active+=.5,i.event&&i.event.interrupt.call(this,this.__data__,i.index))}}function gs(t,e,n){return q(t,ys),t.namespace=e,t.id=n,t}var ms,vs,ys=[],bs=0;function ws(t,e,n,i){var o=t.id,r=t.namespace;return pt(t,"function"==typeof n?function(t,a,s){t[r][o].tween.set(e,i(n.call(t,t.__data__,a,s)))}:(n=i(n),function(t){t[r][o].tween.set(e,n)}))}function _s(t){return null==t&&(t=""),function(){this.textContent=t}}function xs(t){return null==t?"__transition__":"__transition_"+t+"__"}function Ss(t,e,n,i,o){var r,a,s,l,u,c=t[n]||(t[n]={active:0,count:0}),h=c[i];function d(n){var o=c.active,d=c[o];for(var p in d&&(d.timer.c=null,d.timer.t=NaN,--c.count,delete c[o],d.event&&d.event.interrupt.call(t,t.__data__,d.index)),c)if(+p<i){var g=c[p];g.timer.c=null,g.timer.t=NaN,--c.count,delete c[p]}a.c=f,Pe(function(){return a.c&&f(n||1)&&(a.c=null,a.t=NaN),1},0,r),c.active=i,h.event&&h.event.start.call(t,t.__data__,e),u=[],h.tween.forEach(function(n,i){(i=i.call(t,t.__data__,e))&&u.push(i)}),l=h.ease,s=h.duration}function f(o){for(var r=o/s,a=l(r),d=u.length;d>0;)u[--d].call(t,a);if(r>=1)return h.event&&h.event.end.call(t,t.__data__,e),--c.count?delete c[i]:delete t[n],1}h||(r=o.time,a=Pe(function(t){var e=h.delay;if(a.t=e+r,e<=t)return d(t-e);a.c=d},0,r),h=c[i]={tween:new E,time:r,timer:a,delay:o.delay,duration:o.duration,ease:o.ease,index:e},o=null,++c.count)}ys.call=K.call,ys.empty=K.empty,ys.node=K.node,ys.size=K.size,r.transition=function(t,e){return t&&t.transition?ms?t.transition(e):t:r.selection().transition(t)},r.transition.prototype=ys,ys.select=function(t){var e,n,i,o=this.id,r=this.namespace,a=[];t=$(t);for(var s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(i=u[c])&&(n=t.call(i,i.__data__,c,s))?("__data__"in i&&(n.__data__=i.__data__),Ss(n,c,r,o,i[r][o]),e.push(n)):e.push(null)}return gs(a,r,o)},ys.selectAll=function(t){var e,n,i,o,r,a=this.id,s=this.namespace,l=[];t=J(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],d=-1,f=h.length;++d<f;)if(i=h[d]){r=i[s][a],n=t.call(i,i.__data__,d,u),l.push(e=[]);for(var p=-1,g=n.length;++p<g;)(o=n[p])&&Ss(o,p,s,a,r),e.push(o)}return gs(l,s,a)},ys.filter=function(t){var e,n,i=[];"function"!=typeof t&&(t=ft(t));for(var o=0,r=this.length;o<r;o++){i.push(e=[]);for(var a,s=0,l=(a=this[o]).length;s<l;s++)(n=a[s])&&t.call(n,n.__data__,s,o)&&e.push(n)}return gs(i,this.namespace,this.id)},ys.tween=function(t,e){var n=this.id,i=this.namespace;return arguments.length<2?this.node()[i][n].tween.get(t):pt(this,null==e?function(e){e[i][n].tween.remove(t)}:function(o){o[i][n].tween.set(t,e)})},ys.attr=function(t,e){if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var n="transform"==t?yr:$o,i=r.ns.qualify(t);function o(){this.removeAttribute(i)}function a(){this.removeAttributeNS(i.space,i.local)}return ws(this,"attr."+t,e,i.local?function(t){return null==t?a:(t+="",function(){var e,o=this.getAttributeNS(i.space,i.local);return o!==t&&(e=n(o,t),function(t){this.setAttributeNS(i.space,i.local,e(t))})})}:function(t){return null==t?o:(t+="",function(){var e,o=this.getAttribute(i);return o!==t&&(e=n(o,t),function(t){this.setAttribute(i,e(t))})})})},ys.attrTween=function(t,e){var n=r.ns.qualify(t);return this.tween("attr."+t,n.local?function(t,i){var o=e.call(this,t,i,this.getAttributeNS(n.space,n.local));return o&&function(t){this.setAttributeNS(n.space,n.local,o(t))}}:function(t,i){var o=e.call(this,t,i,this.getAttribute(n));return o&&function(t){this.setAttribute(n,o(t))}})},ys.style=function(t,e,n){var i=arguments.length;if(i<3){if("string"!=typeof t){for(n in i<2&&(e=""),t)this.style(n,t[n],e);return this}n=""}function o(){this.style.removeProperty(t)}return ws(this,"style."+t,e,function(e){return null==e?o:(e+="",function(){var i,o=c(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=$o(o,e),function(e){this.style.setProperty(t,i(e),n)})})})},ys.styleTween=function(t,e,n){return arguments.length<3&&(n=""),this.tween("style."+t,function(i,o){var r=e.call(this,i,o,c(this).getComputedStyle(this,null).getPropertyValue(t));return r&&function(e){this.style.setProperty(t,r(e),n)}})},ys.text=function(t){return ws(this,"text",t,_s)},ys.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},ys.ease=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].ease:("function"!=typeof t&&(t=r.ease.apply(r,arguments)),pt(this,function(i){i[n][e].ease=t}))},ys.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:pt(this,"function"==typeof t?function(i,o,r){i[n][e].delay=+t.call(i,i.__data__,o,r)}:(t=+t,function(i){i[n][e].delay=t}))},ys.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:pt(this,"function"==typeof t?function(i,o,r){i[n][e].duration=Math.max(1,t.call(i,i.__data__,o,r))}:(t=Math.max(1,t),function(i){i[n][e].duration=t}))},ys.each=function(t,e){var n=this.id,i=this.namespace;if(arguments.length<2){var o=vs,a=ms;try{ms=n,pt(this,function(e,o,r){vs=e[i][n],t.call(e,e.__data__,o,r)})}finally{vs=o,ms=a}}else pt(this,function(o){var a=o[i][n];(a.event||(a.event=r.dispatch("start","end","interrupt"))).on(t,e)});return this},ys.transition=function(){for(var t,e,n,i=this.id,o=++bs,r=this.namespace,a=[],s=0,l=this.length;s<l;s++){a.push(t=[]);for(var u,c=0,h=(u=this[s]).length;c<h;c++)(e=u[c])&&Ss(e,c,r,o,{time:(n=e[r][i]).time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration}),t.push(e)}return gs(a,r,o)},r.svg.axis=function(){var t,e=r.scale.linear(),n=Es,i=6,o=6,a=3,l=[10],u=null;function c(s){s.each(function(){var s,c=r.select(this),h=this.__chart__||e,d=this.__chart__=e.copy(),f=null==u?d.ticks?d.ticks.apply(d,l):d.domain():u,p=null==t?d.tickFormat?d.tickFormat.apply(d,l):j:t,g=c.selectAll(".tick").data(f,d),m=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Mt),v=r.transition(g.exit()).style("opacity",Mt).remove(),y=r.transition(g.order()).style("opacity",1),b=Math.max(i,0)+a,w=fa(d),_=c.selectAll(".domain").data([0]),x=(_.enter().append("path").attr("class","domain"),r.transition(_));m.append("line"),m.append("text");var S,E,C,T,M=m.select("line"),P=y.select("line"),L=g.select("text").text(p),A=m.select("text"),k=y.select("text"),O="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(s=Ts,S="x",C="y",E="x2",T="y2",L.attr("dy",O<0?"0em":".71em").style("text-anchor","middle"),x.attr("d","M"+w[0]+","+O*o+"V0H"+w[1]+"V"+O*o)):(s=Ms,S="y",C="x",E="y2",T="x2",L.attr("dy",".32em").style("text-anchor",O<0?"end":"start"),x.attr("d","M"+O*o+","+w[0]+"H0V"+w[1]+"H"+O*o)),M.attr(T,O*i),A.attr(C,O*b),P.attr(E,0).attr(T,O*i),k.attr(S,0).attr(C,O*b),d.rangeBand){var R=d,D=R.rangeBand()/2;h=d=function(t){return R(t)+D}}else h.rangeBand?h=d:v.call(s,d,h);m.call(s,h,d),y.call(s,d,d)})}return c.scale=function(t){return arguments.length?(e=t,c):e},c.orient=function(t){return arguments.length?(n=t in Cs?t+"":Es,c):n},c.ticks=function(){return arguments.length?(l=s(arguments),c):l},c.tickValues=function(t){return arguments.length?(u=t,c):u},c.tickFormat=function(e){return arguments.length?(t=e,c):t},c.tickSize=function(t){var e=arguments.length;return e?(i=+t,o=+arguments[e-1],c):i},c.innerTickSize=function(t){return arguments.length?(i=+t,c):i},c.outerTickSize=function(t){return arguments.length?(o=+t,c):o},c.tickPadding=function(t){return arguments.length?(a=+t,c):a},c.tickSubdivide=function(){return arguments.length&&c},c};var Es="bottom",Cs={top:1,right:1,bottom:1,left:1};function Ts(t,e,n){t.attr("transform",function(t){var i=e(t);return"translate("+(isFinite(i)?i:n(t))+",0)"})}function Ms(t,e,n){t.attr("transform",function(t){var i=e(t);return"translate(0,"+(isFinite(i)?i:n(t))+")"})}r.svg.brush=function(){var t,e,n=U(d,"brushstart","brush","brushend"),i=null,o=null,a=[0,0],s=[0,0],l=!0,u=!0,h=Ls[0];function d(t){t.each(function(){var t=r.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",m).on("touchstart.brush",m),e=t.selectAll(".background").data([0]);e.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=t.selectAll(".resize").data(h,j);n.exit().remove(),n.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ps[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"),n.style("display",d.empty()?"none":null);var a,s=r.transition(t),l=r.transition(e);i&&(a=fa(i),l.attr("x",a[0]).attr("width",a[1]-a[0]),p(s)),o&&(a=fa(o),l.attr("y",a[0]).attr("height",a[1]-a[0]),g(s)),f(s)})}function f(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+a[+/e$/.test(t)]+","+s[+/^s/.test(t)]+")"})}function p(t){t.select(".extent").attr("x",a[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",a[1]-a[0])}function g(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function m(){var h,m,v=this,y=r.select(r.event.target),b=n.of(v,arguments),w=r.select(v),_=y.datum(),x=!/^(n|s)$/.test(_)&&i,S=!/^(e|w)$/.test(_)&&o,E=y.classed("extent"),C=St(v),T=r.mouse(v),M=r.select(c(v)).on("keydown.brush",function(){32==r.event.keyCode&&(E||(h=null,T[0]-=a[1],T[1]-=s[1],E=2),V())}).on("keyup.brush",function(){32==r.event.keyCode&&2==E&&(T[0]+=a[1],T[1]+=s[1],E=0,V())});if(r.event.changedTouches?M.on("touchmove.brush",A).on("touchend.brush",O):M.on("mousemove.brush",A).on("mouseup.brush",O),w.interrupt().selectAll("*").interrupt(),E)T[0]=a[0]-T[0],T[1]=s[0]-T[1];else if(_){var P=+/w$/.test(_),L=+/^n/.test(_);m=[a[1-P]-T[0],s[1-L]-T[1]],T[0]=a[P],T[1]=s[L]}else r.event.altKey&&(h=T.slice());function A(){var t=r.mouse(v),e=!1;m&&(t[0]+=m[0],t[1]+=m[1]),E||(r.event.altKey?(h||(h=[(a[0]+a[1])/2,(s[0]+s[1])/2]),T[0]=a[+(t[0]<h[0])],T[1]=s[+(t[1]<h[1])]):h=null),x&&k(t,i,0)&&(p(w),e=!0),S&&k(t,o,1)&&(g(w),e=!0),e&&(f(w),b({type:"brush",mode:E?"move":"resize"}))}function k(n,i,o){var r,c,d=fa(i),f=d[0],p=d[1],g=T[o],m=o?s:a,v=m[1]-m[0];if(E&&(f-=g,p-=v+g),r=(o?u:l)?Math.max(f,Math.min(p,n[o])):n[o],E?c=(r+=g)+v:(h&&(g=Math.max(f,Math.min(p,2*h[o]-r))),g<r?(c=r,r=g):c=g),m[0]!=r||m[1]!=c)return o?e=null:t=null,m[0]=r,m[1]=c,!0}function O(){A(),w.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),r.select("body").style("cursor",null),M.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),C(),b({type:"brushend"})}w.style("pointer-events","none").selectAll(".resize").style("display",null),r.select("body").style("cursor",y.style("cursor")),b({type:"brushstart"}),A()}return d.event=function(i){i.each(function(){var i=n.of(this,arguments),o={x:a,y:s,i:t,j:e},l=this.__chart__||o;this.__chart__=o,ms?r.select(this).transition().each("start.brush",function(){t=l.i,e=l.j,a=l.x,s=l.y,i({type:"brushstart"})}).tween("brush:brush",function(){var n=Jo(a,o.x),r=Jo(s,o.y);return t=e=null,function(t){a=o.x=n(t),s=o.y=r(t),i({type:"brush",mode:"resize"})}}).each("end.brush",function(){t=o.i,e=o.j,i({type:"brush",mode:"resize"}),i({type:"brushend"})}):(i({type:"brushstart"}),i({type:"brush",mode:"resize"}),i({type:"brushend"}))})},d.x=function(t){return arguments.length?(h=Ls[!(i=t)<<1|!o],d):i},d.y=function(t){return arguments.length?(h=Ls[!i<<1|!(o=t)],d):o},d.clamp=function(t){return arguments.length?(i&&o?(l=!!t[0],u=!!t[1]):i?l=!!t:o&&(u=!!t),d):i&&o?[l,u]:i?l:o?u:null},d.extent=function(n){var r,l,u,c,h;return arguments.length?(i&&(r=n[0],l=n[1],o&&(r=r[0],l=l[0]),t=[r,l],i.invert&&(r=i(r),l=i(l)),l<r&&(h=r,r=l,l=h),r==a[0]&&l==a[1]||(a=[r,l])),o&&(u=n[0],c=n[1],i&&(u=u[1],c=c[1]),e=[u,c],o.invert&&(u=o(u),c=o(c)),c<u&&(h=u,u=c,c=h),u==s[0]&&c==s[1]||(s=[u,c])),d):(i&&(t?(r=t[0],l=t[1]):(r=a[0],l=a[1],i.invert&&(r=i.invert(r),l=i.invert(l)),l<r&&(h=r,r=l,l=h))),o&&(e?(u=e[0],c=e[1]):(u=s[0],c=s[1],o.invert&&(u=o.invert(u),c=o.invert(c)),c<u&&(h=u,u=c,c=h))),i&&o?[[r,u],[l,c]]:i?[r,l]:o&&[u,c])},d.clear=function(){return d.empty()||(a=[0,0],s=[0,0],t=e=null),d},d.empty=function(){return!!i&&a[0]==a[1]||!!o&&s[0]==s[1]},r.rebind(d,n,"on")};var Ps={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ls=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],As=Ne.format=dn.timeFormat,ks=As.utc,Os=ks("%Y-%m-%dT%H:%M:%S.%LZ");function Rs(t){return t.toISOString()}function Ds(t,e,n){function i(e){return t(e)}function o(t,n){var i=(t[1]-t[0])/n,o=r.bisect(zs,i);return o==zs.length?[e.year,_a(t.map(function(t){return t/31536e6}),n)[2]]:o?e[i/zs[o-1]<zs[o]/i?o-1:o]:[Fs,_a(t,n)[2]]}return i.invert=function(e){return js(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain().map(js)},i.nice=function(t,e){var n=i.domain(),r=da(n),a=null==t?o(r,10):"number"==typeof t&&o(r,t);function s(n){return!isNaN(n)&&!t.range(n,js(+n+1),e).length}return a&&(t=a[0],e=a[1]),i.domain(ga(n,e>1?{floor:function(e){for(;s(e=t.floor(e));)e=js(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=js(+e+1);return e}}:t))},i.ticks=function(t,e){var n=da(i.domain()),r=null==t?o(n,10):"number"==typeof t?o(n,t):!t.range&&[{range:t},e];return r&&(t=r[0],e=r[1]),t.range(n[0],js(+n[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Ds(t.copy(),e,n)},ba(i,t)}function js(t){return new Date(t)}As.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Rs:Os,Rs.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Rs.toString=Os.toString,Ne.second=Ge(function(t){return new Ie(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Ne.seconds=Ne.second.range,Ne.seconds.utc=Ne.second.utc.range,Ne.minute=Ge(function(t){return new Ie(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Ne.minutes=Ne.minute.range,Ne.minutes.utc=Ne.minute.utc.range,Ne.hour=Ge(function(t){var e=t.getTimezoneOffset()/60;return new Ie(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Ne.hours=Ne.hour.range,Ne.hours.utc=Ne.hour.utc.range,Ne.month=Ge(function(t){return(t=Ne.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Ne.months=Ne.month.range,Ne.months.utc=Ne.month.utc.range;var zs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ns=[[Ne.second,1],[Ne.second,5],[Ne.second,15],[Ne.second,30],[Ne.minute,1],[Ne.minute,5],[Ne.minute,15],[Ne.minute,30],[Ne.hour,1],[Ne.hour,3],[Ne.hour,6],[Ne.hour,12],[Ne.day,1],[Ne.day,2],[Ne.week,1],[Ne.month,1],[Ne.month,3],[Ne.year,1]],Is=As.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",Kn]]),Fs={range:function(t,e,n){return r.range(Math.ceil(t/n)*n,+e,n).map(js)},floor:j,ceil:j};Ns.year=Ne.year,Ne.scale=function(){return Ds(r.scale.linear(),Ns,Is)};var Hs=Ns.map(function(t){return[t[0].utc,t[1]]}),Gs=ks.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",Kn]]);function Vs(t){return JSON.parse(t.responseText)}function Bs(t){var e=l.createRange();return e.selectNode(l.body),e.createContextualFragment(t.responseText)}Hs.year=Ne.year.utc,Ne.scale.utc=function(){return Ds(r.scale.linear(),Hs,Gs)},r.text=_e(function(t){return t.responseText}),r.json=function(t,e){return xe(t,"application/json",Vs,e)},r.html=function(t,e){return xe(t,"text/html",Bs,e)},r.xml=_e(function(t){return t.responseXML}),this.d3=r,void 0===(o="function"==typeof(i=r)?i.call(e,n,e,t):i)||(t.exports=o)}()},function(t,e,n){(t.exports=n(25)(!1)).push([t.i,"/*-- Chart --*/\n.c3 svg {\n font: 10px sans-serif;\n -webkit-tap-highlight-color: transparent; }\n\n.c3 path, .c3 line {\n fill: none;\n stroke: #000; }\n\n.c3 text {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none; }\n\n.c3-legend-item-tile,\n.c3-xgrid-focus,\n.c3-ygrid,\n.c3-event-rect,\n.c3-bars path {\n shape-rendering: crispEdges; }\n\n.c3-chart-arc path {\n stroke: #fff; }\n\n.c3-chart-arc rect {\n stroke: white;\n stroke-width: 1; }\n\n.c3-chart-arc text {\n fill: #fff;\n font-size: 13px; }\n\n/*-- Axis --*/\n/*-- Grid --*/\n.c3-grid line {\n stroke: #aaa; }\n\n.c3-grid text {\n fill: #aaa; }\n\n.c3-xgrid, .c3-ygrid {\n stroke-dasharray: 3 3; }\n\n/*-- Text on Chart --*/\n.c3-text.c3-empty {\n fill: #808080;\n font-size: 2em; }\n\n/*-- Line --*/\n.c3-line {\n stroke-width: 1px; }\n\n/*-- Point --*/\n.c3-circle._expanded_ {\n stroke-width: 1px;\n stroke: white; }\n\n.c3-selected-circle {\n fill: white;\n stroke-width: 2px; }\n\n/*-- Bar --*/\n.c3-bar {\n stroke-width: 0; }\n\n.c3-bar._expanded_ {\n fill-opacity: 1;\n fill-opacity: 0.75; }\n\n/*-- Focus --*/\n.c3-target.c3-focused {\n opacity: 1; }\n\n.c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step {\n stroke-width: 2px; }\n\n.c3-target.c3-defocused {\n opacity: 0.3 !important; }\n\n/*-- Region --*/\n.c3-region {\n fill: steelblue;\n fill-opacity: .1; }\n\n/*-- Brush --*/\n.c3-brush .extent {\n fill-opacity: .1; }\n\n/*-- Select - Drag --*/\n/*-- Legend --*/\n.c3-legend-item {\n font-size: 12px; }\n\n.c3-legend-item-hidden {\n opacity: 0.15; }\n\n.c3-legend-background {\n opacity: 0.75;\n fill: white;\n stroke: lightgray;\n stroke-width: 1; }\n\n/*-- Title --*/\n.c3-title {\n font: 14px sans-serif; }\n\n/*-- Tooltip --*/\n.c3-tooltip-container {\n z-index: 10; }\n\n.c3-tooltip {\n border-collapse: collapse;\n border-spacing: 0;\n background-color: #fff;\n empty-cells: show;\n -webkit-box-shadow: 7px 7px 12px -9px #777777;\n -moz-box-shadow: 7px 7px 12px -9px #777777;\n box-shadow: 7px 7px 12px -9px #777777;\n opacity: 0.9; }\n\n.c3-tooltip tr {\n border: 1px solid #CCC; }\n\n.c3-tooltip th {\n background-color: #aaa;\n font-size: 14px;\n padding: 2px 5px;\n text-align: left;\n color: #FFF; }\n\n.c3-tooltip td {\n font-size: 13px;\n padding: 3px 6px;\n background-color: #fff;\n border-left: 1px dotted #999; }\n\n.c3-tooltip td > span {\n display: inline-block;\n width: 10px;\n height: 10px;\n margin-right: 6px; }\n\n.c3-tooltip td.value {\n text-align: right; }\n\n/*-- Area --*/\n.c3-area {\n stroke-width: 0;\n opacity: 0.2; }\n\n/*-- Arc --*/\n.c3-chart-arcs-title {\n dominant-baseline: middle;\n font-size: 1.3em; }\n\n.c3-chart-arcs .c3-chart-arcs-background {\n fill: #e0e0e0;\n stroke: #FFF; }\n\n.c3-chart-arcs .c3-chart-arcs-gauge-unit {\n fill: #000;\n font-size: 16px; }\n\n.c3-chart-arcs .c3-chart-arcs-gauge-max {\n fill: #777; }\n\n.c3-chart-arcs .c3-chart-arcs-gauge-min {\n fill: #777; }\n\n.c3-chart-arc .c3-gauge-value {\n fill: #000;\n /* font-size: 28px !important;*/ }\n\n.c3-chart-arc.c3-target g path {\n opacity: 1; }\n\n.c3-chart-arc.c3-target.c3-focused g path {\n opacity: 1; }\n",""])},function(t,e,n){(t.exports=n(25)(!1)).push([t.i,".chart text {\n fill: white;\n}\n.chart line {\n stroke: white;\n}\n.chart path {\n stroke: white;\n}\n.c3 path,\n.c3 line {\n stroke: white;\n}\n\n.c3-tooltip,\n.c3-tooltip td {\n background: rgba(0,0,0,0.8);\n}\n.c3-tooltip th {\n font-family: 'Roboto', sans-serif;\n background: black;\n}\n",""])},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=p(n(65)),o=p(n(12)),r=p(n(7)),a=p(n(8)),s=p(n(13)),l=p(n(14)),u=n(2),c=p(u),h=(n(21),n(17),n(11)),d=p(n(178));n(179),n(180);var f=n(181);function p(t){return t&&t.__esModule?t:{default:t}}var g=function(t){function e(){return(0,r.default)(this,e),(0,s.default)(this,(e.__proto__||(0,o.default)(e)).apply(this,arguments))}return(0,l.default)(e,t),(0,a.default)(e,[{key:"render",value:function(){var t=this.props.payload.data,e=t.paper,n=t.citations;if(!n.length)return null;var o={},r=(0,i.default)({},f.initialInstitutionLookup);n.forEach(function(t){t.addresses.forEach(function(t){var e=t.country;if(e)switch(e in o?o[e]+=1:o[e]=1,t.type){case"company":case"edu":case"gov":r[t.type]+=1;break;case"mil":r.gov+=1;break;default:console.log("weird institution type",t)}})});var a=(0,h.toTuples)(o).sort(function(t,e){return e[1]-t[1]}),s=a.slice(0,10),l=a.slice(10).reduce(function(t,e){return t+e[1]},0);l>0&&s.push([f.otherCountriesLabel,l]);var u=(0,h.toTuples)(r).map(function(t){return[f.institutionOrder[t[0]],t]}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]}).map(function(t){return[f.institutionLabels[t[0]],t[1]]});f.rainbow;return c.default.createElement("div",{className:"chart"},c.default.createElement("div",null,c.default.createElement(d.default,{data:{columns:s,type:"pie"},color:{pattern:f.rainbow},tooltip:{format:{value:function(t){return t}}},size:{height:s.length<4?316:336}}),c.default.createElement("span",{className:"chartCaption"},n.length+" verified "+e.name+" dataset citations by country")),c.default.createElement("div",null,c.default.createElement(d.default,{data:{columns:u,type:"pie"},color:{pattern:f.institutionColors},tooltip:{format:{value:function(t){return t}}},size:{height:316}}),c.default.createElement("span",{className:"chartCaption"},n.length+" verified "+e.name+" dataset citations by organization type")))}}]),e}(u.Component);e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.store=void 0;var i=n(21),o=function(t){return t&&t.__esModule?t:{default:t}}(n(462));var r=(0,i.combineReducers)({api:function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}});var a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||i.compose;return(0,i.createStore)(r,t,e((0,i.applyMiddleware)(o.default)))}({});e.store=a},function(t,e,n){"use strict";function i(t){return function(e){var n=e.dispatch,i=e.getState;return function(e){return function(o){return"function"==typeof o?o(n,i,t):e(o)}}}}Object.defineProperty(e,"__esModule",{value:!0});var o=i();o.withExtraArgument=i,e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=u(n(65)),o=u(n(464)),r=u(n(45)),a=u(n(7)),s=u(n(8));e.default=function(t,e){var n=e.data;if(!n)return;return new p(t,n)};var l=u(n(182));function u(t){return t&&t.__esModule?t:{default:t}}n(467);var c={edu:{color:"rgb(245, 246, 150)",fillColor:"rgb(245, 246, 150)",opacity:.5,weight:"1"},company:{color:"rgb(50, 100, 246)",fillColor:"rgb(50, 100, 246)",opacity:1,weight:"2"},gov:{color:"rgb(245, 150, 100)",fillColor:"rgb(245, 150, 150)",opacity:1,weight:"2"},mil:{color:"rgb(245, 0, 0)",fillColor:"rgb(245, 0, 0)",opacity:1,weight:"2"}},h=["edu","company","gov"],d={all:0,edu:1,company:2,gov:3,mil:3},f=l.default.icon({iconUrl:"/assets/img/reddot.png",iconSize:[17,17],iconAnchor:[8,8],popupAnchor:[0,-5]}),p=function(){function t(e,n){var i=this;(0,a.default)(this,t);var o=n.paper,r=n.citations;this.el=e,this.paper=o,this.markers=[],this.arcs=[],this.filter=d.all,o.addresses&&o.addresses.length?this.source=[o.addresses[0].lat,o.addresses[0].lng].map(function(t){return parseFloat(t)||0}):(console.error("No address found for root paper"),this.source=[0,0]),this.citationsByAddress={},this.citations=r,this.citations.forEach(function(t){t.addresses&&t.addresses.forEach(function(e){e.name in i.citationsByAddress||(i.citationsByAddress[e.name]={address:e,citations:[]}),i.citationsByAddress[e.name].citations.push(t)})}),this.build(),this.bind(),this.buildMarkers(),this.rootMarker.openPopup()}return(0,s.default)(t,[{key:"build",value:function(){this.map=l.default.map(this.el).setView([25,0],2),l.default.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}",{attribution:'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',maxZoom:18,id:"mapbox.dark",style:"mapbox://styles/mapbox/dark-v9",accessToken:"pk.eyJ1IjoiZmFuc2FsY3kiLCJhIjoiY2pvN3I1czJwMHF5NDNrbWRoMWpteHlrdCJ9.kMpM5syQUhVjKkn1iVx9fg"}).addTo(this.map)}},{key:"bind",value:function(){var t=this,e=document.createElement("div");function n(t){t.stopPropagation()}e.classList.add("map_cover"),e.innerHTML="<div class='cover_message'>Click here to explore the map</div>",e.querySelector("div").addEventListener("click",function(){t.map.scrollWheelZoom.enable(),e.parentNode===t.el&&t.el.removeChild(e)}),e.querySelector("div").addEventListener("touchstart",function(t){t.stopPropagation()}),e.querySelector("div").addEventListener("tap",function(n){n.stopPropagation(),t.map.scrollWheelZoom.enable(),e.parentNode===t.el&&t.el.removeChild(e)}),e.addEventListener("mousewheel",n,!0),e.addEventListener("DOMMouseScroll",n,!0),this.map.scrollWheelZoom.disable(),this.map.on("focus",function(){t.map.scrollWheelZoom.enable(),e.parentNode===t.el&&t.el.removeChild(e)}),this.map.on("blur",function(){t.map.scrollWheelZoom.disable()}),this.el.appendChild(e),h.forEach(function(e){var n=e.substr(0,3),i=document.querySelector(".map-legend ."+n);i.addEventListener("click",function(){t.filterMarkers(i,e)})})}},{key:"filterMarkers",value:function(t,e){var n=document.querySelector(".map-legend .active");n&&n.classList.remove("active");var i=d[e];this.filter===i?this.filter=d.all:(this.filter=i,t.classList.add("active")),this.buildMarkers()}},{key:"resetMarkers",value:function(){this.arcs.forEach(function(t){return t.remove()}),this.markers.forEach(function(t){return t.remove()}),this.markers=[],this.arcs=[]}},{key:"buildMarkers",value:function(){var t=this;this.resetMarkers(),(0,r.default)(this.citationsByAddress).map(function(e){var n=t.citationsByAddress[e],r=n.citations,a=n.address;if(!t.filter||d[a.type]===t.filter){var s=[a.lat,a.lng].map(function(t){return parseFloat(t)});if(!(0,o.default)(s[0])&&!(0,o.default)(s[1])){t.addMarker(s,r);var l=(0,i.default)({},c[a.type]),u=Math.min(r.length,5),h=.5+Math.min(r.length/5,.5);"edu"!==a.type&&(u+=1,h=1),l.weight=String(u),l.opacity=h,t.addArc(t.source,s,l)}}}),this.rootMarker=this.addMarker(this.source,[this.paper])}},{key:"addMarker",value:function(t,e){var n=l.default.marker(t,{icon:f}).addTo(this.map),i=e.map(function(t){var e=t.title,n=t.addresses,i=t.year,o=t.pdf,r=t.doi,a=["<b>",e,"</b>"];o&&o.length?(a.unshift("<a href='"+o[0]+"' target='_blank'>"),a.push("</a>")):r&&r.length&&(a.unshift("<a href='"+r[0]+"' target='_blank'>"),a.push("</a>")),i&&a.push(" ("+i+")");var s=n.map(function(t){return t.name}).join("<br/>");return a.push("<br>"),a.push(s),a.join("")});return n.bindPopup(i.join("<br><br>")),this.markers.push(n),n}},{key:"addArc",value:function(t,e,n){var i=l.default.bezier({path:[[{lat:t[0],lng:t[1]},{lat:e[0],lng:e[1]}]]},n).addTo(this.map);this.arcs.push(i)}}]),t}()},function(t,e,n){t.exports={default:n(465),__esModule:!0}},function(t,e,n){n(466),t.exports=n(3).Number.isNaN},function(t,e,n){var i=n(4);i(i.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.noop=e.Bezier=void 0;var i=function(t){return t&&t.__esModule?t:{default:t}}(n(182));i.default.SVG.include({_updatecurve:function(t){var e=this._curvePointsToPath(t._points);if(this._setPath(t,e),t.options.animate){var n=t._path,i=n.getTotalLength();t.options.dashArray||(n.style.strokeDasharray=i+" "+i),t._initialUpdate&&(n.animate([{strokeDashoffset:i},{strokeDashoffset:0}],t.options.animate),t._initialUpdate=!1)}return e},_curvePointsToPath:function(t){for(var e=void 0,n="",i=0;i<t.length;i++)"string"==typeof(e=t[i])||e instanceof String?n+=e:n+=e.x+","+e.y+" ";return n||"M0 0"}});var o=i.default.Path.extend({options:{},initialize:function(t,e,n){t.mid&&void 0!==t.mid[0]||(t.mid=this.getMidPoint(t.from,t.to,t.from.deep?t.from.deep:4,t.from.slide)),i.default.setOptions(this,n),this._initialUpdate=!0,this.setPath(t),this.icon=e},onAdd:function(t){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this),t.on("zoom",function(){})},getPath:function(){return this._coords},setPath:function(t){return this._setPath(t),this.redraw()},getBounds:function(){return this._bounds},getMidPoint:function(t,e,n){var i=3.14;"RIGHT_ROUND"===(arguments.length>3&&void 0!==arguments[3]?arguments[3]:"LEFT_ROUND")&&(i*=-1);var o=t,r=e,a=r.lng-o.lng,s=r.lat-o.lat,l=Math.sqrt(Math.pow(a,2)+Math.pow(s,2)),u=Math.atan2(s,a),c=i/(n||4),h=l/2/Math.cos(c),d=u+c,f=h*Math.cos(d)+o.lng,p=[h*Math.sin(d)+o.lat,f];return[].push(o,p,r),p},_setPath:function(t){this._coords=t,this._bounds=this._computeBounds()},_computeBounds:function(){var t=new i.default.LatLngBounds;return t.extend(this._coords.from),t.extend(this._coords.to),t.extend(this._coords.mid),t},getCenter:function(){return this._bounds.getCenter()},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updatecurve(this)},_project:function(){this._points=[],this._points.push("M");var t=this._map.latLngToLayerPoint(this._coords.from);this._points.push(t),this._coords.mid&&(this._points.push("Q"),t=this._map.latLngToLayerPoint(this._coords.mid),this._points.push(t)),t=this._map.latLngToLayerPoint(this._coords.to),this._points.push(t)}});i.default.bezier=function(t,e){for(var n=[],r=0;t.path.length>r;r++)for(var a=!1,s=0;t.path[r].length>s;s++){var l=t.path[r][s];if(a){var u={from:a,to:l};n.push(new o(u,t.icon,e))}a=t.path[r][s]}return i.default.layerGroup(n)},e.Bezier=o,e.noop=function(){}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ModalImage=void 0;var i=function(t){return t&&t.__esModule?t:{default:t}}(n(469));n(470),e.ModalImage=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=h(n(12)),o=h(n(7)),r=h(n(8)),a=h(n(13)),s=h(n(14)),l=n(2),u=h(l),c=(n(21),n(17),n(89),n(11));n(51),h(n(176));function h(t){return t&&t.__esModule?t:{default:t}}var d=function(t){function e(){var t,n,r,s;(0,o.default)(this,e);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=r=(0,a.default)(this,(t=e.__proto__||(0,i.default)(e)).call.apply(t,[this].concat(u))),r.state={visible:!1,images:[],index:0},s=n,(0,a.default)(r,s)}return(0,s.default)(e,t),(0,r.default)(e,[{key:"componentDidMount",value:function(){var t=this,e=(0,c.toArray)(document.querySelectorAll(".image img"));e.forEach(function(e,n){e.addEventListener("click",function(){return t.loadImage(n)})}),this.setState({images:e}),document.body.addEventListener("keydown",function(e){if(document.activeElement&&document.activeElement!==document.body)return null;switch(e.keyCode){case 27:t.close();break;case 37:t.prev();break;case 39:t.next()}})}},{key:"loadImage",value:function(t){var e=this.state.images;e.length&&(t<0||t>=e.length||this.setState({visible:!0,index:t}))}},{key:"prev",value:function(){var t=this.state,e=t.index,n=t.images;n.length&&this.setState({index:(n.length+e-1)%n.length})}},{key:"next",value:function(){var t=this.state,e=t.index,n=t.images;n.length&&this.setState({index:(e+1)%n.length})}},{key:"close",value:function(){this.setState({visible:!1})}},{key:"render",value:function(){var t=this,e=this.state,n=e.images,i=e.index,o=e.visible;if(!n.length)return null;var r=n[i],a=null,s=r.nextSibling;return s&&s.classList.contains("caption")&&(a=s.innerText),u.default.createElement("div",{className:o?"modal visible":"modal"},u.default.createElement("div",{className:"inner",onClick:function(){return t.close()}},u.default.createElement("div",{className:"centered",onClick:function(t){return t.stopPropagation()}},u.default.createElement("img",{src:r.src}),a&&u.default.createElement("div",{className:"caption"},a))),u.default.createElement("div",{onClick:function(){return t.prev()},className:"prev","aria-label":"Previous image",alt:"Previous image"},u.default.createElement("img",{src:"/assets/img/arrow-left.png"})),u.default.createElement("div",{onClick:function(){return t.next()},className:"next","aria-label":"Next image",alt:"Next image"},u.default.createElement("img",{src:"/assets/img/arrow-right.png"})),u.default.createElement("div",{onClick:function(){return t.close()},className:"close","aria-label":"Close",alt:"Close"},u.default.createElement("img",{src:"/assets/img/close.png"})))}}]),e}(l.Component);e.default=d},function(t,e,n){var i=n(471);"string"==typeof i&&(i=[[t.i,i,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(26)(i,o);i.locals&&(t.exports=i.locals)},function(t,e,n){(t.exports=n(25)(!1)).push([t.i,".modal {\n position: fixed;\n top: 0; left: 0; width: 100%; height: 100%;\n background: rgba(0,0,0,0.9);\n color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n pointer-events: none;\n z-index: -9999999;\n transition: opacity 0.2s cubic-bezier(0,0,1,1);\n}\n.modal.visible {\n opacity: 1;\n pointer-events: auto;\n z-index: 9999999;\n}\n.modal .inner {\n position: absolute;\n top: 0; left: 0;\n width: 100%; height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.modal img {\n max-width: 85vw;\n max-height: 90vh;\n}\n.modal .caption {\n display: block;\n text-align: center;\n background: black;\n padding: 10px;\n}\n.modal .prev span,\n.modal .next span,\n.modal .close span {\n background: #222;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n text-align: center;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: 0 1px 2px rgba(255,255,255,0.4);\n transition: all 0.2s cubic-bezier(0,0,1,1);\n user-select: none;\n}\n.desktop .modal .prev:hover span,\n.desktop .modal .prev:hover span,\n.desktop .modal .prev:hover span {\n background: #000;\n box-shadow: 0 1px 2px rgba(255,255,255,0.6);\n}\n.modal .prev,\n.modal .next,\n.modal .close {\n position: absolute;\n top: 0;\n padding: 20px;\n width: 8%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: all 0.1s cubic-bezier(0,0,0,1);\n z-index: 99999999;\n}\n.modal .prev {\n left: 0;\n}\n.modal .next {\n right: 0;\n}\n.modal .prev img,\n.modal .next img {\n max-width: 40px;\n max-height: 100%;\n}\n\n.modal .close {\n position: absolute;\n top: 0; right: 0;\n width: 80px;\n height: 80px;\n max-width: 10vw;\n max-height: 10vw;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: all 0.1s cubic-bezier(0,0,0,1);\n padding: 20px;\n}\n.modal .close img {\n width: 100%;\n height: 100%;\n}\n\n.desktop .modal .prev:hover {\n width: 9%;\n left: -10px;\n}\n.desktop .modal .next:hover {\n width: 9%;\n right: -10px;\n}\n.desktop .modal .close:hover {\n padding: 10px;\n}\n\n@media all and (max-device-width: 1024px) {\n .modal img {\n max-width: 100vw;\n max-height: 90vh;\n }\n}",""])}]); \ No newline at end of file