(()=>{var t={126:(t,e,i)=>{t.exports=i(750)},757:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,i="millisecond",n="second",a="minute",r="hour",s="day",o="week",l="month",u="quarter",c="year",h="date",d="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,i){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(i)+t},g={s:m,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),n=Math.floor(i/60),a=i%60;return(e<=0?"+":"-")+m(n,2,"0")+":"+m(a,2,"0")},m:function t(e,i){if(e.date()=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function a(t){return t.titleHeight+t.margins.top+t.paddings.top}function r(t){return t.margins.left+t.paddings.left}function s(t){return t.margins.top+t.margins.bottom+t.paddings.top+t.paddings.bottom+t.titleHeight+t.legendHeight}function o(t){return t.margins.left+t.margins.right+t.paddings.left+t.paddings.right}function l(t){return parseFloat(t.toFixed(2))}function u(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i||(i=n?t[0]:t[t.length-1]);var a=new Array(Math.abs(e)).fill(i);return n?a.concat(t):t.concat(a)}function c(t,e){return(t+"").length*e}function h(t,e){return{x:Math.sin(t*kt)*e,y:Math.cos(t*kt)*e}}function d(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(Number.isNaN(t)||void 0===t||!Number.isFinite(t)||e&&t<0)}function f(t){var e=void 0,i=void 0,n=void 0;if(t instanceof Date)return new Date(t.getTime());if("object"!==(void 0===t?"undefined":lt(t))||null===t)return t;for(n in e=Array.isArray(t)?[]:{},t)i=t[n],e[n]=f(i);return e}function p(t,e){var i=void 0,n=void 0;return t<=e?(i=e-t,n=t):(i=t-e,n=e),[i,n]}function v(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-t.length;return i>0?t=u(t,i):e=u(e,i),[t,e]}function m(t,e){if(t)return t.length>e?t.slice(0,e-3)+"...":t}function g(t){var e=void 0;if("number"==typeof t)e=t;else if("string"==typeof t&&(e=Number(t),Number.isNaN(e)))return t;var i=Math.floor(Math.log10(Math.abs(e)));if(i<=2)return e;var n=Math.floor(i/3),a=Math.pow(10,i-3*n)*+(e/Math.pow(10,i)).toFixed(1);return Math.round(100*a)/100+" "+["","K","M","B","T"][n]}function y(t,e){for(var i=[],n=0;n255?255:t<0?0:t}function x(t,e){var i=Pt(t),n=!1;"#"==i[0]&&(i=i.slice(1),n=!0);var a=parseInt(i,16),r=b((a>>16)+e),s=b((a>>8&255)+e);return(n?"#":"")+(b((255&a)+e)|s<<8|r<<16).toString(16)}function w(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function k(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg",t);for(var n in e){var a=e[n];if("inside"===n)w(a).appendChild(i);else if("around"===n){var r=w(a);r.parentNode.insertBefore(i,r),i.appendChild(r)}else"styles"===n?"object"===(void 0===a?"undefined":lt(a))&&Object.keys(a).map((function(t){i.style[t]=a[t]})):("className"===n&&(n="class"),"innerHTML"===n?i.textContent=a:i.setAttribute(n,a))}return i}function D(t,e){return k("linearGradient",{inside:t,id:e,x1:0,x2:0,y1:0,y2:1})}function M(t,e,i,n){return k("stop",{inside:t,style:"stop-color: "+i,offset:e,"stop-opacity":n})}function P(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i={className:t,transform:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""};return e&&(i.inside=e),k("g",i)}function L(t){return k("path",{className:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",d:t,styles:{stroke:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"none",fill:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none","stroke-width":arguments.length>4&&void 0!==arguments[4]?arguments[4]:2}})}function S(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n="path-fill-gradient-"+e+"-"+(i?"lighter":"default"),a=D(t,n),r=[1,.6,.2];return i&&(r=[.4,.2,0]),M(a,"0%",e,r[0]),M(a,"50%",e,r[1]),M(a,"100%",e,r[2]),n}function O(t,e,i,n,a){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},s={className:t,x:e,y:i,width:n,height:n,rx:a,fill:arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none"};return Object.keys(r).map((function(t){s[t]=r[t]})),k("rect",s)}function T(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},r=a.fontSize||Tt;return k("text",{className:t,x:e,y:i,dy:(void 0!==a.dy?a.dy:r/2)+"px","font-size":r+"px",fill:a.fill||Ct,"text-anchor":a.textAnchor||"start",innerHTML:n})}function A(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};a.stroke||(a.stroke=At);var r=k("line",{className:"line-vertical "+a.className,x1:0,x2:0,y1:i,y2:n,styles:{stroke:a.stroke}}),s=k("text",{x:0,y:i>n?i+St:i-St-Tt,dy:Tt+"px","font-size":Tt+"px","text-anchor":"middle",innerHTML:e+""}),o=k("g",{transform:"translate("+t+", 0)"});return o.appendChild(r),o.appendChild(s),o}function C(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};a.stroke||(a.stroke=At),a.lineType||(a.lineType=""),a.shortenNumbers&&(e=g(e));var r=k("line",{className:"line-horizontal "+a.className+("dashed"===a.lineType?"dashed":""),x1:i,x2:n,y1:0,y2:0,styles:{stroke:a.stroke}}),s=k("text",{x:i4&&void 0!==arguments[4]?arguments[4]:0,r=p(i,(arguments.length>5&&void 0!==arguments[5]?arguments[5]:{}).zeroLine),s=pt(r,2),o=s[0],l=s[1];return l-=a,"rect"!==t.nodeName?[[t.childNodes[0],{width:n,height:o},Et,jt],N(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,l],Yt)]:[[t,{width:n,height:o,x:e,y:l},Et,jt]]}function $(t,e){return[t,{d:e},Et,jt]}function Y(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"linear",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=t.cloneNode(!0),o=t.cloneNode(!0);for(var l in e){var u=void 0;u="transform"===l?document.createElementNS("http://www.w3.org/2000/svg","animateTransform"):document.createElementNS("http://www.w3.org/2000/svg","animate");var c=r[l]||t.getAttribute(l),h=e[l],d={attributeName:l,from:c,to:h,begin:"0s",dur:i/1e3+"s",values:c+";"+h,keySplines:zt[n],keyTimes:"0;1",calcMode:"spline",fill:"freeze"};for(var f in a&&(d.type=a),d)u.setAttribute(f,d[f]);s.appendChild(u),a?o.setAttribute(l,"translate("+h+")"):o.setAttribute(l,h)}return[s,o]}function W(t,e){t.style.transform=e,t.style.webkitTransform=e,t.style.msTransform=e,t.style.mozTransform=e,t.style.oTransform=e}function j(t,e){var i=[],n=[];e.map((function(t){var e,a,r=t[0],s=r.parentNode;t[0]=r;var o=Y.apply(void 0,vt(t)),l=pt(o,2);e=l[0],a=l[1],i.push(a),n.push([e,s]),s&&s.replaceChild(e,r)}));var a=t.cloneNode(!0);return n.map((function(t,n){t[1]&&(t[1].replaceChild(i[n],t[0]),e[n][0]=i[n])})),a}function z(t,e,i){if(0!==i.length){var n=j(e,i);e.parentNode==t&&(t.removeChild(e),t.appendChild(n)),setTimeout((function(){n.parentNode==t&&(t.removeChild(n),t.appendChild(e))}),Wt)}}function H(e){var i=e.cloneNode(!0);i.classList.add("chart-container"),i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");var n=t.create("style",{innerHTML:Ht});i.insertBefore(n,i.firstChild);var a=t.create("div");return a.appendChild(i),a.innerHTML}function F(t){var e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function I(t){var e=t.getDate(),i=t.getMonth()+1;return[t.getFullYear(),(i>9?"":"0")+i,(e>9?"":"0")+e].join("-")}function R(t){return new Date(t.getTime())}function U(t,e){var i=q(t);return Math.ceil(function(t,e){var i=Vt*Ut;return(F(e)-F(t))/i}(i,e)/Rt)}function V(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}function B(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=Bt[t];return e?i.slice(0,3):i}function G(t,e){return new Date(e,t+1,0)}function q(t){var e=R(t),i=e.getDay();return 0!==i&&J(e,-1*i),e}function J(t,e){t.setDate(t.getDate()+e)}function X(t,e,i){var n=Object.keys(Jt).filter((function(e){return t.includes(e)})),a=Jt[n[0]];return Object.assign(a,{constants:e,getData:i}),new qt(a)}function Z(t){if(0===t)return[0,0];if(isNaN(t))return{mantissa:-6755399441055744,exponent:972};var e=t>0?1:-1;if(!isFinite(t))return{mantissa:4503599627370496*e,exponent:972};t=Math.abs(t);var i=Math.floor(Math.log10(t));return[e*(t/Math.pow(10,i)),i]}function K(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Math.ceil(t),n=Math.floor(e),a=i-n,r=a,s=1;a>5&&(a%2!=0&&(a=++i-n),r=a/2,s=2),a<=2&&(s=a/(r=4)),0===a&&(r=5,s=1);for(var o=[],l=0;l<=r;l++)o.push(n+s*l);return o}function Q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Z(t),n=pt(i,2),a=n[0],r=n[1],s=e?e/Math.pow(10,r):0,o=K(a=a.toFixed(6),s);return o.map((function(t){return t*Math.pow(10,r)}))}function tt(t){function e(t,e){for(var i=Q(t),n=i[1]-i[0],a=0,r=1;a1&&void 0!==arguments[1]&&arguments[1],n=Math.max.apply(Math,vt(t)),a=Math.min.apply(Math,vt(t)),r=[];if(n>=0&&a>=0)Z(n)[1],r=i?Q(n,a):Q(n);else if(n>0&&a<0){var s=Math.abs(a);n>=s?(Z(n)[1],r=e(n,s)):(Z(s)[1],r=e(s,n).reverse().map((function(t){return-1*t})))}else if(n<=0&&a<=0){var o=Math.abs(a),l=Math.abs(n);Z(o)[1],r=(r=i?Q(o,l):Q(o)).reverse().map((function(t){return-1*t}))}return r}function et(t){var e=it(t);return t.indexOf(0)>=0?t.indexOf(0):t[0]>0?-1*t[0]/e:-1*t[t.length-1]/e+(t.length-1)}function it(t){return t[1]-t[0]}function nt(t){return t[t.length-1]-t[0]}function at(t,e){return l(e.zeroLine-t*e.scaleMultiplier)}function rt(t,e){return e.filter((function(e){return ei?n.slice(0,i):u(n,i-n.length,0),t.values=n}else t.values=a;t.chartType||(gt.includes(e),t.chartType=e)})),t.yRegions&&t.yRegions.map((function(t){if(t.end\n\t\t\t\t
    \n\t\t\t\t
    '}),this.hideTip(),this.title=this.container.querySelector(".title"),this.dataPointList=this.container.querySelector(".data-point-list"),this.parent.addEventListener("mouseleave",(function(){e.hideTip()}))}},{key:"fill",value:function(){var e,i=this;this.index&&this.container.setAttribute("data-point-index",this.index),e=this.titleValueFirst?""+this.titleValue+""+this.titleName:this.titleName+""+this.titleValue+"",this.title.innerHTML=e,this.dataPointList.innerHTML="",this.listValues.map((function(e,n){var a=i.colors[n]||"black",r=0===e.formatted||e.formatted?e.formatted:e.value,s=t.create("li",{styles:{"border-top":"3px solid "+a},innerHTML:''+(0===r||r?r:"")+"\n\t\t\t\t\t"+(e.title?e.title:"")});i.dataPointList.appendChild(s)}))}},{key:"calcPosition",value:function(){var t=this.container.offsetWidth;this.top=this.y-this.container.offsetHeight-5,this.left=this.x-t/2;var e=this.parent.offsetWidth-t,i=this.container.querySelector(".svg-pointer");if(this.left<0)i.style.left="calc(50% - "+-1*this.left+"px)",this.left=0;else if(this.left>e){var n="calc(50% + "+(this.left-e)+"px)";i.style.left=n,this.left=e}else i.style.left="50%"}},{key:"setValues",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;this.titleName=i.name,this.titleValue=i.value,this.listValues=n,this.x=t,this.y=e,this.titleValueFirst=i.valueFirst||0,this.index=a,this.refresh()}},{key:"hideTip",value:function(){this.container.style.top="0px",this.container.style.left="0px",this.container.style.opacity="0"}},{key:"showTip",value:function(){this.container.style.top=this.top+"px",this.container.style.left=this.left+"px",this.container.style.opacity="1"}}]),e}(),Mt={"light-blue":"#7cd6fd",blue:"#5e64ff",violet:"#743ee2",red:"#ff5858",orange:"#ffa00a",yellow:"#feef72",green:"#28a745","light-green":"#98d85b",purple:"#b554ff",magenta:"#ffa3ef",black:"#36114C",grey:"#bdd3e6","light-grey":"#f0f4f7","dark-grey":"#b8c2cc"},Pt=function(t){return/rgb[a]{0,1}\([\d, ]+\)/gim.test(t)?/\D+(\d*)\D+(\d*)\D+(\d*)/gim.exec(t).map((function(t,e){return 0!==e?Number(t).toString(16):"#"})).reduce((function(t,e){return""+t+e})):Mt[t]||t},Lt=6,St=4,Ot=15,Tt=10,At="#dadada",Ct="#555b51",Nt={bar:function(t){var e=void 0;"rect"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode();return i.style.fill="#000000",i.style.opacity="0.4",e&&i.setAttribute("transform",e),i},dot:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode(),n=t.getAttribute("r"),a=t.getAttribute("fill");return i.setAttribute("r",parseInt(n)+4),i.setAttribute("fill",a),i.style.opacity="0.6",e&&i.setAttribute("transform",e),i},heat_square:function(t){var e=void 0;"circle"!==t.nodeName&&(e=t.getAttribute("transform"),t=t.childNodes[0]);var i=t.cloneNode(),n=t.getAttribute("r"),a=t.getAttribute("fill");return i.setAttribute("r",parseInt(n)+4),i.setAttribute("fill",a),i.style.opacity="0.6",e&&i.setAttribute("transform",e),i}},_t={bar:function(t,e){var i=void 0;"rect"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["x","y","width","height"];Object.values(t.attributes).filter((function(t){return n.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),i&&e.setAttribute("transform",i)},dot:function(t,e){var i=void 0;"circle"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["cx","cy"];Object.values(t.attributes).filter((function(t){return n.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),i&&e.setAttribute("transform",i)},heat_square:function(t,e){var i=void 0;"circle"!==t.nodeName&&(i=t.getAttribute("transform"),t=t.childNodes[0]);var n=["cx","cy"];Object.values(t.attributes).filter((function(t){return n.includes(t.name)&&t.specified})).map((function(t){e.setAttribute(t.name,t.nodeValue)})),i&&e.setAttribute("transform",i)}},Et=350,$t=350,Yt=Et,Wt=250,jt="easein",zt={ease:"0.25 0.1 0.25 1",linear:"0 0 1 1",easein:"0.1 0.8 0.2 1",easeout:"0 0 0.58 1",easeinout:"0.42 0 0.58 1"},Ht=".chart-container{position:relative;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Cantarell','Fira Sans','Droid Sans','Helvetica Neue',sans-serif}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .legend-dataset-text{fill:#6c7680;font-weight:600}.graph-svg-tip{position:absolute;z-index:99999;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.graph-svg-tip ul{padding-left:0;display:flex}.graph-svg-tip ol{padding-left:0;display:flex}.graph-svg-tip ul.data-point-list li{min-width:90px;flex:1;font-weight:600}.graph-svg-tip strong{color:#dfe2e5;font-weight:600}.graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:' ';border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}",Ft=function(){function e(t,i){if(ut(this,e),i=f(i),this.parent="string"==typeof t?document.querySelector(t):t,!(this.parent instanceof HTMLElement))throw new Error("No `parent` element to render on was provided.");this.rawChartArgs=i,this.title=i.title||"",this.type=i.type||"",this.realData=this.prepareData(i.data),this.data=this.prepareFirstData(this.realData),this.colors=this.validateColors(i.colors,this.type),this.config={showTooltip:1,showLegend:1,isNavigable:i.isNavigable||0,animate:void 0!==i.animate?i.animate:1,truncateLegends:i.truncateLegends||1},this.measures=JSON.parse(JSON.stringify(mt));var n=this.measures;this.setMeasures(i),this.title.length||(n.titleHeight=0),this.config.showLegend||(n.legendHeight=0),this.argHeight=i.height||n.baseHeight,this.state={},this.options={},this.initTimeout=700,this.config.isNavigable&&(this.overlays=[]),this.configure(i)}return ct(e,[{key:"prepareData",value:function(t){return t}},{key:"prepareFirstData",value:function(t){return t}},{key:"validateColors",value:function(t,e){var i=[];return(t=(t||[]).concat(wt[e])).forEach((function(t){var e=Pt(t);!function(t){return/(^\s*)(#)((?:[A-Fa-f0-9]{3}){1,2})$/i.test(t)||/(^\s*)(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/i.test(t)}(e)?console.warn('"'+t+'" is not a valid color.'):i.push(e)})),i}},{key:"setMeasures",value:function(){}},{key:"configure",value:function(){var t=this,e=this.argHeight;this.baseHeight=e,this.height=e-s(this.measures),this.boundDrawFn=function(){return t.draw(!0)},ResizeObserver&&(this.resizeObserver=new ResizeObserver(this.boundDrawFn),this.resizeObserver.observe(this.parent)),window.addEventListener("resize",this.boundDrawFn),window.addEventListener("orientationchange",this.boundDrawFn)}},{key:"destroy",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),window.removeEventListener("resize",this.boundDrawFn),window.removeEventListener("orientationchange",this.boundDrawFn)}},{key:"setup",value:function(){this.makeContainer(),this.updateWidth(),this.makeTooltip(),this.draw(!1,!0)}},{key:"makeContainer",value:function(){this.parent.innerHTML="";var e={inside:this.parent,className:"chart-container"};this.independentWidth&&(e.styles={width:this.independentWidth+"px"}),this.container=t.create("div",e)}},{key:"makeTooltip",value:function(){this.tip=new Dt({parent:this.container,colors:this.colors}),this.bindTooltip()}},{key:"bindTooltip",value:function(){}},{key:"draw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&i(this.parent)||(this.updateWidth(),this.calc(e),this.makeChartArea(),this.setupComponents(),this.components.forEach((function(e){return e.setup(t.drawArea)})),this.render(this.components,!1),n&&(this.data=this.realData,setTimeout((function(){t.update(t.data)}),this.initTimeout)),this.renderLegend(),this.setupNavigation(n))}},{key:"calc",value:function(){}},{key:"updateWidth",value:function(){this.baseWidth=function(t){var e=window.getComputedStyle(t),i=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.clientWidth-i}(this.parent),this.width=this.baseWidth-o(this.measures)}},{key:"makeChartArea",value:function(){this.svg&&this.container.removeChild(this.svg);var t=this.measures;this.svg=function(t,e,i,n){return k("svg",{className:e,inside:t,width:i,height:n})}(this.container,"frappe-chart chart",this.baseWidth,this.baseHeight),this.svgDefs=function(t){return k("defs",{inside:t})}(this.svg),this.title.length&&(this.titleEL=T("title",t.margins.left,t.margins.top,this.title,{fontSize:t.titleFontSize,fill:"#666666",dy:t.titleFontSize}));var e=a(t);this.drawArea=P(this.type+"-chart chart-draw-area","translate("+r(t)+", "+e+")"),this.config.showLegend&&(e+=this.height+t.paddings.bottom,this.legendArea=P("chart-legend","translate("+r(t)+", "+e+")")),this.title.length&&this.svg.appendChild(this.titleEL),this.svg.appendChild(this.drawArea),this.config.showLegend&&this.svg.appendChild(this.legendArea),this.updateTipOffset(r(t),a(t))}},{key:"updateTipOffset",value:function(t,e){this.tip.offset={x:t,y:e}}},{key:"setupComponents",value:function(){this.components=new Map}},{key:"update",value:function(t){t||console.error("No data to update."),this.data=this.prepareData(t),this.calc(),this.render(this.components,this.config.animate),this.renderLegend()}},{key:"render",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.components,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.config.isNavigable&&this.overlays.map((function(t){return t.parentNode.removeChild(t)}));var n=[];e.forEach((function(t){n=n.concat(t.update(i))})),n.length>0?(z(this.container,this.svg,n),setTimeout((function(){e.forEach((function(t){return t.make()})),t.updateNav()}),400)):(e.forEach((function(t){return t.make()})),this.updateNav())}},{key:"updateNav",value:function(){this.config.isNavigable&&(this.makeOverlay(),this.bindUnits())}},{key:"renderLegend",value:function(){}},{key:"setupNavigation",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.config.isNavigable&&e&&(this.bindOverlay(),this.keyActions={13:this.onEnterKey.bind(this),37:this.onLeftArrow.bind(this),38:this.onUpArrow.bind(this),39:this.onRightArrow.bind(this),40:this.onDownArrow.bind(this)},document.addEventListener("keydown",(function(e){n(t.container)&&(e=e||window.event,t.keyActions[e.keyCode]&&t.keyActions[e.keyCode]())})))}},{key:"makeOverlay",value:function(){}},{key:"updateOverlay",value:function(){}},{key:"bindOverlay",value:function(){}},{key:"bindUnits",value:function(){}},{key:"onLeftArrow",value:function(){}},{key:"onRightArrow",value:function(){}},{key:"onUpArrow",value:function(){}},{key:"onDownArrow",value:function(){}},{key:"onEnterKey",value:function(){}},{key:"addDataPoint",value:function(){}},{key:"removeDataPoint",value:function(){}},{key:"getDataPoint",value:function(){}},{key:"setCurrentDataPoint",value:function(){}},{key:"updateDataset",value:function(){}},{key:"export",value:function(){var t=H(this.svg);!function(t,e){var i=document.createElement("a");i.style="display: none";var n=new Blob(e,{type:"image/svg+xml; charset=utf-8"}),a=window.URL.createObjectURL(n);i.href=a,i.download=t,document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i),window.URL.revokeObjectURL(a)}),300)}(this.title||"Chart",[t])}}]),e}(),It=function(t){function e(t,i){return ut(this,e),ft(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i))}return dt(e,t),ct(e,[{key:"configure",value:function(t){ht(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"configure",this).call(this,t),this.config.formatTooltipY=(t.tooltipOptions||{}).formatTooltipY,this.config.maxSlices=t.maxSlices||20,this.config.maxLegendPoints=t.maxLegendPoints||20}},{key:"calc",value:function(){var t=this,e=this.state,i=this.config.maxSlices;e.sliceTotals=[];var n=this.data.labels.map((function(e,i){var n=0;return t.data.datasets.map((function(t){n+=t.values[i]})),[n,e]})).filter((function(t){return t[0]>=0})),a=n;if(n.length>i){n.sort((function(t,e){return e[0]-t[0]})),a=n.slice(0,i-1);var r=0;n.slice(i-1).map((function(t){r+=t[0]})),a.push([r,"Rest"]),this.colors[i-1]="grey"}e.labels=[],a.map((function(t){e.sliceTotals.push(function(t){return Number(Math.round(t+"e4")+"e-4")}(t[0])),e.labels.push(t[1])})),e.grandTotal=e.sliceTotals.reduce((function(t,e){return t+e}),0),this.center={x:this.width/2,y:this.height/2}}},{key:"renderLegend",value:function(){var t=this,e=this.state;this.legendArea.textContent="",this.legendTotals=e.sliceTotals.slice(0,this.config.maxLegendPoints);var i=0,n=0;this.legendTotals.map((function(a,r){var s=150,l=Math.floor((t.width-o(t.measures))/s);t.legendTotals.lengthl&&(i=0,n+=20);var u=s*i+5,c=t.config.truncateLegends?m(e.labels[r],s/10):e.labels[r],h=t.config.formatTooltipY?t.config.formatTooltipY(a):a,d=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",a=arguments[4];a=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?m(a,Ot):a;var r={className:"legend-dot",cx:0,cy:0,r:i,fill:n},s=k("text",{className:"legend-dataset-text",x:0,y:0,dx:Tt+"px",dy:Tt/3+"px","font-size":1.2*Tt+"px","text-anchor":"start",fill:Ct,innerHTML:a}),o=k("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(k("circle",r)),o.appendChild(s),o}(u,n,5,t.colors[r],c+": "+h,!1);t.legendArea.appendChild(d),i++}))}}]),e}(Ft),Rt=7,Ut=1e3,Vt=86400,Bt=["January","February","March","April","May","June","July","August","September","October","November","December"],Gt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],qt=function(){function t(e){var i=e.layerClass,n=void 0===i?"":i,a=e.layerTransform,r=void 0===a?"":a,s=e.constants,o=e.getData,l=e.makeElements,u=e.animateElements;ut(this,t),this.layerTransform=r,this.constants=s,this.makeElements=l,this.getData=o,this.animateElements=u,this.store=[],this.labels=[],this.layerClass=n,this.layerClass="function"==typeof this.layerClass?this.layerClass():this.layerClass,this.refresh()}return ct(t,[{key:"refresh",value:function(t){this.data=t||this.getData()}},{key:"setup",value:function(t){this.layer=P(this.layerClass,this.layerTransform,t)}},{key:"make",value:function(){this.render(this.data),this.oldData=this.data}},{key:"render",value:function(t){var e=this;this.store=this.makeElements(t),this.layer.textContent="",this.store.forEach((function(t){e.layer.appendChild(t)})),this.labels.forEach((function(t){e.layer.appendChild(t)}))}},{key:"update",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.refresh();var e=[];return t&&(e=this.animateElements(this.data)||[]),e}}]),t}(),Jt={donutSlices:{layerClass:"donut-slices",makeElements:function(t){return t.sliceStrings.map((function(e,i){var n=L(e,"donut-path",t.colors[i],"none",t.strokeWidth);return n.style.transition="transform .3s;",n}))},animateElements:function(t){return this.store.map((function(e,i){return $(e,t.sliceStrings[i])}))}},pieSlices:{layerClass:"pie-slices",makeElements:function(t){return t.sliceStrings.map((function(e,i){var n=L(e,"pie-path","none",t.colors[i]);return n.style.transition="transform .3s;",n}))},animateElements:function(t){return this.store.map((function(e,i){return $(e,t.sliceStrings[i])}))}},percentageBars:{layerClass:"percentage-bars",makeElements:function(t){var e=this;return t.xPositions.map((function(i,n){return function(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:yt,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"none";return k("rect",{className:"percentage-bar",x:t,y:e,width:i,height:n,fill:r,styles:{stroke:x(r,-25),"stroke-dasharray":"0, "+(n+i)+", "+i+", "+n,"stroke-width":a}})}(i,0,t.widths[n],e.constants.barHeight,e.constants.barDepth,t.colors[n])}))},animateElements:function(t){if(t)return[]}},yAxis:{layerClass:"y axis",makeElements:function(t){var e=this;return t.positions.map((function(i,n){return function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};d(t)||(t=0),n.pos||(n.pos="left"),n.offset||(n.offset=0),n.mode||(n.mode="span"),n.stroke||(n.stroke=At),n.className||(n.className="");var a=-1*Lt,r="span"===n.mode?i+Lt:0;return"tick"===n.mode&&"right"===n.pos&&(a=i+Lt,r=i),C(t,e,a+=n.offset,r+=n.offset,{stroke:n.stroke,className:n.className,lineType:n.lineType,shortenNumbers:n.shortenNumbers})}(i,t.labels[n],e.constants.width,{mode:e.constants.mode,pos:e.constants.pos,shortenNumbers:e.constants.shortenNumbers})}))},animateElements:function(t){var e=t.positions,i=t.labels,n=this.oldData.positions,a=this.oldData.labels,r=v(n,e),s=pt(r,2);n=s[0],e=s[1];var o=v(a,i),l=pt(o,2);return a=l[0],i=l[1],this.render({positions:n,labels:i}),this.store.map((function(t,i){return _(t,e[i],n[i])}))}},xAxis:{layerClass:"x axis",makeElements:function(t){var e=this;return t.positions.map((function(i,n){return function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};d(t)||(t=0),n.pos||(n.pos="bottom"),n.offset||(n.offset=0),n.mode||(n.mode="span"),n.stroke||(n.stroke=At),n.className||(n.className="");var a=i+Lt,r="span"===n.mode?-1*Lt:i;return"tick"===n.mode&&"top"===n.pos&&(a=-1*Lt,r=0),A(t,e,a,r,{stroke:n.stroke,className:n.className,lineType:n.lineType})}(i,t.calcLabels[n],e.constants.height,{mode:e.constants.mode,pos:e.constants.pos})}))},animateElements:function(t){var e=t.positions,i=t.calcLabels,n=this.oldData.positions,a=this.oldData.calcLabels,r=v(n,e),s=pt(r,2);n=s[0],e=s[1];var o=v(a,i),l=pt(o,2);return a=l[0],i=l[1],this.render({positions:n,calcLabels:i}),this.store.map((function(t,i){return function(t,e,i){return N(t,[i,0],[e,0],Yt)}(t,e[i],n[i])}))}},yMarkers:{layerClass:"y-markers",makeElements:function(t){var e=this;return t.map((function(t){return function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.labelPos||(n.labelPos="right");var a=k("text",{className:"chart-label",x:"left"===n.labelPos?St:i-c(e,5)-St,y:0,dy:Tt/-2+"px","font-size":Tt+"px","text-anchor":"start",innerHTML:e+""}),r=C(t,"",0,i,{stroke:n.stroke||At,className:n.className||"",lineType:n.lineType});return r.appendChild(a),r}(t.position,t.label,e.constants.width,{labelPos:t.options.labelPos,mode:"span",lineType:"dashed"})}))},animateElements:function(t){var e=v(this.oldData,t),i=pt(e,2);this.oldData=i[0];var n=(t=i[1]).map((function(t){return t.position})),a=t.map((function(t){return t.label})),r=t.map((function(t){return t.options})),s=this.oldData.map((function(t){return t.position}));return this.render(s.map((function(t,e){return{position:s[e],label:a[e],options:r[e]}}))),this.store.map((function(t,e){return _(t,n[e],s[e])}))}},yRegions:{layerClass:"y-regions",makeElements:function(t){var e=this;return t.map((function(t){return function(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},r=t-e,s=k("rect",{className:"bar mini",styles:{fill:"rgba(228, 234, 239, 0.49)",stroke:At,"stroke-dasharray":i+", "+r},x:0,y:0,width:i,height:r});a.labelPos||(a.labelPos="right");var o=k("text",{className:"chart-label",x:"left"===a.labelPos?St:i-c(n+"",4.5)-St,y:0,dy:Tt/-2+"px","font-size":Tt+"px","text-anchor":"start",innerHTML:n+""}),l=k("g",{transform:"translate(0, "+e+")"});return l.appendChild(s),l.appendChild(o),l}(t.startPos,t.endPos,e.constants.width,t.label,{labelPos:t.options.labelPos})}))},animateElements:function(t){var e=v(this.oldData,t),i=pt(e,2);this.oldData=i[0];var n=(t=i[1]).map((function(t){return t.endPos})),a=t.map((function(t){return t.label})),r=t.map((function(t){return t.startPos})),s=t.map((function(t){return t.options})),o=this.oldData.map((function(t){return t.endPos})),l=this.oldData.map((function(t){return t.startPos}));this.render(o.map((function(t,e){return{startPos:l[e],endPos:o[e],label:a[e],options:s[e]}})));var u=[];return this.store.map((function(t,e){u=u.concat(function(t,e,i,n){var a=e-i,r=t.childNodes[0];return[[r,{height:a,"stroke-dasharray":r.getAttribute("width")+", "+a},Yt,jt],N(t,[0,n],[0,i],Yt)]}(t,r[e],n[e],o[e]))})),u}},heatDomain:{layerClass:function(){return"heat-domain domain-"+this.constants.index},makeElements:function(t){var e=this,i=this.constants,n=i.index,a=i.colWidth,r=i.rowHeight,s=i.squareSize,o=i.radius,l=i.xTranslate,u=0;return this.serializedSubDomains=[],t.cols.map((function(t,i){1===i&&e.labels.push(T("domain-name",l,-12,B(n,!0).toUpperCase(),{fontSize:9})),t.map((function(t,i){if(t.fill){var n={"data-date":t.yyyyMmDd,"data-value":t.dataValue,"data-day":i},a=O("day",l,u,s,o,t.fill,n);e.serializedSubDomains.push(a)}u+=r})),u=0,l+=a})),this.serializedSubDomains},animateElements:function(t){if(t)return[]}},barGraph:{layerClass:function(){return"dataset-units dataset-bars dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="bar",this.units=t.yPositions.map((function(i,n){return function(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},l=p(e,o.zeroLine),u=pt(l,2),c=u[0],h=u[1];h-=s,0===c&&(c=o.minHeight,h-=o.minHeight),d(t)||(t=0),d(h)||(h=0),d(c,!0)||(c=0),d(i,!0)||(i=0);var f=k("rect",{className:"bar mini",style:"fill: "+n,"data-point-index":r,x:t,y:h,width:i,height:c});if((a+="")||a.length){f.setAttribute("y",0),f.setAttribute("x",0);var v=k("text",{className:"data-point-value",x:i/2,y:0,dy:Tt/2*-1+"px","font-size":Tt+"px","text-anchor":"middle",innerHTML:a}),m=k("g",{"data-point-index":r,transform:"translate("+t+", "+h+")"});return m.appendChild(f),m.appendChild(v),m}return f}(t.xPositions[n],i,t.barWidth,e.color,t.labels[n],n,t.offsets[n],{zeroLine:t.zeroLine,barsWidth:t.barsWidth,minHeight:e.minHeight})})),this.units},animateElements:function(t){var e=t.xPositions,i=t.yPositions,n=t.offsets,a=t.labels,r=this.oldData.xPositions,s=this.oldData.yPositions,o=this.oldData.offsets,l=this.oldData.labels,u=v(r,e),c=pt(u,2);r=c[0],e=c[1];var h=v(s,i),d=pt(h,2);s=d[0],i=d[1];var f=v(o,n),p=pt(f,2);o=p[0],n=p[1];var m=v(l,a),g=pt(m,2);l=g[0],a=g[1],this.render({xPositions:r,yPositions:s,offsets:o,labels:a,zeroLine:this.oldData.zeroLine,barsWidth:this.oldData.barsWidth,barWidth:this.oldData.barWidth});var y=[];return this.store.map((function(a,r){y=y.concat(E(a,e[r],i[r],t.barWidth,n[r],{zeroLine:t.zeroLine}))})),y}},lineGraph:{layerClass:function(){return"dataset-units dataset-line dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return this.unitType="dot",this.paths={},e.hideLine||(this.paths=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},r=e.map((function(e,i){return t[i]+","+e})).join("L");n.spline&&(r=y(t,e));var s=L("M"+r,"line-graph-path",i);if(n.heatline){var o=S(a.svgDefs,i);s.style.stroke="url(#"+o+")"}var l={path:s};if(n.regionFill){var u=S(a.svgDefs,i,!0),c="M"+t[0]+","+a.zeroLine+"L"+r+"L"+t.slice(-1)[0]+","+a.zeroLine;l.region=L(c,"region-fill","none","url(#"+u+")")}return l}(t.xPositions,t.yPositions,e.color,{heatline:e.heatline,regionFill:e.regionFill,spline:e.spline},{svgDefs:e.svgDefs,zeroLine:t.zeroLine})),this.units=[],e.hideDots||(this.units=t.yPositions.map((function(i,n){return function(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=k("circle",{style:"fill: "+n,"data-point-index":r,cx:t,cy:e,r:i});if((a+="")||a.length){s.setAttribute("cy",0),s.setAttribute("cx",0);var o=k("text",{className:"data-point-value",x:0,y:0,dy:Tt/2*-1-i+"px","font-size":Tt+"px","text-anchor":"middle",innerHTML:a}),l=k("g",{"data-point-index":r,transform:"translate("+t+", "+e+")"});return l.appendChild(s),l.appendChild(o),l}return s}(t.xPositions[n],i,t.radius,e.color,e.valuesOverPoints?t.values[n]:"",n)}))),Object.values(this.paths).concat(this.units)},animateElements:function(t){var e=t.xPositions,i=t.yPositions,n=t.values,a=this.oldData.xPositions,r=this.oldData.yPositions,s=this.oldData.values,o=v(a,e),l=pt(o,2);a=l[0],e=l[1];var u=v(r,i),c=pt(u,2);r=c[0],i=c[1];var h=v(s,n),d=pt(h,2);s=d[0],n=d[1],this.render({xPositions:a,yPositions:r,values:n,zeroLine:this.oldData.zeroLine,radius:this.oldData.radius});var f=[];return Object.keys(this.paths).length&&(f=f.concat(function(t,e,i,n,a){var r=[],s=i.map((function(t,i){return e[i]+","+t})).join("L");a&&(s=y(e,i));var o=[t.path,{d:"M"+s},$t,jt];if(r.push(o),t.region){var l=e[0]+","+n+"L",u="L"+e.slice(-1)[0]+", "+n,c=[t.region,{d:"M"+l+s+u},$t,jt];r.push(c)}return r}(this.paths,e,i,t.zeroLine,this.constants.spline))),this.units.length&&this.units.map((function(t,n){f=f.concat(function(t,e,i){return"circle"!==t.nodeName?[N(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,i],Yt)]:[[t,{cx:e,cy:i},Et,jt]]}(t,e[n],i[n]))})),f}}},Xt=function(t){function i(t,e){ut(this,i);var n=ft(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="percentage",n.setup(),n}return dt(i,t),ct(i,[{key:"setMeasures",value:function(t){var e=this.measures;this.barOptions=t.barOptions||{};var i=this.barOptions;i.height=i.height||20,i.depth=i.depth||yt,e.paddings.right=30,e.legendHeight=60,e.baseHeight=8*(i.height+.5*i.depth)}},{key:"setupComponents",value:function(){var t=this.state,e=[["percentageBars",{barHeight:this.barOptions.height,barDepth:this.barOptions.depth},function(){return{xPositions:t.xPositions,widths:t.widths,colors:this.colors}}.bind(this)]];this.components=new Map(e.map((function(t){var e=X.apply(void 0,vt(t));return[t[0],e]})))}},{key:"calc",value:function(){var t=this;ht(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;e.xPositions=[],e.widths=[];var n=0;e.sliceTotals.map((function(i){var a=t.width*i/e.grandTotal;e.widths.push(a),e.xPositions.push(n),n+=a}))}},{key:"makeDataByIndex",value:function(){}},{key:"bindTooltip",value:function(){var t=this,i=this.state;this.container.addEventListener("mousemove",(function(n){var a=t.components.get("percentageBars").store,r=n.target;if(a.includes(r)){var s=a.indexOf(r),o=e(t.container),l=e(r),u=l.left-o.left+parseInt(r.getAttribute("width"))/2,c=l.top-o.top,h=(t.formattedLabels&&t.formattedLabels.length>0?t.formattedLabels[s]:t.state.labels[s])+": ",d=i.sliceTotals[s]/i.grandTotal;t.tip.setValues(u,c,{name:h,value:(100*d).toFixed(1)+"%"}),t.tip.showTip()}}))}}]),i}(It),Zt=function(t){function i(t,e){ut(this,i);var n=ft(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="pie",n.initTimeout=0,n.init=1,n.setup(),n}return dt(i,t),ct(i,[{key:"configure",value:function(t){ht(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1}},{key:"calc",value:function(){var t=this;ht(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x:this.center.y;var n=this.radius,a=this.clockWise,r=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var s=180-this.config.startAngle;e.sliceTotals.map((function(i,o){var l=s,u=i/e.grandTotal*360,c=u>180?1:0,d=a?-u:u,f=s+=d,p=h(l,n),v=h(f,n),m=t.init&&r[o],g=void 0,y=void 0;t.init?(g=m?m.startPosition:p,y=m?m.endPosition:p):(g=p,y=v);var b=360===u?function(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=2*i.y,c=i.y+e.y;return"M"+i.x+" "+i.y+"\n\t\tL"+s+" "+o+"\n\t\tA "+n+" "+n+" 0 "+r+" "+(a?1:0)+"\n\t\t"+l+" "+u+" z\n\t\tL"+s+" "+u+"\n\t\tA "+n+" "+n+" 0 "+r+" "+(a?1:0)+"\n\t\t"+l+" "+c+" z"}(g,y,t.center,t.radius,a,c):function(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=i.y+e.y;return"M"+i.x+" "+i.y+"\n\t\tL"+s+" "+o+"\n\t\tA "+n+" "+n+" 0 "+r+" "+(a?1:0)+"\n\t\t"+l+" "+u+" z"}(g,y,t.center,t.radius,a,c);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:p,endPosition:v,value:i,total:e.grandTotal,startAngle:l,endAngle:f,angle:d})})),this.init=0}},{key:"setupComponents",value:function(){var t=this.state,e=[["pieSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors}}.bind(this)]];this.components=new Map(e.map((function(t){var e=X.apply(void 0,vt(t));return[t[0],e]})))}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,i=this.hoverRadio,n=h(t.startAngle+t.angle/2,e);return"translate3d("+n.x*i+"px,"+n.y*i+"px,0)"}},{key:"hoverSlice",value:function(t,i,n,a){if(t){var r=this.colors[i];if(n){W(t,this.calTranslateByAngle(this.state.slicesProperties[i])),t.style.fill=x(r,50);var s=e(this.svg),o=a.pageX-s.left+10,l=a.pageY-s.top-10,u=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[i]:this.state.labels[i])+": ",c=(100*this.state.sliceTotals[i]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:u,value:c+"%"}),this.tip.showTip()}else W(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.fill=r}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}},{key:"mouseMove",value:function(t){var e=t.target,i=this.components.get("pieSlices").store,n=this.curActiveSliceIndex,a=this.curActiveSlice;if(i.includes(e)){var r=i.indexOf(e);this.hoverSlice(a,n,!1),this.curActiveSlice=e,this.curActiveSliceIndex=r,this.hoverSlice(e,r,!0,t)}else this.mouseLeave()}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}]),i}(It),Kt=function(t){function e(t,i){ut(this,e);var n=ft(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));n.type="heatmap",n.countLabel=i.countLabel||"";var a=["Sunday","Monday"],r=a.includes(i.startSubDomain)?i.startSubDomain:"Sunday";return n.startSubDomainIndex=a.indexOf(r),n.setup(),n}return dt(e,t),ct(e,[{key:"setMeasures",value:function(t){var e=this.measures;this.discreteDomains=0===t.discreteDomains?0:1,e.paddings.top=36,e.paddings.bottom=0,e.legendHeight=24,e.baseHeight=12*Rt+s(e);var i=this.data,n=this.discreteDomains?12:0;this.independentWidth=12*(U(i.start,i.end)+n)+o(e)}},{key:"updateWidth",value:function(){var t=this.discreteDomains?12:0,e=this.state.noOfWeeks?this.state.noOfWeeks:52;this.baseWidth=12*(e+t)+o(this.measures)}},{key:"prepareData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;if(t.start&&t.end&&t.start>t.end)throw new Error("Start date cannot be greater than end date.");if(t.start||(t.start=new Date,t.start.setFullYear(t.start.getFullYear()-1)),t.end||(t.end=new Date),t.dataPoints=t.dataPoints||{},parseInt(Object.keys(t.dataPoints)[0])>1e5){var e={};Object.keys(t.dataPoints).forEach((function(i){var n=new Date(i*Ut);e[I(n)]=t.dataPoints[i]})),t.dataPoints=e}return t}},{key:"calc",value:function(){var t=this.state;t.start=R(this.data.start),t.end=R(this.data.end),t.firstWeekStart=R(t.start),t.noOfWeeks=U(t.start,t.end),t.distribution=function(t,e){for(var i=Math.max.apply(Math,vt(t)),n=1/(e-1),a=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:"",i=[t.getMonth(),t.getFullYear()],n=i[0],a=i[1],r=q(t),s={index:n,cols:[]};J(e=R(e)||G(n,a),1);for(var o=U(r,e),l=[],u=void 0,c=0;c2&&void 0!==arguments[2]&&arguments[2],n=this.state,a=R(t),r=[],s=0;s=n.start&&a<=n.end;i||a.getMonth()!==e||!l?o.yyyyMmDd=I(a):o=this.getSubDomainConfig(a),r.push(o)}return r}},{key:"getSubDomainConfig",value:function(t){var e=I(t),i=this.data.dataPoints[e];return{yyyyMmDd:e,dataValue:i||0,fill:this.colors[rt(i,this.state.distribution)]}}}]),e}(Ft),Qt=function(t){function i(t,e){ut(this,i);var n=ft(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.barOptions=e.barOptions||{},n.lineOptions=e.lineOptions||{},n.type=e.type||"line",n.init=1,n.setup(),n}return dt(i,t),ct(i,[{key:"setMeasures",value:function(){this.data.datasets.length<=1&&(this.config.showLegend=0,this.measures.paddings.bottom=30)}},{key:"configure",value:function(t){ht(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),t.axisOptions=t.axisOptions||{},t.tooltipOptions=t.tooltipOptions||{},this.config.xAxisMode=t.axisOptions.xAxisMode||"span",this.config.yAxisMode=t.axisOptions.yAxisMode||"span",this.config.xIsSeries=t.axisOptions.xIsSeries||0,this.config.shortenYAxisNumbers=t.axisOptions.shortenYAxisNumbers||0,this.config.formatTooltipX=t.tooltipOptions.formatTooltipX,this.config.formatTooltipY=t.tooltipOptions.formatTooltipY,this.config.valuesOverPoints=t.valuesOverPoints}},{key:"prepareData",value:function(){return st(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data,this.type)}},{key:"prepareFirstData",value:function(){return ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data)}},{key:"calc",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.calcXPositions(),t||this.calcYAxisParameters(this.getAllYValues(),"line"===this.type),this.makeDataByIndex()}},{key:"calcXPositions",value:function(){var t=this.state,e=this.data.labels;t.datasetLength=e.length,t.unitWidth=this.width/t.datasetLength,t.xOffset=t.unitWidth/2,t.xAxis={labels:e,positions:e.map((function(e,i){return l(t.xOffset+i*t.unitWidth)}))}}},{key:"calcYAxisParameters",value:function(t){var e=tt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"false"),i=this.height/nt(e),n=it(e)*i,a=this.height-et(e)*n;this.state.yAxis={labels:e,positions:e.map((function(t){return a-t*i})),scaleMultiplier:i,zeroLine:a},this.calcDatasetPoints(),this.calcYExtremes(),this.calcYRegions()}},{key:"calcDatasetPoints",value:function(){var t=this.state,e=function(e){return e.map((function(e){return at(e,t.yAxis)}))};t.datasets=this.data.datasets.map((function(t,i){var n=t.values,a=t.cumulativeYs||[];return{name:t.name&&t.name.replace(/<|>|&/g,(function(t){return"&"==t?"&":"<"==t?"<":">"})),index:i,chartType:t.chartType,values:n,yPositions:e(n),cumulativeYs:a,cumulativeYPos:e(a)}}))}},{key:"calcYExtremes",value:function(){var t=this.state;this.barOptions.stacked?t.yExtremes=t.datasets[t.datasets.length-1].cumulativeYPos:(t.yExtremes=new Array(t.datasetLength).fill(9999),t.datasets.map((function(e){e.yPositions.map((function(e,i){e1&&void 0!==arguments[1]?arguments[1]:[],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t/e.length;n<=0&&(n=1);var a=n/bt,r=void 0;if(i){var s=Math.max.apply(Math,vt(e.map((function(t){return t.length}))));r=Math.ceil(s/a)}return e.map((function(t,e){return(t+="").length>a&&(i?e%r!=0&&(t=""):t=a-3>0?t.slice(0,a-3)+" ...":t.slice(0,a)+".."),t}))}(this.width,t.xAxis.labels,this.config.xIsSeries),t.xAxis}.bind(this)],["yRegions",{width:this.width,pos:"right"},function(){return this.state.yRegions}.bind(this)]],i=this.state.datasets.filter((function(t){return"bar"===t.chartType})),n=this.state.datasets.filter((function(t){return"line"===t.chartType})),a=i.map((function(e){var n=e.index;return["barGraph-"+e.index,{index:n,color:t.colors[n],stacked:t.barOptions.stacked,valuesOverPoints:t.config.valuesOverPoints,minHeight:0*t.height},function(){var t=this.state,e=t.datasets[n],a=this.barOptions.stacked,r=this.barOptions.spaceRatio||.5,s=t.unitWidth*(1-r),o=s/(a?1:i.length),l=t.xAxis.positions.map((function(t){return t-s/2}));a||(l=l.map((function(t){return t+o*n})));var u=new Array(t.datasetLength).fill("");this.config.valuesOverPoints&&(u=a&&e.index===t.datasets.length-1?e.cumulativeYs:e.values);var c=new Array(t.datasetLength).fill(0);return a&&(c=e.yPositions.map((function(t,i){return t-e.cumulativeYPos[i]}))),{xPositions:l,yPositions:e.yPositions,offsets:c,labels:u,zeroLine:t.yAxis.zeroLine,barsWidth:s,barWidth:o}}.bind(t)]})),r=n.map((function(e){var i=e.index;return["lineGraph-"+e.index,{index:i,color:t.colors[i],svgDefs:t.svgDefs,heatline:t.lineOptions.heatline,regionFill:t.lineOptions.regionFill,spline:t.lineOptions.spline,hideDots:t.lineOptions.hideDots,hideLine:t.lineOptions.hideLine,valuesOverPoints:t.config.valuesOverPoints},function(){var t=this.state,e=t.datasets[i],n=t.yAxis.positions[0]a(n)?t.mapTooltipXPosition(o):t.tip.hideTip()}))}},{key:"mapTooltipXPosition",value:function(t){var e=this.state;if(e.yExtremes){var i=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.reduce((function(e,i){return Math.abs(i-t)=0){var n=this.dataByIndex[i];this.tip.setValues(n.xPos+this.tip.offset.x,n.yExtreme+this.tip.offset.y,{name:n.formattedLabel,value:""},n.values,i),this.tip.showTip()}}}},{key:"renderLegend",value:function(){var t=this,e=this.data;e.datasets.length>1&&(this.legendArea.textContent="",e.datasets.map((function(e,i){var n=function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",a=arguments[4];a=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?m(a,Ot):a;var r={className:"legend-bar",x:0,y:0,width:i,height:"2px",fill:n},s=k("text",{className:"legend-dataset-text",x:0,y:0,dy:2*Tt+"px","font-size":1.2*Tt+"px","text-anchor":"start",fill:Ct,innerHTML:a}),o=k("g",{transform:"translate("+t+", "+e+")"});return o.appendChild(k("rect",r)),o.appendChild(s),o}(100*i,"0",100,t.colors[i],e.name,t.config.truncateLegends);t.legendArea.appendChild(n)})))}},{key:"makeOverlay",value:function(){var t=this;this.init?this.init=0:(this.overlayGuides&&this.overlayGuides.forEach((function(t){var e=t.overlay;e.parentNode.removeChild(e)})),this.overlayGuides=this.dataUnitComponents.map((function(t){return{type:t.unitType,overlay:void 0,units:t.units}})),void 0===this.state.currentIndex&&(this.state.currentIndex=this.state.datasetLength-1),this.overlayGuides.map((function(e){var i=e.units[t.state.currentIndex];e.overlay=Nt[e.type](i),t.drawArea.appendChild(e.overlay)})))}},{key:"updateOverlayGuides",value:function(){this.overlayGuides&&this.overlayGuides.forEach((function(t){var e=t.overlay;e.parentNode.removeChild(e)}))}},{key:"bindOverlay",value:function(){var t=this;this.parent.addEventListener("data-select",(function(){t.updateOverlay()}))}},{key:"bindUnits",value:function(){var t=this;this.dataUnitComponents.map((function(e){e.units.map((function(e){e.addEventListener("click",(function(){var i=e.getAttribute("data-point-index");t.setCurrentDataPoint(i)}))}))})),this.tip.container.addEventListener("click",(function(){var e=t.tip.container.getAttribute("data-point-index");t.setCurrentDataPoint(e)}))}},{key:"updateOverlay",value:function(){var t=this;this.overlayGuides.map((function(e){var i=e.units[t.state.currentIndex];_t[e.type](i,e.overlay)}))}},{key:"onLeftArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex-1)}},{key:"onRightArrow",value:function(){this.setCurrentDataPoint(this.state.currentIndex+1)}},{key:"getDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentIndex,e=this.state;return{index:t,label:e.xAxis.labels[t],values:e.datasets.map((function(e){return e.values[t]}))}}},{key:"setCurrentDataPoint",value:function(t){var e=this.state;(t=parseInt(t))<0&&(t=0),t>=e.xAxis.labels.length&&(t=e.xAxis.labels.length-1),t!==e.currentIndex&&(e.currentIndex=t,function(t,e,i){var n=document.createEvent("HTMLEvents");for(var a in n.initEvent(e,!0,!0),i)n[a]=i[a];t.dispatchEvent(n)}(this.parent,"data-select",this.getDataPoint()))}},{key:"addDataPoint",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.state.datasetLength;ht(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"addDataPoint",this).call(this,t,e,n),this.data.labels.splice(n,0,t),this.data.datasets.map((function(t,i){t.values.splice(n,0,e[i])})),this.update(this.data)}},{key:"removeDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.datasetLength-1;this.data.labels.length<=1||(ht(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"removeDataPoint",this).call(this,t),this.data.labels.splice(t,1),this.data.datasets.map((function(e){e.values.splice(t,1)})),this.update(this.data))}},{key:"updateDataset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.data.datasets[e].values=t,this.update(this.data)}},{key:"updateDatasets",value:function(t){this.data.datasets.map((function(e,i){t[i]&&(e.values=t[i])})),this.update(this.data)}}]),i}(Ft),te=function(t){function i(t,e){ut(this,i);var n=ft(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t,e));return n.type="donut",n.initTimeout=0,n.init=1,n.setup(),n}return dt(i,t),ct(i,[{key:"configure",value:function(t){ht(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"configure",this).call(this,t),this.mouseMove=this.mouseMove.bind(this),this.mouseLeave=this.mouseLeave.bind(this),this.hoverRadio=t.hoverRadio||.1,this.config.startAngle=t.startAngle||0,this.clockWise=t.clockWise||!1,this.strokeWidth=t.strokeWidth||30}},{key:"calc",value:function(){var t=this;ht(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"calc",this).call(this);var e=this.state;this.radius=this.height>this.width?this.center.x-this.strokeWidth/2:this.center.y-this.strokeWidth/2;var n=this.radius,a=this.clockWise,r=e.slicesProperties||[];e.sliceStrings=[],e.slicesProperties=[];var s=180-this.config.startAngle;e.sliceTotals.map((function(i,o){var l=s,u=i/e.grandTotal*360,c=u>180?1:0,d=a?-u:u,f=s+=d,p=h(l,n),v=h(f,n),m=t.init&&r[o],g=void 0,y=void 0;t.init?(g=m?m.startPosition:p,y=m?m.endPosition:p):(g=p,y=v);var b=360===u?function(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=i.x+t.x,o=i.y+t.y,l=i.x+e.x,u=2*n+o;return"M"+s+" "+o+"\n\t\tA "+n+" "+n+" 0 "+r+" "+(a?1:0)+"\n\t\t"+l+" "+u+"\n\t\tM"+s+" "+u+"\n\t\tA "+n+" "+n+" 0 "+r+" "+(a?1:0)+"\n\t\t"+l+" "+(i.y+t.y)}(g,y,t.center,t.radius,t.clockWise,c):function(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return"M"+(i.x+t.x)+" "+(i.y+t.y)+"\n\t\tA "+n+" "+n+" 0 "+r+" "+(a?1:0)+"\n\t\t"+(i.x+e.x)+" "+(i.y+e.y)}(g,y,t.center,t.radius,t.clockWise,c);e.sliceStrings.push(b),e.slicesProperties.push({startPosition:p,endPosition:v,value:i,total:e.grandTotal,startAngle:l,endAngle:f,angle:d})})),this.init=0}},{key:"setupComponents",value:function(){var t=this.state,e=[["donutSlices",{},function(){return{sliceStrings:t.sliceStrings,colors:this.colors,strokeWidth:this.strokeWidth}}.bind(this)]];this.components=new Map(e.map((function(t){var e=X.apply(void 0,vt(t));return[t[0],e]})))}},{key:"calTranslateByAngle",value:function(t){var e=this.radius,i=this.hoverRadio,n=h(t.startAngle+t.angle/2,e);return"translate3d("+n.x*i+"px,"+n.y*i+"px,0)"}},{key:"hoverSlice",value:function(t,i,n,a){if(t){var r=this.colors[i];if(n){W(t,this.calTranslateByAngle(this.state.slicesProperties[i])),t.style.stroke=x(r,50);var s=e(this.svg),o=a.pageX-s.left+10,l=a.pageY-s.top-10,u=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[i]:this.state.labels[i])+": ",c=(100*this.state.sliceTotals[i]/this.state.grandTotal).toFixed(1);this.tip.setValues(o,l,{name:u,value:c+"%"}),this.tip.showTip()}else W(t,"translate3d(0,0,0)"),this.tip.hideTip(),t.style.stroke=r}}},{key:"bindTooltip",value:function(){this.container.addEventListener("mousemove",this.mouseMove),this.container.addEventListener("mouseleave",this.mouseLeave)}},{key:"mouseMove",value:function(t){var e=t.target,i=this.components.get("donutSlices").store,n=this.curActiveSliceIndex,a=this.curActiveSlice;if(i.includes(e)){var r=i.indexOf(e);this.hoverSlice(a,n,!1),this.curActiveSlice=e,this.curActiveSliceIndex=r,this.hoverSlice(e,r,!0,t)}else this.mouseLeave()}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}}]),i}(It),ee={bar:Qt,line:Qt,percentage:Xt,heatmap:Kt,pie:Zt,donut:te},ie=Object.freeze({Chart:function t(e,i){return ut(this,t),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"line",e=arguments[1],i=arguments[2];return"axis-mixed"===t?(i.type="line",new Qt(e,i)):ee[t]?new ee[t](e,i):void console.error("Undefined chart type: "+t)}(i.type,e,i)},PercentageChart:Xt,PieChart:Zt,Heatmap:Kt,AxisChart:Qt});return Object.assign({},{NAME:"Frappe Charts",VERSION:"1.6.2"},ie)}()},750:t=>{var e=function(t){"use strict";var e,i=Object.prototype,n=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function l(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,i){return t[e]=i}}function u(t,e,i,n){var a=e&&e.prototype instanceof m?e:m,r=Object.create(a.prototype),s=new O(n||[]);return r._invoke=function(t,e,i){var n=h;return function(a,r){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===a)throw r;return A()}for(i.method=a,i.arg=r;;){var s=i.delegate;if(s){var o=P(s,i);if(o){if(o===v)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===h)throw n=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=f;var l=c(t,e,i);if("normal"===l.type){if(n=i.done?p:d,l.arg===v)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n=p,i.method="throw",i.arg=l.arg)}}}(t,i,s),r}function c(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",v={};function m(){}function g(){}function y(){}var b={};l(b,r,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(T([])));w&&w!==i&&n.call(w,r)&&(b=w);var k=y.prototype=m.prototype=Object.create(b);function D(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function i(a,r,s,o){var l=c(t[a],t,r);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,o)}),(function(t){i("throw",t,s,o)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return i("throw",t,s,o)}))}o(l.arg)}var a;this._invoke=function(t,n){function r(){return new e((function(e,a){i(t,n,e,a)}))}return a=a?a.then(r,r):r()}}function P(t,i){var n=t.iterator[i.method];if(n===e){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=e,P(t,i),"throw"===i.method))return v;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var a=c(n,t.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,v;var r=a.arg;return r?r.done?(i[t.resultName]=r.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,v):r:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function T(t){if(t){var i=t[r];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,s=function i(){for(;++a=0;--r){var s=this.tryEntries[r],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),u=n.call(s,"finallyLoc");if(l&&u){if(this.prev=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),S(i),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var a=n.arg;S(i)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:T(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},e={};function i(n){var a=e[n];if(void 0!==a)return a.exports;var r=e[n]={exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n);const t=flarum.core.compat["admin/app"];var e=i.n(t);const a=flarum.core.compat["common/extend"],r=flarum.core.compat["admin/components/DashboardPage"];var s=i.n(r);function o(t,e,i,n,a,r,s){try{var o=t[r](s),l=o.value}catch(t){return void i(t)}o.done?e(l):Promise.resolve(l).then(n,a)}function l(t){return function(){var e=this,i=arguments;return new Promise((function(n,a){var r=t.apply(e,i);function s(t){o(r,n,a,s,l,"next",t)}function l(t){o(r,n,a,s,l,"throw",t)}s(void 0)}))}}function u(t,e){return u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},u(t,e)}function c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,u(t,e)}var h=i(126),d=i.n(h);const f=flarum.core.compat["admin/components/DashboardWidget"];var p=i.n(f);const v=flarum.core.compat["common/components/LoadingIndicator"];var g=i.n(v);const y=flarum.core.compat["common/components/Link"];var b=i.n(y);const x=flarum.core.compat["common/utils/abbreviateNumber"];var w=i.n(x),k=function(t){function i(){for(var e,i=arguments.length,n=new Array(i),a=0;a0?"up":"down")},$()("fas fa-arrow-"+(l>0?"up":"down")),Math.abs(l).toFixed(1),"%"))))}))),m("[",null,a?m("div",{key:"loading",className:"StatisticsWidget-chart","data-loading":"true"},m(g(),{size:"large"})):m("div",{key:"loaded",className:"StatisticsWidget-chart","data-loading":"false",oncreate:this.drawChart.bind(this),onupdate:this.drawChart.bind(this)})),this.noData&&m(_(),{text:e().translator.trans("flarum-statistics.admin.statistics.no_data")}))},n.drawChart=function(t){var i,n;if(!this.chart||this.chartEntity!==this.selectedEntity||this.chartPeriod!==this.selectedPeriod){for(var a="custom"===this.selectedPeriod?{start:null==(i=this.customPeriod)?void 0:i.start,end:null==(n=this.customPeriod)?void 0:n.end,step:86400}:this.periods[this.selectedPeriod],r=a.end-a.start,s=[],o=[],l=[],u=a.start;u86400&&(c+=" - "+R().unix(u+a.step-1).utc().format("D MMM"))),s.push(c),o.push(this.getPeriodCount(this.selectedEntity,{start:u,end:u+a.step})),l.push(this.getPeriodCount(this.selectedEntity,{start:u-r,end:u-r+a.step}))}if(0===o.length)return this.noData=!0,void m.redraw();this.noData=!1,m.redraw();var h={labels:s,datasets:[{values:l},{values:o}]};this.chart&&16&document.compareDocumentPosition(this.chart.parent)?this.chart.update(h):this.chart=new J.Chart(t.dom,{data:h,type:"line",height:280,axisOptions:{xAxisMode:"tick",yAxisMode:"span",xIsSeries:!0},lineOptions:{hideDots:1},colors:["black",e().forum.attribute("themePrimaryColor")]}),this.chartEntity=this.selectedEntity,this.chartPeriod=this.selectedPeriod}},n.changeEntity=function(t){this.selectedEntity=t},n.changePeriod=function(t){this.selectedPeriod=t},n.getTotalCount=function(t){return this.lifetimeData[t]},n.getPeriodCount=function(t,e){var i=("custom"===this.selectedPeriod?this.customPeriodData:this.timedData)[t],n=0;for(var a in i){var r=parseInt(a);r>=e.start&&r