/*! For license information please see main.8bf5e645.js.LICENSE.txt */ (()=>{var e={606:(e,t,n)=>{"use strict";var r=n(897).default;function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function u(e){var t=p();return function(){var n,r=h(e);if(t){var i=h(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return a(e)}(this,n)}}function d(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t>16,s=n>>8&255,o=255&n;return"#"+(16777216+65536*(Math.round((r-a)*i)+a)+256*(Math.round((r-s)*i)+s)+(Math.round((r-o)*i)+o)).toString(16).slice(1)}},{key:"shadeColor",value:function(t,n){return e.isColorHex(n)?this.shadeHexColor(t,n):this.shadeRGBColor(t,n)}}],[{key:"bind",value:function(e,t){return function(){return e.apply(t,arguments)}}},{key:"isObject",value:function(e){return e&&"object"===w(e)&&!Array.isArray(e)&&null!=e}},{key:"is",value:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"}},{key:"listToArray",value:function(e){var t,n=[];for(t=0;t1&&void 0!==arguments[1]?arguments[1]:2;return Number.isInteger(e)?e:parseFloat(e.toPrecision(t))}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(e){var t=String(e).split(/[eE]/);if(1===t.length)return t[0];var n="",r=e<0?"-":"",i=t[0].replace(".",""),a=Number(t[1])+1;if(a<0){for(n=r+"0.";a++;)n+="0";return n+i.replace(/^-/,"")}for(a-=i.length;a--;)n+="0";return i+n}},{key:"elementExists",value:function(e){return!(!e||!e.isConnected)}},{key:"getDimensions",value:function(e){var t=getComputedStyle(e,null),n=e.clientHeight,r=e.clientWidth;return n-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),[r-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),n]}},{key:"getBoundingClientRect",value:function(e){var t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:e.clientWidth,height:e.clientHeight,x:t.left,y:t.top}}},{key:"getLargestStringFromArr",value:function(e){return e.reduce((function(e,t){return Array.isArray(t)&&(t=t.reduce((function(e,t){return e.length>t.length?e:t}))),e.length>t.length?e:t}),0)}},{key:"hexToRgba",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#999999",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.6;"#"!==e.substring(0,1)&&(e="#999999");var n=e.replace("#","");n=n.match(new RegExp("(.{"+n.length/3+"})","g"));for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"x",n=e.toString().slice();return n.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,t)}},{key:"negToZero",value:function(e){return e<0?0:e}},{key:"moveIndexInArray",value:function(e,t,n){if(n>=e.length)for(var r=n-e.length+1;r--;)e.push(void 0);return e.splice(n,0,e.splice(t,1)[0]),e}},{key:"extractNumber",value:function(e){return parseFloat(e.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}},{key:"setELstyles",value:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e.style.key=t[n])}},{key:"preciseAddition",value:function(e,t){var n=(String(e).split(".")[1]||"").length,r=(String(t).split(".")[1]||"").length,i=Math.pow(10,Math.max(n,r));return(Math.round(e*i)+Math.round(t*i))/i}},{key:"isNumber",value:function(e){return!isNaN(e)&&parseFloat(Number(e))===e&&!isNaN(parseInt(e,10))}},{key:"isFloat",value:function(e){return Number(e)===e&&e%1!=0}},{key:"isMsEdge",value:function(){var e=window.navigator.userAgent,t=e.indexOf("Edge/");return t>0&&parseInt(e.substring(t+5,e.indexOf(".",t)),10)}},{key:"getGCD",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:7,r=Math.pow(10,n-Math.floor(Math.log10(Math.max(e,t))));for(e=Math.round(Math.abs(e)*r),t=Math.round(Math.abs(t)*r);t;){var i=t;t=e%t,e=i}return e/r}},{key:"getPrimeFactors",value:function(e){for(var t=[],n=2;e>=2;)e%n==0?(t.push(n),e/=n):n++;return t}},{key:"mod",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:7,r=Math.pow(10,n-Math.floor(Math.log10(Math.max(e,t))));return(e=Math.round(Math.abs(e)*r))%(t=Math.round(Math.abs(t)*r))/r}}]),e}(),S=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"animateLine",value:function(e,t,n,r){e.attr(t).animate(r).attr(n)}},{key:"animateMarker",value:function(e,t,n,r){e.attr({opacity:0}).animate(t).attr({opacity:1}).after((function(){r()}))}},{key:"animateRect",value:function(e,t,n,r,i){e.attr(t).animate(r).attr(n).after((function(){return i()}))}},{key:"animatePathsGradually",value:function(e){var t=e.el,n=e.realIndex,r=e.j,i=e.fill,a=e.pathFrom,s=e.pathTo,o=e.speed,l=e.delay,c=this.w,u=0;c.config.chart.animations.animateGradually.enabled&&(u=c.config.chart.animations.animateGradually.delay),c.config.chart.animations.dynamicAnimation.enabled&&c.globals.dataChanged&&"bar"!==c.config.chart.type&&(u=0),this.morphSVG(t,n,r,"line"!==c.config.chart.type||c.globals.comboCharts?i:"stroke",a,s,o,l*u)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach((function(e){var t=e.el;t.classList.remove("apexcharts-element-hidden"),t.classList.add("apexcharts-hidden-element-shown")}))}},{key:"animationCompleted",value:function(e){var t=this.w;t.globals.animationEnded||(t.globals.animationEnded=!0,this.showDelayedElements(),"function"==typeof t.config.chart.events.animationEnd&&t.config.chart.events.animationEnd(this.ctx,{el:e,w:t}))}},{key:"morphSVG",value:function(e,t,n,r,i,a,s,o){var l=this,c=this.w;i||(i=e.attr("pathFrom")),a||(a=e.attr("pathTo"));var u=function(e){return"radar"===c.config.chart.type&&(s=1),"M 0 ".concat(c.globals.gridHeight)};(!i||i.indexOf("undefined")>-1||i.indexOf("NaN")>-1)&&(i=u()),(!a.trim()||a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a=u()),c.globals.shouldAnimate||(s=1),e.plot(i).animate(1,o).plot(i).animate(s,o).plot(a).after((function(){k.isNumber(n)?n===c.globals.series[c.globals.maxValsInArrayIndex].length-2&&c.globals.shouldAnimate&&l.animationCompleted(e):"none"!==r&&c.globals.shouldAnimate&&(!c.globals.comboCharts&&t===c.globals.series.length-1||c.globals.comboCharts)&&l.animationCompleted(e),l.showDelayedElements()}))}}]),e}();const _={},C=[];function E(e,t){if(Array.isArray(e))for(const n of e)E(n,t);else if("object"!=typeof e)M(Object.getOwnPropertyNames(t)),_[e]=Object.assign(_[e]||{},t);else for(const n in e)E(n,e[n])}function N(e){return _[e]||{}}function M(e){C.push(...e)}function T(e,t){let n;const r=e.length,i=[];for(n=0;nD.has(e.nodeName),F=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=r({},t);for(const r in i)i[r].valueOf()===n[r]&&delete i[r];Object.keys(i).length?e.node.setAttribute("data-svgjs",JSON.stringify(i)):(e.node.removeAttribute("data-svgjs"),e.node.removeAttribute("svgjs:data"))},B="http://www.w3.org/2000/svg",z="http://www.w3.org/2000/xmlns/",H="http://www.w3.org/1999/xlink",Y={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};function U(){return Y.window}let W=class{};const X={},V="___SYMBOL___ROOT___";function q(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:B;return Y.document.createElementNS(t,e)}function G(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof W)return e;if("object"==typeof e)return Z(e);if(null==e)return new X[V];if("string"==typeof e&&"<"!==e.charAt(0))return Z(Y.document.querySelector(e));const n=t?Y.document.createElement("div"):q("svg");return n.innerHTML=e,e=Z(n.firstChild),n.removeChild(n.firstChild),e}function Q(e,t){return t&&(t instanceof Y.window.Node||t.ownerDocument&&t instanceof t.ownerDocument.defaultView.Node)?t:q(e)}function K(e){if(!e)return null;if(e.instance instanceof W)return e.instance;if("#document-fragment"===e.nodeName)return new X.Fragment(e);let t=R(e.nodeName||"Dom");return"LinearGradient"===t||"RadialGradient"===t?t="Gradient":X[t]||(t="Dom"),new X[t](e)}let Z=K;function J(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.name,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return X[t]=e,n&&(X[V]=e),M(Object.getOwnPropertyNames(e.prototype)),e}let $=1e3;function ee(e){return"Svgjs"+R(e)+$++}function te(e){for(let t=e.children.length-1;t>=0;t--)te(e.children[t]);return e.id?(e.id=ee(e.nodeName),e):e}function ne(e,t){let n,r;for(r=(e=Array.isArray(e)?e:[e]).length-1;r>=0;r--)for(n in t)e[r].prototype[n]=t[n]}function re(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}E("Dom",{classes:function(){const e=this.attr("class");return null==e?[]:e.trim().split(me)},hasClass:function(e){return-1!==this.classes().indexOf(e)},addClass:function(e){if(!this.hasClass(e)){const t=this.classes();t.push(e),this.attr("class",t.join(" "))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr("class",this.classes().filter((function(t){return t!==e})).join(" ")),this},toggleClass:function(e){return this.hasClass(e)?this.removeClass(e):this.addClass(e)}}),E("Dom",{css:function(e,t){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(e){return!!e.length})).forEach((function(e){const t=e.split(/\s*:\s*/);n[t[0]]=t[1]})),n;if(arguments.length<2){if(Array.isArray(e)){for(const t of e){const e=t;n[t]=this.node.style.getPropertyValue(e)}return n}if("string"==typeof e)return this.node.style.getPropertyValue(e);if("object"==typeof e)for(const t in e)this.node.style.setProperty(t,null==e[t]||he.test(e[t])?"":e[t])}return 2===arguments.length&&this.node.style.setProperty(e,null==t||he.test(t)?"":t),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),E("Dom",{data:function(e,t,n){if(null==e)return this.data(T(function(e,t){let n;const r=e.length,i=[];for(n=0;n0===e.nodeName.indexOf("data-"))),(e=>e.nodeName.slice(5))));if(e instanceof Array){const t={};for(const n of e)t[n]=this.data(n);return t}if("object"==typeof e)for(t in e)this.data(t,e[t]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+e))}catch(t){return this.attr("data-"+e)}else this.attr("data-"+e,null===t?null:!0===n||"string"==typeof t||"number"==typeof t?t:JSON.stringify(t));return this}}),E("Dom",{remember:function(e,t){if("object"==typeof arguments[0])for(const n in e)this.remember(n,e[n]);else{if(1===arguments.length)return this.memory()[e];this.memory()[e]=t}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let e=arguments.length-1;e>=0;e--)delete this.memory()[arguments[e]];return this},memory:function(){return this._memory=this._memory||{}}});class xe{constructor(){this.init(...arguments)}static isColor(e){return e&&(e instanceof xe||this.isRgb(e)||this.test(e))}static isRgb(e){return e&&"number"==typeof e.r&&"number"==typeof e.g&&"number"==typeof e.b}static random(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vibrant",t=arguments.length>1?arguments[1]:void 0;const{random:n,round:r,sin:i,PI:a}=Math;if("vibrant"===e){const e=24*n()+57,t=38*n()+45,r=360*n();return new xe(e,t,r,"lch")}if("sine"===e){const e=r(80*i(2*a*(t=null==t?n():t)/.5+.01)+150),s=r(50*i(2*a*t/.5+4.6)+200),o=r(100*i(2*a*t/.5+2.3)+150);return new xe(e,s,o)}if("pastel"===e){const e=8*n()+86,t=17*n()+9,r=360*n();return new xe(e,t,r,"lch")}if("dark"===e){const e=10+10*n(),t=50*n()+86,r=360*n();return new xe(e,t,r,"lch")}if("rgb"===e){const e=255*n(),t=255*n(),r=255*n();return new xe(e,t,r)}if("lab"===e){const e=100*n(),t=256*n()-128,r=256*n()-128;return new xe(e,t,r,"lab")}if("grey"===e){const e=255*n();return new xe(e,e,e)}throw new Error("Unsupported random color mode")}static test(e){return"string"==typeof e&&(ue.test(e)||de.test(e))}cmyk(){const{_a:e,_b:t,_c:n}=this.rgb(),[r,i,a]=[e,t,n].map((e=>e/255)),s=Math.min(1-r,1-i,1-a);return 1===s?new xe(0,0,0,1,"cmyk"):new xe((1-r-s)/(1-s),(1-i-s)/(1-s),(1-a-s)/(1-s),s,"cmyk")}hsl(){const{_a:e,_b:t,_c:n}=this.rgb(),[r,i,a]=[e,t,n].map((e=>e/255)),s=Math.max(r,i,a),o=Math.min(r,i,a),l=(s+o)/2,c=s===o,u=s-o;return new xe(360*(c?0:s===r?((i-a)/u+(i.5?u/(2-s-o):u/(s+o)),100*l,"hsl")}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"rgb";if(e=e||0,this.space)for(const u in this.space)delete this[this.space[u]];if("number"==typeof e)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:e,_b:t,_c:n,_d:r,space:i});else if(e instanceof Array)this.space=t||("string"==typeof e[3]?e[3]:e[4])||"rgb",Object.assign(this,{_a:e[0],_b:e[1],_c:e[2],_d:e[3]||0});else if(e instanceof Object){const n=function(e,t){const n=be(e,"rgb")?{_a:e.r,_b:e.g,_c:e.b,_d:0,space:"rgb"}:be(e,"xyz")?{_a:e.x,_b:e.y,_c:e.z,_d:0,space:"xyz"}:be(e,"hsl")?{_a:e.h,_b:e.s,_c:e.l,_d:0,space:"hsl"}:be(e,"lab")?{_a:e.l,_b:e.a,_c:e.b,_d:0,space:"lab"}:be(e,"lch")?{_a:e.l,_b:e.c,_c:e.h,_d:0,space:"lch"}:be(e,"cmyk")?{_a:e.c,_b:e.m,_c:e.y,_d:e.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=t||n.space,n}(e,t);Object.assign(this,n)}else if("string"==typeof e)if(de.test(e)){const t=e.replace(ce,""),[n,r,i]=se.exec(t).slice(1,4).map((e=>parseInt(e)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!ue.test(e))throw Error("Unsupported string format, can't construct Color");{const t=e=>parseInt(e,16),[,n,r,i]=ae.exec(function(e){return 4===e.length?["#",e.substring(1,2),e.substring(1,2),e.substring(2,3),e.substring(2,3),e.substring(3,4),e.substring(3,4)].join(""):e}(e)).map(t);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:a,_b:s,_c:o,_d:l}=this,c="rgb"===this.space?{r:a,g:s,b:o}:"xyz"===this.space?{x:a,y:s,z:o}:"hsl"===this.space?{h:a,s:s,l:o}:"lab"===this.space?{l:a,a:s,b:o}:"lch"===this.space?{l:a,c:s,h:o}:"cmyk"===this.space?{c:a,m:s,y:o,k:l}:{};Object.assign(this,c)}lab(){const{x:e,y:t,z:n}=this.xyz();return new xe(116*t-16,500*(e-t),200*(t-n),"lab")}lch(){const{l:e,a:t,b:n}=this.lab(),r=Math.sqrt(t**2+n**2);let i=180*Math.atan2(n,t)/Math.PI;return i<0&&(i*=-1,i=360-i),new xe(e,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:t,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:a}=this;if("lch"===this.space){const{c:e,h:t}=this,n=Math.PI/180;i=e*Math.cos(n*t),a=e*Math.sin(n*t)}const s=(r+16)/116,o=i/500+s,l=s-a/200,c=16/116,u=.008856,d=7.787;e=.95047*(o**3>u?o**3:(o-c)/d),t=1*(s**3>u?s**3:(s-c)/d),n=1.08883*(l**3>u?l**3:(l-c)/d)}const r=3.2406*e+-1.5372*t+-.4986*n,i=-.9689*e+1.8758*t+.0415*n,a=.0557*e+-.204*t+1.057*n,s=Math.pow,o=.0031308,l=r>o?1.055*s(r,1/2.4)-.055:12.92*r,c=i>o?1.055*s(i,1/2.4)-.055:12.92*i,u=a>o?1.055*s(a,1/2.4)-.055:12.92*a;return new xe(255*l,255*c,255*u)}if("hsl"===this.space){let{h:e,s:t,l:n}=this;if(e/=360,t/=100,n/=100,0===t)return n*=255,new xe(n,n,n);const r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=255*ye(i,r,e+1/3),s=255*ye(i,r,e),o=255*ye(i,r,e-1/3);return new xe(a,s,o)}if("cmyk"===this.space){const{c:e,m:t,y:n,k:r}=this,i=255*(1-Math.min(1,e*(1-r)+r)),a=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,n*(1-r)+r));return new xe(i,a,s)}return this;var e}toArray(){const{_a:e,_b:t,_c:n,_d:r,space:i}=this;return[e,t,n,r,i]}toHex(){const[e,t,n]=this._clamped().map(ve);return"#".concat(e).concat(t).concat(n)}toRgb(){const[e,t,n]=this._clamped();return"rgb(".concat(e,",").concat(t,",").concat(n,")")}toString(){return this.toHex()}xyz(){const{_a:e,_b:t,_c:n}=this.rgb(),[r,i,a]=[e,t,n].map((e=>e/255)),s=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,o=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,l=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92,c=(.4124*s+.3576*o+.1805*l)/.95047,u=(.2126*s+.7152*o+.0722*l)/1,d=(.0193*s+.1192*o+.9505*l)/1.08883,h=c>.008856?Math.pow(c,1/3):7.787*c+16/116,f=u>.008856?Math.pow(u,1/3):7.787*u+16/116,p=d>.008856?Math.pow(d,1/3):7.787*d+16/116;return new xe(h,f,p,"xyz")}_clamped(){const{_a:e,_b:t,_c:n}=this.rgb(),{max:r,min:i,round:a}=Math;return[e,t,n].map((e=>r(0,i(a(e),255))))}}class we{constructor(){this.init(...arguments)}clone(){return new we(this)}init(e,t){const n=Array.isArray(e)?{x:e[0],y:e[1]}:"object"==typeof e?{x:e.x,y:e.y}:{x:e,y:t};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(e){return this.clone().transformO(e)}transformO(e){ke.isMatrixLike(e)||(e=new ke(e));const{x:t,y:n}=this;return this.x=e.a*t+e.c*n+e.e,this.y=e.b*t+e.d*n+e.f,this}}function Ae(e,t,n){return Math.abs(t-e)<(n||1e-6)}class ke{constructor(){this.init(...arguments)}static formatTransforms(e){const t="both"===e.flip||!0===e.flip,n=e.flip&&(t||"x"===e.flip)?-1:1,r=e.flip&&(t||"y"===e.flip)?-1:1,i=e.skew&&e.skew.length?e.skew[0]:isFinite(e.skew)?e.skew:isFinite(e.skewX)?e.skewX:0,a=e.skew&&e.skew.length?e.skew[1]:isFinite(e.skew)?e.skew:isFinite(e.skewY)?e.skewY:0,s=e.scale&&e.scale.length?e.scale[0]*n:isFinite(e.scale)?e.scale*n:isFinite(e.scaleX)?e.scaleX*n:n,o=e.scale&&e.scale.length?e.scale[1]*r:isFinite(e.scale)?e.scale*r:isFinite(e.scaleY)?e.scaleY*r:r,l=e.shear||0,c=e.rotate||e.theta||0,u=new we(e.origin||e.around||e.ox||e.originX,e.oy||e.originY),d=u.x,h=u.y,f=new we(e.position||e.px||e.positionX||NaN,e.py||e.positionY||NaN),p=f.x,m=f.y,g=new we(e.translate||e.tx||e.translateX,e.ty||e.translateY),v=g.x,b=g.y,y=new we(e.relative||e.rx||e.relativeX,e.ry||e.relativeY);return{scaleX:s,scaleY:o,skewX:i,skewY:a,shear:l,theta:c,rx:y.x,ry:y.y,tx:v,ty:b,ox:d,oy:h,px:p,py:m}}static fromArray(e){return{a:e[0],b:e[1],c:e[2],d:e[3],e:e[4],f:e[5]}}static isMatrixLike(e){return null!=e.a||null!=e.b||null!=e.c||null!=e.d||null!=e.e||null!=e.f}static matrixMultiply(e,t,n){const r=e.a*t.a+e.c*t.b,i=e.b*t.a+e.d*t.b,a=e.a*t.c+e.c*t.d,s=e.b*t.c+e.d*t.d,o=e.e+e.a*t.e+e.c*t.f,l=e.f+e.b*t.e+e.d*t.f;return n.a=r,n.b=i,n.c=a,n.d=s,n.e=o,n.f=l,n}around(e,t,n){return this.clone().aroundO(e,t,n)}aroundO(e,t,n){const r=e||0,i=t||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new ke(this)}decompose(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.a,r=this.b,i=this.c,a=this.d,s=this.e,o=this.f,l=n*a-r*i,c=l>0?1:-1,u=c*Math.sqrt(n*n+r*r),d=Math.atan2(c*r,c*n),h=180/Math.PI*d,f=Math.cos(d),p=Math.sin(d),m=(n*i+r*a)/l,g=i*u/(m*n-r)||a*u/(m*r+n);return{scaleX:u,scaleY:g,shear:m,rotate:h,translateX:s-e+e*f*u+t*(m*f*u-p*g),translateY:o-t+e*p*u+t*(m*p*u+f*g),originX:e,originY:t,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const t=new ke(e);return Ae(this.a,t.a)&&Ae(this.b,t.b)&&Ae(this.c,t.c)&&Ae(this.d,t.d)&&Ae(this.e,t.e)&&Ae(this.f,t.f)}flip(e,t){return this.clone().flipO(e,t)}flipO(e,t){return"x"===e?this.scaleO(-1,1,t,0):"y"===e?this.scaleO(1,-1,0,t):this.scaleO(-1,-1,e,t||e)}init(e){const t=ke.fromArray([1,0,0,1,0,0]);return e=e instanceof Xe?e.matrixify():"string"==typeof e?ke.fromArray(e.split(me).map(parseFloat)):Array.isArray(e)?ke.fromArray(e):"object"==typeof e&&ke.isMatrixLike(e)?e:"object"==typeof e?(new ke).transform(e):6===arguments.length?ke.fromArray([].slice.call(arguments)):t,this.a=null!=e.a?e.a:t.a,this.b=null!=e.b?e.b:t.b,this.c=null!=e.c?e.c:t.c,this.d=null!=e.d?e.d:t.d,this.e=null!=e.e?e.e:t.e,this.f=null!=e.f?e.f:t.f,this}inverse(){return this.clone().inverseO()}inverseO(){const e=this.a,t=this.b,n=this.c,r=this.d,i=this.e,a=this.f,s=e*r-t*n;if(!s)throw new Error("Cannot invert "+this);const o=r/s,l=-t/s,c=-n/s,u=e/s,d=-(o*i+c*a),h=-(l*i+u*a);return this.a=o,this.b=l,this.c=c,this.d=u,this.e=d,this.f=h,this}lmultiply(e){return this.clone().lmultiplyO(e)}lmultiplyO(e){const t=e instanceof ke?e:new ke(e);return ke.matrixMultiply(t,this,this)}multiply(e){return this.clone().multiplyO(e)}multiplyO(e){const t=e instanceof ke?e:new ke(e);return ke.matrixMultiply(this,t,this)}rotate(e,t,n){return this.clone().rotateO(e,t,n)}rotateO(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e=O(e);const r=Math.cos(e),i=Math.sin(e),{a:a,b:s,c:o,d:l,e:c,f:u}=this;return this.a=a*r-s*i,this.b=s*r+a*i,this.c=o*r-l*i,this.d=l*r+o*i,this.e=c*r-u*i+n*i-t*r+t,this.f=u*r+c*i-t*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;3===arguments.length&&(r=n,n=t,t=e);const{a:i,b:a,c:s,d:o,e:l,f:c}=this;return this.a=i*e,this.b=a*t,this.c=s*e,this.d=o*t,this.e=l*e-n*e+n,this.f=c*t-r*t+r,this}shear(e,t,n){return this.clone().shearO(e,t,n)}shearO(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const{a:n,b:r,c:i,d:a,e:s,f:o}=this;return this.a=n+r*e,this.c=i+a*e,this.e=s+o*e-t*e,this}skew(){return this.clone().skewO(...arguments)}skewO(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;3===arguments.length&&(r=n,n=t,t=e),e=O(e),t=O(t);const i=Math.tan(e),a=Math.tan(t),{a:s,b:o,c:l,d:c,e:u,f:d}=this;return this.a=s+o*i,this.b=o+s*a,this.c=l+c*i,this.d=c+l*a,this.e=u+d*i-r*i,this.f=d+u*a-n*a,this}skewX(e,t,n){return this.skew(e,0,t,n)}skewY(e,t,n){return this.skew(0,e,t,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(e){if(ke.isMatrixLike(e))return new ke(e).multiplyO(this);const t=ke.formatTransforms(e),{x:n,y:r}=new we(t.ox,t.oy).transform(this),i=(new ke).translateO(t.rx,t.ry).lmultiplyO(this).translateO(-n,-r).scaleO(t.scaleX,t.scaleY).skewO(t.skewX,t.skewY).shearO(t.shear).rotateO(t.theta).translateO(n,r);if(isFinite(t.px)||isFinite(t.py)){const e=new we(n,r).transform(i),a=isFinite(t.px)?t.px-e.x:0,s=isFinite(t.py)?t.py-e.y:0;i.translateO(a,s)}return i.translateO(t.tx,t.ty),i}translate(e,t){return this.clone().translateO(e,t)}translateO(e,t){return this.e+=e||0,this.f+=t||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function Se(){if(!Se.nodes){const e=G().size(2,0);e.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),e.attr("focusable","false"),e.attr("aria-hidden","true");const t=e.path().node;Se.nodes={svg:e,path:t}}if(!Se.nodes.svg.node.parentNode){const e=Y.document.body||Y.document.documentElement;Se.nodes.svg.addTo(e)}return Se.nodes}function _e(e){return!(e.width||e.height||e.x||e.y)}J(ke,"Matrix");class Ce{constructor(){this.init(...arguments)}addOffset(){return this.x+=Y.window.pageXOffset,this.y+=Y.window.pageYOffset,new Ce(this)}init(e){return e="string"==typeof e?e.split(me).map(parseFloat):Array.isArray(e)?e:"object"==typeof e?[null!=e.left?e.left:e.x,null!=e.top?e.top:e.y,e.width,e.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=e[0]||0,this.y=e[1]||0,this.width=this.w=e[2]||0,this.height=this.h=e[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return _e(this)}merge(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),r=Math.max(this.x+this.width,e.x+e.width)-t,i=Math.max(this.y+this.height,e.y+e.height)-n;return new Ce(t,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof ke||(e=new ke(e));let t=1/0,n=-1/0,r=1/0,i=-1/0;return[new we(this.x,this.y),new we(this.x2,this.y),new we(this.x,this.y2),new we(this.x2,this.y2)].forEach((function(a){a=a.transform(e),t=Math.min(t,a.x),n=Math.max(n,a.x),r=Math.min(r,a.y),i=Math.max(i,a.y)})),new Ce(t,r,n-t,i-r)}}function je(e,t,n){let r;try{if(r=t(e.node),_e(r)&&(i=e.node)!==Y.document&&!(Y.document.documentElement.contains||function(e){for(;e.parentNode;)e=e.parentNode;return e===Y.document}).call(Y.document.documentElement,i))throw new Error("Element not in the dom")}catch(t){r=n(e)}var i;return r}E({viewbox:{viewbox(e,t,n,r){return null==e?new Ce(this.attr("viewBox")):this.attr("viewBox",new Ce(e,t,n,r))},zoom(e,t){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),a=n/i.width,s=r/i.height,o=Math.min(a,s);if(null==e)return o;let l=o/e;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),t=t||new we(n/2/a+i.x,r/2/s+i.y);const c=new Ce(i).transform(new ke({scale:l,origin:t}));return this.viewbox(c)}}}),J(Ce,"Box");class Ee extends Array{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;re.call(t,t,n,r))):this.map((t=>t[e](...n)))},toArray(){return Array.prototype.concat.apply([],this)}});const Ne=["toArray","constructor","each"];function Me(e,t){return new Ee(T((t||Y.document).querySelectorAll(e),(function(e){return K(e)})))}Ee.extend=function(e){e=e.reduce(((e,t)=>(Ne.includes(t)||"_"===t[0]||(t in Array.prototype&&(e["$"+t]=Array.prototype[t]),e[t]=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:[];return e instanceof Array?e:e.trim().split(me).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const e=[];return e.push(...this),e}}class He{constructor(){this.init(...arguments)}convert(e){return new He(this.value,e)}divide(e){return e=new He(e),new He(this/e,this.unit||e.unit)}init(e,t){return t=Array.isArray(e)?e[1]:t,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=t||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(t=e.match(ie))&&(this.value=parseFloat(t[1]),"%"===t[5]?this.value/=100:"s"===t[5]&&(this.value*=1e3),this.unit=t[5]):e instanceof He&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new He(e),new He(this-e,this.unit||e.unit)}plus(e){return e=new He(e),new He(this+e,this.unit||e.unit)}times(e){return e=new He(e),new He(this*e,this.unit||e.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Ye=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ue=[];class We extends Le{constructor(e,t){super(),this.node=e,this.type=e.nodeName,t&&e!==t&&this.attr(t)}add(e,t){return(e=G(e)).removeNamespace&&this.node instanceof Y.window.SVGElement&&e.removeNamespace(),null==t?this.node.appendChild(e.node):e.node!==this.node.childNodes[t]&&this.node.insertBefore(e.node,this.node.childNodes[t]),this}addTo(e,t){return G(e).put(this,t)}children(){return new Ee(T(this.node.children,(function(e){return K(e)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.writeDataToDom();let n=this.node.cloneNode(e);return t&&(n=te(n)),new this.constructor(n)}each(e,t){const n=this.children();let r,i;for(r=0,i=n.length;r=0}html(e,t){return this.xml(e,t,"http://www.w3.org/1999/xhtml")}id(e){return void 0!==e||this.node.id||(this.node.id=ee(this.type)),this.attr("id",e)}index(e){return[].slice.call(this.node.childNodes).indexOf(e.node)}last(){return K(this.node.lastChild)}matches(e){const t=this.node,n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return n&&n.call(t,e)}parent(e){let t=this;if(!t.node.parentNode)return null;if(t=K(t.node.parentNode),!e)return t;do{if("string"==typeof e?t.matches(e):t instanceof e)return t}while(t=K(t.node.parentNode));return t}put(e,t){return e=G(e),this.add(e,t),e}putIn(e,t){return G(e).add(this,t)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(e){return this.node.removeChild(e.node),this}replace(e){return e=G(e),this.node.parentNode&&this.node.parentNode.replaceChild(e.node,this.node),e}round(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const t=10**(arguments.length>0&&void 0!==arguments[0]?arguments[0]:2),n=this.attr(e);for(const r in n)"number"==typeof n[r]&&(n[r]=Math.round(n[r]*t)/t);return this.attr(n),this}svg(e,t){return this.xml(e,t,B)}toString(){return this.id()}words(e){return this.node.textContent=e,this}wrap(e){const t=this.parent();if(!t)return this.addTo(e);const n=t.index(this);return t.put(e,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(e,t,n){if("boolean"==typeof e&&(n=t,t=e,e=null),null==e||"function"==typeof e){t=null==t||t,this.writeDataToDom();let n=this;if(null!=e){if(n=K(n.node.cloneNode(!0)),t){const t=e(n);if(n=t||n,!1===t)return""}n.each((function(){const t=e(this),n=t||this;!1===t?this.remove():t&&this!==n&&this.replace(n)}),!0)}return t?n.node.outerHTML:n.node.innerHTML}t=null!=t&&t;const r=q("wrapper",n),i=Y.document.createDocumentFragment();r.innerHTML=e;for(let s=r.children.length;s--;)i.appendChild(r.firstElementChild);const a=this.parent();return t?this.replace(i)&&a:this.add(i)}}ne(We,{attr:function(e,t,n){if(null==e){e={},t=this.node.attributes;for(const n of t)e[n.nodeName]=fe.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return e}if(e instanceof Array)return e.reduce(((e,t)=>(e[t]=this.attr(t),e)),{});if("object"==typeof e&&e.constructor===Object)for(t in e)this.attr(t,e[t]);else if(null===t)this.node.removeAttribute(e);else{if(null==t)return null==(t=this.node.getAttribute(e))?Be[e]:fe.test(t)?parseFloat(t):t;"number"==typeof(t=Ue.reduce(((t,n)=>n(e,t,this)),t))?t=new He(t):Ye.has(e)&&xe.isColor(t)?t=new xe(t):t.constructor===Array&&(t=new ze(t)),"leading"===e?this.leading&&this.leading(t):"string"==typeof n?this.node.setAttributeNS(n,e,t.toString()):this.node.setAttribute(e,t.toString()),!this.rebuild||"font-size"!==e&&"x"!==e||this.rebuild()}return this},find:function(e){return Me(e,this.node)},findOne:function(e){return K(this.node.querySelector(e))}}),J(We,"Dom");class Xe extends We{constructor(e,t){var n,r;super(e,t),this.dom={},this.node.instance=this,(e.hasAttribute("data-svgjs")||e.hasAttribute("svgjs:data"))&&this.setData(null!==(n=null!==(r=JSON.parse(e.getAttribute("data-svgjs")))&&void 0!==r?r:JSON.parse(e.getAttribute("svgjs:data")))&&void 0!==n?n:{})}center(e,t){return this.cx(e).cy(t)}cx(e){return null==e?this.x()+this.width()/2:this.x(e-this.width()/2)}cy(e){return null==e?this.y()+this.height()/2:this.y(e-this.height()/2)}defs(){const e=this.root();return e&&e.defs()}dmove(e,t){return this.dx(e).dy(t)}dx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x(new He(e).plus(this.x()))}dy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y(new He(e).plus(this.y()))}getEventHolder(){return this}height(e){return this.attr("height",e)}move(e,t){return this.x(e).y(t)}parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.root();const t="string"==typeof e;t||(e=G(e));const n=new Ee;let r=this;for(;(r=r.parent())&&r.node!==Y.document&&"#document-fragment"!==r.nodeName&&(n.push(r),t||r.node!==e.node)&&(!t||!r.matches(e));)if(r.node===this.root().node)return null;return n}reference(e){if(!(e=this.attr(e)))return null;const t=(e+"").match(oe);return t?G(t[1]):null}root(){const e=this.parent(function(e){return X[e]}(V));return e&&e.root()}setData(e){return this.dom=e,this}size(e,t){const n=P(this,e,t);return this.width(new He(n.width)).height(new He(n.height))}width(e){return this.attr("width",e)}writeDataToDom(){return F(this,this.dom),super.writeDataToDom()}x(e){return this.attr("x",e)}y(e){return this.attr("y",e)}}ne(Xe,{bbox:function(){const e=je(this,(e=>e.getBBox()),(e=>{try{const t=e.clone().addTo(Se().svg).show(),n=t.node.getBBox();return t.remove(),n}catch(a){throw new Error('Getting bbox of element "'.concat(e.node.nodeName,'" is not possible: ').concat(a.toString()))}}));return new Ce(e)},rbox:function(e){const t=je(this,(e=>e.getBoundingClientRect()),(e=>{throw new Error('Getting rbox of element "'.concat(e.node.nodeName,'" is not possible'))})),n=new Ce(t);return e?n.transform(e.screenCTM().inverseO()):n.addOffset()},inside:function(e,t){const n=this.bbox();return e>n.x&&t>n.y&&e=0;n--)null!=t[Ve[e][n]]&&this.attr(Ve.prefix(e,Ve[e][n]),t[Ve[e][n]]);return this},E(["Element","Runner"],t)})),E(["Element","Runner"],{matrix:function(e,t,n,r,i,a){return null==e?new ke(this):this.attr("transform",new ke(e,t,n,r,i,a))},rotate:function(e,t,n){return this.transform({rotate:e,ox:t,oy:n},!0)},skew:function(e,t,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:e,ox:t,oy:n},!0):this.transform({skew:[e,t],ox:n,oy:r},!0)},shear:function(e,t,n){return this.transform({shear:e,ox:t,oy:n},!0)},scale:function(e,t,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:e,ox:t,oy:n},!0):this.transform({scale:[e,t],ox:n,oy:r},!0)},translate:function(e,t){return this.transform({translate:[e,t]},!0)},relative:function(e,t){return this.transform({relative:[e,t]},!0)},flip:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"both",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"center";return-1==="xybothtrue".indexOf(e)&&(t=e,e="both"),this.transform({flip:e,origin:t},!0)},opacity:function(e){return this.attr("opacity",e)}}),E("radius",{radius:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return"radialGradient"===(this._element||this).type?this.attr("r",new He(e)):this.rx(e).ry(t)}}),E("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(e){return new we(this.node.getPointAtLength(e))}}),E(["Element","Runner"],{font:function(e,t){if("object"==typeof e){for(t in e)this.font(t,e[t]);return this}return"leading"===e?this.leading(t):"anchor"===e?this.attr("text-anchor",t):"size"===e||"family"===e||"weight"===e||"stretch"===e||"variant"===e||"style"===e?this.attr("font-"+e,t):this.attr(e,t)}}),E("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(e,t){return e[t]=function(e){return null===e?this.off(t):this.on(t,e),this},e}),{})),E("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){const e=(this.attr("transform")||"").split(le).slice(0,-1).map((function(e){const t=e.trim().split("(");return[t[0],t[1].split(me).map((function(e){return parseFloat(e)}))]})).reverse().reduce((function(e,t){return"matrix"===t[0]?e.lmultiply(ke.fromArray(t[1])):e[t[0]].apply(e,t[1])}),new ke);return e},toParent:function(e,t){if(this===e)return this;if(L(this.node))return this.addTo(e,t);const n=this.screenCTM(),r=e.screenCTM().inverse();return this.addTo(e,t).untransform().transform(r.multiply(n)),this},toRoot:function(e){return this.toParent(this.root(),e)},transform:function(e,t){if(null==e||"string"==typeof e){const t=new ke(this).decompose();return null==e?t:t[e]}ke.isMatrixLike(e)||(e=r(r({},e),{},{origin:I(e,this)}));const n=new ke(!0===t?this:t||!1).transform(e);return this.attr("transform",n)}});class qe extends Xe{flatten(){return this.each((function(){if(this instanceof qe)return this.flatten().ungroup()})),this}ungroup(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.index(this);return t=-1===t?e.children().length:t,this.each((function(n,r){return r[r.length-n-1].toParent(e,t)})),this.remove()}}J(qe,"Container");class Ge extends qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("defs",e),t)}flatten(){return this}ungroup(){return this}}J(Ge,"Defs");class Qe extends Xe{}function Ke(e){return this.attr("rx",e)}function Ze(e){return this.attr("ry",e)}function Je(e){return null==e?this.cx()-this.rx():this.cx(e+this.rx())}function $e(e){return null==e?this.cy()-this.ry():this.cy(e+this.ry())}function et(e){return this.attr("cx",e)}function tt(e){return this.attr("cy",e)}function nt(e){return null==e?2*this.rx():this.rx(new He(e).divide(2))}function rt(e){return null==e?2*this.ry():this.ry(new He(e).divide(2))}J(Qe,"Shape");var it=Object.freeze({__proto__:null,cx:et,cy:tt,height:rt,rx:Ke,ry:Ze,width:nt,x:Je,y:$e});class at extends Qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("ellipse",e),t)}size(e,t){const n=P(this,e,t);return this.rx(new He(n.width).divide(2)).ry(new He(n.height).divide(2))}}ne(at,it),E("Container",{ellipse:re((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.put(new at).size(e,t).move(0,0)}))}),J(at,"Ellipse");class st extends We{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y.document.createDocumentFragment())}xml(e,t,n){if("boolean"==typeof e&&(n=t,t=e,e=null),null==e||"function"==typeof e){const e=new We(q("wrapper",n));return e.add(this.node.cloneNode(!0)),e.xml(!1,n)}return super.xml(e,!1,n)}}function ot(e,t){return"radialGradient"===(this._element||this).type?this.attr({fx:new He(e),fy:new He(t)}):this.attr({x1:new He(e),y1:new He(t)})}function lt(e,t){return"radialGradient"===(this._element||this).type?this.attr({cx:new He(e),cy:new He(t)}):this.attr({x2:new He(e),y2:new He(t)})}J(st,"Fragment");var ct=Object.freeze({__proto__:null,from:ot,to:lt});class ut extends qe{constructor(e,t){super(Q(e+"Gradient","string"==typeof e?null:e),t)}attr(e,t,n){return"transform"===e&&(e="gradientTransform"),super.attr(e,t,n)}bbox(){return new Ce}targets(){return Me("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(e){return this.clear(),"function"==typeof e&&e.call(this,this),this}url(){return"url(#"+this.id()+")"}}ne(ut,ct),E({Container:{gradient(){return this.defs().gradient(...arguments)}},Defs:{gradient:re((function(e,t){return this.put(new ut(e)).update(t)}))}}),J(ut,"Gradient");class dt extends qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("pattern",e),t)}attr(e,t,n){return"transform"===e&&(e="patternTransform"),super.attr(e,t,n)}bbox(){return new Ce}targets(){return Me("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(e){return this.clear(),"function"==typeof e&&e.call(this,this),this}url(){return"url(#"+this.id()+")"}}E({Container:{pattern(){return this.defs().pattern(...arguments)}},Defs:{pattern:re((function(e,t,n){return this.put(new dt).update(n).attr({x:0,y:0,width:e,height:t,patternUnits:"userSpaceOnUse"})}))}}),J(dt,"Pattern");let ht=class extends Qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("image",e),t)}load(e,t){if(!e)return this;const n=new Y.window.Image;return Ie(n,"load",(function(e){const r=this.parent(dt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof dt&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof t&&t.call(this,e)}),this),Ie(n,"load error",(function(){De(n)})),this.attr("href",n.src=e,H)}};var ft;ft=function(e,t,n){return"fill"!==e&&"stroke"!==e||pe.test(t)&&(t=n.root().defs().image(t)),t instanceof ht&&(t=n.root().defs().pattern(0,0,(e=>{e.add(t)}))),t},Ue.push(ft),E({Container:{image:re((function(e,t){return this.put(new ht).size(0,0).load(e,t)}))}}),J(ht,"Image");class pt extends ze{bbox(){let e=-1/0,t=-1/0,n=1/0,r=1/0;return this.forEach((function(i){e=Math.max(i[0],e),t=Math.max(i[1],t),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new Ce(n,r,e-n,t-r)}move(e,t){const n=this.bbox();if(e-=n.x,t-=n.y,!isNaN(e)&&!isNaN(t))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+e,this[r][1]+t];return this}parse(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0];const t=[];(e=e instanceof Array?Array.prototype.concat.apply([],e):e.trim().split(me).map(parseFloat)).length%2!=0&&e.pop();for(let n=0,r=e.length;n=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*e/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*t/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const e=[];for(let t=0,n=this.length;t1&&void 0!==arguments[1]?arguments[1]:e;super(Q("line",e),t)}array(){return new pt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(e,t){return this.attr(this.array().move(e,t).toLine())}plot(e,t,n,r){return null==e?this.array():(e=void 0!==t?{x1:e,y1:t,x2:n,y2:r}:new pt(e).toLine(),this.attr(e))}size(e,t){const n=P(this,e,t);return this.attr(this.array().size(n.width,n.height).toLine())}};ne(vt,gt),E({Container:{line:re((function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:e;super(Q("marker",e),t)}height(e){return this.attr("markerHeight",e)}orient(e){return this.attr("orient",e)}ref(e,t){return this.attr("refX",e).attr("refY",t)}toString(){return"url(#"+this.id()+")"}update(e){return this.clear(),"function"==typeof e&&e.call(this,this),this}width(e){return this.attr("markerWidth",e)}};function yt(e,t){return function(n){return null==n?this[e]:(this[e]=n,t&&t.call(this),this)}}E({Container:{marker(){return this.defs().marker(...arguments)}},Defs:{marker:re((function(e,t,n){return this.put(new bt).size(e,t).ref(e/2,t/2).viewbox(0,0,e,t).attr("orient","auto").update(n)}))},marker:{marker(e,t,n,r){let i=["marker"];return"all"!==e&&i.push(e),i=i.join("-"),e=arguments[1]instanceof bt?arguments[1]:this.defs().marker(t,n,r),this.attr(i,e)}}}),J(bt,"Marker");const xt={"-":function(e){return e},"<>":function(e){return-Math.cos(e*Math.PI)/2+.5},">":function(e){return Math.sin(e*Math.PI/2)},"<":function(e){return 1-Math.cos(e*Math.PI/2)},bezier:function(e,t,n,r){return function(i){return i<0?e>0?t/e*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):e<1?(1-t)/(1-e)*i+(t-e)/(1-e):1:3*i*(1-i)**2*t+3*i**2*(1-i)*r+i**3}},steps:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"end";t=t.split("-").reverse()[0];let n=e;return"none"===t?--n:"both"===t&&++n,function(r){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=Math.floor(r*e);const s=r*a%1==0;return"start"!==t&&"both"!==t||++a,i&&s&&--a,r>=0&&a<0&&(a=0),r<=1&&a>n&&(a=n),a/n}}};class wt{done(){return!1}}class At extends wt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:">";super(),this.ease=xt[e]||e}step(e,t,n){return"number"!=typeof e?n<1?e:t:e+(t-e)*this.ease(n)}}class kt extends wt{constructor(e){super(),this.stepper=e}done(e){return e.done}step(e,t,n,r){return this.stepper(e,t,n,r)}}function St(){const e=(this._duration||500)/1e3,t=this._overshoot||0,n=Math.PI,r=Math.log(t/100+1e-10),i=-r/Math.sqrt(n*n+r*r),a=3.9/(i*e);this.d=2*i*a,this.k=a*a}ne(class extends kt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(),this.duration(e).overshoot(t)}step(e,t,n,r){if("string"==typeof e)return e;if(r.done=n===1/0,n===1/0)return t;if(0===n)return e;n>100&&(n=16),n/=1e3;const i=r.velocity||0,a=-this.d*i-this.k*(e-t),s=e+i*n+a*n*n/2;return r.velocity=i+a*n,r.done=Math.abs(t-s)+Math.abs(i)<.002,r.done?t:s}},{duration:yt("_duration",St),overshoot:yt("_overshoot",St)}),ne(class extends kt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.01,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;super(),this.p(e).i(t).d(n).windup(r)}step(e,t,n,r){if("string"==typeof e)return e;if(r.done=n===1/0,n===1/0)return t;if(0===n)return e;const i=t-e;let a=(r.integral||0)+i*n;const s=(i-(r.error||0))/n,o=this._windup;return!1!==o&&(a=Math.max(-o,Math.min(a,o))),r.error=i,r.integral=a,r.done=Math.abs(i)<.001,r.done?t:e+(this.P*i+this.I*a+this.D*s)}},{windup:yt("_windup"),p:yt("P"),i:yt("I"),d:yt("D")});const _t={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ct={M:function(e,t,n){return t.x=n.x=e[0],t.y=n.y=e[1],["M",t.x,t.y]},L:function(e,t){return t.x=e[0],t.y=e[1],["L",e[0],e[1]]},H:function(e,t){return t.x=e[0],["H",e[0]]},V:function(e,t){return t.y=e[0],["V",e[0]]},C:function(e,t){return t.x=e[4],t.y=e[5],["C",e[0],e[1],e[2],e[3],e[4],e[5]]},S:function(e,t){return t.x=e[2],t.y=e[3],["S",e[0],e[1],e[2],e[3]]},Q:function(e,t){return t.x=e[2],t.y=e[3],["Q",e[0],e[1],e[2],e[3]]},T:function(e,t){return t.x=e[0],t.y=e[1],["T",e[0],e[1]]},Z:function(e,t,n){return t.x=n.x,t.y=n.y,["Z"]},A:function(e,t){return t.x=e[5],t.y=e[6],["A",e[0],e[1],e[2],e[3],e[4],e[5],e[6]]}},jt="mlhvqtcsaz".split("");for(let j=0,fi=jt.length;j=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=e,this[i][2]+=t):"H"===r?this[i][1]+=e:"V"===r?this[i][1]+=t:"C"===r||"S"===r||"Q"===r?(this[i][1]+=e,this[i][2]+=t,this[i][3]+=e,this[i][4]+=t,"C"===r&&(this[i][5]+=e,this[i][6]+=t)):"A"===r&&(this[i][6]+=e,this[i][7]+=t);return this}parse(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"M0 0";return Array.isArray(e)&&(e=Array.prototype.concat.apply([],e).toString()),function(e){let t=0,n="";const r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:!(arguments.length>1&&void 0!==arguments[1])||arguments[1],p0:new we,p:new we};for(;r.lastToken=n,n=e.charAt(t++);)if(r.inSegment||!Nt(r,n))if("."!==n)if(isNaN(parseInt(n)))if(Pt.has(n))r.inNumber&&Mt(r,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(ge.test(n)){if(r.inNumber)Mt(r,!1);else{if(!Et(r))throw new Error("parser Error");Tt(r)}--t}}else r.number+=n,r.hasExponent=!0;else{if(r.inNumber&&!Rt(r)){Mt(r,!1),--t;continue}r.number+=n,r.inNumber=!0}else{if("0"===r.number||Ot(r)){r.inNumber=!0,r.number=n,Mt(r,!0);continue}r.inNumber=!0,r.number+=n}else{if(r.pointSeen||r.hasExponent){Mt(r,!1),--t;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=n}return r.inNumber&&Mt(r,!1),r.inSegment&&Et(r)&&Tt(r),r.segments}(e)}size(e,t){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*e/n.width+n.x,this[r][2]=(this[r][2]-n.y)*t/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*e/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*t/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*e/n.width+n.x,this[r][2]=(this[r][2]-n.y)*t/n.height+n.y,this[r][3]=(this[r][3]-n.x)*e/n.width+n.x,this[r][4]=(this[r][4]-n.y)*t/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*e/n.width+n.x,this[r][6]=(this[r][6]-n.y)*t/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*e/n.width,this[r][2]=this[r][2]*t/n.height,this[r][6]=(this[r][6]-n.x)*e/n.width+n.x,this[r][7]=(this[r][7]-n.y)*t/n.height+n.y);return this}toString(){return function(e){let t="";for(let n=0,r=e.length;n{const t=typeof e;return"number"===t?He:"string"===t?xe.isColor(e)?xe:me.test(e)?ge.test(e)?It:ze:ie.test(e)?He:Ft:Yt.indexOf(e.constructor)>-1?e.constructor:Array.isArray(e)?ze:"object"===t?Ht:Ft};class Lt{constructor(e){this._stepper=e||new At("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(e){return this._morphObj.morph(this._from,this._to,e,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(e,t){return e&&t}),!0)}from(e){return null==e?this._from:(this._from=this._set(e),this)}stepper(e){return null==e?this._stepper:(this._stepper=e,this)}to(e){return null==e?this._to:(this._to=this._set(e),this)}type(e){return null==e?this._type:(this._type=e,this)}_set(e){this._type||this.type(Dt(e));let t=new this._type(e);return this._type===xe&&(t=this._to?t[this._to[4]]():this._from?t[this._from[4]]():t),this._type===Ht&&(t=this._to?t.align(this._to):this._from?t.align(this._from):t),t=t.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(t.length)).map(Object).map((function(e){return e.done=!0,e})),t}}class Ft{constructor(){this.init(...arguments)}init(e){return e=Array.isArray(e)?e[0]:e,this.value=e,this}toArray(){return[this.value]}valueOf(){return this.value}}class Bt{constructor(){this.init(...arguments)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,Bt.defaults,e),this}toArray(){const e=this;return[e.scaleX,e.scaleY,e.shear,e.rotate,e.translateX,e.translateY,e.originX,e.originY]}}Bt.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const zt=(e,t)=>e[0]t[0]?1:0;class Ht{constructor(){this.init(...arguments)}align(e){const t=this.values;for(let n=0,r=t.length;ne.concat(t)),[]),this}toArray(){return this.values}valueOf(){const e={},t=this.values;for(;t.length;){const n=t.shift(),r=t.shift(),i=t.shift(),a=t.splice(0,i);e[n]=new r(a)}return e}}const Yt=[Ft,Bt,Ht];class Ut extends Qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("path",e),t)}array(){return this._array||(this._array=new It(this.attr("d")))}clear(){return delete this._array,this}height(e){return null==e?this.bbox().height:this.size(this.bbox().width,e)}move(e,t){return this.attr("d",this.array().move(e,t))}plot(e){return null==e?this.array():this.clear().attr("d","string"==typeof e?e:this._array=new It(e))}size(e,t){const n=P(this,e,t);return this.attr("d",this.array().size(n.width,n.height))}width(e){return null==e?this.bbox().width:this.size(e,this.bbox().height)}x(e){return null==e?this.bbox().x:this.move(e,this.bbox().y)}y(e){return null==e?this.bbox().y:this.move(this.bbox().x,e)}}Ut.prototype.MorphArray=It,E({Container:{path:re((function(e){return this.put(new Ut).plot(e||new It)}))}}),J(Ut,"Path");var Wt=Object.freeze({__proto__:null,array:function(){return this._array||(this._array=new pt(this.attr("points")))},clear:function(){return delete this._array,this},move:function(e,t){return this.attr("points",this.array().move(e,t))},plot:function(e){return null==e?this.array():this.clear().attr("points","string"==typeof e?e:this._array=new pt(e))},size:function(e,t){const n=P(this,e,t);return this.attr("points",this.array().size(n.width,n.height))}});class Xt extends Qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("polygon",e),t)}}E({Container:{polygon:re((function(e){return this.put(new Xt).plot(e||new pt)}))}}),ne(Xt,gt),ne(Xt,Wt),J(Xt,"Polygon");class Vt extends Qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("polyline",e),t)}}E({Container:{polyline:re((function(e){return this.put(new Vt).plot(e||new pt)}))}}),ne(Vt,gt),ne(Vt,Wt),J(Vt,"Polyline");class qt extends Qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("rect",e),t)}}ne(qt,{rx:Ke,ry:Ze}),E({Container:{rect:re((function(e,t){return this.put(new qt).size(e,t)}))}}),J(qt,"Rect");class Gt{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(e){const t=void 0!==e.next?e:{value:e,next:null,prev:null};return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._last=t,this._first=t),t}remove(e){e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this._last&&(this._last=e.prev),e===this._first&&(this._first=e.next),e.prev=null,e.next=null}shift(){const e=this._first;return e?(this._first=e.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,e.value):null}}const Qt={nextDraw:null,frames:new Gt,timeouts:new Gt,immediates:new Gt,timer:()=>Y.window.performance||Y.window.Date,transforms:[],frame(e){const t=Qt.frames.push({run:e});return null===Qt.nextDraw&&(Qt.nextDraw=Y.window.requestAnimationFrame(Qt._draw)),t},timeout(e,t){t=t||0;const n=Qt.timer().now()+t,r=Qt.timeouts.push({run:e,time:n});return null===Qt.nextDraw&&(Qt.nextDraw=Y.window.requestAnimationFrame(Qt._draw)),r},immediate(e){const t=Qt.immediates.push(e);return null===Qt.nextDraw&&(Qt.nextDraw=Y.window.requestAnimationFrame(Qt._draw)),t},cancelFrame(e){null!=e&&Qt.frames.remove(e)},clearTimeout(e){null!=e&&Qt.timeouts.remove(e)},cancelImmediate(e){null!=e&&Qt.immediates.remove(e)},_draw(e){let t=null;const n=Qt.timeouts.last();for(;(t=Qt.timeouts.shift())&&(e>=t.time?t.run():Qt.timeouts.push(t),t!==n););let r=null;const i=Qt.frames.last();for(;r!==i&&(r=Qt.frames.shift());)r.run(e);let a=null;for(;a=Qt.immediates.shift();)a();Qt.nextDraw=Qt.timeouts.first()||Qt.frames.first()?Y.window.requestAnimationFrame(Qt._draw):null}},Kt=function(e){const t=e.start,n=e.runner.duration();return{start:t,duration:n,end:t+n,runner:e.runner}},Zt=function(){const e=Y.window;return(e.performance||e.Date).now()};class Jt extends Le{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zt;super(),this._timeSource=e,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const e=this.getLastRunnerInfo(),t=e?e.runner.duration():0;return(e?e.start:this._time)+t}getEndTimeOfTimeline(){const e=this._runners.map((e=>e.start+e.runner.duration()));return Math.max(0,...e)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(e){return this._runners[this._runnerIds.indexOf(e)]||null}pause(){return this._paused=!0,this._continue()}persist(e){return null==e?this._persist:(this._persist=e,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(e){const t=this.speed();if(null==e)return this.speed(-t);const n=Math.abs(t);return this.speed(e?-n:n)}schedule(e,t,n){if(null==e)return this._runners.map(Kt);let r=0;const i=this.getEndTime();if(t=t||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=t,t=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(e.id);n&&(r=n.start+t,t=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const e=this.getLastRunnerInfo();r=e?e.start:this._time}}e.unschedule(),e.timeline(this);const a=e.persist(),s={persist:null===a?this._persist:a,start:r+t,runner:e};return this._lastRunnerId=e.id,this._runners.push(s),this._runners.sort(((e,t)=>e.start-t.start)),this._runnerIds=this._runners.map((e=>e.runner.id)),this.updateTime()._continue(),this}seek(e){return this.time(this._time+e)}source(e){return null==e?this._timeSource:(this._timeSource=e,this)}speed(e){return null==e?this._speed:(this._speed=e,this)}stop(){return this.time(0),this.pause()}time(e){return null==e?this._time:(this._time=e,this._continue(!0))}unschedule(e){const t=this._runnerIds.indexOf(e.id);return t<0||(this._runners.splice(t,1),this._runnerIds.splice(t,1),e.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Qt.cancelFrame(this._nextFrame),this._nextFrame=null,e?this._stepImmediate():(this._paused||(this._nextFrame=Qt.frame(this._step)),this)}_stepFn(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this._timeSource();let n=t-this._lastSourceTime;e&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=t,e||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let a=this._runners.length;a--;){const e=this._runners[a],t=e.runner;this._time-e.start<=0&&t.reset()}let i=!1;for(let a=0,s=this._runners.length;a0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}E({Element:{timeline:function(e){return null==e?(this._timeline=this._timeline||new Jt,this._timeline):(this._timeline=e,this)}}});class $t extends Le{constructor(e){super(),this.id=$t.id++,e="function"==typeof(e=null==e?400:e)?new kt(e):e,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof kt,this._stepper=this._isDeclarative?e:new At,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ke,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(e,t,n){var r,i,a,s,o,l,c;let u=1,d=!1,h=0;return t=null!==(r=t)&&void 0!==r?r:0,n=n||"last","object"!=typeof(e=null!==(i=e)&&void 0!==i?i:400)||e instanceof wt||(t=null!==(a=e.delay)&&void 0!==a?a:t,n=null!==(s=e.when)&&void 0!==s?s:n,d=e.swing||d,u=null!==(o=e.times)&&void 0!==o?o:u,h=null!==(l=e.wait)&&void 0!==l?l:h,e=null!==(c=e.duration)&&void 0!==c?c:400),{duration:e,delay:t,swing:d,times:u,wait:h,when:n}}active(e){return null==e?this.enabled:(this.enabled=e,this)}addTransform(e){return this.transforms.lmultiplyO(e),this}after(e){return this.on("finished",e)}animate(e,t,n){const r=$t.sanitise(e,t,n),i=new $t(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new ke,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((e=>!e.isTransform)))}delay(e){return this.animate(0,e)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(e){return this.queue(null,e)}ease(e){return this._stepper=new At(e),this}element(e){return null==e?this._element:(this._element=e,e._prepareRunner(),this)}finish(){return this.step(1/0)}loop(e,t,n){return"object"==typeof e&&(t=e.swing,n=e.wait,e=e.times),this._times=e||1/0,this._swing=t||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(e){const t=this._duration+this._wait;if(null==e){const e=Math.floor(this._time/t),n=(this._time-e*t)/this._duration;return Math.min(e+n,this._times)}const n=e%1,r=t*Math.floor(e)+this._duration*n;return this.time(r)}persist(e){return null==e?this._persist:(this._persist=e,this)}position(e){const t=this._time,n=this._duration,r=this._wait,i=this._times,a=this._swing,s=this._reverse;let o;if(null==e){const e=function(e){const t=a*Math.floor(e%(2*(r+n))/(r+n)),i=t&&!s||!t&&s,o=Math.pow(-1,i)*(e%(r+n))/n+i;return Math.max(Math.min(o,1),0)},l=i*(r+n)-r;return o=t<=0?Math.round(e(1e-5)):t=0;this._lastPosition=t;const r=this.duration(),i=this._lastTime<=0&&this._time>0,a=this._lastTime=r;this._lastTime=this._time,i&&this.fire("start",this);const s=this._isDeclarative;this.done=!s&&!a&&this._time>=r,this._reseted=!1;let o=!1;return(n||s)&&(this._initialise(n),this.transforms=new ke,o=this._run(s?e:t),this.fire("step",this)),this.done=this.done||o&&s,a&&this.fire("finished",this),this}time(e){if(null==e)return this._time;const t=e-this._time;return this.step(t),this}timeline(e){return void 0===e?this._timeline:(this._timeline=e,this)}unschedule(){const e=this.timeline();return e&&e.unschedule(this),this}_initialise(e){if(e||this._isDeclarative)for(let t=0,n=this._queue.length;t0&&void 0!==arguments[0]?arguments[0]:new ke,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.transforms=e,this.id=t,this.done=n}clearTransformsFromQueue(){}}ne([$t,en],{mergeWith(e){return new en(e.transforms.lmultiply(this.transforms),e.id)}});const tn=(e,t)=>e.lmultiplyO(t),nn=e=>e.transforms;function rn(){const e=this._transformationRunners.runners.map(nn).reduce(tn,new ke);this.transform(e),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class an{constructor(){this.runners=[],this.ids=[]}add(e){if(this.runners.includes(e))return;const t=e.id+1;return this.runners.push(e),this.ids.push(t),this}clearBefore(e){const t=this.ids.indexOf(e+1)||1;return this.ids.splice(0,t,0),this.runners.splice(0,t,new en).forEach((e=>e.clearTransformsFromQueue())),this}edit(e,t){const n=this.ids.indexOf(e+1);return this.ids.splice(n,1,e+1),this.runners.splice(n,1,t),this}getByID(e){return this.runners[this.ids.indexOf(e+1)]}length(){return this.ids.length}merge(){let e=null;for(let t=0;tt.id<=e.id)).map(nn).reduce(tn,new ke)},_addRunner(e){this._transformationRunners.add(e),Qt.cancelImmediate(this._frameId),this._frameId=Qt.immediate(rn.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new an).add(new en(new ke(this))))}}}),ne($t,{attr(e,t){return this.styleAttr("attr",e,t)},css(e,t){return this.styleAttr("css",e,t)},styleAttr(e,t,n){if("string"==typeof t)return this.styleAttr(e,{[t]:n});let r=t;if(this._tryRetarget(e,r))return this;let i=new Lt(this._stepper).to(r),a=Object.keys(r);return this.queue((function(){i=i.from(this.element()[e](a))}),(function(t){return this.element()[e](i.at(t).valueOf()),i.done()}),(function(t){const n=Object.keys(t),s=(o=a,n.filter((e=>!o.includes(e))));var o;if(s.length){const t=this.element()[e](s),n=new Ht(i.from()).valueOf();Object.assign(n,t),i.from(n)}const l=new Ht(i.to()).valueOf();Object.assign(l,t),i.to(l),a=n,r=t})),this._rememberMorpher(e,i),this},zoom(e,t){if(this._tryRetarget("zoom",e,t))return this;let n=new Lt(this._stepper).to(new He(e));return this.queue((function(){n=n.from(this.element().zoom())}),(function(e){return this.element().zoom(n.at(e),t),n.done()}),(function(e,r){t=r,n.to(e)})),this._rememberMorpher("zoom",n),this},transform(e,t,n){if(t=e.relative||t,this._isDeclarative&&!t&&this._tryRetarget("transform",e))return this;const i=ke.isMatrixLike(e);n=null!=e.affine?e.affine:null!=n?n:!i;const a=new Lt(this._stepper).type(n?Bt:ke);let s,o,l,c,u;return this.queue((function(){o=o||this.element(),s=s||I(e,o),u=new ke(t?void 0:o),o._addRunner(this),t||o._clearTransformRunnersBefore(this)}),(function(d){t||this.clearTransform();const{x:h,y:f}=new we(s).transform(o._currentTransform(this));let p=new ke(r(r({},e),{},{origin:[h,f]})),m=this._isDeclarative&&l?l:u;if(n){p=p.decompose(h,f),m=m.decompose(h,f);const e=p.rotate,t=m.rotate,n=[e-360,e,e+360],r=n.map((e=>Math.abs(e-t))),i=Math.min(...r),a=r.indexOf(i);p.rotate=n[a]}t&&(i||(p.rotate=e.rotate||0),this._isDeclarative&&c&&(m.rotate=c)),a.from(m),a.to(p);const g=a.at(d);return c=g.rotate,l=new ke(g),this.addTransform(l),o._addRunner(this),a.done()}),(function(t){(t.origin||"center").toString()!==(e.origin||"center").toString()&&(s=I(t,o)),e=r(r({},t),{},{origin:s})}),!0),this._isDeclarative&&this._rememberMorpher("transform",a),this},x(e){return this._queueNumber("x",e)},y(e){return this._queueNumber("y",e)},ax(e){return this._queueNumber("ax",e)},ay(e){return this._queueNumber("ay",e)},dx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this._queueNumberDelta("x",e)},dy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this._queueNumberDelta("y",e)},dmove(e,t){return this.dx(e).dy(t)},_queueNumberDelta(e,t){if(t=new He(t),this._tryRetarget(e,t))return this;const n=new Lt(this._stepper).to(t);let r=null;return this.queue((function(){r=this.element()[e](),n.from(r),n.to(r+t)}),(function(t){return this.element()[e](n.at(t)),n.done()}),(function(e){n.to(r+new He(e))})),this._rememberMorpher(e,n),this},_queueObject(e,t){if(this._tryRetarget(e,t))return this;const n=new Lt(this._stepper).to(t);return this.queue((function(){n.from(this.element()[e]())}),(function(t){return this.element()[e](n.at(t)),n.done()})),this._rememberMorpher(e,n),this},_queueNumber(e,t){return this._queueObject(e,new He(t))},cx(e){return this._queueNumber("cx",e)},cy(e){return this._queueNumber("cy",e)},move(e,t){return this.x(e).y(t)},amove(e,t){return this.ax(e).ay(t)},center(e,t){return this.cx(e).cy(t)},size(e,t){let n;return e&&t||(n=this._element.bbox()),e||(e=n.width/n.height*t),t||(t=n.height/n.width*e),this.width(e).height(t)},width(e){return this._queueNumber("width",e)},height(e){return this._queueNumber("height",e)},plot(e,t,n,r){if(4===arguments.length)return this.plot([e,t,n,r]);if(this._tryRetarget("plot",e))return this;const i=new Lt(this._stepper).type(this._element.MorphArray).to(e);return this.queue((function(){i.from(this._element.array())}),(function(e){return this._element.plot(i.at(e)),i.done()})),this._rememberMorpher("plot",i),this},leading(e){return this._queueNumber("leading",e)},viewbox(e,t,n,r){return this._queueObject("viewbox",new Ce(e,t,n,r))},update(e){return"object"!=typeof e?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=e.opacity&&this.attr("stop-opacity",e.opacity),null!=e.color&&this.attr("stop-color",e.color),null!=e.offset&&this.attr("offset",e.offset),this)}}),ne($t,{rx:Ke,ry:Ze,from:ot,to:lt}),J($t,"Runner");class sn extends qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("svg",e),t),this.namespace()}defs(){return this.isRoot()?K(this.node.querySelector("defs"))||this.put(new Ge):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof Y.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:B,version:"1.1"}).attr("xmlns:xlink",H,z):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,z).attr("xmlns:svgjs",null,z)}root(){return this.isRoot()?this:super.root()}}E({Container:{nested:re((function(){return this.put(new sn)}))}}),J(sn,"Svg",!0);let on=class extends qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("symbol",e),t)}};E({Container:{symbol:re((function(){return this.put(new on)}))}}),J(on,"Symbol");var ln=Object.freeze({__proto__:null,amove:function(e,t){return this.ax(e).ay(t)},ax:function(e){return this.attr("x",e)},ay:function(e){return this.attr("y",e)},build:function(e){return this._build=!!e,this},center:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.bbox();return this.cx(e,n).cy(t,n)},cx:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.bbox();return null==e?t.cx:this.attr("x",this.attr("x")+e-t.cx)},cy:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.bbox();return null==e?t.cy:this.attr("y",this.attr("y")+e-t.cy)},length:function(){return this.node.getComputedTextLength()},move:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.bbox();return this.x(e,n).y(t,n)},plain:function(e){return!1===this._build&&this.clear(),this.node.appendChild(Y.document.createTextNode(e)),this},x:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.bbox();return null==e?t.x:this.attr("x",this.attr("x")+e-t.x)},y:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.bbox();return null==e?t.y:this.attr("y",this.attr("y")+e-t.y)}});class cn extends Qe{constructor(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("text",e),n),this.dom.leading=null!==(t=this.dom.leading)&&void 0!==t?t:new He(1.3),this._rebuild=!0,this._build=!1}leading(e){return null==e?this.dom.leading:(this.dom.leading=new He(e),this.rebuild())}rebuild(e){if("boolean"==typeof e&&(this._rebuild=e),this._rebuild){const e=this;let t=0;const n=this.dom.leading;this.each((function(r){if(L(this.node))return;const i=Y.window.getComputedStyle(this.node).getPropertyValue("font-size"),a=n*new He(i);this.dom.newLined&&(this.attr("x",e.attr("x")),"\n"===this.text()?t+=a:(this.attr("dy",r?a+t:0),t=0))})),this.fire("rebuild")}return this}setData(e){return this.dom=e,this.dom.leading=new He(e.leading||1.3),this}writeDataToDom(){return F(this,this.dom,{leading:1.3}),this}text(e){if(void 0===e){const t=this.node.childNodes;let n=0;e="";for(let r=0,i=t.length;r0&&void 0!==arguments[0]?arguments[0]:"";return this.put(new cn).text(e)})),plain:re((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.put(new cn).plain(e)}))}}),J(cn,"Text");class un extends Qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("tspan",e),t),this._build=!1}dx(e){return this.attr("dx",e)}dy(e){return this.attr("dy",e)}newLine(){this.dom.newLined=!0;const e=this.parent();if(!(e instanceof cn))return this;const t=e.index(this),n=Y.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=e.dom.leading*new He(n);return this.dy(t?r:0).attr("x",e.x())}text(e){return null==e?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof e?(this.clear().build(!0),e.call(this,this),this.build(!1)):this.plain(e),this)}}ne(un,ln),E({Tspan:{tspan:re((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=new un;return this._build||this.clear(),this.put(t).text(e)}))},Text:{newLine:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.tspan(e).newLine()}}}),J(un,"Tspan");class dn extends Qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("circle",e),t)}radius(e){return this.attr("r",e)}rx(e){return this.attr("r",e)}ry(e){return this.rx(e)}size(e){return this.radius(new He(e).divide(2))}}ne(dn,{x:Je,y:$e,cx:et,cy:tt,width:nt,height:rt}),E({Container:{circle:re((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.put(new dn).size(e).move(0,0)}))}}),J(dn,"Circle");class hn extends qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("clipPath",e),t)}remove(){return this.targets().forEach((function(e){e.unclip()})),super.remove()}targets(){return Me("svg [clip-path*="+this.id()+"]")}}E({Container:{clip:re((function(){return this.defs().put(new hn)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(e){const t=e instanceof hn?e:this.parent().clip().add(e);return this.attr("clip-path","url(#"+t.id()+")")},unclip(){return this.attr("clip-path",null)}}}),J(hn,"ClipPath");class fn extends Xe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("foreignObject",e),t)}}E({Container:{foreignObject:re((function(e,t){return this.put(new fn).size(e,t)}))}}),J(fn,"ForeignObject");var pn=Object.freeze({__proto__:null,dmove:function(e,t){return this.children().forEach((n=>{let r;try{r=n.node instanceof U().SVGSVGElement?new Ce(n.attr(["x","y","width","height"])):n.bbox()}catch(e){return}const i=new ke(n),a=i.translate(e,t).transform(i.inverse()),s=new we(r.x,r.y).transform(a);n.move(s.x,s.y)})),this},dx:function(e){return this.dmove(e,0)},dy:function(e){return this.dmove(0,e)},height:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.bbox();return null==e?t.height:this.size(t.width,e,t)},move:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.bbox();const r=e-n.x,i=t-n.y;return this.dmove(r,i)},size:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.bbox();const r=P(this,e,t,n),i=r.width/n.width,a=r.height/n.height;return this.children().forEach((e=>{const t=new we(n).transform(new ke(e).inverse());e.scale(i,a,t.x,t.y)})),this},width:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.bbox();return null==e?t.width:this.size(e,t.height,t)},x:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.bbox();return null==e?t.x:this.move(e,t.y,t)},y:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.bbox();return null==e?t.y:this.move(t.x,e,t)}});class mn extends qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("g",e),t)}}ne(mn,pn),E({Container:{group:re((function(){return this.put(new mn)}))}}),J(mn,"G");class gn extends qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("a",e),t)}target(e){return this.attr("target",e)}to(e){return this.attr("href",e,H)}}ne(gn,pn),E({Container:{link:re((function(e){return this.put(new gn).to(e)}))},Element:{unlink(){const e=this.linker();if(!e)return this;const t=e.parent();if(!t)return this.remove();const n=t.index(e);return t.add(this,n),e.remove(),this},linkTo(e){let t=this.linker();return t||(t=new gn,this.wrap(t)),"function"==typeof e?e.call(t,t):t.to(e),this},linker(){const e=this.parent();return e&&"a"===e.node.nodeName.toLowerCase()?e:null}}}),J(gn,"A");class vn extends qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("mask",e),t)}remove(){return this.targets().forEach((function(e){e.unmask()})),super.remove()}targets(){return Me("svg [mask*="+this.id()+"]")}}E({Container:{mask:re((function(){return this.defs().put(new vn)}))},Element:{masker(){return this.reference("mask")},maskWith(e){const t=e instanceof vn?e:this.parent().mask().add(e);return this.attr("mask","url(#"+t.id()+")")},unmask(){return this.attr("mask",null)}}}),J(vn,"Mask");class bn extends Xe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("stop",e),t)}update(e){return("number"==typeof e||e instanceof He)&&(e={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=e.opacity&&this.attr("stop-opacity",e.opacity),null!=e.color&&this.attr("stop-color",e.color),null!=e.offset&&this.attr("offset",new He(e.offset)),this}}E({Gradient:{stop:function(e,t,n){return this.put(new bn).update(e,t,n)}}}),J(bn,"Stop");class yn extends Xe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("style",e),t)}addText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.node.textContent+=e,this}font(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.rule("@font-face",r({fontFamily:e,src:t},n))}rule(e,t){return this.addText(function(e,t){if(!e)return"";if(!t)return e;let n=e+"{";for(const r in t)n+=r.replace(/([A-Z])/g,(function(e,t){return"-"+t.toLowerCase()}))+":"+t[r]+";";return n+="}",n}(e,t))}}E("Dom",{style(e,t){return this.put(new yn).rule(e,t)},fontface(e,t,n){return this.put(new yn).font(e,t,n)}}),J(yn,"Style");class xn extends cn{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("textPath",e),t)}array(){const e=this.track();return e?e.array():null}plot(e){const t=this.track();let n=null;return t&&(n=t.plot(e)),null==e?n:this}track(){return this.reference("href")}}E({Container:{textPath:re((function(e,t){return e instanceof cn||(e=this.text(e)),e.path(t)}))},Text:{path:re((function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=new xn;let r;if(e instanceof Ut||(e=this.defs().path(e)),n.attr("href","#"+e,H),t)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:re((function(e){return e instanceof cn||(e=(new cn).addTo(this.parent()).text(e)),e.path(this)})),targets(){return Me("svg textPath").filter((e=>(e.attr("href")||"").includes(this.id())))}}}),xn.prototype.MorphArray=It,J(xn,"TextPath");class wn extends Qe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;super(Q("use",e),t)}use(e,t){return this.attr("href",(t||"")+"#"+e,H)}}E({Container:{use:re((function(e,t){return this.put(new wn).use(e,t)}))}}),J(wn,"Use");const An=G;ne([sn,on,ht,dt,bt],N("viewbox")),ne([vt,Vt,Xt,Ut],N("marker")),ne(cn,N("Text")),ne(Ut,N("Path")),ne(Ge,N("Defs")),ne([cn,un],N("Tspan")),ne([qt,at,ut,$t],N("radius")),ne(Le,N("EventTarget")),ne(We,N("Dom")),ne(Xe,N("Element")),ne(Qe,N("Shape")),ne([qe,st],N("Container")),ne(ut,N("Gradient")),ne($t,N("Runner")),Ee.extend([...new Set(C)]),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Yt.push(...[].concat(e))}([He,xe,Ce,ke,ze,pt,It,we]),ne(Yt,{to(e){return(new Lt).type(this.constructor).from(this.toArray()).to(e)},fromArray(e){return this.init(e),this},toConsumable(){return this.toArray()},morph(e,t,n,r,i){return this.fromArray(e.map((function(e,a){return r.step(e,t[a],n,i[a],i)})))}});class kn extends Xe{constructor(e){super(Q("filter",e),e),this.$source="SourceGraphic",this.$sourceAlpha="SourceAlpha",this.$background="BackgroundImage",this.$backgroundAlpha="BackgroundAlpha",this.$fill="FillPaint",this.$stroke="StrokePaint",this.$autoSetIn=!0}put(e,t){return!(e=super.put(e,t)).attr("in")&&this.$autoSetIn&&e.attr("in",this.$source),e.attr("result")||e.attr("result",e.id()),e}remove(){return this.targets().each("unfilter"),super.remove()}targets(){return Me('svg [filter*="'+this.id()+'"]')}toString(){return"url(#"+this.id()+")"}}class Sn extends Xe{constructor(e,t){super(e,t),this.result(this.id())}in(e){if(null==e){const e=this.attr("in");return this.parent()&&this.parent().find('[result="'.concat(e,'"]'))[0]||e}return this.attr("in",e)}result(e){return this.attr("result",e)}toString(){return this.result()}}const _n=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;this.attr("stdDeviation",e+" "+t)},image:function(e){this.attr("href",e,H)},morphology:_n(["operator","radius"]),offset:_n(["dx","dy"]),specularLighting:_n(["surfaceScale","lightingColor","diffuseConstant","specularExponent","kernelUnitLength"]),tile:_n([]),turbulence:_n(["baseFrequency","numOctaves","seed","stitchTiles","type"])};["blend","colorMatrix","componentTransfer","composite","convolveMatrix","diffuseLighting","displacementMap","dropShadow","flood","gaussianBlur","image","merge","morphology","offset","specularLighting","tile","turbulence"].forEach((e=>{const t=R(e),n=Cn[e];kn[t+"Effect"]=class extends Sn{constructor(e){super(Q("fe"+t,e),e)}update(e){return n.apply(this,e),this}},kn.prototype[e]=re((function(e){const n=new kn[t+"Effect"];for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a{e instanceof kn.MergeNode?t.put(e):t.mergeNode(e)})),t)},componentTransfer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.put(new kn.ComponentTransferEffect);if("function"==typeof e)return e.call(t,t),t;e.r||e.g||e.b||e.a||(e={r:e,g:e,b:e,a:e});for(const n in e)t.add(new(kn["Func"+n.toUpperCase()])(e[n]));return t}}),["distantLight","pointLight","spotLight","mergeNode","FuncR","FuncG","FuncB","FuncA"].forEach((e=>{const t=R(e);kn[t]=class extends Sn{constructor(e){super(Q("fe"+t,e),e)}}})),["funcR","funcG","funcB","funcA"].forEach((function(e){const t=kn[R(e)],n=re((function(){return this.put(new t)}));kn.ComponentTransferEffect.prototype[e]=n})),["distantLight","pointLight","spotLight"].forEach((e=>{const t=kn[R(e)],n=re((function(){return this.put(new t)}));kn.DiffuseLightingEffect.prototype[e]=n,kn.SpecularLightingEffect.prototype[e]=n})),ne(kn.MergeEffect,{mergeNode(e){return this.put(new kn.MergeNode).attr("in",e)}}),ne(Ge,{filter:function(e){const t=this.put(new kn);return"function"==typeof e&&e.call(t,t),t}}),ne(qe,{filter:function(e){return this.defs().filter(e)}}),ne(Xe,{filterWith:function(e){const t=e instanceof kn?e:this.defs().filter(e);return this.attr("filter",t)},unfilter:function(e){return this.attr("filter",null)},filterer(){return this.reference("filter")}});const jn={blend:function(e,t){return this.parent()&&this.parent().blend(this,e,t)},colorMatrix:function(e,t){return this.parent()&&this.parent().colorMatrix(e,t).in(this)},componentTransfer:function(e){return this.parent()&&this.parent().componentTransfer(e).in(this)},composite:function(e,t){return this.parent()&&this.parent().composite(this,e,t)},convolveMatrix:function(e){return this.parent()&&this.parent().convolveMatrix(e).in(this)},diffuseLighting:function(e,t,n,r){return this.parent()&&this.parent().diffuseLighting(e,n,r).in(this)},displacementMap:function(e,t,n,r){return this.parent()&&this.parent().displacementMap(this,e,t,n,r)},dropShadow:function(e,t,n){return this.parent()&&this.parent().dropShadow(this,e,t,n).in(this)},flood:function(e,t){return this.parent()&&this.parent().flood(e,t)},gaussianBlur:function(e,t){return this.parent()&&this.parent().gaussianBlur(e,t).in(this)},image:function(e){return this.parent()&&this.parent().image(e)},merge:function(e){return e=e instanceof Array?e:[...e],this.parent()&&this.parent().merge(this,...e)},morphology:function(e,t){return this.parent()&&this.parent().morphology(e,t).in(this)},offset:function(e,t){return this.parent()&&this.parent().offset(e,t).in(this)},specularLighting:function(e,t,n,r,i){return this.parent()&&this.parent().specularLighting(e,n,r,i).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(e,t,n,r,i){return this.parent()&&this.parent().turbulence(e,t,n,r,i).in(this)}};ne(Sn,jn),ne(kn.MergeEffect,{in:function(e){return e instanceof kn.MergeNode?this.add(e,0):this.add((new kn.MergeNode).in(e),0),this}}),ne([kn.CompositeEffect,kn.BlendEffect,kn.DisplacementMapEffect],{in2:function(e){if(null==e){const e=this.attr("in2");return this.parent()&&this.parent().find('[result="'.concat(e,'"]'))[0]||e}return this.attr("in2",e)}}),kn.filter={sepiatone:[.343,.669,.119,0,0,.249,.626,.13,0,0,.172,.334,.111,0,0,0,0,0,1,0]};var En=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"getDefaultFilter",value:function(e,t){var n=this.w;e.unfilter(!0),(new kn).size("120%","180%","-5%","-40%"),n.config.chart.dropShadow.enabled&&this.dropShadow(e,n.config.chart.dropShadow,t)}},{key:"applyFilter",value:function(e,t,n){var r,i=this,a=this.w;if(e.unfilter(!0),"none"!==n){var s,o,l=a.config.chart.dropShadow,c="lighten"===n?2:.3;e.filterWith((function(e){e.colorMatrix({type:"matrix",values:"\n ".concat(c," 0 0 0 0\n 0 ").concat(c," 0 0 0\n 0 0 ").concat(c," 0 0\n 0 0 0 1 0\n "),in:"SourceGraphic",result:"brightness"}),l.enabled&&i.addShadow(e,t,l,"brightness")})),l.noUserSpaceOnUse||null===(s=e.filterer())||void 0===s||null===(o=s.node)||void 0===o||o.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null===(r=e.filterer())||void 0===r?void 0:r.node)}else this.getDefaultFilter(e,t)}},{key:"addShadow",value:function(e,t,n,r){var i,a=this.w,s=n.blur,o=n.top,l=n.left,c=n.color,u=n.opacity;if(c=Array.isArray(c)?c[t]:c,(null===(i=a.config.chart.dropShadow.enabledOnSeries)||void 0===i?void 0:i.length)>0&&-1===a.config.chart.dropShadow.enabledOnSeries.indexOf(t))return e;e.offset({in:r,dx:l,dy:o,result:"offset"}),e.gaussianBlur({in:"offset",stdDeviation:s,result:"blur"}),e.flood({"flood-color":c,"flood-opacity":u,result:"flood"}),e.composite({in:"flood",in2:"blur",operator:"in",result:"shadow"}),e.merge(["shadow",r])}},{key:"dropShadow",value:function(e,t){var n,r,i,a,s,o=this,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,c=this.w;return e.unfilter(!0),k.isMsEdge()&&"radialBar"===c.config.chart.type||(null===(n=c.config.chart.dropShadow.enabledOnSeries)||void 0===n?void 0:n.length)>0&&-1===(null===(i=c.config.chart.dropShadow.enabledOnSeries)||void 0===i?void 0:i.indexOf(l))||(e.filterWith((function(e){o.addShadow(e,l,t,"SourceGraphic")})),t.noUserSpaceOnUse||null===(a=e.filterer())||void 0===a||null===(s=a.node)||void 0===s||s.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null===(r=e.filterer())||void 0===r?void 0:r.node)),e}},{key:"setSelectionFilter",value:function(e,t,n){var r=this.w;if(void 0!==r.globals.selectedDataPoints[t]&&r.globals.selectedDataPoints[t].indexOf(n)>-1){e.node.setAttribute("selected",!0);var i=r.config.states.active.filter;"none"!==i&&this.applyFilter(e,t,i.type)}}},{key:"_scaleFilterSize",value:function(e){e&&function(t){for(var n in t)t.hasOwnProperty(n)&&e.setAttribute(n,t[n])}({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}]),e}(),Nn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"roundPathCorners",value:function(e,t){function n(e,t,n){var i=t.x-e.x,a=t.y-e.y,s=Math.sqrt(i*i+a*a);return r(e,t,Math.min(1,n/s))}function r(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function i(e,t){e.length>2&&(e[e.length-2]=t.x,e[e.length-1]=t.y)}function a(e){return{x:parseFloat(e[e.length-2]),y:parseFloat(e[e.length-1])}}e.indexOf("NaN")>-1&&(e="");var s=e.split(/[,\s]/).reduce((function(e,t){var n=t.match("([a-zA-Z])(.+)");return n?(e.push(n[1]),e.push(n[2])):e.push(t),e}),[]).reduce((function(e,t){return parseFloat(t)==t&&e.length?e[e.length-1].push(t):e.push([t]),e}),[]),o=[];if(s.length>1){var l=a(s[0]),c=null;"Z"==s[s.length-1][0]&&s[0].length>2&&(c=["L",l.x,l.y],s[s.length-1]=c),o.push(s[0]);for(var u=1;u2&&"L"==h[0]&&f.length>2&&"L"==f[0]){var p,m,g=a(d),v=a(h),b=a(f);p=n(v,g,t),m=n(v,b,t),i(h,p),h.origPoint=v,o.push(h);var y=r(p,v,.5),x=r(v,m,.5),w=["C",y.x,y.y,x.x,x.y,m.x,m.y];w.origPoint=v,o.push(w)}else o.push(h)}if(c){var A=a(o[o.length-1]);o.push(["Z"]),i(o[0],A)}}else o=s;return o.reduce((function(e,t){return e+t.join(" ")+" "}),"")}},{key:"drawLine",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"#a8a8a8",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"butt";return this.w.globals.dom.Paper.line().attr({x1:e,y1:t,x2:n,y2:r,stroke:i,"stroke-dasharray":a,"stroke-width":s,"stroke-linecap":o})}},{key:"drawRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"#fefefe",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,u=this.w.globals.dom.Paper.rect();return u.attr({x:e,y:t,width:n>0?n:0,height:r>0?r:0,rx:i,ry:i,opacity:s,"stroke-width":null!==o?o:0,stroke:null!==l?l:"none","stroke-dasharray":c}),u.node.setAttribute("fill",a),u}},{key:"drawPolygon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#e1e1e1",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none";return this.w.globals.dom.Paper.polygon(e).attr({fill:r,stroke:t,"stroke-width":n})}},{key:"drawCircle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e<0&&(e=0);var n=this.w.globals.dom.Paper.circle(2*e);return null!==t&&n.attr(t),n}},{key:"drawPath",value:function(e){var t=e.d,n=void 0===t?"":t,r=e.stroke,i=void 0===r?"#a8a8a8":r,a=e.strokeWidth,s=void 0===a?1:a,o=e.fill,l=e.fillOpacity,c=void 0===l?1:l,u=e.strokeOpacity,d=void 0===u?1:u,h=e.classes,f=e.strokeLinecap,p=void 0===f?null:f,m=e.strokeDashArray,g=void 0===m?0:m,v=this.w;return null===p&&(p=v.config.stroke.lineCap),(n.indexOf("undefined")>-1||n.indexOf("NaN")>-1)&&(n="M 0 ".concat(v.globals.gridHeight)),v.globals.dom.Paper.path(n).attr({fill:o,"fill-opacity":c,stroke:i,"stroke-opacity":d,"stroke-linecap":p,"stroke-width":s,"stroke-dasharray":g,class:h})}},{key:"group",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.w.globals.dom.Paper.group();return null!==e&&t.attr(e),t}},{key:"move",value:function(e,t){return["M",e,t].join(" ")}},{key:"line",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=null;return null===n?r=[" L",e,t].join(" "):"H"===n?r=[" H",e].join(" "):"V"===n&&(r=[" V",t].join(" ")),r}},{key:"curve",value:function(e,t,n,r,i,a){return["C",e,t,n,r,i,a].join(" ")}},{key:"quadraticCurve",value:function(e,t,n,r){return["Q",e,t,n,r].join(" ")}},{key:"arc",value:function(e,t,n,r,i,a,s){var o="A";return arguments.length>7&&void 0!==arguments[7]&&arguments[7]&&(o="a"),[o,e,t,n,r,i,a,s].join(" ")}},{key:"renderPaths",value:function(e){var t,n=e.j,r=e.realIndex,i=e.pathFrom,a=e.pathTo,s=e.stroke,o=e.strokeWidth,l=e.strokeLinecap,c=e.fill,u=e.animationDelay,d=e.initialSpeed,h=e.dataChangeSpeed,f=e.className,p=e.chartType,m=e.shouldClipToGrid,v=void 0===m||m,b=e.bindEventsOnPaths,y=void 0===b||b,x=e.drawShadow,w=void 0===x||x,A=this.w,k=new En(this.ctx),_=new S(this.ctx),C=this.w.config.chart.animations.enabled,j=C&&this.w.config.chart.animations.dynamicAnimation.enabled,E=!!(C&&!A.globals.resized||j&&A.globals.dataChanged&&A.globals.shouldAnimate);E?t=i:(t=a,A.globals.animationEnded=!0);var N,M=A.config.stroke.dashArray;N=Array.isArray(M)?M[r]:A.config.stroke.dashArray;var T=this.drawPath({d:t,stroke:s,strokeWidth:o,fill:c,fillOpacity:1,classes:f,strokeLinecap:l,strokeDashArray:N});T.attr("index",r),v&&("bar"===p&&!A.globals.isHorizontal||A.globals.comboCharts?T.attr({"clip-path":"url(#gridRectBarMask".concat(A.globals.cuid,")")}):T.attr({"clip-path":"url(#gridRectMask".concat(A.globals.cuid,")")})),A.config.chart.dropShadow.enabled&&w&&k.dropShadow(T,A.config.chart.dropShadow,r),y&&(T.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,T)),T.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,T)),T.node.addEventListener("mousedown",this.pathMouseDown.bind(this,T))),T.attr({pathTo:a,pathFrom:i});var O={el:T,j:n,realIndex:r,pathFrom:i,pathTo:a,fill:c,strokeWidth:o,delay:u};return!C||A.globals.resized||A.globals.dataChanged?!A.globals.resized&&A.globals.dataChanged||_.showDelayedElements():_.animatePathsGradually(g(g({},O),{},{speed:d})),A.globals.dataChanged&&j&&E&&_.animatePathsGradually(g(g({},O),{},{speed:h})),T}},{key:"drawPattern",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#a8a8a8",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return this.w.globals.dom.Paper.pattern(t,n,(function(a){"horizontalLines"===e?a.line(0,0,n,0).stroke({color:r,width:i+1}):"verticalLines"===e?a.line(0,0,0,t).stroke({color:r,width:i+1}):"slantedLines"===e?a.line(0,0,t,n).stroke({color:r,width:i}):"squares"===e?a.rect(t,n).fill("none").stroke({color:r,width:i}):"circles"===e&&a.circle(t).fill("none").stroke({color:r,width:i})}))}},{key:"drawGradient",value:function(e,t,n,r,i){var a,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,u=this.w;t.length<9&&0===t.indexOf("#")&&(t=k.hexToRgba(t,r)),n.length<9&&0===n.indexOf("#")&&(n=k.hexToRgba(n,i));var d=0,h=1,f=1,p=null;null!==o&&(d=void 0!==o[0]?o[0]/100:0,h=void 0!==o[1]?o[1]/100:1,f=void 0!==o[2]?o[2]/100:1,p=void 0!==o[3]?o[3]/100:null);var m=!("donut"!==u.config.chart.type&&"pie"!==u.config.chart.type&&"polarArea"!==u.config.chart.type&&"bubble"!==u.config.chart.type);if(a=l&&0!==l.length?u.globals.dom.Paper.gradient(m?"radial":"linear",(function(e){(Array.isArray(l[c])?l[c]:l).forEach((function(t){e.stop(t.offset/100,t.color,t.opacity)}))})):u.globals.dom.Paper.gradient(m?"radial":"linear",(function(e){e.stop(d,t,r),e.stop(h,n,i),e.stop(f,n,i),null!==p&&e.stop(p,t,r)})),m){var g=u.globals.gridWidth/2,v=u.globals.gridHeight/2;"bubble"!==u.config.chart.type?a.attr({gradientUnits:"userSpaceOnUse",cx:g,cy:v,r:s}):a.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===e?a.from(0,0).to(0,1):"diagonal"===e?a.from(0,0).to(1,1):"horizontal"===e?a.from(0,1).to(1,1):"diagonal2"===e&&a.from(1,0).to(0,1);return a}},{key:"getTextBasedOnMaxWidth",value:function(e){var t=e.text,n=e.maxWidth,r=e.fontSize,i=e.fontFamily,a=this.getTextRects(t,r,i),s=a.width/t.length,o=Math.floor(n/s);return n-1){var o=n.globals.selectedDataPoints[i].indexOf(a);n.globals.selectedDataPoints[i].splice(o,1)}}else{if(!n.config.states.active.allowMultipleDataPointsSelection&&n.globals.selectedDataPoints.length>0){n.globals.selectedDataPoints=[];var l=n.globals.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),c=n.globals.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),u=function(e){Array.prototype.forEach.call(e,(function(e){e.node.setAttribute("selected","false"),r.getDefaultFilter(e,i)}))};u(l),u(c)}e.node.setAttribute("selected","true"),s="true",void 0===n.globals.selectedDataPoints[i]&&(n.globals.selectedDataPoints[i]=[]),n.globals.selectedDataPoints[i].push(a)}if("true"===s){var d=n.config.states.active.filter;if("none"!==d)r.applyFilter(e,i,d.type);else if("none"!==n.config.states.hover.filter&&!n.globals.isTouchDevice){var h=n.config.states.hover.filter;r.applyFilter(e,i,h.type)}}else"none"!==n.config.states.active.filter.type&&("none"===n.config.states.hover.filter.type||n.globals.isTouchDevice?r.getDefaultFilter(e,i):(h=n.config.states.hover.filter,r.applyFilter(e,i,h.type)));"function"==typeof n.config.chart.events.dataPointSelection&&n.config.chart.events.dataPointSelection(t,this.ctx,{selectedDataPoints:n.globals.selectedDataPoints,seriesIndex:i,dataPointIndex:a,w:n}),t&&this.ctx.events.fireEvent("dataPointSelection",[t,this.ctx,{selectedDataPoints:n.globals.selectedDataPoints,seriesIndex:i,dataPointIndex:a,w:n}])}},{key:"rotateAroundCenter",value:function(e){var t={};return e&&"function"==typeof e.getBBox&&(t=e.getBBox()),{x:t.x+t.width/2,y:t.y+t.height/2}}},{key:"getTextRects",value:function(e,t,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=this.w,s=this.drawText({x:-200,y:-200,text:e,textAnchor:"start",fontSize:t,fontFamily:n,foreColor:"#fff",opacity:0});r&&s.attr("transform",r),a.globals.dom.Paper.add(s);var o=s.bbox();return i||(o=s.node.getBoundingClientRect()),s.remove(),{width:o.width,height:o.height}}},{key:"placeTextWithEllipsis",value:function(e,t,n){if("function"==typeof e.getComputedTextLength&&(e.textContent=t,t.length>0&&e.getComputedTextLength()>=n/1.1)){for(var r=t.length-3;r>0;r-=3)if(e.getSubStringLength(0,r)<=n/1.1)return void(e.textContent=t.substring(0,r)+"...");e.textContent="."}}}],[{key:"setAttrs",value:function(e,t){for(var n in t)t.hasOwnProperty(n)&&e.setAttribute(n,t[n])}}]),e}(),Mn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"getStackedSeriesTotals",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.w,n=[];if(0===t.globals.series.length)return n;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;return null===e?this.w.config.series.reduce((function(e,t){return e+t}),0):this.w.globals.series[e].reduce((function(e,t){return e+t}),0)}},{key:"getStackedSeriesTotalsByGroups",value:function(){var e=this,t=this.w,n=[];return t.globals.seriesGroups.forEach((function(r){var i=[];t.config.series.forEach((function(e,n){r.indexOf(t.globals.seriesNames[n])>-1&&i.push(n)}));var a=t.globals.series.map((function(e,t){return-1===i.indexOf(t)?t:-1})).filter((function(e){return-1!==e}));n.push(e.getStackedSeriesTotals(a))})),n}},{key:"setSeriesYAxisMappings",value:function(){var e=this.w.globals,t=this.w.config,n=[],r=[],i=[],a=e.series.length>t.yaxis.length||t.yaxis.some((function(e){return Array.isArray(e.seriesName)}));t.series.forEach((function(e,t){i.push(t),r.push(null)})),t.yaxis.forEach((function(e,t){n[t]=[]}));var s=[];t.yaxis.forEach((function(e,r){var o=!1;if(e.seriesName){var l=[];Array.isArray(e.seriesName)?l=e.seriesName:l.push(e.seriesName),l.forEach((function(e){t.series.forEach((function(t,s){if(t.name===e){var l=s;r===s||a?!a||i.indexOf(s)>-1?n[r].push([r,s]):console.warn("Series '"+t.name+"' referenced more than once in what looks like the new style. That is, when using either seriesName: [], or when there are more series than yaxes."):(n[s].push([s,r]),l=r),o=!0,-1!==(l=i.indexOf(l))&&i.splice(l,1)}}))}))}o||s.push(r)})),n=n.map((function(e,t){var n=[];return e.forEach((function(e){r[e[1]]=e[0],n.push(e[1])})),n}));for(var o=t.yaxis.length-1,l=0;l0&&void 0!==arguments[0]?arguments[0]:null;return 0===(null===e?this.w.config.series.filter((function(e){return null!==e})):this.w.config.series[e].data.filter((function(e){return null!==e}))).length}},{key:"seriesHaveSameValues",value:function(e){return this.w.globals.series[e].every((function(e,t,n){return e===n[0]}))}},{key:"getCategoryLabels",value:function(e){var t=this.w,n=e.slice();return t.config.xaxis.convertedCatToNumeric&&(n=e.map((function(e,n){return t.config.xaxis.labels.formatter(e-t.globals.minX+1)}))),n}},{key:"getLargestSeries",value:function(){var e=this.w;e.globals.maxValsInArrayIndex=e.globals.series.map((function(e){return e.length})).indexOf(Math.max.apply(Math,e.globals.series.map((function(e){return e.length}))))}},{key:"getLargestMarkerSize",value:function(){var e=this.w,t=0;return e.globals.markers.size.forEach((function(e){t=Math.max(t,e)})),e.config.markers.discrete&&e.config.markers.discrete.length&&e.config.markers.discrete.forEach((function(e){t=Math.max(t,e.size)})),t>0&&(e.config.markers.hover.size>0?t=e.config.markers.hover.size:t+=e.config.markers.hover.sizeOffset),e.globals.markers.largestSize=t,t}},{key:"getSeriesTotals",value:function(){var e=this.w;e.globals.seriesTotals=e.globals.series.map((function(e,t){var n=0;if(Array.isArray(e))for(var r=0;re&&n.globals.seriesX[i][s]0){var f=function(e,t){var n=i.config.yaxis[i.globals.seriesYAxisReverseMap[t]],a=e<0?-1:1;return e=Math.abs(e),n.logarithmic&&(e=r.getBaseLog(n.logBase,e)),-a*e/s[t]};if(a.isMultipleYAxis){l=[];for(var p=0;p0&&t.forEach((function(t){var s=[],o=[];e.i.forEach((function(n,r){i.config.series[n].group===t&&(s.push(e.series[r]),o.push(n))})),s.length>0&&a.push(r.draw(s,n,o))})),a}}],[{key:"checkComboSeries",value:function(e,t){var n=!1,r=0,i=0;return void 0===t&&(t="line"),e.length&&void 0!==e[0].type&&e.forEach((function(e){"bar"!==e.type&&"column"!==e.type&&"candlestick"!==e.type&&"boxPlot"!==e.type||r++,void 0!==e.type&&e.type!==t&&i++})),i>0&&(n=!0),{comboBarCount:r,comboCharts:n}}},{key:"extendArrayProps",value:function(e,t,n){var r,i,a,s,o,l;return null!==(r=t)&&void 0!==r&&r.yaxis&&(t=e.extendYAxis(t,n)),null!==(i=t)&&void 0!==i&&i.annotations&&(t.annotations.yaxis&&(t=e.extendYAxisAnnotations(t)),null!==(a=t)&&void 0!==a&&null!==(s=a.annotations)&&void 0!==s&&s.xaxis&&(t=e.extendXAxisAnnotations(t)),null!==(o=t)&&void 0!==o&&null!==(l=o.annotations)&&void 0!==l&&l.points&&(t=e.extendPointAnnotations(t))),t}}]),e}(),Tn=function(){function e(t){s(this,e),this.w=t.w,this.annoCtx=t}return l(e,[{key:"setOrientations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.w;if("vertical"===e.label.orientation){var r=null!==t?t:0,i=n.globals.dom.baseEl.querySelector(".apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='".concat(r,"']"));if(null!==i){var a=i.getBoundingClientRect();i.setAttribute("x",parseFloat(i.getAttribute("x"))-a.height+4);var s="top"===e.label.position?a.width:-a.width;i.setAttribute("y",parseFloat(i.getAttribute("y"))+s);var o=this.annoCtx.graphics.rotateAroundCenter(i),l=o.x,c=o.y;i.setAttribute("transform","rotate(-90 ".concat(l," ").concat(c,")"))}}}},{key:"addBackgroundToAnno",value:function(e,t){var n=this.w;if(!e||!t.label.text||!String(t.label.text).trim())return null;var r=n.globals.dom.baseEl.querySelector(".apexcharts-grid").getBoundingClientRect(),i=e.getBoundingClientRect(),a=t.label.style.padding,s=a.left,o=a.right,l=a.top,c=a.bottom;if("vertical"===t.label.orientation){var u=[s,o,l,c];l=u[0],c=u[1],s=u[2],o=u[3]}var d=i.left-r.left-s,h=i.top-r.top-l,f=this.annoCtx.graphics.drawRect(d-n.globals.barPadForNumericAxis,h,i.width+s+o,i.height+l+c,t.label.borderRadius,t.label.style.background,1,t.label.borderWidth,t.label.borderColor,0);return t.id&&f.node.classList.add(t.id),f}},{key:"annotationsBackground",value:function(){var e=this,t=this.w,n=function(n,r,i){var a=t.globals.dom.baseEl.querySelector(".apexcharts-".concat(i,"-annotations .apexcharts-").concat(i,"-annotation-label[rel='").concat(r,"']"));if(a){var s=a.parentNode,o=e.addBackgroundToAnno(a,n);o&&(s.insertBefore(o.node,a),n.label.mouseEnter&&o.node.addEventListener("mouseenter",n.label.mouseEnter.bind(e,n)),n.label.mouseLeave&&o.node.addEventListener("mouseleave",n.label.mouseLeave.bind(e,n)),n.label.click&&o.node.addEventListener("click",n.label.click.bind(e,n)))}};t.config.annotations.xaxis.forEach((function(e,t){return n(e,t,"xaxis")})),t.config.annotations.yaxis.forEach((function(e,t){return n(e,t,"yaxis")})),t.config.annotations.points.forEach((function(e,t){return n(e,t,"point")}))}},{key:"getY1Y2",value:function(e,t){var n,r=this.w,i="y1"===e?t.y:t.y2,a=!1;if(this.annoCtx.invertAxis){var s=r.config.xaxis.convertedCatToNumeric?r.globals.categoryLabels:r.globals.labels,o=s.indexOf(i),l=r.globals.dom.baseEl.querySelector(".apexcharts-yaxis-texts-g text:nth-child(".concat(o+1,")"));n=l?parseFloat(l.getAttribute("y")):(r.globals.gridHeight/s.length-1)*(o+1)-r.globals.barHeight,void 0!==t.seriesIndex&&r.globals.barHeight&&(n-=r.globals.barHeight/2*(r.globals.series.length-1)-r.globals.barHeight*t.seriesIndex)}else{var c,u=r.globals.seriesYAxisMap[t.yAxisIndex][0],d=r.config.yaxis[t.yAxisIndex].logarithmic?new Mn(this.annoCtx.ctx).getLogVal(r.config.yaxis[t.yAxisIndex].logBase,i,u)/r.globals.yLogRatio[u]:(i-r.globals.minYArr[u])/(r.globals.yRange[u]/r.globals.gridHeight);n=r.globals.gridHeight-Math.min(Math.max(d,0),r.globals.gridHeight),a=d>r.globals.gridHeight||d<0,!t.marker||void 0!==t.y&&null!==t.y||(n=0),null!==(c=r.config.yaxis[t.yAxisIndex])&&void 0!==c&&c.reversed&&(n=d)}return"string"==typeof i&&i.includes("px")&&(n=parseFloat(i)),{yP:n,clipped:a}}},{key:"getX1X2",value:function(e,t){var n=this.w,r="x1"===e?t.x:t.x2,i=this.annoCtx.invertAxis?n.globals.minY:n.globals.minX,a=this.annoCtx.invertAxis?n.globals.maxY:n.globals.maxX,s=this.annoCtx.invertAxis?n.globals.yRange[0]:n.globals.xRange,o=!1,l=this.annoCtx.inversedReversedAxis?(a-r)/(s/n.globals.gridWidth):(r-i)/(s/n.globals.gridWidth);return"category"!==n.config.xaxis.type&&!n.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||n.globals.dataFormatXNumeric||n.config.chart.sparkline.enabled||(l=this.getStringX(r)),"string"==typeof r&&r.includes("px")&&(l=parseFloat(r)),null==r&&t.marker&&(l=n.globals.gridWidth),void 0!==t.seriesIndex&&n.globals.barWidth&&!this.annoCtx.invertAxis&&(l-=n.globals.barWidth/2*(n.globals.series.length-1)-n.globals.barWidth*t.seriesIndex),l>n.globals.gridWidth?(l=n.globals.gridWidth,o=!0):l<0&&(l=0,o=!0),{x:l,clipped:o}}},{key:"getStringX",value:function(e){var t=this.w,n=e;t.config.xaxis.convertedCatToNumeric&&t.globals.categoryLabels.length&&(e=t.globals.categoryLabels.indexOf(e)+1);var r=t.globals.labels.map((function(e){return Array.isArray(e)?e.join(" "):e})).indexOf(e),i=t.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g text:nth-child(".concat(r+1,")"));return i&&(n=parseFloat(i.getAttribute("x"))),n}}]),e}(),On=function(){function e(t){s(this,e),this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new Tn(this.annoCtx)}return l(e,[{key:"addXaxisAnnotation",value:function(e,t,n){var r,i=this.w,a=this.helpers.getX1X2("x1",e),s=a.x,o=a.clipped,l=!0,c=e.label.text,u=e.strokeDashArray;if(k.isNumber(s)){if(null===e.x2||void 0===e.x2){if(!o){var d=this.annoCtx.graphics.drawLine(s+e.offsetX,0+e.offsetY,s+e.offsetX,i.globals.gridHeight+e.offsetY,e.borderColor,u,e.borderWidth);t.appendChild(d.node),e.id&&d.node.classList.add(e.id)}}else{var h=this.helpers.getX1X2("x2",e);if(r=h.x,l=h.clipped,!o||!l){if(r12?h-12:0===h?12:h;t=(t=(t=(t=t.replace(/(^|[^\\])HH+/g,"$1"+l(h))).replace(/(^|[^\\])H/g,"$1"+h)).replace(/(^|[^\\])hh+/g,"$1"+l(f))).replace(/(^|[^\\])h/g,"$1"+f);var p=r?e.getUTCMinutes():e.getMinutes();t=(t=t.replace(/(^|[^\\])mm+/g,"$1"+l(p))).replace(/(^|[^\\])m/g,"$1"+p);var m=r?e.getUTCSeconds():e.getSeconds();t=(t=t.replace(/(^|[^\\])ss+/g,"$1"+l(m))).replace(/(^|[^\\])s/g,"$1"+m);var g=r?e.getUTCMilliseconds():e.getMilliseconds();t=t.replace(/(^|[^\\])fff+/g,"$1"+l(g,3)),g=Math.round(g/10),t=t.replace(/(^|[^\\])ff/g,"$1"+l(g)),g=Math.round(g/10);var v=h<12?"AM":"PM";t=(t=(t=t.replace(/(^|[^\\])f/g,"$1"+g)).replace(/(^|[^\\])TT+/g,"$1"+v)).replace(/(^|[^\\])T/g,"$1"+v.charAt(0));var b=v.toLowerCase();t=(t=t.replace(/(^|[^\\])tt+/g,"$1"+b)).replace(/(^|[^\\])t/g,"$1"+b.charAt(0));var x=-e.getTimezoneOffset(),w=r||!x?"Z":x>0?"+":"-";if(!r){var A=(x=Math.abs(x))%60;w+=l(Math.floor(x/60))+":"+l(A)}t=t.replace(/(^|[^\\])K/g,"$1"+w);var k=(r?e.getUTCDay():e.getDay())+1;return(t=(t=(t=(t=t.replace(new RegExp(s[0],"g"),s[k])).replace(new RegExp(o[0],"g"),o[k])).replace(new RegExp(i[0],"g"),i[u])).replace(new RegExp(a[0],"g"),a[u])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(e,t,n){var r=this.w;void 0!==r.config.xaxis.min&&(e=r.config.xaxis.min),void 0!==r.config.xaxis.max&&(t=r.config.xaxis.max);var i=this.getDate(e),a=this.getDate(t),s=this.formatDate(i,"yyyy MM dd HH mm ss fff").split(" "),o=this.formatDate(a,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(s[6],10),maxMillisecond:parseInt(o[6],10),minSecond:parseInt(s[5],10),maxSecond:parseInt(o[5],10),minMinute:parseInt(s[4],10),maxMinute:parseInt(o[4],10),minHour:parseInt(s[3],10),maxHour:parseInt(o[3],10),minDate:parseInt(s[2],10),maxDate:parseInt(o[2],10),minMonth:parseInt(s[1],10)-1,maxMonth:parseInt(o[1],10)-1,minYear:parseInt(s[0],10),maxYear:parseInt(o[0],10)}}},{key:"isLeapYear",value:function(e){return e%4==0&&e%100!=0||e%400==0}},{key:"calculcateLastDaysOfMonth",value:function(e,t,n){return this.determineDaysOfMonths(e,t)-n}},{key:"determineDaysOfYear",value:function(e){var t=365;return this.isLeapYear(e)&&(t=366),t}},{key:"determineRemainingDaysOfYear",value:function(e,t,n){var r=this.daysCntOfYear[t]+n;return t>1&&this.isLeapYear()&&r++,r}},{key:"determineDaysOfMonths",value:function(e,t){var n=30;switch(e=k.monthMod(e),!0){case this.months30.indexOf(e)>-1:2===e&&(n=this.isLeapYear(t)?29:28);break;case this.months31.indexOf(e)>-1:default:n=31}return n}}]),e}(),Pn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.tooltipKeyFormat="dd MMM"}return l(e,[{key:"xLabelFormat",value:function(e,t,n,r){var i=this.w;if("datetime"===i.config.xaxis.type&&void 0===i.config.xaxis.labels.formatter&&void 0===i.config.tooltip.x.formatter){var a=new Rn(this.ctx);return a.formatDate(a.getDate(t),i.config.tooltip.x.format)}return e(t,n,r)}},{key:"defaultGeneralFormatter",value:function(e){return Array.isArray(e)?e.map((function(e){return e})):e}},{key:"defaultYFormatter",value:function(e,t,n){var r=this.w;if(k.isNumber(e))if(0!==r.globals.yValueDecimal)e=e.toFixed(void 0!==t.decimalsInFloat?t.decimalsInFloat:r.globals.yValueDecimal);else{var i=e.toFixed(0);e=e==i?i:e.toFixed(1)}return e}},{key:"setLabelFormatters",value:function(){var e=this,t=this.w;return t.globals.xaxisTooltipFormatter=function(t){return e.defaultGeneralFormatter(t)},t.globals.ttKeyFormatter=function(t){return e.defaultGeneralFormatter(t)},t.globals.ttZFormatter=function(e){return e},t.globals.legendFormatter=function(t){return e.defaultGeneralFormatter(t)},void 0!==t.config.xaxis.labels.formatter?t.globals.xLabelFormatter=t.config.xaxis.labels.formatter:t.globals.xLabelFormatter=function(e){if(k.isNumber(e)){if(!t.config.xaxis.convertedCatToNumeric&&"numeric"===t.config.xaxis.type){if(k.isNumber(t.config.xaxis.decimalsInFloat))return e.toFixed(t.config.xaxis.decimalsInFloat);var n=t.globals.maxX-t.globals.minX;return n>0&&n<100?e.toFixed(1):e.toFixed(0)}return t.globals.isBarHorizontal&&t.globals.maxY-t.globals.minYArr<4?e.toFixed(1):e.toFixed(0)}return e},"function"==typeof t.config.tooltip.x.formatter?t.globals.ttKeyFormatter=t.config.tooltip.x.formatter:t.globals.ttKeyFormatter=t.globals.xLabelFormatter,"function"==typeof t.config.xaxis.tooltip.formatter&&(t.globals.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||void 0!==t.config.tooltip.y.formatter)&&(t.globals.ttVal=t.config.tooltip.y),void 0!==t.config.tooltip.z.formatter&&(t.globals.ttZFormatter=t.config.tooltip.z.formatter),void 0!==t.config.legend.formatter&&(t.globals.legendFormatter=t.config.legend.formatter),t.config.yaxis.forEach((function(n,r){void 0!==n.labels.formatter?t.globals.yLabelFormatters[r]=n.labels.formatter:t.globals.yLabelFormatters[r]=function(i){return t.globals.xyCharts?Array.isArray(i)?i.map((function(t){return e.defaultYFormatter(t,n,r)})):e.defaultYFormatter(i,n,r):i}})),t.globals}},{key:"heatmapLabelFormatters",value:function(){var e=this.w;if("heatmap"===e.config.chart.type){e.globals.yAxisScale[0].result=e.globals.seriesNames.slice();var t=e.globals.seriesNames.reduce((function(e,t){return e.length>t.length?e:t}),0);e.globals.yAxisScale[0].niceMax=t,e.globals.yAxisScale[0].niceMin=t}}}]),e}(),In=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"getLabel",value:function(e,t,n,r){var i,a,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"12px",l=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],c=this.w,u=void 0===e[r]?"":e[r],d=u,h=c.globals.xLabelFormatter,f=c.config.xaxis.labels.formatter,p=!1,m=new Pn(this.ctx),g=u;l&&(d=m.xLabelFormat(h,u,g,{i:r,dateFormatter:new Rn(this.ctx).formatDate,w:c}),void 0!==f&&(d=f(u,e[r],{i:r,dateFormatter:new Rn(this.ctx).formatDate,w:c}))),t.length>0?(i=t[r].unit,a=null,t.forEach((function(e){"month"===e.unit?a="year":"day"===e.unit?a="month":"hour"===e.unit?a="day":"minute"===e.unit&&(a="hour")})),p=a===i,n=t[r].position,d=t[r].value):"datetime"===c.config.xaxis.type&&void 0===f&&(d=""),void 0===d&&(d=""),d=Array.isArray(d)?d:d.toString();var v,b=new Nn(this.ctx);v=c.globals.rotateXLabels&&l?b.getTextRects(d,parseInt(o,10),null,"rotate(".concat(c.config.xaxis.labels.rotate," 0 0)"),!1):b.getTextRects(d,parseInt(o,10));var y=!c.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(d)&&("NaN"===String(d)||s.indexOf(d)>=0&&y)&&(d=""),{x:n,text:d,textRect:v,isBold:p}}},{key:"checkLabelBasedOnTickamount",value:function(e,t,n){var r=this.w,i=r.config.xaxis.tickAmount;return"dataPoints"===i&&(i=Math.round(r.globals.gridWidth/120)),i>n||e%Math.round(n/(i+1))==0||(t.text=""),t}},{key:"checkForOverflowingLabels",value:function(e,t,n,r,i){var a=this.w;if(0===e&&a.globals.skipFirstTimelinelabel&&(t.text=""),e===n-1&&a.globals.skipLastTimelinelabel&&(t.text=""),a.config.xaxis.labels.hideOverlappingLabels&&r.length>0){var s=i[i.length-1];t.xr.length||r.some((function(e){return Array.isArray(e.seriesName)}))?e:n.seriesYAxisReverseMap[e]}},{key:"isYAxisHidden",value:function(e){var t=this.w,n=t.config.yaxis[e];if(!n.show||this.yAxisAllSeriesCollapsed(e))return!0;if(!n.showForNullSeries){var r=t.globals.seriesYAxisMap[e],i=new Mn(this.ctx);return r.every((function(e){return i.isSeriesNull(e)}))}return!1}},{key:"getYAxisForeColor",value:function(e,t){var n=this.w;return Array.isArray(e)&&n.globals.yAxisScale[t]&&this.ctx.theme.pushExtraColors(e,n.globals.yAxisScale[t].result.length,!1),e}},{key:"drawYAxisTicks",value:function(e,t,n,r,i,a,s){var o=this.w,l=new Nn(this.ctx),c=o.globals.translateY+o.config.yaxis[i].labels.offsetY;if(o.globals.isBarHorizontal?c=0:"heatmap"===o.config.chart.type&&(c+=a/2),r.show&&t>0){!0===o.config.yaxis[i].opposite&&(e+=r.width);for(var u=t;u>=0;u--){var d=l.drawLine(e+n.offsetX-r.width+r.offsetX,c+r.offsetY,e+n.offsetX+r.offsetX,c+r.offsetY,r.color);s.add(d),c+=a}}}}]),e}(),Dn=function(){function e(t){s(this,e),this.w=t.w,this.annoCtx=t,this.helpers=new Tn(this.annoCtx),this.axesUtils=new In(this.annoCtx)}return l(e,[{key:"addYaxisAnnotation",value:function(e,t,n){var r,i=this.w,a=e.strokeDashArray,s=this.helpers.getY1Y2("y1",e),o=s.yP,l=s.clipped,c=!0,u=!1,d=e.label.text;if(null===e.y2||void 0===e.y2){if(!l){u=!0;var h=this.annoCtx.graphics.drawLine(0+e.offsetX,o+e.offsetY,this._getYAxisAnnotationWidth(e),o+e.offsetY,e.borderColor,a,e.borderWidth);t.appendChild(h.node),e.id&&h.node.classList.add(e.id)}}else{if(r=(s=this.helpers.getY1Y2("y2",e)).yP,c=s.clipped,r>o){var f=o;o=r,r=f}if(!l||!c){u=!0;var p=this.annoCtx.graphics.drawRect(0+e.offsetX,r+e.offsetY,this._getYAxisAnnotationWidth(e),o-r,0,e.fillColor,e.opacity,1,e.borderColor,a);p.node.classList.add("apexcharts-annotation-rect"),p.attr("clip-path","url(#gridRectMask".concat(i.globals.cuid,")")),t.appendChild(p.node),e.id&&p.node.classList.add(e.id)}}if(u){var m="right"===e.label.position?i.globals.gridWidth:"center"===e.label.position?i.globals.gridWidth/2:0,g=this.annoCtx.graphics.drawText({x:m+e.label.offsetX,y:(null!=r?r:o)+e.label.offsetY-3,text:d,textAnchor:e.label.textAnchor,fontSize:e.label.style.fontSize,fontFamily:e.label.style.fontFamily,fontWeight:e.label.style.fontWeight,foreColor:e.label.style.color,cssClass:"apexcharts-yaxis-annotation-label ".concat(e.label.style.cssClass," ").concat(e.id?e.id:"")});g.attr({rel:n}),t.appendChild(g.node)}}},{key:"_getYAxisAnnotationWidth",value:function(e){var t=this.w;return t.globals.gridWidth,(e.width.indexOf("%")>-1?t.globals.gridWidth*parseInt(e.width,10)/100:parseInt(e.width,10))+e.offsetX}},{key:"drawYAxisAnnotations",value:function(){var e=this,t=this.w,n=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((function(t,r){t.yAxisIndex=e.axesUtils.translateYAxisIndex(t.yAxisIndex),e.axesUtils.isYAxisHidden(t.yAxisIndex)&&e.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||e.addYaxisAnnotation(t,n.node,r)})),n}}]),e}(),Ln=function(){function e(t){s(this,e),this.w=t.w,this.annoCtx=t,this.helpers=new Tn(this.annoCtx)}return l(e,[{key:"addPointAnnotation",value:function(e,t,n){if(!(this.w.globals.collapsedSeriesIndices.indexOf(e.seriesIndex)>-1)){var r=this.helpers.getX1X2("x1",e),i=r.x,a=r.clipped,s=(r=this.helpers.getY1Y2("y1",e)).yP,o=r.clipped;if(k.isNumber(i)&&!o&&!a){var l={pSize:e.marker.size,pointStrokeWidth:e.marker.strokeWidth,pointFillColor:e.marker.fillColor,pointStrokeColor:e.marker.strokeColor,shape:e.marker.shape,pRadius:e.marker.radius,class:"apexcharts-point-annotation-marker ".concat(e.marker.cssClass," ").concat(e.id?e.id:"")},c=this.annoCtx.graphics.drawMarker(i+e.marker.offsetX,s+e.marker.offsetY,l);t.appendChild(c.node);var u=e.label.text?e.label.text:"",d=this.annoCtx.graphics.drawText({x:i+e.label.offsetX,y:s+e.label.offsetY-e.marker.size-parseFloat(e.label.style.fontSize)/1.6,text:u,textAnchor:e.label.textAnchor,fontSize:e.label.style.fontSize,fontFamily:e.label.style.fontFamily,fontWeight:e.label.style.fontWeight,foreColor:e.label.style.color,cssClass:"apexcharts-point-annotation-label ".concat(e.label.style.cssClass," ").concat(e.id?e.id:"")});if(d.attr({rel:n}),t.appendChild(d.node),e.customSVG.SVG){var h=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+e.customSVG.cssClass});h.attr({transform:"translate(".concat(i+e.customSVG.offsetX,", ").concat(s+e.customSVG.offsetY,")")}),h.node.innerHTML=e.customSVG.SVG,t.appendChild(h.node)}if(e.image.path){var f=e.image.width?e.image.width:20,p=e.image.height?e.image.height:20;c=this.annoCtx.addImage({x:i+e.image.offsetX-f/2,y:s+e.image.offsetY-p/2,width:f,height:p,path:e.image.path,appendTo:".apexcharts-point-annotations"})}e.mouseEnter&&c.node.addEventListener("mouseenter",e.mouseEnter.bind(this,e)),e.mouseLeave&&c.node.addEventListener("mouseleave",e.mouseLeave.bind(this,e)),e.click&&c.node.addEventListener("click",e.click.bind(this,e))}}}},{key:"drawPointAnnotations",value:function(){var e=this,t=this.w,n=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((function(t,r){e.addPointAnnotation(t,n.node,r)})),n}}]),e}(),Fn={name:"en",options:{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"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}},Bn=function(){function e(){s(this,e),this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}return l(e,[{key:"init",value:function(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"",locales:[Fn],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.7},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},stacked:!1,stackOnlyBar:!0,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}}},plotOptions:{line:{isSlopeChart:!1,colors:{threshold:0,colorAboveThreshold:void 0,colorBelowThreshold:void 0}},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:function(e){return e}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(e){return e+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(e){return e.globals.seriesTotals.reduce((function(e,t){return e+t}),0)/e.globals.series.length+"%"}}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:function(e){return e},onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:function(e){return e}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(e){return e}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(e){return e.globals.seriesTotals.reduce((function(e,t){return e+t}),0)}}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:function(e){return null!==e?e:""},textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],clusterGroupedSeries:!0,clusterGroupedSeriesOrientation:"vertical",labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{hover:{filter:{type:"lighten"}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken"}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:function(e){return e?e+": ":""}}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.8}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}]),e}(),zn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.graphics=new Nn(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new Tn(this),this.xAxisAnnotations=new On(this),this.yAxisAnnotations=new Dn(this),this.pointsAnnotations=new Ln(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}return l(e,[{key:"drawAxesAnnotations",value:function(){var e=this.w;if(e.globals.axisCharts&&e.globals.dataPoints){for(var t=this.yAxisAnnotations.drawYAxisAnnotations(),n=this.xAxisAnnotations.drawXAxisAnnotations(),r=this.pointsAnnotations.drawPointAnnotations(),i=e.config.chart.animations.enabled,a=[t,n,r],s=[n.node,t.node,r.node],o=0;o<3;o++)e.globals.dom.elGraphical.add(a[o]),!i||e.globals.resized||e.globals.dataChanged||"scatter"!==e.config.chart.type&&"bubble"!==e.config.chart.type&&e.globals.dataPoints>1&&s[o].classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:s[o],index:0});this.helpers.annotationsBackground()}}},{key:"drawImageAnnos",value:function(){var e=this;this.w.config.annotations.images.map((function(t,n){e.addImage(t,n)}))}},{key:"drawTextAnnos",value:function(){var e=this;this.w.config.annotations.texts.map((function(t,n){e.addText(t,n)}))}},{key:"addXaxisAnnotation",value:function(e,t,n){this.xAxisAnnotations.addXaxisAnnotation(e,t,n)}},{key:"addYaxisAnnotation",value:function(e,t,n){this.yAxisAnnotations.addYaxisAnnotation(e,t,n)}},{key:"addPointAnnotation",value:function(e,t,n){this.pointsAnnotations.addPointAnnotation(e,t,n)}},{key:"addText",value:function(e,t){var n=e.x,r=e.y,i=e.text,a=e.textAnchor,s=e.foreColor,o=e.fontSize,l=e.fontFamily,c=e.fontWeight,u=e.cssClass,d=e.backgroundColor,h=e.borderWidth,f=e.strokeDashArray,p=e.borderRadius,m=e.borderColor,g=e.appendTo,v=void 0===g?".apexcharts-svg":g,b=e.paddingLeft,y=void 0===b?4:b,x=e.paddingRight,w=void 0===x?4:x,A=e.paddingBottom,k=void 0===A?2:A,S=e.paddingTop,_=void 0===S?2:S,C=this.w,j=this.graphics.drawText({x:n,y:r,text:i,textAnchor:a||"start",fontSize:o||"12px",fontWeight:c||"regular",fontFamily:l||C.config.chart.fontFamily,foreColor:s||C.config.chart.foreColor,cssClass:u}),E=C.globals.dom.baseEl.querySelector(v);E&&E.appendChild(j.node);var N=j.bbox();if(i){var M=this.graphics.drawRect(N.x-y,N.y-_,N.width+y+w,N.height+k+_,p,d||"transparent",1,h,m,f);E.insertBefore(M.node,j.node)}}},{key:"addImage",value:function(e,t){var n=this.w,r=e.path,i=e.x,a=void 0===i?0:i,s=e.y,o=void 0===s?0:s,l=e.width,c=void 0===l?20:l,u=e.height,d=void 0===u?20:u,h=e.appendTo,f=void 0===h?".apexcharts-svg":h,p=n.globals.dom.Paper.image(r);p.size(c,d).move(a,o);var m=n.globals.dom.baseEl.querySelector(f);return m&&m.appendChild(p.node),p}},{key:"addXaxisAnnotationExternal",value:function(e,t,n){return this.addAnnotationExternal({params:e,pushToMemory:t,context:n,type:"xaxis",contextMethod:n.addXaxisAnnotation}),n}},{key:"addYaxisAnnotationExternal",value:function(e,t,n){return this.addAnnotationExternal({params:e,pushToMemory:t,context:n,type:"yaxis",contextMethod:n.addYaxisAnnotation}),n}},{key:"addPointAnnotationExternal",value:function(e,t,n){return void 0===this.invertAxis&&(this.invertAxis=n.w.globals.isBarHorizontal),this.addAnnotationExternal({params:e,pushToMemory:t,context:n,type:"point",contextMethod:n.addPointAnnotation}),n}},{key:"addAnnotationExternal",value:function(e){var t=e.params,n=e.pushToMemory,r=e.context,i=e.type,a=e.contextMethod,s=r,o=s.w,l=o.globals.dom.baseEl.querySelector(".apexcharts-".concat(i,"-annotations")),c=l.childNodes.length+1,u=new Bn,d=Object.assign({},"xaxis"===i?u.xAxisAnnotation:"yaxis"===i?u.yAxisAnnotation:u.pointAnnotation),h=k.extend(d,t);switch(i){case"xaxis":this.addXaxisAnnotation(h,l,c);break;case"yaxis":this.addYaxisAnnotation(h,l,c);break;case"point":this.addPointAnnotation(h,l,c)}var f=o.globals.dom.baseEl.querySelector(".apexcharts-".concat(i,"-annotations .apexcharts-").concat(i,"-annotation-label[rel='").concat(c,"']")),p=this.helpers.addBackgroundToAnno(f,h);return p&&l.insertBefore(p.node,f),n&&o.globals.memory.methodsToExec.push({context:s,id:h.id?h.id:k.randomId(),method:a,label:"addAnnotation",params:t}),r}},{key:"clearAnnotations",value:function(e){for(var t=e.w,n=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations"),r=t.globals.memory.methodsToExec.length-1;r>=0;r--)"addText"!==t.globals.memory.methodsToExec[r].label&&"addAnnotation"!==t.globals.memory.methodsToExec[r].label||t.globals.memory.methodsToExec.splice(r,1);n=k.listToArray(n),Array.prototype.forEach.call(n,(function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}))}},{key:"removeAnnotation",value:function(e,t){var n=e.w,r=n.globals.dom.baseEl.querySelectorAll(".".concat(t));r&&(n.globals.memory.methodsToExec.map((function(e,r){e.id===t&&n.globals.memory.methodsToExec.splice(r,1)})),Array.prototype.forEach.call(r,(function(e){e.parentElement.removeChild(e)})))}}]),e}(),Hn=function(e){var t,n=e.isTimeline,r=e.ctx,i=e.seriesIndex,a=e.dataPointIndex,s=e.y1,o=e.y2,l=e.w,c=l.globals.seriesRangeStart[i][a],u=l.globals.seriesRangeEnd[i][a],d=l.globals.labels[a],h=l.config.series[i].name?l.config.series[i].name:"",f=l.globals.ttKeyFormatter,p=l.config.tooltip.y.title.formatter,m={w:l,seriesIndex:i,dataPointIndex:a,start:c,end:u};"function"==typeof p&&(h=p(h,m)),null!==(t=l.config.series[i].data[a])&&void 0!==t&&t.x&&(d=l.config.series[i].data[a].x),n||"datetime"===l.config.xaxis.type&&(d=new Pn(r).xLabelFormat(l.globals.ttKeyFormatter,d,d,{i:void 0,dateFormatter:new Rn(r).formatDate,w:l})),"function"==typeof f&&(d=f(d,m)),Number.isFinite(s)&&Number.isFinite(o)&&(c=s,u=o);var g="",v="",b=l.globals.colors[i];if(void 0===l.config.tooltip.x.formatter)if("datetime"===l.config.xaxis.type){var y=new Rn(r);g=y.formatDate(y.getDate(c),l.config.tooltip.x.format),v=y.formatDate(y.getDate(u),l.config.tooltip.x.format)}else g=c,v=u;else g=l.config.tooltip.x.formatter(c),v=l.config.tooltip.x.formatter(u);return{start:c,end:u,startVal:g,endVal:v,ylabel:d,color:b,seriesName:h}},Yn=function(e){var t=e.color,n=e.seriesName,r=e.ylabel,i=e.start,a=e.end,s=e.seriesIndex,o=e.dataPointIndex,l=e.ctx.tooltip.tooltipLabels.getFormatters(s);i=l.yLbFormatter(i),a=l.yLbFormatter(a);var c=l.yLbFormatter(e.w.globals.series[s][o]),u='\n '.concat(i,'\n - \n ').concat(a,"\n ");return'
'+(n||"")+'
'+r+": "+(e.w.globals.comboCharts?"rangeArea"===e.w.config.series[s].type||"rangeBar"===e.w.config.series[s].type?u:"".concat(c,""):u)+"
"},Un=function(){function e(t){s(this,e),this.opts=t}return l(e,[{key:"hideYAxis",value:function(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}},{key:"line",value:function(){return{dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}},{key:"sparkline",value:function(e){return this.hideYAxis(),k.extend(e,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}},{key:"slope",value:function(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter:function(e,t){var n=t.w.config.series[t.seriesIndex].name;return null!==e?n+": "+e:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}},{key:"bar",value:function(){return{chart:{stacked:!1},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"round"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}},{key:"funnel",value:function(){return this.hideYAxis(),g(g({},this.bar()),{},{chart:{animations:{speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}},{key:"candlestick",value:function(){var e=this;return{stroke:{width:1,colors:["#333"]},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(t){var n=t.seriesIndex,r=t.dataPointIndex,i=t.w;return e._getBoxTooltip(i,n,r,["Open","High","","Low","Close"],"candlestick")}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"boxPlot",value:function(){var e=this;return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(t){var n=t.seriesIndex,r=t.dataPointIndex,i=t.w;return e._getBoxTooltip(i,n,r,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")}},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}},{key:"rangeBar",value:function(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter:function(e,t){t.ctx;var n=t.seriesIndex,r=t.dataPointIndex,i=t.w,a=function(){var e=i.globals.seriesRangeStart[n][r];return i.globals.seriesRangeEnd[n][r]-e};return i.globals.comboCharts?"rangeBar"===i.config.series[n].type||"rangeArea"===i.config.series[n].type?a():e:a()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:function(e){return e.w.config.plotOptions&&e.w.config.plotOptions.bar&&e.w.config.plotOptions.bar.horizontal?function(e){var t=Hn(g(g({},e),{},{isTimeline:!0})),n=t.color,r=t.seriesName,i=t.ylabel,a=t.startVal,s=t.endVal;return Yn(g(g({},e),{},{color:n,seriesName:r,ylabel:i,start:a,end:s}))}(e):function(e){var t=Hn(e),n=t.color,r=t.seriesName,i=t.ylabel,a=t.start,s=t.end;return Yn(g(g({},e),{},{color:n,seriesName:r,ylabel:i,start:a,end:s}))}(e)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"dumbbell",value:function(e){var t,n;return null!==(t=e.plotOptions.bar)&&void 0!==t&&t.barHeight||(e.plotOptions.bar.barHeight=2),null!==(n=e.plotOptions.bar)&&void 0!==n&&n.columnWidth||(e.plotOptions.bar.columnWidth=2),e}},{key:"area",value:function(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}},{key:"rangeArea",value:function(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:function(e){return function(e){var t=Hn(e),n=t.color,r=t.seriesName,i=t.ylabel,a=t.start,s=t.end;return Yn(g(g({},e),{},{color:n,seriesName:r,ylabel:i,start:a,end:s}))}(e)}}}}},{key:"brush",value:function(e){return k.extend(e,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:"stacked100",value:function(e){e.dataLabels=e.dataLabels||{},e.dataLabels.formatter=e.dataLabels.formatter||void 0;var t=e.dataLabels.formatter;return e.yaxis.forEach((function(t,n){e.yaxis[n].min=0,e.yaxis[n].max=100})),"bar"===e.chart.type&&(e.dataLabels.formatter=t||function(e){return"number"==typeof e&&e?e.toFixed(0)+"%":e}),e}},{key:"stackedBars",value:function(){var e=this.bar();return g(g({},e),{},{plotOptions:g(g({},e.plotOptions),{},{bar:g(g({},e.plotOptions.bar),{},{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}},{key:"convertCatToNumeric",value:function(e){return e.xaxis.convertedCatToNumeric=!0,e}},{key:"convertCatToNumericXaxis",value:function(e,t,n){e.xaxis.type="numeric",e.xaxis.labels=e.xaxis.labels||{},e.xaxis.labels.formatter=e.xaxis.labels.formatter||function(e){return k.isNumber(e)?Math.floor(e):e};var r=e.xaxis.labels.formatter,i=e.xaxis.categories&&e.xaxis.categories.length?e.xaxis.categories:e.labels;return n&&n.length&&(i=n.map((function(e){return Array.isArray(e)?e:String(e)}))),i&&i.length&&(e.xaxis.labels.formatter=function(e){return k.isNumber(e)?r(i[Math.floor(e)-1]):r(e)}),e.xaxis.categories=[],e.labels=[],e.xaxis.tickAmount=e.xaxis.tickAmount||"dataPoints",e}},{key:"bubble",value:function(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}},{key:"scatter",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}},{key:"heatmap",value:function(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}},{key:"treemap",value:function(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}},{key:"pie",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(e){return e.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(e){return e.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"polarArea",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(e){return e.toFixed(1)+"%"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"radar",value:function(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:function(e){return e},style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:"radialBar",value:function(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"_getBoxTooltip",value:function(e,t,n,r,i){var a=e.globals.seriesCandleO[t][n],s=e.globals.seriesCandleH[t][n],o=e.globals.seriesCandleM[t][n],l=e.globals.seriesCandleL[t][n],c=e.globals.seriesCandleC[t][n];return e.config.series[t].type&&e.config.series[t].type!==i?'
\n '.concat(e.config.series[t].name?e.config.series[t].name:"series-"+(t+1),": ").concat(e.globals.series[t][n],"\n
"):'
')+"
".concat(r[0],': ')+a+"
"+"
".concat(r[1],': ')+s+"
"+(o?"
".concat(r[2],': ')+o+"
":"")+"
".concat(r[3],': ')+l+"
"+"
".concat(r[4],': ')+c+"
"}}]),e}(),Wn=function(){function e(t){s(this,e),this.opts=t}return l(e,[{key:"init",value:function(e){var t=e.responsiveOverride,n=this.opts,r=new Bn,i=new Un(n);this.chartType=n.chart.type,n=this.extendYAxis(n),n=this.extendAnnotations(n);var a=r.init(),s={};if(n&&"object"===w(n)){var o,l,c,u,d,h,f,p,m,g,v={};v=-1!==["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(n.chart.type)?i[n.chart.type]():i.line(),null!==(o=n.plotOptions)&&void 0!==o&&null!==(l=o.bar)&&void 0!==l&&l.isFunnel&&(v=i.funnel()),n.chart.stacked&&"bar"===n.chart.type&&(v=i.stackedBars()),null!==(c=n.chart.brush)&&void 0!==c&&c.enabled&&(v=i.brush(v)),null!==(u=n.plotOptions)&&void 0!==u&&null!==(d=u.line)&&void 0!==d&&d.isSlopeChart&&(v=i.slope()),n.chart.stacked&&"100%"===n.chart.stackType&&(n=i.stacked100(n)),null!==(h=n.plotOptions)&&void 0!==h&&null!==(f=h.bar)&&void 0!==f&&f.isDumbbell&&(n=i.dumbbell(n)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(n),n.xaxis=n.xaxis||window.Apex.xaxis||{},t||(n.xaxis.convertedCatToNumeric=!1),(null!==(p=(n=this.checkForCatToNumericXAxis(this.chartType,v,n)).chart.sparkline)&&void 0!==p&&p.enabled||null!==(m=window.Apex.chart)&&void 0!==m&&null!==(g=m.sparkline)&&void 0!==g&&g.enabled)&&(v=i.sparkline(v)),s=k.extend(a,v)}var b=k.extend(s,window.Apex);return a=k.extend(b,n),this.handleUserInputErrors(a)}},{key:"checkForCatToNumericXAxis",value:function(e,t,n){var r,i,a=new Un(n),s=("bar"===e||"boxPlot"===e)&&(null===(r=n.plotOptions)||void 0===r||null===(i=r.bar)||void 0===i?void 0:i.horizontal),o="pie"===e||"polarArea"===e||"donut"===e||"radar"===e||"radialBar"===e||"heatmap"===e,l="datetime"!==n.xaxis.type&&"numeric"!==n.xaxis.type,c=n.xaxis.tickPlacement?n.xaxis.tickPlacement:t.xaxis&&t.xaxis.tickPlacement;return s||o||!l||"between"===c||(n=a.convertCatToNumeric(n)),n}},{key:"extendYAxis",value:function(e,t){var n=new Bn;(void 0===e.yaxis||!e.yaxis||Array.isArray(e.yaxis)&&0===e.yaxis.length)&&(e.yaxis={}),e.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(e.yaxis=k.extend(e.yaxis,window.Apex.yaxis)),e.yaxis.constructor!==Array?e.yaxis=[k.extend(n.yAxis,e.yaxis)]:e.yaxis=k.extendArray(e.yaxis,n.yAxis);var r=!1;e.yaxis.forEach((function(e){e.logarithmic&&(r=!0)}));var i=e.series;return t&&!i&&(i=t.config.series),r&&i.length!==e.yaxis.length&&i.length&&(e.yaxis=i.map((function(t,r){if(t.name||(i[r].name="series-".concat(r+1)),e.yaxis[r])return e.yaxis[r].seriesName=i[r].name,e.yaxis[r];var a=k.extend(n.yAxis,e.yaxis[0]);return a.show=!1,a}))),r&&i.length>1&&i.length!==e.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes"),e}},{key:"extendAnnotations",value:function(e){return void 0===e.annotations&&(e.annotations={},e.annotations.yaxis=[],e.annotations.xaxis=[],e.annotations.points=[]),e=this.extendYAxisAnnotations(e),e=this.extendXAxisAnnotations(e),this.extendPointAnnotations(e)}},{key:"extendYAxisAnnotations",value:function(e){var t=new Bn;return e.annotations.yaxis=k.extendArray(void 0!==e.annotations.yaxis?e.annotations.yaxis:[],t.yAxisAnnotation),e}},{key:"extendXAxisAnnotations",value:function(e){var t=new Bn;return e.annotations.xaxis=k.extendArray(void 0!==e.annotations.xaxis?e.annotations.xaxis:[],t.xAxisAnnotation),e}},{key:"extendPointAnnotations",value:function(e){var t=new Bn;return e.annotations.points=k.extendArray(void 0!==e.annotations.points?e.annotations.points:[],t.pointAnnotation),e}},{key:"checkForDarkTheme",value:function(e){e.theme&&"dark"===e.theme.mode&&(e.tooltip||(e.tooltip={}),"light"!==e.tooltip.theme&&(e.tooltip.theme="dark"),e.chart.foreColor||(e.chart.foreColor="#f6f7f8"),e.theme.palette||(e.theme.palette="palette4"))}},{key:"handleUserInputErrors",value:function(e){var t=e;if(t.tooltip.shared&&t.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if("bar"===t.chart.type&&t.plotOptions.bar.horizontal){if(t.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");t.yaxis[0].reversed&&(t.yaxis[0].opposite=!0),t.xaxis.tooltip.enabled=!1,t.yaxis[0].tooltip.enabled=!1,t.chart.zoom.enabled=!1}return"bar"!==t.chart.type&&"rangeBar"!==t.chart.type||t.tooltip.shared&&"barWidth"===t.xaxis.crosshairs.width&&t.series.length>1&&(t.xaxis.crosshairs.width="tickWidth"),"candlestick"!==t.chart.type&&"boxPlot"!==t.chart.type||t.yaxis[0].reversed&&(console.warn("Reversed y-axis in ".concat(t.chart.type," chart is not supported.")),t.yaxis[0].reversed=!1),t}}]),e}(),Xn=function(){function e(){s(this,e)}return l(e,[{key:"initGlobalVars",value:function(e){e.series=[],e.seriesCandleO=[],e.seriesCandleH=[],e.seriesCandleM=[],e.seriesCandleL=[],e.seriesCandleC=[],e.seriesRangeStart=[],e.seriesRangeEnd=[],e.seriesRange=[],e.seriesPercent=[],e.seriesGoals=[],e.seriesX=[],e.seriesZ=[],e.seriesNames=[],e.seriesTotals=[],e.seriesLog=[],e.seriesColors=[],e.stackedSeriesTotals=[],e.seriesXvalues=[],e.seriesYvalues=[],e.labels=[],e.hasXaxisGroups=!1,e.groups=[],e.barGroups=[],e.lineGroups=[],e.areaGroups=[],e.hasSeriesGroups=!1,e.seriesGroups=[],e.categoryLabels=[],e.timescaleLabels=[],e.noLabelsProvided=!1,e.resizeTimer=null,e.selectionResizeTimer=null,e.lastWheelExecution=0,e.delayedElements=[],e.pointsArray=[],e.dataLabelsRects=[],e.isXNumeric=!1,e.skipLastTimelinelabel=!1,e.skipFirstTimelinelabel=!1,e.isDataXYZ=!1,e.isMultiLineX=!1,e.isMultipleYAxis=!1,e.maxY=-Number.MAX_VALUE,e.minY=Number.MIN_VALUE,e.minYArr=[],e.maxYArr=[],e.maxX=-Number.MAX_VALUE,e.minX=Number.MAX_VALUE,e.initialMaxX=-Number.MAX_VALUE,e.initialMinX=Number.MAX_VALUE,e.maxDate=0,e.minDate=Number.MAX_VALUE,e.minZ=Number.MAX_VALUE,e.maxZ=-Number.MAX_VALUE,e.minXDiff=Number.MAX_VALUE,e.yAxisScale=[],e.xAxisScale=null,e.xAxisTicksPositions=[],e.yLabelsCoords=[],e.yTitleCoords=[],e.barPadForNumericAxis=0,e.padHorizontal=0,e.xRange=0,e.yRange=[],e.zRange=0,e.dataPoints=0,e.xTickAmount=0,e.multiAxisTickAmount=0}},{key:"globalVars",value:function(e){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:e.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],invalidLogScale:!1,ignoreYAxisIndexes:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,zoomEnabled:"zoom"===e.chart.toolbar.autoSelected&&e.chart.toolbar.tools.zoom&&e.chart.zoom.enabled,panEnabled:"pan"===e.chart.toolbar.autoSelected&&e.chart.toolbar.tools.pan,selectionEnabled:"selection"===e.chart.toolbar.autoSelected&&e.chart.toolbar.tools.selection,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,isSlopeChart:e.plotOptions.line.isSlopeChart,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null,niceScaleAllowedMagMsd:[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],niceScaleDefaultTicks:[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24],seriesYAxisMap:[],seriesYAxisReverseMap:[]}}},{key:"init",value:function(e){var t=this.globalVars(e);return this.initGlobalVars(t),t.initialConfig=k.extend({},e),t.initialSeries=k.clone(e.series),t.lastXAxis=k.clone(t.initialConfig.xaxis),t.lastYAxis=k.clone(t.initialConfig.yaxis),t}}]),e}(),Vn=function(){function e(t){s(this,e),this.opts=t}return l(e,[{key:"init",value:function(){var e=new Wn(this.opts).init({responsiveOverride:!1});return{config:e,globals:(new Xn).init(e)}}}]),e}(),qn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}return l(e,[{key:"clippedImgArea",value:function(e){var t=this.w,n=t.config,r=parseInt(t.globals.gridWidth,10),i=parseInt(t.globals.gridHeight,10),a=r>i?r:i,s=e.image,o=0,l=0;void 0===e.width&&void 0===e.height?void 0!==n.fill.image.width&&void 0!==n.fill.image.height?(o=n.fill.image.width+1,l=n.fill.image.height):(o=a+1,l=a):(o=e.width,l=e.height);var c=document.createElementNS(t.globals.SVGNS,"pattern");Nn.setAttrs(c,{id:e.patternID,patternUnits:e.patternUnits?e.patternUnits:"userSpaceOnUse",width:o+"px",height:l+"px"});var u=document.createElementNS(t.globals.SVGNS,"image");c.appendChild(u),u.setAttributeNS(window.SVG.xlink,"href",s),Nn.setAttrs(u,{x:0,y:0,preserveAspectRatio:"none",width:o+"px",height:l+"px"}),u.style.opacity=e.opacity,t.globals.dom.elDefs.node.appendChild(c)}},{key:"getSeriesIndex",value:function(e){var t=this.w,n=t.config.chart.type;return("bar"===n||"rangeBar"===n)&&t.config.plotOptions.bar.distributed||"heatmap"===n||"treemap"===n?this.seriesIndex=e.seriesNumber:this.seriesIndex=e.seriesNumber%t.globals.series.length,this.seriesIndex}},{key:"computeColorStops",value:function(e,t){var n,r=this.w,i=null,a=null,s=c(e);try{for(s.s();!(n=s.n()).done;){var o=n.value;o>=t.threshold?(null===i||o>i)&&(i=o):(null===a||o-1?m=k.getOpacityFromRGBA(u):v=k.hexToRgba(k.rgb2hex(u),m),e.opacity&&(m=e.opacity),"pattern"===p&&(s=this.handlePatternFill({fillConfig:e.fillConfig,patternFill:s,fillColor:u,fillOpacity:m,defaultColor:v})),g){var b=y(l.fill.gradient.colorStops)||[],x=l.fill.gradient.type;c&&(b[this.seriesIndex]=this.computeColorStops(i.globals.series[this.seriesIndex],l.plotOptions.line.colors),x="vertical"),o=this.handleGradientFill({type:x,fillConfig:e.fillConfig,fillColor:u,fillOpacity:m,colorStops:b,i:this.seriesIndex})}if("image"===p){var w=l.fill.image.src,A=e.patternID?e.patternID:"",S="pattern".concat(i.globals.cuid).concat(e.seriesNumber+1).concat(A);-1===this.patternIDs.indexOf(S)&&(this.clippedImgArea({opacity:m,image:Array.isArray(w)?e.seriesNumber-1&&(f=k.getOpacityFromRGBA(h));var p=void 0===o.gradient.opacityTo?r:Array.isArray(o.gradient.opacityTo)?o.gradient.opacityTo[s]:o.gradient.opacityTo;if(void 0===o.gradient.gradientToColors||0===o.gradient.gradientToColors.length)d="dark"===o.gradient.shade?u.shadeColor(-1*parseFloat(o.gradient.shadeIntensity),n.indexOf("rgb")>-1?k.rgb2hex(n):n):u.shadeColor(parseFloat(o.gradient.shadeIntensity),n.indexOf("rgb")>-1?k.rgb2hex(n):n);else if(o.gradient.gradientToColors[l.seriesNumber]){var m=o.gradient.gradientToColors[l.seriesNumber];d=m,m.indexOf("rgba")>-1&&(p=k.getOpacityFromRGBA(m))}else d=n;if(o.gradient.gradientFrom&&(h=o.gradient.gradientFrom),o.gradient.gradientTo&&(d=o.gradient.gradientTo),o.gradient.inverseColors){var v=h;h=d,d=v}return h.indexOf("rgb")>-1&&(h=k.rgb2hex(h)),d.indexOf("rgb")>-1&&(d=k.rgb2hex(d)),c.drawGradient(t,h,d,f,p,l.size,o.gradient.stops,a,s)}}]),e}(),Gn=function(){function e(t,n){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"setGlobalMarkerSize",value:function(){var e=this.w;if(e.globals.markers.size=Array.isArray(e.config.markers.size)?e.config.markers.size:[e.config.markers.size],e.globals.markers.size.length>0){if(e.globals.markers.size.length4&&void 0!==arguments[4]&&arguments[4],a=this.w,s=t,o=e,l=null,c=new Nn(this.ctx),u=a.config.markers.discrete&&a.config.markers.discrete.length;if(Array.isArray(o.x))for(var d=0;d0:a.config.markers.size>0)||i||u){p||(m+=" w".concat(k.randomId()));var g=this.getMarkerConfig({cssClass:m,seriesIndex:t,dataPointIndex:f});a.config.series[s].data[f]&&(a.config.series[s].data[f].fillColor&&(g.pointFillColor=a.config.series[s].data[f].fillColor),a.config.series[s].data[f].strokeColor&&(g.pointStrokeColor=a.config.series[s].data[f].strokeColor)),void 0!==r&&(g.pSize=r),(o.x[d]<-a.globals.markers.largestSize||o.x[d]>a.globals.gridWidth+a.globals.markers.largestSize||o.y[d]<-a.globals.markers.largestSize||o.y[d]>a.globals.gridHeight+a.globals.markers.largestSize)&&(g.pSize=0),p||((a.globals.markers.size[t]>0||i||u)&&!l&&(l=c.group({class:i||u?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(a.globals.cuid,")")),(h=c.drawMarker(o.x[d],o.y[d],g)).attr("rel",f),h.attr("j",f),h.attr("index",t),h.node.setAttribute("default-marker-size",g.pSize),new En(this.ctx).setSelectionFilter(h,t,f),this.addEvents(h),l&&l.add(h))}else void 0===a.globals.pointsArray[t]&&(a.globals.pointsArray[t]=[]),a.globals.pointsArray[t].push([o.x[d],o.y[d]])}return l}},{key:"getMarkerConfig",value:function(e){var t=e.cssClass,n=e.seriesIndex,r=e.dataPointIndex,i=void 0===r?null:r,a=e.radius,s=void 0===a?null:a,o=e.size,l=void 0===o?null:o,c=e.strokeWidth,u=void 0===c?null:c,d=this.w,h=this.getMarkerStyle(n),f=null===l?d.globals.markers.size[n]:l,p=d.config.markers;return null!==i&&p.discrete.length&&p.discrete.map((function(e){e.seriesIndex===n&&e.dataPointIndex===i&&(h.pointStrokeColor=e.strokeColor,h.pointFillColor=e.fillColor,f=e.size,h.pointShape=e.shape)})),{pSize:null===s?f:s,pRadius:null!==s?s:p.radius,pointStrokeWidth:null!==u?u:Array.isArray(p.strokeWidth)?p.strokeWidth[n]:p.strokeWidth,pointStrokeColor:h.pointStrokeColor,pointFillColor:h.pointFillColor,shape:h.pointShape||(Array.isArray(p.shape)?p.shape[n]:p.shape),class:t,pointStrokeOpacity:Array.isArray(p.strokeOpacity)?p.strokeOpacity[n]:p.strokeOpacity,pointStrokeDashArray:Array.isArray(p.strokeDashArray)?p.strokeDashArray[n]:p.strokeDashArray,pointFillOpacity:Array.isArray(p.fillOpacity)?p.fillOpacity[n]:p.fillOpacity,seriesIndex:n}}},{key:"addEvents",value:function(e){var t=this.w,n=new Nn(this.ctx);e.node.addEventListener("mouseenter",n.pathMouseEnter.bind(this.ctx,e)),e.node.addEventListener("mouseleave",n.pathMouseLeave.bind(this.ctx,e)),e.node.addEventListener("mousedown",n.pathMouseDown.bind(this.ctx,e)),e.node.addEventListener("click",t.config.markers.onClick),e.node.addEventListener("dblclick",t.config.markers.onDblClick),e.node.addEventListener("touchstart",n.pathMouseDown.bind(this.ctx,e),{passive:!0})}},{key:"getMarkerStyle",value:function(e){var t=this.w,n=t.globals.markers.colors,r=t.config.markers.strokeColor||t.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(r)?r[e]:r,pointFillColor:Array.isArray(n)?n[e]:n}}}]),e}(),Qn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.initialAnim=this.w.config.chart.animations.enabled}return l(e,[{key:"draw",value:function(e,t,n){var r=this.w,i=new Nn(this.ctx),a=n.realIndex,s=n.pointsPos,o=n.zRatio,l=n.elParent,c=i.group({class:"apexcharts-series-markers apexcharts-series-".concat(r.config.chart.type)});if(c.attr("clip-path","url(#gridRectMarkerMask".concat(r.globals.cuid,")")),Array.isArray(s.x))for(var u=0;up.maxBubbleRadius&&(f=p.maxBubbleRadius)}var m=s.x[u],g=s.y[u];if(f=f||0,null!==g&&void 0!==r.globals.series[a][d]||(h=!1),h){var v=this.drawPoint(m,g,f,a,d,t);c.add(v)}l.add(c)}}},{key:"drawPoint",value:function(e,t,n,r,i,a){var s=this.w,o=r,l=new S(this.ctx),c=new En(this.ctx),u=new qn(this.ctx),d=new Gn(this.ctx),h=new Nn(this.ctx),f=d.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:o,dataPointIndex:i,radius:"bubble"===s.config.chart.type||s.globals.comboCharts&&s.config.series[r]&&"bubble"===s.config.series[r].type?n:null}),p=u.fillPath({seriesNumber:r,dataPointIndex:i,color:f.pointFillColor,patternUnits:"objectBoundingBox",value:s.globals.series[r][a]}),m=h.drawMarker(e,t,f);if(s.config.series[o].data[i]&&s.config.series[o].data[i].fillColor&&(p=s.config.series[o].data[i].fillColor),m.attr({fill:p}),s.config.chart.dropShadow.enabled){var g=s.config.chart.dropShadow;c.dropShadow(m,g,r)}if(!this.initialAnim||s.globals.dataChanged||s.globals.resized)s.globals.animationEnded=!0;else{var v=s.config.chart.animations.speed;l.animateMarker(m,v,s.globals.easing,(function(){window.setTimeout((function(){l.animationCompleted(m)}),100)}))}return m.attr({rel:i,j:i,index:r,"default-marker-size":f.pSize}),c.setSelectionFilter(m,r,i),d.addEvents(m),m.node.classList.add("apexcharts-marker"),m}},{key:"centerTextInBubble",value:function(e){var t=this.w;return{y:e+=parseInt(t.config.dataLabels.style.fontSize,10)/4}}}]),e}(),Kn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"dataLabelsCorrection",value:function(e,t,n,r,i,a,s){var o=this.w,l=!1,c=new Nn(this.ctx).getTextRects(n,s),u=c.width,d=c.height;t<0&&(t=0),t>o.globals.gridHeight+d&&(t=o.globals.gridHeight+d/2),void 0===o.globals.dataLabelsRects[r]&&(o.globals.dataLabelsRects[r]=[]),o.globals.dataLabelsRects[r].push({x:e,y:t,width:u,height:d});var h=o.globals.dataLabelsRects[r].length-2,f=void 0!==o.globals.lastDrawnDataLabelsIndexes[r]?o.globals.lastDrawnDataLabelsIndexes[r][o.globals.lastDrawnDataLabelsIndexes[r].length-1]:0;if(void 0!==o.globals.dataLabelsRects[r][h]){var p=o.globals.dataLabelsRects[r][f];(e>p.x+p.width||t>p.y+p.height||t+dt.globals.gridWidth+v.textRects.width+30)&&(o="");var b=t.globals.dataLabels.style.colors[a];(("bar"===t.config.chart.type||"rangeBar"===t.config.chart.type)&&t.config.plotOptions.bar.distributed||t.config.dataLabels.distributed)&&(b=t.globals.dataLabels.style.colors[s]),"function"==typeof b&&(b=b({series:t.globals.series,seriesIndex:a,dataPointIndex:s,w:t})),h&&(b=h);var y=d.offsetX,x=d.offsetY;if("bar"!==t.config.chart.type&&"rangeBar"!==t.config.chart.type||(y=0,x=0),t.globals.isSlopeChart&&(0!==s&&(y=-2*d.offsetX+5),0!==s&&s!==t.config.series[a].data.length-1&&(y=0)),v.drawnextLabel){if((g=n.drawText({width:100,height:parseInt(d.style.fontSize,10),x:r+y,y:i+x,foreColor:b,textAnchor:l||d.textAnchor,text:o,fontSize:c||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"})).attr({class:m||"apexcharts-datalabel",cx:r,cy:i}),d.dropShadow.enabled){var w=d.dropShadow;new En(this.ctx).dropShadow(g,w)}u.add(g),void 0===t.globals.lastDrawnDataLabelsIndexes[a]&&(t.globals.lastDrawnDataLabelsIndexes[a]=[]),t.globals.lastDrawnDataLabelsIndexes[a].push(s)}return g}},{key:"addBackgroundToDataLabel",value:function(e,t){var n=this.w,r=n.config.dataLabels.background,i=r.padding,a=r.padding/2,s=t.width,o=t.height,l=new Nn(this.ctx).drawRect(t.x-i,t.y-a/2,s+2*i,o+a,r.borderRadius,"transparent"!==n.config.chart.background&&n.config.chart.background?n.config.chart.background:"#fff",r.opacity,r.borderWidth,r.borderColor);return r.dropShadow.enabled&&new En(this.ctx).dropShadow(l,r.dropShadow),l}},{key:"dataLabelsBackground",value:function(){var e=this.w;if("bubble"!==e.config.chart.type)for(var t=e.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),n=0;n0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.w,i=k.clone(r.globals.initialSeries);r.globals.previousPaths=[],n?(r.globals.collapsedSeries=[],r.globals.ancillaryCollapsedSeries=[],r.globals.collapsedSeriesIndices=[],r.globals.ancillaryCollapsedSeriesIndices=[]):i=this.emptyCollapsedSeries(i),r.config.series=i,e&&(t&&(r.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(i,r.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(e){for(var t=this.w,n=0;n-1&&(e[n].data=[]);return e}},{key:"highlightSeries",value:function(e){var t=this.w,n=this.getSeriesByName(e),r=parseInt(null==n?void 0:n.getAttribute("data:realIndex"),10),i=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),a=null,s=null,o=null;if(t.globals.axisCharts||"radialBar"===t.config.chart.type)if(t.globals.axisCharts){a=t.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(r,"']")),s=t.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(r,"']"));var l=t.globals.seriesYAxisReverseMap[r];o=t.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(l,"']"))}else a=t.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(r+1,"']"));else a=t.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(r+1,"'] path"));for(var c=0;c=e.from&&(a0&&void 0!==arguments[0]?arguments[0]:"asc",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this.w,r=0;if(n.config.series.length>1)for(var i=n.config.series.map((function(e,r){return e.data&&e.data.length>0&&-1===n.globals.collapsedSeriesIndices.indexOf(r)&&(!n.globals.comboCharts||0===t.length||t.length&&t.indexOf(n.config.series[r].type)>-1)?r:-1})),a="asc"===e?0:i.length-1;"asc"===e?a=0;"asc"===e?a++:a--)if(-1!==i[a]){r=i[a];break}return r}},{key:"getBarSeriesIndices",value:function(){return this.w.globals.comboCharts?this.w.config.series.map((function(e,t){return"bar"===e.type||"column"===e.type?t:-1})).filter((function(e){return-1!==e})):this.w.config.series.map((function(e,t){return t}))}},{key:"getPreviousPaths",value:function(){var e=this.w;function t(t,n,r){for(var i=t[n].childNodes,a={type:r,paths:[],realIndex:t[n].getAttribute("data:realIndex")},s=0;s0)for(var r=function(t){for(var n=e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(e.config.chart.type," .apexcharts-series[data\\:realIndex='").concat(t,"'] rect")),r=[],i=function(e){var t=function(t){return n[e].getAttribute(t)},i={x:parseFloat(t("x")),y:parseFloat(t("y")),width:parseFloat(t("width")),height:parseFloat(t("height"))};r.push({rect:i,color:n[e].getAttribute("color")})},a=0;a0?e:[]}))}}]),e}(),Jn=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new Mn(this.ctx)}return l(e,[{key:"isMultiFormat",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:"isFormatXY",value:function(){var e=this.w.config.series.slice(),t=new Zn(this.ctx);if(this.activeSeriesIndex=t.getActiveConfigSeriesIndex(),void 0!==e[this.activeSeriesIndex].data&&e[this.activeSeriesIndex].data.length>0&&null!==e[this.activeSeriesIndex].data[0]&&void 0!==e[this.activeSeriesIndex].data[0].x&&null!==e[this.activeSeriesIndex].data[0])return!0}},{key:"isFormat2DArray",value:function(){var e=this.w.config.series.slice(),t=new Zn(this.ctx);if(this.activeSeriesIndex=t.getActiveConfigSeriesIndex(),void 0!==e[this.activeSeriesIndex].data&&e[this.activeSeriesIndex].data.length>0&&void 0!==e[this.activeSeriesIndex].data[0]&&null!==e[this.activeSeriesIndex].data[0]&&e[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(e,t){for(var n=this.w.config,r=this.w.globals,i="boxPlot"===n.chart.type||"boxPlot"===n.series[t].type,a=0;a=5?this.twoDSeries.push(k.parseNumber(e[t].data[a][4])):this.twoDSeries.push(k.parseNumber(e[t].data[a][1])),r.dataFormatXNumeric=!0),"datetime"===n.xaxis.type){var s=new Date(e[t].data[a][0]);s=new Date(s).getTime(),this.twoDSeriesX.push(s)}else this.twoDSeriesX.push(e[t].data[a][0]);for(var o=0;o-1&&(a=this.activeSeriesIndex);for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:this.ctx,r=this.w.config,i=this.w.globals,a=new Rn(n),s=r.labels.length>0?r.labels.slice():r.xaxis.categories.slice();i.isRangeBar="rangeBar"===r.chart.type&&i.isBarHorizontal,i.hasXaxisGroups="category"===r.xaxis.type&&r.xaxis.group.groups.length>0,i.hasXaxisGroups&&(i.groups=r.xaxis.group.groups),e.forEach((function(e,t){void 0!==e.name?i.seriesNames.push(e.name):i.seriesNames.push("series-"+parseInt(t+1,10))})),this.coreUtils.setSeriesYAxisMappings();var o=[],l=y(new Set(r.series.map((function(e){return e.group}))));r.series.forEach((function(e,t){var n=l.indexOf(e.group);o[n]||(o[n]=[]),o[n].push(i.seriesNames[t])})),i.seriesGroups=o;for(var c=function(){for(var e=0;e0&&(this.twoDSeriesX=s,i.seriesX.push(this.twoDSeriesX))),i.labels.push(this.twoDSeriesX);var d=e[u].data.map((function(e){return k.parseNumber(e)}));i.series.push(d)}i.seriesZ.push(this.threeDSeries),void 0!==e[u].color?i.seriesColors.push(e[u].color):i.seriesColors.push(void 0)}return this.w}},{key:"parseDataNonAxisCharts",value:function(e){var t=this.w.globals,n=this.w.config;t.series=e.slice(),t.seriesNames=n.labels.slice();for(var r=0;r0?n.labels=t.xaxis.categories:t.labels.length>0?n.labels=t.labels.slice():this.fallbackToCategory?(n.labels=n.labels[0],n.seriesRange.length&&(n.seriesRange.map((function(e){e.forEach((function(e){n.labels.indexOf(e.x)<0&&e.x&&n.labels.push(e.x)}))})),n.labels=Array.from(new Set(n.labels.map(JSON.stringify)),JSON.parse)),t.xaxis.convertedCatToNumeric&&(new Un(t).convertCatToNumericXaxis(t,this.ctx,n.seriesX[0]),this._generateExternalLabels(e))):this._generateExternalLabels(e)}},{key:"_generateExternalLabels",value:function(e){var t=this.w.globals,n=this.w.config,r=[];if(t.axisCharts){if(t.series.length>0)if(this.isFormatXY())for(var i=n.series.map((function(e,t){return e.data.filter((function(e,t,n){return n.findIndex((function(t){return t.x===e.x}))===t}))})),a=i.reduce((function(e,t,n,r){return r[e].length>t.length?e:n}),0),s=0;s0&&i==n.length&&t.push(r)})),e.globals.ignoreYAxisIndexes=t.map((function(e){return e}))}}]),e}(),$n=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"scaleSvgNode",value:function(e,t){var n=parseFloat(e.getAttributeNS(null,"width")),r=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",n*t),e.setAttributeNS(null,"height",r*t),e.setAttributeNS(null,"viewBox","0 0 "+n+" "+r)}},{key:"getSvgString",value:function(){var e=this;return new Promise((function(t){var n=e.w,r=n.config.chart.toolbar.export.width,i=n.config.chart.toolbar.export.scale||r/n.globals.svgWidth;i||(i=1);var a=e.w.globals.dom.Paper.svg(),s=e.w.globals.dom.Paper.node.cloneNode(!0);1!==i&&e.scaleSvgNode(s,i),e.convertImagesToBase64(s).then((function(){a=(new XMLSerializer).serializeToString(s),t(a.replace(/ /g," "))}))}))}},{key:"convertImagesToBase64",value:function(e){var t=this,n=e.getElementsByTagName("image"),r=Array.from(n).map((function(e){var n=e.getAttributeNS("http://www.w3.org/1999/xlink","href");return n&&!n.startsWith("data:")?t.getBase64FromUrl(n).then((function(t){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t)})).catch((function(e){console.error("Error converting image to base64:",e)})):Promise.resolve()}));return Promise.all(r)}},{key:"getBase64FromUrl",value:function(e){return new Promise((function(t,n){var r=new Image;r.crossOrigin="Anonymous",r.onload=function(){var e=document.createElement("canvas");e.width=r.width,e.height=r.height,e.getContext("2d").drawImage(r,0,0),t(e.toDataURL())},r.onerror=n,r.src=e}))}},{key:"cleanup",value:function(){var e=this.w,t=e.globals.dom.baseEl.getElementsByClassName("apexcharts-xcrosshairs"),n=e.globals.dom.baseEl.getElementsByClassName("apexcharts-ycrosshairs"),r=e.globals.dom.baseEl.querySelectorAll(".apexcharts-zoom-rect, .apexcharts-selection-rect");Array.prototype.forEach.call(r,(function(e){e.setAttribute("width",0)})),t&&t[0]&&(t[0].setAttribute("x",-500),t[0].setAttribute("x1",-500),t[0].setAttribute("x2",-500)),n&&n[0]&&(n[0].setAttribute("y",-100),n[0].setAttribute("y1",-100),n[0].setAttribute("y2",-100))}},{key:"svgUrl",value:function(){var e=this;return new Promise((function(t){e.cleanup(),e.getSvgString().then((function(e){var n=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(n))}))}))}},{key:"dataURI",value:function(e){var t=this;return new Promise((function(n){var r=t.w,i=e?e.scale||e.width/r.globals.svgWidth:1;t.cleanup();var a=document.createElement("canvas");a.width=r.globals.svgWidth*i,a.height=parseInt(r.globals.dom.elWrap.style.height,10)*i;var s="transparent"!==r.config.chart.background&&r.config.chart.background?r.config.chart.background:"#fff",o=a.getContext("2d");o.fillStyle=s,o.fillRect(0,0,a.width*i,a.height*i),t.getSvgString().then((function(e){var t="data:image/svg+xml,"+encodeURIComponent(e),r=new Image;r.crossOrigin="anonymous",r.onload=function(){if(o.drawImage(r,0,0),a.msToBlob){var e=a.msToBlob();n({blob:e})}else{var t=a.toDataURL("image/png");n({imgURI:t})}},r.src=t}))}))}},{key:"exportToSVG",value:function(){var e=this;this.svgUrl().then((function(t){e.triggerDownload(t,e.w.config.chart.toolbar.export.svg.filename,".svg")}))}},{key:"exportToPng",value:function(){var e=this,t=this.w.config.chart.toolbar.export.scale,n=this.w.config.chart.toolbar.export.width,r=t?{scale:t}:n?{width:n}:void 0;this.dataURI(r).then((function(t){var n=t.imgURI,r=t.blob;r?navigator.msSaveOrOpenBlob(r,e.w.globals.chartID+".png"):e.triggerDownload(n,e.w.config.chart.toolbar.export.png.filename,".png")}))}},{key:"exportToCSV",value:function(e){var t=this,n=e.series,r=e.fileName,i=e.columnDelimiter,a=void 0===i?",":i,s=e.lineDelimiter,o=void 0===s?"\n":s,l=this.w;n||(n=l.config.series);var c=[],u=[],d="",h=l.globals.series.map((function(e,t){return-1===l.globals.collapsedSeriesIndices.indexOf(t)?e:[]})),f=function(e){return"function"==typeof l.config.chart.toolbar.export.csv.categoryFormatter?l.config.chart.toolbar.export.csv.categoryFormatter(e):"datetime"===l.config.xaxis.type&&String(e).length>=10?new Date(e).toDateString():k.isNumber(e)?e:e.split(a).join("")},p=function(e){return"function"==typeof l.config.chart.toolbar.export.csv.valueFormatter?l.config.chart.toolbar.export.csv.valueFormatter(e):e},m=Math.max.apply(Math,y(n.map((function(e){return e.data?e.data.length:0})))),g=new Jn(this.ctx),v=new In(this.ctx),b=function(e){var n="";if(l.globals.axisCharts){if("category"===l.config.xaxis.type||l.config.xaxis.convertedCatToNumeric)if(l.globals.isBarHorizontal){var r=l.globals.yLabelFormatters[0],i=new Zn(t.ctx).getActiveConfigSeriesIndex();n=r(l.globals.labels[e],{seriesIndex:i,dataPointIndex:e,w:l})}else n=v.getLabel(l.globals.labels,l.globals.timescaleLabels,0,e).text;"datetime"===l.config.xaxis.type&&(l.config.xaxis.categories.length?n=l.config.xaxis.categories[e]:l.config.labels.length&&(n=l.config.labels[e]))}else n=l.config.labels[e];return null===n?"nullvalue":(Array.isArray(n)&&(n=n.join(" ")),k.isNumber(n)?n:n.split(a).join(""))};c.push(l.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===l.config.chart.type?(c.push("minimum"),c.push("q1"),c.push("median"),c.push("q3"),c.push("maximum")):"candlestick"===l.config.chart.type?(c.push("open"),c.push("high"),c.push("low"),c.push("close")):"rangeBar"===l.config.chart.type?(c.push("minimum"),c.push("maximum")):n.map((function(e,t){var n=(e.name?e.name:"series-".concat(t))+"";l.globals.axisCharts&&c.push(n.split(a).join("")?n.split(a).join(""):"series-".concat(t))})),l.globals.axisCharts||(c.push(l.config.chart.toolbar.export.csv.headerValue),u.push(c.join(a))),l.globals.allSeriesHasEqualX||!l.globals.axisCharts||l.config.xaxis.categories.length||l.config.labels.length?n.map((function(e,t){l.globals.axisCharts?function(e,t){if(c.length&&0===t&&u.push(c.join(a)),e.data){e.data=e.data.length&&e.data||y(Array(m)).map((function(){return""}));for(var r=0;r0&&!r.globals.isBarHorizontal&&(this.xaxisLabels=r.globals.timescaleLabels.slice()),r.config.xaxis.overwriteCategories&&(this.xaxisLabels=r.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===r.config.xaxis.position?this.offY=0:this.offY=r.globals.gridHeight,this.offY=this.offY+r.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===r.config.chart.type&&r.config.plotOptions.bar.horizontal,this.xaxisFontSize=r.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=r.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=r.config.xaxis.labels.style.colors,this.xaxisBorderWidth=r.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=r.config.yaxis[0].axisBorder.width.toString()),this.xaxisBorderWidth.indexOf("%")>-1?this.xaxisBorderWidth=r.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=r.config.xaxis.axisBorder.height,this.yaxis=r.config.yaxis[0]}return l(e,[{key:"drawXaxis",value:function(){var e=this.w,t=new Nn(this.ctx),n=t.group({class:"apexcharts-xaxis",transform:"translate(".concat(e.config.xaxis.offsetX,", ").concat(e.config.xaxis.offsetY,")")}),r=t.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(e.globals.translateXAxisX,", ").concat(e.globals.translateXAxisY,")")});n.add(r);for(var i=[],a=0;a6&&void 0!==arguments[6]?arguments[6]:{},c=[],u=[],d=this.w,h=l.xaxisFontSize||this.xaxisFontSize,f=l.xaxisFontFamily||this.xaxisFontFamily,p=l.xaxisForeColors||this.xaxisForeColors,m=l.fontWeight||d.config.xaxis.labels.style.fontWeight,g=l.cssClass||d.config.xaxis.labels.style.cssClass,v=d.globals.padHorizontal,b=r.length,y="category"===d.config.xaxis.type?d.globals.dataPoints:b;if(0===y&&b>y&&(y=b),i){var x=y>1?y-1:y;s=d.globals.gridWidth/Math.min(x,b-1),v=v+a(0,s)/2+d.config.xaxis.labels.offsetX}else s=d.globals.gridWidth/y,v=v+a(0,s)+d.config.xaxis.labels.offsetX;for(var w=function(i){var l=v-a(i,s)/2+d.config.xaxis.labels.offsetX;0===i&&1===b&&s/2===v&&1===y&&(l=d.globals.gridWidth/2);var x=o.axesUtils.getLabel(r,d.globals.timescaleLabels,l,i,c,h,e),w=28;if(d.globals.rotateXLabels&&e&&(w=22),d.config.xaxis.title.text&&"top"===d.config.xaxis.position&&(w+=parseFloat(d.config.xaxis.title.style.fontSize)+2),e||(w=w+parseFloat(h)+(d.globals.xAxisLabelsHeight-d.globals.xAxisGroupLabelsHeight)+(d.globals.rotateXLabels?10:0)),x=void 0!==d.config.xaxis.tickAmount&&"dataPoints"!==d.config.xaxis.tickAmount&&"datetime"!==d.config.xaxis.type?o.axesUtils.checkLabelBasedOnTickamount(i,x,b):o.axesUtils.checkForOverflowingLabels(i,x,b,c,u),d.config.xaxis.labels.show){var A=t.drawText({x:x.x,y:o.offY+d.config.xaxis.labels.offsetY+w-("top"===d.config.xaxis.position?d.globals.xAxisHeight+d.config.xaxis.axisTicks.height-2:0),text:x.text,textAnchor:"middle",fontWeight:x.isBold?600:m,fontSize:h,fontFamily:f,foreColor:Array.isArray(p)?e&&d.config.xaxis.convertedCatToNumeric?p[d.globals.minX+i-1]:p[i]:p,isPlainText:!1,cssClass:(e?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+g});if(n.add(A),A.on("click",(function(e){if("function"==typeof d.config.chart.events.xAxisLabelClick){var t=Object.assign({},d,{labelIndex:i});d.config.chart.events.xAxisLabelClick(e,o.ctx,t)}})),e){var k=document.createElementNS(d.globals.SVGNS,"title");k.textContent=Array.isArray(x.text)?x.text.join(" "):x.text,A.node.appendChild(k),""!==x.text&&(c.push(x.text),u.push(x))}}ir.globals.gridWidth)){var a=this.offY+r.config.xaxis.axisTicks.offsetY;if(t=t+a+r.config.xaxis.axisTicks.height,"top"===r.config.xaxis.position&&(t=a-r.config.xaxis.axisTicks.height),r.config.xaxis.axisTicks.show){var s=new Nn(this.ctx).drawLine(e+r.config.xaxis.axisTicks.offsetX,a+r.config.xaxis.offsetY,i+r.config.xaxis.axisTicks.offsetX,t+r.config.xaxis.offsetY,r.config.xaxis.axisTicks.color);n.add(s),s.node.classList.add("apexcharts-xaxis-tick")}}}},{key:"getXAxisTicksPositions",value:function(){var e=this.w,t=[],n=this.xaxisLabels.length,r=e.globals.padHorizontal;if(e.globals.timescaleLabels.length>0)for(var i=0;i0){var c=i[i.length-1].getBBox(),u=i[0].getBBox();c.x<-20&&i[i.length-1].parentNode.removeChild(i[i.length-1]),u.x+u.width>e.globals.gridWidth&&!e.globals.isBarHorizontal&&i[0].parentNode.removeChild(i[0]);for(var d=0;d0&&(this.xaxisLabels=n.globals.timescaleLabels.slice())}return l(e,[{key:"drawGridArea",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.w,n=new Nn(this.ctx);e||(e=n.group({class:"apexcharts-grid"}));var r=n.drawLine(t.globals.padHorizontal,1,t.globals.padHorizontal,t.globals.gridHeight,"transparent"),i=n.drawLine(t.globals.padHorizontal,t.globals.gridHeight,t.globals.gridWidth,t.globals.gridHeight,"transparent");return e.add(i),e.add(r),e}},{key:"drawGrid",value:function(){if(this.w.globals.axisCharts){var e=this.renderGrid();return this.drawGridArea(e.el),e}return null}},{key:"createGridMask",value:function(){var e=this.w,t=e.globals,n=new Nn(this.ctx),r=Array.isArray(e.config.stroke.width)?Math.max.apply(Math,y(e.config.stroke.width)):e.config.stroke.width,i=function(e){var n=document.createElementNS(t.SVGNS,"clipPath");return n.setAttribute("id",e),n};t.dom.elGridRectMask=i("gridRectMask".concat(t.cuid)),t.dom.elGridRectBarMask=i("gridRectBarMask".concat(t.cuid)),t.dom.elGridRectMarkerMask=i("gridRectMarkerMask".concat(t.cuid)),t.dom.elForecastMask=i("forecastMask".concat(t.cuid)),t.dom.elNonForecastMask=i("nonForecastMask".concat(t.cuid));var a=0,s=0;(["bar","rangeBar","candlestick","boxPlot"].includes(e.config.chart.type)||e.globals.comboBarCount>0)&&e.globals.isXNumeric&&!e.globals.isBarHorizontal&&(a=Math.max(e.config.grid.padding.left,t.barPadForNumericAxis),s=Math.max(e.config.grid.padding.right,t.barPadForNumericAxis)),t.dom.elGridRect=n.drawRect(0,0,t.gridWidth,t.gridHeight,0,"#fff"),t.dom.elGridRectBar=n.drawRect(-r/2-a-2,-r/2-2,t.gridWidth+r+s+a+4,t.gridHeight+r+4,0,"#fff");var o=e.globals.markers.largestSize;t.dom.elGridRectMarker=n.drawRect(-o,-o,t.gridWidth+2*o,t.gridHeight+2*o,0,"#fff"),t.dom.elGridRectMask.appendChild(t.dom.elGridRect.node),t.dom.elGridRectBarMask.appendChild(t.dom.elGridRectBar.node),t.dom.elGridRectMarkerMask.appendChild(t.dom.elGridRectMarker.node);var l=t.dom.baseEl.querySelector("defs");l.appendChild(t.dom.elGridRectMask),l.appendChild(t.dom.elGridRectBarMask),l.appendChild(t.dom.elGridRectMarkerMask),l.appendChild(t.dom.elForecastMask),l.appendChild(t.dom.elNonForecastMask)}},{key:"_drawGridLines",value:function(e){var t=e.i,n=e.x1,r=e.y1,i=e.x2,a=e.y2,s=e.xCount,o=e.parent,l=this.w;if(!(0===t&&l.globals.skipFirstTimelinelabel||t===s-1&&l.globals.skipLastTimelinelabel&&!l.config.xaxis.labels.formatter||"radar"===l.config.chart.type)){l.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:n,y1:r,x2:i,y2:a,xCount:s,parent:o});var c=0;if(l.globals.hasXaxisGroups&&"between"===l.config.xaxis.tickPlacement){var u=l.globals.groups;if(u){for(var d=0,h=0;d0&&"datetime"!==e.config.xaxis.type&&(i=t.yAxisScale[r].result.length-1)),this._drawXYLines({xCount:i,tickAmount:l})):(i=l,l=t.xTickAmount,this._drawInvertedXYLines({xCount:i,tickAmount:l}));return this.drawGridBands(i,l),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:t.gridWidth/i}}},{key:"drawGridBands",value:function(e,t){var n,r,i=this,a=this.w;if((null===(n=a.config.grid.row.colors)||void 0===n?void 0:n.length)>0&&function(e,n,r,s,o,l){for(var c=0,u=0;c=a.config.grid.row.colors.length&&(u=0),i._drawGridBandRect({c:u,x1:0,y1:s,x2:o,y2:l,type:"row"}),s+=a.globals.gridHeight/t}(0,t,0,0,a.globals.gridWidth,a.globals.gridHeight/t),(null===(r=a.config.grid.column.colors)||void 0===r?void 0:r.length)>0){var s=a.globals.isBarHorizontal||"on"!==a.config.xaxis.tickPlacement||"category"!==a.config.xaxis.type&&!a.config.xaxis.convertedCatToNumeric?e:e-1;a.globals.isXNumeric&&(s=a.globals.xAxisScale.result.length-1);for(var o=a.globals.padHorizontal,l=a.globals.padHorizontal+a.globals.gridWidth/s,c=a.globals.gridHeight,u=0,d=0;u=a.config.grid.column.colors.length&&(d=0),"datetime"===a.config.xaxis.type&&(o=this.xaxisLabels[u].position,l=((null===(h=this.xaxisLabels[u+1])||void 0===h?void 0:h.position)||a.globals.gridWidth)-this.xaxisLabels[u].position),this._drawGridBandRect({c:d,x1:o,y1:0,x2:l,y2:c,type:"column"}),o+=a.globals.gridWidth/s}}}}]),e}(),nr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.coreUtils=new Mn(this.ctx)}return l(e,[{key:"niceScale",value:function(e,t){var n,r,i,a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=1e-11,l=this.w,c=l.globals;c.isBarHorizontal?(n=l.config.xaxis,r=Math.max((c.svgWidth-100)/25,2)):(n=l.config.yaxis[s],r=Math.max((c.svgHeight-100)/15,2)),k.isNumber(r)||(r=10),i=void 0!==n.min&&null!==n.min,a=void 0!==n.max&&null!==n.min;var u=void 0!==n.stepSize&&null!==n.stepSize,d=void 0!==n.tickAmount&&null!==n.tickAmount,h=d?n.tickAmount:c.niceScaleDefaultTicks[Math.min(Math.round(r/2),c.niceScaleDefaultTicks.length-1)];if(c.isMultipleYAxis&&!d&&c.multiAxisTickAmount>0&&(h=c.multiAxisTickAmount,d=!0),h="dataPoints"===h?c.dataPoints-1:Math.abs(Math.round(h)),(e===Number.MIN_VALUE&&0===t||!k.isNumber(e)&&!k.isNumber(t)||e===Number.MIN_VALUE&&t===-Number.MAX_VALUE)&&(e=k.isNumber(n.min)?n.min:0,t=k.isNumber(n.max)?n.max:e+h,c.allSeriesCollapsed=!1),e>t){console.warn("axis.min cannot be greater than axis.max: swapping min and max");var f=t;t=e,e=f}else e===t&&(e=0===e?0:e-1,t=0===t?2:t+1);var p=[];h<1&&(h=1);var m=h,g=Math.abs(t-e);!i&&e>0&&e/g<.15&&(e=0,i=!0),!a&&t<0&&-t/g<.15&&(t=0,a=!0);var v=(g=Math.abs(t-e))/m,b=v,y=Math.floor(Math.log10(b)),x=Math.pow(10,y),w=Math.ceil(b/x);if(v=b=(w=c.niceScaleAllowedMagMsd[0===c.yValueDecimal?0:1][w])*x,c.isBarHorizontal&&n.stepSize&&"datetime"!==n.type?(v=n.stepSize,u=!0):u&&(v=n.stepSize),u&&n.forceNiceScale){var A=Math.floor(Math.log10(v));v*=Math.pow(10,y-A)}if(i&&a){var S=g/m;if(d)if(u)if(0!=k.mod(g,v)){var _=k.getGCD(v,S);v=S/_<10?_:S}else 0==k.mod(v,S)?v=S:(S=v,d=!1);else v=S;else if(u)0==k.mod(g,v)?S=v:v=S;else if(0==k.mod(g,v))S=v;else{S=g/(m=Math.ceil(g/v));var C=k.getGCD(g,v);g/Cr&&(e=t-v*h,e+=v*Math.floor((j-e)/v))}else if(i)if(d)t=e+v*m;else{var E=t;t=v*Math.ceil(t/v),Math.abs(t-e)/k.getGCD(g,v)>r&&(t=e+v*h,t+=v*Math.ceil((E-t)/v))}}else if(c.isMultipleYAxis&&d){var N=v*Math.floor(e/v),M=N+v*m;M0&&e16&&k.getPrimeFactors(m).length<2&&m++,!d&&n.forceNiceScale&&0===c.yValueDecimal&&m>g&&(m=g,v=Math.round(g/m)),m>r&&(!d&&!u||n.forceNiceScale)){var T=k.getPrimeFactors(m),O=T.length-1,R=m;e:for(var P=0;PH);return{result:p,niceMin:p[0],niceMax:p[p.length-1]}}},{key:"linearScale",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,a=Math.abs(t-e),s=[];if(e===t)return{result:s=[e],niceMin:s[0],niceMax:s[s.length-1]};"dataPoints"===(n=this._adjustTicksForSmallRange(n,r,a))&&(n=this.w.globals.dataPoints-1),i||(i=a/n),i=Math.round(10*(i+Number.EPSILON))/10,n===Number.MAX_VALUE&&(n=5,i=1);for(var o=e;n>=0;)s.push(o),o=k.preciseAddition(o,i),n-=1;return{result:s,niceMin:s[0],niceMax:s[s.length-1]}}},{key:"logarithmicScaleNice",value:function(e,t,n){t<=0&&(t=Math.max(e,n)),e<=0&&(e=Math.min(t,n));for(var r=[],i=Math.ceil(Math.log(t)/Math.log(n)+1),a=Math.floor(Math.log(e)/Math.log(n));a5?(r.allSeriesCollapsed=!1,r.yAxisScale[e]=a.forceNiceScale?this.logarithmicScaleNice(t,n,a.logBase):this.logarithmicScale(t,n,a.logBase)):n!==-Number.MAX_VALUE&&k.isNumber(n)&&t!==Number.MAX_VALUE&&k.isNumber(t)?(r.allSeriesCollapsed=!1,r.yAxisScale[e]=this.niceScale(t,n,e)):r.yAxisScale[e]=this.niceScale(Number.MIN_VALUE,0,e)}},{key:"setXScale",value:function(e,t){var n=this.w,r=n.globals,i=Math.abs(t-e);if(t!==-Number.MAX_VALUE&&k.isNumber(t)){var a=r.xTickAmount+1;i<10&&i>1&&(a=i),r.xAxisScale=this.linearScale(e,t,a,0,n.config.xaxis.stepSize)}else r.xAxisScale=this.linearScale(0,10,10);return r.xAxisScale}},{key:"scaleMultipleYAxes",value:function(){var e=this,t=this.w.config,n=this.w.globals;this.coreUtils.setSeriesYAxisMappings();var r=n.seriesYAxisMap,i=n.minYArr,a=n.maxYArr;n.allSeriesCollapsed=!0,n.barGroups=[],r.forEach((function(r,s){var o=[];r.forEach((function(e){var n=t.series[e].group;o.indexOf(n)<0&&o.push(n)})),r.length>0?function(){var l,c,u=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=u,f=d;if(t.chart.stacked)!function(){var e=new Array(n.dataPoints).fill(0),i=[],a=[],p=[];o.forEach((function(){i.push(e.map((function(){return Number.MIN_VALUE}))),a.push(e.map((function(){return Number.MIN_VALUE}))),p.push(e.map((function(){return Number.MIN_VALUE})))}));for(var m=function(e){!l&&t.series[r[e]].type&&(l=t.series[r[e]].type);var u=r[e];c=t.series[u].group?t.series[u].group:"axis-".concat(s),!(n.collapsedSeriesIndices.indexOf(u)<0&&n.ancillaryCollapsedSeriesIndices.indexOf(u)<0)||(n.allSeriesCollapsed=!1,o.forEach((function(e,r){if(t.series[u].group===e)for(var s=0;s=0?a[r][s]+=o:p[r][s]+=o,i[r][s]+=o,h=Math.min(h,o),f=Math.max(f,o)}}))),"bar"!==l&&"column"!==l||n.barGroups.push(c)},g=0;g1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-Number.MAX_VALUE,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=this.w.config,a=this.w.globals,s=-Number.MAX_VALUE,o=Number.MIN_VALUE;null===r&&(r=e+1);var l=a.series,c=l,u=l;"candlestick"===i.chart.type?(c=a.seriesCandleL,u=a.seriesCandleH):"boxPlot"===i.chart.type?(c=a.seriesCandleO,u=a.seriesCandleC):a.isRangeData&&(c=a.seriesRangeStart,u=a.seriesRangeEnd);var d=!1;if(a.seriesX.length>=r){var h,f=null===(h=a.brushSource)||void 0===h?void 0:h.w.config.chart.brush;(i.chart.zoom.enabled&&i.chart.zoom.autoScaleYaxis||null!=f&&f.enabled&&null!=f&&f.autoScaleYaxis)&&(d=!0)}for(var p=e;pg&&a.seriesX[p][v]>i.xaxis.max;v--);}for(var b=g;b<=v&&bc[p][b]&&c[p][b]<0&&(o=c[p][b])}else a.hasNullValues=!0}"bar"!==m&&"column"!==m||(o<0&&s<0&&(s=0,n=Math.max(n,0)),o===Number.MIN_VALUE&&(o=0,t=Math.min(t,0)))}return"rangeBar"===i.chart.type&&a.seriesRangeStart.length&&a.isBarHorizontal&&(o=t),"bar"===i.chart.type&&(o<0&&s<0&&(s=0),o===Number.MIN_VALUE&&(o=0)),{minY:o,maxY:s,lowestY:t,highestY:n}}},{key:"setYRange",value:function(){var e=this.w.globals,t=this.w.config;e.maxY=-Number.MAX_VALUE,e.minY=Number.MIN_VALUE;var n,r=Number.MAX_VALUE;if(e.isMultipleYAxis){r=Number.MAX_VALUE;for(var i=0;ie.dataPoints&&0!==e.dataPoints&&(r=e.dataPoints-1);else if("dataPoints"===t.xaxis.tickAmount){if(e.series.length>1&&(r=e.series[e.maxValsInArrayIndex].length-1),e.isXNumeric){var i=e.maxX-e.minX;i<30&&(r=i-1)}}else r=t.xaxis.tickAmount;if(e.xTickAmount=r,void 0!==t.xaxis.max&&"number"==typeof t.xaxis.max&&(e.maxX=t.xaxis.max),void 0!==t.xaxis.min&&"number"==typeof t.xaxis.min&&(e.minX=t.xaxis.min),void 0!==t.xaxis.range&&(e.minX=e.maxX-t.xaxis.range),e.minX!==Number.MAX_VALUE&&e.maxX!==-Number.MAX_VALUE)if(t.xaxis.convertedCatToNumeric&&!e.dataFormatXNumeric){for(var a=[],s=e.minX-1;s0&&(e.xAxisScale=this.scales.linearScale(1,e.labels.length,r-1,0,t.xaxis.stepSize),e.seriesX=e.labels.slice());n&&(e.labels=e.xAxisScale.result.slice())}return e.isBarHorizontal&&e.labels.length&&(e.xTickAmount=e.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:e.minX,maxX:e.maxX}}},{key:"setZRange",value:function(){var e=this.w.globals;if(e.isDataXYZ)for(var t=0;t0){var i=t-r[n-1];i>0&&(e.minXDiff=Math.min(i,e.minXDiff))}})),1!==e.dataPoints&&e.minXDiff!==Number.MAX_VALUE||(e.minXDiff=.5)}))}},{key:"_setStackedMinMax",value:function(){var e=this,t=this.w.globals;if(t.series.length){var n=t.seriesGroups;n.length||(n=[this.w.globals.seriesNames.map((function(e){return e}))]);var r={},i={};n.forEach((function(n){r[n]=[],i[n]=[],e.w.config.series.map((function(e,r){return n.indexOf(t.seriesNames[r])>-1?r:null})).filter((function(e){return null!==e})).forEach((function(a){for(var s=0;s0?r[n][s]+=parseFloat(t.series[a][s])+1e-4:i[n][s]+=parseFloat(t.series[a][s]))}}))})),Object.entries(r).forEach((function(e){var n=b(e,1)[0];r[n].forEach((function(e,a){t.maxY=Math.max(t.maxY,r[n][a]),t.minY=Math.min(t.minY,i[n][a])}))}))}}}]),e}(),ir=function(){function e(t,n){s(this,e),this.ctx=t,this.elgrid=n,this.w=t.w;var r=this.w;this.xaxisFontSize=r.config.xaxis.labels.style.fontSize,this.axisFontFamily=r.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=r.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===r.config.chart.type&&r.config.plotOptions.bar.horizontal,this.xAxisoffX="bottom"===r.config.xaxis.position?r.globals.gridHeight:0,this.drawnLabels=[],this.axesUtils=new In(t)}return l(e,[{key:"drawYaxis",value:function(e){var t=this.w,n=new Nn(this.ctx),r=t.config.yaxis[e].labels.style,i=r.fontSize,a=r.fontFamily,s=r.fontWeight,o=n.group({class:"apexcharts-yaxis",rel:e,transform:"translate(".concat(t.globals.translateYAxisX[e],", 0)")});if(this.axesUtils.isYAxisHidden(e))return o;var l=n.group({class:"apexcharts-yaxis-texts-g"});o.add(l);var c=t.globals.yAxisScale[e].result.length-1,u=t.globals.gridHeight/c,d=t.globals.yLabelFormatters[e],h=this.axesUtils.checkForReversedLabels(e,t.globals.yAxisScale[e].result.slice());if(t.config.yaxis[e].labels.show){var f=t.globals.translateY+t.config.yaxis[e].labels.offsetY;t.globals.isBarHorizontal?f=0:"heatmap"===t.config.chart.type&&(f-=u/2),f+=parseInt(i,10)/3;for(var p=c;p>=0;p--){var m=d(h[p],p,t),g=t.config.yaxis[e].labels.padding;t.config.yaxis[e].opposite&&0!==t.config.yaxis.length&&(g*=-1);var v=this.getTextAnchor(t.config.yaxis[e].labels.align,t.config.yaxis[e].opposite),b=this.axesUtils.getYAxisForeColor(r.colors,e),y=Array.isArray(b)?b[p]:b,x=k.listToArray(t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-label tspan"))).map((function(e){return e.textContent})),w=n.drawText({x:g,y:f,text:x.includes(m)&&!t.config.yaxis[e].labels.showDuplicates?"":m,textAnchor:v,fontSize:i,fontFamily:a,fontWeight:s,maxWidth:t.config.yaxis[e].labels.maxWidth,foreColor:y,isPlainText:!1,cssClass:"apexcharts-yaxis-label ".concat(r.cssClass)});l.add(w),this.addTooltip(w,m),0!==t.config.yaxis[e].labels.rotate&&this.rotateLabel(n,w,firstLabel,t.config.yaxis[e].labels.rotate),f+=u}}return this.addYAxisTitle(n,o,e),this.addAxisBorder(n,o,e,c,u),o}},{key:"getTextAnchor",value:function(e,t){return"left"===e?"start":"center"===e?"middle":"right"===e?"end":t?"start":"end"}},{key:"addTooltip",value:function(e,t){var n=document.createElementNS(this.w.globals.SVGNS,"title");n.textContent=Array.isArray(t)?t.join(" "):t,e.node.appendChild(n)}},{key:"rotateLabel",value:function(e,t,n,r){var i=e.rotateAroundCenter(n.node),a=e.rotateAroundCenter(t.node);t.node.setAttribute("transform","rotate(".concat(r," ").concat(i.x," ").concat(a.y,")"))}},{key:"addYAxisTitle",value:function(e,t,n){var r=this.w;if(void 0!==r.config.yaxis[n].title.text){var i=e.group({class:"apexcharts-yaxis-title"}),a=r.config.yaxis[n].opposite?r.globals.translateYAxisX[n]:0,s=e.drawText({x:a,y:r.globals.gridHeight/2+r.globals.translateY+r.config.yaxis[n].title.offsetY,text:r.config.yaxis[n].title.text,textAnchor:"end",foreColor:r.config.yaxis[n].title.style.color,fontSize:r.config.yaxis[n].title.style.fontSize,fontWeight:r.config.yaxis[n].title.style.fontWeight,fontFamily:r.config.yaxis[n].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text ".concat(r.config.yaxis[n].title.style.cssClass)});i.add(s),t.add(i)}}},{key:"addAxisBorder",value:function(e,t,n,r,i){var a=this.w,s=a.config.yaxis[n].axisBorder,o=31+s.offsetX;if(a.config.yaxis[n].opposite&&(o=-31-s.offsetX),s.show){var l=e.drawLine(o,a.globals.translateY+s.offsetY-2,o,a.globals.gridHeight+a.globals.translateY+s.offsetY+2,s.color,0,s.width);t.add(l)}a.config.yaxis[n].axisTicks.show&&this.axesUtils.drawYAxisTicks(o,r,s,a.config.yaxis[n].axisTicks,n,i,t)}},{key:"drawYaxisInversed",value:function(e){var t=this.w,n=new Nn(this.ctx),r=n.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),i=n.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(t.globals.translateXAxisX,", ").concat(t.globals.translateXAxisY,")")});r.add(i);var a=t.globals.yAxisScale[e].result.length-1,s=t.globals.gridWidth/a+.1,o=s+t.config.xaxis.labels.offsetX,l=t.globals.xLabelFormatter,c=this.axesUtils.checkForReversedLabels(e,t.globals.yAxisScale[e].result.slice()),u=t.globals.timescaleLabels;if(u.length>0&&(this.xaxisLabels=u.slice(),a=(c=u.slice()).length),t.config.xaxis.labels.show)for(var d=u.length?0:a;u.length?d=0;u.length?d++:d--){var h=l(c[d],d,t),f=t.globals.gridWidth+t.globals.padHorizontal-(o-s+t.config.xaxis.labels.offsetX);if(u.length){var p=this.axesUtils.getLabel(c,u,f,d,this.drawnLabels,this.xaxisFontSize);f=p.x,h=p.text,this.drawnLabels.push(p.text),0===d&&t.globals.skipFirstTimelinelabel&&(h=""),d===c.length-1&&t.globals.skipLastTimelinelabel&&(h="")}var m=n.drawText({x:f,y:this.xAxisoffX+t.config.xaxis.labels.offsetY+30-("top"===t.config.xaxis.position?t.globals.xAxisHeight+t.config.xaxis.axisTicks.height-2:0),text:h,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[e]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:t.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-xaxis-label ".concat(t.config.xaxis.labels.style.cssClass)});i.add(m),m.tspan(h),this.addTooltip(m,h),o+=s}return this.inversedYAxisTitleText(r),this.inversedYAxisBorder(r),r}},{key:"inversedYAxisBorder",value:function(e){var t=this.w,n=new Nn(this.ctx),r=t.config.xaxis.axisBorder;if(r.show){var i=0;"bar"===t.config.chart.type&&t.globals.isXNumeric&&(i-=15);var a=n.drawLine(t.globals.padHorizontal+i+r.offsetX,this.xAxisoffX,t.globals.gridWidth,this.xAxisoffX,r.color,0,r.height);this.elgrid&&this.elgrid.elGridBorders&&t.config.grid.show?this.elgrid.elGridBorders.add(a):e.add(a)}}},{key:"inversedYAxisTitleText",value:function(e){var t=this.w,n=new Nn(this.ctx);if(void 0!==t.config.xaxis.title.text){var r=n.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),i=n.drawText({x:t.globals.gridWidth/2+t.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(t.config.xaxis.title.style.fontSize)+t.config.xaxis.title.offsetY+20,text:t.config.xaxis.title.text,textAnchor:"middle",fontSize:t.config.xaxis.title.style.fontSize,fontFamily:t.config.xaxis.title.style.fontFamily,fontWeight:t.config.xaxis.title.style.fontWeight,foreColor:t.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text ".concat(t.config.xaxis.title.style.cssClass)});r.add(i),e.add(r)}}},{key:"yAxisTitleRotate",value:function(e,t){var n=this.w,r=new Nn(this.ctx),i=n.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-texts-g")),a=i?i.getBoundingClientRect():{width:0,height:0},s=n.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-title text")),o=s?s.getBoundingClientRect():{width:0,height:0};if(s){var l=this.xPaddingForYAxisTitle(e,a,o,t);s.setAttribute("x",l.xPos-(t?10:0));var c=r.rotateAroundCenter(s);s.setAttribute("transform","rotate(".concat(t?-1*n.config.yaxis[e].title.rotate:n.config.yaxis[e].title.rotate," ").concat(c.x," ").concat(c.y,")"))}}},{key:"xPaddingForYAxisTitle",value:function(e,t,n,r){var i=this.w,a=0,s=10;return void 0===i.config.yaxis[e].title.text||e<0?{xPos:a,padd:0}:(r?a=t.width+i.config.yaxis[e].title.offsetX+n.width/2+s/2:(a=-1*t.width+i.config.yaxis[e].title.offsetX+s/2+n.width/2,i.globals.isBarHorizontal&&(s=25,a=-1*t.width-i.config.yaxis[e].title.offsetX-s)),{xPos:a,padd:s})}},{key:"setYAxisXPosition",value:function(e,t){var n=this.w,r=0,i=0,a=18,s=1;n.config.yaxis.length>1&&(this.multipleYs=!0),n.config.yaxis.forEach((function(o,l){var c=n.globals.ignoreYAxisIndexes.includes(l)||!o.show||o.floating||0===e[l].width,u=e[l].width+t[l].width;o.opposite?n.globals.isBarHorizontal?(i=n.globals.gridWidth+n.globals.translateX-1,n.globals.translateYAxisX[l]=i-o.labels.offsetX):(i=n.globals.gridWidth+n.globals.translateX+s,c||(s+=u+20),n.globals.translateYAxisX[l]=i-o.labels.offsetX+20):(r=n.globals.translateX-a,c||(a+=u+20),n.globals.translateYAxisX[l]=r+o.labels.offsetX)}))}},{key:"setYAxisTextAlignments",value:function(){var e=this.w;k.listToArray(e.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach((function(t,n){var r=e.config.yaxis[n];if(r&&!r.floating&&void 0!==r.labels.align){var i=e.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(n,"'] .apexcharts-yaxis-texts-g")),a=k.listToArray(e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(n,"'] .apexcharts-yaxis-label"))),s=i.getBoundingClientRect();a.forEach((function(e){e.setAttribute("text-anchor",r.labels.align)})),"left"!==r.labels.align||r.opposite?"center"===r.labels.align?i.setAttribute("transform","translate(".concat(s.width/2*(r.opposite?1:-1),", 0)")):"right"===r.labels.align&&r.opposite&&i.setAttribute("transform","translate(".concat(s.width,", 0)")):i.setAttribute("transform","translate(-".concat(s.width,", 0)"))}}))}}]),e}(),ar=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.documentEvent=k.bind(this.documentEvent,this)}return l(e,[{key:"addEventListener",value:function(e,t){var n=this.w;n.globals.events.hasOwnProperty(e)?n.globals.events[e].push(t):n.globals.events[e]=[t]}},{key:"removeEventListener",value:function(e,t){var n=this.w;if(n.globals.events.hasOwnProperty(e)){var r=n.globals.events[e].indexOf(t);-1!==r&&n.globals.events[e].splice(r,1)}}},{key:"fireEvent",value:function(e,t){var n=this.w;if(n.globals.events.hasOwnProperty(e)){t&&t.length||(t=[]);for(var r=n.globals.events[e],i=r.length,a=0;a0&&(t=this.w.config.chart.locales.concat(window.Apex.chart.locales));var n=t.filter((function(t){return t.name===e}))[0];if(!n)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var r=k.extend(Fn,n);this.w.globals.locale=r.options}}]),e}(),or=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"drawAxis",value:function(e,t){var n,r,i=this,a=this.w.globals,s=this.w.config,o=new er(this.ctx,t),l=new ir(this.ctx,t);a.axisCharts&&"radar"!==e&&(a.isBarHorizontal?(r=l.drawYaxisInversed(0),n=o.drawXaxisInversed(0),a.dom.elGraphical.add(n),a.dom.elGraphical.add(r)):(n=o.drawXaxis(),a.dom.elGraphical.add(n),s.yaxis.map((function(e,t){if(-1===a.ignoreYAxisIndexes.indexOf(t)&&(r=l.drawYaxis(t),a.dom.Paper.add(r),"back"===i.w.config.grid.position)){var n=a.dom.Paper.children()[1];n.remove(),a.dom.Paper.add(n)}}))))}}]),e}(),lr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"drawXCrosshairs",value:function(){var e=this.w,t=new Nn(this.ctx),n=new En(this.ctx),r=e.config.xaxis.crosshairs.fill.gradient,i=e.config.xaxis.crosshairs.dropShadow,a=e.config.xaxis.crosshairs.fill.type,s=r.colorFrom,o=r.colorTo,l=r.opacityFrom,c=r.opacityTo,u=r.stops,d=i.enabled,h=i.left,f=i.top,p=i.blur,m=i.color,g=i.opacity,v=e.config.xaxis.crosshairs.fill.color;if(e.config.xaxis.crosshairs.show){"gradient"===a&&(v=t.drawGradient("vertical",s,o,l,c,null,u,null));var b=t.drawRect();1===e.config.xaxis.crosshairs.width&&(b=t.drawLine());var y=e.globals.gridHeight;(!k.isNumber(y)||y<0)&&(y=0);var x=e.config.xaxis.crosshairs.width;(!k.isNumber(x)||x<0)&&(x=0),b.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:y,width:x,height:y,fill:v,filter:"none","fill-opacity":e.config.xaxis.crosshairs.opacity,stroke:e.config.xaxis.crosshairs.stroke.color,"stroke-width":e.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":e.config.xaxis.crosshairs.stroke.dashArray}),d&&(b=n.dropShadow(b,{left:h,top:f,blur:p,color:m,opacity:g})),e.globals.dom.elGraphical.add(b)}}},{key:"drawYCrosshairs",value:function(){var e=this.w,t=new Nn(this.ctx),n=e.config.yaxis[0].crosshairs,r=e.globals.barPadForNumericAxis;if(e.config.yaxis[0].crosshairs.show){var i=t.drawLine(-r,0,e.globals.gridWidth+r,0,n.stroke.color,n.stroke.dashArray,n.stroke.width);i.attr({class:"apexcharts-ycrosshairs"}),e.globals.dom.elGraphical.add(i)}var a=t.drawLine(-r,0,e.globals.gridWidth+r,0,n.stroke.color,0,0);a.attr({class:"apexcharts-ycrosshairs-hidden"}),e.globals.dom.elGraphical.add(a)}}]),e}(),cr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"checkResponsiveConfig",value:function(e){var t=this,n=this.w,r=n.config;if(0!==r.responsive.length){var i=r.responsive.slice();i.sort((function(e,t){return e.breakpoint>t.breakpoint?1:t.breakpoint>e.breakpoint?-1:0})).reverse();var a=new Wn({}),s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i[0].breakpoint,s=window.innerWidth>0?window.innerWidth:screen.width;if(s>r){var o=k.clone(n.globals.initialConfig);o.series=k.clone(n.config.series);var l=Mn.extendArrayProps(a,o,n);e=k.extend(l,e),e=k.extend(n.config,e),t.overrideResponsiveOptions(e)}else for(var c=0;c0&&"function"==typeof e[0]?(this.isColorFn=!0,n.config.series.map((function(r,i){var a=e[i]||e[0];return"function"==typeof a?a({value:n.globals.axisCharts?n.globals.series[i][0]||0:n.globals.series[i],seriesIndex:i,dataPointIndex:i,w:t.w}):a}))):e:this.predefined()}},{key:"applySeriesColors",value:function(e,t){e.forEach((function(e,n){e&&(t[n]=e)}))}},{key:"getMonochromeColors",value:function(e,t,n){var r=e.color,i=e.shadeIntensity,a=e.shadeTo,s=this.isBarDistributed||this.isHeatmapDistributed?t[0].length*t.length:t.length,o=1/(s/i),l=0;return Array.from({length:s},(function(){var e="dark"===a?n.shadeColor(-1*l,r):n.shadeColor(l,r);return l+=o,e}))}},{key:"applyColorTypes",value:function(e,t){var n=this,r=this.w;e.forEach((function(e){r.globals[e].colors=void 0===r.config[e].colors?n.isColorFn?r.config.colors:t:r.config[e].colors.slice(),n.pushExtraColors(r.globals[e].colors)}))}},{key:"applyDataLabelsColors",value:function(e){var t=this.w;t.globals.dataLabels.style.colors=void 0===t.config.dataLabels.style.colors?e:t.config.dataLabels.style.colors.slice(),this.pushExtraColors(t.globals.dataLabels.style.colors,50)}},{key:"applyRadarPolygonsColors",value:function(){var e=this.w;e.globals.radarPolygons.fill.colors=void 0===e.config.plotOptions.radar.polygons.fill.colors?["dark"===e.config.theme.mode?"#424242":"none"]:e.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(e.globals.radarPolygons.fill.colors,20)}},{key:"applyMarkersColors",value:function(e){var t=this.w;t.globals.markers.colors=void 0===t.config.markers.colors?e:t.config.markers.colors.slice(),this.pushExtraColors(t.globals.markers.colors)}},{key:"pushExtraColors",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.w,i=t||r.globals.series.length;if(null===n&&(n=this.isBarDistributed||this.isHeatmapDistributed||"heatmap"===r.config.chart.type&&r.config.plotOptions.heatmap&&r.config.plotOptions.heatmap.colorScale.inverse),n&&r.globals.series.length&&(i=r.globals.series[r.globals.maxValsInArrayIndex].length*r.globals.series.length),e.lengthe.globals.svgWidth&&(this.dCtx.lgRect.width=e.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getDatalabelsRect",value:function(){var e=this,t=this.w,n=[];t.config.series.forEach((function(i,a){i.data.forEach((function(i,s){var o;o=t.globals.series[a][s],r=t.config.dataLabels.formatter(o,{ctx:e.dCtx.ctx,seriesIndex:a,dataPointIndex:s,w:t}),n.push(r)}))}));var r=k.getLargestStringFromArr(n),i=new Nn(this.dCtx.ctx),a=t.config.dataLabels.style,s=i.getTextRects(r,parseInt(a.fontSize),a.fontFamily);return{width:1.05*s.width,height:s.height}}},{key:"getLargestStringFromMultiArr",value:function(e,t){var n=e;if(this.w.globals.isMultiLineX){var r=t.map((function(e,t){return Array.isArray(e)?e.length:1})),i=Math.max.apply(Math,y(r));n=t[r.indexOf(i)]}return n}}]),e}(),fr=function(){function e(t){s(this,e),this.w=t.w,this.dCtx=t}return l(e,[{key:"getxAxisLabelsCoords",value:function(){var e,t=this.w,n=t.globals.labels.slice();if(t.config.xaxis.convertedCatToNumeric&&0===n.length&&(n=t.globals.categoryLabels),t.globals.timescaleLabels.length>0){var r=this.getxAxisTimeScaleLabelsCoords();e={width:r.width,height:r.height},t.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==t.config.legend.position&&"right"!==t.config.legend.position||t.config.legend.floating?0:this.dCtx.lgRect.width;var i=t.globals.xLabelFormatter,a=k.getLargestStringFromArr(n),s=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,n);t.globals.isBarHorizontal&&(s=a=t.globals.yAxisScale[0].result.reduce((function(e,t){return e.length>t.length?e:t}),0));var o=new Pn(this.dCtx.ctx),l=a;a=o.xLabelFormat(i,a,l,{i:void 0,dateFormatter:new Rn(this.dCtx.ctx).formatDate,w:t}),s=o.xLabelFormat(i,s,l,{i:void 0,dateFormatter:new Rn(this.dCtx.ctx).formatDate,w:t}),(t.config.xaxis.convertedCatToNumeric&&void 0===a||""===String(a).trim())&&(s=a="1");var c=new Nn(this.dCtx.ctx),u=c.getTextRects(a,t.config.xaxis.labels.style.fontSize),d=u;if(a!==s&&(d=c.getTextRects(s,t.config.xaxis.labels.style.fontSize)),(e={width:u.width>=d.width?u.width:d.width,height:u.height>=d.height?u.height:d.height}).width*n.length>t.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==t.config.xaxis.labels.rotate||t.config.xaxis.labels.rotateAlways){if(!t.globals.isBarHorizontal){t.globals.rotateXLabels=!0;var h=function(e){return c.getTextRects(e,t.config.xaxis.labels.style.fontSize,t.config.xaxis.labels.style.fontFamily,"rotate(".concat(t.config.xaxis.labels.rotate," 0 0)"),!1)};u=h(a),a!==s&&(d=h(s)),e.height=(u.height>d.height?u.height:d.height)/1.5,e.width=u.width>d.width?u.width:d.width}}else t.globals.rotateXLabels=!1}return t.config.xaxis.labels.show||(e={width:0,height:0}),{width:e.width,height:e.height}}},{key:"getxAxisGroupLabelsCoords",value:function(){var e,t=this.w;if(!t.globals.hasXaxisGroups)return{width:0,height:0};var n,r=(null===(e=t.config.xaxis.group.style)||void 0===e?void 0:e.fontSize)||t.config.xaxis.labels.style.fontSize,i=t.globals.groups.map((function(e){return e.title})),a=k.getLargestStringFromArr(i),s=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,i),o=new Nn(this.dCtx.ctx),l=o.getTextRects(a,r),c=l;return a!==s&&(c=o.getTextRects(s,r)),n={width:l.width>=c.width?l.width:c.width,height:l.height>=c.height?l.height:c.height},t.config.xaxis.labels.show||(n={width:0,height:0}),{width:n.width,height:n.height}}},{key:"getxAxisTitleCoords",value:function(){var e=this.w,t=0,n=0;if(void 0!==e.config.xaxis.title.text){var r=new Nn(this.dCtx.ctx).getTextRects(e.config.xaxis.title.text,e.config.xaxis.title.style.fontSize);t=r.width,n=r.height}return{width:t,height:n}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var e,t=this.w;this.dCtx.timescaleLabels=t.globals.timescaleLabels.slice();var n=this.dCtx.timescaleLabels.map((function(e){return e.value})),r=n.reduce((function(e,t){return void 0===e?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):e.length>t.length?e:t}),0);return 1.05*(e=new Nn(this.dCtx.ctx).getTextRects(r,t.config.xaxis.labels.style.fontSize)).width*n.length>t.globals.gridWidth&&0!==t.config.xaxis.labels.rotate&&(t.globals.overlappingXLabels=!0),e}},{key:"additionalPaddingXLabels",value:function(e){var t=this,n=this.w,r=n.globals,i=n.config,a=i.xaxis.type,s=e.width;r.skipLastTimelinelabel=!1,r.skipFirstTimelinelabel=!1;var o=n.config.yaxis[0].opposite&&n.globals.isBarHorizontal,l=function(e,o){i.yaxis.length>1&&function(e){return-1!==r.collapsedSeriesIndices.indexOf(e)}(o)||function(e){if(t.dCtx.timescaleLabels&&t.dCtx.timescaleLabels.length){var o=t.dCtx.timescaleLabels[0],l=t.dCtx.timescaleLabels[t.dCtx.timescaleLabels.length-1].position+s/1.75-t.dCtx.yAxisWidthRight,c=o.position-s/1.75+t.dCtx.yAxisWidthLeft,u="right"===n.config.legend.position&&t.dCtx.lgRect.width>0?t.dCtx.lgRect.width:0;l>r.svgWidth-r.translateX-u&&(r.skipLastTimelinelabel=!0),c<-(e.show&&!e.floating||"bar"!==i.chart.type&&"candlestick"!==i.chart.type&&"rangeBar"!==i.chart.type&&"boxPlot"!==i.chart.type?10:s/1.75)&&(r.skipFirstTimelinelabel=!0)}else"datetime"===a?t.dCtx.gridPad.right(null===(r=String(u(t,o)))||void 0===r?void 0:r.length)?e:t}),d),f=h=u(h,o);if(void 0!==h&&0!==h.length||(h=l.niceMax),t.globals.isBarHorizontal){r=0;var p=t.globals.labels.slice();h=k.getLargestStringFromArr(p),h=u(h,{seriesIndex:s,dataPointIndex:-1,w:t}),f=e.dCtx.dimHelpers.getLargestStringFromMultiArr(h,p)}var m=new Nn(e.dCtx.ctx),g="rotate(".concat(a.labels.rotate," 0 0)"),v=m.getTextRects(h,a.labels.style.fontSize,a.labels.style.fontFamily,g,!1),b=v;h!==f&&(b=m.getTextRects(f,a.labels.style.fontSize,a.labels.style.fontFamily,g,!1)),n.push({width:(c>b.width||c>v.width?c:b.width>v.width?b.width:v.width)+r,height:b.height>v.height?b.height:v.height})}else n.push({width:0,height:0})})),n}},{key:"getyAxisTitleCoords",value:function(){var e=this,t=this.w,n=[];return t.config.yaxis.map((function(t,r){if(t.show&&void 0!==t.title.text){var i=new Nn(e.dCtx.ctx),a="rotate(".concat(t.title.rotate," 0 0)"),s=i.getTextRects(t.title.text,t.title.style.fontSize,t.title.style.fontFamily,a,!1);n.push({width:s.width,height:s.height})}else n.push({width:0,height:0})})),n}},{key:"getTotalYAxisWidth",value:function(){var e=this.w,t=0,n=0,r=0,i=e.globals.yAxisScale.length>1?10:0,a=new In(this.dCtx.ctx),s=function(s,o){var l=e.config.yaxis[o].floating,c=0;s.width>0&&!l?(c=s.width+i,function(t){return e.globals.ignoreYAxisIndexes.indexOf(t)>-1}(o)&&(c=c-s.width-i)):c=l||a.isYAxisHidden(o)?0:5,e.config.yaxis[o].opposite?r+=c:n+=c,t+=c};return e.globals.yLabelsCoords.map((function(e,t){s(e,t)})),e.globals.yTitleCoords.map((function(e,t){s(e,t)})),e.globals.isBarHorizontal&&!e.config.yaxis[0].floating&&(t=e.globals.yLabelsCoords[0].width+e.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=n,this.dCtx.yAxisWidthRight=r,t}}]),e}(),mr=function(){function e(t){s(this,e),this.w=t.w,this.dCtx=t}return l(e,[{key:"gridPadForColumnsInNumericAxis",value:function(e){var t=this.w,n=t.config,r=t.globals;if(r.noData||r.collapsedSeries.length+r.ancillaryCollapsedSeries.length===n.series.length)return 0;var i=function(e){return["bar","rangeBar","candlestick","boxPlot"].includes(e)},a=n.chart.type,s=0,o=i(a)?n.series.length:1;r.comboBarCount>0&&(o=r.comboBarCount),r.collapsedSeries.forEach((function(e){i(e.type)&&(o-=1)})),n.chart.stacked&&(o=1);var l=i(a)||r.comboBarCount>0,c=Math.abs(r.initialMaxX-r.initialMinX);if(l&&r.isXNumeric&&!r.isBarHorizontal&&o>0&&0!==c){c<=3&&(c=r.dataPoints);var u=c/e,d=r.minXDiff&&r.minXDiff/u>0?r.minXDiff/u:0;d>e/2&&(d/=2),(s=d*parseInt(n.plotOptions.bar.columnWidth,10)/100)<1&&(s=1),r.barPadForNumericAxis=s}return s}},{key:"gridPadFortitleSubtitle",value:function(){var e=this,t=this.w,n=t.globals,r=this.dCtx.isSparkline||!n.axisCharts?0:10;["title","subtitle"].forEach((function(i){void 0!==t.config[i].text?r+=t.config[i].margin:r+=e.dCtx.isSparkline||!n.axisCharts?0:5})),!t.config.legend.show||"bottom"!==t.config.legend.position||t.config.legend.floating||n.axisCharts||(r+=10);var i=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),a=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");n.gridHeight-=i.height+a.height+r,n.translateY+=i.height+a.height+r}},{key:"setGridXPosForDualYAxis",value:function(e,t){var n=this.w,r=new In(this.dCtx.ctx);n.config.yaxis.forEach((function(i,a){-1!==n.globals.ignoreYAxisIndexes.indexOf(a)||i.floating||r.isYAxisHidden(a)||(i.opposite&&(n.globals.translateX-=t[a].width+e[a].width+parseInt(i.labels.style.fontSize,10)/1.2+12),n.globals.translateX<2&&(n.globals.translateX=2))}))}}]),e}(),gr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new hr(this),this.dimYAxis=new pr(this),this.dimXAxis=new fr(this),this.dimGrid=new mr(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}return l(e,[{key:"plotCoords",value:function(){var e=this,t=this.w,n=t.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};var r=Array.isArray(t.config.stroke.width)?Math.max.apply(Math,y(t.config.stroke.width)):t.config.stroke.width;this.isSparkline&&((t.config.markers.discrete.length>0||t.config.markers.size>0)&&Object.entries(this.gridPad).forEach((function(t){var n=b(t,2),r=n[0],i=n[1];e.gridPad[r]=Math.max(i,e.w.globals.markers.largestSize/1.5)})),this.gridPad.top=Math.max(r/2,this.gridPad.top),this.gridPad.bottom=Math.max(r/2,this.gridPad.bottom)),n.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),n.gridHeight=n.gridHeight-this.gridPad.top-this.gridPad.bottom,n.gridWidth=n.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var i=this.dimGrid.gridPadForColumnsInNumericAxis(n.gridWidth);n.gridWidth=n.gridWidth-2*i,n.translateX=n.translateX+this.gridPad.left+this.xPadLeft+(i>0?i:0),n.translateY=n.translateY+this.gridPad.top}},{key:"setDimensionsForAxisCharts",value:function(){var e=this,t=this.w,n=t.globals,r=this.dimYAxis.getyAxisLabelsCoords(),i=this.dimYAxis.getyAxisTitleCoords();n.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.globals.yLabelsCoords=[],t.globals.yTitleCoords=[],t.config.yaxis.map((function(e,n){t.globals.yLabelsCoords.push({width:r[n].width,index:n}),t.globals.yTitleCoords.push({width:i[n].width,index:n})})),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var a=this.dimXAxis.getxAxisLabelsCoords(),s=this.dimXAxis.getxAxisGroupLabelsCoords(),o=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(a,o,s),n.translateXAxisY=t.globals.rotateXLabels?this.xAxisHeight/8:-4,n.translateXAxisX=t.globals.rotateXLabels&&t.globals.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(n.rotateXLabels=!1,n.translateXAxisY=parseInt(t.config.xaxis.labels.style.fontSize,10)/1.5*-1),n.translateXAxisY=n.translateXAxisY+t.config.xaxis.labels.offsetY,n.translateXAxisX=n.translateXAxisX+t.config.xaxis.labels.offsetX;var l=this.yAxisWidth,c=this.xAxisHeight;n.xAxisLabelsHeight=this.xAxisHeight-o.height,n.xAxisGroupLabelsHeight=n.xAxisLabelsHeight-a.height,n.xAxisLabelsWidth=this.xAxisWidth,n.xAxisHeight=this.xAxisHeight;var u=10;("radar"===t.config.chart.type||this.isSparkline)&&(l=0,c=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||"treemap"===t.config.chart.type)&&(l=0,c=0,u=0),this.isSparkline||"treemap"===t.config.chart.type||this.dimXAxis.additionalPaddingXLabels(a);var d=function(){n.translateX=l+e.datalabelsCoords.width,n.gridHeight=n.svgHeight-e.lgRect.height-c-(e.isSparkline||"treemap"===t.config.chart.type?0:t.globals.rotateXLabels?10:15),n.gridWidth=n.svgWidth-l-2*e.datalabelsCoords.width};switch("top"===t.config.xaxis.position&&(u=n.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":n.translateY=u,d();break;case"top":n.translateY=this.lgRect.height+u,d();break;case"left":n.translateY=u,n.translateX=this.lgRect.width+l+this.datalabelsCoords.width,n.gridHeight=n.svgHeight-c-12,n.gridWidth=n.svgWidth-this.lgRect.width-l-2*this.datalabelsCoords.width;break;case"right":n.translateY=u,n.translateX=l+this.datalabelsCoords.width,n.gridHeight=n.svgHeight-c-12,n.gridWidth=n.svgWidth-this.lgRect.width-l-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(i,r),new ir(this.ctx).setYAxisXPosition(r,i)}},{key:"setDimensionsForNonAxisCharts",value:function(){var e=this.w,t=e.globals,n=e.config,r=0;e.config.legend.show&&!e.config.legend.floating&&(r=20);var i="pie"===n.chart.type||"polarArea"===n.chart.type||"donut"===n.chart.type?"pie":"radialBar",a=n.plotOptions[i].offsetY,s=n.plotOptions[i].offsetX;if(!n.legend.show||n.legend.floating){t.gridHeight=t.svgHeight;var o=t.dom.elWrap.getBoundingClientRect().width;return t.gridWidth=Math.min(o,t.gridHeight),t.translateY=a,void(t.translateX=s+(t.svgWidth-t.gridWidth)/2)}switch(n.legend.position){case"bottom":t.gridHeight=t.svgHeight-this.lgRect.height,t.gridWidth=t.svgWidth,t.translateY=a-10,t.translateX=s+(t.svgWidth-t.gridWidth)/2;break;case"top":t.gridHeight=t.svgHeight-this.lgRect.height,t.gridWidth=t.svgWidth,t.translateY=this.lgRect.height+a+10,t.translateX=s+(t.svgWidth-t.gridWidth)/2;break;case"left":t.gridWidth=t.svgWidth-this.lgRect.width-r,t.gridHeight="auto"!==n.chart.height?t.svgHeight:t.gridWidth,t.translateY=a,t.translateX=s+this.lgRect.width+r;break;case"right":t.gridWidth=t.svgWidth-this.lgRect.width-r-5,t.gridHeight="auto"!==n.chart.height?t.svgHeight:t.gridWidth,t.translateY=a,t.translateX=s+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(e,t,n){var r=this.w,i=r.globals.hasXaxisGroups?2:1,a=n.height+e.height+t.height,s=r.globals.isMultiLineX?1.2:r.globals.LINE_HEIGHT_RATIO,o=r.globals.rotateXLabels?22:10,l=r.globals.rotateXLabels&&"bottom"===r.config.legend.position?10:0;this.xAxisHeight=a*s+i*o+l,this.xAxisWidth=e.width,this.xAxisHeight-t.height>r.config.xaxis.labels.maxHeight&&(this.xAxisHeight=r.config.xaxis.labels.maxHeight),r.config.xaxis.labels.minHeight&&this.xAxisHeightu&&(this.yAxisWidth=u)}}]),e}(),vr=function(){function e(t){s(this,e),this.w=t.w,this.lgCtx=t}return l(e,[{key:"getLegendStyles",value:function(){var e,t,n,r=document.createElement("style");r.setAttribute("type","text/css");var i=(null===(e=this.lgCtx.ctx)||void 0===e||null===(t=e.opts)||void 0===t||null===(n=t.chart)||void 0===n?void 0:n.nonce)||this.w.config.chart.nonce;i&&r.setAttribute("nonce",i);var a=document.createTextNode("\n .apexcharts-flip-y {\n transform: scaleY(-1) translateY(-100%);\n transform-origin: top;\n transform-box: fill-box;\n }\n .apexcharts-flip-x {\n transform: scaleX(-1);\n transform-origin: center;\n transform-box: fill-box;\n }\n .apexcharts-legend {\n display: flex;\n overflow: auto;\n padding: 0 10px;\n }\n .apexcharts-legend.apexcharts-legend-group-horizontal {\n flex-direction: column;\n }\n .apexcharts-legend-group {\n display: flex;\n }\n .apexcharts-legend-group-vertical {\n flex-direction: column-reverse;\n }\n .apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n flex-wrap: wrap\n }\n .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n flex-direction: column;\n bottom: 0;\n }\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n justify-content: flex-start;\n align-items: flex-start;\n }\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: center;\n align-items: center;\n }\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n justify-content: flex-end;\n align-items: flex-end;\n }\n .apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n display: flex;\n align-items: center;\n }\n .apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n }\n .apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n }\n .apexcharts-legend-marker {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-right: 1px;\n }\n\n .apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n }\n .apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n }\n .apexcharts-inactive-legend {\n opacity: 0.45;\n }\n\n ");return r.appendChild(a),r}},{key:"getLegendDimensions",value:function(){var e=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(),t=e.width;return{clwh:e.height,clww:t}}},{key:"appendToForeignObject",value:function(){this.w.globals.dom.elLegendForeign.appendChild(this.getLegendStyles())}},{key:"toggleDataSeries",value:function(e,t){var n=this,r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;var i=null,a=null;r.globals.risingSeries=[],r.globals.axisCharts?(i=r.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(e,"']")),a=parseInt(i.getAttribute("data:realIndex"),10)):(i=r.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(e+1,"']")),a=parseInt(i.getAttribute("rel"),10)-1),t?[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach((function(e){n.riseCollapsedSeries(e.cs,e.csi,a)})):this.hideSeries({seriesEl:i,realIndex:a})}else{var s=r.globals.dom.Paper.findOne(" .apexcharts-series[rel='".concat(e+1,"'] path")),o=r.config.chart.type;if("pie"===o||"polarArea"===o||"donut"===o){var l=r.config.plotOptions.pie.donut.labels;new Nn(this.lgCtx.ctx).pathMouseDown(s,null),this.lgCtx.ctx.pie.printDataLabelsInner(s.node,l)}s.fire("click")}}},{key:"getSeriesAfterCollapsing",value:function(e){var t=e.realIndex,n=this.w,r=n.globals,i=k.clone(n.config.series);if(r.axisCharts){var a=n.config.yaxis[r.seriesYAxisReverseMap[t]],s={index:t,data:i[t].data.slice(),type:i[t].type||n.config.chart.type};if(a&&a.show&&a.showAlways)r.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(r.ancillaryCollapsedSeries.push(s),r.ancillaryCollapsedSeriesIndices.push(t));else if(r.collapsedSeriesIndices.indexOf(t)<0){r.collapsedSeries.push(s),r.collapsedSeriesIndices.push(t);var o=r.risingSeries.indexOf(t);r.risingSeries.splice(o,1)}}else r.collapsedSeries.push({index:t,data:i[t]}),r.collapsedSeriesIndices.push(t);return r.allSeriesCollapsed=r.collapsedSeries.length+r.ancillaryCollapsedSeries.length===n.config.series.length,this._getSeriesBasedOnCollapsedState(i)}},{key:"hideSeries",value:function(e){for(var t=e.seriesEl,n=e.realIndex,r=this.w,i=this.getSeriesAfterCollapsing({realIndex:n}),a=t.childNodes,s=0;s0){for(var a=0;a1;if(this.legendHelpers.appendToForeignObject(),(r||!t.axisCharts)&&n.legend.show){for(;t.dom.elLegendWrap.firstChild;)t.dom.elLegendWrap.removeChild(t.dom.elLegendWrap.firstChild);this.drawLegends(),"bottom"===n.legend.position||"top"===n.legend.position?this.legendAlignHorizontal():"right"!==n.legend.position&&"left"!==n.legend.position||this.legendAlignVertical()}}},{key:"createLegendMarker",value:function(e){var t=e.i,n=e.fillcolor,r=this.w,i=document.createElement("span");i.classList.add("apexcharts-legend-marker");var a=r.config.legend.markers.shape||r.config.markers.shape,s=a;Array.isArray(a)&&(s=a[t]);var o=Array.isArray(r.config.legend.markers.size)?parseFloat(r.config.legend.markers.size[t]):parseFloat(r.config.legend.markers.size),l=Array.isArray(r.config.legend.markers.offsetX)?parseFloat(r.config.legend.markers.offsetX[t]):parseFloat(r.config.legend.markers.offsetX),c=Array.isArray(r.config.legend.markers.offsetY)?parseFloat(r.config.legend.markers.offsetY[t]):parseFloat(r.config.legend.markers.offsetY),u=Array.isArray(r.config.legend.markers.strokeWidth)?parseFloat(r.config.legend.markers.strokeWidth[t]):parseFloat(r.config.legend.markers.strokeWidth),d=i.style;if(d.height=2*(o+u)+"px",d.width=2*(o+u)+"px",d.left=l+"px",d.top=c+"px",r.config.legend.markers.customHTML)d.background="transparent",d.color=n[t],Array.isArray(r.config.legend.markers.customHTML)?r.config.legend.markers.customHTML[t]&&(i.innerHTML=r.config.legend.markers.customHTML[t]()):i.innerHTML=r.config.legend.markers.customHTML();else{var h=new Gn(this.ctx).getMarkerConfig({cssClass:"apexcharts-legend-marker apexcharts-marker apexcharts-marker-".concat(s),seriesIndex:t,strokeWidth:u,size:o}),f=window.SVG().addTo(i).size("100%","100%"),p=new Nn(this.ctx).drawMarker(0,0,g(g({},h),{},{pointFillColor:Array.isArray(n)?n[t]:h.pointFillColor,shape:s}));r.globals.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach((function(e){e.node.classList.contains("apexcharts-marker-triangle")?e.node.style.transform="translate(50%, 45%)":e.node.style.transform="translate(50%, 50%)"})),f.add(p)}return i}},{key:"drawLegends",value:function(){var e=this,t=this,n=this.w,r=n.config.legend.fontFamily,i=n.globals.seriesNames,a=n.config.legend.markers.fillColors?n.config.legend.markers.fillColors.slice():n.globals.colors.slice();if("heatmap"===n.config.chart.type){var s=n.config.plotOptions.heatmap.colorScale.ranges;i=s.map((function(e){return e.name?e.name:e.from+" - "+e.to})),a=s.map((function(e){return e.color}))}else this.isBarsDistributed&&(i=n.globals.labels.slice());n.config.legend.customLegendItems.length&&(i=n.config.legend.customLegendItems);var o=n.globals.legendFormatter,l=n.config.legend.inverseOrder,c=[];n.globals.seriesGroups.length>1&&n.config.legend.clusterGroupedSeries&&n.globals.seriesGroups.forEach((function(e,t){c[t]=document.createElement("div"),c[t].classList.add("apexcharts-legend-group","apexcharts-legend-group-".concat(t)),"horizontal"===n.config.legend.clusterGroupedSeriesOrientation?n.globals.dom.elLegendWrap.classList.add("apexcharts-legend-group-horizontal"):c[t].classList.add("apexcharts-legend-group-vertical")}));for(var u=function(t){var s,l=o(i[t],{seriesIndex:t,w:n}),u=!1,d=!1;if(n.globals.collapsedSeries.length>0)for(var h=0;h0)for(var f=0;f=0:d<=i.length-1;l?d--:d++)u(d);n.globals.dom.elWrap.addEventListener("click",t.onLegendClick,!0),n.config.legend.onItemHover.highlightDataSeries&&0===n.config.legend.customLegendItems.length&&(n.globals.dom.elWrap.addEventListener("mousemove",t.onLegendHovered,!0),n.globals.dom.elWrap.addEventListener("mouseout",t.onLegendHovered,!0))}},{key:"setLegendWrapXY",value:function(e,t){var n=this.w,r=n.globals.dom.elLegendWrap,i=r.clientHeight,a=0,s=0;if("bottom"===n.config.legend.position)s=n.globals.svgHeight-Math.min(i,n.globals.svgHeight/2)-5;else if("top"===n.config.legend.position){var o=new gr(this.ctx),l=o.dimHelpers.getTitleSubtitleCoords("title").height,c=o.dimHelpers.getTitleSubtitleCoords("subtitle").height;s=(l>0?l-10:0)+(c>0?c-10:0)}r.style.position="absolute",a=a+e+n.config.legend.offsetX,s=s+t+n.config.legend.offsetY,r.style.left=a+"px",r.style.top=s+"px","right"===n.config.legend.position&&(r.style.left="auto",r.style.right=25+n.config.legend.offsetX+"px"),["width","height"].forEach((function(e){r.style[e]&&(r.style[e]=parseInt(n.config.legend[e],10)+"px")}))}},{key:"legendAlignHorizontal",value:function(){var e=this.w;e.globals.dom.elLegendWrap.style.right=0;var t=new gr(this.ctx),n=t.dimHelpers.getTitleSubtitleCoords("title"),r=t.dimHelpers.getTitleSubtitleCoords("subtitle"),i=0;"top"===e.config.legend.position&&(i=n.height+r.height+e.config.title.margin+e.config.subtitle.margin-10),this.setLegendWrapXY(20,i)}},{key:"legendAlignVertical",value:function(){var e=this.w,t=this.legendHelpers.getLegendDimensions(),n=0;"left"===e.config.legend.position&&(n=20),"right"===e.config.legend.position&&(n=e.globals.svgWidth-t.clww-10),this.setLegendWrapXY(n,20)}},{key:"onLegendHovered",value:function(e){var t=this.w,n=e.target.classList.contains("apexcharts-legend-series")||e.target.classList.contains("apexcharts-legend-text")||e.target.classList.contains("apexcharts-legend-marker");if("heatmap"===t.config.chart.type||this.isBarsDistributed){if(n){var r=parseInt(e.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,r,this.w]),new Zn(this.ctx).highlightRangeInSeries(e,e.target)}}else!e.target.classList.contains("apexcharts-inactive-legend")&&n&&new Zn(this.ctx).toggleSeriesOnHover(e,e.target)}},{key:"onLegendClick",value:function(e){var t=this.w;if(!t.config.legend.customLegendItems.length&&(e.target.classList.contains("apexcharts-legend-series")||e.target.classList.contains("apexcharts-legend-text")||e.target.classList.contains("apexcharts-legend-marker"))){var n=parseInt(e.target.getAttribute("rel"),10)-1,r="true"===e.target.getAttribute("data:collapsed"),i=this.w.config.chart.events.legendClick;"function"==typeof i&&i(this.ctx,n,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,n,this.w]);var a=this.w.config.legend.markers.onClick;"function"==typeof a&&e.target.classList.contains("apexcharts-legend-marker")&&(a(this.ctx,n,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,n,this.w])),"treemap"!==t.config.chart.type&&"heatmap"!==t.config.chart.type&&!this.isBarsDistributed&&t.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(n,r)}}}]),e}(),yr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w;var n=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=n.globals.minX,this.maxX=n.globals.maxX}return l(e,[{key:"createToolbar",value:function(){var e=this,t=this.w,n=function(){return document.createElement("div")},r=n();if(r.setAttribute("class","apexcharts-toolbar"),r.style.top=t.config.chart.toolbar.offsetY+"px",r.style.right=3-t.config.chart.toolbar.offsetX+"px",t.globals.dom.elWrap.appendChild(r),this.elZoom=n(),this.elZoomIn=n(),this.elZoomOut=n(),this.elPan=n(),this.elSelection=n(),this.elZoomReset=n(),this.elMenuIcon=n(),this.elMenu=n(),this.elCustomIcons=[],this.t=t.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var i=0;i\n \n \n\n'),s("zoomOut",this.elZoomOut,'\n \n \n\n');var o=function(n){e.t[n]&&t.config.chart[n].enabled&&a.push({el:"zoom"===n?e.elZoom:e.elSelection,icon:"string"==typeof e.t[n]?e.t[n]:"zoom"===n?'\n \n \n \n':'\n \n \n',title:e.localeValues["zoom"===n?"selectionZoom":"selection"],class:t.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-".concat(n,"-icon")})};o("zoom"),o("selection"),this.t.pan&&t.config.chart.zoom.enabled&&a.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'\n \n \n \n \n \n \n \n',title:this.localeValues.pan,class:t.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-pan-icon"}),s("reset",this.elZoomReset,'\n \n \n'),this.t.download&&a.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var l=0;lthis.wheelDelay&&(this.executeMouseWheelZoom(e),n.globals.lastWheelExecution=r),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((function(){r-n.globals.lastWheelExecution>t.wheelDelay&&(t.executeMouseWheelZoom(e),n.globals.lastWheelExecution=r)}),this.debounceDelay)}},{key:"executeMouseWheelZoom",value:function(e){var t,n=this.w;this.minX=n.globals.isRangeBar?n.globals.minY:n.globals.minX,this.maxX=n.globals.isRangeBar?n.globals.maxY:n.globals.maxX;var r=null===(t=this.gridRect)||void 0===t?void 0:t.getBoundingClientRect();if(r){var i,a,s,o=(e.clientX-r.left)/r.width,l=this.minX,c=this.maxX,u=c-l;if(e.deltaY<0){var d=l+o*u;a=d-(i=.5*u)/2,s=d+i/2}else a=l-(i=1.5*u)/2,s=c+i/2;if(!n.globals.isRangeBar){a=Math.max(a,n.globals.initialMinX),s=Math.min(s,n.globals.initialMaxX);var h=.01*(n.globals.initialMaxX-n.globals.initialMinX);if(s-a0&&n.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:function(){},updateRot:function(){},createHandle:function(e,t,n,r,i){return"l"===i||"r"===i?e.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):e.circle(0)},updateHandle:function(e,t){return e.center(t[0],t[1])}}).resize().on("resize",(function(){var n=t.globals.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;e.handleMouseUp({zoomtype:n,isResized:!0})})))}}},{key:"preselectedSelection",value:function(){var e=this.w,t=this.xyRatios;if(!e.globals.zoomEnabled)if(void 0!==e.globals.selection&&null!==e.globals.selection)this.drawSelectionRect(g(g({},e.globals.selection),{},{translateX:e.globals.translateX,translateY:e.globals.translateY}));else if(void 0!==e.config.chart.selection.xaxis.min&&void 0!==e.config.chart.selection.xaxis.max){var n=(e.config.chart.selection.xaxis.min-e.globals.minX)/t.xRatio,r=e.globals.gridWidth-(e.globals.maxX-e.config.chart.selection.xaxis.max)/t.xRatio-n;e.globals.isRangeBar&&(n=(e.config.chart.selection.xaxis.min-e.globals.yAxisScale[0].niceMin)/t.invertedYRatio,r=(e.config.chart.selection.xaxis.max-e.config.chart.selection.xaxis.min)/t.invertedYRatio);var i={x:n,y:0,width:r,height:e.globals.gridHeight,translateX:e.globals.translateX,translateY:e.globals.translateY,selectionEnabled:!0};this.drawSelectionRect(i),this.makeSelectionRectDraggable(),"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,{xaxis:{min:e.config.chart.selection.xaxis.min,max:e.config.chart.selection.xaxis.max},yaxis:{}})}}},{key:"drawSelectionRect",value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.translateX,s=void 0===a?0:a,o=e.translateY,l=void 0===o?0:o,c=this.w,u=this.zoomRect,d=this.selectionRect;if(this.dragged||null!==c.globals.selection){var h={transform:"translate("+s+", "+l+")"};c.globals.zoomEnabled&&this.dragged&&(r<0&&(r=1),u.attr({x:t,y:n,width:r,height:i,fill:c.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":c.config.chart.zoom.zoomedArea.fill.opacity,stroke:c.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":c.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":c.config.chart.zoom.zoomedArea.stroke.opacity}),Nn.setAttrs(u.node,h)),c.globals.selectionEnabled&&(d.attr({x:t,y:n,width:r>0?r:0,height:i>0?i:0,fill:c.config.chart.selection.fill.color,"fill-opacity":c.config.chart.selection.fill.opacity,stroke:c.config.chart.selection.stroke.color,"stroke-width":c.config.chart.selection.stroke.width,"stroke-dasharray":c.config.chart.selection.stroke.dashArray,"stroke-opacity":c.config.chart.selection.stroke.opacity}),Nn.setAttrs(d.node,h))}}},{key:"hideSelectionRect",value:function(e){e&&e.attr({x:0,y:0,width:0,height:0})}},{key:"selectionDrawing",value:function(e){var t=e.context,n=e.zoomtype,r=this.w,i=t,a=this.gridRect.getBoundingClientRect(),s=i.startX-1,o=i.startY,l=!1,c=!1,u=i.clientX-a.left-r.globals.barPadForNumericAxis,d=i.clientY-a.top,h=u-s,f=d-o,p={translateX:r.globals.translateX,translateY:r.globals.translateY};return Math.abs(h+s)>r.globals.gridWidth?h=r.globals.gridWidth-s:u<0&&(h=s),s>u&&(l=!0,h=Math.abs(h)),o>d&&(c=!0,f=Math.abs(f)),p=g(g({},p="x"===n?{x:l?s-h:s,y:0,width:h,height:r.globals.gridHeight}:"y"===n?{x:0,y:c?o-f:o,width:r.globals.gridWidth,height:f}:{x:l?s-h:s,y:c?o-f:o,width:h,height:f}),{},{translateX:r.globals.translateX,translateY:r.globals.translateY}),i.drawSelectionRect(p),i.selectionDragging("resizing"),p}},{key:"selectionDragging",value:function(e,t){var n=this,r=this.w;if(t){t.preventDefault();var i=t.detail,a=i.handler,s=i.box,o=s.x,l=s.y;othis.constraints.x2&&(o=this.constraints.x2-s.w),s.y2>this.constraints.y2&&(l=this.constraints.y2-s.h),a.move(o,l);var c=this.xyRatios,u=this.selectionRect,d=0;"resizing"===e&&(d=30);var h=function(e){return parseFloat(u.node.getAttribute(e))},f={x:h("x"),y:h("y"),width:h("width"),height:h("height")};r.globals.selection=f,"function"==typeof r.config.chart.events.selection&&r.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout((function(){var e,t,i,a,s=n.gridRect.getBoundingClientRect(),o=u.node.getBoundingClientRect();r.globals.isRangeBar?(e=r.globals.yAxisScale[0].niceMin+(o.left-s.left)*c.invertedYRatio,t=r.globals.yAxisScale[0].niceMin+(o.right-s.left)*c.invertedYRatio,i=0,a=1):(e=r.globals.xAxisScale.niceMin+(o.left-s.left)*c.xRatio,t=r.globals.xAxisScale.niceMin+(o.right-s.left)*c.xRatio,i=r.globals.yAxisScale[0].niceMin+(s.bottom-o.bottom)*c.yRatio[0],a=r.globals.yAxisScale[0].niceMax-(o.top-s.top)*c.yRatio[0]);var l={xaxis:{min:e,max:t},yaxis:{min:i,max:a}};r.config.chart.events.selection(n.ctx,l),r.config.chart.brush.enabled&&void 0!==r.config.chart.events.brushScrolled&&r.config.chart.events.brushScrolled(n.ctx,l)}),d))}}},{key:"selectionDrawn",value:function(e){var t=e.context,n=e.zoomtype,r=this.w,i=t,a=this.xyRatios,s=this.ctx.toolbar;if(i.startX>i.endX){var o=i.startX;i.startX=i.endX,i.endX=o}if(i.startY>i.endY){var l=i.startY;i.startY=i.endY,i.endY=l}var c=void 0,u=void 0;r.globals.isRangeBar?(c=r.globals.yAxisScale[0].niceMin+i.startX*a.invertedYRatio,u=r.globals.yAxisScale[0].niceMin+i.endX*a.invertedYRatio):(c=r.globals.xAxisScale.niceMin+i.startX*a.xRatio,u=r.globals.xAxisScale.niceMin+i.endX*a.xRatio);var d=[],h=[];if(r.config.yaxis.forEach((function(e,t){var n=r.globals.seriesYAxisMap[t][0];d.push(r.globals.yAxisScale[t].niceMax-a.yRatio[n]*i.startY),h.push(r.globals.yAxisScale[t].niceMax-a.yRatio[n]*i.endY)})),i.dragged&&(i.dragX>10||i.dragY>10)&&c!==u)if(r.globals.zoomEnabled){var f=k.clone(r.globals.initialConfig.yaxis),p=k.clone(r.globals.initialConfig.xaxis);if(r.globals.zoomed=!0,r.config.xaxis.convertedCatToNumeric&&(c=Math.floor(c),u=Math.floor(u),c<1&&(c=1,u=r.globals.dataPoints),u-c<2&&(u=c+1)),"xy"!==n&&"x"!==n||(p={min:c,max:u}),"xy"!==n&&"y"!==n||f.forEach((function(e,t){f[t].min=h[t],f[t].max=d[t]})),s){var m=s.getBeforeZoomRange(p,f);m&&(p=m.xaxis?m.xaxis:p,f=m.yaxis?m.yaxis:f)}var g={xaxis:p};r.config.chart.group||(g.yaxis=f),i.ctx.updateHelpers._updateOptions(g,!1,i.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof r.config.chart.events.zoomed&&s.zoomCallback(p,f)}else if(r.globals.selectionEnabled){var v,b=null;v={min:c,max:u},"xy"!==n&&"y"!==n||(b=k.clone(r.config.yaxis)).forEach((function(e,t){b[t].min=h[t],b[t].max=d[t]})),r.globals.selection=i.selection,"function"==typeof r.config.chart.events.selection&&r.config.chart.events.selection(i.ctx,{xaxis:v,yaxis:b})}}},{key:"panDragging",value:function(e){var t=e.context,n=this.w,r=t;if(void 0!==n.globals.lastClientPosition.x){var i=n.globals.lastClientPosition.x-r.clientX,a=n.globals.lastClientPosition.y-r.clientY;Math.abs(i)>Math.abs(a)&&i>0?this.moveDirection="left":Math.abs(i)>Math.abs(a)&&i<0?this.moveDirection="right":Math.abs(a)>Math.abs(i)&&a>0?this.moveDirection="up":Math.abs(a)>Math.abs(i)&&a<0&&(this.moveDirection="down")}n.globals.lastClientPosition={x:r.clientX,y:r.clientY};var s=n.globals.isRangeBar?n.globals.minY:n.globals.minX,o=n.globals.isRangeBar?n.globals.maxY:n.globals.maxX;n.config.xaxis.convertedCatToNumeric||r.panScrolled(s,o)}},{key:"delayedPanScrolled",value:function(){var e=this.w,t=e.globals.minX,n=e.globals.maxX,r=(e.globals.maxX-e.globals.minX)/2;"left"===this.moveDirection?(t=e.globals.minX+r,n=e.globals.maxX+r):"right"===this.moveDirection&&(t=e.globals.minX-r,n=e.globals.maxX-r),t=Math.floor(t),n=Math.floor(n),this.updateScrolledChart({xaxis:{min:t,max:n}},t,n)}},{key:"panScrolled",value:function(e,t){var n=this.w,r=this.xyRatios,i=k.clone(n.globals.initialConfig.yaxis),a=r.xRatio,s=n.globals.minX,o=n.globals.maxX;n.globals.isRangeBar&&(a=r.invertedYRatio,s=n.globals.minY,o=n.globals.maxY),"left"===this.moveDirection?(e=s+n.globals.gridWidth/15*a,t=o+n.globals.gridWidth/15*a):"right"===this.moveDirection&&(e=s-n.globals.gridWidth/15*a,t=o-n.globals.gridWidth/15*a),n.globals.isRangeBar||(en.globals.initialMaxX)&&(e=s,t=o);var l={xaxis:{min:e,max:t}};n.config.chart.group||(l.yaxis=i),this.updateScrolledChart(l,e,t)}},{key:"updateScrolledChart",value:function(e,t,n){var r=this.w;this.ctx.updateHelpers._updateOptions(e,!1,!1),"function"==typeof r.config.chart.events.scrolled&&r.config.chart.events.scrolled(this.ctx,{xaxis:{min:t,max:n}})}}]),t}(),wr=function(){function e(t){s(this,e),this.w=t.w,this.ttCtx=t,this.ctx=t.ctx}return l(e,[{key:"getNearestValues",value:function(e){var t=e.hoverArea,n=e.elGrid,r=e.clientX,i=e.clientY,a=this.w,s=n.getBoundingClientRect(),o=s.width,l=s.height,c=o/(a.globals.dataPoints-1),u=l/a.globals.dataPoints,d=this.hasBars();!a.globals.comboCharts&&!d||a.config.xaxis.convertedCatToNumeric||(c=o/a.globals.dataPoints);var h=r-s.left-a.globals.barPadForNumericAxis,f=i-s.top;h<0||f<0||h>o||f>l?(t.classList.remove("hovering-zoom"),t.classList.remove("hovering-pan")):a.globals.zoomEnabled?(t.classList.remove("hovering-pan"),t.classList.add("hovering-zoom")):a.globals.panEnabled&&(t.classList.remove("hovering-zoom"),t.classList.add("hovering-pan"));var p=Math.round(h/c),m=Math.floor(f/u);d&&!a.config.xaxis.convertedCatToNumeric&&(p=Math.ceil(h/c),p-=1);var g=null,v=null,b=a.globals.seriesXvalues.map((function(e){return e.filter((function(e){return k.isNumber(e)}))})),y=a.globals.seriesYvalues.map((function(e){return e.filter((function(e){return k.isNumber(e)}))}));if(a.globals.isXNumeric){var x=this.ttCtx.getElGrid().getBoundingClientRect(),w=h*(x.width/o),A=f*(x.height/l);g=(v=this.closestInMultiArray(w,A,b,y)).index,p=v.j,null!==g&&(b=a.globals.seriesXvalues[g],p=(v=this.closestInArray(w,b)).index)}return a.globals.capturedSeriesIndex=null===g?-1:g,(!p||p<1)&&(p=0),a.globals.isBarHorizontal?a.globals.capturedDataPointIndex=m:a.globals.capturedDataPointIndex=p,{capturedSeries:g,j:a.globals.isBarHorizontal?m:p,hoverX:h,hoverY:f}}},{key:"closestInMultiArray",value:function(e,t,n,r){var i=this.w,a=0,s=null,o=-1;i.globals.series.length>1?a=this.getFirstActiveXArray(n):s=0;var l=n[a][0],c=Math.abs(e-l);if(n.forEach((function(t){t.forEach((function(t,n){var r=Math.abs(e-t);r<=c&&(c=r,o=n)}))})),-1!==o){var u=r[a][o],d=Math.abs(t-u);s=a,r.forEach((function(e,n){var r=Math.abs(t-e[o]);r<=d&&(d=r,s=n)}))}return{index:s,j:o}}},{key:"getFirstActiveXArray",value:function(e){for(var t=this.w,n=0,r=e.map((function(e,t){return e.length>0?t:-1})),i=0;i0)for(var r=0;r *")):this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}},{key:"getAllMarkers",value:function(){var e=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");(e=y(e)).sort((function(e,t){var n=Number(e.getAttribute("data:realIndex")),r=Number(t.getAttribute("data:realIndex"));return rn?-1:0}));var t=[];return e.forEach((function(e){t.push(e.querySelector(".apexcharts-marker"))})),t}},{key:"hasMarkers",value:function(e){return this.getElMarkers(e).length>0}},{key:"getPathFromPoint",value:function(e,t){var n=Number(e.getAttribute("cx")),r=Number(e.getAttribute("cy")),i=e.getAttribute("shape");return new Nn(this.ctx).getMarkerPath(n,r,i,t)}},{key:"getElBars",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-rangebar-series")}},{key:"hasBars",value:function(){return this.getElBars().length>0}},{key:"getHoverMarkerSize",value:function(e){var t=this.w,n=t.config.markers.hover.size;return void 0===n&&(n=t.globals.markers.size[e]+t.config.markers.hover.sizeOffset),n}},{key:"toggleAllTooltipSeriesGroups",value:function(e){var t=this.w,n=this.ttCtx;0===n.allTooltipSeriesGroups.length&&(n.allTooltipSeriesGroups=t.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var r=n.allTooltipSeriesGroups,i=0;i ').concat(n.attrs.name,""),t+="
".concat(n.val,"
")})),b.innerHTML=e+"",y.innerHTML=t+""};s?l.globals.seriesGoals[t][n]&&Array.isArray(l.globals.seriesGoals[t][n])?x():(b.innerHTML="",y.innerHTML=""):x()}else b.innerHTML="",y.innerHTML="";if(null!==p&&(r[t].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=l.config.tooltip.z.title,r[t].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==p?p:""),s&&m[0]){if(l.config.tooltip.hideEmptySeries){var w=r[t].querySelector(".apexcharts-tooltip-marker"),A=r[t].querySelector(".apexcharts-tooltip-text");0==parseFloat(u)?(w.style.display="none",A.style.display="none"):(w.style.display="block",A.style.display="block")}null==u||l.globals.ancillaryCollapsedSeriesIndices.indexOf(t)>-1||l.globals.collapsedSeriesIndices.indexOf(t)>-1||Array.isArray(c.tConfig.enabledOnSeries)&&-1===c.tConfig.enabledOnSeries.indexOf(t)?m[0].parentNode.style.display="none":m[0].parentNode.style.display=l.config.tooltip.items.display}else Array.isArray(c.tConfig.enabledOnSeries)&&-1===c.tConfig.enabledOnSeries.indexOf(t)&&(m[0].parentNode.style.display="none")}},{key:"toggleActiveInactiveSeries",value:function(e,t){var n=this.w;if(e)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");var r=n.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group-".concat(t));r&&(r.classList.add("apexcharts-active"),r.style.display=n.config.tooltip.items.display)}}},{key:"getValuesToPrint",value:function(e){var t=e.i,n=e.j,r=this.w,i=this.ctx.series.filteredSeriesX(),a="",s="",o=null,l=null,c={series:r.globals.series,seriesIndex:t,dataPointIndex:n,w:r},u=r.globals.ttZFormatter;null===n?l=r.globals.series[t]:r.globals.isXNumeric&&"treemap"!==r.config.chart.type?(a=i[t][n],0===i[t].length&&(a=i[this.tooltipUtil.getFirstActiveXArray(i)][n])):a=new Jn(this.ctx).isFormatXY()?void 0!==r.config.series[t].data[n]?r.config.series[t].data[n].x:"":void 0!==r.globals.labels[n]?r.globals.labels[n]:"";var d=a;return a=r.globals.isXNumeric&&"datetime"===r.config.xaxis.type?new Pn(this.ctx).xLabelFormat(r.globals.ttKeyFormatter,d,d,{i:void 0,dateFormatter:new Rn(this.ctx).formatDate,w:this.w}):r.globals.isBarHorizontal?r.globals.yLabelFormatters[0](d,c):r.globals.xLabelFormatter(d,c),void 0!==r.config.tooltip.x.formatter&&(a=r.globals.ttKeyFormatter(d,c)),r.globals.seriesZ.length>0&&r.globals.seriesZ[t].length>0&&(o=u(r.globals.seriesZ[t][n],r)),s="function"==typeof r.config.xaxis.tooltip.formatter?r.globals.xaxisTooltipFormatter(d,c):a,{val:Array.isArray(l)?l.join(" "):l,xVal:Array.isArray(a)?a.join(" "):a,xAxisTTVal:Array.isArray(s)?s.join(" "):s,zVal:o}}},{key:"handleCustomTooltip",value:function(e){var t=e.i,n=e.j,r=e.y1,i=e.y2,a=e.w,s=this.ttCtx.getElTooltip(),o=a.config.tooltip.custom;Array.isArray(o)&&o[t]&&(o=o[t]),s.innerHTML=o({ctx:this.ctx,series:a.globals.series,seriesIndex:t,dataPointIndex:n,y1:r,y2:i,w:a})}}]),e}(),kr=function(){function e(t){s(this,e),this.ttCtx=t,this.ctx=t.ctx,this.w=t.w}return l(e,[{key:"moveXCrosshairs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.ttCtx,r=this.w,i=n.getElXCrosshairs(),a=e-n.xcrosshairsWidth/2,s=r.globals.labels.slice().length;if(null!==t&&(a=r.globals.gridWidth/s*t),null===i||r.globals.isBarHorizontal||(i.setAttribute("x",a),i.setAttribute("x1",a),i.setAttribute("x2",a),i.setAttribute("y2",r.globals.gridHeight),i.classList.add("apexcharts-active")),a<0&&(a=0),a>r.globals.gridWidth&&(a=r.globals.gridWidth),n.isXAxisTooltipEnabled){var o=a;"tickWidth"!==r.config.xaxis.crosshairs.width&&"barWidth"!==r.config.xaxis.crosshairs.width||(o=a+n.xcrosshairsWidth/2),this.moveXAxisTooltip(o)}}},{key:"moveYCrosshairs",value:function(e){var t=this.ttCtx;null!==t.ycrosshairs&&Nn.setAttrs(t.ycrosshairs,{y1:e,y2:e}),null!==t.ycrosshairsHidden&&Nn.setAttrs(t.ycrosshairsHidden,{y1:e,y2:e})}},{key:"moveXAxisTooltip",value:function(e){var t=this.w,n=this.ttCtx;if(null!==n.xaxisTooltip&&0!==n.xcrosshairsWidth){n.xaxisTooltip.classList.add("apexcharts-active");var r,i=n.xaxisOffY+t.config.xaxis.tooltip.offsetY+t.globals.translateY+1+t.config.xaxis.offsetY;if(e-=n.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(e))e+=t.globals.translateX,r=new Nn(this.ctx).getTextRects(n.xaxisTooltipText.innerHTML),n.xaxisTooltipText.style.minWidth=r.width+"px",n.xaxisTooltip.style.left=e+"px",n.xaxisTooltip.style.top=i+"px"}}},{key:"moveYAxisTooltip",value:function(e){var t=this.w,n=this.ttCtx;null===n.yaxisTTEls&&(n.yaxisTTEls=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var r=parseInt(n.ycrosshairsHidden.getAttribute("y1"),10),i=t.globals.translateY+r,a=n.yaxisTTEls[e].getBoundingClientRect().height,s=t.globals.translateYAxisX[e]-2;t.config.yaxis[e].opposite&&(s-=26),i-=a/2,-1===t.globals.ignoreYAxisIndexes.indexOf(e)?(n.yaxisTTEls[e].classList.add("apexcharts-active"),n.yaxisTTEls[e].style.top=i+"px",n.yaxisTTEls[e].style.left=s+t.config.yaxis[e].tooltip.offsetX+"px"):n.yaxisTTEls[e].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.w,i=this.ttCtx,a=i.getElTooltip(),s=i.tooltipRect,o=null!==n?parseFloat(n):1,l=parseFloat(e)+o+5,c=parseFloat(t)+o/2;if(l>r.globals.gridWidth/2&&(l=l-s.ttWidth-o-10),l>r.globals.gridWidth-s.ttWidth-10&&(l=r.globals.gridWidth-s.ttWidth),l<-20&&(l=-20),r.config.tooltip.followCursor){var u=i.getElGrid().getBoundingClientRect();(l=i.e.clientX-u.left)>r.globals.gridWidth/2&&(l-=i.tooltipRect.ttWidth),(c=i.e.clientY+r.globals.translateY-u.top)>r.globals.gridHeight/2&&(c-=i.tooltipRect.ttHeight)}else r.globals.isBarHorizontal||s.ttHeight/2+c>r.globals.gridHeight&&(c=r.globals.gridHeight-s.ttHeight+r.globals.translateY);isNaN(l)||(l+=r.globals.translateX,a.style.left=l+"px",a.style.top=c+"px")}},{key:"moveMarkers",value:function(e,t){var n=this.w,r=this.ttCtx;if(n.globals.markers.size[e]>0)for(var i=n.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(e,"'] .apexcharts-marker")),a=0;a0){var f=h.getAttribute("shape"),p=l.getMarkerPath(i,a,f,1.5*u);h.setAttribute("d",p)}this.moveXCrosshairs(i),o.fixedTooltip||this.moveTooltip(i,a,u)}}},{key:"moveDynamicPointsOnHover",value:function(e){var t,n=this.ttCtx,r=n.w,i=0,a=0,s=r.globals.pointsArray,o=new Zn(this.ctx),l=new Nn(this.ctx);t=o.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);var c=n.tooltipUtil.getHoverMarkerSize(t);s[t]&&(i=s[t][e][0],a=s[t][e][1]);var u=n.tooltipUtil.getAllMarkers();if(null!==u)for(var d=0;d0){var v=l.getMarkerPath(i,f,m,c);u[d].setAttribute("d",v)}else u[d].setAttribute("d","")}}this.moveXCrosshairs(i),n.fixedTooltip||this.moveTooltip(i,a||r.globals.gridHeight,c)}},{key:"moveStickyTooltipOverBars",value:function(e,t){var n=this.w,r=this.ttCtx,i=n.globals.columnSeries?n.globals.columnSeries.length:n.globals.series.length,a=i>=2&&i%2==0?Math.floor(i/2):Math.floor(i/2)+1;n.globals.isBarHorizontal&&(a=new Zn(this.ctx).getActiveConfigSeriesIndex("desc")+1);var s=n.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(a,"'] path[j='").concat(e,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(a,"'] path[j='").concat(e,"'], .apexcharts-boxPlot-series .apexcharts-series[rel='").concat(a,"'] path[j='").concat(e,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(a,"'] path[j='").concat(e,"']"));s||"number"!=typeof t||(s=n.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[data\\:realIndex='".concat(t,"'] path[j='").concat(e,"'],\n .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='").concat(t,"'] path[j='").concat(e,"'],\n .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='").concat(t,"'] path[j='").concat(e,"'],\n .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='").concat(t,"'] path[j='").concat(e,"']")));var o=s?parseFloat(s.getAttribute("cx")):0,l=s?parseFloat(s.getAttribute("cy")):0,c=s?parseFloat(s.getAttribute("barWidth")):0,u=r.getElGrid().getBoundingClientRect(),d=s&&(s.classList.contains("apexcharts-candlestick-area")||s.classList.contains("apexcharts-boxPlot-area"));n.globals.isXNumeric?(s&&!d&&(o-=i%2!=0?c/2:0),s&&d&&(o-=c/2)):n.globals.isBarHorizontal||(o=r.xAxisTicksPositions[e-1]+r.dataPointsDividedWidth/2,isNaN(o)&&(o=r.xAxisTicksPositions[e]-r.dataPointsDividedWidth/2)),n.globals.isBarHorizontal?l-=r.tooltipRect.ttHeight:n.config.tooltip.followCursor?l=r.e.clientY-u.top-r.tooltipRect.ttHeight/2:l+r.tooltipRect.ttHeight+15>n.globals.gridHeight&&(l=n.globals.gridHeight),n.globals.isBarHorizontal||this.moveXCrosshairs(o),r.fixedTooltip||this.moveTooltip(o,l||n.globals.gridHeight)}}]),e}(),Sr=function(){function e(t){s(this,e),this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new kr(t)}return l(e,[{key:"drawDynamicPoints",value:function(){var e=this.w,t=new Nn(this.ctx),n=new Gn(this.ctx),r=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series");r=y(r),e.config.chart.stacked&&r.sort((function(e,t){return parseFloat(e.getAttribute("data:realIndex"))-parseFloat(t.getAttribute("data:realIndex"))}));for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=this.w;"bubble"!==i.config.chart.type&&this.newPointSize(e,t);var a=t.getAttribute("cx"),s=t.getAttribute("cy");if(null!==n&&null!==r&&(a=n,s=r),this.tooltipPosition.moveXCrosshairs(a),!this.fixedTooltip){if("radar"===i.config.chart.type){var o=this.ttCtx.getElGrid().getBoundingClientRect();a=this.ttCtx.e.clientX-o.left}this.tooltipPosition.moveTooltip(a,s,i.config.markers.hover.size)}}},{key:"enlargePoints",value:function(e){for(var t=this.w,n=this,r=this.ttCtx,i=e,a=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),s=t.config.markers.hover.size,o=0;o0){var r=this.ttCtx.tooltipUtil.getPathFromPoint(e[t],n);e[t].setAttribute("d",r)}else e[t].setAttribute("d","M0,0")}}}]),e}(),_r=function(){function e(t){s(this,e),this.w=t.w;var n=this.w;this.ttCtx=t,this.isVerticalGroupedRangeBar=!n.globals.isBarHorizontal&&"rangeBar"===n.config.chart.type&&n.config.plotOptions.bar.rangeBarGroupRows}return l(e,[{key:"getAttr",value:function(e,t){return parseFloat(e.target.getAttribute(t))}},{key:"handleHeatTreeTooltip",value:function(e){var t=e.e,n=e.opt,r=e.x,i=e.y,a=e.type,s=this.ttCtx,o=this.w;if(t.target.classList.contains("apexcharts-".concat(a,"-rect"))){var l=this.getAttr(t,"i"),c=this.getAttr(t,"j"),u=this.getAttr(t,"cx"),d=this.getAttr(t,"cy"),h=this.getAttr(t,"width"),f=this.getAttr(t,"height");if(s.tooltipLabels.drawSeriesTexts({ttItems:n.ttItems,i:l,j:c,shared:!1,e:t}),o.globals.capturedSeriesIndex=l,o.globals.capturedDataPointIndex=c,r=u+s.tooltipRect.ttWidth/2+h,i=d+s.tooltipRect.ttHeight/2-f/2,s.tooltipPosition.moveXCrosshairs(u+h/2),r>o.globals.gridWidth/2&&(r=u-s.tooltipRect.ttWidth/2+h),s.w.config.tooltip.followCursor){var p=o.globals.dom.elWrap.getBoundingClientRect();r=o.globals.clientX-p.left-(r>o.globals.gridWidth/2?s.tooltipRect.ttWidth:0),i=o.globals.clientY-p.top-(i>o.globals.gridHeight/2?s.tooltipRect.ttHeight:0)}}return{x:r,y:i}}},{key:"handleMarkerTooltip",value:function(e){var t,n,r=e.e,i=e.opt,a=e.x,s=e.y,o=this.w,l=this.ttCtx;if(r.target.classList.contains("apexcharts-marker")){var c=parseInt(i.paths.getAttribute("cx"),10),u=parseInt(i.paths.getAttribute("cy"),10),d=parseFloat(i.paths.getAttribute("val"));if(n=parseInt(i.paths.getAttribute("rel"),10),t=parseInt(i.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,l.intersect){var h=k.findAncestor(i.paths,"apexcharts-series");h&&(t=parseInt(h.getAttribute("data:realIndex"),10))}if(l.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:n,shared:!l.showOnIntersect&&o.config.tooltip.shared,e:r}),"mouseup"===r.type&&l.markerClick(r,t,n),o.globals.capturedSeriesIndex=t,o.globals.capturedDataPointIndex=n,a=c,s=u+o.globals.translateY-1.4*l.tooltipRect.ttHeight,l.w.config.tooltip.followCursor){var f=l.getElGrid().getBoundingClientRect();s=l.e.clientY+o.globals.translateY-f.top}d<0&&(s=u),l.marker.enlargeCurrentPoint(n,i.paths,a,s)}return{x:a,y:s}}},{key:"handleBarTooltip",value:function(e){var t,n,r=e.e,i=e.opt,a=this.w,s=this.ttCtx,o=s.getElTooltip(),l=0,c=0,u=0,d=this.getBarTooltipXY({e:r,opt:i});if(null!==d.j||0!==d.barHeight||0!==d.barWidth){t=d.i;var h=d.j;if(a.globals.capturedSeriesIndex=t,a.globals.capturedDataPointIndex=h,a.globals.isBarHorizontal&&s.tooltipUtil.hasBars()||!a.config.tooltip.shared?(c=d.x,u=d.y,n=Array.isArray(a.config.stroke.width)?a.config.stroke.width[t]:a.config.stroke.width,l=c):a.globals.comboCharts||a.config.tooltip.shared||(l/=2),isNaN(u)&&(u=a.globals.svgHeight-s.tooltipRect.ttHeight),parseInt(i.paths.parentNode.getAttribute("data:realIndex"),10),c+s.tooltipRect.ttWidth>a.globals.gridWidth?c-=s.tooltipRect.ttWidth:c<0&&(c=0),s.w.config.tooltip.followCursor){var f=s.getElGrid().getBoundingClientRect();u=s.e.clientY-f.top}null===s.tooltip&&(s.tooltip=a.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),a.config.tooltip.shared||(a.globals.comboBarCount>0?s.tooltipPosition.moveXCrosshairs(l+n/2):s.tooltipPosition.moveXCrosshairs(l)),!s.fixedTooltip&&(!a.config.tooltip.shared||a.globals.isBarHorizontal&&s.tooltipUtil.hasBars())&&(u=u+a.globals.translateY-s.tooltipRect.ttHeight/2,o.style.left=c+a.globals.translateX+"px",o.style.top=u+"px")}}},{key:"getBarTooltipXY",value:function(e){var t=this,n=e.e,r=e.opt,i=this.w,a=null,s=this.ttCtx,o=0,l=0,c=0,u=0,d=0,h=n.target.classList;if(h.contains("apexcharts-bar-area")||h.contains("apexcharts-candlestick-area")||h.contains("apexcharts-boxPlot-area")||h.contains("apexcharts-rangebar-area")){var f=n.target,p=f.getBoundingClientRect(),m=r.elGrid.getBoundingClientRect(),g=p.height;d=p.height;var v=p.width,b=parseInt(f.getAttribute("cx"),10),y=parseInt(f.getAttribute("cy"),10);u=parseFloat(f.getAttribute("barWidth"));var x="touchmove"===n.type?n.touches[0].clientX:n.clientX;a=parseInt(f.getAttribute("j"),10),o=parseInt(f.parentNode.getAttribute("rel"),10)-1;var w=f.getAttribute("data-range-y1"),A=f.getAttribute("data-range-y2");i.globals.comboCharts&&(o=parseInt(f.parentNode.getAttribute("data:realIndex"),10));var k=function(e){return i.globals.isXNumeric?b-v/2:t.isVerticalGroupedRangeBar?b+v/2:b-s.dataPointsDividedWidth+v/2},S=function(){return y-s.dataPointsDividedHeight+g/2-s.tooltipRect.ttHeight/2};s.tooltipLabels.drawSeriesTexts({ttItems:r.ttItems,i:o,j:a,y1:w?parseInt(w,10):null,y2:A?parseInt(A,10):null,shared:!s.showOnIntersect&&i.config.tooltip.shared,e:n}),i.config.tooltip.followCursor?i.globals.isBarHorizontal?(l=x-m.left+15,c=S()):(l=k(),c=n.clientY-m.top-s.tooltipRect.ttHeight/2-15):i.globals.isBarHorizontal?((l=b)0&&n.setAttribute("width",t.xcrosshairsWidth)}},{key:"handleYCrosshair",value:function(){var e=this.w,t=this.ttCtx;t.ycrosshairs=e.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),t.ycrosshairsHidden=e.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}},{key:"drawYaxisTooltipText",value:function(e,t,n){var r=this.ttCtx,i=this.w,a=i.globals,s=a.seriesYAxisMap[e];if(r.yaxisTooltips[e]&&s.length>0){var o=a.yLabelFormatters[e],l=r.getElGrid().getBoundingClientRect(),c=s[0],u=0;n.yRatio.length>1&&(u=c);var d=(t-l.top)*n.yRatio[u],h=a.maxYArr[c]-a.minYArr[c],f=a.minYArr[c]+(h-d);i.config.yaxis[e].reversed&&(f=a.maxYArr[c]-(h-d)),r.tooltipPosition.moveYCrosshairs(t-l.top),r.yaxisTooltipText[e].innerHTML=o(f),r.tooltipPosition.moveYAxisTooltip(e)}}}]),e}(),jr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w;var n=this.w;this.tConfig=n.config.tooltip,this.tooltipUtil=new wr(this),this.tooltipLabels=new Ar(this),this.tooltipPosition=new kr(this),this.marker=new Sr(this),this.intersect=new _r(this),this.axesTooltip=new Cr(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!n.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now()}return l(e,[{key:"getElTooltip",value:function(e){return e||(e=this),e.w.globals.dom.baseEl?e.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip"):null}},{key:"getElXCrosshairs",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}},{key:"getElGrid",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}},{key:"drawTooltip",value:function(e){var t=this.w;this.xyRatios=e,this.isXAxisTooltipEnabled=t.config.xaxis.tooltip.enabled&&t.globals.axisCharts,this.yaxisTooltips=t.config.yaxis.map((function(e,n){return!!(e.show&&e.tooltip.enabled&&t.globals.axisCharts)})),this.allTooltipSeriesGroups=[],t.globals.axisCharts||(this.showTooltipTitle=!1);var n=document.createElement("div");if(n.classList.add("apexcharts-tooltip"),t.config.tooltip.cssClass&&n.classList.add(t.config.tooltip.cssClass),n.classList.add("apexcharts-theme-".concat(this.tConfig.theme)),t.globals.dom.elWrap.appendChild(n),t.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var r=new er(this.ctx);this.xAxisTicksPositions=r.getXAxisTicksPositions()}if(!t.globals.comboCharts&&!this.tConfig.intersect&&"rangeBar"!==t.config.chart.type||this.tConfig.shared||(this.showOnIntersect=!0),0!==t.config.markers.size&&0!==t.globals.markers.largestSize||this.marker.drawDynamicPoints(this),t.globals.collapsedSeries.length!==t.globals.series.length){this.dataPointsDividedHeight=t.globals.gridHeight/t.globals.dataPoints,this.dataPointsDividedWidth=t.globals.gridWidth/t.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||t.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,n.appendChild(this.tooltipTitle));var i=t.globals.series.length;(t.globals.xyCharts||t.globals.comboCharts)&&this.tConfig.shared&&(i=this.showOnIntersect?1:t.globals.series.length),this.legendLabels=t.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(i),this.addSVGEvents()}}},{key:"createTTElements",value:function(e){for(var t=this,n=this.w,r=[],i=this.getElTooltip(),a=function(a){var s=document.createElement("div");s.classList.add("apexcharts-tooltip-series-group","apexcharts-tooltip-series-group-".concat(a)),s.style.order=n.config.tooltip.inverseOrder?e-a:a+1;var o=document.createElement("span");o.classList.add("apexcharts-tooltip-marker"),o.style.backgroundColor=n.globals.colors[a],s.appendChild(o);var l=document.createElement("div");l.classList.add("apexcharts-tooltip-text"),l.style.fontFamily=t.tConfig.style.fontFamily||n.config.chart.fontFamily,l.style.fontSize=t.tConfig.style.fontSize,["y","goals","z"].forEach((function(e){var t=document.createElement("div");t.classList.add("apexcharts-tooltip-".concat(e,"-group"));var n=document.createElement("span");n.classList.add("apexcharts-tooltip-text-".concat(e,"-label")),t.appendChild(n);var r=document.createElement("span");r.classList.add("apexcharts-tooltip-text-".concat(e,"-value")),t.appendChild(r),l.appendChild(t)})),s.appendChild(l),i.appendChild(s),r.push(s)},s=0;s0&&this.addPathsEventListeners(f,u),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(u)}}},{key:"drawFixedTooltipRect",value:function(){var e=this.w,t=this.getElTooltip(),n=t.getBoundingClientRect(),r=n.width+10,i=n.height+10,a=this.tConfig.fixed.offsetX,s=this.tConfig.fixed.offsetY,o=this.tConfig.fixed.position.toLowerCase();return o.indexOf("right")>-1&&(a=a+e.globals.svgWidth-r+10),o.indexOf("bottom")>-1&&(s=s+e.globals.svgHeight-i-10),t.style.left=a+"px",t.style.top=s+"px",{x:a,y:s,ttWidth:r,ttHeight:i}}},{key:"addDatapointEventsListeners",value:function(e){var t=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(t,e)}},{key:"addPathsEventListeners",value:function(e,t){for(var n=this,r=function(r){var i={paths:e[r],tooltipEl:t.tooltipEl,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:t.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map((function(t){return e[r].addEventListener(t,n.onSeriesHover.bind(n,i),{capture:!1,passive:!0})}))},i=0;i=20?this.seriesHover(e,t):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout((function(){n.seriesHover(e,t)}),20-r))}},{key:"seriesHover",value:function(e,t){var n=this;this.lastHoverTime=Date.now();var r=[],i=this.w;i.config.chart.group&&(r=this.ctx.getGroupedCharts()),i.globals.axisCharts&&(i.globals.minX===-1/0&&i.globals.maxX===1/0||0===i.globals.dataPoints)||(r.length?r.forEach((function(r){var i=n.getElTooltip(r),a={paths:e.paths,tooltipEl:i,tooltipY:e.tooltipY,tooltipX:e.tooltipX,elGrid:e.elGrid,hoverArea:e.hoverArea,ttItems:r.w.globals.tooltip.ttItems};r.w.globals.minX===n.w.globals.minX&&r.w.globals.maxX===n.w.globals.maxX&&r.w.globals.tooltip.seriesHoverByContext({chartCtx:r,ttCtx:r.w.globals.tooltip,opt:a,e:t})})):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:e,e:t}))}},{key:"seriesHoverByContext",value:function(e){var t=e.chartCtx,n=e.ttCtx,r=e.opt,i=e.e,a=t.w,s=this.getElTooltip(t);s&&(n.tooltipRect={x:0,y:0,ttWidth:s.getBoundingClientRect().width,ttHeight:s.getBoundingClientRect().height},n.e=i,!n.tooltipUtil.hasBars()||a.globals.comboCharts||n.isBarShared||this.tConfig.onDatasetHover.highlightDataSeries&&new Zn(t).toggleSeriesOnHover(i,i.target.parentNode),n.fixedTooltip&&n.drawFixedTooltipRect(),a.globals.axisCharts?n.axisChartsTooltips({e:i,opt:r,tooltipRect:n.tooltipRect}):n.nonAxisChartsTooltips({e:i,opt:r,tooltipRect:n.tooltipRect}))}},{key:"axisChartsTooltips",value:function(e){var t,n,r=e.e,i=e.opt,a=this.w,s=i.elGrid.getBoundingClientRect(),o="touchmove"===r.type?r.touches[0].clientX:r.clientX,l="touchmove"===r.type?r.touches[0].clientY:r.clientY;if(this.clientY=l,this.clientX=o,a.globals.capturedSeriesIndex=-1,a.globals.capturedDataPointIndex=-1,ls.top+s.height)this.handleMouseOut(i);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!a.config.tooltip.shared){var c=parseInt(i.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(c)<0)return void this.handleMouseOut(i)}var u=this.getElTooltip(),d=this.getElXCrosshairs(),h=[];a.config.chart.group&&(h=this.ctx.getSyncedCharts());var f=a.globals.xyCharts||"bar"===a.config.chart.type&&!a.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||a.globals.comboCharts&&this.tooltipUtil.hasBars();if("mousemove"===r.type||"touchmove"===r.type||"mouseup"===r.type){if(a.globals.collapsedSeries.length+a.globals.ancillaryCollapsedSeries.length===a.globals.series.length)return;null!==d&&d.classList.add("apexcharts-active");var p=this.yaxisTooltips.filter((function(e){return!0===e}));if(null!==this.ycrosshairs&&p.length&&this.ycrosshairs.classList.add("apexcharts-active"),f&&!this.showOnIntersect||h.length>1)this.handleStickyTooltip(r,o,l,i);else if("heatmap"===a.config.chart.type||"treemap"===a.config.chart.type){var m=this.intersect.handleHeatTreeTooltip({e:r,opt:i,x:t,y:n,type:a.config.chart.type});t=m.x,n=m.y,u.style.left=t+"px",u.style.top=n+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:r,opt:i}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:r,opt:i,x:t,y:n});if(this.yaxisTooltips.length)for(var g=0;gl.width)this.handleMouseOut(r);else if(null!==o)this.handleStickyCapturedSeries(e,o,r,s);else if(this.tooltipUtil.isXoverlap(s)||i.globals.isBarHorizontal){var c=i.globals.series.findIndex((function(e,t){return!i.globals.collapsedSeriesIndices.includes(t)}));this.create(e,this,c,s,r.ttItems)}}},{key:"handleStickyCapturedSeries",value:function(e,t,n,r){var i=this.w;if(this.tConfig.shared||null!==i.globals.series[t][r]){if(void 0!==i.globals.series[t][r])this.tConfig.shared&&this.tooltipUtil.isXoverlap(r)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(e,this,t,r,n.ttItems):this.create(e,this,t,r,n.ttItems,!1);else if(this.tooltipUtil.isXoverlap(r)){var a=i.globals.series.findIndex((function(e,t){return!i.globals.collapsedSeriesIndices.includes(t)}));this.create(e,this,a,r,n.ttItems)}}else this.handleMouseOut(n)}},{key:"deactivateHoverFilter",value:function(){for(var e=this.w,t=new Nn(this.ctx),n=e.globals.dom.Paper.find(".apexcharts-bar-area"),r=0;r5&&void 0!==arguments[5]?arguments[5]:null,k=this.w,S=t;"mouseup"===e.type&&this.markerClick(e,n,r),null===A&&(A=this.tConfig.shared);var _=this.tooltipUtil.hasMarkers(n),C=this.tooltipUtil.getElBars();if(k.config.legend.tooltipHoverFormatter){var j=k.config.legend.tooltipHoverFormatter,E=Array.from(this.legendLabels);E.forEach((function(e){var t=e.getAttribute("data:default-text");e.innerHTML=decodeURIComponent(t)}));for(var N=0;N0?S.marker.enlargePoints(r):S.tooltipPosition.moveDynamicPointsOnHover(r);else if(this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(C),this.barSeriesHeight>0)){var I=new Nn(this.ctx),D=k.globals.dom.Paper.find(".apexcharts-bar-area[j='".concat(r,"']"));this.deactivateHoverFilter(),this.tooltipPosition.moveStickyTooltipOverBars(r,n);for(var L=0;L0&&t.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(h-=c*A)),w&&(h=h+d.height/2-v/2-2);var S=t.globals.series[n][r]<0,_=o;switch(this.barCtx.isReversed&&(_=o+(S?u:-u)),m.position){case"center":f=w?S?_-u/2+y:_+u/2-y:S?_-u/2+d.height/2+y:_+u/2+d.height/2-y;break;case"bottom":f=w?S?_-u+y:_+u-y:S?_-u+d.height+v+y:_+u-d.height/2+v-y;break;case"top":f=w?S?_+y:_-y:S?_-d.height/2-y:_+d.height+y}if(this.barCtx.lastActiveBarSerieIndex===i&&g.enabled){var C=new Nn(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:i,j:r}),p.fontSize);a=S?_-C.height/2-y-g.offsetY+18:_+C.height+y+g.offsetY-18;var j=k;s=x+(t.globals.isXNumeric?-c*t.globals.barGroups.length/2:t.globals.barGroups.length*c/2-(t.globals.barGroups.length-1)*c-j)+g.offsetX}return t.config.chart.stacked||(f<0?f=0+v:f+d.height/3>t.globals.gridHeight&&(f=t.globals.gridHeight-v)),{bcx:l,bcy:o,dataLabelsX:h,dataLabelsY:f,totalDataLabelsX:s,totalDataLabelsY:a,totalDataLabelsAnchor:"middle"}}},{key:"calculateBarsDataLabelsPosition",value:function(e){var t=this.w,n=e.x,r=e.i,i=e.j,a=e.realIndex,s=e.bcy,o=e.barHeight,l=e.barWidth,c=e.textRects,u=e.dataLabelsX,d=e.strokeWidth,h=e.dataLabelsConfig,f=e.barDataLabelsConfig,p=e.barTotalDataLabelsConfig,m=e.offX,g=e.offY,v=t.globals.gridHeight/t.globals.dataPoints;l=Math.abs(l);var b,y,x=s-(this.barCtx.isRangeBar?0:v)+o/2+c.height/2+g-3,w="start",A=t.globals.series[r][i]<0,k=n;switch(this.barCtx.isReversed&&(k=n+(A?-l:l),w=A?"start":"end"),f.position){case"center":u=A?k+l/2-m:Math.max(c.width/2,k-l/2)+m;break;case"bottom":u=A?k+l-d-m:k-l+d+m;break;case"top":u=A?k-d-m:k-d+m}if(this.barCtx.lastActiveBarSerieIndex===a&&p.enabled){var S=new Nn(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:a,j:i}),h.fontSize);A?(b=k-d-m-p.offsetX,w="end"):b=k+m+p.offsetX+(this.barCtx.isReversed?-(l+d):d),y=x-c.height/2+S.height/2+p.offsetY+d}return t.config.chart.stacked||("start"===h.textAnchor?u-c.width<0?u=A?c.width+d:d:u+c.width>t.globals.gridWidth&&(u=A?t.globals.gridWidth-d:t.globals.gridWidth-c.width-d):"middle"===h.textAnchor?u-c.width/2<0?u=c.width/2+d:u+c.width/2>t.globals.gridWidth&&(u=t.globals.gridWidth-c.width/2-d):"end"===h.textAnchor&&(u<1?u=c.width+d:u+1>t.globals.gridWidth&&(u=t.globals.gridWidth-c.width-d))),{bcx:n,bcy:s,dataLabelsX:u,dataLabelsY:x,totalDataLabelsX:b,totalDataLabelsY:y,totalDataLabelsAnchor:w}}},{key:"drawCalculatedDataLabels",value:function(e){var t=e.x,n=e.y,r=e.val,i=e.i,a=e.j,s=e.textRects,o=e.barHeight,l=e.barWidth,c=e.dataLabelsConfig,u=this.w,d="rotate(0)";"vertical"===u.config.plotOptions.bar.dataLabels.orientation&&(d="rotate(-90, ".concat(t,", ").concat(n,")"));var h=new Kn(this.barCtx.ctx),f=new Nn(this.barCtx.ctx),p=c.formatter,m=null,v=u.globals.collapsedSeriesIndices.indexOf(i)>-1;if(c.enabled&&!v){m=f.group({class:"apexcharts-data-labels",transform:d});var b="";void 0!==r&&(b=p(r,g(g({},u),{},{seriesIndex:i,dataPointIndex:a,w:u}))),!r&&u.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b="");var y=u.globals.series[i][a]<0,x=u.config.plotOptions.bar.dataLabels.position;"vertical"===u.config.plotOptions.bar.dataLabels.orientation&&("top"===x&&(c.textAnchor=y?"end":"start"),"center"===x&&(c.textAnchor="middle"),"bottom"===x&&(c.textAnchor=y?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&lMath.abs(l)&&(b=""):s.height/1.6>Math.abs(o)&&(b=""));var w=g({},c);this.barCtx.isHorizontal&&r<0&&("start"===c.textAnchor?w.textAnchor="end":"end"===c.textAnchor&&(w.textAnchor="start")),h.plotDataLabelsText({x:t,y:n,text:b,i:i,j:a,parent:m,dataLabelsConfig:w,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return m}},{key:"drawTotalDataLabels",value:function(e){var t=e.x,n=e.y,r=e.val,i=e.realIndex,a=e.textAnchor,s=e.barTotalDataLabelsConfig;this.w;var o,l=new Nn(this.barCtx.ctx);return s.enabled&&void 0!==t&&void 0!==n&&this.barCtx.lastActiveBarSerieIndex===i&&(o=l.drawText({x:t,y:n,foreColor:s.style.color,text:r,textAnchor:a,fontFamily:s.style.fontFamily,fontSize:s.style.fontSize,fontWeight:s.style.fontWeight})),o}}]),e}(),Nr=function(){function e(t){s(this,e),this.w=t.w,this.barCtx=t}return l(e,[{key:"initVariables",value:function(e){var t=this.w;this.barCtx.series=e,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var n=0;n0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=e[n].length),t.globals.isXNumeric)for(var r=0;rt.globals.minX&&t.globals.seriesX[n][r]0&&(r=l.globals.minXDiff/d),(a=r/u*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(a=1)}-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(a=parseInt(this.barCtx.barOptions.columnWidth,10)),s=l.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?l.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e=l.globals.padHorizontal+(r-a*this.barCtx.seriesLen)/2}return l.globals.barHeight=i,l.globals.barWidth=a,{x:e,y:t,yDivision:n,xDivision:r,barHeight:i,barWidth:a,zeroH:s,zeroW:o}}},{key:"initializeStackedPrevVars",value:function(e){e.w.globals.seriesGroups.forEach((function(t){e[t]||(e[t]={}),e[t].prevY=[],e[t].prevX=[],e[t].prevYF=[],e[t].prevXF=[],e[t].prevYVal=[],e[t].prevXVal=[]}))}},{key:"initializeStackedXYVars",value:function(e){e.w.globals.seriesGroups.forEach((function(t){e[t]||(e[t]={}),e[t].xArrj=[],e[t].xArrjF=[],e[t].xArrjVal=[],e[t].yArrj=[],e[t].yArrjF=[],e[t].yArrjVal=[]}))}},{key:"getPathFillColor",value:function(e,t,n,r){var i,a,s,o,l=this.w,c=this.barCtx.ctx.fill,u=null,d=this.barCtx.barOptions.distributed?n:t;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map((function(r){e[t][n]>=r.from&&e[t][n]<=r.to&&(u=r.color)})),c.fillPath({seriesNumber:this.barCtx.barOptions.distributed?d:r,dataPointIndex:n,color:u,value:e[t][n],fillConfig:null===(i=l.config.series[t].data[n])||void 0===i?void 0:i.fill,fillType:null!==(a=l.config.series[t].data[n])&&void 0!==a&&null!==(s=a.fill)&&void 0!==s&&s.type?null===(o=l.config.series[t].data[n])||void 0===o?void 0:o.fill.type:Array.isArray(l.config.fill.type)?l.config.fill.type[r]:l.config.fill.type})}},{key:"getStrokeWidth",value:function(e,t,n){var r=0,i=this.w;return this.barCtx.series[e][t]?this.barCtx.isNullValue=!1:this.barCtx.isNullValue=!0,i.config.stroke.show&&(this.barCtx.isNullValue||(r=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[n]:this.barCtx.strokeWidth)),r}},{key:"createBorderRadiusArr",value:function(e){var t,n=this.w,r=!this.w.config.chart.stacked||n.config.plotOptions.bar.borderRadius<=0,i=e.length,a=0|(null===(t=e[0])||void 0===t?void 0:t.length),s=Array.from({length:i},(function(){return Array(a).fill(r?"top":"none")}));if(r)return s;for(var o=0;o0?(l.push(h),d++):f<0&&(u.push(h),d++)}if(l.length>0&&0===u.length)if(1===l.length)s[l[0]][o]="both";else{var p,m=l[0],g=l[l.length-1],v=c(l);try{for(v.s();!(p=v.n()).done;){var b=p.value;s[b][o]=b===m?"bottom":b===g?"top":"none"}}catch(e){v.e(e)}finally{v.f()}}else if(u.length>0&&0===l.length)if(1===u.length)s[u[0]][o]="both";else{var y,x=Math.max.apply(Math,u),w=Math.min.apply(Math,u),A=c(u);try{for(A.s();!(y=A.n()).done;){var k=y.value;s[k][o]=k===x?"bottom":k===w?"top":"none"}}catch(e){A.e(e)}finally{A.f()}}else if(l.length>0&&u.length>0){var S,_=l[l.length-1],C=c(l);try{for(C.s();!(S=C.n()).done;){var j=S.value;s[j][o]=j===_?"top":"none"}}catch(e){C.e(e)}finally{C.f()}var E,N=Math.max.apply(Math,u),M=c(u);try{for(M.s();!(E=M.n()).done;){var T=E.value;s[T][o]=T===N?"bottom":"none"}}catch(e){M.e(e)}finally{M.f()}}else 1===d&&(s[l[0]||u[0]][o]="both")}return s}},{key:"barBackground",value:function(e){var t=e.j,n=e.i,r=e.x1,i=e.x2,a=e.y1,s=e.y2,o=e.elSeries,l=this.w,c=new Nn(this.barCtx.ctx),u=new Zn(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&u===n){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);var d=this.barCtx.barOptions.colors.backgroundBarColors[t],h=c.drawRect(void 0!==r?r:0,void 0!==a?a:0,void 0!==i?i:l.globals.gridWidth,void 0!==s?s:l.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,d,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}},{key:"getColumnPaths",value:function(e){var t,n=e.barWidth,r=e.barXPosition,i=e.y1,a=e.y2,s=e.strokeWidth,o=e.isReversed,l=e.series,c=e.seriesGroup,u=e.realIndex,d=e.i,h=e.j,f=e.w,p=new Nn(this.barCtx.ctx);(s=Array.isArray(s)?s[u]:s)||(s=0);var m=n,g=r;null!==(t=f.config.series[u].data[h])&&void 0!==t&&t.columnWidthOffset&&(g=r-f.config.series[u].data[h].columnWidthOffset/2,m=n+f.config.series[u].data[h].columnWidthOffset);var v=s/2,b=g+v,y=g+m-v,x=(l[d][h]>=0?1:-1)*(o?-1:1);i+=.001-v*x,a+=.001+v*x;var w=p.move(b,i),A=p.move(b,i),k=p.line(y,i);if(f.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(u,h,!1)),w=w+p.line(b,a)+p.line(y,a)+k+("around"===f.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[u][h]?" Z":" z"),A=A+p.line(b,i)+k+k+k+k+k+p.line(b,i)+("around"===f.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[u][h]?" Z":" z"),"none"!==this.arrBorderRadius[u][h]&&(w=p.roundPathCorners(w,f.config.plotOptions.bar.borderRadius)),f.config.chart.stacked){var S=this.barCtx;(S=this.barCtx[c]).yArrj.push(a-v*x),S.yArrjF.push(Math.abs(i-a+s*x)),S.yArrjVal.push(this.barCtx.series[d][h])}return{pathTo:w,pathFrom:A}}},{key:"getBarpaths",value:function(e){var t,n=e.barYPosition,r=e.barHeight,i=e.x1,a=e.x2,s=e.strokeWidth,o=e.isReversed,l=e.series,c=e.seriesGroup,u=e.realIndex,d=e.i,h=e.j,f=e.w,p=new Nn(this.barCtx.ctx);(s=Array.isArray(s)?s[u]:s)||(s=0);var m=n,g=r;null!==(t=f.config.series[u].data[h])&&void 0!==t&&t.barHeightOffset&&(m=n-f.config.series[u].data[h].barHeightOffset/2,g=r+f.config.series[u].data[h].barHeightOffset);var v=s/2,b=m+v,y=m+g-v,x=(l[d][h]>=0?1:-1)*(o?-1:1);i+=.001+v*x,a+=.001-v*x;var w=p.move(i,b),A=p.move(i,b);f.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(u,h,!1));var k=p.line(i,y);if(w=w+p.line(a,b)+p.line(a,y)+k+("around"===f.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[u][h]?" Z":" z"),A=A+p.line(i,b)+k+k+k+k+k+p.line(i,b)+("around"===f.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[u][h]?" Z":" z"),"none"!==this.arrBorderRadius[u][h]&&(w=p.roundPathCorners(w,f.config.plotOptions.bar.borderRadius)),f.config.chart.stacked){var S=this.barCtx;(S=this.barCtx[c]).xArrj.push(a+v*x),S.xArrjF.push(Math.abs(i-a-s*x)),S.xArrjVal.push(this.barCtx.series[d][h])}return{pathTo:w,pathFrom:A}}},{key:"checkZeroSeries",value:function(e){for(var t=e.series,n=this.w,r=0;r2&&void 0!==arguments[2]&&!arguments[2]?null:t;return null!=e&&(n=t+e/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?e/this.barCtx.invertedYRatio:0)),n}},{key:"getYForValue",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?null:t;return null!=e&&(r=t-e/this.barCtx.yRatio[n]+2*(this.barCtx.isReversed?e/this.barCtx.yRatio[n]:0)),r}},{key:"getGoalValues",value:function(e,t,n,r,i,a){var s=this,o=this.w,l=[],c=function(r,i){var o;l.push((d(o={},e,"x"===e?s.getXForValue(r,t,!1):s.getYForValue(r,n,a,!1)),d(o,"attrs",i),o))};if(o.globals.seriesGoals[r]&&o.globals.seriesGoals[r][i]&&Array.isArray(o.globals.seriesGoals[r][i])&&o.globals.seriesGoals[r][i].forEach((function(e){c(e.value,e)})),this.barCtx.barOptions.isDumbbell&&o.globals.seriesRange.length){var u=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:o.globals.colors,h={strokeHeight:"x"===e?0:o.globals.markers.size[r],strokeWidth:"x"===e?o.globals.markers.size[r]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(u[r])?u[r][0]:u[r]};c(o.globals.seriesRangeStart[r][i],h),c(o.globals.seriesRangeEnd[r][i],g(g({},h),{},{strokeColor:Array.isArray(u[r])?u[r][1]:u[r]}))}return l}},{key:"drawGoalLine",value:function(e){var t=e.barXPosition,n=e.barYPosition,r=e.goalX,i=e.goalY,a=e.barWidth,s=e.barHeight,o=new Nn(this.barCtx.ctx),l=o.group({className:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path","url(#gridRectMarkerMask".concat(this.barCtx.w.globals.cuid,")"));var c=null;return this.barCtx.isHorizontal?Array.isArray(r)&&r.forEach((function(e){if(e.x>=-1&&e.x<=o.w.globals.gridWidth+1){var t=void 0!==e.attrs.strokeHeight?e.attrs.strokeHeight:s/2,r=n+t+s/2;c=o.drawLine(e.x,r-2*t,e.x,r,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeWidth?e.attrs.strokeWidth:2,e.attrs.strokeLineCap),l.add(c)}})):Array.isArray(i)&&i.forEach((function(e){if(e.y>=-1&&e.y<=o.w.globals.gridHeight+1){var n=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,r=t+n+a/2;c=o.drawLine(r-2*n,e.y,r,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),l.add(c)}})),l}},{key:"drawBarShadow",value:function(e){var t=e.prevPaths,n=e.currPaths,r=e.color,i=this.w,a=t.x,s=t.x1,o=t.barYPosition,l=n.x,c=n.x1,u=n.barYPosition,d=o+n.barHeight,h=new Nn(this.barCtx.ctx),f=new k,p=h.move(s,d)+h.line(a,d)+h.line(l,u)+h.line(c,u)+h.line(s,d)+("around"===i.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[realIndex][j]?" Z":" z");return h.drawPath({d:p,fill:f.shadeColor(.5,k.rgb2hex(r)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}},{key:"getZeroValueEncounters",value:function(e){var t,n=e.i,r=e.j,i=this.w,a=0,s=0;return(i.config.plotOptions.bar.horizontal?i.globals.series.map((function(e,t){return t})):(null===(t=i.globals.columnSeries)||void 0===t?void 0:t.i.map((function(e){return e})))||[]).forEach((function(e){var t=i.globals.seriesPercent[e][r];t&&a++,e-1})),r=this.barCtx.columnGroupIndices,i=r.indexOf(n);return i<0&&(r.push(n),i=r.length-1),{groupIndex:n,columnGroupIndex:i}}}]),e}(),Mr=function(){function e(t,n){s(this,e),this.ctx=t,this.w=t.w;var r=this.w;this.barOptions=r.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=r.config.stroke.width,this.isNullValue=!1,this.isRangeBar=r.globals.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!r.globals.isBarHorizontal&&r.globals.seriesRange.length&&r.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=n,null!==this.xyRatios&&(this.xRatio=n.xRatio,this.yRatio=n.yRatio,this.invertedXRatio=n.invertedXRatio,this.invertedYRatio=n.invertedYRatio,this.baseLineY=n.baseLineY,this.baseLineInvertedY=n.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[];var i=new Zn(this.ctx);this.lastActiveBarSerieIndex=i.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];var a=i.getBarSeriesIndices(),o=new Mn(this.ctx);this.stackedSeriesTotals=o.getStackedSeriesTotals(this.w.config.series.map((function(e,t){return-1===a.indexOf(t)?t:-1})).filter((function(e){return-1!==e}))),this.barHelpers=new Nr(this)}return l(e,[{key:"draw",value:function(e,t){var n=this.w,r=new Nn(this.ctx),i=new Mn(this.ctx,n);e=i.getLogSeries(e),this.series=e,this.yRatio=i.getLogYRatios(this.yRatio),this.barHelpers.initVariables(e);var a=r.group({class:"apexcharts-bar-series apexcharts-plot-series"});n.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(var s=0,o=0;s0&&(this.visibleI=this.visibleI+1);var x=0,w=0;this.yRatio.length>1&&(this.yaxisIndex=n.globals.seriesYAxisReverseMap[v],this.translationsIndex=v);var A=this.translationsIndex;this.isReversed=n.config.yaxis[this.yaxisIndex]&&n.config.yaxis[this.yaxisIndex].reversed;var S=this.barHelpers.initialPositions();f=S.y,x=S.barHeight,c=S.yDivision,d=S.zeroW,h=S.x,w=S.barWidth,l=S.xDivision,u=S.zeroH,this.isHorizontal||m.push(h+w/2);var _=r.group({class:"apexcharts-datalabels","data:realIndex":v});n.globals.delayedElements.push({el:_.node}),_.node.classList.add("apexcharts-element-hidden");var C=r.group({class:"apexcharts-bar-goals-markers"}),j=r.group({class:"apexcharts-bar-shadows"});n.globals.delayedElements.push({el:j.node}),j.node.classList.add("apexcharts-element-hidden");for(var E=0;E0){var R=this.barHelpers.drawBarShadow({color:"string"==typeof O&&-1===(null==O?void 0:O.indexOf("url"))?O:k.hexToRgba(n.globals.colors[s]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:M});j.add(R),n.config.chart.dropShadow.enabled&&new En(this.ctx).dropShadow(R,n.config.chart.dropShadow,v)}this.pathArr.push(M);var P=this.barHelpers.drawGoalLine({barXPosition:M.barXPosition,barYPosition:M.barYPosition,goalX:M.goalX,goalY:M.goalY,barHeight:x,barWidth:w});P&&C.add(P),f=M.y,h=M.x,E>0&&m.push(h+w/2),p.push(f),this.renderSeries({realIndex:v,pathFill:O,j:E,i:s,columnGroupIndex:b,pathFrom:M.pathFrom,pathTo:M.pathTo,strokeWidth:N,elSeries:y,x:h,y:f,series:e,barHeight:Math.abs(M.barHeight?M.barHeight:x),barWidth:Math.abs(M.barWidth?M.barWidth:w),elDataLabelsWrap:_,elGoalsMarkers:C,elBarShadows:j,visibleSeries:this.visibleI,type:"bar"})}n.globals.seriesXvalues[v]=m,n.globals.seriesYvalues[v]=p,a.add(y)}return a}},{key:"renderSeries",value:function(e){var t=e.realIndex,n=e.pathFill,r=e.lineFill,i=e.j,a=e.i,s=e.columnGroupIndex,o=e.pathFrom,l=e.pathTo,c=e.strokeWidth,u=e.elSeries,d=e.x,h=e.y,f=e.y1,p=e.y2,m=e.series,g=e.barHeight,v=e.barWidth,b=e.barXPosition,y=e.barYPosition,x=e.elDataLabelsWrap,w=e.elGoalsMarkers,A=e.elBarShadows,k=e.visibleSeries,S=e.type,_=e.classes,C=this.w,j=new Nn(this.ctx);if(!r){var E="function"==typeof C.globals.stroke.colors[t]?function(e){var t,n=C.config.stroke.colors;return Array.isArray(n)&&n.length>0&&((t=n[e])||(t=""),"function"==typeof t)?t({value:C.globals.series[e][i],dataPointIndex:i,w:C}):t}(t):C.globals.stroke.colors[t];r=this.barOptions.distributed?C.globals.stroke.colors[i]:E}C.config.series[a].data[i]&&C.config.series[a].data[i].strokeColor&&(r=C.config.series[a].data[i].strokeColor),this.isNullValue&&(n="none");var N=i/C.config.chart.animations.animateGradually.delay*(C.config.chart.animations.speed/C.globals.dataPoints)/2.4,M=j.renderPaths({i:a,j:i,realIndex:t,pathFrom:o,pathTo:l,stroke:r,strokeWidth:c,strokeLineCap:C.config.stroke.lineCap,fill:n,animationDelay:N,initialSpeed:C.config.chart.animations.speed,dataChangeSpeed:C.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(S,"-area ").concat(_),chartType:S});M.attr("clip-path","url(#gridRectBarMask".concat(C.globals.cuid,")"));var T=C.config.forecastDataPoints;T.count>0&&i>=C.globals.dataPoints-T.count&&(M.node.setAttribute("stroke-dasharray",T.dashArray),M.node.setAttribute("stroke-width",T.strokeWidth),M.node.setAttribute("fill-opacity",T.fillOpacity)),void 0!==f&&void 0!==p&&(M.attr("data-range-y1",f),M.attr("data-range-y2",p)),new En(this.ctx).setSelectionFilter(M,t,i),u.add(M);var O=new Er(this).handleBarDataLabels({x:d,y:h,y1:f,y2:p,i:a,j:i,series:m,realIndex:t,columnGroupIndex:s,barHeight:g,barWidth:v,barXPosition:b,barYPosition:y,renderedPath:M,visibleSeries:k});return null!==O.dataLabels&&x.add(O.dataLabels),O.totalDataLabels&&x.add(O.totalDataLabels),u.add(x),w&&u.add(w),A&&u.add(A),u}},{key:"drawBarPaths",value:function(e){var t,n=e.indexes,r=e.barHeight,i=e.strokeWidth,a=e.zeroW,s=e.x,o=e.y,l=e.yDivision,c=e.elSeries,u=this.w,d=n.i,h=n.j;if(u.globals.isXNumeric)t=(o=(u.globals.seriesX[d][h]-u.globals.minX)/this.invertedXRatio-r)+r*this.visibleI;else if(u.config.plotOptions.bar.hideZeroBarsWhenGrouped){var f=0,p=0;u.globals.seriesPercent.forEach((function(e,t){e[h]&&f++,t0&&(r=this.seriesLen*r/f),t=o+r*this.visibleI,t-=r*p}else t=o+r*this.visibleI;this.isFunnel&&(a-=(this.barHelpers.getXForValue(this.series[d][h],a)-a)/2),s=this.barHelpers.getXForValue(this.series[d][h],a);var m=this.barHelpers.getBarpaths({barYPosition:t,barHeight:r,x1:a,x2:s,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:n.realIndex,i:d,j:h,w:u});return u.globals.isXNumeric||(o+=l),this.barHelpers.barBackground({j:h,i:d,y1:t-r*this.visibleI,y2:r*this.seriesLen,elSeries:c}),{pathTo:m.pathTo,pathFrom:m.pathFrom,x1:a,x:s,y:o,goalX:this.barHelpers.getGoalValues("x",a,null,d,h),barYPosition:t,barHeight:r}}},{key:"drawColumnPaths",value:function(e){var t,n=e.indexes,r=e.x,i=e.y,a=e.xDivision,s=e.barWidth,o=e.zeroH,l=e.strokeWidth,c=e.elSeries,u=this.w,d=n.realIndex,h=n.translationsIndex,f=n.i,p=n.j,m=n.bc;if(u.globals.isXNumeric){var g=this.getBarXForNumericXAxis({x:r,j:p,realIndex:d,barWidth:s});r=g.x,t=g.barXPosition}else if(u.config.plotOptions.bar.hideZeroBarsWhenGrouped){var v=this.barHelpers.getZeroValueEncounters({i:f,j:p}),b=v.nonZeroColumns,y=v.zeroEncounters;b>0&&(s=this.seriesLen*s/b),t=r+s*this.visibleI,t-=s*y}else t=r+s*this.visibleI;i=this.barHelpers.getYForValue(this.series[f][p],o,h);var x=this.barHelpers.getColumnPaths({barXPosition:t,barWidth:s,y1:o,y2:i,strokeWidth:l,isReversed:this.isReversed,series:this.series,realIndex:d,i:f,j:p,w:u});return u.globals.isXNumeric||(r+=a),this.barHelpers.barBackground({bc:m,j:p,i:f,x1:t-l/2-s*this.visibleI,x2:s*this.seriesLen+l/2,elSeries:c}),{pathTo:x.pathTo,pathFrom:x.pathFrom,x:r,y:i,goalY:this.barHelpers.getGoalValues("y",null,o,f,p,h),barXPosition:t,barWidth:s}}},{key:"getBarXForNumericXAxis",value:function(e){var t=e.x,n=e.barWidth,r=e.realIndex,i=e.j,a=this.w,s=r;return a.globals.seriesX[r].length||(s=a.globals.maxValsInArrayIndex),k.isNumber(a.globals.seriesX[s][i])&&(t=(a.globals.seriesX[s][i]-a.globals.minX)/this.xRatio-n*this.seriesLen/2),{barXPosition:t+n*this.visibleI,x:t}}},{key:"getPreviousPath",value:function(e,t){for(var n,r=this.w,i=0;i0&&parseInt(a.realIndex,10)===parseInt(e,10)&&void 0!==r.globals.previousPaths[i].paths[t]&&(n=r.globals.previousPaths[i].paths[t].d)}return n}}]),e}(),Tr=function(){f(t,Mr);var e=u(t);function t(){return s(this,t),e.apply(this,arguments)}return l(t,[{key:"draw",value:function(e,t){var n=this,r=this.w;this.graphics=new Nn(this.ctx),this.bar=new Mr(this.ctx,this.xyRatios);var i=new Mn(this.ctx,r);e=i.getLogSeries(e),this.yRatio=i.getLogYRatios(this.yRatio),this.barHelpers.initVariables(e),"100%"===r.config.chart.stackType&&(e=r.globals.comboCharts?t.map((function(e){return r.globals.seriesPercent[e]})):r.globals.seriesPercent.slice()),this.series=e,this.barHelpers.initializeStackedPrevVars(this);for(var a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),s=0,o=0,l=function(i,l){var c=void 0,u=void 0,d=void 0,h=void 0,f=r.globals.comboCharts?t[i]:i,p=n.barHelpers.getGroupIndex(f),m=p.groupIndex,v=p.columnGroupIndex;n.groupCtx=n[r.globals.seriesGroups[m]];var b=[],y=[],x=0;n.yRatio.length>1&&(n.yaxisIndex=r.globals.seriesYAxisReverseMap[f][0],x=f),n.isReversed=r.config.yaxis[n.yaxisIndex]&&r.config.yaxis[n.yaxisIndex].reversed;var w=n.graphics.group({class:"apexcharts-series",seriesName:k.escapeString(r.globals.seriesNames[f]),rel:i+1,"data:realIndex":f});n.ctx.series.addCollapsedClassToSeries(w,f);var A=n.graphics.group({class:"apexcharts-datalabels","data:realIndex":f}),S=n.graphics.group({class:"apexcharts-bar-goals-markers"}),_=0,C=0,j=n.initialPositions(s,o,c,u,d,h,x);o=j.y,_=j.barHeight,u=j.yDivision,h=j.zeroW,s=j.x,C=j.barWidth,c=j.xDivision,d=j.zeroH,r.globals.barHeight=_,r.globals.barWidth=C,n.barHelpers.initializeStackedXYVars(n),1===n.groupCtx.prevY.length&&n.groupCtx.prevY[0].every((function(e){return isNaN(e)}))&&(n.groupCtx.prevY[0]=n.groupCtx.prevY[0].map((function(){return d})),n.groupCtx.prevYF[0]=n.groupCtx.prevYF[0].map((function(){return 0})));for(var E=0;E0||"top"===n.barHelpers.arrBorderRadius[f][E]&&r.globals.series[f][E]<0)&&(P=I),w=n.renderSeries({realIndex:f,pathFill:R,j:E,i:i,columnGroupIndex:v,pathFrom:T.pathFrom,pathTo:T.pathTo,strokeWidth:N,elSeries:w,x:s,y:o,series:e,barHeight:_,barWidth:C,elDataLabelsWrap:A,elGoalsMarkers:S,type:"bar",visibleSeries:v,classes:P})}r.globals.seriesXvalues[f]=b,r.globals.seriesYvalues[f]=y,n.groupCtx.prevY.push(n.groupCtx.yArrj),n.groupCtx.prevYF.push(n.groupCtx.yArrjF),n.groupCtx.prevYVal.push(n.groupCtx.yArrjVal),n.groupCtx.prevX.push(n.groupCtx.xArrj),n.groupCtx.prevXF.push(n.groupCtx.xArrjF),n.groupCtx.prevXVal.push(n.groupCtx.xArrjVal),a.add(w)},c=0,u=0;c1?l=(n=c.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(d).indexOf("%")?l=parseInt(d,10):l*=parseInt(d,10)/100,i=this.isReversed?this.baseLineY[s]:c.globals.gridHeight-this.baseLineY[s],e=c.globals.padHorizontal+(n-l)/2}var h=c.globals.barGroups.length||1;return{x:e,y:t,yDivision:r,xDivision:n,barHeight:o/h,barWidth:l/h,zeroH:i,zeroW:a}}},{key:"drawStackedBarPaths",value:function(e){for(var t,n=e.indexes,r=e.barHeight,i=e.strokeWidth,a=e.zeroW,s=e.x,o=e.y,l=e.columnGroupIndex,c=e.seriesGroup,u=e.yDivision,d=e.elSeries,h=this.w,f=o+l*r,p=n.i,m=n.j,g=n.realIndex,v=n.translationsIndex,b=0,y=0;y0){var w=a;this.groupCtx.prevXVal[x-1][m]<0?w=this.series[p][m]>=0?this.groupCtx.prevX[x-1][m]+b-2*(this.isReversed?b:0):this.groupCtx.prevX[x-1][m]:this.groupCtx.prevXVal[x-1][m]>=0&&(w=this.series[p][m]>=0?this.groupCtx.prevX[x-1][m]:this.groupCtx.prevX[x-1][m]-b+2*(this.isReversed?b:0)),t=w}else t=a;s=null===this.series[p][m]?t:t+this.series[p][m]/this.invertedYRatio-2*(this.isReversed?this.series[p][m]/this.invertedYRatio:0);var A=this.barHelpers.getBarpaths({barYPosition:f,barHeight:r,x1:t,x2:s,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:n.realIndex,seriesGroup:c,i:p,j:m,w:h});return this.barHelpers.barBackground({j:m,i:p,y1:f,y2:r,elSeries:d}),o+=u,{pathTo:A.pathTo,pathFrom:A.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,p,m,v),barXPosition:t,barYPosition:f,x:s,y:o}}},{key:"drawStackedColumnPaths",value:function(e){var t=e.indexes,n=e.x,r=e.y,i=e.xDivision,a=e.barWidth,s=e.zeroH,o=e.columnGroupIndex,l=e.seriesGroup,c=e.elSeries,u=this.w,d=t.i,h=t.j,f=t.bc,p=t.realIndex,m=t.translationsIndex;if(u.globals.isXNumeric){var g=u.globals.seriesX[p][h];g||(g=0),n=(g-u.globals.minX)/this.xRatio-a/2*u.globals.barGroups.length}for(var v,b=n+o*a,y=0,x=0;x0&&!u.globals.isXNumeric||w>0&&u.globals.isXNumeric&&u.globals.seriesX[p-1][h]===u.globals.seriesX[p][h]){var A,k,S,_=Math.min(this.yRatio.length+1,p+1);if(void 0!==this.groupCtx.prevY[w-1]&&this.groupCtx.prevY[w-1].length)for(var C=1;C<_;C++){var j;if(!isNaN(null===(j=this.groupCtx.prevY[w-C])||void 0===j?void 0:j[h])){S=this.groupCtx.prevY[w-C][h];break}}for(var E=1;E<_;E++){var N,M;if((null===(N=this.groupCtx.prevYVal[w-E])||void 0===N?void 0:N[h])<0){k=this.series[d][h]>=0?S-y+2*(this.isReversed?y:0):S;break}if((null===(M=this.groupCtx.prevYVal[w-E])||void 0===M?void 0:M[h])>=0){k=this.series[d][h]>=0?S:S+y-2*(this.isReversed?y:0);break}}void 0===k&&(k=u.globals.gridHeight),v=null!==(A=this.groupCtx.prevYF[0])&&void 0!==A&&A.every((function(e){return 0===e}))&&this.groupCtx.prevYF.slice(1,w).every((function(e){return e.every((function(e){return isNaN(e)}))}))?s:k}else v=s;r=this.series[d][h]?v-this.series[d][h]/this.yRatio[m]+2*(this.isReversed?this.series[d][h]/this.yRatio[m]:0):v;var T=this.barHelpers.getColumnPaths({barXPosition:b,barWidth:a,y1:v,y2:r,yRatio:this.yRatio[m],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:l,realIndex:t.realIndex,i:d,j:h,w:u});return this.barHelpers.barBackground({bc:f,j:h,i:d,x1:b,x2:a,elSeries:c}),{pathTo:T.pathTo,pathFrom:T.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,s,d,h),barXPosition:b,x:u.globals.isXNumeric?n:n+i,y:r}}}]),t}(),Or=function(){f(t,Mr);var e=u(t);function t(){return s(this,t),e.apply(this,arguments)}return l(t,[{key:"draw",value:function(e,t,n){var r=this,i=this.w,a=new Nn(this.ctx),s=i.globals.comboCharts?t:i.config.chart.type,o=new qn(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal;var l=new Mn(this.ctx,i);e=l.getLogSeries(e),this.series=e,this.yRatio=l.getLogYRatios(this.yRatio),this.barHelpers.initVariables(e);for(var c=a.group({class:"apexcharts-".concat(s,"-series apexcharts-plot-series")}),u=function(t){r.isBoxPlot="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[t].type;var s,l,u,d,h=void 0,f=void 0,p=[],m=[],v=i.globals.comboCharts?n[t]:t,b=r.barHelpers.getGroupIndex(v).columnGroupIndex,y=a.group({class:"apexcharts-series",seriesName:k.escapeString(i.globals.seriesNames[v]),rel:t+1,"data:realIndex":v});r.ctx.series.addCollapsedClassToSeries(y,v),e[t].length>0&&(r.visibleI=r.visibleI+1);var x,w,A=0;r.yRatio.length>1&&(r.yaxisIndex=i.globals.seriesYAxisReverseMap[v][0],A=v);var S=r.barHelpers.initialPositions();f=S.y,x=S.barHeight,l=S.yDivision,d=S.zeroW,h=S.x,w=S.barWidth,s=S.xDivision,u=S.zeroH,m.push(h+w/2);for(var _=a.group({class:"apexcharts-datalabels","data:realIndex":v}),C=a.group({class:"apexcharts-bar-goals-markers"}),j=function(n){var a=r.barHelpers.getStrokeWidth(t,n,v),c=null,k={indexes:{i:t,j:n,realIndex:v,translationsIndex:A},x:h,y:f,strokeWidth:a,elSeries:y};c=r.isHorizontal?r.drawHorizontalBoxPaths(g(g({},k),{},{yDivision:l,barHeight:x,zeroW:d})):r.drawVerticalBoxPaths(g(g({},k),{},{xDivision:s,barWidth:w,zeroH:u})),f=c.y,h=c.x;var S=r.barHelpers.drawGoalLine({barXPosition:c.barXPosition,barYPosition:c.barYPosition,goalX:c.goalX,goalY:c.goalY,barHeight:x,barWidth:w});S&&C.add(S),n>0&&m.push(h+w/2),p.push(f),c.pathTo.forEach((function(s,l){var u=!r.isBoxPlot&&r.candlestickOptions.wick.useFillColor?c.color[l]:i.globals.stroke.colors[t],d=o.fillPath({seriesNumber:v,dataPointIndex:n,color:c.color[l],value:e[t][n]});r.renderSeries({realIndex:v,pathFill:d,lineFill:u,j:n,i:t,pathFrom:c.pathFrom,pathTo:s,strokeWidth:a,elSeries:y,x:h,y:f,series:e,columnGroupIndex:b,barHeight:x,barWidth:w,elDataLabelsWrap:_,elGoalsMarkers:C,visibleSeries:r.visibleI,type:i.config.chart.type})}))},E=0;E0&&(j=this.getPreviousPath(f,u,!0)),C=this.isBoxPlot?[l.move(_,A)+l.line(_+i/2,A)+l.line(_+i/2,y)+l.line(_+i/4,y)+l.line(_+i-i/4,y)+l.line(_+i/2,y)+l.line(_+i/2,A)+l.line(_+i,A)+l.line(_+i,S)+l.line(_,S)+l.line(_,A+s/2),l.move(_,S)+l.line(_+i,S)+l.line(_+i,k)+l.line(_+i/2,k)+l.line(_+i/2,x)+l.line(_+i-i/4,x)+l.line(_+i/4,x)+l.line(_+i/2,x)+l.line(_+i/2,k)+l.line(_,k)+l.line(_,S)+"z"]:[l.move(_,k)+l.line(_+i/2,k)+l.line(_+i/2,y)+l.line(_+i/2,k)+l.line(_+i,k)+l.line(_+i,A)+l.line(_+i/2,A)+l.line(_+i/2,x)+l.line(_+i/2,A)+l.line(_,A)+l.line(_,k-s/2)],j+=l.move(_,A),o.globals.isXNumeric||(n+=r),{pathTo:C,pathFrom:j,x:n,y:k,goalY:this.barHelpers.getGoalValues("y",null,a,c,u,t.translationsIndex),barXPosition:_,color:w}}},{key:"drawHorizontalBoxPaths",value:function(e){var t=e.indexes;e.x;var n=e.y,r=e.yDivision,i=e.barHeight,a=e.zeroW,s=e.strokeWidth,o=this.w,l=new Nn(this.ctx),c=t.i,u=t.j,d=this.boxOptions.colors.lower;this.isBoxPlot&&(d=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var h=this.invertedYRatio,f=t.realIndex,p=this.getOHLCValue(f,u),m=a,g=a,v=Math.min(p.o,p.c),b=Math.max(p.o,p.c),y=p.m;o.globals.isXNumeric&&(n=(o.globals.seriesX[f][u]-o.globals.minX)/this.invertedXRatio-i/2);var x=n+i*this.visibleI;void 0===this.series[c][u]||null===this.series[c][u]?(v=a,b=a):(v=a+v/h,b=a+b/h,m=a+p.h/h,g=a+p.l/h,y=a+p.m/h);var w=l.move(a,x),A=l.move(v,x+i/2);return o.globals.previousPaths.length>0&&(A=this.getPreviousPath(f,u,!0)),w=[l.move(v,x)+l.line(v,x+i/2)+l.line(m,x+i/2)+l.line(m,x+i/2-i/4)+l.line(m,x+i/2+i/4)+l.line(m,x+i/2)+l.line(v,x+i/2)+l.line(v,x+i)+l.line(y,x+i)+l.line(y,x)+l.line(v+s/2,x),l.move(y,x)+l.line(y,x+i)+l.line(b,x+i)+l.line(b,x+i/2)+l.line(g,x+i/2)+l.line(g,x+i-i/4)+l.line(g,x+i/4)+l.line(g,x+i/2)+l.line(b,x+i/2)+l.line(b,x)+l.line(y,x)+"z"],A+=l.move(v,x),o.globals.isXNumeric||(n+=r),{pathTo:w,pathFrom:A,x:b,y:n,goalX:this.barHelpers.getGoalValues("x",a,null,c,u),barYPosition:x,color:d}}},{key:"getOHLCValue",value:function(e,t){var n=this.w,r=new Mn(this.ctx,n),i=r.getLogValAtSeriesIndex(n.globals.seriesCandleH[e][t],e),a=r.getLogValAtSeriesIndex(n.globals.seriesCandleO[e][t],e),s=r.getLogValAtSeriesIndex(n.globals.seriesCandleM[e][t],e),o=r.getLogValAtSeriesIndex(n.globals.seriesCandleC[e][t],e),l=r.getLogValAtSeriesIndex(n.globals.seriesCandleL[e][t],e);return{o:this.isBoxPlot?i:a,h:this.isBoxPlot?a:i,m:s,l:this.isBoxPlot?o:l,c:this.isBoxPlot?l:o}}}]),t}(),Rr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"checkColorRange",value:function(){var e=this.w,t=!1,n=e.config.plotOptions[e.config.chart.type];return n.colorScale.ranges.length>0&&n.colorScale.ranges.map((function(e,n){e.from<=0&&(t=!0)})),t}},{key:"getShadeColor",value:function(e,t,n,r){var i=this.w,a=1,s=i.config.plotOptions[e].shadeIntensity,o=this.determineColor(e,t,n);i.globals.hasNegs||r?a=i.config.plotOptions[e].reverseNegativeShade?o.percent<0?o.percent/100*(1.25*s):(1-o.percent/100)*(1.25*s):o.percent<=0?1-(1+o.percent/100)*s:(1-o.percent/100)*s:(a=1-o.percent/100,"treemap"===e&&(a=(1-o.percent/100)*(1.25*s)));var l=o.color,c=new k;if(i.config.plotOptions[e].enableShades)if("dark"===this.w.config.theme.mode){var u=c.shadeColor(-1*a,o.color);l=k.hexToRgba(k.isColorHex(u)?u:k.rgb2hex(u),i.config.fill.opacity)}else{var d=c.shadeColor(a,o.color);l=k.hexToRgba(k.isColorHex(d)?d:k.rgb2hex(d),i.config.fill.opacity)}return{color:l,colorProps:o}}},{key:"determineColor",value:function(e,t,n){var r=this.w,i=r.globals.series[t][n],a=r.config.plotOptions[e],s=a.colorScale.inverse?n:t;a.distributed&&"treemap"===r.config.chart.type&&(s=n);var o=r.globals.colors[s],l=null,c=Math.min.apply(Math,y(r.globals.series[t])),u=Math.max.apply(Math,y(r.globals.series[t]));a.distributed||"heatmap"!==e||(c=r.globals.minY,u=r.globals.maxY),void 0!==a.colorScale.min&&(c=a.colorScale.minr.globals.maxY?a.colorScale.max:r.globals.maxY);var d=Math.abs(u)+Math.abs(c),h=100*i/(0===d?d-1e-6:d);return a.colorScale.ranges.length>0&&a.colorScale.ranges.map((function(e,t){if(i>=e.from&&i<=e.to){o=e.color,l=e.foreColor?e.foreColor:null,c=e.from,u=e.to;var n=Math.abs(u)+Math.abs(c);h=100*i/(0===n?n-1e-6:n)}})),{color:o,foreColor:l,percent:h}}},{key:"calculateDataLabels",value:function(e){var t=e.text,n=e.x,r=e.y,i=e.i,a=e.j,s=e.colorProps,o=e.fontSize,l=this.w.config.dataLabels,c=new Nn(this.ctx),u=new Kn(this.ctx),d=null;if(l.enabled){d=c.group({class:"apexcharts-data-labels"});var h=l.offsetX,f=l.offsetY,p=n+h,m=r+parseFloat(l.style.fontSize)/3+f;u.plotDataLabelsText({x:p,y:m,text:t,i:i,j:a,color:s.foreColor,parent:d,fontSize:o,dataLabelsConfig:l})}return d}},{key:"addListeners",value:function(e){var t=new Nn(this.ctx);e.node.addEventListener("mouseenter",t.pathMouseEnter.bind(this,e)),e.node.addEventListener("mouseleave",t.pathMouseLeave.bind(this,e)),e.node.addEventListener("mousedown",t.pathMouseDown.bind(this,e))}}]),e}(),Pr=function(){function e(t,n){s(this,e),this.ctx=t,this.w=t.w,this.xRatio=n.xRatio,this.yRatio=n.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new Rr(t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}return l(e,[{key:"draw",value:function(e){var t=this.w,n=new Nn(this.ctx),r=n.group({class:"apexcharts-heatmap"});r.attr("clip-path","url(#gridRectMask".concat(t.globals.cuid,")"));var i=t.globals.gridWidth/t.globals.dataPoints,a=t.globals.gridHeight/t.globals.series.length,s=0,o=!1;this.negRange=this.helpers.checkColorRange();var l=e.slice();t.config.yaxis[0].reversed&&(o=!0,l.reverse());for(var c=o?0:l.length-1;o?c=0;o?c++:c--){var u=n.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:k.escapeString(t.globals.seriesNames[c]),rel:c+1,"data:realIndex":c});if(this.ctx.series.addCollapsedClassToSeries(u,c),t.config.chart.dropShadow.enabled){var d=t.config.chart.dropShadow;new En(this.ctx).dropShadow(u,d,c)}for(var h=0,f=t.config.plotOptions.heatmap.shadeIntensity,p=0,m=0;m=l[c].length)break;var g=this.helpers.getShadeColor(t.config.chart.type,c,p,this.negRange),v=g.color,b=g.colorProps;"image"===t.config.fill.type&&(v=new qn(this.ctx).fillPath({seriesNumber:c,dataPointIndex:p,opacity:t.globals.hasNegs?b.percent<0?1-(1+b.percent/100):f+b.percent/100:b.percent/100,patternID:k.randomId(),width:t.config.fill.image.width?t.config.fill.image.width:i,height:t.config.fill.image.height?t.config.fill.image.height:a}));var y=this.rectRadius,x=n.drawRect(h,s,i,a,y);if(x.attr({cx:h,cy:s}),x.node.classList.add("apexcharts-heatmap-rect"),u.add(x),x.attr({fill:v,i:c,index:c,j:p,val:e[c][p],"stroke-width":this.strokeWidth,stroke:t.config.plotOptions.heatmap.useFillColorAsStroke?v:t.globals.stroke.colors[0],color:v}),this.helpers.addListeners(x),t.config.chart.animations.enabled&&!t.globals.dataChanged){var w=1;t.globals.resized||(w=t.config.chart.animations.speed),this.animateHeatMap(x,h,s,i,a,w)}if(t.globals.dataChanged){var A=1;if(this.dynamicAnim.enabled&&t.globals.shouldAnimate){A=this.dynamicAnim.speed;var S=t.globals.previousPaths[c]&&t.globals.previousPaths[c][p]&&t.globals.previousPaths[c][p].color;S||(S="rgba(255, 255, 255, 0)"),this.animateHeatColor(x,k.isColorHex(S)?S:k.rgb2hex(S),k.isColorHex(v)?v:k.rgb2hex(v),A)}}var _=(0,t.config.dataLabels.formatter)(t.globals.series[c][p],{value:t.globals.series[c][p],seriesIndex:c,dataPointIndex:p,w:t}),C=this.helpers.calculateDataLabels({text:_,x:h+i/2,y:s+a/2,i:c,j:p,colorProps:b,series:l});null!==C&&u.add(C),h+=i,p++}s+=a,r.add(u)}var j=t.globals.yAxisScale[0].result.slice();return t.config.yaxis[0].reversed?j.unshift(""):j.push(""),t.globals.yAxisScale[0].result=j,r}},{key:"animateHeatMap",value:function(e,t,n,r,i,a){var s=new S(this.ctx);s.animateRect(e,{x:t+r/2,y:n+i/2,width:0,height:0},{x:t,y:n,width:r,height:i},a,(function(){s.animationCompleted(e)}))}},{key:"animateHeatColor",value:function(e,t,n,r){e.attr({fill:t}).animate(r).attr({fill:n})}}]),e}(),Ir=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"drawYAxisTexts",value:function(e,t,n,r){var i=this.w,a=i.config.yaxis[0],s=i.globals.yLabelFormatters[0];return new Nn(this.ctx).drawText({x:e+a.labels.offsetX,y:t+a.labels.offsetY,text:s(r,n),textAnchor:"middle",fontSize:a.labels.style.fontSize,fontFamily:a.labels.style.fontFamily,foreColor:Array.isArray(a.labels.style.colors)?a.labels.style.colors[n]:a.labels.style.colors})}}]),e}(),Dr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w;var n=this.w;this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==n.globals.stroke.colors?n.globals.stroke.colors:n.globals.colors,this.defaultSize=Math.min(n.globals.gridWidth,n.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=n.globals.gridWidth/2,"radialBar"===n.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(n.config.plotOptions.pie.endAngle-n.config.plotOptions.pie.startAngle),this.initialAngle=n.config.plotOptions.pie.startAngle%this.fullAngle,n.globals.radialSize=this.defaultSize/2.05-n.config.stroke.width-(n.config.chart.sparkline.enabled?0:n.config.chart.dropShadow.blur),this.donutSize=n.globals.radialSize*parseInt(n.config.plotOptions.pie.donut.size,10)/100;var r=n.config.plotOptions.pie.customScale,i=n.globals.gridWidth/2,a=n.globals.gridHeight/2;this.translateX=i-i*r,this.translateY=a-a*r,this.dataLabelsGroup=new Nn(this.ctx).group({class:"apexcharts-datalabels-group",transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(r,")")}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}return l(e,[{key:"draw",value:function(e){var t=this,n=this.w,r=new Nn(this.ctx),i=r.group({class:"apexcharts-pie"});if(n.globals.noData)return i;for(var a=0,s=0;s-1&&this.pieClicked(d),n.config.dataLabels.enabled){var x=b.x,w=b.y,A=100*f/this.fullAngle+"%";if(0!==f&&n.config.plotOptions.pie.dataLabels.minAngleToShowLabelthis.fullAngle?t.endAngle=t.endAngle-(r+s):r+s=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(c=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(c)>this.fullAngle&&(c-=this.fullAngle);var u=Math.PI*(c-90)/180,d=n.centerX+a*Math.cos(l),h=n.centerY+a*Math.sin(l),f=n.centerX+a*Math.cos(u),p=n.centerY+a*Math.sin(u),m=k.polarToCartesian(n.centerX,n.centerY,n.donutSize,c),g=k.polarToCartesian(n.centerX,n.centerY,n.donutSize,o),v=i>180?1:0,b=["M",d,h,"A",a,a,0,v,1,f,p];return t="donut"===n.chartType?[].concat(b,["L",m.x,m.y,"A",n.donutSize,n.donutSize,0,v,0,g.x,g.y,"L",d,h,"z"]).join(" "):"pie"===n.chartType||"polarArea"===n.chartType?[].concat(b,["L",n.centerX,n.centerY,"L",d,h]).join(" "):[].concat(b).join(" "),s.roundPathCorners(t,2*this.strokeWidth)}},{key:"drawPolarElements",value:function(e){var t=this.w,n=new nr(this.ctx),r=new Nn(this.ctx),i=new Ir(this.ctx),a=r.group(),s=r.group(),o=n.niceScale(0,Math.ceil(this.maxY),0),l=o.result.reverse(),c=o.result.length;this.maxY=o.niceMax;for(var u=t.globals.radialSize,d=u/(c-1),h=0;h1&&e.total.show&&(i=e.total.color);var s=a.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),o=a.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");n=(0,e.value.formatter)(n,a),r||"function"!=typeof e.total.formatter||(n=e.total.formatter(a));var l=t===e.total.label;t=this.donutDataLabels.total.label?e.name.formatter(t,l,a):"",null!==s&&(s.textContent=t),null!==o&&(o.textContent=n),null!==s&&(s.style.fill=i)}},{key:"printDataLabelsInner",value:function(e,t){var n=this.w,r=e.getAttribute("data:value"),i=n.globals.seriesNames[parseInt(e.parentNode.getAttribute("rel"),10)-1];n.globals.series.length>1&&this.printInnerLabels(t,i,r,e);var a=n.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");null!==a&&(a.style.opacity=1)}},{key:"drawSpokes",value:function(e){var t=this,n=this.w,r=new Nn(this.ctx),i=n.config.plotOptions.polarArea.spokes;if(0!==i.strokeWidth){for(var a=[],s=360/n.globals.series.length,o=0;o0&&(p=t.getPreviousPath(s));for(var m=0;m=10?e.x>0?(n="start",r+=10):e.x<0&&(n="end",r-=10):n="middle",Math.abs(e.y)>=t-10&&(e.y<0?i-=10:e.y>0&&(i+=10)),{textAnchor:n,newX:r,newY:i}}},{key:"getPreviousPath",value:function(e){for(var t=this.w,n=null,r=0;r0&&parseInt(i.realIndex,10)===parseInt(e,10)&&void 0!==t.globals.previousPaths[r].paths[0]&&(n=t.globals.previousPaths[r].paths[0].d)}return n}},{key:"getDataPointsPos",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dataPointsLen;e=e||[],t=t||[];for(var r=[],i=0;i=360&&(h=360-Math.abs(this.startAngle)-.1);var f=n.drawPath({d:"",stroke:u,strokeWidth:s*parseInt(c.strokeWidth,10)/100,fill:"none",strokeOpacity:c.opacity,classes:"apexcharts-radialbar-area"});if(c.dropShadow.enabled){var p=c.dropShadow;i.dropShadow(f,p)}l.add(f),f.attr("id","apexcharts-radialbarTrack-"+o),this.animatePaths(f,{centerX:e.centerX,centerY:e.centerY,endAngle:h,startAngle:d,size:e.size,i:o,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return r}},{key:"drawArcs",value:function(e){var t=this.w,n=new Nn(this.ctx),r=new qn(this.ctx),i=new En(this.ctx),a=n.group(),s=this.getStrokeWidth(e);e.size=e.size-s/2;var o=t.config.plotOptions.radialBar.hollow.background,l=e.size-s*e.series.length-this.margin*e.series.length-s*parseInt(t.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,c=l-t.config.plotOptions.radialBar.hollow.margin;void 0!==t.config.plotOptions.radialBar.hollow.image&&(o=this.drawHollowImage(e,a,l,o));var u=this.drawHollow({size:c,centerX:e.centerX,centerY:e.centerY,fill:o||"transparent"});if(t.config.plotOptions.radialBar.hollow.dropShadow.enabled){var d=t.config.plotOptions.radialBar.hollow.dropShadow;i.dropShadow(u,d)}var h=1;!this.radialDataLabels.total.show&&t.globals.series.length>1&&(h=0);var f=null;if(this.radialDataLabels.show){var p=t.globals.dom.Paper.findOne(".apexcharts-datalabels-group");f=this.renderInnerDataLabels(p,this.radialDataLabels,{hollowSize:l,centerX:e.centerX,centerY:e.centerY,opacity:h})}"back"===t.config.plotOptions.radialBar.hollow.position&&(a.add(u),f&&a.add(f));var m=!1;t.config.plotOptions.radialBar.inverseOrder&&(m=!0);for(var g=m?e.series.length-1:0;m?g>=0:g100?100:e.series[g])/100,A=Math.round(this.totalAngle*w)+this.startAngle,S=void 0;t.globals.dataChanged&&(x=this.startAngle,S=Math.round(this.totalAngle*k.negToZero(t.globals.previousPaths[g])/100)+x),Math.abs(A)+Math.abs(y)>360&&(A-=.01),Math.abs(S)+Math.abs(x)>360&&(S-=.01);var _=A-y,C=Array.isArray(t.config.stroke.dashArray)?t.config.stroke.dashArray[g]:t.config.stroke.dashArray,j=n.drawPath({d:"",stroke:b,strokeWidth:s,fill:"none",fillOpacity:t.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+g,strokeDashArray:C});if(Nn.setAttrs(j.node,{"data:angle":_,"data:value":e.series[g]}),t.config.chart.dropShadow.enabled){var E=t.config.chart.dropShadow;i.dropShadow(j,E,g)}if(i.setSelectionFilter(j,0,g),this.addListeners(j,this.radialDataLabels),v.add(j),j.attr({index:0,j:g}),this.barLabels.enabled){var N=k.polarToCartesian(e.centerX,e.centerY,e.size,y),M=this.barLabels.formatter(t.globals.seriesNames[g],{seriesIndex:g,w:t}),T=["apexcharts-radialbar-label"];this.barLabels.onClick||T.push("apexcharts-no-click");var O=this.barLabels.useSeriesColors?t.globals.colors[g]:t.config.chart.foreColor;O||(O=t.config.chart.foreColor);var R=N.x+this.barLabels.offsetX,P=N.y+this.barLabels.offsetY,I=n.drawText({x:R,y:P,text:M,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:O,cssClass:T.join(" ")});I.on("click",this.onBarLabelClick),I.attr({rel:g+1}),0!==y&&I.attr({"transform-origin":"".concat(R," ").concat(P),transform:"rotate(".concat(y," 0 0)")}),v.add(I)}var D=0;!this.initialAnim||t.globals.resized||t.globals.dataChanged||(D=t.config.chart.animations.speed),t.globals.dataChanged&&(D=t.config.chart.animations.dynamicAnimation.speed),this.animDur=D/(1.2*e.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(j,{centerX:e.centerX,centerY:e.centerY,endAngle:A,startAngle:y,prevEndAngle:S,prevStartAngle:x,size:e.size,i:g,totalItems:2,animBeginArr:this.animBeginArr,dur:D,shouldSetPrevPaths:!0})}return{g:a,elHollow:u,dataLabels:f}}},{key:"drawHollow",value:function(e){var t=new Nn(this.ctx).drawCircle(2*e.size);return t.attr({class:"apexcharts-radialbar-hollow",cx:e.centerX,cy:e.centerY,r:e.size,fill:e.fill}),t}},{key:"drawHollowImage",value:function(e,t,n,r){var i=this.w,a=new qn(this.ctx),s=k.randomId(),o=i.config.plotOptions.radialBar.hollow.image;if(i.config.plotOptions.radialBar.hollow.imageClipped)a.clippedImgArea({width:n,height:n,image:o,patternID:"pattern".concat(i.globals.cuid).concat(s)}),r="url(#pattern".concat(i.globals.cuid).concat(s,")");else{var l=i.config.plotOptions.radialBar.hollow.imageWidth,c=i.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===l&&void 0===c){var u=i.globals.dom.Paper.image(o,(function(t){this.move(e.centerX-t.width/2+i.config.plotOptions.radialBar.hollow.imageOffsetX,e.centerY-t.height/2+i.config.plotOptions.radialBar.hollow.imageOffsetY)}));t.add(u)}else{var d=i.globals.dom.Paper.image(o,(function(t){this.move(e.centerX-l/2+i.config.plotOptions.radialBar.hollow.imageOffsetX,e.centerY-c/2+i.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(l,c)}));t.add(d)}}return r}},{key:"getStrokeWidth",value:function(e){var t=this.w;return e.size*(100-parseInt(t.config.plotOptions.radialBar.hollow.size,10))/100/(e.series.length+1)-this.margin}},{key:"onBarLabelClick",value:function(e){var t=parseInt(e.target.getAttribute("rel"),10)-1,n=this.barLabels.onClick,r=this.w;n&&n(r.globals.seriesNames[t],{w:r,seriesIndex:t})}}]),t}(),Br=function(){f(t,Mr);var e=u(t);function t(){return s(this,t),e.apply(this,arguments)}return l(t,[{key:"draw",value:function(e,t){var n=this.w,r=new Nn(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=e,this.seriesRangeStart=n.globals.seriesRangeStart,this.seriesRangeEnd=n.globals.seriesRangeEnd,this.barHelpers.initVariables(e);for(var i=r.group({class:"apexcharts-rangebar-series apexcharts-plot-series"}),a=0;a0&&(this.visibleI=this.visibleI+1);var m=0,v=0,b=0;this.yRatio.length>1&&(this.yaxisIndex=n.globals.seriesYAxisReverseMap[h][0],b=h);var y=this.barHelpers.initialPositions();d=y.y,c=y.zeroW,u=y.x,v=y.barWidth,m=y.barHeight,s=y.xDivision,o=y.yDivision,l=y.zeroH;for(var x=r.group({class:"apexcharts-datalabels","data:realIndex":h}),w=r.group({class:"apexcharts-rangebar-goals-markers"}),A=0;A0}));return this.isHorizontal?(r=h.config.plotOptions.bar.rangeBarGroupRows?a+c*v:a+o*this.visibleI+c*v,b>-1&&!h.config.plotOptions.bar.rangeBarOverlap&&(f=h.globals.seriesRange[t][b].overlaps).indexOf(p)>-1&&(r=(o=d.barHeight/f.length)*this.visibleI+c*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+f.indexOf(p))+c*v)):(v>-1&&!h.globals.timescaleLabels.length&&(i=h.config.plotOptions.bar.rangeBarGroupRows?s+u*v:s+l*this.visibleI+u*v),b>-1&&!h.config.plotOptions.bar.rangeBarOverlap&&(f=h.globals.seriesRange[t][b].overlaps).indexOf(p)>-1&&(i=(l=d.barWidth/f.length)*this.visibleI+u*(100-parseInt(this.barOptions.barWidth,10))/100/2+l*(this.visibleI+f.indexOf(p))+u*v)),{barYPosition:r,barXPosition:i,barHeight:o,barWidth:l}}},{key:"drawRangeColumnPaths",value:function(e){var t=e.indexes,n=e.x,r=e.xDivision,i=e.barWidth,a=e.barXPosition,s=e.zeroH,o=this.w,l=t.i,c=t.j,u=t.realIndex,d=t.translationsIndex,h=this.yRatio[d],f=this.getRangeValue(u,c),p=Math.min(f.start,f.end),m=Math.max(f.start,f.end);void 0===this.series[l][c]||null===this.series[l][c]?p=s:(p=s-p/h,m=s-m/h);var g=Math.abs(m-p),v=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:i,y1:p,y2:m,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:u,i:u,j:c,w:o});if(o.globals.isXNumeric){var b=this.getBarXForNumericXAxis({x:n,j:c,realIndex:u,barWidth:i});n=b.x,a=b.barXPosition}else n+=r;return{pathTo:v.pathTo,pathFrom:v.pathFrom,barHeight:g,x:n,y:f.start<0&&f.end<0?p:m,goalY:this.barHelpers.getGoalValues("y",null,s,l,c,d),barXPosition:a}}},{key:"preventBarOverflow",value:function(e){var t=this.w;return e<0&&(e=0),e>t.globals.gridWidth&&(e=t.globals.gridWidth),e}},{key:"drawRangeBarPaths",value:function(e){var t=e.indexes,n=e.y,r=e.y1,i=e.y2,a=e.yDivision,s=e.barHeight,o=e.barYPosition,l=e.zeroW,c=this.w,u=t.realIndex,d=t.j,h=this.preventBarOverflow(l+r/this.invertedYRatio),f=this.preventBarOverflow(l+i/this.invertedYRatio),p=this.getRangeValue(u,d),m=Math.abs(f-h),g=this.barHelpers.getBarpaths({barYPosition:o,barHeight:s,x1:h,x2:f,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:u,realIndex:u,j:d,w:c});return c.globals.isXNumeric||(n+=a),{pathTo:g.pathTo,pathFrom:g.pathFrom,barWidth:m,x:p.start<0&&p.end<0?h:f,goalX:this.barHelpers.getGoalValues("x",l,null,u,d),y:n}}},{key:"getRangeValue",value:function(e,t){var n=this.w;return{start:n.globals.seriesRangeStart[e][t],end:n.globals.seriesRangeEnd[e][t]}}}]),t}(),zr=function(){function e(t){s(this,e),this.w=t.w,this.lineCtx=t}return l(e,[{key:"sameValueSeriesFix",value:function(e,t){var n=this.w;if(("gradient"===n.config.fill.type||"gradient"===n.config.fill.type[e])&&new Mn(this.lineCtx.ctx,n).seriesHaveSameValues(e)){var r=t[e].slice();r[r.length-1]=r[r.length-1]+1e-6,t[e]=r}return t}},{key:"calculatePoints",value:function(e){var t=e.series,n=e.realIndex,r=e.x,i=e.y,a=e.i,s=e.j,o=e.prevY,l=this.w,c=[],u=[];if(0===s){var d=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;l.globals.isXNumeric&&(d=(l.globals.seriesX[n][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),c.push(d),u.push(k.isNumber(t[a][0])?o+l.config.markers.offsetY:null),c.push(r+l.config.markers.offsetX),u.push(k.isNumber(t[a][s+1])?i+l.config.markers.offsetY:null)}else c.push(r+l.config.markers.offsetX),u.push(k.isNumber(t[a][s+1])?i+l.config.markers.offsetY:null);return{x:c,y:u}}},{key:"checkPreviousPaths",value:function(e){for(var t=e.pathFromLine,n=e.pathFromArea,r=e.realIndex,i=this.w,a=0;a0&&parseInt(s.realIndex,10)===parseInt(r,10)&&("line"===s.type?(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[a].paths[0].d):"area"===s.type&&(this.lineCtx.appendPathFrom=!1,n=i.globals.previousPaths[a].paths[0].d,i.config.stroke.show&&i.globals.previousPaths[a].paths[1]&&(t=i.globals.previousPaths[a].paths[1].d)))}return{pathFromLine:t,pathFromArea:n}}},{key:"determineFirstPrevY",value:function(e){var t,n,r,i=e.i,a=e.realIndex,s=e.series,o=e.prevY,l=e.lineYPosition,c=e.translationsIndex,u=this.w,d=u.config.chart.stacked&&!u.globals.comboCharts||u.config.chart.stacked&&u.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null===(t=this.w.config.series[a])||void 0===t?void 0:t.type)||"column"===(null===(n=this.w.config.series[a])||void 0===n?void 0:n.type));if(void 0!==(null===(r=s[i])||void 0===r?void 0:r[0]))o=(l=d&&i>0?this.lineCtx.prevSeriesY[i-1][0]:this.lineCtx.zeroY)-s[i][0]/this.lineCtx.yRatio[c]+2*(this.lineCtx.isReversed?s[i][0]/this.lineCtx.yRatio[c]:0);else if(d&&i>0&&void 0===s[i][0])for(var h=i-1;h>=0;h--)if(null!==s[h][0]&&void 0!==s[h][0]){o=l=this.lineCtx.prevSeriesY[h][0];break}return{prevY:o,lineYPosition:l}}}]),e}(),Hr=function(e){var t=function(e){for(var t,n,r,i,a=function(e){for(var t=[],n=e[0],r=e[1],i=t[0]=Ur(n,r),a=1,s=e.length-1;a9&&(i=3*r/Math.sqrt(i),a[l]=i*t,a[l+1]=i*n);for(var c=0;c<=s;c++)i=(e[Math.min(s,c+1)][0]-e[Math.max(0,c-1)][0])/(6*(1+a[c]*a[c])),o.push([i||0,a[c]*i||0]);return o}(e),n=e[1],r=e[0],i=[],a=t[1],s=t[0];i.push(r,[r[0]+s[0],r[1]+s[1],n[0]-a[0],n[1]-a[1],n[0],n[1]]);for(var o=2,l=t.length;o1&&r[1].length<6){var i=r[0].length;r[1]=[2*r[0][i-2]-r[0][i-4],2*r[0][i-1]-r[0][i-3]].concat(r[1])}r[0]=r[0].slice(-2)}return r};function Ur(e,t){return(t[1]-e[1])/(t[0]-e[0])}var Wr=function(){function e(t,n,r){s(this,e),this.ctx=t,this.w=t.w,this.xyRatios=n,this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||r,this.scatter=new Qn(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new zr(this),this.markers=new Gn(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return l(e,[{key:"draw",value:function(e,t,n,r){var i,a=this.w,s=new Nn(this.ctx),o=a.globals.comboCharts?t:a.config.chart.type,l=s.group({class:"apexcharts-".concat(o,"-series apexcharts-plot-series")}),c=new Mn(this.ctx,a);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,e=c.getLogSeries(e),this.yRatio=c.getLogYRatios(this.yRatio),this.prevSeriesY=[];for(var u=[],d=0;d1?h:0;this._initSerieVariables(e,d,h);var p=[],m=[],v=[],b=a.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,h),a.globals.isXNumeric&&a.globals.seriesX.length>0&&(b=(a.globals.seriesX[h][0]-a.globals.minX)/this.xRatio),v.push(b);var y,x=b,w=void 0,A=x,k=this.zeroY,S=this.zeroY;k=this.lineHelpers.determineFirstPrevY({i:d,realIndex:h,series:e,prevY:k,lineYPosition:0,translationsIndex:f}).prevY,"monotoneCubic"===a.config.stroke.curve&&null===e[d][0]?p.push(null):p.push(k),y=k,"rangeArea"===o&&(w=S=this.lineHelpers.determineFirstPrevY({i:d,realIndex:h,series:r,prevY:S,lineYPosition:0,translationsIndex:f}).prevY,m.push(null!==p[0]?S:null));var _=this._calculatePathsFrom({type:o,series:e,i:d,realIndex:h,translationsIndex:f,prevX:A,prevY:k,prevY2:S}),C=[p[0]],j=[m[0]],E={type:o,series:e,realIndex:h,translationsIndex:f,i:d,x:b,y:1,pX:x,pY:y,pathsFrom:_,linePaths:[],areaPaths:[],seriesIndex:n,lineYPosition:0,xArrj:v,yArrj:p,y2Arrj:m,seriesRangeEnd:r},N=this._iterateOverDataPoints(g(g({},E),{},{iterations:"rangeArea"===o?e[d].length-1:void 0,isRangeStart:!0}));if("rangeArea"===o){for(var M=this._calculatePathsFrom({series:r,i:d,realIndex:h,prevX:A,prevY:S}),T=this._iterateOverDataPoints(g(g({},E),{},{series:r,xArrj:[b],yArrj:C,y2Arrj:j,pY:w,areaPaths:N.areaPaths,pathsFrom:M,iterations:r[d].length-1,isRangeStart:!1})),O=N.linePaths.length/2,R=0;R=0;P--)l.add(u[P]);else for(var I=0;I1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[n],a=n),this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.zeroY=r.globals.gridHeight-this.baseLineY[a]-(this.isReversed?r.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[a]:0),this.areaBottomY=this.zeroY,(this.zeroY>r.globals.gridHeight||"end"===r.config.plotOptions.area.fillTo)&&(this.areaBottomY=r.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=i.group({class:"apexcharts-series",zIndex:void 0!==r.config.series[n].zIndex?r.config.series[n].zIndex:n,seriesName:k.escapeString(r.globals.seriesNames[n])}),this.elPointsMain=i.group({class:"apexcharts-series-markers-wrap","data:realIndex":n}),this.elDataLabelsWrap=i.group({class:"apexcharts-datalabels","data:realIndex":n});var s=e[t].length===r.globals.dataPoints;this.elSeries.attr({"data:longestSeries":s,rel:t+1,"data:realIndex":n}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(e){var t,n,r,i,a=e.type,s=e.series,o=e.i,l=e.realIndex,c=e.translationsIndex,u=e.prevX,d=e.prevY,h=e.prevY2,f=this.w,p=new Nn(this.ctx);if(null===s[o][0]){for(var m=0;m0){var g=this.lineHelpers.checkPreviousPaths({pathFromLine:r,pathFromArea:i,realIndex:l});r=g.pathFromLine,i=g.pathFromArea}return{prevX:u,prevY:d,linePath:t,areaPath:n,pathFromLine:r,pathFromArea:i}}},{key:"_handlePaths",value:function(e){var t=e.type,n=e.realIndex,r=e.i,i=e.paths,a=this.w,s=new Nn(this.ctx),o=new qn(this.ctx);this.prevSeriesY.push(i.yArrj),a.globals.seriesXvalues[n]=i.xArrj,a.globals.seriesYvalues[n]=i.yArrj;var l=a.config.forecastDataPoints;if(l.count>0&&"rangeArea"!==t){var c=a.globals.seriesXvalues[n][a.globals.seriesXvalues[n].length-l.count-1],u=s.drawRect(c,0,a.globals.gridWidth,a.globals.gridHeight,0);a.globals.dom.elForecastMask.appendChild(u.node);var d=s.drawRect(0,0,c,a.globals.gridHeight,0);a.globals.dom.elNonForecastMask.appendChild(d.node)}this.pointsChart||a.globals.delayedElements.push({el:this.elPointsMain.node,index:n});var h={i:r,realIndex:n,animationDelay:r,initialSpeed:a.config.chart.animations.speed,dataChangeSpeed:a.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(t)};if("area"===t)for(var f=o.fillPath({seriesNumber:n}),p=0;p0&&"rangeArea"!==t){var k=s.renderPaths(w);k.node.setAttribute("stroke-dasharray",l.dashArray),l.strokeWidth&&k.node.setAttribute("stroke-width",l.strokeWidth),this.elSeries.add(k),k.attr("clip-path","url(#forecastMask".concat(a.globals.cuid,")")),A.attr("clip-path","url(#nonForecastMask".concat(a.globals.cuid,")"))}}}}},{key:"_iterateOverDataPoints",value:function(e){var t,n,r=this,i=e.type,a=e.series,s=e.iterations,o=e.realIndex,l=e.translationsIndex,c=e.i,u=e.x,d=e.y,h=e.pX,f=e.pY,p=e.pathsFrom,m=e.linePaths,g=e.areaPaths,v=e.seriesIndex,b=e.lineYPosition,y=e.xArrj,x=e.yArrj,w=e.y2Arrj,A=e.isRangeStart,S=e.seriesRangeEnd,_=this.w,C=new Nn(this.ctx),j=this.yRatio,E=p.prevY,N=p.linePath,M=p.areaPath,T=p.pathFromLine,O=p.pathFromArea,R=k.isNumber(_.globals.minYArr[o])?_.globals.minYArr[o]:_.globals.minY;s||(s=_.globals.dataPoints>1?_.globals.dataPoints-1:_.globals.dataPoints);var P=function(e,t){return t-e/j[l]+2*(r.isReversed?e/j[l]:0)},I=d,D=_.config.chart.stacked&&!_.globals.comboCharts||_.config.chart.stacked&&_.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null===(t=this.w.config.series[o])||void 0===t?void 0:t.type)||"column"===(null===(n=this.w.config.series[o])||void 0===n?void 0:n.type)),L=_.config.stroke.curve;Array.isArray(L)&&(L=Array.isArray(v)?L[v[c]]:L[c]);for(var F,B=0,z=0;z0&&_.globals.collapsedSeries.length<_.config.series.length-1?this.prevSeriesY[function(e){for(var t=e;t>0;t--){if(!(_.globals.collapsedSeriesIndices.indexOf((null==v?void 0:v[t])||t)>-1))return t;t--}return 0}(c-1)][z+1]:this.zeroY,H?d=P(R,b):(d=P(a[c][z+1],b),"rangeArea"===i&&(I=P(S[c][z+1],b))),y.push(u),!H||"smooth"!==_.config.stroke.curve&&"monotoneCubic"!==_.config.stroke.curve?(x.push(d),w.push(I)):(x.push(null),w.push(null));var U=this.lineHelpers.calculatePoints({series:a,x:u,y:d,realIndex:o,i:c,j:z,prevY:E}),W=this._createPaths({type:i,series:a,i:c,realIndex:o,j:z,x:u,y:d,y2:I,xArrj:y,yArrj:x,y2Arrj:w,pX:h,pY:f,pathState:B,segmentStartX:F,linePath:N,areaPath:M,linePaths:m,areaPaths:g,curve:L,isRangeStart:A});g=W.areaPaths,m=W.linePaths,h=W.pX,f=W.pY,B=W.pathState,F=W.segmentStartX,M=W.areaPath,N=W.linePath,!this.appendPathFrom||_.globals.hasNullValues||"monotoneCubic"===L&&"rangeArea"===i||(T+=C.line(u,this.areaBottomY),O+=C.line(u,this.areaBottomY)),this.handleNullDataPoints(a,U,c,z,o),this._handleMarkersAndLabels({type:i,pointsPos:U,i:c,j:z,realIndex:o,isRangeStart:A})}return{yArrj:x,xArrj:y,pathFromArea:O,areaPaths:g,pathFromLine:T,linePaths:m,linePath:N,areaPath:M}}},{key:"_handleMarkersAndLabels",value:function(e){var t=e.type,n=e.pointsPos,r=e.isRangeStart,i=e.i,a=e.j,s=e.realIndex,o=this.w,l=new Kn(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:s,pointsPos:n,zRatio:this.zRatio,elParent:this.elPointsMain});else{o.globals.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");var c=this.markers.plotChartMarkers(n,s,a+1);null!==c&&this.elPointsMain.add(c)}var u=l.drawDataLabel({type:t,isRangeStart:r,pos:n,i:s,j:a+1});null!==u&&this.elDataLabelsWrap.add(u)}},{key:"_createPaths",value:function(e){var t=e.type,n=e.series,r=e.i;e.realIndex;var i,a=e.j,s=e.x,o=e.y,l=e.xArrj,c=e.yArrj,u=e.y2,d=e.y2Arrj,h=e.pX,f=e.pY,p=e.pathState,m=e.segmentStartX,g=e.linePath,v=e.areaPath,b=e.linePaths,y=e.areaPaths,x=e.curve,w=e.isRangeStart,A=new Nn(this.ctx),k=this.areaBottomY,S="rangeArea"===t,_="rangeArea"===t&&w;switch(x){case"monotoneCubic":var C=w?c:d;switch(p){case 0:if(null===C[a+1])break;p=1;case 1:if(!(S?l.length===n[r].length:a===n[r].length-2))break;case 2:var j=w?l:l.slice().reverse(),E=w?C:C.slice().reverse(),N=(i=E,j.map((function(e,t){return[e,i[t]]})).filter((function(e){return null!==e[1]}))),M=N.length>1?Hr(N):N,T=[];S&&(_?y=N:T=y.reverse());var O=0,R=0;if(function(e,t){for(var n=function(e){var t=[],n=0;return e.forEach((function(e){null!==e?n++:n>0&&(t.push(n),n=0)})),n>0&&t.push(n),t}(e),r=[],i=0,a=0;i4?(t+="C".concat(r[0],", ").concat(r[1]),t+=", ".concat(r[2],", ").concat(r[3]),t+=", ".concat(r[4],", ").concat(r[5])):i>2&&(t+="S".concat(r[0],", ").concat(r[1]),t+=", ".concat(r[2],", ").concat(r[3]))}return t}(e),n=R,r=(R+=e.length)-1;_?g=A.move(N[n][0],N[n][1])+t:S?g=A.move(T[n][0],T[n][1])+A.line(N[n][0],N[n][1])+t+A.line(T[r][0],T[r][1]):(g=A.move(N[n][0],N[n][1])+t,v=g+A.line(N[r][0],k)+A.line(N[n][0],k)+"z",y.push(v)),b.push(g)})),S&&O>1&&!_){var P=b.slice(O).reverse();b.splice(O),P.forEach((function(e){return b.push(e)}))}p=0}break;case"smooth":var I=.35*(s-h);if(null===n[r][a])p=0;else switch(p){case 0:if(m=h,g=_?A.move(h,d[a])+A.line(h,f):A.move(h,f),v=A.move(h,f),null===n[r][a+1]){b.push(g),y.push(v);break}if(p=1,a=n[r].length-2&&(_&&(g+=A.curve(s,o,s,o,s,u)+A.move(s,u)),v+=A.curve(s,o,s,o,s,k)+A.line(m,k)+"z",b.push(g),y.push(v),p=-1)}}h=s,f=o;break;default:var F=function(e,t,n){var r=[];switch(e){case"stepline":r=A.line(t,null,"H")+A.line(null,n,"V");break;case"linestep":r=A.line(null,n,"V")+A.line(t,null,"H");break;case"straight":r=A.line(t,n)}return r};if(null===n[r][a])p=0;else switch(p){case 0:if(m=h,g=_?A.move(h,d[a])+A.line(h,f):A.move(h,f),v=A.move(h,f),null===n[r][a+1]){b.push(g),y.push(v);break}if(p=1,a=n[r].length-2&&(_&&(g+=A.line(s,u)),v+=A.line(s,k)+A.line(m,k)+"z",b.push(g),y.push(v),p=-1)}}h=s,f=o}return{linePaths:b,areaPaths:y,pX:h,pY:f,pathState:p,segmentStartX:m,linePath:g,areaPath:v}}},{key:"handleNullDataPoints",value:function(e,t,n,r,i){var a=this.w;if(null===e[n][r]&&a.config.markers.showNullDataPoints||1===e[n].length){var s=this.strokeWidth-a.config.markers.strokeWidth/2;s>0||(s=0);var o=this.markers.plotChartMarkers(t,i,r+1,s,!0);null!==o&&this.elPointsMain.add(o)}}}]),e}();window.TreemapSquared={},window.TreemapSquared.generate=function(){function e(t,n,r,i){this.xoffset=t,this.yoffset=n,this.height=i,this.width=r,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(e){var t,n=[],r=this.xoffset,i=this.yoffset,s=a(e)/this.height,o=a(e)/this.width;if(this.width>=this.height)for(t=0;t=this.height){var r=t/this.height,i=this.width-r;n=new e(this.xoffset+r,this.yoffset,i,this.height)}else{var a=t/this.width,s=this.height-a;n=new e(this.xoffset,this.yoffset+a,this.width,s)}return n}}function t(t,r,i,s,o){s=void 0===s?0:s,o=void 0===o?0:o;var l=n(function(e,t){var n,r=[],i=t/a(e);for(n=0;n=r(i,n))}(t,l=e[0],o)?(t.push(l),n(e.slice(1),t,i,s)):(c=i.cutArea(a(t),s),s.push(i.getCoordinates(t)),n(e,[],c,s)),s;s.push(i.getCoordinates(t))}function r(e,t){var n=Math.min.apply(Math,e),r=Math.max.apply(Math,e),i=a(e);return Math.max(Math.pow(t,2)*r/Math.pow(i,2),Math.pow(i,2)/(Math.pow(t,2)*n))}function i(e){return e&&e.constructor===Array}function a(e){var t,n=0;for(t=0;ta-r&&l.width<=s-i){var c=o.rotateAroundCenter(e.node);e.node.setAttribute("transform","rotate(-90 ".concat(c.x," ").concat(c.y,") translate(").concat(l.height/3,")"))}}},{key:"truncateLabels",value:function(e,t,n,r,i,a){var s=new Nn(this.ctx),o=s.getTextRects(e,t).width+this.w.config.stroke.width+5>i-n&&a-r>i-n?a-r:i-n,l=s.getTextBasedOnMaxWidth({text:e,maxWidth:o,fontSize:t});return e.length!==l.length&&o/t<5?"":l}},{key:"animateTreemap",value:function(e,t,n,r){var i=new S(this.ctx);i.animateRect(e,{x:t.x,y:t.y,width:t.width,height:t.height},{x:n.x,y:n.y,width:n.width,height:n.height},r,(function(){i.animationCompleted(e)}))}}]),e}(),Vr=10/86400,qr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return l(e,[{key:"calculateTimeScaleTicks",value:function(e,t){var n=this,r=this.w;if(r.globals.allSeriesCollapsed)return r.globals.labels=[],r.globals.timescaleLabels=[],[];var i=new Rn(this.ctx),a=(t-e)/864e5;this.determineInterval(a),r.globals.disableZoomIn=!1,r.globals.disableZoomOut=!1,a5e4&&(r.globals.disableZoomOut=!0);var s=i.getTimeUnitsfromTimestamp(e,t,this.utc),o=r.globals.gridWidth/a,l=o/24,c=l/60,u=c/60,d=Math.floor(24*a),h=Math.floor(1440*a),f=Math.floor(86400*a),p=Math.floor(a),m=Math.floor(a/30),v=Math.floor(a/365),b={minMillisecond:s.minMillisecond,minSecond:s.minSecond,minMinute:s.minMinute,minHour:s.minHour,minDate:s.minDate,minMonth:s.minMonth,minYear:s.minYear},y={firstVal:b,currentMillisecond:b.minMillisecond,currentSecond:b.minSecond,currentMinute:b.minMinute,currentHour:b.minHour,currentMonthDate:b.minDate,currentDate:b.minDate,currentMonth:b.minMonth,currentYear:b.minYear,daysWidthOnXAxis:o,hoursWidthOnXAxis:l,minutesWidthOnXAxis:c,secondsWidthOnXAxis:u,numberOfSeconds:f,numberOfMinutes:h,numberOfHours:d,numberOfDays:p,numberOfMonths:m,numberOfYears:v};switch(this.tickInterval){case"years":this.generateYearScale(y);break;case"months":case"half_year":this.generateMonthScale(y);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(y);break;case"hours":this.generateHourScale(y);break;case"minutes_fives":case"minutes":this.generateMinuteScale(y);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(y)}var x=this.timeScaleArray.map((function(e){var t={position:e.position,unit:e.unit,year:e.year,day:e.day?e.day:1,hour:e.hour?e.hour:0,month:e.month+1};return"month"===e.unit?g(g({},t),{},{day:1,value:e.value+1}):"day"===e.unit||"hour"===e.unit?g(g({},t),{},{value:e.value}):"minute"===e.unit?g(g({},t),{},{value:e.value,minute:e.value}):"second"===e.unit?g(g({},t),{},{value:e.value,minute:e.minute,second:e.second}):e}));return x.filter((function(e){var t=1,i=Math.ceil(r.globals.gridWidth/120),a=e.value;void 0!==r.config.xaxis.tickAmount&&(i=r.config.xaxis.tickAmount),x.length>i&&(t=Math.floor(x.length/i));var s=!1,o=!1;switch(n.tickInterval){case"years":"year"===e.unit&&(s=!0);break;case"half_year":t=7,"year"===e.unit&&(s=!0);break;case"months":t=1,"year"===e.unit&&(s=!0);break;case"months_fortnight":t=15,"year"!==e.unit&&"month"!==e.unit||(s=!0),30===a&&(o=!0);break;case"months_days":t=10,"month"===e.unit&&(s=!0),30===a&&(o=!0);break;case"week_days":t=8,"month"===e.unit&&(s=!0);break;case"days":t=1,"month"===e.unit&&(s=!0);break;case"hours":"day"===e.unit&&(s=!0);break;case"minutes_fives":case"seconds_fives":a%5!=0&&(o=!0);break;case"seconds_tens":a%10!=0&&(o=!0)}if("hours"===n.tickInterval||"minutes_fives"===n.tickInterval||"seconds_tens"===n.tickInterval||"seconds_fives"===n.tickInterval){if(!o)return!0}else if((a%t==0||s)&&!o)return!0}))}},{key:"recalcDimensionsBasedOnFormat",value:function(e,t){var n=this.w,r=this.formatDates(e),i=this.removeOverlappingTS(r);n.globals.timescaleLabels=i.slice(),new gr(this.ctx).plotCoords()}},{key:"determineInterval",value:function(e){var t=24*e,n=60*t;switch(!0){case e/365>5:this.tickInterval="years";break;case e>800:this.tickInterval="half_year";break;case e>180:this.tickInterval="months";break;case e>90:this.tickInterval="months_fortnight";break;case e>60:this.tickInterval="months_days";break;case e>30:this.tickInterval="week_days";break;case e>2:this.tickInterval="days";break;case t>2.4:this.tickInterval="hours";break;case n>15:this.tickInterval="minutes_fives";break;case n>5:this.tickInterval="minutes";break;case n>1:this.tickInterval="seconds_tens";break;case 60*n>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}},{key:"generateYearScale",value:function(e){var t=e.firstVal,n=e.currentMonth,r=e.currentYear,i=e.daysWidthOnXAxis,a=e.numberOfYears,s=t.minYear,o=0,l=new Rn(this.ctx),c="year";if(t.minDate>1||t.minMonth>0){var u=l.determineRemainingDaysOfYear(t.minYear,t.minMonth,t.minDate);o=(l.determineDaysOfYear(t.minYear)-u+1)*i,s=t.minYear+1,this.timeScaleArray.push({position:o,value:s,unit:c,year:s,month:k.monthMod(n+1)})}else 1===t.minDate&&0===t.minMonth&&this.timeScaleArray.push({position:o,value:s,unit:c,year:r,month:k.monthMod(n+1)});for(var d=s,h=o,f=0;f1){l=(c.determineDaysOfMonths(r+1,t.minYear)-n+1)*a,o=k.monthMod(r+1);var h=i+d,f=k.monthMod(o),p=o;0===o&&(u="year",p=h,f=1,h+=d+=1),this.timeScaleArray.push({position:l,value:p,unit:u,year:h,month:f})}else this.timeScaleArray.push({position:l,value:o,unit:u,year:i,month:k.monthMod(r)});for(var m=o+1,g=l,v=0,b=1;vs.determineDaysOfMonths(t+1,n)?(c=1,o="month",h=t+=1,t):t},d=(24-t.minHour)*i,h=l,f=u(c,n,r);0===t.minHour&&1===t.minDate?(d=0,h=k.monthMod(t.minMonth),o="month",c=t.minDate):1!==t.minDate&&0===t.minHour&&0===t.minMinute&&(d=0,l=t.minDate,h=l,f=u(c=l,n,r),1!==h&&(o="day")),this.timeScaleArray.push({position:d,value:h,unit:o,year:this._getYear(r,f,0),month:k.monthMod(f),day:c});for(var p=d,m=0;mo.determineDaysOfMonths(t+1,i)&&(m=1,t+=1),{month:t,date:m}},u=function(e,t){return e>o.determineDaysOfMonths(t+1,i)?t+=1:t},d=60-(t.minMinute+t.minSecond/60),h=d*a,f=t.minHour+1,p=f;60===d&&(h=0,p=f=t.minHour);var m=n;p>=24&&(p=0,l="day",f=m+=1);var g=c(m,r).month;g=u(m,g),this.timeScaleArray.push({position:h,value:f,unit:l,day:m,hour:p,year:i,month:k.monthMod(g)}),p++;for(var v=h,b=0;b=24&&(p=0,l="day",g=c(m+=1,g).month,g=u(m,g));var y=this._getYear(i,g,0);v=60*a+v;var x=0===p?m:p;this.timeScaleArray.push({position:v,value:x,unit:l,hour:p,day:m,year:y,month:k.monthMod(g)}),p++}}},{key:"generateMinuteScale",value:function(e){for(var t=e.currentMillisecond,n=e.currentSecond,r=e.currentMinute,i=e.currentHour,a=e.currentDate,s=e.currentMonth,o=e.currentYear,l=e.minutesWidthOnXAxis,c=e.secondsWidthOnXAxis,u=e.numberOfMinutes,d=r+1,h=a,f=s,p=o,m=i,g=(60-n-t/1e3)*c,v=0;v=60&&(d=0,24===(m+=1)&&(m=0)),this.timeScaleArray.push({position:g,value:d,unit:"minute",hour:m,minute:d,day:h,year:this._getYear(p,f,0),month:k.monthMod(f)}),g+=l,d++}},{key:"generateSecondScale",value:function(e){for(var t=e.currentMillisecond,n=e.currentSecond,r=e.currentMinute,i=e.currentHour,a=e.currentDate,s=e.currentMonth,o=e.currentYear,l=e.secondsWidthOnXAxis,c=e.numberOfSeconds,u=n+1,d=r,h=a,f=s,p=o,m=i,g=(1e3-t)/1e3*l,v=0;v=60&&(u=0,++d>=60&&(d=0,24===++m&&(m=0))),this.timeScaleArray.push({position:g,value:u,unit:"second",hour:m,minute:d,second:u,day:h,year:this._getYear(p,f,0),month:k.monthMod(f)}),g+=l,u++}},{key:"createRawDateString",value:function(e,t){var n=e.year;return 0===e.month&&(e.month=1),n+="-"+("0"+e.month.toString()).slice(-2),"day"===e.unit?n+="day"===e.unit?"-"+("0"+t).slice(-2):"-01":n+="-"+("0"+(e.day?e.day:"1")).slice(-2),"hour"===e.unit?n+="hour"===e.unit?"T"+("0"+t).slice(-2):"T00":n+="T"+("0"+(e.hour?e.hour:"0")).slice(-2),"minute"===e.unit?n+=":"+("0"+t).slice(-2):n+=":"+(e.minute?("0"+e.minute).slice(-2):"00"),"second"===e.unit?n+=":"+("0"+t).slice(-2):n+=":00",this.utc&&(n+=".000Z"),n}},{key:"formatDates",value:function(e){var t=this,n=this.w;return e.map((function(e){var r=e.value.toString(),i=new Rn(t.ctx),a=t.createRawDateString(e,r),s=i.getDate(i.parseDate(a));if(t.utc||(s=i.getDate(i.parseDateWithTimezone(a))),void 0===n.config.xaxis.labels.format){var o="dd MMM",l=n.config.xaxis.labels.datetimeFormatter;"year"===e.unit&&(o=l.year),"month"===e.unit&&(o=l.month),"day"===e.unit&&(o=l.day),"hour"===e.unit&&(o=l.hour),"minute"===e.unit&&(o=l.minute),"second"===e.unit&&(o=l.second),r=i.formatDate(s,o)}else r=i.formatDate(s,n.config.xaxis.labels.format);return{dateString:a,position:e.position,value:r,unit:e.unit,year:e.year,month:e.month}}))}},{key:"removeOverlappingTS",value:function(e){var t,n=this,r=new Nn(this.ctx),i=!1;e.length>0&&e[0].value&&e.every((function(t){return t.value.length===e[0].value.length}))&&(i=!0,t=r.getTextRects(e[0].value).width);var a=0,s=e.map((function(s,o){if(o>0&&n.w.config.xaxis.labels.hideOverlappingLabels){var l=i?t:r.getTextRects(e[a].value).width,c=e[a].position;return s.position>c+l+10?(a=o,s):null}return s}));return s.filter((function(e){return null!==e}))}},{key:"_getYear",value:function(e,t,n){return e+Math.floor(t/12)+n}}]),e}(),Gr=function(){function e(t,n){s(this,e),this.ctx=n,this.w=n.w,this.el=t}return l(e,[{key:"setupElements",value:function(){var e=this.w,t=e.globals,n=e.config,r=n.chart.type;t.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].includes(r),t.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].includes(r),t.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(r)&&n.plotOptions.bar.horizontal,t.chartClass=".apexcharts".concat(t.chartID),t.dom.baseEl=this.el,t.dom.elWrap=document.createElement("div"),Nn.setAttrs(t.dom.elWrap,{id:t.chartClass.substring(1),class:"apexcharts-canvas ".concat(t.chartClass.substring(1))}),this.el.appendChild(t.dom.elWrap),t.dom.Paper=window.SVG().addTo(t.dom.elWrap),t.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(n.chart.offsetX,", ").concat(n.chart.offsetY,")")}),t.dom.Paper.node.style.background="dark"!==n.theme.mode||n.chart.background?"light"!==n.theme.mode||n.chart.background?n.chart.background:"#fff":"#424242",this.setSVGDimensions(),t.dom.elLegendForeign=document.createElementNS(t.SVGNS,"foreignObject"),Nn.setAttrs(t.dom.elLegendForeign,{x:0,y:0,width:t.svgWidth,height:t.svgHeight}),t.dom.elLegendWrap=document.createElement("div"),t.dom.elLegendWrap.classList.add("apexcharts-legend"),t.dom.elLegendWrap.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),t.dom.elLegendForeign.appendChild(t.dom.elLegendWrap),t.dom.Paper.node.appendChild(t.dom.elLegendForeign),t.dom.elGraphical=t.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),t.dom.elDefs=t.dom.Paper.defs(),t.dom.Paper.add(t.dom.elGraphical),t.dom.elGraphical.add(t.dom.elDefs)}},{key:"plotChartType",value:function(e,t){var n=this.w,r=this.ctx,i=n.config,a=n.globals,s={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},column:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},o=i.chart.type||"line",l=null,c=0;a.series.forEach((function(t,r){var i=e[r].type||o;s[i]?("rangeArea"===i?(s[i].series.push(a.seriesRangeStart[r]),s[i].seriesRangeEnd.push(a.seriesRangeEnd[r])):s[i].series.push(t),s[i].i.push(r),"column"!==i&&"bar"!==i||(n.globals.columnSeries=s.column)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(i)?l=i:"bar"===i?(s.column.series.push(t),s.column.i.push(r)):console.warn("You have specified an unrecognized series type (".concat(i,").")),o!==i&&"scatter"!==i&&c++})),c>0&&(l&&console.warn("Chart or series type ".concat(l," cannot appear with other chart or series types.")),s.column.series.length>0&&i.plotOptions.bar.horizontal&&(c-=s.column.series.length,s.column={series:[],i:[]},n.globals.columnSeries={series:[],i:[]},console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"))),a.comboCharts||(a.comboCharts=c>0);var u=new Wr(r,t),d=new Or(r,t);r.pie=new Dr(r);var h=new Fr(r);r.rangeBar=new Br(r,t);var f=new Lr(r),p=[];if(a.comboCharts){var m,g,v=new Mn(r);if(s.area.series.length>0&&(m=p).push.apply(m,y(v.drawSeriesByGroup(s.area,a.areaGroups,"area",u))),s.column.series.length>0)if(i.chart.stacked){var b=new Tr(r,t);p.push(b.draw(s.column.series,s.column.i))}else r.bar=new Mr(r,t),p.push(r.bar.draw(s.column.series,s.column.i));if(s.rangeArea.series.length>0&&p.push(u.draw(s.rangeArea.series,"rangeArea",s.rangeArea.i,s.rangeArea.seriesRangeEnd)),s.line.series.length>0&&(g=p).push.apply(g,y(v.drawSeriesByGroup(s.line,a.lineGroups,"line",u))),s.candlestick.series.length>0&&p.push(d.draw(s.candlestick.series,"candlestick",s.candlestick.i)),s.boxPlot.series.length>0&&p.push(d.draw(s.boxPlot.series,"boxPlot",s.boxPlot.i)),s.rangeBar.series.length>0&&p.push(r.rangeBar.draw(s.rangeBar.series,s.rangeBar.i)),s.scatter.series.length>0){var x=new Wr(r,t,!0);p.push(x.draw(s.scatter.series,"scatter",s.scatter.i))}if(s.bubble.series.length>0){var w=new Wr(r,t,!0);p.push(w.draw(s.bubble.series,"bubble",s.bubble.i))}}else switch(i.chart.type){case"line":p=u.draw(a.series,"line");break;case"area":p=u.draw(a.series,"area");break;case"bar":i.chart.stacked?p=new Tr(r,t).draw(a.series):(r.bar=new Mr(r,t),p=r.bar.draw(a.series));break;case"candlestick":p=new Or(r,t).draw(a.series,"candlestick");break;case"boxPlot":p=new Or(r,t).draw(a.series,i.chart.type);break;case"rangeBar":p=r.rangeBar.draw(a.series);break;case"rangeArea":p=u.draw(a.seriesRangeStart,"rangeArea",void 0,a.seriesRangeEnd);break;case"heatmap":p=new Pr(r,t).draw(a.series);break;case"treemap":p=new Xr(r,t).draw(a.series);break;case"pie":case"donut":case"polarArea":p=r.pie.draw(a.series);break;case"radialBar":p=h.draw(a.series);break;case"radar":p=f.draw(a.series);break;default:p=u.draw(a.series)}return p}},{key:"setSVGDimensions",value:function(){var e=this.w,t=e.globals,n=e.config;n.chart.width=n.chart.width||"100%",n.chart.height=n.chart.height||"auto",t.svgWidth=n.chart.width,t.svgHeight=n.chart.height;var r=k.getDimensions(this.el),i=n.chart.width.toString().split(/[0-9]+/g).pop();"%"===i?k.isNumber(r[0])&&(0===r[0].width&&(r=k.getDimensions(this.el.parentNode)),t.svgWidth=r[0]*parseInt(n.chart.width,10)/100):"px"!==i&&""!==i||(t.svgWidth=parseInt(n.chart.width,10));var a=String(n.chart.height).toString().split(/[0-9]+/g).pop();if("auto"!==t.svgHeight&&""!==t.svgHeight)if("%"===a){var s=k.getDimensions(this.el.parentNode);t.svgHeight=s[1]*parseInt(n.chart.height,10)/100}else t.svgHeight=parseInt(n.chart.height,10);else t.svgHeight=t.axisCharts?t.svgWidth/1.61:t.svgWidth/1.2;if(t.svgWidth=Math.max(t.svgWidth,0),t.svgHeight=Math.max(t.svgHeight,0),Nn.setAttrs(t.dom.Paper.node,{width:t.svgWidth,height:t.svgHeight}),"%"!==a){var o=n.chart.sparkline.enabled?0:t.axisCharts?n.chart.parentHeightOffset:0;t.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(t.svgHeight+o,"px")}t.dom.elWrap.style.width="".concat(t.svgWidth,"px"),t.dom.elWrap.style.height="".concat(t.svgHeight,"px")}},{key:"shiftGraphPosition",value:function(){var e=this.w.globals,t=e.translateY,n=e.translateX;Nn.setAttrs(e.dom.elGraphical.node,{transform:"translate(".concat(n,", ").concat(t,")")})}},{key:"resizeNonAxisCharts",value:function(){var e=this.w,t=e.globals,n=0,r=e.config.chart.sparkline.enabled?1:15;r+=e.config.grid.padding.bottom,["top","bottom"].includes(e.config.legend.position)&&e.config.legend.show&&!e.config.legend.floating&&(n=new br(this.ctx).legendHelpers.getLegendDimensions().clwh+7);var i=e.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),a=2.05*e.globals.radialSize;if(i&&!e.config.chart.sparkline.enabled&&0!==e.config.plotOptions.radialBar.startAngle){var s=k.getBoundingClientRect(i);a=s.bottom;var o=s.bottom-s.top;a=Math.max(2.05*e.globals.radialSize,o)}var l=Math.ceil(a+t.translateY+n+r);t.dom.elLegendForeign&&t.dom.elLegendForeign.setAttribute("height",l),e.config.chart.height&&String(e.config.chart.height).includes("%")||(t.dom.elWrap.style.height="".concat(l,"px"),Nn.setAttrs(t.dom.Paper.node,{height:l}),t.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(l,"px"))}},{key:"coreCalculations",value:function(){new rr(this.ctx).init()}},{key:"resetGlobals",value:function(){var e=this,t=function(){return e.w.config.series.map((function(){return[]}))},n=new Xn,r=this.w.globals;n.initGlobalVars(r),r.seriesXvalues=t(),r.seriesYvalues=t()}},{key:"isMultipleY",value:function(){return!!(Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1)&&(this.w.globals.isMultipleYAxis=!0,!0)}},{key:"xySettings",value:function(){var e=this.w,t=null;if(e.globals.axisCharts){if("back"===e.config.xaxis.crosshairs.position&&new lr(this.ctx).drawXCrosshairs(),"back"===e.config.yaxis[0].crosshairs.position&&new lr(this.ctx).drawYCrosshairs(),"datetime"===e.config.xaxis.type&&void 0===e.config.xaxis.labels.formatter){this.ctx.timeScale=new qr(this.ctx);var n=[];isFinite(e.globals.minX)&&isFinite(e.globals.maxX)&&!e.globals.isBarHorizontal?n=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minX,e.globals.maxX):e.globals.isBarHorizontal&&(n=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minY,e.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(n)}t=new Mn(this.ctx).getCalculatedRatios()}return t}},{key:"updateSourceChart",value:function(e){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:e.w.globals.minX,max:e.w.globals.maxX}}}},!1,!1)}},{key:"setupBrushHandler",value:function(){var e=this,t=this.w;if(t.config.chart.brush.enabled&&"function"!=typeof t.config.chart.events.selection){var n=Array.isArray(t.config.chart.brush.targets)?t.config.chart.brush.targets:[t.config.chart.brush.target];n.forEach((function(t){var n=ApexCharts.getChartByID(t);n.w.globals.brushSource=e.ctx,"function"!=typeof n.w.config.chart.events.zoomed&&(n.w.config.chart.events.zoomed=function(){return e.updateSourceChart(n)}),"function"!=typeof n.w.config.chart.events.scrolled&&(n.w.config.chart.events.scrolled=function(){return e.updateSourceChart(n)})})),t.config.chart.events.selection=function(e,t){n.forEach((function(e){ApexCharts.getChartByID(e).ctx.updateHelpers._updateOptions({xaxis:{min:t.xaxis.min,max:t.xaxis.max}},!1,!1,!1,!1)}))}}}}]),e}(),Qr=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"_updateOptions",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(s){var o=[t.ctx];i&&(o=t.ctx.getSyncedCharts()),t.ctx.w.globals.isExecCalled&&(o=[t.ctx],t.ctx.w.globals.isExecCalled=!1),o.forEach((function(i,l){var c=i.w;if(c.globals.shouldAnimate=r,n||(c.globals.resized=!0,c.globals.dataChanged=!0,r&&i.series.getPreviousPaths()),e&&"object"===w(e)&&(i.config=new Wn(e),e=Mn.extendArrayProps(i.config,e,c),i.w.globals.chartID!==t.ctx.w.globals.chartID&&delete e.series,c.config=k.extend(c.config,e),a&&(c.globals.lastXAxis=e.xaxis?k.clone(e.xaxis):[],c.globals.lastYAxis=e.yaxis?k.clone(e.yaxis):[],c.globals.initialConfig=k.extend({},c.config),c.globals.initialSeries=k.clone(c.config.series),e.series))){for(var u=0;u2&&void 0!==arguments[2]&&arguments[2];return new Promise((function(i){var a,s=n.w;return s.globals.shouldAnimate=t,s.globals.dataChanged=!0,t&&n.ctx.series.getPreviousPaths(),s.globals.axisCharts?(0===(a=e.map((function(e,t){return n._extendSeries(e,t)}))).length&&(a=[{data:[]}]),s.config.series=a):s.config.series=e.slice(),r&&(s.globals.initialConfig.series=k.clone(s.config.series),s.globals.initialSeries=k.clone(s.config.series)),n.ctx.update().then((function(){i(n.ctx)}))}))}},{key:"_extendSeries",value:function(e,t){var n=this.w,r=n.config.series[t];return g(g({},n.config.series[t]),{},{name:e.name?e.name:null==r?void 0:r.name,color:e.color?e.color:null==r?void 0:r.color,type:e.type?e.type:null==r?void 0:r.type,group:e.group?e.group:null==r?void 0:r.group,hidden:void 0!==e.hidden?e.hidden:null==r?void 0:r.hidden,data:e.data?e.data:null==r?void 0:r.data,zIndex:void 0!==e.zIndex?e.zIndex:t})}},{key:"toggleDataPointSelection",value:function(e,t){var n=this.w,r=null,i=".apexcharts-series[data\\:realIndex='".concat(e,"']");return n.globals.axisCharts?r=n.globals.dom.Paper.findOne("".concat(i," path[j='").concat(t,"'], ").concat(i," circle[j='").concat(t,"'], ").concat(i," rect[j='").concat(t,"']")):void 0===t&&(r=n.globals.dom.Paper.findOne("".concat(i," path[j='").concat(e,"']")),"pie"!==n.config.chart.type&&"polarArea"!==n.config.chart.type&&"donut"!==n.config.chart.type||this.ctx.pie.pieClicked(e)),r?(new Nn(this.ctx).pathMouseDown(r,null),r.node?r.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(e){var t=this.w;if(["min","max"].forEach((function(n){void 0!==e.xaxis[n]&&(t.config.xaxis[n]=e.xaxis[n],t.globals.lastXAxis[n]=e.xaxis[n])})),e.xaxis.categories&&e.xaxis.categories.length&&(t.config.xaxis.categories=e.xaxis.categories),t.config.xaxis.convertedCatToNumeric){var n=new Un(e);e=n.convertCatToNumericXaxis(e,this.ctx)}return e}},{key:"forceYAxisUpdate",value:function(e){return e.chart&&e.chart.stacked&&"100%"===e.chart.stackType&&(Array.isArray(e.yaxis)?e.yaxis.forEach((function(t,n){e.yaxis[n].min=0,e.yaxis[n].max=100})):(e.yaxis.min=0,e.yaxis.max=100)),e}},{key:"revertDefaultAxisMinMax",value:function(e){var t=this,n=this.w,r=n.globals.lastXAxis,i=n.globals.lastYAxis;e&&e.xaxis&&(r=e.xaxis),e&&e.yaxis&&(i=e.yaxis),n.config.xaxis.min=r.min,n.config.xaxis.max=r.max;n.config.yaxis.map((function(e,r){n.globals.zoomed||void 0!==i[r]?function(e){void 0!==i[e]&&(n.config.yaxis[e].min=i[e].min,n.config.yaxis[e].max=i[e].max)}(r):void 0!==t.ctx.opts.yaxis[r]&&(e.min=t.ctx.opts.yaxis[r].min,e.max=t.ctx.opts.yaxis[r].max)}))}}]),e}();!function(){function e(){for(var e=arguments.length>0&&arguments[0]!==c?arguments[0]:[],i=arguments.length>1?arguments[1]:c,a=arguments.length>2?arguments[2]:c,s=arguments.length>3?arguments[3]:c,o=arguments.length>4?arguments[4]:c,l=arguments.length>5?arguments[5]:c,c=arguments.length>6?arguments[6]:c,u=e.slice(i,a||c),d=s.slice(o,l||c),h=0,f={pos:[0,0],start:[0,0]},p={pos:[0,0],start:[0,0]};u[h]=t.call(f,u[h]),d[h]=t.call(p,d[h]),u[h][0]!=d[h][0]||"M"==u[h][0]||"A"==u[h][0]&&(u[h][4]!=d[h][4]||u[h][5]!=d[h][5])?(Array.prototype.splice.apply(u,[h,1].concat(r.call(f,u[h]))),Array.prototype.splice.apply(d,[h,1].concat(r.call(p,d[h])))):(u[h]=n.call(f,u[h]),d[h]=n.call(p,d[h])),++h!=u.length||h!=d.length;)h==u.length&&u.push(["C",f.pos[0],f.pos[1],f.pos[0],f.pos[1],f.pos[0],f.pos[1]]),h==d.length&&d.push(["C",p.pos[0],p.pos[1],p.pos[0],p.pos[1],p.pos[0],p.pos[1]]);return{start:u,dest:d}}function t(e){switch(e[0]){case"z":case"Z":e[0]="L",e[1]=this.start[0],e[2]=this.start[1];break;case"H":e[0]="L",e[2]=this.pos[1];break;case"V":e[0]="L",e[2]=e[1],e[1]=this.pos[0];break;case"T":e[0]="Q",e[3]=e[1],e[4]=e[2],e[1]=this.reflection[1],e[2]=this.reflection[0];break;case"S":e[0]="C",e[6]=e[4],e[5]=e[3],e[4]=e[2],e[3]=e[1],e[2]=this.reflection[1],e[1]=this.reflection[0]}return e}function n(e){var t=e.length;return this.pos=[e[t-2],e[t-1]],-1!="SCQT".indexOf(e[0])&&(this.reflection=[2*this.pos[0]-e[t-4],2*this.pos[1]-e[t-3]]),e}function r(e){var t=[e];switch(e[0]){case"M":return this.pos=this.start=[e[1],e[2]],t;case"L":e[5]=e[3]=e[1],e[6]=e[4]=e[2],e[1]=this.pos[0],e[2]=this.pos[1];break;case"Q":e[6]=e[4],e[5]=e[3],e[4]=1*e[4]/3+2*e[2]/3,e[3]=1*e[3]/3+2*e[1]/3,e[2]=1*this.pos[1]/3+2*e[2]/3,e[1]=1*this.pos[0]/3+2*e[1]/3;break;case"A":t=function(e,t){var n,r,i,a,s,o,l,c,u,d,h,f,p,m,g,v,b,y,x,w,A,k,S,_,C,j,E=Math.abs(t[1]),N=Math.abs(t[2]),M=t[3]%360,T=t[4],O=t[5],R=t[6],P=t[7],I=new we(e),D=new we(R,P),L=[];if(0===E||0===N||I.x===D.x&&I.y===D.y)return[["C",I.x,I.y,D.x,D.y,D.x,D.y]];for((r=(n=new we((I.x-D.x)/2,(I.y-D.y)/2).transform((new ke).rotate(M))).x*n.x/(E*E)+n.y*n.y/(N*N))>1&&(E*=r=Math.sqrt(r),N*=r),i=(new ke).rotate(M).scale(1/E,1/N).rotate(-M),I=I.transform(i),o=(a=[(D=D.transform(i)).x-I.x,D.y-I.y])[0]*a[0]+a[1]*a[1],s=Math.sqrt(o),a[0]/=s,a[1]/=s,l=o<4?Math.sqrt(1-o/4):0,T===O&&(l*=-1),c=new we((D.x+I.x)/2+l*-a[1],(D.y+I.y)/2+l*a[0]),u=new we(I.x-c.x,I.y-c.y),d=new we(D.x-c.x,D.y-c.y),h=Math.acos(u.x/Math.sqrt(u.x*u.x+u.y*u.y)),u.y<0&&(h*=-1),f=Math.acos(d.x/Math.sqrt(d.x*d.x+d.y*d.y)),d.y<0&&(f*=-1),O&&h>f&&(f+=2*Math.PI),!O&&h0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(!1===t)return!1;for(var n=t,r=e.length;n(e.changedTouches&&(e=e.changedTouches[0]),{x:e.clientX,y:e.clientY});class Zr{constructor(e){e.remember("_draggable",this),this.el=e,this.drag=this.drag.bind(this),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this)}init(e){e?(this.el.on("mousedown.drag",this.startDrag),this.el.on("touchstart.drag",this.startDrag,{passive:!1})):(this.el.off("mousedown.drag"),this.el.off("touchstart.drag"))}startDrag(e){const t=!e.type.indexOf("mouse");if(t&&1!==e.which&&0!==e.buttons)return;if(this.el.dispatch("beforedrag",{event:e,handler:this}).defaultPrevented)return;e.preventDefault(),e.stopPropagation(),this.init(!1),this.box=this.el.bbox(),this.lastClick=this.el.point(Kr(e));const n=(t?"mouseup":"touchend")+".drag";Ie(window,(t?"mousemove":"touchmove")+".drag",this.drag,this,{passive:!1}),Ie(window,n,this.endDrag,this,{passive:!1}),this.el.fire("dragstart",{event:e,handler:this,box:this.box})}drag(e){const{box:t,lastClick:n}=this,r=this.el.point(Kr(e)),i=r.x-n.x,a=r.y-n.y;if(!i&&!a)return t;const s=t.x+i,o=t.y+a;this.box=new Ce(s,o,t.w,t.h),this.lastClick=r,this.el.dispatch("dragmove",{event:e,handler:this,box:this.box}).defaultPrevented||this.move(s,o)}move(e,t){"svg"===this.el.type?mn.prototype.move.call(this.el,e,t):this.el.move(e,t)}endDrag(e){this.drag(e),this.el.fire("dragend",{event:e,handler:this,box:this.box}),De(window,"mousemove.drag"),De(window,"touchmove.drag"),De(window,"mouseup.drag"),De(window,"touchend.drag"),this.init(!0)}}function Jr(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(i){i.preventDefault(),i.stopPropagation();var a=i.pageX||i.touches[0].pageX,s=i.pageY||i.touches[0].pageY;t.fire(e,{x:a,y:s,event:i,index:r,points:n})}}function $r(e,t){let[n,r]=e,{a:i,b:a,c:s,d:o,e:l,f:c}=t;return[n*i+r*s+l,n*a+r*o+c]}ne(Xe,{draggable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(this.remember("_draggable")||new Zr(this)).init(e),this}});let ei=class{constructor(e){this.el=e,e.remember("_selectHandler",this),this.selection=new mn,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const t=U();this.observer=new t.MutationObserver(this.mutationHandler)}init(e){this.createHandle=e.createHandle||this.createHandleFn,this.createRot=e.createRot||this.createRotFn,this.updateHandle=e.updateHandle||this.updateHandleFn,this.updateRot=e.updateRot||this.updateRotFn,this.el.root().put(this.selection),this.updatePoints(),this.createSelection(),this.createResizeHandles(),this.updateResizeHandles(),this.createRotationHandle(),this.updateRotationHandle(),this.observer.observe(this.el.node,{attributes:!0})}active(e,t){if(!e)return this.selection.clear().remove(),void this.observer.disconnect();this.init(t)}createSelection(){this.selection.polygon(this.handlePoints).addClass("svg_select_shape")}updateSelection(){this.selection.get(0).plot(this.handlePoints)}createResizeHandles(){this.handlePoints.forEach(((e,t,n)=>{const r=this.order[t];this.createHandle.call(this,this.selection,e,t,n,r),this.selection.get(t+1).addClass("svg_select_handle svg_select_handle_"+r).on("mousedown.selection touchstart.selection",Jr(r,this.el,this.handlePoints,t))}))}createHandleFn(e){e.polyline()}updateHandleFn(e,t,n,r){const i=r.at(n-1),a=r[(n+1)%r.length],s=t,o=[s[0]-i[0],s[1]-i[1]],l=[s[0]-a[0],s[1]-a[1]],c=Math.sqrt(o[0]*o[0]+o[1]*o[1]),u=Math.sqrt(l[0]*l[0]+l[1]*l[1]),d=[o[0]/c,o[1]/c],h=[l[0]/u,l[1]/u],f=[s[0]-10*d[0],s[1]-10*d[1]],p=[s[0]-10*h[0],s[1]-10*h[1]];e.plot([f,s,p])}updateResizeHandles(){this.handlePoints.forEach(((e,t,n)=>{const r=this.order[t];this.updateHandle.call(this,this.selection.get(t+1),e,t,n,r)}))}createRotFn(e){e.line(),e.circle(5)}getPoint(e){return this.handlePoints[this.order.indexOf(e)]}getPointHandle(e){return this.selection.get(this.order.indexOf(e)+1)}updateRotFn(e,t){const n=this.getPoint("t");e.get(0).plot(n[0],n[1],t[0],t[1]),e.get(1).center(t[0],t[1])}createRotationHandle(){const e=this.selection.group().addClass("svg_select_handle_rot").on("mousedown.selection touchstart.selection",Jr("rot",this.el,this.handlePoints));this.createRot.call(this,e)}updateRotationHandle(){const e=this.selection.findOne("g.svg_select_handle_rot");this.updateRot(e,this.rotationPoint,this.handlePoints)}updatePoints(){const e=this.el.bbox(),t=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.handlePoints=this.getHandlePoints(e).map((e=>$r(e,t))),this.rotationPoint=$r(this.getRotationPoint(e),t)}getHandlePoints(){let{x:e,x2:t,y:n,y2:r,cx:i,cy:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.el.bbox();return[[e,n],[i,n],[t,n],[t,a],[t,r],[i,r],[e,r],[e,a]]}getRotationPoint(){let{y:e,cx:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.el.bbox();return[t,e-20]}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updateResizeHandles(),this.updateRotationHandle()}};const ti=e=>function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"==typeof t&&(n=t,t=!0);let r=this.remember("_"+e.name);return r||(t.prototype instanceof ei?(r=new t(this),t=!0):r=new e(this),this.remember("_"+e.name,r)),r.active(t,n),this};function ni(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(i){i.preventDefault(),i.stopPropagation();var a=i.pageX||i.touches[0].pageX,s=i.pageY||i.touches[0].pageY;t.fire(e,{x:a,y:s,event:i,index:r,points:n})}}function ri(e,t){let[n,r]=e,{a:i,b:a,c:s,d:o,e:l,f:c}=t;return[n*i+r*s+l,n*a+r*o+c]}ne(Xe,{select:ti(ei)}),ne([Xt,Vt,vt],{pointSelect:ti(class{constructor(e){this.el=e,e.remember("_pointSelectHandler",this),this.selection=new mn,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const t=U();this.observer=new t.MutationObserver(this.mutationHandler)}init(e){this.createHandle=e.createHandle||this.createHandleFn,this.updateHandle=e.updateHandle||this.updateHandleFn,this.el.root().put(this.selection),this.updatePoints(),this.createSelection(),this.createPointHandles(),this.updatePointHandles(),this.observer.observe(this.el.node,{attributes:!0})}active(e,t){if(!e)return this.selection.clear().remove(),void this.observer.disconnect();this.init(t)}createSelection(){this.selection.polygon(this.points).addClass("svg_select_shape_pointSelect")}updateSelection(){this.selection.get(0).plot(this.points)}createPointHandles(){this.points.forEach(((e,t,n)=>{this.createHandle.call(this,this.selection,e,t,n),this.selection.get(t+1).addClass("svg_select_handle_point").on("mousedown.selection touchstart.selection",Jr("point",this.el,this.points,t))}))}createHandleFn(e){e.circle(5)}updateHandleFn(e,t){e.center(t[0],t[1])}updatePointHandles(){this.points.forEach(((e,t,n)=>{this.updateHandle.call(this,this.selection.get(t+1),e,t,n)}))}updatePoints(){const e=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.points=this.el.array().map((t=>$r(t,e)))}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updatePointHandles()}})});class ii{constructor(e){this.el=e,e.remember("_selectHandler",this),this.selection=new mn,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const t=U();this.observer=new t.MutationObserver(this.mutationHandler)}init(e){this.createHandle=e.createHandle||this.createHandleFn,this.createRot=e.createRot||this.createRotFn,this.updateHandle=e.updateHandle||this.updateHandleFn,this.updateRot=e.updateRot||this.updateRotFn,this.el.root().put(this.selection),this.updatePoints(),this.createSelection(),this.createResizeHandles(),this.updateResizeHandles(),this.createRotationHandle(),this.updateRotationHandle(),this.observer.observe(this.el.node,{attributes:!0})}active(e,t){if(!e)return this.selection.clear().remove(),void this.observer.disconnect();this.init(t)}createSelection(){this.selection.polygon(this.handlePoints).addClass("svg_select_shape")}updateSelection(){this.selection.get(0).plot(this.handlePoints)}createResizeHandles(){this.handlePoints.forEach(((e,t,n)=>{const r=this.order[t];this.createHandle.call(this,this.selection,e,t,n,r),this.selection.get(t+1).addClass("svg_select_handle svg_select_handle_"+r).on("mousedown.selection touchstart.selection",ni(r,this.el,this.handlePoints,t))}))}createHandleFn(e){e.polyline()}updateHandleFn(e,t,n,r){const i=r.at(n-1),a=r[(n+1)%r.length],s=t,o=[s[0]-i[0],s[1]-i[1]],l=[s[0]-a[0],s[1]-a[1]],c=Math.sqrt(o[0]*o[0]+o[1]*o[1]),u=Math.sqrt(l[0]*l[0]+l[1]*l[1]),d=[o[0]/c,o[1]/c],h=[l[0]/u,l[1]/u],f=[s[0]-10*d[0],s[1]-10*d[1]],p=[s[0]-10*h[0],s[1]-10*h[1]];e.plot([f,s,p])}updateResizeHandles(){this.handlePoints.forEach(((e,t,n)=>{const r=this.order[t];this.updateHandle.call(this,this.selection.get(t+1),e,t,n,r)}))}createRotFn(e){e.line(),e.circle(5)}getPoint(e){return this.handlePoints[this.order.indexOf(e)]}getPointHandle(e){return this.selection.get(this.order.indexOf(e)+1)}updateRotFn(e,t){const n=this.getPoint("t");e.get(0).plot(n[0],n[1],t[0],t[1]),e.get(1).center(t[0],t[1])}createRotationHandle(){const e=this.selection.group().addClass("svg_select_handle_rot").on("mousedown.selection touchstart.selection",ni("rot",this.el,this.handlePoints));this.createRot.call(this,e)}updateRotationHandle(){const e=this.selection.findOne("g.svg_select_handle_rot");this.updateRot(e,this.rotationPoint,this.handlePoints)}updatePoints(){const e=this.el.bbox(),t=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.handlePoints=this.getHandlePoints(e).map((e=>ri(e,t))),this.rotationPoint=ri(this.getRotationPoint(e),t)}getHandlePoints(){let{x:e,x2:t,y:n,y2:r,cx:i,cy:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.el.bbox();return[[e,n],[i,n],[t,n],[t,a],[t,r],[i,r],[e,r],[e,a]]}getRotationPoint(){let{y:e,cx:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.el.bbox();return[t,e-20]}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updateResizeHandles(),this.updateRotationHandle()}}const ai=e=>function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"==typeof t&&(n=t,t=!0);let r=this.remember("_"+e.name);return r||(t.prototype instanceof ii?(r=new t(this),t=!0):r=new e(this),this.remember("_"+e.name,r)),r.active(t,n),this};ne(Xe,{select:ai(ii)}),ne([Xt,Vt,vt],{pointSelect:ai(class{constructor(e){this.el=e,e.remember("_pointSelectHandler",this),this.selection=new mn,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const t=U();this.observer=new t.MutationObserver(this.mutationHandler)}init(e){this.createHandle=e.createHandle||this.createHandleFn,this.updateHandle=e.updateHandle||this.updateHandleFn,this.el.root().put(this.selection),this.updatePoints(),this.createSelection(),this.createPointHandles(),this.updatePointHandles(),this.observer.observe(this.el.node,{attributes:!0})}active(e,t){if(!e)return this.selection.clear().remove(),void this.observer.disconnect();this.init(t)}createSelection(){this.selection.polygon(this.points).addClass("svg_select_shape_pointSelect")}updateSelection(){this.selection.get(0).plot(this.points)}createPointHandles(){this.points.forEach(((e,t,n)=>{this.createHandle.call(this,this.selection,e,t,n),this.selection.get(t+1).addClass("svg_select_handle_point").on("mousedown.selection touchstart.selection",ni("point",this.el,this.points,t))}))}createHandleFn(e){e.circle(5)}updateHandleFn(e,t){e.center(t[0],t[1])}updatePointHandles(){this.points.forEach(((e,t,n)=>{this.updateHandle.call(this,this.selection.get(t+1),e,t,n)}))}updatePoints(){const e=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.points=this.el.array().map((t=>ri(t,e)))}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updatePointHandles()}})});const si=e=>(e.changedTouches&&(e=e.changedTouches[0]),{x:e.clientX,y:e.clientY}),oi=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a=0;a{let[r,i]=e;const a=r-t[0],s=(i-t[1])*n;return[a*n+t[0],s+t[1]]}));return oi(r)}(this.box,i,a)}this.el.dispatch("resize",{box:new Ce(l),angle:0,eventType:this.eventType,event:e,handler:this}).defaultPrevented||this.el.size(l.width,l.height).move(l.x,l.y)}movePoint(e){this.lastEvent=e;const{x:t,y:n}=this.snapToGrid(this.el.point(si(e))),r=this.el.array().slice();r[this.index]=[t,n],this.el.dispatch("resize",{box:oi(r),angle:0,eventType:this.eventType,event:e,handler:this}).defaultPrevented||this.el.plot(r)}rotate(e){this.lastEvent=e;const t=this.startPoint,n=this.el.point(si(e)),{cx:r,cy:i}=this.box,a=t.x-r,s=t.y-i,o=n.x-r,l=n.y-i,c=Math.sqrt(a*a+s*s)*Math.sqrt(o*o+l*l);if(0===c)return;let u=Math.acos((a*o+s*l)/c)/Math.PI*180;if(!u)return;n.x0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"==typeof e&&(t=e,e=!0);let n=this.remember("_ResizeHandler");return n||(e.prototype instanceof li?(n=new e(this),e=!0):n=new li(this),this.remember("_resizeHandler",n)),n.active(e,t),this}}),void 0===window.SVG&&(window.SVG=An),void 0===window.Apex&&(window.Apex={});var ci=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"initModules",value:function(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend"],this.ctx.animations=new S(this.ctx),this.ctx.axes=new or(this.ctx),this.ctx.core=new Gr(this.ctx.el,this.ctx),this.ctx.config=new Wn({}),this.ctx.data=new Jn(this.ctx),this.ctx.grid=new tr(this.ctx),this.ctx.graphics=new Nn(this.ctx),this.ctx.coreUtils=new Mn(this.ctx),this.ctx.crosshairs=new lr(this.ctx),this.ctx.events=new ar(this.ctx),this.ctx.exports=new $n(this.ctx),this.ctx.fill=new qn(this.ctx),this.ctx.localization=new sr(this.ctx),this.ctx.options=new Bn,this.ctx.responsive=new cr(this.ctx),this.ctx.series=new Zn(this.ctx),this.ctx.theme=new ur(this.ctx),this.ctx.formatters=new Pn(this.ctx),this.ctx.titleSubtitle=new dr(this.ctx),this.ctx.legend=new br(this.ctx),this.ctx.toolbar=new yr(this.ctx),this.ctx.tooltip=new jr(this.ctx),this.ctx.dimensions=new gr(this.ctx),this.ctx.updateHelpers=new Qr(this.ctx),this.ctx.zoomPanSelection=new xr(this.ctx),this.ctx.w.globals.tooltip=new jr(this.ctx)}}]),e}(),ui=function(){function e(t){s(this,e),this.ctx=t,this.w=t.w}return l(e,[{key:"clear",value:function(e){var t=e.isUpdating;this.ctx.zoomPanSelection&&this.ctx.zoomPanSelection.destroy(),this.ctx.toolbar&&this.ctx.toolbar.destroy(),this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx.zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx.toolbar=null,this.ctx.localization=null,this.ctx.w.globals.tooltip=null,this.clearDomElements({isUpdating:t})}},{key:"killSVG",value:function(e){e.each((function(){this.removeClass("*"),this.off()}),!0),e.clear()}},{key:"clearDomElements",value:function(e){var t=this,n=e.isUpdating,r=this.w.globals.dom.Paper.node;r.parentNode&&r.parentNode.parentNode&&!n&&(r.parentNode.parentNode.style.minHeight="unset");var i=this.w.globals.dom.baseEl;i&&this.ctx.eventList.forEach((function(e){i.removeEventListener(e,t.ctx.events.documentEvent)}));var a=this.w.globals.dom;if(null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(a.Paper),a.Paper.remove(),a.elWrap=null,a.elGraphical=null,a.elLegendWrap=null,a.elLegendForeign=null,a.baseEl=null,a.elGridRect=null,a.elGridRectMask=null,a.elGridRectBarMask=null,a.elGridRectMarkerMask=null,a.elForecastMask=null,a.elNonForecastMask=null,a.elDefs=null}}]),e}(),di=new WeakMap,hi=function(){function e(t,n){s(this,e),this.opts=n,this.ctx=this,this.w=new Vn(n).init(),this.el=t,this.w.globals.cuid=k.randomId(),this.w.globals.chartID=this.w.config.chart.id?k.escapeString(this.w.config.chart.id):this.w.globals.cuid,new ci(this).initModules(),this.create=k.bind(this.create,this),this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this)}return l(e,[{key:"render",value:function(){var e=this;return new Promise((function(t,n){if(k.elementExists(e.el)){void 0===Apex._chartInstances&&(Apex._chartInstances=[]),e.w.config.chart.id&&Apex._chartInstances.push({id:e.w.globals.chartID,group:e.w.config.chart.group,chart:e}),e.setLocale(e.w.config.chart.defaultLocale);var r=e.w.config.chart.events.beforeMount;"function"==typeof r&&r(e,e.w),e.events.fireEvent("beforeMount",[e,e.w]),window.addEventListener("resize",e.windowResizeHandler),function(e,t){var n=!1;if(e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var r=e.getBoundingClientRect();"none"!==e.style.display&&0!==r.width||(n=!0)}var i=new ResizeObserver((function(r){n&&t.call(e,r),n=!0}));e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(e.children).forEach((function(e){return i.observe(e)})):i.observe(e),di.set(t,i)}(e.el.parentNode,e.parentResizeHandler);var i=e.el.getRootNode&&e.el.getRootNode(),a=k.is("ShadowRoot",i),s=e.el.ownerDocument,o=a?i.getElementById("apexcharts-css"):s.getElementById("apexcharts-css");if(!o){var l;(o=document.createElement("style")).id="apexcharts-css",o.textContent='@keyframes opaque {\n 0% {\n opacity: 0\n }\n\n to {\n opacity: 1\n }\n}\n\n@keyframes resizeanim {\n\n 0%,\n to {\n opacity: 0\n }\n}\n\n.apexcharts-canvas {\n position: relative;\n direction: ltr !important;\n user-select: none\n}\n\n.apexcharts-canvas ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 6px\n}\n\n.apexcharts-canvas ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 0, 0, .5);\n box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)\n}\n\n.apexcharts-inner {\n position: relative\n}\n\n.apexcharts-text tspan {\n font-family: inherit\n}\n\nrect.legend-mouseover-inactive,\n.legend-mouseover-inactive rect,\n.legend-mouseover-inactive path,\n.legend-mouseover-inactive circle,\n.legend-mouseover-inactive line,\n.legend-mouseover-inactive text.apexcharts-yaxis-title-text,\n.legend-mouseover-inactive text.apexcharts-yaxis-label {\n transition: .15s ease all;\n opacity: .2\n}\n\n.apexcharts-legend-text {\n padding-left: 15px;\n margin-left: -15px;\n}\n\n.apexcharts-series-collapsed {\n opacity: 0\n}\n\n.apexcharts-tooltip {\n border-radius: 5px;\n box-shadow: 2px 2px 6px -4px #999;\n cursor: default;\n font-size: 14px;\n left: 62px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 20px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n white-space: nowrap;\n z-index: 12;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n border: 1px solid #e3e3e3;\n background: rgba(255, 255, 255, .96)\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n color: #fff;\n background: rgba(30, 30, 30, .8)\n}\n\n.apexcharts-tooltip * {\n font-family: inherit\n}\n\n.apexcharts-tooltip-title {\n padding: 6px;\n font-size: 15px;\n margin-bottom: 4px\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {\n background: #eceff1;\n border-bottom: 1px solid #ddd\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n background: rgba(0, 0, 0, .7);\n border-bottom: 1px solid #333\n}\n\n.apexcharts-tooltip-text-goals-value,\n.apexcharts-tooltip-text-y-value,\n.apexcharts-tooltip-text-z-value {\n display: inline-block;\n margin-left: 5px;\n font-weight: 600\n}\n\n.apexcharts-tooltip-text-goals-label:empty,\n.apexcharts-tooltip-text-goals-value:empty,\n.apexcharts-tooltip-text-y-label:empty,\n.apexcharts-tooltip-text-y-value:empty,\n.apexcharts-tooltip-text-z-value:empty,\n.apexcharts-tooltip-title:empty {\n display: none\n}\n\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n padding: 6px 0 5px\n}\n\n.apexcharts-tooltip-goals-group,\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n display: flex\n}\n\n.apexcharts-tooltip-text-goals-label:not(:empty),\n.apexcharts-tooltip-text-goals-value:not(:empty) {\n margin-top: -6px\n}\n\n.apexcharts-tooltip-marker {\n width: 12px;\n height: 12px;\n position: relative;\n top: 0;\n margin-right: 10px;\n border-radius: 50%\n}\n\n.apexcharts-tooltip-series-group {\n padding: 0 10px;\n display: none;\n text-align: left;\n justify-content: left;\n align-items: center\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {\n opacity: 1\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active,\n.apexcharts-tooltip-series-group:last-child {\n padding-bottom: 4px\n}\n\n.apexcharts-tooltip-y-group {\n padding: 6px 0 5px\n}\n\n.apexcharts-custom-tooltip,\n.apexcharts-tooltip-box {\n padding: 4px 8px\n}\n\n.apexcharts-tooltip-boxPlot {\n display: flex;\n flex-direction: column-reverse\n}\n\n.apexcharts-tooltip-box>div {\n margin: 4px 0\n}\n\n.apexcharts-tooltip-box span.value {\n font-weight: 700\n}\n\n.apexcharts-tooltip-rangebar {\n padding: 5px 8px\n}\n\n.apexcharts-tooltip-rangebar .category {\n font-weight: 600;\n color: #777\n}\n\n.apexcharts-tooltip-rangebar .series-name {\n font-weight: 700;\n display: block;\n margin-bottom: 5px\n}\n\n.apexcharts-xaxistooltip,\n.apexcharts-yaxistooltip {\n opacity: 0;\n pointer-events: none;\n color: #373d3f;\n font-size: 13px;\n text-align: center;\n border-radius: 2px;\n position: absolute;\n z-index: 10;\n background: #eceff1;\n border: 1px solid #90a4ae\n}\n\n.apexcharts-xaxistooltip {\n padding: 9px 10px;\n transition: .15s ease all\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\n}\n\n.apexcharts-xaxistooltip:after,\n.apexcharts-xaxistooltip:before {\n left: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n.apexcharts-xaxistooltip:after {\n border-color: transparent;\n border-width: 6px;\n margin-left: -6px\n}\n\n.apexcharts-xaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-left: -7px\n}\n\n.apexcharts-xaxistooltip-bottom:after,\n.apexcharts-xaxistooltip-bottom:before {\n bottom: 100%\n}\n\n.apexcharts-xaxistooltip-top:after,\n.apexcharts-xaxistooltip-top:before {\n top: 100%\n}\n\n.apexcharts-xaxistooltip-bottom:after {\n border-bottom-color: #eceff1\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n border-bottom-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {\n border-bottom-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip-top:after {\n border-top-color: #eceff1\n}\n\n.apexcharts-xaxistooltip-top:before {\n border-top-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {\n border-top-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-yaxistooltip {\n padding: 4px 10px\n}\n\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\n}\n\n.apexcharts-yaxistooltip:after,\n.apexcharts-yaxistooltip:before {\n top: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n.apexcharts-yaxistooltip:after {\n border-color: transparent;\n border-width: 6px;\n margin-top: -6px\n}\n\n.apexcharts-yaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-top: -7px\n}\n\n.apexcharts-yaxistooltip-left:after,\n.apexcharts-yaxistooltip-left:before {\n left: 100%\n}\n\n.apexcharts-yaxistooltip-right:after,\n.apexcharts-yaxistooltip-right:before {\n right: 100%\n}\n\n.apexcharts-yaxistooltip-left:after {\n border-left-color: #eceff1\n}\n\n.apexcharts-yaxistooltip-left:before {\n border-left-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {\n border-left-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-yaxistooltip-right:after {\n border-right-color: #eceff1\n}\n\n.apexcharts-yaxistooltip-right:before {\n border-right-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {\n border-right-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-yaxistooltip.apexcharts-active {\n opacity: 1\n}\n\n.apexcharts-yaxistooltip-hidden {\n display: none\n}\n\n.apexcharts-xcrosshairs,\n.apexcharts-ycrosshairs {\n pointer-events: none;\n opacity: 0;\n transition: .15s ease all\n}\n\n.apexcharts-xcrosshairs.apexcharts-active,\n.apexcharts-ycrosshairs.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-ycrosshairs-hidden {\n opacity: 0\n}\n\n.apexcharts-selection-rect {\n cursor: move\n}\n\n.svg_select_shape {\n stroke-width: 1;\n stroke-dasharray: 10 10;\n stroke: black;\n stroke-opacity: 0.1;\n pointer-events: none;\n fill: none;\n}\n\n.svg_select_handle {\n stroke-width: 3;\n stroke: black;\n fill: none;\n}\n\n.svg_select_handle_r {\n cursor: e-resize;\n}\n\n.svg_select_handle_l {\n cursor: w-resize;\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-zoom {\n cursor: crosshair\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-pan {\n cursor: move\n}\n\n.apexcharts-menu-icon,\n.apexcharts-pan-icon,\n.apexcharts-reset-icon,\n.apexcharts-selection-icon,\n.apexcharts-toolbar-custom-icon,\n.apexcharts-zoom-icon,\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n cursor: pointer;\n width: 20px;\n height: 20px;\n line-height: 24px;\n color: #6e8192;\n text-align: center\n}\n\n.apexcharts-menu-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg {\n fill: #6e8192\n}\n\n.apexcharts-selection-icon svg {\n fill: #444;\n transform: scale(.76)\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon svg,\n.apexcharts-theme-dark .apexcharts-pan-icon svg,\n.apexcharts-theme-dark .apexcharts-reset-icon svg,\n.apexcharts-theme-dark .apexcharts-selection-icon svg,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomin-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomout-icon svg {\n fill: #f3f4f5\n}\n\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {\n fill: #008ffb\n}\n\n.apexcharts-theme-light .apexcharts-menu-icon:hover svg,\n.apexcharts-theme-light .apexcharts-reset-icon:hover svg,\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg {\n fill: #333\n}\n\n.apexcharts-menu-icon,\n.apexcharts-selection-icon {\n position: relative\n}\n\n.apexcharts-reset-icon {\n margin-left: 5px\n}\n\n.apexcharts-menu-icon,\n.apexcharts-reset-icon,\n.apexcharts-zoom-icon {\n transform: scale(.85)\n}\n\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n transform: scale(.7)\n}\n\n.apexcharts-zoomout-icon {\n margin-right: 3px\n}\n\n.apexcharts-pan-icon {\n transform: scale(.62);\n position: relative;\n left: 1px;\n top: 0\n}\n\n.apexcharts-pan-icon svg {\n fill: #fff;\n stroke: #6e8192;\n stroke-width: 2\n}\n\n.apexcharts-pan-icon.apexcharts-selected svg {\n stroke: #008ffb\n}\n\n.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {\n stroke: #333\n}\n\n.apexcharts-toolbar {\n position: absolute;\n z-index: 11;\n max-width: 176px;\n text-align: right;\n border-radius: 3px;\n padding: 0 6px 2px;\n display: flex;\n justify-content: space-between;\n align-items: center\n}\n\n.apexcharts-menu {\n background: #fff;\n position: absolute;\n top: 100%;\n border: 1px solid #ddd;\n border-radius: 3px;\n padding: 3px;\n right: 10px;\n opacity: 0;\n min-width: 110px;\n transition: .15s ease all;\n pointer-events: none\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n opacity: 1;\n pointer-events: all;\n transition: .15s ease all\n}\n\n.apexcharts-menu-item {\n padding: 6px 7px;\n font-size: 12px;\n cursor: pointer\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n background: #eee\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n background: rgba(0, 0, 0, .7);\n color: #fff\n}\n\n@media screen and (min-width:768px) {\n .apexcharts-canvas:hover .apexcharts-toolbar {\n opacity: 1\n }\n}\n\n.apexcharts-canvas .apexcharts-element-hidden,\n.apexcharts-datalabel.apexcharts-element-hidden,\n.apexcharts-hide .apexcharts-series-points {\n opacity: 0;\n}\n\n.apexcharts-hidden-element-shown {\n opacity: 1;\n transition: 0.25s ease all;\n}\n\n.apexcharts-datalabel,\n.apexcharts-datalabel-label,\n.apexcharts-datalabel-value,\n.apexcharts-datalabels,\n.apexcharts-pie-label {\n cursor: default;\n pointer-events: none\n}\n\n.apexcharts-pie-label-delay {\n opacity: 0;\n animation-name: opaque;\n animation-duration: .3s;\n animation-fill-mode: forwards;\n animation-timing-function: ease\n}\n\n.apexcharts-radialbar-label {\n cursor: pointer;\n}\n\n.apexcharts-annotation-rect,\n.apexcharts-area-series .apexcharts-area,\n.apexcharts-gridline,\n.apexcharts-line,\n.apexcharts-point-annotation-label,\n.apexcharts-radar-series path:not(.apexcharts-marker),\n.apexcharts-radar-series polygon,\n.apexcharts-toolbar svg,\n.apexcharts-tooltip .apexcharts-marker,\n.apexcharts-xaxis-annotation-label,\n.apexcharts-yaxis-annotation-label,\n.apexcharts-zoom-rect,\n.no-pointer-events {\n pointer-events: none\n}\n\n.apexcharts-tooltip-active .apexcharts-marker {\n transition: .15s ease all\n}\n\n.resize-triggers {\n animation: 1ms resizeanim;\n visibility: hidden;\n opacity: 0;\n height: 100%;\n width: 100%;\n overflow: hidden\n}\n\n.contract-trigger:before,\n.resize-triggers,\n.resize-triggers>div {\n content: " ";\n display: block;\n position: absolute;\n top: 0;\n left: 0\n}\n\n.resize-triggers>div {\n height: 100%;\n width: 100%;\n background: #eee;\n overflow: auto\n}\n\n.contract-trigger:before {\n overflow: hidden;\n width: 200%;\n height: 200%\n}\n\n.apexcharts-bar-goals-markers {\n pointer-events: none\n}\n\n.apexcharts-bar-shadows {\n pointer-events: none\n}\n\n.apexcharts-rangebar-goals-markers {\n pointer-events: none\n}';var c=(null===(l=e.opts.chart)||void 0===l?void 0:l.nonce)||e.w.config.chart.nonce;c&&o.setAttribute("nonce",c),a?i.prepend(o):s.head.appendChild(o)}var u=e.create(e.w.config.series,{});if(!u)return t(e);e.mount(u).then((function(){"function"==typeof e.w.config.chart.events.mounted&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent("mounted",[e,e.w]),t(u)})).catch((function(e){n(e)}))}else n(new Error("Element not found"))}))}},{key:"create",value:function(e,t){var n=this,r=this.w;new ci(this).initModules();var i=this.w.globals;if(i.noData=!1,i.animationEnded=!1,!k.elementExists(this.el))return i.animationEnded=!0,this.destroy(),null;if(this.responsive.checkResponsiveConfig(t),r.config.xaxis.convertedCatToNumeric&&new Un(r.config).convertCatToNumericXaxis(r.config,this.ctx),this.core.setupElements(),"treemap"===r.config.chart.type&&(r.config.grid.show=!1,r.config.yaxis[0].show=!1),0===i.svgWidth)return i.animationEnded=!0,null;var a=e;e.forEach((function(e,t){e.hidden&&(a=n.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:t}))}));var s=Mn.checkComboSeries(a,r.config.chart.type);i.comboCharts=s.comboCharts,i.comboBarCount=s.comboBarCount;var o=a.every((function(e){return e.data&&0===e.data.length}));(0===a.length||o&&i.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(a),this.theme.init(),new Gn(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),i.noData&&i.collapsedSeries.length!==i.series.length&&!r.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),i.axisCharts&&(this.core.coreCalculations(),"category"!==r.config.xaxis.type&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=r.globals.minX,this.ctx.toolbar.maxX=r.globals.maxX),this.formatters.heatmapLabelFormatters(),new Mn(this).getLargestMarkerSize(),this.dimensions.plotCoords();var l=this.core.xySettings();this.grid.createGridMask();var c=this.core.plotChartType(a,l),u=new Kn(this);return u.bringForward(),r.config.dataLabels.background.enabled&&u.dataLabelsBackground(),this.core.shiftGraphPosition(),{elGraph:c,xyRatios:l,dimensions:{plot:{left:r.globals.translateX,top:r.globals.translateY,width:r.globals.gridWidth,height:r.globals.gridHeight}}}}},{key:"mount",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=this,r=n.w;return new Promise((function(i,a){if(null===n.el)return a(new Error("Not enough data to display or target element not found"));(null===t||r.globals.allSeriesCollapsed)&&n.series.handleNoData(),n.grid=new tr(n);var s,o,l=n.grid.drawGrid();if(n.annotations=new zn(n),n.annotations.drawImageAnnos(),n.annotations.drawTextAnnos(),"back"===r.config.grid.position&&(l&&r.globals.dom.elGraphical.add(l.el),null!=l&&null!==(s=l.elGridBorders)&&void 0!==s&&s.node&&r.globals.dom.elGraphical.add(l.elGridBorders)),Array.isArray(t.elGraph))for(var c=0;c0&&r.globals.memory.methodsToExec.forEach((function(e){e.method(e.params,!1,e.context)})),r.globals.axisCharts||r.globals.noData||n.core.resizeNonAxisCharts(),i(n)}))}},{key:"destroy",value:function(){window.removeEventListener("resize",this.windowResizeHandler),function(e,t){var n=di.get(t);n&&(n.disconnect(),di.delete(t))}(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach((function(t,n){t.id===k.escapeString(e)&&Apex._chartInstances.splice(n,1)})),new ui(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.w;return this.opts=e,s.globals.selection=void 0,e.series&&(this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map((function(e,n){return t.updateHelpers._extendSeries(e,n)}))),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),s.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,n,r,i,a)}},{key:"updateSeries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,t,n)}},{key:"appendSeries",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.w.config.series.slice();return r.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(r,t,n)}},{key:"appendData",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this;n.w.globals.dataChanged=!0,n.series.getPreviousPaths();for(var r=n.w.config.series.slice(),i=0;i0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.series.resetSeries(e,t)}},{key:"addEventListener",value:function(e,t){this.events.addEventListener(e,t)}},{key:"removeEventListener",value:function(e,t){this.events.removeEventListener(e,t)}},{key:"addXaxisAnnotation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addXaxisAnnotationExternal(e,t,r)}},{key:"addYaxisAnnotation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addYaxisAnnotationExternal(e,t,r)}},{key:"addPointAnnotation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this;n&&(r=n),r.annotations.addPointAnnotationExternal(e,t,r)}},{key:"clearAnnotations",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=this;e&&(t=e),t.annotations.clearAnnotations(t)}},{key:"removeAnnotation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=this;t&&(n=t),n.annotations.removeAnnotation(n,e)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(e,t){return this.coreUtils.getSeriesTotalsXRange(e,t)}},{key:"getHighestValueInSeries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new rr(this.ctx).getMinYMaxY(e).highestY}},{key:"getLowestValueInSeries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new rr(this.ctx).getMinYMaxY(e).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(e,t){return this.updateHelpers.toggleDataPointSelection(e,t)}},{key:"zoomX",value:function(e,t){this.ctx.toolbar.zoomUpdateOptions(e,t)}},{key:"setLocale",value:function(e){this.localization.setCurrentLocaleValues(e)}},{key:"dataURI",value:function(e){return new $n(this.ctx).dataURI(e)}},{key:"exportToCSV",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new $n(this.ctx).exportToCSV(e)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var e=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout((function(){e.w.globals.resized=!0,e.w.globals.dataChanged=!1,e.ctx.update()}),150)}},{key:"_windowResizeHandler",value:function(){var e=this.w.config.chart.redrawOnWindowResize;"function"==typeof e&&(e=e()),e&&this._windowResize()}}],[{key:"getChartByID",value:function(e){var t=k.escapeString(e);if(Apex._chartInstances){var n=Apex._chartInstances.filter((function(e){return e.id===t}))[0];return n&&n.chart}}},{key:"initOnLoad",value:function(){for(var t=document.querySelectorAll("[data-apexcharts]"),n=0;n2?i-2:0),s=2;s{"use strict";t.__esModule=!0,t.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(0===n.length)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),a=i.replace(/\/.*$/,"");return n.some((function(e){var t=e.trim().toLowerCase();return"."===t.charAt(0)?r.toLowerCase().endsWith(t):t.endsWith("/*")?a===t.replace(/\/.*$/,""):i===t}))}return!0}},223:(e,t,n)=>{var r=n(897).default,i=n(344).default,a=n(958).default,s=n(881).default;e.exports=function e(t,n,r){function i(s,o){if(!n[s]){if(!t[s]){if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,r)}return n[s].exports}for(var a=void 0,s=0;s{const a=this.workbook.addWorksheet(t.sheetName),s=t.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],l=t.map||function(e){if(""===e)return null;const t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t;const n=s.reduce(((t,n)=>{if(t)return t;const r=o(e,n,!0);return r.isValid()?r:null}),null);if(n)return new Date(n.valueOf());const r=u[e];return void 0!==r?r:e},c=i.parse(t.parserOptions).on("data",(e=>{a.addRow(e.map(l))})).on("end",(()=>{c.emit("worksheet",a)}));c.on("worksheet",n).on("error",r),e.pipe(c)}))}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(e,t){return new Promise(((n,r)=>{t=t||{};const a=this.workbook.getWorksheet(t.sheetName||t.sheetId),s=i.format(t.formatterOptions);e.on("finish",(()=>{n()})),s.on("error",r),s.pipe(e);const{dateFormat:l,dateUTC:c}=t,u=t.map||(e=>{if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||"";if(e.formula||e.result)return e.result||"";if(e instanceof Date)return l?c?o.utc(e).format(l):o(e).format(l):c?o.utc(e).format():o(e).format();if(e.error)return e.error;if("object"==typeof e)return JSON.stringify(e)}return e}),d=void 0===t.includeEmptyRows||t.includeEmptyRows;let h=1;a&&a.eachRow(((e,t)=>{if(d)for(;h++2&&void 0!==arguments[2]?arguments[2]:0;if(this.worksheet=e,t)if("string"==typeof t){const e=r.decodeAddress(t);this.nativeCol=e.col+n,this.nativeColOff=0,this.nativeRow=e.row+n,this.nativeRowOff=0}else void 0!==t.nativeCol?(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0):void 0!==t.col?(this.col=t.col+n,this.row=t.row+n):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(e){return e instanceof i||null==e?e:new i(e)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(e){this.nativeCol=Math.floor(e),this.nativeColOff=Math.floor((e-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(e){this.nativeRow=Math.floor(e),this.nativeRowOff=Math.floor((e-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(e){this.nativeCol=e.nativeCol,this.nativeColOff=e.nativeColOff,this.nativeRow=e.nativeRow,this.nativeRowOff=e.nativeRowOff}}t.exports=i},{"../utils/col-cache":19}],3:[function(e,t,n){"use strict";const r=e("../utils/col-cache"),i=e("../utils/under-dash"),a=e("./enums"),{slideFormula:s}=e("../utils/shared-formula"),o=e("./note");class l{constructor(e,t,n){if(!e||!t)throw new Error("A Cell needs a Row");this._row=e,this._column=t,r.validateAddress(n),this._address=n,this._value=c.create(l.Types.Null,this),this.style=this._mergeStyle(e.style,t.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(e){this.style.numFmt=e}get font(){return this.style.font}set font(e){this.style.font=e}get alignment(){return this.style.alignment}set alignment(e){this.style.alignment=e}get border(){return this.style.border}set border(e){this.style.border=e}get fill(){return this.style.fill}set fill(e){this.style.fill=e}get protection(){return this.style.protection}set protection(e){this.style.protection=e}_mergeStyle(e,t,n){const r=e&&e.numFmt||t&&t.numFmt;r&&(n.numFmt=r);const i=e&&e.font||t&&t.font;i&&(n.font=i);const a=e&&e.alignment||t&&t.alignment;a&&(n.alignment=a);const s=e&&e.border||t&&t.border;s&&(n.border=s);const o=e&&e.fill||t&&t.fill;o&&(n.fill=o);const l=e&&e.protection||t&&t.protection;return l&&(n.protection=l),n}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return"$".concat(this._column.letter,"$").concat(this.row)}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===l.Types.Merge}merge(e,t){this._value.release(),this._value=c.create(l.Types.Merge,this,e),t||(this.style=e.style)}unmerge(){this.type===l.Types.Merge&&(this._value.release(),this._value=c.create(l.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(e){return this._value.type===l.Types.Merge&&this._value.isMergedTo(e)}get master(){return this.type===l.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===l.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(e){this.type!==l.Types.Merge?(this._value.release(),this._value=c.create(c.getType(e),this,e)):this._value.master.value=e}get note(){return this._comment&&this._comment.note}set note(e){this._comment=new o(e)}get text(){return this._value.toString()}get html(){return i.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(e){this.type===l.Types.String&&(this._value=c.create(l.Types.Hyperlink,this,{text:this._value.value,hyperlink:e}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:e}=this._row;return{sheetName:e.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(e){this.names=[e]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(e){const{definedNames:t}=this.workbook;t.removeAllNames(this.fullAddress),e.forEach((e=>{t.addEx(this.fullAddress,e)}))}addName(e){this.workbook.definedNames.addEx(this.fullAddress,e)}removeName(e){this.workbook.definedNames.removeEx(this.fullAddress,e)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(e){this._dataValidations.add(this.address,e)}get model(){const{model:e}=this._value;return e.style=this.style,this._comment&&(e.comment=this._comment.model),e}set model(e){this._value.release(),this._value=c.create(e.type,this),this._value.model=e,e.comment&&"note"===e.comment.type&&(this._comment=o.fromModel(e.comment)),e.style?this.style=e.style:this.style={}}}l.Types=a.ValueType;const c={getType:e=>null==e?l.Types.Null:e instanceof String||"string"==typeof e?l.Types.String:"number"==typeof e?l.Types.Number:"boolean"==typeof e?l.Types.Boolean:e instanceof Date?l.Types.Date:e.text&&e.hyperlink?l.Types.Hyperlink:e.formula||e.sharedFormula?l.Types.Formula:e.richText?l.Types.RichText:e.sharedString?l.Types.SharedString:e.error?l.Types.Error:l.Types.JSON,types:[{t:l.Types.Null,f:class{constructor(e){this.model={address:e.address,type:l.Types.Null}}get value(){return null}set value(e){}get type(){return l.Types.Null}get effectiveType(){return l.Types.Null}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return""}release(){}toString(){return""}}},{t:l.Types.Number,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.Number,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return l.Types.Number}get effectiveType(){return l.Types.Number}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:l.Types.String,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return l.Types.String}get effectiveType(){return l.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return'"'.concat(this.model.value.replace(/"/g,'""'),'"')}release(){}toString(){return this.model.value}}},{t:l.Types.Date,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.Date,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return l.Types.Date}get effectiveType(){return l.Types.Date}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:l.Types.Hyperlink,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.Hyperlink,text:t?t.text:void 0,hyperlink:t?t.hyperlink:void 0},t&&t.tooltip&&(this.model.tooltip=t.tooltip)}get value(){const e={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(e.tooltip=this.model.tooltip),e}set value(e){this.model={text:e.text,hyperlink:e.hyperlink},e.tooltip&&(this.model.tooltip=e.tooltip)}get text(){return this.model.text}set text(e){this.model.text=e}get hyperlink(){return this.model.hyperlink}set hyperlink(e){this.model.hyperlink=e}get type(){return l.Types.Hyperlink}get effectiveType(){return l.Types.Hyperlink}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:l.Types.Formula,f:class{constructor(e,t){this.cell=e,this.model={address:e.address,type:l.Types.Formula,shareType:t?t.shareType:void 0,ref:t?t.ref:void 0,formula:t?t.formula:void 0,sharedFormula:t?t.sharedFormula:void 0,result:t?t.result:void 0}}_copyModel(e){const t={},n=n=>{const r=e[n];r&&(t[n]=r)};return n("formula"),n("result"),n("ref"),n("shareType"),n("sharedFormula"),t}get value(){return this._copyModel(this.model)}set value(e){this.model=this._copyModel(e)}validate(e){switch(c.getType(e)){case l.Types.Null:case l.Types.String:case l.Types.Number:case l.Types.Date:break;case l.Types.Hyperlink:case l.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(e){this.model.formula=e}get formulaType(){return this.model.formula?a.FormulaType.Master:this.model.sharedFormula?a.FormulaType.Shared:a.FormulaType.None}get result(){return this.model.result}set result(e){this.model.result=e}get type(){return l.Types.Formula}get effectiveType(){const e=this.model.result;return null==e?a.ValueType.Null:e instanceof String||"string"==typeof e?a.ValueType.String:"number"==typeof e?a.ValueType.Number:e instanceof Date?a.ValueType.Date:e.text&&e.hyperlink?a.ValueType.Hyperlink:e.formula?a.ValueType.Formula:a.ValueType.Null}get address(){return this.model.address}set address(e){this.model.address=e}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:e}=this.cell,t=e.findCell(this.model.sharedFormula);this._translatedFormula=t&&s(t.formula,t.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:l.Types.Merge,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.Merge,master:t?t.address:void 0},this._master=t,t&&t.addMergeRef()}get value(){return this._master.value}set value(e){e instanceof l?(this._master&&this._master.releaseMergeRef(),e.addMergeRef(),this._master=e):this._master.value=e}isMergedTo(e){return e===this._master}get master(){return this._master}get type(){return l.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:l.Types.JSON,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.String,value:JSON.stringify(t),rawValue:t}}get value(){return this.model.rawValue}set value(e){this.model.rawValue=e,this.model.value=JSON.stringify(e)}get type(){return l.Types.String}get effectiveType(){return l.Types.String}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:l.Types.SharedString,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.SharedString,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return l.Types.SharedString}get effectiveType(){return l.Types.SharedString}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:l.Types.RichText,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.String,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}toString(){return this.model.value.richText.map((e=>e.text)).join("")}get type(){return l.Types.RichText}get effectiveType(){return l.Types.RichText}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return'"'.concat(this.text.replace(/"/g,'""'),'"')}release(){}}},{t:l.Types.Boolean,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.Boolean,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return l.Types.Boolean}get effectiveType(){return l.Types.Boolean}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:l.Types.Error,f:class{constructor(e,t){this.model={address:e.address,type:l.Types.Error,value:t}}get value(){return this.model.value}set value(e){this.model.value=e}get type(){return l.Types.Error}get effectiveType(){return l.Types.Error}get address(){return this.model.address}set address(e){this.model.address=e}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce(((e,t)=>(e[t.t]=t.f,e)),[]),create(e,t,n){const r=this.types[e];if(!r)throw new Error("Could not create Value of type "+e);return new r(t,n)}};t.exports=l},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(e,t,n){"use strict";const r=e("../utils/under-dash"),i=e("./enums"),a=e("../utils/col-cache");class s{constructor(e,t,n){this._worksheet=e,this._number=t,!1!==n&&(this.defn=n)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return a.n2l(this._number)}get isCustomWidth(){return void 0!==this.width&&9!==this.width}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(e){e?(this.key=e.key,this.width=void 0!==e.width?e.width:9,this.outlineLevel=e.outlineLevel,e.style?this.style=e.style:this.style={},this.header=e.header,this._hidden=!!e.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(e){void 0!==e?(this._header=e,this.headers.forEach(((e,t)=>{this._worksheet.getCell(t+1,this.number).value=e}))):this._header=void 0}get key(){return this._key}set key(e){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=e,e&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(e){return this.width===e.width&&this.hidden===e.hidden&&this.outlineLevel===e.outlineLevel&&r.isEqual(this.style,e.style)}get isDefault(){if(this.isCustomWidth)return!1;if(this.hidden)return!1;if(this.outlineLevel)return!1;const e=this.style;return!e||!(e.font||e.numFmt||e.alignment||e.border||e.fill||e.protection)}get headerCount(){return this.headers.length}eachCell(e,t){const n=this.number;t||(t=e,e=null),this._worksheet.eachRow(e,((e,r)=>{t(e.getCell(n),r)}))}get values(){const e=[];return this.eachCell(((t,n)=>{t&&t.type!==i.ValueType.Null&&(e[n]=t.value)})),e}set values(e){if(!e)return;const t=this.number;let n=0;e.hasOwnProperty("0")&&(n=1),e.forEach(((e,r)=>{this._worksheet.getCell(r+n,t).value=e}))}_applyStyle(e,t){return this.style[e]=t,this.eachCell((n=>{n[e]=t})),t}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}static toModel(e){const t=[];let n=null;return e&&e.forEach(((e,r)=>{e.isDefault?n&&(n=null):n&&e.equivalentTo(n)?n.max=r+1:(n={min:r+1,max:r+1,width:void 0!==e.width?e.width:9,style:e.style,isCustomWidth:e.isCustomWidth,hidden:e.hidden,outlineLevel:e.outlineLevel,collapsed:e.collapsed},t.push(n))})),t.length?t:void 0}static fromModel(e,t){const n=[];let r=1,i=0;for(t=(t=t||[]).sort((function(e,t){return e.min-t.min}));i{t.removeCellEx(e)}))}forEach(e){r.each(this.matrixMap,((t,n)=>{t.forEach((t=>{e(n,t)}))}))}getNames(e){return this.getNamesEx(i.decodeEx(e))}getNamesEx(e){return r.map(this.matrixMap,((t,n)=>t.findCellEx(e)&&n)).filter(Boolean)}_explore(e,t){t.mark=!1;const{sheetName:n}=t,r=new s(t.row,t.col,t.row,t.col,n);let i,a;function o(i,a){const s=e.findCellAt(n,i,t.col);return!(!s||!s.mark)&&(r[a]=i,s.mark=!1,!0)}for(a=t.row-1;o(a,"top");a--);for(a=t.row+1;o(a,"bottom");a++);function l(t,i){const s=[];for(a=r.top;a<=r.bottom;a++){const r=e.findCellAt(n,a,t);if(!r||!r.mark)return!1;s.push(r)}r[i]=t;for(let e=0;e{e.mark=!0})),{name:e,ranges:t.map((e=>e.mark&&this._explore(t,e))).filter(Boolean).map((e=>e.$shortRange))}):{name:e,ranges:[]}}normaliseMatrix(e,t){e.forEachInSheet(t,((e,t,n)=>{e&&(e.row===t&&e.col===n||(e.row=t,e.col=n,e.address=i.n2l(n)+t))}))}spliceRows(e,t,n,i){r.each(this.matrixMap,(r=>{r.spliceRows(e,t,n,i),this.normaliseMatrix(r,e)}))}spliceColumns(e,t,n,i){r.each(this.matrixMap,(r=>{r.spliceColumns(e,t,n,i),this.normaliseMatrix(r,e)}))}get model(){return r.map(this.matrixMap,((e,t)=>this.getRanges(t,e))).filter((e=>e.ranges.length))}set model(e){const t=this.matrixMap={};e.forEach((e=>{const n=t[e.name]=new a;e.ranges.forEach((e=>{o.test(e.split("!").pop()||"")&&n.addCell(e)}))}))}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(e,t,n){"use strict";t.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(e,t,n){"use strict";const r=e("../utils/col-cache"),i=e("./anchor");t.exports=class{constructor(e,t){this.worksheet=e,this.model=t}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(e){let{type:t,imageId:n,range:a,hyperlinks:s}=e;if(this.type=t,this.imageId=n,"image"===t)if("string"==typeof a){const e=r.decode(a);this.range={tl:new i(this.worksheet,{col:e.left,row:e.top},-1),br:new i(this.worksheet,{col:e.right,row:e.bottom},0),editAs:"oneCell"}}else this.range={tl:new i(this.worksheet,a.tl,0),br:a.br&&new i(this.worksheet,a.br,0),ext:a.ext,editAs:a.editAs,hyperlinks:s||a.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(e,t,n){"use strict";const r=e("../utils/under-dash");class i{constructor(e){this.note=e}get model(){let e=null;return e="string"===typeof this.note?{type:"note",note:{texts:[{text:this.note}]}}:{type:"note",note:this.note},r.deepMerge({},i.DEFAULT_CONFIGS,e)}set model(e){const{note:t}=e,{texts:n}=t;1===n.length&&1===Object.keys(n[0]).length?this.note=n[0].text:this.note=t}static fromModel(e){const t=new i;return t.model=e,t}}i.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},t.exports=i},{"../utils/under-dash":26}],10:[function(e,t,n){"use strict";const r=e("../utils/col-cache");class i{constructor(){this.decode(arguments)}setTLBR(e,t,n,i,a){if(arguments.length<4){const i=r.decodeAddress(e),s=r.decodeAddress(t);this.model={top:Math.min(i.row,s.row),left:Math.min(i.col,s.col),bottom:Math.max(i.row,s.row),right:Math.max(i.col,s.col),sheetName:n},this.setTLBR(i.row,i.col,s.row,s.col,a)}else this.model={top:Math.min(e,n),left:Math.min(t,i),bottom:Math.max(e,n),right:Math.max(t,i),sheetName:a}}decode(e){switch(e.length){case 5:this.setTLBR(e[0],e[1],e[2],e[3],e[4]);break;case 4:this.setTLBR(e[0],e[1],e[2],e[3]);break;case 3:this.setTLBR(e[0],e[1],e[2]);break;case 2:this.setTLBR(e[0],e[1]);break;case 1:{const t=e[0];if(t instanceof i)this.model={top:t.model.top,left:t.model.left,bottom:t.model.bottom,right:t.model.right,sheetName:t.sheetName};else if(t instanceof Array)this.decode(t);else if(t.top&&t.left&&t.bottom&&t.right)this.model={top:t.top,left:t.left,bottom:t.bottom,right:t.right,sheetName:t.sheetName};else{const e=r.decodeEx(t);e.top?this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName}:this.model={top:e.row,left:e.col,bottom:e.row,right:e.col,sheetName:e.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+e.length)}}get top(){return this.model.top||1}set top(e){this.model.top=e}get left(){return this.model.left||1}set left(e){this.model.left=e}get bottom(){return this.model.bottom||1}set bottom(e){this.model.bottom=e}get right(){return this.model.right||1}set right(e){this.model.right=e}get sheetName(){return this.model.sheetName}set sheetName(e){this.model.sheetName=e}get _serialisedSheetName(){const{sheetName:e}=this.model;return e?/^[a-zA-Z0-9]*$/.test(e)?e+"!":"'".concat(e,"'!"):""}expand(e,t,n,r){(!this.model.top||ethis.bottom)&&(this.bottom=n),(!this.model.right||r>this.right)&&(this.right=r)}expandRow(e){if(e){const{dimensions:t,number:n}=e;t&&this.expand(n,t.min,n,t.max)}}expandToAddress(e){const t=r.decodeEx(e);this.expand(t.row,t.col,t.row,t.col)}get tl(){return r.n2l(this.left)+this.top}get $t$l(){return"$".concat(r.n2l(this.left),"$").concat(this.top)}get br(){return r.n2l(this.right)+this.bottom}get $b$r(){return"$".concat(r.n2l(this.right),"$").concat(this.bottom)}get range(){return"".concat(this._serialisedSheetName+this.tl,":").concat(this.br)}get $range(){return"".concat(this._serialisedSheetName+this.$t$l,":").concat(this.$b$r)}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(e){return(!e.sheetName||!this.sheetName||e.sheetName===this.sheetName)&&!(e.bottomthis.bottom)&&!(e.rightthis.right)}contains(e){const t=r.decodeEx(e);return this.containsEx(t)}containsEx(e){return(!e.sheetName||!this.sheetName||e.sheetName===this.sheetName)&&e.row>=this.top&&e.row<=this.bottom&&e.col>=this.left&&e.col<=this.right}forEachAddress(e){for(let t=this.left;t<=this.right;t++)for(let n=this.top;n<=this.bottom;n++)e(r.encodeAddress(n,t),n,t)}}t.exports=i},{"../utils/col-cache":19}],11:[function(e,t,n){"use strict";const r=e("../utils/under-dash"),i=e("./enums"),a=e("../utils/col-cache"),s=e("./cell");t.exports=class{constructor(e,t){this._worksheet=e,this._number=t,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(e){return this._cells[e-1]}getCellEx(e){let t=this._cells[e.col-1];if(!t){const n=this._worksheet.getColumn(e.col);t=new s(this,n,e.address),this._cells[e.col-1]=t}return t}getCell(e){if("string"==typeof e){const t=this._worksheet.getColumnKey(e);e=t?t.number:a.l2n(e)}return this._cells[e-1]||this.getCellEx({address:a.encodeAddress(this._number,e),row:this._number,col:e})}splice(e,t){const n=e+t;for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a0)for(l=o;l>=n;l--)c=this._cells[l-1],c?(u=this.getCell(l+s),u.value=c.value,u.style=c.style,u._comment=c._comment):this._cells[l+s-1]=void 0;for(l=0;l{e&&e.type!==i.ValueType.Null&&t(e,n+1)}))}addPageBreak(e,t){const n=this._worksheet,r=Math.max(0,e-1)||0,i=Math.max(0,t-1)||16838,a={id:this._number,max:i,man:1};r&&(a.min=r),n.rowBreaks.push(a)}get values(){const e=[];return this._cells.forEach((t=>{t&&t.type!==i.ValueType.Null&&(e[t.col]=t.value)})),e}set values(e){if(this._cells=[],e)if(e instanceof Array){let t=0;e.hasOwnProperty("0")&&(t=1),e.forEach(((e,n)=>{void 0!==e&&(this.getCellEx({address:a.encodeAddress(this._number,n+t),row:this._number,col:n+t}).value=e)}))}else this._worksheet.eachColumnKey(((t,n)=>{void 0!==e[n]&&(this.getCellEx({address:a.encodeAddress(this._number,t.number),row:this._number,col:t.number}).value=e[n])}))}get hasValues(){return r.some(this._cells,(e=>e&&e.type!==i.ValueType.Null))}get cellCount(){return this._cells.length}get actualCellCount(){let e=0;return this.eachCell((()=>{e++})),e}get dimensions(){let e=0,t=0;return this._cells.forEach((n=>{n&&n.type!==i.ValueType.Null&&((!e||e>n.col)&&(e=n.col),t0?{min:e,max:t}:null}_applyStyle(e,t){return this.style[e]=t,this._cells.forEach((n=>{n&&(n[e]=t)})),t}get numFmt(){return this.style.numFmt}set numFmt(e){this._applyStyle("numFmt",e)}get font(){return this.style.font}set font(e){this._applyStyle("font",e)}get alignment(){return this.style.alignment}set alignment(e){this._applyStyle("alignment",e)}get protection(){return this.style.protection}set protection(e){this._applyStyle("protection",e)}get border(){return this.style.border}set border(e){this._applyStyle("border",e)}get fill(){return this.style.fill}set fill(e){this._applyStyle("fill",e)}get hidden(){return!!this._hidden}set hidden(e){this._hidden=e}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(e){this._outlineLevel=e}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const e=[];let t=0,n=0;return this._cells.forEach((r=>{if(r){const i=r.model;i&&((!t||t>r.col)&&(t=r.col),n{switch(e.type){case s.Types.Merge:break;default:{let n;if(e.address)n=a.decodeAddress(e.address);else if(t){const{row:e}=t,r=t.col+1;n={row:e,col:r,address:a.encodeAddress(e,r),$col$row:"$".concat(a.n2l(r),"$").concat(e)}}t=n,this.getCellEx(n).model=e;break}}})),e.height?this.height=e.height:delete this.height,this.hidden=e.hidden,this.outlineLevel=e.outlineLevel||0,this.style=e.style&&JSON.parse(JSON.stringify(e.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(e,t,n){"use strict";const r=e("../utils/col-cache");class i{constructor(e,t,n){this.table=e,this.column=t,this.index=n}_set(e,t){this.table.cacheState(),this.column[e]=t}get name(){return this.column.name}set name(e){this._set("name",e)}get filterButton(){return this.column.filterButton}set filterButton(e){this.column.filterButton=e}get style(){return this.column.style}set style(e){this.column.style=e}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(e){this._set("totalsRowLabel",e)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(e){this._set("totalsRowFunction",e)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(e){this._set("totalsRowResult",e)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(e){this._set("totalsRowFormula",e)}}t.exports=class{constructor(e,t){this.worksheet=e,t&&(this.table=t,this.validate(),this.store())}getFormula(e){switch(e.totalsRowFunction){case"none":return null;case"average":return"SUBTOTAL(101,".concat(this.table.name,"[").concat(e.name,"])");case"countNums":return"SUBTOTAL(102,".concat(this.table.name,"[").concat(e.name,"])");case"count":return"SUBTOTAL(103,".concat(this.table.name,"[").concat(e.name,"])");case"max":return"SUBTOTAL(104,".concat(this.table.name,"[").concat(e.name,"])");case"min":return"SUBTOTAL(105,".concat(this.table.name,"[").concat(e.name,"])");case"stdDev":return"SUBTOTAL(106,".concat(this.table.name,"[").concat(e.name,"])");case"var":return"SUBTOTAL(107,".concat(this.table.name,"[").concat(e.name,"])");case"sum":return"SUBTOTAL(109,".concat(this.table.name,"[").concat(e.name,"])");case"custom":return e.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+e.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:e}=this,t=(e,t,n)=>{void 0===e[t]&&(e[t]=n)};t(e,"headerRow",!0),t(e,"totalsRow",!1),t(e,"style",{}),t(e.style,"theme","TableStyleMedium2"),t(e.style,"showFirstColumn",!1),t(e.style,"showLastColumn",!1),t(e.style,"showRowStripes",!1),t(e.style,"showColumnStripes",!1);const n=(e,t)=>{if(!e)throw new Error(t)};n(e.ref,"Table must have ref"),n(e.columns,"Table must have column definitions"),n(e.rows,"Table must have row definitions"),e.tl=r.decodeAddress(e.ref);const{row:i,col:a}=e.tl;n(i>0,"Table must be on valid row"),n(a>0,"Table must be on valid col");const{width:s,filterHeight:o,tableHeight:l}=this;e.autoFilterRef=r.encode(i,a,i+o-1,a+s-1),e.tableRef=r.encode(i,a,i+l-1,a+s-1),e.columns.forEach(((e,r)=>{n(e.name,"Column ".concat(r," must have a name")),0===r?t(e,"totalsRowLabel","Total"):(t(e,"totalsRowFunction","none"),e.totalsRowFormula=this.getFormula(e))}))}store(){const e=(e,t)=>{t&&Object.keys(t).forEach((n=>{e[n]=t[n]}))},{worksheet:t,table:n}=this,{row:r,col:i}=n.tl;let a=0;if(n.headerRow){const s=t.getRow(r+a++);n.columns.forEach(((t,n)=>{const{style:r,name:a}=t,o=s.getCell(i+n);o.value=a,e(o,r)}))}if(n.rows.forEach((s=>{const o=t.getRow(r+a++);s.forEach(((t,r)=>{const a=o.getCell(i+r);a.value=t,e(a,n.columns[r].style)}))})),n.totalsRow){const s=t.getRow(r+a++);n.columns.forEach(((t,n)=>{const r=s.getCell(i+n);if(0===n)r.value=t.totalsRowLabel;else{const e=this.getFormula(t);r.value=e?{formula:t.totalsRowFormula,result:t.totalsRowResult}:null}e(r,t.style)}))}}load(e){const{table:t}=this,{row:n,col:r}=t.tl;let i=0;if(t.headerRow){const a=e.getRow(n+i++);t.columns.forEach(((e,t)=>{a.getCell(r+t).value=e.name}))}if(t.rows.forEach((t=>{const a=e.getRow(n+i++);t.forEach(((e,t)=>{a.getCell(r+t).value=e}))})),t.totalsRow){const a=e.getRow(n+i++);t.columns.forEach(((e,t)=>{const n=a.getCell(r+t);0===t?n.value=e.totalsRowLabel:this.getFormula(e)&&(n.value={formula:e.totalsRowFormula,result:e.totalsRowResult})}))}}get model(){return this.table}set model(e){this.table=e}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const e=r.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:1;this.cacheState(),this.table.rows.splice(e,t)}getColumn(e){const t=this.table.columns[e];return new i(this,t,e)}addColumn(e,t,n){this.cacheState(),void 0===n?(this.table.columns.push(e),this.table.rows.forEach(((e,n)=>{e.push(t[n])}))):(this.table.columns.splice(n,0,e),this.table.rows.forEach(((e,r)=>{e.splice(n,0,t[r])})))}removeColumns(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cacheState(),this.table.columns.splice(e,t),this.table.rows.forEach((n=>{n.splice(e,t)}))}_assign(e,t,n){this.cacheState(),e[t]=n}get ref(){return this.table.ref}set ref(e){this._assign(this.table,"ref",e)}get name(){return this.table.name}set name(e){this.table.name=e}get displayName(){return this.table.displyName||this.table.name}set displayNamename(e){this.table.displayName=e}get headerRow(){return this.table.headerRow}set headerRow(e){this._assign(this.table,"headerRow",e)}get totalsRow(){return this.table.totalsRow}set totalsRow(e){this._assign(this.table,"totalsRow",e)}get theme(){return this.table.style.name}set theme(e){this.table.style.name=e}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(e){this.table.style.showFirstColumn=e}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(e){this.table.style.showLastColumn=e}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(e){this.table.style.showRowStripes=e}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(e){this.table.style.showColumnStripes=e}}},{"../utils/col-cache":19}],13:[function(e,t,n){"use strict";const r=e("./worksheet"),i=e("./defined-names"),a=e("../xlsx/xlsx"),s=e("../csv/csv");t.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new i}get xlsx(){return this._xlsx||(this._xlsx=new a(this)),this._xlsx}get csv(){return this._csv||(this._csv=new s(this)),this._csv}get nextId(){for(let e=1;e(t&&t.orderNo)>e?t.orderNo:e),0),a=Object.assign({},t,{id:n,name:e,orderNo:i+1,workbook:this}),s=new r(a);return this._worksheets[n]=s,s}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){const t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){return void 0===e?this._worksheets.find(Boolean):"number"==typeof e?this._worksheets[e]:"string"==typeof e?this._worksheets.find((t=>t&&t.name===e)):void 0}get worksheets(){return this._worksheets.slice(1).sort(((e,t)=>e.orderNo-t.orderNo)).filter(Boolean)}eachSheet(e){this.worksheets.forEach((t=>{e(t,t.id)}))}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){const t=this.media.length;return this.media.push(Object.assign({},e,{type:"image"})),t}getImage(e){return this.media[e]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map((e=>e.model)),sheets:this.worksheets.map((e=>e.model)).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach((t=>{const{id:n,name:i,state:a}=t,s=e.sheets&&e.sheets.findIndex((e=>e.id===n));(this._worksheets[n]=new r({id:n,name:i,orderNo:s,state:a,workbook:this})).model=t})),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(e,t,n){"use strict";const r=e("../utils/under-dash"),i=e("../utils/col-cache"),a=e("./range"),s=e("./row"),o=e("./column"),l=e("./enums"),c=e("./image"),u=e("./table"),d=e("./data-validations"),h=e("../utils/encryptor"),{copyStyle:f}=e("../utils/copy-style");t.exports=class{constructor(e){e=e||{},this._workbook=e.workbook,this.id=e.id,this.orderNo=e.orderNo,this.name=e.name,this.state=e.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!e.pageSetup||!e.pageSetup.fitToWidth&&!e.pageSetup.fitToHeight||e.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new d,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(void 0===e&&(e="sheet"+this.id),this._name!==e){if("string"!=typeof e)throw new Error("The name has to be a string.");if(""===e)throw new Error("The name can't be empty.");if("History"===e)throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(e))throw new Error("Worksheet name ".concat(e," cannot include any of the following characters: * ? : \\ / [ ]"));if(/(^')|('$)/.test(e))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+e);if(e&&e.length>31&&(console.warn("Worksheet name ".concat(e," exceeds 31 chars. This will be truncated")),e=e.substring(0,31)),this._workbook._worksheets.find((t=>t&&t.name.toLowerCase()===e.toLowerCase())))throw new Error("Worksheet name already exists: "+e);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const e=new a;return this._rows.forEach((t=>{if(t){const n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}})),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce(((e,t)=>{const n=(t.header?1:t.headers&&t.headers.length)||0;return Math.max(e,n)}),0);let t=1;const n=this._columns=[];e.forEach((e=>{const r=new o(this,t++,!1);n.push(r),r.defn=e}))}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){r.each(this._keys,e)}getColumn(e){if("string"==typeof e){const t=this._keys[e];if(t)return t;e=i.l2n(e)}if(this._columns||(this._columns=[]),e>this._columns.length){let t=this._columns.length+1;for(;t<=e;)this._columns.push(new o(this,t++))}return this._columns[e-1]}spliceColumns(e,t){const n=this._rows.length;for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a0)for(let c=0;c{n.push(e[c]||null)}));const r=this.getRow(c+1);r.splice.apply(r,n)}else this._rows.forEach((n=>{n&&n.splice(e,t)}));const s=i.length-t,o=e+t,l=this._columns.length;if(s<0)for(let c=e+i.length;c<=l;c++)this.getColumn(c).defn=this.getColumn(c-s).defn;else if(s>0)for(let c=l;c>=o;c--)this.getColumn(c+s).defn=this.getColumn(c).defn;for(let c=e;c{e=Math.max(e,t.cellCount)})),e}get actualColumnCount(){const e=[];let t=0;return this.eachRow((n=>{n.eachCell((n=>{let{col:r}=n;e[r]||(e[r]=!0,t++)}))})),t}_commitRow(){}get _lastRowNumber(){const e=this._rows;let t=e.length;for(;t>0&&void 0===e[t-1];)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow((()=>{e++})),e}getRow(e){let t=this._rows[e-1];return t||(t=this._rows[e-1]=new s(this,e)),t}getRows(e,t){if(t<1)return;const n=[];for(let r=e;r1&&void 0!==arguments[1]?arguments[1]:"n";const n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,"i"===t[0]?t:"n"),r}addRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";const n=[];return e.forEach((e=>{n.push(this.addRow(e,t))})),n}insertRow(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"n";return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"n";if(this.spliceRows(e,0,...t),"n"!==n)for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:"n";"o"===t[0]&&void 0!==this.findRow(e+1)?this._copyStyle(e+1,e,"+"===t[1]):"i"===t[0]&&void 0!==this.findRow(e-1)&&this._copyStyle(e-1,e,"+"===t[1])}_copyStyle(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=this.getRow(e),i=this.getRow(t);i.style=f(r.style),r.eachCell({includeEmpty:n},((e,t)=>{i.getCell(t).style=f(e.style)})),i.height=r.height}duplicateRow(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=this._rows[e-1],i=new Array(t).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let a=0;a{t.getCell(n).style=e.style}))}}spliceRows(e,t){const n=e+t;for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a{e.getCell(n).style=t.style})),this._rows[c-1]=void 0}else this._rows[c+o-1]=void 0;else if(o>0)for(c=l;c>=n;c--)if(u=this._rows[c-1],u){const e=this.getRow(c+o);e.values=u.values,e.style=u.style,e.height=u.height,u.eachCell({includeEmpty:!0},((t,n)=>{if(e.getCell(n).style=t.style,"MergeValue"===t._value.constructor.name){const e=this.getRow(t._row._number+s).getCell(n),r=t._value._master,i=this.getRow(r._row._number+s).getCell(r._column._number);e.merge(i)}}))}else this._rows[c+o-1]=void 0;for(c=0;c{e&&e.hasValues&&t(e,e.number)}))}getSheetValues(){const e=[];return this._rows.forEach((t=>{t&&(e[t.number]=t.values)})),e}findCell(e,t){const n=i.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){const n=i.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(){for(var e=arguments.length,t=new Array(e),n=0;n{if(t.intersects(e))throw new Error("Cannot merge already merged cells")}));const n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){const t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return r.some(this._merges,Boolean)}unMergeCells(){for(var e=arguments.length,t=new Array(e),n=0;n3&&void 0!==arguments[3]?arguments[3]:"shared";const a=i.decode(e),{top:s,left:o,bottom:l,right:c}=a,u=c-o+1,d=i.encodeAddress(s,o),h="shared"===r;let f;f="function"==typeof n?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-s][t-o]:(e,t)=>n[(e-s)*u+(t-o)]:()=>{};let p=!0;for(let i=s;i<=l;i++)for(let n=o;n<=c;n++)p?(this.getCell(i,n).value={shareType:r,formula:t,ref:e,result:f(i,n)},p=!1):this.getCell(i,n).value=h?{sharedFormula:d,result:f(i,n)}:f(i,n)}addImage(e,t){const n={type:"image",imageId:e,range:t};this._media.push(new c(this,n))}getImages(){return this._media.filter((e=>"image"===e.type))}addBackgroundImage(e){const t={type:"background",imageId:e};this._media.push(new c(this,t))}getBackgroundImageId(){const e=this._media.find((e=>"background"===e.type));return e&&e.imageId}protect(e,t){return new Promise((n=>{this.sheetProtection={sheet:!0},t&&"spinCount"in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=h.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=t&&"spinCount"in t?t.spinCount:1e5,this.sheetProtection.hashValue=h.convertPasswordToHash(e,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&"spinCount"in t&&delete this.sheetProtection.spinCount),n()}))}unprotect(){this.sheetProtection=null}addTable(e){const t=new u(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){"number"==typeof e?this.conditionalFormattings.splice(e,1):this.conditionalFormattings=e instanceof Function?this.conditionalFormattings.filter(e):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(e){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=e}get model(){const e={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map((e=>e.model)),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((e=>e.model)),conditionalFormattings:this.conditionalFormattings};e.cols=o.toModel(this.columns);const t=e.rows=[],n=e.dimensions=new a;return this._rows.forEach((e=>{const r=e&&e.model;r&&(n.expand(r.number,r.min,r.number,r.max),t.push(r))})),e.merges=[],r.each(this._merges,(t=>{e.merges.push(t.range)})),e}_parseRows(e){this._rows=[],e.rows.forEach((e=>{const t=new s(this,e.number);this._rows[t.number-1]=t,t.model=e}))}_parseMergeCells(e){r.each(e.mergeCells,(e=>{this.mergeCellsWithoutStyle(e)}))}set model(e){this.name=e.name,this._columns=o.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new d(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map((e=>new c(this,e))),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce(((e,t)=>{const n=new u;return n.model=t,e[t.name]=n,e}),{}),this.conditionalFormattings=e.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(e,t,n){"use strict";e("core-js/modules/es.promise"),e("core-js/modules/es.promise.finally"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.values"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.async-iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.find-index"),e("core-js/modules/es.array.find"),e("core-js/modules/es.string.from-code-point"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.number.is-nan"),e("regenerator-runtime/runtime");const r={Workbook:e("./doc/workbook")},i=e("./doc/enums");Object.keys(i).forEach((e=>{r[e]=i[e]})),t.exports=r},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(e,t,n){"use strict";const r="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");n.bufferToString=function(e){return"string"==typeof e?e:r?r.decode(e):e.toString()}},{}],17:[function(e,t,n){"use strict";const r="undefined"==typeof TextEncoder?null:new TextEncoder("utf-8"),{Buffer:i}=e("buffer");n.stringToBuffer=function(e){return"string"!=typeof e?e:r?i.from(r.encode(e).buffer):i.from(e)}},{buffer:220}],18:[function(e,t,n){"use strict";const r=e("./under-dash"),i=e("./col-cache");t.exports=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(i.decodeEx(e))}getCell(e){return this.findCellEx(i.decodeEx(e),!0)}findCell(e){return this.findCellEx(i.decodeEx(e),!1)}findCellAt(e,t,n){const r=this.sheets[e],i=r&&r[t];return i&&i[n]}addCellEx(e){if(e.top)for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++)this.getCellAt(e.sheetName,t,n);else this.findCellEx(e,!0)}getCellEx(e){return this.findCellEx(e,!0)}findCellEx(e,t){const n=this.findSheet(e,t),r=this.findSheetRow(n,e,t);return this.findRowCell(r,e,t)}getCellAt(e,t,n){const r=this.sheets[e]||(this.sheets[e]=[]),a=r[t]||(r[t]=[]);return a[n]||(a[n]={sheetName:e,address:i.n2l(n)+t,row:t,col:n})}removeCellEx(e){const t=this.findSheet(e);if(!t)return;const n=this.findSheetRow(t,e);n&&delete n[e.col]}forEachInSheet(e,t){const n=this.sheets[e];n&&n.forEach(((e,n)=>{e&&e.forEach(((e,r)=>{e&&t(e,n,r)}))}))}forEach(e){r.each(this.sheets,((t,n)=>{this.forEachInSheet(n,e)}))}map(e){const t=[];return this.forEach((n=>{t.push(e(n))})),t}findSheet(e,t){const n=e.sheetName;return this.sheets[n]?this.sheets[n]:t?this.sheets[n]=[]:void 0}findSheetRow(e,t,n){const{row:r}=t;return e&&e[r]?e[r]:n?e[r]=[]:void 0}findRowCell(e,t,n){const{col:r}=t;return e&&e[r]?e[r]:n?e[r]=this.template?Object.assign(t,JSON.parse(JSON.stringify(this.template))):t:void 0}spliceRows(e,t,n,r){const i=this.sheets[e];if(i){const e=[];for(let t=0;t{r.splice(t,n,...e)}))}}}},{"./col-cache":19,"./under-dash":26}],19:[function(e,t,n){"use strict";const i=/^[A-Z]+\d+$/,a={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:e=>e<=26?1:e<=676?2:3,_fill(e){let t,n,r,i,a,s=1;if(e>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&e>=1){for(;s<=26;)t=this._dictionary[s-1],this._n2l[s]=t,this._l2n[t]=s,s++;this._l2nFill=1}if(this._l2nFill<2&&e>=2){for(s=27;s<=702;)n=s-27,r=n%26,i=Math.floor(n/26),t=this._dictionary[i]+this._dictionary[r],this._n2l[s]=t,this._l2n[t]=s,s++;this._l2nFill=2}if(this._l2nFill<3&&e>=3){for(s=703;s<=16384;)n=s-703,r=n%26,i=Math.floor(n/26)%26,a=Math.floor(n/676),t=this._dictionary[a]+this._dictionary[i]+this._dictionary[r],this._n2l[s]=t,this._l2n[t]=s,s++;this._l2nFill=3}},l2n(e){if(this._l2n[e]||this._fill(e.length),!this._l2n[e])throw new Error("Out of bounds. Invalid column letter: "+e);return this._l2n[e]},n2l(e){if(e<1||e>16384)throw new Error(e+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[e]||this._fill(this._level(e)),this._n2l[e]},_hash:{},validateAddress(e){if(!i.test(e))throw new Error("Invalid Address: "+e);return!0},decodeAddress(e){const t=e.length<5&&this._hash[e];if(t)return t;let n=!1,r="",i=0,a=!1,s="",o=0;for(let c,u=0;u=65&&c<=90)n=!0,r+=e[u],i=26*i+c-64;else if(c>=48&&c<=57)a=!0,s+=e[u],o=10*o+c-48;else if(a&&n&&36!==c)break;if(n){if(i>16384)throw new Error("Out of bounds. Invalid column letter: "+r)}else i=void 0;a||(o=void 0);const l={address:e=r+s,col:i,row:o,$col$row:"$".concat(r,"$").concat(s)};return i<=100&&o<=100&&(this._hash[e]=l,this._hash[l.$col$row]=l),l},getAddress(e,t){if(t){const n=this.n2l(t)+e;return this.decodeAddress(n)}return this.decodeAddress(e)},decode(e){const t=e.split(":");if(2===t.length){const e=this.decodeAddress(t[0]),n=this.decodeAddress(t[1]),r={top:Math.min(e.row,n.row),left:Math.min(e.col,n.col),bottom:Math.max(e.row,n.row),right:Math.max(e.col,n.col)};return r.tl=this.n2l(r.left)+r.top,r.br=this.n2l(r.right)+r.bottom,r.dimensions="".concat(r.tl,":").concat(r.br),r}return this.decodeAddress(e)},decodeEx(e){const t=e.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),n=t[1]||t[2],i=t[3],a=i.split(":");if(a.length>1){let e=this.decodeAddress(a[0]),t=this.decodeAddress(a[1]);const r=Math.min(e.row,t.row),i=Math.min(e.col,t.col),s=Math.max(e.row,t.row),o=Math.max(e.col,t.col);return e=this.n2l(i)+r,t=this.n2l(o)+s,{top:r,left:i,bottom:s,right:o,sheetName:n,tl:{address:e,col:i,row:r,$col$row:"$".concat(this.n2l(i),"$").concat(r),sheetName:n},br:{address:t,col:o,row:s,$col$row:"$".concat(this.n2l(o),"$").concat(s),sheetName:n},dimensions:"".concat(e,":").concat(t)}}if(i.startsWith("#"))return n?{sheetName:n,error:i}:{error:i};const s=this.decodeAddress(i);return n?r({sheetName:n},s):s},encodeAddress:(e,t)=>a.n2l(t)+e,encode(){switch(arguments.length){case 2:return a.encodeAddress(arguments[0],arguments[1]);case 4:return"".concat(a.encodeAddress(arguments[0],arguments[1]),":").concat(a.encodeAddress(arguments[2],arguments[3]));default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(e,t){const[n,r,,i,a]=e,[s,o]=t;return s>=n&&s<=i&&o>=r&&o<=a}};t.exports=a},{}],20:[function(e,t,n){"use strict";const i=(e,t)=>r(r({},e),t.reduce(((t,n)=>(e[n]&&(t[n]=r({},e[n])),t)),{})),a=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];e[n]&&(t[n]=i(e[n],r))};n.copyStyle=e=>{if(!e)return e;if(t=e,0===Object.keys(t).length)return{};var t;const n=r({},e);return a(e,n,"font",["color"]),a(e,n,"alignment"),a(e,n,"protection"),e.border&&(a(e,n,"border"),a(e.border,n.border,"top",["color"]),a(e.border,n.border,"left",["color"]),a(e.border,n.border,"bottom",["color"]),a(e.border,n.border,"right",["color"]),a(e.border,n.border,"diagonal",["color"])),e.fill&&(a(e,n,"fill",["fgColor","bgColor","center"]),e.fill.stops&&(n.fill.stops=e.fill.stops.map((e=>i(e,["color"]))))),n}},{}],21:[function(e,t,n){(function(n){(function(){"use strict";const r=e("crypto"),i={hash(e){const t=r.createHash(e);for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;sr.randomBytes(e)};t.exports=i}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(e,t,n){"use strict";const{SaxesParser:r}=e("saxes"),{PassThrough:o}=e("readable-stream"),{bufferToString:l}=e("./browser-buffer-decode");t.exports=function(){var e=a((function*(e){e.pipe&&!e[Symbol.asyncIterator]&&(e=e.pipe(new o));const t=new r;let n;t.on("error",(e=>{n=e}));let a=[];t.on("opentag",(e=>a.push({eventType:"opentag",value:e}))),t.on("text",(e=>a.push({eventType:"text",value:e}))),t.on("closetag",(e=>a.push({eventType:"closetag",value:e})));var c,u=!1,d=!1;try{for(var h,f=s(e);u=!(h=yield i(f.next())).done;u=!1){const e=h.value;if(t.write(l(e)),n)throw n;yield a,a=[]}}catch(p){d=!0,c=p}finally{try{u&&null!=f.return&&(yield i(f.return()))}finally{if(d)throw c}}}));return function(t){return e.apply(this,arguments)}}()},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(e,t,n){"use strict";const r=e("./col-cache"),i=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,a=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;t.exports={slideFormula:function(e,t,n){const s=r.decode(t),o=r.decode(n);return e.replace(i,((e,t,n,i,l)=>{if(l)return e;const c=a.exec(i);if(c){const n=c[1],i=c[2].toUpperCase(),a=c[3],l=c[4];if(i.length>3||3===i.length&&i>"XFD")return e;let u=r.l2n(i),d=parseInt(l,10);return n||(u+=o.col-s.col),a||(d+=o.row-s.row),(t||"")+(n||"")+r.n2l(u)+(a||"")+d}return e}))}}},{"./col-cache":19}],24:[function(e,t,n){(function(n,r){(function(){"use strict";const i=e("readable-stream"),a=e("./utils"),s=e("./string-buf");class o{constructor(e,t){this._data=e,this._encoding=t}get length(){return this.toBuffer().length}copy(e,t,n,r){return this.toBuffer().copy(e,t,n,r)}toBuffer(){return this._buffer||(this._buffer=r.from(this._data,this._encoding)),this._buffer}}class l{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){return this._data._buf.copy(e,t,n,r)}toBuffer(){return this._data.toBuffer()}}class c{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){this._data.copy(e,t,n,r)}toBuffer(){return this._data}}class u{constructor(e){this.size=e,this.buffer=r.alloc(e),this.iRead=0,this.iWrite=0}toBuffer(){if(0===this.iRead&&this.iWrite===this.size)return this.buffer;const e=r.alloc(this.iWrite-this.iRead);return this.buffer.copy(e,0,this.iRead,this.iWrite),e}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){let t;return 0===e?null:void 0===e||e>=this.length?(t=this.toBuffer(),this.iRead=this.iWrite,t):(t=r.alloc(e),this.buffer.copy(t,0,this.iRead,e),this.iRead+=e,t)}write(e,t,n){const r=Math.min(n,this.size-this.iWrite);return e.copy(this.buffer,this.iWrite,t,t+r),this.iWrite+=r,r}}const d=function(e){e=e||{},this.bufSize=e.bufSize||1048576,this.buffers=[],this.batch=e.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};a.inherits(d,i.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return r.concat(this.buffers.map((e=>e.toBuffer())))}},_getWritableBuffer(){if(this.buffers.length){const e=this.buffers[this.buffers.length-1];if(!e.full)return e}const e=new u(this.bufSize);return this.buffers.push(e),e},async _pipe(e){await Promise.all(this.pipes.map((function(t){return new Promise((n=>{t.write(e.toBuffer(),(()=>{n()}))}))})))},_writeToBuffers(e){let t=0;const n=e.length;for(;t1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(u),n.nextTick(i)):(await this._pipe(u),i());else this.paused||this.emit("data",u.toBuffer()),this._writeToBuffers(u),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(e,t,n){const r=e=>{e?n(e):(this._flush(),this.pipes.forEach((e=>{e.end()})),this.emit("finish"))};e?this.write(e,t,r):r()},read(e){let t;if(e){for(t=[];e&&this.buffers.length&&!this.buffers[0].eod;){const n=this.buffers[0],r=n.read(e);e-=r.length,t.push(r),n.eod&&n.full&&this.buffers.shift()}return r.concat(t)}return t=this.buffers.map((e=>e.toBuffer())).filter(Boolean),this.buffers=[],r.concat(t)},setEncoding(e){this.encoding=e},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(e){this.pipes.push(e),!this.paused&&this.buffers.length&&this.end()},unpipe(e){this.pipes=this.pipes.filter((t=>t!==e))},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),t.exports=d}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(e,t,n){(function(e){(function(){"use strict";t.exports=class{constructor(t){this._buf=e.alloc(t&&t.size||16384),this._encoding=t&&t.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=e.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(e){e=e||0,this._buffer=void 0,this._inPos=e}_grow(t){let n=2*this._buf.length;for(;n=this._buf.length-4;)this._grow(this._inPos+e.length),t=this._inPos+this._buf.write(e,this._inPos,this._encoding);this._inPos=t}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),e._buf.copy(this._buf,this._inPos,0,e.length),this._inPos+=e.length)}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220}],26:[function(e,t,n){"use strict";const{toString:r}=Object.prototype,i=/["&<>]/,a={each:function(e,t){e&&(Array.isArray(e)?e.forEach(t):Object.keys(e).forEach((n=>{t(e[n],n)})))},some:function(e,t){return!!e&&(Array.isArray(e)?e.some(t):Object.keys(e).some((n=>t(e[n],n))))},every:function(e,t){return!e||(Array.isArray(e)?e.every(t):Object.keys(e).every((n=>t(e[n],n))))},map:function(e,t){return e?Array.isArray(e)?e.map(t):Object.keys(e).map((n=>t(e[n],n))):[]},keyBy:(e,t)=>e.reduce(((e,n)=>(e[n[t]]=n,e)),{}),isEqual:function(e,t){const n=typeof e,r=typeof t,i=Array.isArray(e),s=Array.isArray(t);let o;if(n!==r)return!1;if("object"===typeof e){if(i||s)return!(!i||!s)&&e.length===t.length&&e.every(((e,n)=>{const r=t[n];return a.isEqual(e,r)}));if(null===e||null===t)return e===t;if(o=Object.keys(e),Object.keys(t).length!==o.length)return!1;for(const e of o)if(!t.hasOwnProperty(e))return!1;return a.every(e,((e,n)=>{const r=t[n];return a.isEqual(e,r)}))}return e===t},escapeHtml(e){const t=i.exec(e);if(!t)return e;let n="",r="",a=0,s=t.index;for(;s":r=">";break;default:continue}a!==s&&(n+=e.substring(a,s)),a=s+1,n+=r}return a!==s?n+e.substring(a,s):n},strcmp:(e,t)=>et?1:0,isUndefined:e=>"[object Undefined]"===r.call(e),isObject:e=>"[object Object]"===r.call(e),deepMerge(){const e=arguments[0]||{},{length:t}=arguments;let n,r,i;function s(t,s){n=e[s],i=Array.isArray(t),a.isObject(t)||i?(i?(i=!1,r=n&&Array.isArray(n)?n:[]):r=n&&a.isObject(n)?n:{},e[s]=a.deepMerge(r,t)):a.isUndefined(t)||(e[s]=t)}for(let o=0;o&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,s={nop(){},promiseImmediate:e=>new Promise((t=>{n.setImmediate?r((()=>{t(e)})):setTimeout((()=>{t(e)}),1)})),inherits:function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach((t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));const i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach((e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)})),e.prototype=Object.create(t.prototype,i)},dateToExcel:(e,t)=>25569+e.getTime()/864e5-(t?1462:0),excelToDate(e,t){const n=Math.round(24*(e-25569+(t?1462:0))*3600*1e3);return new Date(n)},parsePath(e){const t=e.lastIndexOf("/");return{path:e.substring(0,t),name:e.substring(t+1)}},getRelsPath(e){const t=s.parsePath(e);return"".concat(t.path,"/_rels/").concat(t.name,".rels")},xmlEncode(e){const t=a.exec(e);if(!t)return e;let n="",r="",i=0,s=t.index;for(;s=11&&13!==t)){r="";break}continue}i!==s&&(n+=e.substring(i,s)),i=s+1,r&&(n+=r)}return i!==s?n+e.substring(i,s):n},xmlDecode:e=>e.replace(/&([a-z]*);/g,(e=>{switch(e){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return e}})),validInt(e){const t=parseInt(e,10);return Number.isNaN(t)?0:t},isDateFmt:e=>!!e&&null!==(e=(e=e.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/),fs:{exists:e=>new Promise((t=>{i.access(e,i.constants.F_OK,(e=>{t(!e)}))}))},toIsoDateString:e=>e.toIsoString().subsstr(0,10),parseBoolean:e=>!0===e||"true"===e||1===e||"1"===e};t.exports=s}).call(this)}).call(this,"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{fs:216,timers:523}],28:[function(e,t,n){"use strict";const r=e("./under-dash"),i=e("./utils");function a(e,t,n){e.push(" ".concat(t,'="').concat(i.xmlEncode(n.toString()),'"'))}function s(e,t){if(t){const n=[];r.each(t,((e,t)=>{void 0!==e&&a(n,t,e)})),e.push(n.join(""))}}class o{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(e){const t=this._xml;t.push("\n")}openNode(e,t){const n=this.tos,r=this._xml;n&&this.open&&r.push(">"),this._stack.push(e),r.push("<"),r.push(e),s(r,t),this.leaf=!0,this.open=!0}addAttribute(e,t){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");void 0!==t&&a(this._xml,e,t)}addAttributes(e){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");s(this._xml,e)}writeText(e){const t=this._xml;this.open&&(t.push(">"),this.open=!1),this.leaf=!1,t.push(i.xmlEncode(e.toString()))}writeXml(e){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(e)}closeNode(){const e=this._stack.pop(),t=this._xml;this.leaf?t.push("/>"):(t.push("")),this.open=!1,this.leaf=!1}leafNode(e,t,n){this.openNode(e,t),void 0!==n&&this.writeText(n),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this.leaf=e.leaf,this.open=e.open}get xml(){return this.closeAll(),this._xml.join("")}}o.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},t.exports=o},{"./under-dash":26,"./utils":27}],29:[function(e,t,n){(function(n){(function(){"use strict";const r=e("events"),i=e("jszip"),a=e("./stream-buf"),{stringToBuffer:s}=e("./browser-buffer-encode");class o extends r.EventEmitter{constructor(e){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},e),this.zip=new i,this.stream=new a}append(e,t){t.hasOwnProperty("base64")&&t.base64?this.zip.file(t.name,e,{base64:!0}):(n.browser&&"string"==typeof e&&(e=s(e)),this.zip.file(t.name,e))}async finalize(){const e=await this.zip.generateAsync(this.options);this.stream.end(e),this.emit("finish")}read(e){return this.stream.read(e)}setEncoding(e){return this.stream.setEncoding(e)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(e,t){return this.stream.pipe(e,t)}unpipe(e){return this.stream.unpipe(e)}unshift(e){return this.stream.unshift(e)}wrap(e){return this.stream.wrap(e)}}t.exports={ZipWriter:o}}).call(this)}).call(this,e("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(e,t,n){"use strict";t.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5e74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5e74" mm"\u6708" dd"\u65e5"'},28:{"zh-tw":'[$-404]e"\u5e74"m"\u6708"d"\u65e5"',"zh-cn":'m"\u6708"d"\u65e5"',"ja-jp":'[$-411]ggge"\u5e74"m"\u6708"d"\u65e5"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"\u5e74"m"\u6708"d"\u65e5"',"zh-cn":'m"\u6708"d"\u65e5"',"ja-jp":'[$-411]ggge"\u5e74"m"\u6708"d"\u65e5"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"\u5e74"m"\u6708"d"\u65e5"',"zh-cn":'yyyy"\u5e74"m"\u6708"d"\u65e5"',"ja-jp":'yyyy"\u5e74"m"\u6708"d"\u65e5"',"ko-kr":'yyyy"\ub144" mm"\uc6d4" dd"\uc77c"'},32:{"zh-tw":'hh"\u6642"mm"\u5206"',"zh-cn":'h"\u65f6"mm"\u5206"',"ja-jp":'h"\u6642"mm"\u5206"',"ko-kr":'h"\uc2dc" mm"\ubd84"'},33:{"zh-tw":'hh"\u6642"mm"\u5206"ss"\u79d2"',"zh-cn":'h"\u65f6"mm"\u5206"ss"\u79d2"',"ja-jp":'h"\u6642"mm"\u5206"ss"\u79d2"',"ko-kr":'h"\uc2dc" mm"\ubd84" ss"\ucd08"'},34:{"zh-tw":'\u4e0a\u5348/\u4e0b\u5348 hh"\u6642"mm"\u5206"',"zh-cn":'\u4e0a\u5348/\u4e0b\u5348 h"\u65f6"mm"\u5206"',"ja-jp":'yyyy"\u5e74"m"\u6708"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'\u4e0a\u5348/\u4e0b\u5348 hh"\u6642"mm"\u5206"ss"\u79d2"',"zh-cn":'\u4e0a\u5348/\u4e0b\u5348 h"\u65f6"mm"\u5206"ss"\u79d2"',"ja-jp":'m"\u6708"d"\u65e5"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5e74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5e74" mm"\u6708" dd"\u65e5"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5e74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5e74" mm"\u6708" dd"\u65e5"'},51:{"zh-tw":'[$-404]e"\u5e74"m"\u6708"d"\u65e5"',"zh-cn":'m"\u6708"d"\u65e5"',"ja-jp":'[$-411]ggge"\u5e74"m"\u6708"d"\u65e5"',"ko-kr":"mm-dd"},52:{"zh-tw":'\u4e0a\u5348/\u4e0b\u5348 hh"\u6642"mm"\u5206"',"zh-cn":'yyyy"\u5e74"m"\u6708"',"ja-jp":'yyyy"\u5e74"m"\u6708"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'\u4e0a\u5348/\u4e0b\u5348 hh"\u6642"mm"\u5206"ss"\u79d2"',"zh-cn":'m"\u6708"d"\u65e5"',"ja-jp":'m"\u6708"d"\u65e5"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"\u5e74"m"\u6708"d"\u65e5"',"zh-cn":'m"\u6708"d"\u65e5"',"ja-jp":'[$-411]ggge"\u5e74"m"\u6708"d"\u65e5"',"ko-kr":"mm-dd"},55:{"zh-tw":'\u4e0a\u5348/\u4e0b\u5348 hh"\u6642"mm"\u5206"',"zh-cn":'\u4e0a\u5348/\u4e0b\u5348 h"\u65f6"mm"\u5206"',"ja-jp":'yyyy"\u5e74"m"\u6708"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'\u4e0a\u5348/\u4e0b\u5348 hh"\u6642"mm"\u5206"ss"\u79d2"',"zh-cn":'\u4e0a\u5348/\u4e0b\u5348 h"\u65f6"mm"\u5206"ss"\u79d2"',"ja-jp":'m"\u6708"d"\u65e5"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5e74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5e74" mm"\u6708" dd"\u65e5"'},58:{"zh-tw":'[$-404]e"\u5e74"m"\u6708"d"\u65e5"',"zh-cn":'m"\u6708"d"\u65e5"',"ja-jp":'[$-411]ggge"\u5e74"m"\u6708"d"\u65e5"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(e,t,n){"use strict";t.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(e,t,n){"use strict";const r=e("../../utils/parse-sax"),i=e("../../utils/xml-stream");class a{prepare(){}render(){}parseOpen(e){}parseText(e){}parseClose(e){}reconcile(e,t){}reset(){this.model=null,this.map&&Object.values(this.map).forEach((e=>{e instanceof a?e.reset():e.xform&&e.xform.reset()}))}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){var t,n=!1,r=!1;try{for(var i,a=s(e);n=!(i=await a.next()).done;n=!1){const e=i.value;for(const{eventType:t,value:n}of e)if("opentag"===t)this.parseOpen(n);else if("text"===t)this.parseText(n);else if("closetag"===t&&!this.parseClose(n.name))return this.model}}catch(o){r=!0,t=o}finally{try{n&&null!=a.return&&await a.return()}finally{if(r)throw t}}return this.model}async parseStream(e){return this.parse(r(e))}get xml(){return this.toXml(this.model)}toXml(e){const t=new i;return this.render(t,e),t.xml}static toAttribute(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===e){if(n)return t}else if(n||e!==t)return e.toString()}static toStringAttribute(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return a.toAttribute(e,t,n)}static toStringValue(e,t){return void 0===e?t:e}static toBoolAttribute(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===e){if(n)return t}else if(n||e!==t)return e?"1":"0"}static toBoolValue(e,t){return void 0===e?t:"1"===e}static toIntAttribute(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return a.toAttribute(e,t,n)}static toIntValue(e,t){return void 0===e?t:parseInt(e,10)}static toFloatAttribute(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return a.toAttribute(e,t,n)}static toFloatValue(e,t){return void 0===e?t:parseFloat(e)}}t.exports=a},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("../../../utils/col-cache");function a(e){try{return i.decodeEx(e),!0}catch(e){return!1}}function s(e){const t=[];let n=!1,r="";return e.split(",").forEach((e=>{if(!e)return;const i=(e.match(/'/g)||[]).length;if(!i)return void(n?r+=e+",":a(e)&&t.push(e));const s=i%2==0;!n&&s&&a(e)?t.push(e):n&&!s?(n=!1,a(r+e)&&t.push(r+e),r=""):(n=!0,r+=e+",")})),t}t.exports=class extends r{render(e,t){e.openNode("definedName",{name:t.name,localSheetId:t.localSheetId}),e.writeText(t.ranges.join(",")),e.closeNode()}parseOpen(e){return"definedName"===e.name&&(this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0)}parseText(e){this._parsedText.push(e)}parseClose(){return this.model={name:this._parsedName,ranges:s(this._parsedText.join(""))},void 0!==this._parsedLocalSheetId&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(e,t,n){"use strict";const r=e("../../../utils/utils"),i=e("../base-xform");t.exports=class extends i{render(e,t){e.leafNode("sheet",{sheetId:t.id,name:t.name,state:t.state,"r:id":t.rId})}parseOpen(e){return"sheet"===e.name&&(this.model={name:r.xmlDecode(e.attributes.name),id:parseInt(e.attributes.sheetId,10),state:e.attributes.state,rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{render(e,t){e.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0})}parseOpen(e){return"calcPr"===e.name&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{render(e,t){e.leafNode("workbookPr",{date1904:t.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(e){return"workbookPr"===e.name&&(this.model={date1904:"1"===e.attributes.date1904},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{render(e,t){const n={xWindow:t.x||0,yWindow:t.y||0,windowWidth:t.width||12e3,windowHeight:t.height||24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&"visible"!==t.visibility&&(n.visibility=t.visibility),e.leafNode("workbookView",n)}parseOpen(e){if("workbookView"===e.name){const t=this.model={},n=function(e,n,r){const i=void 0!==n?t[e]=n:r;void 0!==i&&(t[e]=i)},r=function(e,n,r){const i=void 0!==n?t[e]=parseInt(n,10):r;void 0!==i&&(t[e]=i)};return r("x",e.attributes.xWindow,0),r("y",e.attributes.yWindow,0),r("width",e.attributes.windowWidth,25e3),r("height",e.attributes.windowHeight,1e4),n("visibility",e.attributes.visibility,"visible"),r("activeTab",e.attributes.activeTab,void 0),r("firstSheet",e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(e,t,n){"use strict";const r=e("../../../utils/under-dash"),i=e("../../../utils/col-cache"),a=e("../../../utils/xml-stream"),s=e("../base-xform"),o=e("../static-xform"),l=e("../list-xform"),c=e("./defined-name-xform"),u=e("./sheet-xform"),d=e("./workbook-view-xform"),h=e("./workbook-properties-xform"),f=e("./workbook-calc-properties-xform");class p extends s{constructor(){super(),this.map={fileVersion:p.STATIC_XFORMS.fileVersion,workbookPr:new h,bookViews:new l({tag:"bookViews",count:!1,childXform:new d}),sheets:new l({tag:"sheets",count:!1,childXform:new u}),definedNames:new l({tag:"definedNames",count:!1,childXform:new c}),calcPr:new f}}prepare(e){e.sheets=e.worksheets;const t=[];let n=0;e.sheets.forEach((e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split("&&").forEach((r=>{const i=r.split(":"),a={name:"_xlnm.Print_Area",ranges:["'".concat(e.name,"'!$").concat(i[0],":$").concat(i[1])],localSheetId:n};t.push(a)})),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){const r=[];if(e.pageSetup.printTitlesColumn){const t=e.pageSetup.printTitlesColumn.split(":");r.push("'".concat(e.name,"'!$").concat(t[0],":$").concat(t[1]))}if(e.pageSetup.printTitlesRow){const t=e.pageSetup.printTitlesRow.split(":");r.push("'".concat(e.name,"'!$").concat(t[0],":$").concat(t[1]))}const i={name:"_xlnm.Print_Titles",ranges:r,localSheetId:n};t.push(i)}n++})),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media||[]).forEach(((e,t)=>{e.name=e.type+(t+1)}))}render(e,t){e.openXml(a.StdDocAttributes),e.openNode("workbook",p.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(e),this.map.workbookPr.render(e,t.properties),this.map.bookViews.render(e,t.views),this.map.sheets.render(e,t.sheets),this.map.definedNames.render(e,t.definedNames),this.map.calcPr.render(e,t.calcProperties),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):("workbook"===e.name||(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):"workbook"!==e||(this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1)}reconcile(e){const t=(e.workbookRels||[]).reduce(((e,t)=>(e[t.Id]=t,e)),{}),n=[];let a,s=0;(e.sheets||[]).forEach((r=>{const i=t[r.rId];i&&(a=e.worksheetHash["xl/"+i.Target.replace(/^(\s|\/xl\/)+/,"")],a&&(a.name=r.name,a.id=r.id,a.state=r.state,n[s++]=a))}));const o=[];r.each(e.definedNames,(e=>{if("_xlnm.Print_Area"===e.name){if(a=n[e.localSheetId],a){a.pageSetup||(a.pageSetup={});const t=i.decodeEx(e.ranges[0]);a.pageSetup.printArea=a.pageSetup.printArea?"".concat(a.pageSetup.printArea,"&&").concat(t.dimensions):t.dimensions}}else if("_xlnm.Print_Titles"===e.name){if(a=n[e.localSheetId],a){a.pageSetup||(a.pageSetup={});const t=e.ranges.join(","),n=/\$/g,r=/\$\d+:\$\d+/,i=t.match(r);if(i&&i.length){const e=i[0];a.pageSetup.printTitlesRow=e.replace(n,"")}const s=/\$[A-Z]+:\$[A-Z]+/,o=t.match(s);if(o&&o.length){const e=o[0];a.pageSetup.printTitlesColumn=e.replace(n,"")}}}else o.push(e)})),e.definedNames=o,e.media.forEach(((e,t)=>{e.index=t}))}}p.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},p.STATIC_XFORMS={fileVersion:new o({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},t.exports=p},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(e,t,n){"use strict";const i=e("../strings/rich-text-xform"),a=e("../../../utils/utils"),s=e("../base-xform"),o=t.exports=function(e){this.model=e};a.inherits(o,s,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new i),this._richTextXform},render(e,t){t=t||this.model,e.openNode("comment",{ref:t.ref,authorId:0}),e.openNode("text"),t&&t.note&&t.note.texts&&t.note.texts.forEach((t=>{this.richTextXform.render(e,t)})),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"comment":return this.model=r({type:"note",note:{texts:[]}},e.attributes),!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(e,t,n){"use strict";const r=e("../../../utils/xml-stream"),i=e("../../../utils/utils"),a=e("../base-xform"),s=e("./comment-xform"),o=t.exports=function(){this.map={comment:new s}};i.inherits(o,a,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(e,t){t=t||this.model,e.openXml(r.StdDocAttributes),e.openNode("comments",o.COMMENTS_ATTRIBUTES),e.openNode("authors"),e.leafNode("author",null,"Author"),e.closeNode(),e.openNode("commentList"),t.comments.forEach((t=>{this.map.comment.render(e,t)})),e.closeNode(),e.closeNode()},parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}},parseText(e){this.parser&&this.parser.parseText(e)},parseClose(e){switch(e){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(e,t,n){"use strict";const r=e("../../base-xform");t.exports=class extends r{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t,n){(t===n[2]||"x:SizeWithCells"===this.tag&&t===n[1])&&e.leafNode(this.tag)}parseOpen(e){return e.name===this.tag&&(this.model={},this.model[this.tag]=!0,!0)}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(e,t,n){"use strict";const r=e("../../base-xform");t.exports=class extends r{constructor(e){super(),this._model=e}get tag(){return this._model&&this._model.tag}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){return e.name===this.tag&&(this.text="",!0)}parseText(e){this.text=e}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"x:Anchor"}getAnchorRect(e){const t=Math.floor(e.left),n=Math.floor(68*(e.left-t)),r=Math.floor(e.top),i=Math.floor(18*(e.top-r)),a=Math.floor(e.right),s=Math.floor(68*(e.right-a)),o=Math.floor(e.bottom);return[t,n,r,i,a,s,o,Math.floor(18*(e.bottom-o))]}getDefaultRect(e){const t=e.col,n=Math.max(e.row-2,0);return[t,6,n,14,t+2,2,n+4,16]}render(e,t){const n=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode("x:Anchor",null,n.join(", "))}parseOpen(e){return e.name===this.tag&&(this.text="",!0)}parseText(e){this.text=e}parseClose(){return!1}}},{"../base-xform":32}],44:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("./vml-anchor-xform"),a=e("./style/vml-protection-xform"),s=e("./style/vml-position-xform"),o=["twoCells","oneCells","absolute"];t.exports=class extends r{constructor(){super(),this.map={"x:Anchor":new i,"x:Locked":new a({tag:"x:Locked"}),"x:LockText":new a({tag:"x:LockText"}),"x:SizeWithCells":new s({tag:"x:SizeWithCells"}),"x:MoveWithCells":new s({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(e,t){const{protection:n,editAs:r}=t.note;e.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(e,r,o),this.map["x:SizeWithCells"].render(e,r,o),this.map["x:Anchor"].render(e,t),this.map["x:Locked"].render(e,n.locked),e.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(e,n.lockText),e.leafNode("x:Row",null,t.refAddress.row-1),e.leafNode("x:Column",null,t.refAddress.col-1),e.closeNode()}parseOpen(e){return e.name===this.tag?(this.reset(),this.model={anchor:[],protection:{},editAs:""}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.normalizeModel(),!1)}normalizeModel(){const e=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),t=Object.keys(e).length;this.model.editAs=o[t],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(e,t,n){"use strict";const r=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("./vml-shape-xform");class s extends i{constructor(){super(),this.map={"v:shape":new a}}get tag(){return"xml"}render(e,t){e.openXml(r.StdDocAttributes),e.openNode(this.tag,s.DRAWING_ATTRIBUTES),e.openNode("o:shapelayout",{"v:ext":"edit"}),e.leafNode("o:idmap",{"v:ext":"edit",data:1}),e.closeNode(),e.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),e.leafNode("v:stroke",{joinstyle:"miter"}),e.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),e.closeNode(),t.comments.forEach(((t,n)=>{this.map["v:shape"].render(e,t,n)})),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={comments:[]}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0):e!==this.tag}reconcile(e,t){e.anchors.forEach((e=>{e.br?this.map["xdr:twoCellAnchor"].reconcile(e,t):this.map["xdr:oneCellAnchor"].reconcile(e,t)}))}}s.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},t.exports=s},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("./vml-textbox-xform"),a=e("./vml-client-data-xform");class s extends r{constructor(){super(),this.map={"v:textbox":new i,"x:ClientData":new a}}get tag(){return"v:shape"}render(e,t,n){e.openNode("v:shape",s.V_SHAPE_ATTRIBUTES(t,n)),e.leafNode("v:fill",{color2:"infoBackground [80]"}),e.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),e.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(e,t),this.map["x:ClientData"].render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={margins:{insetmode:e.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1)}}s.V_SHAPE_ATTRIBUTES=(e,t)=>({id:"_x0000_s"+(1025+t),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":e.note.margins&&e.note.margins.insetmode}),t.exports=s},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"v:textbox"}conversionUnit(e,t,n){return"".concat(parseFloat(e)*t.toFixed(2)).concat(n)}reverseConversionUnit(e){return(e||"").split(",").map((e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,"")).toFixed(2))))}render(e,t){const n={style:"mso-direction-alt:auto"};if(t&&t.note){let{inset:e}=t.note&&t.note.margins;Array.isArray(e)&&(e=e.map((e=>this.conversionUnit(e,10,"mm"))).join(",")),e&&(n.inset=e)}e.openNode("v:textbox",n),e.leafNode("div",{style:"text-align:left"}),e.closeNode()}parseOpen(e){return e.name!==this.tag||(this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0)}parseText(){}parseClose(e){return e!==this.tag}}},{"../base-xform":32}],48:[function(e,t,n){"use strict";const r=e("./base-xform");t.exports=class extends r{createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag&&(this.model=this.createNewModel(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}}},{"./base-xform":32}],49:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{render(e,t){e.openNode("HeadingPairs"),e.openNode("vt:vector",{size:2,baseType:"variant"}),e.openNode("vt:variant"),e.leafNode("vt:lpstr",void 0,"Worksheets"),e.closeNode(),e.openNode("vt:variant"),e.leafNode("vt:i4",void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return"HeadingPairs"===e.name}parseText(){}parseClose(e){return"HeadingPairs"!==e}}},{"../base-xform":32}],50:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{render(e,t){e.openNode("TitlesOfParts"),e.openNode("vt:vector",{size:t.length,baseType:"lpstr"}),t.forEach((t=>{e.leafNode("vt:lpstr",void 0,t.name)})),e.closeNode(),e.closeNode()}parseOpen(e){return"TitlesOfParts"===e.name}parseText(){}parseClose(e){return"TitlesOfParts"!==e}}},{"../base-xform":32}],51:[function(e,t,n){"use strict";const r=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("../simple/string-xform"),s=e("./app-heading-pairs-xform"),o=e("./app-titles-of-parts-xform");class l extends i{constructor(){super(),this.map={Company:new a({tag:"Company"}),Manager:new a({tag:"Manager"}),HeadingPairs:new s,TitleOfParts:new o}}render(e,t){e.openXml(r.StdDocAttributes),e.openNode("Properties",l.PROPERTY_ATTRIBUTES),e.leafNode("Application",void 0,"Microsoft Excel"),e.leafNode("DocSecurity",void 0,"0"),e.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(e,t.worksheets),this.map.TitleOfParts.render(e,t.worksheets),this.map.Company.render(e,t.company||""),this.map.Manager.render(e,t.manager),e.leafNode("LinksUpToDate",void 0,"false"),e.leafNode("SharedDoc",void 0,"false"),e.leafNode("HyperlinksChanged",void 0,"false"),e.leafNode("AppVersion",void 0,"16.0300"),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"Properties"===e.name||(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):"Properties"!==e||(this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1)}}l.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,"")},l.DateAttrs={"xsi:type":"dcterms:W3CDTF"},l.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},t.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(e,t,n){"use strict";const r=e("../../../utils/xml-stream"),i=e("../base-xform");class a extends i{render(e,t){e.openXml(r.StdDocAttributes),e.openNode("Types",a.PROPERTY_ATTRIBUTES);const n={};(t.media||[]).forEach((t=>{if("image"===t.type){const r=t.extension;n[r]||(n[r]=!0,e.leafNode("Default",{Extension:r,ContentType:"image/"+r}))}})),e.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),e.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),e.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),t.worksheets.forEach((t=>{const n="/xl/worksheets/sheet".concat(t.id,".xml");e.leafNode("Override",{PartName:n,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})})),e.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),e.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),t.sharedStrings&&t.sharedStrings.count&&e.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),t.tables&&t.tables.forEach((t=>{e.leafNode("Override",{PartName:"/xl/tables/"+t.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})})),t.drawings&&t.drawings.forEach((t=>{e.leafNode("Override",{PartName:"/xl/drawings/".concat(t.name,".xml"),ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})})),t.commentRefs&&(e.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),t.commentRefs.forEach((t=>{let{commentName:n}=t;e.leafNode("Override",{PartName:"/xl/".concat(n,".xml"),ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})}))),e.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),e.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),e.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}a.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},t.exports=a},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(e,t,n){"use strict";const r=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("../simple/date-xform"),s=e("../simple/string-xform"),o=e("../simple/integer-xform");class l extends i{constructor(){super(),this.map={"dc:creator":new s({tag:"dc:creator"}),"dc:title":new s({tag:"dc:title"}),"dc:subject":new s({tag:"dc:subject"}),"dc:description":new s({tag:"dc:description"}),"dc:identifier":new s({tag:"dc:identifier"}),"dc:language":new s({tag:"dc:language"}),"cp:keywords":new s({tag:"cp:keywords"}),"cp:category":new s({tag:"cp:category"}),"cp:lastModifiedBy":new s({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new a({tag:"cp:lastPrinted",format:l.DateFormat}),"cp:revision":new o({tag:"cp:revision"}),"cp:version":new s({tag:"cp:version"}),"cp:contentStatus":new s({tag:"cp:contentStatus"}),"cp:contentType":new s({tag:"cp:contentType"}),"dcterms:created":new a({tag:"dcterms:created",attrs:l.DateAttrs,format:l.DateFormat}),"dcterms:modified":new a({tag:"dcterms:modified",attrs:l.DateAttrs,format:l.DateFormat})}}render(e,t){e.openXml(r.StdDocAttributes),e.openNode("cp:coreProperties",l.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(e,t.creator),this.map["dc:title"].render(e,t.title),this.map["dc:subject"].render(e,t.subject),this.map["dc:description"].render(e,t.description),this.map["dc:identifier"].render(e,t.identifier),this.map["dc:language"].render(e,t.language),this.map["cp:keywords"].render(e,t.keywords),this.map["cp:category"].render(e,t.category),this.map["cp:lastModifiedBy"].render(e,t.lastModifiedBy),this.map["cp:lastPrinted"].render(e,t.lastPrinted),this.map["cp:revision"].render(e,t.revision),this.map["cp:version"].render(e,t.version),this.map["cp:contentStatus"].render(e,t.contentStatus),this.map["cp:contentType"].render(e,t.contentType),this.map["dcterms:created"].render(e,t.created),this.map["dcterms:modified"].render(e,t.modified),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+e)}}}l.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,"")},l.DateAttrs={"xsi:type":"dcterms:W3CDTF"},l.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},t.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{render(e,t){e.leafNode("Relationship",t)}parseOpen(e){return"Relationship"===e.name&&(this.model=e.attributes,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(e,t,n){"use strict";const r=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("./relationship-xform");class s extends i{constructor(){super(),this.map={Relationship:new a}}render(e,t){t=t||this._values,e.openXml(r.StdDocAttributes),e.openNode("Relationships",s.RELATIONSHIPS_ATTRIBUTES),t.forEach((t=>{this.map.Relationship.render(e,t)})),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if("Relationships"===e.name)return this.model=[],!0;if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;if("Relationships"===e)return!1;throw new Error("Unexpected xml node in parseClose: "+e)}}s.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},t.exports=s},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={range:{editAs:e.attributes.editAs||"oneCell"}}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){const n=t.rels[e.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(n){const e=n[1],r=t.mediaIndex[e];return t.media[r]}}}}},{"../base-xform":32}],57:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("./blip-xform");t.exports=class extends r{constructor(){super(),this.map={"a:blip":new i}}get tag(){return"xdr:blipFill"}render(e,t){e.openNode(this.tag),this.map["a:blip"].render(e,t),e.openNode("a:stretch"),e.leafNode("a:fillRect"),e.closeNode(),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model=this.map["a:blip"].model,!1)}}},{"../base-xform":32,"./blip-xform":58}],58:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"a:blip"}render(e,t){e.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":t.rId,cstate:"print"})}parseOpen(e){return e.name!==this.tag||(this.model={rId:e.attributes["r:embed"]},!0)}parseText(){}parseClose(e){return e!==this.tag}}},{"../base-xform":32}],59:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"xdr:cNvPicPr"}render(e){e.openNode(this.tag),e.leafNode("a:picLocks",{noChangeAspect:"1"}),e.closeNode()}parseOpen(e){return e.name,this.tag,!0}parseText(){}parseClose(e){return e!==this.tag}}},{"../base-xform":32}],60:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("./hlink-click-xform"),a=e("./ext-lst-xform");t.exports=class extends r{constructor(){super(),this.map={"a:hlinkClick":new i,"a:extLst":new a}}get tag(){return"xdr:cNvPr"}render(e,t){e.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(e,t),this.map["a:extLst"].render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model=this.map["a:hlinkClick"].model,!1)}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("../simple/integer-xform");t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new i({tag:"xdr:col",zero:!0}),"xdr:colOff":new i({tag:"xdr:colOff",zero:!0}),"xdr:row":new i({tag:"xdr:row",zero:!0}),"xdr:rowOff":new i({tag:"xdr:rowOff",zero:!0})}}render(e,t){e.openNode(this.tag),this.map["xdr:col"].render(e,t.nativeCol),this.map["xdr:colOff"].render(e,t.nativeColOff),this.map["xdr:row"].render(e,t.nativeRow),this.map["xdr:rowOff"].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1)}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(e,t,n){"use strict";const r=e("../../../utils/col-cache"),i=e("../../../utils/xml-stream"),a=e("../base-xform"),s=e("./two-cell-anchor-xform"),o=e("./one-cell-anchor-xform");class l extends a{constructor(){super(),this.map={"xdr:twoCellAnchor":new s,"xdr:oneCellAnchor":new o}}prepare(e){e.anchors.forEach(((e,t)=>{e.anchorType=function(e){return("string"==typeof e.range?r.decode(e.range):e.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(e),this.map[e.anchorType].prepare(e,{index:t})}))}get tag(){return"xdr:wsDr"}render(e,t){e.openXml(i.StdDocAttributes),e.openNode(this.tag,l.DRAWING_ATTRIBUTES),t.anchors.forEach((t=>{this.map[t.anchorType].render(e,t)})),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?(this.reset(),this.model={anchors:[]}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0):e!==this.tag}reconcile(e,t){e.anchors.forEach((e=>{e.br?this.map["xdr:twoCellAnchor"].reconcile(e,t):this.map["xdr:oneCellAnchor"].reconcile(e,t)}))}}l.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},t.exports=l},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"a:extLst"}render(e){e.openNode(this.tag),e.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),e.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name,this.tag,!0}parseText(){}parseClose(e){return e!==this.tag}}},{"../base-xform":32}],64:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.map={}}render(e,t){e.openNode(this.tag);const n=Math.floor(9525*t.width),r=Math.floor(9525*t.height);e.addAttribute("cx",n),e.addAttribute("cy",r),e.closeNode()}parseOpen(e){return e.name===this.tag&&(this.model={width:parseInt(e.attributes.cx||"0",10)/9525,height:parseInt(e.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"a:hlinkClick"}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){return e.name!==this.tag||(this.model={hyperlinks:{rId:e.attributes["r:id"],tooltip:e.attributes.tooltip}},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("./c-nv-pr-xform"),a=e("./c-nv-pic-pr-xform");t.exports=class extends r{constructor(){super(),this.map={"xdr:cNvPr":new i,"xdr:cNvPicPr":new a}}get tag(){return"xdr:nvPicPr"}render(e,t){e.openNode(this.tag),this.map["xdr:cNvPr"].render(e,t),this.map["xdr:cNvPicPr"].render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model=this.map["xdr:cNvPr"].model,!1)}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(e,t,n){"use strict";const r=e("./base-cell-anchor-xform"),i=e("../static-xform"),a=e("./cell-position-xform"),s=e("./ext-xform"),o=e("./pic-xform");t.exports=class extends r{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:ext":new s({tag:"xdr:ext"}),"xdr:pic":new o,"xdr:clientData":new i({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(e,t){this.map["xdr:pic"].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,t.range.tl),this.map["xdr:ext"].render(e,t.range.ext),this.map["xdr:pic"].render(e,t.picture),this.map["xdr:clientData"].render(e,{}),e.closeNode()}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1)}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("../static-xform"),a=e("./blip-fill-xform"),s=e("./nv-pic-pr-xform"),o=e("./sp-pr");t.exports=class extends r{constructor(){super(),this.map={"xdr:nvPicPr":new s,"xdr:blipFill":new a,"xdr:spPr":new i(o)}}get tag(){return"xdr:pic"}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map["xdr:nvPicPr"].render(e,t),this.map["xdr:blipFill"].render(e,t),this.map["xdr:spPr"].render(e,t),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):(e.name===this.tag?this.reset():(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0)}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0):e!==this.tag}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(e,t,n){"use strict";t.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(e,t,n){"use strict";const r=e("./base-cell-anchor-xform"),i=e("../static-xform"),a=e("./cell-position-xform"),s=e("./pic-xform");t.exports=class extends r{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:to":new a({tag:"xdr:to"}),"xdr:pic":new s,"xdr:clientData":new i({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(e,t){this.map["xdr:pic"].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||"oneCell"}),this.map["xdr:from"].render(e,t.range.tl),this.map["xdr:to"].render(e,t.range.br),this.map["xdr:pic"].render(e,t.picture),this.map["xdr:clientData"].render(e,{}),e.closeNode()}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1)}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(e,t,n){"use strict";const r=e("./base-xform");t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count||"count",this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){const{childXform:n}=this;e&&e.forEach(((e,r)=>{t.index=r,n.prepare(e,t)}))}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t&&t.length||0);const{childXform:n}=this;(t||[]).forEach(((t,r)=>{n.render(e,t,r)})),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=[],!0):!!this.childXform.parseOpen(e)&&(this.parser=this.childXform,!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error("Max ".concat(this.childXform.tag," count (").concat(this.maxItems,") exceeded"));return!0}return!1}reconcile(e,t){if(e){const{childXform:n}=this;e.forEach((e=>{n.reconcile(e,t)}))}}}},{"./base-xform":32}],72:[function(e,t,n){"use strict";const r=e("../../../utils/col-cache"),i=e("../base-xform");t.exports=class extends i{get tag(){return"autoFilter"}render(e,t){if(t)if("string"==typeof t)e.leafNode("autoFilter",{ref:t});else{const n=function(e){return"string"==typeof e?e:r.getAddress(e.row,e.column).address},i=n(t.from),a=n(t.to);i&&a&&e.leafNode("autoFilter",{ref:"".concat(i,":").concat(a)})}}parseOpen(e){"autoFilter"===e.name&&(this.model=e.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(e,t,n){"use strict";const i=e("../../../utils/utils"),a=e("../base-xform"),s=e("../../../doc/range"),o=e("../../../doc/enums"),l=e("../strings/rich-text-xform");function c(e){if(null==e)return o.ValueType.Null;if(e instanceof String||"string"==typeof e)return o.ValueType.String;if("number"==typeof e)return o.ValueType.Number;if("boolean"==typeof e)return o.ValueType.Boolean;if(e instanceof Date)return o.ValueType.Date;if(e.text&&e.hyperlink)return o.ValueType.Hyperlink;if(e.formula)return o.ValueType.Formula;if(e.error)return o.ValueType.Error;throw new Error("I could not understand type of value")}t.exports=class extends a{constructor(){super(),this.richTextXForm=new l}get tag(){return"c"}prepare(e,t){const n=t.styles.addStyleModel(e.style||{},function(e){return e.type===o.ValueType.Formula?c(e.result):e.type}(e));switch(n&&(e.styleId=n),e.comment&&t.comments.push(r(r({},e.comment),{},{ref:e.address})),e.type){case o.ValueType.String:case o.ValueType.RichText:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case o.ValueType.Date:t.date1904&&(e.date1904=!0);break;case o.ValueType.Hyperlink:t.sharedStrings&&void 0!==e.text&&null!==e.text&&(e.ssId=t.sharedStrings.add(e.text)),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case o.ValueType.Merge:t.merges.add(e);break;case o.ValueType.Formula:if(t.date1904&&(e.date1904=!0),"shared"===e.shareType&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){const n=t.formulae[e.sharedFormula];if(!n)throw new Error("Shared Formula master must exist above and or left of clone for cell "+e.address);void 0===n.si?(n.shareType="shared",n.si=t.siFormulae++,n.range=new s(n.address,e.address)):n.range&&n.range.expandToAddress(e.address),e.si=n.si}}}renderFormula(e,t){let n=null;switch(t.shareType){case"shared":n={t:"shared",ref:t.ref||t.range.range,si:t.si};break;case"array":n={t:"array",ref:t.ref};break;default:void 0!==t.si&&(n={t:"shared",si:t.si})}switch(c(t.result)){case o.ValueType.Null:e.leafNode("f",n,t.formula);break;case o.ValueType.String:e.addAttribute("t","str"),e.leafNode("f",n,t.formula),e.leafNode("v",null,t.result);break;case o.ValueType.Number:e.leafNode("f",n,t.formula),e.leafNode("v",null,t.result);break;case o.ValueType.Boolean:e.addAttribute("t","b"),e.leafNode("f",n,t.formula),e.leafNode("v",null,t.result?1:0);break;case o.ValueType.Error:e.addAttribute("t","e"),e.leafNode("f",n,t.formula),e.leafNode("v",null,t.result.error);break;case o.ValueType.Date:e.leafNode("f",n,t.formula),e.leafNode("v",null,i.dateToExcel(t.result,t.date1904));break;default:throw new Error("I could not understand type of value")}}render(e,t){if(t.type!==o.ValueType.Null||t.styleId){switch(e.openNode("c"),e.addAttribute("r",t.address),t.styleId&&e.addAttribute("s",t.styleId),t.type){case o.ValueType.Null:break;case o.ValueType.Number:e.leafNode("v",null,t.value);break;case o.ValueType.Boolean:e.addAttribute("t","b"),e.leafNode("v",null,t.value?"1":"0");break;case o.ValueType.Error:e.addAttribute("t","e"),e.leafNode("v",null,t.value.error);break;case o.ValueType.String:case o.ValueType.RichText:void 0!==t.ssId?(e.addAttribute("t","s"),e.leafNode("v",null,t.ssId)):t.value&&t.value.richText?(e.addAttribute("t","inlineStr"),e.openNode("is"),t.value.richText.forEach((t=>{this.richTextXForm.render(e,t)})),e.closeNode("is")):(e.addAttribute("t","str"),e.leafNode("v",null,t.value));break;case o.ValueType.Date:e.leafNode("v",null,i.dateToExcel(t.value,t.date1904));break;case o.ValueType.Hyperlink:void 0!==t.ssId?(e.addAttribute("t","s"),e.leafNode("v",null,t.ssId)):(e.addAttribute("t","str"),e.leafNode("v",null,t.text));break;case o.ValueType.Formula:this.renderFormula(e,t);case o.ValueType.Merge:}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"c":return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser)this.parser.parseText(e);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+e:e;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e}}parseClose(e){switch(e){case"c":{const{model:e}=this;if(e.formula||e.shareType)e.type=o.ValueType.Formula,e.value&&("str"===this.t?e.result=i.xmlDecode(e.value):"b"===this.t?e.result=0!==parseInt(e.value,10):"e"===this.t?e.result={error:e.value}:e.result=parseFloat(e.value),e.value=void 0);else if(void 0!==e.value)switch(this.t){case"s":e.type=o.ValueType.String,e.value=parseInt(e.value,10);break;case"str":e.type=o.ValueType.String,e.value=i.xmlDecode(e.value);break;case"inlineStr":e.type=o.ValueType.String;break;case"b":e.type=o.ValueType.Boolean,e.value=0!==parseInt(e.value,10);break;case"e":e.type=o.ValueType.Error,e.value={error:e.value};break;default:e.type=o.ValueType.Number,e.value=parseFloat(e.value)}else e.styleId?e.type=o.ValueType.Null:e.type=o.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(e),!0)}}reconcile(e,t){const n=e.styleId&&t.styles&&t.styles.getStyleModel(e.styleId);switch(n&&(e.style=n),void 0!==e.styleId&&(e.styleId=void 0),e.type){case o.ValueType.String:"number"==typeof e.value&&t.sharedStrings&&(e.value=t.sharedStrings.getString(e.value)),e.value.richText&&(e.type=o.ValueType.RichText);break;case o.ValueType.Number:n&&i.isDateFmt(n.numFmt)&&(e.type=o.ValueType.Date,e.value=i.excelToDate(e.value,t.date1904));break;case o.ValueType.Formula:void 0!==e.result&&n&&i.isDateFmt(n.numFmt)&&(e.result=i.excelToDate(e.result,t.date1904)),"shared"===e.shareType&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si)}const r=t.hyperlinkMap[e.address];r&&(e.type===o.ValueType.Formula?(e.text=e.result,e.result=void 0):(e.text=e.value,e.value=void 0),e.type=o.ValueType.Hyperlink,e.hyperlink=r);const a=t.commentsMap&&t.commentsMap[e.address];a&&(e.comment=a)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(e,t,n){"use strict";const r=e("../../base-xform");t.exports=class extends r{get tag(){return"x14:cfIcon"}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen(e){let{attributes:t}=e;this.model={iconSet:t.iconSet,iconId:r.toIntValue(t.iconId)}}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],75:[function(e,t,n){"use strict";const{v4:r}=e("uuid"),i=e("../../base-xform"),a=e("../../composite-xform"),s=e("./databar-ext-xform"),o=e("./icon-set-ext-xform"),l={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class c extends a{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new s,"x14:iconSet":this.iconSetXform=new o}}get tag(){return"x14:cfRule"}static isExt(e){return"dataBar"===e.type?s.isExt(e):!("iconSet"!==e.type||!e.custom&&!l[e.iconSet])}prepare(e){c.isExt(e)&&(e.x14Id="{".concat(r(),"}").toUpperCase())}render(e,t){if(c.isExt(t))switch(t.type){case"dataBar":this.renderDataBar(e,t);break;case"iconSet":this.renderIconSet(e,t)}}renderDataBar(e,t){e.openNode(this.tag,{type:"dataBar",id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:"iconSet",priority:t.priority,id:t.x14Id||"{".concat(r(),"}")}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{type:t.type,x14Id:t.id,priority:i.toIntValue(t.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}}t.exports=c},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(e,t,n){"use strict";const r=e("../../composite-xform"),i=e("./f-ext-xform");t.exports=class extends r{constructor(){super(),this.map={"xm:f":this.fExtXform=new i}}get tag(){return"x14:cfvo"}render(e,t){e.openNode(this.tag,{type:t.type}),void 0!==t.value&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){"xm:f"===e&&(this.model.value=t.model?parseFloat(t.model):0)}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(e,t,n){"use strict";const r=e("../../composite-xform"),i=e("./sqref-ext-xform"),a=e("./cf-rule-ext-xform");t.exports=class extends r{constructor(){super(),this.map={"xm:sqref":this.sqRef=new i,"x14:cfRule":this.cfRule=new a}}get tag(){return"x14:conditionalFormatting"}prepare(e,t){e.rules.forEach((e=>{this.cfRule.prepare(e,t)}))}render(e,t){t.rules.some(a.isExt)&&(e.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(a.isExt).forEach((t=>this.cfRule.render(e,t))),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case"xm:sqref":this.model.ref=t.model;break;case"x14:cfRule":this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(e,t,n){"use strict";const r=e("../../composite-xform"),i=e("./cf-rule-ext-xform"),a=e("./conditional-formatting-ext-xform");t.exports=class extends r{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new a}}get tag(){return"x14:conditionalFormattings"}hasContent(e){return void 0===e.hasExtContent&&(e.hasExtContent=e.some((e=>e.rules.some(i.isExt)))),e.hasExtContent}prepare(e,t){e.forEach((e=>{this.cfXform.prepare(e,t)}))}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach((t=>this.cfXform.render(e,t))),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(e,t,n){"use strict";const r=e("../../base-xform"),i=e("../../composite-xform"),a=e("../../style/color-xform"),s=e("./cfvo-ext-xform");t.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new s,"x14:borderColor":this.borderColorXform=new a("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new a("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new a("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new a("x14:axisColor")}}static isExt(e){return!e.gradient}get tag(){return"x14:dataBar"}render(e,t){e.openNode(this.tag,{minLength:r.toIntAttribute(t.minLength,0,!0),maxLength:r.toIntAttribute(t.maxLength,100,!0),border:r.toBoolAttribute(t.border,!1),gradient:r.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:r.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:r.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:r.toAttribute(t.axisPosition,"auto"),direction:r.toAttribute(t.direction,"leftToRight")}),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],minLength:r.toIntValue(t.minLength,0),maxLength:r.toIntValue(t.maxLength,100),border:r.toBoolValue(t.border,!1),gradient:r.toBoolValue(t.gradient,!0),negativeBarColorSameAsPositive:r.toBoolValue(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:r.toBoolValue(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:r.toStringValue(t.axisPosition,"auto"),direction:r.toStringValue(t.direction,"leftToRight")}}onParserClose(e,t){const[,n]=e.split(":");"cfvo"===n?this.model.cfvo.push(t.model):this.model[n]=t.model}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(e,t,n){"use strict";const r=e("../../base-xform");t.exports=class extends r{get tag(){return"xm:f"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],81:[function(e,t,n){"use strict";const r=e("../../base-xform"),i=e("../../composite-xform"),a=e("./cfvo-ext-xform"),s=e("./cf-icon-ext-xform");t.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new a,"x14:cfIcon":this.cfIconXform=new s}}get tag(){return"x14:iconSet"}render(e,t){e.openNode(this.tag,{iconSet:r.toStringAttribute(t.iconSet),reverse:r.toBoolAttribute(t.reverse,!1),showValue:r.toBoolAttribute(t.showValue,!0),custom:r.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),t.icons&&t.icons.forEach(((t,n)=>{t.iconId=n,this.cfIconXform.render(e,t)})),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{cfvo:[],iconSet:r.toStringValue(t.iconSet,"3TrafficLights"),reverse:r.toBoolValue(t.reverse,!1),showValue:r.toBoolValue(t.showValue,!0)}}onParserClose(e,t){const[,n]=e.split(":");switch(n){case"cfvo":this.model.cfvo.push(t.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[n]=t.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(e,t,n){"use strict";const r=e("../../base-xform");t.exports=class extends r{get tag(){return"xm:sqref"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],83:[function(e,t,n){"use strict";const i=e("../../base-xform"),a=e("../../composite-xform"),s=e("../../../../doc/range"),o=e("./databar-xform"),l=e("./ext-lst-ref-xform"),c=e("./formula-xform"),u=e("./color-scale-xform"),d=e("./icon-set-xform"),h={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},f=e=>{const{type:t,operator:n}=e;switch(t){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:t};default:return{type:t,operator:n}}};class p extends a{constructor(){super(),this.map={dataBar:this.databarXform=new o,extLst:this.extLstRefXform=new l,formula:this.formulaXform=new c,colorScale:this.colorScaleXform=new u,iconSet:this.iconSetXform=new d}}get tag(){return"cfRule"}static isPrimitive(e){return"iconSet"!==e.type||!e.custom&&!h[e.iconSet]}render(e,t){switch(t.type){case"expression":this.renderExpression(e,t);break;case"cellIs":this.renderCellIs(e,t);break;case"top10":this.renderTop10(e,t);break;case"aboveAverage":this.renderAboveAverage(e,t);break;case"dataBar":this.renderDataBar(e,t);break;case"colorScale":this.renderColorScale(e,t);break;case"iconSet":this.renderIconSet(e,t);break;case"containsText":this.renderText(e,t);break;case"timePeriod":this.renderTimePeriod(e,t)}}renderExpression(e,t){e.openNode(this.tag,{type:"expression",dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:"cellIs",dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach((t=>{this.formulaXform.render(e,t)})),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:"top10",dxfId:t.dxfId,priority:t.priority,percent:i.toBoolAttribute(t.percent,!1),bottom:i.toBoolAttribute(t.bottom,!1),rank:i.toIntValue(t.rank,10,!0)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:"aboveAverage",dxfId:t.dxfId,priority:t.priority,aboveAverage:i.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:"dataBar",priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:"colorScale",priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(e,t){p.isPrimitive(t)&&(e.openNode(this.tag,{type:"iconSet",priority:t.priority}),this.iconSetXform.render(e,t),e.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:i.toStringAttribute(t.operator,"containsText")});const n=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];const t=new s(e.ref),{tl:n}=t;switch(e.operator){case"containsText":return'NOT(ISERROR(SEARCH("'.concat(e.text,'",').concat(n,")))");case"containsBlanks":return"LEN(TRIM(".concat(n,"))=0");case"notContainsBlanks":return"LEN(TRIM(".concat(n,"))>0");case"containsErrors":return"ISERROR(".concat(n,")");case"notContainsErrors":return"NOT(ISERROR(".concat(n,"))");default:return}})(t);n&&this.formulaXform.render(e,n),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:"timePeriod",dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});const n=(e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];const t=new s(e.ref),{tl:n}=t;switch(e.timePeriod){case"thisWeek":return"AND(TODAY()-ROUNDDOWN(".concat(n,",0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(").concat(n,",0)-TODAY()<=7-WEEKDAY(TODAY()))");case"lastWeek":return"AND(TODAY()-ROUNDDOWN(".concat(n,",0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(").concat(n,",0)<(WEEKDAY(TODAY())+7))");case"nextWeek":return"AND(ROUNDDOWN(".concat(n,",0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(").concat(n,",0)-TODAY()<(15-WEEKDAY(TODAY())))");case"yesterday":return"FLOOR(".concat(n,",1)=TODAY()-1");case"today":return"FLOOR(".concat(n,",1)=TODAY()");case"tomorrow":return"FLOOR(".concat(n,",1)=TODAY()+1");case"last7Days":return"AND(TODAY()-FLOOR(".concat(n,",1)<=6,FLOOR(").concat(n,",1)<=TODAY())");case"lastMonth":return"AND(MONTH(".concat(n,")=MONTH(EDATE(TODAY(),0-1)),YEAR(").concat(n,")=YEAR(EDATE(TODAY(),0-1)))");case"thisMonth":return"AND(MONTH(".concat(n,")=MONTH(TODAY()),YEAR(").concat(n,")=YEAR(TODAY()))");case"nextMonth":return"AND(MONTH(".concat(n,")=MONTH(EDATE(TODAY(),0+1)),YEAR(").concat(n,")=YEAR(EDATE(TODAY(),0+1)))");default:return}})(t);n&&this.formulaXform.render(e,n),e.closeNode()}createNewModel(e){let{attributes:t}=e;return r(r({},f(t)),{},{dxfId:i.toIntValue(t.dxfId),priority:i.toIntValue(t.priority),timePeriod:t.timePeriod,percent:i.toBoolValue(t.percent),bottom:i.toBoolValue(t.bottom),rank:i.toIntValue(t.rank),aboveAverage:i.toBoolValue(t.aboveAverage)})}onParserClose(e,t){switch(e){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,t.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(t.model)}}}t.exports=p},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(e,t,n){"use strict";const r=e("../../base-xform");t.exports=class extends r{get tag(){return"cfvo"}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:r.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],85:[function(e,t,n){"use strict";const r=e("../../composite-xform"),i=e("../../style/color-xform"),a=e("./cfvo-xform");t.exports=class extends r{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new i}}get tag(){return"colorScale"}render(e,t){e.openNode(this.tag),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),t.color.forEach((t=>{this.colorXform.render(e,t)})),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(e,t,n){"use strict";const r=e("../../composite-xform"),i=e("./cf-rule-xform");t.exports=class extends r{constructor(){super(),this.map={cfRule:new i}}get tag(){return"conditionalFormatting"}render(e,t){t.rules.some(i.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach((n=>{i.isPrimitive(n)&&(n.ref=t.ref,this.map.cfRule.render(e,n))})),e.closeNode())}createNewModel(e){let{attributes:t}=e;return{ref:t.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(e,t,n){"use strict";const r=e("../../base-xform"),i=e("./conditional-formatting-xform");t.exports=class extends r{constructor(){super(),this.cfXform=new i}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(e,t){let n=e.reduce(((e,t)=>Math.max(e,...t.rules.map((e=>e.priority||0)))),1);e.forEach((e=>{e.rules.forEach((e=>{e.priority||(e.priority=n++),e.style&&(e.dxfId=t.styles.addDxfStyle(e.style))}))}))}render(e,t){t.forEach((t=>{this.cfXform.render(e,t)}))}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"conditionalFormatting"===e.name&&(this.parser=this.cfXform,this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(!!this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(e,t){e.forEach((e=>{e.rules.forEach((e=>{void 0!==e.dxfId&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)}))}))}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(e,t,n){"use strict";const r=e("../../composite-xform"),i=e("../../style/color-xform"),a=e("./cfvo-xform");t.exports=class extends r{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new i}}get tag(){return"dataBar"}render(e,t){e.openNode(this.tag),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case"cfvo":this.model.cfvo.push(t.model);break;case"color":this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(e,t,n){"use strict";const r=e("../../base-xform"),i=e("../../composite-xform");class a extends r{get tag(){return"x14:id"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}class s extends i{constructor(){super(),this.map={"x14:id":this.idXform=new a}}get tag(){return"ext"}render(e,t){e.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}}t.exports=class extends i{constructor(){super(),this.map={ext:new s}}get tag(){return"extLst"}render(e,t){e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(e,t,n){"use strict";const r=e("../../base-xform");t.exports=class extends r{get tag(){return"formula"}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=""}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}}},{"../../base-xform":32}],91:[function(e,t,n){"use strict";const r=e("../../base-xform"),i=e("../../composite-xform"),a=e("./cfvo-xform");t.exports=class extends i{constructor(){super(),this.map={cfvo:this.cfvoXform=new a}}get tag(){return"iconSet"}render(e,t){e.openNode(this.tag,{iconSet:r.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:r.toBoolAttribute(t.reverse,!1),showValue:r.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach((t=>{this.cfvoXform.render(e,t)})),e.closeNode()}createNewModel(e){let{attributes:t}=e;return{iconSet:r.toStringValue(t.iconSet,"3TrafficLights"),reverse:r.toBoolValue(t.reverse),showValue:r.toBoolValue(t.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(e,t,n){"use strict";const r=e("../../../utils/utils"),i=e("../base-xform");t.exports=class extends i{get tag(){return"col"}prepare(e,t){const n=t.styles.addStyleModel(e.style||{});n&&(e.styleId=n)}render(e,t){e.openNode("col"),e.addAttribute("min",t.min),e.addAttribute("max",t.max),t.width&&e.addAttribute("width",t.width),t.styleId&&e.addAttribute("style",t.styleId),t.hidden&&e.addAttribute("hidden","1"),t.bestFit&&e.addAttribute("bestFit","1"),t.outlineLevel&&e.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&e.addAttribute("collapsed","1"),e.addAttribute("customWidth","1"),e.closeNode()}parseOpen(e){if("col"===e.name){const t=this.model={min:parseInt(e.attributes.min||"0",10),max:parseInt(e.attributes.max||"0",10),width:void 0===e.attributes.width?void 0:parseFloat(e.attributes.width||"0")};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),r.parseBoolean(e.attributes.hidden)&&(t.hidden=!0),r.parseBoolean(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),r.parseBoolean(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId&&(e.style=t.styles.getStyleModel(e.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(e,t,n){"use strict";const i=e("../../../utils/under-dash"),a=e("../../../utils/utils"),s=e("../../../utils/col-cache"),o=e("../base-xform"),l=e("../../../doc/range");function c(e,t,n,r){const i=t[n];void 0!==i?e[n]=i:void 0!==r&&(e[n]=r)}function u(e,t,n,r){const i=t[n];void 0!==i?e[n]=a.parseBoolean(i):void 0!==r&&(e[n]=r)}t.exports=class extends o{get tag(){return"dataValidations"}render(e,t){const n=function(e){const t=i.map(e,((e,t)=>({address:t,dataValidation:e,marked:!1}))).sort(((e,t)=>i.strcmp(e.address,t.address))),n=i.keyBy(t,"address"),a=(t,n,r)=>{for(let a=0;a{if(!t.marked){const o=s.decodeEx(t.address);if(o.dimensions)return n[o.dimensions].marked=!0,r(r({},t.dataValidation),{},{sqref:t.address});let l=1,c=s.encodeAddress(o.row+l,o.col);for(;e[c]&&i.isEqual(t.dataValidation,e[c]);)l++,c=s.encodeAddress(o.row+l,o.col);let u=1;for(;a(o,l,o.col+u);)u++;for(let e=0;e1||u>1){const e=o.row+(l-1),n=o.col+(u-1);return r(r({},t.dataValidation),{},{sqref:"".concat(t.address,":").concat(s.encodeAddress(e,n))})}return r(r({},t.dataValidation),{},{sqref:t.address})}return null})).filter(Boolean)}(t);n.length&&(e.openNode("dataValidations",{count:n.length}),n.forEach((t=>{e.openNode("dataValidation"),"any"!==t.type&&(e.addAttribute("type",t.type),t.operator&&"list"!==t.type&&"between"!==t.operator&&e.addAttribute("operator",t.operator),t.allowBlank&&e.addAttribute("allowBlank","1")),t.showInputMessage&&e.addAttribute("showInputMessage","1"),t.promptTitle&&e.addAttribute("promptTitle",t.promptTitle),t.prompt&&e.addAttribute("prompt",t.prompt),t.showErrorMessage&&e.addAttribute("showErrorMessage","1"),t.errorStyle&&e.addAttribute("errorStyle",t.errorStyle),t.errorTitle&&e.addAttribute("errorTitle",t.errorTitle),t.error&&e.addAttribute("error",t.error),e.addAttribute("sqref",t.sqref),(t.formulae||[]).forEach(((n,r)=>{e.openNode("formula"+(r+1)),"date"===t.type?e.writeText(a.dateToExcel(new Date(n))):e.writeText(n),e.closeNode()})),e.closeNode()})),e.closeNode())}parseOpen(e){switch(e.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=e.attributes.sqref;const t={type:e.attributes.type||"any",formulae:[]};switch(e.attributes.type&&u(t,e.attributes,"allowBlank"),u(t,e.attributes,"showInputMessage"),u(t,e.attributes,"showErrorMessage"),t.type){case"any":case"list":case"custom":break;default:c(t,e.attributes,"operator","between")}return c(t,e.attributes,"promptTitle"),c(t,e.attributes,"prompt"),c(t,e.attributes,"errorStyle"),c(t,e.attributes,"errorTitle"),c(t,e.attributes,"error"),this._dataValidation=t,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case"dataValidations":return!1;case"dataValidation":return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach((e=>{e.includes(":")?new l(e).forEachAddress((e=>{this.model[e]=this._dataValidation})):this.model[e]=this._dataValidation})),!0;case"formula1":case"formula2":{let e=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":e=parseInt(e,10);break;case"decimal":e=parseFloat(e);break;case"date":e=a.excelToDate(parseFloat(e))}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"dimension"}render(e,t){t&&e.leafNode("dimension",{ref:t})}parseOpen(e){return"dimension"===e.name&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"drawing"}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){return e.name===this.tag&&(this.model={rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(e,t,n){"use strict";const r=e("../composite-xform"),i=e("./cf-ext/conditional-formattings-ext-xform");class a extends r{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new i}}get tag(){return"ext"}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e,t){this.conditionalFormattings.prepare(e.conditionalFormattings,t)}render(e,t){e.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}}t.exports=class extends r{constructor(){super(),this.map={ext:this.ext=new a}}get tag(){return"extLst"}prepare(e,t){this.ext.prepare(e,t)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode("extLst"),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"headerFooter"}render(e,t){if(t){e.addRollback();let n=!1;e.openNode("headerFooter"),t.differentFirst&&(e.addAttribute("differentFirst","1"),n=!0),t.differentOddEven&&(e.addAttribute("differentOddEven","1"),n=!0),t.oddHeader&&"string"==typeof t.oddHeader&&(e.leafNode("oddHeader",null,t.oddHeader),n=!0),t.oddFooter&&"string"==typeof t.oddFooter&&(e.leafNode("oddFooter",null,t.oddFooter),n=!0),t.evenHeader&&"string"==typeof t.evenHeader&&(e.leafNode("evenHeader",null,t.evenHeader),n=!0),t.evenFooter&&"string"==typeof t.evenFooter&&(e.leafNode("evenFooter",null,t.evenFooter),n=!0),t.firstHeader&&"string"==typeof t.firstHeader&&(e.leafNode("firstHeader",null,t.firstHeader),n=!0),t.firstFooter&&"string"==typeof t.firstFooter&&(e.leafNode("firstFooter",null,t.firstFooter),n=!0),n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){switch(e.name){case"headerFooter":return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=1===parseInt(e.attributes.differentFirst,0)),e.attributes.differentOddEven&&(this.model.differentOddEven=1===parseInt(e.attributes.differentOddEven,0)),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(e){switch(this.currentNode){case"oddHeader":this.model.oddHeader=e;break;case"oddFooter":this.model.oddFooter=e;break;case"evenHeader":this.model.evenHeader=e;break;case"evenFooter":this.model.evenFooter=e;break;case"firstHeader":this.model.firstHeader=e;break;case"firstFooter":this.model.firstFooter=e}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"hyperlink"}render(e,t){this.isInternalLink(t)?e.leafNode("hyperlink",{ref:t.address,"r:id":t.rId,tooltip:t.tooltip,location:t.target}):e.leafNode("hyperlink",{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){return"hyperlink"===e.name&&(this.model={address:e.attributes.ref,rId:e.attributes["r:id"],tooltip:e.attributes.tooltip},e.attributes.location&&(this.model.target=e.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(e){return e.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(e.target)}}},{"../base-xform":32}],99:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"mergeCell"}render(e,t){e.leafNode("mergeCell",{ref:t})}parseOpen(e){return"mergeCell"===e.name&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(e,t,n){"use strict";const r=e("../../../utils/under-dash"),i=e("../../../doc/range"),a=e("../../../utils/col-cache"),s=e("../../../doc/enums");t.exports=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{const t="".concat(e.master,":").concat(e.address);this.merges[e.master]=new i(t)}}get mergeCells(){return r.map(this.merges,(e=>e.range))}reconcile(e,t){r.each(e,(e=>{const n=a.decode(e);for(let r=n.top;r<=n.bottom;r++){const e=t[r-1];for(let t=n.left;t<=n.right;t++){const i=e.cells[t-1];i?i.type===s.ValueType.Merge&&(i.master=n.tl):e.cells[t]={type:s.ValueType.Null,address:a.encodeAddress(r,t)}}}}))}getMasterAddress(e){const t=this.hash[e];return t&&t.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e=>void 0!==e;t.exports=class extends r{get tag(){return"outlinePr"}render(e,t){return!(!t||!i(t.summaryBelow)&&!i(t.summaryRight))&&(e.leafNode(this.tag,{summaryBelow:i(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:i(t.summaryRight)?Number(t.summaryRight):void 0}),!0)}parseOpen(e){return e.name===this.tag&&(this.model={summaryBelow:i(e.attributes.summaryBelow)?Boolean(Number(e.attributes.summaryBelow)):void 0,summaryRight:i(e.attributes.summaryRight)?Boolean(Number(e.attributes.summaryRight)):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"brk"}render(e,t){e.leafNode("brk",t)}parseOpen(e){return"brk"===e.name&&(this.model=e.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(e,t,n){"use strict";const r=e("../../../utils/under-dash"),i=e("../base-xform");t.exports=class extends i{get tag(){return"pageMargins"}render(e,t){if(t){const n={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};r.some(n,(e=>void 0!==e))&&e.leafNode(this.tag,n)}}parseOpen(e){return e.name===this.tag&&(this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"pageSetUpPr"}render(e,t){return!(!t||!t.fitToPage)&&(e.leafNode(this.tag,{fitToPage:t.fitToPage?"1":void 0}),!0)}parseOpen(e){return e.name===this.tag&&(this.model={fitToPage:"1"===e.attributes.fitToPage},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(e,t,n){"use strict";const r=e("../../../utils/under-dash"),i=e("../base-xform");function a(e){return e?"1":void 0}function s(e){if("overThenDown"===e)return e}function o(e){switch(e){case"atEnd":case"asDisplyed":return e;default:return}}function l(e){switch(e){case"dash":case"blank":case"NA":return e;default:return}}t.exports=class extends i{get tag(){return"pageSetup"}render(e,t){if(t){const n={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:t.horizontalDpi,verticalDpi:t.verticalDpi,pageOrder:s(t.pageOrder),blackAndWhite:a(t.blackAndWhite),draft:a(t.draft),cellComments:o(t.cellComments),errors:l(t.errors),scale:t.scale,fitToWidth:t.fitToWidth,fitToHeight:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:a(t.firstPageNumber),usePrinterDefaults:a(t.usePrinterDefaults),copies:t.copies};r.some(n,(e=>void 0!==e))&&e.leafNode(this.tag,n)}}parseOpen(e){return e.name===this.tag&&(this.model={paperSize:(t=e.attributes.paperSize,void 0!==t?parseInt(t,10):void 0),orientation:e.attributes.orientation||"portrait",horizontalDpi:parseInt(e.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(e.attributes.verticalDpi||"4294967295",10),pageOrder:e.attributes.pageOrder||"downThenOver",blackAndWhite:"1"===e.attributes.blackAndWhite,draft:"1"===e.attributes.draft,cellComments:e.attributes.cellComments||"None",errors:e.attributes.errors||"displayed",scale:parseInt(e.attributes.scale||"100",10),fitToWidth:parseInt(e.attributes.fitToWidth||"1",10),fitToHeight:parseInt(e.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(e.attributes.firstPageNumber||"1",10),useFirstPageNumber:"1"===e.attributes.useFirstPageNumber,usePrinterDefaults:"1"===e.attributes.usePrinterDefaults,copies:parseInt(e.attributes.copies||"1",10)},!0);var t}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"picture"}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){return e.name===this.tag&&(this.model={rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(e,t,n){"use strict";const r=e("../../../utils/under-dash"),i=e("../base-xform");function a(e){return e?"1":void 0}t.exports=class extends i{get tag(){return"printOptions"}render(e,t){if(t){const n={headings:a(t.showRowColHeaders),gridLines:a(t.showGridLines),horizontalCentered:a(t.horizontalCentered),verticalCentered:a(t.verticalCentered)};r.some(n,(e=>void 0!==e))&&e.leafNode(this.tag,n)}}parseOpen(e){return e.name===this.tag&&(this.model={showRowColHeaders:"1"===e.attributes.headings,showGridLines:"1"===e.attributes.gridLines,horizontalCentered:"1"===e.attributes.horizontalCentered,verticalCentered:"1"===e.attributes.verticalCentered},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(e,t,n){"use strict";const r=e("./page-breaks-xform"),i=e("../list-xform");t.exports=class extends i{constructor(){super({tag:"rowBreaks",count:!0,childXform:new r})}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),this.count&&(e.addAttribute(this.$count,t.length),e.addAttribute("manualBreakCount",t.length));const{childXform:n}=this;t.forEach((t=>{n.render(e,t)})),e.closeNode()}else this.empty&&e.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("../../../utils/utils"),a=e("./cell-xform");t.exports=class extends r{constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new a}}get tag(){return"row"}prepare(e,t){const n=t.styles.addStyleModel(e.style);n&&(e.styleId=n);const r=this.map.c;e.cells.forEach((e=>{r.prepare(e,t)}))}render(e,t,n){e.openNode("row"),e.addAttribute("r",t.number),t.height&&(e.addAttribute("ht",t.height),e.addAttribute("customHeight","1")),t.hidden&&e.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute("spans","".concat(t.min,":").concat(t.max)),t.styleId&&(e.addAttribute("s",t.styleId),e.addAttribute("customFormat","1")),e.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&e.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&e.addAttribute("collapsed","1");const r=this.map.c;t.cells.forEach((t=>{r.render(e,t,n)})),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if("row"===e.name){this.numRowsSeen+=1;const t=e.attributes.spans?e.attributes.spans.split(":").map((e=>parseInt(e,10))):[void 0,void 0],n=this.model={number:parseInt(e.attributes.r,10),min:t[0],max:t[1],cells:[]};return e.attributes.s&&(n.styleId=parseInt(e.attributes.s,10)),i.parseBoolean(e.attributes.hidden)&&(n.hidden=!0),i.parseBoolean(e.attributes.bestFit)&&(n.bestFit=!0),e.attributes.ht&&(n.height=parseFloat(e.attributes.ht)),e.attributes.outlineLevel&&(n.outlineLevel=parseInt(e.attributes.outlineLevel,10)),i.parseBoolean(e.attributes.collapsed)&&(n.collapsed=!0),!0}return this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error("Max column count (".concat(this.maxItems,") exceeded"));this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId?t.styles.getStyleModel(e.styleId):{},void 0!==e.styleId&&(e.styleId=void 0);const n=this.map.c;e.cells.forEach((e=>{n.reconcile(e,t)}))}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(e,t,n){"use strict";const r=e("../../../utils/under-dash"),i=e("../base-xform");t.exports=class extends i{get tag(){return"sheetFormatPr"}render(e,t){if(t){const n={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow,outlineLevelCol:t.outlineLevelCol,"x14ac:dyDescent":t.dyDescent};t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),t.defaultRowHeight&&15===t.defaultRowHeight||(n.customHeight="1"),r.some(n,(e=>void 0!==e))&&e.leafNode("sheetFormatPr",n)}}parseOpen(e){return"sheetFormatPr"===e.name&&(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(e.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(e.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol||"0",10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("../style/color-xform"),a=e("./page-setup-properties-xform"),s=e("./outline-properties-xform");t.exports=class extends r{constructor(){super(),this.map={tabColor:new i("tabColor"),pageSetUpPr:new a,outlinePr:new s}}get tag(){return"sheetPr"}render(e,t){if(t){e.addRollback(),e.openNode("sheetPr");let n=!1;n=this.map.tabColor.render(e,t.tabColor)||n,n=this.map.pageSetUpPr.render(e,t.pageSetup)||n,n=this.map.outlinePr.render(e,t.outlineProperties)||n,n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):!!this.map[e.name]&&(this.parser=this.map[e.name],this.parser.parseOpen(e),!0)}parseText(e){return!!this.parser&&(this.parser.parseText(e),!0)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(e,t,n){"use strict";const r=e("../../../utils/under-dash"),i=e("../base-xform");function a(e,t){return e?t:void 0}function s(e,t){return e===t||void 0}t.exports=class extends i{get tag(){return"sheetProtection"}render(e,t){if(t){const n={sheet:a(t.sheet,"1"),selectLockedCells:!1===t.selectLockedCells?"1":void 0,selectUnlockedCells:!1===t.selectUnlockedCells?"1":void 0,formatCells:a(t.formatCells,"0"),formatColumns:a(t.formatColumns,"0"),formatRows:a(t.formatRows,"0"),insertColumns:a(t.insertColumns,"0"),insertRows:a(t.insertRows,"0"),insertHyperlinks:a(t.insertHyperlinks,"0"),deleteColumns:a(t.deleteColumns,"0"),deleteRows:a(t.deleteRows,"0"),sort:a(t.sort,"0"),autoFilter:a(t.autoFilter,"0"),pivotTables:a(t.pivotTables,"0")};t.sheet&&(n.algorithmName=t.algorithmName,n.hashValue=t.hashValue,n.saltValue=t.saltValue,n.spinCount=t.spinCount,n.objects=a(!1===t.objects,"1"),n.scenarios=a(!1===t.scenarios,"1")),r.some(n,(e=>void 0!==e))&&e.leafNode(this.tag,n)}}parseOpen(e){return e.name===this.tag&&(this.model={sheet:s(e.attributes.sheet,"1"),objects:"1"!==e.attributes.objects&&void 0,scenarios:"1"!==e.attributes.scenarios&&void 0,selectLockedCells:"1"!==e.attributes.selectLockedCells&&void 0,selectUnlockedCells:"1"!==e.attributes.selectUnlockedCells&&void 0,formatCells:s(e.attributes.formatCells,"0"),formatColumns:s(e.attributes.formatColumns,"0"),formatRows:s(e.attributes.formatRows,"0"),insertColumns:s(e.attributes.insertColumns,"0"),insertRows:s(e.attributes.insertRows,"0"),insertHyperlinks:s(e.attributes.insertHyperlinks,"0"),deleteColumns:s(e.attributes.deleteColumns,"0"),deleteRows:s(e.attributes.deleteRows,"0"),sort:s(e.attributes.sort,"0"),autoFilter:s(e.attributes.autoFilter,"0"),pivotTables:s(e.attributes.pivotTables,"0")},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(e,t,n){"use strict";const r=e("../../../utils/col-cache"),i=e("../base-xform"),a={frozen:"frozen",frozenSplit:"frozen",split:"split"};t.exports=class extends i{get tag(){return"sheetView"}prepare(e){switch(e.state){case"frozen":case"split":break;default:e.state="normal"}}render(e,t){e.openNode("sheetView",{workbookViewId:t.workbookViewId||0});const n=function(t,n,r){r&&e.addAttribute(t,n)};let i,a,s,o;switch(n("rightToLeft","1",!0===t.rightToLeft),n("tabSelected","1",t.tabSelected),n("showRuler","0",!1===t.showRuler),n("showRowColHeaders","0",!1===t.showRowColHeaders),n("showGridLines","0",!1===t.showGridLines),n("zoomScale",t.zoomScale,t.zoomScale),n("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),n("view",t.style,t.style),t.state){case"frozen":a=t.xSplit||0,s=t.ySplit||0,i=t.topLeftCell||r.getAddress(s+1,a+1).address,o=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",e.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:i,activePane:o,state:"frozen"}),e.leafNode("selection",{pane:o,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":"topLeft"===t.activePane&&(t.activePane=void 0),e.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&e.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}e.closeNode()}parseOpen(e){switch(e.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:"1"===e.attributes.rightToLeft,tabSelected:"1"===e.attributes.tabSelected,showRuler:!("0"===e.attributes.showRuler),showRowColHeaders:!("0"===e.attributes.showRowColHeaders),showGridLines:!("0"===e.attributes.showGridLines),zoomScale:parseInt(e.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal||"100",10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(e.attributes.xSplit||"0",10),ySplit:parseInt(e.attributes.ySplit||"0",10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane||"topLeft",state:e.attributes.state},!0;case"selection":{const t=e.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,n;return"sheetView"!==e||(this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:a[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},"split"===this.model.state&&(t.activePane=this.pane.activePane),n=this.selections[this.pane.activePane],n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},n=this.selections.topLeft,n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1)}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"tablePart"}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){return e.name===this.tag&&(this.model={rId:e.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(e,t,n){"use strict";const r=e("../../../utils/under-dash"),i=e("../../../utils/col-cache"),a=e("../../../utils/xml-stream"),s=e("../../rel-type"),o=e("./merges"),l=e("../base-xform"),c=e("../list-xform"),u=e("./row-xform"),d=e("./col-xform"),h=e("./dimension-xform"),f=e("./hyperlink-xform"),p=e("./merge-cell-xform"),m=e("./data-validations-xform"),g=e("./sheet-properties-xform"),v=e("./sheet-format-properties-xform"),b=e("./sheet-view-xform"),y=e("./sheet-protection-xform"),x=e("./page-margins-xform"),w=e("./page-setup-xform"),A=e("./print-options-xform"),k=e("./auto-filter-xform"),S=e("./picture-xform"),_=e("./drawing-xform"),C=e("./table-part-xform"),j=e("./row-breaks-xform"),E=e("./header-footer-xform"),N=e("./cf/conditional-formattings-xform"),M=e("./ext-lst-xform"),T=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;const n={},r={};return e.forEach((e=>{n[e.ref]=e,e.rules.forEach((e=>{const{x14Id:t}=e;t&&(r[t]=e)}))})),t.forEach((t=>{t.rules.forEach((i=>{const a=r[i.x14Id];a?((e,t)=>{Object.keys(t).forEach((n=>{const r=e[n],i=t[n];void 0===r&&void 0!==i&&(e[n]=i)}))})(a,i):n[t.ref]?n[t.ref].rules.push(i):e.push({ref:t.ref,rules:[i]})}))})),e};class O extends l{constructor(e){super();const{maxRows:t,maxCols:n,ignoreNodes:r}=e||{};this.ignoreNodes=r||[],this.map={sheetPr:new g,dimension:new h,sheetViews:new c({tag:"sheetViews",count:!1,childXform:new b}),sheetFormatPr:new v,cols:new c({tag:"cols",count:!1,childXform:new d}),sheetData:new c({tag:"sheetData",count:!1,empty:!0,childXform:new u({maxItems:n}),maxItems:t}),autoFilter:new k,mergeCells:new c({tag:"mergeCells",count:!0,childXform:new p}),rowBreaks:new j,hyperlinks:new c({tag:"hyperlinks",count:!1,childXform:new f}),pageMargins:new x,dataValidations:new m,pageSetup:new w,headerFooter:new E,printOptions:new A,picture:new S,drawing:new _,sheetProtection:new y,tableParts:new c({tag:"tableParts",count:!0,childXform:new C}),conditionalFormatting:new N,extLst:new M}}prepare(e,t){t.merges=new o,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;const n=e.rels=[];function r(e){return"rId"+(e.length+1)}if(e.hyperlinks.forEach((e=>{const t=r(n);e.rId=t,n.push({Id:t,Type:s.Hyperlink,Target:e.target,TargetMode:"External"})})),e.comments.length>0){const a={Id:r(n),Type:s.Comments,Target:"../comments".concat(e.id,".xml")};n.push(a);const o={Id:r(n),Type:s.VmlDrawing,Target:"../drawings/vmlDrawing".concat(e.id,".vml")};n.push(o),e.comments.forEach((e=>{e.refAddress=i.decodeAddress(e.ref)})),t.commentRefs.push({commentName:"comments"+e.id,vmlDrawing:"vmlDrawing"+e.id})}const a=[];let l;e.media.forEach((i=>{if("background"===i.type){const a=r(n);l=t.media[i.imageId],n.push({Id:a,Type:s.Image,Target:"../media/".concat(l.name,".").concat(l.extension)}),e.background={rId:a},e.image=t.media[i.imageId]}else if("image"===i.type){let{drawing:o}=e;l=t.media[i.imageId],o||(o=e.drawing={rId:r(n),name:"drawing"+ ++t.drawingsCount,anchors:[],rels:[]},t.drawings.push(o),n.push({Id:o.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:"../drawings/".concat(o.name,".xml")}));let c=this.preImageId===i.imageId?a[i.imageId]:a[o.rels.length];c||(c=r(o.rels),a[o.rels.length]=c,o.rels.push({Id:c,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:"../media/".concat(l.name,".").concat(l.extension)}));const u={picture:{rId:c},range:i.range};if(i.hyperlinks&&i.hyperlinks.hyperlink){const e=r(o.rels);a[o.rels.length]=e,u.picture.hyperlinks={tooltip:i.hyperlinks.tooltip,rId:e},o.rels.push({Id:e,Type:s.Hyperlink,Target:i.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=i.imageId,o.anchors.push(u)}})),e.tables.forEach((e=>{const i=r(n);e.rId=i,n.push({Id:i,Type:s.Table,Target:"../tables/"+e.target}),e.columns.forEach((e=>{const{style:n}=e;n&&(e.dxfId=t.styles.addDxfStyle(n))}))})),this.map.extLst.prepare(e,t)}render(e,t){e.openXml(a.StdDocAttributes),e.openNode("worksheet",O.WORKSHEET_ATTRIBUTES);const n=t.properties?{defaultRowHeight:t.properties.defaultRowHeight,dyDescent:t.properties.dyDescent,outlineLevelCol:t.properties.outlineLevelCol,outlineLevelRow:t.properties.outlineLevelRow}:void 0;t.properties&&t.properties.defaultColWidth&&(n.defaultColWidth=t.properties.defaultColWidth);const r={outlineProperties:t.properties&&t.properties.outlineProperties,tabColor:t.properties&&t.properties.tabColor,pageSetup:t.pageSetup&&t.pageSetup.fitToPage?{fitToPage:t.pageSetup.fitToPage}:void 0},i=t.pageSetup&&t.pageSetup.margins,o={showRowColHeaders:t.pageSetup&&t.pageSetup.showRowColHeaders,showGridLines:t.pageSetup&&t.pageSetup.showGridLines,horizontalCentered:t.pageSetup&&t.pageSetup.horizontalCentered,verticalCentered:t.pageSetup&&t.pageSetup.verticalCentered},l=t.sheetProtection;this.map.sheetPr.render(e,r),this.map.dimension.render(e,t.dimensions),this.map.sheetViews.render(e,t.views),this.map.sheetFormatPr.render(e,n),this.map.cols.render(e,t.cols),this.map.sheetData.render(e,t.rows),this.map.sheetProtection.render(e,l),this.map.autoFilter.render(e,t.autoFilter),this.map.mergeCells.render(e,t.mergeCells),this.map.conditionalFormatting.render(e,t.conditionalFormattings),this.map.dataValidations.render(e,t.dataValidations),this.map.hyperlinks.render(e,t.hyperlinks),this.map.printOptions.render(e,o),this.map.pageMargins.render(e,i),this.map.pageSetup.render(e,t.pageSetup),this.map.headerFooter.render(e,t.headerFooter),this.map.rowBreaks.render(e,t.rowBreaks),this.map.drawing.render(e,t.drawing),this.map.picture.render(e,t.background),this.map.tableParts.render(e,t.tables),this.map.extLst.render(e,t),t.rels&&t.rels.forEach((t=>{t.Type===s.VmlDrawing&&e.leafNode("legacyDrawing",{"r:id":t.Id})})),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"worksheet"===e.name?(r.each(this.map,(e=>{e.reset()})),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if("worksheet"===e){const e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);const t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},n=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),r=T(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:n,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:r},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}return!0}reconcile(e,t){const n=(e.relationships||[]).reduce(((n,r)=>{if(n[r.Id]=r,r.Type===s.Comments&&(e.comments=t.comments[r.Target].comments),r.Type===s.VmlDrawing&&e.comments&&e.comments.length){const n=t.vmlDrawings[r.Target].comments;e.comments.forEach(((e,t)=>{e.note=Object.assign({},e.note,n[t])}))}return n}),{});if(t.commentsMap=(e.comments||[]).reduce(((e,t)=>(t.ref&&(e[t.ref]=t),e)),{}),t.hyperlinkMap=(e.hyperlinks||[]).reduce(((e,t)=>(t.rId&&(e[t.address]=n[t.rId].Target),e)),{}),t.formulae={},e.rows=e.rows&&e.rows.filter(Boolean)||[],e.rows.forEach((e=>{e.cells=e.cells&&e.cells.filter(Boolean)||[]})),this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){const r=n[e.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(r){const n=r[1];t.drawings[n].anchors.forEach((t=>{if(t.medium){const n={type:"image",imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks};e.media.push(n)}}))}}const r=e.background&&n[e.background.rId];if(r){const n=r.Target.split("/media/")[1],i=t.mediaIndex&&t.mediaIndex[n];void 0!==i&&e.media.push({type:"background",imageId:i})}e.tables=(e.tables||[]).map((e=>{const r=n[e.rId];return t.tables[r.Target]})),delete e.relationships,delete e.hyperlinks,delete e.comments}}O.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"},t.exports=O},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?"":e.toISOString()}catch(e){return""}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag&&(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0)}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs}render(e,t){void 0!==t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(e,t,n){"use strict";const r=e("./base-xform"),i=e("../../utils/xml-stream");t.exports=class extends r{constructor(e){super(),this._model=e}render(e){if(!this._xml){const e=new i;!function e(t,n){t.openNode(n.tag,n.$),n.c&&n.c.forEach((n=>{e(t,n)})),n.t&&t.writeText(n.t),t.closeNode()}(e,this._model),this._xml=e.xml}e.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){return e!==this._model.tag}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(e,t,n){"use strict";const r=e("./text-xform"),i=e("./rich-text-xform"),a=e("../base-xform");t.exports=class extends a{constructor(){super(),this.map={r:new i,t:new r}}get tag(){return"rPh"}render(e,t){if(e.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){const{r:n}=this.map;t.richText.forEach((t=>{n.render(e,t)}))}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){const{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}return e!==this.tag}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(e,t,n){"use strict";const r=e("./text-xform"),i=e("../style/font-xform"),a=e("../base-xform");class s extends a{constructor(e){super(),this.model=e}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new r)}get fontXform(){return this._fontXform||(this._fontXform=new i(s.FONT_OPTIONS))}render(e,t){t=t||this.model,e.openNode("r"),t.font&&this.fontXform.render(e,t.font),this.textXform.render(e,t.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(e),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}}s.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},t.exports=s},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(e,t,n){"use strict";const r=e("./text-xform"),i=e("./rich-text-xform"),a=e("./phonetic-text-xform"),s=e("../base-xform");t.exports=class extends s{constructor(e){super(),this.model=e,this.map={r:new i,t:new r,rPh:new a}}get tag(){return"si"}render(e,t){e.openNode(this.tag),t&&t.hasOwnProperty("richText")&&t.richText?t.richText.length?t.richText.forEach((t=>{this.map.r.render(e,t)})):this.map.t.render(e,""):null!=t&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){const{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case"r":{let e=this.model.richText;e||(e=this.model.richText=[]),e.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}return e!==this.tag}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(e,t,n){"use strict";const r=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("./shared-string-xform");t.exports=class extends i{constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new a)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return void 0===t&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){const t=this.sharedStringXform.toXml(e);let n=this.rich[t];return void 0===n&&(n=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,n}render(e,t){t=t||this._values,e.openXml(r.StdDocAttributes),e.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});const n=this.sharedStringXform;t.values.forEach((t=>{n.render(e,t)})),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;if("sst"===e)return!1;throw new Error("Unexpected xml node in parseClose: "+e)}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"t"}render(e,t){e.openNode("t"),/^\s|\n|\s$/.test(t)&&e.addAttribute("xml:space","preserve"),e.writeText(t),e.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}parseOpen(e){return"t"===e.name&&(this._text=[],!0)}parseText(e){this._text.push(e)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(e,t,n){"use strict";const r=e("../../../doc/enums"),i=e("../../../utils/utils"),a=e("../base-xform"),s={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce(((e,t)=>(e[t]=!0,e)),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce(((e,t)=>(e[t]=!0,e)),{}),vertical(e){return"middle"===e?"center":this.verticalValues[e]?e:void 0},wrapText:e=>!!e||void 0,shrinkToFit:e=>!!e||void 0,textRotation:e=>"vertical"===e||(e=i.validInt(e))>=-90&&e<=90?e:void 0,indent:e=>(e=i.validInt(e),Math.max(0,e)),readingOrder(e){switch(e){case"ltr":return r.ReadingOrder.LeftToRight;case"rtl":return r.ReadingOrder.RightToLeft;default:return}}},o={toXml(e){if(e=s.textRotation(e)){if("vertical"===e)return 255;const t=Math.round(e);if(t>=0&&t<=90)return t;if(t<0&&t>=-90)return 90-t}},toModel(e){const t=i.validInt(e);if(void 0!==t){if(255===t)return"vertical";if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};t.exports=class extends a{get tag(){return"alignment"}render(e,t){e.addRollback(),e.openNode("alignment");let n=!1;function r(t,r){r&&(e.addAttribute(t,r),n=!0)}r("horizontal",s.horizontal(t.horizontal)),r("vertical",s.vertical(t.vertical)),r("wrapText",!!s.wrapText(t.wrapText)&&"1"),r("shrinkToFit",!!s.shrinkToFit(t.shrinkToFit)&&"1"),r("indent",s.indent(t.indent)),r("textRotation",o.toXml(t.textRotation)),r("readingOrder",s.readingOrder(t.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){const t={};let n=!1;function r(e,r,i){e&&(t[r]=i,n=!0)}r(e.attributes.horizontal,"horizontal",e.attributes.horizontal),r(e.attributes.vertical,"vertical","center"===e.attributes.vertical?"middle":e.attributes.vertical),r(e.attributes.wrapText,"wrapText",i.parseBoolean(e.attributes.wrapText)),r(e.attributes.shrinkToFit,"shrinkToFit",i.parseBoolean(e.attributes.shrinkToFit)),r(e.attributes.indent,"indent",parseInt(e.attributes.indent,10)),r(e.attributes.textRotation,"textRotation",o.toModel(e.attributes.textRotation)),r(e.attributes.readingOrder,"readingOrder","2"===e.attributes.readingOrder?"rtl":"ltr"),this.model=n?t:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(e,t,n){"use strict";const i=e("../base-xform"),a=e("../../../utils/utils"),s=e("./color-xform");class o extends i{constructor(e){super(),this.name=e,this.map={color:new s}}get tag(){return this.name}render(e,t,n){const r=t&&t.color||n||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute("style",t.style),r&&this.map.color.render(e,r)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{const{style:t}=e.attributes;return this.model=t?{style:t}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(e){return o.validStyleValues[e]}}o.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce(((e,t)=>(e[t]=!0,e)),{}),t.exports=class extends i{constructor(){super(),this.map={top:new o("top"),left:new o("left"),bottom:new o("bottom"),right:new o("right"),diagonal:new o("diagonal")}}render(e,t){const{color:n}=t;function i(i,a){i&&!i.color&&t.color&&(i=r(r({},i),{},{color:t.color})),a.render(e,i,n)}e.openNode("border"),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute("diagonalUp","1"),t.diagonal.down&&e.addAttribute("diagonalDown","1")),i(t.left,this.map.left),i(t.right,this.map.right),i(t.top,this.map.top),i(t.bottom,this.map.bottom),i(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"border"===e.name?(this.reset(),this.diagonalUp=a.parseBoolean(e.attributes.diagonalUp),this.diagonalDown=a.parseBoolean(e.attributes.diagonalDown),!0):(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if("border"===e){const e=this.model={},t=function(t,n,r){n&&(r&&Object.assign(n,r),e[t]=n)};t("left",this.map.left.model),t("right",this.map.right.model),t("top",this.map.top.model),t("bottom",this.map.bottom.model),t("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{constructor(e){super(),this.name=e||"color"}get tag(){return this.name}render(e,t){return!!t&&(e.openNode(this.name),t.argb?e.addAttribute("rgb",t.argb):void 0!==t.theme?(e.addAttribute("theme",t.theme),void 0!==t.tint&&e.addAttribute("tint",t.tint)):void 0!==t.indexed?e.addAttribute("indexed",t.indexed):e.addAttribute("auto","1"),e.closeNode(),!0)}parseOpen(e){return e.name===this.name&&(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):e.attributes.indexed?this.model={indexed:parseInt(e.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("./alignment-xform"),a=e("./border-xform"),s=e("./fill-xform"),o=e("./font-xform"),l=e("./numfmt-xform"),c=e("./protection-xform");t.exports=class extends r{constructor(){super(),this.map={alignment:new i,border:new a,fill:new s,font:new o,numFmt:new l,protection:new c}}get tag(){return"dxf"}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){const n={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,n)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("./color-xform");class a extends r{constructor(){super(),this.map={color:new i}}get tag(){return"stop"}render(e,t){e.openNode("stop"),e.addAttribute("position",t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"stop":return this.model={position:parseFloat(e.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class s extends r{constructor(){super(),this.map={fgColor:new i("fgColor"),bgColor:new i("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(e,t){e.openNode("patternFill"),e.addAttribute("patternType",t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"patternFill"===e.name?(this.model={type:"pattern",pattern:e.attributes.patternType},!0):(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0)}}class o extends r{constructor(){super(),this.map={stop:new a}}get name(){return"gradient"}get tag(){return"gradientFill"}render(e,t){switch(e.openNode("gradientFill"),t.gradient){case"angle":e.addAttribute("degree",t.degree);break;case"path":e.addAttribute("type","path"),t.center.left&&(e.addAttribute("left",t.center.left),void 0===t.center.right&&e.addAttribute("right",t.center.left)),t.center.right&&e.addAttribute("right",t.center.right),t.center.top&&(e.addAttribute("top",t.center.top),void 0===t.center.bottom&&e.addAttribute("bottom",t.center.top)),t.center.bottom&&e.addAttribute("bottom",t.center.bottom)}const n=this.map.stop;t.stops.forEach((t=>{n.render(e,t)})),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"gradientFill":{const t=this.model={stops:[]};return e.attributes.degree?(t.gradient="angle",t.degree=parseInt(e.attributes.degree,10)):"path"===e.attributes.type&&(t.gradient="path",t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class l extends r{constructor(){super(),this.map={patternFill:new s,gradientFill:new o}}get tag(){return"fill"}render(e,t){switch(e.addRollback(),e.openNode("fill"),t.type){case"pattern":this.map.patternFill.render(e,t);break;case"gradient":this.map.gradientFill.render(e,t);break;default:return void e.rollback()}e.closeNode(),e.commit()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"fill"===e.name?(this.model={},!0):(this.parser=this.map[e.name],!!this.parser&&(this.parser.parseOpen(e),!0))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return!!this.parser&&(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(e){return l.validPatternValues[e]}}l.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce(((e,t)=>(e[t]=!0,e)),{}),l.StopXform=a,l.PatternFillXform=s,l.GradientFillXform=o,t.exports=l},{"../base-xform":32,"./color-xform":128}],131:[function(e,t,n){"use strict";const r=e("./color-xform"),i=e("../simple/boolean-xform"),a=e("../simple/integer-xform"),s=e("../simple/string-xform"),o=e("./underline-xform"),l=e("../../../utils/under-dash"),c=e("../base-xform");class u extends c{constructor(e){super(),this.options=e||u.OPTIONS,this.map={b:{prop:"bold",xform:new i({tag:"b",attr:"val"})},i:{prop:"italic",xform:new i({tag:"i",attr:"val"})},u:{prop:"underline",xform:new o},charset:{prop:"charset",xform:new a({tag:"charset",attr:"val"})},color:{prop:"color",xform:new r},condense:{prop:"condense",xform:new i({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new i({tag:"extend",attr:"val"})},family:{prop:"family",xform:new a({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new i({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new s({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new s({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new i({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new i({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new a({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new s({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(e,t){const{map:n}=this;e.openNode(this.options.tagName),l.each(this.map,((r,i)=>{n[i].xform.render(e,t[r.prop])})),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):this.map[e.name]?(this.parser=this.map[e.name].xform,this.parser.parseOpen(e)):e.name===this.options.tagName&&(this.model={},!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){const t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}return e!==this.options.tagName}}u.OPTIONS={tagName:"font",fontNameTag:"name"},t.exports=u},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(e,t,n){"use strict";const r=e("../../../utils/under-dash"),i=e("../../defaultnumformats"),a=e("../base-xform"),s=function(){const e={};return r.each(i,((t,n)=>{t.f&&(e[t.f]=parseInt(n,10))})),e}();class o extends a{constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return"numFmt"}render(e,t){e.leafNode("numFmt",{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){return"numFmt"===e.name&&(this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0)}parseText(){}parseClose(){return!1}}o.getDefaultFmtId=function(e){return s[e]},o.getDefaultFmtCode=function(e){return i[e]&&i[e].f},t.exports=o},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(e,t,n){"use strict";const r=e("../base-xform"),i={boolean:(e,t)=>void 0===e?t:e};t.exports=class extends r{get tag(){return"protection"}render(e,t){e.addRollback(),e.openNode("protection");let n=!1;function r(t,r){void 0!==r&&(e.addAttribute(t,r),n=!0)}r("locked",i.boolean(t.locked,!0)?void 0:"0"),r("hidden",i.boolean(t.hidden,!1)?"1":void 0),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){const t={locked:!("0"===e.attributes.locked),hidden:"1"===e.attributes.hidden},n=!t.locked||t.hidden;this.model=n?t:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("./alignment-xform"),a=e("./protection-xform");t.exports=class extends r{constructor(e){super(),this.xfId=!(!e||!e.xfId),this.map={alignment:new i,protection:new a}}get tag(){return"xf"}render(e,t){e.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&e.addAttribute("xfId",t.xfId||0),t.numFmtId&&e.addAttribute("applyNumberFormat","1"),t.fontId&&e.addAttribute("applyFont","1"),t.fillId&&e.addAttribute("applyFill","1"),t.borderId&&e.addAttribute("applyBorder","1"),t.alignment&&e.addAttribute("applyAlignment","1"),t.protection&&e.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case"xf":return this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):"xf"!==e}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(e,t,n){"use strict";const r=e("../../../doc/enums"),i=e("../../../utils/xml-stream"),a=e("../base-xform"),s=e("../static-xform"),o=e("../list-xform"),l=e("./font-xform"),c=e("./fill-xform"),u=e("./border-xform"),d=e("./numfmt-xform"),h=e("./style-xform"),f=e("./dxf-xform");class p extends a{constructor(e){super(),this.map={numFmts:new o({tag:"numFmts",count:!0,childXform:new d}),fonts:new o({tag:"fonts",count:!0,childXform:new l,$:{"x14ac:knownFonts":1}}),fills:new o({tag:"fills",count:!0,childXform:new c}),borders:new o({tag:"borders",count:!0,childXform:new u}),cellStyleXfs:new o({tag:"cellStyleXfs",count:!0,childXform:new h}),cellXfs:new o({tag:"cellXfs",count:!0,childXform:new h({xfId:!0})}),dxfs:new o({tag:"dxfs",always:!0,count:!0,childXform:new f}),numFmt:new d,font:new l,fill:new c,border:new u,style:new h({xfId:!0}),cellStyles:p.STATIC_XFORMS.cellStyles,tableStyles:p.STATIC_XFORMS.tableStyles,extLst:p.STATIC_XFORMS.extLst},e&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(e,t){t=t||this.model,e.openXml(i.StdDocAttributes),e.openNode("styleSheet",p.STYLESHEET_ATTRIBUTES),this.index?(t.numFmts&&t.numFmts.length&&(e.openNode("numFmts",{count:t.numFmts.length}),t.numFmts.forEach((t=>{e.writeXml(t)})),e.closeNode()),t.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),e.openNode("fonts",{count:t.fonts.length,"x14ac:knownFonts":1}),t.fonts.forEach((t=>{e.writeXml(t)})),e.closeNode(),e.openNode("fills",{count:t.fills.length}),t.fills.forEach((t=>{e.writeXml(t)})),e.closeNode(),e.openNode("borders",{count:t.borders.length}),t.borders.forEach((t=>{e.writeXml(t)})),e.closeNode(),this.map.cellStyleXfs.render(e,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),e.openNode("cellXfs",{count:t.styles.length}),t.styles.forEach((t=>{e.writeXml(t)})),e.closeNode()):(this.map.numFmts.render(e,t.numFmts),this.map.fonts.render(e,t.fonts),this.map.fills.render(e,t.fills),this.map.borders.render(e,t.borders),this.map.cellStyleXfs.render(e,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(e,t.styles)),p.STATIC_XFORMS.cellStyles.render(e),this.map.dxfs.render(e,t.dxfs),p.STATIC_XFORMS.tableStyles.render(e),p.STATIC_XFORMS.extLst.render(e),e.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):"styleSheet"===e.name?(this.initIndex(),!0):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if("styleSheet"===e){this.model={};const e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e("numFmts",this.map.numFmts),e("fonts",this.map.fonts),e("fills",this.map.fills),e("borders",this.map.borders),e("styles",this.map.cellXfs),e("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const e=this.index.numFmt;this.model.numFmts.forEach((t=>{e[t.id]=t.formatCode}))}return!1}return!0}addStyleModel(e,t){if(!e)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);const n={};if(t=t||r.ValueType.Number,e.numFmt)n.numFmtId=this._addNumFmtStr(e.numFmt);else switch(t){case r.ValueType.Number:n.numFmtId=this._addNumFmtStr("General");break;case r.ValueType.Date:n.numFmtId=this._addNumFmtStr("mm-dd-yy")}e.font&&(n.fontId=this._addFont(e.font)),e.border&&(n.borderId=this._addBorder(e.border)),e.fill&&(n.fillId=this._addFill(e.fill)),e.alignment&&(n.alignment=e.alignment),e.protection&&(n.protection=e.protection);const i=this._addStyle(n);return this.weakMap&&this.weakMap.set(e,i),i}getStyleModel(e){const t=this.model.styles[e];if(!t)return null;let n=this.index.model[e];if(n)return n;if(n=this.index.model[e]={},t.numFmtId){const e=this.index.numFmt[t.numFmtId]||d.getDefaultFmtCode(t.numFmtId);e&&(n.numFmt=e)}function r(e,t,r){if(r||0===r){const i=t[r];i&&(n[e]=i)}}return r("font",this.model.fonts,t.fontId),r("border",this.model.borders,t.borderId),r("fill",this.model.fills,t.fillId),t.alignment&&(n.alignment=t.alignment),t.protection&&(n.protection=t.protection),n}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}_addStyle(e){const t=this.map.style.toXml(e);let n=this.index.style[t];return void 0===n&&(n=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),n}_addNumFmtStr(e){let t=d.getDefaultFmtId(e);if(void 0!==t)return t;if(t=this.index.numFmt[e],void 0!==t)return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;const n=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(n),t}_addFont(e){const t=this.map.font.toXml(e);let n=this.index.font[t];return void 0===n&&(n=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),n}_addBorder(e){const t=this.map.border.toXml(e);let n=this.index.border[t];return void 0===n&&(n=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),n}_addFill(e){const t=this.map.fill.toXml(e);let n=this.index.fill[t];return void 0===n&&(n=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),n}}p.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},p.STATIC_XFORMS={cellStyles:new s({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new s({tag:"dxfs",$:{count:0}}),tableStyles:new s({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new s({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},p.Mock=class extends p{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){return t===r.ValueType.Date?this.dateStyleId:0}get dateStyleId(){if(!this._dateStyleId){const e={numFmtId:d.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}},t.exports=p},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(e,t,n){"use strict";const r=e("../base-xform");class i extends r{constructor(e){super(),this.model=e}get tag(){return"u"}render(e,t){if(!0===(t=t||this.model))e.leafNode("u");else{const n=i.Attributes[t];n&&e.leafNode("u",n)}}parseOpen(e){"u"===e.name&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}}i.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},t.exports=i},{"../base-xform":32}],137:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("./filter-column-xform");t.exports=class extends r{constructor(){super(),this.map={filterColumn:new i}}get tag(){return"autoFilter"}prepare(e){e.columns.forEach(((e,t)=>{this.map.filterColumn.prepare(e,{index:t})}))}render(e,t){return e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach((t=>{this.map.filterColumn.render(e,t)})),e.closeNode(),!0}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===this.tag)return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;if(e===this.tag)return!1;throw new Error("Unexpected xml node in parseClose: "+e)}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"customFilter"}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val,operator:e.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(e,t,n){"use strict";const r=e("../base-xform"),i=e("../list-xform"),a=e("./custom-filter-xform"),s=e("./filter-xform");t.exports=class extends r{constructor(){super(),this.map={customFilters:new i({tag:"customFilters",count:!1,empty:!0,childXform:new a}),filters:new i({tag:"filters",count:!1,empty:!0,childXform:new s})}}get tag(){return"filterColumn"}prepare(e,t){e.colId=t.index.toString()}render(e,t){return t.customFilters?(e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?"0":"1"}),this.map.customFilters.render(e,t.customFilters),e.closeNode(),!0):(e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?"0":"1"}),!0)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;const{attributes:t}=e;if(e.name===this.tag)return this.model={filterButton:"0"===t.hiddenButton},!0;if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(e))}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.customFilters=this.map.customFilters.model,!1)}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"filter"}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag&&(this.model={val:e.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"tableColumn"}prepare(e,t){e.id=t.index+1}render(e,t){return e.leafNode(this.tag,{id:t.id.toString(),name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId}),!0}parseOpen(e){if(e.name===this.tag){const{attributes:t}=e;return this.model={name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(e,t,n){"use strict";const r=e("../base-xform");t.exports=class extends r{get tag(){return"tableStyleInfo"}render(e,t){return e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?"1":"0",showLastColumn:t.showLastColumn?"1":"0",showRowStripes:t.showRowStripes?"1":"0",showColumnStripes:t.showColumnStripes?"1":"0"}),!0}parseOpen(e){if(e.name===this.tag){const{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:"1"===t.showFirstColumn,showLastColumn:"1"===t.showLastColumn,showRowStripes:"1"===t.showRowStripes,showColumnStripes:"1"===t.showColumnStripes},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(e,t,n){"use strict";const i=e("../../../utils/xml-stream"),a=e("../base-xform"),s=e("../list-xform"),o=e("./auto-filter-xform"),l=e("./table-column-xform"),c=e("./table-style-info-xform");class u extends a{constructor(){super(),this.map={autoFilter:new o,tableColumns:new s({tag:"tableColumns",count:!0,empty:!0,childXform:new l}),tableStyleInfo:new c}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return"table"}render(e,t){e.openXml(i.StdDocAttributes),e.openNode(this.tag,r(r({},u.TABLE_ATTRIBUTES),{},{id:t.id,name:t.name,displayName:t.displayName||t.name,ref:t.tableRef,totalsRowCount:t.totalsRow?"1":void 0,totalsRowShown:t.totalsRow?void 0:"1",headerRowCount:t.headerRow?"1":"0"})),this.map.autoFilter.render(e,t),this.map.tableColumns.render(e,t.columns),this.map.tableStyleInfo.render(e,t.style),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;const{name:t,attributes:n}=e;return t===this.tag?(this.reset(),this.model={name:n.name,displayName:n.displayName||n.name,tableRef:n.ref,totalsRow:"1"===n.totalsRowCount,headerRow:"1"===n.headerRowCount}):(this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e)),!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e!==this.tag||(this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach(((e,t)=>{this.model.columns[t].filterButton=e.filterButton}))),this.model.style=this.map.tableStyleInfo.model,!1)}reconcile(e,t){e.columns.forEach((e=>{void 0!==e.dxfId&&(e.style=t.styles.getDxfStyle(e.dxfId))}))}}u.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},t.exports=u},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(e,t,n){(function(n,r){(function(){"use strict";const i=e("fs"),a=e("jszip"),{PassThrough:o}=e("readable-stream"),l=e("../utils/zip-stream"),c=e("../utils/stream-buf"),u=e("../utils/utils"),d=e("../utils/xml-stream"),{bufferToString:h}=e("../utils/browser-buffer-decode"),f=e("./xform/style/styles-xform"),p=e("./xform/core/core-xform"),m=e("./xform/strings/shared-strings-xform"),g=e("./xform/core/relationships-xform"),v=e("./xform/core/content-types-xform"),b=e("./xform/core/app-xform"),y=e("./xform/book/workbook-xform"),x=e("./xform/sheet/worksheet-xform"),w=e("./xform/drawing/drawing-xform"),A=e("./xform/table/table-xform"),k=e("./xform/comment/comments-xform"),S=e("./xform/comment/vml-notes-xform"),_=e("./xml/theme1");class C{constructor(e){this.workbook=e}async readFile(e,t){if(!await u.fs.exists(e))throw new Error("File not found: "+e);const n=i.createReadStream(e);try{const e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}parseRels(e){return(new g).parseStream(e)}parseWorkbook(e){return(new y).parseStream(e)}parseSharedStrings(e){return(new m).parseStream(e)}reconcile(e,t){const n=new y,r=new x(t),i=new w,a=new A;n.reconcile(e);const s={media:e.media,mediaIndex:e.mediaIndex};Object.keys(e.drawings).forEach((t=>{const n=e.drawings[t],r=e.drawingRels[t];r&&(s.rels=r.reduce(((e,t)=>(e[t.Id]=t,e)),{}),(n.anchors||[]).forEach((e=>{const t=e.picture&&e.picture.hyperlinks;t&&s.rels[t.rId]&&(t.hyperlink=s.rels[t.rId].Target,delete t.rId)})),i.reconcile(n,s))}));const o={styles:e.styles};Object.values(e.tables).forEach((e=>{a.reconcile(e,o)}));const l={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties&&e.properties.date1904,drawings:e.drawings,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings};e.worksheets.forEach((t=>{t.relationships=e.worksheetRels[t.sheetNo],r.reconcile(t,l)})),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings}async _processWorksheetEntry(e,t,n,r,i){const a=new x(r),s=await a.parseStream(e);s.sheetNo=n,t.worksheetHash[i]=s,t.worksheets.push(s)}async _processCommentEntry(e,t,n){const r=new k,i=await r.parseStream(e);t.comments["../".concat(n,".xml")]=i}async _processTableEntry(e,t,n){const r=new A,i=await r.parseStream(e);t.tables["../tables/".concat(n,".xml")]=i}async _processWorksheetRelsEntry(e,t,n){const r=new g,i=await r.parseStream(e);t.worksheetRels[n]=i}async _processMediaEntry(e,t,n){const r=n.lastIndexOf(".");if(r>=1){const i=n.substr(r+1),a=n.substr(0,r);await new Promise(((r,s)=>{const o=new c;o.on("finish",(()=>{t.mediaIndex[n]=t.media.length,t.mediaIndex[a]=t.media.length;const e={type:"image",name:a,extension:i,buffer:o.toBuffer()};t.media.push(e),r()})),e.on("error",(e=>{s(e)})),e.pipe(o)}))}}async _processDrawingEntry(e,t,n){const r=new w,i=await r.parseStream(e);t.drawings[n]=i}async _processDrawingRelsEntry(e,t,n){const r=new g,i=await r.parseStream(e);t.drawingRels[n]=i}async _processVmlDrawingEntry(e,t,n){const r=new S,i=await r.parseStream(e);t.vmlDrawings["../drawings/".concat(n,".vml")]=i}async _processThemeEntry(e,t,n){await new Promise(((r,i)=>{const a=new c;e.on("error",i),a.on("error",i),a.on("finish",(()=>{t.themes[n]=a.read().toString(),r()})),e.pipe(a)}))}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(e,t){!e[Symbol.asyncIterator]&&e.pipe&&(e=e.pipe(new o));const n=[];var i,a=!1,l=!1;try{for(var c,u=s(e);a=!(c=await u.next()).done;a=!1){const e=c.value;n.push(e)}}catch(d){l=!0,i=d}finally{try{a&&null!=u.return&&await u.return()}finally{if(l)throw i}}return this.load(r.concat(n),t)}async load(e,t){let i;i=t&&t.base64?r.from(e.toString(),"base64"):e;const s={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},l=await a.loadAsync(i);for(const r of Object.values(l.files))if(!r.dir){let e,i=r.name;if("/"===i[0]&&(i=i.substr(1)),i.match(/xl\/media\//)||i.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))e=new o,e.write(await r.async("nodebuffer"));else{let t;e=new o({writableObjectMode:!0,readableObjectMode:!0}),t=n.browser?h(await r.async("nodebuffer")):await r.async("string");const i=16384;for(let n=0;n{if("image"===t.type){const n="xl/media/".concat(t.name,".").concat(t.extension);if(t.filename){const r=await function(e,t){return new Promise(((n,r)=>{i.readFile(e,t,((e,t)=>{e?r(e):n(t)}))}))}(t.filename);return e.append(r,{name:n})}if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){const r=t.base64,i=r.substring(r.indexOf(",")+1);return e.append(i,{name:n,base64:!0})}}throw new Error("Unsupported media")})))}addDrawings(e,t){const n=new w,r=new g;t.worksheets.forEach((t=>{const{drawing:i}=t;if(i){n.prepare(i,{});let t=n.toXml(i);e.append(t,{name:"xl/drawings/".concat(i.name,".xml")}),t=r.toXml(i.rels),e.append(t,{name:"xl/drawings/_rels/".concat(i.name,".xml.rels")})}}))}addTables(e,t){const n=new A;t.worksheets.forEach((t=>{const{tables:r}=t;r.forEach((t=>{n.prepare(t,{});const r=n.toXml(t);e.append(r,{name:"xl/tables/"+t.target})}))}))}async addContentTypes(e,t){const n=(new v).toXml(t);e.append(n,{name:"[Content_Types].xml"})}async addApp(e,t){const n=(new b).toXml(t);e.append(n,{name:"docProps/app.xml"})}async addCore(e,t){const n=new p;e.append(n.toXml(t),{name:"docProps/core.xml"})}async addThemes(e,t){const n=t.themes||{theme1:_};Object.keys(n).forEach((t=>{const r=n[t],i="xl/theme/".concat(t,".xml");e.append(r,{name:i})}))}async addOfficeRels(e){const t=(new g).toXml([{Id:"rId1",Type:C.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:C.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:C.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);e.append(t,{name:"_rels/.rels"})}async addWorkbookRels(e,t){let n=1;const r=[{Id:"rId"+n++,Type:C.RelType.Styles,Target:"styles.xml"},{Id:"rId"+n++,Type:C.RelType.Theme,Target:"theme/theme1.xml"}];t.sharedStrings.count&&r.push({Id:"rId"+n++,Type:C.RelType.SharedStrings,Target:"sharedStrings.xml"}),t.worksheets.forEach((e=>{e.rId="rId"+n++,r.push({Id:e.rId,Type:C.RelType.Worksheet,Target:"worksheets/sheet".concat(e.id,".xml")})}));const i=(new g).toXml(r);e.append(i,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(e,t){const{xml:n}=t.styles;n&&e.append(n,{name:"xl/styles.xml"})}async addWorkbook(e,t){const n=new y;e.append(n.toXml(t),{name:"xl/workbook.xml"})}async addWorksheets(e,t){const n=new x,r=new g,i=new k,a=new S;t.worksheets.forEach((t=>{let s=new d;n.render(s,t),e.append(s.xml,{name:"xl/worksheets/sheet".concat(t.id,".xml")}),t.rels&&t.rels.length&&(s=new d,r.render(s,t.rels),e.append(s.xml,{name:"xl/worksheets/_rels/sheet".concat(t.id,".xml.rels")})),t.comments.length>0&&(s=new d,i.render(s,t),e.append(s.xml,{name:"xl/comments".concat(t.id,".xml")}),s=new d,a.render(s,t),e.append(s.xml,{name:"xl/drawings/vmlDrawing".concat(t.id,".vml")}))}))}_finalize(e){return new Promise(((t,n)=>{e.on("finish",(()=>{t(this)})),e.on("error",n),e.finalize()}))}prepareModel(e,t){e.creator=e.creator||"ExcelJS",e.lastModifiedBy=e.lastModifiedBy||"ExcelJS",e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=void 0===t.useSharedStrings||t.useSharedStrings,e.useStyles=void 0===t.useStyles||t.useStyles,e.sharedStrings=new m,e.styles=e.useStyles?new f(!0):new f.Mock;const n=new y,r=new x;n.prepare(e);const i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let a=0;e.tables=[],e.worksheets.forEach((t=>{t.tables.forEach((t=>{a++,t.target="table".concat(a,".xml"),t.id=a,e.tables.push(t)})),r.prepare(t,i)}))}async write(e,t){t=t||{};const{model:n}=this.workbook,r=new l.ZipWriter(t.zip);return r.pipe(e),this.prepareModel(n,t),await this.addContentTypes(r,n),await this.addOfficeRels(r,n),await this.addWorkbookRels(r,n),await this.addWorksheets(r,n),await this.addSharedStrings(r,n),await this.addDrawings(r,n),await this.addTables(r,n),await Promise.all([this.addThemes(r,n),this.addStyles(r,n)]),await this.addMedia(r,n),await Promise.all([this.addApp(r,n),this.addCore(r,n)]),await this.addWorkbook(r,n),this._finalize(r)}writeFile(e,t){const n=i.createWriteStream(e);return new Promise(((e,r)=>{n.on("finish",(()=>{e()})),n.on("error",(e=>{r(e)})),this.write(n,t).then((()=>{n.end()})).catch((e=>{r(e)}))}))}async writeBuffer(e){const t=new c;return await this.write(t,e),t.read()}}C.RelType=e("./rel-type"),t.exports=C}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(e,t,n){"use strict";t.exports='\n '},{}],146:[function(e,t,n){(function(t){(function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CsvFormatterStream=void 0;const r=e("stream"),i=e("./formatter");class a extends r.Transform{constructor(e){super({writableObjectMode:e.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=e,this.rowFormatter=new i.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,n,r){let i=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(e,((e,n)=>e?(i=!0,r(e)):(n&&n.forEach((e=>{this.push(t.from(e,"utf8"))})),i=!0,r())))}catch(e){if(i)throw e;r(e)}}_flush(e){this.rowFormatter.finish(((n,r)=>n?e(n):(r&&r.forEach((e=>{this.push(t.from(e,"utf8"))})),e())))}}n.CsvFormatterStream=a}).call(this)}).call(this,e("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.FormatterOptions=void 0,n.FormatterOptions=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;this.objectMode=!0,this.delimiter=",",this.rowDelimiter="\n",this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\ufeff",this.alwaysWriteHeaders=!1,Object.assign(this,e||{}),void 0===(null==e?void 0:e.quoteHeaders)&&(this.quoteHeaders=this.quoteColumns),!0===(null==e?void 0:e.quote)?this.quote='"':!1===(null==e?void 0:e.quote)&&(this.quote=""),"string"!=typeof(null==e?void 0:e.escape)&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&(null===(t=e.writeHeaders)||void 0===t||t),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote="".concat(this.escape).concat(this.quote)}}},{}],148:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.FieldFormatter=void 0;const i=r(e("lodash.isboolean")),a=r(e("lodash.isnil")),s=r(e("lodash.escaperegexp"));n.FieldFormatter=class{constructor(e){this._headers=null,this.formatterOptions=e,null!==e.headers&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,"g");const t="[".concat(e.delimiter).concat(s.default(e.rowDelimiter),"|\r|\n]");this.ESCAPE_REGEXP=new RegExp(t)}set headers(e){this._headers=e}shouldQuote(e,t){const n=t?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return i.default(n)?n:Array.isArray(n)?n[e]:null!==this._headers&&n[this._headers[e]]}format(e,t,n){const r=(""+(a.default(e)?"":e)).replace(/\0/g,""),{formatterOptions:i}=this;return""!==i.quote&&-1!==r.indexOf(i.quote)?this.quoteField(r.replace(this.REPLACE_REGEXP,i.escapedQuote)):-1!==r.search(this.ESCAPE_REGEXP)||this.shouldQuote(t,n)?this.quoteField(r):r}quoteField(e){const{quote:t}=this.formatterOptions;return"".concat(t).concat(e).concat(t)}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.RowFormatter=void 0;const i=r(e("lodash.isfunction")),a=r(e("lodash.isequal")),s=e("./FieldFormatter"),o=e("../types");class l{constructor(e){this.rowCount=0,this.formatterOptions=e,this.fieldFormatter=new s.FieldFormatter(e),this.headers=e.headers,this.shouldWriteHeaders=e.shouldWriteHeaders,this.hasWrittenHeaders=!1,null!==this.headers&&(this.fieldFormatter.headers=this.headers),e.transform&&(this.rowTransform=e.transform)}static isRowHashArray(e){return!!Array.isArray(e)&&Array.isArray(e[0])&&2===e[0].length}static isRowArray(e){return Array.isArray(e)&&!this.isRowHashArray(e)}static gatherHeaders(e){return l.isRowHashArray(e)?e.map((e=>e[0])):Array.isArray(e)?e:Object.keys(e)}static createTransform(e){return o.isSyncTransform(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:(t,n)=>{e(t,n)}}set rowTransform(e){if(!i.default(e))throw new TypeError("The transform should be a function");this._rowTransform=l.createTransform(e)}format(e,t){this.callTransformer(e,((n,r)=>{if(n)return t(n);if(!e)return t(null);const i=[];if(r){const{shouldFormatColumns:e,headers:t}=this.checkHeaders(r);if(this.shouldWriteHeaders&&t&&!this.hasWrittenHeaders&&(i.push(this.formatColumns(t,!0)),this.hasWrittenHeaders=!0),e){const e=this.gatherColumns(r);i.push(this.formatColumns(e,!1))}}return t(null,i)}))}finish(e){const t=[];if(this.formatterOptions.alwaysWriteHeaders&&0===this.rowCount){if(!this.headers)return e(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));t.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&t.push(this.formatterOptions.rowDelimiter),e(null,t)}checkHeaders(e){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const t=l.gatherHeaders(e);return this.headers=t,this.fieldFormatter.headers=t,this.shouldWriteHeaders?{shouldFormatColumns:!a.default(t,e),headers:t}:{shouldFormatColumns:!0,headers:null}}gatherColumns(e){if(null===this.headers)throw new Error("Headers is currently null");return Array.isArray(e)?l.isRowHashArray(e)?this.headers.map(((t,n)=>{const r=e[n];return r?r[1]:""})):l.isRowArray(e)&&!this.shouldWriteHeaders?e:this.headers.map(((t,n)=>e[n])):this.headers.map((t=>e[t]))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}formatColumns(e,t){const n=e.map(((e,n)=>this.fieldFormatter.format(e,n,t))).join(this.formatterOptions.delimiter),{rowCount:r}=this;return this.rowCount+=1,r?[this.formatterOptions.rowDelimiter,n].join(""):n}}n.RowFormatter=l},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.FieldFormatter=n.RowFormatter=void 0;var r=e("./RowFormatter");Object.defineProperty(n,"RowFormatter",{enumerable:!0,get:function(){return r.RowFormatter}});var i=e("./FieldFormatter");Object.defineProperty(n,"FieldFormatter",{enumerable:!0,get:function(){return i.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(e,t,n){(function(t){(function(){"use strict";var r=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),n.writeToPath=n.writeToString=n.writeToBuffer=n.writeToStream=n.write=n.format=n.FormatterOptions=n.CsvFormatterStream=void 0;const o=e("util"),l=e("stream"),c=a(e("fs")),u=e("./FormatterOptions"),d=e("./CsvFormatterStream");s(e("./types"),n);var h=e("./CsvFormatterStream");Object.defineProperty(n,"CsvFormatterStream",{enumerable:!0,get:function(){return h.CsvFormatterStream}});var f=e("./FormatterOptions");Object.defineProperty(n,"FormatterOptions",{enumerable:!0,get:function(){return f.FormatterOptions}}),n.format=e=>new d.CsvFormatterStream(new u.FormatterOptions(e)),n.write=(e,t)=>{const r=n.format(t),i=o.promisify(((e,t)=>{r.write(e,void 0,t)}));return e.reduce(((e,t)=>e.then((()=>i(t)))),Promise.resolve()).then((()=>r.end())).catch((e=>{r.emit("error",e)})),r},n.writeToStream=(e,t,r)=>n.write(t,r).pipe(e),n.writeToBuffer=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=[],a=new l.Writable({write(e,t,n){i.push(e),n()}});return new Promise(((s,o)=>{a.on("error",o).on("finish",(()=>s(t.concat(i)))),n.write(e,r).pipe(a)}))},n.writeToString=(e,t)=>n.writeToBuffer(e,t).then((e=>e.toString())),n.writeToPath=(e,t,r)=>{const i=c.createWriteStream(e,{encoding:"utf8"});return n.write(t,r).pipe(i)}}).call(this)}).call(this,e("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isSyncTransform=void 0,n.isSyncTransform=e=>1===e.length},{}],153:[function(e,t,n){(function(t){(function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CsvParserStream=void 0;const r=e("string_decoder"),i=e("stream"),a=e("./transforms"),s=e("./parser");class o extends i.Transform{constructor(e){super({objectMode:e.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=e,this.parser=new s.Parser(e),this.headerTransformer=new a.HeaderTransformer(e),this.decoder=new r.StringDecoder(e.encoding),this.rowTransformerValidator=new a.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(e){return this.rowTransformerValidator.rowTransform=e,this}validate(e){return this.rowTransformerValidator.rowValidator=e,this}emit(e){if("end"===e)return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const s=e=>e?n(e):a%100!=0?i(a+1):void t((()=>i(a+1)));if(this.checkAndEmitHeaders(),a>=r||this.hasHitRowLimit)return n();if(this.parsedLineCount+=1,this.shouldSkipLine)return s();const o=e[a];this.rowCount+=1,this.parsedRowCount+=1;const l=this.rowCount;return this.transformRow(o,((e,t)=>{if(e)return this.rowCount-=1,s(e);if(!t)return s(new Error("expected transform result"));if(t.isValid){if(t.row)return this.pushRow(t.row,s)}else this.emit("data-invalid",t.row,l,t.reason);return s()}))};i(0)}transformRow(e,t){try{this.headerTransformer.transform(e,((n,r)=>n?t(n):r?r.isValid?r.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(r.row,t):this.skipRow(t):(this.rowCount-=1,this.parsedRowCount-=1,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:e}):this.skipRow(t):t(new Error("Expected result from header transform"))))}catch(e){t(e)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(e){return this.rowCount-=1,e(null,{row:null,isValid:!0})}pushRow(e,t){try{this.parserOptions.objectMode?this.push(e):this.push(JSON.stringify(e)),t()}catch(e){t(e)}}static wrapDoneCallback(e){let t=!1;return function(n){if(n){if(t)throw n;return t=!0,void e(n)}for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=i.default(this.delimiter),this.escapeChar=null!==(t=this.escape)&&void 0!==t?t:this.quote,this.supportsComments=!a.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp("([^\\s]|\\r\\n|\\n|\\r|".concat(this.escapedDelimiter,")")),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(e,t,n){"use strict";var r=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),n.parseString=n.parseFile=n.parseStream=n.parse=n.ParserOptions=n.CsvParserStream=void 0;const o=a(e("fs")),l=e("stream"),c=e("./ParserOptions"),u=e("./CsvParserStream");s(e("./types"),n);var d=e("./CsvParserStream");Object.defineProperty(n,"CsvParserStream",{enumerable:!0,get:function(){return d.CsvParserStream}});var h=e("./ParserOptions");Object.defineProperty(n,"ParserOptions",{enumerable:!0,get:function(){return h.ParserOptions}}),n.parse=e=>new u.CsvParserStream(new c.ParserOptions(e)),n.parseStream=(e,t)=>e.pipe(new u.CsvParserStream(new c.ParserOptions(t))),n.parseFile=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.createReadStream(e).pipe(new u.CsvParserStream(new c.ParserOptions(t)))},n.parseString=(e,t)=>{const n=new l.Readable;return n.push(e),n.push(null),n.pipe(new u.CsvParserStream(new c.ParserOptions(t)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Parser=void 0;const r=e("./Scanner"),i=e("./RowParser"),a=e("./Token");class s{constructor(e){this.parserOptions=e,this.rowParser=new i.RowParser(this.parserOptions)}static removeBOM(e){return e&&65279===e.charCodeAt(0)?e.slice(1):e}parse(e,t){const n=new r.Scanner({line:s.removeBOM(e),parserOptions:this.parserOptions,hasMoreData:t});return this.parserOptions.supportsComments?this.parseWithComments(n):this.parseWithoutComments(n)}parseWithoutComments(e){const t=[];let n=!0;for(;n;)n=this.parseRow(e,t);return{line:e.line,rows:t}}parseWithComments(e){const{parserOptions:t}=this,n=[];for(let r=e.nextCharacterToken;null!==r;r=e.nextCharacterToken)if(a.Token.isTokenComment(r,t)){if(null===e.advancePastLine())return{line:e.lineFromCursor,rows:n};if(!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,t){if(!e.nextNonSpaceToken)return!1;const n=this.rowParser.parse(e);return null!==n&&(this.parserOptions.ignoreEmpty&&i.RowParser.isEmptyRow(n)||t.push(n),!0)}}n.Parser=s},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.RowParser=void 0;const r=e("./column"),i=e("./Token");n.RowParser=class{constructor(e){this.parserOptions=e,this.columnParser=new r.ColumnParser(e)}static isEmptyRow(e){return""===e.join("").replace(/\s+/g,"")}parse(e){const{parserOptions:t}=this,{hasMoreData:n}=e,r=e,a=[];let s=this.getStartToken(r,a);for(;s;){if(i.Token.isTokenRowDelimiter(s))return r.advancePastToken(s),!r.hasMoreCharacters&&i.Token.isTokenCarriageReturn(s,t)&&n?null:(r.truncateToCursor(),a);if(!this.shouldSkipColumnParse(r,s,a)){const e=this.columnParser.parse(r);if(null===e)return null;a.push(e)}s=r.nextNonSpaceToken}return n?null:(r.truncateToCursor(),a)}getStartToken(e,t){const n=e.nextNonSpaceToken;return null!==n&&i.Token.isTokenDelimiter(n,this.parserOptions)?(t.push(""),e.nextNonSpaceToken):n}shouldSkipColumnParse(e,t,n){const{parserOptions:r}=this;if(i.Token.isTokenDelimiter(t,r)){e.advancePastToken(t);const a=e.nextCharacterToken;if(!e.hasMoreCharacters||null!==a&&i.Token.isTokenRowDelimiter(a))return n.push(""),!0;if(null!==a&&i.Token.isTokenDelimiter(a,r))return n.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Scanner=void 0;const r=e("./Token"),i=/((?:\r\n)|\n|\r)/;n.Scanner=class{constructor(e){this.cursor=0,this.line=e.line,this.lineLength=this.line.length,this.parserOptions=e.parserOptions,this.hasMoreData=e.hasMoreData,this.cursor=e.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:e}=this,t=this.parserOptions.NEXT_TOKEN_REGEXP;if(-1===e.search(t))return null;const n=t.exec(e);if(null==n)return null;const i=n[1],a=this.cursor+(n.index||0);return new r.Token({token:i,startCursor:a,endCursor:a+i.length-1})}get nextCharacterToken(){const{cursor:e,lineLength:t}=this;return t<=e?null:new r.Token({token:this.line[e],startCursor:e,endCursor:e})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const e=i.exec(this.lineFromCursor);return e?(this.cursor+=(e.index||0)+e[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(e){return this.cursor=e,this}advanceToToken(e){return this.cursor=e.startCursor,this}advancePastToken(e){return this.cursor=e.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Token=void 0,n.Token=class{constructor(e){this.token=e.token,this.startCursor=e.startCursor,this.endCursor=e.endCursor}static isTokenRowDelimiter(e){const t=e.token;return"\r"===t||"\n"===t||"\r\n"===t}static isTokenCarriageReturn(e,t){return e.token===t.carriageReturn}static isTokenComment(e,t){return t.supportsComments&&!!e&&e.token===t.comment}static isTokenEscapeCharacter(e,t){return e.token===t.escapeChar}static isTokenQuote(e,t){return e.token===t.quote}static isTokenDelimiter(e,t){return e.token===t.delimiter}}},{}],160:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ColumnFormatter=void 0,n.ColumnFormatter=class{constructor(e){e.trim?this.format=e=>e.trim():e.ltrim?this.format=e=>e.trimLeft():e.rtrim?this.format=e=>e.trimRight():this.format=e=>e}}},{}],161:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ColumnParser=void 0;const r=e("./NonQuotedColumnParser"),i=e("./QuotedColumnParser"),a=e("../Token");n.ColumnParser=class{constructor(e){this.parserOptions=e,this.quotedColumnParser=new i.QuotedColumnParser(e),this.nonQuotedColumnParser=new r.NonQuotedColumnParser(e)}parse(e){const{nextNonSpaceToken:t}=e;return null!==t&&a.Token.isTokenQuote(t,this.parserOptions)?(e.advanceToToken(t),this.quotedColumnParser.parse(e)):this.nonQuotedColumnParser.parse(e)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.NonQuotedColumnParser=void 0;const r=e("./ColumnFormatter"),i=e("../Token");n.NonQuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new r.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;const{parserOptions:t}=this,n=[];let r=e.nextCharacterToken;for(;r&&!i.Token.isTokenDelimiter(r,t)&&!i.Token.isTokenRowDelimiter(r);r=e.nextCharacterToken)n.push(r.token),e.advancePastToken(r);return this.columnFormatter.format(n.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.QuotedColumnParser=void 0;const r=e("./ColumnFormatter"),i=e("../Token");n.QuotedColumnParser=class{constructor(e){this.parserOptions=e,this.columnFormatter=new r.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;const t=e.cursor,{foundClosingQuote:n,col:r}=this.gatherDataBetweenQuotes(e);if(!n){if(e.advanceTo(t),!e.hasMoreData)throw new Error("Parse Error: missing closing: '".concat(this.parserOptions.quote||"","' in line: at '").concat(e.lineFromCursor.replace(/[\r\n]/g,"\\n'"),"'"));return null}return this.checkForMalformedColumn(e),r}gatherDataBetweenQuotes(e){const{parserOptions:t}=this;let n=!1,r=!1;const a=[];let s=e.nextCharacterToken;for(;!r&&null!==s;s=e.nextCharacterToken){const o=i.Token.isTokenQuote(s,t);if(!n&&o)n=!0;else if(n)if(i.Token.isTokenEscapeCharacter(s,t)){e.advancePastToken(s);const n=e.nextCharacterToken;null!==n&&(i.Token.isTokenQuote(n,t)||i.Token.isTokenEscapeCharacter(n,t))?(a.push(n.token),s=n):o?r=!0:a.push(s.token)}else o?r=!0:a.push(s.token);e.advancePastToken(s)}return{col:this.columnFormatter.format(a.join("")),foundClosingQuote:r}}checkForMalformedColumn(e){const{parserOptions:t}=this,{nextNonSpaceToken:n}=e;if(n){const r=i.Token.isTokenDelimiter(n,t),a=i.Token.isTokenRowDelimiter(n);if(!r&&!a){const r=e.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error("Parse Error: expected: '".concat(t.escapedDelimiter,"' OR new line got: '").concat(n.token,"'. at '").concat(r))}e.advanceToToken(n)}else e.hasMoreData||e.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ColumnFormatter=n.QuotedColumnParser=n.NonQuotedColumnParser=n.ColumnParser=void 0;var r=e("./ColumnParser");Object.defineProperty(n,"ColumnParser",{enumerable:!0,get:function(){return r.ColumnParser}});var i=e("./NonQuotedColumnParser");Object.defineProperty(n,"NonQuotedColumnParser",{enumerable:!0,get:function(){return i.NonQuotedColumnParser}});var a=e("./QuotedColumnParser");Object.defineProperty(n,"QuotedColumnParser",{enumerable:!0,get:function(){return a.QuotedColumnParser}});var s=e("./ColumnFormatter");Object.defineProperty(n,"ColumnFormatter",{enumerable:!0,get:function(){return s.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.QuotedColumnParser=n.NonQuotedColumnParser=n.ColumnParser=n.Token=n.Scanner=n.RowParser=n.Parser=void 0;var r=e("./Parser");Object.defineProperty(n,"Parser",{enumerable:!0,get:function(){return r.Parser}});var i=e("./RowParser");Object.defineProperty(n,"RowParser",{enumerable:!0,get:function(){return i.RowParser}});var a=e("./Scanner");Object.defineProperty(n,"Scanner",{enumerable:!0,get:function(){return a.Scanner}});var s=e("./Token");Object.defineProperty(n,"Token",{enumerable:!0,get:function(){return s.Token}});var o=e("./column");Object.defineProperty(n,"ColumnParser",{enumerable:!0,get:function(){return o.ColumnParser}}),Object.defineProperty(n,"NonQuotedColumnParser",{enumerable:!0,get:function(){return o.NonQuotedColumnParser}}),Object.defineProperty(n,"QuotedColumnParser",{enumerable:!0,get:function(){return o.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.HeaderTransformer=void 0;const i=r(e("lodash.isundefined")),a=r(e("lodash.isfunction")),s=r(e("lodash.uniq")),o=r(e("lodash.groupby"));n.HeaderTransformer=class{constructor(e){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=e,!0===e.headers?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):a.default(e.headers)&&(this.headersTransform=e.headers)}transform(e,t){return this.shouldMapRow(e)?t(null,this.processRow(e)):t(null,{row:null,isValid:!0})}shouldMapRow(e){const{parserOptions:t}=this;if(!this.headersTransform&&t.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(e)}return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};const{parserOptions:t}=this;if(!t.discardUnmappedColumns&&e.length>this.headersLength){if(!t.strictColumnHandling)throw new Error("Unexpected Error: column header mismatch expected: ".concat(this.headersLength," columns got: ").concat(e.length));return{row:e,isValid:!1,reason:"Column header mismatch expected: ".concat(this.headersLength," columns got: ").concat(e.length)}}return t.strictColumnHandling&&e.length!!e));if(s.default(n).length!==n.length){const e=o.default(n),t=Object.keys(e).filter((t=>e[t].length>1));throw new Error("Duplicate headers found "+JSON.stringify(t))}this.headers=e,this.receivedHeaders=!0,this.headersLength=(null===(t=this.headers)||void 0===t?void 0:t.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.RowTransformerValidator=void 0;const i=r(e("lodash.isfunction")),a=e("../types");class s{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(e){return a.isSyncTransform(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:e}static createValidator(e){return a.isSyncValidate(e)?(t,n)=>{n(null,{row:t,isValid:e(t)})}:(t,n)=>{e(t,((e,r,i)=>e?n(e):n(null,r?{row:t,isValid:r,reason:i}:{row:t,isValid:!1,reason:i})))}}set rowTransform(e){if(!i.default(e))throw new TypeError("The transform should be a function");this._rowTransform=s.createTransform(e)}set rowValidator(e){if(!i.default(e))throw new TypeError("The validate should be a function");this._rowValidator=s.createValidator(e)}transformAndValidate(e,t){return this.callTransformer(e,((e,n)=>e?t(e):n?this.callValidator(n,((e,r)=>e?t(e):r&&!r.isValid?t(null,{row:n,isValid:!1,reason:r.reason}):t(null,{row:n,isValid:!0}))):t(null,{row:null,isValid:!0})))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}callValidator(e,t){return this._rowValidator?this._rowValidator(e,t):t(null,{row:e,isValid:!0})}}n.RowTransformerValidator=s},{"../types":169,"lodash.isfunction":446}],168:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.HeaderTransformer=n.RowTransformerValidator=void 0;var r=e("./RowTransformerValidator");Object.defineProperty(n,"RowTransformerValidator",{enumerable:!0,get:function(){return r.RowTransformerValidator}});var i=e("./HeaderTransformer");Object.defineProperty(n,"HeaderTransformer",{enumerable:!0,get:function(){return i.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isSyncValidate=n.isSyncTransform=void 0,n.isSyncTransform=e=>1===e.length,n.isSyncValidate=e=>1===e.length},{}],170:[function(e,t,n){"use strict";const r=n;r.bignum=e("bn.js"),r.define=e("./asn1/api").define,r.base=e("./asn1/base"),r.constants=e("./asn1/constants"),r.decoders=e("./asn1/decoders"),r.encoders=e("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(e,t,n){"use strict";const r=e("./encoders"),i=e("./decoders"),a=e("inherits");function s(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}n.define=function(e,t){return new s(e,t)},s.prototype._createNamed=function(e){const t=this.name;function n(e){this._initNamed(e,t)}return a(n,e),n.prototype._initNamed=function(t,n){e.call(this,t,n)},new n(this)},s.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},s.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},s.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(r[e])),this.encoders[e]},s.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(e,t,n){"use strict";const r=e("inherits"),i=e("../base/reporter").Reporter,a=e("safer-buffer").Buffer;function s(e,t){i.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function o(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return o.isEncoderBuffer(e)||(e=new o(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}r(s,i),n.DecoderBuffer=s,s.isDecoderBuffer=function(e){return e instanceof s||"object"==typeof e&&a.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(e){const t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const n=new s(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},n.EncoderBuffer=o,o.isEncoderBuffer=function(e){return e instanceof o||"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},o.prototype.join=function(e,t){return e||(e=a.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(n){n.join(e,t),t+=n.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(e,t,n){"use strict";const r=n;r.Reporter=e("./reporter").Reporter,r.DecoderBuffer=e("./buffer").DecoderBuffer,r.EncoderBuffer=e("./buffer").EncoderBuffer,r.Node=e("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(e,t,n){"use strict";const r=e("../base/reporter").Reporter,i=e("../base/buffer").EncoderBuffer,a=e("../base/buffer").DecoderBuffer,s=e("minimalistic-assert"),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],l=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function c(e,t,n){const r={};this._baseState=r,r.name=n,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=c;const u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const e=this._baseState,t={};u.forEach((function(n){t[n]=e[n]}));const n=new this.constructor(t.parent);return n._baseState=t,n},c.prototype._wrap=function(){const e=this._baseState;l.forEach((function(t){this[t]=function(){const n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},c.prototype._init=function(e){const t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),s.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){const t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==n.length&&(s(null===t.children),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);const r=e[n];t[r]=n})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){c.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),o.forEach((function(e){c.prototype[e]=function(){const t=this._baseState,n=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(n),this}})),c.prototype.use=function(e){s(e);const t=this._baseState;return s(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){const t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){const t=this._baseState;return s(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){const t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},c.prototype.contains=function(e){const t=this._baseState;return s(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){const n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));let r,i=n.default,s=!0,o=null;if(null!==n.key&&(o=e.enterKey(n.key)),n.optional){let r=null;if(null!==n.explicit?r=n.explicit:null!==n.implicit?r=n.implicit:null!==n.tag&&(r=n.tag),null!==r||n.any){if(s=this._peekTag(e,r,n.any),e.isError(s))return s}else{const r=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(r)}}if(n.obj&&s&&(r=e.enterObject()),s){if(null!==n.explicit){const t=this._decodeTag(e,n.explicit);if(e.isError(t))return t;e=t}const r=e.offset;if(null===n.use&&null===n.choice){let t;n.any&&(t=e.save());const r=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(r))return r;n.any?i=e.raw(t):e=r}if(t&&t.track&&null!==n.tag&&t.track(e.path(),r,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),n.any||(i=null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){const r=new a(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(r,t)}}return n.obj&&s&&(i=e.leaveObject(r)),null===n.key||null===i&&!0!==s?null!==o&&e.exitKey(o):e.leaveKey(o,n.key,i),i},c.prototype._decodeGeneric=function(e,t,n){const r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){const n=this._baseState;return n.useDecoder=this._use(e,t),s(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},c.prototype._decodeChoice=function(e,t){const n=this._baseState;let r=null,i=!1;return Object.keys(n.choice).some((function(a){const s=e.save(),o=n.choice[a];try{const n=o._decode(e,t);if(e.isError(n))return!1;r={type:a,value:n},i=!0}catch(t){return e.restore(s),!1}return!0}),this),i?r:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},c.prototype._encode=function(e,t,n){const r=this._baseState;if(null!==r.default&&r.default===e)return;const i=this._encodeValue(e,t,n);return void 0===i||this._skipDefault(i,t,n)?void 0:i},c.prototype._encodeValue=function(e,t,n){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new r);let a=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}let s=null,o=!1;if(i.any)a=this._createEncoderBuffer(e);else if(i.choice)a=this._encodeChoice(e,t);else if(i.contains)s=this._getUse(i.contains,n)._encode(e,t),o=!0;else if(i.children)s=i.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");const r=t.enterKey(n._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const i=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),i}),this).filter((function(e){return e})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const n=this.clone();n._baseState.implicit=null,s=this._createEncoderBuffer(e.map((function(n){const r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),n))}else null!==i.use?a=this._getUse(i.use,n)._encode(e,t):(s=this._encodePrimitive(i.tag,e),o=!0);if(!i.any&&null===i.choice){const e=null!==i.implicit?i.implicit:i.tag,n=null===i.implicit?"universal":"context";null===e?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(a=this._encodeComposite(e,o,n,s))}return null!==i.explicit&&(a=this._encodeComposite(i.explicit,!1,"context",a)),a},c.prototype._encodeChoice=function(e,t){const n=this._baseState,r=n.choice[e.type];return r||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){const n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(e,t,n){"use strict";const r=e("inherits");function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function a(e,t){this.path=e,this.rethrow(t)}n.Reporter=i,i.prototype.isError=function(e){return e instanceof a},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,n){const r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=n)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,n=t.obj;return t.obj=e,n},i.prototype.error=function(e){let t;const n=this._reporterState,r=e instanceof a;if(t=r?e:new a(n.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(a,Error),a.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:440}],176:[function(e,t,n){"use strict";function r(e){const t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);const r=e[n];t[r]=n})),t}n.tagClass={0:"universal",1:"application",2:"context",3:"private"},n.tagClassByName=r(n.tagClass),n.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},n.tagByName=r(n.tag)},{}],177:[function(e,t,n){"use strict";const r=n;r._reverse=function(e){const t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);const r=e[n];t[r]=n})),t},r.der=e("./der")},{"./der":176}],178:[function(e,t,n){"use strict";const r=e("inherits"),i=e("bn.js"),a=e("../base/buffer").DecoderBuffer,s=e("../base/node"),o=e("../constants/der");function l(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){s.call(this,"der",e)}function u(e,t){let n=e.readUInt8(t);if(e.isError(n))return n;const r=o.tagClass[n>>6],i=0==(32&n);if(31==(31&n)){let r=n;for(n=0;128==(128&r);){if(r=e.readUInt8(t),e.isError(r))return r;n<<=7,n|=127&r}}else n&=31;return{cls:r,primitive:i,tag:n,tagStr:o.tag[n]}}function d(e,t,n){let r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0==(128&r))return r;const i=127&r;if(i>4)return e.error("length octect is too long");r=0;for(let a=0;a=31?r.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=s.tagClassByName[n||"universal"]<<6,i)}(e,t,n,this.reporter);if(r.length<128){const e=i.alloc(2);return e[0]=a,e[1]=r.length,this._createEncoderBuffer([e,r])}let o=1;for(let i=r.length;i>=256;i>>=8)o++;const l=i.alloc(2+o);l[0]=a,l[1]=128|o;for(let i=1+o,s=r.length;s>0;i--,s>>=8)l[i]=255&s;return this._createEncoderBuffer([l,r])},l.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=i.alloc(2*e.length);for(let n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let r=0;for(let i=0;i=128;t>>=7)r++}const a=i.alloc(r);let s=a.length-1;for(let i=e.length-1;i>=0;i--){let t=e[i];for(a[s--]=127&t;(t>>=7)>0;)a[s--]=128|127&t}return this._createEncoderBuffer(a)},l.prototype._encodeTime=function(e,t){let n;const r=new Date(e);return"gentime"===t?n=[c(r.getUTCFullYear()),c(r.getUTCMonth()+1),c(r.getUTCDate()),c(r.getUTCHours()),c(r.getUTCMinutes()),c(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[c(r.getUTCFullYear()%100),c(r.getUTCMonth()+1),c(r.getUTCDate()),c(r.getUTCHours()),c(r.getUTCMinutes()),c(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},l.prototype._encodeNull=function(){return this._createEncoderBuffer("")},l.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=i.from(t)}if(i.isBuffer(e)){let t=e.length;0===e.length&&t++;const n=i.alloc(t);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let i=e;i>=256;i>>=8)n++;const r=new Array(n);for(let i=r.length-1;i>=0;i--)r[i]=255&e,e>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(i.from(r))},l.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},l.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},l.prototype._skipDefault=function(e,t,n){const r=this._baseState;let i;if(null===r.default)return!1;const a=e.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),a.length!==r.defaultBuffer.length)return!1;for(i=0;i=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function o(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,n,r){for(var i=0,a=Math.min(e.length,n),s=t;s=49?o-49+10:o>=17?o-17+10:o}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=o(e,t,r)<=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,s=a%r,o=Math.min(a,a-s)+n,c=0,u=n;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,l=s/67108864|0;n.words[0]=o;for(var c=1;c>>26,d=67108863&l,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;u+=(s=(i=0|e.words[p])*(a=0|t.words[f])+d)/67108864|0,d=67108863&s}n.words[c]=0|d,l=0|u}return 0!==l?n.words[c]=0|l:n.length--,n.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=u[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,l="le"===t,c=new e(a),u=this.clone();if(l){for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),c[o]=s;for(;o=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==a&&s>26,this.words[s]=67108863&t;if(0===a&&s>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],v=8191&g,b=g>>>13,y=0|s[3],x=8191&y,w=y>>>13,A=0|s[4],k=8191&A,S=A>>>13,_=0|s[5],C=8191&_,j=_>>>13,E=0|s[6],N=8191&E,M=E>>>13,T=0|s[7],O=8191&T,R=T>>>13,P=0|s[8],I=8191&P,D=P>>>13,L=0|s[9],F=8191&L,B=L>>>13,z=0|o[0],H=8191&z,Y=z>>>13,U=0|o[1],W=8191&U,X=U>>>13,V=0|o[2],q=8191&V,G=V>>>13,Q=0|o[3],K=8191&Q,Z=Q>>>13,J=0|o[4],$=8191&J,ee=J>>>13,te=0|o[5],ne=8191&te,re=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],le=8191&oe,ce=oe>>>13,ue=0|o[8],de=8191&ue,he=ue>>>13,fe=0|o[9],pe=8191&fe,me=fe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(d,H))|0)+((8191&(i=(i=Math.imul(d,Y))+Math.imul(h,H)|0))<<13)|0;c=((a=Math.imul(h,Y))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,H),i=(i=Math.imul(p,Y))+Math.imul(m,H)|0,a=Math.imul(m,Y);var ve=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,H),i=(i=Math.imul(v,Y))+Math.imul(b,H)|0,a=Math.imul(b,Y),r=r+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var be=(c+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(h,q)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(x,H),i=(i=Math.imul(x,Y))+Math.imul(w,H)|0,a=Math.imul(w,Y),r=r+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0;var ye=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,K)|0))<<13)|0;c=((a=a+Math.imul(h,Z)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(k,H),i=(i=Math.imul(k,Y))+Math.imul(S,H)|0,a=Math.imul(S,Y),r=r+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(w,W)|0,a=a+Math.imul(w,X)|0,r=r+Math.imul(v,q)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(b,q)|0,a=a+Math.imul(b,G)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,Z)|0;var xe=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,ee)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(C,H),i=(i=Math.imul(C,Y))+Math.imul(j,H)|0,a=Math.imul(j,Y),r=r+Math.imul(k,W)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,r=r+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(w,q)|0,a=a+Math.imul(w,G)|0,r=r+Math.imul(v,K)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,Z)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0;var we=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((a=a+Math.imul(h,re)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(N,H),i=(i=Math.imul(N,Y))+Math.imul(M,H)|0,a=Math.imul(M,Y),r=r+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(j,W)|0,a=a+Math.imul(j,X)|0,r=r+Math.imul(k,q)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,r=r+Math.imul(x,K)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,Z)|0,r=r+Math.imul(v,$)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,a=a+Math.imul(m,re)|0;var Ae=(c+(r=r+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(h,ae)|0))<<13)|0;c=((a=a+Math.imul(h,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(O,H),i=(i=Math.imul(O,Y))+Math.imul(R,H)|0,a=Math.imul(R,Y),r=r+Math.imul(N,W)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(M,W)|0,a=a+Math.imul(M,X)|0,r=r+Math.imul(C,q)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(j,q)|0,a=a+Math.imul(j,G)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,Z)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,ee)|0,r=r+Math.imul(v,ne)|0,i=(i=i+Math.imul(v,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0,r=r+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,se)|0;var ke=(c+(r=r+Math.imul(d,le)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,le)|0))<<13)|0;c=((a=a+Math.imul(h,ce)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(I,H),i=(i=Math.imul(I,Y))+Math.imul(D,H)|0,a=Math.imul(D,Y),r=r+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,r=r+Math.imul(N,q)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(M,q)|0,a=a+Math.imul(M,G)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(j,K)|0,a=a+Math.imul(j,Z)|0,r=r+Math.imul(k,$)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(w,ne)|0,a=a+Math.imul(w,re)|0,r=r+Math.imul(v,ae)|0,i=(i=i+Math.imul(v,se)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,se)|0,r=r+Math.imul(p,le)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,le)|0,a=a+Math.imul(m,ce)|0;var Se=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(F,H),i=(i=Math.imul(F,Y))+Math.imul(B,H)|0,a=Math.imul(B,Y),r=r+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,X)|0,r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,r=r+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,Z)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(j,$)|0,a=a+Math.imul(j,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(S,ne)|0,a=a+Math.imul(S,re)|0,r=r+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,se)|0,r=r+Math.imul(v,le)|0,i=(i=i+Math.imul(v,ce)|0)+Math.imul(b,le)|0,a=a+Math.imul(b,ce)|0,r=r+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,a=a+Math.imul(m,he)|0;var _e=(c+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((a=a+Math.imul(h,me)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(F,W),i=(i=Math.imul(F,X))+Math.imul(B,W)|0,a=Math.imul(B,X),r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(D,q)|0,a=a+Math.imul(D,G)|0,r=r+Math.imul(O,K)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(R,K)|0,a=a+Math.imul(R,Z)|0,r=r+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(j,ne)|0,a=a+Math.imul(j,re)|0,r=r+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,se)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,se)|0,r=r+Math.imul(x,le)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(w,le)|0,a=a+Math.imul(w,ce)|0,r=r+Math.imul(v,de)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,he)|0;var Ce=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(F,q),i=(i=Math.imul(F,G))+Math.imul(B,q)|0,a=Math.imul(B,G),r=r+Math.imul(I,K)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,Z)|0,r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,ee)|0,r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(M,ne)|0,a=a+Math.imul(M,re)|0,r=r+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(j,ae)|0,a=a+Math.imul(j,se)|0,r=r+Math.imul(k,le)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(S,le)|0,a=a+Math.imul(S,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(w,de)|0,a=a+Math.imul(w,he)|0;var je=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(F,K),i=(i=Math.imul(F,Z))+Math.imul(B,K)|0,a=Math.imul(B,Z),r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(R,ne)|0,a=a+Math.imul(R,re)|0,r=r+Math.imul(N,ae)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,se)|0,r=r+Math.imul(C,le)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(j,le)|0,a=a+Math.imul(j,ce)|0,r=r+Math.imul(k,de)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(S,de)|0,a=a+Math.imul(S,he)|0;var Ee=(c+(r=r+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(w,pe)|0))<<13)|0;c=((a=a+Math.imul(w,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(F,$),i=(i=Math.imul(F,ee))+Math.imul(B,$)|0,a=Math.imul(B,ee),r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(D,ne)|0,a=a+Math.imul(D,re)|0,r=r+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,se)|0,r=r+Math.imul(N,le)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(j,de)|0,a=a+Math.imul(j,he)|0;var Ne=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(F,ne),i=(i=Math.imul(F,re))+Math.imul(B,ne)|0,a=Math.imul(B,re),r=r+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,r=r+Math.imul(O,le)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(R,le)|0,a=a+Math.imul(R,ce)|0,r=r+Math.imul(N,de)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(M,de)|0,a=a+Math.imul(M,he)|0;var Me=(c+(r=r+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(j,pe)|0))<<13)|0;c=((a=a+Math.imul(j,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(F,ae),i=(i=Math.imul(F,se))+Math.imul(B,ae)|0,a=Math.imul(B,se),r=r+Math.imul(I,le)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(D,le)|0,a=a+Math.imul(D,ce)|0,r=r+Math.imul(O,de)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(R,de)|0,a=a+Math.imul(R,he)|0;var Te=(c+(r=r+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((a=a+Math.imul(M,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,le),i=(i=Math.imul(F,ce))+Math.imul(B,le)|0,a=Math.imul(B,ce),r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,he)|0;var Oe=(c+(r=r+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((a=a+Math.imul(R,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(F,de),i=(i=Math.imul(F,he))+Math.imul(B,de)|0,a=Math.imul(B,he);var Re=(c+(r=r+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(D,pe)|0))<<13)|0;c=((a=a+Math.imul(D,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Pe=(c+(r=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(B,pe)|0))<<13)|0;return c=((a=Math.imul(B,me))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l[0]=ge,l[1]=ve,l[2]=be,l[3]=ye,l[4]=xe,l[5]=we,l[6]=Ae,l[7]=ke,l[8]=Se,l[9]=_e,l[10]=Ce,l[11]=je,l[12]=Ee,l[13]=Ne,l[14]=Me,l[15]=Te,l[16]=Oe,l[17]=Re,l[18]=Pe,0!==c&&(l[19]=c,n.length++),n};function p(e,t,n){return(new m).mulp(e,t,n)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=h),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?f(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,s&=67108863}n.words[a]=o,r=s,s=i}return 0!==r?n.words[a]=r:n.length--,n.strip()}(this,e,t):p(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},m.prototype.permute=function(e,t,n,r,i,a){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<s)for(this.length-=s,c=0;c=0&&(0!==u||c>=i);c--){var d=0|this.words[c];this.words[c]=u<<26-a|d>>>a,u=d&o}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,s=0|a.words[a.length-1];0!==(n=26-this._countBits(s))&&(a=a.ushln(n),r.iushln(n),s=0|a.words[a.length-1]);var o,l=r.length-a.length;if("mod"!==t){(o=new i(null)).length=l+1,o.words=new Array(o.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(h=Math.min(h/s|0,67108863),r._ishlnsubmul(a,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=h)}return o&&o.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:o||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,s,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),s=new i(0),o=new i(0),l=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||l.isOdd())&&(o.iadd(u),l.isub(d)),o.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(o),s.isub(l)):(r.isub(t),o.isub(a),l.isub(s))}return{a:o,b:l,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,s=new i(1),o=new i(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(a=0===t.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(b,v),b.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,i=a}i>>>=22,e.words[r-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);n(!a.isZero());var o=new i(1).toRed(this),l=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var d=this.pow(u,a),h=this.pow(e,a.addn(1).iushrn(1)),f=this.pow(e,a),p=s;0!==f.cmp(o);){for(var m=f,g=0;0!==m.cmp(o);g++)m=m.redSqr();n(g=0;r--){for(var c=t.words[r],u=l-1;u>=0;u--){var d=c>>u&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,(4===++o||0===r&&0===u)&&(a=this.mul(a,n[s]),o=0,s=0)):o=0}l=26}return a},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},r(k,A),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t)},{buffer:188}],185:[function(e,t,n){"use strict";n.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){var t,n,r=c(e),s=r[0],o=r[1],l=new a(function(e,t,n){return 3*(t+n)/4-n}(0,s,o)),u=0,d=o>0?s-4:s;for(n=0;n>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===o&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,l[u++]=255&t),1===o&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=0,o=n-i;so?o:s+16383));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,l=s.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var i,a,s=[],o=t;o>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],186:[function(e,t,n){"use strict";!function(t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof t?t.exports=i:(void 0).BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function o(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function l(e,t,r,i){for(var a=0,s=0,o=Math.min(e.length,r),l=t;l=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=o(e,t,r)<=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,s=a%r,o=Math.min(a,a-s)+n,c=0,u=n;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(e){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,l=s/67108864|0;n.words[0]=o;for(var c=1;c>>26,d=67108863&l,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;u+=(s=(i=0|e.words[p])*(a=0|t.words[f])+d)/67108864|0,d=67108863&s}n.words[c]=0|d,l=0|u}return 0!==l?n.words[c]=0|l:n.length--,n._strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==a||s!==this.length-1?d[6-l.length]+l+r:l+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],u=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(u).toString(e);r=(p=p.idivn(u)).isZero()?m+r:d[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i>8&255),n>16&255),6===a?(n>24&255),r=0,a=0):(r=s>>>24,a+=2)}if(n=0&&(e[n--]=s>>8&255),n>=0&&(e[n--]=s>>16&255),6===a?(n>=0&&(e[n--]=s>>24&255),r=0,a=0):(r=s>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==a&&s>26,this.words[s]=67108863&t;if(0===a&&s>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],v=8191&g,b=g>>>13,y=0|s[3],x=8191&y,w=y>>>13,A=0|s[4],k=8191&A,S=A>>>13,_=0|s[5],C=8191&_,j=_>>>13,E=0|s[6],N=8191&E,M=E>>>13,T=0|s[7],O=8191&T,R=T>>>13,P=0|s[8],I=8191&P,D=P>>>13,L=0|s[9],F=8191&L,B=L>>>13,z=0|o[0],H=8191&z,Y=z>>>13,U=0|o[1],W=8191&U,X=U>>>13,V=0|o[2],q=8191&V,G=V>>>13,Q=0|o[3],K=8191&Q,Z=Q>>>13,J=0|o[4],$=8191&J,ee=J>>>13,te=0|o[5],ne=8191&te,re=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],le=8191&oe,ce=oe>>>13,ue=0|o[8],de=8191&ue,he=ue>>>13,fe=0|o[9],pe=8191&fe,me=fe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(d,H))|0)+((8191&(i=(i=Math.imul(d,Y))+Math.imul(h,H)|0))<<13)|0;c=((a=Math.imul(h,Y))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,H),i=(i=Math.imul(p,Y))+Math.imul(m,H)|0,a=Math.imul(m,Y);var ve=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,H),i=(i=Math.imul(v,Y))+Math.imul(b,H)|0,a=Math.imul(b,Y),r=r+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var be=(c+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(h,q)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(x,H),i=(i=Math.imul(x,Y))+Math.imul(w,H)|0,a=Math.imul(w,Y),r=r+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0;var ye=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,K)|0))<<13)|0;c=((a=a+Math.imul(h,Z)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(k,H),i=(i=Math.imul(k,Y))+Math.imul(S,H)|0,a=Math.imul(S,Y),r=r+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(w,W)|0,a=a+Math.imul(w,X)|0,r=r+Math.imul(v,q)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(b,q)|0,a=a+Math.imul(b,G)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,Z)|0;var xe=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,ee)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(C,H),i=(i=Math.imul(C,Y))+Math.imul(j,H)|0,a=Math.imul(j,Y),r=r+Math.imul(k,W)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,r=r+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(w,q)|0,a=a+Math.imul(w,G)|0,r=r+Math.imul(v,K)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,Z)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0;var we=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((a=a+Math.imul(h,re)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(N,H),i=(i=Math.imul(N,Y))+Math.imul(M,H)|0,a=Math.imul(M,Y),r=r+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(j,W)|0,a=a+Math.imul(j,X)|0,r=r+Math.imul(k,q)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,r=r+Math.imul(x,K)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,Z)|0,r=r+Math.imul(v,$)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,a=a+Math.imul(m,re)|0;var Ae=(c+(r=r+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(h,ae)|0))<<13)|0;c=((a=a+Math.imul(h,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(O,H),i=(i=Math.imul(O,Y))+Math.imul(R,H)|0,a=Math.imul(R,Y),r=r+Math.imul(N,W)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(M,W)|0,a=a+Math.imul(M,X)|0,r=r+Math.imul(C,q)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(j,q)|0,a=a+Math.imul(j,G)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,Z)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,ee)|0,r=r+Math.imul(v,ne)|0,i=(i=i+Math.imul(v,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0,r=r+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,se)|0;var ke=(c+(r=r+Math.imul(d,le)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,le)|0))<<13)|0;c=((a=a+Math.imul(h,ce)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(I,H),i=(i=Math.imul(I,Y))+Math.imul(D,H)|0,a=Math.imul(D,Y),r=r+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,r=r+Math.imul(N,q)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(M,q)|0,a=a+Math.imul(M,G)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(j,K)|0,a=a+Math.imul(j,Z)|0,r=r+Math.imul(k,$)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(w,ne)|0,a=a+Math.imul(w,re)|0,r=r+Math.imul(v,ae)|0,i=(i=i+Math.imul(v,se)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,se)|0,r=r+Math.imul(p,le)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,le)|0,a=a+Math.imul(m,ce)|0;var Se=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(F,H),i=(i=Math.imul(F,Y))+Math.imul(B,H)|0,a=Math.imul(B,Y),r=r+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,X)|0,r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,r=r+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,Z)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(j,$)|0,a=a+Math.imul(j,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(S,ne)|0,a=a+Math.imul(S,re)|0,r=r+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,se)|0,r=r+Math.imul(v,le)|0,i=(i=i+Math.imul(v,ce)|0)+Math.imul(b,le)|0,a=a+Math.imul(b,ce)|0,r=r+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,a=a+Math.imul(m,he)|0;var _e=(c+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((a=a+Math.imul(h,me)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(F,W),i=(i=Math.imul(F,X))+Math.imul(B,W)|0,a=Math.imul(B,X),r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(D,q)|0,a=a+Math.imul(D,G)|0,r=r+Math.imul(O,K)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(R,K)|0,a=a+Math.imul(R,Z)|0,r=r+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(j,ne)|0,a=a+Math.imul(j,re)|0,r=r+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,se)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,se)|0,r=r+Math.imul(x,le)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(w,le)|0,a=a+Math.imul(w,ce)|0,r=r+Math.imul(v,de)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,he)|0;var Ce=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(F,q),i=(i=Math.imul(F,G))+Math.imul(B,q)|0,a=Math.imul(B,G),r=r+Math.imul(I,K)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,Z)|0,r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,ee)|0,r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(M,ne)|0,a=a+Math.imul(M,re)|0,r=r+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(j,ae)|0,a=a+Math.imul(j,se)|0,r=r+Math.imul(k,le)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(S,le)|0,a=a+Math.imul(S,ce)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(w,de)|0,a=a+Math.imul(w,he)|0;var je=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(F,K),i=(i=Math.imul(F,Z))+Math.imul(B,K)|0,a=Math.imul(B,Z),r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(R,ne)|0,a=a+Math.imul(R,re)|0,r=r+Math.imul(N,ae)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,se)|0,r=r+Math.imul(C,le)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(j,le)|0,a=a+Math.imul(j,ce)|0,r=r+Math.imul(k,de)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(S,de)|0,a=a+Math.imul(S,he)|0;var Ee=(c+(r=r+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(w,pe)|0))<<13)|0;c=((a=a+Math.imul(w,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(F,$),i=(i=Math.imul(F,ee))+Math.imul(B,$)|0,a=Math.imul(B,ee),r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(D,ne)|0,a=a+Math.imul(D,re)|0,r=r+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,se)|0,r=r+Math.imul(N,le)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(j,de)|0,a=a+Math.imul(j,he)|0;var Ne=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(F,ne),i=(i=Math.imul(F,re))+Math.imul(B,ne)|0,a=Math.imul(B,re),r=r+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,r=r+Math.imul(O,le)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(R,le)|0,a=a+Math.imul(R,ce)|0,r=r+Math.imul(N,de)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(M,de)|0,a=a+Math.imul(M,he)|0;var Me=(c+(r=r+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(j,pe)|0))<<13)|0;c=((a=a+Math.imul(j,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(F,ae),i=(i=Math.imul(F,se))+Math.imul(B,ae)|0,a=Math.imul(B,se),r=r+Math.imul(I,le)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(D,le)|0,a=a+Math.imul(D,ce)|0,r=r+Math.imul(O,de)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(R,de)|0,a=a+Math.imul(R,he)|0;var Te=(c+(r=r+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((a=a+Math.imul(M,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(F,le),i=(i=Math.imul(F,ce))+Math.imul(B,le)|0,a=Math.imul(B,ce),r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,he)|0;var Oe=(c+(r=r+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((a=a+Math.imul(R,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(F,de),i=(i=Math.imul(F,he))+Math.imul(B,de)|0,a=Math.imul(B,he);var Re=(c+(r=r+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(D,pe)|0))<<13)|0;c=((a=a+Math.imul(D,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Pe=(c+(r=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(B,pe)|0))<<13)|0;return c=((a=Math.imul(B,me))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l[0]=ge,l[1]=ve,l[2]=be,l[3]=ye,l[4]=xe,l[5]=we,l[6]=Ae,l[7]=ke,l[8]=Se,l[9]=_e,l[10]=Ce,l[11]=je,l[12]=Ee,l[13]=Ne,l[14]=Me,l[15]=Te,l[16]=Oe,l[17]=Re,l[18]=Pe,0!==c&&(l[19]=c,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a>>26)|0)>>>26,s&=67108863}n.words[a]=o,r=s,s=i}return 0!==r?n.words[a]=r:n.length--,n._strip()}function v(e,t,n){return g(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?p(this,e,t):n<1024?g(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},b.prototype.permute=function(e,t,n,r,i,a){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s>=26,r+=a/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<s)for(this.length-=s,c=0;c=0&&(0!==u||c>=i);c--){var d=0|this.words[c];this.words[c]=u<<26-a|d>>>a,u=d&o}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===o)return this._strip();for(n(-1===o),o=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,s=0|a.words[a.length-1];0!==(n=26-this._countBits(s))&&(a=a.ushln(n),r.iushln(n),s=0|a.words[a.length-1]);var o,l=r.length-a.length;if("mod"!==t){(o=new i(null)).length=l+1,o.words=new Array(o.length);for(var c=0;c=0;d--){var h=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(h=Math.min(h/s|0,67108863),r._ishlnsubmul(a,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=h)}return o&&o._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:o||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,s,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(0|this.words[a]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*r;this.words[i]=a/e|0,r=a%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),s=new i(0),o=new i(0),l=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||l.isOdd())&&(o.iadd(u),l.isub(d)),o.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(o),s.isub(l)):(r.isub(t),o.isub(a),l.isub(s))}return{a:o,b:l,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,s=new i(1),o=new i(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(a=0===t.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},r(w,x),w.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,i=a}i>>>=22,e.words[r-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new A;else if("p192"===e)t=new k;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return y[e]=t,t},_.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},_.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);n(!a.isZero());var o=new i(1).toRed(this),l=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var d=this.pow(u,a),h=this.pow(e,a.addn(1).iushrn(1)),f=this.pow(e,a),p=s;0!==f.cmp(o);){for(var m=f,g=0;0!==m.cmp(o);g++)m=m.redSqr();n(g=0;r--){for(var c=t.words[r],u=l-1;u>=0;u--){var d=c>>u&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,(4===++o||0===r&&0===u)&&(a=this.mul(a,n[s]),o=0,s=0)):o=0}l=26}return a},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new C(e)},r(C,_),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t)},{buffer:188}],187:[function(e,t,n){"use strict";var r;function i(e){this.rand=e}if(t.exports=function(e){return r||(r=new i(null)),r.generate(e)},t.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n>>24]^u[p>>>16&255]^d[m>>>8&255]^h[255&g]^t[v++],s=c[p>>>24]^u[m>>>16&255]^d[g>>>8&255]^h[255&f]^t[v++],o=c[m>>>24]^u[g>>>16&255]^d[f>>>8&255]^h[255&p]^t[v++],l=c[g>>>24]^u[f>>>16&255]^d[p>>>8&255]^h[255&m]^t[v++],f=a,p=s,m=o,g=l;return a=(r[f>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&g])^t[v++],s=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[g>>>8&255]<<8|r[255&f])^t[v++],o=(r[m>>>24]<<24|r[g>>>16&255]<<16|r[f>>>8&255]<<8|r[255&p])^t[v++],l=(r[g>>>24]<<24|r[f>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^t[v++],[a>>>=0,s>>>=0,o>>>=0,l>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],l=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],i=[[],[],[],[]],a=[[],[],[],[]],s=0,o=0,l=0;l<256;++l){var c=o^o<<1^o<<2^o<<3^o<<4;c=c>>>8^255&c^99,n[s]=c,r[c]=s;var u=e[s],d=e[u],h=e[d],f=257*e[c]^16843008*c;i[0][s]=f<<24|f>>>8,i[1][s]=f<<16|f>>>16,i[2][s]=f<<8|f>>>24,i[3][s]=f,f=16843009*h^65537*d^257*u^16843008*s,a[0][c]=f<<24|f>>>8,a[1][c]=f<<16|f>>>16,a[2][c]=f<<8|f>>>24,a[3][c]=f,0===s?s=o=1:(s=u^e[e[e[h^u]]],o^=e[e[o]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:i,INV_SUB_MIX:a}}();function c(e){this._key=i(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),i=[],a=0;a>>24,s=l.SBOX[s>>>24]<<24|l.SBOX[s>>>16&255]<<16|l.SBOX[s>>>8&255]<<8|l.SBOX[255&s],s^=o[a/t|0]<<24):t>6&&a%t==4&&(s=l.SBOX[s>>>24]<<24|l.SBOX[s>>>16&255]<<16|l.SBOX[s>>>8&255]<<8|l.SBOX[255&s]),i[a]=i[a-t]^s}for(var c=[],u=0;u>>24]]^l.INV_SUB_MIX[1][l.SBOX[h>>>16&255]]^l.INV_SUB_MIX[2][l.SBOX[h>>>8&255]]^l.INV_SUB_MIX[3][l.SBOX[255&h]]}this._nRounds=n,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return s(e=i(e),this._keySchedule,l.SUB_MIX,l.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=r.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},c.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var n=s(e,this._invKeySchedule,l.INV_SUB_MIX,l.INV_SBOX,this._nRounds),a=r.allocUnsafe(16);return a.writeUInt32BE(n[0],0),a.writeUInt32BE(n[3],4),a.writeUInt32BE(n[2],8),a.writeUInt32BE(n[1],12),a},c.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},t.exports.AES=c},{"safe-buffer":494}],190:[function(e,t,n){"use strict";var r=e("./aes"),i=e("safe-buffer").Buffer,a=e("cipher-base"),s=e("inherits"),o=e("./ghash"),l=e("buffer-xor"),c=e("./incr32");function u(e,t,n,s){a.call(this);var l=i.alloc(4,0);this._cipher=new r.AES(t);var u=this._cipher.encryptBlock(l);this._ghash=new o(u),n=function(e,t,n){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var r=new o(n),a=t.length,s=a%16;r.update(t),s&&(s=16-s,r.update(i.alloc(s,0))),r.update(i.alloc(8,0));var l=8*a,u=i.alloc(8);u.writeUIntBE(l,0,8),r.update(u),e._finID=r.state;var d=i.from(e._finID);return c(d),d}(this,n,u),this._prev=i.from(n),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}s(u,a),u.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var n=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(n),this._len+=e.length,n},u.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=l(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var n=0;e.length!==t.length&&n++;for(var r=Math.min(e.length,t.length),i=0;i16)throw new Error("unable to decrypt data");for(var n=-1;++n16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},d.prototype.flush=function(){if(this.cache.length)return this.cache},n.createDecipher=function(e,t){var n=a[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var r=c(t,!1,n.key,n.iv);return h(e,r.key,r.iv)},n.createDecipheriv=h},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(e,t,n){"use strict";var r=e("./modes"),i=e("./authCipher"),a=e("safe-buffer").Buffer,s=e("./streamCipher"),o=e("cipher-base"),l=e("./aes"),c=e("evp_bytestokey");function u(e,t,n){o.call(this),this._cache=new h,this._cipher=new l.AES(t),this._prev=a.from(n),this._mode=e,this._autopadding=!0}e("inherits")(u,o),u.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get();)n=this._mode.encrypt(this,t),r.push(n);return a.concat(r)};var d=a.alloc(16,16);function h(){this.cache=a.allocUnsafe(0)}function f(e,t,n){var o=r[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=a.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof n&&(n=a.from(n)),"GCM"!==o.mode&&n.length!==o.iv)throw new TypeError("invalid iv length "+n.length);return"stream"===o.type?new s(o.module,t,n):"auth"===o.type?new i(o.module,t,n):new u(o.module,t,n)}u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(d))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=a.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=a.allocUnsafe(e),n=-1;++n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t0;t--)r[t]=r[t]>>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,n&&(r[0]=r[0]^225<<24)}this.state=a(i)},s.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},t.exports=s},{"safe-buffer":494}],195:[function(e,t,n){"use strict";t.exports=function(e){for(var t,n=e.length;n--;){if(255!==(t=e.readUInt8(n))){t++,e.writeUInt8(t,n);break}e.writeUInt8(0,n)}}},{}],196:[function(e,t,n){"use strict";var r=e("buffer-xor");n.encrypt=function(e,t){var n=r(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},n.decrypt=function(e,t){var n=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return r(i,n)}},{"buffer-xor":219}],197:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer,i=e("buffer-xor");function a(e,t,n){var a=t.length,s=i(t,e._cache);return e._cache=e._cache.slice(a),e._prev=r.concat([e._prev,n?t:s]),s}n.encrypt=function(e,t,n){for(var i,s=r.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=r.allocUnsafe(0)),!(e._cache.length<=t.length)){s=r.concat([s,a(e,t,n)]);break}i=e._cache.length,s=r.concat([s,a(e,t.slice(0,i),n)]),t=t.slice(i)}return s}},{"buffer-xor":219,"safe-buffer":494}],198:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer;function i(e,t,n){for(var r,i,s=-1,o=0;++s<8;)r=t&1<<7-s?128:0,o+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^r))>>s%8,e._prev=a(e._prev,n?r:i);return o}function a(e,t){var n=e.length,i=-1,a=r.allocUnsafe(e.length);for(e=r.concat([e,r.from([t])]);++i>7;return a}n.encrypt=function(e,t,n){for(var a=t.length,s=r.allocUnsafe(a),o=-1;++o=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var i=function(e){var t=a(e);return{blinder:t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),s=t.modulus.byteLength(),o=new r(e).mul(i.blinder).umod(t.modulus),l=o.toRed(r.mont(t.prime1)),c=o.toRed(r.mont(t.prime2)),u=t.coefficient,d=t.prime1,h=t.prime2,f=l.redPow(t.exponent1).fromRed(),p=c.redPow(t.exponent2).fromRed(),m=f.isub(p).imul(u).umod(d).imul(h);return p.iadd(m).imul(i.unblinder).umod(t.modulus).toArrayLike(n,"be",s)}s.getr=a,t.exports=s}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(e,t,n){"use strict";t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(e,t,n){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(e,t,n){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer,i=e("create-hash"),a=e("readable-stream"),s=e("inherits"),o=e("./sign"),l=e("./verify"),c=e("./algorithms.json");function u(e){a.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){a.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function h(e){return new u(e)}function f(e){return new d(e)}Object.keys(c).forEach((function(e){c[e].id=r.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]})),s(u,a.Writable),u.prototype._write=function(e,t,n){this._hash.update(e),n()},u.prototype.update=function(e,t){return"string"==typeof e&&(e=r.from(e,t)),this._hash.update(e),this},u.prototype.sign=function(e,t){this.end();var n=this._hash.digest(),r=o(n,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},s(d,a.Writable),d.prototype._write=function(e,t,n){this._hash.update(e),n()},d.prototype.update=function(e,t){return"string"==typeof e&&(e=r.from(e,t)),this._hash.update(e),this},d.prototype.verify=function(e,t,n){"string"==typeof t&&(t=r.from(t,n)),this.end();var i=this._hash.digest();return l(t,i,e,this._signType,this._tag)},t.exports={Sign:h,Verify:f,createSign:h,createVerify:f}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer,i=e("create-hmac"),a=e("browserify-rsa"),s=e("elliptic").ec,o=e("bn.js"),l=e("parse-asn1"),c=e("./curves.json");function u(e,t,n,a){if((e=r.from(e.toArray())).length0&&n.ishrn(r),n}function h(e,t,n){var a,s;do{for(a=r.alloc(0);8*a.length=t)throw new Error("invalid sig")}t.exports=function(e,t,n,c,u){var d=s(n);if("ec"===d.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,n){var r=o[n.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var i=new a(r),s=n.data.subjectPrivateKey.data;return i.verify(t,e,s)}(e,t,d)}if("dsa"===d.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,n){var r=n.data.p,a=n.data.q,o=n.data.g,c=n.data.pub_key,u=s.signature.decode(e,"der"),d=u.s,h=u.r;l(d,a),l(h,a);var f=i.mont(r),p=d.invm(a);return 0===o.toRed(f).redPow(new i(t).mul(p).mod(a)).fromRed().mul(c.toRed(f).redPow(h.mul(p).mod(a)).fromRed()).mod(r).mod(a).cmp(h)}(e,t,d)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");t=r.concat([u,t]);for(var h=d.modulus.byteLength(),f=[1],p=0;t.length+f.length+2>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function u(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}n.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":217}],219:[function(e,t,n){(function(e){(function(){"use strict";t.exports=function(t,n){for(var r=Math.min(t.length,n.length),i=new e(r),a=0;a2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|d(e,t),r=i(n),s=r.write(e,t);return s!==n&&(r=r.slice(0,s)),r}(e,t);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(F(e,ArrayBuffer)||e&&F(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||F(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return I(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(e).length;default:if(i)return r?-1:I(e).length;t=(""+t).toLowerCase(),i=!0}}function h(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return _(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function p(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){var a,s=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,o/=2,l/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var u=-1;for(a=n;ao&&(n=o-l),a=n;a>=0;a--){for(var d=!0,h=0;hi&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var s=0;s>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function A(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(a=e[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&(l=(15&c)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(l=(15&c)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,s){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function T(e,t,n,i,a){return t=+t,n>>>=0,a||M(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function O(e,t,n,i,a){return t=+t,n>>>=0,a||M(e,0,n,8),r.write(e,t,n,i,52,8),n+8}n.Buffer=a,n.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},n.INSPECT_MAX_BYTES=50,n.kMaxLength=2147483647,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(e,t,n){return s(e,t,n)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(e,t,n){return function(e,t,n){return o(e),e<=0?i(e):void 0!==t?"string"==typeof n?i(e).fill(t,n):i(e).fill(t):i(e)}(e,t,n)},a.allocUnsafe=function(e){return l(e)},a.allocUnsafeSlow=function(e){return l(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(F(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),F(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,s=Math.min(n,r);it&&(e+=" ... "),""},a.prototype.compare=function(e,t,n,r,i){if(F(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),l=Math.min(s,o),c=this.slice(r,i),u=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return b(this,e,t,n);case"latin1":case"binary":return y(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||E(e,t,this.length);for(var r=this[e],i=1,a=0;++a>>=0,t>>>=0,n||E(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||E(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||E(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||E(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||E(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||E(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||E(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a>>=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=n-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return T(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return T(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return O(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return O(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--s)e[s+t]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function D(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function L(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function F(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function B(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer,i=e("stream").Transform,a=e("string_decoder").StringDecoder;function s(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(s,i),s.prototype.update=function(e,t,n){"string"==typeof e&&(e=r.from(e,t));var i=this._update(e);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new a(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},t.exports=s},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(e,t,n){"use strict";var r=e("../internals/is-callable"),i=e("../internals/try-to-string"),a=TypeError;t.exports=function(e){if(r(e))return e;throw new a(i(e)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(e,t,n){"use strict";var r=e("../internals/is-constructor"),i=e("../internals/try-to-string"),a=TypeError;t.exports=function(e){if(r(e))return e;throw new a(i(e)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(e,t,n){"use strict";var r=e("../internals/is-callable"),i=String,a=TypeError;t.exports=function(e){if("object"==typeof e||r(e))return e;throw new a("Can't set "+i(e)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(e,t,n){"use strict";var r=e("../internals/well-known-symbol"),i=e("../internals/object-create"),a=e("../internals/object-define-property").f,s=r("unscopables"),o=Array.prototype;void 0===o[s]&&a(o,s,{configurable:!0,value:i(null)}),t.exports=function(e){o[s][e]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(e,t,n){"use strict";var r=e("../internals/object-is-prototype-of"),i=TypeError;t.exports=function(e,t){if(r(t,e))return e;throw new i("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(e,t,n){"use strict";var r=e("../internals/is-object"),i=String,a=TypeError;t.exports=function(e){if(r(e))return e;throw new a(i(e)+" is not an object")}},{"../internals/is-object":289}],228:[function(e,t,n){"use strict";var r=e("../internals/to-indexed-object"),i=e("../internals/to-absolute-index"),a=e("../internals/length-of-array-like"),s=function(e){return function(t,n,s){var o,l=r(t),c=a(l),u=i(s,c);if(e&&n!=n){for(;c>u;)if((o=l[u++])!=o)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(e,t,n){"use strict";var r=e("../internals/function-bind-context"),i=e("../internals/function-uncurry-this"),a=e("../internals/indexed-object"),s=e("../internals/to-object"),o=e("../internals/length-of-array-like"),l=e("../internals/array-species-create"),c=i([].push),u=function(e){var t=1===e,n=2===e,i=3===e,u=4===e,d=6===e,h=7===e,f=5===e||d;return function(p,m,g,v){for(var b,y,x=s(p),w=a(x),A=r(m,g),k=o(w),S=0,_=v||l,C=t?_(p,k):n||h?_(p,0):void 0;k>S;S++)if((f||S in w)&&(y=A(b=w[S],S,x),e))if(t)C[S]=y;else if(y)switch(e){case 3:return!0;case 5:return b;case 6:return S;case 2:c(C,b)}else switch(e){case 4:return!1;case 7:c(C,b)}return d?-1:i||u?u:C}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(e,t,n){"use strict";var r=e("../internals/to-absolute-index"),i=e("../internals/length-of-array-like"),a=e("../internals/create-property"),s=Array,o=Math.max;t.exports=function(e,t,n){for(var l=i(e),c=r(t,l),u=r(void 0===n?l:n,l),d=s(o(u-c,0)),h=0;c0&&r[0]<4?1:+(r[0]+r[1])),!i&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(e,t,n){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(e,t,n){"use strict";var r=e("../internals/global"),i=e("../internals/object-get-own-property-descriptor").f,a=e("../internals/create-non-enumerable-property"),s=e("../internals/define-built-in"),o=e("../internals/define-global-property"),l=e("../internals/copy-constructor-properties"),c=e("../internals/is-forced");t.exports=function(e,t){var n,u,d,h,f,p=e.target,m=e.global,g=e.stat;if(n=m?r:g?r[p]||o(p,{}):(r[p]||{}).prototype)for(u in t){if(h=t[u],d=e.dontCallGetSet?(f=i(n,u))&&f.value:n[u],!c(m?u:p+(g?".":"#")+u,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;l(h,d)}(e.sham||d&&d.sham)&&a(h,"sham",!0),s(n,u,h,e)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(e,t,n){"use strict";t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],261:[function(e,t,n){"use strict";var r=e("../internals/function-bind-native"),i=Function.prototype,a=i.apply,s=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(a):function(){return s.apply(a,arguments)})},{"../internals/function-bind-native":263}],262:[function(e,t,n){"use strict";var r=e("../internals/function-uncurry-this-clause"),i=e("../internals/a-callable"),a=e("../internals/function-bind-native"),s=r(r.bind);t.exports=function(e,t){return i(e),void 0===t?e:a?s(e,t):function(){return e.apply(t,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(e,t,n){"use strict";var r=e("../internals/fails");t.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},{"../internals/fails":260}],264:[function(e,t,n){"use strict";var r=e("../internals/function-bind-native"),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},{"../internals/function-bind-native":263}],265:[function(e,t,n){"use strict";var r=e("../internals/descriptors"),i=e("../internals/has-own-property"),a=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,o=i(a,"name"),l=o&&"something"===function(){}.name,c=o&&(!r||r&&s(a,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(e,t,n){"use strict";var r=e("../internals/function-uncurry-this"),i=e("../internals/a-callable");t.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(e,t,n){"use strict";var r=e("../internals/classof-raw"),i=e("../internals/function-uncurry-this");t.exports=function(e){if("Function"===r(e))return i(e)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(e,t,n){"use strict";var r=e("../internals/function-bind-native"),i=Function.prototype,a=i.call,s=r&&i.bind.bind(a,a);t.exports=r?s:function(e){return function(){return a.apply(e,arguments)}}},{"../internals/function-bind-native":263}],269:[function(e,t,n){"use strict";var r=e("../internals/global"),i=e("../internals/is-callable"),a=function(e){return i(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?a(r[e]):r[e]&&r[e][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(e,t,n){"use strict";var r=e("../internals/classof"),i=e("../internals/get-method"),a=e("../internals/is-null-or-undefined"),s=e("../internals/iterators"),o=e("../internals/well-known-symbol")("iterator");t.exports=function(e){if(!a(e))return i(e,o)||i(e,"@@iterator")||s[r(e)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(e,t,n){"use strict";var r=e("../internals/function-call"),i=e("../internals/a-callable"),a=e("../internals/an-object"),s=e("../internals/try-to-string"),o=e("../internals/get-iterator-method"),l=TypeError;t.exports=function(e,t){var n=arguments.length<2?o(e):t;if(i(n))return a(r(n,e));throw new l(s(e)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(e,t,n){"use strict";var r=e("../internals/function-uncurry-this"),i=e("../internals/is-array"),a=e("../internals/is-callable"),s=e("../internals/classof-raw"),o=e("../internals/to-string"),l=r([].push);t.exports=function(e){if(a(e))return e;if(i(e)){for(var t=e.length,n=[],r=0;rb;b++)if((x=M(e[b]))&&c(m,x))return x;return new p(!1)}g=u(e,v)}for(w=_?e.next:g.next;!(A=i(w,g)).done;){try{x=M(A.value)}catch(e){h(g,"throw",e)}if("object"==typeof x&&x&&c(m,x))return x}return new p(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(e,t,n){"use strict";var r=e("../internals/function-call"),i=e("../internals/an-object"),a=e("../internals/get-method");t.exports=function(e,t,n){var s,o;i(e);try{if(!(s=a(e,"return"))){if("throw"===t)throw n;return n}s=r(s,e)}catch(e){o=!0,s=e}if("throw"===t)throw n;if(o)throw s;return i(s),n}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(e,t,n){"use strict";var r=e("../internals/iterators-core").IteratorPrototype,i=e("../internals/object-create"),a=e("../internals/create-property-descriptor"),s=e("../internals/set-to-string-tag"),o=e("../internals/iterators"),l=function(){return this};t.exports=function(e,t,n,c){var u=t+" Iterator";return e.prototype=i(r,{next:a(+!c,n)}),s(e,u,!1,!0),o[u]=l,e}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(e,t,n){"use strict";var r=e("../internals/export"),i=e("../internals/function-call"),a=e("../internals/is-pure"),s=e("../internals/function-name"),o=e("../internals/is-callable"),l=e("../internals/iterator-create-constructor"),c=e("../internals/object-get-prototype-of"),u=e("../internals/object-set-prototype-of"),d=e("../internals/set-to-string-tag"),h=e("../internals/create-non-enumerable-property"),f=e("../internals/define-built-in"),p=e("../internals/well-known-symbol"),m=e("../internals/iterators"),g=e("../internals/iterators-core"),v=s.PROPER,b=s.CONFIGURABLE,y=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,w=p("iterator"),A=function(){return this};t.exports=function(e,t,n,s,p,g,k){l(n,t,s);var S,_,C,j=function(e){if(e===p&&O)return O;if(!x&&e&&e in M)return M[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},E=t+" Iterator",N=!1,M=e.prototype,T=M[w]||M["@@iterator"]||p&&M[p],O=!x&&T||j(p),R="Array"===t&&M.entries||T;if(R&&(S=c(R.call(new e)))!==Object.prototype&&S.next&&(a||c(S)===y||(u?u(S,y):o(S[w])||f(S,w,A)),d(S,E,!0,!0),a&&(m[E]=A)),v&&"values"===p&&T&&"values"!==T.name&&(!a&&b?h(M,"name","values"):(N=!0,O=function(){return i(T,this)})),p)if(_={values:j("values"),keys:g?O:j("keys"),entries:j("entries")},k)for(C in _)(x||N||!(C in M))&&f(M,C,_[C]);else r({target:t,proto:!0,forced:x||N},_);return a&&!k||M[w]===O||f(M,w,O,{name:p}),m[t]=O,_}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(e,t,n){"use strict";var r,i,a,s=e("../internals/fails"),o=e("../internals/is-callable"),l=e("../internals/is-object"),c=e("../internals/object-create"),u=e("../internals/object-get-prototype-of"),d=e("../internals/define-built-in"),h=e("../internals/well-known-symbol"),f=e("../internals/is-pure"),p=h("iterator"),m=!1;[].keys&&("next"in(a=[].keys())?(i=u(u(a)))!==Object.prototype&&(r=i):m=!0),!l(r)||s((function(){var e={};return r[p].call(e)!==e}))?r={}:f&&(r=c(r)),o(r[p])||d(r,p,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:m}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(e,t,n){arguments[4][276][0].apply(n,arguments)},{dup:276}],299:[function(e,t,n){"use strict";var r=e("../internals/to-length");t.exports=function(e){return r(e.length)}},{"../internals/to-length":343}],300:[function(e,t,n){"use strict";var r=e("../internals/function-uncurry-this"),i=e("../internals/fails"),a=e("../internals/is-callable"),s=e("../internals/has-own-property"),o=e("../internals/descriptors"),l=e("../internals/function-name").CONFIGURABLE,c=e("../internals/inspect-source"),u=e("../internals/internal-state"),d=u.enforce,h=u.get,f=String,p=Object.defineProperty,m=r("".slice),g=r("".replace),v=r([].join),b=o&&!i((function(){return 8!==p((function(){}),"length",{value:8}).length})),y=String(String).split("String"),x=t.exports=function(e,t,n){"Symbol("===m(f(t),0,7)&&(t="["+g(f(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!s(e,"name")||l&&e.name!==t)&&(o?p(e,"name",{value:t,configurable:!0}):e.name=t),b&&n&&s(n,"arity")&&e.length!==n.arity&&p(e,"length",{value:n.arity});try{n&&s(n,"constructor")&&n.constructor?o&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return s(r,"source")||(r.source=v(y,"string"==typeof t?t:"")),e};Function.prototype.toString=x((function(){return a(this)&&h(this).source||c(this)}),"toString")},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(e,t,n){"use strict";var r=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?i:r)(t)}},{}],302:[function(e,t,n){"use strict";var r,i,a,s,o,l=e("../internals/global"),c=e("../internals/function-bind-context"),u=e("../internals/object-get-own-property-descriptor").f,d=e("../internals/task").set,h=e("../internals/queue"),f=e("../internals/engine-is-ios"),p=e("../internals/engine-is-ios-pebble"),m=e("../internals/engine-is-webos-webkit"),g=e("../internals/engine-is-node"),v=l.MutationObserver||l.WebKitMutationObserver,b=l.document,y=l.process,x=l.Promise,w=u(l,"queueMicrotask"),A=w&&w.value;if(!A){var k=new h,S=function(){var e,t;for(g&&(e=y.domain)&&e.exit();t=k.get();)try{t()}catch(e){throw k.head&&r(),e}e&&e.enter()};f||g||m||!v||!b?!p&&x&&x.resolve?((s=x.resolve(void 0)).constructor=x,o=c(s.then,s),r=function(){o(S)}):g?r=function(){y.nextTick(S)}:(d=c(d,l),r=function(){d(S)}):(i=!0,a=b.createTextNode(""),new v(S).observe(a,{characterData:!0}),r=function(){a.data=i=!i}),A=function(e){k.head||r(),k.add(e)}}t.exports=A},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(e,t,n){"use strict";var r=e("../internals/a-callable"),i=TypeError,a=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw new i("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};t.exports.f=function(e){return new a(e)}},{"../internals/a-callable":222}],304:[function(e,t,n){"use strict";var r=e("../internals/is-regexp"),i=TypeError;t.exports=function(e){if(r(e))throw new i("The method doesn't accept regular expressions");return e}},{"../internals/is-regexp":291}],305:[function(e,t,n){"use strict";var r=e("../internals/descriptors"),i=e("../internals/function-uncurry-this"),a=e("../internals/function-call"),s=e("../internals/fails"),o=e("../internals/object-keys"),l=e("../internals/object-get-own-property-symbols"),c=e("../internals/object-property-is-enumerable"),u=e("../internals/to-object"),d=e("../internals/indexed-object"),h=Object.assign,f=Object.defineProperty,p=i([].concat);t.exports=!h||s((function(){if(r&&1!==h({b:1},h(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol("assign detection");return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!==h({},e)[n]||"abcdefghijklmnopqrst"!==o(h({},t)).join("")}))?function(e,t){for(var n=u(e),i=arguments.length,s=1,h=l.f,f=c.f;i>s;)for(var m,g=d(arguments[s++]),v=h?p(o(g),h(g)):o(g),b=v.length,y=0;b>y;)m=v[y++],r&&!a(f,g,m)||(n[m]=g[m]);return n}:h},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(e,t,n){"use strict";var r,i=e("../internals/an-object"),a=e("../internals/object-define-properties"),s=e("../internals/enum-bug-keys"),o=e("../internals/hidden-keys"),l=e("../internals/html"),c=e("../internals/document-create-element"),u=e("../internals/shared-key")("IE_PROTO"),d=function(){},h=function(e){return"