@smallwebco/tinypivot-vue 1.0.51 → 1.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChartBuilder.vue.d.ts +24 -0
- package/dist/components/ChartBuilder.vue.d.ts.map +1 -0
- package/dist/components/DataGrid.vue.d.ts +3 -3
- package/dist/components/DataGrid.vue.d.ts.map +1 -1
- package/dist/components/PivotConfig.vue.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/composables/useLicense.d.ts +2 -0
- package/dist/composables/useLicense.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tinypivot-vue.js +14408 -2455
- package/dist/tinypivot-vue.js.map +1 -1
- package/dist/tinypivot-vue.umd.cjs +946 -7
- package/dist/tinypivot-vue.umd.cjs.map +1 -1
- package/package.json +4 -2
|
@@ -1,10 +1,949 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`)?`"${
|
|
3
|
-
`);
|
|
4
|
-
`);
|
|
5
|
-
`)}const
|
|
1
|
+
(function(we,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue"),require("@tanstack/vue-table")):typeof define=="function"&&define.amd?define(["exports","vue","@tanstack/vue-table"],c):(we=typeof globalThis<"u"?globalThis:we||self,c(we.TinyPivotVue={},we.Vue,we.VueTable))})(this,function(we,c,ya){"use strict";const _a=[{type:"bar",label:"Bar Chart",icon:"bar",description:"Compare values across categories",requiredFields:["dimension","measure"],optionalFields:["dimension"],guidance:"Drag a category to X-axis and a number to Y-axis",bestFor:["Comparing categories","Ranking","Part-to-whole"]},{type:"line",label:"Line Chart",icon:"line",description:"Show trends over time or sequence",requiredFields:["dimension","measure"],optionalFields:["dimension"],guidance:"Best with time/date on X-axis and numbers on Y-axis",bestFor:["Trends over time","Continuous data","Multiple series"]},{type:"area",label:"Area Chart",icon:"area",description:"Show magnitude and trends",requiredFields:["dimension","measure"],optionalFields:["dimension"],guidance:"Like line charts but emphasizes volume. Great for stacked comparisons.",bestFor:["Cumulative totals","Part-to-whole over time","Volume trends"]},{type:"pie",label:"Pie Chart",icon:"pie",description:"Show proportions of a whole",requiredFields:["dimension","measure"],optionalFields:[],guidance:"Drag a category and a number. Best with 2-6 categories.",bestFor:["Part-to-whole","Proportions","Simple distributions"]},{type:"donut",label:"Donut Chart",icon:"donut",description:"Proportions with center space for metrics",requiredFields:["dimension","measure"],optionalFields:[],guidance:"Like pie but allows showing a total in the center",bestFor:["Part-to-whole","Showing total","Dashboard KPIs"]},{type:"scatter",label:"Scatter Plot",icon:"scatter",description:"Show relationships between two variables",requiredFields:["measure","measure"],optionalFields:["dimension"],guidance:"Drag a number to X-axis and another number to Y-axis",bestFor:["Correlation","Outlier detection","Distribution"]},{type:"bubble",label:"Bubble Chart",icon:"bubble",description:"Three-dimensional comparison",requiredFields:["measure","measure"],optionalFields:["measure","dimension"],guidance:"Like scatter, plus drag a third number to Size for bubble size",bestFor:["Multi-variable comparison","Weighted relationships"]},{type:"heatmap",label:"Heatmap",icon:"heatmap",description:"Visualize density or intensity",requiredFields:["dimension","dimension","measure"],optionalFields:[],guidance:"Drag two categories (X and Y) and a number to Color",bestFor:["Patterns","Density","Cross-tabulation"]},{type:"radar",label:"Radar Chart",icon:"radar",description:"Compare multiple variables",requiredFields:["dimension","measure"],optionalFields:["dimension"],guidance:"Best for comparing items across multiple metrics",bestFor:["Multi-metric comparison","Performance profiles","Balanced scorecards"]}],wa=[{value:"sum",label:"Sum",symbol:"SUM"},{value:"count",label:"Count",symbol:"COUNT"},{value:"avg",label:"Average",symbol:"AVG"},{value:"min",label:"Minimum",symbol:"MIN"},{value:"max",label:"Maximum",symbol:"MAX"},{value:"countDistinct",label:"Count Distinct",symbol:"DISTINCT"}],qi=["#6366f1","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6","#f97316","#3b82f6"];function Qr(n,e){if(n.length===0)return"dimension";const a=n.slice(0,100).map(o=>o[e]).filter(o=>o!=null);if(a.length===0)return"dimension";let i=0,s=0;for(const o of a)(typeof o=="number"||!Number.isNaN(Number(o))&&o!==""&&typeof o!="boolean")&&i++,(o instanceof Date||typeof o=="string"&&!Number.isNaN(Date.parse(o))&&o.includes("-"))&&s++;const r=a.length*.8;return s>=r?"temporal":i>=r&&new Set(a.map(String)).size>Math.min(a.length*.3,20)?"measure":"dimension"}function en(n){if(n.length===0)return[];const e=Object.keys(n[0]),t=[];for(const a of e){const i=n.map(d=>d[a]).filter(d=>d!=null),s=Qr(n,a),r=new Set(i.map(String));let o="string",l,h;if(s==="measure"){o="number";const d=i.map(u=>Number(u)).filter(u=>!Number.isNaN(u));d.length>0&&(l=Math.min(...d),h=Math.max(...d))}else s==="temporal"?o="date":i.filter(u=>typeof u=="boolean"||u==="true"||u==="false").length>=i.length*.8&&(o="boolean");t.push({field:a,label:ja(a),role:s,dataType:o,uniqueCount:r.size,sampleValues:Array.from(r).slice(0,5),min:l,max:h})}return t}function ja(n){return n.replace(/([A-Z])/g," $1").replace(/[_-]/g," ").replace(/\s+/g," ").trim().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function Zi(n){return _a.find(e=>e.type===n)}function tn(n){if(!Zi(n.type))return!1;switch(n.type){case"bar":case"line":case"area":case"pie":case"donut":case"radar":return!!n.xAxis&&!!n.yAxis;case"scatter":return!!n.xAxis&&!!n.yAxis;case"bubble":return!!n.xAxis&&!!n.yAxis;case"heatmap":return!!n.xAxis&&!!n.yAxis&&!!n.colorField;default:return!1}}function an(n){const e=Zi(n.type);if(!e)return"Select a chart type to begin";if(!n.xAxis&&!n.yAxis)return e.guidance;switch(n.type){case"bar":case"line":case"area":return n.xAxis?n.yAxis?n.seriesField?"Chart is ready! Adjust options as needed.":"Optionally add a field to Color for grouped series":"Drag a number field to the Y-axis":"Drag a category field to the X-axis";case"pie":case"donut":return n.xAxis?n.yAxis?"Chart is ready!":"Drag a number field (values)":"Drag a category field (slices)";case"radar":return n.xAxis?n.yAxis?"Chart is ready!":"Drag a number field for values":"Drag a category field for axes";case"scatter":return n.xAxis?n.yAxis?n.seriesField?"Tip: Filter data first for clearer visualizations":"Optionally add a category to color points by group":"Drag a number field to Y-axis":"Drag a number field to X-axis";case"bubble":return n.xAxis?n.yAxis?n.sizeField?"Tip: Filter to fewer records for readable bubbles":"Drag a number field to Size for bubble size":"Drag a number field to Y-axis":"Drag a number field to X-axis";case"heatmap":return n.xAxis?n.yAxis?n.colorField?"Chart is ready!":"Drag a number field to Value for color intensity":"Drag a category field to Y-axis":"Drag a category field to X-axis";default:return e.guidance}}function Ga(n,e){if(n.length===0)return 0;switch(e){case"sum":return n.reduce((t,a)=>t+a,0);case"count":return n.length;case"avg":return n.reduce((t,a)=>t+a,0)/n.length;case"min":return Math.min(...n);case"max":return Math.max(...n);case"countDistinct":return new Set(n).size;default:return n.reduce((t,a)=>t+a,0)}}function Ki(n,e){var d;if(!e.xAxis||!e.yAxis||n.length===0)return{categories:[],series:[]};const t=e.xAxis.field,a=e.yAxis.field,i=e.yAxis.aggregation||"sum",s=(d=e.seriesField)==null?void 0:d.field,r=new Map;for(const u of n){const g=String(u[t]??"(blank)"),p=Number(u[a]),f=s?String(u[s]??"(blank)"):"_default";if(Number.isNaN(p))continue;r.has(g)||r.set(g,new Map);const m=r.get(g);m.has(f)||m.set(f,[]),m.get(f).push(p)}const o=Array.from(r.keys()).sort((u,g)=>{const p=Number.parseFloat(u),f=Number.parseFloat(g);return!Number.isNaN(p)&&!Number.isNaN(f)?p-f:u.localeCompare(g)}),l=new Set;for(const u of r.values())for(const g of u.keys())l.add(g);const h=[];for(const u of l){const g=[];for(const p of o){const f=r.get(p),m=(f==null?void 0:f.get(u))||[];g.push(Ga(m,i))}h.push({name:u==="_default"?ja(a):u,data:g})}return{categories:o,series:h}}function Ji(n,e){if(!e.xAxis||!e.yAxis||n.length===0)return{categories:[],series:[]};const t=e.xAxis.field,a=e.yAxis.field,i=e.yAxis.aggregation||"sum",s=new Map;for(const o of n){const l=String(o[t]??"(blank)"),h=Number(o[a]);Number.isNaN(h)||(s.has(l)||s.set(l,[]),s.get(l).push(h))}const r=Array.from(s.entries()).map(([o,l])=>({category:o,value:Ga(l,i)})).sort((o,l)=>l.value-o.value);return{categories:r.map(o=>o.category),series:[{name:ja(a),data:r.map(o=>o.value)}]}}function sn(n,e){var l,h;if(!e.xAxis||!e.yAxis||n.length===0)return{series:[]};const t=e.xAxis.field,a=e.yAxis.field,i=(l=e.sizeField)==null?void 0:l.field,s=(h=e.seriesField)==null?void 0:h.field,r=new Map;for(const d of n){const u=Number(d[t]),g=Number(d[a]);if(Number.isNaN(u)||Number.isNaN(g))continue;const p={x:u,y:g};if(i){const m=Number(d[i]);Number.isNaN(m)||(p.z=m)}const f=s?String(d[s]??"(blank)"):"_default";r.has(f)||r.set(f,[]),r.get(f).push(p)}return{series:Array.from(r.entries()).map(([d,u])=>{var g;return{name:d==="_default"?((g=e.yAxis)==null?void 0:g.label)||"Data":d,data:u}})}}function rn(n,e){if(!e.xAxis||!e.yAxis||!e.colorField||n.length===0)return{series:[]};const t=e.xAxis.field,a=e.yAxis.field,i=e.colorField.field,s=e.colorField.aggregation||"sum",r=new Map,o=new Set;for(const u of n){const g=String(u[t]??"(blank)"),p=String(u[a]??"(blank)"),f=Number(u[i]);if(Number.isNaN(f))continue;o.add(g),r.has(p)||r.set(p,new Map);const m=r.get(p);m.has(g)||m.set(g,[]),m.get(g).push(f)}const l=Array.from(o).sort((u,g)=>{const p=Number.parseFloat(u),f=Number.parseFloat(g);return!Number.isNaN(p)&&!Number.isNaN(f)?p-f:u.localeCompare(g)});return{series:Array.from(r.keys()).sort((u,g)=>{const p=Number.parseFloat(u),f=Number.parseFloat(g);return!Number.isNaN(p)&&!Number.isNaN(f)?p-f:u.localeCompare(g)}).map(u=>{const g=r.get(u),p=l.map(f=>{const m=g.get(f)||[],x=m.length>0?Ga(m,s):0;return{x:f,y:x}});return{name:u,data:p}})}}function nn(){return{type:"bar",options:{showDataLabels:!1,showLegend:!0,legendPosition:"top",animated:!0,colors:qi,showGrid:!0,enableZoom:!1,stacked:!1}}}function Ge(n,e=","){if(n==null)return"";const t=String(n);return t.includes(e)||t.includes('"')||t.includes(`
|
|
2
|
+
`)?`"${t.replace(/"/g,'""')}"`:t}function on(n,e,t={}){const{filename:a="export.csv",includeHeaders:i=!0,delimiter:s=","}=t,r=[];i&&r.push(e.map(l=>Ge(l,s)).join(s));for(const l of n){const h=e.map(d=>Ge(l[d],s));r.push(h.join(s))}const o=r.join(`
|
|
3
|
+
`);Qi(o,a,"text/csv;charset=utf-8;")}function ln(n,e,t,a,i={}){const{filename:s="pivot-export.csv",delimiter:r=","}=i,o=[],{headers:l,rowHeaders:h,data:d,rowTotals:u,columnTotals:g,grandTotal:p,showRowTotals:f,showColumnTotals:m}=n,x=e.length||1;if(l.length>0)for(let v=0;v<l.length;v++){const w=[];for(let k=0;k<x;k++)w.push(v===l.length-1?Ge(e[k]||"",r):"");for(const k of l[v])w.push(Ge(k,r));if(f&&u&&u.length>0)if(v===l.length-1)for(const k of a)w.push(Ge(`Total (${k.aggregation})`,r));else for(let k=0;k<a.length;k++)w.push("");o.push(w.join(r))}else{const v=[];for(let w=0;w<x;w++)v.push(Ge(e[w]||"",r));for(const w of a)v.push(Ge(`${w.field} (${w.aggregation})`,r));f&&u&&u.length>0&&v.push(Ge("Total",r)),o.push(v.join(r))}for(let v=0;v<h.length;v++){const w=[],k=h[v]||[];for(let E=0;E<x;E++)w.push(Ge(k[E]||"",r));const y=d[v]||[];for(const E of y)w.push(Ge((E==null?void 0:E.formattedValue)||"",r));f&&u&&u[v]&&w.push(Ge(u[v].formattedValue||"",r)),o.push(w.join(r))}if(m&&g&&g.length>0){const v=[];v.push(Ge("Total",r));for(let w=1;w<x;w++)v.push("");for(const w of g)v.push(Ge((w==null?void 0:w.formattedValue)||"",r));f&&p&&v.push(Ge(p.formattedValue||"",r)),o.push(v.join(r))}const b=o.join(`
|
|
4
|
+
`);Qi(b,s,"text/csv;charset=utf-8;")}function Qi(n,e,t){const a=new Blob([n],{type:t}),i=URL.createObjectURL(a),s=document.createElement("a");s.href=i,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)}function cn(n,e,t){navigator.clipboard.writeText(n).then(e).catch(t)}function hn(n,e,t){const{minRow:a,maxRow:i,minCol:s,maxCol:r}=t,o=[];for(let l=a;l<=i;l++){const h=n[l];if(!h)continue;const d=[];for(let u=s;u<=r;u++){const g=e[u];if(!g)continue;const p=h[g];d.push(p==null?"":String(p))}o.push(d.join(" "))}return o.join(`
|
|
5
|
+
`)}const es={type:"free",isValid:!0,features:{pivot:!0,advancedAggregations:!1,percentageMode:!1,sessionPersistence:!1,noWatermark:!1,charts:!1}},ka={type:"free",isValid:!1,features:{pivot:!0,advancedAggregations:!1,percentageMode:!1,sessionPersistence:!1,noWatermark:!1,charts:!1}},dn={type:"free",isValid:!0,features:{pivot:!0,advancedAggregations:!0,percentageMode:!0,sessionPersistence:!0,noWatermark:!1,charts:!0}},un=`-----BEGIN PUBLIC KEY-----
|
|
6
6
|
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE436rfGofder4lfo4UHsRF2M88Gs0
|
|
7
7
|
zLsikg2H9GMkL8hLGuOtnGMpVfLRlc7cD8FdkPBBRgiQ8UFnG8hm+nMIug==
|
|
8
|
-
-----END PUBLIC KEY-----`;function it(t){let r=t.replace(/-/g,"+").replace(/_/g,"/");for(;r.length%4;)r+="=";const l=atob(r),a=new Uint8Array(l.length);for(let o=0;o<l.length;o++)a[o]=l.charCodeAt(o);return a}function Xt(t){if(t[0]!==48)throw new Error("Invalid DER signature");let r=2;if(t[r]!==2)throw new Error("Invalid DER signature");r++;const l=t[r];r++;let a=t.slice(r,r+l);if(r+=l,t[r]!==2)throw new Error("Invalid DER signature");r++;const o=t[r];r++;let s=t.slice(r,r+o);a.length===33&&a[0]===0&&(a=a.slice(1)),s.length===33&&s[0]===0&&(s=s.slice(1));const p=new Uint8Array(32),f=new Uint8Array(32);p.set(a,32-a.length),f.set(s,32-s.length);const k=new Uint8Array(64);return k.set(p,0),k.set(f,32),k}async function Zt(){try{const t=It.replace("-----BEGIN PUBLIC KEY-----","").replace("-----END PUBLIC KEY-----","").replace(/\s/g,""),r=it(t);return await crypto.subtle.importKey("spki",new Uint8Array(r).buffer,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}catch{return null}}async function Qt(t,r,l){const a=`TP-${t}-${l}`;try{const o=await Zt();if(!o)return!1;const p=new TextEncoder().encode(a),f=it(r),k=Xt(f);return await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},o,new Uint8Array(k).buffer,p)}catch{return!1}}async function Jt(t){if(!t||t==="")return st;if(!t.startsWith("TP-"))return _e;const r=t.lastIndexOf("-");if(r===-1||t.length-r!==9)return _e;const l=t.slice(r+1),a=t.slice(3),o=a.indexOf("-");if(o===-1)return _e;const s=a.slice(0,o),p=a.slice(o+1,a.lastIndexOf("-"));if(!await Qt(s,p,l))return _e;const k=Number.parseInt(l.slice(0,4)),b=Number.parseInt(l.slice(4,6))-1,E=Number.parseInt(l.slice(6,8)),S=new Date(k,b,E);let F="free";return s==="PRO1"?F="pro-single":s==="PROU"?F="pro-unlimited":s==="PROT"&&(F="pro-team"),{type:F,isValid:!0,expiresAt:S,features:{pivot:F!=="free",advancedAggregations:F!=="free",percentageMode:F!=="free",sessionPersistence:F!=="free",noWatermark:F!=="free"}}}function el(t){console.warn("[TinyPivot] configureLicenseSecret() is deprecated and no longer needed.")}const tl="A48AA0618518D3E62F31FCFCA2DD2B86E7FE0863E2F90756FB0A960AE7A51583";async function ll(t){try{const l=new TextEncoder().encode(t),a=await crypto.subtle.digest("SHA-256",l);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("").toUpperCase()}catch{return""}}async function nl(t){return!t||await ll(t)!==tl?null:Yt}function ol(){return st}function al(t){return t.features.pivot}function rl(t){return t.isValid&&t.type!=="free"}function sl(t,r){return r||!t.features.noWatermark}function il(t){console.warn(`[TinyPivot] "${t}" requires a Pro license. Visit https://tiny-pivot.com/#pricing to upgrade.`)}function cl(t){const r=t.filter(f=>f!=null&&f!=="");if(r.length===0)return"string";const l=r.slice(0,100);let a=0,o=0,s=0;for(const f of l)typeof f=="boolean"?s++:typeof f=="number"||!Number.isNaN(Number(f))&&f!==""?a++:(f instanceof Date||!Number.isNaN(Date.parse(String(f))))&&o++;const p=l.length*.8;return s>=p?"boolean":a>=p?"number":o>=p?"date":"string"}function dl(t,r){const a=t.map(f=>f[r]).filter(f=>f!=null&&f!=="").slice(0,100);let o=0;const s=new Set;for(const f of a)s.add(String(f)),(typeof f=="number"||!Number.isNaN(Number(f))&&f!=="")&&o++;const p=o>=a.length*.8;return{field:r,type:p?"number":"string",uniqueCount:s.size,isNumeric:p}}function ct(t,r,l=500){const a=[];let o=0,s,p;for(const E of t){const S=E[r];if(S==null||S==="")o++;else{a.push(S);const F=typeof S=="number"?S:Number.parseFloat(String(S));Number.isNaN(F)||((s===void 0||F<s)&&(s=F),(p===void 0||F>p)&&(p=F))}}const f=new Set;for(const E of a)if(f.add(String(E)),f.size>=l)break;const k=Array.from(f).sort((E,S)=>{const F=Number.parseFloat(E),N=Number.parseFloat(S);return!Number.isNaN(F)&&!Number.isNaN(N)?F-N:E.localeCompare(S)}),b=cl(a);return{uniqueValues:k,totalCount:t.length,nullCount:o,type:b,...b==="number"&&s!==void 0&&p!==void 0?{numericMin:s,numericMax:p}:{}}}function dt(t,r){if(t==null||t==="")return"";switch(r){case"number":{const l=typeof t=="number"?t:Number.parseFloat(String(t));return Number.isNaN(l)?String(t):Math.abs(l)>=1e3?l.toLocaleString("en-US",{maximumFractionDigits:2}):l.toLocaleString("en-US",{maximumFractionDigits:4})}case"date":{const l=t instanceof Date?t:new Date(String(t));return Number.isNaN(l.getTime())?String(t):l.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}case"boolean":return t?"Yes":"No";default:return String(t)}}function ut(t,r){return r.map(l=>String(t[l]??"(blank)")).join("|||")}function mt(t){return t.split("|||")}function ul(t){const r=[...t].sort((a,o)=>a-o),l=Math.floor(r.length/2);return r.length%2!==0?r[l]:(r[l-1]+r[l])/2}function ml(t){const r=t.reduce((o,s)=>o+s,0)/t.length,a=t.map(o=>(o-r)**2).reduce((o,s)=>o+s,0)/t.length;return Math.sqrt(a)}function Ye(t,r,l,a,o){if(t.length===0&&r!=="custom")return null;switch(r){case"sum":return t.reduce((s,p)=>s+p,0);case"count":return t.length;case"avg":return t.reduce((s,p)=>s+p,0)/t.length;case"min":return Math.min(...t);case"max":return Math.max(...t);case"countDistinct":return new Set(t).size;case"median":return ul(t);case"stdDev":return ml(t);case"percentOfTotal":{const s=t.reduce((p,f)=>p+f,0);return l===void 0||l===0?null:s/l*100}case"custom":return null;default:return t.reduce((s,p)=>s+p,0)}}function Ie(t,r){return t===null?"-":r==="count"||r==="countDistinct"?Math.round(t).toLocaleString():r==="percentOfTotal"?`${t.toFixed(1)}%`:r==="stdDev"?t.toLocaleString("en-US",{maximumFractionDigits:2}):Math.abs(t)>=1e3?t.toLocaleString("en-US",{maximumFractionDigits:2}):t.toLocaleString("en-US",{maximumFractionDigits:4})}function je(t,r){return t==="custom"&&r?r:{sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max",countDistinct:"Count Distinct",median:"Median",stdDev:"Std Dev",percentOfTotal:"% of Total",custom:"Custom"}[t]}function gt(t,r){return t==="custom"&&r?r:{sum:"Σ",count:"#",avg:"x̄",min:"↓",max:"↑",countDistinct:"◇",median:"M̃",stdDev:"σ",percentOfTotal:"%Σ",custom:"ƒ"}[t]}const gl=[{value:"sum",label:"Sum",symbol:"Σ"},{value:"count",label:"Count",symbol:"#"},{value:"avg",label:"Avg",symbol:"x̄"},{value:"min",label:"Min",symbol:"↓"},{value:"max",label:"Max",symbol:"↑"},{value:"countDistinct",label:"Unique",symbol:"◇"},{value:"median",label:"Median",symbol:"M̃"},{value:"stdDev",label:"Std Dev",symbol:"σ"},{value:"percentOfTotal",label:"% of Total",symbol:"%Σ"}];function pl(t,r,l=2){if(t===null)return"-";switch(r){case"percent":return`${t.toFixed(l)}%`;case"currency":return t.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:l,maximumFractionDigits:l});default:return t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:l})}}function pt(t){const r=t.match(/[a-z_]\w*/gi)||[],l=["true","false","null","undefined"];return[...new Set(r.filter(a=>!l.includes(a.toLowerCase())))]}function ft(t,r){if(!t.trim())return"Formula is required";const l=pt(t);if(l.length===0)return"Formula must reference at least one field";const a=r.map(o=>o.toLowerCase());for(const o of l)if(!a.includes(o.toLowerCase()))return`Unknown field: ${o}`;try{let o=t;for(const s of l){const p=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o=o.replace(new RegExp(`\\b${p}\\b`,"gi"),"1")}new Function(`return ${o}`)}catch{return"Invalid formula syntax"}return null}function vt(t,r,l){try{const a=pt(t);let o=t;for(const p of a){const f=l.find(S=>S.toLowerCase()===p.toLowerCase())||p,k=r[f];if(k==null||k==="")return null;const b=typeof k=="number"?k:Number.parseFloat(String(k));if(Number.isNaN(b))return null;const E=p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o=o.replace(new RegExp(`\\b${E}\\b`,"gi"),String(b))}if(!/^[\d\s+\-*/().]+$/.test(o))return null;const s=new Function(`return ${o}`)();return typeof s=="number"&&Number.isFinite(s)?s:null}catch{return null}}function fl(t){return t.length===0?[]:Object.keys(t[0]).map(l=>dl(t,l))}function vl(t,r,l,a){const o=new Set([...r,...l,...a.map(s=>s.field)]);return t.filter(s=>!o.has(s.field))}function ht(t){return(t.rowFields.length>0||t.columnFields.length>0)&&t.valueFields.length>0}function hl(t,r){const{rowFields:l,columnFields:a,valueFields:o,showRowTotals:s,showColumnTotals:p,calculatedFields:f}=r;if(!ht(r)||t.length===0)return null;const k=new Map;if(f)for(const R of f)k.set(R.id,R);const b=t.length>0?Object.keys(t[0]):[],E=new Set,S=new Set,F=new Map;for(const R of t){const C=l.length>0?ut(R,l):"__all__",g=a.length>0?ut(R,a):"__all__";E.add(C),S.add(g),F.has(C)||F.set(C,new Map);const d=F.get(C);d.has(g)||d.set(g,o.map(()=>[]));const c=d.get(g);for(let u=0;u<o.length;u++){const V=o[u];let $=null;if(V.field.startsWith("calc:")){const j=V.field.replace("calc:",""),J=k.get(j);J&&($=vt(J.formula,R,b))}else{const j=R[V.field];j!=null&&j!==""&&($=typeof j=="number"?j:Number.parseFloat(String(j)),Number.isNaN($)&&($=V.aggregation==="count"||V.aggregation==="countDistinct"?1:null))}$!==null&&c[u].push($)}}const N=Array.from(E).sort(),w=Array.from(S).sort(),z=o.map((R,C)=>{let g=0;for(const d of t){let c=null;if(R.field.startsWith("calc:")){const u=R.field.replace("calc:",""),V=k.get(u);V&&(c=vt(V.formula,d,b))}else{const u=d[R.field];u!=null&&u!==""&&(c=typeof u=="number"?u:Number.parseFloat(String(u)),Number.isNaN(c)&&(c=null))}c!==null&&(g+=c)}return g});function W(R){if(R.field.startsWith("calc:")){const C=R.field.replace("calc:",""),g=k.get(C);return`${(g==null?void 0:g.name)||R.field} (${je(R.aggregation)})`}return`${R.label||R.field} (${je(R.aggregation)})`}const H=[];if(a.length>0){const R=o.length>1?o.length:1;for(let C=0;C<a.length;C++){const g=[];for(const d of w){const c=mt(d);for(let u=0;u<R;u++)g.push(c[C]||"")}H.push(g)}}if(o.length>1||H.length===0){const R=[];for(const C of w)for(const g of o)R.push(W(g));w.length===1&&w[0]==="__all__"?H.push(o.map(C=>W(C))):H.push(R)}const P=N.map(R=>R==="__all__"?["Total"]:mt(R)),M=[],x=[],T=new Map;for(const R of N){const C=[],g=o.map(()=>[]);for(const d of w){const c=F.get(R),u=(c==null?void 0:c.get(d))||o.map(()=>[]);for(let $=0;$<u.length;$++)g[$].push(...u[$]);T.has(d)||T.set(d,o.map(()=>[]));const V=T.get(d);for(let $=0;$<u.length;$++)V[$].push(...u[$]);for(let $=0;$<o.length;$++){const j=o[$],J=u[$]||[],se=z[$],ve=Ye(J,j.aggregation,se);let ae;if(j.field.startsWith("calc:")){const Me=j.field.replace("calc:",""),ie=k.get(Me);ae=pl(ve,(ie==null?void 0:ie.formatAs)||"number",(ie==null?void 0:ie.decimals)??2)}else ae=Ie(ve,j.aggregation);C.push({value:ve,count:J.length,formattedValue:ae})}}if(M.push(C),s&&w.length>1)if(o.length>0){const d=o[0],c=g[0]||[],u=Ye(c,d.aggregation,z[0]);x.push({value:u,count:c.length,formattedValue:Ie(u,d.aggregation)})}else x.push({value:null,count:0,formattedValue:"-"})}const U=[];if(p&&N.length>1)for(const R of w){const C=T.get(R)||o.map(()=>[]);for(let g=0;g<o.length;g++){const d=o[g],c=C[g]||[],u=Ye(c,d.aggregation,z[g]);U.push({value:u,count:c.length,formattedValue:Ie(u,d.aggregation)})}}const _={value:null,count:0,formattedValue:"-"};if(s&&p&&o.length>0){const R=o.map(()=>[]);for(const c of N){const u=F.get(c);if(u)for(const V of w){const $=u.get(V);if($)for(let j=0;j<$.length;j++)R[j].push(...$[j])}}const C=o[0],g=R[0]||[],d=Ye(g,C.aggregation,z[0]);_.value=d,_.count=g.length,_.formattedValue=Ie(d,C.aggregation)}return{headers:H,rowHeaders:P,data:M,rowTotals:x,columnTotals:U,grandTotal:_}}const kl="vpg-pivot-";function wl(t){const l=[...t].sort().join("|").substring(0,100);return`${kl}${l}`}function Vl(t,r){try{sessionStorage.setItem(t,JSON.stringify(r))}catch{}}function El(t){try{const r=sessionStorage.getItem(t);if(r)return JSON.parse(r)}catch{}return null}function tt(t,r){const l=new Set(r);return[...t.rowFields,...t.columnFields,...t.valueFields.map(o=>o.field)].filter(o=>!o.startsWith("calc:")).every(o=>l.has(o))}const kt="vpg-calculated-fields";function He(t){try{localStorage.setItem(kt,JSON.stringify(t))}catch{}}function wt(){try{const t=localStorage.getItem(kt);if(t)return JSON.parse(t)}catch{}return[]}function Xe(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&("min"in t||"max"in t)}const Cl={class:"vpg-modal"},Nl={class:"vpg-modal-header"},yl={class:"vpg-modal-body"},bl={class:"vpg-form-group"},Fl={class:"vpg-form-group"},Sl={key:0,class:"vpg-error"},Bl={class:"vpg-form-group"},xl={class:"vpg-button-group"},Ml={class:"vpg-form-group"},$l={key:0,class:"vpg-button-group vpg-field-buttons"},Dl=["onClick"],Rl={key:1,class:"vpg-no-fields"},Tl={class:"vpg-form-row"},Ll={class:"vpg-form-group vpg-form-group-half"},zl={class:"vpg-form-group vpg-form-group-half"},Al={key:0,class:"vpg-error vpg-error-box"},Pl={class:"vpg-modal-footer"},Ul=e.defineComponent({__name:"CalculatedFieldModal",props:{show:{type:Boolean},availableFields:{},existingField:{}},emits:["close","save"],setup(t,{emit:r}){const l=t,a=r,o=e.ref(""),s=e.ref(""),p=e.ref("number"),f=e.ref(2),k=e.ref(null);e.watch(()=>l.show,N=>{N&&(l.existingField?(o.value=l.existingField.name,s.value=l.existingField.formula,p.value=l.existingField.formatAs||"number",f.value=l.existingField.decimals??2):(o.value="",s.value="",p.value="number",f.value=2),k.value=null)});const b=e.computed(()=>s.value.trim()?ft(s.value,l.availableFields):null);function E(N){s.value.trim()&&!s.value.endsWith(" ")&&(s.value+=" "),s.value+=N}function S(N){s.value.trim()&&!s.value.endsWith(" ")&&(s.value+=" "),s.value+=`${N} `}function F(){var z;if(!o.value.trim()){k.value="Name is required";return}const N=ft(s.value,l.availableFields);if(N){k.value=N;return}const w={id:((z=l.existingField)==null?void 0:z.id)||`calc_${Date.now()}`,name:o.value.trim(),formula:s.value.trim(),formatAs:p.value,decimals:f.value};a("save",w),a("close")}return(N,w)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vpg-modal-overlay",onClick:w[12]||(w[12]=e.withModifiers(z=>a("close"),["self"]))},[e.createElementVNode("div",Cl,[e.createElementVNode("div",Nl,[e.createElementVNode("h3",null,e.toDisplayString(t.existingField?"Edit":"Create")+" Calculated Field",1),e.createElementVNode("button",{class:"vpg-modal-close",onClick:w[0]||(w[0]=z=>a("close"))}," × ")]),e.createElementVNode("div",yl,[e.createElementVNode("div",bl,[w[13]||(w[13]=e.createElementVNode("label",{class:"vpg-label"},"Name",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":w[1]||(w[1]=z=>o.value=z),type:"text",class:"vpg-input",placeholder:"e.g., Profit Margin %"},null,512),[[e.vModelText,o.value]])]),e.createElementVNode("div",Fl,[w[14]||(w[14]=e.createElementVNode("label",{class:"vpg-label"},"Formula",-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":w[2]||(w[2]=z=>s.value=z),class:"vpg-textarea",placeholder:"e.g., revenue / units",rows:"2"},null,512),[[e.vModelText,s.value]]),w[15]||(w[15]=e.createElementVNode("div",{class:"vpg-formula-hint"}," Use field names with math operators: + - * / ( ) ",-1)),b.value?(e.openBlock(),e.createElementBlock("div",Sl,e.toDisplayString(b.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bl,[w[16]||(w[16]=e.createElementVNode("label",{class:"vpg-label-small"},"Operators",-1)),e.createElementVNode("div",xl,[e.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:w[3]||(w[3]=z=>S("+"))}," + "),e.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:w[4]||(w[4]=z=>S("-"))}," − "),e.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:w[5]||(w[5]=z=>S("*"))}," × "),e.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:w[6]||(w[6]=z=>S("/"))}," ÷ "),e.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:w[7]||(w[7]=z=>S("("))}," ( "),e.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:w[8]||(w[8]=z=>S(")"))}," ) ")])]),e.createElementVNode("div",Ml,[w[17]||(w[17]=e.createElementVNode("label",{class:"vpg-label-small"},"Insert Field",-1)),t.availableFields.length>0?(e.openBlock(),e.createElementBlock("div",$l,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.availableFields,z=>(e.openBlock(),e.createElementBlock("button",{key:z,class:"vpg-insert-btn vpg-field-btn",onClick:W=>E(z)},e.toDisplayString(z),9,Dl))),128))])):(e.openBlock(),e.createElementBlock("div",Rl," No numeric fields available "))]),e.createElementVNode("div",Tl,[e.createElementVNode("div",Ll,[w[19]||(w[19]=e.createElementVNode("label",{class:"vpg-label"},"Format As",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":w[9]||(w[9]=z=>p.value=z),class:"vpg-select"},[...w[18]||(w[18]=[e.createElementVNode("option",{value:"number"}," Number ",-1),e.createElementVNode("option",{value:"percent"}," Percentage ",-1),e.createElementVNode("option",{value:"currency"}," Currency ($) ",-1)])],512),[[e.vModelSelect,p.value]])]),e.createElementVNode("div",zl,[w[20]||(w[20]=e.createElementVNode("label",{class:"vpg-label"},"Decimals",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":w[10]||(w[10]=z=>f.value=z),type:"number",class:"vpg-input",min:"0",max:"6"},null,512),[[e.vModelText,f.value,void 0,{number:!0}]])])]),k.value?(e.openBlock(),e.createElementBlock("div",Al,e.toDisplayString(k.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pl,[e.createElementVNode("button",{class:"vpg-btn vpg-btn-secondary",onClick:w[11]||(w[11]=z=>a("close"))}," Cancel "),e.createElementVNode("button",{class:"vpg-btn vpg-btn-primary",onClick:F},e.toDisplayString(t.existingField?"Update":"Add")+" Field ",1)])])])):e.createCommentVNode("",!0)]))}}),xe=(t,r)=>{const l=t.__vccOpts||t;for(const[a,o]of r)l[a]=o;return l},jl=xe(Ul,[["__scopeId","data-v-a29541ff"]]),Hl={class:"vpg-range-filter"},Kl={class:"vpg-range-info"},Ol={class:"vpg-range-bounds"},Wl={class:"vpg-slider-container"},ql={class:"vpg-slider-track"},Gl=["min","max","step","value"],_l=["min","max","step","value"],Yl={class:"vpg-range-inputs"},Il={class:"vpg-input-group"},Xl=["placeholder","value","step"],Zl={class:"vpg-input-group"},Ql=["placeholder","value","step"],Jl={class:"vpg-range-actions"},en=["disabled"],tn={key:0,class:"vpg-filter-summary"},ln=xe(e.defineComponent({__name:"NumericRangeFilter",props:{dataMin:{},dataMax:{},currentRange:{}},emits:["change"],setup(t,{emit:r}){var P,M;const l=t,a=r,o=e.ref(((P=l.currentRange)==null?void 0:P.min)??null),s=e.ref(((M=l.currentRange)==null?void 0:M.max)??null),p=e.computed(()=>{const x=l.dataMax-l.dataMin;return x===0?1:x<=1?.01:x<=10?.1:x<=100?1:x<=1e3?10:10**(Math.floor(Math.log10(x))-2)});function f(x){return x===null?"":Number.isInteger(x)?x.toLocaleString():x.toLocaleString(void 0,{maximumFractionDigits:2})}const k=e.computed(()=>o.value!==null||s.value!==null),b=e.computed(()=>o.value===null||l.dataMax===l.dataMin?0:(o.value-l.dataMin)/(l.dataMax-l.dataMin)*100),E=e.computed(()=>s.value===null||l.dataMax===l.dataMin?100:(s.value-l.dataMin)/(l.dataMax-l.dataMin)*100);function S(x){const T=x.target,U=Number.parseFloat(T.value);s.value!==null&&U>s.value?o.value=s.value:o.value=U}function F(x){const T=x.target,U=Number.parseFloat(T.value);o.value!==null&&U<o.value?s.value=o.value:s.value=U}function N(x){const T=x.target,U=T.value===""?null:Number.parseFloat(T.value);U!==null&&!Number.isNaN(U)?o.value=Math.max(l.dataMin,Math.min(U,s.value??l.dataMax)):U===null&&(o.value=null)}function w(x){const T=x.target,U=T.value===""?null:Number.parseFloat(T.value);U!==null&&!Number.isNaN(U)?s.value=Math.min(l.dataMax,Math.max(U,o.value??l.dataMin)):U===null&&(s.value=null)}function z(){o.value=null,s.value=null,H()}function W(){o.value=l.dataMin,s.value=l.dataMax,H()}function H(){o.value===null&&s.value===null?a("change",null):a("change",{min:o.value,max:s.value})}return e.watch(()=>l.currentRange,x=>{o.value=(x==null?void 0:x.min)??null,s.value=(x==null?void 0:x.max)??null},{immediate:!0}),(x,T)=>(e.openBlock(),e.createElementBlock("div",Hl,[e.createElementVNode("div",Kl,[T[0]||(T[0]=e.createElementVNode("span",{class:"vpg-range-label"},"Data range:",-1)),e.createElementVNode("span",Ol,e.toDisplayString(f(t.dataMin))+" – "+e.toDisplayString(f(t.dataMax)),1)]),e.createElementVNode("div",Wl,[e.createElementVNode("div",ql,[e.createElementVNode("div",{class:"vpg-slider-fill",style:e.normalizeStyle({left:`${b.value}%`,right:`${100-E.value}%`})},null,4)]),e.createElementVNode("input",{type:"range",class:"vpg-slider vpg-slider-min",min:t.dataMin,max:t.dataMax,step:p.value,value:o.value??t.dataMin,onInput:S,onChange:H},null,40,Gl),e.createElementVNode("input",{type:"range",class:"vpg-slider vpg-slider-max",min:t.dataMin,max:t.dataMax,step:p.value,value:s.value??t.dataMax,onInput:F,onChange:H},null,40,_l)]),e.createElementVNode("div",Yl,[e.createElementVNode("div",Il,[T[1]||(T[1]=e.createElementVNode("label",{class:"vpg-input-label"},"Min",-1)),e.createElementVNode("input",{type:"number",class:"vpg-range-input",placeholder:f(t.dataMin),value:o.value??"",step:p.value,onInput:N,onChange:H},null,40,Xl)]),T[3]||(T[3]=e.createElementVNode("span",{class:"vpg-input-separator"},"to",-1)),e.createElementVNode("div",Zl,[T[2]||(T[2]=e.createElementVNode("label",{class:"vpg-input-label"},"Max",-1)),e.createElementVNode("input",{type:"number",class:"vpg-range-input",placeholder:f(t.dataMax),value:s.value??"",step:p.value,onInput:w,onChange:H},null,40,Ql)])]),e.createElementVNode("div",Jl,[e.createElementVNode("button",{class:"vpg-range-btn",disabled:!k.value,onClick:z},[...T[4]||(T[4]=[e.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),e.createTextVNode(" Clear ",-1)])],8,en),e.createElementVNode("button",{class:"vpg-range-btn",onClick:W},[...T[5]||(T[5]=[e.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})],-1),e.createTextVNode(" Full Range ",-1)])])]),k.value?(e.openBlock(),e.createElementBlock("div",tn,[T[7]||(T[7]=e.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})],-1)),e.createElementVNode("span",null,[T[6]||(T[6]=e.createTextVNode(" Showing values ",-1)),e.createElementVNode("strong",null,e.toDisplayString(o.value!==null?`≥ ${f(o.value)}`:""),1),e.createTextVNode(" "+e.toDisplayString(o.value!==null&&s.value!==null?" and ":"")+" ",1),e.createElementVNode("strong",null,e.toDisplayString(s.value!==null?`≤ ${f(s.value)}`:""),1)])])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-8d673357"]]),nn={class:"vpg-filter-header"},on={class:"vpg-filter-title"},an={class:"vpg-filter-count"},rn={class:"vpg-sort-controls"},sn=["title"],cn=["title"],dn={key:0,class:"vpg-filter-tabs"},un={class:"vpg-search-container"},mn={class:"vpg-values-list"},gn=["checked","onChange"],pn={key:0,class:"vpg-no-results"},Vt=xe(e.defineComponent({__name:"ColumnFilter",props:{columnId:{},columnName:{},stats:{},selectedValues:{},sortDirection:{},numericRange:{}},emits:["filter","sort","close","rangeFilter"],setup(t,{emit:r}){const l=t,a=r,o=e.ref(""),s=e.ref(),p=e.ref(),f=e.computed(()=>l.stats.type==="number"&&l.stats.numericMin!==void 0&&l.stats.numericMax!==void 0),k=e.ref(l.numericRange?"range":"values"),b=e.ref(l.numericRange??null);e.computed(()=>{const d=[...l.stats.uniqueValues];return l.stats.nullCount>0&&d.unshift("(blank)"),d});const E=e.ref(new Set(l.selectedValues)),S=e.computed(()=>l.stats.nullCount>0),F=e.computed(()=>{const d=l.stats.uniqueValues;if(!o.value)return d;const c=o.value.toLowerCase();return d.filter(u=>u.toLowerCase().includes(c))}),N=e.computed(()=>{const d=[...F.value];return S.value&&(!o.value||"(blank)".includes(o.value.toLowerCase()))&&d.unshift("(blank)"),d});e.computed(()=>N.value.every(d=>E.value.has(d))),e.computed(()=>E.value.size===0);function w(d){E.value.has(d)?E.value.delete(d):E.value.add(d),E.value=new Set(E.value)}function z(){for(const d of N.value)E.value.add(d);E.value=new Set(E.value)}function W(){E.value.clear(),E.value=new Set(E.value)}function H(){E.value.size===0?a("filter",[]):a("filter",Array.from(E.value)),a("close")}function P(){a("sort",l.sortDirection==="asc"?null:"asc")}function M(){a("sort",l.sortDirection==="desc"?null:"desc")}function x(){E.value.clear(),E.value=new Set(E.value),a("filter",[]),a("close")}function T(d){b.value=d}function U(){a("rangeFilter",b.value),a("close")}function _(){b.value=null,a("rangeFilter",null),a("close")}function R(d){k.value=d}function C(d){s.value&&!s.value.contains(d.target)&&a("close")}function g(d){d.key==="Escape"?a("close"):d.key==="Enter"&&d.ctrlKey&&H()}return e.onMounted(()=>{e.nextTick(()=>{var d;(d=p.value)==null||d.focus()}),document.addEventListener("mousedown",C),document.addEventListener("keydown",g)}),e.onUnmounted(()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",g)}),e.watch(()=>l.selectedValues,d=>{E.value=new Set(d)},{immediate:!0}),e.watch(()=>l.numericRange,d=>{b.value=d??null,d&&(k.value="range")},{immediate:!0}),(d,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dropdownRef",ref:s,class:"vpg-filter-dropdown"},[e.createElementVNode("div",nn,[e.createElementVNode("span",on,e.toDisplayString(t.columnName),1),e.createElementVNode("span",an,e.toDisplayString(t.stats.uniqueValues.length.toLocaleString())+" unique ",1)]),e.createElementVNode("div",rn,[e.createElementVNode("button",{class:e.normalizeClass(["vpg-sort-btn",{active:t.sortDirection==="asc"}]),title:f.value?"Sort Low to High":"Sort A to Z",onClick:P},[c[4]||(c[4]=e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})],-1)),e.createElementVNode("span",null,e.toDisplayString(f.value?"1→9":"A→Z"),1)],10,sn),e.createElementVNode("button",{class:e.normalizeClass(["vpg-sort-btn",{active:t.sortDirection==="desc"}]),title:f.value?"Sort High to Low":"Sort Z to A",onClick:M},[c[5]||(c[5]=e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4"})],-1)),e.createElementVNode("span",null,e.toDisplayString(f.value?"9→1":"Z→A"),1)],10,cn)]),c[11]||(c[11]=e.createElementVNode("div",{class:"vpg-divider"},null,-1)),f.value?(e.openBlock(),e.createElementBlock("div",dn,[e.createElementVNode("button",{class:e.normalizeClass(["vpg-tab-btn",{active:k.value==="values"}]),onClick:c[0]||(c[0]=u=>R("values"))},[...c[6]||(c[6]=[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})],-1),e.createTextVNode(" Values ",-1)])],2),e.createElementVNode("button",{class:e.normalizeClass(["vpg-tab-btn",{active:k.value==="range"}]),onClick:c[1]||(c[1]=u=>R("range"))},[...c[7]||(c[7]=[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"})],-1),e.createTextVNode(" Range ",-1)])],2)])):e.createCommentVNode("",!0),!f.value||k.value==="values"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",un,[c[8]||(c[8]=e.createElementVNode("svg",{class:"vpg-search-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:p,"onUpdate:modelValue":c[2]||(c[2]=u=>o.value=u),type:"text",placeholder:"Search values...",class:"vpg-search-input"},null,512),[[e.vModelText,o.value]]),o.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vpg-clear-search",onClick:c[3]||(c[3]=u=>o.value="")}," × ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vpg-bulk-actions"},[e.createElementVNode("button",{class:"vpg-bulk-btn",onClick:z},[...c[9]||(c[9]=[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),e.createTextVNode(" Select All ",-1)])]),e.createElementVNode("button",{class:"vpg-bulk-btn",onClick:W},[...c[10]||(c[10]=[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),e.createTextVNode(" Clear All ",-1)])])]),e.createElementVNode("div",mn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,u=>(e.openBlock(),e.createElementBlock("label",{key:u,class:e.normalizeClass(["vpg-value-item",{selected:E.value.has(u)}])},[e.createElementVNode("input",{type:"checkbox",checked:E.value.has(u),class:"vpg-value-checkbox",onChange:V=>w(u)},null,40,gn),e.createElementVNode("span",{class:e.normalizeClass(["vpg-value-text",{"vpg-blank":u==="(blank)"}])},e.toDisplayString(u),3)],2))),128)),N.value.length===0?(e.openBlock(),e.createElementBlock("div",pn," No matching values ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vpg-filter-footer"},[e.createElementVNode("button",{class:"vpg-btn-clear",onClick:x}," Clear Filter "),e.createElementVNode("button",{class:"vpg-btn-apply",onClick:H}," Apply ")])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(ln,{"data-min":t.stats.numericMin,"data-max":t.stats.numericMax,"current-range":b.value,onChange:T},null,8,["data-min","data-max","current-range"]),e.createElementVNode("div",{class:"vpg-filter-footer"},[e.createElementVNode("button",{class:"vpg-btn-clear",onClick:_}," Clear Filter "),e.createElementVNode("button",{class:"vpg-btn-apply",onClick:U}," Apply ")])],64))],512))}}),[["__scopeId","data-v-6c8a1b76"]]),Et=(t,r,l)=>{if(!l)return!0;if(Xe(l)){const a=t.getValue(r);if(a==null||a==="")return!1;const o=typeof a=="number"?a:Number.parseFloat(String(a));if(Number.isNaN(o))return!1;const{min:s,max:p}=l;return!(s!==null&&o<s||p!==null&&o>p)}if(Array.isArray(l)&&l.length>0){const a=t.getValue(r),o=a==null||a===""?"(blank)":String(a);return l.includes(o)}return!0};function Ct(t){const{data:r,enableSorting:l=!0,enableFiltering:a=!0}=t,o=e.ref([]),s=e.ref([]),p=e.ref({}),f=e.ref(""),k=e.ref({}),b=e.computed(()=>r.value.length===0?[]:Object.keys(r.value[0]));function E(C){const g=`${C}-${r.value.length}`;return k.value[g]||(k.value[g]=ct(r.value,C)),k.value[g]}function S(){k.value={}}const F=e.computed(()=>b.value.map(C=>{const g=E(C);return{id:C,accessorKey:C,header:C,cell:d=>dt(d.getValue(),g.type),filterFn:Et,meta:{type:g.type,uniqueCount:g.uniqueValues.length}}})),N=Ge.useVueTable({get data(){return r.value},get columns(){return F.value},state:{get sorting(){return o.value},get columnFilters(){return s.value},get columnVisibility(){return p.value},get globalFilter(){return f.value}},onSortingChange:C=>{o.value=typeof C=="function"?C(o.value):C},onColumnFiltersChange:C=>{s.value=typeof C=="function"?C(s.value):C},getCoreRowModel:Ge.getCoreRowModel(),getSortedRowModel:l?Ge.getSortedRowModel():void 0,getFilteredRowModel:a?Ge.getFilteredRowModel():void 0,filterFns:{multiSelect:Et},enableSorting:l,enableFilters:a}),w=e.computed(()=>N.getFilteredRowModel().rows.length),z=e.computed(()=>r.value.length),W=e.computed(()=>s.value.map(C=>{const g=C.value;return g&&Xe(g)?{column:C.id,type:"range",range:g,values:[]}:{column:C.id,type:"values",values:Array.isArray(g)?g:[],range:null}}));function H(C){const g=N.getColumn(C);if(!g)return!1;const d=g.getFilterValue();return d?Xe(d)?d.min!==null||d.max!==null:Array.isArray(d)&&d.length>0:!1}function P(C,g){const d=N.getColumn(C);d&&(d.setFilterValue(g.length===0?void 0:g),s.value=N.getState().columnFilters)}function M(C,g){const d=N.getColumn(C);d&&(!g||g.min===null&&g.max===null?d.setFilterValue(void 0):d.setFilterValue(g),s.value=N.getState().columnFilters)}function x(C){const g=N.getColumn(C);if(!g)return null;const d=g.getFilterValue();return d&&Xe(d)?d:null}function T(){N.resetColumnFilters(),f.value="",s.value=[]}function U(C){const g=N.getColumn(C);if(!g)return[];const d=g.getFilterValue();return Array.isArray(d)?d:[]}function _(C){const g=o.value.find(d=>d.id===C);g?g.desc?o.value=[]:o.value=[{id:C,desc:!0}]:o.value=[{id:C,desc:!1}]}function R(C){const g=o.value.find(d=>d.id===C);return g?g.desc?"desc":"asc":null}return e.watch(r,()=>{S()}),{table:N,sorting:o,columnFilters:s,columnVisibility:p,globalFilter:f,columnKeys:b,filteredRowCount:w,totalRowCount:z,activeFilters:W,getColumnStats:E,clearStatsCache:S,hasActiveFilter:H,setColumnFilter:P,getColumnFilterValues:U,clearAllFilters:T,toggleSort:_,getSortDirection:R,setNumericRangeFilter:M,getNumericRangeFilter:x}}function Nt(t,r,l){Wt(t,r,l)}function yt(t,r,l,a,o){qt(t,r,l,a,o)}function bt(t,r,l){Gt(t,r,l)}function Ft(t,r,l){return _t(t,r,l)}function fn(t,r={}){const l=e.ref(r.pageSize??50),a=e.ref(r.currentPage??1),o=e.computed(()=>Math.max(1,Math.ceil(t.value.length/l.value))),s=e.computed(()=>{const w=(a.value-1)*l.value,z=w+l.value;return t.value.slice(w,z)}),p=e.computed(()=>(a.value-1)*l.value+1),f=e.computed(()=>Math.min(a.value*l.value,t.value.length));function k(w){a.value=Math.max(1,Math.min(w,o.value))}function b(){a.value<o.value&&a.value++}function E(){a.value>1&&a.value--}function S(){a.value=1}function F(){a.value=o.value}function N(w){l.value=w,a.value=1}return{pageSize:l,currentPage:a,totalPages:o,paginatedData:s,startIndex:p,endIndex:f,goToPage:k,nextPage:b,prevPage:E,firstPage:S,lastPage:F,setPageSize:N}}function vn(t,r){const l=e.ref(""),a=e.ref(!1),o=e.computed(()=>{if(!l.value.trim())return t.value;const p=a.value?l.value.trim():l.value.trim().toLowerCase();return t.value.filter(f=>{for(const k of r.value){const b=f[k];if(b==null)continue;if((a.value?String(b):String(b).toLowerCase()).includes(p))return!0}return!1})});function s(){l.value=""}return{searchTerm:l,caseSensitive:a,filteredData:o,clearSearch:s}}function hn(t){const r=e.ref(new Set),l=e.computed(()=>Array.from(r.value).sort((N,w)=>N-w).map(N=>t.value[N]).filter(Boolean)),a=e.computed(()=>t.value.length>0&&r.value.size===t.value.length),o=e.computed(()=>r.value.size>0&&r.value.size<t.value.length);function s(N){r.value.has(N)?r.value.delete(N):r.value.add(N),r.value=new Set(r.value)}function p(N){r.value.add(N),r.value=new Set(r.value)}function f(N){r.value.delete(N),r.value=new Set(r.value)}function k(){r.value=new Set(t.value.map((N,w)=>w))}function b(){r.value=new Set}function E(){a.value?b():k()}function S(N){return r.value.has(N)}function F(N,w){const z=Math.min(N,w),W=Math.max(N,w);for(let H=z;H<=W;H++)r.value.add(H);r.value=new Set(r.value)}return{selectedRowIndices:r,selectedRows:l,allSelected:a,someSelected:o,toggleRow:s,selectRow:p,deselectRow:f,selectAll:k,deselectAll:b,toggleAll:E,isSelected:S,selectRange:F}}function kn(t,r=60,l=600){const a=e.ref({...t.value}),o=e.ref(!1),s=e.ref(null);function p(b,E){o.value=!0,s.value=b;const S=E.clientX,F=a.value[b]||150,N=z=>{const W=z.clientX-S,H=Math.max(r,Math.min(l,F+W));a.value={...a.value,[b]:H}},w=()=>{o.value=!1,s.value=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",w)};document.addEventListener("mousemove",N),document.addEventListener("mouseup",w)}function f(b){t.value[b]&&(a.value={...a.value,[b]:t.value[b]})}function k(){a.value={...t.value}}return{columnWidths:a,isResizing:o,resizingColumn:s,startResize:p,resetColumnWidth:f,resetAllWidths:k}}const wn=e.ref(null),Ee=e.ref(!1),ge=e.ref(ol());let lt=null;async function Vn(t){wn.value=t,lt=Jt(t),ge.value=await lt,lt=null,ge.value.isValid?ge.value.type!=="free"&&console.info(`[TinyPivot] Pro license activated (${ge.value.type})`):console.warn("[TinyPivot] Invalid or expired license key. Running in free mode.")}async function En(t){const r=await nl(t);return r?(Ee.value=!0,ge.value=r,console.info("[TinyPivot] Demo mode enabled - all Pro features unlocked for evaluation"),!0):(console.warn("[TinyPivot] Demo mode activation failed - invalid secret"),!1)}function Cn(t){el()}function Ke(){const t=e.computed(()=>Ee.value),r=e.computed(()=>Ee.value||rl(ge.value)),l=e.computed(()=>Ee.value||al(ge.value)),a=e.computed(()=>Ee.value||ge.value.features.advancedAggregations),o=e.computed(()=>Ee.value||ge.value.features.percentageMode),s=e.computed(()=>sl(ge.value,Ee.value));function p(f){return r.value?!0:(il(f),!1)}return{licenseInfo:e.computed(()=>ge.value),isDemo:t,isPro:r,canUsePivot:l,canUseAdvancedAggregations:a,canUsePercentageMode:o,showWatermark:s,requirePro:p}}function St(t){const{canUsePivot:r,requirePro:l}=Ke(),a=e.ref([]),o=e.ref([]),s=e.ref([]),p=e.ref(!0),f=e.ref(!0),k=e.ref(wt()),b=e.ref(null),E=e.computed(()=>fl(t.value)),S=e.computed(()=>vl(E.value,a.value,o.value,s.value)),F=e.computed(()=>ht({rowFields:a.value,columnFields:o.value,valueFields:s.value,showRowTotals:p.value,showColumnTotals:f.value})),N=e.computed(()=>!F.value||!r.value?null:hl(t.value,{rowFields:a.value,columnFields:o.value,valueFields:s.value,showRowTotals:p.value,showColumnTotals:f.value,calculatedFields:k.value}));function w(g){a.value.includes(g)||(a.value=[...a.value,g])}function z(g){a.value=a.value.filter(d=>d!==g)}function W(g){o.value.includes(g)||(o.value=[...o.value,g])}function H(g){o.value=o.value.filter(d=>d!==g)}function P(g,d="sum"){d!=="sum"&&!l(`${d} aggregation`)||s.value.some(c=>c.field===g&&c.aggregation===d)||(s.value=[...s.value,{field:g,aggregation:d}])}function M(g,d){d?s.value=s.value.filter(c=>!(c.field===g&&c.aggregation===d)):s.value=s.value.filter(c=>c.field!==g)}function x(g,d,c){s.value=s.value.map(u=>u.field===g&&u.aggregation===d?{...u,aggregation:c}:u)}function T(){a.value=[],o.value=[],s.value=[]}function U(g,d){if(g.area===d.area){if(g.area==="row"){const c=[...a.value],[u]=c.splice(g.index,1);c.splice(d.index,0,u),a.value=c}else if(g.area==="column"){const c=[...o.value],[u]=c.splice(g.index,1);c.splice(d.index,0,u),o.value=c}}}function _(){if(!l("Pivot Table - Auto Suggest")||E.value.length===0)return;const g=E.value.filter(c=>!c.isNumeric&&c.uniqueCount<50),d=E.value.filter(c=>c.isNumeric);g.length>0&&d.length>0&&(a.value=[g[0].field],s.value=[{field:d[0].field,aggregation:"sum"}])}function R(g){const d=k.value.findIndex(c=>c.id===g.id);d>=0?k.value=[...k.value.slice(0,d),g,...k.value.slice(d+1)]:k.value=[...k.value,g],He(k.value)}function C(g){k.value=k.value.filter(d=>d.id!==g),s.value=s.value.filter(d=>d.field!==`calc:${g}`),He(k.value)}return e.watch(t,g=>{if(g.length===0)return;const d=Object.keys(g[0]),c=wl(d);if(c!==b.value){b.value=c;const u=El(c);if(u&&tt(u,d))a.value=u.rowFields,o.value=u.columnFields,s.value=u.valueFields,p.value=u.showRowTotals,f.value=u.showColumnTotals,u.calculatedFields&&(k.value=u.calculatedFields);else{const V={rowFields:a.value,columnFields:o.value,valueFields:s.value,showRowTotals:p.value,showColumnTotals:f.value};tt(V,d)||T()}}else{const u={rowFields:a.value,columnFields:o.value,valueFields:s.value,showRowTotals:p.value,showColumnTotals:f.value};tt(u,d)||T()}},{immediate:!0}),e.watch([a,o,s,p,f,k],()=>{if(!b.value)return;const g={rowFields:a.value,columnFields:o.value,valueFields:s.value,showRowTotals:p.value,showColumnTotals:f.value,calculatedFields:k.value};Vl(b.value,g)},{deep:!0}),{rowFields:a,columnFields:o,valueFields:s,showRowTotals:p,showColumnTotals:f,calculatedFields:k,availableFields:E,unassignedFields:S,isConfigured:F,pivotResult:N,addRowField:w,removeRowField:z,addColumnField:W,removeColumnField:H,addValueField:P,removeValueField:M,updateValueFieldAggregation:x,clearConfig:T,moveField:U,autoSuggestConfig:_,addCalculatedField:R,removeCalculatedField:C}}const Nn={class:"vpg-pivot-config"},yn={class:"vpg-config-header"},bn={class:"vpg-header-actions"},Fn={key:0,class:"vpg-assigned-section"},Sn={class:"vpg-assigned-list"},Bn=["title","onDragstart"],xn={class:"vpg-item-main"},Mn={class:"vpg-item-name"},$n={class:"vpg-item-actions"},Dn=["title","onClick"],Rn=["value","onChange"],Tn=["value","disabled"],Ln=["onClick"],zn={class:"vpg-unassigned-section"},An={class:"vpg-section-header"},Pn={class:"vpg-section-label"},Un={class:"vpg-count"},jn={class:"vpg-field-search"},Hn={class:"vpg-field-list"},Kn=["title","onDragstart"],On={class:"vpg-field-name"},Wn=["onClick"],qn=["onClick"],Gn={key:1,class:"vpg-unique-count"},_n={key:0,class:"vpg-empty-hint"},Yn={key:1,class:"vpg-empty-hint"},In={class:"vpg-options-section"},Xn={class:"vpg-option-toggle"},Zn=["checked"],Bt=xe(e.defineComponent({__name:"PivotConfig",props:{availableFields:{},rowFields:{},columnFields:{},valueFields:{},showRowTotals:{type:Boolean},showColumnTotals:{type:Boolean},calculatedFields:{}},emits:["update:showRowTotals","update:showColumnTotals","clearConfig","dragStart","dragEnd","updateAggregation","addRowField","removeRowField","addColumnField","removeColumnField","addValueField","removeValueField","addCalculatedField","removeCalculatedField","updateCalculatedField"],setup(t,{emit:r}){const l=t,a=r,{canUseAdvancedAggregations:o}=Ke(),s=gl;function p(c){return c!=="sum"}function f(c){return!p(c)||o.value}const k=e.ref(!1),b=e.ref(null),E=e.computed(()=>l.availableFields.filter(c=>c.isNumeric).map(c=>c.field));function S(c){b.value=c||null,k.value=!0}function F(c){b.value?a("updateCalculatedField",c):a("addCalculatedField",c),k.value=!1,b.value=null}function N(c){a("update:showRowTotals",c),a("update:showColumnTotals",c)}const w=e.computed(()=>l.calculatedFields?l.calculatedFields.map(c=>({field:`calc:${c.id}`,type:"number",uniqueCount:0,isNumeric:!0,isCalculated:!0,calcId:c.id,calcName:c.name,calcFormula:c.formula})):[]),z=e.computed(()=>[...l.availableFields.map(c=>({...c,isCalculated:!1})),...w.value]),W=e.computed(()=>{const c=new Set(l.rowFields),u=new Set(l.columnFields),V=new Map(l.valueFields.map($=>[$.field,$]));return z.value.filter($=>c.has($.field)||u.has($.field)||V.has($.field)).map($=>({...$,assignedTo:c.has($.field)?"row":u.has($.field)?"column":"value",valueConfig:V.get($.field)}))}),H=e.computed(()=>{const c=new Set(l.rowFields),u=new Set(l.columnFields),V=new Set(l.valueFields.map($=>$.field));return z.value.filter($=>!c.has($.field)&&!u.has($.field)&&!V.has($.field))}),P=e.computed(()=>W.value.length),M=e.ref(""),x=e.computed(()=>{if(!M.value.trim())return H.value;const c=M.value.toLowerCase().trim();return H.value.filter(u=>{const V=u.field.toLowerCase(),$=u.isCalculated&&u.calcName?u.calcName.toLowerCase():"";return V.includes(c)||$.includes(c)})});function T(c,u){if(u)return"ƒ";switch(c){case"number":return"#";case"date":return"📅";case"boolean":return"✓";default:return"Aa"}}function U(c){return c.isCalculated&&c.calcName?c.calcName:c.field}function _(c,u){var V;(V=u.dataTransfer)==null||V.setData("text/plain",c),u.dataTransfer.effectAllowed="move",a("dragStart",c,u)}function R(){a("dragEnd")}function C(c,u,V){if(!f(V)){console.warn(`[TinyPivot] "${V}" aggregation requires a Pro license. Visit https://tiny-pivot.com/#pricing to upgrade.`);return}a("updateAggregation",c,u,V)}function g(c,u){u==="row"?(a("removeRowField",c),a("addColumnField",c)):(a("removeColumnField",c),a("addRowField",c))}function d(c,u,V){u==="row"?a("removeRowField",c):u==="column"?a("removeColumnField",c):V&&a("removeValueField",c,V.aggregation)}return(c,u)=>(e.openBlock(),e.createElementBlock("div",Nn,[e.createElementVNode("div",yn,[u[8]||(u[8]=e.createElementVNode("h3",{class:"vpg-config-title"},[e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})]),e.createTextVNode(" Fields ")],-1)),e.createElementVNode("div",bn,[P.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vpg-action-btn vpg-clear-btn",title:"Clear all",onClick:u[0]||(u[0]=V=>a("clearConfig"))},[...u[7]||(u[7]=[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):e.createCommentVNode("",!0)])]),P.value>0?(e.openBlock(),e.createElementBlock("div",Fn,[u[10]||(u[10]=e.createElementVNode("div",{class:"vpg-section-label"}," Active ",-1)),e.createElementVNode("div",Sn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,V=>{var $;return e.openBlock(),e.createElementBlock("div",{key:V.field,class:e.normalizeClass(["vpg-assigned-item",[`vpg-type-${V.assignedTo}`,{"vpg-type-calc":V.isCalculated}]]),title:V.isCalculated?V.calcFormula:V.field,draggable:"true",onDragstart:j=>_(V.field,j),onDragend:R},[e.createElementVNode("div",xn,[e.createElementVNode("span",{class:e.normalizeClass(["vpg-item-badge",[V.assignedTo,{calc:V.isCalculated}]])},e.toDisplayString(V.isCalculated?"ƒ":V.assignedTo==="row"?"R":V.assignedTo==="column"?"C":e.unref(gt)((($=V.valueConfig)==null?void 0:$.aggregation)||"sum")),3),e.createElementVNode("span",Mn,e.toDisplayString(U(V)),1)]),e.createElementVNode("div",$n,[V.assignedTo==="row"||V.assignedTo==="column"?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vpg-toggle-btn",title:V.assignedTo==="row"?"Move to Columns":"Move to Rows",onClick:e.withModifiers(j=>g(V.field,V.assignedTo),["stop"])},[...u[9]||(u[9]=[e.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})],-1)])],8,Dn)):e.createCommentVNode("",!0),V.assignedTo==="value"&&V.valueConfig?(e.openBlock(),e.createElementBlock("select",{key:1,class:"vpg-agg-select",value:V.valueConfig.aggregation,onChange:j=>C(V.field,V.valueConfig.aggregation,j.target.value),onClick:u[1]||(u[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),j=>(e.openBlock(),e.createElementBlock("option",{key:j.value,value:j.value,disabled:p(j.value)&&!e.unref(o)},e.toDisplayString(j.symbol)+" "+e.toDisplayString(j.label)+e.toDisplayString(p(j.value)&&!e.unref(o)?" (Pro)":""),9,Tn))),128))],40,Rn)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"vpg-remove-btn",title:"Remove",onClick:e.withModifiers(j=>d(V.field,V.assignedTo,V.valueConfig),["stop"])}," × ",8,Ln)])],42,Bn)}),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",zn,[e.createElementVNode("div",An,[e.createElementVNode("div",Pn,[u[11]||(u[11]=e.createTextVNode(" Available ",-1)),e.createElementVNode("span",Un,e.toDisplayString(H.value.length),1)])]),e.createElementVNode("div",jn,[u[13]||(u[13]=e.createElementVNode("svg",{class:"vpg-search-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[2]||(u[2]=V=>M.value=V),type:"text",placeholder:"Search fields...",class:"vpg-search-input"},null,512),[[e.vModelText,M.value]]),M.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vpg-clear-search",onClick:u[3]||(u[3]=V=>M.value="")},[...u[12]||(u[12]=[e.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Hn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,V=>(e.openBlock(),e.createElementBlock("div",{key:V.field,class:e.normalizeClass(["vpg-field-item",{"vpg-is-numeric":V.isNumeric&&!V.isCalculated,"vpg-is-calculated":V.isCalculated}]),title:V.isCalculated?V.calcFormula:V.field,draggable:"true",onDragstart:$=>_(V.field,$),onDragend:R},[e.createElementVNode("span",{class:e.normalizeClass(["vpg-field-type-icon",{"vpg-calc-type":V.isCalculated}])},e.toDisplayString(T(V.type,V.isCalculated)),3),e.createElementVNode("span",On,e.toDisplayString(U(V)),1),V.isCalculated?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{class:"vpg-field-edit",title:"Edit calculated field",onClick:e.withModifiers($=>{var j;return S((j=t.calculatedFields)==null?void 0:j.find(J=>J.id===V.calcId))},["stop"])}," ✎ ",8,Wn),e.createElementVNode("button",{class:"vpg-field-delete",title:"Delete calculated field",onClick:e.withModifiers($=>a("removeCalculatedField",V.calcId),["stop"])}," × ",8,qn)],64)):(e.openBlock(),e.createElementBlock("span",Gn,e.toDisplayString(V.uniqueCount),1))],42,Kn))),128)),x.value.length===0&&M.value?(e.openBlock(),e.createElementBlock("div",_n,' No fields match "'+e.toDisplayString(M.value)+'" ',1)):H.value.length===0?(e.openBlock(),e.createElementBlock("div",Yn," All fields assigned ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",In,[e.createElementVNode("label",Xn,[e.createElementVNode("input",{type:"checkbox",checked:t.showRowTotals,onChange:u[4]||(u[4]=V=>N(V.target.checked))},null,40,Zn),u[14]||(u[14]=e.createElementVNode("span",null,"Totals",-1))]),e.createElementVNode("button",{class:"vpg-calc-btn",title:"Add calculated field (e.g. Profit Margin %)",onClick:u[5]||(u[5]=V=>S())},[...u[15]||(u[15]=[e.createElementVNode("span",{class:"vpg-calc-icon"},"ƒ",-1),e.createElementVNode("span",null,"+ Calc",-1)])])]),e.createVNode(jl,{show:k.value,"available-fields":E.value,"existing-field":b.value,onClose:u[6]||(u[6]=V=>{k.value=!1,b.value=null}),onSave:F},null,8,["show","available-fields","existing-field"])]))}}),[["__scopeId","data-v-7d06ac9a"]]),Qn={key:0,class:"vpg-toast"},Jn={class:"vpg-skeleton-header"},eo={class:"vpg-header-right"},to={class:"vpg-filter-text"},lo={key:0,class:"vpg-filter-count"},no={key:0,class:"vpg-filter-tooltip"},oo={class:"vpg-tooltip-column"},ao={class:"vpg-tooltip-values"},ro={key:0,class:"vpg-tooltip-value vpg-range-value"},so={key:0,class:"vpg-tooltip-more"},io={key:0,class:"vpg-tooltip-summary"},co={key:1,class:"vpg-config-summary"},uo={class:"vpg-summary-badge vpg-rows"},mo={class:"vpg-summary-badge vpg-cols"},go={class:"vpg-summary-badge vpg-vals"},po={key:2,class:"vpg-font-size-toggle"},fo=["onClick"],vo={key:0,class:"vpg-pro-required"},ho={class:"vpg-config-bar"},ko={class:"vpg-zone-chips"},wo=["onDragstart","onDragover","onDrop"],Vo={class:"vpg-mini-name"},Eo=["onClick"],Co={key:0,class:"vpg-zone-hint"},No={class:"vpg-zone-chips"},yo=["onDragstart","onDragover","onDrop"],bo={class:"vpg-mini-name"},Fo=["onClick"],So={key:0,class:"vpg-zone-hint"},Bo={class:"vpg-zone-chips"},xo={class:"vpg-agg-symbol"},Mo={class:"vpg-mini-name"},$o=["onClick"],Do={key:0,class:"vpg-zone-hint"},Ro={key:0,class:"vpg-placeholder"},To={class:"vpg-placeholder-content"},Lo={class:"vpg-placeholder-text"},zo={key:1,class:"vpg-table-container"},Ao={class:"vpg-pivot-table"},Po=["rowspan"],Uo={class:"vpg-header-content"},jo=["colspan","onClick"],Ho={class:"vpg-header-content"},Ko=["rowspan"],Oo=["onMousedown","onMouseenter"],Wo={key:0,class:"vpg-data-cell vpg-total-cell"},qo={key:0,class:"vpg-totals-row"},Go=["colspan"],_o={key:0,class:"vpg-data-cell vpg-grand-total-cell"},Yo={key:2,class:"vpg-skeleton-footer"},Io={class:"vpg-footer-info"},Xo={key:0,class:"vpg-selection-stats"},Zo={class:"vpg-stat"},Qo={class:"vpg-stat-value"},Jo={class:"vpg-stat"},ea={class:"vpg-stat-value"},ta={class:"vpg-stat"},la={class:"vpg-stat-value"},na={key:1,href:"https://tiny-pivot.com",target:"_blank",rel:"noopener"},xt=xe(e.defineComponent({__name:"PivotSkeleton",props:{rowFields:{},columnFields:{},valueFields:{},calculatedFields:{},isConfigured:{type:Boolean},draggingField:{},pivotResult:{},fontSize:{},activeFilters:{},totalRowCount:{},filteredRowCount:{}},emits:["addRowField","removeRowField","addColumnField","removeColumnField","addValueField","removeValueField","updateAggregation","reorderRowFields","reorderColumnFields"],setup(t,{emit:r}){const l=t,a=r;function o(y){var m;if(y.startsWith("calc:")){const D=y.replace("calc:",""),h=(m=l.calculatedFields)==null?void 0:m.find(B=>B.id===D);return(h==null?void 0:h.name)||y}return y}function s(y){return y.startsWith("calc:")}const{showWatermark:p,canUsePivot:f,isDemo:k}=Ke(),b=e.ref(null),E=e.ref(null),S=e.ref(null),F=e.ref(l.fontSize||"xs"),N=[{value:"xs",label:"S"},{value:"sm",label:"M"},{value:"base",label:"L"}],w=e.computed(()=>l.activeFilters&&l.activeFilters.length>0),z=e.computed(()=>!l.activeFilters||l.activeFilters.length===0?"":l.activeFilters.map(m=>m.column).join(", ")),W=e.computed(()=>!l.activeFilters||l.activeFilters.length===0?[]:l.activeFilters.map(y=>{if(y.isRange&&y.displayText)return{column:y.column,displayText:y.displayText,isRange:!0,values:[],remaining:0};const m=y.values||[],D=5,h=m.slice(0,D),B=m.length-D;return{column:y.column,values:h,remaining:B>0?B:0,isRange:!1}})),H=e.ref(!1),P=e.ref("asc"),M=e.ref("row");function x(y="row"){M.value===y?P.value=P.value==="asc"?"desc":"asc":(M.value=y,P.value="asc")}const T=e.computed(()=>{if(!l.pivotResult)return[];const y=l.pivotResult.rowHeaders.map((h,B)=>B),m=l.pivotResult.rowHeaders,D=l.pivotResult.data;return y.sort((h,B)=>{var K,G,ee,oe,re,de;let L;if(M.value==="row"){const te=((K=m[h])==null?void 0:K.join(" / "))||"",be=((G=m[B])==null?void 0:G.join(" / "))||"";L=te.localeCompare(be,void 0,{numeric:!0,sensitivity:"base"})}else{const te=M.value,be=((oe=(ee=D[h])==null?void 0:ee[te])==null?void 0:oe.value)??null,ze=((de=(re=D[B])==null?void 0:re[te])==null?void 0:de.value)??null;be===null&&ze===null?L=0:be===null?L=1:ze===null?L=-1:L=be-ze}return P.value==="asc"?L:-L}),y}),U=e.computed(()=>{if(!l.pivotResult||l.pivotResult.headers.length===0)return[l.valueFields.map(m=>({label:s(m.field)?`${o(m.field)} (${je(m.aggregation)})`:`${m.field} (${je(m.aggregation)})`,colspan:1}))];const y=[];for(let m=0;m<l.pivotResult.headers.length;m++){const D=l.pivotResult.headers[m],h=[];let B=0;for(;B<D.length;){const L=D[B];let K=1;for(;B+K<D.length&&D[B+K]===L;)K++;h.push({label:L,colspan:K}),B+=K}y.push(h)}return y}),_=e.ref(null),R=e.ref(null),C=e.ref(null),g=e.ref(!1),d=e.ref(!1),c=e.ref(""),u=e.computed(()=>!R.value||!C.value?null:{minRow:Math.min(R.value.row,C.value.row),maxRow:Math.max(R.value.row,C.value.row),minCol:Math.min(R.value.col,C.value.col),maxCol:Math.max(R.value.col,C.value.col)});function V(y,m,D){D.preventDefault(),D.shiftKey&&_.value?C.value={row:y,col:m}:(_.value={row:y,col:m},R.value={row:y,col:m},C.value={row:y,col:m},g.value=!0)}function $(y,m){g.value&&(C.value={row:y,col:m})}function j(){g.value=!1}function J(y,m){var K,G;if(!u.value)return((K=_.value)==null?void 0:K.row)===y&&((G=_.value)==null?void 0:G.col)===m;const{minRow:D,maxRow:h,minCol:B,maxCol:L}=u.value;return y>=D&&y<=h&&m>=B&&m<=L}function se(){var K;if(!u.value||!l.pivotResult)return;const{minRow:y,maxRow:m,minCol:D,maxCol:h}=u.value,B=[];for(let G=y;G<=m;G++){const ee=T.value[G];if(ee===void 0)continue;const oe=[];for(let re=D;re<=h;re++){const de=(K=l.pivotResult.data[ee])==null?void 0:K[re];oe.push((de==null?void 0:de.formattedValue)??"")}B.push(oe.join(" "))}const L=B.join(`
|
|
9
|
-
`);navigator.clipboard.writeText(L).then(()=>{const G=(m-y+1)*(h-D+1);c.value=`Copied ${G} cell${G>1?"s":""}`,d.value=!0,setTimeout(()=>{d.value=!1},2e3)}).catch(G=>{console.error("Copy failed:",G)})}function ve(y){if(u.value){if((y.ctrlKey||y.metaKey)&&y.key==="c"){y.preventDefault(),se();return}y.key==="Escape"&&(_.value=null,R.value=null,C.value=null)}}const ae=e.computed(()=>{var ee;if(!u.value||!l.pivotResult)return null;const{minRow:y,maxRow:m,minCol:D,maxCol:h}=u.value,B=[];let L=0;for(let oe=y;oe<=m;oe++){const re=T.value[oe];if(re!==void 0)for(let de=D;de<=h;de++){const te=(ee=l.pivotResult.data[re])==null?void 0:ee[de];L++,(te==null?void 0:te.value)!==null&&(te==null?void 0:te.value)!==void 0&&typeof te.value=="number"&&B.push(te.value)}}if(L<=1)return null;const K=B.reduce((oe,re)=>oe+re,0),G=B.length>0?K/B.length:0;return{count:L,numericCount:B.length,sum:K,avg:G}});function Me(y){return Math.abs(y)>=1e6?`${(y/1e6).toFixed(2)}M`:Math.abs(y)>=1e3?`${(y/1e3).toFixed(2)}K`:y.toFixed(2)}e.onMounted(()=>{document.addEventListener("mouseup",j),document.addEventListener("keydown",ve)}),e.onUnmounted(()=>{document.removeEventListener("mouseup",j),document.removeEventListener("keydown",ve)});function ie(y,m){m.preventDefault(),m.dataTransfer.dropEffect="move",b.value=y}function Oe(){b.value=null}function We(y,m){var B;m.preventDefault();const D=(B=m.dataTransfer)==null?void 0:B.getData("text/plain");if(!D||D.startsWith("reorder:")){b.value=null;return}l.rowFields.includes(D)&&a("removeRowField",D),l.columnFields.includes(D)&&a("removeColumnField",D);const h=l.valueFields.find(L=>L.field===D);switch(h&&a("removeValueField",D,h.aggregation),y){case"row":a("addRowField",D);break;case"column":a("addColumnField",D);break;case"value":a("addValueField",D,"sum");break}b.value=null}function Ce(y,m,D){E.value={zone:y,index:m},D.dataTransfer.effectAllowed="move",D.dataTransfer.setData("text/plain",`reorder:${y}:${m}`),requestAnimationFrame(()=>{b.value=null})}function Ne(){E.value=null,S.value=null}function ye(y,m,D){D.preventDefault(),E.value&&E.value.zone===y&&(D.dataTransfer.dropEffect="move",S.value={zone:y,index:m})}function $e(){S.value=null}function De(y,m,D){if(D.preventDefault(),D.stopPropagation(),!E.value||E.value.zone!==y)return;const h=E.value.index;if(h===m){E.value=null,S.value=null;return}const B=y==="row"?[...l.rowFields]:[...l.columnFields],[L]=B.splice(h,1);B.splice(m,0,L),a(y==="row"?"reorderRowFields":"reorderColumnFields",B),E.value=null,S.value=null}function Ze(y,m){var D,h;return((D=E.value)==null?void 0:D.zone)===y&&((h=E.value)==null?void 0:h.index)===m}function Re(y,m){var D,h;return((D=S.value)==null?void 0:D.zone)===y&&((h=S.value)==null?void 0:h.index)===m}const ce=e.ref(180),Te=e.ref(80),Le=e.computed(()=>{const y=Math.max(l.rowFields.length,1);return Math.max(ce.value/y,80)});function qe(y){return y*Le.value}return(y,m)=>{var D;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vpg-pivot-skeleton",[`vpg-font-${F.value}`,{"vpg-is-dragging":t.draggingField}]])},[e.createVNode(e.Transition,{name:"vpg-toast"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",Qn,[m[9]||(m[9]=e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)),e.createTextVNode(" "+e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Jn,[m[13]||(m[13]=e.createElementVNode("div",{class:"vpg-skeleton-title"},[e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})]),e.createElementVNode("span",null,"Pivot Table")],-1)),e.createElementVNode("div",eo,[w.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vpg-filter-indicator",onMouseenter:m[0]||(m[0]=h=>H.value=!0),onMouseleave:m[1]||(m[1]=h=>H.value=!1)},[m[12]||(m[12]=e.createElementVNode("svg",{class:"vpg-filter-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})],-1)),e.createElementVNode("span",to,[m[10]||(m[10]=e.createTextVNode(" Filtered: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(z.value),1),t.filteredRowCount!==void 0&&t.totalRowCount!==void 0?(e.openBlock(),e.createElementBlock("span",lo," ("+e.toDisplayString(t.filteredRowCount.toLocaleString())+" of "+e.toDisplayString(t.totalRowCount.toLocaleString())+" rows) ",1)):e.createCommentVNode("",!0)]),H.value?(e.openBlock(),e.createElementBlock("div",no,[m[11]||(m[11]=e.createElementVNode("div",{class:"vpg-tooltip-header"}," Active Filters ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.column,class:"vpg-tooltip-filter"},[e.createElementVNode("div",oo,e.toDisplayString(h.column),1),e.createElementVNode("div",ao,[h.isRange?(e.openBlock(),e.createElementBlock("span",ro,e.toDisplayString(h.displayText),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.values,(B,L)=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"vpg-tooltip-value"},e.toDisplayString(B),1))),128)),h.remaining>0?(e.openBlock(),e.createElementBlock("span",so," +"+e.toDisplayString(h.remaining)+" more ",1)):e.createCommentVNode("",!0)],64))])]))),128)),t.filteredRowCount!==void 0&&t.totalRowCount!==void 0?(e.openBlock(),e.createElementBlock("div",io," Showing "+e.toDisplayString(t.filteredRowCount.toLocaleString())+" of "+e.toDisplayString(t.totalRowCount.toLocaleString())+" rows ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],32)):e.createCommentVNode("",!0),t.isConfigured?(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("span",uo,e.toDisplayString(t.rowFields.length)+" row"+e.toDisplayString(t.rowFields.length!==1?"s":""),1),e.createElementVNode("span",mo,e.toDisplayString(t.columnFields.length)+" col"+e.toDisplayString(t.columnFields.length!==1?"s":""),1),e.createElementVNode("span",go,e.toDisplayString(t.valueFields.length)+" val"+e.toDisplayString(t.valueFields.length!==1?"s":""),1)])):e.createCommentVNode("",!0),t.isConfigured&&t.pivotResult?(e.openBlock(),e.createElementBlock("div",po,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(N,h=>e.createElementVNode("button",{key:h.value,class:e.normalizeClass(["vpg-font-size-btn",{active:F.value===h.value}]),onClick:B=>F.value=h.value},e.toDisplayString(h.label),11,fo)),64))])):e.createCommentVNode("",!0)])]),e.unref(f)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",ho,[e.createElementVNode("div",{class:e.normalizeClass(["vpg-drop-zone vpg-row-zone",{"vpg-drag-over":b.value==="row"}]),onDragover:m[2]||(m[2]=h=>ie("row",h)),onDragleave:Oe,onDrop:m[3]||(m[3]=h=>We("row",h))},[m[16]||(m[16]=e.createElementVNode("div",{class:"vpg-zone-header"},[e.createElementVNode("span",{class:"vpg-zone-icon vpg-row-icon"},"↓"),e.createElementVNode("span",{class:"vpg-zone-label"},"Rows")],-1)),e.createElementVNode("div",ko,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rowFields,(h,B)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:e.normalizeClass(["vpg-mini-chip vpg-row-chip",{"vpg-chip-dragging":Ze("row",B),"vpg-chip-drop-target":Re("row",B)}]),draggable:"true",onDragstart:L=>Ce("row",B,L),onDragend:Ne,onDragover:L=>ye("row",B,L),onDragleave:$e,onDrop:L=>De("row",B,L)},[m[15]||(m[15]=e.createElementVNode("span",{class:"vpg-drag-handle"},"⋮⋮",-1)),e.createElementVNode("span",Vo,e.toDisplayString(h),1),e.createElementVNode("button",{class:"vpg-mini-remove",onClick:e.withModifiers(L=>a("removeRowField",h),["stop"])}," × ",8,Eo)],42,wo))),128)),t.rowFields.length===0?(e.openBlock(),e.createElementBlock("span",Co,"Drop here")):e.createCommentVNode("",!0)])],34),e.createElementVNode("div",{class:e.normalizeClass(["vpg-drop-zone vpg-column-zone",{"vpg-drag-over":b.value==="column"}]),onDragover:m[4]||(m[4]=h=>ie("column",h)),onDragleave:Oe,onDrop:m[5]||(m[5]=h=>We("column",h))},[m[18]||(m[18]=e.createElementVNode("div",{class:"vpg-zone-header"},[e.createElementVNode("span",{class:"vpg-zone-icon vpg-column-icon"},"→"),e.createElementVNode("span",{class:"vpg-zone-label"},"Columns")],-1)),e.createElementVNode("div",No,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnFields,(h,B)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:e.normalizeClass(["vpg-mini-chip vpg-column-chip",{"vpg-chip-dragging":Ze("column",B),"vpg-chip-drop-target":Re("column",B)}]),draggable:"true",onDragstart:L=>Ce("column",B,L),onDragend:Ne,onDragover:L=>ye("column",B,L),onDragleave:$e,onDrop:L=>De("column",B,L)},[m[17]||(m[17]=e.createElementVNode("span",{class:"vpg-drag-handle"},"⋮⋮",-1)),e.createElementVNode("span",bo,e.toDisplayString(h),1),e.createElementVNode("button",{class:"vpg-mini-remove",onClick:e.withModifiers(L=>a("removeColumnField",h),["stop"])}," × ",8,Fo)],42,yo))),128)),t.columnFields.length===0?(e.openBlock(),e.createElementBlock("span",So,"Drop here")):e.createCommentVNode("",!0)])],34),e.createElementVNode("div",{class:e.normalizeClass(["vpg-drop-zone vpg-value-zone",{"vpg-drag-over":b.value==="value"}]),onDragover:m[6]||(m[6]=h=>ie("value",h)),onDragleave:Oe,onDrop:m[7]||(m[7]=h=>We("value",h))},[m[19]||(m[19]=e.createElementVNode("div",{class:"vpg-zone-header"},[e.createElementVNode("span",{class:"vpg-zone-icon vpg-value-icon"},"Σ"),e.createElementVNode("span",{class:"vpg-zone-label"},"Values")],-1)),e.createElementVNode("div",Bo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.valueFields,h=>(e.openBlock(),e.createElementBlock("div",{key:`${h.field}-${h.aggregation}`,class:e.normalizeClass(["vpg-mini-chip vpg-value-chip",{"vpg-calc-chip":s(h.field)}])},[e.createElementVNode("span",xo,e.toDisplayString(s(h.field)?"ƒ":e.unref(gt)(h.aggregation)),1),e.createElementVNode("span",Mo,e.toDisplayString(o(h.field)),1),e.createElementVNode("button",{class:"vpg-mini-remove",onClick:B=>a("removeValueField",h.field,h.aggregation)}," × ",8,$o)],2))),128)),t.valueFields.length===0?(e.openBlock(),e.createElementBlock("span",Do,"Drop numeric")):e.createCommentVNode("",!0)])],34)]),!t.isConfigured||!t.pivotResult?(e.openBlock(),e.createElementBlock("div",Ro,[e.createElementVNode("div",To,[m[28]||(m[28]=e.createElementVNode("svg",{class:"vpg-placeholder-icon",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)),e.createElementVNode("span",Lo,[t.valueFields.length===0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[m[20]||(m[20]=e.createTextVNode(" Add a ",-1)),m[21]||(m[21]=e.createElementVNode("strong",null,"Values",-1)),m[22]||(m[22]=e.createTextVNode(" field to see your pivot table ",-1))],64)):t.rowFields.length===0&&t.columnFields.length===0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[m[23]||(m[23]=e.createTextVNode(" Add ",-1)),m[24]||(m[24]=e.createElementVNode("strong",null,"Row",-1)),m[25]||(m[25]=e.createTextVNode(" or ",-1)),m[26]||(m[26]=e.createElementVNode("strong",null,"Column",-1)),m[27]||(m[27]=e.createTextVNode(" fields to group your data ",-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(" Your pivot table will appear here ")],64))])])])):(e.openBlock(),e.createElementBlock("div",zo,[e.createElementVNode("table",Ao,[e.createElementVNode("thead",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(h,B)=>(e.openBlock(),e.createElementBlock("tr",{key:`header-${B}`,class:"vpg-column-header-row"},[B===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.rowFields.length>0?t.rowFields:["Rows"],(L,K)=>(e.openBlock(),e.createElementBlock("th",{key:`row-header-${K}`,class:"vpg-row-header-label",rowspan:U.value.length,style:e.normalizeStyle({width:`${Le.value}px`,minWidth:"80px",left:`${qe(K)}px`}),onClick:m[8]||(m[8]=G=>x("row"))},[e.createElementVNode("div",Uo,[e.createElementVNode("span",null,e.toDisplayString(L),1),K===t.rowFields.length-1||t.rowFields.length===0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["vpg-sort-indicator",{active:M.value==="row"}])},e.toDisplayString(M.value==="row"?P.value==="asc"?"↑":"↓":"⇅"),3)):e.createCommentVNode("",!0)])],12,Po))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h,(L,K)=>(e.openBlock(),e.createElementBlock("th",{key:K,class:"vpg-column-header-cell",colspan:L.colspan,style:e.normalizeStyle({width:`${Te.value*L.colspan}px`}),onClick:G=>B===U.value.length-1&&x(K)},[e.createElementVNode("div",Ho,[e.createElementVNode("span",null,e.toDisplayString(L.label),1),B===U.value.length-1?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["vpg-sort-indicator",{active:M.value===K}])},e.toDisplayString(M.value===K?P.value==="asc"?"↑":"↓":"⇅"),3)):e.createCommentVNode("",!0)])],12,jo))),128)),t.pivotResult.rowTotals.length>0&&B===0?(e.openBlock(),e.createElementBlock("th",{key:1,class:"vpg-total-header",rowspan:U.value.length}," Total ",8,Ko)):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,h=>(e.openBlock(),e.createElementBlock("tr",{key:h,class:"vpg-data-row"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pivotResult.rowHeaders[h],(B,L)=>(e.openBlock(),e.createElementBlock("th",{key:`row-${h}-${L}`,class:"vpg-row-header-cell",style:e.normalizeStyle({width:`${Le.value}px`,minWidth:"80px",left:`${qe(L)}px`})},e.toDisplayString(B),5))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pivotResult.data[h],(B,L)=>(e.openBlock(),e.createElementBlock("td",{key:L,class:e.normalizeClass(["vpg-data-cell",[J(T.value.indexOf(h),L)&&"selected",B.value===null&&"vpg-is-null"]]),style:e.normalizeStyle({width:`${Te.value}px`}),onMousedown:K=>V(T.value.indexOf(h),L,K),onMouseenter:K=>$(T.value.indexOf(h),L)},e.toDisplayString(B.formattedValue),47,Oo))),128)),t.pivotResult.rowTotals[h]?(e.openBlock(),e.createElementBlock("td",Wo,e.toDisplayString(t.pivotResult.rowTotals[h].formattedValue),1)):e.createCommentVNode("",!0)]))),128)),t.pivotResult.columnTotals.length>0?(e.openBlock(),e.createElementBlock("tr",qo,[e.createElementVNode("th",{class:"vpg-row-header-cell vpg-total-label",colspan:Math.max(t.rowFields.length,1),style:e.normalizeStyle({width:`${ce.value}px`})}," Total ",12,Go),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pivotResult.columnTotals,(h,B)=>(e.openBlock(),e.createElementBlock("td",{key:B,class:"vpg-data-cell vpg-total-cell",style:e.normalizeStyle({width:`${Te.value}px`})},e.toDisplayString(h.formattedValue),5))),128)),t.pivotResult.rowTotals.length>0?(e.openBlock(),e.createElementBlock("td",_o,e.toDisplayString(t.pivotResult.grandTotal.formattedValue),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])])),t.isConfigured&&t.pivotResult?(e.openBlock(),e.createElementBlock("div",Yo,[e.createElementVNode("span",Io,e.toDisplayString(t.pivotResult.rowHeaders.length)+" rows × "+e.toDisplayString(((D=t.pivotResult.data[0])==null?void 0:D.length)||0)+" columns",1),ae.value&&ae.value.count>1?(e.openBlock(),e.createElementBlock("div",Xo,[e.createElementVNode("span",Zo,[m[29]||(m[29]=e.createElementVNode("span",{class:"vpg-stat-label"},"Count:",-1)),e.createElementVNode("span",Qo,e.toDisplayString(ae.value.count),1)]),ae.value.numericCount>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[m[32]||(m[32]=e.createElementVNode("span",{class:"vpg-stat-divider"},"|",-1)),e.createElementVNode("span",Jo,[m[30]||(m[30]=e.createElementVNode("span",{class:"vpg-stat-label"},"Sum:",-1)),e.createElementVNode("span",ea,e.toDisplayString(Me(ae.value.sum)),1)]),m[33]||(m[33]=e.createElementVNode("span",{class:"vpg-stat-divider"},"|",-1)),e.createElementVNode("span",ta,[m[31]||(m[31]=e.createElementVNode("span",{class:"vpg-stat-label"},"Avg:",-1)),e.createElementVNode("span",la,e.toDisplayString(Me(ae.value.avg)),1)])],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",vo,[...m[14]||(m[14]=[e.createElementVNode("div",{class:"vpg-pro-content"},[e.createElementVNode("svg",{class:"vpg-pro-icon",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})]),e.createElementVNode("h3",null,"Pro Feature"),e.createElementVNode("p",null,"Pivot Table functionality requires a Pro license."),e.createElementVNode("a",{href:"https://tiny-pivot.com/#pricing",target:"_blank",class:"vpg-pro-link"}," Get Pro License → ")],-1)])])),e.unref(p)&&e.unref(f)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["vpg-watermark",{"vpg-demo-mode":e.unref(k)}])},[e.unref(k)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[m[34]||(m[34]=e.createElementVNode("span",{class:"vpg-demo-badge"},"DEMO",-1)),m[35]||(m[35]=e.createElementVNode("span",null,"Pro features unlocked for evaluation",-1)),m[36]||(m[36]=e.createElementVNode("a",{href:"https://tiny-pivot.com/#pricing",target:"_blank",rel:"noopener",class:"vpg-get-pro"}," Get Pro License → ",-1))],64)):(e.openBlock(),e.createElementBlock("a",na," Powered by TinyPivot "))],2)):e.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-be785c2d"]]),oa={key:0,class:"vpg-toast"},aa={class:"vpg-toolbar"},ra={class:"vpg-toolbar-left"},sa={key:0,class:"vpg-view-toggle"},ia={key:0,class:"vpg-search-container"},ca={key:1,class:"vpg-search-box"},da={class:"vpg-font-size-control"},ua={class:"vpg-font-size-toggle"},ma=["onClick"],ga={key:1,class:"vpg-filter-info"},pa={key:2,class:"vpg-search-info"},fa={key:0,class:"vpg-pivot-status"},va={class:"vpg-toolbar-right"},ha=["disabled","title"],ka={key:0,class:"vpg-loading"},wa={key:1,class:"vpg-empty"},Va={key:2,class:"vpg-empty"},Ea={key:3,class:"vpg-table-wrapper"},Ca=["onClick"],Na={class:"vpg-header-content"},ya={class:"vpg-header-text"},ba={class:"vpg-header-icons"},Fa={key:0,class:"vpg-sort-indicator"},Sa={key:0,class:"vpg-icon-sm",fill:"currentColor",viewBox:"0 0 20 20"},Ba={key:1,class:"vpg-icon-sm",fill:"currentColor",viewBox:"0 0 20 20"},xa={key:1,class:"vpg-filter-indicator"},Ma=["onMousedown"],$a=["data-row","data-col","onMousedown","onMouseenter"],Da={key:1,class:"vpg-pivot-container"},Ra={key:0,class:"vpg-pivot-config-panel"},Ta={class:"vpg-footer"},La={class:"vpg-footer-left"},za={key:0,class:"vpg-filtered-note"},Aa={key:1},Pa={class:"vpg-filtered-count"},Ua={key:0,class:"vpg-pagination"},ja=["disabled"],Ha=["disabled"],Ka={class:"vpg-page-info"},Oa=["disabled"],Wa=["disabled"],qa={key:1,class:"vpg-selection-stats"},Ga={class:"vpg-stat"},_a={class:"vpg-stat-value"},Ya={class:"vpg-stat"},Ia={class:"vpg-stat-value"},Xa={class:"vpg-stat"},Za={class:"vpg-stat-value"},Qa={class:"vpg-footer-right"},Ja={key:0,class:"vpg-demo-banner"},er={key:1,class:"vpg-watermark-inline"},Ve=120,Mt=350,tr=xe(e.defineComponent({__name:"DataGrid",props:{data:{},loading:{type:Boolean,default:!1},rowHeight:{default:36},headerHeight:{default:40},fontSize:{default:"xs"},showPivot:{type:Boolean,default:!0},enableExport:{type:Boolean,default:!0},enableSearch:{type:Boolean,default:!0},enablePagination:{type:Boolean,default:!1},pageSize:{default:50},enableColumnResize:{type:Boolean,default:!0},enableClipboard:{type:Boolean,default:!0},theme:{default:"light"},stripedRows:{type:Boolean,default:!0},exportFilename:{default:"data-export.csv"},enableVerticalResize:{type:Boolean,default:!0},initialHeight:{default:600},minHeight:{default:300},maxHeight:{default:1200}},emits:["cellClick","selectionChange","export","copy"],setup(t,{emit:r}){const l=t,a=r,{showWatermark:o,canUsePivot:s,isDemo:p,isPro:f}=Ke(),k=e.computed(()=>{var i;return l.theme==="auto"?(i=window.matchMedia)!=null&&i.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light":l.theme}),b=e.ref(l.fontSize),E=e.ref(""),S=e.ref(!1),F=e.ref(1),N=e.ref(null),w=e.ref(0),z=e.ref(0),W=e.ref(l.initialHeight),H=e.ref(!1),P=e.ref(0),M=e.ref(0),x=e.ref(!1),T=e.ref(""),U=[{value:"xs",label:"S"},{value:"sm",label:"M"},{value:"base",label:"L"}],_=e.computed(()=>l.data),{table:R,columnKeys:C,filteredRowCount:g,totalRowCount:d,getColumnStats:c,hasActiveFilter:u,setColumnFilter:V,getColumnFilterValues:$,clearAllFilters:j,toggleSort:J,getSortDirection:se,columnFilters:ve,activeFilters:ae,setNumericRangeFilter:Me,getNumericRangeFilter:ie}=Ct({data:_}),Oe=e.computed(()=>R.getFilteredRowModel().rows.map(n=>n.original)),We=e.computed(()=>ae.value.length===0?null:ae.value.map(i=>{var n;if(i.type==="range"&&i.range){const v=[];return i.range.min!==null&&v.push(`≥ ${i.range.min}`),i.range.max!==null&&v.push(`≤ ${i.range.max}`),{column:i.column,valueCount:1,displayText:v.join(" and "),isRange:!0}}return{column:i.column,valueCount:((n=i.values)==null?void 0:n.length)||0,values:i.values||[],isRange:!1}})),{rowFields:Ce,columnFields:Ne,valueFields:ye,showRowTotals:$e,showColumnTotals:De,availableFields:Ze,isConfigured:Re,pivotResult:ce,addRowField:Te,removeRowField:Le,addColumnField:qe,removeColumnField:y,addValueField:m,removeValueField:D,updateValueFieldAggregation:h,clearConfig:B,autoSuggestConfig:L}=St(Oe),K=e.computed(()=>{if(!E.value.trim()||!l.enableSearch)return Fe.value;const i=E.value.toLowerCase().trim();return Fe.value.filter(n=>{for(const v of C.value){const A=n.original[v];if(A!=null&&String(A).toLowerCase().includes(i))return!0}return!1})}),G=e.computed(()=>K.value.length),ee=e.computed(()=>l.enablePagination?Math.max(1,Math.ceil(G.value/l.pageSize)):1),oe=e.computed(()=>{if(!l.enablePagination)return K.value;const i=(F.value-1)*l.pageSize,n=i+l.pageSize;return K.value.slice(i,n)}),re=e.computed(()=>G.value===0?0:(F.value-1)*l.pageSize+1),de=e.computed(()=>Math.min(F.value*l.pageSize,G.value));function te(){F.value<ee.value&&F.value++}function be(){F.value>1&&F.value--}e.watch([ve,E],()=>{F.value=1});function ze(){if(le.value==="pivot"){lr();return}const i=l.enableSearch&&E.value.trim()?K.value.map(n=>n.original):Fe.value.map(n=>n.original);Nt(i,C.value,{filename:l.exportFilename,includeHeaders:!0}),a("export",{rowCount:i.length,filename:l.exportFilename})}function lr(){if(!ce.value)return;const i=l.exportFilename.replace(".csv","-pivot.csv");yt({headers:ce.value.headers,rowHeaders:ce.value.rowHeaders,data:ce.value.data,rowTotals:ce.value.rowTotals,columnTotals:ce.value.columnTotals,grandTotal:ce.value.grandTotal,showRowTotals:$e.value,showColumnTotals:De.value},Ce.value,Ne.value,ye.value,{filename:i});const n=ce.value.rowHeaders.length;a("export",{rowCount:n,filename:i})}function nr(i,n){l.enableColumnResize&&(n.preventDefault(),n.stopPropagation(),N.value=i,w.value=n.clientX,z.value=he.value[i]||Ve,document.addEventListener("mousemove",$t),document.addEventListener("mouseup",Dt))}function $t(i){if(!N.value)return;const n=i.clientX-w.value,v=Math.max(Ve,Math.min(Mt,z.value+n));he.value={...he.value,[N.value]:v}}function Dt(){N.value=null,document.removeEventListener("mousemove",$t),document.removeEventListener("mouseup",Dt)}function or(i){l.enableVerticalResize&&(i.preventDefault(),H.value=!0,P.value=i.clientY,M.value=W.value,document.addEventListener("mousemove",Rt),document.addEventListener("mouseup",Tt))}function Rt(i){if(!H.value)return;const n=i.clientY-P.value,v=Math.max(l.minHeight,Math.min(l.maxHeight,M.value+n));W.value=v}function Tt(){H.value=!1,document.removeEventListener("mousemove",Rt),document.removeEventListener("mouseup",Tt)}function Lt(){if(!me.value||!l.enableClipboard)return;const i=Ft(Fe.value.map(n=>n.original),C.value,me.value);bt(i,()=>{const n=(me.value.maxRow-me.value.minRow+1)*(me.value.maxCol-me.value.minCol+1);T.value=`Copied ${n} cell${n>1?"s":""}`,x.value=!0,setTimeout(()=>{x.value=!1},2e3),a("copy",{text:i,cellCount:n})},n=>{T.value="Copy failed",x.value=!0,setTimeout(()=>{x.value=!1},2e3),console.error("Copy failed:",n)})}const le=e.ref("grid"),Ae=e.ref(!0),nt=e.ref(null),pe=e.ref(wt());function ar(i){i.id||(i.id=`calc_${Date.now()}_${Math.random().toString(36).substr(2,9)}`),pe.value=[...pe.value,i],He(pe.value)}function rr(i){pe.value=pe.value.filter(A=>A.id!==i),He(pe.value);const n=`calc:${i}`,v=ye.value.find(A=>A.field===n);v&&D(n,v.aggregation)}function sr(i){pe.value=pe.value.map(n=>n.id===i.id?i:n),He(pe.value)}function ir(i){nt.value=i}function cr(){nt.value=null}function dr(i){Ce.value=i}function ur(i){Ne.value=i}const ot=e.ref(),zt=e.ref(),Fe=e.computed(()=>R.getRowModel().rows),Z=e.ref(null),Qe=e.ref({top:0,left:0,maxHeight:400}),he=e.ref({});function At(){if(typeof document>"u"||l.data.length===0)return;const i={},n=Math.min(100,l.data.length),A=document.createElement("canvas").getContext("2d");if(A){A.font="13px system-ui, -apple-system, sans-serif";for(const O of C.value){let X=A.measureText(O).width+56;for(let I=0;I<n;I++){const Y=l.data[I][O],Q=Y==null?"":String(Y),we=A.measureText(Q).width+28;X=Math.max(X,we)}i[O]=Math.min(Math.max(X,Ve),Mt)}he.value=i}}function mr(i,n){n.stopPropagation();const v=n.currentTarget,A=v.closest(".vpg-header-cell"),O=(A==null?void 0:A.getBoundingClientRect())||v.getBoundingClientRect(),X=280,I=12;let Y=O.left;Y+X>window.innerWidth-I&&(Y=window.innerWidth-X-I),Y=Math.max(I,Y);const Q=window.innerHeight-O.bottom-I,we=O.top-I;let Se,Be;Q>=300||Q>=we?(Se=O.bottom+4,Be=Math.min(400,Q-4)):(Be=Math.min(400,we-4),Se=O.top-Be-4),Qe.value={top:Se,left:Y,maxHeight:Be},Z.value=i}function Je(){Z.value=null}function gr(i,n){V(i,n)}function pr(i,n){Me(i,n)}function fr(i,n){if(n===null)se(i)&&(J(i),se(i)&&J(i));else{const v=se(i);v===null?(J(i),n==="desc"&&se(i)==="asc"&&J(i)):v!==n&&J(i)}}const et=e.computed(()=>ve.value.length),ke=e.ref(null),fe=e.ref(null),ue=e.ref(null),at=e.ref(!1);function vr(i){const n=Fe.value.length-1;n<0||(fe.value={row:0,col:i},ue.value={row:n,col:i},ke.value={row:0,col:i})}function hr(i,n){if(n.target.closest(".vpg-dropdown-arrow")){const A=C.value[i];mr(A,n)}else vr(i)}const me=e.computed(()=>!fe.value||!ue.value?null:{minRow:Math.min(fe.value.row,ue.value.row),maxRow:Math.max(fe.value.row,ue.value.row),minCol:Math.min(fe.value.col,ue.value.col),maxCol:Math.max(fe.value.col,ue.value.col)});function kr(i,n){if(!me.value)return!1;const{minRow:v,maxRow:A,minCol:O,maxCol:X}=me.value;return i>=v&&i<=A&&n>=O&&n<=X}const Pe=e.computed(()=>{if(!me.value)return null;const{minRow:i,maxRow:n,minCol:v,maxCol:A}=me.value,O=[];let X=0;for(let Q=i;Q<=n;Q++){const we=Fe.value[Q];if(we)for(let Se=v;Se<=A;Se++){const Be=C.value[Se];if(!Be)continue;const Ue=we.original[Be];if(X++,Ue!=null&&Ue!==""){const Ot=typeof Ue=="number"?Ue:Number.parseFloat(String(Ue));Number.isNaN(Ot)||O.push(Ot)}}}if(O.length===0)return{count:X,sum:null,avg:null,numericCount:0};const I=O.reduce((Q,we)=>Q+we,0),Y=I/O.length;return{count:X,sum:I,avg:Y,numericCount:O.length}});function Pt(i){return i===null?"-":Math.abs(i)>=1e3?i.toLocaleString("en-US",{maximumFractionDigits:2}):i.toLocaleString("en-US",{maximumFractionDigits:4})}function Ut(i){if((i.ctrlKey||i.metaKey)&&i.key==="c"&&me.value){i.preventDefault(),Lt();return}if((i.ctrlKey||i.metaKey)&&i.key==="f"&&l.enableSearch){i.preventDefault(),S.value=!0,e.nextTick(()=>{const Y=document.querySelector(".vpg-search-input");Y==null||Y.focus()});return}if(!ke.value||Z.value)return;const{row:n,col:v}=ke.value,O=oe.value.length-1,X=C.value.length-1;function I(Y,Q){i.shiftKey?(fe.value||(fe.value={row:n,col:v}),ue.value={row:Y,col:Q}):(fe.value={row:Y,col:Q},ue.value={row:Y,col:Q}),ke.value={row:Y,col:Q},wr(Y,Q)}switch(i.key){case"ArrowUp":i.preventDefault(),n>0&&I(n-1,v);break;case"ArrowDown":i.preventDefault(),n<O&&I(n+1,v);break;case"ArrowLeft":i.preventDefault(),v>0&&I(n,v-1);break;case"ArrowRight":i.preventDefault(),v<X&&I(n,v+1);break;case"Escape":ke.value=null,fe.value=null,ue.value=null,S.value=!1,E.value="";break}}function wr(i,n){e.nextTick(()=>{var A;const v=(A=zt.value)==null?void 0:A.querySelector(`[data-row="${i}"][data-col="${n}"]`);v==null||v.scrollIntoView({block:"nearest",inline:"nearest"})})}function Vr(i,n,v){v.preventDefault(),v.shiftKey&&ke.value?ue.value={row:i,col:n}:(ke.value={row:i,col:n},fe.value={row:i,col:n},ue.value={row:i,col:n},at.value=!0);const A=Fe.value[i];if(A){const O=C.value[n];a("cellClick",{row:i,col:n,value:A.original[O],rowData:A.original})}}function Er(i,n){at.value&&(ue.value={row:i,col:n})}function jt(){at.value=!1}function Cr(i,n){var v,A;return kr(i,n)?!0:((v=ke.value)==null?void 0:v.row)===i&&((A=ke.value)==null?void 0:A.col)===n}const Nr=/^(?:.*_)?(?:id|code|year|month|quarter|day|week|date|zip|phone|fax|ssn|ein|npi|ndc|gpi|hcpcs|icd|cpt|rx|bin|pcn|group|member|claim|rx_number|script|fill)(?:_.*)?$/i;function yr(i){return!Nr.test(i)}function br(i,n){if(i==null||i==="")return"";if(c(n).type==="number"){const A=typeof i=="number"?i:Number.parseFloat(String(i));return Number.isNaN(A)?String(i):yr(n)&&Math.abs(A)>=1e3?A.toLocaleString("en-US",{maximumFractionDigits:2}):Number.isInteger(A)?String(A):A.toLocaleString("en-US",{maximumFractionDigits:4,useGrouping:!1})}return String(i)}function Ht(){Z.value&&Je()}function Kt(i){var n;if(Z.value){const v=i.target;if(v&&((n=v.closest)!=null&&n.call(v,".vpg-filter-portal")))return;Je()}}e.onMounted(()=>{At(),document.addEventListener("keydown",Ut),document.addEventListener("mouseup",jt),e.nextTick(()=>{var i;(i=ot.value)==null||i.addEventListener("scroll",Ht,{passive:!0})}),window.addEventListener("scroll",Kt,{passive:!0,capture:!0})}),e.onUnmounted(()=>{var i;document.removeEventListener("keydown",Ut),document.removeEventListener("mouseup",jt),(i=ot.value)==null||i.removeEventListener("scroll",Ht),window.removeEventListener("scroll",Kt,{capture:!0})}),e.watch(()=>l.data,()=>{e.nextTick(At)},{immediate:!0});const Fr=e.computed(()=>C.value.reduce((i,n)=>i+(he.value[n]||Ve),0));function Sr(i){Z.value&&(i.target.closest(".vpg-filter-portal")||Je())}return(i,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vpg-data-grid",[`vpg-font-${b.value}`,`vpg-theme-${k.value}`,{"vpg-striped":t.stripedRows},{"vpg-resizing":N.value},{"vpg-resizing-vertical":H.value}]]),style:e.normalizeStyle({height:`${W.value}px`}),onClick:Sr},[e.createVNode(e.Transition,{name:"vpg-toast"},{default:e.withCtx(()=>[x.value?(e.openBlock(),e.createElementBlock("div",oa,[n[17]||(n[17]=e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)),e.createTextVNode(" "+e.toDisplayString(T.value),1)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",aa,[e.createElementVNode("div",ra,[t.showPivot?(e.openBlock(),e.createElementBlock("div",sa,[e.createElementVNode("button",{class:e.normalizeClass(["vpg-view-btn",{active:le.value==="grid"}]),onClick:n[0]||(n[0]=v=>le.value="grid")},[...n[18]||(n[18]=[e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),e.createTextVNode(" Grid ",-1)])],2),e.createElementVNode("button",{class:e.normalizeClass(["vpg-view-btn vpg-pivot-btn",{active:le.value==="pivot"}]),onClick:n[1]||(n[1]=v=>le.value="pivot")},[...n[19]||(n[19]=[e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})],-1),e.createTextVNode(" Pivot ",-1)])],2)])):e.createCommentVNode("",!0),le.value==="grid"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.enableSearch?(e.openBlock(),e.createElementBlock("div",ia,[S.value?(e.openBlock(),e.createElementBlock("div",ca,[n[22]||(n[22]=e.createElementVNode("svg",{class:"vpg-search-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[3]||(n[3]=v=>E.value=v),type:"text",class:"vpg-search-input",placeholder:"Search all columns...",onKeydown:n[4]||(n[4]=e.withKeys(v=>{S.value=!1,E.value=""},["escape"]))},null,544),[[e.vModelText,E.value]]),E.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vpg-search-clear",onClick:n[5]||(n[5]=v=>E.value="")},[...n[21]||(n[21]=[e.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",{key:0,class:"vpg-icon-btn",title:"Search (Ctrl+F)",onClick:n[2]||(n[2]=v=>S.value=!0)},[...n[20]||(n[20]=[e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("div",da,[n[23]||(n[23]=e.createElementVNode("span",{class:"vpg-label"},"Size:",-1)),e.createElementVNode("div",ua,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(U,v=>e.createElementVNode("button",{key:v.value,class:e.normalizeClass(["vpg-font-size-btn",{active:b.value===v.value}]),onClick:A=>b.value=v.value},e.toDisplayString(v.label),11,ma)),64))])]),et.value>0?(e.openBlock(),e.createElementBlock("div",ga,[n[24]||(n[24]=e.createElementVNode("svg",{class:"vpg-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1)),e.createElementVNode("span",null,e.toDisplayString(et.value)+" filter"+e.toDisplayString(et.value>1?"s":""),1)])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",pa,[e.createElementVNode("span",null,e.toDisplayString(G.value)+" match"+e.toDisplayString(G.value!==1?"es":""),1)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),le.value==="pivot"&&e.unref(s)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("button",{class:e.normalizeClass(["vpg-config-toggle",{active:Ae.value}]),onClick:n[6]||(n[6]=v=>Ae.value=!Ae.value)},[n[25]||(n[25]=e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})],-1)),e.createTextVNode(" "+e.toDisplayString(Ae.value?"Hide":"Show")+" Config ",1)],2),e.unref(Re)?(e.openBlock(),e.createElementBlock("div",fa,[...n[26]||(n[26]=[e.createElementVNode("svg",{class:"vpg-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1),e.createElementVNode("span",null,"Pivot configured",-1)])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",va,[le.value==="grid"&&et.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"vpg-clear-filters",onClick:n[7]||(n[7]=(...v)=>e.unref(j)&&e.unref(j)(...v))},[...n[27]||(n[27]=[e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),e.createTextVNode(" Clear Filters ",-1)])])):e.createCommentVNode("",!0),t.enableClipboard&&me.value&&le.value==="grid"?(e.openBlock(),e.createElementBlock("button",{key:1,class:"vpg-icon-btn",title:"Copy selection (Ctrl+C)",onClick:Lt},[...n[28]||(n[28]=[e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)])])):e.createCommentVNode("",!0),t.enableExport&&le.value==="grid"?(e.openBlock(),e.createElementBlock("button",{key:2,class:"vpg-export-btn",title:"Export to CSV",onClick:ze},[...n[29]||(n[29]=[e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1),e.createTextVNode(" Export ",-1)])])):e.createCommentVNode("",!0),t.enableExport&&le.value==="pivot"&&e.unref(Re)?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["vpg-export-btn",{"vpg-export-btn-disabled":!e.unref(f)}]),disabled:!e.unref(f),title:e.unref(f)?"Export Pivot to CSV":"Export Pivot to CSV (Pro feature)",onClick:n[8]||(n[8]=v=>e.unref(f)&&ze())},[n[30]||(n[30]=e.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)),e.createTextVNode(" Export Pivot"+e.toDisplayString(e.unref(f)?"":" (Pro)"),1)],10,ha)):e.createCommentVNode("",!0)])]),le.value==="grid"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"tableContainerRef",ref:ot,class:"vpg-grid-container",tabindex:"0"},[t.loading?(e.openBlock(),e.createElementBlock("div",ka,[...n[31]||(n[31]=[e.createElementVNode("div",{class:"vpg-spinner"},null,-1),e.createElementVNode("span",null,"Loading data...",-1)])])):t.data.length===0?(e.openBlock(),e.createElementBlock("div",wa,[...n[32]||(n[32]=[e.createElementVNode("div",{class:"vpg-empty-icon"},[e.createElementVNode("svg",{class:"vpg-icon-lg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),e.createElementVNode("span",null,"No data available",-1)])])):e.unref(g)===0?(e.openBlock(),e.createElementBlock("div",Va,[n[33]||(n[33]=e.createElementVNode("div",{class:"vpg-empty-icon vpg-warning"},[e.createElementVNode("svg",{class:"vpg-icon-lg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})])],-1)),n[34]||(n[34]=e.createElementVNode("span",null,"No matching records",-1)),e.createElementVNode("button",{class:"vpg-clear-link",onClick:n[9]||(n[9]=(...v)=>e.unref(j)&&e.unref(j)(...v))}," Clear all filters ")])):(e.openBlock(),e.createElementBlock("div",Ea,[e.createElementVNode("table",{class:"vpg-table",style:e.normalizeStyle({minWidth:`${Fr.value}px`})},[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(C),(v,A)=>(e.openBlock(),e.createElementBlock("th",{key:v,class:e.normalizeClass(["vpg-header-cell",{"vpg-has-filter":e.unref(u)(v),"vpg-is-sorted":e.unref(se)(v)!==null,"vpg-is-active":Z.value===v}]),style:e.normalizeStyle({width:`${he.value[v]||Ve}px`,minWidth:`${he.value[v]||Ve}px`}),onClick:O=>hr(A,O)},[e.createElementVNode("div",Na,[e.createElementVNode("span",ya,e.toDisplayString(v),1),e.createElementVNode("div",ba,[e.unref(se)(v)?(e.openBlock(),e.createElementBlock("span",Fa,[e.unref(se)(v)==="asc"?(e.openBlock(),e.createElementBlock("svg",Sa,[...n[35]||(n[35]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Ba,[...n[36]||(n[36]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])]))])):e.createCommentVNode("",!0),e.unref(u)(v)?(e.openBlock(),e.createElementBlock("span",xa,[...n[37]||(n[37]=[e.createElementVNode("svg",{class:"vpg-icon-xs",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1)])])):e.createCommentVNode("",!0),n[38]||(n[38]=e.createElementVNode("span",{class:"vpg-dropdown-arrow",title:"Filter & Sort"},[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})])],-1))])]),t.enableColumnResize?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vpg-resize-handle",onMousedown:O=>nr(v,O)},null,40,Ma)):e.createCommentVNode("",!0)],14,Ca))),128))])]),e.createElementVNode("tbody",{ref_key:"tableBodyRef",ref:zt},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(v,A)=>(e.openBlock(),e.createElementBlock("tr",{key:v.id,class:"vpg-row"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(C),(O,X)=>(e.openBlock(),e.createElementBlock("td",{key:O,class:e.normalizeClass(["vpg-cell",{"vpg-selected":Cr(A,X),"vpg-is-number":e.unref(c)(O).type==="number"}]),"data-row":A,"data-col":X,style:e.normalizeStyle({width:`${he.value[O]||Ve}px`,minWidth:`${he.value[O]||Ve}px`}),onMousedown:I=>Vr(A,X,I),onMouseenter:I=>Er(A,X)},e.toDisplayString(br(v.original[O],O)),47,$a))),128))]))),128))],512)],4)]))],512)):(e.openBlock(),e.createElementBlock("div",Da,[Ae.value&&e.unref(s)?(e.openBlock(),e.createElementBlock("div",Ra,[e.createVNode(Bt,{"available-fields":e.unref(Ze),"row-fields":e.unref(Ce),"column-fields":e.unref(Ne),"value-fields":e.unref(ye),"show-row-totals":e.unref($e),"show-column-totals":e.unref(De),"calculated-fields":pe.value,"onUpdate:showRowTotals":n[10]||(n[10]=v=>$e.value=v),"onUpdate:showColumnTotals":n[11]||(n[11]=v=>De.value=v),onClearConfig:e.unref(B),onDragStart:ir,onDragEnd:cr,onUpdateAggregation:e.unref(h),onAddRowField:e.unref(Te),onRemoveRowField:e.unref(Le),onAddColumnField:e.unref(qe),onRemoveColumnField:e.unref(y),onAddValueField:e.unref(m),onRemoveValueField:e.unref(D),onAddCalculatedField:ar,onRemoveCalculatedField:rr,onUpdateCalculatedField:sr},null,8,["available-fields","row-fields","column-fields","value-fields","show-row-totals","show-column-totals","calculated-fields","onClearConfig","onUpdateAggregation","onAddRowField","onRemoveRowField","onAddColumnField","onRemoveColumnField","onAddValueField","onRemoveValueField"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["vpg-pivot-main",{"vpg-full-width":!Ae.value}])},[e.createVNode(xt,{"row-fields":e.unref(Ce),"column-fields":e.unref(Ne),"value-fields":e.unref(ye),"calculated-fields":pe.value,"is-configured":e.unref(Re),"dragging-field":nt.value,"pivot-result":e.unref(ce),"font-size":b.value,"active-filters":We.value,"total-row-count":e.unref(d),"filtered-row-count":e.unref(g),onAddRowField:e.unref(Te),onRemoveRowField:e.unref(Le),onAddColumnField:e.unref(qe),onRemoveColumnField:e.unref(y),onAddValueField:e.unref(m),onRemoveValueField:e.unref(D),onUpdateAggregation:e.unref(h),onReorderRowFields:dr,onReorderColumnFields:ur},null,8,["row-fields","column-fields","value-fields","calculated-fields","is-configured","dragging-field","pivot-result","font-size","active-filters","total-row-count","filtered-row-count","onAddRowField","onRemoveRowField","onAddColumnField","onRemoveColumnField","onAddValueField","onRemoveValueField","onUpdateAggregation"])],2)])),e.createElementVNode("div",Ta,[e.createElementVNode("div",La,[le.value==="grid"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.enablePagination?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString(re.value.toLocaleString())+"-"+e.toDisplayString(de.value.toLocaleString()),1),n[39]||(n[39]=e.createElementVNode("span",{class:"vpg-separator"},"of",-1)),e.createElementVNode("span",null,e.toDisplayString(G.value.toLocaleString()),1),G.value!==e.unref(d)?(e.openBlock(),e.createElementBlock("span",za," ("+e.toDisplayString(e.unref(d).toLocaleString())+" total) ",1)):e.createCommentVNode("",!0)],64)):e.unref(g)===e.unref(d)&&G.value===e.unref(d)?(e.openBlock(),e.createElementBlock("span",Aa,e.toDisplayString(e.unref(d).toLocaleString())+" records",1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("span",Pa,e.toDisplayString(G.value.toLocaleString()),1),n[40]||(n[40]=e.createElementVNode("span",{class:"vpg-separator"},"of",-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(d).toLocaleString()),1),n[41]||(n[41]=e.createElementVNode("span",{class:"vpg-separator"},"records",-1))],64))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[42]||(n[42]=e.createElementVNode("span",{class:"vpg-pivot-label"},"Pivot Table",-1)),n[43]||(n[43]=e.createElementVNode("span",{class:"vpg-separator"},"•",-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(d).toLocaleString())+" source records",1)],64))]),t.enablePagination&&le.value==="grid"&&ee.value>1?(e.openBlock(),e.createElementBlock("div",Ua,[e.createElementVNode("button",{class:"vpg-page-btn",disabled:F.value===1,onClick:n[12]||(n[12]=v=>F.value=1)},[...n[44]||(n[44]=[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})],-1)])],8,ja),e.createElementVNode("button",{class:"vpg-page-btn",disabled:F.value===1,onClick:be},[...n[45]||(n[45]=[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])],8,Ha),e.createElementVNode("span",Ka," Page "+e.toDisplayString(F.value)+" of "+e.toDisplayString(ee.value),1),e.createElementVNode("button",{class:"vpg-page-btn",disabled:F.value===ee.value,onClick:te},[...n[46]||(n[46]=[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],8,Oa),e.createElementVNode("button",{class:"vpg-page-btn",disabled:F.value===ee.value,onClick:n[13]||(n[13]=v=>F.value=ee.value)},[...n[47]||(n[47]=[e.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 5l7 7-7 7M5 5l7 7-7 7"})],-1)])],8,Wa)])):e.createCommentVNode("",!0),le.value==="grid"&&Pe.value&&Pe.value.count>1?(e.openBlock(),e.createElementBlock("div",qa,[e.createElementVNode("span",Ga,[n[48]||(n[48]=e.createElementVNode("span",{class:"vpg-stat-label"},"Count:",-1)),e.createElementVNode("span",_a,e.toDisplayString(Pe.value.count),1)]),Pe.value.numericCount>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[51]||(n[51]=e.createElementVNode("span",{class:"vpg-stat-divider"},"|",-1)),e.createElementVNode("span",Ya,[n[49]||(n[49]=e.createElementVNode("span",{class:"vpg-stat-label"},"Sum:",-1)),e.createElementVNode("span",Ia,e.toDisplayString(Pt(Pe.value.sum)),1)]),n[52]||(n[52]=e.createElementVNode("span",{class:"vpg-stat-divider"},"|",-1)),e.createElementVNode("span",Xa,[n[50]||(n[50]=e.createElementVNode("span",{class:"vpg-stat-label"},"Avg:",-1)),e.createElementVNode("span",Za,e.toDisplayString(Pt(Pe.value.avg)),1)])],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Qa,[e.unref(p)?(e.openBlock(),e.createElementBlock("div",Ja,[...n[53]||(n[53]=[e.createElementVNode("span",{class:"vpg-demo-badge"},"DEMO",-1),e.createElementVNode("span",null,"Pro features enabled",-1),e.createElementVNode("a",{href:"https://tiny-pivot.com/#pricing",target:"_blank",rel:"noopener"},"Get License →",-1)])])):e.unref(o)?(e.openBlock(),e.createElementBlock("span",er,[...n[54]||(n[54]=[e.createStaticVNode('<a href="https://tiny-pivot.com" target="_blank" rel="noopener" data-v-4e45a194><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-4e45a194><rect x="3" y="3" width="7" height="7" data-v-4e45a194></rect><rect x="14" y="3" width="7" height="7" data-v-4e45a194></rect><rect x="14" y="14" width="7" height="7" data-v-4e45a194></rect><rect x="3" y="14" width="7" height="7" data-v-4e45a194></rect></svg> Powered by TinyPivot </a>',1)])])):e.createCommentVNode("",!0)])]),t.enableVerticalResize?(e.openBlock(),e.createElementBlock("div",{key:2,class:"vpg-vertical-resize-handle",onMousedown:or},[...n[55]||(n[55]=[e.createElementVNode("div",{class:"vpg-resize-grip"},[e.createElementVNode("span"),e.createElementVNode("span"),e.createElementVNode("span")],-1)])],32)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Z.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vpg-filter-portal",style:e.normalizeStyle({position:"fixed",top:`${Qe.value.top}px`,left:`${Qe.value.left}px`,maxHeight:`${Qe.value.maxHeight}px`,zIndex:9999})},[e.createVNode(Vt,{"column-id":Z.value,"column-name":Z.value,stats:e.unref(c)(Z.value),"selected-values":e.unref($)(Z.value),"sort-direction":e.unref(se)(Z.value),"numeric-range":e.unref(ie)(Z.value),onFilter:n[14]||(n[14]=v=>gr(Z.value,v)),onRangeFilter:n[15]||(n[15]=v=>pr(Z.value,v)),onSort:n[16]||(n[16]=v=>fr(Z.value,v)),onClose:Je},null,8,["column-id","column-name","stats","selected-values","sort-direction","numeric-range"])],4)):e.createCommentVNode("",!0)]))],6))}}),[["__scopeId","data-v-4e45a194"]]);q.ColumnFilter=Vt,q.DataGrid=tr,q.PivotConfig=Bt,q.PivotSkeleton=xt,q.configureLicenseSecret=Cn,q.copyToClipboard=bt,q.enableDemoMode=En,q.exportPivotToCSV=yt,q.exportToCSV=Nt,q.formatCellValue=dt,q.formatSelectionForClipboard=Ft,q.getAggregationLabel=je,q.getColumnUniqueValues=ct,q.setLicenseKey=Vn,q.useColumnResize=kn,q.useExcelGrid=Ct,q.useGlobalSearch=vn,q.useLicense=Ke,q.usePagination=fn,q.usePivotTable=St,q.useRowSelection=hn,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
|
8
|
+
-----END PUBLIC KEY-----`;function ts(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4;)e+="=";const t=atob(e),a=new Uint8Array(t.length);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return a}function gn(n){if(n[0]!==48)throw new Error("Invalid DER signature");let e=2;if(n[e]!==2)throw new Error("Invalid DER signature");e++;const t=n[e];e++;let a=n.slice(e,e+t);if(e+=t,n[e]!==2)throw new Error("Invalid DER signature");e++;const i=n[e];e++;let s=n.slice(e,e+i);a.length===33&&a[0]===0&&(a=a.slice(1)),s.length===33&&s[0]===0&&(s=s.slice(1));const r=new Uint8Array(32),o=new Uint8Array(32);r.set(a,32-a.length),o.set(s,32-s.length);const l=new Uint8Array(64);return l.set(r,0),l.set(o,32),l}async function pn(){try{const n=un.replace("-----BEGIN PUBLIC KEY-----","").replace("-----END PUBLIC KEY-----","").replace(/\s/g,""),e=ts(n);return await crypto.subtle.importKey("spki",new Uint8Array(e).buffer,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}catch{return null}}async function fn(n,e,t){const a=`TP-${n}-${t}`;try{const i=await pn();if(!i)return!1;const r=new TextEncoder().encode(a),o=ts(e),l=gn(o);return await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},i,new Uint8Array(l).buffer,r)}catch{return!1}}async function mn(n){if(!n||n==="")return es;if(!n.startsWith("TP-"))return ka;const e=n.lastIndexOf("-");if(e===-1||n.length-e!==9)return ka;const t=n.slice(e+1),a=n.slice(3),i=a.indexOf("-");if(i===-1)return ka;const s=a.slice(0,i),r=a.slice(i+1,a.lastIndexOf("-"));if(!await fn(s,r,t))return ka;const l=Number.parseInt(t.slice(0,4)),h=Number.parseInt(t.slice(4,6))-1,d=Number.parseInt(t.slice(6,8)),u=new Date(l,h,d);let g="free";return s==="PRO1"?g="pro-single":s==="PROU"?g="pro-unlimited":s==="PROT"&&(g="pro-team"),{type:g,isValid:!0,expiresAt:u,features:{pivot:g!=="free",advancedAggregations:g!=="free",percentageMode:g!=="free",sessionPersistence:g!=="free",noWatermark:g!=="free",charts:g!=="free"}}}function xn(n){console.warn("[TinyPivot] configureLicenseSecret() is deprecated and no longer needed.")}const bn="A48AA0618518D3E62F31FCFCA2DD2B86E7FE0863E2F90756FB0A960AE7A51583";async function vn(n){try{const t=new TextEncoder().encode(n),a=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("").toUpperCase()}catch{return""}}async function yn(n){return!n||await vn(n)!==bn?null:dn}function wn(){return es}function kn(n){return n.features.pivot}function Cn(n){return n.features.charts}function An(n){return n.isValid&&n.type!=="free"}function Sn(n,e){return e||!n.features.noWatermark}function En(n){console.warn(`[TinyPivot] "${n}" requires a Pro license. Visit https://tiny-pivot.com/#pricing to upgrade.`)}function Mn(n){const e=n.filter(o=>o!=null&&o!=="");if(e.length===0)return"string";const t=e.slice(0,100);let a=0,i=0,s=0;for(const o of t)typeof o=="boolean"?s++:typeof o=="number"||!Number.isNaN(Number(o))&&o!==""?a++:(o instanceof Date||!Number.isNaN(Date.parse(String(o))))&&i++;const r=t.length*.8;return s>=r?"boolean":a>=r?"number":i>=r?"date":"string"}function Ln(n,e){const a=n.map(o=>o[e]).filter(o=>o!=null&&o!=="").slice(0,100);let i=0;const s=new Set;for(const o of a)s.add(String(o)),(typeof o=="number"||!Number.isNaN(Number(o))&&o!=="")&&i++;const r=i>=a.length*.8;return{field:e,type:r?"number":"string",uniqueCount:s.size,isNumeric:r}}function as(n,e,t=500){const a=[];let i=0,s,r;for(const d of n){const u=d[e];if(u==null||u==="")i++;else{a.push(u);const g=typeof u=="number"?u:Number.parseFloat(String(u));Number.isNaN(g)||((s===void 0||g<s)&&(s=g),(r===void 0||g>r)&&(r=g))}}const o=new Set;for(const d of a)if(o.add(String(d)),o.size>=t)break;const l=Array.from(o).sort((d,u)=>{const g=Number.parseFloat(d),p=Number.parseFloat(u);return!Number.isNaN(g)&&!Number.isNaN(p)?g-p:d.localeCompare(u)}),h=Mn(a);return{uniqueValues:l,totalCount:n.length,nullCount:i,type:h,...h==="number"&&s!==void 0&&r!==void 0?{numericMin:s,numericMax:r}:{}}}function is(n,e){if(n==null||n==="")return"";switch(e){case"number":{const t=typeof n=="number"?n:Number.parseFloat(String(n));return Number.isNaN(t)?String(n):Math.abs(t)>=1e3?t.toLocaleString("en-US",{maximumFractionDigits:2}):t.toLocaleString("en-US",{maximumFractionDigits:4})}case"date":{const t=n instanceof Date?n:new Date(String(n));return Number.isNaN(t.getTime())?String(n):t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}case"boolean":return n?"Yes":"No";default:return String(n)}}function ss(n,e){return e.map(t=>String(n[t]??"(blank)")).join("|||")}function rs(n){return n.split("|||")}function Nn(n){const e=[...n].sort((a,i)=>a-i),t=Math.floor(e.length/2);return e.length%2!==0?e[t]:(e[t-1]+e[t])/2}function Fn(n){const e=n.reduce((i,s)=>i+s,0)/n.length,a=n.map(i=>(i-e)**2).reduce((i,s)=>i+s,0)/n.length;return Math.sqrt(a)}function Ca(n,e,t,a,i){if(n.length===0&&e!=="custom")return null;switch(e){case"sum":return n.reduce((s,r)=>s+r,0);case"count":return n.length;case"avg":return n.reduce((s,r)=>s+r,0)/n.length;case"min":return Math.min(...n);case"max":return Math.max(...n);case"countDistinct":return new Set(n).size;case"median":return Nn(n);case"stdDev":return Fn(n);case"percentOfTotal":{const s=n.reduce((r,o)=>r+o,0);return t===void 0||t===0?null:s/t*100}case"custom":return null;default:return n.reduce((s,r)=>s+r,0)}}function Aa(n,e){return n===null?"-":e==="count"||e==="countDistinct"?Math.round(n).toLocaleString():e==="percentOfTotal"?`${n.toFixed(1)}%`:e==="stdDev"?n.toLocaleString("en-US",{maximumFractionDigits:2}):Math.abs(n)>=1e3?n.toLocaleString("en-US",{maximumFractionDigits:2}):n.toLocaleString("en-US",{maximumFractionDigits:4})}function ea(n,e){return n==="custom"&&e?e:{sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max",countDistinct:"Count Distinct",median:"Median",stdDev:"Std Dev",percentOfTotal:"% of Total",custom:"Custom"}[n]}function ns(n,e){return n==="custom"&&e?e:{sum:"Σ",count:"#",avg:"x̄",min:"↓",max:"↑",countDistinct:"◇",median:"M̃",stdDev:"σ",percentOfTotal:"%Σ",custom:"ƒ"}[n]}const zn=[{value:"sum",label:"Sum",symbol:"Σ"},{value:"count",label:"Count",symbol:"#"},{value:"avg",label:"Avg",symbol:"x̄"},{value:"min",label:"Min",symbol:"↓"},{value:"max",label:"Max",symbol:"↑"},{value:"countDistinct",label:"Unique",symbol:"◇"},{value:"median",label:"Median",symbol:"M̃"},{value:"stdDev",label:"Std Dev",symbol:"σ"},{value:"percentOfTotal",label:"% of Total",symbol:"%Σ"}];function Tn(n,e,t=2){if(n===null)return"-";switch(e){case"percent":return`${n.toFixed(t)}%`;case"currency":return n.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:t,maximumFractionDigits:t});default:return n.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:t})}}function os(n){const e=n.match(/[a-z_]\w*/gi)||[],t=["true","false","null","undefined"];return[...new Set(e.filter(a=>!t.includes(a.toLowerCase())))]}function ls(n,e){if(!n.trim())return"Formula is required";const t=os(n);if(t.length===0)return"Formula must reference at least one field";const a=e.map(i=>i.toLowerCase());for(const i of t)if(!a.includes(i.toLowerCase()))return`Unknown field: ${i}`;try{let i=n;for(const s of t){const r=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(`\\b${r}\\b`,"gi"),"1")}new Function(`return ${i}`)}catch{return"Invalid formula syntax"}return null}function cs(n,e,t){try{const a=os(n);let i=n;for(const r of a){const o=t.find(u=>u.toLowerCase()===r.toLowerCase())||r,l=e[o];if(l==null||l==="")return null;const h=typeof l=="number"?l:Number.parseFloat(String(l));if(Number.isNaN(h))return null;const d=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(`\\b${d}\\b`,"gi"),String(h))}if(!/^[\d\s+\-*/().]+$/.test(i))return null;const s=new Function(`return ${i}`)();return typeof s=="number"&&Number.isFinite(s)?s:null}catch{return null}}function Pn(n){return n.length===0?[]:Object.keys(n[0]).map(t=>Ln(n,t))}function Dn(n,e,t,a){const i=new Set([...e,...t,...a.map(s=>s.field)]);return n.filter(s=>!i.has(s.field))}function hs(n){return(n.rowFields.length>0||n.columnFields.length>0)&&n.valueFields.length>0}function Rn(n,e){const{rowFields:t,columnFields:a,valueFields:i,showRowTotals:s,showColumnTotals:r,calculatedFields:o}=e;if(!hs(e)||n.length===0)return null;const l=new Map;if(o)for(const C of o)l.set(C.id,C);const h=n.length>0?Object.keys(n[0]):[],d=new Set,u=new Set,g=new Map;for(const C of n){const N=t.length>0?ss(C,t):"__all__",L=a.length>0?ss(C,a):"__all__";d.add(N),u.add(L),g.has(N)||g.set(N,new Map);const A=g.get(N);A.has(L)||A.set(L,i.map(()=>[]));const M=A.get(L);for(let F=0;F<i.length;F++){const z=i[F];let B=null;if(z.field.startsWith("calc:")){const T=z.field.replace("calc:",""),D=l.get(T);D&&(B=cs(D.formula,C,h))}else{const T=C[z.field];T!=null&&T!==""&&(B=typeof T=="number"?T:Number.parseFloat(String(T)),Number.isNaN(B)&&(B=z.aggregation==="count"||z.aggregation==="countDistinct"?1:null))}B!==null&&M[F].push(B)}}const p=Array.from(d).sort(),f=Array.from(u).sort(),m=i.map((C,N)=>{let L=0;for(const A of n){let M=null;if(C.field.startsWith("calc:")){const F=C.field.replace("calc:",""),z=l.get(F);z&&(M=cs(z.formula,A,h))}else{const F=A[C.field];F!=null&&F!==""&&(M=typeof F=="number"?F:Number.parseFloat(String(F)),Number.isNaN(M)&&(M=null))}M!==null&&(L+=M)}return L});function x(C){if(C.field.startsWith("calc:")){const N=C.field.replace("calc:",""),L=l.get(N);return`${(L==null?void 0:L.name)||C.field} (${ea(C.aggregation)})`}return`${C.label||C.field} (${ea(C.aggregation)})`}const b=[];if(a.length>0){const C=i.length>1?i.length:1;for(let N=0;N<a.length;N++){const L=[];for(const A of f){const M=rs(A);for(let F=0;F<C;F++)L.push(M[N]||"")}b.push(L)}}if(i.length>1||b.length===0){const C=[];for(const N of f)for(const L of i)C.push(x(L));f.length===1&&f[0]==="__all__"?b.push(i.map(N=>x(N))):b.push(C)}const v=p.map(C=>C==="__all__"?["Total"]:rs(C)),w=[],k=[],y=new Map;for(const C of p){const N=[],L=i.map(()=>[]);for(const A of f){const M=g.get(C),F=(M==null?void 0:M.get(A))||i.map(()=>[]);for(let B=0;B<F.length;B++)L[B].push(...F[B]);y.has(A)||y.set(A,i.map(()=>[]));const z=y.get(A);for(let B=0;B<F.length;B++)z[B].push(...F[B]);for(let B=0;B<i.length;B++){const T=i[B],D=F[B]||[],I=m[B],Y=Ca(D,T.aggregation,I);let $;if(T.field.startsWith("calc:")){const K=T.field.replace("calc:",""),ie=l.get(K);$=Tn(Y,(ie==null?void 0:ie.formatAs)||"number",(ie==null?void 0:ie.decimals)??2)}else $=Aa(Y,T.aggregation);N.push({value:Y,count:D.length,formattedValue:$})}}if(w.push(N),s&&f.length>1)if(i.length>0){const A=i[0],M=L[0]||[],F=Ca(M,A.aggregation,m[0]);k.push({value:F,count:M.length,formattedValue:Aa(F,A.aggregation)})}else k.push({value:null,count:0,formattedValue:"-"})}const E=[];if(r&&p.length>1)for(const C of f){const N=y.get(C)||i.map(()=>[]);for(let L=0;L<i.length;L++){const A=i[L],M=N[L]||[],F=Ca(M,A.aggregation,m[L]);E.push({value:F,count:M.length,formattedValue:Aa(F,A.aggregation)})}}const S={value:null,count:0,formattedValue:"-"};if(s&&r&&i.length>0){const C=i.map(()=>[]);for(const M of p){const F=g.get(M);if(F)for(const z of f){const B=F.get(z);if(B)for(let T=0;T<B.length;T++)C[T].push(...B[T])}}const N=i[0],L=C[0]||[],A=Ca(L,N.aggregation,m[0]);S.value=A,S.count=L.length,S.formattedValue=Aa(A,N.aggregation)}return{headers:b,rowHeaders:v,data:w,rowTotals:k,columnTotals:E,grandTotal:S}}const Bn="vpg-pivot-";function Vn(n){const t=[...n].sort().join("|").substring(0,100);return`${Bn}${t}`}function In(n,e){try{sessionStorage.setItem(n,JSON.stringify(e))}catch{}}function Hn(n){try{const e=sessionStorage.getItem(n);if(e)return JSON.parse(e)}catch{}return null}function $a(n,e){const t=new Set(e);return[...n.rowFields,...n.columnFields,...n.valueFields.map(i=>i.field)].filter(i=>!i.startsWith("calc:")).every(i=>t.has(i))}const ds="vpg-calculated-fields";function ta(n){try{localStorage.setItem(ds,JSON.stringify(n))}catch{}}function us(){try{const n=localStorage.getItem(ds);if(n)return JSON.parse(n)}catch{}return[]}function Sa(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&("min"in n||"max"in n)}const On={class:"vpg-modal"},Xn={class:"vpg-modal-header"},Yn={class:"vpg-modal-body"},Wn={class:"vpg-form-group"},_n={class:"vpg-form-group"},jn={key:0,class:"vpg-error"},Gn={class:"vpg-form-group"},$n={class:"vpg-button-group"},Un={class:"vpg-form-group"},qn={key:0,class:"vpg-button-group vpg-field-buttons"},Zn=["onClick"],Kn={key:1,class:"vpg-no-fields"},Jn={class:"vpg-form-row"},Qn={class:"vpg-form-group vpg-form-group-half"},eo={class:"vpg-form-group vpg-form-group-half"},to={key:0,class:"vpg-error vpg-error-box"},ao={class:"vpg-modal-footer"},io=c.defineComponent({__name:"CalculatedFieldModal",props:{show:{type:Boolean},availableFields:{},existingField:{}},emits:["close","save"],setup(n,{emit:e}){const t=n,a=e,i=c.ref(""),s=c.ref(""),r=c.ref("number"),o=c.ref(2),l=c.ref(null);c.watch(()=>t.show,p=>{p&&(t.existingField?(i.value=t.existingField.name,s.value=t.existingField.formula,r.value=t.existingField.formatAs||"number",o.value=t.existingField.decimals??2):(i.value="",s.value="",r.value="number",o.value=2),l.value=null)});const h=c.computed(()=>s.value.trim()?ls(s.value,t.availableFields):null);function d(p){s.value.trim()&&!s.value.endsWith(" ")&&(s.value+=" "),s.value+=p}function u(p){s.value.trim()&&!s.value.endsWith(" ")&&(s.value+=" "),s.value+=`${p} `}function g(){var m;if(!i.value.trim()){l.value="Name is required";return}const p=ls(s.value,t.availableFields);if(p){l.value=p;return}const f={id:((m=t.existingField)==null?void 0:m.id)||`calc_${Date.now()}`,name:i.value.trim(),formula:s.value.trim(),formatAs:r.value,decimals:o.value};a("save",f),a("close")}return(p,f)=>(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[n.show?(c.openBlock(),c.createElementBlock("div",{key:0,class:"vpg-modal-overlay",onClick:f[12]||(f[12]=c.withModifiers(m=>a("close"),["self"]))},[c.createElementVNode("div",On,[c.createElementVNode("div",Xn,[c.createElementVNode("h3",null,c.toDisplayString(n.existingField?"Edit":"Create")+" Calculated Field",1),c.createElementVNode("button",{class:"vpg-modal-close",onClick:f[0]||(f[0]=m=>a("close"))}," × ")]),c.createElementVNode("div",Yn,[c.createElementVNode("div",Wn,[f[13]||(f[13]=c.createElementVNode("label",{class:"vpg-label"},"Name",-1)),c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":f[1]||(f[1]=m=>i.value=m),type:"text",class:"vpg-input",placeholder:"e.g., Profit Margin %"},null,512),[[c.vModelText,i.value]])]),c.createElementVNode("div",_n,[f[14]||(f[14]=c.createElementVNode("label",{class:"vpg-label"},"Formula",-1)),c.withDirectives(c.createElementVNode("textarea",{"onUpdate:modelValue":f[2]||(f[2]=m=>s.value=m),class:"vpg-textarea",placeholder:"e.g., revenue / units",rows:"2"},null,512),[[c.vModelText,s.value]]),f[15]||(f[15]=c.createElementVNode("div",{class:"vpg-formula-hint"}," Use field names with math operators: + - * / ( ) ",-1)),h.value?(c.openBlock(),c.createElementBlock("div",jn,c.toDisplayString(h.value),1)):c.createCommentVNode("",!0)]),c.createElementVNode("div",Gn,[f[16]||(f[16]=c.createElementVNode("label",{class:"vpg-label-small"},"Operators",-1)),c.createElementVNode("div",$n,[c.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:f[3]||(f[3]=m=>u("+"))}," + "),c.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:f[4]||(f[4]=m=>u("-"))}," − "),c.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:f[5]||(f[5]=m=>u("*"))}," × "),c.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:f[6]||(f[6]=m=>u("/"))}," ÷ "),c.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:f[7]||(f[7]=m=>u("("))}," ( "),c.createElementVNode("button",{class:"vpg-insert-btn vpg-op-btn",onClick:f[8]||(f[8]=m=>u(")"))}," ) ")])]),c.createElementVNode("div",Un,[f[17]||(f[17]=c.createElementVNode("label",{class:"vpg-label-small"},"Insert Field",-1)),n.availableFields.length>0?(c.openBlock(),c.createElementBlock("div",qn,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.availableFields,m=>(c.openBlock(),c.createElementBlock("button",{key:m,class:"vpg-insert-btn vpg-field-btn",onClick:x=>d(m)},c.toDisplayString(m),9,Zn))),128))])):(c.openBlock(),c.createElementBlock("div",Kn," No numeric fields available "))]),c.createElementVNode("div",Jn,[c.createElementVNode("div",Qn,[f[19]||(f[19]=c.createElementVNode("label",{class:"vpg-label"},"Format As",-1)),c.withDirectives(c.createElementVNode("select",{"onUpdate:modelValue":f[9]||(f[9]=m=>r.value=m),class:"vpg-select"},[...f[18]||(f[18]=[c.createElementVNode("option",{value:"number"}," Number ",-1),c.createElementVNode("option",{value:"percent"}," Percentage ",-1),c.createElementVNode("option",{value:"currency"}," Currency ($) ",-1)])],512),[[c.vModelSelect,r.value]])]),c.createElementVNode("div",eo,[f[20]||(f[20]=c.createElementVNode("label",{class:"vpg-label"},"Decimals",-1)),c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":f[10]||(f[10]=m=>o.value=m),type:"number",class:"vpg-input",min:"0",max:"6"},null,512),[[c.vModelText,o.value,void 0,{number:!0}]])])]),l.value?(c.openBlock(),c.createElementBlock("div",to,c.toDisplayString(l.value),1)):c.createCommentVNode("",!0)]),c.createElementVNode("div",ao,[c.createElementVNode("button",{class:"vpg-btn vpg-btn-secondary",onClick:f[11]||(f[11]=m=>a("close"))}," Cancel "),c.createElementVNode("button",{class:"vpg-btn vpg-btn-primary",onClick:g},c.toDisplayString(n.existingField?"Update":"Add")+" Field ",1)])])])):c.createCommentVNode("",!0)]))}}),It=(n,e)=>{const t=n.__vccOpts||n;for(const[a,i]of e)t[a]=i;return t},so=It(io,[["__scopeId","data-v-a29541ff"]]);/*!
|
|
9
|
+
* ApexCharts v4.7.0
|
|
10
|
+
* (c) 2018-2025 ApexCharts
|
|
11
|
+
* Released under the MIT License.
|
|
12
|
+
*/function Ua(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,a=Array(e);t<e;t++)a[t]=n[t];return a}function gs(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function q(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function ps(n,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,bs(a.key),a)}}function Z(n,e,t){return e&&ps(n.prototype,e),t&&ps(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function aa(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Za(n))||e){t&&(n=t);var a=0,i=function(){};return{s:i,n:function(){return a>=n.length?{done:!0}:{done:!1,value:n[a++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
13
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,r=!0,o=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return r=l.done,l},e:function(l){o=!0,s=l},f:function(){try{r||t.return==null||t.return()}finally{if(o)throw s}}}}function ia(n){var e=fs();return function(){var t,a=Ma(n);if(e){var i=Ma(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return function(s,r){if(r&&(typeof r=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gs(s)}(this,t)}}function Ea(n,e,t){return(e=bs(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ma(n){return Ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ma(n)}function sa(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&qa(n,e)}function fs(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fs=function(){return!!n})()}function ms(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,a)}return t}function G(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ms(Object(t),!0).forEach(function(a){Ea(n,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ms(Object(t)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))})}return n}function qa(n,e){return qa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},qa(n,e)}function xs(n,e){return function(t){if(Array.isArray(t))return t}(n)||function(t,a){var i=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(i!=null){var s,r,o,l,h=[],d=!0,u=!1;try{if(o=(i=i.call(t)).next,a===0){if(Object(i)!==i)return;d=!1}else for(;!(d=(s=o.call(i)).done)&&(h.push(s.value),h.length!==a);d=!0);}catch(g){u=!0,r=g}finally{try{if(!d&&i.return!=null&&(l=i.return(),Object(l)!==l))return}finally{if(u)throw r}}return h}}(n,e)||Za(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
14
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Pe(n){return function(e){if(Array.isArray(e))return Ua(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||Za(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
15
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function bs(n){var e=function(t,a){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var s=i.call(t,a);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(t)}(n,"string");return typeof e=="symbol"?e:e+""}function Ht(n){return Ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ht(n)}function Za(n,e){if(n){if(typeof n=="string")return Ua(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ua(n,e):void 0}}var R=function(){function n(){q(this,n)}return Z(n,[{key:"shadeRGBColor",value:function(e,t){var a=t.split(","),i=e<0?0:255,s=e<0?-1*e:e,r=parseInt(a[0].slice(4),10),o=parseInt(a[1],10),l=parseInt(a[2],10);return"rgb("+(Math.round((i-r)*s)+r)+","+(Math.round((i-o)*s)+o)+","+(Math.round((i-l)*s)+l)+")"}},{key:"shadeHexColor",value:function(e,t){var a=parseInt(t.slice(1),16),i=e<0?0:255,s=e<0?-1*e:e,r=a>>16,o=a>>8&255,l=255&a;return"#"+(16777216+65536*(Math.round((i-r)*s)+r)+256*(Math.round((i-o)*s)+o)+(Math.round((i-l)*s)+l)).toString(16).slice(1)}},{key:"shadeColor",value:function(e,t){return n.isColorHex(t)?this.shadeHexColor(e,t):this.shadeRGBColor(e,t)}}],[{key:"bind",value:function(e,t){return function(){return e.apply(t,arguments)}}},{key:"isObject",value:function(e){return e&&Ht(e)==="object"&&!Array.isArray(e)&&e!=null}},{key:"is",value:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"}},{key:"isSafari",value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:"listToArray",value:function(e){var t,a=[];for(t=0;t<e.length;t++)a[t]=e[t];return a}},{key:"extend",value:function(e,t){var a=this;typeof Object.assign!="function"&&(Object.assign=function(s){if(s==null)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(s),o=1;o<arguments.length;o++){var l=arguments[o];if(l!=null)for(var h in l)l.hasOwnProperty(h)&&(r[h]=l[h])}return r});var i=Object.assign({},e);return this.isObject(e)&&this.isObject(t)&&Object.keys(t).forEach(function(s){a.isObject(t[s])&&s in e?i[s]=a.extend(e[s],t[s]):Object.assign(i,Ea({},s,t[s]))}),i}},{key:"extendArray",value:function(e,t){var a=[];return e.map(function(i){a.push(n.extend(t,i))}),e=a}},{key:"monthMod",value:function(e){return e%12}},{key:"clone",value:function(e){var t,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(e===null||Ht(e)!=="object")return e;if(a.has(e))return a.get(e);if(Array.isArray(e)){t=[],a.set(e,t);for(var i=0;i<e.length;i++)t[i]=this.clone(e[i],a)}else if(e instanceof Date)t=new Date(e.getTime());else for(var s in t={},a.set(e,t),e)e.hasOwnProperty(s)&&(t[s]=this.clone(e[s],a));return t}},{key:"log10",value:function(e){return Math.log(e)/Math.LN10}},{key:"roundToBase10",value:function(e){return Math.pow(10,Math.floor(Math.log10(e)))}},{key:"roundToBase",value:function(e,t){return Math.pow(t,Math.floor(Math.log(e)/Math.log(t)))}},{key:"parseNumber",value:function(e){return e===null?e:parseFloat(e)}},{key:"stripNumber",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?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){return e.toString().includes("e")?Math.round(e):e}},{key:"elementExists",value:function(e){return!(!e||!e.isConnected)}},{key:"getDimensions",value:function(e){var t=getComputedStyle(e,null),a=e.clientHeight,i=e.clientWidth;return a-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),[i-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),a]}},{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(t,a){return Array.isArray(a)&&(a=a.reduce(function(i,s){return i.length>s.length?i:s})),t.length>a.length?t:a},0)}},{key:"hexToRgba",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#999999",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;e.substring(0,1)!=="#"&&(e="#999999");var a=e.replace("#","");a=a.match(new RegExp("(.{"+a.length/3+"})","g"));for(var i=0;i<a.length;i++)a[i]=parseInt(a[i].length===1?a[i]+a[i]:a[i],16);return t!==void 0&&a.push(t),"rgba("+a.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(e){return parseFloat(e.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&e.length===4?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(e)}},{key:"getPolygonPos",value:function(e,t){for(var a=[],i=2*Math.PI/t,s=0;s<t;s++){var r={};r.x=e*Math.sin(s*i),r.y=-e*Math.cos(s*i),a.push(r)}return a}},{key:"polarToCartesian",value:function(e,t,a,i){var s=(i-90)*Math.PI/180;return{x:e+a*Math.cos(s),y:t+a*Math.sin(s)}}},{key:"escapeString",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x",a=e.toString().slice();return a=a.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,t)}},{key:"negToZero",value:function(e){return e<0?0:e}},{key:"moveIndexInArray",value:function(e,t,a){if(a>=e.length)for(var i=a-e.length+1;i--;)e.push(void 0);return e.splice(a,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 a in t)t.hasOwnProperty(a)&&(e.style.key=t[a])}},{key:"preciseAddition",value:function(e,t){var a=(String(e).split(".")[1]||"").length,i=(String(t).split(".")[1]||"").length,s=Math.pow(10,Math.max(a,i));return(Math.round(e*s)+Math.round(t*s))/s}},{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 a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,i=Math.pow(10,a-Math.floor(Math.log10(Math.max(e,t))));for(e=Math.round(Math.abs(e)*i),t=Math.round(Math.abs(t)*i);t;){var s=t;t=e%t,e=s}return e/i}},{key:"getPrimeFactors",value:function(e){for(var t=[],a=2;e>=2;)e%a==0?(t.push(a),e/=a):a++;return t}},{key:"mod",value:function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,i=Math.pow(10,a-Math.floor(Math.log10(Math.max(e,t))));return(e=Math.round(Math.abs(e)*i))%(t=Math.round(Math.abs(t)*i))/i}}]),n}(),Ot=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"animateLine",value:function(e,t,a,i){e.attr(t).animate(i).attr(a)}},{key:"animateMarker",value:function(e,t,a,i){e.attr({opacity:0}).animate(t).attr({opacity:1}).after(function(){i()})}},{key:"animateRect",value:function(e,t,a,i,s){e.attr(t).animate(i).attr(a).after(function(){return s()})}},{key:"animatePathsGradually",value:function(e){var t=e.el,a=e.realIndex,i=e.j,s=e.fill,r=e.pathFrom,o=e.pathTo,l=e.speed,h=e.delay,d=this.w,u=0;d.config.chart.animations.animateGradually.enabled&&(u=d.config.chart.animations.animateGradually.delay),d.config.chart.animations.dynamicAnimation.enabled&&d.globals.dataChanged&&d.config.chart.type!=="bar"&&(u=0),this.morphSVG(t,a,i,d.config.chart.type!=="line"||d.globals.comboCharts?s:"stroke",r,o,l,h*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(),typeof t.config.chart.events.animationEnd=="function"&&t.config.chart.events.animationEnd(this.ctx,{el:e,w:t}))}},{key:"morphSVG",value:function(e,t,a,i,s,r,o,l){var h=this,d=this.w;s||(s=e.attr("pathFrom")),r||(r=e.attr("pathTo"));var u=function(g){return d.config.chart.type==="radar"&&(o=1),"M 0 ".concat(d.globals.gridHeight)};(!s||s.indexOf("undefined")>-1||s.indexOf("NaN")>-1)&&(s=u()),(!r.trim()||r.indexOf("undefined")>-1||r.indexOf("NaN")>-1)&&(r=u()),d.globals.shouldAnimate||(o=1),e.plot(s).animate(1,l).plot(s).animate(o,l).plot(r).after(function(){R.isNumber(a)?a===d.globals.series[d.globals.maxValsInArrayIndex].length-2&&d.globals.shouldAnimate&&h.animationCompleted(e):i!=="none"&&d.globals.shouldAnimate&&(!d.globals.comboCharts&&t===d.globals.series.length-1||d.globals.comboCharts)&&h.animationCompleted(e),h.showDelayedElements()})}}]),n}();const Ka={},vs=[];function le(n,e){if(Array.isArray(n))for(const t of n)le(t,e);else if(typeof n!="object")ys(Object.getOwnPropertyNames(e)),Ka[n]=Object.assign(Ka[n]||{},e);else for(const t in n)le(t,n[t])}function $e(n){return Ka[n]||{}}function ys(n){vs.push(...n)}function Ja(n,e){let t;const a=n.length,i=[];for(t=0;t<a;t++)i.push(e(n[t]));return i}function Qa(n){return n%360*Math.PI/180}function Xt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Yt(n,e,t,a){return e!=null&&t!=null||(a=a||n.bbox(),e==null?e=a.width/a.height*t:t==null&&(t=a.height/a.width*e)),{width:e,height:t}}function ei(n,e){const t=n.origin;let a=n.ox!=null?n.ox:n.originX!=null?n.originX:"center",i=n.oy!=null?n.oy:n.originY!=null?n.originY:"center";t!=null&&([a,i]=Array.isArray(t)?t:typeof t=="object"?[t.x,t.y]:[t,t]);const s=typeof a=="string",r=typeof i=="string";if(s||r){const{height:o,width:l,x:h,y:d}=e.bbox();s&&(a=a.includes("left")?h:a.includes("right")?h+l:h+l/2),r&&(i=i.includes("top")?d:i.includes("bottom")?d+o:d+o/2)}return[a,i]}const ro=new Set(["desc","metadata","title"]),ti=n=>ro.has(n.nodeName),ws=(n,e,t={})=>{const a={...e};for(const i in a)a[i].valueOf()===t[i]&&delete a[i];Object.keys(a).length?n.node.setAttribute("data-svgjs",JSON.stringify(a)):(n.node.removeAttribute("data-svgjs"),n.node.removeAttribute("svgjs:data"))},ai="http://www.w3.org/2000/svg",ii="http://www.w3.org/2000/xmlns/",Wt="http://www.w3.org/1999/xlink",de={window:typeof window>"u"?null:window,document:typeof document>"u"?null:document};function ra(){return de.window}let si=class{};const Ct={},ri="___SYMBOL___ROOT___";function na(n,e=ai){return de.document.createElementNS(e,n)}function We(n,e=!1){if(n instanceof si)return n;if(typeof n=="object")return ni(n);if(n==null)return new Ct[ri];if(typeof n=="string"&&n.charAt(0)!=="<")return ni(de.document.querySelector(n));const t=e?de.document.createElement("div"):na("svg");return t.innerHTML=n,n=ni(t.firstChild),t.removeChild(t.firstChild),n}function ke(n,e){return e&&(e instanceof de.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:na(n)}function Ke(n){if(!n)return null;if(n.instance instanceof si)return n.instance;if(n.nodeName==="#document-fragment")return new Ct.Fragment(n);let e=Xt(n.nodeName||"Dom");return e==="LinearGradient"||e==="RadialGradient"?e="Gradient":Ct[e]||(e="Dom"),new Ct[e](n)}let ni=Ke;function ue(n,e=n.name,t=!1){return Ct[e]=n,t&&(Ct[ri]=n),ys(Object.getOwnPropertyNames(n.prototype)),n}let no=1e3;function ks(n){return"Svgjs"+Xt(n)+no++}function Cs(n){for(let e=n.children.length-1;e>=0;e--)Cs(n.children[e]);return n.id&&(n.id=ks(n.nodeName)),n}function ae(n,e){let t,a;for(a=(n=Array.isArray(n)?n:[n]).length-1;a>=0;a--)for(t in e)n[a].prototype[t]=e[t]}function Ce(n){return function(...e){const t=e[e.length-1];return!t||t.constructor!==Object||t instanceof Array?n.apply(this,e):n.apply(this,e.slice(0,-1)).attr(t)}}le("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const n=this.position();return this.parent().add(this.remove(),n+1),this},backward:function(){const n=this.position();return this.parent().add(this.remove(),n?n-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(n){(n=We(n)).remove();const e=this.position();return this.parent().add(n,e),this},after:function(n){(n=We(n)).remove();const e=this.position();return this.parent().add(n,e+1),this},insertBefore:function(n){return(n=We(n)).before(this),this},insertAfter:function(n){return(n=We(n)).after(this),this}});const As=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,oo=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,lo=/rgb\((\d+),(\d+),(\d+)\)/,co=/(#[a-z_][a-z0-9\-_]*)/i,ho=/\)\s*,?\s*/,uo=/\s/g,Ss=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,Es=/^rgb\(/,Ms=/^(\s+)?$/,Ls=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,go=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,dt=/[\s,]+/,oi=/[MLHVCSQTAZ]/i;function po(n){const e=Math.round(n),t=Math.max(0,Math.min(255,e)).toString(16);return t.length===1?"0"+t:t}function _t(n,e){for(let t=e.length;t--;)if(n[e[t]]==null)return!1;return!0}function li(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+6*(e-n)*t:t<.5?e:t<2/3?n+(e-n)*(2/3-t)*6:n}le("Dom",{classes:function(){const n=this.attr("class");return n==null?[]:n.trim().split(dt)},hasClass:function(n){return this.classes().indexOf(n)!==-1},addClass:function(n){if(!this.hasClass(n)){const e=this.classes();e.push(n),this.attr("class",e.join(" "))}return this},removeClass:function(n){return this.hasClass(n)&&this.attr("class",this.classes().filter(function(e){return e!==n}).join(" ")),this},toggleClass:function(n){return this.hasClass(n)?this.removeClass(n):this.addClass(n)}}),le("Dom",{css:function(n,e){const t={};if(arguments.length===0)return this.node.style.cssText.split(/\s*;\s*/).filter(function(a){return!!a.length}).forEach(function(a){const i=a.split(/\s*:\s*/);t[i[0]]=i[1]}),t;if(arguments.length<2){if(Array.isArray(n)){for(const a of n){const i=a;t[a]=this.node.style.getPropertyValue(i)}return t}if(typeof n=="string")return this.node.style.getPropertyValue(n);if(typeof n=="object")for(const a in n)this.node.style.setProperty(a,n[a]==null||Ms.test(n[a])?"":n[a])}return arguments.length===2&&this.node.style.setProperty(n,e==null||Ms.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return this.css("display")!=="none"}}),le("Dom",{data:function(n,e,t){if(n==null)return this.data(Ja(function(a,i){let s;const r=a.length,o=[];for(s=0;s<r;s++)i(a[s])&&o.push(a[s]);return o}(this.node.attributes,a=>a.nodeName.indexOf("data-")===0),a=>a.nodeName.slice(5)));if(n instanceof Array){const a={};for(const i of n)a[i]=this.data(i);return a}if(typeof n=="object")for(e in n)this.data(e,n[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+n))}catch{return this.attr("data-"+n)}else this.attr("data-"+n,e===null?null:t===!0||typeof e=="string"||typeof e=="number"?e:JSON.stringify(e));return this}}),le("Dom",{remember:function(n,e){if(typeof arguments[0]=="object")for(const t in n)this.remember(t,n[t]);else{if(arguments.length===1)return this.memory()[n];this.memory()[n]=e}return this},forget:function(){if(arguments.length===0)this._memory={};else for(let n=arguments.length-1;n>=0;n--)delete this.memory()[arguments[n]];return this},memory:function(){return this._memory=this._memory||{}}});class be{constructor(...e){this.init(...e)}static isColor(e){return e&&(e instanceof be||this.isRgb(e)||this.test(e))}static isRgb(e){return e&&typeof e.r=="number"&&typeof e.g=="number"&&typeof e.b=="number"}static random(e="vibrant",t){const{random:a,round:i,sin:s,PI:r}=Math;if(e==="vibrant"){const o=24*a()+57,l=38*a()+45,h=360*a();return new be(o,l,h,"lch")}if(e==="sine"){const o=i(80*s(2*r*(t=t??a())/.5+.01)+150),l=i(50*s(2*r*t/.5+4.6)+200),h=i(100*s(2*r*t/.5+2.3)+150);return new be(o,l,h)}if(e==="pastel"){const o=8*a()+86,l=17*a()+9,h=360*a();return new be(o,l,h,"lch")}if(e==="dark"){const o=10+10*a(),l=50*a()+86,h=360*a();return new be(o,l,h,"lch")}if(e==="rgb"){const o=255*a(),l=255*a(),h=255*a();return new be(o,l,h)}if(e==="lab"){const o=100*a(),l=256*a()-128,h=256*a()-128;return new be(o,l,h,"lab")}if(e==="grey"){const o=255*a();return new be(o,o,o)}throw new Error("Unsupported random color mode")}static test(e){return typeof e=="string"&&(Ss.test(e)||Es.test(e))}cmyk(){const{_a:e,_b:t,_c:a}=this.rgb(),[i,s,r]=[e,t,a].map(l=>l/255),o=Math.min(1-i,1-s,1-r);return o===1?new be(0,0,0,1,"cmyk"):new be((1-i-o)/(1-o),(1-s-o)/(1-o),(1-r-o)/(1-o),o,"cmyk")}hsl(){const{_a:e,_b:t,_c:a}=this.rgb(),[i,s,r]=[e,t,a].map(g=>g/255),o=Math.max(i,s,r),l=Math.min(i,s,r),h=(o+l)/2,d=o===l,u=o-l;return new be(360*(d?0:o===i?((s-r)/u+(s<r?6:0))/6:o===s?((r-i)/u+2)/6:o===r?((i-s)/u+4)/6:0),100*(d?0:h>.5?u/(2-o-l):u/(o+l)),100*h,"hsl")}init(e=0,t=0,a=0,i=0,s="rgb"){if(e=e||0,this.space)for(const u in this.space)delete this[this.space[u]];if(typeof e=="number")s=typeof i=="string"?i:s,i=typeof i=="string"?0:i,Object.assign(this,{_a:e,_b:t,_c:a,_d:i,space:s});else if(e instanceof Array)this.space=t||(typeof e[3]=="string"?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 u=function(g,p){const f=_t(g,"rgb")?{_a:g.r,_b:g.g,_c:g.b,_d:0,space:"rgb"}:_t(g,"xyz")?{_a:g.x,_b:g.y,_c:g.z,_d:0,space:"xyz"}:_t(g,"hsl")?{_a:g.h,_b:g.s,_c:g.l,_d:0,space:"hsl"}:_t(g,"lab")?{_a:g.l,_b:g.a,_c:g.b,_d:0,space:"lab"}:_t(g,"lch")?{_a:g.l,_b:g.c,_c:g.h,_d:0,space:"lch"}:_t(g,"cmyk")?{_a:g.c,_b:g.m,_c:g.y,_d:g.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return f.space=p||f.space,f}(e,t);Object.assign(this,u)}else if(typeof e=="string")if(Es.test(e)){const u=e.replace(uo,""),[g,p,f]=lo.exec(u).slice(1,4).map(m=>parseInt(m));Object.assign(this,{_a:g,_b:p,_c:f,_d:0,space:"rgb"})}else{if(!Ss.test(e))throw Error("Unsupported string format, can't construct Color");{const u=m=>parseInt(m,16),[,g,p,f]=oo.exec(function(m){return m.length===4?["#",m.substring(1,2),m.substring(1,2),m.substring(2,3),m.substring(2,3),m.substring(3,4),m.substring(3,4)].join(""):m}(e)).map(u);Object.assign(this,{_a:g,_b:p,_c:f,_d:0,space:"rgb"})}}const{_a:r,_b:o,_c:l,_d:h}=this,d=this.space==="rgb"?{r,g:o,b:l}:this.space==="xyz"?{x:r,y:o,z:l}:this.space==="hsl"?{h:r,s:o,l}:this.space==="lab"?{l:r,a:o,b:l}:this.space==="lch"?{l:r,c:o,h:l}:this.space==="cmyk"?{c:r,m:o,y:l,k:h}:{};Object.assign(this,d)}lab(){const{x:e,y:t,z:a}=this.xyz();return new be(116*t-16,500*(e-t),200*(t-a),"lab")}lch(){const{l:e,a:t,b:a}=this.lab(),i=Math.sqrt(t**2+a**2);let s=180*Math.atan2(a,t)/Math.PI;return s<0&&(s*=-1,s=360-s),new be(e,i,s,"lch")}rgb(){if(this.space==="rgb")return this;if((e=this.space)==="lab"||e==="xyz"||e==="lch"){let{x:t,y:a,z:i}=this;if(this.space==="lab"||this.space==="lch"){let{l:p,a:f,b:m}=this;if(this.space==="lch"){const{c:E,h:S}=this,C=Math.PI/180;f=E*Math.cos(C*S),m=E*Math.sin(C*S)}const x=(p+16)/116,b=f/500+x,v=x-m/200,w=16/116,k=.008856,y=7.787;t=.95047*(b**3>k?b**3:(b-w)/y),a=1*(x**3>k?x**3:(x-w)/y),i=1.08883*(v**3>k?v**3:(v-w)/y)}const s=3.2406*t+-1.5372*a+-.4986*i,r=-.9689*t+1.8758*a+.0415*i,o=.0557*t+-.204*a+1.057*i,l=Math.pow,h=.0031308,d=s>h?1.055*l(s,1/2.4)-.055:12.92*s,u=r>h?1.055*l(r,1/2.4)-.055:12.92*r,g=o>h?1.055*l(o,1/2.4)-.055:12.92*o;return new be(255*d,255*u,255*g)}if(this.space==="hsl"){let{h:t,s:a,l:i}=this;if(t/=360,a/=100,i/=100,a===0)return i*=255,new be(i,i,i);const s=i<.5?i*(1+a):i+a-i*a,r=2*i-s,o=255*li(r,s,t+1/3),l=255*li(r,s,t),h=255*li(r,s,t-1/3);return new be(o,l,h)}if(this.space==="cmyk"){const{c:t,m:a,y:i,k:s}=this,r=255*(1-Math.min(1,t*(1-s)+s)),o=255*(1-Math.min(1,a*(1-s)+s)),l=255*(1-Math.min(1,i*(1-s)+s));return new be(r,o,l)}return this;var e}toArray(){const{_a:e,_b:t,_c:a,_d:i,space:s}=this;return[e,t,a,i,s]}toHex(){const[e,t,a]=this._clamped().map(po);return`#${e}${t}${a}`}toRgb(){const[e,t,a]=this._clamped();return`rgb(${e},${t},${a})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:t,_c:a}=this.rgb(),[i,s,r]=[e,t,a].map(x=>x/255),o=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,l=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,d=(.4124*o+.3576*l+.1805*h)/.95047,u=(.2126*o+.7152*l+.0722*h)/1,g=(.0193*o+.1192*l+.9505*h)/1.08883,p=d>.008856?Math.pow(d,1/3):7.787*d+16/116,f=u>.008856?Math.pow(u,1/3):7.787*u+16/116,m=g>.008856?Math.pow(g,1/3):7.787*g+16/116;return new be(p,f,m,"xyz")}_clamped(){const{_a:e,_b:t,_c:a}=this.rgb(),{max:i,min:s,round:r}=Math;return[e,t,a].map(o=>i(0,s(r(o),255)))}}class fe{constructor(...e){this.init(...e)}clone(){return new fe(this)}init(e,t){const s=Array.isArray(e)?{x:e[0],y:e[1]}:typeof e=="object"?{x:e.x,y:e.y}:{x:e,y:t};return this.x=s.x==null?0:s.x,this.y=s.y==null?0:s.y,this}toArray(){return[this.x,this.y]}transform(e){return this.clone().transformO(e)}transformO(e){Q.isMatrixLike(e)||(e=new Q(e));const{x:t,y:a}=this;return this.x=e.a*t+e.c*a+e.e,this.y=e.b*t+e.d*a+e.f,this}}function jt(n,e,t){return Math.abs(e-n)<1e-6}class Q{constructor(...e){this.init(...e)}static formatTransforms(e){const t=e.flip==="both"||e.flip===!0,a=e.flip&&(t||e.flip==="x")?-1:1,i=e.flip&&(t||e.flip==="y")?-1:1,s=e.skew&&e.skew.length?e.skew[0]:isFinite(e.skew)?e.skew:isFinite(e.skewX)?e.skewX:0,r=e.skew&&e.skew.length?e.skew[1]:isFinite(e.skew)?e.skew:isFinite(e.skewY)?e.skewY:0,o=e.scale&&e.scale.length?e.scale[0]*a:isFinite(e.scale)?e.scale*a:isFinite(e.scaleX)?e.scaleX*a:a,l=e.scale&&e.scale.length?e.scale[1]*i:isFinite(e.scale)?e.scale*i:isFinite(e.scaleY)?e.scaleY*i:i,h=e.shear||0,d=e.rotate||e.theta||0,u=new fe(e.origin||e.around||e.ox||e.originX,e.oy||e.originY),g=u.x,p=u.y,f=new fe(e.position||e.px||e.positionX||NaN,e.py||e.positionY||NaN),m=f.x,x=f.y,b=new fe(e.translate||e.tx||e.translateX,e.ty||e.translateY),v=b.x,w=b.y,k=new fe(e.relative||e.rx||e.relativeX,e.ry||e.relativeY);return{scaleX:o,scaleY:l,skewX:s,skewY:r,shear:h,theta:d,rx:k.x,ry:k.y,tx:v,ty:w,ox:g,oy:p,px:m,py:x}}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 e.a!=null||e.b!=null||e.c!=null||e.d!=null||e.e!=null||e.f!=null}static matrixMultiply(e,t,a){const i=e.a*t.a+e.c*t.b,s=e.b*t.a+e.d*t.b,r=e.a*t.c+e.c*t.d,o=e.b*t.c+e.d*t.d,l=e.e+e.a*t.e+e.c*t.f,h=e.f+e.b*t.e+e.d*t.f;return a.a=i,a.b=s,a.c=r,a.d=o,a.e=l,a.f=h,a}around(e,t,a){return this.clone().aroundO(e,t,a)}aroundO(e,t,a){const i=e||0,s=t||0;return this.translateO(-i,-s).lmultiplyO(a).translateO(i,s)}clone(){return new Q(this)}decompose(e=0,t=0){const a=this.a,i=this.b,s=this.c,r=this.d,o=this.e,l=this.f,h=a*r-i*s,d=h>0?1:-1,u=d*Math.sqrt(a*a+i*i),g=Math.atan2(d*i,d*a),p=180/Math.PI*g,f=Math.cos(g),m=Math.sin(g),x=(a*s+i*r)/h,b=s*u/(x*a-i)||r*u/(x*i+a);return{scaleX:u,scaleY:b,shear:x,rotate:p,translateX:o-e+e*f*u+t*(x*f*u-m*b),translateY:l-t+e*m*u+t*(x*m*u+f*b),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 Q(e);return jt(this.a,t.a)&&jt(this.b,t.b)&&jt(this.c,t.c)&&jt(this.d,t.d)&&jt(this.e,t.e)&&jt(this.f,t.f)}flip(e,t){return this.clone().flipO(e,t)}flipO(e,t){return e==="x"?this.scaleO(-1,1,t,0):e==="y"?this.scaleO(1,-1,0,t):this.scaleO(-1,-1,e,t||e)}init(e){const t=Q.fromArray([1,0,0,1,0,0]);return e=e instanceof Ve?e.matrixify():typeof e=="string"?Q.fromArray(e.split(dt).map(parseFloat)):Array.isArray(e)?Q.fromArray(e):typeof e=="object"&&Q.isMatrixLike(e)?e:typeof e=="object"?new Q().transform(e):arguments.length===6?Q.fromArray([].slice.call(arguments)):t,this.a=e.a!=null?e.a:t.a,this.b=e.b!=null?e.b:t.b,this.c=e.c!=null?e.c:t.c,this.d=e.d!=null?e.d:t.d,this.e=e.e!=null?e.e:t.e,this.f=e.f!=null?e.f:t.f,this}inverse(){return this.clone().inverseO()}inverseO(){const e=this.a,t=this.b,a=this.c,i=this.d,s=this.e,r=this.f,o=e*i-t*a;if(!o)throw new Error("Cannot invert "+this);const l=i/o,h=-t/o,d=-a/o,u=e/o,g=-(l*s+d*r),p=-(h*s+u*r);return this.a=l,this.b=h,this.c=d,this.d=u,this.e=g,this.f=p,this}lmultiply(e){return this.clone().lmultiplyO(e)}lmultiplyO(e){const t=e instanceof Q?e:new Q(e);return Q.matrixMultiply(t,this,this)}multiply(e){return this.clone().multiplyO(e)}multiplyO(e){const t=e instanceof Q?e:new Q(e);return Q.matrixMultiply(this,t,this)}rotate(e,t,a){return this.clone().rotateO(e,t,a)}rotateO(e,t=0,a=0){e=Qa(e);const i=Math.cos(e),s=Math.sin(e),{a:r,b:o,c:l,d:h,e:d,f:u}=this;return this.a=r*i-o*s,this.b=o*i+r*s,this.c=l*i-h*s,this.d=h*i+l*s,this.e=d*i-u*s+a*s-t*i+t,this.f=u*i+d*s-t*s-a*i+a,this}scale(){return this.clone().scaleO(...arguments)}scaleO(e,t=e,a=0,i=0){arguments.length===3&&(i=a,a=t,t=e);const{a:s,b:r,c:o,d:l,e:h,f:d}=this;return this.a=s*e,this.b=r*t,this.c=o*e,this.d=l*t,this.e=h*e-a*e+a,this.f=d*t-i*t+i,this}shear(e,t,a){return this.clone().shearO(e,t,a)}shearO(e,t=0,a=0){const{a:i,b:s,c:r,d:o,e:l,f:h}=this;return this.a=i+s*e,this.c=r+o*e,this.e=l+h*e-a*e,this}skew(){return this.clone().skewO(...arguments)}skewO(e,t=e,a=0,i=0){arguments.length===3&&(i=a,a=t,t=e),e=Qa(e),t=Qa(t);const s=Math.tan(e),r=Math.tan(t),{a:o,b:l,c:h,d,e:u,f:g}=this;return this.a=o+l*s,this.b=l+o*r,this.c=h+d*s,this.d=d+h*r,this.e=u+g*s-i*s,this.f=g+u*r-a*r,this}skewX(e,t,a){return this.skew(e,0,t,a)}skewY(e,t,a){return this.skew(0,e,t,a)}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(Q.isMatrixLike(e))return new Q(e).multiplyO(this);const t=Q.formatTransforms(e),{x:a,y:i}=new fe(t.ox,t.oy).transform(this),s=new Q().translateO(t.rx,t.ry).lmultiplyO(this).translateO(-a,-i).scaleO(t.scaleX,t.scaleY).skewO(t.skewX,t.skewY).shearO(t.shear).rotateO(t.theta).translateO(a,i);if(isFinite(t.px)||isFinite(t.py)){const r=new fe(a,i).transform(s),o=isFinite(t.px)?t.px-r.x:0,l=isFinite(t.py)?t.py-r.y:0;s.translateO(o,l)}return s.translateO(t.tx,t.ty),s}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 mt(){if(!mt.nodes){const n=We().size(2,0);n.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),n.attr("focusable","false"),n.attr("aria-hidden","true");const e=n.path().node;mt.nodes={svg:n,path:e}}if(!mt.nodes.svg.node.parentNode){const n=de.document.body||de.document.documentElement;mt.nodes.svg.addTo(n)}return mt.nodes}function Ns(n){return!(n.width||n.height||n.x||n.y)}ue(Q,"Matrix");class Me{constructor(...e){this.init(...e)}addOffset(){return this.x+=de.window.pageXOffset,this.y+=de.window.pageYOffset,new Me(this)}init(e){return e=typeof e=="string"?e.split(dt).map(parseFloat):Array.isArray(e)?e:typeof e=="object"?[e.left!=null?e.left:e.x,e.top!=null?e.top:e.y,e.width,e.height]:arguments.length===4?[].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 Ns(this)}merge(e){const t=Math.min(this.x,e.x),a=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-t,s=Math.max(this.y+this.height,e.y+e.height)-a;return new Me(t,a,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof Q||(e=new Q(e));let t=1/0,a=-1/0,i=1/0,s=-1/0;return[new fe(this.x,this.y),new fe(this.x2,this.y),new fe(this.x,this.y2),new fe(this.x2,this.y2)].forEach(function(r){r=r.transform(e),t=Math.min(t,r.x),a=Math.max(a,r.x),i=Math.min(i,r.y),s=Math.max(s,r.y)}),new Me(t,i,a-t,s-i)}}function Fs(n,e,t){let a;try{if(a=e(n.node),Ns(a)&&(i=n.node)!==de.document&&!(de.document.documentElement.contains||function(s){for(;s.parentNode;)s=s.parentNode;return s===de.document}).call(de.document.documentElement,i))throw new Error("Element not in the dom")}catch{a=t(n)}var i;return a}le({viewbox:{viewbox(n,e,t,a){return n==null?new Me(this.attr("viewBox")):this.attr("viewBox",new Me(n,e,t,a))},zoom(n,e){let{width:t,height:a}=this.attr(["width","height"]);if((t||a)&&typeof t!="string"&&typeof a!="string"||(t=this.node.clientWidth,a=this.node.clientHeight),!t||!a)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(),s=t/i.width,r=a/i.height,o=Math.min(s,r);if(n==null)return o;let l=o/n;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),e=e||new fe(t/2/s+i.x,a/2/r+i.y);const h=new Me(i).transform(new Q({scale:l,origin:e}));return this.viewbox(h)}}}),ue(Me,"Box");class At extends Array{constructor(e=[],...t){if(super(e,...t),typeof e=="number")return this;this.length=0,this.push(...e)}}ae([At],{each(n,...e){return typeof n=="function"?this.map((t,a,i)=>n.call(t,t,a,i)):this.map(t=>t[n](...e))},toArray(){return Array.prototype.concat.apply([],this)}});const fo=["toArray","constructor","each"];function St(n,e){return new At(Ja((e||de.document).querySelectorAll(n),function(t){return Ke(t)}))}At.extend=function(n){n=n.reduce((e,t)=>(fo.includes(t)||t[0]==="_"||(t in Array.prototype&&(e["$"+t]=Array.prototype[t]),e[t]=function(...a){return this.each(t,...a)}),e),{}),ae([At],n)};let mo=0;const zs={};function Ts(n){let e=n.getEventHolder();return e===de.window&&(e=zs),e.events||(e.events={}),e.events}function ci(n){return n.getEventTarget()}function ut(n,e,t,a,i){const s=t.bind(a||n),r=We(n),o=Ts(r),l=ci(r);e=Array.isArray(e)?e:e.split(dt),t._svgjsListenerId||(t._svgjsListenerId=++mo),e.forEach(function(h){const d=h.split(".")[0],u=h.split(".")[1]||"*";o[d]=o[d]||{},o[d][u]=o[d][u]||{},o[d][u][t._svgjsListenerId]=s,l.addEventListener(d,s,i||!1)})}function Je(n,e,t,a){const i=We(n),s=Ts(i),r=ci(i);(typeof t!="function"||(t=t._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(dt)).forEach(function(o){const l=o&&o.split(".")[0],h=o&&o.split(".")[1];let d,u;if(t)s[l]&&s[l][h||"*"]&&(r.removeEventListener(l,s[l][h||"*"][t],a||!1),delete s[l][h||"*"][t]);else if(l&&h){if(s[l]&&s[l][h]){for(u in s[l][h])Je(r,[l,h].join("."),u);delete s[l][h]}}else if(h)for(o in s)for(d in s[o])h===d&&Je(r,[o,h].join("."));else if(l){if(s[l]){for(d in s[l])Je(r,[l,d].join("."));delete s[l]}}else{for(o in s)Je(r,o);(function(g){let p=g.getEventHolder();p===de.window&&(p=zs),p.events&&(p.events={})})(i)}})}class oa extends si{addEventListener(){}dispatch(e,t,a){return function(i,s,r,o){const l=ci(i);return s instanceof de.window.Event||(s=new de.window.CustomEvent(s,{detail:r,cancelable:!0,...o})),l.dispatchEvent(s),s}(this,e,t,a)}dispatchEvent(e){const t=this.getEventHolder().events;if(!t)return!0;const a=t[e.type];for(const i in a)for(const s in a[i])a[i][s](e);return!e.defaultPrevented}fire(e,t,a){return this.dispatch(e,t,a),this}getEventHolder(){return this}getEventTarget(){return this}off(e,t,a){return Je(this,e,t,a),this}on(e,t,a,i){return ut(this,e,t,a,i),this}removeEventListener(){}}function Ps(){}ue(oa,"EventTarget");const hi=400,xo=">",bo=0,vo={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Et extends Array{constructor(...e){super(...e),this.init(...e)}clone(){return new this.constructor(this)}init(e){return typeof e=="number"||(this.length=0,this.push(...this.parse(e))),this}parse(e=[]){return e instanceof Array?e:e.trim().split(dt).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 re{constructor(...e){this.init(...e)}convert(e){return new re(this.value,e)}divide(e){return e=new re(e),new re(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||"",typeof e=="number"?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:typeof e=="string"?(t=e.match(As))&&(this.value=parseFloat(t[1]),t[5]==="%"?this.value/=100:t[5]==="s"&&(this.value*=1e3),this.unit=t[5]):e instanceof re&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new re(e),new re(this-e,this.unit||e.unit)}plus(e){return e=new re(e),new re(this+e,this.unit||e.unit)}times(e){return e=new re(e),new re(this*e,this.unit||e.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(this.unit==="%"?~~(1e8*this.value)/1e6:this.unit==="s"?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const yo=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ds=[];class xt extends oa{constructor(e,t){super(),this.node=e,this.type=e.nodeName,t&&e!==t&&this.attr(t)}add(e,t){return(e=We(e)).removeNamespace&&this.node instanceof de.window.SVGElement&&e.removeNamespace(),t==null?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 We(e).put(this,t)}children(){return new At(Ja(this.node.children,function(e){return Ke(e)}))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(e=!0,t=!0){this.writeDataToDom();let a=this.node.cloneNode(e);return t&&(a=Cs(a)),new this.constructor(a)}each(e,t){const a=this.children();let i,s;for(i=0,s=a.length;i<s;i++)e.apply(a[i],[i,a]),t&&a[i].each(e,t);return this}element(e,t){return this.put(new xt(na(e),t))}first(){return Ke(this.node.firstChild)}get(e){return Ke(this.node.childNodes[e])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(e){return this.index(e)>=0}html(e,t){return this.xml(e,t,"http://www.w3.org/1999/xhtml")}id(e){return e!==void 0||this.node.id||(this.node.id=ks(this.type)),this.attr("id",e)}index(e){return[].slice.call(this.node.childNodes).indexOf(e.node)}last(){return Ke(this.node.lastChild)}matches(e){const t=this.node,a=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return a&&a.call(t,e)}parent(e){let t=this;if(!t.node.parentNode)return null;if(t=Ke(t.node.parentNode),!e)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=Ke(t.node.parentNode));return t}put(e,t){return e=We(e),this.add(e,t),e}putIn(e,t){return We(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=We(e),this.node.parentNode&&this.node.parentNode.replaceChild(e.node,this.node),e}round(e=2,t=null){const a=10**e,i=this.attr(t);for(const s in i)typeof i[s]=="number"&&(i[s]=Math.round(i[s]*a)/a);return this.attr(i),this}svg(e,t){return this.xml(e,t,ai)}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 a=t.index(this);return t.put(e,a).put(this)}writeDataToDom(){return this.each(function(){this.writeDataToDom()}),this}xml(e,t,a){if(typeof e=="boolean"&&(a=t,t=e,e=null),e==null||typeof e=="function"){t=t==null||t,this.writeDataToDom();let o=this;if(e!=null){if(o=Ke(o.node.cloneNode(!0)),t){const l=e(o);if(o=l||o,l===!1)return""}o.each(function(){const l=e(this),h=l||this;l===!1?this.remove():l&&this!==h&&this.replace(h)},!0)}return t?o.node.outerHTML:o.node.innerHTML}t=t!=null&&t;const i=na("wrapper",a),s=de.document.createDocumentFragment();i.innerHTML=e;for(let o=i.children.length;o--;)s.appendChild(i.firstElementChild);const r=this.parent();return t?this.replace(s)&&r:this.add(s)}}ae(xt,{attr:function(n,e,t){if(n==null){n={},e=this.node.attributes;for(const a of e)n[a.nodeName]=Ls.test(a.nodeValue)?parseFloat(a.nodeValue):a.nodeValue;return n}if(n instanceof Array)return n.reduce((a,i)=>(a[i]=this.attr(i),a),{});if(typeof n=="object"&&n.constructor===Object)for(e in n)this.attr(e,n[e]);else if(e===null)this.node.removeAttribute(n);else{if(e==null)return(e=this.node.getAttribute(n))==null?vo[n]:Ls.test(e)?parseFloat(e):e;typeof(e=Ds.reduce((a,i)=>i(n,a,this),e))=="number"?e=new re(e):yo.has(n)&&be.isColor(e)?e=new be(e):e.constructor===Array&&(e=new Et(e)),n==="leading"?this.leading&&this.leading(e):typeof t=="string"?this.node.setAttributeNS(t,n,e.toString()):this.node.setAttribute(n,e.toString()),!this.rebuild||n!=="font-size"&&n!=="x"||this.rebuild()}return this},find:function(n){return St(n,this.node)},findOne:function(n){return Ke(this.node.querySelector(n))}}),ue(xt,"Dom");let Ve=class extends xt{constructor(n,e){super(n,e),this.dom={},this.node.instance=this,(n.hasAttribute("data-svgjs")||n.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(n.getAttribute("data-svgjs"))??JSON.parse(n.getAttribute("svgjs:data"))??{})}center(n,e){return this.cx(n).cy(e)}cx(n){return n==null?this.x()+this.width()/2:this.x(n-this.width()/2)}cy(n){return n==null?this.y()+this.height()/2:this.y(n-this.height()/2)}defs(){const n=this.root();return n&&n.defs()}dmove(n,e){return this.dx(n).dy(e)}dx(n=0){return this.x(new re(n).plus(this.x()))}dy(n=0){return this.y(new re(n).plus(this.y()))}getEventHolder(){return this}height(n){return this.attr("height",n)}move(n,e){return this.x(n).y(e)}parents(n=this.root()){const e=typeof n=="string";e||(n=We(n));const t=new At;let a=this;for(;(a=a.parent())&&a.node!==de.document&&a.nodeName!=="#document-fragment"&&(t.push(a),e||a.node!==n.node)&&(!e||!a.matches(n));)if(a.node===this.root().node)return null;return t}reference(n){if(!(n=this.attr(n)))return null;const e=(n+"").match(co);return e?We(e[1]):null}root(){const n=this.parent(function(e){return Ct[e]}(ri));return n&&n.root()}setData(n){return this.dom=n,this}size(n,e){const t=Yt(this,n,e);return this.width(new re(t.width)).height(new re(t.height))}width(n){return this.attr("width",n)}writeDataToDom(){return ws(this,this.dom),super.writeDataToDom()}x(n){return this.attr("x",n)}y(n){return this.attr("y",n)}};ae(Ve,{bbox:function(){const n=Fs(this,e=>e.getBBox(),e=>{try{const t=e.clone().addTo(mt().svg).show(),a=t.node.getBBox();return t.remove(),a}catch(t){throw new Error(`Getting bbox of element "${e.node.nodeName}" is not possible: ${t.toString()}`)}});return new Me(n)},rbox:function(n){const e=Fs(this,a=>a.getBoundingClientRect(),a=>{throw new Error(`Getting rbox of element "${a.node.nodeName}" is not possible`)}),t=new Me(e);return n?t.transform(n.screenCTM().inverseO()):t.addOffset()},inside:function(n,e){const t=this.bbox();return n>t.x&&e>t.y&&n<t.x+t.width&&e<t.y+t.height},point:function(n,e){return new fe(n,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Q(this.node.getCTM())},screenCTM:function(){try{if(typeof this.isRoot=="function"&&!this.isRoot()){const n=this.rect(1,1),e=n.node.getScreenCTM();return n.remove(),new Q(e)}return new Q(this.node.getScreenCTM())}catch{return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new Q}}}),ue(Ve,"Element");const la={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(n,e){return e==="color"?n:n+"-"+e}};["fill","stroke"].forEach(function(n){const e={};let t;e[n]=function(a){if(a===void 0)return this.attr(n);if(typeof a=="string"||a instanceof be||be.isRgb(a)||a instanceof Ve)this.attr(n,a);else for(t=la[n].length-1;t>=0;t--)a[la[n][t]]!=null&&this.attr(la.prefix(n,la[n][t]),a[la[n][t]]);return this},le(["Element","Runner"],e)}),le(["Element","Runner"],{matrix:function(n,e,t,a,i,s){return n==null?new Q(this):this.attr("transform",new Q(n,e,t,a,i,s))},rotate:function(n,e,t){return this.transform({rotate:n,ox:e,oy:t},!0)},skew:function(n,e,t,a){return arguments.length===1||arguments.length===3?this.transform({skew:n,ox:e,oy:t},!0):this.transform({skew:[n,e],ox:t,oy:a},!0)},shear:function(n,e,t){return this.transform({shear:n,ox:e,oy:t},!0)},scale:function(n,e,t,a){return arguments.length===1||arguments.length===3?this.transform({scale:n,ox:e,oy:t},!0):this.transform({scale:[n,e],ox:t,oy:a},!0)},translate:function(n,e){return this.transform({translate:[n,e]},!0)},relative:function(n,e){return this.transform({relative:[n,e]},!0)},flip:function(n="both",e="center"){return"xybothtrue".indexOf(n)===-1&&(e=n,n="both"),this.transform({flip:n,origin:e},!0)},opacity:function(n){return this.attr("opacity",n)}}),le("radius",{radius:function(n,e=n){return(this._element||this).type==="radialGradient"?this.attr("r",new re(n)):this.rx(n).ry(e)}}),le("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(n){return new fe(this.node.getPointAtLength(n))}}),le(["Element","Runner"],{font:function(n,e){if(typeof n=="object"){for(e in n)this.font(e,n[e]);return this}return n==="leading"?this.leading(e):n==="anchor"?this.attr("text-anchor",e):n==="size"||n==="family"||n==="weight"||n==="stretch"||n==="variant"||n==="style"?this.attr("font-"+n,e):this.attr(n,e)}}),le("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce(function(n,e){return n[e]=function(t){return t===null?this.off(e):this.on(e,t),this},n},{})),le("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(ho).slice(0,-1).map(function(e){const t=e.trim().split("(");return[t[0],t[1].split(dt).map(function(a){return parseFloat(a)})]}).reverse().reduce(function(e,t){return t[0]==="matrix"?e.lmultiply(Q.fromArray(t[1])):e[t[0]].apply(e,t[1])},new Q)},toParent:function(n,e){if(this===n)return this;if(ti(this.node))return this.addTo(n,e);const t=this.screenCTM(),a=n.screenCTM().inverse();return this.addTo(n,e).untransform().transform(a.multiply(t)),this},toRoot:function(n){return this.toParent(this.root(),n)},transform:function(n,e){if(n==null||typeof n=="string"){const a=new Q(this).decompose();return n==null?a:a[n]}Q.isMatrixLike(n)||(n={...n,origin:ei(n,this)});const t=new Q(e===!0?this:e||!1).transform(n);return this.attr("transform",t)}});class _e extends Ve{flatten(){return this.each(function(){if(this instanceof _e)return this.flatten().ungroup()}),this}ungroup(e=this.parent(),t=e.index(this)){return t=t===-1?e.children().length:t,this.each(function(a,i){return i[i.length-a-1].toParent(e,t)}),this.remove()}}ue(_e,"Container");class La extends _e{constructor(e,t=e){super(ke("defs",e),t)}flatten(){return this}ungroup(){return this}}ue(La,"Defs");class qe extends Ve{}function di(n){return this.attr("rx",n)}function ui(n){return this.attr("ry",n)}function Rs(n){return n==null?this.cx()-this.rx():this.cx(n+this.rx())}function Bs(n){return n==null?this.cy()-this.ry():this.cy(n+this.ry())}function Vs(n){return this.attr("cx",n)}function Is(n){return this.attr("cy",n)}function Hs(n){return n==null?2*this.rx():this.rx(new re(n).divide(2))}function Os(n){return n==null?2*this.ry():this.ry(new re(n).divide(2))}ue(qe,"Shape");var wo=Object.freeze({__proto__:null,cx:Vs,cy:Is,height:Os,rx:di,ry:ui,width:Hs,x:Rs,y:Bs});class Na extends qe{constructor(e,t=e){super(ke("ellipse",e),t)}size(e,t){const a=Yt(this,e,t);return this.rx(new re(a.width).divide(2)).ry(new re(a.height).divide(2))}}ae(Na,wo),le("Container",{ellipse:Ce(function(n=0,e=n){return this.put(new Na).size(n,e).move(0,0)})}),ue(Na,"Ellipse");class Xs extends xt{constructor(e=de.document.createDocumentFragment()){super(e)}xml(e,t,a){if(typeof e=="boolean"&&(a=t,t=e,e=null),e==null||typeof e=="function"){const i=new xt(na("wrapper",a));return i.add(this.node.cloneNode(!0)),i.xml(!1,a)}return super.xml(e,!1,a)}}function Ys(n,e){return(this._element||this).type==="radialGradient"?this.attr({fx:new re(n),fy:new re(e)}):this.attr({x1:new re(n),y1:new re(e)})}function Ws(n,e){return(this._element||this).type==="radialGradient"?this.attr({cx:new re(n),cy:new re(e)}):this.attr({x2:new re(n),y2:new re(e)})}ue(Xs,"Fragment");var ko=Object.freeze({__proto__:null,from:Ys,to:Ws});class ca extends _e{constructor(e,t){super(ke(e+"Gradient",typeof e=="string"?null:e),t)}attr(e,t,a){return e==="transform"&&(e="gradientTransform"),super.attr(e,t,a)}bbox(){return new Me}targets(){return St("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(e){return this.clear(),typeof e=="function"&&e.call(this,this),this}url(){return"url(#"+this.id()+")"}}ae(ca,ko),le({Container:{gradient(...n){return this.defs().gradient(...n)}},Defs:{gradient:Ce(function(n,e){return this.put(new ca(n)).update(e)})}}),ue(ca,"Gradient");class ha extends _e{constructor(e,t=e){super(ke("pattern",e),t)}attr(e,t,a){return e==="transform"&&(e="patternTransform"),super.attr(e,t,a)}bbox(){return new Me}targets(){return St("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(e){return this.clear(),typeof e=="function"&&e.call(this,this),this}url(){return"url(#"+this.id()+")"}}le({Container:{pattern(...n){return this.defs().pattern(...n)}},Defs:{pattern:Ce(function(n,e,t){return this.put(new ha).update(t).attr({x:0,y:0,width:n,height:e,patternUnits:"userSpaceOnUse"})})}}),ue(ha,"Pattern");let Fa=class extends qe{constructor(n,e=n){super(ke("image",n),e)}load(n,e){if(!n)return this;const t=new de.window.Image;return ut(t,"load",function(a){const i=this.parent(ha);this.width()===0&&this.height()===0&&this.size(t.width,t.height),i instanceof ha&&i.width()===0&&i.height()===0&&i.size(this.width(),this.height()),typeof e=="function"&&e.call(this,a)},this),ut(t,"load error",function(){Je(t)}),this.attr("href",t.src=n,Wt)}};var _s;_s=function(n,e,t){return n!=="fill"&&n!=="stroke"||go.test(e)&&(e=t.root().defs().image(e)),e instanceof Fa&&(e=t.root().defs().pattern(0,0,a=>{a.add(e)})),e},Ds.push(_s),le({Container:{image:Ce(function(n,e){return this.put(new Fa).size(0,0).load(n,e)})}}),ue(Fa,"Image");class bt extends Et{bbox(){let e=-1/0,t=-1/0,a=1/0,i=1/0;return this.forEach(function(s){e=Math.max(s[0],e),t=Math.max(s[1],t),a=Math.min(s[0],a),i=Math.min(s[1],i)}),new Me(a,i,e-a,t-i)}move(e,t){const a=this.bbox();if(e-=a.x,t-=a.y,!isNaN(e)&&!isNaN(t))for(let i=this.length-1;i>=0;i--)this[i]=[this[i][0]+e,this[i][1]+t];return this}parse(e=[0,0]){const t=[];(e=e instanceof Array?Array.prototype.concat.apply([],e):e.trim().split(dt).map(parseFloat)).length%2!=0&&e.pop();for(let a=0,i=e.length;a<i;a+=2)t.push([e[a],e[a+1]]);return t}size(e,t){let a;const i=this.bbox();for(a=this.length-1;a>=0;a--)i.width&&(this[a][0]=(this[a][0]-i.x)*e/i.width+i.x),i.height&&(this[a][1]=(this[a][1]-i.y)*t/i.height+i.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,a=this.length;t<a;t++)e.push(this[t].join(","));return e.join(" ")}transform(e){return this.clone().transformO(e)}transformO(e){Q.isMatrixLike(e)||(e=new Q(e));for(let t=this.length;t--;){const[a,i]=this[t];this[t][0]=e.a*a+e.c*i+e.e,this[t][1]=e.b*a+e.d*i+e.f}return this}}var gi=Object.freeze({__proto__:null,MorphArray:bt,height:function(n){const e=this.bbox();return n==null?e.height:this.size(e.width,n)},width:function(n){const e=this.bbox();return n==null?e.width:this.size(n,e.height)},x:function(n){return n==null?this.bbox().x:this.move(n,this.bbox().y)},y:function(n){return n==null?this.bbox().y:this.move(this.bbox().x,n)}});let Mt=class extends qe{constructor(n,e=n){super(ke("line",n),e)}array(){return new bt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(n,e){return this.attr(this.array().move(n,e).toLine())}plot(n,e,t,a){return n==null?this.array():(n=e!==void 0?{x1:n,y1:e,x2:t,y2:a}:new bt(n).toLine(),this.attr(n))}size(n,e){const t=Yt(this,n,e);return this.attr(this.array().size(t.width,t.height).toLine())}};ae(Mt,gi),le({Container:{line:Ce(function(...n){return Mt.prototype.plot.apply(this.put(new Mt),n[0]!=null?n:[0,0,0,0])})}}),ue(Mt,"Line");let za=class extends _e{constructor(n,e=n){super(ke("marker",n),e)}height(n){return this.attr("markerHeight",n)}orient(n){return this.attr("orient",n)}ref(n,e){return this.attr("refX",n).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(n){return this.clear(),typeof n=="function"&&n.call(this,this),this}width(n){return this.attr("markerWidth",n)}};function Gt(n,e){return function(t){return t==null?this[n]:(this[n]=t,e&&e.call(this),this)}}le({Container:{marker(...n){return this.defs().marker(...n)}},Defs:{marker:Ce(function(n,e,t){return this.put(new za).size(n,e).ref(n/2,e/2).viewbox(0,0,n,e).attr("orient","auto").update(t)})},marker:{marker(n,e,t,a){let i=["marker"];return n!=="all"&&i.push(n),i=i.join("-"),n=arguments[1]instanceof za?arguments[1]:this.defs().marker(e,t,a),this.attr(i,n)}}}),ue(za,"Marker");const Co={"-":function(n){return n},"<>":function(n){return-Math.cos(n*Math.PI)/2+.5},">":function(n){return Math.sin(n*Math.PI/2)},"<":function(n){return 1-Math.cos(n*Math.PI/2)},bezier:function(n,e,t,a){return function(i){return i<0?n>0?e/n*i:t>0?a/t*i:0:i>1?t<1?(1-a)/(1-t)*i+(a-t)/(1-t):n<1?(1-e)/(1-n)*i+(e-n)/(1-n):1:3*i*(1-i)**2*e+3*i**2*(1-i)*a+i**3}},steps:function(n,e="end"){e=e.split("-").reverse()[0];let t=n;return e==="none"?--t:e==="both"&&++t,(a,i=!1)=>{let s=Math.floor(a*n);const r=a*s%1==0;return e!=="start"&&e!=="both"||++s,i&&r&&--s,a>=0&&s<0&&(s=0),a<=1&&s>t&&(s=t),s/t}}};class pi{done(){return!1}}class fi extends pi{constructor(e=xo){super(),this.ease=Co[e]||e}step(e,t,a){return typeof e!="number"?a<1?e:t:e+(t-e)*this.ease(a)}}class Ta extends pi{constructor(e){super(),this.stepper=e}done(e){return e.done}step(e,t,a,i){return this.stepper(e,t,a,i)}}function js(){const n=(this._duration||500)/1e3,e=this._overshoot||0,t=Math.PI,a=Math.log(e/100+1e-10),i=-a/Math.sqrt(t*t+a*a),s=3.9/(i*n);this.d=2*i*s,this.k=s*s}ae(class extends Ta{constructor(n=500,e=0){super(),this.duration(n).overshoot(e)}step(n,e,t,a){if(typeof n=="string")return n;if(a.done=t===1/0,t===1/0)return e;if(t===0)return n;t>100&&(t=16),t/=1e3;const i=a.velocity||0,s=-this.d*i-this.k*(n-e),r=n+i*t+s*t*t/2;return a.velocity=i+s*t,a.done=Math.abs(e-r)+Math.abs(i)<.002,a.done?e:r}},{duration:Gt("_duration",js),overshoot:Gt("_overshoot",js)}),ae(class extends Ta{constructor(n=.1,e=.01,t=0,a=1e3){super(),this.p(n).i(e).d(t).windup(a)}step(n,e,t,a){if(typeof n=="string")return n;if(a.done=t===1/0,t===1/0)return e;if(t===0)return n;const i=e-n;let s=(a.integral||0)+i*t;const r=(i-(a.error||0))/t,o=this._windup;return o!==!1&&(s=Math.max(-o,Math.min(s,o))),a.error=i,a.integral=s,a.done=Math.abs(i)<.001,a.done?e:n+(this.P*i+this.I*s+this.D*r)}},{windup:Gt("_windup"),p:Gt("P"),i:Gt("I"),d:Gt("D")});const Ao={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},mi={M:function(n,e,t){return e.x=t.x=n[0],e.y=t.y=n[1],["M",e.x,e.y]},L:function(n,e){return e.x=n[0],e.y=n[1],["L",n[0],n[1]]},H:function(n,e){return e.x=n[0],["H",n[0]]},V:function(n,e){return e.y=n[0],["V",n[0]]},C:function(n,e){return e.x=n[4],e.y=n[5],["C",n[0],n[1],n[2],n[3],n[4],n[5]]},S:function(n,e){return e.x=n[2],e.y=n[3],["S",n[0],n[1],n[2],n[3]]},Q:function(n,e){return e.x=n[2],e.y=n[3],["Q",n[0],n[1],n[2],n[3]]},T:function(n,e){return e.x=n[0],e.y=n[1],["T",n[0],n[1]]},Z:function(n,e,t){return e.x=t.x,e.y=t.y,["Z"]},A:function(n,e){return e.x=n[5],e.y=n[6],["A",n[0],n[1],n[2],n[3],n[4],n[5],n[6]]}},xi="mlhvqtcsaz".split("");for(let n=0,e=xi.length;n<e;++n)mi[xi[n]]=function(t){return function(a,i,s){if(t==="H")a[0]=a[0]+i.x;else if(t==="V")a[0]=a[0]+i.y;else if(t==="A")a[5]=a[5]+i.x,a[6]=a[6]+i.y;else for(let r=0,o=a.length;r<o;++r)a[r]=a[r]+(r%2?i.y:i.x);return mi[t](a,i,s)}}(xi[n].toUpperCase());function bi(n){return n.segment.length&&n.segment.length-1===Ao[n.segment[0].toUpperCase()]}function So(n,e){n.inNumber&&Lt(n,!1);const t=oi.test(e);if(t)n.segment=[e];else{const a=n.lastCommand,i=a.toLowerCase(),s=a===i;n.segment=[i==="m"?s?"l":"L":a]}return n.inSegment=!0,n.lastCommand=n.segment[0],t}function Lt(n,e){if(!n.inNumber)throw new Error("Parser Error");n.number&&n.segment.push(parseFloat(n.number)),n.inNumber=e,n.number="",n.pointSeen=!1,n.hasExponent=!1,bi(n)&&vi(n)}function vi(n){n.inSegment=!1,n.absolute&&(n.segment=function(e){const t=e.segment[0];return mi[t](e.segment.slice(1),e.p,e.p0)}(n)),n.segments.push(n.segment)}function Eo(n){if(!n.segment.length)return!1;const e=n.segment[0].toUpperCase()==="A",t=n.segment.length;return e&&(t===4||t===5)}function Mo(n){return n.lastToken.toUpperCase()==="E"}const Lo=new Set([" ",","," ",`
|
|
16
|
+
`,"\r","\f"]);class nt extends Et{bbox(){return mt().path.setAttribute("d",this.toString()),new Me(mt.nodes.path.getBBox())}move(e,t){const a=this.bbox();if(e-=a.x,t-=a.y,!isNaN(e)&&!isNaN(t))for(let i,s=this.length-1;s>=0;s--)i=this[s][0],i==="M"||i==="L"||i==="T"?(this[s][1]+=e,this[s][2]+=t):i==="H"?this[s][1]+=e:i==="V"?this[s][1]+=t:i==="C"||i==="S"||i==="Q"?(this[s][1]+=e,this[s][2]+=t,this[s][3]+=e,this[s][4]+=t,i==="C"&&(this[s][5]+=e,this[s][6]+=t)):i==="A"&&(this[s][6]+=e,this[s][7]+=t);return this}parse(e="M0 0"){return Array.isArray(e)&&(e=Array.prototype.concat.apply([],e).toString()),function(t,a=!0){let i=0,s="";const r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:a,p0:new fe,p:new fe};for(;r.lastToken=s,s=t.charAt(i++);)if(r.inSegment||!So(r,s))if(s!==".")if(isNaN(parseInt(s)))if(Lo.has(s))r.inNumber&&Lt(r,!1);else if(s!=="-"&&s!=="+")if(s.toUpperCase()!=="E"){if(oi.test(s)){if(r.inNumber)Lt(r,!1);else{if(!bi(r))throw new Error("parser Error");vi(r)}--i}}else r.number+=s,r.hasExponent=!0;else{if(r.inNumber&&!Mo(r)){Lt(r,!1),--i;continue}r.number+=s,r.inNumber=!0}else{if(r.number==="0"||Eo(r)){r.inNumber=!0,r.number=s,Lt(r,!0);continue}r.inNumber=!0,r.number+=s}else{if(r.pointSeen||r.hasExponent){Lt(r,!1),--i;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=s}return r.inNumber&&Lt(r,!1),r.inSegment&&bi(r)&&vi(r),r.segments}(e)}size(e,t){const a=this.bbox();let i,s;for(a.width=a.width===0?1:a.width,a.height=a.height===0?1:a.height,i=this.length-1;i>=0;i--)s=this[i][0],s==="M"||s==="L"||s==="T"?(this[i][1]=(this[i][1]-a.x)*e/a.width+a.x,this[i][2]=(this[i][2]-a.y)*t/a.height+a.y):s==="H"?this[i][1]=(this[i][1]-a.x)*e/a.width+a.x:s==="V"?this[i][1]=(this[i][1]-a.y)*t/a.height+a.y:s==="C"||s==="S"||s==="Q"?(this[i][1]=(this[i][1]-a.x)*e/a.width+a.x,this[i][2]=(this[i][2]-a.y)*t/a.height+a.y,this[i][3]=(this[i][3]-a.x)*e/a.width+a.x,this[i][4]=(this[i][4]-a.y)*t/a.height+a.y,s==="C"&&(this[i][5]=(this[i][5]-a.x)*e/a.width+a.x,this[i][6]=(this[i][6]-a.y)*t/a.height+a.y)):s==="A"&&(this[i][1]=this[i][1]*e/a.width,this[i][2]=this[i][2]*t/a.height,this[i][6]=(this[i][6]-a.x)*e/a.width+a.x,this[i][7]=(this[i][7]-a.y)*t/a.height+a.y);return this}toString(){return function(e){let t="";for(let a=0,i=e.length;a<i;a++)t+=e[a][0],e[a][1]!=null&&(t+=e[a][1],e[a][2]!=null&&(t+=" ",t+=e[a][2],e[a][3]!=null&&(t+=" ",t+=e[a][3],t+=" ",t+=e[a][4],e[a][5]!=null&&(t+=" ",t+=e[a][5],t+=" ",t+=e[a][6],e[a][7]!=null&&(t+=" ",t+=e[a][7])))));return t+" "}(this)}}const Gs=n=>{const e=typeof n;return e==="number"?re:e==="string"?be.isColor(n)?be:dt.test(n)?oi.test(n)?nt:Et:As.test(n)?re:yi:wi.indexOf(n.constructor)>-1?n.constructor:Array.isArray(n)?Et:e==="object"?ua:yi};class Nt{constructor(e){this._stepper=e||new fi("-"),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 e==null?this._from:(this._from=this._set(e),this)}stepper(e){return e==null?this._stepper:(this._stepper=e,this)}to(e){return e==null?this._to:(this._to=this._set(e),this)}type(e){return e==null?this._type:(this._type=e,this)}_set(e){this._type||this.type(Gs(e));let t=new this._type(e);return this._type===be&&(t=this._to?t[this._to[4]]():this._from?t[this._from[4]]():t),this._type===ua&&(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(a){return a.done=!0,a}),t}}class yi{constructor(...e){this.init(...e)}init(e){return e=Array.isArray(e)?e[0]:e,this.value=e,this}toArray(){return[this.value]}valueOf(){return this.value}}class da{constructor(...e){this.init(...e)}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,da.defaults,e),this}toArray(){const e=this;return[e.scaleX,e.scaleY,e.shear,e.rotate,e.translateX,e.translateY,e.originX,e.originY]}}da.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const No=(n,e)=>n[0]<e[0]?-1:n[0]>e[0]?1:0;class ua{constructor(...e){this.init(...e)}align(e){const t=this.values;for(let a=0,i=t.length;a<i;++a){if(t[a+1]===e[a+1]){if(t[a+1]===be&&e[a+7]!==t[a+7]){const o=e[a+7],l=new be(this.values.splice(a+3,5))[o]().toArray();this.values.splice(a+3,0,...l)}a+=t[a+2]+2;continue}if(!e[a+1])return this;const s=new e[a+1]().toArray(),r=t[a+2]+3;t.splice(a,r,e[a],e[a+1],e[a+2],...s),a+=t[a+2]+2}return this}init(e){if(this.values=[],Array.isArray(e))return void(this.values=e.slice());e=e||{};const t=[];for(const a in e){const i=Gs(e[a]),s=new i(e[a]).toArray();t.push([a,i,s.length,...s])}return t.sort(No),this.values=t.reduce((a,i)=>a.concat(i),[]),this}toArray(){return this.values}valueOf(){const e={},t=this.values;for(;t.length;){const a=t.shift(),i=t.shift(),s=t.shift(),r=t.splice(0,s);e[a]=new i(r)}return e}}const wi=[yi,da,ua];class $t extends qe{constructor(e,t=e){super(ke("path",e),t)}array(){return this._array||(this._array=new nt(this.attr("d")))}clear(){return delete this._array,this}height(e){return e==null?this.bbox().height:this.size(this.bbox().width,e)}move(e,t){return this.attr("d",this.array().move(e,t))}plot(e){return e==null?this.array():this.clear().attr("d",typeof e=="string"?e:this._array=new nt(e))}size(e,t){const a=Yt(this,e,t);return this.attr("d",this.array().size(a.width,a.height))}width(e){return e==null?this.bbox().width:this.size(e,this.bbox().height)}x(e){return e==null?this.bbox().x:this.move(e,this.bbox().y)}y(e){return e==null?this.bbox().y:this.move(this.bbox().x,e)}}$t.prototype.MorphArray=nt,le({Container:{path:Ce(function(n){return this.put(new $t).plot(n||new nt)})}}),ue($t,"Path");var $s=Object.freeze({__proto__:null,array:function(){return this._array||(this._array=new bt(this.attr("points")))},clear:function(){return delete this._array,this},move:function(n,e){return this.attr("points",this.array().move(n,e))},plot:function(n){return n==null?this.array():this.clear().attr("points",typeof n=="string"?n:this._array=new bt(n))},size:function(n,e){const t=Yt(this,n,e);return this.attr("points",this.array().size(t.width,t.height))}});class Ft extends qe{constructor(e,t=e){super(ke("polygon",e),t)}}le({Container:{polygon:Ce(function(n){return this.put(new Ft).plot(n||new bt)})}}),ae(Ft,gi),ae(Ft,$s),ue(Ft,"Polygon");class zt extends qe{constructor(e,t=e){super(ke("polyline",e),t)}}le({Container:{polyline:Ce(function(n){return this.put(new zt).plot(n||new bt)})}}),ae(zt,gi),ae(zt,$s),ue(zt,"Polyline");class Pa extends qe{constructor(e,t=e){super(ke("rect",e),t)}}ae(Pa,{rx:di,ry:ui}),le({Container:{rect:Ce(function(n,e){return this.put(new Pa).size(n,e)})}}),ue(Pa,"Rect");class ki{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=e.next!==void 0?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 me={nextDraw:null,frames:new ki,timeouts:new ki,immediates:new ki,timer:()=>de.window.performance||de.window.Date,transforms:[],frame(n){const e=me.frames.push({run:n});return me.nextDraw===null&&(me.nextDraw=de.window.requestAnimationFrame(me._draw)),e},timeout(n,e){e=e||0;const t=me.timer().now()+e,a=me.timeouts.push({run:n,time:t});return me.nextDraw===null&&(me.nextDraw=de.window.requestAnimationFrame(me._draw)),a},immediate(n){const e=me.immediates.push(n);return me.nextDraw===null&&(me.nextDraw=de.window.requestAnimationFrame(me._draw)),e},cancelFrame(n){n!=null&&me.frames.remove(n)},clearTimeout(n){n!=null&&me.timeouts.remove(n)},cancelImmediate(n){n!=null&&me.immediates.remove(n)},_draw(n){let e=null;const t=me.timeouts.last();for(;(e=me.timeouts.shift())&&(n>=e.time?e.run():me.timeouts.push(e),e!==t););let a=null;const i=me.frames.last();for(;a!==i&&(a=me.frames.shift());)a.run(n);let s=null;for(;s=me.immediates.shift();)s();me.nextDraw=me.timeouts.first()||me.frames.first()?de.window.requestAnimationFrame(me._draw):null}},Fo=function(n){const e=n.start,t=n.runner.duration();return{start:e,duration:t,end:e+t,runner:n.runner}},zo=function(){const n=de.window;return(n.performance||n.Date).now()};class Us extends oa{constructor(e=zo){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(t=>t.start+t.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 e==null?this._persist:(this._persist=e,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(e){const t=this.speed();if(e==null)return this.speed(-t);const a=Math.abs(t);return this.speed(e?-a:a)}schedule(e,t,a){if(e==null)return this._runners.map(Fo);let i=0;const s=this.getEndTime();if(t=t||0,a==null||a==="last"||a==="after")i=s;else if(a==="absolute"||a==="start")i=t,t=0;else if(a==="now")i=this._time;else if(a==="relative"){const l=this.getRunnerInfoById(e.id);l&&(i=l.start+t,t=0)}else{if(a!=="with-last")throw new Error('Invalid value for the "when" parameter');{const l=this.getLastRunnerInfo();i=l?l.start:this._time}}e.unschedule(),e.timeline(this);const r=e.persist(),o={persist:r===null?this._persist:r,start:i+t,runner:e};return this._lastRunnerId=e.id,this._runners.push(o),this._runners.sort((l,h)=>l.start-h.start),this._runnerIds=this._runners.map(l=>l.runner.id),this.updateTime()._continue(),this}seek(e){return this.time(this._time+e)}source(e){return e==null?this._timeSource:(this._timeSource=e,this)}speed(e){return e==null?this._speed:(this._speed=e,this)}stop(){return this.time(0),this.pause()}time(e){return e==null?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(e=!1){return me.cancelFrame(this._nextFrame),this._nextFrame=null,e?this._stepImmediate():(this._paused||(this._nextFrame=me.frame(this._step)),this)}_stepFn(e=!1){const t=this._timeSource();let a=t-this._lastSourceTime;e&&(a=0);const i=this._speed*a+(this._time-this._lastStepTime);this._lastSourceTime=t,e||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let r=this._runners.length;r--;){const o=this._runners[r],l=o.runner;this._time-o.start<=0&&l.reset()}let s=!1;for(let r=0,o=this._runners.length;r<o;r++){const l=this._runners[r],h=l.runner;let d=i;const u=this._time-l.start;if(u<=0){s=!0;continue}u<d&&(d=u),h.active()&&(h.step(d).done?l.persist!==!0&&h.duration()-h.time()+this._time+l.persist<this._time&&(h.unschedule(),--r,--o):s=!0)}return s&&!(this._speed<0&&this._time===0)||this._runnerIds.length&&this._speed<0&&this._time>0?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)}}le({Element:{timeline:function(n){return n==null?(this._timeline=this._timeline||new Us,this._timeline):(this._timeline=n,this)}}});class Ze extends oa{constructor(e){super(),this.id=Ze.id++,e=typeof(e=e??hi)=="function"?new Ta(e):e,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration=typeof e=="number"&&e,this._isDeclarative=e instanceof Ta,this._stepper=this._isDeclarative?e:new fi,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,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,a){let i=1,s=!1,r=0;return t=t??bo,a=a||"last",typeof(e=e??hi)!="object"||e instanceof pi||(t=e.delay??t,a=e.when??a,s=e.swing||s,i=e.times??i,r=e.wait??r,e=e.duration??hi),{duration:e,delay:t,swing:s,times:i,wait:r,when:a}}active(e){return e==null?this.enabled:(this.enabled=e,this)}addTransform(e){return this.transforms.lmultiplyO(e),this}after(e){return this.on("finished",e)}animate(e,t,a){const i=Ze.sanitise(e,t,a),s=new Ze(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new Q,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 fi(e),this}element(e){return e==null?this._element:(this._element=e,e._prepareRunner(),this)}finish(){return this.step(1/0)}loop(e,t,a){return typeof e=="object"&&(t=e.swing,a=e.wait,e=e.times),this._times=e||1/0,this._swing=t||!1,this._wait=a||0,this._times===!0&&(this._times=1/0),this}loops(e){const t=this._duration+this._wait;if(e==null){const s=Math.floor(this._time/t),r=(this._time-s*t)/this._duration;return Math.min(s+r,this._times)}const a=e%1,i=t*Math.floor(e)+this._duration*a;return this.time(i)}persist(e){return e==null?this._persist:(this._persist=e,this)}position(e){const t=this._time,a=this._duration,i=this._wait,s=this._times,r=this._swing,o=this._reverse;let l;if(e==null){const u=function(p){const f=r*Math.floor(p%(2*(i+a))/(i+a)),m=f&&!o||!f&&o,x=Math.pow(-1,m)*(p%(i+a))/a+m;return Math.max(Math.min(x,1),0)},g=s*(i+a)-i;return l=t<=0?Math.round(u(1e-5)):t<g?u(t):Math.round(u(g-1e-5)),l}const h=Math.floor(this.loops()),d=r&&h%2==0;return l=h+(d&&!o||o&&d?e:1-e),this.loops(l)}progress(e){return e==null?Math.min(1,this._time/this.duration()):this.time(e*this.duration())}queue(e,t,a,i){return this._queue.push({initialiser:e||Ps,runner:t||Ps,retarget:a,isTransform:i,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(e){return this._reverse=e??!this._reverse,this}schedule(e,t,a){if(e instanceof Us||(a=t,t=e,e=this.timeline()),!e)throw Error("Runner cannot be scheduled without timeline");return e.schedule(this,t,a),this}step(e){if(!this.enabled)return this;e=e??16,this._time+=e;const t=this.position(),a=this._lastPosition!==t&&this._time>=0;this._lastPosition=t;const i=this.duration(),s=this._lastTime<=0&&this._time>0,r=this._lastTime<i&&this._time>=i;this._lastTime=this._time,s&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!r&&this._time>=i,this._reseted=!1;let l=!1;return(a||o)&&(this._initialise(a),this.transforms=new Q,l=this._run(o?e:t),this.fire("step",this)),this.done=this.done||l&&o,r&&this.fire("finished",this),this}time(e){if(e==null)return this._time;const t=e-this._time;return this.step(t),this}timeline(e){return e===void 0?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,a=this._queue.length;t<a;++t){const i=this._queue[t],s=this._isDeclarative||!i.initialised&&e;e=!i.finished,s&&e&&(i.initialiser.call(this),i.initialised=!0)}}_rememberMorpher(e,t){if(this._history[e]={morpher:t,caller:this._queue[this._queue.length-1]},this._isDeclarative){const a=this.timeline();a&&a.play()}}_run(e){let t=!0;for(let a=0,i=this._queue.length;a<i;++a){const s=this._queue[a],r=s.runner.call(this,e);s.finished=s.finished||r===!0,t=t&&s.finished}return t}_tryRetarget(e,t,a){if(this._history[e]){if(!this._history[e].caller.initialised){const s=this._queue.indexOf(this._history[e].caller);return this._queue.splice(s,1),!1}this._history[e].caller.retarget?this._history[e].caller.retarget.call(this,t,a):this._history[e].morpher.to(t),this._history[e].caller.finished=!1;const i=this.timeline();return i&&i.play(),!0}return!1}}Ze.id=0;class Da{constructor(e=new Q,t=-1,a=!0){this.transforms=e,this.id=t,this.done=a}clearTransformsFromQueue(){}}ae([Ze,Da],{mergeWith(n){return new Da(n.transforms.lmultiply(this.transforms),n.id)}});const qs=(n,e)=>n.lmultiplyO(e),Zs=n=>n.transforms;function To(){const n=this._transformationRunners.runners.map(Zs).reduce(qs,new Q);this.transform(n),this._transformationRunners.merge(),this._transformationRunners.length()===1&&(this._frameId=null)}class Po{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 Da).forEach(a=>a.clearTransformsFromQueue()),this}edit(e,t){const a=this.ids.indexOf(e+1);return this.ids.splice(a,1,e+1),this.runners.splice(a,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;t<this.runners.length;++t){const a=this.runners[t];if(e&&a.done&&e.done&&(!a._timeline||!a._timeline._runnerIds.includes(a.id))&&(!e._timeline||!e._timeline._runnerIds.includes(e.id))){this.remove(a.id);const i=a.mergeWith(e);this.edit(e.id,i),e=i,--t}else e=a}return this}remove(e){const t=this.ids.indexOf(e+1);return this.ids.splice(t,1),this.runners.splice(t,1),this}}le({Element:{animate(n,e,t){const a=Ze.sanitise(n,e,t),i=this.timeline();return new Ze(a.duration).loop(a).element(this).timeline(i.play()).schedule(a.delay,a.when)},delay(n,e){return this.animate(0,n,e)},_clearTransformRunnersBefore(n){this._transformationRunners.clearBefore(n.id)},_currentTransform(n){return this._transformationRunners.runners.filter(e=>e.id<=n.id).map(Zs).reduce(qs,new Q)},_addRunner(n){this._transformationRunners.add(n),me.cancelImmediate(this._frameId),this._frameId=me.immediate(To.bind(this))},_prepareRunner(){this._frameId==null&&(this._transformationRunners=new Po().add(new Da(new Q(this))))}}}),ae(Ze,{attr(n,e){return this.styleAttr("attr",n,e)},css(n,e){return this.styleAttr("css",n,e)},styleAttr(n,e,t){if(typeof e=="string")return this.styleAttr(n,{[e]:t});let a=e;if(this._tryRetarget(n,a))return this;let i=new Nt(this._stepper).to(a),s=Object.keys(a);return this.queue(function(){i=i.from(this.element()[n](s))},function(r){return this.element()[n](i.at(r).valueOf()),i.done()},function(r){const o=Object.keys(r),l=(h=s,o.filter(u=>!h.includes(u)));var h;if(l.length){const u=this.element()[n](l),g=new ua(i.from()).valueOf();Object.assign(g,u),i.from(g)}const d=new ua(i.to()).valueOf();Object.assign(d,r),i.to(d),s=o,a=r}),this._rememberMorpher(n,i),this},zoom(n,e){if(this._tryRetarget("zoom",n,e))return this;let t=new Nt(this._stepper).to(new re(n));return this.queue(function(){t=t.from(this.element().zoom())},function(a){return this.element().zoom(t.at(a),e),t.done()},function(a,i){e=i,t.to(a)}),this._rememberMorpher("zoom",t),this},transform(n,e,t){if(e=n.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",n))return this;const a=Q.isMatrixLike(n);t=n.affine!=null?n.affine:t??!a;const i=new Nt(this._stepper).type(t?da:Q);let s,r,o,l,h;return this.queue(function(){r=r||this.element(),s=s||ei(n,r),h=new Q(e?void 0:r),r._addRunner(this),e||r._clearTransformRunnersBefore(this)},function(d){e||this.clearTransform();const{x:u,y:g}=new fe(s).transform(r._currentTransform(this));let p=new Q({...n,origin:[u,g]}),f=this._isDeclarative&&o?o:h;if(t){p=p.decompose(u,g),f=f.decompose(u,g);const x=p.rotate,b=f.rotate,v=[x-360,x,x+360],w=v.map(E=>Math.abs(E-b)),k=Math.min(...w),y=w.indexOf(k);p.rotate=v[y]}e&&(a||(p.rotate=n.rotate||0),this._isDeclarative&&l&&(f.rotate=l)),i.from(f),i.to(p);const m=i.at(d);return l=m.rotate,o=new Q(m),this.addTransform(o),r._addRunner(this),i.done()},function(d){(d.origin||"center").toString()!==(n.origin||"center").toString()&&(s=ei(d,r)),n={...d,origin:s}},!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(n){return this._queueNumber("x",n)},y(n){return this._queueNumber("y",n)},ax(n){return this._queueNumber("ax",n)},ay(n){return this._queueNumber("ay",n)},dx(n=0){return this._queueNumberDelta("x",n)},dy(n=0){return this._queueNumberDelta("y",n)},dmove(n,e){return this.dx(n).dy(e)},_queueNumberDelta(n,e){if(e=new re(e),this._tryRetarget(n,e))return this;const t=new Nt(this._stepper).to(e);let a=null;return this.queue(function(){a=this.element()[n](),t.from(a),t.to(a+e)},function(i){return this.element()[n](t.at(i)),t.done()},function(i){t.to(a+new re(i))}),this._rememberMorpher(n,t),this},_queueObject(n,e){if(this._tryRetarget(n,e))return this;const t=new Nt(this._stepper).to(e);return this.queue(function(){t.from(this.element()[n]())},function(a){return this.element()[n](t.at(a)),t.done()}),this._rememberMorpher(n,t),this},_queueNumber(n,e){return this._queueObject(n,new re(e))},cx(n){return this._queueNumber("cx",n)},cy(n){return this._queueNumber("cy",n)},move(n,e){return this.x(n).y(e)},amove(n,e){return this.ax(n).ay(e)},center(n,e){return this.cx(n).cy(e)},size(n,e){let t;return n&&e||(t=this._element.bbox()),n||(n=t.width/t.height*e),e||(e=t.height/t.width*n),this.width(n).height(e)},width(n){return this._queueNumber("width",n)},height(n){return this._queueNumber("height",n)},plot(n,e,t,a){if(arguments.length===4)return this.plot([n,e,t,a]);if(this._tryRetarget("plot",n))return this;const i=new Nt(this._stepper).type(this._element.MorphArray).to(n);return this.queue(function(){i.from(this._element.array())},function(s){return this._element.plot(i.at(s)),i.done()}),this._rememberMorpher("plot",i),this},leading(n){return this._queueNumber("leading",n)},viewbox(n,e,t,a){return this._queueObject("viewbox",new Me(n,e,t,a))},update(n){return typeof n!="object"?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(n.opacity!=null&&this.attr("stop-opacity",n.opacity),n.color!=null&&this.attr("stop-color",n.color),n.offset!=null&&this.attr("offset",n.offset),this)}}),ae(Ze,{rx:di,ry:ui,from:Ys,to:Ws}),ue(Ze,"Runner");class Ci extends _e{constructor(e,t=e){super(ke("svg",e),t),this.namespace()}defs(){return this.isRoot()?Ke(this.node.querySelector("defs"))||this.put(new La):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof de.window.SVGElement)&&this.node.parentNode.nodeName!=="#document-fragment"}namespace(){return this.isRoot()?this.attr({xmlns:ai,version:"1.1"}).attr("xmlns:xlink",Wt,ii):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,ii).attr("xmlns:svgjs",null,ii)}root(){return this.isRoot()?this:super.root()}}le({Container:{nested:Ce(function(){return this.put(new Ci)})}}),ue(Ci,"Svg",!0);let Ai=class extends _e{constructor(n,e=n){super(ke("symbol",n),e)}};le({Container:{symbol:Ce(function(){return this.put(new Ai)})}}),ue(Ai,"Symbol");var Ks=Object.freeze({__proto__:null,amove:function(n,e){return this.ax(n).ay(e)},ax:function(n){return this.attr("x",n)},ay:function(n){return this.attr("y",n)},build:function(n){return this._build=!!n,this},center:function(n,e,t=this.bbox()){return this.cx(n,t).cy(e,t)},cx:function(n,e=this.bbox()){return n==null?e.cx:this.attr("x",this.attr("x")+n-e.cx)},cy:function(n,e=this.bbox()){return n==null?e.cy:this.attr("y",this.attr("y")+n-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(n,e,t=this.bbox()){return this.x(n,t).y(e,t)},plain:function(n){return this._build===!1&&this.clear(),this.node.appendChild(de.document.createTextNode(n)),this},x:function(n,e=this.bbox()){return n==null?e.x:this.attr("x",this.attr("x")+n-e.x)},y:function(n,e=this.bbox()){return n==null?e.y:this.attr("y",this.attr("y")+n-e.y)}});class ot extends qe{constructor(e,t=e){super(ke("text",e),t),this.dom.leading=this.dom.leading??new re(1.3),this._rebuild=!0,this._build=!1}leading(e){return e==null?this.dom.leading:(this.dom.leading=new re(e),this.rebuild())}rebuild(e){if(typeof e=="boolean"&&(this._rebuild=e),this._rebuild){const t=this;let a=0;const i=this.dom.leading;this.each(function(s){if(ti(this.node))return;const r=de.window.getComputedStyle(this.node).getPropertyValue("font-size"),o=i*new re(r);this.dom.newLined&&(this.attr("x",t.attr("x")),this.text()===`
|
|
17
|
+
`?a+=o:(this.attr("dy",s?o+a:0),a=0))}),this.fire("rebuild")}return this}setData(e){return this.dom=e,this.dom.leading=new re(e.leading||1.3),this}writeDataToDom(){return ws(this,this.dom,{leading:1.3}),this}text(e){if(e===void 0){const t=this.node.childNodes;let a=0;e="";for(let i=0,s=t.length;i<s;++i)t[i].nodeName==="textPath"||ti(t[i])?i===0&&(a=i+1):(i!==a&&t[i].nodeType!==3&&Ke(t[i]).dom.newLined===!0&&(e+=`
|
|
18
|
+
`),e+=t[i].textContent);return e}if(this.clear().build(!0),typeof e=="function")e.call(this,this);else for(let t=0,a=(e=(e+"").split(`
|
|
19
|
+
`)).length;t<a;t++)this.newLine(e[t]);return this.build(!1).rebuild()}}ae(ot,Ks),le({Container:{text:Ce(function(n=""){return this.put(new ot).text(n)}),plain:Ce(function(n=""){return this.put(new ot).plain(n)})}}),ue(ot,"Text");class Ra extends qe{constructor(e,t=e){super(ke("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 ot))return this;const t=e.index(this),a=de.window.getComputedStyle(this.node).getPropertyValue("font-size"),i=e.dom.leading*new re(a);return this.dy(t?i:0).attr("x",e.x())}text(e){return e==null?this.node.textContent+(this.dom.newLined?`
|
|
20
|
+
`:""):(typeof e=="function"?(this.clear().build(!0),e.call(this,this),this.build(!1)):this.plain(e),this)}}ae(Ra,Ks),le({Tspan:{tspan:Ce(function(n=""){const e=new Ra;return this._build||this.clear(),this.put(e).text(n)})},Text:{newLine:function(n=""){return this.tspan(n).newLine()}}}),ue(Ra,"Tspan");class Si extends qe{constructor(e,t=e){super(ke("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 re(e).divide(2))}}ae(Si,{x:Rs,y:Bs,cx:Vs,cy:Is,width:Hs,height:Os}),le({Container:{circle:Ce(function(n=0){return this.put(new Si).size(n).move(0,0)})}}),ue(Si,"Circle");class Ei extends _e{constructor(e,t=e){super(ke("clipPath",e),t)}remove(){return this.targets().forEach(function(e){e.unclip()}),super.remove()}targets(){return St("svg [clip-path*="+this.id()+"]")}}le({Container:{clip:Ce(function(){return this.defs().put(new Ei)})},Element:{clipper(){return this.reference("clip-path")},clipWith(n){const e=n instanceof Ei?n:this.parent().clip().add(n);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),ue(Ei,"ClipPath");class Js extends Ve{constructor(e,t=e){super(ke("foreignObject",e),t)}}le({Container:{foreignObject:Ce(function(n,e){return this.put(new Js).size(n,e)})}}),ue(Js,"ForeignObject");var Qs=Object.freeze({__proto__:null,dmove:function(n,e){return this.children().forEach(t=>{let a;try{a=t.node instanceof ra().SVGSVGElement?new Me(t.attr(["x","y","width","height"])):t.bbox()}catch{return}const i=new Q(t),s=i.translate(n,e).transform(i.inverse()),r=new fe(a.x,a.y).transform(s);t.move(r.x,r.y)}),this},dx:function(n){return this.dmove(n,0)},dy:function(n){return this.dmove(0,n)},height:function(n,e=this.bbox()){return n==null?e.height:this.size(e.width,n,e)},move:function(n=0,e=0,t=this.bbox()){const a=n-t.x,i=e-t.y;return this.dmove(a,i)},size:function(n,e,t=this.bbox()){const a=Yt(this,n,e,t),i=a.width/t.width,s=a.height/t.height;return this.children().forEach(r=>{const o=new fe(t).transform(new Q(r).inverse());r.scale(i,s,o.x,o.y)}),this},width:function(n,e=this.bbox()){return n==null?e.width:this.size(n,e.height,e)},x:function(n,e=this.bbox()){return n==null?e.x:this.move(n,e.y,e)},y:function(n,e=this.bbox()){return n==null?e.y:this.move(e.x,n,e)}});class vt extends _e{constructor(e,t=e){super(ke("g",e),t)}}ae(vt,Qs),le({Container:{group:Ce(function(){return this.put(new vt)})}}),ue(vt,"G");class Ba extends _e{constructor(e,t=e){super(ke("a",e),t)}target(e){return this.attr("target",e)}to(e){return this.attr("href",e,Wt)}}ae(Ba,Qs),le({Container:{link:Ce(function(n){return this.put(new Ba).to(n)})},Element:{unlink(){const n=this.linker();if(!n)return this;const e=n.parent();if(!e)return this.remove();const t=e.index(n);return e.add(this,t),n.remove(),this},linkTo(n){let e=this.linker();return e||(e=new Ba,this.wrap(e)),typeof n=="function"?n.call(e,e):e.to(n),this},linker(){const n=this.parent();return n&&n.node.nodeName.toLowerCase()==="a"?n:null}}}),ue(Ba,"A");class Mi extends _e{constructor(e,t=e){super(ke("mask",e),t)}remove(){return this.targets().forEach(function(e){e.unmask()}),super.remove()}targets(){return St("svg [mask*="+this.id()+"]")}}le({Container:{mask:Ce(function(){return this.defs().put(new Mi)})},Element:{masker(){return this.reference("mask")},maskWith(n){const e=n instanceof Mi?n:this.parent().mask().add(n);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),ue(Mi,"Mask");class er extends Ve{constructor(e,t=e){super(ke("stop",e),t)}update(e){return(typeof e=="number"||e instanceof re)&&(e={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),e.opacity!=null&&this.attr("stop-opacity",e.opacity),e.color!=null&&this.attr("stop-color",e.color),e.offset!=null&&this.attr("offset",new re(e.offset)),this}}le({Gradient:{stop:function(n,e,t){return this.put(new er).update(n,e,t)}}}),ue(er,"Stop");class Li extends Ve{constructor(e,t=e){super(ke("style",e),t)}addText(e=""){return this.node.textContent+=e,this}font(e,t,a={}){return this.rule("@font-face",{fontFamily:e,src:t,...a})}rule(e,t){return this.addText(function(a,i){if(!a)return"";if(!i)return a;let s=a+"{";for(const r in i)s+=r.replace(/([A-Z])/g,function(o,l){return"-"+l.toLowerCase()})+":"+i[r]+";";return s+="}",s}(e,t))}}le("Dom",{style(n,e){return this.put(new Li).rule(n,e)},fontface(n,e,t){return this.put(new Li).font(n,e,t)}}),ue(Li,"Style");class Ni extends ot{constructor(e,t=e){super(ke("textPath",e),t)}array(){const e=this.track();return e?e.array():null}plot(e){const t=this.track();let a=null;return t&&(a=t.plot(e)),e==null?a:this}track(){return this.reference("href")}}le({Container:{textPath:Ce(function(n,e){return n instanceof ot||(n=this.text(n)),n.path(e)})},Text:{path:Ce(function(n,e=!0){const t=new Ni;let a;if(n instanceof $t||(n=this.defs().path(n)),t.attr("href","#"+n,Wt),e)for(;a=this.node.firstChild;)t.node.appendChild(a);return this.put(t)}),textPath(){return this.findOne("textPath")}},Path:{text:Ce(function(n){return n instanceof ot||(n=new ot().addTo(this.parent()).text(n)),n.path(this)}),targets(){return St("svg textPath").filter(n=>(n.attr("href")||"").includes(this.id()))}}}),Ni.prototype.MorphArray=nt,ue(Ni,"TextPath");class tr extends qe{constructor(e,t=e){super(ke("use",e),t)}use(e,t){return this.attr("href",(t||"")+"#"+e,Wt)}}le({Container:{use:Ce(function(n,e){return this.put(new tr).use(n,e)})}}),ue(tr,"Use");const Do=We;ae([Ci,Ai,Fa,ha,za],$e("viewbox")),ae([Mt,zt,Ft,$t],$e("marker")),ae(ot,$e("Text")),ae($t,$e("Path")),ae(La,$e("Defs")),ae([ot,Ra],$e("Tspan")),ae([Pa,Na,ca,Ze],$e("radius")),ae(oa,$e("EventTarget")),ae(xt,$e("Dom")),ae(Ve,$e("Element")),ae(qe,$e("Shape")),ae([_e,Xs],$e("Container")),ae(ca,$e("Gradient")),ae(Ze,$e("Runner")),At.extend([...new Set(vs)]),function(n=[]){wi.push(...[].concat(n))}([re,be,Me,Q,Et,bt,nt,fe]),ae(wi,{to(n){return new Nt().type(this.constructor).from(this.toArray()).to(n)},fromArray(n){return this.init(n),this},toConsumable(){return this.toArray()},morph(n,e,t,a,i){return this.fromArray(n.map(function(s,r){return a.step(s,e[r],t,i[r],i)}))}});class Se extends Ve{constructor(e){super(ke("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 St('svg [filter*="'+this.id()+'"]')}toString(){return"url(#"+this.id()+")"}}class Fi extends Ve{constructor(e,t){super(e,t),this.result(this.id())}in(e){if(e==null){const t=this.attr("in");return this.parent()&&this.parent().find(`[result="${t}"]`)[0]||t}return this.attr("in",e)}result(e){return this.attr("result",e)}toString(){return this.result()}}const Qe=n=>function(...e){for(let t=n.length;t--;)e[t]!=null&&this.attr(n[t],e[t])},Ro={blend:Qe(["in","in2","mode"]),colorMatrix:Qe(["type","values"]),composite:Qe(["in","in2","operator"]),convolveMatrix:function(n){n=new Et(n).toString(),this.attr({order:Math.sqrt(n.split(" ").length),kernelMatrix:n})},diffuseLighting:Qe(["surfaceScale","lightingColor","diffuseConstant","kernelUnitLength"]),displacementMap:Qe(["in","in2","scale","xChannelSelector","yChannelSelector"]),dropShadow:Qe(["in","dx","dy","stdDeviation"]),flood:Qe(["flood-color","flood-opacity"]),gaussianBlur:function(n=0,e=n){this.attr("stdDeviation",n+" "+e)},image:function(n){this.attr("href",n,Wt)},morphology:Qe(["operator","radius"]),offset:Qe(["dx","dy"]),specularLighting:Qe(["surfaceScale","lightingColor","diffuseConstant","specularExponent","kernelUnitLength"]),tile:Qe([]),turbulence:Qe(["baseFrequency","numOctaves","seed","stitchTiles","type"])};["blend","colorMatrix","componentTransfer","composite","convolveMatrix","diffuseLighting","displacementMap","dropShadow","flood","gaussianBlur","image","merge","morphology","offset","specularLighting","tile","turbulence"].forEach(n=>{const e=Xt(n),t=Ro[n];Se[e+"Effect"]=class extends Fi{constructor(a){super(ke("fe"+e,a),a)}update(a){return t.apply(this,a),this}},Se.prototype[n]=Ce(function(a,...i){const s=new Se[e+"Effect"];return a==null?this.put(s):(typeof a=="function"?a.call(s,s):i.unshift(a),this.put(s).update(i))})}),ae(Se,{merge(n){const e=this.put(new Se.MergeEffect);return typeof n=="function"?(n.call(e,e),e):((n instanceof Array?n:[...arguments]).forEach(t=>{t instanceof Se.MergeNode?e.put(t):e.mergeNode(t)}),e)},componentTransfer(n={}){const e=this.put(new Se.ComponentTransferEffect);if(typeof n=="function")return n.call(e,e),e;n.r||n.g||n.b||n.a||(n={r:n,g:n,b:n,a:n});for(const t in n)e.add(new Se["Func"+t.toUpperCase()](n[t]));return e}}),["distantLight","pointLight","spotLight","mergeNode","FuncR","FuncG","FuncB","FuncA"].forEach(n=>{const e=Xt(n);Se[e]=class extends Fi{constructor(t){super(ke("fe"+e,t),t)}}}),["funcR","funcG","funcB","funcA"].forEach(function(n){const e=Se[Xt(n)],t=Ce(function(){return this.put(new e)});Se.ComponentTransferEffect.prototype[n]=t}),["distantLight","pointLight","spotLight"].forEach(n=>{const e=Se[Xt(n)],t=Ce(function(){return this.put(new e)});Se.DiffuseLightingEffect.prototype[n]=t,Se.SpecularLightingEffect.prototype[n]=t}),ae(Se.MergeEffect,{mergeNode(n){return this.put(new Se.MergeNode).attr("in",n)}}),ae(La,{filter:function(n){const e=this.put(new Se);return typeof n=="function"&&n.call(e,e),e}}),ae(_e,{filter:function(n){return this.defs().filter(n)}}),ae(Ve,{filterWith:function(n){const e=n instanceof Se?n:this.defs().filter(n);return this.attr("filter",e)},unfilter:function(n){return this.attr("filter",null)},filterer(){return this.reference("filter")}}),ae(Fi,{blend:function(n,e){return this.parent()&&this.parent().blend(this,n,e)},colorMatrix:function(n,e){return this.parent()&&this.parent().colorMatrix(n,e).in(this)},componentTransfer:function(n){return this.parent()&&this.parent().componentTransfer(n).in(this)},composite:function(n,e){return this.parent()&&this.parent().composite(this,n,e)},convolveMatrix:function(n){return this.parent()&&this.parent().convolveMatrix(n).in(this)},diffuseLighting:function(n,e,t,a){return this.parent()&&this.parent().diffuseLighting(n,t,a).in(this)},displacementMap:function(n,e,t,a){return this.parent()&&this.parent().displacementMap(this,n,e,t,a)},dropShadow:function(n,e,t){return this.parent()&&this.parent().dropShadow(this,n,e,t).in(this)},flood:function(n,e){return this.parent()&&this.parent().flood(n,e)},gaussianBlur:function(n,e){return this.parent()&&this.parent().gaussianBlur(n,e).in(this)},image:function(n){return this.parent()&&this.parent().image(n)},merge:function(n){return n=n instanceof Array?n:[...n],this.parent()&&this.parent().merge(this,...n)},morphology:function(n,e){return this.parent()&&this.parent().morphology(n,e).in(this)},offset:function(n,e){return this.parent()&&this.parent().offset(n,e).in(this)},specularLighting:function(n,e,t,a,i){return this.parent()&&this.parent().specularLighting(n,t,a,i).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(n,e,t,a,i){return this.parent()&&this.parent().turbulence(n,e,t,a,i).in(this)}}),ae(Se.MergeEffect,{in:function(n){return n instanceof Se.MergeNode?this.add(n,0):this.add(new Se.MergeNode().in(n),0),this}}),ae([Se.CompositeEffect,Se.BlendEffect,Se.DisplacementMapEffect],{in2:function(n){if(n==null){const e=this.attr("in2");return this.parent()&&this.parent().find(`[result="${e}"]`)[0]||e}return this.attr("in2",n)}}),Se.filter={sepiatone:[.343,.669,.119,0,0,.249,.626,.13,0,0,.172,.334,.111,0,0,0,0,0,1,0]};var Ie=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"getDefaultFilter",value:function(e,t){var a=this.w;e.unfilter(!0),new Se().size("120%","180%","-5%","-40%"),a.config.chart.dropShadow.enabled&&this.dropShadow(e,a.config.chart.dropShadow,t)}},{key:"applyFilter",value:function(e,t,a){var i,s=this,r=this.w;if(e.unfilter(!0),a!=="none"){var o,l,h=r.config.chart.dropShadow,d=a==="lighten"?2:.3;e.filterWith(function(u){u.colorMatrix({type:"matrix",values:`
|
|
21
|
+
`.concat(d,` 0 0 0 0
|
|
22
|
+
0 `).concat(d,` 0 0 0
|
|
23
|
+
0 0 `).concat(d,` 0 0
|
|
24
|
+
0 0 0 1 0
|
|
25
|
+
`),in:"SourceGraphic",result:"brightness"}),h.enabled&&s.addShadow(u,t,h,"brightness")}),!h.noUserSpaceOnUse&&((o=e.filterer())===null||o===void 0||(l=o.node)===null||l===void 0||l.setAttribute("filterUnits","userSpaceOnUse")),this._scaleFilterSize((i=e.filterer())===null||i===void 0?void 0:i.node)}else this.getDefaultFilter(e,t)}},{key:"addShadow",value:function(e,t,a,i){var s,r=this.w,o=a.blur,l=a.top,h=a.left,d=a.color,u=a.opacity;if(d=Array.isArray(d)?d[t]:d,((s=r.config.chart.dropShadow.enabledOnSeries)===null||s===void 0?void 0:s.length)>0&&r.config.chart.dropShadow.enabledOnSeries.indexOf(t)===-1)return e;e.offset({in:i,dx:h,dy:l,result:"offset"}),e.gaussianBlur({in:"offset",stdDeviation:o,result:"blur"}),e.flood({"flood-color":d,"flood-opacity":u,result:"flood"}),e.composite({in:"flood",in2:"blur",operator:"in",result:"shadow"}),e.merge(["shadow",i])}},{key:"dropShadow",value:function(e,t){var a,i,s,r,o,l=this,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,d=this.w;return e.unfilter(!0),R.isMsEdge()&&d.config.chart.type==="radialBar"||((a=d.config.chart.dropShadow.enabledOnSeries)===null||a===void 0?void 0:a.length)>0&&((s=d.config.chart.dropShadow.enabledOnSeries)===null||s===void 0?void 0:s.indexOf(h))===-1?e:(e.filterWith(function(u){l.addShadow(u,h,t,"SourceGraphic")}),t.noUserSpaceOnUse||(r=e.filterer())===null||r===void 0||(o=r.node)===null||o===void 0||o.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize((i=e.filterer())===null||i===void 0?void 0:i.node),e)}},{key:"setSelectionFilter",value:function(e,t,a){var i=this.w;if(i.globals.selectedDataPoints[t]!==void 0&&i.globals.selectedDataPoints[t].indexOf(a)>-1){e.node.setAttribute("selected",!0);var s=i.config.states.active.filter;s!=="none"&&this.applyFilter(e,t,s.type)}}},{key:"_scaleFilterSize",value:function(e){e&&function(t){for(var a in t)t.hasOwnProperty(a)&&e.setAttribute(a,t[a])}({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}]),n}(),O=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"roundPathCorners",value:function(e,t){function a(C,N,L){var A=N.x-C.x,M=N.y-C.y,F=Math.sqrt(A*A+M*M);return i(C,N,Math.min(1,L/F))}function i(C,N,L){return{x:C.x+(N.x-C.x)*L,y:C.y+(N.y-C.y)*L}}function s(C,N){C.length>2&&(C[C.length-2]=N.x,C[C.length-1]=N.y)}function r(C){return{x:parseFloat(C[C.length-2]),y:parseFloat(C[C.length-1])}}e.indexOf("NaN")>-1&&(e="");var o=e.split(/[,\s]/).reduce(function(C,N){var L=N.match(/^([a-zA-Z])(.+)/);return L?(C.push(L[1]),C.push(L[2])):C.push(N),C},[]).reduce(function(C,N){return parseFloat(N)==N&&C.length?C[C.length-1].push(N):C.push([N]),C},[]),l=[];if(o.length>1){var h=r(o[0]),d=null;o[o.length-1][0]=="Z"&&o[0].length>2&&(d=["L",h.x,h.y],o[o.length-1]=d),l.push(o[0]);for(var u=1;u<o.length;u++){var g=l[l.length-1],p=o[u],f=p==d?o[1]:o[u+1];if(f&&g&&g.length>2&&p[0]=="L"&&f.length>2&&f[0]=="L"){var m,x,b=r(g),v=r(p),w=r(f);m=a(v,b,t),x=a(v,w,t),s(p,m),p.origPoint=v,l.push(p);var k=i(m,v,.5),y=i(v,x,.5),E=["C",k.x,k.y,y.x,y.y,x.x,x.y];E.origPoint=v,l.push(E)}else l.push(p)}if(d){var S=r(l[l.length-1]);l.push(["Z"]),s(l[0],S)}}else l=o;return l.reduce(function(C,N){return C+N.join(" ")+" "},"")}},{key:"drawLine",value:function(e,t,a,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"#a8a8a8",r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"butt";return this.w.globals.dom.Paper.line().attr({x1:e,y1:t,x2:a,y2:i,stroke:s,"stroke-dasharray":r,"stroke-width":o,"stroke-linecap":l})}},{key:"drawRect",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"#fefefe",o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,h=arguments.length>8&&arguments[8]!==void 0?arguments[8]:null,d=arguments.length>9&&arguments[9]!==void 0?arguments[9]:0,u=this.w.globals.dom.Paper.rect();return u.attr({x:e,y:t,width:a>0?a:0,height:i>0?i:0,rx:s,ry:s,opacity:o,"stroke-width":l!==null?l:0,stroke:h!==null?h:"none","stroke-dasharray":d}),u.node.setAttribute("fill",r),u}},{key:"drawPolygon",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"#e1e1e1",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"none";return this.w.globals.dom.Paper.polygon(e).attr({fill:i,stroke:t,"stroke-width":a})}},{key:"drawCircle",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;e<0&&(e=0);var a=this.w.globals.dom.Paper.circle(2*e);return t!==null&&a.attr(t),a}},{key:"drawPath",value:function(e){var t=e.d,a=t===void 0?"":t,i=e.stroke,s=i===void 0?"#a8a8a8":i,r=e.strokeWidth,o=r===void 0?1:r,l=e.fill,h=e.fillOpacity,d=h===void 0?1:h,u=e.strokeOpacity,g=u===void 0?1:u,p=e.classes,f=e.strokeLinecap,m=f===void 0?null:f,x=e.strokeDashArray,b=x===void 0?0:x,v=this.w;return m===null&&(m=v.config.stroke.lineCap),(a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a="M 0 ".concat(v.globals.gridHeight)),v.globals.dom.Paper.path(a).attr({fill:l,"fill-opacity":d,stroke:s,"stroke-opacity":g,"stroke-linecap":m,"stroke-width":o,"stroke-dasharray":b,class:p})}},{key:"group",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=this.w.globals.dom.Paper.group();return e!==null&&t.attr(e),t}},{key:"move",value:function(e,t){var a=["M",e,t].join(" ");return a}},{key:"line",value:function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=null;return a===null?i=[" L",e,t].join(" "):a==="H"?i=[" H",e].join(" "):a==="V"&&(i=[" V",t].join(" ")),i}},{key:"curve",value:function(e,t,a,i,s,r){var o=["C",e,t,a,i,s,r].join(" ");return o}},{key:"quadraticCurve",value:function(e,t,a,i){return["Q",e,t,a,i].join(" ")}},{key:"arc",value:function(e,t,a,i,s,r,o){var l="A";arguments.length>7&&arguments[7]!==void 0&&arguments[7]&&(l="a");var h=[l,e,t,a,i,s,r,o].join(" ");return h}},{key:"renderPaths",value:function(e){var t,a=e.j,i=e.realIndex,s=e.pathFrom,r=e.pathTo,o=e.stroke,l=e.strokeWidth,h=e.strokeLinecap,d=e.fill,u=e.animationDelay,g=e.initialSpeed,p=e.dataChangeSpeed,f=e.className,m=e.chartType,x=e.shouldClipToGrid,b=x===void 0||x,v=e.bindEventsOnPaths,w=v===void 0||v,k=e.drawShadow,y=k===void 0||k,E=this.w,S=new Ie(this.ctx),C=new Ot(this.ctx),N=this.w.config.chart.animations.enabled,L=N&&this.w.config.chart.animations.dynamicAnimation.enabled;if(s&&s.startsWith("M 0 0")&&r){var A=r.match(/^M\s+[\d.-]+\s+[\d.-]+/);A&&(s=s.replace(/^M\s+0\s+0/,A[0]))}var M=!!(N&&!E.globals.resized||L&&E.globals.dataChanged&&E.globals.shouldAnimate);M?t=s:(t=r,E.globals.animationEnded=!0);var F=E.config.stroke.dashArray,z=0;z=Array.isArray(F)?F[i]:E.config.stroke.dashArray;var B=this.drawPath({d:t,stroke:o,strokeWidth:l,fill:d,fillOpacity:1,classes:f,strokeLinecap:h,strokeDashArray:z});B.attr("index",i),b&&(m==="bar"&&!E.globals.isHorizontal||E.globals.comboCharts?B.attr({"clip-path":"url(#gridRectBarMask".concat(E.globals.cuid,")")}):B.attr({"clip-path":"url(#gridRectMask".concat(E.globals.cuid,")")})),E.config.chart.dropShadow.enabled&&y&&S.dropShadow(B,E.config.chart.dropShadow,i),w&&(B.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,B)),B.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,B)),B.node.addEventListener("mousedown",this.pathMouseDown.bind(this,B))),B.attr({pathTo:r,pathFrom:s});var T={el:B,j:a,realIndex:i,pathFrom:s,pathTo:r,fill:d,strokeWidth:l,delay:u};return!N||E.globals.resized||E.globals.dataChanged?!E.globals.resized&&E.globals.dataChanged||C.showDelayedElements():C.animatePathsGradually(G(G({},T),{},{speed:g})),E.globals.dataChanged&&L&&M&&C.animatePathsGradually(G(G({},T),{},{speed:p})),B}},{key:"drawPattern",value:function(e,t,a){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"#a8a8a8",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;return this.w.globals.dom.Paper.pattern(t,a,function(r){e==="horizontalLines"?r.line(0,0,a,0).stroke({color:i,width:s+1}):e==="verticalLines"?r.line(0,0,0,t).stroke({color:i,width:s+1}):e==="slantedLines"?r.line(0,0,t,a).stroke({color:i,width:s}):e==="squares"?r.rect(t,a).fill("none").stroke({color:i,width:s}):e==="circles"&&r.circle(t).fill("none").stroke({color:i,width:s})})}},{key:"drawGradient",value:function(e,t,a,i,s){var r,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,h=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[],d=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0,u=this.w;t.length<9&&t.indexOf("#")===0&&(t=R.hexToRgba(t,i)),a.length<9&&a.indexOf("#")===0&&(a=R.hexToRgba(a,s));var g=0,p=1,f=1,m=null;l!==null&&(g=l[0]!==void 0?l[0]/100:0,p=l[1]!==void 0?l[1]/100:1,f=l[2]!==void 0?l[2]/100:1,m=l[3]!==void 0?l[3]/100:null);var x=!(u.config.chart.type!=="donut"&&u.config.chart.type!=="pie"&&u.config.chart.type!=="polarArea"&&u.config.chart.type!=="bubble");if(r=h&&h.length!==0?u.globals.dom.Paper.gradient(x?"radial":"linear",function(w){(Array.isArray(h[d])?h[d]:h).forEach(function(k){w.stop(k.offset/100,k.color,k.opacity)})}):u.globals.dom.Paper.gradient(x?"radial":"linear",function(w){w.stop(g,t,i),w.stop(p,a,s),w.stop(f,a,s),m!==null&&w.stop(m,t,i)}),x){var b=u.globals.gridWidth/2,v=u.globals.gridHeight/2;u.config.chart.type!=="bubble"?r.attr({gradientUnits:"userSpaceOnUse",cx:b,cy:v,r:o}):r.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else e==="vertical"?r.from(0,0).to(0,1):e==="diagonal"?r.from(0,0).to(1,1):e==="horizontal"?r.from(0,1).to(1,1):e==="diagonal2"&&r.from(1,0).to(0,1);return r}},{key:"getTextBasedOnMaxWidth",value:function(e){var t=e.text,a=e.maxWidth,i=e.fontSize,s=e.fontFamily,r=this.getTextRects(t,i,s),o=r.width/t.length,l=Math.floor(a/o);return a<r.width?t.slice(0,l-3)+"...":t}},{key:"drawText",value:function(e){var t=this,a=e.x,i=e.y,s=e.text,r=e.textAnchor,o=e.fontSize,l=e.fontFamily,h=e.fontWeight,d=e.foreColor,u=e.opacity,g=e.maxWidth,p=e.cssClass,f=p===void 0?"":p,m=e.isPlainText,x=m===void 0||m,b=e.dominantBaseline,v=b===void 0?"auto":b,w=this.w;s===void 0&&(s="");var k=s;r||(r="start"),d&&d.length||(d=w.config.chart.foreColor),l=l||w.config.chart.fontFamily,h=h||"regular";var y,E={maxWidth:g,fontSize:o=o||"11px",fontFamily:l};return Array.isArray(s)?y=w.globals.dom.Paper.text(function(S){for(var C=0;C<s.length;C++)k=s[C],g&&(k=t.getTextBasedOnMaxWidth(G({text:s[C]},E))),C===0?S.tspan(k):S.tspan(k).newLine()}):(g&&(k=this.getTextBasedOnMaxWidth(G({text:s},E))),y=x?w.globals.dom.Paper.plain(s):w.globals.dom.Paper.text(function(S){return S.tspan(k)})),y.attr({x:a,y:i,"text-anchor":r,"dominant-baseline":v,"font-size":o,"font-family":l,"font-weight":h,fill:d,class:"apexcharts-text "+f}),y.node.style.fontFamily=l,y.node.style.opacity=u,y}},{key:"getMarkerPath",value:function(e,t,a,i){var s="";switch(a){case"cross":s="M ".concat(e-(i/=1.4)," ").concat(t-i," L ").concat(e+i," ").concat(t+i," M ").concat(e-i," ").concat(t+i," L ").concat(e+i," ").concat(t-i);break;case"plus":s="M ".concat(e-(i/=1.12)," ").concat(t," L ").concat(e+i," ").concat(t," M ").concat(e," ").concat(t-i," L ").concat(e," ").concat(t+i);break;case"star":case"sparkle":var r=5;i*=1.15,a==="sparkle"&&(i/=1.1,r=4);for(var o=Math.PI/r,l=0;l<=2*r;l++){var h=l*o,d=l%2==0?i:i/2;s+=(l===0?"M":"L")+(e+d*Math.sin(h))+","+(t-d*Math.cos(h))}s+="Z";break;case"triangle":s="M ".concat(e," ").concat(t-i,`
|
|
26
|
+
L `).concat(e+i," ").concat(t+i,`
|
|
27
|
+
L `).concat(e-i," ").concat(t+i,`
|
|
28
|
+
Z`);break;case"square":case"rect":s="M ".concat(e-(i/=1.125)," ").concat(t-i,`
|
|
29
|
+
L `).concat(e+i," ").concat(t-i,`
|
|
30
|
+
L `).concat(e+i," ").concat(t+i,`
|
|
31
|
+
L `).concat(e-i," ").concat(t+i,`
|
|
32
|
+
Z`);break;case"diamond":i*=1.05,s="M ".concat(e," ").concat(t-i,`
|
|
33
|
+
L `).concat(e+i," ").concat(t,`
|
|
34
|
+
L `).concat(e," ").concat(t+i,`
|
|
35
|
+
L `).concat(e-i," ").concat(t,`
|
|
36
|
+
Z`);break;case"line":s="M ".concat(e-(i/=1.1)," ").concat(t,`
|
|
37
|
+
L `).concat(e+i," ").concat(t);break;default:i*=2,s="M ".concat(e,", ").concat(t,`
|
|
38
|
+
m -`).concat(i/2,`, 0
|
|
39
|
+
a `).concat(i/2,",").concat(i/2," 0 1,0 ").concat(i,`,0
|
|
40
|
+
a `).concat(i/2,",").concat(i/2," 0 1,0 -").concat(i,",0")}return s}},{key:"drawMarkerShape",value:function(e,t,a,i,s){var r=this.drawPath({d:this.getMarkerPath(e,t,a,i,s),stroke:s.pointStrokeColor,strokeDashArray:s.pointStrokeDashArray,strokeWidth:s.pointStrokeWidth,fill:s.pointFillColor,fillOpacity:s.pointFillOpacity,strokeOpacity:s.pointStrokeOpacity});return r.attr({cx:e,cy:t,shape:s.shape,class:s.class?s.class:""}),r}},{key:"drawMarker",value:function(e,t,a){e=e||0;var i=a.pSize||0;return R.isNumber(t)||(i=0,t=0),this.drawMarkerShape(e,t,a==null?void 0:a.shape,i,G(G({},a),a.shape==="line"||a.shape==="plus"||a.shape==="cross"?{pointStrokeColor:a.pointFillColor,pointStrokeOpacity:a.pointFillOpacity}:{}))}},{key:"pathMouseEnter",value:function(e,t){var a=this.w,i=new Ie(this.ctx),s=parseInt(e.node.getAttribute("index"),10),r=parseInt(e.node.getAttribute("j"),10);if(typeof a.config.chart.events.dataPointMouseEnter=="function"&&a.config.chart.events.dataPointMouseEnter(t,this.ctx,{seriesIndex:s,dataPointIndex:r,w:a}),this.ctx.events.fireEvent("dataPointMouseEnter",[t,this.ctx,{seriesIndex:s,dataPointIndex:r,w:a}]),(a.config.states.active.filter.type==="none"||e.node.getAttribute("selected")!=="true")&&a.config.states.hover.filter.type!=="none"&&!a.globals.isTouchDevice){var o=a.config.states.hover.filter;i.applyFilter(e,s,o.type)}}},{key:"pathMouseLeave",value:function(e,t){var a=this.w,i=new Ie(this.ctx),s=parseInt(e.node.getAttribute("index"),10),r=parseInt(e.node.getAttribute("j"),10);typeof a.config.chart.events.dataPointMouseLeave=="function"&&a.config.chart.events.dataPointMouseLeave(t,this.ctx,{seriesIndex:s,dataPointIndex:r,w:a}),this.ctx.events.fireEvent("dataPointMouseLeave",[t,this.ctx,{seriesIndex:s,dataPointIndex:r,w:a}]),a.config.states.active.filter.type!=="none"&&e.node.getAttribute("selected")==="true"||a.config.states.hover.filter.type!=="none"&&i.getDefaultFilter(e,s)}},{key:"pathMouseDown",value:function(e,t){var a=this.w,i=new Ie(this.ctx),s=parseInt(e.node.getAttribute("index"),10),r=parseInt(e.node.getAttribute("j"),10),o="false";if(e.node.getAttribute("selected")==="true"){if(e.node.setAttribute("selected","false"),a.globals.selectedDataPoints[s].indexOf(r)>-1){var l=a.globals.selectedDataPoints[s].indexOf(r);a.globals.selectedDataPoints[s].splice(l,1)}}else{if(!a.config.states.active.allowMultipleDataPointsSelection&&a.globals.selectedDataPoints.length>0){a.globals.selectedDataPoints=[];var h=a.globals.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),d=a.globals.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),u=function(f){Array.prototype.forEach.call(f,function(m){m.node.setAttribute("selected","false"),i.getDefaultFilter(m,s)})};u(h),u(d)}e.node.setAttribute("selected","true"),o="true",a.globals.selectedDataPoints[s]===void 0&&(a.globals.selectedDataPoints[s]=[]),a.globals.selectedDataPoints[s].push(r)}if(o==="true"){var g=a.config.states.active.filter;if(g!=="none")i.applyFilter(e,s,g.type);else if(a.config.states.hover.filter!=="none"&&!a.globals.isTouchDevice){var p=a.config.states.hover.filter;i.applyFilter(e,s,p.type)}}else a.config.states.active.filter.type!=="none"&&(a.config.states.hover.filter.type==="none"||a.globals.isTouchDevice?i.getDefaultFilter(e,s):(p=a.config.states.hover.filter,i.applyFilter(e,s,p.type)));typeof a.config.chart.events.dataPointSelection=="function"&&a.config.chart.events.dataPointSelection(t,this.ctx,{selectedDataPoints:a.globals.selectedDataPoints,seriesIndex:s,dataPointIndex:r,w:a}),t&&this.ctx.events.fireEvent("dataPointSelection",[t,this.ctx,{selectedDataPoints:a.globals.selectedDataPoints,seriesIndex:s,dataPointIndex:r,w:a}])}},{key:"rotateAroundCenter",value:function(e){var t={};return e&&typeof e.getBBox=="function"&&(t=e.getBBox()),{x:t.x+t.width/2,y:t.y+t.height/2}}},{key:"getTextRects",value:function(e,t,a,i){var s=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],r=this.w,o=this.drawText({x:-200,y:-200,text:e,textAnchor:"start",fontSize:t,fontFamily:a,foreColor:"#fff",opacity:0});i&&o.attr("transform",i),r.globals.dom.Paper.add(o);var l=o.bbox();return s||(l=o.node.getBoundingClientRect()),o.remove(),{width:l.width,height:l.height}}},{key:"placeTextWithEllipsis",value:function(e,t,a){if(typeof e.getComputedTextLength=="function"&&(e.textContent=t,t.length>0&&e.getComputedTextLength()>=a/1.1)){for(var i=t.length-3;i>0;i-=3)if(e.getSubStringLength(0,i)<=a/1.1)return void(e.textContent=t.substring(0,i)+"...");e.textContent="."}}}],[{key:"setAttrs",value:function(e,t){for(var a in t)t.hasOwnProperty(a)&&e.setAttribute(a,t[a])}}]),n}(),Le=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"getStackedSeriesTotals",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=this.w,a=[];if(t.globals.series.length===0)return a;for(var i=0;i<t.globals.series[t.globals.maxValsInArrayIndex].length;i++){for(var s=0,r=0;r<t.globals.series.length;r++)t.globals.series[r][i]!==void 0&&e.indexOf(r)===-1&&(s+=t.globals.series[r][i]);a.push(s)}return a}},{key:"getSeriesTotalByIndex",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e===null?this.w.config.series.reduce(function(t,a){return t+a},0):this.w.globals.series[e].reduce(function(t,a){return t+a},0)}},{key:"getStackedSeriesTotalsByGroups",value:function(){var e=this,t=this.w,a=[];return t.globals.seriesGroups.forEach(function(i){var s=[];t.config.series.forEach(function(o,l){i.indexOf(t.globals.seriesNames[l])>-1&&s.push(l)});var r=t.globals.series.map(function(o,l){return s.indexOf(l)===-1?l:-1}).filter(function(o){return o!==-1});a.push(e.getStackedSeriesTotals(r))}),a}},{key:"setSeriesYAxisMappings",value:function(){var e=this.w.globals,t=this.w.config,a=[],i=[],s=[],r=e.series.length>t.yaxis.length||t.yaxis.some(function(u){return Array.isArray(u.seriesName)});t.series.forEach(function(u,g){s.push(g),i.push(null)}),t.yaxis.forEach(function(u,g){a[g]=[]});var o=[];t.yaxis.forEach(function(u,g){var p=!1;if(u.seriesName){var f=[];Array.isArray(u.seriesName)?f=u.seriesName:f.push(u.seriesName),f.forEach(function(m){t.series.forEach(function(x,b){if(x.name===m){var v=b;g===b||r?!r||s.indexOf(b)>-1?a[g].push([g,b]):console.warn("Series '"+x.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."):(a[b].push([b,g]),v=g),p=!0,(v=s.indexOf(v))!==-1&&s.splice(v,1)}})})}p||o.push(g)}),a=a.map(function(u,g){var p=[];return u.forEach(function(f){i[f[1]]=f[0],p.push(f[1])}),p});for(var l=t.yaxis.length-1,h=0;h<o.length&&(l=o[h],a[l]=[],s);h++){var d=s[0];s.shift(),a[l].push(d),i[d]=l}s.forEach(function(u){a[l].push(u),i[u]=l}),e.seriesYAxisMap=a.map(function(u){return u}),e.seriesYAxisReverseMap=i.map(function(u){return u}),e.seriesYAxisMap.forEach(function(u,g){u.forEach(function(p){t.series[p]&&t.series[p].group===void 0&&(t.series[p].group="apexcharts-axis-".concat(g.toString()))})})}},{key:"isSeriesNull",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return(e===null?this.w.config.series.filter(function(t){return t!==null}):this.w.config.series[e].data.filter(function(t){return t!==null})).length===0}},{key:"seriesHaveSameValues",value:function(e){return this.w.globals.series[e].every(function(t,a,i){return t===i[0]})}},{key:"getCategoryLabels",value:function(e){var t=this.w,a=e.slice();return t.config.xaxis.convertedCatToNumeric&&(a=e.map(function(i,s){return t.config.xaxis.labels.formatter(i-t.globals.minX+1)})),a}},{key:"getLargestSeries",value:function(){var e=this.w;e.globals.maxValsInArrayIndex=e.globals.series.map(function(t){return t.length}).indexOf(Math.max.apply(Math,e.globals.series.map(function(t){return t.length})))}},{key:"getLargestMarkerSize",value:function(){var e=this.w,t=0;return e.globals.markers.size.forEach(function(a){t=Math.max(t,a)}),e.config.markers.discrete&&e.config.markers.discrete.length&&e.config.markers.discrete.forEach(function(a){t=Math.max(t,a.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(t,a){var i=0;if(Array.isArray(t))for(var s=0;s<t.length;s++)i+=t[s];else i+=t;return i})}},{key:"getSeriesTotalsXRange",value:function(e,t){var a=this.w;return a.globals.series.map(function(i,s){for(var r=0,o=0;o<i.length;o++)a.globals.seriesX[s][o]>e&&a.globals.seriesX[s][o]<t&&(r+=i[o]);return r})}},{key:"getPercentSeries",value:function(){var e=this.w;e.globals.seriesPercent=e.globals.series.map(function(t,a){var i=[];if(Array.isArray(t))for(var s=0;s<t.length;s++){var r=e.globals.stackedSeriesTotals[s],o=0;r&&(o=100*t[s]/r),i.push(o)}else{var l=100*t/e.globals.seriesTotals.reduce(function(h,d){return h+d},0);i.push(l)}return i})}},{key:"getCalculatedRatios",value:function(){var e,t,a,i=this,s=this.w,r=s.globals,o=[],l=0,h=[],d=.1,u=0;if(r.yRange=[],r.isMultipleYAxis)for(var g=0;g<r.minYArr.length;g++)r.yRange.push(Math.abs(r.minYArr[g]-r.maxYArr[g])),h.push(0);else r.yRange.push(Math.abs(r.minY-r.maxY));r.xRange=Math.abs(r.maxX-r.minX),r.zRange=Math.abs(r.maxZ-r.minZ);for(var p=0;p<r.yRange.length;p++)o.push(r.yRange[p]/r.gridHeight);if(t=r.xRange/r.gridWidth,e=r.yRange/r.gridWidth,a=r.xRange/r.gridHeight,(l=r.zRange/r.gridHeight*16)||(l=1),r.minY!==Number.MIN_VALUE&&Math.abs(r.minY)!==0&&(r.hasNegs=!0),s.globals.seriesYAxisReverseMap.length>0){var f=function(x,b){var v=s.config.yaxis[s.globals.seriesYAxisReverseMap[b]],w=x<0?-1:1;return x=Math.abs(x),v.logarithmic&&(x=i.getBaseLog(v.logBase,x)),-w*x/o[b]};if(r.isMultipleYAxis){h=[];for(var m=0;m<o.length;m++)h.push(f(r.minYArr[m],m))}else(h=[]).push(f(r.minY,0)),r.minY!==Number.MIN_VALUE&&Math.abs(r.minY)!==0&&(d=-r.minY/e,u=r.minX/t)}else(h=[]).push(0),d=0,u=0;return{yRatio:o,invertedYRatio:e,zRatio:l,xRatio:t,invertedXRatio:a,baseLineInvertedY:d,baseLineY:h,baseLineX:u}}},{key:"getLogSeries",value:function(e){var t=this,a=this.w;return a.globals.seriesLog=e.map(function(i,s){var r=a.globals.seriesYAxisReverseMap[s];return a.config.yaxis[r]&&a.config.yaxis[r].logarithmic?i.map(function(o){return o===null?null:t.getLogVal(a.config.yaxis[r].logBase,o,s)}):i}),a.globals.invalidLogScale?e:a.globals.seriesLog}},{key:"getLogValAtSeriesIndex",value:function(e,t){if(e===null)return null;var a=this.w,i=a.globals.seriesYAxisReverseMap[t];return a.config.yaxis[i]&&a.config.yaxis[i].logarithmic?this.getLogVal(a.config.yaxis[i].logBase,e,t):e}},{key:"getBaseLog",value:function(e,t){return Math.log(t)/Math.log(e)}},{key:"getLogVal",value:function(e,t,a){if(t<=0)return 0;var i=this.w,s=i.globals.minYArr[a]===0?-1:this.getBaseLog(e,i.globals.minYArr[a]),r=(i.globals.maxYArr[a]===0?0:this.getBaseLog(e,i.globals.maxYArr[a]))-s;return t<1?t/r:(this.getBaseLog(e,t)-s)/r}},{key:"getLogYRatios",value:function(e){var t=this,a=this.w,i=this.w.globals;return i.yLogRatio=e.slice(),i.logYRange=i.yRange.map(function(s,r){var o=a.globals.seriesYAxisReverseMap[r];if(a.config.yaxis[o]&&t.w.config.yaxis[o].logarithmic){var l,h=-Number.MAX_VALUE,d=Number.MIN_VALUE;return i.seriesLog.forEach(function(u,g){u.forEach(function(p){a.config.yaxis[g]&&a.config.yaxis[g].logarithmic&&(h=Math.max(p,h),d=Math.min(p,d))})}),l=Math.pow(i.yRange[r],Math.abs(d-h)/i.yRange[r]),i.yLogRatio[r]=l/i.gridHeight,l}}),i.invalidLogScale?e.slice():i.yLogRatio}},{key:"drawSeriesByGroup",value:function(e,t,a,i){var s=this.w,r=[];return e.series.length>0&&t.forEach(function(o){var l=[],h=[];e.i.forEach(function(d,u){s.config.series[d].group===o&&(l.push(e.series[u]),h.push(d))}),l.length>0&&r.push(i.draw(l,a,h))}),r}}],[{key:"checkComboSeries",value:function(e,t){var a=!1,i=0,s=0;return t===void 0&&(t="line"),e.length&&e[0].type!==void 0&&e.forEach(function(r){r.type!=="bar"&&r.type!=="column"&&r.type!=="candlestick"&&r.type!=="boxPlot"||i++,r.type!==void 0&&r.type!==t&&s++}),s>0&&(a=!0),{comboBarCount:i,comboCharts:a}}},{key:"extendArrayProps",value:function(e,t,a){var i,s,r,o,l,h;return(i=t)!==null&&i!==void 0&&i.yaxis&&(t=e.extendYAxis(t,a)),(s=t)!==null&&s!==void 0&&s.annotations&&(t.annotations.yaxis&&(t=e.extendYAxisAnnotations(t)),(r=t)!==null&&r!==void 0&&(o=r.annotations)!==null&&o!==void 0&&o.xaxis&&(t=e.extendXAxisAnnotations(t)),(l=t)!==null&&l!==void 0&&(h=l.annotations)!==null&&h!==void 0&&h.points&&(t=e.extendPointAnnotations(t))),t}}]),n}(),Va=function(){function n(e){q(this,n),this.w=e.w,this.annoCtx=e}return Z(n,[{key:"setOrientations",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=this.w;if(e.label.orientation==="vertical"){var i=t!==null?t:0,s=a.globals.dom.baseEl.querySelector(".apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='".concat(i,"']"));if(s!==null){var r=s.getBoundingClientRect();s.setAttribute("x",parseFloat(s.getAttribute("x"))-r.height+4);var o=e.label.position==="top"?r.width:-r.width;s.setAttribute("y",parseFloat(s.getAttribute("y"))+o);var l=this.annoCtx.graphics.rotateAroundCenter(s),h=l.x,d=l.y;s.setAttribute("transform","rotate(-90 ".concat(h," ").concat(d,")"))}}}},{key:"addBackgroundToAnno",value:function(e,t){var a=this.w;if(!e||!t.label.text||!String(t.label.text).trim())return null;var i=a.globals.dom.baseEl.querySelector(".apexcharts-grid").getBoundingClientRect(),s=e.getBoundingClientRect(),r=t.label.style.padding,o=r.left,l=r.right,h=r.top,d=r.bottom;if(t.label.orientation==="vertical"){var u=[o,l,h,d];h=u[0],d=u[1],o=u[2],l=u[3]}var g=s.left-i.left-o,p=s.top-i.top-h,f=this.annoCtx.graphics.drawRect(g-a.globals.barPadForNumericAxis,p,s.width+o+l,s.height+h+d,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,a=function(i,s,r){var o=t.globals.dom.baseEl.querySelector(".apexcharts-".concat(r,"-annotations .apexcharts-").concat(r,"-annotation-label[rel='").concat(s,"']"));if(o){var l=o.parentNode,h=e.addBackgroundToAnno(o,i);h&&(l.insertBefore(h.node,o),i.label.mouseEnter&&h.node.addEventListener("mouseenter",i.label.mouseEnter.bind(e,i)),i.label.mouseLeave&&h.node.addEventListener("mouseleave",i.label.mouseLeave.bind(e,i)),i.label.click&&h.node.addEventListener("click",i.label.click.bind(e,i)))}};t.config.annotations.xaxis.forEach(function(i,s){return a(i,s,"xaxis")}),t.config.annotations.yaxis.forEach(function(i,s){return a(i,s,"yaxis")}),t.config.annotations.points.forEach(function(i,s){return a(i,s,"point")})}},{key:"getY1Y2",value:function(e,t){var a,i=this.w,s=e==="y1"?t.y:t.y2,r=!1;if(this.annoCtx.invertAxis){var o=i.config.xaxis.convertedCatToNumeric?i.globals.categoryLabels:i.globals.labels,l=o.indexOf(s),h=i.globals.dom.baseEl.querySelector(".apexcharts-yaxis-texts-g text:nth-child(".concat(l+1,")"));a=h?parseFloat(h.getAttribute("y")):(i.globals.gridHeight/o.length-1)*(l+1)-i.globals.barHeight,t.seriesIndex!==void 0&&i.globals.barHeight&&(a-=i.globals.barHeight/2*(i.globals.series.length-1)-i.globals.barHeight*t.seriesIndex)}else{var d,u=i.globals.seriesYAxisMap[t.yAxisIndex][0],g=i.config.yaxis[t.yAxisIndex].logarithmic?new Le(this.annoCtx.ctx).getLogVal(i.config.yaxis[t.yAxisIndex].logBase,s,u)/i.globals.yLogRatio[u]:(s-i.globals.minYArr[u])/(i.globals.yRange[u]/i.globals.gridHeight);a=i.globals.gridHeight-Math.min(Math.max(g,0),i.globals.gridHeight),r=g>i.globals.gridHeight||g<0,!t.marker||t.y!==void 0&&t.y!==null||(a=0),(d=i.config.yaxis[t.yAxisIndex])!==null&&d!==void 0&&d.reversed&&(a=g)}return typeof s=="string"&&s.includes("px")&&(a=parseFloat(s)),{yP:a,clipped:r}}},{key:"getX1X2",value:function(e,t){var a=this.w,i=e==="x1"?t.x:t.x2,s=this.annoCtx.invertAxis?a.globals.minY:a.globals.minX,r=this.annoCtx.invertAxis?a.globals.maxY:a.globals.maxX,o=this.annoCtx.invertAxis?a.globals.yRange[0]:a.globals.xRange,l=!1,h=this.annoCtx.inversedReversedAxis?(r-i)/(o/a.globals.gridWidth):(i-s)/(o/a.globals.gridWidth);return a.config.xaxis.type!=="category"&&!a.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||a.globals.dataFormatXNumeric||a.config.chart.sparkline.enabled||(h=this.getStringX(i)),typeof i=="string"&&i.includes("px")&&(h=parseFloat(i)),i==null&&t.marker&&(h=a.globals.gridWidth),t.seriesIndex!==void 0&&a.globals.barWidth&&!this.annoCtx.invertAxis&&(h-=a.globals.barWidth/2*(a.globals.series.length-1)-a.globals.barWidth*t.seriesIndex),typeof h!="number"&&(h=0,l=!0),parseFloat(h.toFixed(10))>parseFloat(a.globals.gridWidth.toFixed(10))?(h=a.globals.gridWidth,l=!0):h<0&&(h=0,l=!0),{x:h,clipped:l}}},{key:"getStringX",value:function(e){var t=this.w,a=e;t.config.xaxis.convertedCatToNumeric&&t.globals.categoryLabels.length&&(e=t.globals.categoryLabels.indexOf(e)+1);var i=t.globals.labels.map(function(r){return Array.isArray(r)?r.join(" "):r}).indexOf(e),s=t.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g text:nth-child(".concat(i+1,")"));return s&&(a=parseFloat(s.getAttribute("x"))),a}}]),n}(),Bo=function(){function n(e){q(this,n),this.w=e.w,this.annoCtx=e,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new Va(this.annoCtx)}return Z(n,[{key:"addXaxisAnnotation",value:function(e,t,a){var i,s=this.w,r=this.helpers.getX1X2("x1",e),o=r.x,l=r.clipped,h=!0,d=e.label.text,u=e.strokeDashArray;if(R.isNumber(o)){if(e.x2===null||e.x2===void 0){if(!l){var g=this.annoCtx.graphics.drawLine(o+e.offsetX,0+e.offsetY,o+e.offsetX,s.globals.gridHeight+e.offsetY,e.borderColor,u,e.borderWidth);t.appendChild(g.node),e.id&&g.node.classList.add(e.id)}}else{var p=this.helpers.getX1X2("x2",e);if(i=p.x,h=p.clipped,i<o){var f=o;o=i,i=f}var m=this.annoCtx.graphics.drawRect(o+e.offsetX,0+e.offsetY,i-o,s.globals.gridHeight+e.offsetY,0,e.fillColor,e.opacity,1,e.borderColor,u);m.node.classList.add("apexcharts-annotation-rect"),m.attr("clip-path","url(#gridRectMask".concat(s.globals.cuid,")")),t.appendChild(m.node),e.id&&m.node.classList.add(e.id)}if(!l||!h){var x=this.annoCtx.graphics.getTextRects(d,parseFloat(e.label.style.fontSize)),b=e.label.position==="top"?4:e.label.position==="center"?s.globals.gridHeight/2+(e.label.orientation==="vertical"?x.width/2:0):s.globals.gridHeight,v=this.annoCtx.graphics.drawText({x:o+e.label.offsetX,y:b+e.label.offsetY-(e.label.orientation==="vertical"?e.label.position==="top"?x.width/2-12:-x.width/2:0),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-xaxis-annotation-label ".concat(e.label.style.cssClass," ").concat(e.id?e.id:"")});v.attr({rel:a}),t.appendChild(v.node),this.annoCtx.helpers.setOrientations(e,a)}}}},{key:"drawXAxisAnnotations",value:function(){var e=this,t=this.w,a=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map(function(i,s){e.addXaxisAnnotation(i,a.node,s)}),a}}]),n}(),He=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}return Z(n,[{key:"isValidDate",value:function(e){return typeof e!="number"&&!isNaN(this.parseDate(e))}},{key:"getTimeStamp",value:function(e){return Date.parse(e)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(e).toISOString().substr(0,25)).getTime():new Date(e).getTime():e}},{key:"getDate",value:function(e){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(e).toUTCString()):new Date(e)}},{key:"parseDate",value:function(e){var t=Date.parse(e);if(!isNaN(t))return this.getTimeStamp(e);var a=Date.parse(e.replace(/-/g,"/").replace(/[a-z]+/gi," "));return a=this.getTimeStamp(a)}},{key:"parseDateWithTimezone",value:function(e){return Date.parse(e.replace(/-/g,"/").replace(/[a-z]+/gi," "))}},{key:"formatDate",value:function(e,t){var a=this.w.globals.locale,i=this.w.config.xaxis.labels.datetimeUTC,s=["\0"].concat(Pe(a.months)),r=[""].concat(Pe(a.shortMonths)),o=[""].concat(Pe(a.days)),l=[""].concat(Pe(a.shortDays));function h(C,N){var L=C+"";for(N=N||2;L.length<N;)L="0"+L;return L}var d=i?e.getUTCFullYear():e.getFullYear();t=(t=(t=t.replace(/(^|[^\\])yyyy+/g,"$1"+d)).replace(/(^|[^\\])yy/g,"$1"+d.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+d);var u=(i?e.getUTCMonth():e.getMonth())+1;t=(t=(t=(t=t.replace(/(^|[^\\])MMMM+/g,"$1"+s[0])).replace(/(^|[^\\])MMM/g,"$1"+r[0])).replace(/(^|[^\\])MM/g,"$1"+h(u))).replace(/(^|[^\\])M/g,"$1"+u);var g=i?e.getUTCDate():e.getDate();t=(t=(t=(t=t.replace(/(^|[^\\])dddd+/g,"$1"+o[0])).replace(/(^|[^\\])ddd/g,"$1"+l[0])).replace(/(^|[^\\])dd/g,"$1"+h(g))).replace(/(^|[^\\])d/g,"$1"+g);var p=i?e.getUTCHours():e.getHours(),f=p>12?p-12:p===0?12:p;t=(t=(t=(t=t.replace(/(^|[^\\])HH+/g,"$1"+h(p))).replace(/(^|[^\\])H/g,"$1"+p)).replace(/(^|[^\\])hh+/g,"$1"+h(f))).replace(/(^|[^\\])h/g,"$1"+f);var m=i?e.getUTCMinutes():e.getMinutes();t=(t=t.replace(/(^|[^\\])mm+/g,"$1"+h(m))).replace(/(^|[^\\])m/g,"$1"+m);var x=i?e.getUTCSeconds():e.getSeconds();t=(t=t.replace(/(^|[^\\])ss+/g,"$1"+h(x))).replace(/(^|[^\\])s/g,"$1"+x);var b=i?e.getUTCMilliseconds():e.getMilliseconds();t=t.replace(/(^|[^\\])fff+/g,"$1"+h(b,3)),b=Math.round(b/10),t=t.replace(/(^|[^\\])ff/g,"$1"+h(b)),b=Math.round(b/10);var v=p<12?"AM":"PM";t=(t=(t=t.replace(/(^|[^\\])f/g,"$1"+b)).replace(/(^|[^\\])TT+/g,"$1"+v)).replace(/(^|[^\\])T/g,"$1"+v.charAt(0));var w=v.toLowerCase();t=(t=t.replace(/(^|[^\\])tt+/g,"$1"+w)).replace(/(^|[^\\])t/g,"$1"+w.charAt(0));var k=-e.getTimezoneOffset(),y=i||!k?"Z":k>0?"+":"-";if(!i){var E=(k=Math.abs(k))%60;y+=h(Math.floor(k/60))+":"+h(E)}t=t.replace(/(^|[^\\])K/g,"$1"+y);var S=(i?e.getUTCDay():e.getDay())+1;return t=(t=(t=(t=(t=t.replace(new RegExp(o[0],"g"),o[S])).replace(new RegExp(l[0],"g"),l[S])).replace(new RegExp(s[0],"g"),s[u])).replace(new RegExp(r[0],"g"),r[u])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(e,t,a){var i=this.w;i.config.xaxis.min!==void 0&&(e=i.config.xaxis.min),i.config.xaxis.max!==void 0&&(t=i.config.xaxis.max);var s=this.getDate(e),r=this.getDate(t),o=this.formatDate(s,"yyyy MM dd HH mm ss fff").split(" "),l=this.formatDate(r,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(o[6],10),maxMillisecond:parseInt(l[6],10),minSecond:parseInt(o[5],10),maxSecond:parseInt(l[5],10),minMinute:parseInt(o[4],10),maxMinute:parseInt(l[4],10),minHour:parseInt(o[3],10),maxHour:parseInt(l[3],10),minDate:parseInt(o[2],10),maxDate:parseInt(l[2],10),minMonth:parseInt(o[1],10)-1,maxMonth:parseInt(l[1],10)-1,minYear:parseInt(o[0],10),maxYear:parseInt(l[0],10)}}},{key:"isLeapYear",value:function(e){return e%4==0&&e%100!=0||e%400==0}},{key:"calculcateLastDaysOfMonth",value:function(e,t,a){return this.determineDaysOfMonths(e,t)-a}},{key:"determineDaysOfYear",value:function(e){var t=365;return this.isLeapYear(e)&&(t=366),t}},{key:"determineRemainingDaysOfYear",value:function(e,t,a){var i=this.daysCntOfYear[t]+a;return t>1&&this.isLeapYear()&&i++,i}},{key:"determineDaysOfMonths",value:function(e,t){var a=30;switch(e=R.monthMod(e),!0){case this.months30.indexOf(e)>-1:e===2&&(a=this.isLeapYear(t)?29:28);break;case this.months31.indexOf(e)>-1:default:a=31}return a}}]),n}(),ga=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.tooltipKeyFormat="dd MMM"}return Z(n,[{key:"xLabelFormat",value:function(e,t,a,i){var s=this.w;if(s.config.xaxis.type==="datetime"&&s.config.xaxis.labels.formatter===void 0&&s.config.tooltip.x.formatter===void 0){var r=new He(this.ctx);return r.formatDate(r.getDate(t),s.config.tooltip.x.format)}return e(t,a,i)}},{key:"defaultGeneralFormatter",value:function(e){return Array.isArray(e)?e.map(function(t){return t}):e}},{key:"defaultYFormatter",value:function(e,t,a){var i=this.w;if(R.isNumber(e))if(i.globals.yValueDecimal!==0)e=e.toFixed(t.decimalsInFloat!==void 0?t.decimalsInFloat:i.globals.yValueDecimal);else{var s=e.toFixed(0);e=e==s?s:e.toFixed(1)}return e}},{key:"setLabelFormatters",value:function(){var e=this,t=this.w;return t.globals.xaxisTooltipFormatter=function(a){return e.defaultGeneralFormatter(a)},t.globals.ttKeyFormatter=function(a){return e.defaultGeneralFormatter(a)},t.globals.ttZFormatter=function(a){return a},t.globals.legendFormatter=function(a){return e.defaultGeneralFormatter(a)},t.config.xaxis.labels.formatter!==void 0?t.globals.xLabelFormatter=t.config.xaxis.labels.formatter:t.globals.xLabelFormatter=function(a){if(R.isNumber(a)){if(!t.config.xaxis.convertedCatToNumeric&&t.config.xaxis.type==="numeric"){if(R.isNumber(t.config.xaxis.decimalsInFloat))return a.toFixed(t.config.xaxis.decimalsInFloat);var i=t.globals.maxX-t.globals.minX;return i>0&&i<100?a.toFixed(1):a.toFixed(0)}return t.globals.isBarHorizontal&&t.globals.maxY-t.globals.minYArr<4?a.toFixed(1):a.toFixed(0)}return a},typeof t.config.tooltip.x.formatter=="function"?t.globals.ttKeyFormatter=t.config.tooltip.x.formatter:t.globals.ttKeyFormatter=t.globals.xLabelFormatter,typeof t.config.xaxis.tooltip.formatter=="function"&&(t.globals.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||t.config.tooltip.y.formatter!==void 0)&&(t.globals.ttVal=t.config.tooltip.y),t.config.tooltip.z.formatter!==void 0&&(t.globals.ttZFormatter=t.config.tooltip.z.formatter),t.config.legend.formatter!==void 0&&(t.globals.legendFormatter=t.config.legend.formatter),t.config.yaxis.forEach(function(a,i){a.labels.formatter!==void 0?t.globals.yLabelFormatters[i]=a.labels.formatter:t.globals.yLabelFormatters[i]=function(s){return t.globals.xyCharts?Array.isArray(s)?s.map(function(r){return e.defaultYFormatter(r,a,i)}):e.defaultYFormatter(s,a,i):s}}),t.globals}},{key:"heatmapLabelFormatters",value:function(){var e=this.w;if(e.config.chart.type==="heatmap"){e.globals.yAxisScale[0].result=e.globals.seriesNames.slice();var t=e.globals.seriesNames.reduce(function(a,i){return a.length>i.length?a:i},0);e.globals.yAxisScale[0].niceMax=t,e.globals.yAxisScale[0].niceMin=t}}}]),n}(),yt=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"getLabel",value:function(e,t,a,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"12px",o=!(arguments.length>6&&arguments[6]!==void 0)||arguments[6],l=this.w,h=e[i]===void 0?"":e[i],d=h,u=l.globals.xLabelFormatter,g=l.config.xaxis.labels.formatter,p=!1,f=new ga(this.ctx),m=h;o&&(d=f.xLabelFormat(u,h,m,{i,dateFormatter:new He(this.ctx).formatDate,w:l}),g!==void 0&&(d=g(h,e[i],{i,dateFormatter:new He(this.ctx).formatDate,w:l})));var x,b;t.length>0?(x=t[i].unit,b=null,t.forEach(function(y){y.unit==="month"?b="year":y.unit==="day"?b="month":y.unit==="hour"?b="day":y.unit==="minute"&&(b="hour")}),p=b===x,a=t[i].position,d=t[i].value):l.config.xaxis.type==="datetime"&&g===void 0&&(d=""),d===void 0&&(d=""),d=Array.isArray(d)?d:d.toString();var v=new O(this.ctx),w={};w=l.globals.rotateXLabels&&o?v.getTextRects(d,parseInt(r,10),null,"rotate(".concat(l.config.xaxis.labels.rotate," 0 0)"),!1):v.getTextRects(d,parseInt(r,10));var k=!l.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(d)&&(String(d)==="NaN"||s.indexOf(d)>=0&&k)&&(d=""),{x:a,text:d,textRect:w,isBold:p}}},{key:"checkLabelBasedOnTickamount",value:function(e,t,a){var i=this.w,s=i.config.xaxis.tickAmount;return s==="dataPoints"&&(s=Math.round(i.globals.gridWidth/120)),s>a||e%Math.round(a/(s+1))==0||(t.text=""),t}},{key:"checkForOverflowingLabels",value:function(e,t,a,i,s){var r=this.w;if(e===0&&r.globals.skipFirstTimelinelabel&&(t.text=""),e===a-1&&r.globals.skipLastTimelinelabel&&(t.text=""),r.config.xaxis.labels.hideOverlappingLabels&&i.length>0){var o=s[s.length-1];t.x<o.textRect.width/(r.globals.rotateXLabels?Math.abs(r.config.xaxis.labels.rotate)/12:1.01)+o.x&&(t.text="")}return t}},{key:"checkForReversedLabels",value:function(e,t){var a=this.w;return a.config.yaxis[e]&&a.config.yaxis[e].reversed&&t.reverse(),t}},{key:"yAxisAllSeriesCollapsed",value:function(e){var t=this.w.globals;return!t.seriesYAxisMap[e].some(function(a){return t.collapsedSeriesIndices.indexOf(a)===-1})}},{key:"translateYAxisIndex",value:function(e){var t=this.w,a=t.globals,i=t.config.yaxis;return a.series.length>i.length||i.some(function(s){return Array.isArray(s.seriesName)})?e:a.seriesYAxisReverseMap[e]}},{key:"isYAxisHidden",value:function(e){var t=this.w,a=t.config.yaxis[e];if(!a.show||this.yAxisAllSeriesCollapsed(e))return!0;if(!a.showForNullSeries){var i=t.globals.seriesYAxisMap[e],s=new Le(this.ctx);return i.every(function(r){return s.isSeriesNull(r)})}return!1}},{key:"getYAxisForeColor",value:function(e,t){var a=this.w;return Array.isArray(e)&&a.globals.yAxisScale[t]&&this.ctx.theme.pushExtraColors(e,a.globals.yAxisScale[t].result.length,!1),e}},{key:"drawYAxisTicks",value:function(e,t,a,i,s,r,o){var l=this.w,h=new O(this.ctx),d=l.globals.translateY+l.config.yaxis[s].labels.offsetY;if(l.globals.isBarHorizontal?d=0:l.config.chart.type==="heatmap"&&(d+=r/2),i.show&&t>0){l.config.yaxis[s].opposite===!0&&(e+=i.width);for(var u=t;u>=0;u--){var g=h.drawLine(e+a.offsetX-i.width+i.offsetX,d+i.offsetY,e+a.offsetX+i.offsetX,d+i.offsetY,i.color);o.add(g),d+=r}}}}]),n}(),Vo=function(){function n(e){q(this,n),this.w=e.w,this.annoCtx=e,this.helpers=new Va(this.annoCtx),this.axesUtils=new yt(this.annoCtx)}return Z(n,[{key:"addYaxisAnnotation",value:function(e,t,a){var i,s=this.w,r=e.strokeDashArray,o=this.helpers.getY1Y2("y1",e),l=o.yP,h=o.clipped,d=!0,u=!1,g=e.label.text;if(e.y2===null||e.y2===void 0){if(!h){u=!0;var p=this.annoCtx.graphics.drawLine(0+e.offsetX,l+e.offsetY,this._getYAxisAnnotationWidth(e),l+e.offsetY,e.borderColor,r,e.borderWidth);t.appendChild(p.node),e.id&&p.node.classList.add(e.id)}}else{if(i=(o=this.helpers.getY1Y2("y2",e)).yP,d=o.clipped,i>l){var f=l;l=i,i=f}if(!h||!d){u=!0;var m=this.annoCtx.graphics.drawRect(0+e.offsetX,i+e.offsetY,this._getYAxisAnnotationWidth(e),l-i,0,e.fillColor,e.opacity,1,e.borderColor,r);m.node.classList.add("apexcharts-annotation-rect"),m.attr("clip-path","url(#gridRectMask".concat(s.globals.cuid,")")),t.appendChild(m.node),e.id&&m.node.classList.add(e.id)}}if(u){var x=e.label.position==="right"?s.globals.gridWidth:e.label.position==="center"?s.globals.gridWidth/2:0,b=this.annoCtx.graphics.drawText({x:x+e.label.offsetX,y:(i??l)+e.label.offsetY-3,text:g,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:"")});b.attr({rel:a}),t.appendChild(b.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,a=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach(function(i,s){i.yAxisIndex=e.axesUtils.translateYAxisIndex(i.yAxisIndex),e.axesUtils.isYAxisHidden(i.yAxisIndex)&&e.axesUtils.yAxisAllSeriesCollapsed(i.yAxisIndex)||e.addYaxisAnnotation(i,a.node,s)}),a}}]),n}(),Io=function(){function n(e){q(this,n),this.w=e.w,this.annoCtx=e,this.helpers=new Va(this.annoCtx)}return Z(n,[{key:"addPointAnnotation",value:function(e,t,a){if(!(this.w.globals.collapsedSeriesIndices.indexOf(e.seriesIndex)>-1)){var i=this.helpers.getX1X2("x1",e),s=i.x,r=i.clipped,o=(i=this.helpers.getY1Y2("y1",e)).yP,l=i.clipped;if(R.isNumber(s)&&!l&&!r){var h={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:"")},d=this.annoCtx.graphics.drawMarker(s+e.marker.offsetX,o+e.marker.offsetY,h);t.appendChild(d.node);var u=e.label.text?e.label.text:"",g=this.annoCtx.graphics.drawText({x:s+e.label.offsetX,y:o+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(g.attr({rel:a}),t.appendChild(g.node),e.customSVG.SVG){var p=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+e.customSVG.cssClass});p.attr({transform:"translate(".concat(s+e.customSVG.offsetX,", ").concat(o+e.customSVG.offsetY,")")}),p.node.innerHTML=e.customSVG.SVG,t.appendChild(p.node)}if(e.image.path){var f=e.image.width?e.image.width:20,m=e.image.height?e.image.height:20;d=this.annoCtx.addImage({x:s+e.image.offsetX-f/2,y:o+e.image.offsetY-m/2,width:f,height:m,path:e.image.path,appendTo:".apexcharts-point-annotations"})}e.mouseEnter&&d.node.addEventListener("mouseenter",e.mouseEnter.bind(this,e)),e.mouseLeave&&d.node.addEventListener("mouseleave",e.mouseLeave.bind(this,e)),e.click&&d.node.addEventListener("click",e.click.bind(this,e))}}}},{key:"drawPointAnnotations",value:function(){var e=this,t=this.w,a=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map(function(i,s){e.addPointAnnotation(i,a.node,s)}),a}}]),n}(),ar={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"}}},Tt=function(){function n(){q(this,n),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 Z(n,[{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:[ar],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},seriesTitle:{show:!0,offsetY:1,offsetX:1,borderColor:"#000",borderWidth:1,borderRadius:2,style:{background:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"12px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:6,right:6,top:2,bottom:2}}}},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(t,a){return t+a},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(t,a){return t+a},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 e!==null?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",backgroundColor:void 0,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}}}}}]),n}(),Ho=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.graphics=new O(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new Va(this),this.xAxisAnnotations=new Bo(this),this.yAxisAnnotations=new Vo(this),this.pointsAnnotations=new Io(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 Z(n,[{key:"drawAxesAnnotations",value:function(){var e=this.w;if(e.globals.axisCharts&&e.globals.dataPoints){for(var t=this.yAxisAnnotations.drawYAxisAnnotations(),a=this.xAxisAnnotations.drawXAxisAnnotations(),i=this.pointsAnnotations.drawPointAnnotations(),s=e.config.chart.animations.enabled,r=[t,a,i],o=[a.node,t.node,i.node],l=0;l<3;l++)e.globals.dom.elGraphical.add(r[l]),!s||e.globals.resized||e.globals.dataChanged||e.config.chart.type!=="scatter"&&e.config.chart.type!=="bubble"&&e.globals.dataPoints>1&&o[l].classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:o[l],index:0});this.helpers.annotationsBackground()}}},{key:"drawImageAnnos",value:function(){var e=this;this.w.config.annotations.images.map(function(t,a){e.addImage(t,a)})}},{key:"drawTextAnnos",value:function(){var e=this;this.w.config.annotations.texts.map(function(t,a){e.addText(t,a)})}},{key:"addXaxisAnnotation",value:function(e,t,a){this.xAxisAnnotations.addXaxisAnnotation(e,t,a)}},{key:"addYaxisAnnotation",value:function(e,t,a){this.yAxisAnnotations.addYaxisAnnotation(e,t,a)}},{key:"addPointAnnotation",value:function(e,t,a){this.pointsAnnotations.addPointAnnotation(e,t,a)}},{key:"addText",value:function(e,t){var a=e.x,i=e.y,s=e.text,r=e.textAnchor,o=e.foreColor,l=e.fontSize,h=e.fontFamily,d=e.fontWeight,u=e.cssClass,g=e.backgroundColor,p=e.borderWidth,f=e.strokeDashArray,m=e.borderRadius,x=e.borderColor,b=e.appendTo,v=b===void 0?".apexcharts-svg":b,w=e.paddingLeft,k=w===void 0?4:w,y=e.paddingRight,E=y===void 0?4:y,S=e.paddingBottom,C=S===void 0?2:S,N=e.paddingTop,L=N===void 0?2:N,A=this.w,M=this.graphics.drawText({x:a,y:i,text:s,textAnchor:r||"start",fontSize:l||"12px",fontWeight:d||"regular",fontFamily:h||A.config.chart.fontFamily,foreColor:o||A.config.chart.foreColor,cssClass:u}),F=A.globals.dom.baseEl.querySelector(v);F&&F.appendChild(M.node);var z=M.bbox();if(s){var B=this.graphics.drawRect(z.x-k,z.y-L,z.width+k+E,z.height+C+L,m,g||"transparent",1,p,x,f);F.insertBefore(B.node,M.node)}}},{key:"addImage",value:function(e,t){var a=this.w,i=e.path,s=e.x,r=s===void 0?0:s,o=e.y,l=o===void 0?0:o,h=e.width,d=h===void 0?20:h,u=e.height,g=u===void 0?20:u,p=e.appendTo,f=p===void 0?".apexcharts-svg":p,m=a.globals.dom.Paper.image(i);m.size(d,g).move(r,l);var x=a.globals.dom.baseEl.querySelector(f);return x&&x.appendChild(m.node),m}},{key:"addXaxisAnnotationExternal",value:function(e,t,a){return this.addAnnotationExternal({params:e,pushToMemory:t,context:a,type:"xaxis",contextMethod:a.addXaxisAnnotation}),a}},{key:"addYaxisAnnotationExternal",value:function(e,t,a){return this.addAnnotationExternal({params:e,pushToMemory:t,context:a,type:"yaxis",contextMethod:a.addYaxisAnnotation}),a}},{key:"addPointAnnotationExternal",value:function(e,t,a){return this.invertAxis===void 0&&(this.invertAxis=a.w.globals.isBarHorizontal),this.addAnnotationExternal({params:e,pushToMemory:t,context:a,type:"point",contextMethod:a.addPointAnnotation}),a}},{key:"addAnnotationExternal",value:function(e){var t=e.params,a=e.pushToMemory,i=e.context,s=e.type,r=e.contextMethod,o=i,l=o.w,h=l.globals.dom.baseEl.querySelector(".apexcharts-".concat(s,"-annotations")),d=h.childNodes.length+1,u=new Tt,g=Object.assign({},s==="xaxis"?u.xAxisAnnotation:s==="yaxis"?u.yAxisAnnotation:u.pointAnnotation),p=R.extend(g,t);switch(s){case"xaxis":this.addXaxisAnnotation(p,h,d);break;case"yaxis":this.addYaxisAnnotation(p,h,d);break;case"point":this.addPointAnnotation(p,h,d)}var f=l.globals.dom.baseEl.querySelector(".apexcharts-".concat(s,"-annotations .apexcharts-").concat(s,"-annotation-label[rel='").concat(d,"']")),m=this.helpers.addBackgroundToAnno(f,p);return m&&h.insertBefore(m.node,f),a&&l.globals.memory.methodsToExec.push({context:o,id:p.id?p.id:R.randomId(),method:r,label:"addAnnotation",params:t}),i}},{key:"clearAnnotations",value:function(e){for(var t=e.w,a=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations"),i=t.globals.memory.methodsToExec.length-1;i>=0;i--)t.globals.memory.methodsToExec[i].label!=="addText"&&t.globals.memory.methodsToExec[i].label!=="addAnnotation"||t.globals.memory.methodsToExec.splice(i,1);a=R.listToArray(a),Array.prototype.forEach.call(a,function(s){for(;s.firstChild;)s.removeChild(s.firstChild)})}},{key:"removeAnnotation",value:function(e,t){var a=e.w,i=a.globals.dom.baseEl.querySelectorAll(".".concat(t));i&&(a.globals.memory.methodsToExec.map(function(s,r){s.id===t&&a.globals.memory.methodsToExec.splice(r,1)}),Object.keys(a.config.annotations).forEach(function(s){var r=a.config.annotations[s];Array.isArray(r)&&(a.config.annotations[s]=r.filter(function(o){return o.id!==t}))}),Array.prototype.forEach.call(i,function(s){s.parentElement.removeChild(s)}))}}]),n}(),zi=function(n){var e,t=n.isTimeline,a=n.ctx,i=n.seriesIndex,s=n.dataPointIndex,r=n.y1,o=n.y2,l=n.w,h=l.globals.seriesRangeStart[i][s],d=l.globals.seriesRangeEnd[i][s],u=l.globals.labels[s],g=l.config.series[i].name?l.config.series[i].name:"",p=l.globals.ttKeyFormatter,f=l.config.tooltip.y.title.formatter,m={w:l,seriesIndex:i,dataPointIndex:s,start:h,end:d};typeof f=="function"&&(g=f(g,m)),(e=l.config.series[i].data[s])!==null&&e!==void 0&&e.x&&(u=l.config.series[i].data[s].x),t||l.config.xaxis.type==="datetime"&&(u=new ga(a).xLabelFormat(l.globals.ttKeyFormatter,u,u,{i:void 0,dateFormatter:new He(a).formatDate,w:l})),typeof p=="function"&&(u=p(u,m)),Number.isFinite(r)&&Number.isFinite(o)&&(h=r,d=o);var x="",b="",v=l.globals.colors[i];if(l.config.tooltip.x.formatter===void 0)if(l.config.xaxis.type==="datetime"){var w=new He(a);x=w.formatDate(w.getDate(h),l.config.tooltip.x.format),b=w.formatDate(w.getDate(d),l.config.tooltip.x.format)}else x=h,b=d;else x=l.config.tooltip.x.formatter(h),b=l.config.tooltip.x.formatter(d);return{start:h,end:d,startVal:x,endVal:b,ylabel:u,color:v,seriesName:g}},Ti=function(n){var e=n.color,t=n.seriesName,a=n.ylabel,i=n.start,s=n.end,r=n.seriesIndex,o=n.dataPointIndex,l=n.ctx.tooltip.tooltipLabels.getFormatters(r);i=l.yLbFormatter(i),s=l.yLbFormatter(s);var h=l.yLbFormatter(n.w.globals.series[r][o]),d=`<span class="value start-value">
|
|
41
|
+
`.concat(i,`
|
|
42
|
+
</span> <span class="separator">-</span> <span class="value end-value">
|
|
43
|
+
`).concat(s,`
|
|
44
|
+
</span>`);return'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+e+'">'+(t||"")+'</span></div><div> <span class="category">'+a+": </span> "+(n.w.globals.comboCharts?n.w.config.series[r].type==="rangeArea"||n.w.config.series[r].type==="rangeBar"?d:"<span>".concat(h,"</span>"):d)+" </div></div>"},pa=function(){function n(e){q(this,n),this.opts=e}return Z(n,[{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(),R.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 a=t.w.config.series[t.seriesIndex].name;return e!==null?a+": "+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:"square"},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},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(t){var a=t.seriesIndex,i=t.dataPointIndex,s=t.w;return e._getBoxTooltip(s,a,i,["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 a=t.seriesIndex,i=t.dataPointIndex,s=t.w;return e._getBoxTooltip(s,a,i,["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 a=t.seriesIndex,i=t.dataPointIndex,s=t.w,r=function(){var o=s.globals.seriesRangeStart[a][i];return s.globals.seriesRangeEnd[a][i]-o};return s.globals.comboCharts?s.config.series[a].type==="rangeBar"||s.config.series[a].type==="rangeArea"?r():e:r()},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(t){var a=zi(G(G({},t),{},{isTimeline:!0})),i=a.color,s=a.seriesName,r=a.ylabel,o=a.startVal,l=a.endVal;return Ti(G(G({},t),{},{color:i,seriesName:s,ylabel:r,start:o,end:l}))}(e):function(t){var a=zi(t),i=a.color,s=a.seriesName,r=a.ylabel,o=a.start,l=a.end;return Ti(G(G({},t),{},{color:i,seriesName:s,ylabel:r,start:o,end:l}))}(e)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"dumbbell",value:function(e){var t,a;return(t=e.plotOptions.bar)!==null&&t!==void 0&&t.barHeight||(e.plotOptions.bar.barHeight=2),(a=e.plotOptions.bar)!==null&&a!==void 0&&a.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(t){var a=zi(t),i=a.color,s=a.seriesName,r=a.ylabel,o=a.start,l=a.end;return Ti(G(G({},t),{},{color:i,seriesName:s,ylabel:r,start:o,end:l}))}(e)}}}}},{key:"brush",value:function(e){return R.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(a,i){e.yaxis[i].min=0,e.yaxis[i].max=100}),e.chart.type==="bar"&&(e.dataLabels.formatter=t||function(a){return typeof a=="number"&&a?a.toFixed(0)+"%":a}),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,a){e.xaxis.type="numeric",e.xaxis.labels=e.xaxis.labels||{},e.xaxis.labels.formatter=e.xaxis.labels.formatter||function(r){return R.isNumber(r)?Math.floor(r):r};var i=e.xaxis.labels.formatter,s=e.xaxis.categories&&e.xaxis.categories.length?e.xaxis.categories:e.labels;return a&&a.length&&(s=a.map(function(r){return Array.isArray(r)?r:String(r)})),s&&s.length&&(e.xaxis.labels.formatter=function(r){return R.isNumber(r)?i(s[Math.floor(r)-1]):i(r)}),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,a,i,s){var r=e.globals.seriesCandleO[t][a],o=e.globals.seriesCandleH[t][a],l=e.globals.seriesCandleM[t][a],h=e.globals.seriesCandleL[t][a],d=e.globals.seriesCandleC[t][a];return e.config.series[t].type&&e.config.series[t].type!==s?`<div class="apexcharts-custom-tooltip">
|
|
45
|
+
`.concat(e.config.series[t].name?e.config.series[t].name:"series-"+(t+1),": <strong>").concat(e.globals.series[t][a],`</strong>
|
|
46
|
+
</div>`):'<div class="apexcharts-tooltip-box apexcharts-tooltip-'.concat(e.config.chart.type,'">')+"<div>".concat(i[0],': <span class="value">')+r+"</span></div>"+"<div>".concat(i[1],': <span class="value">')+o+"</span></div>"+(l?"<div>".concat(i[2],': <span class="value">')+l+"</span></div>":"")+"<div>".concat(i[3],': <span class="value">')+h+"</span></div>"+"<div>".concat(i[4],': <span class="value">')+d+"</span></div></div>"}}]),n}(),fa=function(){function n(e){q(this,n),this.opts=e}return Z(n,[{key:"init",value:function(e){var t=e.responsiveOverride,a=this.opts,i=new Tt,s=new pa(a);this.chartType=a.chart.type,a=this.extendYAxis(a),a=this.extendAnnotations(a);var r=i.init(),o={};if(a&&Ht(a)==="object"){var l,h,d,u,g,p,f,m,x,b,v={};v=["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(a.chart.type)!==-1?s[a.chart.type]():s.line(),(l=a.plotOptions)!==null&&l!==void 0&&(h=l.bar)!==null&&h!==void 0&&h.isFunnel&&(v=s.funnel()),a.chart.stacked&&a.chart.type==="bar"&&(v=s.stackedBars()),(d=a.chart.brush)!==null&&d!==void 0&&d.enabled&&(v=s.brush(v)),(u=a.plotOptions)!==null&&u!==void 0&&(g=u.line)!==null&&g!==void 0&&g.isSlopeChart&&(v=s.slope()),a.chart.stacked&&a.chart.stackType==="100%"&&(a=s.stacked100(a)),(p=a.plotOptions)!==null&&p!==void 0&&(f=p.bar)!==null&&f!==void 0&&f.isDumbbell&&(a=s.dumbbell(a)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(a),a.xaxis=a.xaxis||window.Apex.xaxis||{},t||(a.xaxis.convertedCatToNumeric=!1),((m=(a=this.checkForCatToNumericXAxis(this.chartType,v,a)).chart.sparkline)!==null&&m!==void 0&&m.enabled||(x=window.Apex.chart)!==null&&x!==void 0&&(b=x.sparkline)!==null&&b!==void 0&&b.enabled)&&(v=s.sparkline(v)),o=R.extend(r,v)}var w=R.extend(o,window.Apex);return r=R.extend(w,a),r=this.handleUserInputErrors(r)}},{key:"checkForCatToNumericXAxis",value:function(e,t,a){var i,s,r=new pa(a),o=(e==="bar"||e==="boxPlot")&&((i=a.plotOptions)===null||i===void 0||(s=i.bar)===null||s===void 0?void 0:s.horizontal),l=e==="pie"||e==="polarArea"||e==="donut"||e==="radar"||e==="radialBar"||e==="heatmap",h=a.xaxis.type!=="datetime"&&a.xaxis.type!=="numeric",d=a.xaxis.tickPlacement?a.xaxis.tickPlacement:t.xaxis&&t.xaxis.tickPlacement;return o||l||!h||d==="between"||(a=r.convertCatToNumeric(a)),a}},{key:"extendYAxis",value:function(e,t){var a=new Tt;(e.yaxis===void 0||!e.yaxis||Array.isArray(e.yaxis)&&e.yaxis.length===0)&&(e.yaxis={}),e.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(e.yaxis=R.extend(e.yaxis,window.Apex.yaxis)),e.yaxis.constructor!==Array?e.yaxis=[R.extend(a.yAxis,e.yaxis)]:e.yaxis=R.extendArray(e.yaxis,a.yAxis);var i=!1;e.yaxis.forEach(function(r){r.logarithmic&&(i=!0)});var s=e.series;return t&&!s&&(s=t.config.series),i&&s.length!==e.yaxis.length&&s.length&&(e.yaxis=s.map(function(r,o){if(r.name||(s[o].name="series-".concat(o+1)),e.yaxis[o])return e.yaxis[o].seriesName=s[o].name,e.yaxis[o];var l=R.extend(a.yAxis,e.yaxis[0]);return l.show=!1,l})),i&&s.length>1&&s.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 e.annotations===void 0&&(e.annotations={},e.annotations.yaxis=[],e.annotations.xaxis=[],e.annotations.points=[]),e=this.extendYAxisAnnotations(e),e=this.extendXAxisAnnotations(e),e=this.extendPointAnnotations(e)}},{key:"extendYAxisAnnotations",value:function(e){var t=new Tt;return e.annotations.yaxis=R.extendArray(e.annotations.yaxis!==void 0?e.annotations.yaxis:[],t.yAxisAnnotation),e}},{key:"extendXAxisAnnotations",value:function(e){var t=new Tt;return e.annotations.xaxis=R.extendArray(e.annotations.xaxis!==void 0?e.annotations.xaxis:[],t.xAxisAnnotation),e}},{key:"extendPointAnnotations",value:function(e){var t=new Tt;return e.annotations.points=R.extendArray(e.annotations.points!==void 0?e.annotations.points:[],t.pointAnnotation),e}},{key:"checkForDarkTheme",value:function(e){e.theme&&e.theme.mode==="dark"&&(e.tooltip||(e.tooltip={}),e.tooltip.theme!=="light"&&(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(t.chart.type==="bar"&&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 t.chart.type!=="bar"&&t.chart.type!=="rangeBar"||t.tooltip.shared&&t.xaxis.crosshairs.width==="barWidth"&&t.series.length>1&&(t.xaxis.crosshairs.width="tickWidth"),t.chart.type!=="candlestick"&&t.chart.type!=="boxPlot"||t.yaxis[0].reversed&&(console.warn("Reversed y-axis in ".concat(t.chart.type," chart is not supported.")),t.yaxis[0].reversed=!1),t}}]),n}(),ir=function(){function n(){q(this,n)}return Z(n,[{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:e.chart.toolbar.autoSelected==="zoom"&&e.chart.toolbar.tools.zoom&&e.chart.zoom.enabled,panEnabled:e.chart.toolbar.autoSelected==="pan"&&e.chart.toolbar.tools.pan,selectionEnabled:e.chart.toolbar.autoSelected==="selection"&&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=R.extend({},e),t.initialSeries=R.clone(e.series),t.lastXAxis=R.clone(t.initialConfig.xaxis),t.lastYAxis=R.clone(t.initialConfig.yaxis),t}}]),n}(),Oo=function(){function n(e){q(this,n),this.opts=e}return Z(n,[{key:"init",value:function(){var e=new fa(this.opts).init({responsiveOverride:!1});return{config:e,globals:new ir().init(e)}}}]),n}(),lt=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}return Z(n,[{key:"clippedImgArea",value:function(e){var t=this.w,a=t.config,i=parseInt(t.globals.gridWidth,10),s=parseInt(t.globals.gridHeight,10),r=i>s?i:s,o=e.image,l=0,h=0;e.width===void 0&&e.height===void 0?a.fill.image.width!==void 0&&a.fill.image.height!==void 0?(l=a.fill.image.width+1,h=a.fill.image.height):(l=r+1,h=r):(l=e.width,h=e.height);var d=document.createElementNS(t.globals.SVGNS,"pattern");O.setAttrs(d,{id:e.patternID,patternUnits:e.patternUnits?e.patternUnits:"userSpaceOnUse",width:l+"px",height:h+"px"});var u=document.createElementNS(t.globals.SVGNS,"image");d.appendChild(u),u.setAttributeNS(window.SVG.xlink,"href",o),O.setAttrs(u,{x:0,y:0,preserveAspectRatio:"none",width:l+"px",height:h+"px"}),u.style.opacity=e.opacity,t.globals.dom.elDefs.node.appendChild(d)}},{key:"getSeriesIndex",value:function(e){var t=this.w,a=t.config.chart.type;return(a==="bar"||a==="rangeBar")&&t.config.plotOptions.bar.distributed||a==="heatmap"||a==="treemap"?this.seriesIndex=e.seriesNumber:this.seriesIndex=e.seriesNumber%t.globals.series.length,this.seriesIndex}},{key:"computeColorStops",value:function(e,t){var a,i=this.w,s=null,r=null,o=aa(e);try{for(o.s();!(a=o.n()).done;){var l=a.value;l>=t.threshold?(s===null||l>s)&&(s=l):(r===null||l<r)&&(r=l)}}catch(u){o.e(u)}finally{o.f()}s===null&&(s=t.threshold),r===null&&(r=t.threshold);var h=s-t.threshold+(t.threshold-r);h===0&&(h=1);var d=100-(t.threshold-r)/h*100;return[{offset:d=Math.max(0,Math.min(d,100)),color:t.colorAboveThreshold,opacity:i.config.fill.opacity},{offset:0,color:t.colorBelowThreshold,opacity:i.config.fill.opacity}]}},{key:"fillPath",value:function(e){var t,a,i,s=this.w;this.opts=e;var r,o,l,h=this.w.config;this.seriesIndex=this.getSeriesIndex(e);var d=h.plotOptions.line.colors.colorAboveThreshold&&h.plotOptions.line.colors.colorBelowThreshold,u=this.getFillColors()[this.seriesIndex];s.globals.seriesColors[this.seriesIndex]!==void 0&&(u=s.globals.seriesColors[this.seriesIndex]),typeof u=="function"&&(u=u({seriesIndex:this.seriesIndex,dataPointIndex:e.dataPointIndex,value:e.value,w:s}));var g,p,f,m=e.fillType?e.fillType:this.getFillType(this.seriesIndex),x=Array.isArray(h.fill.opacity)?h.fill.opacity[this.seriesIndex]:h.fill.opacity,b=m==="gradient"||d;e.color&&(u=e.color),(t=s.config.series[this.seriesIndex])!==null&&t!==void 0&&(a=t.data)!==null&&a!==void 0&&(i=a[e.dataPointIndex])!==null&&i!==void 0&&i.fillColor&&(u=(g=s.config.series[this.seriesIndex])===null||g===void 0||(p=g.data)===null||p===void 0||(f=p[e.dataPointIndex])===null||f===void 0?void 0:f.fillColor),u||(u="#fff",console.warn("undefined color - ApexCharts"));var v=u;if(u.indexOf("rgb")===-1?u.indexOf("#")===-1?v=u:u.length<9&&(v=R.hexToRgba(u,x)):u.indexOf("rgba")>-1?x=R.getOpacityFromRGBA(u):v=R.hexToRgba(R.rgb2hex(u),x),e.opacity&&(x=e.opacity),m==="pattern"&&(o=this.handlePatternFill({fillConfig:e.fillConfig,patternFill:o,fillColor:u,fillOpacity:x,defaultColor:v})),b){var w=Pe(h.fill.gradient.colorStops)||[],k=h.fill.gradient.type;d&&(w[this.seriesIndex]=this.computeColorStops(s.globals.series[this.seriesIndex],h.plotOptions.line.colors),k="vertical"),l=this.handleGradientFill({type:k,fillConfig:e.fillConfig,fillColor:u,fillOpacity:x,colorStops:w,i:this.seriesIndex})}if(m==="image"){var y=h.fill.image.src,E=e.patternID?e.patternID:"",S="pattern".concat(s.globals.cuid).concat(e.seriesNumber+1).concat(E);this.patternIDs.indexOf(S)===-1&&(this.clippedImgArea({opacity:x,image:Array.isArray(y)?e.seriesNumber<y.length?y[e.seriesNumber]:y[0]:y,width:e.width?e.width:void 0,height:e.height?e.height:void 0,patternUnits:e.patternUnits,patternID:S}),this.patternIDs.push(S)),r="url(#".concat(S,")")}else r=b?l:m==="pattern"?o:v;return e.solid&&(r=v),r}},{key:"getFillType",value:function(e){var t=this.w;return Array.isArray(t.config.fill.type)?t.config.fill.type[e]:t.config.fill.type}},{key:"getFillColors",value:function(){var e=this.w,t=e.config,a=this.opts,i=[];return e.globals.comboCharts?e.config.series[this.seriesIndex].type==="line"?Array.isArray(e.globals.stroke.colors)?i=e.globals.stroke.colors:i.push(e.globals.stroke.colors):Array.isArray(e.globals.fill.colors)?i=e.globals.fill.colors:i.push(e.globals.fill.colors):t.chart.type==="line"?Array.isArray(e.globals.stroke.colors)?i=e.globals.stroke.colors:i.push(e.globals.stroke.colors):Array.isArray(e.globals.fill.colors)?i=e.globals.fill.colors:i.push(e.globals.fill.colors),a.fillColors!==void 0&&(i=[],Array.isArray(a.fillColors)?i=a.fillColors.slice():i.push(a.fillColors)),i}},{key:"handlePatternFill",value:function(e){var t=e.fillConfig,a=e.patternFill,i=e.fillColor,s=e.fillOpacity,r=e.defaultColor,o=this.w.config.fill;t&&(o=t);var l=this.opts,h=new O(this.ctx),d=Array.isArray(o.pattern.strokeWidth)?o.pattern.strokeWidth[this.seriesIndex]:o.pattern.strokeWidth,u=i;return Array.isArray(o.pattern.style)?a=o.pattern.style[l.seriesNumber]!==void 0?h.drawPattern(o.pattern.style[l.seriesNumber],o.pattern.width,o.pattern.height,u,d,s):r:a=h.drawPattern(o.pattern.style,o.pattern.width,o.pattern.height,u,d,s),a}},{key:"handleGradientFill",value:function(e){var t=e.type,a=e.fillColor,i=e.fillOpacity,s=e.fillConfig,r=e.colorStops,o=e.i,l=this.w.config.fill;s&&(l=G(G({},l),s));var h=this.opts,d=new O(this.ctx),u=new R;t=t||l.gradient.type;var g,p=a,f=l.gradient.opacityFrom===void 0?i:Array.isArray(l.gradient.opacityFrom)?l.gradient.opacityFrom[o]:l.gradient.opacityFrom;p.indexOf("rgba")>-1&&(f=R.getOpacityFromRGBA(p));var m=l.gradient.opacityTo===void 0?i:Array.isArray(l.gradient.opacityTo)?l.gradient.opacityTo[o]:l.gradient.opacityTo;if(l.gradient.gradientToColors===void 0||l.gradient.gradientToColors.length===0)g=l.gradient.shade==="dark"?u.shadeColor(-1*parseFloat(l.gradient.shadeIntensity),a.indexOf("rgb")>-1?R.rgb2hex(a):a):u.shadeColor(parseFloat(l.gradient.shadeIntensity),a.indexOf("rgb")>-1?R.rgb2hex(a):a);else if(l.gradient.gradientToColors[h.seriesNumber]){var x=l.gradient.gradientToColors[h.seriesNumber];g=x,x.indexOf("rgba")>-1&&(m=R.getOpacityFromRGBA(x))}else g=a;if(l.gradient.gradientFrom&&(p=l.gradient.gradientFrom),l.gradient.gradientTo&&(g=l.gradient.gradientTo),l.gradient.inverseColors){var b=p;p=g,g=b}return p.indexOf("rgb")>-1&&(p=R.rgb2hex(p)),g.indexOf("rgb")>-1&&(g=R.rgb2hex(g)),d.drawGradient(t,p,g,f,m,h.size,l.gradient.stops,r,o)}}]),n}(),Ut=function(){function n(e,t){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{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.length<e.globals.series.length+1)for(var t=0;t<=e.globals.series.length;t++)e.globals.markers.size[t]===void 0&&e.globals.markers.size.push(e.globals.markers.size[0])}else e.globals.markers.size=e.config.series.map(function(a){return e.config.markers.size})}},{key:"plotChartMarkers",value:function(e){var t=e.pointsPos,a=e.seriesIndex,i=e.j,s=e.pSize,r=e.alwaysDrawMarker,o=r!==void 0&&r,l=e.isVirtualPoint,h=l!==void 0&&l,d=this.w,u=a,g=t,p=null,f=new O(this.ctx),m=d.config.markers.discrete&&d.config.markers.discrete.length;if(Array.isArray(g.x))for(var x=0;x<g.x.length;x++){var b=void 0,v=i,w=!R.isNumber(g.y[x]);d.globals.markers.largestSize===0&&d.globals.hasNullValues&&d.globals.series[u][i+1]!==null&&!h&&(w=!0),i===1&&x===0&&(v=0),i===1&&x===1&&(v=1);var k="apexcharts-marker";if(d.config.chart.type!=="line"&&d.config.chart.type!=="area"||d.globals.comboCharts||d.config.tooltip.intersect||(k+=" no-pointer-events"),(Array.isArray(d.config.markers.size)?d.globals.markers.size[a]>0:d.config.markers.size>0)||o||m){w||(k+=" w".concat(R.randomId()));var y=this.getMarkerConfig({cssClass:k,seriesIndex:a,dataPointIndex:v});d.config.series[u].data[v]&&(d.config.series[u].data[v].fillColor&&(y.pointFillColor=d.config.series[u].data[v].fillColor),d.config.series[u].data[v].strokeColor&&(y.pointStrokeColor=d.config.series[u].data[v].strokeColor)),s!==void 0&&(y.pSize=s),(g.x[x]<-d.globals.markers.largestSize||g.x[x]>d.globals.gridWidth+d.globals.markers.largestSize||g.y[x]<-d.globals.markers.largestSize||g.y[x]>d.globals.gridHeight+d.globals.markers.largestSize)&&(y.pSize=0),!w&&((d.globals.markers.size[a]>0||o||m)&&!p&&(p=f.group({class:o||m?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(d.globals.cuid,")")),(b=f.drawMarker(g.x[x],g.y[x],y)).attr("rel",v),b.attr("j",v),b.attr("index",a),b.node.setAttribute("default-marker-size",y.pSize),new Ie(this.ctx).setSelectionFilter(b,a,v),this.addEvents(b),p&&p.add(b))}else d.globals.pointsArray[a]===void 0&&(d.globals.pointsArray[a]=[]),d.globals.pointsArray[a].push([g.x[x],g.y[x]])}return p}},{key:"getMarkerConfig",value:function(e){var t=e.cssClass,a=e.seriesIndex,i=e.dataPointIndex,s=i===void 0?null:i,r=e.radius,o=r===void 0?null:r,l=e.size,h=l===void 0?null:l,d=e.strokeWidth,u=d===void 0?null:d,g=this.w,p=this.getMarkerStyle(a),f=h===null?g.globals.markers.size[a]:h,m=g.config.markers;return s!==null&&m.discrete.length&&m.discrete.map(function(x){x.seriesIndex===a&&x.dataPointIndex===s&&(p.pointStrokeColor=x.strokeColor,p.pointFillColor=x.fillColor,f=x.size,p.pointShape=x.shape)}),{pSize:o===null?f:o,pRadius:o!==null?o:m.radius,pointStrokeWidth:u!==null?u:Array.isArray(m.strokeWidth)?m.strokeWidth[a]:m.strokeWidth,pointStrokeColor:p.pointStrokeColor,pointFillColor:p.pointFillColor,shape:p.pointShape||(Array.isArray(m.shape)?m.shape[a]:m.shape),class:t,pointStrokeOpacity:Array.isArray(m.strokeOpacity)?m.strokeOpacity[a]:m.strokeOpacity,pointStrokeDashArray:Array.isArray(m.strokeDashArray)?m.strokeDashArray[a]:m.strokeDashArray,pointFillOpacity:Array.isArray(m.fillOpacity)?m.fillOpacity[a]:m.fillOpacity,seriesIndex:a}}},{key:"addEvents",value:function(e){var t=this.w,a=new O(this.ctx);e.node.addEventListener("mouseenter",a.pathMouseEnter.bind(this.ctx,e)),e.node.addEventListener("mouseleave",a.pathMouseLeave.bind(this.ctx,e)),e.node.addEventListener("mousedown",a.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",a.pathMouseDown.bind(this.ctx,e),{passive:!0})}},{key:"getMarkerStyle",value:function(e){var t=this.w,a=t.globals.markers.colors,i=t.config.markers.strokeColor||t.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(i)?i[e]:i,pointFillColor:Array.isArray(a)?a[e]:a}}}]),n}(),sr=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.initialAnim=this.w.config.chart.animations.enabled}return Z(n,[{key:"draw",value:function(e,t,a){var i=this.w,s=new O(this.ctx),r=a.realIndex,o=a.pointsPos,l=a.zRatio,h=a.elParent,d=s.group({class:"apexcharts-series-markers apexcharts-series-".concat(i.config.chart.type)});if(d.attr("clip-path","url(#gridRectMarkerMask".concat(i.globals.cuid,")")),Array.isArray(o.x))for(var u=0;u<o.x.length;u++){var g=t+1,p=!0;t===0&&u===0&&(g=0),t===0&&u===1&&(g=1);var f=i.globals.markers.size[r];if(l!==1/0){var m=i.config.plotOptions.bubble;f=i.globals.seriesZ[r][g],m.zScaling&&(f/=l),m.minBubbleRadius&&f<m.minBubbleRadius&&(f=m.minBubbleRadius),m.maxBubbleRadius&&f>m.maxBubbleRadius&&(f=m.maxBubbleRadius)}var x=o.x[u],b=o.y[u];if(f=f||0,b!==null&&i.globals.series[r][g]!==void 0||(p=!1),p){var v=this.drawPoint(x,b,f,r,g,t);d.add(v)}h.add(d)}}},{key:"drawPoint",value:function(e,t,a,i,s,r){var o=this.w,l=i,h=new Ot(this.ctx),d=new Ie(this.ctx),u=new lt(this.ctx),g=new Ut(this.ctx),p=new O(this.ctx),f=g.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:l,dataPointIndex:s,radius:o.config.chart.type==="bubble"||o.globals.comboCharts&&o.config.series[i]&&o.config.series[i].type==="bubble"?a:null}),m=u.fillPath({seriesNumber:i,dataPointIndex:s,color:f.pointFillColor,patternUnits:"objectBoundingBox",value:o.globals.series[i][r]}),x=p.drawMarker(e,t,f);if(o.config.series[l].data[s]&&o.config.series[l].data[s].fillColor&&(m=o.config.series[l].data[s].fillColor),x.attr({fill:m}),o.config.chart.dropShadow.enabled){var b=o.config.chart.dropShadow;d.dropShadow(x,b,i)}if(!this.initialAnim||o.globals.dataChanged||o.globals.resized)o.globals.animationEnded=!0;else{var v=o.config.chart.animations.speed;h.animateMarker(x,v,o.globals.easing,function(){window.setTimeout(function(){h.animationCompleted(x)},100)})}return x.attr({rel:s,j:s,index:i,"default-marker-size":f.pSize}),d.setSelectionFilter(x,i,s),g.addEvents(x),x.node.classList.add("apexcharts-marker"),x}},{key:"centerTextInBubble",value:function(e){var t=this.w;return{y:e+=parseInt(t.config.dataLabels.style.fontSize,10)/4}}}]),n}(),qt=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"dataLabelsCorrection",value:function(e,t,a,i,s,r,o){var l=this.w,h=!1,d=new O(this.ctx).getTextRects(a,o),u=d.width,g=d.height;t<0&&(t=0),t>l.globals.gridHeight+g&&(t=l.globals.gridHeight+g/2),l.globals.dataLabelsRects[i]===void 0&&(l.globals.dataLabelsRects[i]=[]),l.globals.dataLabelsRects[i].push({x:e,y:t,width:u,height:g});var p=l.globals.dataLabelsRects[i].length-2,f=l.globals.lastDrawnDataLabelsIndexes[i]!==void 0?l.globals.lastDrawnDataLabelsIndexes[i][l.globals.lastDrawnDataLabelsIndexes[i].length-1]:0;if(l.globals.dataLabelsRects[i][p]!==void 0){var m=l.globals.dataLabelsRects[i][f];(e>m.x+m.width||t>m.y+m.height||t+g<m.y||e+u<m.x)&&(h=!0)}return(s===0||r)&&(h=!0),{x:e,y:t,textRects:d,drawnextLabel:h}}},{key:"drawDataLabel",value:function(e){var t=this,a=e.type,i=e.pos,s=e.i,r=e.j,o=e.isRangeStart,l=e.strokeWidth,h=l===void 0?2:l,d=this.w,u=new O(this.ctx),g=d.config.dataLabels,p=0,f=0,m=r,x=null;if(d.globals.collapsedSeriesIndices.indexOf(s)!==-1||!g.enabled||!Array.isArray(i.x))return x;x=u.group({class:"apexcharts-data-labels"});for(var b=0;b<i.x.length;b++)if(p=i.x[b]+g.offsetX,f=i.y[b]+g.offsetY+h,!isNaN(p)){r===1&&b===0&&(m=0),r===1&&b===1&&(m=1);var v=d.globals.series[s][m];a==="rangeArea"&&(v=o?d.globals.seriesRangeStart[s][m]:d.globals.seriesRangeEnd[s][m]);var w="",k=function(E){return d.config.dataLabels.formatter(E,{ctx:t.ctx,seriesIndex:s,dataPointIndex:m,w:d})};d.config.chart.type==="bubble"?(w=k(v=d.globals.seriesZ[s][m]),f=i.y[b],f=new sr(this.ctx).centerTextInBubble(f,s,m).y):v!==void 0&&(w=k(v));var y=d.config.dataLabels.textAnchor;d.globals.isSlopeChart&&(y=m===0?"end":m===d.config.series[s].data.length-1?"start":"middle"),this.plotDataLabelsText({x:p,y:f,text:w,i:s,j:m,parent:x,offsetCorrection:!0,dataLabelsConfig:d.config.dataLabels,textAnchor:y})}return x}},{key:"plotDataLabelsText",value:function(e){var t=this.w,a=new O(this.ctx),i=e.x,s=e.y,r=e.i,o=e.j,l=e.text,h=e.textAnchor,d=e.fontSize,u=e.parent,g=e.dataLabelsConfig,p=e.color,f=e.alwaysDrawDataLabel,m=e.offsetCorrection,x=e.className,b=null;if(Array.isArray(t.config.dataLabels.enabledOnSeries)&&t.config.dataLabels.enabledOnSeries.indexOf(r)<0)return b;var v={x:i,y:s,drawnextLabel:!0,textRects:null};m&&(v=this.dataLabelsCorrection(i,s,l,r,o,f,parseInt(g.style.fontSize,10))),t.globals.zoomed||(i=v.x,s=v.y),v.textRects&&(i<-20-v.textRects.width||i>t.globals.gridWidth+v.textRects.width+30)&&(l="");var w=t.globals.dataLabels.style.colors[r];((t.config.chart.type==="bar"||t.config.chart.type==="rangeBar")&&t.config.plotOptions.bar.distributed||t.config.dataLabels.distributed)&&(w=t.globals.dataLabels.style.colors[o]),typeof w=="function"&&(w=w({series:t.globals.series,seriesIndex:r,dataPointIndex:o,w:t})),p&&(w=p);var k=g.offsetX,y=g.offsetY;if(t.config.chart.type!=="bar"&&t.config.chart.type!=="rangeBar"||(k=0,y=0),t.globals.isSlopeChart&&(o!==0&&(k=-2*g.offsetX+5),o!==0&&o!==t.config.series[r].data.length-1&&(k=0)),v.drawnextLabel){if((b=a.drawText({width:100,height:parseInt(g.style.fontSize,10),x:i+k,y:s+y,foreColor:w,textAnchor:h||g.textAnchor,text:l,fontSize:d||g.style.fontSize,fontFamily:g.style.fontFamily,fontWeight:g.style.fontWeight||"normal"})).attr({class:x||"apexcharts-datalabel",cx:i,cy:s}),g.dropShadow.enabled){var E=g.dropShadow;new Ie(this.ctx).dropShadow(b,E)}u.add(b),t.globals.lastDrawnDataLabelsIndexes[r]===void 0&&(t.globals.lastDrawnDataLabelsIndexes[r]=[]),t.globals.lastDrawnDataLabelsIndexes[r].push(o)}return b}},{key:"addBackgroundToDataLabel",value:function(e,t){var a=this.w,i=a.config.dataLabels.background,s=i.padding,r=i.padding/2,o=t.width,l=t.height,h=new O(this.ctx).drawRect(t.x-s,t.y-r/2,o+2*s,l+r,i.borderRadius,a.config.chart.background!=="transparent"&&a.config.chart.background?a.config.chart.background:"#fff",i.opacity,i.borderWidth,i.borderColor);return i.dropShadow.enabled&&new Ie(this.ctx).dropShadow(h,i.dropShadow),h}},{key:"dataLabelsBackground",value:function(){var e=this.w;if(e.config.chart.type!=="bubble")for(var t=e.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),a=0;a<t.length;a++){var i=t[a],s=i.getBBox(),r=null;if(s.width&&s.height&&(r=this.addBackgroundToDataLabel(i,s)),r){i.parentNode.insertBefore(r.node,i);var o=e.config.dataLabels.background.backgroundColor||i.getAttribute("fill");e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged?r.animate().attr({fill:o}):r.attr({fill:o}),i.setAttribute("fill",e.config.dataLabels.background.foreColor)}}}},{key:"bringForward",value:function(){for(var e=this.w,t=e.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),a=e.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child"),i=0;i<t.length;i++)a&&a.insertBefore(t[i],a.nextSibling)}}]),n}(),et=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.legendInactiveClass="legend-mouseover-inactive"}return Z(n,[{key:"getAllSeriesEls",value:function(){return this.w.globals.dom.baseEl.getElementsByClassName("apexcharts-series")}},{key:"getSeriesByName",value:function(e){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner .apexcharts-series[seriesName='".concat(R.escapeString(e),"']"))}},{key:"isSeriesHidden",value:function(e){var t=this.getSeriesByName(e),a=parseInt(t.getAttribute("data:realIndex"),10);return{isHidden:t.classList.contains("apexcharts-series-collapsed"),realIndex:a}}},{key:"addCollapsedClassToSeries",value:function(e,t){var a=this.w;function i(s){for(var r=0;r<s.length;r++)s[r].index===t&&e.node.classList.add("apexcharts-series-collapsed")}i(a.globals.collapsedSeries),i(a.globals.ancillaryCollapsedSeries)}},{key:"toggleSeries",value:function(e){var t=this.isSeriesHidden(e);return this.ctx.legend.legendHelpers.toggleDataSeries(t.realIndex,t.isHidden),t.isHidden}},{key:"showSeries",value:function(e){var t=this.isSeriesHidden(e);t.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(t.realIndex,!0)}},{key:"hideSeries",value:function(e){var t=this.isSeriesHidden(e);t.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(t.realIndex,!1)}},{key:"resetSeries",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],a=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],i=this.w,s=R.clone(i.globals.initialSeries);i.globals.previousPaths=[],a?(i.globals.collapsedSeries=[],i.globals.ancillaryCollapsedSeries=[],i.globals.collapsedSeriesIndices=[],i.globals.ancillaryCollapsedSeriesIndices=[]):s=this.emptyCollapsedSeries(s),i.config.series=s,e&&(t&&(i.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(e){for(var t=this.w,a=0;a<e.length;a++)t.globals.collapsedSeriesIndices.indexOf(a)>-1&&(e[a].data=[]);return e}},{key:"highlightSeries",value:function(e){var t=this.w,a=this.getSeriesByName(e),i=parseInt(a==null?void 0:a.getAttribute("data:realIndex"),10),s=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),r=null,o=null,l=null;if(t.globals.axisCharts||t.config.chart.type==="radialBar")if(t.globals.axisCharts){r=t.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(i,"']")),o=t.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(i,"']"));var h=t.globals.seriesYAxisReverseMap[i];l=t.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(h,"']"))}else r=t.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(i+1,"']"));else r=t.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(i+1,"'] path"));for(var d=0;d<s.length;d++)s[d].classList.add(this.legendInactiveClass);if(r)t.globals.axisCharts||r.parentNode.classList.remove(this.legendInactiveClass),r.classList.remove(this.legendInactiveClass),o!==null&&o.classList.remove(this.legendInactiveClass),l!==null&&l.classList.remove(this.legendInactiveClass);else for(var u=0;u<s.length;u++)s[u].classList.remove(this.legendInactiveClass)}},{key:"toggleSeriesOnHover",value:function(e,t){var a=this.w;t||(t=e.target);var i=a.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if(e.type==="mousemove"){var s=parseInt(t.getAttribute("rel"),10)-1;this.highlightSeries(a.globals.seriesNames[s])}else if(e.type==="mouseout")for(var r=0;r<i.length;r++)i[r].classList.remove(this.legendInactiveClass)}},{key:"highlightRangeInSeries",value:function(e,t){var a=this,i=this.w,s=i.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),r=function(h){for(var d=0;d<s.length;d++)s[d].classList[h](a.legendInactiveClass)};if(e.type==="mousemove"){var o=parseInt(t.getAttribute("rel"),10)-1;r("add");var l=i.config.plotOptions.heatmap.colorScale.ranges;(function(h,d){for(var u=0;u<s.length;u++){var g=Number(s[u].getAttribute("val"));g>=h.from&&(g<h.to||h.to===d&&g===d)&&s[u].classList.remove(a.legendInactiveClass)}})(l[o],l.reduce(function(h,d){return Math.max(h,d.to)},0))}else e.type==="mouseout"&&r("remove")}},{key:"getActiveConfigSeriesIndex",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"asc",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=this.w,i=0;if(a.config.series.length>1){for(var s=a.config.series.map(function(o,l){return o.data&&o.data.length>0&&a.globals.collapsedSeriesIndices.indexOf(l)===-1&&(!a.globals.comboCharts||t.length===0||t.length&&t.indexOf(a.config.series[l].type)>-1)?l:-1}),r=e==="asc"?0:s.length-1;e==="asc"?r<s.length:r>=0;e==="asc"?r++:r--)if(s[r]!==-1){i=s[r];break}}return i}},{key:"getBarSeriesIndices",value:function(){return this.w.globals.comboCharts?this.w.config.series.map(function(e,t){return e.type==="bar"||e.type==="column"?t:-1}).filter(function(e){return e!==-1}):this.w.config.series.map(function(e,t){return t})}},{key:"getPreviousPaths",value:function(){var e=this.w;function t(r,o,l){for(var h=r[o].childNodes,d={type:l,paths:[],realIndex:r[o].getAttribute("data:realIndex")},u=0;u<h.length;u++)if(h[u].hasAttribute("pathTo")){var g=h[u].getAttribute("pathTo");d.paths.push({d:g})}e.globals.previousPaths.push(d)}e.globals.previousPaths=[],["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(function(r){for(var o,l=(o=r,e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(o,"-series .apexcharts-series"))),h=0;h<l.length;h++)t(l,h,r)});var a=e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(e.config.chart.type," .apexcharts-series"));if(a.length>0)for(var i=function(r){for(var o=e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(e.config.chart.type," .apexcharts-series[data\\:realIndex='").concat(r,"'] rect")),l=[],h=function(u){var g=function(f){return o[u].getAttribute(f)},p={x:parseFloat(g("x")),y:parseFloat(g("y")),width:parseFloat(g("width")),height:parseFloat(g("height"))};l.push({rect:p,color:o[u].getAttribute("color")})},d=0;d<o.length;d++)h(d);e.globals.previousPaths.push(l)},s=0;s<a.length;s++)i(s);e.globals.axisCharts||(e.globals.previousPaths=e.globals.series)}},{key:"clearPreviousPaths",value:function(){var e=this.w;e.globals.previousPaths=[],e.globals.allSeriesCollapsed=!1}},{key:"handleNoData",value:function(){var e=this.w,t=e.config.noData,a=new O(this.ctx),i=e.globals.svgWidth/2,s=e.globals.svgHeight/2,r="middle";if(e.globals.noData=!0,e.globals.animationEnded=!0,t.align==="left"?(i=10,r="start"):t.align==="right"&&(i=e.globals.svgWidth-10,r="end"),t.verticalAlign==="top"?s=50:t.verticalAlign==="bottom"&&(s=e.globals.svgHeight-50),i+=t.offsetX,s=s+parseInt(t.style.fontSize,10)+2+t.offsetY,t.text!==void 0&&t.text!==""){var o=a.drawText({x:i,y:s,text:t.text,textAnchor:r,fontSize:t.style.fontSize,fontFamily:t.style.fontFamily,foreColor:t.style.color,opacity:1,class:"apexcharts-text-nodata"});e.globals.dom.Paper.add(o)}}},{key:"setNullSeriesToZeroValues",value:function(e){for(var t=this.w,a=0;a<e.length;a++)if(e[a].length===0)for(var i=0;i<e[t.globals.maxValsInArrayIndex].length;i++)e[a].push(0);return e}},{key:"hasAllSeriesEqualX",value:function(){for(var e=!0,t=this.w,a=this.filteredSeriesX(),i=0;i<a.length-1;i++)if(a[i][0]!==a[i+1][0]){e=!1;break}return t.globals.allSeriesHasEqualX=e,e}},{key:"filteredSeriesX",value:function(){var e=this.w.globals.seriesX.map(function(t){return t.length>0?t:[]});return e}}]),n}(),Pi=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new Le(this.ctx)}return Z(n,[{key:"isMultiFormat",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:"isFormatXY",value:function(){var e=this.w.config.series.slice(),t=new et(this.ctx);if(this.activeSeriesIndex=t.getActiveConfigSeriesIndex(),e[this.activeSeriesIndex].data!==void 0&&e[this.activeSeriesIndex].data.length>0&&e[this.activeSeriesIndex].data[0]!==null&&e[this.activeSeriesIndex].data[0].x!==void 0&&e[this.activeSeriesIndex].data[0]!==null)return!0}},{key:"isFormat2DArray",value:function(){var e=this.w.config.series.slice(),t=new et(this.ctx);if(this.activeSeriesIndex=t.getActiveConfigSeriesIndex(),e[this.activeSeriesIndex].data!==void 0&&e[this.activeSeriesIndex].data.length>0&&e[this.activeSeriesIndex].data[0]!==void 0&&e[this.activeSeriesIndex].data[0]!==null&&e[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(e,t){for(var a=this.w.config,i=this.w.globals,s=a.chart.type==="boxPlot"||a.series[t].type==="boxPlot",r=0;r<e[t].data.length;r++)if(e[t].data[r][1]!==void 0&&(Array.isArray(e[t].data[r][1])&&e[t].data[r][1].length===4&&!s?this.twoDSeries.push(R.parseNumber(e[t].data[r][1][3])):e[t].data[r].length>=5?this.twoDSeries.push(R.parseNumber(e[t].data[r][4])):this.twoDSeries.push(R.parseNumber(e[t].data[r][1])),i.dataFormatXNumeric=!0),a.xaxis.type==="datetime"){var o=new Date(e[t].data[r][0]);o=new Date(o).getTime(),this.twoDSeriesX.push(o)}else this.twoDSeriesX.push(e[t].data[r][0]);for(var l=0;l<e[t].data.length;l++)e[t].data[l][2]!==void 0&&(this.threeDSeries.push(e[t].data[l][2]),i.isDataXYZ=!0)}},{key:"handleFormatXY",value:function(e,t){var a=this.w.config,i=this.w.globals,s=new He(this.ctx),r=t;i.collapsedSeriesIndices.indexOf(t)>-1&&(r=this.activeSeriesIndex);for(var o=0;o<e[t].data.length;o++)e[t].data[o].y!==void 0&&(Array.isArray(e[t].data[o].y)?this.twoDSeries.push(R.parseNumber(e[t].data[o].y[e[t].data[o].y.length-1])):this.twoDSeries.push(R.parseNumber(e[t].data[o].y))),e[t].data[o].goals!==void 0&&Array.isArray(e[t].data[o].goals)?(this.seriesGoals[t]===void 0&&(this.seriesGoals[t]=[]),this.seriesGoals[t].push(e[t].data[o].goals)):(this.seriesGoals[t]===void 0&&(this.seriesGoals[t]=[]),this.seriesGoals[t].push(null));for(var l=0;l<e[r].data.length;l++){var h=typeof e[r].data[l].x=="string",d=Array.isArray(e[r].data[l].x),u=!d&&!!s.isValidDate(e[r].data[l].x);if(h||u)if(h||a.xaxis.convertedCatToNumeric){var g=i.isBarHorizontal&&i.isRangeData;a.xaxis.type!=="datetime"||g?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e[r].data[l].x),isNaN(e[r].data[l].x)||this.w.config.xaxis.type==="category"||typeof e[r].data[l].x=="string"||(i.isXNumeric=!0)):this.twoDSeriesX.push(s.parseDate(e[r].data[l].x))}else a.xaxis.type==="datetime"?this.twoDSeriesX.push(s.parseDate(e[r].data[l].x.toString())):(i.dataFormatXNumeric=!0,i.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(e[r].data[l].x)));else d?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e[r].data[l].x)):(i.isXNumeric=!0,i.dataFormatXNumeric=!0,this.twoDSeriesX.push(e[r].data[l].x))}if(e[t].data[0]&&e[t].data[0].z!==void 0){for(var p=0;p<e[t].data.length;p++)this.threeDSeries.push(e[t].data[p].z);i.isDataXYZ=!0}}},{key:"handleRangeData",value:function(e,t){var a=this.w.globals,i={};return this.isFormat2DArray()?i=this.handleRangeDataFormat("array",e,t):this.isFormatXY()&&(i=this.handleRangeDataFormat("xy",e,t)),a.seriesRangeStart[t]=i.start===void 0?[]:i.start,a.seriesRangeEnd[t]=i.end===void 0?[]:i.end,a.seriesRange[t]=i.rangeUniques,a.seriesRange.forEach(function(s,r){s&&s.forEach(function(o,l){o.y.forEach(function(h,d){for(var u=0;u<o.y.length;u++)if(d!==u){var g=h.y1,p=h.y2,f=o.y[u].y1;g<=o.y[u].y2&&f<=p&&(o.overlaps.indexOf(h.rangeName)<0&&o.overlaps.push(h.rangeName),o.overlaps.indexOf(o.y[u].rangeName)<0&&o.overlaps.push(o.y[u].rangeName))}})})}),i}},{key:"handleCandleStickBoxData",value:function(e,t){var a=this.w.globals,i={};return this.isFormat2DArray()?i=this.handleCandleStickBoxDataFormat("array",e,t):this.isFormatXY()&&(i=this.handleCandleStickBoxDataFormat("xy",e,t)),a.seriesCandleO[t]=i.o,a.seriesCandleH[t]=i.h,a.seriesCandleM[t]=i.m,a.seriesCandleL[t]=i.l,a.seriesCandleC[t]=i.c,i}},{key:"handleRangeDataFormat",value:function(e,t,a){var i=[],s=[],r=t[a].data.filter(function(d,u,g){return u===g.findIndex(function(p){return p.x===d.x})}).map(function(d,u){return{x:d.x,overlaps:[],y:[]}});if(e==="array")for(var o=0;o<t[a].data.length;o++)Array.isArray(t[a].data[o])?(i.push(t[a].data[o][1][0]),s.push(t[a].data[o][1][1])):(i.push(t[a].data[o]),s.push(t[a].data[o]));else if(e==="xy")for(var l=function(d){var u=Array.isArray(t[a].data[d].y),g=R.randomId(),p=t[a].data[d].x,f={y1:u?t[a].data[d].y[0]:t[a].data[d].y,y2:u?t[a].data[d].y[1]:t[a].data[d].y,rangeName:g};t[a].data[d].rangeName=g;var m=r.findIndex(function(x){return x.x===p});r[m].y.push(f),i.push(f.y1),s.push(f.y2)},h=0;h<t[a].data.length;h++)l(h);return{start:i,end:s,rangeUniques:r}}},{key:"handleCandleStickBoxDataFormat",value:function(e,t,a){var i=this.w,s=i.config.chart.type==="boxPlot"||i.config.series[a].type==="boxPlot",r=[],o=[],l=[],h=[],d=[];if(e==="array")if(s&&t[a].data[0].length===6||!s&&t[a].data[0].length===5)for(var u=0;u<t[a].data.length;u++)r.push(t[a].data[u][1]),o.push(t[a].data[u][2]),s?(l.push(t[a].data[u][3]),h.push(t[a].data[u][4]),d.push(t[a].data[u][5])):(h.push(t[a].data[u][3]),d.push(t[a].data[u][4]));else for(var g=0;g<t[a].data.length;g++)Array.isArray(t[a].data[g][1])&&(r.push(t[a].data[g][1][0]),o.push(t[a].data[g][1][1]),s?(l.push(t[a].data[g][1][2]),h.push(t[a].data[g][1][3]),d.push(t[a].data[g][1][4])):(h.push(t[a].data[g][1][2]),d.push(t[a].data[g][1][3])));else if(e==="xy")for(var p=0;p<t[a].data.length;p++)Array.isArray(t[a].data[p].y)&&(r.push(t[a].data[p].y[0]),o.push(t[a].data[p].y[1]),s?(l.push(t[a].data[p].y[2]),h.push(t[a].data[p].y[3]),d.push(t[a].data[p].y[4])):(h.push(t[a].data[p].y[2]),d.push(t[a].data[p].y[3])));return{o:r,h:o,m:l,l:h,c:d}}},{key:"parseDataAxisCharts",value:function(e){var t=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.ctx,i=this.w.config,s=this.w.globals,r=new He(a),o=i.labels.length>0?i.labels.slice():i.xaxis.categories.slice();s.isRangeBar=i.chart.type==="rangeBar"&&s.isBarHorizontal,s.hasXaxisGroups=i.xaxis.type==="category"&&i.xaxis.group.groups.length>0,s.hasXaxisGroups&&(s.groups=i.xaxis.group.groups),e.forEach(function(p,f){p.name!==void 0?s.seriesNames.push(p.name):s.seriesNames.push("series-"+parseInt(f+1,10))}),this.coreUtils.setSeriesYAxisMappings();var l=[],h=Pe(new Set(i.series.map(function(p){return p.group})));i.series.forEach(function(p,f){var m=h.indexOf(p.group);l[m]||(l[m]=[]),l[m].push(s.seriesNames[f])}),s.seriesGroups=l;for(var d=function(){for(var p=0;p<o.length;p++)if(typeof o[p]=="string"){if(!r.isValidDate(o[p]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");t.twoDSeriesX.push(r.parseDate(o[p]))}else t.twoDSeriesX.push(o[p])},u=0;u<e.length;u++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],e[u].data===void 0)return void console.error("It is a possibility that you may have not included 'data' property in series.");if(i.chart.type!=="rangeBar"&&i.chart.type!=="rangeArea"&&e[u].type!=="rangeBar"&&e[u].type!=="rangeArea"||(s.isRangeData=!0,this.handleRangeData(e,u)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(e,u):this.isFormatXY()&&this.handleFormatXY(e,u),i.chart.type!=="candlestick"&&e[u].type!=="candlestick"&&i.chart.type!=="boxPlot"&&e[u].type!=="boxPlot"||this.handleCandleStickBoxData(e,u),s.series.push(this.twoDSeries),s.labels.push(this.twoDSeriesX),s.seriesX.push(this.twoDSeriesX),s.seriesGoals=this.seriesGoals,u!==this.activeSeriesIndex||this.fallbackToCategory||(s.isXNumeric=!0);else{i.xaxis.type==="datetime"?(s.isXNumeric=!0,d(),s.seriesX.push(this.twoDSeriesX)):i.xaxis.type==="numeric"&&(s.isXNumeric=!0,o.length>0&&(this.twoDSeriesX=o,s.seriesX.push(this.twoDSeriesX))),s.labels.push(this.twoDSeriesX);var g=e[u].data.map(function(p){return R.parseNumber(p)});s.series.push(g)}s.seriesZ.push(this.threeDSeries),e[u].color!==void 0?s.seriesColors.push(e[u].color):s.seriesColors.push(void 0)}return this.w}},{key:"parseDataNonAxisCharts",value:function(e){var t=this.w.globals,a=this.w.config;t.series=e.slice(),t.seriesNames=a.labels.slice();for(var i=0;i<t.series.length;i++)t.seriesNames[i]===void 0&&t.seriesNames.push("series-"+(i+1));return this.w}},{key:"handleExternalLabelsData",value:function(e){var t=this.w.config,a=this.w.globals;t.xaxis.categories.length>0?a.labels=t.xaxis.categories:t.labels.length>0?a.labels=t.labels.slice():this.fallbackToCategory?(a.labels=a.labels[0],a.seriesRange.length&&(a.seriesRange.map(function(i){i.forEach(function(s){a.labels.indexOf(s.x)<0&&s.x&&a.labels.push(s.x)})}),a.labels=Array.from(new Set(a.labels.map(JSON.stringify)),JSON.parse)),t.xaxis.convertedCatToNumeric&&(new pa(t).convertCatToNumericXaxis(t,this.ctx,a.seriesX[0]),this._generateExternalLabels(e))):this._generateExternalLabels(e)}},{key:"_generateExternalLabels",value:function(e){var t=this.w.globals,a=this.w.config,i=[];if(t.axisCharts){if(t.series.length>0)if(this.isFormatXY())for(var s=a.series.map(function(u,g){return u.data.filter(function(p,f,m){return m.findIndex(function(x){return x.x===p.x})===f})}),r=s.reduce(function(u,g,p,f){return f[u].length>g.length?u:p},0),o=0;o<s[r].length;o++)i.push(o+1);else for(var l=0;l<t.series[t.maxValsInArrayIndex].length;l++)i.push(l+1);t.seriesX=[];for(var h=0;h<e.length;h++)t.seriesX.push(i);this.w.globals.isBarHorizontal||(t.isXNumeric=!0)}if(i.length===0){i=t.axisCharts?[]:t.series.map(function(u,g){return g+1});for(var d=0;d<e.length;d++)t.seriesX.push(i)}t.labels=i,a.xaxis.convertedCatToNumeric&&(t.categoryLabels=i.map(function(u){return a.xaxis.labels.formatter(u)})),t.noLabelsProvided=!0}},{key:"parseData",value:function(e){var t=this.w,a=t.config,i=t.globals;if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),i.axisCharts?(this.parseDataAxisCharts(e),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(e),a.chart.stacked){var s=new et(this.ctx);i.series=s.setNullSeriesToZeroValues(i.series)}this.coreUtils.getSeriesTotals(),i.axisCharts&&(i.stackedSeriesTotals=this.coreUtils.getStackedSeriesTotals(),i.stackedSeriesTotalsByGroups=this.coreUtils.getStackedSeriesTotalsByGroups()),this.coreUtils.getPercentSeries(),i.dataFormatXNumeric||i.isXNumeric&&(a.xaxis.type!=="numeric"||a.labels.length!==0||a.xaxis.categories.length!==0)||this.handleExternalLabelsData(e);for(var r=this.coreUtils.getCategoryLabels(i.labels),o=0;o<r.length;o++)if(Array.isArray(r[o])){i.isMultiLineX=!0;break}}},{key:"excludeCollapsedSeriesInYAxis",value:function(){var e=this.w,t=[];e.globals.seriesYAxisMap.forEach(function(a,i){var s=0;a.forEach(function(r){e.globals.collapsedSeriesIndices.indexOf(r)!==-1&&s++}),s>0&&s==a.length&&t.push(i)}),e.globals.ignoreYAxisIndexes=t.map(function(a){return a})}}]),n}(),ma=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"svgStringToNode",value:function(e){return new DOMParser().parseFromString(e,"image/svg+xml").documentElement}},{key:"scaleSvgNode",value:function(e,t){var a=parseFloat(e.getAttributeNS(null,"width")),i=parseFloat(e.getAttributeNS(null,"height"));e.setAttributeNS(null,"width",a*t),e.setAttributeNS(null,"height",i*t),e.setAttributeNS(null,"viewBox","0 0 "+a+" "+i)}},{key:"getSvgString",value:function(e){var t=this;return new Promise(function(a){var i=t.w,s=e||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;s||(s=1);var r=i.globals.svgWidth*s,o=i.globals.svgHeight*s,l=i.globals.dom.elWrap.cloneNode(!0);l.style.width=r+"px",l.style.height=o+"px";var h=new XMLSerializer().serializeToString(l),d=`
|
|
47
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
48
|
+
version="1.1"
|
|
49
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
50
|
+
class="apexcharts-svg"
|
|
51
|
+
xmlns:data="ApexChartsNS"
|
|
52
|
+
transform="translate(0, 0)"
|
|
53
|
+
width="`.concat(i.globals.svgWidth,'px" height="').concat(i.globals.svgHeight,`px">
|
|
54
|
+
<foreignObject width="100%" height="100%">
|
|
55
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="width:`).concat(r,"px; height:").concat(o,`px;">
|
|
56
|
+
<style type="text/css">
|
|
57
|
+
.apexcharts-tooltip, .apexcharts-toolbar, .apexcharts-xaxistooltip, .apexcharts-yaxistooltip, .apexcharts-xcrosshairs, .apexcharts-ycrosshairs, .apexcharts-zoom-rect, .apexcharts-selection-rect {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
61
|
+
`).concat(h,`
|
|
62
|
+
</div>
|
|
63
|
+
</foreignObject>
|
|
64
|
+
</svg>
|
|
65
|
+
`),u=t.svgStringToNode(d);s!==1&&t.scaleSvgNode(u,s),t.convertImagesToBase64(u).then(function(){d=new XMLSerializer().serializeToString(u),a(d.replace(/ /g," "))})})}},{key:"convertImagesToBase64",value:function(e){var t=this,a=e.getElementsByTagName("image"),i=Array.from(a).map(function(s){var r=s.getAttributeNS("http://www.w3.org/1999/xlink","href");return r&&!r.startsWith("data:")?t.getBase64FromUrl(r).then(function(o){s.setAttributeNS("http://www.w3.org/1999/xlink","href",o)}).catch(function(o){console.error("Error converting image to base64:",o)}):Promise.resolve()});return Promise.all(i)}},{key:"getBase64FromUrl",value:function(e){return new Promise(function(t,a){var i=new Image;i.crossOrigin="Anonymous",i.onload=function(){var s=document.createElement("canvas");s.width=i.width,s.height=i.height,s.getContext("2d").drawImage(i,0,0),t(s.toDataURL())},i.onerror=a,i.src=e})}},{key:"svgUrl",value:function(){var e=this;return new Promise(function(t){e.getSvgString().then(function(a){var i=new Blob([a],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}},{key:"dataURI",value:function(e){var t=this;return new Promise(function(a){var i=t.w,s=e?e.scale||e.width/i.globals.svgWidth:1,r=document.createElement("canvas");r.width=i.globals.svgWidth*s,r.height=parseInt(i.globals.dom.elWrap.style.height,10)*s;var o=i.config.chart.background!=="transparent"&&i.config.chart.background?i.config.chart.background:"#fff",l=r.getContext("2d");l.fillStyle=o,l.fillRect(0,0,r.width*s,r.height*s),t.getSvgString(s).then(function(h){var d="data:image/svg+xml,"+encodeURIComponent(h),u=new Image;u.crossOrigin="anonymous",u.onload=function(){if(l.drawImage(u,0,0),r.msToBlob){var g=r.msToBlob();a({blob:g})}else{var p=r.toDataURL("image/png");a({imgURI:p})}},u.src=d})})}},{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,a=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:a?{width:a}:void 0;this.dataURI(i).then(function(s){var r=s.imgURI,o=s.blob;o?navigator.msSaveOrOpenBlob(o,e.w.globals.chartID+".png"):e.triggerDownload(r,e.w.config.chart.toolbar.export.png.filename,".png")})}},{key:"exportToCSV",value:function(e){var t=this,a=e.series,i=e.fileName,s=e.columnDelimiter,r=s===void 0?",":s,o=e.lineDelimiter,l=o===void 0?`
|
|
66
|
+
`:o,h=this.w;a||(a=h.config.series);var d=[],u=[],g="",p=h.globals.series.map(function(y,E){return h.globals.collapsedSeriesIndices.indexOf(E)===-1?y:[]}),f=function(y){return typeof h.config.chart.toolbar.export.csv.categoryFormatter=="function"?h.config.chart.toolbar.export.csv.categoryFormatter(y):h.config.xaxis.type==="datetime"&&String(y).length>=10?new Date(y).toDateString():R.isNumber(y)?y:y.split(r).join("")},m=function(y){return typeof h.config.chart.toolbar.export.csv.valueFormatter=="function"?h.config.chart.toolbar.export.csv.valueFormatter(y):y},x=Math.max.apply(Math,Pe(a.map(function(y){return y.data?y.data.length:0}))),b=new Pi(this.ctx),v=new yt(this.ctx),w=function(y){var E="";if(h.globals.axisCharts){if(h.config.xaxis.type==="category"||h.config.xaxis.convertedCatToNumeric)if(h.globals.isBarHorizontal){var S=h.globals.yLabelFormatters[0],C=new et(t.ctx).getActiveConfigSeriesIndex();E=S(h.globals.labels[y],{seriesIndex:C,dataPointIndex:y,w:h})}else E=v.getLabel(h.globals.labels,h.globals.timescaleLabels,0,y).text;h.config.xaxis.type==="datetime"&&(h.config.xaxis.categories.length?E=h.config.xaxis.categories[y]:h.config.labels.length&&(E=h.config.labels[y]))}else E=h.config.labels[y];return E===null?"nullvalue":(Array.isArray(E)&&(E=E.join(" ")),R.isNumber(E)?E:E.split(r).join(""))},k=function(y,E){if(d.length&&E===0&&u.push(d.join(r)),y.data){y.data=y.data.length&&y.data||Pe(Array(x)).map(function(){return""});for(var S=0;S<y.data.length;S++){d=[];var C=w(S);if(C!=="nullvalue"){if(C||(b.isFormatXY()?C=a[E].data[S].x:b.isFormat2DArray()&&(C=a[E].data[S]?a[E].data[S][0]:"")),E===0){d.push(f(C));for(var N=0;N<h.globals.series.length;N++){var L,A=b.isFormatXY()?(L=a[N].data[S])===null||L===void 0?void 0:L.y:p[N][S];d.push(m(A))}}(h.config.chart.type==="candlestick"||y.type&&y.type==="candlestick")&&(d.pop(),d.push(h.globals.seriesCandleO[E][S]),d.push(h.globals.seriesCandleH[E][S]),d.push(h.globals.seriesCandleL[E][S]),d.push(h.globals.seriesCandleC[E][S])),(h.config.chart.type==="boxPlot"||y.type&&y.type==="boxPlot")&&(d.pop(),d.push(h.globals.seriesCandleO[E][S]),d.push(h.globals.seriesCandleH[E][S]),d.push(h.globals.seriesCandleM[E][S]),d.push(h.globals.seriesCandleL[E][S]),d.push(h.globals.seriesCandleC[E][S])),h.config.chart.type==="rangeBar"&&(d.pop(),d.push(h.globals.seriesRangeStart[E][S]),d.push(h.globals.seriesRangeEnd[E][S])),d.length&&u.push(d.join(r))}}}};d.push(h.config.chart.toolbar.export.csv.headerCategory),h.config.chart.type==="boxPlot"?(d.push("minimum"),d.push("q1"),d.push("median"),d.push("q3"),d.push("maximum")):h.config.chart.type==="candlestick"?(d.push("open"),d.push("high"),d.push("low"),d.push("close")):h.config.chart.type==="rangeBar"?(d.push("minimum"),d.push("maximum")):a.map(function(y,E){var S=(y.name?y.name:"series-".concat(E))+"";h.globals.axisCharts&&d.push(S.split(r).join("")?S.split(r).join(""):"series-".concat(E))}),h.globals.axisCharts||(d.push(h.config.chart.toolbar.export.csv.headerValue),u.push(d.join(r))),h.globals.allSeriesHasEqualX||!h.globals.axisCharts||h.config.xaxis.categories.length||h.config.labels.length?a.map(function(y,E){h.globals.axisCharts?k(y,E):((d=[]).push(f(h.globals.labels[E])),d.push(m(p[E])),u.push(d.join(r)))}):function(){var y=new Set,E={};a.forEach(function(S,C){S==null||S.data.forEach(function(N){var L,A;if(b.isFormatXY())L=N.x,A=N.y;else{if(!b.isFormat2DArray())return;L=N[0],A=N[1]}E[L]||(E[L]=Array(a.length).fill("")),E[L][C]=m(A),y.add(L)})}),d.length&&u.push(d.join(r)),Array.from(y).sort().forEach(function(S){u.push([f(S),E[S].join(r)])})}(),g+=u.join(l),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\uFEFF"+g),i||h.config.chart.toolbar.export.csv.filename,".csv")}},{key:"triggerDownload",value:function(e,t,a){var i=document.createElement("a");i.href=e,i.download=(t||this.w.globals.chartID)+a,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}]),n}(),xa=function(){function n(e,t){q(this,n),this.ctx=e,this.elgrid=t,this.w=e.w;var a=this.w;this.axesUtils=new yt(e),this.xaxisLabels=a.globals.labels.slice(),a.globals.timescaleLabels.length>0&&!a.globals.isBarHorizontal&&(this.xaxisLabels=a.globals.timescaleLabels.slice()),a.config.xaxis.overwriteCategories&&(this.xaxisLabels=a.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],a.config.xaxis.position==="top"?this.offY=0:this.offY=a.globals.gridHeight,this.offY=this.offY+a.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal=a.config.chart.type==="bar"&&a.config.plotOptions.bar.horizontal,this.xaxisFontSize=a.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=a.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=a.config.xaxis.labels.style.colors,this.xaxisBorderWidth=a.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=a.config.yaxis[0].axisBorder.width.toString()),this.xaxisBorderWidth.indexOf("%")>-1?this.xaxisBorderWidth=a.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=a.config.xaxis.axisBorder.height,this.yaxis=a.config.yaxis[0]}return Z(n,[{key:"drawXaxis",value:function(){var e=this.w,t=new O(this.ctx),a=t.group({class:"apexcharts-xaxis",transform:"translate(".concat(e.config.xaxis.offsetX,", ").concat(e.config.xaxis.offsetY,")")}),i=t.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(e.globals.translateXAxisX,", ").concat(e.globals.translateXAxisY,")")});a.add(i);for(var s=[],r=0;r<this.xaxisLabels.length;r++)s.push(this.xaxisLabels[r]);if(this.drawXAxisLabelAndGroup(!0,t,i,s,e.globals.isXNumeric,function(f,m){return m}),e.globals.hasXaxisGroups){var o=e.globals.groups;s=[];for(var l=0;l<o.length;l++)s.push(o[l].title);var h={};e.config.xaxis.group.style&&(h.xaxisFontSize=e.config.xaxis.group.style.fontSize,h.xaxisFontFamily=e.config.xaxis.group.style.fontFamily,h.xaxisForeColors=e.config.xaxis.group.style.colors,h.fontWeight=e.config.xaxis.group.style.fontWeight,h.cssClass=e.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,t,i,s,!1,function(f,m){return o[f].cols*m},h)}if(e.config.xaxis.title.text!==void 0){var d=t.group({class:"apexcharts-xaxis-title"}),u=t.drawText({x:e.globals.gridWidth/2+e.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+(e.config.xaxis.position==="bottom"?e.globals.xAxisLabelsHeight:-e.globals.xAxisLabelsHeight-10)+e.config.xaxis.title.offsetY,text:e.config.xaxis.title.text,textAnchor:"middle",fontSize:e.config.xaxis.title.style.fontSize,fontFamily:e.config.xaxis.title.style.fontFamily,fontWeight:e.config.xaxis.title.style.fontWeight,foreColor:e.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+e.config.xaxis.title.style.cssClass});d.add(u),a.add(d)}if(e.config.xaxis.axisBorder.show){var g=e.globals.barPadForNumericAxis,p=t.drawLine(e.globals.padHorizontal+e.config.xaxis.axisBorder.offsetX-g,this.offY,this.xaxisBorderWidth+g,this.offY,e.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(p):a.add(p)}return a}},{key:"drawXAxisLabelAndGroup",value:function(e,t,a,i,s,r){var o,l=this,h=arguments.length>6&&arguments[6]!==void 0?arguments[6]:{},d=[],u=[],g=this.w,p=h.xaxisFontSize||this.xaxisFontSize,f=h.xaxisFontFamily||this.xaxisFontFamily,m=h.xaxisForeColors||this.xaxisForeColors,x=h.fontWeight||g.config.xaxis.labels.style.fontWeight,b=h.cssClass||g.config.xaxis.labels.style.cssClass,v=g.globals.padHorizontal,w=i.length,k=g.config.xaxis.type==="category"?g.globals.dataPoints:w;if(k===0&&w>k&&(k=w),s){var y=Math.max(Number(g.config.xaxis.tickAmount)||1,k>1?k-1:k);o=g.globals.gridWidth/Math.min(y,w-1),v=v+r(0,o)/2+g.config.xaxis.labels.offsetX}else o=g.globals.gridWidth/k,v=v+r(0,o)+g.config.xaxis.labels.offsetX;for(var E=function(C){var N=v-r(C,o)/2+g.config.xaxis.labels.offsetX;C===0&&w===1&&o/2===v&&k===1&&(N=g.globals.gridWidth/2);var L=l.axesUtils.getLabel(i,g.globals.timescaleLabels,N,C,d,p,e),A=28;if(g.globals.rotateXLabels&&e&&(A=22),g.config.xaxis.title.text&&g.config.xaxis.position==="top"&&(A+=parseFloat(g.config.xaxis.title.style.fontSize)+2),e||(A=A+parseFloat(p)+(g.globals.xAxisLabelsHeight-g.globals.xAxisGroupLabelsHeight)+(g.globals.rotateXLabels?10:0)),L=g.config.xaxis.tickAmount!==void 0&&g.config.xaxis.tickAmount!=="dataPoints"&&g.config.xaxis.type!=="datetime"?l.axesUtils.checkLabelBasedOnTickamount(C,L,w):l.axesUtils.checkForOverflowingLabels(C,L,w,d,u),g.config.xaxis.labels.show){var M=t.drawText({x:L.x,y:l.offY+g.config.xaxis.labels.offsetY+A-(g.config.xaxis.position==="top"?g.globals.xAxisHeight+g.config.xaxis.axisTicks.height-2:0),text:L.text,textAnchor:"middle",fontWeight:L.isBold?600:x,fontSize:p,fontFamily:f,foreColor:Array.isArray(m)?e&&g.config.xaxis.convertedCatToNumeric?m[g.globals.minX+C-1]:m[C]:m,isPlainText:!1,cssClass:(e?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+b});if(a.add(M),M.on("click",function(z){if(typeof g.config.chart.events.xAxisLabelClick=="function"){var B=Object.assign({},g,{labelIndex:C});g.config.chart.events.xAxisLabelClick(z,l.ctx,B)}}),e){var F=document.createElementNS(g.globals.SVGNS,"title");F.textContent=Array.isArray(L.text)?L.text.join(" "):L.text,M.node.appendChild(F),L.text!==""&&(d.push(L.text),u.push(L))}}C<w-1&&(v+=r(C+1,o))},S=0;S<=w-1;S++)E(S)}},{key:"drawXaxisInversed",value:function(e){var t,a,i=this,s=this.w,r=new O(this.ctx),o=s.config.yaxis[0].opposite?s.globals.translateYAxisX[e]:0,l=r.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:e}),h=r.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+o+", 0)"});l.add(h);var d=[];if(s.config.yaxis[e].show)for(var u=0;u<this.xaxisLabels.length;u++)d.push(this.xaxisLabels[u]);t=s.globals.gridHeight/d.length,a=-t/2.2;var g=s.globals.yLabelFormatters[0],p=s.config.yaxis[0].labels;if(p.show)for(var f=function(y){var E=d[y]===void 0?"":d[y];E=g(E,{seriesIndex:e,dataPointIndex:y,w:s});var S=i.axesUtils.getYAxisForeColor(p.style.colors,e),C=0;Array.isArray(E)&&(C=E.length/2*parseInt(p.style.fontSize,10));var N=p.offsetX-15,L="end";i.yaxis.opposite&&(L="start"),s.config.yaxis[0].labels.align==="left"?(N=p.offsetX,L="start"):s.config.yaxis[0].labels.align==="center"?(N=p.offsetX,L="middle"):s.config.yaxis[0].labels.align==="right"&&(L="end");var A=r.drawText({x:N,y:a+t+p.offsetY-C,text:E,textAnchor:L,foreColor:Array.isArray(S)?S[y]:S,fontSize:p.style.fontSize,fontFamily:p.style.fontFamily,fontWeight:p.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+p.style.cssClass,maxWidth:p.maxWidth});h.add(A),A.on("click",function(z){if(typeof s.config.chart.events.xAxisLabelClick=="function"){var B=Object.assign({},s,{labelIndex:y});s.config.chart.events.xAxisLabelClick(z,i.ctx,B)}});var M=document.createElementNS(s.globals.SVGNS,"title");if(M.textContent=Array.isArray(E)?E.join(" "):E,A.node.appendChild(M),s.config.yaxis[e].labels.rotate!==0){var F=r.rotateAroundCenter(A.node);A.node.setAttribute("transform","rotate(".concat(s.config.yaxis[e].labels.rotate," 0 ").concat(F.y,")"))}a+=t},m=0;m<=d.length-1;m++)f(m);if(s.config.yaxis[0].title.text!==void 0){var x=r.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+o+", 0)"}),b=r.drawText({x:s.config.yaxis[0].title.offsetX,y:s.globals.gridHeight/2+s.config.yaxis[0].title.offsetY,text:s.config.yaxis[0].title.text,textAnchor:"middle",foreColor:s.config.yaxis[0].title.style.color,fontSize:s.config.yaxis[0].title.style.fontSize,fontWeight:s.config.yaxis[0].title.style.fontWeight,fontFamily:s.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+s.config.yaxis[0].title.style.cssClass});x.add(b),l.add(x)}var v=0;this.isCategoryBarHorizontal&&s.config.yaxis[0].opposite&&(v=s.globals.gridWidth);var w=s.config.xaxis.axisBorder;if(w.show){var k=r.drawLine(s.globals.padHorizontal+w.offsetX+v,1+w.offsetY,s.globals.padHorizontal+w.offsetX+v,s.globals.gridHeight+w.offsetY,w.color,0);this.elgrid&&this.elgrid.elGridBorders&&s.config.grid.show?this.elgrid.elGridBorders.add(k):l.add(k)}return s.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(v,d.length,s.config.yaxis[0].axisBorder,s.config.yaxis[0].axisTicks,0,t,l),l}},{key:"drawXaxisTicks",value:function(e,t,a){var i=this.w,s=e;if(!(e<0||e-2>i.globals.gridWidth)){var r=this.offY+i.config.xaxis.axisTicks.offsetY;if(t=t+r+i.config.xaxis.axisTicks.height,i.config.xaxis.position==="top"&&(t=r-i.config.xaxis.axisTicks.height),i.config.xaxis.axisTicks.show){var o=new O(this.ctx).drawLine(e+i.config.xaxis.axisTicks.offsetX,r+i.config.xaxis.offsetY,s+i.config.xaxis.axisTicks.offsetX,t+i.config.xaxis.offsetY,i.config.xaxis.axisTicks.color);a.add(o),o.node.classList.add("apexcharts-xaxis-tick")}}}},{key:"getXAxisTicksPositions",value:function(){var e=this.w,t=[],a=this.xaxisLabels.length,i=e.globals.padHorizontal;if(e.globals.timescaleLabels.length>0)for(var s=0;s<a;s++)i=this.xaxisLabels[s].position,t.push(i);else for(var r=a,o=0;o<r;o++){var l=r;e.globals.isXNumeric&&e.config.chart.type!=="bar"&&(l-=1),i+=e.globals.gridWidth/l,t.push(i)}return t}},{key:"xAxisLabelCorrections",value:function(){var e=this.w,t=new O(this.ctx),a=e.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),i=e.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),s=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),r=e.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(e.globals.rotateXLabels||e.config.xaxis.labels.rotateAlways)for(var o=0;o<i.length;o++){var l=t.rotateAroundCenter(i[o]);l.y=l.y-1,l.x=l.x+1,i[o].setAttribute("transform","rotate(".concat(e.config.xaxis.labels.rotate," ").concat(l.x," ").concat(l.y,")")),i[o].setAttribute("text-anchor","end"),a.setAttribute("transform","translate(0, ".concat(-10,")"));var h=i[o].childNodes;e.config.xaxis.labels.trim&&Array.prototype.forEach.call(h,function(p){t.placeTextWithEllipsis(p,p.textContent,e.globals.xAxisLabelsHeight-(e.config.legend.position==="bottom"?20:10))})}else(function(){for(var p=e.globals.gridWidth/(e.globals.labels.length+1),f=0;f<i.length;f++){var m=i[f].childNodes;e.config.xaxis.labels.trim&&e.config.xaxis.type!=="datetime"&&Array.prototype.forEach.call(m,function(x){t.placeTextWithEllipsis(x,x.textContent,p)})}})();if(s.length>0){var d=s[s.length-1].getBBox(),u=s[0].getBBox();d.x<-20&&s[s.length-1].parentNode.removeChild(s[s.length-1]),u.x+u.width>e.globals.gridWidth&&!e.globals.isBarHorizontal&&s[0].parentNode.removeChild(s[0]);for(var g=0;g<r.length;g++)t.placeTextWithEllipsis(r[g],r[g].textContent,e.config.yaxis[0].labels.maxWidth-(e.config.yaxis[0].title.text?2*parseFloat(e.config.yaxis[0].title.style.fontSize):0)-15)}}}]),n}(),rr=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w;var t=this.w;this.xaxisLabels=t.globals.labels.slice(),this.axesUtils=new yt(e),this.isRangeBar=t.globals.seriesRange.length&&t.globals.isBarHorizontal,t.globals.timescaleLabels.length>0&&(this.xaxisLabels=t.globals.timescaleLabels.slice())}return Z(n,[{key:"drawGridArea",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=this.w,a=new O(this.ctx);e||(e=a.group({class:"apexcharts-grid"}));var i=a.drawLine(t.globals.padHorizontal,1,t.globals.padHorizontal,t.globals.gridHeight,"transparent"),s=a.drawLine(t.globals.padHorizontal,t.globals.gridHeight,t.globals.gridWidth,t.globals.gridHeight,"transparent");return e.add(s),e.add(i),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,a=new O(this.ctx),i=Array.isArray(e.config.stroke.width)?Math.max.apply(Math,Pe(e.config.stroke.width)):e.config.stroke.width,s=function(d){var u=document.createElementNS(t.SVGNS,"clipPath");return u.setAttribute("id",d),u};t.dom.elGridRectMask=s("gridRectMask".concat(t.cuid)),t.dom.elGridRectBarMask=s("gridRectBarMask".concat(t.cuid)),t.dom.elGridRectMarkerMask=s("gridRectMarkerMask".concat(t.cuid)),t.dom.elForecastMask=s("forecastMask".concat(t.cuid)),t.dom.elNonForecastMask=s("nonForecastMask".concat(t.cuid));var r=0,o=0;(["bar","rangeBar","candlestick","boxPlot"].includes(e.config.chart.type)||e.globals.comboBarCount>0)&&e.globals.isXNumeric&&!e.globals.isBarHorizontal&&(r=Math.max(e.config.grid.padding.left,t.barPadForNumericAxis),o=Math.max(e.config.grid.padding.right,t.barPadForNumericAxis)),t.dom.elGridRect=a.drawRect(-i/2-2,-i/2-2,t.gridWidth+i+4,t.gridHeight+i+4,0,"#fff"),t.dom.elGridRectBar=a.drawRect(-i/2-r-2,-i/2-2,t.gridWidth+i+o+r+4,t.gridHeight+i+4,0,"#fff");var l=e.globals.markers.largestSize;t.dom.elGridRectMarker=a.drawRect(-l,-l,t.gridWidth+2*l,t.gridHeight+2*l,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 h=t.dom.baseEl.querySelector("defs");h.appendChild(t.dom.elGridRectMask),h.appendChild(t.dom.elGridRectBarMask),h.appendChild(t.dom.elGridRectMarkerMask),h.appendChild(t.dom.elForecastMask),h.appendChild(t.dom.elNonForecastMask)}},{key:"_drawGridLines",value:function(e){var t=e.i,a=e.x1,i=e.y1,s=e.x2,r=e.y2,o=e.xCount,l=e.parent,h=this.w;if(!(t===0&&h.globals.skipFirstTimelinelabel||t===o-1&&h.globals.skipLastTimelinelabel&&!h.config.xaxis.labels.formatter||h.config.chart.type==="radar")){h.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:a,y1:i,x2:s,y2:r,xCount:o,parent:l});var d=0;if(h.globals.hasXaxisGroups&&h.config.xaxis.tickPlacement==="between"){var u=h.globals.groups;if(u){for(var g=0,p=0;g<t&&p<u.length;p++)g+=u[p].cols;g===t&&(d=.6*h.globals.xAxisLabelsHeight)}}new xa(this.ctx).drawXaxisTicks(a,d,h.globals.dom.elGraphical)}}},{key:"_drawGridLine",value:function(e){var t=e.i,a=e.x1,i=e.y1,s=e.x2,r=e.y2,o=e.xCount,l=e.parent,h=this.w,d=l.node.classList.contains("apexcharts-gridlines-horizontal"),u=h.globals.barPadForNumericAxis,g=i===0&&r===0||a===0&&s===0||i===h.globals.gridHeight&&r===h.globals.gridHeight||h.globals.isBarHorizontal&&(t===0||t===o-1),p=new O(this).drawLine(a-(d?u:0),i,s+(d?u:0),r,h.config.grid.borderColor,h.config.grid.strokeDashArray);p.node.classList.add("apexcharts-gridline"),g&&h.config.grid.show?this.elGridBorders.add(p):l.add(p)}},{key:"_drawGridBandRect",value:function(e){var t=e.c,a=e.x1,i=e.y1,s=e.x2,r=e.y2,o=e.type,l=this.w,h=new O(this.ctx),d=l.globals.barPadForNumericAxis,u=l.config.grid[o].colors[t],g=h.drawRect(a-(o==="row"?d:0),i,s+(o==="row"?2*d:0),r,0,u,l.config.grid[o].opacity);this.elg.add(g),g.attr("clip-path","url(#gridRectMask".concat(l.globals.cuid,")")),g.node.classList.add("apexcharts-grid-".concat(o))}},{key:"_drawXYLines",value:function(e){var t=this,a=e.xCount,i=e.tickAmount,s=this.w;if(s.config.grid.xaxis.lines.show||s.config.xaxis.axisTicks.show){var r,o=s.globals.padHorizontal,l=s.globals.gridHeight;s.globals.timescaleLabels.length?function(f){for(var m=f.xC,x=f.x1,b=f.y1,v=f.x2,w=f.y2,k=0;k<m;k++)x=t.xaxisLabels[k].position,v=t.xaxisLabels[k].position,t._drawGridLines({i:k,x1:x,y1:b,x2:v,y2:w,xCount:a,parent:t.elgridLinesV})}({xC:a,x1:o,y1:0,x2:r,y2:l}):(s.globals.isXNumeric&&(a=s.globals.xAxisScale.result.length),function(f){for(var m=f.xC,x=f.x1,b=f.y1,v=f.x2,w=f.y2,k=0;k<m+(s.globals.isXNumeric?0:1);k++)k===0&&m===1&&s.globals.dataPoints===1&&(v=x=s.globals.gridWidth/2),t._drawGridLines({i:k,x1:x,y1:b,x2:v,y2:w,xCount:a,parent:t.elgridLinesV}),v=x+=s.globals.gridWidth/(s.globals.isXNumeric?m-1:m)}({xC:a,x1:o,y1:0,x2:r,y2:l}))}if(s.config.grid.yaxis.lines.show){var h=0,d=0,u=s.globals.gridWidth,g=i+1;this.isRangeBar&&(g=s.globals.labels.length);for(var p=0;p<g+(this.isRangeBar?1:0);p++)this._drawGridLine({i:p,xCount:g+(this.isRangeBar?1:0),x1:0,y1:h,x2:u,y2:d,parent:this.elgridLinesH}),d=h+=s.globals.gridHeight/(this.isRangeBar?g:i)}}},{key:"_drawInvertedXYLines",value:function(e){var t=e.xCount,a=this.w;if(a.config.grid.xaxis.lines.show||a.config.xaxis.axisTicks.show)for(var i,s=a.globals.padHorizontal,r=a.globals.gridHeight,o=0;o<t+1;o++)a.config.grid.xaxis.lines.show&&this._drawGridLine({i:o,xCount:t+1,x1:s,y1:0,x2:i,y2:r,parent:this.elgridLinesV}),new xa(this.ctx).drawXaxisTicks(s,0,a.globals.dom.elGraphical),i=s+=a.globals.gridWidth/t;if(a.config.grid.yaxis.lines.show)for(var l=0,h=0,d=a.globals.gridWidth,u=0;u<a.globals.dataPoints+1;u++)this._drawGridLine({i:u,xCount:a.globals.dataPoints+1,x1:0,y1:l,x2:d,y2:h,parent:this.elgridLinesH}),h=l+=a.globals.gridHeight/a.globals.dataPoints}},{key:"renderGrid",value:function(){var e=this.w,t=e.globals,a=new O(this.ctx);this.elg=a.group({class:"apexcharts-grid"}),this.elgridLinesH=a.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=a.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=a.group({class:"apexcharts-grid-borders"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),e.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide(),this.elGridBorders.hide());for(var i=0;i<t.seriesYAxisMap.length&&t.ignoreYAxisIndexes.includes(i);)i++;i===t.seriesYAxisMap.length&&(i=0);var s,r=t.yAxisScale[i].result.length-1;if(!t.isBarHorizontal||this.isRangeBar){var o,l,h;s=this.xaxisLabels.length,this.isRangeBar&&(r=t.labels.length,e.config.xaxis.tickAmount&&e.config.xaxis.labels.formatter&&(s=e.config.xaxis.tickAmount),((o=t.yAxisScale)===null||o===void 0||(l=o[i])===null||l===void 0||(h=l.result)===null||h===void 0?void 0:h.length)>0&&e.config.xaxis.type!=="datetime"&&(s=t.yAxisScale[i].result.length-1)),this._drawXYLines({xCount:s,tickAmount:r})}else s=r,r=t.xTickAmount,this._drawInvertedXYLines({xCount:s,tickAmount:r});return this.drawGridBands(s,r),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:t.gridWidth/s}}},{key:"drawGridBands",value:function(e,t){var a,i,s=this,r=this.w;if(((a=r.config.grid.row.colors)===null||a===void 0?void 0:a.length)>0&&function(f,m,x,b,v,w){for(var k=0,y=0;k<m;k++,y++)y>=r.config.grid[f].colors.length&&(y=0),s._drawGridBandRect({c:y,x1:x,y1:b,x2:v,y2:w,type:f}),b+=r.globals.gridHeight/t}("row",t,0,0,r.globals.gridWidth,r.globals.gridHeight/t),((i=r.config.grid.column.colors)===null||i===void 0?void 0:i.length)>0){var o=r.globals.isBarHorizontal||r.config.xaxis.tickPlacement!=="on"||r.config.xaxis.type!=="category"&&!r.config.xaxis.convertedCatToNumeric?e:e-1;r.globals.isXNumeric&&(o=r.globals.xAxisScale.result.length-1);for(var l=r.globals.padHorizontal,h=r.globals.padHorizontal+r.globals.gridWidth/o,d=r.globals.gridHeight,u=0,g=0;u<e;u++,g++){var p;g>=r.config.grid.column.colors.length&&(g=0),r.config.xaxis.type==="datetime"&&(l=this.xaxisLabels[u].position,h=(((p=this.xaxisLabels[u+1])===null||p===void 0?void 0:p.position)||r.globals.gridWidth)-this.xaxisLabels[u].position),this._drawGridBandRect({c:g,x1:l,y1:0,x2:h,y2:d,type:"column"}),l+=r.globals.gridWidth/o}}}}]),n}(),nr=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.coreUtils=new Le(this.ctx)}return Z(n,[{key:"niceScale",value:function(e,t){var a,i,s,r,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,l=1e-11,h=this.w,d=h.globals;d.isBarHorizontal?(a=h.config.xaxis,i=Math.max((d.svgWidth-100)/25,2)):(a=h.config.yaxis[o],i=Math.max((d.svgHeight-100)/15,2)),R.isNumber(i)||(i=10),s=a.min!==void 0&&a.min!==null,r=a.max!==void 0&&a.min!==null;var u=a.stepSize!==void 0&&a.stepSize!==null,g=a.tickAmount!==void 0&&a.tickAmount!==null,p=g?a.tickAmount:d.niceScaleDefaultTicks[Math.min(Math.round(i/2),d.niceScaleDefaultTicks.length-1)];if(d.isMultipleYAxis&&!g&&d.multiAxisTickAmount>0&&(p=d.multiAxisTickAmount,g=!0),p=p==="dataPoints"?d.dataPoints-1:Math.abs(Math.round(p)),(e===Number.MIN_VALUE&&t===0||!R.isNumber(e)&&!R.isNumber(t)||e===Number.MIN_VALUE&&t===-Number.MAX_VALUE)&&(e=R.isNumber(a.min)?a.min:0,t=R.isNumber(a.max)?a.max:e+p,d.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=e===0?0:e-1,t=t===0?2:t+1);var m=[];p<1&&(p=1);var x=p,b=Math.abs(t-e);!s&&e>0&&e/b<.15&&(e=0,s=!0),!r&&t<0&&-t/b<.15&&(t=0,r=!0);var v=(b=Math.abs(t-e))/x,w=v,k=Math.floor(Math.log10(w)),y=Math.pow(10,k),E=Math.ceil(w/y);if(v=w=(E=d.niceScaleAllowedMagMsd[d.yValueDecimal===0?0:1][E])*y,d.isBarHorizontal&&a.stepSize&&a.type!=="datetime"?(v=a.stepSize,u=!0):u&&(v=a.stepSize),u&&a.forceNiceScale){var S=Math.floor(Math.log10(v));v*=Math.pow(10,k-S)}if(s&&r){var C=b/x;if(g)if(u)if(R.mod(b,v)!=0){var N=R.getGCD(v,C);v=C/N<10?N:C}else R.mod(v,C)==0?v=C:(C=v,g=!1);else v=C;else if(u)R.mod(b,v)==0?C=v:v=C;else if(R.mod(b,v)==0)C=v;else{C=b/(x=Math.ceil(b/v));var L=R.getGCD(b,v);b/L<i&&(C=L),v=C}x=Math.round(b/v)}else{if(s||r){if(r)if(g)e=t-v*x;else{var A=e;e=v*Math.floor(e/v),Math.abs(t-e)/R.getGCD(b,v)>i&&(e=t-v*p,e+=v*Math.floor((A-e)/v))}else if(s)if(g)t=e+v*x;else{var M=t;t=v*Math.ceil(t/v),Math.abs(t-e)/R.getGCD(b,v)>i&&(t=e+v*p,t+=v*Math.ceil((M-t)/v))}}else if(d.isMultipleYAxis&&g){var F=v*Math.floor(e/v),z=F+v*x;z<t&&(v*=2),z=t,t=(e=F)+v*x,b=Math.abs(t-e),e>0&&e<Math.abs(z-t)&&(e=0,t=v*x),t<0&&-t<Math.abs(F-e)&&(t=0,e=-v*x)}else e=v*Math.floor(e/v),t=v*Math.ceil(t/v);b=Math.abs(t-e),v=R.getGCD(b,v),x=Math.round(b/v)}if(g||s||r||(x=Math.ceil((b-l)/(v+l)))>16&&R.getPrimeFactors(x).length<2&&x++,!g&&a.forceNiceScale&&d.yValueDecimal===0&&x>b&&(x=b,v=Math.round(b/x)),x>i&&(!g&&!u||a.forceNiceScale)){var B=R.getPrimeFactors(x),T=B.length-1,D=x;e:for(var I=0;I<T;I++)for(var Y=0;Y<=T-I;Y++){for(var $=Math.min(Y+I,T),K=D,ie=1,he=Y;he<=$;he++)ie*=B[he];if((K/=ie)<i){D=K;break e}}v=D===x?b:b/D,x=Math.round(b/v)}d.isMultipleYAxis&&d.multiAxisTickAmount==0&&d.ignoreYAxisIndexes.indexOf(o)<0&&(d.multiAxisTickAmount=x);var X=e-v,ge=v*l;do X+=v,m.push(R.stripNumber(X,7));while(t-X>ge);return{result:m,niceMin:m[0],niceMax:m[m.length-1]}}},{key:"linearScale",value:function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:void 0,r=Math.abs(t-e),o=[];if(e===t)return{result:o=[e],niceMin:o[0],niceMax:o[o.length-1]};(a=this._adjustTicksForSmallRange(a,i,r))==="dataPoints"&&(a=this.w.globals.dataPoints-1),s||(s=r/a),s=Math.round(100*(s+Number.EPSILON))/100,a===Number.MAX_VALUE&&(a=5,s=1);for(var l=e;a>=0;)o.push(l),l=R.preciseAddition(l,s),a-=1;return{result:o,niceMin:o[0],niceMax:o[o.length-1]}}},{key:"logarithmicScaleNice",value:function(e,t,a){t<=0&&(t=Math.max(e,a)),e<=0&&(e=Math.min(t,a));for(var i=[],s=Math.ceil(Math.log(t)/Math.log(a)+1),r=Math.floor(Math.log(e)/Math.log(a));r<s;r++)i.push(Math.pow(a,r));return{result:i,niceMin:i[0],niceMax:i[i.length-1]}}},{key:"logarithmicScale",value:function(e,t,a){t<=0&&(t=Math.max(e,a)),e<=0&&(e=Math.min(t,a));for(var i=[],s=Math.log(t)/Math.log(a),r=Math.log(e)/Math.log(a),o=s-r,l=Math.round(o),h=o/l,d=0,u=r;d<l;d++,u+=h)i.push(Math.pow(a,u));return i.push(Math.pow(a,s)),{result:i,niceMin:e,niceMax:t}}},{key:"_adjustTicksForSmallRange",value:function(e,t,a){var i=e;if(t!==void 0&&this.w.config.yaxis[t].labels.formatter&&this.w.config.yaxis[t].tickAmount===void 0){var s=Number(this.w.config.yaxis[t].labels.formatter(1));R.isNumber(s)&&this.w.globals.yValueDecimal===0&&(i=Math.ceil(a))}return i<e?i:e}},{key:"setYScaleForIndex",value:function(e,t,a){var i=this.w.globals,s=this.w.config,r=i.isBarHorizontal?s.xaxis:s.yaxis[e];i.yAxisScale[e]===void 0&&(i.yAxisScale[e]=[]);var o=Math.abs(a-t);r.logarithmic&&o<=5&&(i.invalidLogScale=!0),r.logarithmic&&o>5?(i.allSeriesCollapsed=!1,i.yAxisScale[e]=r.forceNiceScale?this.logarithmicScaleNice(t,a,r.logBase):this.logarithmicScale(t,a,r.logBase)):a!==-Number.MAX_VALUE&&R.isNumber(a)&&t!==Number.MAX_VALUE&&R.isNumber(t)?(i.allSeriesCollapsed=!1,i.yAxisScale[e]=this.niceScale(t,a,e)):i.yAxisScale[e]=this.niceScale(Number.MIN_VALUE,0,e)}},{key:"setXScale",value:function(e,t){var a=this.w,i=a.globals;if(t!==-Number.MAX_VALUE&&R.isNumber(t)){var s=i.xTickAmount;i.xAxisScale=this.linearScale(e,t,s,0,a.config.xaxis.stepSize)}else i.xAxisScale=this.linearScale(0,10,10);return i.xAxisScale}},{key:"scaleMultipleYAxes",value:function(){var e=this,t=this.w.config,a=this.w.globals;this.coreUtils.setSeriesYAxisMappings();var i=a.seriesYAxisMap,s=a.minYArr,r=a.maxYArr;a.allSeriesCollapsed=!0,a.barGroups=[],i.forEach(function(o,l){var h=[];o.forEach(function(d){var u,g=(u=t.series[d])===null||u===void 0?void 0:u.group;h.indexOf(g)<0&&h.push(g)}),o.length>0?function(){var d,u,g=Number.MAX_VALUE,p=-Number.MAX_VALUE,f=g,m=p;if(t.chart.stacked)(function(){var v=new Array(a.dataPoints).fill(0),w=[],k=[],y=[];h.forEach(function(){w.push(v.map(function(){return Number.MIN_VALUE})),k.push(v.map(function(){return Number.MIN_VALUE})),y.push(v.map(function(){return Number.MIN_VALUE}))});for(var E=function(C){!d&&t.series[o[C]].type&&(d=t.series[o[C]].type);var N=o[C];u=t.series[N].group?t.series[N].group:"axis-".concat(l),!(a.collapsedSeriesIndices.indexOf(N)<0&&a.ancillaryCollapsedSeriesIndices.indexOf(N)<0)||(a.allSeriesCollapsed=!1,h.forEach(function(L,A){if(t.series[N].group===L)for(var M=0;M<a.series[N].length;M++){var F=a.series[N][M];F>=0?k[A][M]+=F:y[A][M]+=F,w[A][M]+=F,f=Math.min(f,F),m=Math.max(m,F)}})),d!=="bar"&&d!=="column"||a.barGroups.push(u)},S=0;S<o.length;S++)E(S);d||(d=t.chart.type),d==="bar"||d==="column"?h.forEach(function(C,N){g=Math.min(g,Math.min.apply(null,y[N])),p=Math.max(p,Math.max.apply(null,k[N]))}):(h.forEach(function(C,N){f=Math.min(f,Math.min.apply(null,w[N])),m=Math.max(m,Math.max.apply(null,w[N]))}),g=f,p=m),g===Number.MIN_VALUE&&p===Number.MIN_VALUE&&(p=-Number.MAX_VALUE)})();else for(var x=0;x<o.length;x++){var b=o[x];g=Math.min(g,s[b]),p=Math.max(p,r[b]),!(a.collapsedSeriesIndices.indexOf(b)<0&&a.ancillaryCollapsedSeriesIndices.indexOf(b)<0)||(a.allSeriesCollapsed=!1)}t.yaxis[l].min!==void 0&&(g=typeof t.yaxis[l].min=="function"?t.yaxis[l].min(g):t.yaxis[l].min),t.yaxis[l].max!==void 0&&(p=typeof t.yaxis[l].max=="function"?t.yaxis[l].max(p):t.yaxis[l].max),a.barGroups=a.barGroups.filter(function(v,w,k){return k.indexOf(v)===w}),e.setYScaleForIndex(l,g,p),o.forEach(function(v){s[v]=a.yAxisScale[l].niceMin,r[v]=a.yAxisScale[l].niceMax})}():e.setYScaleForIndex(l,0,-Number.MAX_VALUE)})}}]),n}(),Di=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.scales=new nr(e)}return Z(n,[{key:"init",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:"getMinYMaxY",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-Number.MAX_VALUE,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,s=this.w.config,r=this.w.globals,o=-Number.MAX_VALUE,l=Number.MIN_VALUE;i===null&&(i=e+1);var h=r.series,d=h,u=h;s.chart.type==="candlestick"?(d=r.seriesCandleL,u=r.seriesCandleH):s.chart.type==="boxPlot"?(d=r.seriesCandleO,u=r.seriesCandleC):r.isRangeData&&(d=r.seriesRangeStart,u=r.seriesRangeEnd);var g=!1;if(r.seriesX.length>=i){var p,f=(p=r.brushSource)===null||p===void 0?void 0:p.w.config.chart.brush;(s.chart.zoom.enabled&&s.chart.zoom.autoScaleYaxis||f!=null&&f.enabled&&f!=null&&f.autoScaleYaxis)&&(g=!0)}for(var m=e;m<i;m++){r.dataPoints=Math.max(r.dataPoints,h[m].length);var x=s.series[m].type;r.categoryLabels.length&&(r.dataPoints=r.categoryLabels.filter(function(N){return N!==void 0}).length),r.labels.length&&s.xaxis.type!=="datetime"&&r.series.reduce(function(N,L){return N+L.length},0)!==0&&(r.dataPoints=Math.max(r.dataPoints,r.labels.length));var b=0,v=h[m].length-1;if(g){if(s.xaxis.min)for(;b<v&&r.seriesX[m][b]<s.xaxis.min;b++);if(s.xaxis.max)for(;v>b&&r.seriesX[m][v]>s.xaxis.max;v--);}for(var w=b;w<=v&&w<r.series[m].length;w++){var k=h[m][w];if(k!==null&&R.isNumber(k)){var y,E,S,C;switch(((y=u[m])===null||y===void 0?void 0:y[w])!==void 0&&(o=Math.max(o,u[m][w]),t=Math.min(t,u[m][w])),((E=d[m])===null||E===void 0?void 0:E[w])!==void 0&&(t=Math.min(t,d[m][w]),a=Math.max(a,d[m][w])),x){case"candlestick":r.seriesCandleC[m][w]!==void 0&&(o=Math.max(o,r.seriesCandleH[m][w]),t=Math.min(t,r.seriesCandleL[m][w]));break;case"boxPlot":r.seriesCandleC[m][w]!==void 0&&(o=Math.max(o,r.seriesCandleC[m][w]),t=Math.min(t,r.seriesCandleO[m][w]))}x&&x!=="candlestick"&&x!=="boxPlot"&&x!=="rangeArea"&&x!=="rangeBar"&&(o=Math.max(o,r.series[m][w]),t=Math.min(t,r.series[m][w])),r.seriesGoals[m]&&r.seriesGoals[m][w]&&Array.isArray(r.seriesGoals[m][w])&&r.seriesGoals[m][w].forEach(function(N){o=Math.max(o,N.value),t=Math.min(t,N.value)}),a=o,k=R.noExponents(k),R.isFloat(k)&&(r.yValueDecimal=Math.max(r.yValueDecimal,k.toString().split(".")[1].length)),l>((S=d[m])===null||S===void 0?void 0:S[w])&&((C=d[m])===null||C===void 0?void 0:C[w])<0&&(l=d[m][w])}else r.hasNullValues=!0}x!=="bar"&&x!=="column"||(l<0&&o<0&&(o=0,a=Math.max(a,0)),l===Number.MIN_VALUE&&(l=0,t=Math.min(t,0)))}return s.chart.type==="rangeBar"&&r.seriesRangeStart.length&&r.isBarHorizontal&&(l=t),s.chart.type==="bar"&&(l<0&&o<0&&(o=0),l===Number.MIN_VALUE&&(l=0)),{minY:l,maxY:o,lowestY:t,highestY:a}}},{key:"setYRange",value:function(){var e=this.w.globals,t=this.w.config;e.maxY=-Number.MAX_VALUE,e.minY=Number.MIN_VALUE;var a,i=Number.MAX_VALUE;if(e.isMultipleYAxis){i=Number.MAX_VALUE;for(var s=0;s<e.series.length;s++)a=this.getMinYMaxY(s),e.minYArr[s]=a.lowestY,e.maxYArr[s]=a.highestY,i=Math.min(i,a.lowestY)}return a=this.getMinYMaxY(0,i,null,e.series.length),t.chart.type==="bar"?(e.minY=a.minY,e.maxY=a.maxY):(e.minY=a.lowestY,e.maxY=a.highestY),i=a.lowestY,t.chart.stacked&&this._setStackedMinMax(),t.chart.type==="line"||t.chart.type==="area"||t.chart.type==="scatter"||t.chart.type==="candlestick"||t.chart.type==="boxPlot"||t.chart.type==="rangeBar"&&!e.isBarHorizontal?e.minY===Number.MIN_VALUE&&i!==-Number.MAX_VALUE&&i!==e.maxY&&(e.minY=i):e.minY=e.minY!==Number.MIN_VALUE?Math.min(a.minY,e.minY):a.minY,t.yaxis.forEach(function(r,o){r.max!==void 0&&(typeof r.max=="number"?e.maxYArr[o]=r.max:typeof r.max=="function"&&(e.maxYArr[o]=r.max(e.isMultipleYAxis?e.maxYArr[o]:e.maxY)),e.maxY=e.maxYArr[o]),r.min!==void 0&&(typeof r.min=="number"?e.minYArr[o]=r.min:typeof r.min=="function"&&(e.minYArr[o]=r.min(e.isMultipleYAxis?e.minYArr[o]===Number.MIN_VALUE?0:e.minYArr[o]:e.minY)),e.minY=e.minYArr[o])}),e.isBarHorizontal&&["min","max"].forEach(function(r){t.xaxis[r]!==void 0&&typeof t.xaxis[r]=="number"&&(r==="min"?e.minY=t.xaxis[r]:e.maxY=t.xaxis[r])}),e.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),e.minY=i):(this.scales.setYScaleForIndex(0,e.minY,e.maxY),e.minY=e.yAxisScale[0].niceMin,e.maxY=e.yAxisScale[0].niceMax,e.minYArr[0]=e.minY,e.maxYArr[0]=e.maxY),e.barGroups=[],e.lineGroups=[],e.areaGroups=[],t.series.forEach(function(r){switch(r.type||t.chart.type){case"bar":case"column":e.barGroups.push(r.group);break;case"line":e.lineGroups.push(r.group);break;case"area":e.areaGroups.push(r.group)}}),e.barGroups=e.barGroups.filter(function(r,o,l){return l.indexOf(r)===o}),e.lineGroups=e.lineGroups.filter(function(r,o,l){return l.indexOf(r)===o}),e.areaGroups=e.areaGroups.filter(function(r,o,l){return l.indexOf(r)===o}),{minY:e.minY,maxY:e.maxY,minYArr:e.minYArr,maxYArr:e.maxYArr,yAxisScale:e.yAxisScale}}},{key:"setXRange",value:function(){var e=this.w.globals,t=this.w.config,a=t.xaxis.type==="numeric"||t.xaxis.type==="datetime"||t.xaxis.type==="category"&&!e.noLabelsProvided||e.noLabelsProvided||e.isXNumeric;if(e.isXNumeric&&function(){for(var l=0;l<e.series.length;l++)if(e.labels[l])for(var h=0;h<e.labels[l].length;h++)e.labels[l][h]!==null&&R.isNumber(e.labels[l][h])&&(e.maxX=Math.max(e.maxX,e.labels[l][h]),e.initialMaxX=Math.max(e.maxX,e.labels[l][h]),e.minX=Math.min(e.minX,e.labels[l][h]),e.initialMinX=Math.min(e.minX,e.labels[l][h]))}(),e.noLabelsProvided&&t.xaxis.categories.length===0&&(e.maxX=e.labels[e.labels.length-1],e.initialMaxX=e.labels[e.labels.length-1],e.minX=1,e.initialMinX=1),e.isXNumeric||e.noLabelsProvided||e.dataFormatXNumeric){var i=10;if(t.xaxis.tickAmount===void 0)i=Math.round(e.svgWidth/150),t.xaxis.type==="numeric"&&e.dataPoints<30&&(i=e.dataPoints-1),i>e.dataPoints&&e.dataPoints!==0&&(i=e.dataPoints-1);else if(t.xaxis.tickAmount==="dataPoints"){if(e.series.length>1&&(i=e.series[e.maxValsInArrayIndex].length-1),e.isXNumeric){var s=Math.round(e.maxX-e.minX);s<30&&(i=s-1)}}else i=t.xaxis.tickAmount;if(e.xTickAmount=i,t.xaxis.max!==void 0&&typeof t.xaxis.max=="number"&&(e.maxX=t.xaxis.max),t.xaxis.min!==void 0&&typeof t.xaxis.min=="number"&&(e.minX=t.xaxis.min),t.xaxis.range!==void 0&&(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 r=[],o=e.minX-1;o<e.maxX;o++)r.push(o+1);e.xAxisScale={result:r,niceMin:r[0],niceMax:r[r.length-1]}}else e.xAxisScale=this.scales.setXScale(e.minX,e.maxX);else e.xAxisScale=this.scales.linearScale(0,i,i,0,t.xaxis.stepSize),e.noLabelsProvided&&e.labels.length>0&&(e.xAxisScale=this.scales.linearScale(1,e.labels.length,i-1,0,t.xaxis.stepSize),e.seriesX=e.labels.slice());a&&(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;t<e.series.length;t++)if(e.seriesZ[t]!==void 0)for(var a=0;a<e.seriesZ[t].length;a++)e.seriesZ[t][a]!==null&&R.isNumber(e.seriesZ[t][a])&&(e.maxZ=Math.max(e.maxZ,e.seriesZ[t][a]),e.minZ=Math.min(e.minZ,e.seriesZ[t][a]))}}},{key:"_handleSingleDataPoint",value:function(){var e=this.w.globals,t=this.w.config;if(e.minX===e.maxX){var a=new He(this.ctx);if(t.xaxis.type==="datetime"){var i=a.getDate(e.minX);t.xaxis.labels.datetimeUTC?i.setUTCDate(i.getUTCDate()-2):i.setDate(i.getDate()-2),e.minX=new Date(i).getTime();var s=a.getDate(e.maxX);t.xaxis.labels.datetimeUTC?s.setUTCDate(s.getUTCDate()+2):s.setDate(s.getDate()+2),e.maxX=new Date(s).getTime()}else(t.xaxis.type==="numeric"||t.xaxis.type==="category"&&!e.noLabelsProvided)&&(e.minX=e.minX-2,e.initialMinX=e.minX,e.maxX=e.maxX+2,e.initialMaxX=e.maxX)}}},{key:"_getMinXDiff",value:function(){var e=this.w.globals;e.isXNumeric&&e.seriesX.forEach(function(t,a){if(t.length){t.length===1&&t.push(e.seriesX[e.maxValsInArrayIndex][e.seriesX[e.maxValsInArrayIndex].length-1]);var i=t.slice();i.sort(function(s,r){return s-r}),i.forEach(function(s,r){if(r>0){var o=s-i[r-1];o>0&&(e.minXDiff=Math.min(o,e.minXDiff))}}),e.dataPoints!==1&&e.minXDiff!==Number.MAX_VALUE||(e.minXDiff=.5)}})}},{key:"_setStackedMinMax",value:function(){var e=this,t=this.w.globals;if(t.series.length){var a=t.seriesGroups;a.length||(a=[this.w.globals.seriesNames.map(function(r){return r})]);var i={},s={};a.forEach(function(r){i[r]=[],s[r]=[],e.w.config.series.map(function(o,l){return r.indexOf(t.seriesNames[l])>-1?l:null}).filter(function(o){return o!==null}).forEach(function(o){for(var l=0;l<t.series[t.maxValsInArrayIndex].length;l++){var h,d,u,g;i[r][l]===void 0&&(i[r][l]=0,s[r][l]=0),(e.w.config.chart.stacked&&!t.comboCharts||e.w.config.chart.stacked&&t.comboCharts&&(!e.w.config.chart.stackOnlyBar||((h=e.w.config.series)===null||h===void 0||(d=h[o])===null||d===void 0?void 0:d.type)==="bar"||((u=e.w.config.series)===null||u===void 0||(g=u[o])===null||g===void 0?void 0:g.type)==="column"))&&t.series[o][l]!==null&&R.isNumber(t.series[o][l])&&(t.series[o][l]>0?i[r][l]+=parseFloat(t.series[o][l])+1e-4:s[r][l]+=parseFloat(t.series[o][l]))}})}),Object.entries(i).forEach(function(r){var o=xs(r,1)[0];i[o].forEach(function(l,h){t.maxY=Math.max(t.maxY,i[o][h]),t.minY=Math.min(t.minY,s[o][h])})})}}}]),n}(),Ri=function(){function n(e,t){q(this,n),this.ctx=e,this.elgrid=t,this.w=e.w;var a=this.w;this.xaxisFontSize=a.config.xaxis.labels.style.fontSize,this.axisFontFamily=a.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=a.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal=a.config.chart.type==="bar"&&a.config.plotOptions.bar.horizontal,this.xAxisoffX=a.config.xaxis.position==="bottom"?a.globals.gridHeight:0,this.drawnLabels=[],this.axesUtils=new yt(e)}return Z(n,[{key:"drawYaxis",value:function(e){var t=this.w,a=new O(this.ctx),i=t.config.yaxis[e].labels.style,s=i.fontSize,r=i.fontFamily,o=i.fontWeight,l=a.group({class:"apexcharts-yaxis",rel:e,transform:"translate(".concat(t.globals.translateYAxisX[e],", 0)")});if(this.axesUtils.isYAxisHidden(e))return l;var h=a.group({class:"apexcharts-yaxis-texts-g"});l.add(h);var d=t.globals.yAxisScale[e].result.length-1,u=t.globals.gridHeight/d,g=t.globals.yLabelFormatters[e],p=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:t.config.chart.type==="heatmap"&&(f-=u/2),f+=parseInt(s,10)/3;for(var m=d;m>=0;m--){var x=g(p[m],m,t),b=t.config.yaxis[e].labels.padding;t.config.yaxis[e].opposite&&t.config.yaxis.length!==0&&(b*=-1);var v=this.getTextAnchor(t.config.yaxis[e].labels.align,t.config.yaxis[e].opposite),w=this.axesUtils.getYAxisForeColor(i.colors,e),k=Array.isArray(w)?w[m]:w,y=R.listToArray(t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-label tspan"))).map(function(S){return S.textContent}),E=a.drawText({x:b,y:f,text:y.includes(x)&&!t.config.yaxis[e].labels.showDuplicates?"":x,textAnchor:v,fontSize:s,fontFamily:r,fontWeight:o,maxWidth:t.config.yaxis[e].labels.maxWidth,foreColor:k,isPlainText:!1,cssClass:"apexcharts-yaxis-label ".concat(i.cssClass)});h.add(E),this.addTooltip(E,x),t.config.yaxis[e].labels.rotate!==0&&this.rotateLabel(a,E,firstLabel,t.config.yaxis[e].labels.rotate),f+=u}}return this.addYAxisTitle(a,l,e),this.addAxisBorder(a,l,e,d,u),l}},{key:"getTextAnchor",value:function(e,t){return e==="left"?"start":e==="center"?"middle":e==="right"?"end":t?"start":"end"}},{key:"addTooltip",value:function(e,t){var a=document.createElementNS(this.w.globals.SVGNS,"title");a.textContent=Array.isArray(t)?t.join(" "):t,e.node.appendChild(a)}},{key:"rotateLabel",value:function(e,t,a,i){var s=e.rotateAroundCenter(a.node),r=e.rotateAroundCenter(t.node);t.node.setAttribute("transform","rotate(".concat(i," ").concat(s.x," ").concat(r.y,")"))}},{key:"addYAxisTitle",value:function(e,t,a){var i=this.w;if(i.config.yaxis[a].title.text!==void 0){var s=e.group({class:"apexcharts-yaxis-title"}),r=i.config.yaxis[a].opposite?i.globals.translateYAxisX[a]:0,o=e.drawText({x:r,y:i.globals.gridHeight/2+i.globals.translateY+i.config.yaxis[a].title.offsetY,text:i.config.yaxis[a].title.text,textAnchor:"end",foreColor:i.config.yaxis[a].title.style.color,fontSize:i.config.yaxis[a].title.style.fontSize,fontWeight:i.config.yaxis[a].title.style.fontWeight,fontFamily:i.config.yaxis[a].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text ".concat(i.config.yaxis[a].title.style.cssClass)});s.add(o),t.add(s)}}},{key:"addAxisBorder",value:function(e,t,a,i,s){var r=this.w,o=r.config.yaxis[a].axisBorder,l=31+o.offsetX;if(r.config.yaxis[a].opposite&&(l=-31-o.offsetX),o.show){var h=e.drawLine(l,r.globals.translateY+o.offsetY-2,l,r.globals.gridHeight+r.globals.translateY+o.offsetY+2,o.color,0,o.width);t.add(h)}r.config.yaxis[a].axisTicks.show&&this.axesUtils.drawYAxisTicks(l,i,o,r.config.yaxis[a].axisTicks,a,s,t)}},{key:"drawYaxisInversed",value:function(e){var t=this.w,a=new O(this.ctx),i=a.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),s=a.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(t.globals.translateXAxisX,", ").concat(t.globals.translateXAxisY,")")});i.add(s);var r=t.globals.yAxisScale[e].result.length-1,o=t.globals.gridWidth/r+.1,l=o+t.config.xaxis.labels.offsetX,h=t.globals.xLabelFormatter,d=this.axesUtils.checkForReversedLabels(e,t.globals.yAxisScale[e].result.slice()),u=t.globals.timescaleLabels;if(u.length>0&&(this.xaxisLabels=u.slice(),r=(d=u.slice()).length),t.config.xaxis.labels.show)for(var g=u.length?0:r;u.length?g<u.length:g>=0;u.length?g++:g--){var p=h(d[g],g,t),f=t.globals.gridWidth+t.globals.padHorizontal-(l-o+t.config.xaxis.labels.offsetX);if(u.length){var m=this.axesUtils.getLabel(d,u,f,g,this.drawnLabels,this.xaxisFontSize);f=m.x,p=m.text,this.drawnLabels.push(m.text),g===0&&t.globals.skipFirstTimelinelabel&&(p=""),g===d.length-1&&t.globals.skipLastTimelinelabel&&(p="")}var x=a.drawText({x:f,y:this.xAxisoffX+t.config.xaxis.labels.offsetY+30-(t.config.xaxis.position==="top"?t.globals.xAxisHeight+t.config.xaxis.axisTicks.height-2:0),text:p,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)});s.add(x),x.tspan(p),this.addTooltip(x,p),l+=o}return this.inversedYAxisTitleText(i),this.inversedYAxisBorder(i),i}},{key:"inversedYAxisBorder",value:function(e){var t=this.w,a=new O(this.ctx),i=t.config.xaxis.axisBorder;if(i.show){var s=0;t.config.chart.type==="bar"&&t.globals.isXNumeric&&(s-=15);var r=a.drawLine(t.globals.padHorizontal+s+i.offsetX,this.xAxisoffX,t.globals.gridWidth,this.xAxisoffX,i.color,0,i.height);this.elgrid&&this.elgrid.elGridBorders&&t.config.grid.show?this.elgrid.elGridBorders.add(r):e.add(r)}}},{key:"inversedYAxisTitleText",value:function(e){var t=this.w,a=new O(this.ctx);if(t.config.xaxis.title.text!==void 0){var i=a.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),s=a.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)});i.add(s),e.add(i)}}},{key:"yAxisTitleRotate",value:function(e,t){var a=this.w,i=new O(this.ctx),s=a.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-texts-g")),r=s?s.getBoundingClientRect():{width:0,height:0},o=a.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(e,"'] .apexcharts-yaxis-title text")),l=o?o.getBoundingClientRect():{width:0,height:0};if(o){var h=this.xPaddingForYAxisTitle(e,r,l,t);o.setAttribute("x",h.xPos-(t?10:0));var d=i.rotateAroundCenter(o);o.setAttribute("transform","rotate(".concat(t?-1*a.config.yaxis[e].title.rotate:a.config.yaxis[e].title.rotate," ").concat(d.x," ").concat(d.y,")"))}}},{key:"xPaddingForYAxisTitle",value:function(e,t,a,i){var s=this.w,r=0,o=10;return s.config.yaxis[e].title.text===void 0||e<0?{xPos:r,padd:0}:(i?r=t.width+s.config.yaxis[e].title.offsetX+a.width/2+o/2:(r=-1*t.width+s.config.yaxis[e].title.offsetX+o/2+a.width/2,s.globals.isBarHorizontal&&(o=25,r=-1*t.width-s.config.yaxis[e].title.offsetX-o)),{xPos:r,padd:o})}},{key:"setYAxisXPosition",value:function(e,t){var a=this.w,i=0,s=0,r=18,o=1;a.config.yaxis.length>1&&(this.multipleYs=!0),a.config.yaxis.forEach(function(l,h){var d=a.globals.ignoreYAxisIndexes.includes(h)||!l.show||l.floating||e[h].width===0,u=e[h].width+t[h].width;l.opposite?a.globals.isBarHorizontal?(s=a.globals.gridWidth+a.globals.translateX-1,a.globals.translateYAxisX[h]=s-l.labels.offsetX):(s=a.globals.gridWidth+a.globals.translateX+o,d||(o+=u+20),a.globals.translateYAxisX[h]=s-l.labels.offsetX+20):(i=a.globals.translateX-r,d||(r+=u+20),a.globals.translateYAxisX[h]=i+l.labels.offsetX)})}},{key:"setYAxisTextAlignments",value:function(){var e=this.w;R.listToArray(e.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach(function(t,a){var i=e.config.yaxis[a];if(i&&!i.floating&&i.labels.align!==void 0){var s=e.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(a,"'] .apexcharts-yaxis-texts-g")),r=R.listToArray(e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(a,"'] .apexcharts-yaxis-label"))),o=s.getBoundingClientRect();r.forEach(function(l){l.setAttribute("text-anchor",i.labels.align)}),i.labels.align!=="left"||i.opposite?i.labels.align==="center"?s.setAttribute("transform","translate(".concat(o.width/2*(i.opposite?1:-1),", 0)")):i.labels.align==="right"&&i.opposite&&s.setAttribute("transform","translate(".concat(o.width,", 0)")):s.setAttribute("transform","translate(-".concat(o.width,", 0)"))}})}}]),n}(),Xo=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.documentEvent=R.bind(this.documentEvent,this)}return Z(n,[{key:"addEventListener",value:function(e,t){var a=this.w;a.globals.events.hasOwnProperty(e)?a.globals.events[e].push(t):a.globals.events[e]=[t]}},{key:"removeEventListener",value:function(e,t){var a=this.w;if(a.globals.events.hasOwnProperty(e)){var i=a.globals.events[e].indexOf(t);i!==-1&&a.globals.events[e].splice(i,1)}}},{key:"fireEvent",value:function(e,t){var a=this.w;if(a.globals.events.hasOwnProperty(e)){t&&t.length||(t=[]);for(var i=a.globals.events[e],s=i.length,r=0;r<s;r++)i[r].apply(null,t)}}},{key:"setupEventHandlers",value:function(){var e=this,t=this.w,a=this.ctx,i=t.globals.dom.baseEl.querySelector(t.globals.chartClass);this.ctx.eventList.forEach(function(s){i.addEventListener(s,function(r){var o=r.target.getAttribute("i")===null&&t.globals.capturedSeriesIndex!==-1?t.globals.capturedSeriesIndex:r.target.getAttribute("i"),l=r.target.getAttribute("j")===null&&t.globals.capturedDataPointIndex!==-1?t.globals.capturedDataPointIndex:r.target.getAttribute("j"),h=Object.assign({},t,{seriesIndex:t.globals.axisCharts?o:0,dataPointIndex:l});r.type==="mousemove"||r.type==="touchmove"?typeof t.config.chart.events.mouseMove=="function"&&t.config.chart.events.mouseMove(r,a,h):r.type==="mouseleave"||r.type==="touchleave"?typeof t.config.chart.events.mouseLeave=="function"&&t.config.chart.events.mouseLeave(r,a,h):(r.type==="mouseup"&&r.which===1||r.type==="touchend")&&(typeof t.config.chart.events.click=="function"&&t.config.chart.events.click(r,a,h),a.ctx.events.fireEvent("click",[r,a,h]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(function(s){t.globals.dom.baseEl.addEventListener(s,e.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}},{key:"documentEvent",value:function(e){var t=this.w,a=e.target.className;if(e.type==="click"){var i=t.globals.dom.baseEl.querySelector(".apexcharts-menu");i&&i.classList.contains("apexcharts-menu-open")&&a!=="apexcharts-menu-icon"&&i.classList.remove("apexcharts-menu-open")}t.globals.clientX=e.type==="touchmove"?e.touches[0].clientX:e.clientX,t.globals.clientY=e.type==="touchmove"?e.touches[0].clientY:e.clientY}}]),n}(),Yo=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"setCurrentLocaleValues",value:function(e){var t=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(t=this.w.config.chart.locales.concat(window.Apex.chart.locales));var a=t.filter(function(s){return s.name===e})[0];if(!a)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var i=R.extend(ar,a);this.w.globals.locale=i.options}}]),n}(),Wo=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"drawAxis",value:function(e,t){var a,i,s=this,r=this.w.globals,o=this.w.config,l=new xa(this.ctx,t),h=new Ri(this.ctx,t);r.axisCharts&&e!=="radar"&&(r.isBarHorizontal?(i=h.drawYaxisInversed(0),a=l.drawXaxisInversed(0),r.dom.elGraphical.add(a),r.dom.elGraphical.add(i)):(a=l.drawXaxis(),r.dom.elGraphical.add(a),o.yaxis.map(function(d,u){if(r.ignoreYAxisIndexes.indexOf(u)===-1&&(i=h.drawYaxis(u),r.dom.Paper.add(i),s.w.config.grid.position==="back")){var g=r.dom.Paper.children()[1];g.remove(),r.dom.Paper.add(g)}})))}}]),n}(),Bi=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"drawXCrosshairs",value:function(){var e=this.w,t=new O(this.ctx),a=new Ie(this.ctx),i=e.config.xaxis.crosshairs.fill.gradient,s=e.config.xaxis.crosshairs.dropShadow,r=e.config.xaxis.crosshairs.fill.type,o=i.colorFrom,l=i.colorTo,h=i.opacityFrom,d=i.opacityTo,u=i.stops,g=s.enabled,p=s.left,f=s.top,m=s.blur,x=s.color,b=s.opacity,v=e.config.xaxis.crosshairs.fill.color;if(e.config.xaxis.crosshairs.show){r==="gradient"&&(v=t.drawGradient("vertical",o,l,h,d,null,u,null));var w=t.drawRect();e.config.xaxis.crosshairs.width===1&&(w=t.drawLine());var k=e.globals.gridHeight;(!R.isNumber(k)||k<0)&&(k=0);var y=e.config.xaxis.crosshairs.width;(!R.isNumber(y)||y<0)&&(y=0),w.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:k,width:y,height:k,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}),g&&(w=a.dropShadow(w,{left:p,top:f,blur:m,color:x,opacity:b})),e.globals.dom.elGraphical.add(w)}}},{key:"drawYCrosshairs",value:function(){var e=this.w,t=new O(this.ctx),a=e.config.yaxis[0].crosshairs,i=e.globals.barPadForNumericAxis;if(e.config.yaxis[0].crosshairs.show){var s=t.drawLine(-i,0,e.globals.gridWidth+i,0,a.stroke.color,a.stroke.dashArray,a.stroke.width);s.attr({class:"apexcharts-ycrosshairs"}),e.globals.dom.elGraphical.add(s)}var r=t.drawLine(-i,0,e.globals.gridWidth+i,0,a.stroke.color,0,0);r.attr({class:"apexcharts-ycrosshairs-hidden"}),e.globals.dom.elGraphical.add(r)}}]),n}(),_o=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"checkResponsiveConfig",value:function(e){var t=this,a=this.w,i=a.config;if(i.responsive.length!==0){var s=i.responsive.slice();s.sort(function(h,d){return h.breakpoint>d.breakpoint?1:d.breakpoint>h.breakpoint?-1:0}).reverse();var r=new fa({}),o=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=s[0].breakpoint,u=window.innerWidth>0?window.innerWidth:screen.width;if(u>d){var g=R.clone(a.globals.initialConfig);g.series=R.clone(a.config.series);var p=Le.extendArrayProps(r,g,a);h=R.extend(p,h),h=R.extend(a.config,h),t.overrideResponsiveOptions(h)}else for(var f=0;f<s.length;f++)u<s[f].breakpoint&&(h=Le.extendArrayProps(r,s[f].options,a),h=R.extend(a.config,h),t.overrideResponsiveOptions(h))};if(e){var l=Le.extendArrayProps(r,e,a);l=R.extend(a.config,l),o(l=R.extend(l,e))}else o({})}}},{key:"overrideResponsiveOptions",value:function(e){var t=new fa(e).init({responsiveOverride:!0});this.w.config=t}}]),n}(),jo=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}return Z(n,[{key:"checkHeatmapDistributed",value:function(){var e=this.w.config,t=e.chart,a=e.plotOptions;return t.type==="treemap"&&a.treemap&&a.treemap.distributed||t.type==="heatmap"&&a.heatmap&&a.heatmap.distributed}},{key:"checkBarDistributed",value:function(){var e=this.w.config,t=e.chart,a=e.plotOptions;return a.bar&&a.bar.distributed&&(t.type==="bar"||t.type==="rangeBar")}},{key:"init",value:function(){this.setDefaultColors()}},{key:"setDefaultColors",value:function(){var e=this.w,t=new R;e.globals.dom.elWrap.classList.add("apexcharts-theme-".concat(e.config.theme.mode||"light"));var a=Pe(e.config.colors||e.config.fill.colors||[]);e.globals.colors=this.getColors(a),this.applySeriesColors(e.globals.seriesColors,e.globals.colors),e.config.theme.monochrome.enabled&&(e.globals.colors=this.getMonochromeColors(e.config.theme.monochrome,e.globals.series,t));var i=e.globals.colors.slice();this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],i),this.applyDataLabelsColors(i),this.applyRadarPolygonsColors(),this.applyMarkersColors(i)}},{key:"getColors",value:function(e){var t=this,a=this.w;return e&&e.length!==0?Array.isArray(e)&&e.length>0&&typeof e[0]=="function"?(this.isColorFn=!0,a.config.series.map(function(i,s){var r=e[s]||e[0];return typeof r=="function"?r({value:a.globals.axisCharts?a.globals.series[s][0]||0:a.globals.series[s],seriesIndex:s,dataPointIndex:s,w:t.w}):r})):e:this.predefined()}},{key:"applySeriesColors",value:function(e,t){e.forEach(function(a,i){a&&(t[i]=a)})}},{key:"getMonochromeColors",value:function(e,t,a){var i=e.color,s=e.shadeIntensity,r=e.shadeTo,o=this.isBarDistributed||this.isHeatmapDistributed?t[0].length*t.length:t.length,l=1/(o/s),h=0;return Array.from({length:o},function(){var d=r==="dark"?a.shadeColor(-1*h,i):a.shadeColor(h,i);return h+=l,d})}},{key:"applyColorTypes",value:function(e,t){var a=this,i=this.w;e.forEach(function(s){i.globals[s].colors=i.config[s].colors===void 0?a.isColorFn?i.config.colors:t:i.config[s].colors.slice(),a.pushExtraColors(i.globals[s].colors)})}},{key:"applyDataLabelsColors",value:function(e){var t=this.w;t.globals.dataLabels.style.colors=t.config.dataLabels.style.colors===void 0?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=e.config.plotOptions.radar.polygons.fill.colors===void 0?[e.config.theme.mode==="dark"?"#343A3F":"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=t.config.markers.colors===void 0?e:t.config.markers.colors.slice(),this.pushExtraColors(t.globals.markers.colors)}},{key:"pushExtraColors",value:function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=this.w,s=t||i.globals.series.length;if(a===null&&(a=this.isBarDistributed||this.isHeatmapDistributed||i.config.chart.type==="heatmap"&&i.config.plotOptions.heatmap&&i.config.plotOptions.heatmap.colorScale.inverse),a&&i.globals.series.length&&(s=i.globals.series[i.globals.maxValsInArrayIndex].length*i.globals.series.length),e.length<s)for(var r=s-e.length,o=0;o<r;o++)e.push(e[o])}},{key:"updateThemeOptions",value:function(e){e.chart=e.chart||{},e.tooltip=e.tooltip||{};var t=e.theme.mode,a=t==="dark"?"palette4":t==="light"?"palette1":e.theme.palette||"palette1",i=t==="dark"?"#f6f7f8":t==="light"?"#373d3f":e.chart.foreColor||"#373d3f";return e.tooltip.theme=t||"light",e.chart.foreColor=i,e.theme.palette=a,e}},{key:"predefined",value:function(){var e={palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#FF9800"],palette3:["#33b2df","#546E7A","#d4526e","#13d8aa","#A5978B"],palette4:["#4ecdc4","#c7f464","#81D4FA","#fd6a6a","#546E7A"],palette5:["#2b908f","#f9a3a4","#90ee7e","#fa4443","#69d2e7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"],default:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"]};return e[this.w.config.theme.palette]||e.default}}]),n}(),Go=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"draw",value:function(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}},{key:"drawTitleSubtitle",value:function(e){var t=this.w,a=e==="title"?t.config.title:t.config.subtitle,i=t.globals.svgWidth/2,s=a.offsetY,r="middle";if(a.align==="left"?(i=10,r="start"):a.align==="right"&&(i=t.globals.svgWidth-10,r="end"),i+=a.offsetX,s=s+parseInt(a.style.fontSize,10)+a.margin/2,a.text!==void 0){var o=new O(this.ctx).drawText({x:i,y:s,text:a.text,textAnchor:r,fontSize:a.style.fontSize,fontFamily:a.style.fontFamily,fontWeight:a.style.fontWeight,foreColor:a.style.color,opacity:1});o.node.setAttribute("class","apexcharts-".concat(e,"-text")),t.globals.dom.Paper.add(o)}}}]),n}(),$o=function(){function n(e){q(this,n),this.w=e.w,this.dCtx=e}return Z(n,[{key:"getTitleSubtitleCoords",value:function(e){var t=this.w,a=0,i=0,s=e==="title"?t.config.title.floating:t.config.subtitle.floating,r=t.globals.dom.baseEl.querySelector(".apexcharts-".concat(e,"-text"));if(r!==null&&!s){var o=r.getBoundingClientRect();a=o.width,i=t.globals.axisCharts?o.height+5:o.height}return{width:a,height:i}}},{key:"getLegendsRect",value:function(){var e=this.w,t=e.globals.dom.elLegendWrap;e.config.legend.height||e.config.legend.position!=="top"&&e.config.legend.position!=="bottom"||(t.style.maxHeight=e.globals.svgHeight/2+"px");var a=Object.assign({},R.getBoundingClientRect(t));return t!==null&&!e.config.legend.floating&&e.config.legend.show?this.dCtx.lgRect={x:a.x,y:a.y,height:a.height,width:a.height===0?0:a.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},e.config.legend.position!=="left"&&e.config.legend.position!=="right"||1.5*this.dCtx.lgRect.width>e.globals.svgWidth&&(this.dCtx.lgRect.width=e.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getDatalabelsRect",value:function(){var e=this,t=this.w,a=[];t.config.series.forEach(function(l,h){l.data.forEach(function(d,u){var g;g=t.globals.series[h][u],i=t.config.dataLabels.formatter(g,{ctx:e.dCtx.ctx,seriesIndex:h,dataPointIndex:u,w:t}),a.push(i)})});var i=R.getLargestStringFromArr(a),s=new O(this.dCtx.ctx),r=t.config.dataLabels.style,o=s.getTextRects(i,parseInt(r.fontSize),r.fontFamily);return{width:1.05*o.width,height:o.height}}},{key:"getLargestStringFromMultiArr",value:function(e,t){var a=e;if(this.w.globals.isMultiLineX){var i=t.map(function(r,o){return Array.isArray(r)?r.length:1}),s=Math.max.apply(Math,Pe(i));a=t[i.indexOf(s)]}return a}}]),n}(),Uo=function(){function n(e){q(this,n),this.w=e.w,this.dCtx=e}return Z(n,[{key:"getxAxisLabelsCoords",value:function(){var e,t=this.w,a=t.globals.labels.slice();if(t.config.xaxis.convertedCatToNumeric&&a.length===0&&(a=t.globals.categoryLabels),t.globals.timescaleLabels.length>0){var i=this.getxAxisTimeScaleLabelsCoords();e={width:i.width,height:i.height},t.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends=t.config.legend.position!=="left"&&t.config.legend.position!=="right"||t.config.legend.floating?0:this.dCtx.lgRect.width;var s=t.globals.xLabelFormatter,r=R.getLargestStringFromArr(a),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(r,a);t.globals.isBarHorizontal&&(o=r=t.globals.yAxisScale[0].result.reduce(function(f,m){return f.length>m.length?f:m},0));var l=new ga(this.dCtx.ctx),h=r;r=l.xLabelFormat(s,r,h,{i:void 0,dateFormatter:new He(this.dCtx.ctx).formatDate,w:t}),o=l.xLabelFormat(s,o,h,{i:void 0,dateFormatter:new He(this.dCtx.ctx).formatDate,w:t}),(t.config.xaxis.convertedCatToNumeric&&r===void 0||String(r).trim()==="")&&(o=r="1");var d=new O(this.dCtx.ctx),u=d.getTextRects(r,t.config.xaxis.labels.style.fontSize),g=u;if(r!==o&&(g=d.getTextRects(o,t.config.xaxis.labels.style.fontSize)),(e={width:u.width>=g.width?u.width:g.width,height:u.height>=g.height?u.height:g.height}).width*a.length>t.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&t.config.xaxis.labels.rotate!==0||t.config.xaxis.labels.rotateAlways){if(!t.globals.isBarHorizontal){t.globals.rotateXLabels=!0;var p=function(f){return d.getTextRects(f,t.config.xaxis.labels.style.fontSize,t.config.xaxis.labels.style.fontFamily,"rotate(".concat(t.config.xaxis.labels.rotate," 0 0)"),!1)};u=p(r),r!==o&&(g=p(o)),e.height=(u.height>g.height?u.height:g.height)/1.5,e.width=u.width>g.width?u.width:g.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 a,i=((e=t.config.xaxis.group.style)===null||e===void 0?void 0:e.fontSize)||t.config.xaxis.labels.style.fontSize,s=t.globals.groups.map(function(u){return u.title}),r=R.getLargestStringFromArr(s),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(r,s),l=new O(this.dCtx.ctx),h=l.getTextRects(r,i),d=h;return r!==o&&(d=l.getTextRects(o,i)),a={width:h.width>=d.width?h.width:d.width,height:h.height>=d.height?h.height:d.height},t.config.xaxis.labels.show||(a={width:0,height:0}),{width:a.width,height:a.height}}},{key:"getxAxisTitleCoords",value:function(){var e=this.w,t=0,a=0;if(e.config.xaxis.title.text!==void 0){var i=new O(this.dCtx.ctx).getTextRects(e.config.xaxis.title.text,e.config.xaxis.title.style.fontSize);t=i.width,a=i.height}return{width:t,height:a}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var e,t=this.w;this.dCtx.timescaleLabels=t.globals.timescaleLabels.slice();var a=this.dCtx.timescaleLabels.map(function(s){return s.value}),i=a.reduce(function(s,r){return s===void 0?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):s.length>r.length?s:r},0);return 1.05*(e=new O(this.dCtx.ctx).getTextRects(i,t.config.xaxis.labels.style.fontSize)).width*a.length>t.globals.gridWidth&&t.config.xaxis.labels.rotate!==0&&(t.globals.overlappingXLabels=!0),e}},{key:"additionalPaddingXLabels",value:function(e){var t=this,a=this.w,i=a.globals,s=a.config,r=s.xaxis.type,o=e.width;i.skipLastTimelinelabel=!1,i.skipFirstTimelinelabel=!1;var l=a.config.yaxis[0].opposite&&a.globals.isBarHorizontal,h=function(d,u){s.yaxis.length>1&&function(g){return i.collapsedSeriesIndices.indexOf(g)!==-1}(u)||function(g){if(t.dCtx.timescaleLabels&&t.dCtx.timescaleLabels.length){var p=t.dCtx.timescaleLabels[0],f=t.dCtx.timescaleLabels[t.dCtx.timescaleLabels.length-1].position+o/1.75-t.dCtx.yAxisWidthRight,m=p.position-o/1.75+t.dCtx.yAxisWidthLeft,x=a.config.legend.position==="right"&&t.dCtx.lgRect.width>0?t.dCtx.lgRect.width:0;f>i.svgWidth-i.translateX-x&&(i.skipLastTimelinelabel=!0),m<-(g.show&&!g.floating||s.chart.type!=="bar"&&s.chart.type!=="candlestick"&&s.chart.type!=="rangeBar"&&s.chart.type!=="boxPlot"?10:o/1.75)&&(i.skipFirstTimelinelabel=!0)}else r==="datetime"?t.dCtx.gridPad.right<o&&!i.rotateXLabels&&(i.skipLastTimelinelabel=!0):r!=="datetime"&&t.dCtx.gridPad.right<o/2-t.dCtx.yAxisWidthRight&&!i.rotateXLabels&&!a.config.xaxis.labels.trim&&(t.dCtx.xPadRight=o/2+1)}(d)};s.yaxis.forEach(function(d,u){l?(t.dCtx.gridPad.left<o&&(t.dCtx.xPadLeft=o/2+1),t.dCtx.xPadRight=o/2+1):h(d,u)})}}]),n}(),qo=function(){function n(e){q(this,n),this.w=e.w,this.dCtx=e}return Z(n,[{key:"getyAxisLabelsCoords",value:function(){var e=this,t=this.w,a=[],i=10,s=new yt(this.dCtx.ctx);return t.config.yaxis.map(function(r,o){var l={seriesIndex:o,dataPointIndex:-1,w:t},h=t.globals.yAxisScale[o],d=0;if(!s.isYAxisHidden(o)&&r.labels.show&&r.labels.minWidth!==void 0&&(d=r.labels.minWidth),!s.isYAxisHidden(o)&&r.labels.show&&h.result.length){var u=t.globals.yLabelFormatters[o],g=h.niceMin===Number.MIN_VALUE?0:h.niceMin,p=h.result.reduce(function(k,y){var E,S;return((E=String(u(k,l)))===null||E===void 0?void 0:E.length)>((S=String(u(y,l)))===null||S===void 0?void 0:S.length)?k:y},g),f=p=u(p,l);if(p!==void 0&&p.length!==0||(p=h.niceMax),t.globals.isBarHorizontal){i=0;var m=t.globals.labels.slice();p=R.getLargestStringFromArr(m),p=u(p,{seriesIndex:o,dataPointIndex:-1,w:t}),f=e.dCtx.dimHelpers.getLargestStringFromMultiArr(p,m)}var x=new O(e.dCtx.ctx),b="rotate(".concat(r.labels.rotate," 0 0)"),v=x.getTextRects(p,r.labels.style.fontSize,r.labels.style.fontFamily,b,!1),w=v;p!==f&&(w=x.getTextRects(f,r.labels.style.fontSize,r.labels.style.fontFamily,b,!1)),a.push({width:(d>w.width||d>v.width?d:w.width>v.width?w.width:v.width)+i,height:w.height>v.height?w.height:v.height})}else a.push({width:0,height:0})}),a}},{key:"getyAxisTitleCoords",value:function(){var e=this,t=this.w,a=[];return t.config.yaxis.map(function(i,s){if(i.show&&i.title.text!==void 0){var r=new O(e.dCtx.ctx),o="rotate(".concat(i.title.rotate," 0 0)"),l=r.getTextRects(i.title.text,i.title.style.fontSize,i.title.style.fontFamily,o,!1);a.push({width:l.width,height:l.height})}else a.push({width:0,height:0})}),a}},{key:"getTotalYAxisWidth",value:function(){var e=this.w,t=0,a=0,i=0,s=e.globals.yAxisScale.length>1?10:0,r=new yt(this.dCtx.ctx),o=function(l,h){var d=e.config.yaxis[h].floating,u=0;l.width>0&&!d?(u=l.width+s,function(g){return e.globals.ignoreYAxisIndexes.indexOf(g)>-1}(h)&&(u=u-l.width-s)):u=d||r.isYAxisHidden(h)?0:5,e.config.yaxis[h].opposite?i+=u:a+=u,t+=u};return e.globals.yLabelsCoords.map(function(l,h){o(l,h)}),e.globals.yTitleCoords.map(function(l,h){o(l,h)}),e.globals.isBarHorizontal&&!e.config.yaxis[0].floating&&(t=e.globals.yLabelsCoords[0].width+e.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=a,this.dCtx.yAxisWidthRight=i,t}}]),n}(),Zo=function(){function n(e){q(this,n),this.w=e.w,this.dCtx=e}return Z(n,[{key:"gridPadForColumnsInNumericAxis",value:function(e){var t=this.w,a=t.config,i=t.globals;if(i.noData||i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===a.series.length)return 0;var s=function(p){return["bar","rangeBar","candlestick","boxPlot"].includes(p)},r=a.chart.type,o=0,l=s(r)?a.series.length:1;i.comboBarCount>0&&(l=i.comboBarCount),i.collapsedSeries.forEach(function(p){s(p.type)&&(l-=1)}),a.chart.stacked&&(l=1);var h=s(r)||i.comboBarCount>0,d=Math.abs(i.initialMaxX-i.initialMinX);if(h&&i.isXNumeric&&!i.isBarHorizontal&&l>0&&d!==0){d<=3&&(d=i.dataPoints);var u=d/e,g=i.minXDiff&&i.minXDiff/u>0?i.minXDiff/u:0;g>e/2&&(g/=2),(o=g*parseInt(a.plotOptions.bar.columnWidth,10)/100)<1&&(o=1),i.barPadForNumericAxis=o}return o}},{key:"gridPadFortitleSubtitle",value:function(){var e=this,t=this.w,a=t.globals,i=this.dCtx.isSparkline||!a.axisCharts?0:10;["title","subtitle"].forEach(function(o){t.config[o].text!==void 0?i+=t.config[o].margin:i+=e.dCtx.isSparkline||!a.axisCharts?0:5}),!t.config.legend.show||t.config.legend.position!=="bottom"||t.config.legend.floating||a.axisCharts||(i+=10);var s=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),r=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");a.gridHeight-=s.height+r.height+i,a.translateY+=s.height+r.height+i}},{key:"setGridXPosForDualYAxis",value:function(e,t){var a=this.w,i=new yt(this.dCtx.ctx);a.config.yaxis.forEach(function(s,r){a.globals.ignoreYAxisIndexes.indexOf(r)!==-1||s.floating||i.isYAxisHidden(r)||(s.opposite&&(a.globals.translateX-=t[r].width+e[r].width+parseInt(s.labels.style.fontSize,10)/1.2+12),a.globals.translateX<2&&(a.globals.translateX=2))})}}]),n}(),Ia=function(){function n(e){q(this,n),this.ctx=e,this.w=e.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 $o(this),this.dimYAxis=new qo(this),this.dimXAxis=new Uo(this),this.dimGrid=new Zo(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}return Z(n,[{key:"plotCoords",value:function(){var e=this,t=this.w,a=t.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};var i=Array.isArray(t.config.stroke.width)?Math.max.apply(Math,Pe(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(r){var o=xs(r,2),l=o[0],h=o[1];e.gridPad[l]=Math.max(h,e.w.globals.markers.largestSize/1.5)}),this.gridPad.top=Math.max(i/2,this.gridPad.top),this.gridPad.bottom=Math.max(i/2,this.gridPad.bottom)),a.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),a.gridHeight=a.gridHeight-this.gridPad.top-this.gridPad.bottom,a.gridWidth=a.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var s=this.dimGrid.gridPadForColumnsInNumericAxis(a.gridWidth);a.gridWidth=a.gridWidth-2*s,a.translateX=a.translateX+this.gridPad.left+this.xPadLeft+(s>0?s:0),a.translateY=a.translateY+this.gridPad.top}},{key:"setDimensionsForAxisCharts",value:function(){var e=this,t=this.w,a=t.globals,i=this.dimYAxis.getyAxisLabelsCoords(),s=this.dimYAxis.getyAxisTitleCoords();a.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.globals.yLabelsCoords=[],t.globals.yTitleCoords=[],t.config.yaxis.map(function(p,f){t.globals.yLabelsCoords.push({width:i[f].width,index:f}),t.globals.yTitleCoords.push({width:s[f].width,index:f})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var r=this.dimXAxis.getxAxisLabelsCoords(),o=this.dimXAxis.getxAxisGroupLabelsCoords(),l=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(r,l,o),a.translateXAxisY=t.globals.rotateXLabels?this.xAxisHeight/8:-4,a.translateXAxisX=t.globals.rotateXLabels&&t.globals.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(a.rotateXLabels=!1,a.translateXAxisY=parseInt(t.config.xaxis.labels.style.fontSize,10)/1.5*-1),a.translateXAxisY=a.translateXAxisY+t.config.xaxis.labels.offsetY,a.translateXAxisX=a.translateXAxisX+t.config.xaxis.labels.offsetX;var h=this.yAxisWidth,d=this.xAxisHeight;a.xAxisLabelsHeight=this.xAxisHeight-l.height,a.xAxisGroupLabelsHeight=a.xAxisLabelsHeight-r.height,a.xAxisLabelsWidth=this.xAxisWidth,a.xAxisHeight=this.xAxisHeight;var u=10;(t.config.chart.type==="radar"||this.isSparkline)&&(h=0,d=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||t.config.chart.type==="treemap")&&(h=0,d=0,u=0),this.isSparkline||t.config.chart.type==="treemap"||this.dimXAxis.additionalPaddingXLabels(r);var g=function(){a.translateX=h+e.datalabelsCoords.width,a.gridHeight=a.svgHeight-e.lgRect.height-d-(e.isSparkline||t.config.chart.type==="treemap"?0:t.globals.rotateXLabels?10:15),a.gridWidth=a.svgWidth-h-2*e.datalabelsCoords.width};switch(t.config.xaxis.position==="top"&&(u=a.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":a.translateY=u,g();break;case"top":a.translateY=this.lgRect.height+u,g();break;case"left":a.translateY=u,a.translateX=this.lgRect.width+h+this.datalabelsCoords.width,a.gridHeight=a.svgHeight-d-12,a.gridWidth=a.svgWidth-this.lgRect.width-h-2*this.datalabelsCoords.width;break;case"right":a.translateY=u,a.translateX=h+this.datalabelsCoords.width,a.gridHeight=a.svgHeight-d-12,a.gridWidth=a.svgWidth-this.lgRect.width-h-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(s,i),new Ri(this.ctx).setYAxisXPosition(i,s)}},{key:"setDimensionsForNonAxisCharts",value:function(){var e=this.w,t=e.globals,a=e.config,i=0;e.config.legend.show&&!e.config.legend.floating&&(i=20);var s=a.chart.type==="pie"||a.chart.type==="polarArea"||a.chart.type==="donut"?"pie":"radialBar",r=a.plotOptions[s].offsetY,o=a.plotOptions[s].offsetX;if(!a.legend.show||a.legend.floating){t.gridHeight=t.svgHeight;var l=t.dom.elWrap.getBoundingClientRect().width;return t.gridWidth=Math.min(l,t.gridHeight),t.translateY=r,void(t.translateX=o+(t.svgWidth-t.gridWidth)/2)}switch(a.legend.position){case"bottom":t.gridHeight=t.svgHeight-this.lgRect.height,t.gridWidth=t.svgWidth,t.translateY=r-10,t.translateX=o+(t.svgWidth-t.gridWidth)/2;break;case"top":t.gridHeight=t.svgHeight-this.lgRect.height,t.gridWidth=t.svgWidth,t.translateY=this.lgRect.height+r+10,t.translateX=o+(t.svgWidth-t.gridWidth)/2;break;case"left":t.gridWidth=t.svgWidth-this.lgRect.width-i,t.gridHeight=a.chart.height!=="auto"?t.svgHeight:t.gridWidth,t.translateY=r,t.translateX=o+this.lgRect.width+i;break;case"right":t.gridWidth=t.svgWidth-this.lgRect.width-i-5,t.gridHeight=a.chart.height!=="auto"?t.svgHeight:t.gridWidth,t.translateY=r,t.translateX=o+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(e,t,a){var i=this.w,s=i.globals.hasXaxisGroups?2:1,r=a.height+e.height+t.height,o=i.globals.isMultiLineX?1.2:i.globals.LINE_HEIGHT_RATIO,l=i.globals.rotateXLabels?22:10,h=i.globals.rotateXLabels&&i.config.legend.position==="bottom"?10:0;this.xAxisHeight=r*o+s*l+h,this.xAxisWidth=e.width,this.xAxisHeight-t.height>i.config.xaxis.labels.maxHeight&&(this.xAxisHeight=i.config.xaxis.labels.maxHeight),i.config.xaxis.labels.minHeight&&this.xAxisHeight<i.config.xaxis.labels.minHeight&&(this.xAxisHeight=i.config.xaxis.labels.minHeight),i.config.xaxis.floating&&(this.xAxisHeight=0);var d=0,u=0;i.config.yaxis.forEach(function(g){d+=g.labels.minWidth,u+=g.labels.maxWidth}),this.yAxisWidth<d&&(this.yAxisWidth=d),this.yAxisWidth>u&&(this.yAxisWidth=u)}}]),n}(),Ko=function(){function n(e){q(this,n),this.w=e.w,this.lgCtx=e}return Z(n,[{key:"getLegendStyles",value:function(){var e,t,a,i=document.createElement("style");i.setAttribute("type","text/css");var s=((e=this.lgCtx.ctx)===null||e===void 0||(t=e.opts)===null||t===void 0||(a=t.chart)===null||a===void 0?void 0:a.nonce)||this.w.config.chart.nonce;s&&i.setAttribute("nonce",s);var r=document.createTextNode(`
|
|
67
|
+
.apexcharts-flip-y {
|
|
68
|
+
transform: scaleY(-1) translateY(-100%);
|
|
69
|
+
transform-origin: top;
|
|
70
|
+
transform-box: fill-box;
|
|
71
|
+
}
|
|
72
|
+
.apexcharts-flip-x {
|
|
73
|
+
transform: scaleX(-1);
|
|
74
|
+
transform-origin: center;
|
|
75
|
+
transform-box: fill-box;
|
|
76
|
+
}
|
|
77
|
+
.apexcharts-legend {
|
|
78
|
+
display: flex;
|
|
79
|
+
overflow: auto;
|
|
80
|
+
padding: 0 10px;
|
|
81
|
+
}
|
|
82
|
+
.apexcharts-legend.apexcharts-legend-group-horizontal {
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
}
|
|
85
|
+
.apexcharts-legend-group {
|
|
86
|
+
display: flex;
|
|
87
|
+
}
|
|
88
|
+
.apexcharts-legend-group-vertical {
|
|
89
|
+
flex-direction: column-reverse;
|
|
90
|
+
}
|
|
91
|
+
.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {
|
|
92
|
+
flex-wrap: wrap
|
|
93
|
+
}
|
|
94
|
+
.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
bottom: 0;
|
|
97
|
+
}
|
|
98
|
+
.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 {
|
|
99
|
+
justify-content: flex-start;
|
|
100
|
+
align-items: flex-start;
|
|
101
|
+
}
|
|
102
|
+
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
}
|
|
106
|
+
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {
|
|
107
|
+
justify-content: flex-end;
|
|
108
|
+
align-items: flex-end;
|
|
109
|
+
}
|
|
110
|
+
.apexcharts-legend-series {
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
line-height: normal;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
}
|
|
116
|
+
.apexcharts-legend-text {
|
|
117
|
+
position: relative;
|
|
118
|
+
font-size: 14px;
|
|
119
|
+
}
|
|
120
|
+
.apexcharts-legend-text *, .apexcharts-legend-marker * {
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
}
|
|
123
|
+
.apexcharts-legend-marker {
|
|
124
|
+
position: relative;
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
justify-content: center;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
margin-right: 1px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.apexcharts-legend-series.apexcharts-no-click {
|
|
133
|
+
cursor: auto;
|
|
134
|
+
}
|
|
135
|
+
.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {
|
|
136
|
+
display: none !important;
|
|
137
|
+
}
|
|
138
|
+
.apexcharts-inactive-legend {
|
|
139
|
+
opacity: 0.45;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
`);return i.appendChild(r),i}},{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 a=this,i=this.w;if(i.globals.axisCharts||i.config.chart.type==="radialBar"){i.globals.resized=!0;var s=null,r=null;i.globals.risingSeries=[],i.globals.axisCharts?(s=i.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(e,"']")),r=parseInt(s.getAttribute("data:realIndex"),10)):(s=i.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(e+1,"']")),r=parseInt(s.getAttribute("rel"),10)-1),t?[{cs:i.globals.collapsedSeries,csi:i.globals.collapsedSeriesIndices},{cs:i.globals.ancillaryCollapsedSeries,csi:i.globals.ancillaryCollapsedSeriesIndices}].forEach(function(d){a.riseCollapsedSeries(d.cs,d.csi,r)}):this.hideSeries({seriesEl:s,realIndex:r})}else{var o=i.globals.dom.Paper.findOne(" .apexcharts-series[rel='".concat(e+1,"'] path")),l=i.config.chart.type;if(l==="pie"||l==="polarArea"||l==="donut"){var h=i.config.plotOptions.pie.donut.labels;new O(this.lgCtx.ctx).pathMouseDown(o,null),this.lgCtx.ctx.pie.printDataLabelsInner(o.node,h)}o.fire("click")}}},{key:"getSeriesAfterCollapsing",value:function(e){var t=e.realIndex,a=this.w,i=a.globals,s=R.clone(a.config.series);if(i.axisCharts){var r=a.config.yaxis[i.seriesYAxisReverseMap[t]],o={index:t,data:s[t].data.slice(),type:s[t].type||a.config.chart.type};if(r&&r.show&&r.showAlways)i.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(i.ancillaryCollapsedSeries.push(o),i.ancillaryCollapsedSeriesIndices.push(t));else if(i.collapsedSeriesIndices.indexOf(t)<0){i.collapsedSeries.push(o),i.collapsedSeriesIndices.push(t);var l=i.risingSeries.indexOf(t);i.risingSeries.splice(l,1)}}else i.collapsedSeries.push({index:t,data:s[t]}),i.collapsedSeriesIndices.push(t);return i.allSeriesCollapsed=i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===a.config.series.length,this._getSeriesBasedOnCollapsedState(s)}},{key:"hideSeries",value:function(e){for(var t=e.seriesEl,a=e.realIndex,i=this.w,s=this.getSeriesAfterCollapsing({realIndex:a}),r=t.childNodes,o=0;o<r.length;o++)r[o].classList.contains("apexcharts-series-markers-wrap")&&(r[o].classList.contains("apexcharts-hide")?r[o].classList.remove("apexcharts-hide"):r[o].classList.add("apexcharts-hide"));this.lgCtx.ctx.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled)}},{key:"riseCollapsedSeries",value:function(e,t,a){var i=this.w,s=R.clone(i.config.series);if(e.length>0){for(var r=0;r<e.length;r++)e[r].index===a&&(i.globals.axisCharts?s[a].data=e[r].data.slice():s[a]=e[r].data,typeof s[a]!="number"&&(s[a].hidden=!1),e.splice(r,1),t.splice(r,1),i.globals.risingSeries.push(a));s=this._getSeriesBasedOnCollapsedState(s),this.lgCtx.ctx.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled)}}},{key:"_getSeriesBasedOnCollapsedState",value:function(e){var t=this.w,a=0;return t.globals.axisCharts?e.forEach(function(i,s){t.globals.collapsedSeriesIndices.indexOf(s)<0&&t.globals.ancillaryCollapsedSeriesIndices.indexOf(s)<0||(e[s].data=[],a++)}):e.forEach(function(i,s){!t.globals.collapsedSeriesIndices.indexOf(s)<0&&(e[s]=0,a++)}),t.globals.allSeriesCollapsed=a===e.length,e}}]),n}(),or=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed=this.w.config.chart.type==="bar"&&this.w.config.plotOptions.bar.distributed&&this.w.config.series.length===1,this.legendHelpers=new Ko(this)}return Z(n,[{key:"init",value:function(){var e=this.w,t=e.globals,a=e.config,i=a.legend.showForSingleSeries&&t.series.length===1||this.isBarsDistributed||t.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!t.axisCharts)&&a.legend.show){for(;t.dom.elLegendWrap.firstChild;)t.dom.elLegendWrap.removeChild(t.dom.elLegendWrap.firstChild);this.drawLegends(),a.legend.position==="bottom"||a.legend.position==="top"?this.legendAlignHorizontal():a.legend.position!=="right"&&a.legend.position!=="left"||this.legendAlignVertical()}}},{key:"createLegendMarker",value:function(e){var t=e.i,a=e.fillcolor,i=this.w,s=document.createElement("span");s.classList.add("apexcharts-legend-marker");var r=i.config.legend.markers.shape||i.config.markers.shape,o=r;Array.isArray(r)&&(o=r[t]);var l=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),h=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),d=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),u=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),g=s.style;if(g.height=2*(l+u)+"px",g.width=2*(l+u)+"px",g.left=h+"px",g.top=d+"px",i.config.legend.markers.customHTML)g.background="transparent",g.color=a[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{var p=new Ut(this.ctx).getMarkerConfig({cssClass:"apexcharts-legend-marker apexcharts-marker apexcharts-marker-".concat(o),seriesIndex:t,strokeWidth:u,size:l}),f=window.SVG().addTo(s).size("100%","100%"),m=new O(this.ctx).drawMarker(0,0,G(G({},p),{},{pointFillColor:Array.isArray(a)?a[t]:p.pointFillColor,shape:o}));i.globals.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(function(x){x.node.classList.contains("apexcharts-marker-triangle")?x.node.style.transform="translate(50%, 45%)":x.node.style.transform="translate(50%, 50%)"}),f.add(m)}return s}},{key:"drawLegends",value:function(){var e=this,t=this,a=this.w,i=a.config.legend.fontFamily,s=a.globals.seriesNames,r=a.config.legend.markers.fillColors?a.config.legend.markers.fillColors.slice():a.globals.colors.slice();if(a.config.chart.type==="heatmap"){var o=a.config.plotOptions.heatmap.colorScale.ranges;s=o.map(function(p){return p.name?p.name:p.from+" - "+p.to}),r=o.map(function(p){return p.color})}else this.isBarsDistributed&&(s=a.globals.labels.slice());a.config.legend.customLegendItems.length&&(s=a.config.legend.customLegendItems);var l=a.globals.legendFormatter,h=a.config.legend.inverseOrder,d=[];a.globals.seriesGroups.length>1&&a.config.legend.clusterGroupedSeries&&a.globals.seriesGroups.forEach(function(p,f){d[f]=document.createElement("div"),d[f].classList.add("apexcharts-legend-group","apexcharts-legend-group-".concat(f)),a.config.legend.clusterGroupedSeriesOrientation==="horizontal"?a.globals.dom.elLegendWrap.classList.add("apexcharts-legend-group-horizontal"):d[f].classList.add("apexcharts-legend-group-vertical")});for(var u=function(p){var f,m=l(s[p],{seriesIndex:p,w:a}),x=!1,b=!1;if(a.globals.collapsedSeries.length>0)for(var v=0;v<a.globals.collapsedSeries.length;v++)a.globals.collapsedSeries[v].index===p&&(x=!0);if(a.globals.ancillaryCollapsedSeriesIndices.length>0)for(var w=0;w<a.globals.ancillaryCollapsedSeriesIndices.length;w++)a.globals.ancillaryCollapsedSeriesIndices[w]===p&&(b=!0);var k=e.createLegendMarker({i:p,fillcolor:r});O.setAttrs(k,{rel:p+1,"data:collapsed":x||b}),(x||b)&&k.classList.add("apexcharts-inactive-legend");var y=document.createElement("div"),E=document.createElement("span");E.classList.add("apexcharts-legend-text"),E.innerHTML=Array.isArray(m)?m.join(" "):m;var S=a.config.legend.labels.useSeriesColors?a.globals.colors[p]:Array.isArray(a.config.legend.labels.colors)?(f=a.config.legend.labels.colors)===null||f===void 0?void 0:f[p]:a.config.legend.labels.colors;S||(S=a.config.chart.foreColor),E.style.color=S,E.style.fontSize=parseFloat(a.config.legend.fontSize)+"px",E.style.fontWeight=a.config.legend.fontWeight,E.style.fontFamily=i||a.config.chart.fontFamily,O.setAttrs(E,{rel:p+1,i:p,"data:default-text":encodeURIComponent(m),"data:collapsed":x||b}),y.appendChild(k),y.appendChild(E);var C=new Le(e.ctx);a.config.legend.showForZeroSeries||C.getSeriesTotalByIndex(p)===0&&C.seriesHaveSameValues(p)&&!C.isSeriesNull(p)&&a.globals.collapsedSeriesIndices.indexOf(p)===-1&&a.globals.ancillaryCollapsedSeriesIndices.indexOf(p)===-1&&y.classList.add("apexcharts-hidden-zero-series"),a.config.legend.showForNullSeries||C.isSeriesNull(p)&&a.globals.collapsedSeriesIndices.indexOf(p)===-1&&a.globals.ancillaryCollapsedSeriesIndices.indexOf(p)===-1&&y.classList.add("apexcharts-hidden-null-series"),d.length?a.globals.seriesGroups.forEach(function(N,L){var A;N.includes((A=a.config.series[p])===null||A===void 0?void 0:A.name)&&(a.globals.dom.elLegendWrap.appendChild(d[L]),d[L].appendChild(y))}):a.globals.dom.elLegendWrap.appendChild(y),a.globals.dom.elLegendWrap.classList.add("apexcharts-align-".concat(a.config.legend.horizontalAlign)),a.globals.dom.elLegendWrap.classList.add("apx-legend-position-"+a.config.legend.position),y.classList.add("apexcharts-legend-series"),y.style.margin="".concat(a.config.legend.itemMargin.vertical,"px ").concat(a.config.legend.itemMargin.horizontal,"px"),a.globals.dom.elLegendWrap.style.width=a.config.legend.width?a.config.legend.width+"px":"",a.globals.dom.elLegendWrap.style.height=a.config.legend.height?a.config.legend.height+"px":"",O.setAttrs(y,{rel:p+1,seriesName:R.escapeString(s[p]),"data:collapsed":x||b}),(x||b)&&y.classList.add("apexcharts-inactive-legend"),a.config.legend.onItemClick.toggleDataSeries||y.classList.add("apexcharts-no-click")},g=h?s.length-1:0;h?g>=0:g<=s.length-1;h?g--:g++)u(g);a.globals.dom.elWrap.addEventListener("click",t.onLegendClick,!0),a.config.legend.onItemHover.highlightDataSeries&&a.config.legend.customLegendItems.length===0&&(a.globals.dom.elWrap.addEventListener("mousemove",t.onLegendHovered,!0),a.globals.dom.elWrap.addEventListener("mouseout",t.onLegendHovered,!0))}},{key:"setLegendWrapXY",value:function(e,t){var a=this.w,i=a.globals.dom.elLegendWrap,s=i.clientHeight,r=0,o=0;if(a.config.legend.position==="bottom")o=a.globals.svgHeight-Math.min(s,a.globals.svgHeight/2)-5;else if(a.config.legend.position==="top"){var l=new Ia(this.ctx),h=l.dimHelpers.getTitleSubtitleCoords("title").height,d=l.dimHelpers.getTitleSubtitleCoords("subtitle").height;o=(h>0?h-10:0)+(d>0?d-10:0)}i.style.position="absolute",r=r+e+a.config.legend.offsetX,o=o+t+a.config.legend.offsetY,i.style.left=r+"px",i.style.top=o+"px",a.config.legend.position==="right"&&(i.style.left="auto",i.style.right=25+a.config.legend.offsetX+"px"),["width","height"].forEach(function(u){i.style[u]&&(i.style[u]=parseInt(a.config.legend[u],10)+"px")})}},{key:"legendAlignHorizontal",value:function(){var e=this.w;e.globals.dom.elLegendWrap.style.right=0;var t=new Ia(this.ctx),a=t.dimHelpers.getTitleSubtitleCoords("title"),i=t.dimHelpers.getTitleSubtitleCoords("subtitle"),s=0;e.config.legend.position==="top"&&(s=a.height+i.height+e.config.title.margin+e.config.subtitle.margin-10),this.setLegendWrapXY(20,s)}},{key:"legendAlignVertical",value:function(){var e=this.w,t=this.legendHelpers.getLegendDimensions(),a=0;e.config.legend.position==="left"&&(a=20),e.config.legend.position==="right"&&(a=e.globals.svgWidth-t.clww-10),this.setLegendWrapXY(a,20)}},{key:"onLegendHovered",value:function(e){var t=this.w,a=e.target.classList.contains("apexcharts-legend-series")||e.target.classList.contains("apexcharts-legend-text")||e.target.classList.contains("apexcharts-legend-marker");if(t.config.chart.type==="heatmap"||this.isBarsDistributed){if(a){var i=parseInt(e.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,i,this.w]),new et(this.ctx).highlightRangeInSeries(e,e.target)}}else!e.target.classList.contains("apexcharts-inactive-legend")&&a&&new et(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 a=parseInt(e.target.getAttribute("rel"),10)-1,i=e.target.getAttribute("data:collapsed")==="true",s=this.w.config.chart.events.legendClick;typeof s=="function"&&s(this.ctx,a,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,a,this.w]);var r=this.w.config.legend.markers.onClick;typeof r=="function"&&e.target.classList.contains("apexcharts-legend-marker")&&(r(this.ctx,a,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,a,this.w])),t.config.chart.type!=="treemap"&&t.config.chart.type!=="heatmap"&&!this.isBarsDistributed&&t.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(a,i)}}}]),n}(),lr=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w;var t=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=t.globals.minX,this.maxX=t.globals.maxX}return Z(n,[{key:"createToolbar",value:function(){var e=this,t=this.w,a=function(){return document.createElement("div")},i=a();if(i.setAttribute("class","apexcharts-toolbar"),i.style.top=t.config.chart.toolbar.offsetY+"px",i.style.right=3-t.config.chart.toolbar.offsetX+"px",t.globals.dom.elWrap.appendChild(i),this.elZoom=a(),this.elZoomIn=a(),this.elZoomOut=a(),this.elPan=a(),this.elSelection=a(),this.elZoomReset=a(),this.elMenuIcon=a(),this.elMenu=a(),this.elCustomIcons=[],this.t=t.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var s=0;s<this.t.customIcons.length;s++)this.elCustomIcons.push(a());var r=[],o=function(u,g,p){var f=u.toLowerCase();e.t[f]&&t.config.chart.zoom.enabled&&r.push({el:g,icon:typeof e.t[f]=="string"?e.t[f]:p,title:e.localeValues[u],class:"apexcharts-".concat(f,"-icon")})};o("zoomIn",this.elZoomIn,`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
143
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
144
|
+
<path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
|
|
145
|
+
</svg>
|
|
146
|
+
`),o("zoomOut",this.elZoomOut,`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
147
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
148
|
+
<path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
|
|
149
|
+
</svg>
|
|
150
|
+
`);var l=function(u){e.t[u]&&t.config.chart[u].enabled&&r.push({el:u==="zoom"?e.elZoom:e.elSelection,icon:typeof e.t[u]=="string"?e.t[u]:u==="zoom"?`<svg xmlns="http://www.w3.org/2000/svg" fill="#000000" height="24" viewBox="0 0 24 24" width="24">
|
|
151
|
+
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
|
|
152
|
+
<path d="M0 0h24v24H0V0z" fill="none"/>
|
|
153
|
+
<path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>
|
|
154
|
+
</svg>`:`<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
155
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
156
|
+
<path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>
|
|
157
|
+
</svg>`,title:e.localeValues[u==="zoom"?"selectionZoom":"selection"],class:t.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-".concat(u,"-icon")})};l("zoom"),l("selection"),this.t.pan&&t.config.chart.zoom.enabled&&r.push({el:this.elPan,icon:typeof this.t.pan=="string"?this.t.pan:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">
|
|
158
|
+
<defs>
|
|
159
|
+
<path d="M0 0h24v24H0z" id="a"/>
|
|
160
|
+
</defs>
|
|
161
|
+
<clipPath id="b">
|
|
162
|
+
<use overflow="visible" xlink:href="#a"/>
|
|
163
|
+
</clipPath>
|
|
164
|
+
<path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>
|
|
165
|
+
</svg>`,title:this.localeValues.pan,class:t.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-pan-icon"}),o("reset",this.elZoomReset,`<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
166
|
+
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
|
|
167
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
168
|
+
</svg>`),this.t.download&&r.push({el:this.elMenuIcon,icon:typeof this.t.download=="string"?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var h=0;h<this.elCustomIcons.length;h++)r.push({el:this.elCustomIcons[h],icon:this.t.customIcons[h].icon,title:this.t.customIcons[h].title,index:this.t.customIcons[h].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[h].class});r.forEach(function(u,g){u.index&&R.moveIndexInArray(r,g,u.index)});for(var d=0;d<r.length;d++)O.setAttrs(r[d].el,{class:r[d].class,title:r[d].title}),r[d].el.innerHTML=r[d].icon,i.appendChild(r[d].el);this._createHamburgerMenu(i),t.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):t.globals.panEnabled?this.elPan.classList.add(this.selectedClass):t.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}},{key:"_createHamburgerMenu",value:function(e){this.elMenuItems=[],e.appendChild(this.elMenu),O.setAttrs(this.elMenu,{class:"apexcharts-menu"});for(var t=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}],a=0;a<t.length;a++)this.elMenuItems.push(document.createElement("div")),this.elMenuItems[a].innerHTML=t[a].title,O.setAttrs(this.elMenuItems[a],{class:"apexcharts-menu-item ".concat(t[a].name),title:t[a].title}),this.elMenu.appendChild(this.elMenuItems[a])}},{key:"addToolbarEventListeners",value:function(){var e=this;this.elZoomReset.addEventListener("click",this.handleZoomReset.bind(this)),this.elSelection.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),this.elZoom.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),this.elZoomIn.addEventListener("click",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener("click",this.handleZoomOut.bind(this)),this.elPan.addEventListener("click",this.togglePanning.bind(this)),this.elMenuIcon.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(function(a){a.classList.contains("exportSVG")?a.addEventListener("click",e.handleDownload.bind(e,"svg")):a.classList.contains("exportPNG")?a.addEventListener("click",e.handleDownload.bind(e,"png")):a.classList.contains("exportCSV")&&a.addEventListener("click",e.handleDownload.bind(e,"csv"))});for(var t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w))}},{key:"toggleZoomSelection",value:function(e){this.ctx.getSyncedCharts().forEach(function(t){t.ctx.toolbar.toggleOtherControls();var a=e==="selection"?t.ctx.toolbar.elSelection:t.ctx.toolbar.elZoom,i=e==="selection"?"selectionEnabled":"zoomEnabled";t.w.globals[i]=!t.w.globals[i],a.classList.contains(t.ctx.toolbar.selectedClass)?a.classList.remove(t.ctx.toolbar.selectedClass):a.classList.add(t.ctx.toolbar.selectedClass)})}},{key:"getToolbarIconsReference",value:function(){var e=this.w;this.elZoom||(this.elZoom=e.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=e.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=e.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}},{key:"enableZoomPanFromToolbar",value:function(e){this.toggleOtherControls(),e==="pan"?this.w.globals.panEnabled=!0:this.w.globals.zoomEnabled=!0;var t=e==="pan"?this.elPan:this.elZoom,a=e==="pan"?this.elZoom:this.elPan;t&&t.classList.add(this.selectedClass),a&&a.classList.remove(this.selectedClass)}},{key:"togglePanning",value:function(){this.ctx.getSyncedCharts().forEach(function(e){e.ctx.toolbar.toggleOtherControls(),e.w.globals.panEnabled=!e.w.globals.panEnabled,e.ctx.toolbar.elPan.classList.contains(e.ctx.toolbar.selectedClass)?e.ctx.toolbar.elPan.classList.remove(e.ctx.toolbar.selectedClass):e.ctx.toolbar.elPan.classList.add(e.ctx.toolbar.selectedClass)})}},{key:"toggleOtherControls",value:function(){var e=this,t=this.w;t.globals.panEnabled=!1,t.globals.zoomEnabled=!1,t.globals.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach(function(a){a&&a.classList.remove(e.selectedClass)})}},{key:"handleZoomIn",value:function(){var e=this.w;e.globals.isRangeBar&&(this.minX=e.globals.minY,this.maxX=e.globals.maxY);var t=(this.minX+this.maxX)/2,a=(this.minX+t)/2,i=(this.maxX+t)/2,s=this._getNewMinXMaxX(a,i);e.globals.disableZoomIn||this.zoomUpdateOptions(s.minX,s.maxX)}},{key:"handleZoomOut",value:function(){var e=this.w;if(e.globals.isRangeBar&&(this.minX=e.globals.minY,this.maxX=e.globals.maxY),!(e.config.xaxis.type==="datetime"&&new Date(this.minX).getUTCFullYear()<1e3)){var t=(this.minX+this.maxX)/2,a=this.minX-(t-this.minX),i=this.maxX-(t-this.maxX),s=this._getNewMinXMaxX(a,i);e.globals.disableZoomOut||this.zoomUpdateOptions(s.minX,s.maxX)}}},{key:"_getNewMinXMaxX",value:function(e,t){var a=this.w.config.xaxis.convertedCatToNumeric;return{minX:a?Math.floor(e):e,maxX:a?Math.floor(t):t}}},{key:"zoomUpdateOptions",value:function(e,t){var a=this.w;if(e!==void 0||t!==void 0){if(!(a.config.xaxis.convertedCatToNumeric&&(e<1&&(e=1,t=a.globals.dataPoints),t-e<2))){var i={min:e,max:t},s=this.getBeforeZoomRange(i);s&&(i=s.xaxis);var r={xaxis:i},o=R.clone(a.globals.initialConfig.yaxis);a.config.chart.group||(r.yaxis=o),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(i,o)}}else this.handleZoomReset()}},{key:"zoomCallback",value:function(e,t){typeof this.ev.zoomed=="function"&&(this.ev.zoomed(this.ctx,{xaxis:e,yaxis:t}),this.ctx.events.fireEvent("zoomed",{xaxis:e,yaxis:t}))}},{key:"getBeforeZoomRange",value:function(e,t){var a=null;return typeof this.ev.beforeZoom=="function"&&(a=this.ev.beforeZoom(this,{xaxis:e,yaxis:t})),a}},{key:"toggleMenu",value:function(){var e=this;window.setTimeout(function(){e.elMenu.classList.contains("apexcharts-menu-open")?e.elMenu.classList.remove("apexcharts-menu-open"):e.elMenu.classList.add("apexcharts-menu-open")},0)}},{key:"handleDownload",value:function(e){var t=this.w,a=new ma(this.ctx);switch(e){case"svg":a.exportToSVG(this.ctx);break;case"png":a.exportToPng(this.ctx);break;case"csv":a.exportToCSV({series:t.config.series,columnDelimiter:t.config.chart.toolbar.export.csv.columnDelimiter})}}},{key:"handleZoomReset",value:function(e){this.ctx.getSyncedCharts().forEach(function(t){var a=t.w;if(a.globals.lastXAxis.min=a.globals.initialConfig.xaxis.min,a.globals.lastXAxis.max=a.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),typeof a.config.chart.events.beforeResetZoom=="function"){var i=a.config.chart.events.beforeResetZoom(t,a);i&&t.updateHelpers.revertDefaultAxisMinMax(i)}typeof a.config.chart.events.zoomed=="function"&&t.ctx.toolbar.zoomCallback({min:a.config.xaxis.min,max:a.config.xaxis.max}),a.globals.zoomed=!1;var s=t.ctx.series.emptyCollapsedSeries(R.clone(a.globals.initialSeries));t.updateHelpers._updateSeries(s,a.config.chart.animations.dynamicAnimation.enabled)})}},{key:"destroy",value:function(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}]),n}(),Jo=function(n){sa(t,lr);var e=ia(t);function t(a){var i;return q(this,t),(i=e.call(this,a)).ctx=a,i.w=a.w,i.dragged=!1,i.graphics=new O(i.ctx),i.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],i.clientX=0,i.clientY=0,i.startX=0,i.endX=0,i.dragX=0,i.startY=0,i.endY=0,i.dragY=0,i.moveDirection="none",i.debounceTimer=null,i.debounceDelay=100,i.wheelDelay=400,i}return Z(t,[{key:"init",value:function(a){var i=this,s=a.xyRatios,r=this.w,o=this;this.xyRatios=s,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=r.globals.dom.baseEl.querySelector(".apexcharts-grid"),this.constraints=new Me(0,0,r.globals.gridWidth,r.globals.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),r.globals.dom.Paper.add(this.zoomRect),r.globals.dom.Paper.add(this.selectionRect),r.config.chart.selection.type==="x"?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:r.globals.gridWidth,maxY:r.globals.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):r.config.chart.selection.type==="y"?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:r.globals.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=r.globals.dom.baseEl.querySelector("".concat(r.globals.chartClass," .apexcharts-svg")),this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(function(l){i.hoverArea.addEventListener(l,o.svgMouseEvents.bind(o,s),{capture:!1,passive:!0})}),r.config.chart.zoom.enabled&&r.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",o.mouseWheelEvent.bind(o),{capture:!1,passive:!1})}},{key:"destroy",value:function(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}},{key:"svgMouseEvents",value:function(a,i){var s=this.w,r=this.ctx.toolbar,o=s.globals.zoomEnabled?s.config.chart.zoom.type:s.config.chart.selection.type,l=s.config.chart.toolbar.autoSelected;if(i.shiftKey?(this.shiftWasPressed=!0,r.enableZoomPanFromToolbar(l==="pan"?"zoom":"pan")):this.shiftWasPressed&&(r.enableZoomPanFromToolbar(l),this.shiftWasPressed=!1),i.target){var h,d=i.target.classList;if(i.target.parentNode&&i.target.parentNode!==null&&(h=i.target.parentNode.classList),!(d.contains("apexcharts-legend-marker")||d.contains("apexcharts-legend-text")||h&&h.contains("apexcharts-toolbar"))){if(this.clientX=i.type==="touchmove"||i.type==="touchstart"?i.touches[0].clientX:i.type==="touchend"?i.changedTouches[0].clientX:i.clientX,this.clientY=i.type==="touchmove"||i.type==="touchstart"?i.touches[0].clientY:i.type==="touchend"?i.changedTouches[0].clientY:i.clientY,i.type==="mousedown"&&i.which===1||i.type==="touchstart"){var u=this.gridRect.getBoundingClientRect();this.startX=this.clientX-u.left-s.globals.barPadForNumericAxis,this.startY=this.clientY-u.top,this.dragged=!1,this.w.globals.mousedown=!0}(i.type==="mousemove"&&i.which===1||i.type==="touchmove")&&(this.dragged=!0,s.globals.panEnabled?(s.globals.selection=null,this.w.globals.mousedown&&this.panDragging({context:this,zoomtype:o,xyRatios:a})):(this.w.globals.mousedown&&s.globals.zoomEnabled||this.w.globals.mousedown&&s.globals.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:o}))),i.type!=="mouseup"&&i.type!=="touchend"&&i.type!=="mouseleave"||this.handleMouseUp({zoomtype:o}),this.makeSelectionRectDraggable()}}}},{key:"handleMouseUp",value:function(a){var i,s=a.zoomtype,r=a.isResized,o=this.w,l=(i=this.gridRect)===null||i===void 0?void 0:i.getBoundingClientRect();l&&(this.w.globals.mousedown||r)&&(this.endX=this.clientX-l.left-o.globals.barPadForNumericAxis,this.endY=this.clientY-l.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(o.globals.zoomEnabled||o.globals.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:s})),o.globals.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.globals.mousedown=!1}},{key:"mouseWheelEvent",value:function(a){var i=this,s=this.w;a.preventDefault();var r=Date.now();r-s.globals.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(a),s.globals.lastWheelExecution=r),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(function(){r-s.globals.lastWheelExecution>i.wheelDelay&&(i.executeMouseWheelZoom(a),s.globals.lastWheelExecution=r)},this.debounceDelay)}},{key:"executeMouseWheelZoom",value:function(a){var i,s=this.w;this.minX=s.globals.isRangeBar?s.globals.minY:s.globals.minX,this.maxX=s.globals.isRangeBar?s.globals.maxY:s.globals.maxX;var r=(i=this.gridRect)===null||i===void 0?void 0:i.getBoundingClientRect();if(r){var o,l,h,d=(a.clientX-r.left)/r.width,u=this.minX,g=this.maxX,p=g-u;if(a.deltaY<0){var f=u+d*p;l=f-(o=.5*p)/2,h=f+o/2}else l=u-(o=1.5*p)/2,h=g+o/2;if(!s.globals.isRangeBar){l=Math.max(l,s.globals.initialMinX),h=Math.min(h,s.globals.initialMaxX);var m=.01*(s.globals.initialMaxX-s.globals.initialMinX);if(h-l<m){var x=(l+h)/2;l=x-m/2,h=x+m/2}}var b=this._getNewMinXMaxX(l,h);isNaN(b.minX)||isNaN(b.maxX)||this.zoomUpdateOptions(b.minX,b.maxX)}}},{key:"makeSelectionRectDraggable",value:function(){var a=this,i=this.w;if(this.selectionRect){var s=this.selectionRect.node.getBoundingClientRect();s.width>0&&s.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:function(){},updateRot:function(){},createHandle:function(r,o,l,h,d){return d==="l"||d==="r"?r.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):r.circle(0)},updateHandle:function(r,o){return r.center(o[0],o[1])}}).resize().on("resize",function(){var r=i.globals.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type;a.handleMouseUp({zoomtype:r,isResized:!0})}))}}},{key:"preselectedSelection",value:function(){var a=this.w,i=this.xyRatios;if(!a.globals.zoomEnabled){if(a.globals.selection!==void 0&&a.globals.selection!==null)this.drawSelectionRect(G(G({},a.globals.selection),{},{translateX:a.globals.translateX,translateY:a.globals.translateY}));else if(a.config.chart.selection.xaxis.min!==void 0&&a.config.chart.selection.xaxis.max!==void 0){var s=(a.config.chart.selection.xaxis.min-a.globals.minX)/i.xRatio,r=a.globals.gridWidth-(a.globals.maxX-a.config.chart.selection.xaxis.max)/i.xRatio-s;a.globals.isRangeBar&&(s=(a.config.chart.selection.xaxis.min-a.globals.yAxisScale[0].niceMin)/i.invertedYRatio,r=(a.config.chart.selection.xaxis.max-a.config.chart.selection.xaxis.min)/i.invertedYRatio);var o={x:s,y:0,width:r,height:a.globals.gridHeight,translateX:a.globals.translateX,translateY:a.globals.translateY,selectionEnabled:!0};this.drawSelectionRect(o),this.makeSelectionRectDraggable(),typeof a.config.chart.events.selection=="function"&&a.config.chart.events.selection(this.ctx,{xaxis:{min:a.config.chart.selection.xaxis.min,max:a.config.chart.selection.xaxis.max},yaxis:{}})}}}},{key:"drawSelectionRect",value:function(a){var i=a.x,s=a.y,r=a.width,o=a.height,l=a.translateX,h=l===void 0?0:l,d=a.translateY,u=d===void 0?0:d,g=this.w,p=this.zoomRect,f=this.selectionRect;if(this.dragged||g.globals.selection!==null){var m={transform:"translate("+h+", "+u+")"};g.globals.zoomEnabled&&this.dragged&&(r<0&&(r=1),p.attr({x:i,y:s,width:r,height:o,fill:g.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":g.config.chart.zoom.zoomedArea.fill.opacity,stroke:g.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":g.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":g.config.chart.zoom.zoomedArea.stroke.opacity}),O.setAttrs(p.node,m)),g.globals.selectionEnabled&&(f.attr({x:i,y:s,width:r>0?r:0,height:o>0?o:0,fill:g.config.chart.selection.fill.color,"fill-opacity":g.config.chart.selection.fill.opacity,stroke:g.config.chart.selection.stroke.color,"stroke-width":g.config.chart.selection.stroke.width,"stroke-dasharray":g.config.chart.selection.stroke.dashArray,"stroke-opacity":g.config.chart.selection.stroke.opacity}),O.setAttrs(f.node,m))}}},{key:"hideSelectionRect",value:function(a){a&&a.attr({x:0,y:0,width:0,height:0})}},{key:"selectionDrawing",value:function(a){var i=a.context,s=a.zoomtype,r=this.w,o=i,l=this.gridRect.getBoundingClientRect(),h=o.startX-1,d=o.startY,u=!1,g=!1,p=o.clientX-l.left-r.globals.barPadForNumericAxis,f=o.clientY-l.top,m=p-h,x=f-d,b={translateX:r.globals.translateX,translateY:r.globals.translateY};return Math.abs(m+h)>r.globals.gridWidth?m=r.globals.gridWidth-h:p<0&&(m=h),h>p&&(u=!0,m=Math.abs(m)),d>f&&(g=!0,x=Math.abs(x)),b=G(G({},b=s==="x"?{x:u?h-m:h,y:0,width:m,height:r.globals.gridHeight}:s==="y"?{x:0,y:g?d-x:d,width:r.globals.gridWidth,height:x}:{x:u?h-m:h,y:g?d-x:d,width:m,height:x}),{},{translateX:r.globals.translateX,translateY:r.globals.translateY}),o.drawSelectionRect(b),o.selectionDragging("resizing"),b}},{key:"selectionDragging",value:function(a,i){var s=this,r=this.w;if(i){i.preventDefault();var o=i.detail,l=o.handler,h=o.box,d=h.x,u=h.y;d<this.constraints.x&&(d=this.constraints.x),u<this.constraints.y&&(u=this.constraints.y),h.x2>this.constraints.x2&&(d=this.constraints.x2-h.w),h.y2>this.constraints.y2&&(u=this.constraints.y2-h.h),l.move(d,u);var g=this.xyRatios,p=this.selectionRect,f=0;a==="resizing"&&(f=30);var m=function(b){return parseFloat(p.node.getAttribute(b))},x={x:m("x"),y:m("y"),width:m("width"),height:m("height")};r.globals.selection=x,typeof r.config.chart.events.selection=="function"&&r.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(function(){var b,v,w,k,y=s.gridRect.getBoundingClientRect(),E=p.node.getBoundingClientRect();r.globals.isRangeBar?(b=r.globals.yAxisScale[0].niceMin+(E.left-y.left)*g.invertedYRatio,v=r.globals.yAxisScale[0].niceMin+(E.right-y.left)*g.invertedYRatio,w=0,k=1):(b=r.globals.xAxisScale.niceMin+(E.left-y.left)*g.xRatio,v=r.globals.xAxisScale.niceMin+(E.right-y.left)*g.xRatio,w=r.globals.yAxisScale[0].niceMin+(y.bottom-E.bottom)*g.yRatio[0],k=r.globals.yAxisScale[0].niceMax-(E.top-y.top)*g.yRatio[0]);var S={xaxis:{min:b,max:v},yaxis:{min:w,max:k}};r.config.chart.events.selection(s.ctx,S),r.config.chart.brush.enabled&&r.config.chart.events.brushScrolled!==void 0&&r.config.chart.events.brushScrolled(s.ctx,S)},f))}}},{key:"selectionDrawn",value:function(a){var i,s,r=a.context,o=a.zoomtype,l=this.w,h=r,d=this.xyRatios,u=this.ctx.toolbar,g=l.globals.zoomEnabled?h.zoomRect.node.getBoundingClientRect():h.selectionRect.node.getBoundingClientRect(),p=h.gridRect.getBoundingClientRect(),f=g.left-p.left-l.globals.barPadForNumericAxis,m=g.right-p.left-l.globals.barPadForNumericAxis,x=g.top-p.top,b=g.bottom-p.top;l.globals.isRangeBar?(i=l.globals.yAxisScale[0].niceMin+f*d.invertedYRatio,s=l.globals.yAxisScale[0].niceMin+m*d.invertedYRatio):(i=l.globals.xAxisScale.niceMin+f*d.xRatio,s=l.globals.xAxisScale.niceMin+m*d.xRatio);var v=[],w=[];if(l.config.yaxis.forEach(function(L,A){var M=l.globals.seriesYAxisMap[A][0],F=l.globals.yAxisScale[A].niceMax-d.yRatio[M]*x,z=l.globals.yAxisScale[A].niceMax-d.yRatio[M]*b;v.push(F),w.push(z)}),h.dragged&&(h.dragX>10||h.dragY>10)&&i!==s){if(l.globals.zoomEnabled){var k=R.clone(l.globals.initialConfig.yaxis),y=R.clone(l.globals.initialConfig.xaxis);if(l.globals.zoomed=!0,l.config.xaxis.convertedCatToNumeric&&(i=Math.floor(i),s=Math.floor(s),i<1&&(i=1,s=l.globals.dataPoints),s-i<2&&(s=i+1)),o!=="xy"&&o!=="x"||(y={min:i,max:s}),o!=="xy"&&o!=="y"||k.forEach(function(L,A){k[A].min=w[A],k[A].max=v[A]}),u){var E=u.getBeforeZoomRange(y,k);E&&(y=E.xaxis?E.xaxis:y,k=E.yaxis?E.yaxis:k)}var S={xaxis:y};l.config.chart.group||(S.yaxis=k),h.ctx.updateHelpers._updateOptions(S,!1,h.w.config.chart.animations.dynamicAnimation.enabled),typeof l.config.chart.events.zoomed=="function"&&u.zoomCallback(y,k)}else if(l.globals.selectionEnabled){var C,N=null;C={min:i,max:s},o!=="xy"&&o!=="y"||(N=R.clone(l.config.yaxis)).forEach(function(L,A){N[A].min=w[A],N[A].max=v[A]}),l.globals.selection=h.selection,typeof l.config.chart.events.selection=="function"&&l.config.chart.events.selection(h.ctx,{xaxis:C,yaxis:N})}}}},{key:"panDragging",value:function(a){var i=a.context,s=this.w,r=i;if(s.globals.lastClientPosition.x!==void 0){var o=s.globals.lastClientPosition.x-r.clientX,l=s.globals.lastClientPosition.y-r.clientY;Math.abs(o)>Math.abs(l)&&o>0?this.moveDirection="left":Math.abs(o)>Math.abs(l)&&o<0?this.moveDirection="right":Math.abs(l)>Math.abs(o)&&l>0?this.moveDirection="up":Math.abs(l)>Math.abs(o)&&l<0&&(this.moveDirection="down")}s.globals.lastClientPosition={x:r.clientX,y:r.clientY};var h=s.globals.isRangeBar?s.globals.minY:s.globals.minX,d=s.globals.isRangeBar?s.globals.maxY:s.globals.maxX;r.panScrolled(h,d)}},{key:"panScrolled",value:function(a,i){var s=this.w,r=this.xyRatios,o=R.clone(s.globals.initialConfig.yaxis),l=r.xRatio,h=s.globals.minX,d=s.globals.maxX;s.globals.isRangeBar&&(l=r.invertedYRatio,h=s.globals.minY,d=s.globals.maxY),this.moveDirection==="left"?(a=h+s.globals.gridWidth/15*l,i=d+s.globals.gridWidth/15*l):this.moveDirection==="right"&&(a=h-s.globals.gridWidth/15*l,i=d-s.globals.gridWidth/15*l),s.globals.isRangeBar||(a<s.globals.initialMinX||i>s.globals.initialMaxX)&&(a=h,i=d);var u={xaxis:{min:a,max:i}};s.config.chart.group||(u.yaxis=o),this.updateScrolledChart(u,a,i)}},{key:"updateScrolledChart",value:function(a,i,s){var r=this.w;if(this.ctx.updateHelpers._updateOptions(a,!1,!1),typeof r.config.chart.events.scrolled=="function"){var o={xaxis:{min:i,max:s}};r.config.chart.events.scrolled(this.ctx,o),this.ctx.events.fireEvent("scrolled",o)}}}]),t}(),cr=function(){function n(e){q(this,n),this.w=e.w,this.ttCtx=e,this.ctx=e.ctx}return Z(n,[{key:"getNearestValues",value:function(e){var t=e.hoverArea,a=e.elGrid,i=e.clientX,s=e.clientY,r=this.w,o=a.getBoundingClientRect(),l=o.width,h=o.height,d=l/(r.globals.dataPoints-1),u=h/r.globals.dataPoints,g=this.hasBars();!r.globals.comboCharts&&!g||r.config.xaxis.convertedCatToNumeric||(d=l/r.globals.dataPoints);var p=i-o.left-r.globals.barPadForNumericAxis,f=s-o.top;p<0||f<0||p>l||f>h?(t.classList.remove("hovering-zoom"),t.classList.remove("hovering-pan")):r.globals.zoomEnabled?(t.classList.remove("hovering-pan"),t.classList.add("hovering-zoom")):r.globals.panEnabled&&(t.classList.remove("hovering-zoom"),t.classList.add("hovering-pan"));var m=Math.round(p/d),x=Math.floor(f/u);g&&!r.config.xaxis.convertedCatToNumeric&&(m=Math.ceil(p/d),m-=1);var b=null,v=null,w=r.globals.seriesXvalues.map(function(C){return C.filter(function(N){return R.isNumber(N)})}),k=r.globals.seriesYvalues.map(function(C){return C.filter(function(N){return R.isNumber(N)})});if(r.globals.isXNumeric){var y=this.ttCtx.getElGrid().getBoundingClientRect(),E=p*(y.width/l),S=f*(y.height/h);b=(v=this.closestInMultiArray(E,S,w,k)).index,m=v.j,b!==null&&r.globals.hasNullValues&&(w=r.globals.seriesXvalues[b],m=(v=this.closestInArray(E,w)).j)}return r.globals.capturedSeriesIndex=b===null?-1:b,(!m||m<1)&&(m=0),r.globals.isBarHorizontal?r.globals.capturedDataPointIndex=x:r.globals.capturedDataPointIndex=m,{capturedSeries:b,j:r.globals.isBarHorizontal?x:m,hoverX:p,hoverY:f}}},{key:"getFirstActiveXArray",value:function(e){for(var t=this.w,a=0,i=e.map(function(r,o){return r.length>0?o:-1}),s=0;s<i.length;s++)if(i[s]!==-1&&t.globals.collapsedSeriesIndices.indexOf(s)===-1&&t.globals.ancillaryCollapsedSeriesIndices.indexOf(s)===-1){a=i[s];break}return a}},{key:"closestInMultiArray",value:function(e,t,a,i){for(var s,r=this.w,o=1/0,l=null,h=null,d=0;d<a.length;d++)if(s=d,r.globals.collapsedSeriesIndices.indexOf(s)===-1&&r.globals.ancillaryCollapsedSeriesIndices.indexOf(s)===-1)for(var u=a[d],g=i[d],p=Math.min(u.length,g.length),f=0;f<p;f++){var m=e-u[f],x=Math.sqrt(m*m);if(!r.globals.allSeriesHasEqualX){var b=t-g[f];x=Math.sqrt(m*m+b*b)}x<o&&(o=x,l=d,h=f)}return{index:l,j:h}}},{key:"closestInArray",value:function(e,t){for(var a=t[0],i=null,s=Math.abs(e-a),r=0;r<t.length;r++){var o=Math.abs(e-t[r]);o<s&&(s=o,i=r)}return{j:i}}},{key:"isXoverlap",value:function(e){var t=[],a=this.w.globals.seriesX.filter(function(s){return s[0]!==void 0});if(a.length>0)for(var i=0;i<a.length-1;i++)a[i][e]!==void 0&&a[i+1][e]!==void 0&&a[i][e]!==a[i+1][e]&&t.push("unEqual");return t.length===0}},{key:"isInitialSeriesSameLen",value:function(){for(var e=!0,t=this.w.globals.initialSeries,a=0;a<t.length-1;a++)if(t[a].data.length!==t[a+1].data.length){e=!1;break}return e}},{key:"getBarsHeight",value:function(e){return Pe(e).reduce(function(t,a){return t+a.getBBox().height},0)}},{key:"getElMarkers",value:function(e){return typeof e=="number"?this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:realIndex='".concat(e,"'] .apexcharts-series-markers-wrap > *")):this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}},{key:"getAllMarkers",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],a=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");a=Pe(a),t&&(a=a.filter(function(s){var r=Number(s.getAttribute("data:realIndex"));return e.w.globals.collapsedSeriesIndices.indexOf(r)===-1})),a.sort(function(s,r){var o=Number(s.getAttribute("data:realIndex")),l=Number(r.getAttribute("data:realIndex"));return l<o?1:l>o?-1:0});var i=[];return a.forEach(function(s){i.push(s.querySelector(".apexcharts-marker"))}),i}},{key:"hasMarkers",value:function(e){return this.getElMarkers(e).length>0}},{key:"getPathFromPoint",value:function(e,t){var a=Number(e.getAttribute("cx")),i=Number(e.getAttribute("cy")),s=e.getAttribute("shape");return new O(this.ctx).getMarkerPath(a,i,s,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,a=t.config.markers.hover.size;return a===void 0&&(a=t.globals.markers.size[e]+t.config.markers.hover.sizeOffset),a}},{key:"toggleAllTooltipSeriesGroups",value:function(e){var t=this.w,a=this.ttCtx;a.allTooltipSeriesGroups.length===0&&(a.allTooltipSeriesGroups=t.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var i=a.allTooltipSeriesGroups,s=0;s<i.length;s++)e==="enable"?(i[s].classList.add("apexcharts-active"),i[s].style.display=t.config.tooltip.items.display):(i[s].classList.remove("apexcharts-active"),i[s].style.display="none")}}]),n}(),Qo=function(){function n(e){q(this,n),this.w=e.w,this.ctx=e.ctx,this.ttCtx=e,this.tooltipUtil=new cr(e)}return Z(n,[{key:"drawSeriesTexts",value:function(e){var t=e.shared,a=t===void 0||t,i=e.ttItems,s=e.i,r=s===void 0?0:s,o=e.j,l=o===void 0?null:o,h=e.y1,d=e.y2,u=e.e,g=this.w;g.config.tooltip.custom!==void 0?this.handleCustomTooltip({i:r,j:l,y1:h,y2:d,w:g}):this.toggleActiveInactiveSeries(a,r);var p=this.getValuesToPrint({i:r,j:l});this.printLabels({i:r,j:l,values:p,ttItems:i,shared:a,e:u});var f=this.ttCtx.getElTooltip();this.ttCtx.tooltipRect.ttWidth=f.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=f.getBoundingClientRect().height}},{key:"printLabels",value:function(e){var t,a=this,i=e.i,s=e.j,r=e.values,o=e.ttItems,l=e.shared,h=e.e,d=this.w,u=[],g=function(y){return d.globals.seriesGoals[y]&&d.globals.seriesGoals[y][s]&&Array.isArray(d.globals.seriesGoals[y][s])},p=r.xVal,f=r.zVal,m=r.xAxisTTVal,x="",b=d.globals.colors[i];s!==null&&d.config.plotOptions.bar.distributed&&(b=d.globals.colors[s]);for(var v=function(y,E){var S=a.getFormatters(i);x=a.getSeriesName({fn:S.yLbTitleFormatter,index:i,seriesIndex:i,j:s}),d.config.chart.type==="treemap"&&(x=S.yLbTitleFormatter(String(d.config.series[i].data[s].x),{series:d.globals.series,seriesIndex:i,dataPointIndex:s,w:d}));var C=d.config.tooltip.inverseOrder?E:y;if(d.globals.axisCharts){var N=function(M){var F,z,B,T;return d.globals.isRangeData?S.yLbFormatter((F=d.globals.seriesRangeStart)===null||F===void 0||(z=F[M])===null||z===void 0?void 0:z[s],{series:d.globals.seriesRangeStart,seriesIndex:M,dataPointIndex:s,w:d})+" - "+S.yLbFormatter((B=d.globals.seriesRangeEnd)===null||B===void 0||(T=B[M])===null||T===void 0?void 0:T[s],{series:d.globals.seriesRangeEnd,seriesIndex:M,dataPointIndex:s,w:d}):S.yLbFormatter(d.globals.series[M][s],{series:d.globals.series,seriesIndex:M,dataPointIndex:s,w:d})};if(l)S=a.getFormatters(C),x=a.getSeriesName({fn:S.yLbTitleFormatter,index:C,seriesIndex:i,j:s}),b=d.globals.colors[C],t=N(C),g(C)&&(u=d.globals.seriesGoals[C][s].map(function(M){return{attrs:M,val:S.yLbFormatter(M.value,{seriesIndex:C,dataPointIndex:s,w:d})}}));else{var L,A=h==null||(L=h.target)===null||L===void 0?void 0:L.getAttribute("fill");A&&(A.indexOf("url")!==-1?A.indexOf("Pattern")!==-1&&(b=d.globals.dom.baseEl.querySelector(A.substr(4).slice(0,-1)).childNodes[0].getAttribute("stroke")):b=A),t=N(i),g(i)&&Array.isArray(d.globals.seriesGoals[i][s])&&(u=d.globals.seriesGoals[i][s].map(function(M){return{attrs:M,val:S.yLbFormatter(M.value,{seriesIndex:i,dataPointIndex:s,w:d})}}))}}s===null&&(t=S.yLbFormatter(d.globals.series[i],G(G({},d),{},{seriesIndex:i,dataPointIndex:i}))),a.DOMHandling({i,t:C,j:s,ttItems:o,values:{val:t,goalVals:u,xVal:p,xAxisTTVal:m,zVal:f},seriesName:x,shared:l,pColor:b})},w=0,k=d.globals.series.length-1;w<d.globals.series.length;w++,k--)v(w,k)}},{key:"getFormatters",value:function(e){var t,a=this.w,i=a.globals.yLabelFormatters[e];return a.globals.ttVal!==void 0?Array.isArray(a.globals.ttVal)?(i=a.globals.ttVal[e]&&a.globals.ttVal[e].formatter,t=a.globals.ttVal[e]&&a.globals.ttVal[e].title&&a.globals.ttVal[e].title.formatter):(i=a.globals.ttVal.formatter,typeof a.globals.ttVal.title.formatter=="function"&&(t=a.globals.ttVal.title.formatter)):t=a.config.tooltip.y.title.formatter,typeof i!="function"&&(i=a.globals.yLabelFormatters[0]?a.globals.yLabelFormatters[0]:function(s){return s}),typeof t!="function"&&(t=function(s){return s?s+": ":""}),{yLbFormatter:i,yLbTitleFormatter:t}}},{key:"getSeriesName",value:function(e){var t=e.fn,a=e.index,i=e.seriesIndex,s=e.j,r=this.w;return t(String(r.globals.seriesNames[a]),{series:r.globals.series,seriesIndex:i,dataPointIndex:s,w:r})}},{key:"DOMHandling",value:function(e){e.i;var t=e.t,a=e.j,i=e.ttItems,s=e.values,r=e.seriesName,o=e.shared,l=e.pColor,h=this.w,d=this.ttCtx,u=s.val,g=s.goalVals,p=s.xVal,f=s.xAxisTTVal,m=s.zVal,x=null;x=i[t].children,h.config.tooltip.fillSeriesColor&&(i[t].style.backgroundColor=l,x[0].style.display="none"),d.showTooltipTitle&&(d.tooltipTitle===null&&(d.tooltipTitle=h.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),d.tooltipTitle.innerHTML=p),d.isXAxisTooltipEnabled&&(d.xaxisTooltipText.innerHTML=f!==""?f:p);var b=i[t].querySelector(".apexcharts-tooltip-text-y-label");b&&(b.innerHTML=r||"");var v=i[t].querySelector(".apexcharts-tooltip-text-y-value");v&&(v.innerHTML=u!==void 0?u:""),x[0]&&x[0].classList.contains("apexcharts-tooltip-marker")&&(h.config.tooltip.marker.fillColors&&Array.isArray(h.config.tooltip.marker.fillColors)&&(l=h.config.tooltip.marker.fillColors[t]),h.config.tooltip.fillSeriesColor?x[0].style.backgroundColor=l:x[0].style.color=l),h.config.tooltip.marker.show||(x[0].style.display="none");var w=i[t].querySelector(".apexcharts-tooltip-text-goals-label"),k=i[t].querySelector(".apexcharts-tooltip-text-goals-value");if(g.length&&h.globals.seriesGoals[t]){var y=function(){var C="<div>",N="<div>";g.forEach(function(L,A){C+=' <div style="display: flex"><span class="apexcharts-tooltip-marker" style="background-color: '.concat(L.attrs.strokeColor,'; height: 3px; border-radius: 0; top: 5px;"></span> ').concat(L.attrs.name,"</div>"),N+="<div>".concat(L.val,"</div>")}),w.innerHTML=C+"</div>",k.innerHTML=N+"</div>"};o?h.globals.seriesGoals[t][a]&&Array.isArray(h.globals.seriesGoals[t][a])?y():(w.innerHTML="",k.innerHTML=""):y()}else w.innerHTML="",k.innerHTML="";if(m!==null&&(i[t].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=h.config.tooltip.z.title,i[t].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=m!==void 0?m:""),o&&x[0]){if(h.config.tooltip.hideEmptySeries){var E=i[t].querySelector(".apexcharts-tooltip-marker"),S=i[t].querySelector(".apexcharts-tooltip-text");parseFloat(u)==0?(E.style.display="none",S.style.display="none"):(E.style.display="block",S.style.display="block")}u==null||h.globals.ancillaryCollapsedSeriesIndices.indexOf(t)>-1||h.globals.collapsedSeriesIndices.indexOf(t)>-1||Array.isArray(d.tConfig.enabledOnSeries)&&d.tConfig.enabledOnSeries.indexOf(t)===-1?x[0].parentNode.style.display="none":x[0].parentNode.style.display=h.config.tooltip.items.display}else Array.isArray(d.tConfig.enabledOnSeries)&&d.tConfig.enabledOnSeries.indexOf(t)===-1&&(x[0].parentNode.style.display="none")}},{key:"toggleActiveInactiveSeries",value:function(e,t){var a=this.w;if(e)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");var i=a.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group-".concat(t));i&&(i.classList.add("apexcharts-active"),i.style.display=a.config.tooltip.items.display)}}},{key:"getValuesToPrint",value:function(e){var t=e.i,a=e.j,i=this.w,s=this.ctx.series.filteredSeriesX(),r="",o="",l=null,h=null,d={series:i.globals.series,seriesIndex:t,dataPointIndex:a,w:i},u=i.globals.ttZFormatter;a===null?h=i.globals.series[t]:i.globals.isXNumeric&&i.config.chart.type!=="treemap"?(r=s[t][a],s[t].length===0&&(r=s[this.tooltipUtil.getFirstActiveXArray(s)][a])):r=new Pi(this.ctx).isFormatXY()?i.config.series[t].data[a]!==void 0?i.config.series[t].data[a].x:"":i.globals.labels[a]!==void 0?i.globals.labels[a]:"";var g=r;return i.globals.isXNumeric&&i.config.xaxis.type==="datetime"?r=new ga(this.ctx).xLabelFormat(i.globals.ttKeyFormatter,g,g,{i:void 0,dateFormatter:new He(this.ctx).formatDate,w:this.w}):r=i.globals.isBarHorizontal?i.globals.yLabelFormatters[0](g,d):i.globals.xLabelFormatter(g,d),i.config.tooltip.x.formatter!==void 0&&(r=i.globals.ttKeyFormatter(g,d)),i.globals.seriesZ.length>0&&i.globals.seriesZ[t].length>0&&(l=u(i.globals.seriesZ[t][a],i)),o=typeof i.config.xaxis.tooltip.formatter=="function"?i.globals.xaxisTooltipFormatter(g,d):r,{val:Array.isArray(h)?h.join(" "):h,xVal:Array.isArray(r)?r.join(" "):r,xAxisTTVal:Array.isArray(o)?o.join(" "):o,zVal:l}}},{key:"handleCustomTooltip",value:function(e){var t=e.i,a=e.j,i=e.y1,s=e.y2,r=e.w,o=this.ttCtx.getElTooltip(),l=r.config.tooltip.custom;Array.isArray(l)&&l[t]&&(l=l[t]);var h=l({ctx:this.ctx,series:r.globals.series,seriesIndex:t,dataPointIndex:a,y1:i,y2:s,w:r});typeof h=="string"||typeof h=="number"?o.innerHTML=h:(h instanceof Element||typeof h.nodeName=="string")&&(o.innerHTML="",o.appendChild(h.cloneNode(!0)))}}]),n}(),hr=function(){function n(e){q(this,n),this.ttCtx=e,this.ctx=e.ctx,this.w=e.w}return Z(n,[{key:"moveXCrosshairs",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=this.ttCtx,i=this.w,s=a.getElXCrosshairs(),r=e-a.xcrosshairsWidth/2,o=i.globals.labels.slice().length;if(t!==null&&(r=i.globals.gridWidth/o*t),s===null||i.globals.isBarHorizontal||(s.setAttribute("x",r),s.setAttribute("x1",r),s.setAttribute("x2",r),s.setAttribute("y2",i.globals.gridHeight),s.classList.add("apexcharts-active")),r<0&&(r=0),r>i.globals.gridWidth&&(r=i.globals.gridWidth),a.isXAxisTooltipEnabled){var l=r;i.config.xaxis.crosshairs.width!=="tickWidth"&&i.config.xaxis.crosshairs.width!=="barWidth"||(l=r+a.xcrosshairsWidth/2),this.moveXAxisTooltip(l)}}},{key:"moveYCrosshairs",value:function(e){var t=this.ttCtx;t.ycrosshairs!==null&&O.setAttrs(t.ycrosshairs,{y1:e,y2:e}),t.ycrosshairsHidden!==null&&O.setAttrs(t.ycrosshairsHidden,{y1:e,y2:e})}},{key:"moveXAxisTooltip",value:function(e){var t=this.w,a=this.ttCtx;if(a.xaxisTooltip!==null&&a.xcrosshairsWidth!==0){a.xaxisTooltip.classList.add("apexcharts-active");var i=a.xaxisOffY+t.config.xaxis.tooltip.offsetY+t.globals.translateY+1+t.config.xaxis.offsetY;if(e-=a.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(e)){e+=t.globals.translateX;var s;s=new O(this.ctx).getTextRects(a.xaxisTooltipText.innerHTML),a.xaxisTooltipText.style.minWidth=s.width+"px",a.xaxisTooltip.style.left=e+"px",a.xaxisTooltip.style.top=i+"px"}}}},{key:"moveYAxisTooltip",value:function(e){var t=this.w,a=this.ttCtx;a.yaxisTTEls===null&&(a.yaxisTTEls=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var i=parseInt(a.ycrosshairsHidden.getAttribute("y1"),10),s=t.globals.translateY+i,r=a.yaxisTTEls[e].getBoundingClientRect(),o=r.height,l=t.globals.translateYAxisX[e]-2;t.config.yaxis[e].opposite&&(l-=r.width),s-=o/2,t.globals.ignoreYAxisIndexes.indexOf(e)===-1&&s>0&&s<t.globals.gridHeight?(a.yaxisTTEls[e].classList.add("apexcharts-active"),a.yaxisTTEls[e].style.top=s+"px",a.yaxisTTEls[e].style.left=l+t.config.yaxis[e].tooltip.offsetX+"px"):a.yaxisTTEls[e].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=this.w,s=this.ttCtx,r=s.getElTooltip(),o=s.tooltipRect,l=a!==null?parseFloat(a):1,h=parseFloat(e)+l+5,d=parseFloat(t)+l/2;if(h>i.globals.gridWidth/2&&(h=h-o.ttWidth-l-10),h>i.globals.gridWidth-o.ttWidth-10&&(h=i.globals.gridWidth-o.ttWidth),h<-20&&(h=-20),i.config.tooltip.followCursor){var u=s.getElGrid().getBoundingClientRect();(h=s.e.clientX-u.left)>i.globals.gridWidth/2&&(h-=s.tooltipRect.ttWidth),(d=s.e.clientY+i.globals.translateY-u.top)>i.globals.gridHeight/2&&(d-=s.tooltipRect.ttHeight)}else i.globals.isBarHorizontal||o.ttHeight/2+d>i.globals.gridHeight&&(d=i.globals.gridHeight-o.ttHeight+i.globals.translateY);isNaN(h)||(h+=i.globals.translateX,r.style.left=h+"px",r.style.top=d+"px")}},{key:"moveMarkers",value:function(e,t){var a=this.w,i=this.ttCtx;if(a.globals.markers.size[e]>0)for(var s=a.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(e,"'] .apexcharts-marker")),r=0;r<s.length;r++)parseInt(s[r].getAttribute("rel"),10)===t&&(i.marker.resetPointsSize(),i.marker.enlargeCurrentPoint(t,s[r]));else i.marker.resetPointsSize(),this.moveDynamicPointOnHover(t,e)}},{key:"moveDynamicPointOnHover",value:function(e,t){var a,i,s,r,o=this.w,l=this.ttCtx,h=new O(this.ctx),d=o.globals.pointsArray,u=l.tooltipUtil.getHoverMarkerSize(t),g=o.config.series[t].type;if(!g||g!=="column"&&g!=="candlestick"&&g!=="boxPlot"){s=(a=d[t][e])===null||a===void 0?void 0:a[0],r=((i=d[t][e])===null||i===void 0?void 0:i[1])||0;var p=o.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(t,"'] .apexcharts-series-markers path"));if(p&&r<o.globals.gridHeight&&r>0){var f=p.getAttribute("shape"),m=h.getMarkerPath(s,r,f,1.5*u);p.setAttribute("d",m)}this.moveXCrosshairs(s),l.fixedTooltip||this.moveTooltip(s,r,u)}}},{key:"moveDynamicPointsOnHover",value:function(e){var t,a=this.ttCtx,i=a.w,s=0,r=0,o=i.globals.pointsArray,l=new et(this.ctx),h=new O(this.ctx);t=l.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);var d=a.tooltipUtil.getHoverMarkerSize(t);if(o[t]&&(s=o[t][e][0],r=o[t][e][1]),!isNaN(s)){var u=a.tooltipUtil.getAllMarkers();if(u.length)for(var g=0;g<i.globals.series.length;g++){var p=o[g];if(i.globals.comboCharts&&p===void 0&&u.splice(g,0,null),p&&p.length){var f=o[g][e][1],m=void 0;u[g].setAttribute("cx",s);var x=u[g].getAttribute("shape");if(i.config.chart.type==="rangeArea"&&!i.globals.comboCharts){var b=e+i.globals.series[g].length;m=o[g][b][1],f-=Math.abs(f-m)/2}if(f!==null&&!isNaN(f)&&f<i.globals.gridHeight+d&&f+d>0){var v=h.getMarkerPath(s,f,x,d);u[g].setAttribute("d",v)}else u[g].setAttribute("d","")}}this.moveXCrosshairs(s),a.fixedTooltip||this.moveTooltip(s,r||i.globals.gridHeight,d)}}},{key:"moveStickyTooltipOverBars",value:function(e,t){var a=this.w,i=this.ttCtx,s=a.globals.columnSeries?a.globals.columnSeries.length:a.globals.series.length;a.config.chart.stacked&&(s=a.globals.barGroups.length);var r=s>=2&&s%2==0?Math.floor(s/2):Math.floor(s/2)+1;a.globals.isBarHorizontal&&(r=new et(this.ctx).getActiveConfigSeriesIndex("desc")+1);var o=a.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(r,"'] path[j='").concat(e,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(r,"'] path[j='").concat(e,"'], .apexcharts-boxPlot-series .apexcharts-series[rel='").concat(r,"'] path[j='").concat(e,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(r,"'] path[j='").concat(e,"']"));o||typeof t!="number"||(o=a.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[data\\:realIndex='".concat(t,"'] path[j='").concat(e,`'],
|
|
169
|
+
.apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='`).concat(t,"'] path[j='").concat(e,`'],
|
|
170
|
+
.apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='`).concat(t,"'] path[j='").concat(e,`'],
|
|
171
|
+
.apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='`).concat(t,"'] path[j='").concat(e,"']")));var l=o?parseFloat(o.getAttribute("cx")):0,h=o?parseFloat(o.getAttribute("cy")):0,d=o?parseFloat(o.getAttribute("barWidth")):0,u=i.getElGrid().getBoundingClientRect(),g=o&&(o.classList.contains("apexcharts-candlestick-area")||o.classList.contains("apexcharts-boxPlot-area"));a.globals.isXNumeric?(o&&!g&&(l-=s%2!=0?d/2:0),o&&g&&(l-=d/2)):a.globals.isBarHorizontal||(l=i.xAxisTicksPositions[e-1]+i.dataPointsDividedWidth/2,isNaN(l)&&(l=i.xAxisTicksPositions[e]-i.dataPointsDividedWidth/2)),a.globals.isBarHorizontal?h-=i.tooltipRect.ttHeight:a.config.tooltip.followCursor?h=i.e.clientY-u.top-i.tooltipRect.ttHeight/2:h+i.tooltipRect.ttHeight+15>a.globals.gridHeight&&(h=a.globals.gridHeight),a.globals.isBarHorizontal||this.moveXCrosshairs(l),i.fixedTooltip||this.moveTooltip(l,h||a.globals.gridHeight)}}]),n}(),el=function(){function n(e){q(this,n),this.w=e.w,this.ttCtx=e,this.ctx=e.ctx,this.tooltipPosition=new hr(e)}return Z(n,[{key:"drawDynamicPoints",value:function(){var e=this.w,t=new O(this.ctx),a=new Ut(this.ctx),i=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series");i=Pe(i),e.config.chart.stacked&&i.sort(function(u,g){return parseFloat(u.getAttribute("data:realIndex"))-parseFloat(g.getAttribute("data:realIndex"))});for(var s=0;s<i.length;s++){var r=i[s].querySelector(".apexcharts-series-markers-wrap");if(r!==null){var o=void 0,l="apexcharts-marker w".concat((Math.random()+1).toString(36).substring(4));e.config.chart.type!=="line"&&e.config.chart.type!=="area"||e.globals.comboCharts||e.config.tooltip.intersect||(l+=" no-pointer-events");var h=a.getMarkerConfig({cssClass:l,seriesIndex:Number(r.getAttribute("data:realIndex"))});(o=t.drawMarker(0,0,h)).node.setAttribute("default-marker-size",0);var d=document.createElementNS(e.globals.SVGNS,"g");d.classList.add("apexcharts-series-markers"),d.appendChild(o.node),r.appendChild(d)}}}},{key:"enlargeCurrentPoint",value:function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,s=this.w;s.config.chart.type!=="bubble"&&this.newPointSize(e,t);var r=t.getAttribute("cx"),o=t.getAttribute("cy");if(a!==null&&i!==null&&(r=a,o=i),this.tooltipPosition.moveXCrosshairs(r),!this.fixedTooltip){if(s.config.chart.type==="radar"){var l=this.ttCtx.getElGrid().getBoundingClientRect();r=this.ttCtx.e.clientX-l.left}this.tooltipPosition.moveTooltip(r,o,s.config.markers.hover.size)}}},{key:"enlargePoints",value:function(e){for(var t=this.w,a=this,i=this.ttCtx,s=e,r=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),o=t.config.markers.hover.size,l=0;l<r.length;l++){var h=r[l].getAttribute("rel"),d=r[l].getAttribute("index");if(o===void 0&&(o=t.globals.markers.size[d]+t.config.markers.hover.sizeOffset),s===parseInt(h,10)){a.newPointSize(s,r[l]);var u=r[l].getAttribute("cx"),g=r[l].getAttribute("cy");a.tooltipPosition.moveXCrosshairs(u),i.fixedTooltip||a.tooltipPosition.moveTooltip(u,g,o)}else a.oldPointSize(r[l])}}},{key:"newPointSize",value:function(e,t){var a=this.w,i=a.config.markers.hover.size,s=e===0?t.parentNode.firstChild:t.parentNode.lastChild;if(s.getAttribute("default-marker-size")!=="0"){var r=parseInt(s.getAttribute("index"),10);i===void 0&&(i=a.globals.markers.size[r]+a.config.markers.hover.sizeOffset),i<0&&(i=0);var o=this.ttCtx.tooltipUtil.getPathFromPoint(t,i);t.setAttribute("d",o)}}},{key:"oldPointSize",value:function(e){var t=parseFloat(e.getAttribute("default-marker-size")),a=this.ttCtx.tooltipUtil.getPathFromPoint(e,t);e.setAttribute("d",a)}},{key:"resetPointsSize",value:function(){for(var e=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),t=0;t<e.length;t++){var a=parseFloat(e[t].getAttribute("default-marker-size"));if(R.isNumber(a)&&a>0){var i=this.ttCtx.tooltipUtil.getPathFromPoint(e[t],a);e[t].setAttribute("d",i)}else e[t].setAttribute("d","M0,0")}}}]),n}(),tl=function(){function n(e){q(this,n),this.w=e.w;var t=this.w;this.ttCtx=e,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.config.chart.type==="rangeBar"&&t.config.plotOptions.bar.rangeBarGroupRows}return Z(n,[{key:"getAttr",value:function(e,t){return parseFloat(e.target.getAttribute(t))}},{key:"handleHeatTreeTooltip",value:function(e){var t=e.e,a=e.opt,i=e.x,s=e.y,r=e.type,o=this.ttCtx,l=this.w;if(t.target.classList.contains("apexcharts-".concat(r,"-rect"))){var h=this.getAttr(t,"i"),d=this.getAttr(t,"j"),u=this.getAttr(t,"cx"),g=this.getAttr(t,"cy"),p=this.getAttr(t,"width"),f=this.getAttr(t,"height");if(o.tooltipLabels.drawSeriesTexts({ttItems:a.ttItems,i:h,j:d,shared:!1,e:t}),l.globals.capturedSeriesIndex=h,l.globals.capturedDataPointIndex=d,i=u+o.tooltipRect.ttWidth/2+p,s=g+o.tooltipRect.ttHeight/2-f/2,o.tooltipPosition.moveXCrosshairs(u+p/2),i>l.globals.gridWidth/2&&(i=u-o.tooltipRect.ttWidth/2+p),o.w.config.tooltip.followCursor){var m=l.globals.dom.elWrap.getBoundingClientRect();i=l.globals.clientX-m.left-(i>l.globals.gridWidth/2?o.tooltipRect.ttWidth:0),s=l.globals.clientY-m.top-(s>l.globals.gridHeight/2?o.tooltipRect.ttHeight:0)}}return{x:i,y:s}}},{key:"handleMarkerTooltip",value:function(e){var t,a,i=e.e,s=e.opt,r=e.x,o=e.y,l=this.w,h=this.ttCtx;if(i.target.classList.contains("apexcharts-marker")){var d=parseInt(s.paths.getAttribute("cx"),10),u=parseInt(s.paths.getAttribute("cy"),10),g=parseFloat(s.paths.getAttribute("val"));if(a=parseInt(s.paths.getAttribute("rel"),10),t=parseInt(s.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,h.intersect){var p=R.findAncestor(s.paths,"apexcharts-series");p&&(t=parseInt(p.getAttribute("data:realIndex"),10))}if(h.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,j:a,shared:!h.showOnIntersect&&l.config.tooltip.shared,e:i}),i.type==="mouseup"&&h.markerClick(i,t,a),l.globals.capturedSeriesIndex=t,l.globals.capturedDataPointIndex=a,r=d,o=u+l.globals.translateY-1.4*h.tooltipRect.ttHeight,h.w.config.tooltip.followCursor){var f=h.getElGrid().getBoundingClientRect();o=h.e.clientY+l.globals.translateY-f.top}g<0&&(o=u),h.marker.enlargeCurrentPoint(a,s.paths,r,o)}return{x:r,y:o}}},{key:"handleBarTooltip",value:function(e){var t,a,i=e.e,s=e.opt,r=this.w,o=this.ttCtx,l=o.getElTooltip(),h=0,d=0,u=0,g=this.getBarTooltipXY({e:i,opt:s});if(g.j!==null||g.barHeight!==0||g.barWidth!==0){t=g.i;var p=g.j;if(r.globals.capturedSeriesIndex=t,r.globals.capturedDataPointIndex=p,r.globals.isBarHorizontal&&o.tooltipUtil.hasBars()||!r.config.tooltip.shared?(d=g.x,u=g.y,a=Array.isArray(r.config.stroke.width)?r.config.stroke.width[t]:r.config.stroke.width,h=d):r.globals.comboCharts||r.config.tooltip.shared||(h/=2),isNaN(u)&&(u=r.globals.svgHeight-o.tooltipRect.ttHeight),parseInt(s.paths.parentNode.getAttribute("data:realIndex"),10),d+o.tooltipRect.ttWidth>r.globals.gridWidth?d-=o.tooltipRect.ttWidth:d<0&&(d=0),o.w.config.tooltip.followCursor){var f=o.getElGrid().getBoundingClientRect();u=o.e.clientY-f.top}o.tooltip===null&&(o.tooltip=r.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),r.config.tooltip.shared||(r.globals.comboBarCount>0?o.tooltipPosition.moveXCrosshairs(h+a/2):o.tooltipPosition.moveXCrosshairs(h)),!o.fixedTooltip&&(!r.config.tooltip.shared||r.globals.isBarHorizontal&&o.tooltipUtil.hasBars())&&(u=u+r.globals.translateY-o.tooltipRect.ttHeight/2,l.style.left=d+r.globals.translateX+"px",l.style.top=u+"px")}}},{key:"getBarTooltipXY",value:function(e){var t=this,a=e.e,i=e.opt,s=this.w,r=null,o=this.ttCtx,l=0,h=0,d=0,u=0,g=0,p=a.target.classList;if(p.contains("apexcharts-bar-area")||p.contains("apexcharts-candlestick-area")||p.contains("apexcharts-boxPlot-area")||p.contains("apexcharts-rangebar-area")){var f=a.target,m=f.getBoundingClientRect(),x=i.elGrid.getBoundingClientRect(),b=m.height;g=m.height;var v=m.width,w=parseInt(f.getAttribute("cx"),10),k=parseInt(f.getAttribute("cy"),10);u=parseFloat(f.getAttribute("barWidth"));var y=a.type==="touchmove"?a.touches[0].clientX:a.clientX;r=parseInt(f.getAttribute("j"),10),l=parseInt(f.parentNode.getAttribute("rel"),10)-1;var E=f.getAttribute("data-range-y1"),S=f.getAttribute("data-range-y2");s.globals.comboCharts&&(l=parseInt(f.parentNode.getAttribute("data:realIndex"),10));var C=function(L){return s.globals.isXNumeric?w-v/2:t.isVerticalGroupedRangeBar?w+v/2:w-o.dataPointsDividedWidth+v/2},N=function(){return k-o.dataPointsDividedHeight+b/2-o.tooltipRect.ttHeight/2};o.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:l,j:r,y1:E?parseInt(E,10):null,y2:S?parseInt(S,10):null,shared:!o.showOnIntersect&&s.config.tooltip.shared,e:a}),s.config.tooltip.followCursor?s.globals.isBarHorizontal?(h=y-x.left+15,d=N()):(h=C(),d=a.clientY-x.top-o.tooltipRect.ttHeight/2-15):s.globals.isBarHorizontal?((h=w)<o.xyRatios.baseLineInvertedY&&(h=w-o.tooltipRect.ttWidth),d=N()):(h=C(),d=k)}return{x:h,y:d,barHeight:g,barWidth:u,i:l,j:r}}}]),n}(),al=function(){function n(e){q(this,n),this.w=e.w,this.ttCtx=e}return Z(n,[{key:"drawXaxisTooltip",value:function(){var e=this.w,t=this.ttCtx,a=e.config.xaxis.position==="bottom";t.xaxisOffY=a?e.globals.gridHeight+1:-e.globals.xAxisHeight-e.config.xaxis.axisTicks.height+3;var i=a?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",s=e.globals.dom.elWrap;t.isXAxisTooltipEnabled&&e.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")===null&&(t.xaxisTooltip=document.createElement("div"),t.xaxisTooltip.setAttribute("class",i+" apexcharts-theme-"+e.config.tooltip.theme),s.appendChild(t.xaxisTooltip),t.xaxisTooltipText=document.createElement("div"),t.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),t.xaxisTooltipText.style.fontFamily=e.config.xaxis.tooltip.style.fontFamily||e.config.chart.fontFamily,t.xaxisTooltipText.style.fontSize=e.config.xaxis.tooltip.style.fontSize,t.xaxisTooltip.appendChild(t.xaxisTooltipText))}},{key:"drawYaxisTooltip",value:function(){for(var e=this.w,t=this.ttCtx,a=0;a<e.config.yaxis.length;a++){var i=e.config.yaxis[a].opposite||e.config.yaxis[a].crosshairs.opposite;t.yaxisOffX=i?e.globals.gridWidth+1:1;var s="apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(a,i?" apexcharts-yaxistooltip-right":" apexcharts-yaxistooltip-left"),r=e.globals.dom.elWrap;e.globals.dom.baseEl.querySelector(".apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(a))===null&&(t.yaxisTooltip=document.createElement("div"),t.yaxisTooltip.setAttribute("class",s+" apexcharts-theme-"+e.config.tooltip.theme),r.appendChild(t.yaxisTooltip),a===0&&(t.yaxisTooltipText=[]),t.yaxisTooltipText[a]=document.createElement("div"),t.yaxisTooltipText[a].classList.add("apexcharts-yaxistooltip-text"),t.yaxisTooltip.appendChild(t.yaxisTooltipText[a]))}}},{key:"setXCrosshairWidth",value:function(){var e=this.w,t=this.ttCtx,a=t.getElXCrosshairs();if(t.xcrosshairsWidth=parseInt(e.config.xaxis.crosshairs.width,10),e.globals.comboCharts){var i=e.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(i!==null&&e.config.xaxis.crosshairs.width==="barWidth"){var s=parseFloat(i.getAttribute("barWidth"));t.xcrosshairsWidth=s}else if(e.config.xaxis.crosshairs.width==="tickWidth"){var r=e.globals.labels.length;t.xcrosshairsWidth=e.globals.gridWidth/r}}else if(e.config.xaxis.crosshairs.width==="tickWidth"){var o=e.globals.labels.length;t.xcrosshairsWidth=e.globals.gridWidth/o}else if(e.config.xaxis.crosshairs.width==="barWidth"){var l=e.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(l!==null){var h=parseFloat(l.getAttribute("barWidth"));t.xcrosshairsWidth=h}else t.xcrosshairsWidth=1}e.globals.isBarHorizontal&&(t.xcrosshairsWidth=0),a!==null&&t.xcrosshairsWidth>0&&a.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,a){var i=this.ttCtx,s=this.w,r=s.globals,o=r.seriesYAxisMap[e];if(i.yaxisTooltips[e]&&o.length>0){var l=r.yLabelFormatters[e],h=i.getElGrid().getBoundingClientRect(),d=o[0],u=0;a.yRatio.length>1&&(u=d);var g=(t-h.top)*a.yRatio[u],p=r.maxYArr[d]-r.minYArr[d],f=r.minYArr[d]+(p-g);s.config.yaxis[e].reversed&&(f=r.maxYArr[d]-(p-g)),i.tooltipPosition.moveYCrosshairs(t-h.top),i.yaxisTooltipText[e].innerHTML=l(f),i.tooltipPosition.moveYAxisTooltip(e)}}}]),n}(),dr=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w;var t=this.w;this.tConfig=t.config.tooltip,this.tooltipUtil=new cr(this),this.tooltipLabels=new Qo(this),this.tooltipPosition=new hr(this),this.marker=new el(this),this.intersect=new tl(this),this.axesTooltip=new al(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=!t.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now()}return Z(n,[{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(r,o){return!!(r.show&&r.tooltip.enabled&&t.globals.axisCharts)}),this.allTooltipSeriesGroups=[],t.globals.axisCharts||(this.showTooltipTitle=!1);var a=document.createElement("div");if(a.classList.add("apexcharts-tooltip"),t.config.tooltip.cssClass&&a.classList.add(t.config.tooltip.cssClass),a.classList.add("apexcharts-theme-".concat(this.tConfig.theme||"light")),t.globals.dom.elWrap.appendChild(a),t.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var i=new xa(this.ctx);this.xAxisTicksPositions=i.getXAxisTicksPositions()}if(!t.globals.comboCharts&&!this.tConfig.intersect&&t.config.chart.type!=="rangeBar"||this.tConfig.shared||(this.showOnIntersect=!0),t.config.markers.size!==0&&t.globals.markers.largestSize!==0||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,a.appendChild(this.tooltipTitle));var s=t.globals.series.length;(t.globals.xyCharts||t.globals.comboCharts)&&this.tConfig.shared&&(s=this.showOnIntersect?1:t.globals.series.length),this.legendLabels=t.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(s),this.addSVGEvents()}}},{key:"createTTElements",value:function(e){for(var t=this,a=this.w,i=[],s=this.getElTooltip(),r=function(l){var h=document.createElement("div");h.classList.add("apexcharts-tooltip-series-group","apexcharts-tooltip-series-group-".concat(l)),h.style.order=a.config.tooltip.inverseOrder?e-l:l+1;var d=document.createElement("span");d.classList.add("apexcharts-tooltip-marker"),a.config.tooltip.fillSeriesColor?d.style.backgroundColor=a.globals.colors[l]:d.style.color=a.globals.colors[l];var u=a.config.markers.shape,g=u;Array.isArray(u)&&(g=u[l]),d.setAttribute("shape",g),h.appendChild(d);var p=document.createElement("div");p.classList.add("apexcharts-tooltip-text"),p.style.fontFamily=t.tConfig.style.fontFamily||a.config.chart.fontFamily,p.style.fontSize=t.tConfig.style.fontSize,["y","goals","z"].forEach(function(f){var m=document.createElement("div");m.classList.add("apexcharts-tooltip-".concat(f,"-group"));var x=document.createElement("span");x.classList.add("apexcharts-tooltip-text-".concat(f,"-label")),m.appendChild(x);var b=document.createElement("span");b.classList.add("apexcharts-tooltip-text-".concat(f,"-value")),m.appendChild(b),p.appendChild(m)}),h.appendChild(p),s.appendChild(h),i.push(h)},o=0;o<e;o++)r(o);return i}},{key:"addSVGEvents",value:function(){var e=this.w,t=e.config.chart.type,a=this.getElTooltip(),i=!(t!=="bar"&&t!=="candlestick"&&t!=="boxPlot"&&t!=="rangeBar"),s=t==="area"||t==="line"||t==="scatter"||t==="bubble"||t==="radar",r=e.globals.dom.Paper.node,o=this.getElGrid();o&&(this.seriesBound=o.getBoundingClientRect());var l,h=[],d=[],u={hoverArea:r,elGrid:o,tooltipEl:a,tooltipY:h,tooltipX:d,ttItems:this.ttItems};if(e.globals.axisCharts&&(s?l=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):i?l=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area"):t!=="heatmap"&&t!=="treemap"||(l=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),l&&l.length))for(var g=0;g<l.length;g++)h.push(l[g].getAttribute("cy")),d.push(l[g].getAttribute("cx"));if(e.globals.xyCharts&&!this.showOnIntersect||e.globals.comboCharts&&!this.showOnIntersect||i&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([r],u);else if(i&&!e.globals.comboCharts||s&&this.showOnIntersect)this.addDatapointEventsListeners(u);else if(!e.globals.axisCharts||t==="heatmap"||t==="treemap"){var p=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(p,u)}if(this.showOnIntersect){var f=e.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");f.length>0&&this.addPathsEventListeners(f,u),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(u)}}},{key:"drawFixedTooltipRect",value:function(){var e=this.w,t=this.getElTooltip(),a=t.getBoundingClientRect(),i=a.width+10,s=a.height+10,r=this.tConfig.fixed.offsetX,o=this.tConfig.fixed.offsetY,l=this.tConfig.fixed.position.toLowerCase();return l.indexOf("right")>-1&&(r=r+e.globals.svgWidth-i+10),l.indexOf("bottom")>-1&&(o=o+e.globals.svgHeight-s-10),t.style.left=r+"px",t.style.top=o+"px",{x:r,y:o,ttWidth:i,ttHeight:s}}},{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 a=this,i=function(r){var o={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(l){return e[r].addEventListener(l,a.onSeriesHover.bind(a,o),{capture:!1,passive:!0})})},s=0;s<e.length;s++)i(s)}},{key:"onSeriesHover",value:function(e,t){var a=this,i=Date.now()-this.lastHoverTime;i>=20?this.seriesHover(e,t):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(function(){a.seriesHover(e,t)},20-i))}},{key:"seriesHover",value:function(e,t){var a=this;this.lastHoverTime=Date.now();var i=[],s=this.w;s.config.chart.group&&(i=this.ctx.getGroupedCharts()),s.globals.axisCharts&&(s.globals.minX===-1/0&&s.globals.maxX===1/0||s.globals.dataPoints===0)||(i.length?i.forEach(function(r){var o=a.getElTooltip(r),l={paths:e.paths,tooltipEl:o,tooltipY:e.tooltipY,tooltipX:e.tooltipX,elGrid:e.elGrid,hoverArea:e.hoverArea,ttItems:r.w.globals.tooltip.ttItems};r.w.globals.minX===a.w.globals.minX&&r.w.globals.maxX===a.w.globals.maxX&&r.w.globals.tooltip.seriesHoverByContext({chartCtx:r,ttCtx:r.w.globals.tooltip,opt:l,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,a=e.ttCtx,i=e.opt,s=e.e,r=t.w,o=this.getElTooltip(t);o&&(a.tooltipRect={x:0,y:0,ttWidth:o.getBoundingClientRect().width,ttHeight:o.getBoundingClientRect().height},a.e=s,a.tooltipUtil.hasBars()&&!r.globals.comboCharts&&!a.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries&&new et(t).toggleSeriesOnHover(s,s.target.parentNode),r.globals.axisCharts?a.axisChartsTooltips({e:s,opt:i,tooltipRect:a.tooltipRect}):a.nonAxisChartsTooltips({e:s,opt:i,tooltipRect:a.tooltipRect}),a.fixedTooltip&&a.drawFixedTooltipRect())}},{key:"axisChartsTooltips",value:function(e){var t,a,i=e.e,s=e.opt,r=this.w,o=s.elGrid.getBoundingClientRect(),l=i.type==="touchmove"?i.touches[0].clientX:i.clientX,h=i.type==="touchmove"?i.touches[0].clientY:i.clientY;if(this.clientY=h,this.clientX=l,r.globals.capturedSeriesIndex=-1,r.globals.capturedDataPointIndex=-1,h<o.top||h>o.top+o.height)this.handleMouseOut(s);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!r.config.tooltip.shared){var d=parseInt(s.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(d)<0)return void this.handleMouseOut(s)}var u=this.getElTooltip(),g=this.getElXCrosshairs(),p=[];r.config.chart.group&&(p=this.ctx.getSyncedCharts());var f=r.globals.xyCharts||r.config.chart.type==="bar"&&!r.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||r.globals.comboCharts&&this.tooltipUtil.hasBars();if(i.type==="mousemove"||i.type==="touchmove"||i.type==="mouseup"){if(r.globals.collapsedSeries.length+r.globals.ancillaryCollapsedSeries.length===r.globals.series.length)return;g!==null&&g.classList.add("apexcharts-active");var m=this.yaxisTooltips.filter(function(v){return v===!0});if(this.ycrosshairs!==null&&m.length&&this.ycrosshairs.classList.add("apexcharts-active"),f&&!this.showOnIntersect||p.length>1)this.handleStickyTooltip(i,l,h,s);else if(r.config.chart.type==="heatmap"||r.config.chart.type==="treemap"){var x=this.intersect.handleHeatTreeTooltip({e:i,opt:s,x:t,y:a,type:r.config.chart.type});t=x.x,a=x.y,u.style.left=t+"px",u.style.top=a+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:i,opt:s}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:i,opt:s,x:t,y:a});if(this.yaxisTooltips.length)for(var b=0;b<r.config.yaxis.length;b++)this.axesTooltip.drawYaxisTooltipText(b,h,this.xyRatios);r.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),s.tooltipEl.classList.add("apexcharts-active")}else i.type!=="mouseout"&&i.type!=="touchend"||this.handleMouseOut(s)}}},{key:"nonAxisChartsTooltips",value:function(e){var t=e.e,a=e.opt,i=e.tooltipRect,s=this.w,r=a.paths.getAttribute("rel"),o=this.getElTooltip(),l=s.globals.dom.elWrap.getBoundingClientRect();if(t.type==="mousemove"||t.type==="touchmove"){s.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),o.classList.add("apexcharts-active"),this.tooltipLabels.drawSeriesTexts({ttItems:a.ttItems,i:parseInt(r,10)-1,shared:!1});var h=s.globals.clientX-l.left-i.ttWidth/2,d=s.globals.clientY-l.top-i.ttHeight-10;if(o.style.left=h+"px",o.style.top=d+"px",s.config.legend.tooltipHoverFormatter){var u=r-1,g=(0,s.config.legend.tooltipHoverFormatter)(this.legendLabels[u].getAttribute("data:default-text"),{seriesIndex:u,dataPointIndex:u,w:s});this.legendLabels[u].innerHTML=g}}else t.type!=="mouseout"&&t.type!=="touchend"||(o.classList.remove("apexcharts-active"),s.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),s.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(p){var f=p.getAttribute("data:default-text");p.innerHTML=decodeURIComponent(f)}))}},{key:"handleStickyTooltip",value:function(e,t,a,i){var s=this.w,r=this.tooltipUtil.getNearestValues({context:this,hoverArea:i.hoverArea,elGrid:i.elGrid,clientX:t,clientY:a}),o=r.j,l=r.capturedSeries;s.globals.collapsedSeriesIndices.includes(l)&&(l=null);var h=i.elGrid.getBoundingClientRect();if(r.hoverX<0||r.hoverX>h.width)this.handleMouseOut(i);else if(l!==null)this.handleStickyCapturedSeries(e,l,i,o);else if(this.tooltipUtil.isXoverlap(o)||s.globals.isBarHorizontal){var d=s.globals.series.findIndex(function(u,g){return!s.globals.collapsedSeriesIndices.includes(g)});this.create(e,this,d,o,i.ttItems)}}},{key:"handleStickyCapturedSeries",value:function(e,t,a,i){var s=this.w;if(!this.tConfig.shared&&s.globals.series[t][i]===null)return void this.handleMouseOut(a);if(s.globals.series[t][i]!==void 0)this.tConfig.shared&&this.tooltipUtil.isXoverlap(i)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(e,this,t,i,a.ttItems):this.create(e,this,t,i,a.ttItems,!1);else if(this.tooltipUtil.isXoverlap(i)){var r=s.globals.series.findIndex(function(o,l){return!s.globals.collapsedSeriesIndices.includes(l)});this.create(e,this,r,i,a.ttItems)}}},{key:"deactivateHoverFilter",value:function(){for(var e=this.w,t=new O(this.ctx),a=e.globals.dom.Paper.find(".apexcharts-bar-area"),i=0;i<a.length;i++)t.pathMouseLeave(a[i])}},{key:"handleMouseOut",value:function(e){var t=this.w,a=this.getElXCrosshairs();if(t.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),e.tooltipEl.classList.remove("apexcharts-active"),this.deactivateHoverFilter(),t.config.chart.type!=="bubble"&&this.marker.resetPointsSize(),a!==null&&a.classList.remove("apexcharts-active"),this.ycrosshairs!==null&&this.ycrosshairs.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&this.xaxisTooltip.classList.remove("apexcharts-active"),this.yaxisTooltips.length){this.yaxisTTEls===null&&(this.yaxisTTEls=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(var i=0;i<this.yaxisTTEls.length;i++)this.yaxisTTEls[i].classList.remove("apexcharts-active")}t.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(s){var r=s.getAttribute("data:default-text");s.innerHTML=decodeURIComponent(r)})}},{key:"markerClick",value:function(e,t,a){var i=this.w;typeof i.config.chart.events.markerClick=="function"&&i.config.chart.events.markerClick(e,this.ctx,{seriesIndex:t,dataPointIndex:a,w:i}),this.ctx.events.fireEvent("markerClick",[e,this.ctx,{seriesIndex:t,dataPointIndex:a,w:i}])}},{key:"create",value:function(e,t,a,i,s){var r,o,l,h,d,u,g,p,f,m,x,b,v,w,k,y,E=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,S=this.w,C=t;e.type==="mouseup"&&this.markerClick(e,a,i),E===null&&(E=this.tConfig.shared);var N=this.tooltipUtil.hasMarkers(a),L=this.tooltipUtil.getElBars(),A=function(){S.globals.markers.largestSize>0?C.marker.enlargePoints(i):C.tooltipPosition.moveDynamicPointsOnHover(i)};if(S.config.legend.tooltipHoverFormatter){var M=S.config.legend.tooltipHoverFormatter,F=Array.from(this.legendLabels);F.forEach(function(he){var X=he.getAttribute("data:default-text");he.innerHTML=decodeURIComponent(X)});for(var z=0;z<F.length;z++){var B=F[z],T=parseInt(B.getAttribute("i"),10),D=decodeURIComponent(B.getAttribute("data:default-text")),I=M(D,{seriesIndex:E?T:a,dataPointIndex:i,w:S});if(E)B.innerHTML=S.globals.collapsedSeriesIndices.indexOf(T)<0?I:D;else if(B.innerHTML=T===a?I:D,a===T)break}}var Y=G(G({ttItems:s,i:a,j:i},((r=S.globals.seriesRange)===null||r===void 0||(o=r[a])===null||o===void 0||(l=o[i])===null||l===void 0||(h=l.y[0])===null||h===void 0?void 0:h.y1)!==void 0&&{y1:(d=S.globals.seriesRange)===null||d===void 0||(u=d[a])===null||u===void 0||(g=u[i])===null||g===void 0||(p=g.y[0])===null||p===void 0?void 0:p.y1}),((f=S.globals.seriesRange)===null||f===void 0||(m=f[a])===null||m===void 0||(x=m[i])===null||x===void 0||(b=x.y[0])===null||b===void 0?void 0:b.y2)!==void 0&&{y2:(v=S.globals.seriesRange)===null||v===void 0||(w=v[a])===null||w===void 0||(k=w[i])===null||k===void 0||(y=k.y[0])===null||y===void 0?void 0:y.y2});if(E){if(C.tooltipLabels.drawSeriesTexts(G(G({},Y),{},{shared:!this.showOnIntersect&&this.tConfig.shared})),N)A();else if(this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(L),this.barSeriesHeight>0)){var $=new O(this.ctx),K=S.globals.dom.Paper.find(".apexcharts-bar-area[j='".concat(i,"']"));this.deactivateHoverFilter(),C.tooltipUtil.getAllMarkers(!0).length&&!this.barSeriesHeight&&A(),C.tooltipPosition.moveStickyTooltipOverBars(i,a);for(var ie=0;ie<K.length;ie++)$.pathMouseEnter(K[ie])}}else C.tooltipLabels.drawSeriesTexts(G({shared:!1},Y)),this.tooltipUtil.hasBars()&&C.tooltipPosition.moveStickyTooltipOverBars(i,a),N&&C.tooltipPosition.moveMarkers(a,i)}}]),n}(),il=function(){function n(e){q(this,n),this.w=e.w,this.barCtx=e,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}return Z(n,[{key:"handleBarDataLabels",value:function(e){var t,a,i=e.x,s=e.y,r=e.y1,o=e.y2,l=e.i,h=e.j,d=e.realIndex,u=e.columnGroupIndex,g=e.series,p=e.barHeight,f=e.barWidth,m=e.barXPosition,x=e.barYPosition,b=e.visibleSeries,v=this.w,w=new O(this.barCtx.ctx),k=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[d]:this.barCtx.strokeWidth;v.globals.isXNumeric&&!v.globals.isBarHorizontal?(t=i+parseFloat(f*(b+1)),a=s+parseFloat(p*(b+1))-k):(t=i+parseFloat(f*b),a=s+parseFloat(p*b));var y,E=null,S=i,C=s,N={},L=v.config.dataLabels,A=this.barCtx.barOptions.dataLabels,M=this.barCtx.barOptions.dataLabels.total;x!==void 0&&this.barCtx.isRangeBar&&(a=x,C=x),m!==void 0&&this.barCtx.isVerticalGroupedRangeBar&&(t=m,S=m);var F=L.offsetX,z=L.offsetY,B={width:0,height:0};if(v.config.dataLabels.enabled){var T=v.globals.series[l][h];B=w.getTextRects(v.config.dataLabels.formatter?v.config.dataLabels.formatter(T,G(G({},v),{},{seriesIndex:l,dataPointIndex:h,w:v})):v.globals.yLabelFormatters[0](T),parseFloat(L.style.fontSize))}var D={x:i,y:s,i:l,j:h,realIndex:d,columnGroupIndex:u,bcx:t,bcy:a,barHeight:p,barWidth:f,textRects:B,strokeWidth:k,dataLabelsX:S,dataLabelsY:C,dataLabelsConfig:L,barDataLabelsConfig:A,barTotalDataLabelsConfig:M,offX:F,offY:z};return N=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(D):this.calculateColumnsDataLabelsPosition(D),y=this.drawCalculatedDataLabels({x:N.dataLabelsX,y:N.dataLabelsY,val:this.barCtx.isRangeBar?[r,o]:v.config.chart.stackType==="100%"?g[d][h]:v.globals.series[d][h],i:d,j:h,barWidth:f,barHeight:p,textRects:B,dataLabelsConfig:L}),v.config.chart.stacked&&M.enabled&&(E=this.drawTotalDataLabels({x:N.totalDataLabelsX,y:N.totalDataLabelsY,barWidth:f,barHeight:p,realIndex:d,textAnchor:N.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:d,j:h}),dataLabelsConfig:L,barTotalDataLabelsConfig:M})),{dataLabelsPos:N,dataLabels:y,totalDataLabels:E}}},{key:"getStackedTotalDataLabel",value:function(e){var t=e.realIndex,a=e.j,i=this.w,s=this.barCtx.stackedSeriesTotals[a];return this.totalFormatter&&(s=this.totalFormatter(s,G(G({},i),{},{seriesIndex:t,dataPointIndex:a,w:i}))),s}},{key:"calculateColumnsDataLabelsPosition",value:function(e){var t=this,a=this.w,i=e.i,s=e.j,r=e.realIndex;e.columnGroupIndex;var o,l,h=e.y,d=e.bcx,u=e.barWidth,g=e.barHeight,p=e.textRects,f=e.dataLabelsX,m=e.dataLabelsY,x=e.dataLabelsConfig,b=e.barDataLabelsConfig,v=e.barTotalDataLabelsConfig,w=e.strokeWidth,k=e.offX,y=e.offY,E=d;g=Math.abs(g);var S=a.config.plotOptions.bar.dataLabels.orientation==="vertical",C=this.barCtx.barHelpers.getZeroValueEncounters({i,j:s}).zeroEncounters;d-=w/2;var N=a.globals.gridWidth/a.globals.dataPoints;this.barCtx.isVerticalGroupedRangeBar?f+=u/2:(f=a.globals.isXNumeric?d-u/2+k:d-N+u/2+k,!a.config.chart.stacked&&C>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(f-=u*C)),S&&(f=f+p.height/2-w/2-2);var L=a.globals.series[i][s]<0,A=h;switch(this.barCtx.isReversed&&(A=h+(L?g:-g)),b.position){case"center":m=S?L?A-g/2+y:A+g/2-y:L?A-g/2+p.height/2+y:A+g/2+p.height/2-y;break;case"bottom":m=S?L?A-g+y:A+g-y:L?A-g+p.height+w+y:A+g-p.height/2+w-y;break;case"top":m=S?L?A+y:A-y:L?A-p.height/2-y:A+p.height+y}var M=A;if(a.globals.seriesGroups.forEach(function(B){var T;(T=t.barCtx[B.join(",")])===null||T===void 0||T.prevY.forEach(function(D){M=L?Math.max(D[s],M):Math.min(D[s],M)})}),this.barCtx.lastActiveBarSerieIndex===r&&v.enabled){var F=new O(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:r,j:s}),x.fontSize);o=L?M-F.height/2-y-v.offsetY+18:M+F.height+y+v.offsetY-18;var z=N;l=E+(a.globals.isXNumeric?-u*a.globals.barGroups.length/2:a.globals.barGroups.length*u/2-(a.globals.barGroups.length-1)*u-z)+v.offsetX}return a.config.chart.stacked||(m<0?m=0+w:m+p.height/3>a.globals.gridHeight&&(m=a.globals.gridHeight-w)),{bcx:d,bcy:h,dataLabelsX:f,dataLabelsY:m,totalDataLabelsX:l,totalDataLabelsY:o,totalDataLabelsAnchor:"middle"}}},{key:"calculateBarsDataLabelsPosition",value:function(e){var t=this,a=this.w,i=e.x,s=e.i,r=e.j,o=e.realIndex,l=e.bcy,h=e.barHeight,d=e.barWidth,u=e.textRects,g=e.dataLabelsX,p=e.strokeWidth,f=e.dataLabelsConfig,m=e.barDataLabelsConfig,x=e.barTotalDataLabelsConfig,b=e.offX,v=e.offY,w=a.globals.gridHeight/a.globals.dataPoints,k=this.barCtx.barHelpers.getZeroValueEncounters({i:s,j:r}).zeroEncounters;d=Math.abs(d);var y,E,S=l-(this.barCtx.isRangeBar?0:w)+h/2+u.height/2+v-3;!a.config.chart.stacked&&k>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(S-=h*k);var C="start",N=a.globals.series[s][r]<0,L=i;switch(this.barCtx.isReversed&&(L=i+(N?-d:d),C=N?"start":"end"),m.position){case"center":g=N?L+d/2-b:Math.max(u.width/2,L-d/2)+b;break;case"bottom":g=N?L+d-p-b:L-d+p+b;break;case"top":g=N?L-p-b:L-p+b}var A=L;if(a.globals.seriesGroups.forEach(function(F){var z;(z=t.barCtx[F.join(",")])===null||z===void 0||z.prevX.forEach(function(B){A=N?Math.min(B[r],A):Math.max(B[r],A)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){var M=new O(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),f.fontSize);N?(y=A-p-b-x.offsetX,C="end"):y=A+b+x.offsetX+(this.barCtx.isReversed?-(d+p):p),E=S-u.height/2+M.height/2+x.offsetY+p,a.globals.barGroups.length>1&&(E-=a.globals.barGroups.length/2*(h/2))}return a.config.chart.stacked||(f.textAnchor==="start"?g-u.width<0?g=N?u.width+p:p:g+u.width>a.globals.gridWidth&&(g=N?a.globals.gridWidth-p:a.globals.gridWidth-u.width-p):f.textAnchor==="middle"?g-u.width/2<0?g=u.width/2+p:g+u.width/2>a.globals.gridWidth&&(g=a.globals.gridWidth-u.width/2-p):f.textAnchor==="end"&&(g<1?g=u.width+p:g+1>a.globals.gridWidth&&(g=a.globals.gridWidth-u.width-p))),{bcx:i,bcy:l,dataLabelsX:g,dataLabelsY:S,totalDataLabelsX:y,totalDataLabelsY:E,totalDataLabelsAnchor:C}}},{key:"drawCalculatedDataLabels",value:function(e){var t=e.x,a=e.y,i=e.val,s=e.i,r=e.j,o=e.textRects,l=e.barHeight,h=e.barWidth,d=e.dataLabelsConfig,u=this.w,g="rotate(0)";u.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(g="rotate(-90, ".concat(t,", ").concat(a,")"));var p=new qt(this.barCtx.ctx),f=new O(this.barCtx.ctx),m=d.formatter,x=null,b=u.globals.collapsedSeriesIndices.indexOf(s)>-1;if(d.enabled&&!b){x=f.group({class:"apexcharts-data-labels",transform:g});var v="";i!==void 0&&(v=m(i,G(G({},u),{},{seriesIndex:s,dataPointIndex:r,w:u}))),!i&&u.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(v="");var w=u.globals.series[s][r]<0,k=u.config.plotOptions.bar.dataLabels.position;u.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(k==="top"&&(d.textAnchor=w?"end":"start"),k==="center"&&(d.textAnchor="middle"),k==="bottom"&&(d.textAnchor=w?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&h<f.getTextRects(v,parseFloat(d.style.fontSize)).width&&(v=""),u.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?o.width/1.6>Math.abs(h)&&(v=""):o.height/1.6>Math.abs(l)&&(v=""));var y=G({},d);this.barCtx.isHorizontal&&i<0&&(d.textAnchor==="start"?y.textAnchor="end":d.textAnchor==="end"&&(y.textAnchor="start")),p.plotDataLabelsText({x:t,y:a,text:v,i:s,j:r,parent:x,dataLabelsConfig:y,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return x}},{key:"drawTotalDataLabels",value:function(e){var t=e.x,a=e.y,i=e.val,s=e.realIndex,r=e.textAnchor,o=e.barTotalDataLabelsConfig;this.w;var l,h=new O(this.barCtx.ctx);return o.enabled&&t!==void 0&&a!==void 0&&this.barCtx.lastActiveBarSerieIndex===s&&(l=h.drawText({x:t,y:a,foreColor:o.style.color,text:i,textAnchor:r,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight})),l}}]),n}(),sl=function(){function n(e){q(this,n),this.w=e.w,this.barCtx=e}return Z(n,[{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 a=0;a<e.length;a++)if(e[a].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=e[a].length),t.globals.isXNumeric)for(var i=0;i<e[a].length;i++)t.globals.seriesX[a][i]>t.globals.minX&&t.globals.seriesX[a][i]<t.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=t.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(t.globals.series),R.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(function(s){return s.map(function(r){return"none"})})),this.barCtx.seriesLen===0&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],t.globals.comboCharts||this.checkZeroSeries({series:e})}},{key:"initialPositions",value:function(e){var t,a,i,s,r,o,l,h,d=this.w,u=d.globals.dataPoints;this.barCtx.isRangeBar&&(u=d.globals.labels.length);var g=this.barCtx.seriesLen;if(d.config.plotOptions.bar.rangeBarGroupRows&&(g=1),this.barCtx.isHorizontal)r=(i=d.globals.gridHeight/u)/g,d.globals.isXNumeric&&(r=(i=d.globals.gridHeight/this.barCtx.totalItems)/this.barCtx.seriesLen),r=r*parseInt(this.barCtx.barOptions.barHeight,10)/100,String(this.barCtx.barOptions.barHeight).indexOf("%")===-1&&(r=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+d.globals.padHorizontal+(this.barCtx.isReversed?d.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=d.globals.gridWidth/2),a=(i-r*this.barCtx.seriesLen)/2;else{if(s=d.globals.gridWidth/this.barCtx.visibleItems,d.config.xaxis.convertedCatToNumeric&&(s=d.globals.gridWidth/d.globals.dataPoints),o=s/g*parseInt(this.barCtx.barOptions.columnWidth,10)/100,d.globals.isXNumeric){var p=this.barCtx.xRatio;d.globals.minXDiff&&d.globals.minXDiff!==.5&&d.globals.minXDiff/p>0&&(s=d.globals.minXDiff/p),(o=s/g*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(o=1)}String(this.barCtx.barOptions.columnWidth).indexOf("%")===-1&&(o=parseInt(this.barCtx.barOptions.columnWidth,10)),l=d.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?d.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),d.globals.isXNumeric?t=this.barCtx.getBarXForNumericXAxis({x:t,j:0,realIndex:e,barWidth:o}).x:t=d.globals.padHorizontal+R.noExponents(s-o*this.barCtx.seriesLen)/2}return d.globals.barHeight=r,d.globals.barWidth=o,{x:t,y:a,yDivision:i,xDivision:s,barHeight:r,barWidth:o,zeroH:l,zeroW:h}}},{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,a,i){var s,r,o,l,h=this.w,d=this.barCtx.ctx.fill,u=null,g=this.barCtx.barOptions.distributed?a:t,p=!1;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map(function(f){e[t][a]>=f.from&&e[t][a]<=f.to&&(u=f.color,p=!0)}),{color:d.fillPath({seriesNumber:this.barCtx.barOptions.distributed?g:i,dataPointIndex:a,color:u,value:e[t][a],fillConfig:(s=h.config.series[t].data[a])===null||s===void 0?void 0:s.fill,fillType:(r=h.config.series[t].data[a])!==null&&r!==void 0&&(o=r.fill)!==null&&o!==void 0&&o.type?(l=h.config.series[t].data[a])===null||l===void 0?void 0:l.fill.type:Array.isArray(h.config.fill.type)?h.config.fill.type[i]:h.config.fill.type}),useRangeColor:p}}},{key:"getStrokeWidth",value:function(e,t,a){var i=0,s=this.w;return this.barCtx.series[e][t]===void 0||this.barCtx.series[e][t]===null?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,s.config.stroke.show&&(this.barCtx.isNullValue||(i=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[a]:this.barCtx.strokeWidth)),i}},{key:"createBorderRadiusArr",value:function(e){var t,a=this.w,i=!this.w.config.chart.stacked||a.config.plotOptions.bar.borderRadius<=0,s=e.length,r=0|((t=e[0])===null||t===void 0?void 0:t.length),o=Array.from({length:s},function(){return Array(r).fill(i?"top":"none")});if(i)return o;for(var l=0;l<r;l++){for(var h=[],d=[],u=0,g=0;g<s;g++){var p=e[g][l];p>0?(h.push(g),u++):p<0&&(d.push(g),u++)}if(h.length>0&&d.length===0)if(h.length===1)o[h[0]][l]="both";else{var f,m=h[0],x=h[h.length-1],b=aa(h);try{for(b.s();!(f=b.n()).done;){var v=f.value;o[v][l]=v===m?"bottom":v===x?"top":"none"}}catch(T){b.e(T)}finally{b.f()}}else if(d.length>0&&h.length===0)if(d.length===1)o[d[0]][l]="both";else{var w,k=Math.max.apply(Math,d),y=Math.min.apply(Math,d),E=aa(d);try{for(E.s();!(w=E.n()).done;){var S=w.value;o[S][l]=S===k?"bottom":S===y?"top":"none"}}catch(T){E.e(T)}finally{E.f()}}else if(h.length>0&&d.length>0){var C,N=h[h.length-1],L=aa(h);try{for(L.s();!(C=L.n()).done;){var A=C.value;o[A][l]=A===N?"top":"none"}}catch(T){L.e(T)}finally{L.f()}var M,F=Math.max.apply(Math,d),z=aa(d);try{for(z.s();!(M=z.n()).done;){var B=M.value;o[B][l]=B===F?"bottom":"none"}}catch(T){z.e(T)}finally{z.f()}}else u===1&&(o[h[0]||d[0]][l]="both")}return o}},{key:"barBackground",value:function(e){var t=e.j,a=e.i,i=e.x1,s=e.x2,r=e.y1,o=e.y2,l=e.elSeries,h=this.w,d=new O(this.barCtx.ctx),u=new et(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&u===a){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);var g=this.barCtx.barOptions.colors.backgroundBarColors[t],p=d.drawRect(i!==void 0?i:0,r!==void 0?r:0,s!==void 0?s:h.globals.gridWidth,o!==void 0?o:h.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,g,this.barCtx.barOptions.colors.backgroundBarOpacity);l.add(p),p.node.classList.add("apexcharts-backgroundBar")}}},{key:"getColumnPaths",value:function(e){var t,a=e.barWidth,i=e.barXPosition,s=e.y1,r=e.y2,o=e.strokeWidth,l=e.isReversed,h=e.series,d=e.seriesGroup,u=e.realIndex,g=e.i,p=e.j,f=e.w,m=new O(this.barCtx.ctx);(o=Array.isArray(o)?o[u]:o)||(o=0);var x=a,b=i;(t=f.config.series[u].data[p])!==null&&t!==void 0&&t.columnWidthOffset&&(b=i-f.config.series[u].data[p].columnWidthOffset/2,x=a+f.config.series[u].data[p].columnWidthOffset);var v=o/2,w=b+v,k=b+x-v,y=(h[g][p]>=0?1:-1)*(l?-1:1);s+=.001-v*y,r+=.001+v*y;var E=m.move(w,s),S=m.move(w,s),C=m.line(k,s);if(f.globals.previousPaths.length>0&&(S=this.barCtx.getPreviousPath(u,p,!1)),E=E+m.line(w,r)+m.line(k,r)+C+(f.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[u][p]==="both"?" Z":" z"),S=S+m.line(w,s)+C+C+C+C+C+m.line(w,s)+(f.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[u][p]==="both"?" Z":" z"),this.arrBorderRadius[u][p]!=="none"&&(E=m.roundPathCorners(E,f.config.plotOptions.bar.borderRadius)),f.config.chart.stacked){var N=this.barCtx;(N=this.barCtx[d]).yArrj.push(r-v*y),N.yArrjF.push(Math.abs(s-r+o*y)),N.yArrjVal.push(this.barCtx.series[g][p])}return{pathTo:E,pathFrom:S}}},{key:"getBarpaths",value:function(e){var t,a=e.barYPosition,i=e.barHeight,s=e.x1,r=e.x2,o=e.strokeWidth,l=e.isReversed,h=e.series,d=e.seriesGroup,u=e.realIndex,g=e.i,p=e.j,f=e.w,m=new O(this.barCtx.ctx);(o=Array.isArray(o)?o[u]:o)||(o=0);var x=a,b=i;(t=f.config.series[u].data[p])!==null&&t!==void 0&&t.barHeightOffset&&(x=a-f.config.series[u].data[p].barHeightOffset/2,b=i+f.config.series[u].data[p].barHeightOffset);var v=o/2,w=x+v,k=x+b-v,y=(h[g][p]>=0?1:-1)*(l?-1:1);s+=.001+v*y,r+=.001-v*y;var E=m.move(s,w),S=m.move(s,w);f.globals.previousPaths.length>0&&(S=this.barCtx.getPreviousPath(u,p,!1));var C=m.line(s,k);if(E=E+m.line(r,w)+m.line(r,k)+C+(f.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[u][p]==="both"?" Z":" z"),S=S+m.line(s,w)+C+C+C+C+C+m.line(s,w)+(f.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[u][p]==="both"?" Z":" z"),this.arrBorderRadius[u][p]!=="none"&&(E=m.roundPathCorners(E,f.config.plotOptions.bar.borderRadius)),f.config.chart.stacked){var N=this.barCtx;(N=this.barCtx[d]).xArrj.push(r+v*y),N.xArrjF.push(Math.abs(s-r-o*y)),N.xArrjVal.push(this.barCtx.series[g][p])}return{pathTo:E,pathFrom:S}}},{key:"checkZeroSeries",value:function(e){for(var t=e.series,a=this.w,i=0;i<t.length;i++){for(var s=0,r=0;r<t[a.globals.maxValsInArrayIndex].length;r++)s+=t[i][r];s===0&&this.barCtx.zeroSerieses.push(i)}}},{key:"getXForValue",value:function(e,t){var a=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]?t:null;return e!=null&&(a=t+e/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?e/this.barCtx.invertedYRatio:0)),a}},{key:"getYForValue",value:function(e,t,a){var i=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3]?t:null;return e!=null&&(i=t-e/this.barCtx.yRatio[a]+2*(this.barCtx.isReversed?e/this.barCtx.yRatio[a]:0)),i}},{key:"getGoalValues",value:function(e,t,a,i,s,r){var o=this,l=this.w,h=[],d=function(p,f){var m;h.push((Ea(m={},e,e==="x"?o.getXForValue(p,t,!1):o.getYForValue(p,a,r,!1)),Ea(m,"attrs",f),m))};if(l.globals.seriesGoals[i]&&l.globals.seriesGoals[i][s]&&Array.isArray(l.globals.seriesGoals[i][s])&&l.globals.seriesGoals[i][s].forEach(function(p){d(p.value,p)}),this.barCtx.barOptions.isDumbbell&&l.globals.seriesRange.length){var u=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:l.globals.colors,g={strokeHeight:e==="x"?0:l.globals.markers.size[i],strokeWidth:e==="x"?l.globals.markers.size[i]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(u[i])?u[i][0]:u[i]};d(l.globals.seriesRangeStart[i][s],g),d(l.globals.seriesRangeEnd[i][s],G(G({},g),{},{strokeColor:Array.isArray(u[i])?u[i][1]:u[i]}))}return h}},{key:"drawGoalLine",value:function(e){var t=e.barXPosition,a=e.barYPosition,i=e.goalX,s=e.goalY,r=e.barWidth,o=e.barHeight,l=new O(this.barCtx.ctx),h=l.group({className:"apexcharts-bar-goals-groups"});h.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:h.node}),h.attr("clip-path","url(#gridRectMarkerMask".concat(this.barCtx.w.globals.cuid,")"));var d=null;return this.barCtx.isHorizontal?Array.isArray(i)&&i.forEach(function(u){if(u.x>=-1&&u.x<=l.w.globals.gridWidth+1){var g=u.attrs.strokeHeight!==void 0?u.attrs.strokeHeight:o/2,p=a+g+o/2;d=l.drawLine(u.x,p-2*g,u.x,p,u.attrs.strokeColor?u.attrs.strokeColor:void 0,u.attrs.strokeDashArray,u.attrs.strokeWidth?u.attrs.strokeWidth:2,u.attrs.strokeLineCap),h.add(d)}}):Array.isArray(s)&&s.forEach(function(u){if(u.y>=-1&&u.y<=l.w.globals.gridHeight+1){var g=u.attrs.strokeWidth!==void 0?u.attrs.strokeWidth:r/2,p=t+g+r/2;d=l.drawLine(p-2*g,u.y,p,u.y,u.attrs.strokeColor?u.attrs.strokeColor:void 0,u.attrs.strokeDashArray,u.attrs.strokeHeight?u.attrs.strokeHeight:2,u.attrs.strokeLineCap),h.add(d)}}),h}},{key:"drawBarShadow",value:function(e){var t=e.prevPaths,a=e.currPaths,i=e.color,s=this.w,r=t.x,o=t.x1,l=t.barYPosition,h=a.x,d=a.x1,u=a.barYPosition,g=l+a.barHeight,p=new O(this.barCtx.ctx),f=new R,m=p.move(o,g)+p.line(r,g)+p.line(h,u)+p.line(d,u)+p.line(o,g)+(s.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[realIndex][j]==="both"?" Z":" z");return p.drawPath({d:m,fill:f.shadeColor(.5,R.rgb2hex(i)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}},{key:"getZeroValueEncounters",value:function(e){var t,a=e.i,i=e.j,s=this.w,r=0,o=0;return(s.config.plotOptions.bar.horizontal?s.globals.series.map(function(l,h){return h}):((t=s.globals.columnSeries)===null||t===void 0?void 0:t.i.map(function(l){return l}))||[]).forEach(function(l){var h=s.globals.seriesPercent[l][i];h&&r++,l<a&&h===0&&o++}),{nonZeroColumns:r,zeroEncounters:o}}},{key:"getGroupIndex",value:function(e){var t=this.w,a=t.globals.seriesGroups.findIndex(function(r){return r.indexOf(t.globals.seriesNames[e])>-1}),i=this.barCtx.columnGroupIndices,s=i.indexOf(a);return s<0&&(i.push(a),s=i.length-1),{groupIndex:a,columnGroupIndex:s}}}]),n}(),Zt=function(){function n(e,t){q(this,n),this.ctx=e,this.w=e.w;var a=this.w;this.barOptions=a.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=a.config.stroke.width,this.isNullValue=!1,this.isRangeBar=a.globals.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!a.globals.isBarHorizontal&&a.globals.seriesRange.length&&a.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=t,this.xyRatios!==null&&(this.xRatio=t.xRatio,this.yRatio=t.yRatio,this.invertedXRatio=t.invertedXRatio,this.invertedYRatio=t.invertedYRatio,this.baseLineY=t.baseLineY,this.baseLineInvertedY=t.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[];var i=new et(this.ctx);this.lastActiveBarSerieIndex=i.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];var s=i.getBarSeriesIndices(),r=new Le(this.ctx);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map(function(o,l){return s.indexOf(l)===-1?l:-1}).filter(function(o){return o!==-1})),this.barHelpers=new sl(this)}return Z(n,[{key:"draw",value:function(e,t){var a=this.w,i=new O(this.ctx),s=new Le(this.ctx,a);e=s.getLogSeries(e),this.series=e,this.yRatio=s.getLogYRatios(this.yRatio),this.barHelpers.initVariables(e);var r=i.group({class:"apexcharts-bar-series apexcharts-plot-series"});a.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 o=0,l=0;o<e.length;o++,l++){var h,d,u,g,p=void 0,f=void 0,m=[],x=[],b=a.globals.comboCharts?t[o]:o,v=this.barHelpers.getGroupIndex(b).columnGroupIndex,w=i.group({class:"apexcharts-series",rel:o+1,seriesName:R.escapeString(a.globals.seriesNames[b]),"data:realIndex":b});this.ctx.series.addCollapsedClassToSeries(w,b),e[o].length>0&&(this.visibleI=this.visibleI+1);var k=0,y=0;this.yRatio.length>1&&(this.yaxisIndex=a.globals.seriesYAxisReverseMap[b],this.translationsIndex=b);var E=this.translationsIndex;this.isReversed=a.config.yaxis[this.yaxisIndex]&&a.config.yaxis[this.yaxisIndex].reversed;var S=this.barHelpers.initialPositions(b);f=S.y,k=S.barHeight,d=S.yDivision,g=S.zeroW,p=S.x,y=S.barWidth,h=S.xDivision,u=S.zeroH,this.isHorizontal||x.push(p+y/2);var C=i.group({class:"apexcharts-datalabels","data:realIndex":b});a.globals.delayedElements.push({el:C.node}),C.node.classList.add("apexcharts-element-hidden");var N=i.group({class:"apexcharts-bar-goals-markers"}),L=i.group({class:"apexcharts-bar-shadows"});a.globals.delayedElements.push({el:L.node}),L.node.classList.add("apexcharts-element-hidden");for(var A=0;A<e[o].length;A++){var M=this.barHelpers.getStrokeWidth(o,A,b),F=null,z={indexes:{i:o,j:A,realIndex:b,translationsIndex:E,bc:l},x:p,y:f,strokeWidth:M,elSeries:w};this.isHorizontal?(F=this.drawBarPaths(G(G({},z),{},{barHeight:k,zeroW:g,yDivision:d})),y=this.series[o][A]/this.invertedYRatio):(F=this.drawColumnPaths(G(G({},z),{},{xDivision:h,barWidth:y,zeroH:u})),k=this.series[o][A]/this.yRatio[E]);var B=this.barHelpers.getPathFillColor(e,o,A,b);if(this.isFunnel&&this.barOptions.isFunnel3d&&this.pathArr.length&&A>0){var T,D=this.barHelpers.drawBarShadow({color:typeof B.color=="string"&&((T=B.color)===null||T===void 0?void 0:T.indexOf("url"))===-1?B.color:R.hexToRgba(a.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:F});L.add(D),a.config.chart.dropShadow.enabled&&new Ie(this.ctx).dropShadow(D,a.config.chart.dropShadow,b)}this.pathArr.push(F);var I=this.barHelpers.drawGoalLine({barXPosition:F.barXPosition,barYPosition:F.barYPosition,goalX:F.goalX,goalY:F.goalY,barHeight:k,barWidth:y});I&&N.add(I),f=F.y,p=F.x,A>0&&x.push(p+y/2),m.push(f),this.renderSeries(G(G({realIndex:b,pathFill:B.color},B.useRangeColor?{lineFill:B.color}:{}),{},{j:A,i:o,columnGroupIndex:v,pathFrom:F.pathFrom,pathTo:F.pathTo,strokeWidth:M,elSeries:w,x:p,y:f,series:e,barHeight:Math.abs(F.barHeight?F.barHeight:k),barWidth:Math.abs(F.barWidth?F.barWidth:y),elDataLabelsWrap:C,elGoalsMarkers:N,elBarShadows:L,visibleSeries:this.visibleI,type:"bar"}))}a.globals.seriesXvalues[b]=x,a.globals.seriesYvalues[b]=m,r.add(w)}return r}},{key:"renderSeries",value:function(e){var t=e.realIndex,a=e.pathFill,i=e.lineFill,s=e.j,r=e.i,o=e.columnGroupIndex,l=e.pathFrom,h=e.pathTo,d=e.strokeWidth,u=e.elSeries,g=e.x,p=e.y,f=e.y1,m=e.y2,x=e.series,b=e.barHeight,v=e.barWidth,w=e.barXPosition,k=e.barYPosition,y=e.elDataLabelsWrap,E=e.elGoalsMarkers,S=e.elBarShadows,C=e.visibleSeries,N=e.type,L=e.classes,A=this.w,M=new O(this.ctx),F=!1;if(!i){var z=typeof A.globals.stroke.colors[t]=="function"?function(Y){var $,K=A.config.stroke.colors;return Array.isArray(K)&&K.length>0&&(($=K[Y])||($=""),typeof $=="function")?$({value:A.globals.series[Y][s],dataPointIndex:s,w:A}):$}(t):A.globals.stroke.colors[t];i=this.barOptions.distributed?A.globals.stroke.colors[s]:z}var B=new il(this).handleBarDataLabels({x:g,y:p,y1:f,y2:m,i:r,j:s,series:x,realIndex:t,columnGroupIndex:o,barHeight:b,barWidth:v,barXPosition:w,barYPosition:k,visibleSeries:C});A.globals.isBarHorizontal||(B.dataLabelsPos.dataLabelsX+v<0||B.dataLabelsPos.dataLabelsX-v>A.globals.gridWidth)&&(F=!0),A.config.series[r].data[s]&&A.config.series[r].data[s].strokeColor&&(i=A.config.series[r].data[s].strokeColor),this.isNullValue&&(a="none");var T=s/A.config.chart.animations.animateGradually.delay*(A.config.chart.animations.speed/A.globals.dataPoints)/2.4;if(!F){var D=M.renderPaths({i:r,j:s,realIndex:t,pathFrom:l,pathTo:h,stroke:i,strokeWidth:d,strokeLineCap:A.config.stroke.lineCap,fill:a,animationDelay:T,initialSpeed:A.config.chart.animations.speed,dataChangeSpeed:A.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(N,"-area ").concat(L),chartType:N});D.attr("clip-path","url(#gridRectBarMask".concat(A.globals.cuid,")"));var I=A.config.forecastDataPoints;I.count>0&&s>=A.globals.dataPoints-I.count&&(D.node.setAttribute("stroke-dasharray",I.dashArray),D.node.setAttribute("stroke-width",I.strokeWidth),D.node.setAttribute("fill-opacity",I.fillOpacity)),f!==void 0&&m!==void 0&&(D.attr("data-range-y1",f),D.attr("data-range-y2",m)),new Ie(this.ctx).setSelectionFilter(D,t,s),u.add(D),D.attr({cy:B.dataLabelsPos.bcy,cx:B.dataLabelsPos.bcx,j:s,val:A.globals.series[r][s],barHeight:b,barWidth:v}),B.dataLabels!==null&&y.add(B.dataLabels),B.totalDataLabels&&y.add(B.totalDataLabels),u.add(y),E&&u.add(E),S&&u.add(S)}return u}},{key:"drawBarPaths",value:function(e){var t,a=e.indexes,i=e.barHeight,s=e.strokeWidth,r=e.zeroW,o=e.x,l=e.y,h=e.yDivision,d=e.elSeries,u=this.w,g=a.i,p=a.j;if(u.globals.isXNumeric)t=(l=(u.globals.seriesX[g][p]-u.globals.minX)/this.invertedXRatio-i)+i*this.visibleI;else if(u.config.plotOptions.bar.hideZeroBarsWhenGrouped){var f=this.barHelpers.getZeroValueEncounters({i:g,j:p}),m=f.nonZeroColumns,x=f.zeroEncounters;m>0&&(i=this.seriesLen*i/m),t=l+i*this.visibleI,t-=i*x}else t=l+i*this.visibleI;this.isFunnel&&(r-=(this.barHelpers.getXForValue(this.series[g][p],r)-r)/2),o=this.barHelpers.getXForValue(this.series[g][p],r);var b=this.barHelpers.getBarpaths({barYPosition:t,barHeight:i,x1:r,x2:o,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:a.realIndex,i:g,j:p,w:u});return u.globals.isXNumeric||(l+=h),this.barHelpers.barBackground({j:p,i:g,y1:t-i*this.visibleI,y2:i*this.seriesLen,elSeries:d}),{pathTo:b.pathTo,pathFrom:b.pathFrom,x1:r,x:o,y:l,goalX:this.barHelpers.getGoalValues("x",r,null,g,p),barYPosition:t,barHeight:i}}},{key:"drawColumnPaths",value:function(e){var t,a=e.indexes,i=e.x,s=e.y,r=e.xDivision,o=e.barWidth,l=e.zeroH,h=e.strokeWidth,d=e.elSeries,u=this.w,g=a.realIndex,p=a.translationsIndex,f=a.i,m=a.j,x=a.bc;if(u.globals.isXNumeric){var b=this.getBarXForNumericXAxis({x:i,j:m,realIndex:g,barWidth:o});i=b.x,t=b.barXPosition}else if(u.config.plotOptions.bar.hideZeroBarsWhenGrouped){var v=this.barHelpers.getZeroValueEncounters({i:f,j:m}),w=v.nonZeroColumns,k=v.zeroEncounters;w>0&&(o=this.seriesLen*o/w),t=i+o*this.visibleI,t-=o*k}else t=i+o*this.visibleI;s=this.barHelpers.getYForValue(this.series[f][m],l,p);var y=this.barHelpers.getColumnPaths({barXPosition:t,barWidth:o,y1:l,y2:s,strokeWidth:h,isReversed:this.isReversed,series:this.series,realIndex:g,i:f,j:m,w:u});return u.globals.isXNumeric||(i+=r),this.barHelpers.barBackground({bc:x,j:m,i:f,x1:t-h/2-o*this.visibleI,x2:o*this.seriesLen+h/2,elSeries:d}),{pathTo:y.pathTo,pathFrom:y.pathFrom,x:i,y:s,goalY:this.barHelpers.getGoalValues("y",null,l,f,m,p),barXPosition:t,barWidth:o}}},{key:"getBarXForNumericXAxis",value:function(e){var t=e.x,a=e.barWidth,i=e.realIndex,s=e.j,r=this.w,o=i;return r.globals.seriesX[i].length||(o=r.globals.maxValsInArrayIndex),R.isNumber(r.globals.seriesX[o][s])&&(t=(r.globals.seriesX[o][s]-r.globals.minX)/this.xRatio-a*this.seriesLen/2),{barXPosition:t+a*this.visibleI,x:t}}},{key:"getPreviousPath",value:function(e,t){for(var a=this.w,i="M 0 0",s=0;s<a.globals.previousPaths.length;s++){var r=a.globals.previousPaths[s];r.paths&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(e,10)&&a.globals.previousPaths[s].paths[t]!==void 0&&(i=a.globals.previousPaths[s].paths[t].d)}return i}}]),n}(),ur=function(n){sa(t,Zt);var e=ia(t);function t(){return q(this,t),e.apply(this,arguments)}return Z(t,[{key:"draw",value:function(a,i){var s=this,r=this.w;this.graphics=new O(this.ctx),this.bar=new Zt(this.ctx,this.xyRatios);var o=new Le(this.ctx,r);a=o.getLogSeries(a),this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(a),r.config.chart.stackType==="100%"&&(a=r.globals.comboCharts?i.map(function(f){return r.globals.seriesPercent[f]}):r.globals.seriesPercent.slice()),this.series=a,this.barHelpers.initializeStackedPrevVars(this);for(var l=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),h=0,d=0,u=function(f,m){var x=void 0,b=void 0,v=void 0,w=void 0,k=r.globals.comboCharts?i[f]:f,y=s.barHelpers.getGroupIndex(k),E=y.groupIndex,S=y.columnGroupIndex;s.groupCtx=s[r.globals.seriesGroups[E]];var C=[],N=[],L=0;s.yRatio.length>1&&(s.yaxisIndex=r.globals.seriesYAxisReverseMap[k][0],L=k),s.isReversed=r.config.yaxis[s.yaxisIndex]&&r.config.yaxis[s.yaxisIndex].reversed;var A=s.graphics.group({class:"apexcharts-series",seriesName:R.escapeString(r.globals.seriesNames[k]),rel:f+1,"data:realIndex":k});s.ctx.series.addCollapsedClassToSeries(A,k);var M=s.graphics.group({class:"apexcharts-datalabels","data:realIndex":k}),F=s.graphics.group({class:"apexcharts-bar-goals-markers"}),z=0,B=0,T=s.initialPositions(h,d,x,b,v,w,L);d=T.y,z=T.barHeight,b=T.yDivision,w=T.zeroW,h=T.x,B=T.barWidth,x=T.xDivision,v=T.zeroH,r.globals.barHeight=z,r.globals.barWidth=B,s.barHelpers.initializeStackedXYVars(s),s.groupCtx.prevY.length===1&&s.groupCtx.prevY[0].every(function(ge){return isNaN(ge)})&&(s.groupCtx.prevY[0]=s.groupCtx.prevY[0].map(function(){return v}),s.groupCtx.prevYF[0]=s.groupCtx.prevYF[0].map(function(){return 0}));for(var D=0;D<r.globals.dataPoints;D++){var I=s.barHelpers.getStrokeWidth(f,D,k),Y={indexes:{i:f,j:D,realIndex:k,translationsIndex:L,bc:m},strokeWidth:I,x:h,y:d,elSeries:A,columnGroupIndex:S,seriesGroup:r.globals.seriesGroups[E]},$=null;s.isHorizontal?($=s.drawStackedBarPaths(G(G({},Y),{},{zeroW:w,barHeight:z,yDivision:b})),B=s.series[f][D]/s.invertedYRatio):($=s.drawStackedColumnPaths(G(G({},Y),{},{xDivision:x,barWidth:B,zeroH:v})),z=s.series[f][D]/s.yRatio[L]);var K=s.barHelpers.drawGoalLine({barXPosition:$.barXPosition,barYPosition:$.barYPosition,goalX:$.goalX,goalY:$.goalY,barHeight:z,barWidth:B});K&&F.add(K),d=$.y,h=$.x,C.push(h),N.push(d);var ie=s.barHelpers.getPathFillColor(a,f,D,k),he="",X=r.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y";(s.barHelpers.arrBorderRadius[k][D]==="bottom"&&r.globals.series[k][D]>0||s.barHelpers.arrBorderRadius[k][D]==="top"&&r.globals.series[k][D]<0)&&(he=X),A=s.renderSeries(G(G({realIndex:k,pathFill:ie.color},ie.useRangeColor?{lineFill:ie.color}:{}),{},{j:D,i:f,columnGroupIndex:S,pathFrom:$.pathFrom,pathTo:$.pathTo,strokeWidth:I,elSeries:A,x:h,y:d,series:a,barHeight:z,barWidth:B,elDataLabelsWrap:M,elGoalsMarkers:F,type:"bar",visibleSeries:S,classes:he}))}r.globals.seriesXvalues[k]=C,r.globals.seriesYvalues[k]=N,s.groupCtx.prevY.push(s.groupCtx.yArrj),s.groupCtx.prevYF.push(s.groupCtx.yArrjF),s.groupCtx.prevYVal.push(s.groupCtx.yArrjVal),s.groupCtx.prevX.push(s.groupCtx.xArrj),s.groupCtx.prevXF.push(s.groupCtx.xArrjF),s.groupCtx.prevXVal.push(s.groupCtx.xArrjVal),l.add(A)},g=0,p=0;g<a.length;g++,p++)u(g,p);return l}},{key:"initialPositions",value:function(a,i,s,r,o,l,h){var d,u,g=this.w;if(this.isHorizontal){r=g.globals.gridHeight/g.globals.dataPoints;var p=g.config.plotOptions.bar.barHeight;d=String(p).indexOf("%")===-1?parseInt(p,10):r*parseInt(p,10)/100,l=g.globals.padHorizontal+(this.isReversed?g.globals.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),i=(r-d)/2}else{u=s=g.globals.gridWidth/g.globals.dataPoints;var f=g.config.plotOptions.bar.columnWidth;g.globals.isXNumeric&&g.globals.dataPoints>1?u=(s=g.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:String(f).indexOf("%")===-1?u=parseInt(f,10):u*=parseInt(f,10)/100,o=this.isReversed?this.baseLineY[h]:g.globals.gridHeight-this.baseLineY[h],a=g.globals.padHorizontal+(s-u)/2}var m=g.globals.barGroups.length||1;return{x:a,y:i,yDivision:r,xDivision:s,barHeight:d/m,barWidth:u/m,zeroH:o,zeroW:l}}},{key:"drawStackedBarPaths",value:function(a){for(var i,s=a.indexes,r=a.barHeight,o=a.strokeWidth,l=a.zeroW,h=a.x,d=a.y,u=a.columnGroupIndex,g=a.seriesGroup,p=a.yDivision,f=a.elSeries,m=this.w,x=d+u*r,b=s.i,v=s.j,w=s.realIndex,k=s.translationsIndex,y=0,E=0;E<this.groupCtx.prevXF.length;E++)y+=this.groupCtx.prevXF[E][v];var S=b;if(m.config.series[w].name&&(S=g.indexOf(m.config.series[w].name)),S>0){var C=l;this.groupCtx.prevXVal[S-1][v]<0?C=this.series[b][v]>=0?this.groupCtx.prevX[S-1][v]+y-2*(this.isReversed?y:0):this.groupCtx.prevX[S-1][v]:this.groupCtx.prevXVal[S-1][v]>=0&&(C=this.series[b][v]>=0?this.groupCtx.prevX[S-1][v]:this.groupCtx.prevX[S-1][v]-y+2*(this.isReversed?y:0)),i=C}else i=l;h=this.series[b][v]===null?i:i+this.series[b][v]/this.invertedYRatio-2*(this.isReversed?this.series[b][v]/this.invertedYRatio:0);var N=this.barHelpers.getBarpaths({barYPosition:x,barHeight:r,x1:i,x2:h,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:s.realIndex,seriesGroup:g,i:b,j:v,w:m});return this.barHelpers.barBackground({j:v,i:b,y1:x,y2:r,elSeries:f}),d+=p,{pathTo:N.pathTo,pathFrom:N.pathFrom,goalX:this.barHelpers.getGoalValues("x",l,null,b,v,k),barXPosition:i,barYPosition:x,x:h,y:d}}},{key:"drawStackedColumnPaths",value:function(a){var i=a.indexes,s=a.x,r=a.y,o=a.xDivision,l=a.barWidth,h=a.zeroH,d=a.columnGroupIndex,u=a.seriesGroup,g=a.elSeries,p=this.w,f=i.i,m=i.j,x=i.bc,b=i.realIndex,v=i.translationsIndex;if(p.globals.isXNumeric){var w=p.globals.seriesX[b][m];w||(w=0),s=(w-p.globals.minX)/this.xRatio-l/2*p.globals.barGroups.length}for(var k,y=s+d*l,E=0,S=0;S<this.groupCtx.prevYF.length;S++)E+=isNaN(this.groupCtx.prevYF[S][m])?0:this.groupCtx.prevYF[S][m];var C=f;if(u&&(C=u.indexOf(p.globals.seriesNames[b])),C>0&&!p.globals.isXNumeric||C>0&&p.globals.isXNumeric&&p.globals.seriesX[b-1][m]===p.globals.seriesX[b][m]){var N,L,A,M=Math.min(this.yRatio.length+1,b+1);if(this.groupCtx.prevY[C-1]!==void 0&&this.groupCtx.prevY[C-1].length)for(var F=1;F<M;F++){var z;if(!isNaN((z=this.groupCtx.prevY[C-F])===null||z===void 0?void 0:z[m])){A=this.groupCtx.prevY[C-F][m];break}}for(var B=1;B<M;B++){var T,D;if(((T=this.groupCtx.prevYVal[C-B])===null||T===void 0?void 0:T[m])<0){L=this.series[f][m]>=0?A-E+2*(this.isReversed?E:0):A;break}if(((D=this.groupCtx.prevYVal[C-B])===null||D===void 0?void 0:D[m])>=0){L=this.series[f][m]>=0?A:A+E-2*(this.isReversed?E:0);break}}L===void 0&&(L=p.globals.gridHeight),k=(N=this.groupCtx.prevYF[0])!==null&&N!==void 0&&N.every(function(Y){return Y===0})&&this.groupCtx.prevYF.slice(1,C).every(function(Y){return Y.every(function($){return isNaN($)})})?h:L}else k=h;r=this.series[f][m]?k-this.series[f][m]/this.yRatio[v]+2*(this.isReversed?this.series[f][m]/this.yRatio[v]:0):k;var I=this.barHelpers.getColumnPaths({barXPosition:y,barWidth:l,y1:k,y2:r,yRatio:this.yRatio[v],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:u,realIndex:i.realIndex,i:f,j:m,w:p});return this.barHelpers.barBackground({bc:x,j:m,i:f,x1:y,x2:l,elSeries:g}),{pathTo:I.pathTo,pathFrom:I.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,h,f,m),barXPosition:y,x:p.globals.isXNumeric?s:s+o,y:r}}}]),t}(),Vi=function(n){sa(t,Zt);var e=ia(t);function t(){return q(this,t),e.apply(this,arguments)}return Z(t,[{key:"draw",value:function(a,i,s){var r=this,o=this.w,l=new O(this.ctx),h=o.globals.comboCharts?i:o.config.chart.type,d=new lt(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=o.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&this.candlestickOptions.type==="ohlc";var u=new Le(this.ctx,o);a=u.getLogSeries(a),this.series=a,this.yRatio=u.getLogYRatios(this.yRatio),this.barHelpers.initVariables(a);for(var g=l.group({class:"apexcharts-".concat(h,"-series apexcharts-plot-series")}),p=function(m){r.isBoxPlot=o.config.chart.type==="boxPlot"||o.config.series[m].type==="boxPlot";var x,b,v,w,k=void 0,y=void 0,E=[],S=[],C=o.globals.comboCharts?s[m]:m,N=r.barHelpers.getGroupIndex(C).columnGroupIndex,L=l.group({class:"apexcharts-series",seriesName:R.escapeString(o.globals.seriesNames[C]),rel:m+1,"data:realIndex":C});r.ctx.series.addCollapsedClassToSeries(L,C),a[m].length>0&&(r.visibleI=r.visibleI+1);var A,M,F=0;r.yRatio.length>1&&(r.yaxisIndex=o.globals.seriesYAxisReverseMap[C][0],F=C);var z=r.barHelpers.initialPositions(C);y=z.y,A=z.barHeight,b=z.yDivision,w=z.zeroW,k=z.x,M=z.barWidth,x=z.xDivision,v=z.zeroH,S.push(k+M/2);for(var B=l.group({class:"apexcharts-datalabels","data:realIndex":C}),T=l.group({class:"apexcharts-bar-goals-markers"}),D=function(Y){var $=r.barHelpers.getStrokeWidth(m,Y,C),K=null,ie={indexes:{i:m,j:Y,realIndex:C,translationsIndex:F},x:k,y,strokeWidth:$,elSeries:L};K=r.isHorizontal?r.drawHorizontalBoxPaths(G(G({},ie),{},{yDivision:b,barHeight:A,zeroW:w})):r.drawVerticalBoxPaths(G(G({},ie),{},{xDivision:x,barWidth:M,zeroH:v})),y=K.y,k=K.x;var he=r.barHelpers.drawGoalLine({barXPosition:K.barXPosition,barYPosition:K.barYPosition,goalX:K.goalX,goalY:K.goalY,barHeight:A,barWidth:M});he&&T.add(he),Y>0&&S.push(k+M/2),E.push(y),K.pathTo.forEach(function(X,ge){var oe=!r.isBoxPlot&&r.candlestickOptions.wick.useFillColor?K.color[ge]:o.globals.stroke.colors[m],ne=d.fillPath({seriesNumber:C,dataPointIndex:Y,color:K.color[ge],value:a[m][Y]});r.renderSeries({realIndex:C,pathFill:ne,lineFill:oe,j:Y,i:m,pathFrom:K.pathFrom,pathTo:X,strokeWidth:$,elSeries:L,x:k,y,series:a,columnGroupIndex:N,barHeight:A,barWidth:M,elDataLabelsWrap:B,elGoalsMarkers:T,visibleSeries:r.visibleI,type:o.config.chart.type})})},I=0;I<o.globals.dataPoints;I++)D(I);o.globals.seriesXvalues[C]=S,o.globals.seriesYvalues[C]=E,g.add(L)},f=0;f<a.length;f++)p(f);return g}},{key:"drawVerticalBoxPaths",value:function(a){var i=a.indexes,s=a.x;a.y;var r=a.xDivision,o=a.barWidth,l=a.zeroH,h=a.strokeWidth,d=this.w,u=new O(this.ctx),g=i.i,p=i.j,f=d.config.plotOptions.candlestick.colors,m=this.boxOptions.colors,x=i.realIndex,b=function(I){return Array.isArray(I)?I[x]:I},v=b(f.upward),w=b(f.downward),k=this.yRatio[i.translationsIndex],y=this.getOHLCValue(x,p),E=l,S=l,C=y.o<y.c?[v]:[w];this.isBoxPlot&&(C=[b(m.lower),b(m.upper)]);var N=Math.min(y.o,y.c),L=Math.max(y.o,y.c),A=y.m;d.globals.isXNumeric&&(s=(d.globals.seriesX[x][p]-d.globals.minX)/this.xRatio-o/2);var M=s+o*this.visibleI;this.series[g][p]===void 0||this.series[g][p]===null?(N=l,L=l):(N=l-N/k,L=l-L/k,E=l-y.h/k,S=l-y.l/k,A=l-y.m/k);var F=u.move(M,l),z=u.move(M+o/2,N);if(d.globals.previousPaths.length>0&&(z=this.getPreviousPath(x,p,!0)),this.isOHLC){var B=M+o/2,T=l-y.o/k,D=l-y.c/k;F=[u.move(B,E)+u.line(B,S)+u.move(B,T)+u.line(M,T)+u.move(B,D)+u.line(M+o,D)]}else F=this.isBoxPlot?[u.move(M,N)+u.line(M+o/2,N)+u.line(M+o/2,E)+u.line(M+o/4,E)+u.line(M+o-o/4,E)+u.line(M+o/2,E)+u.line(M+o/2,N)+u.line(M+o,N)+u.line(M+o,A)+u.line(M,A)+u.line(M,N+h/2),u.move(M,A)+u.line(M+o,A)+u.line(M+o,L)+u.line(M+o/2,L)+u.line(M+o/2,S)+u.line(M+o-o/4,S)+u.line(M+o/4,S)+u.line(M+o/2,S)+u.line(M+o/2,L)+u.line(M,L)+u.line(M,A)+"z"]:[u.move(M,L)+u.line(M+o/2,L)+u.line(M+o/2,E)+u.line(M+o/2,L)+u.line(M+o,L)+u.line(M+o,N)+u.line(M+o/2,N)+u.line(M+o/2,S)+u.line(M+o/2,N)+u.line(M,N)+u.line(M,L-h/2)];return z+=u.move(M,N),d.globals.isXNumeric||(s+=r),{pathTo:F,pathFrom:z,x:s,y:L,goalY:this.barHelpers.getGoalValues("y",null,l,g,p,i.translationsIndex),barXPosition:M,color:C}}},{key:"drawHorizontalBoxPaths",value:function(a){var i=a.indexes;a.x;var s=a.y,r=a.yDivision,o=a.barHeight,l=a.zeroW,h=a.strokeWidth,d=this.w,u=new O(this.ctx),g=i.i,p=i.j,f=this.boxOptions.colors.lower;this.isBoxPlot&&(f=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var m=this.invertedYRatio,x=i.realIndex,b=this.getOHLCValue(x,p),v=l,w=l,k=Math.min(b.o,b.c),y=Math.max(b.o,b.c),E=b.m;d.globals.isXNumeric&&(s=(d.globals.seriesX[x][p]-d.globals.minX)/this.invertedXRatio-o/2);var S=s+o*this.visibleI;this.series[g][p]===void 0||this.series[g][p]===null?(k=l,y=l):(k=l+k/m,y=l+y/m,v=l+b.h/m,w=l+b.l/m,E=l+b.m/m);var C=u.move(l,S),N=u.move(k,S+o/2);return d.globals.previousPaths.length>0&&(N=this.getPreviousPath(x,p,!0)),C=[u.move(k,S)+u.line(k,S+o/2)+u.line(v,S+o/2)+u.line(v,S+o/2-o/4)+u.line(v,S+o/2+o/4)+u.line(v,S+o/2)+u.line(k,S+o/2)+u.line(k,S+o)+u.line(E,S+o)+u.line(E,S)+u.line(k+h/2,S),u.move(E,S)+u.line(E,S+o)+u.line(y,S+o)+u.line(y,S+o/2)+u.line(w,S+o/2)+u.line(w,S+o-o/4)+u.line(w,S+o/4)+u.line(w,S+o/2)+u.line(y,S+o/2)+u.line(y,S)+u.line(E,S)+"z"],N+=u.move(k,S),d.globals.isXNumeric||(s+=r),{pathTo:C,pathFrom:N,x:y,y:s,goalX:this.barHelpers.getGoalValues("x",l,null,g,p),barYPosition:S,color:f}}},{key:"getOHLCValue",value:function(a,i){var s=this.w,r=new Le(this.ctx,s),o=r.getLogValAtSeriesIndex(s.globals.seriesCandleH[a][i],a),l=r.getLogValAtSeriesIndex(s.globals.seriesCandleO[a][i],a),h=r.getLogValAtSeriesIndex(s.globals.seriesCandleM[a][i],a),d=r.getLogValAtSeriesIndex(s.globals.seriesCandleC[a][i],a),u=r.getLogValAtSeriesIndex(s.globals.seriesCandleL[a][i],a);return{o:this.isBoxPlot?o:l,h:this.isBoxPlot?l:o,m:h,l:this.isBoxPlot?d:u,c:this.isBoxPlot?u:d}}}]),t}(),gr=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"checkColorRange",value:function(){var e=this.w,t=!1,a=e.config.plotOptions[e.config.chart.type];return a.colorScale.ranges.length>0&&a.colorScale.ranges.map(function(i,s){i.from<=0&&(t=!0)}),t}},{key:"getShadeColor",value:function(e,t,a,i){var s=this.w,r=1,o=s.config.plotOptions[e].shadeIntensity,l=this.determineColor(e,t,a);s.globals.hasNegs||i?r=s.config.plotOptions[e].reverseNegativeShade?l.percent<0?l.percent/100*(1.25*o):(1-l.percent/100)*(1.25*o):l.percent<=0?1-(1+l.percent/100)*o:(1-l.percent/100)*o:(r=1-l.percent/100,e==="treemap"&&(r=(1-l.percent/100)*(1.25*o)));var h=l.color,d=new R;if(s.config.plotOptions[e].enableShades)if(this.w.config.theme.mode==="dark"){var u=d.shadeColor(-1*r,l.color);h=R.hexToRgba(R.isColorHex(u)?u:R.rgb2hex(u),s.config.fill.opacity)}else{var g=d.shadeColor(r,l.color);h=R.hexToRgba(R.isColorHex(g)?g:R.rgb2hex(g),s.config.fill.opacity)}return{color:h,colorProps:l}}},{key:"determineColor",value:function(e,t,a){var i=this.w,s=i.globals.series[t][a],r=i.config.plotOptions[e],o=r.colorScale.inverse?a:t;r.distributed&&i.config.chart.type==="treemap"&&(o=a);var l=i.globals.colors[o],h=null,d=Math.min.apply(Math,Pe(i.globals.series[t])),u=Math.max.apply(Math,Pe(i.globals.series[t]));r.distributed||e!=="heatmap"||(d=i.globals.minY,u=i.globals.maxY),r.colorScale.min!==void 0&&(d=r.colorScale.min<i.globals.minY?r.colorScale.min:i.globals.minY,u=r.colorScale.max>i.globals.maxY?r.colorScale.max:i.globals.maxY);var g=Math.abs(u)+Math.abs(d),p=100*s/(g===0?g-1e-6:g);return r.colorScale.ranges.length>0&&r.colorScale.ranges.map(function(f,m){if(s>=f.from&&s<=f.to){l=f.color,h=f.foreColor?f.foreColor:null,d=f.from,u=f.to;var x=Math.abs(u)+Math.abs(d);p=100*s/(x===0?x-1e-6:x)}}),{color:l,foreColor:h,percent:p}}},{key:"calculateDataLabels",value:function(e){var t=e.text,a=e.x,i=e.y,s=e.i,r=e.j,o=e.colorProps,l=e.fontSize,h=this.w.config.dataLabels,d=new O(this.ctx),u=new qt(this.ctx),g=null;if(h.enabled){g=d.group({class:"apexcharts-data-labels"});var p=h.offsetX,f=h.offsetY,m=a+p,x=i+parseFloat(h.style.fontSize)/3+f;u.plotDataLabelsText({x:m,y:x,text:t,i:s,j:r,color:o.foreColor,parent:g,fontSize:l,dataLabelsConfig:h})}return g}},{key:"addListeners",value:function(e){var t=new O(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))}}]),n}(),rl=function(){function n(e,t){q(this,n),this.ctx=e,this.w=e.w,this.xRatio=t.xRatio,this.yRatio=t.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new gr(e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}return Z(n,[{key:"draw",value:function(e){var t=this.w,a=new O(this.ctx),i=a.group({class:"apexcharts-heatmap"});i.attr("clip-path","url(#gridRectMask".concat(t.globals.cuid,")"));var s=t.globals.gridWidth/t.globals.dataPoints,r=t.globals.gridHeight/t.globals.series.length,o=0,l=!1;this.negRange=this.helpers.checkColorRange();var h=e.slice();t.config.yaxis[0].reversed&&(l=!0,h.reverse());for(var d=l?0:h.length-1;l?d<h.length:d>=0;l?d++:d--){var u=a.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:R.escapeString(t.globals.seriesNames[d]),rel:d+1,"data:realIndex":d});if(this.ctx.series.addCollapsedClassToSeries(u,d),t.config.chart.dropShadow.enabled){var g=t.config.chart.dropShadow;new Ie(this.ctx).dropShadow(u,g,d)}for(var p=0,f=t.config.plotOptions.heatmap.shadeIntensity,m=0,x=0;x<t.globals.dataPoints;x++)if(t.globals.seriesX.length&&!t.globals.allSeriesHasEqualX&&t.globals.minX+t.globals.minXDiff*x<t.globals.seriesX[d][m])p+=s;else{if(m>=h[d].length)break;var b=this.helpers.getShadeColor(t.config.chart.type,d,m,this.negRange),v=b.color,w=b.colorProps;t.config.fill.type==="image"&&(v=new lt(this.ctx).fillPath({seriesNumber:d,dataPointIndex:m,opacity:t.globals.hasNegs?w.percent<0?1-(1+w.percent/100):f+w.percent/100:w.percent/100,patternID:R.randomId(),width:t.config.fill.image.width?t.config.fill.image.width:s,height:t.config.fill.image.height?t.config.fill.image.height:r}));var k=this.rectRadius,y=a.drawRect(p,o,s,r,k);if(y.attr({cx:p,cy:o}),y.node.classList.add("apexcharts-heatmap-rect"),u.add(y),y.attr({fill:v,i:d,index:d,j:m,val:e[d][m],"stroke-width":this.strokeWidth,stroke:t.config.plotOptions.heatmap.useFillColorAsStroke?v:t.globals.stroke.colors[0],color:v}),this.helpers.addListeners(y),t.config.chart.animations.enabled&&!t.globals.dataChanged){var E=1;t.globals.resized||(E=t.config.chart.animations.speed),this.animateHeatMap(y,p,o,s,r,E)}if(t.globals.dataChanged){var S=1;if(this.dynamicAnim.enabled&&t.globals.shouldAnimate){S=this.dynamicAnim.speed;var C=t.globals.previousPaths[d]&&t.globals.previousPaths[d][m]&&t.globals.previousPaths[d][m].color;C||(C="rgba(255, 255, 255, 0)"),this.animateHeatColor(y,R.isColorHex(C)?C:R.rgb2hex(C),R.isColorHex(v)?v:R.rgb2hex(v),S)}}var N=(0,t.config.dataLabels.formatter)(t.globals.series[d][m],{value:t.globals.series[d][m],seriesIndex:d,dataPointIndex:m,w:t}),L=this.helpers.calculateDataLabels({text:N,x:p+s/2,y:o+r/2,i:d,j:m,colorProps:w,series:h});L!==null&&u.add(L),p+=s,m++}o+=r,i.add(u)}var A=t.globals.yAxisScale[0].result.slice();return t.config.yaxis[0].reversed?A.unshift(""):A.push(""),t.globals.yAxisScale[0].result=A,i}},{key:"animateHeatMap",value:function(e,t,a,i,s,r){var o=new Ot(this.ctx);o.animateRect(e,{x:t+i/2,y:a+s/2,width:0,height:0},{x:t,y:a,width:i,height:s},r,function(){o.animationCompleted(e)})}},{key:"animateHeatColor",value:function(e,t,a,i){e.attr({fill:t}).animate(i).attr({fill:a})}}]),n}(),pr=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"drawYAxisTexts",value:function(e,t,a,i){var s=this.w,r=s.config.yaxis[0],o=s.globals.yLabelFormatters[0];return new O(this.ctx).drawText({x:e+r.labels.offsetX,y:t+r.labels.offsetY,text:o(i,a),textAnchor:"middle",fontSize:r.labels.style.fontSize,fontFamily:r.labels.style.fontFamily,foreColor:Array.isArray(r.labels.style.colors)?r.labels.style.colors[a]:r.labels.style.colors})}}]),n}(),fr=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w;var t=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=t.globals.stroke.colors!==void 0?t.globals.stroke.colors:t.globals.colors,this.defaultSize=Math.min(t.globals.gridWidth,t.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=t.globals.gridWidth/2,t.config.chart.type==="radialBar"?this.fullAngle=360:this.fullAngle=Math.abs(t.config.plotOptions.pie.endAngle-t.config.plotOptions.pie.startAngle),this.initialAngle=t.config.plotOptions.pie.startAngle%this.fullAngle,t.globals.radialSize=this.defaultSize/2.05-t.config.stroke.width-(t.config.chart.sparkline.enabled?0:t.config.chart.dropShadow.blur),this.donutSize=t.globals.radialSize*parseInt(t.config.plotOptions.pie.donut.size,10)/100;var a=t.config.plotOptions.pie.customScale,i=t.globals.gridWidth/2,s=t.globals.gridHeight/2;this.translateX=i-i*a,this.translateY=s-s*a,this.dataLabelsGroup=new O(this.ctx).group({class:"apexcharts-datalabels-group",transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(a,")")}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}return Z(n,[{key:"draw",value:function(e){var t=this,a=this.w,i=new O(this.ctx),s=i.group({class:"apexcharts-pie"});if(a.globals.noData)return s;for(var r=0,o=0;o<e.length;o++)r+=R.negToZero(e[o]);var l=[],h=i.group();r===0&&(r=1e-5),e.forEach(function(w){t.maxY=Math.max(t.maxY,w)}),a.config.yaxis[0].max&&(this.maxY=a.config.yaxis[0].max),a.config.grid.position==="back"&&this.chartType==="polarArea"&&this.drawPolarElements(s);for(var d=0;d<e.length;d++){var u=this.fullAngle*R.negToZero(e[d])/r;l.push(u),this.chartType==="polarArea"?(l[d]=this.fullAngle/e.length,this.sliceSizes.push(a.globals.radialSize*e[d]/this.maxY)):this.sliceSizes.push(a.globals.radialSize)}if(a.globals.dataChanged){for(var g,p=0,f=0;f<a.globals.previousPaths.length;f++)p+=R.negToZero(a.globals.previousPaths[f]);for(var m=0;m<a.globals.previousPaths.length;m++)g=this.fullAngle*R.negToZero(a.globals.previousPaths[m])/p,this.prevSectorAngleArr.push(g)}if(this.donutSize<0&&(this.donutSize=0),this.chartType==="donut"){var x=i.drawCircle(this.donutSize);x.attr({cx:this.centerX,cy:this.centerY,fill:a.config.plotOptions.pie.donut.background?a.config.plotOptions.pie.donut.background:"transparent"}),h.add(x)}var b=this.drawArcs(l,e);if(this.sliceLabels.forEach(function(w){b.add(w)}),h.attr({transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(a.config.plotOptions.pie.customScale,")")}),h.add(b),s.add(h),this.donutDataLabels.show){var v=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});s.add(v)}return a.config.grid.position==="front"&&this.chartType==="polarArea"&&this.drawPolarElements(s),s}},{key:"drawArcs",value:function(e,t){var a=this.w,i=new Ie(this.ctx),s=new O(this.ctx),r=new lt(this.ctx),o=s.group({class:"apexcharts-slices"}),l=this.initialAngle,h=this.initialAngle,d=this.initialAngle,u=this.initialAngle;this.strokeWidth=a.config.stroke.show?a.config.stroke.width:0;for(var g=0;g<e.length;g++){var p=s.group({class:"apexcharts-series apexcharts-pie-series",seriesName:R.escapeString(a.globals.seriesNames[g]),rel:g+1,"data:realIndex":g});o.add(p),h=u,d=(l=d)+e[g],u=h+this.prevSectorAngleArr[g];var f=d<l?this.fullAngle+d-l:d-l,m=r.fillPath({seriesNumber:g,size:this.sliceSizes[g],value:t[g]}),x=this.getChangedPath(h,u),b=s.drawPath({d:x,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[g]:this.lineColorArr,strokeWidth:0,fill:m,fillOpacity:a.config.fill.opacity,classes:"apexcharts-pie-area apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(g)});if(b.attr({index:0,j:g}),i.setSelectionFilter(b,0,g),a.config.chart.dropShadow.enabled){var v=a.config.chart.dropShadow;i.dropShadow(b,v,g)}this.addListeners(b,this.donutDataLabels),O.setAttrs(b.node,{"data:angle":f,"data:startAngle":l,"data:strokeWidth":this.strokeWidth,"data:value":t[g]});var w={x:0,y:0};this.chartType==="pie"||this.chartType==="polarArea"?w=R.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize/1.25+a.config.plotOptions.pie.dataLabels.offset,(l+f/2)%this.fullAngle):this.chartType==="donut"&&(w=R.polarToCartesian(this.centerX,this.centerY,(a.globals.radialSize+this.donutSize)/2+a.config.plotOptions.pie.dataLabels.offset,(l+f/2)%this.fullAngle)),p.add(b);var k=0;if(!this.initialAnim||a.globals.resized||a.globals.dataChanged?this.animBeginArr.push(0):((k=f/this.fullAngle*a.config.chart.animations.speed)===0&&(k=1),this.animDur=k+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&a.globals.dataChanged?this.animatePaths(b,{size:this.sliceSizes[g],endAngle:d,startAngle:l,prevStartAngle:h,prevEndAngle:u,animateStartingPos:!0,i:g,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:a.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(b,{size:this.sliceSizes[g],endAngle:d,startAngle:l,i:g,totalItems:e.length-1,animBeginArr:this.animBeginArr,dur:k}),a.config.plotOptions.pie.expandOnClick&&this.chartType!=="polarArea"&&b.node.addEventListener("mouseup",this.pieClicked.bind(this,g)),a.globals.selectedDataPoints[0]!==void 0&&a.globals.selectedDataPoints[0].indexOf(g)>-1&&this.pieClicked(g),a.config.dataLabels.enabled){var y=w.x,E=w.y,S=100*f/this.fullAngle+"%";if(f!==0&&a.config.plotOptions.pie.dataLabels.minAngleToShowLabel<e[g]){var C=a.config.dataLabels.formatter;C!==void 0&&(S=C(a.globals.seriesPercent[g][0],{seriesIndex:g,w:a}));var N=a.globals.dataLabels.style.colors[g],L=s.group({class:"apexcharts-datalabels"}),A=s.drawText({x:y,y:E,text:S,textAnchor:"middle",fontSize:a.config.dataLabels.style.fontSize,fontFamily:a.config.dataLabels.style.fontFamily,fontWeight:a.config.dataLabels.style.fontWeight,foreColor:N});if(L.add(A),a.config.dataLabels.dropShadow.enabled){var M=a.config.dataLabels.dropShadow;i.dropShadow(A,M)}A.node.classList.add("apexcharts-pie-label"),a.config.chart.animations.animate&&a.globals.resized===!1&&(A.node.classList.add("apexcharts-pie-label-delay"),A.node.style.animationDelay=a.config.chart.animations.speed/940+"s"),this.sliceLabels.push(L)}}}return o}},{key:"addListeners",value:function(e,t){var a=new O(this.ctx);e.node.addEventListener("mouseenter",a.pathMouseEnter.bind(this,e)),e.node.addEventListener("mouseleave",a.pathMouseLeave.bind(this,e)),e.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this,e.node,t)),e.node.addEventListener("mousedown",a.pathMouseDown.bind(this,e)),this.donutDataLabels.total.showAlways||(e.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,e.node,t)),e.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,e.node,t)))}},{key:"animatePaths",value:function(e,t){var a=this.w,i=t.endAngle<t.startAngle?this.fullAngle+t.endAngle-t.startAngle:t.endAngle-t.startAngle,s=i,r=t.startAngle,o=t.startAngle;t.prevStartAngle!==void 0&&t.prevEndAngle!==void 0&&(r=t.prevEndAngle,s=t.prevEndAngle<t.prevStartAngle?this.fullAngle+t.prevEndAngle-t.prevStartAngle:t.prevEndAngle-t.prevStartAngle),t.i===a.config.series.length-1&&(i+o>this.fullAngle?t.endAngle=t.endAngle-(i+o):i+o<this.fullAngle&&(t.endAngle=t.endAngle+(this.fullAngle-(i+o)))),i===this.fullAngle&&(i=this.fullAngle-.01),this.animateArc(e,r,o,i,s,t)}},{key:"animateArc",value:function(e,t,a,i,s,r){var o,l=this,h=this.w,d=new Ot(this.ctx),u=r.size;(isNaN(t)||isNaN(s))&&(t=a,s=i,r.dur=0);var g=i,p=a,f=t<a?this.fullAngle+t-a:t-a;h.globals.dataChanged&&r.shouldSetPrevPaths&&r.prevEndAngle&&(o=l.getPiePath({me:l,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:u}),e.attr({d:o})),r.dur!==0?e.animate(r.dur,r.animBeginArr[r.i]).after(function(){l.chartType!=="pie"&&l.chartType!=="donut"&&l.chartType!=="polarArea"||this.animate(h.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":l.strokeWidth}),r.i===h.config.series.length-1&&d.animationCompleted(e)}).during(function(m){g=f+(i-f)*m,r.animateStartingPos&&(g=s+(i-s)*m,p=t-s+(a-(t-s))*m),o=l.getPiePath({me:l,startAngle:p,angle:g,size:u}),e.node.setAttribute("data:pathOrig",o),e.attr({d:o})}):(o=l.getPiePath({me:l,startAngle:p,angle:i,size:u}),r.isTrack||(h.globals.animationEnded=!0),e.node.setAttribute("data:pathOrig",o),e.attr({d:o,"stroke-width":l.strokeWidth}))}},{key:"pieClicked",value:function(e){var t,a=this.w,i=this,s=i.sliceSizes[e]+(a.config.plotOptions.pie.expandOnClick?4:0),r=a.globals.dom.Paper.findOne(".apexcharts-".concat(i.chartType.toLowerCase(),"-slice-").concat(e));if(r.attr("data:pieClicked")!=="true"){var o=a.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(o,function(u){u.setAttribute("data:pieClicked","false");var g=u.getAttribute("data:pathOrig");g&&u.setAttribute("d",g)}),a.globals.capturedDataPointIndex=e,r.attr("data:pieClicked","true");var l=parseInt(r.attr("data:startAngle"),10),h=parseInt(r.attr("data:angle"),10);t=i.getPiePath({me:i,startAngle:l,angle:h,size:s}),h!==360&&r.plot(t)}else{r.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(r.node,this.donutDataLabels);var d=r.attr("data:pathOrig");r.attr({d})}}},{key:"getChangedPath",value:function(e,t){var a="";return this.dynamicAnim&&this.w.globals.dataChanged&&(a=this.getPiePath({me:this,startAngle:e,angle:t-e,size:this.size})),a}},{key:"getPiePath",value:function(e){var t,a=e.me,i=e.startAngle,s=e.angle,r=e.size,o=new O(this.ctx),l=i,h=Math.PI*(l-90)/180,d=s+i;Math.ceil(d)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(d=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(d)>this.fullAngle&&(d-=this.fullAngle);var u=Math.PI*(d-90)/180,g=a.centerX+r*Math.cos(h),p=a.centerY+r*Math.sin(h),f=a.centerX+r*Math.cos(u),m=a.centerY+r*Math.sin(u),x=R.polarToCartesian(a.centerX,a.centerY,a.donutSize,d),b=R.polarToCartesian(a.centerX,a.centerY,a.donutSize,l),v=s>180?1:0,w=["M",g,p,"A",r,r,0,v,1,f,m];return t=a.chartType==="donut"?[].concat(w,["L",x.x,x.y,"A",a.donutSize,a.donutSize,0,v,0,b.x,b.y,"L",g,p,"z"]).join(" "):a.chartType==="pie"||a.chartType==="polarArea"?[].concat(w,["L",a.centerX,a.centerY,"L",g,p]).join(" "):[].concat(w).join(" "),o.roundPathCorners(t,2*this.strokeWidth)}},{key:"drawPolarElements",value:function(e){var t=this.w,a=new nr(this.ctx),i=new O(this.ctx),s=new pr(this.ctx),r=i.group(),o=i.group(),l=a.niceScale(0,Math.ceil(this.maxY),0),h=l.result.reverse(),d=l.result.length;this.maxY=l.niceMax;for(var u=t.globals.radialSize,g=u/(d-1),p=0;p<d-1;p++){var f=i.drawCircle(u);if(f.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":t.config.plotOptions.polarArea.rings.strokeWidth,stroke:t.config.plotOptions.polarArea.rings.strokeColor}),t.config.yaxis[0].show){var m=s.drawYAxisTexts(this.centerX,this.centerY-u+parseInt(t.config.yaxis[0].labels.style.fontSize,10)/2,p,h[p]);o.add(m)}r.add(f),u-=g}this.drawSpokes(e),e.add(r),e.add(o)}},{key:"renderInnerDataLabels",value:function(e,t,a){var i=this.w,s=new O(this.ctx),r=t.total.show;e.node.innerHTML="",e.node.style.opacity=a.opacity;var o,l,h=a.centerX,d=this.donutDataLabels.total.label?a.centerY:a.centerY-a.centerY/6;o=t.name.color===void 0?i.globals.colors[0]:t.name.color;var u=t.name.fontSize,g=t.name.fontFamily,p=t.name.fontWeight;l=t.value.color===void 0?i.config.chart.foreColor:t.value.color;var f=t.value.formatter,m="",x="";if(r?(o=t.total.color,u=t.total.fontSize,g=t.total.fontFamily,p=t.total.fontWeight,x=this.donutDataLabels.total.label?t.total.label:"",m=t.total.formatter(i)):i.globals.series.length===1&&(m=f(i.globals.series[0],i),x=i.globals.seriesNames[0]),x&&(x=t.name.formatter(x,t.total.show,i)),t.name.show){var b=s.drawText({x:h,y:d+parseFloat(t.name.offsetY),text:x,textAnchor:"middle",foreColor:o,fontSize:u,fontWeight:p,fontFamily:g});b.node.classList.add("apexcharts-datalabel-label"),e.add(b)}if(t.value.show){var v=t.name.show?parseFloat(t.value.offsetY)+16:t.value.offsetY,w=s.drawText({x:h,y:d+v,text:m,textAnchor:"middle",foreColor:l,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily});w.node.classList.add("apexcharts-datalabel-value"),e.add(w)}return e}},{key:"printInnerLabels",value:function(e,t,a,i){var s,r=this.w;i?s=e.name.color===void 0?r.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:e.name.color:r.globals.series.length>1&&e.total.show&&(s=e.total.color);var o=r.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),l=r.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");a=(0,e.value.formatter)(a,r),i||typeof e.total.formatter!="function"||(a=e.total.formatter(r));var h=t===e.total.label;t=this.donutDataLabels.total.label?e.name.formatter(t,h,r):"",o!==null&&(o.textContent=t),l!==null&&(l.textContent=a),o!==null&&(o.style.fill=s)}},{key:"printDataLabelsInner",value:function(e,t){var a=this.w,i=e.getAttribute("data:value"),s=a.globals.seriesNames[parseInt(e.parentNode.getAttribute("rel"),10)-1];a.globals.series.length>1&&this.printInnerLabels(t,s,i,e);var r=a.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");r!==null&&(r.style.opacity=1)}},{key:"drawSpokes",value:function(e){var t=this,a=this.w,i=new O(this.ctx),s=a.config.plotOptions.polarArea.spokes;if(s.strokeWidth!==0){for(var r=[],o=360/a.globals.series.length,l=0;l<a.globals.series.length;l++)r.push(R.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize,a.config.plotOptions.pie.startAngle+o*l));r.forEach(function(h,d){var u=i.drawLine(h.x,h.y,t.centerX,t.centerY,Array.isArray(s.connectorColors)?s.connectorColors[d]:s.connectorColors);e.add(u)})}}},{key:"revertDataLabelsInner",value:function(){var e=this.w;if(this.donutDataLabels.show){var t=e.globals.dom.Paper.findOne(".apexcharts-datalabels-group"),a=this.renderInnerDataLabels(t,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});e.globals.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(a)}}}]),n}(),nl=function(){function n(e){q(this,n),this.ctx=e,this.w=e.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.animDur=0;var t=this.w;this.graphics=new O(this.ctx),this.lineColorArr=t.globals.stroke.colors!==void 0?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight<t.globals.svgWidth?t.globals.gridHeight:t.globals.gridWidth,this.isLog=t.config.yaxis[0].logarithmic,this.logBase=t.config.yaxis[0].logBase,this.coreUtils=new Le(this.ctx),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,t.globals.maxY,0):t.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):t.globals.minY,this.polygons=t.config.plotOptions.radar.polygons,this.strokeWidth=t.config.stroke.show?t.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-t.config.chart.dropShadow.blur,t.config.xaxis.labels.show&&(this.size=this.size-t.globals.xAxisLabelsWidth/1.75),t.config.plotOptions.radar.size!==void 0&&(this.size=t.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}return Z(n,[{key:"draw",value:function(e){var t=this,a=this.w,i=new lt(this.ctx),s=[],r=new qt(this.ctx);e.length&&(this.dataPointsLen=e[a.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;var o=a.globals.gridWidth/2,l=a.globals.gridHeight/2,h=o+a.config.plotOptions.radar.offsetX,d=l+a.config.plotOptions.radar.offsetY,u=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:"translate(".concat(h||0,", ").concat(d||0,")")}),g=[],p=null,f=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),e.forEach(function(x,b){var v=x.length===a.globals.dataPoints,w=t.graphics.group().attr({class:"apexcharts-series","data:longestSeries":v,seriesName:R.escapeString(a.globals.seriesNames[b]),rel:b+1,"data:realIndex":b});t.dataRadiusOfPercent[b]=[],t.dataRadius[b]=[],t.angleArr[b]=[],x.forEach(function(F,z){var B=Math.abs(t.maxValue-t.minValue);F-=t.minValue,t.isLog&&(F=t.coreUtils.getLogVal(t.logBase,F,0)),t.dataRadiusOfPercent[b][z]=F/B,t.dataRadius[b][z]=t.dataRadiusOfPercent[b][z]*t.size,t.angleArr[b][z]=z*t.disAngle}),g=t.getDataPointsPos(t.dataRadius[b],t.angleArr[b]);var k=t.createPaths(g,{x:0,y:0});p=t.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),f=t.graphics.group({class:"apexcharts-datalabels","data:realIndex":b}),a.globals.delayedElements.push({el:p.node,index:b});var y={i:b,realIndex:b,animationDelay:b,initialSpeed:a.config.chart.animations.speed,dataChangeSpeed:a.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:a.globals.stroke.colors[b],strokeLineCap:a.config.stroke.lineCap},E=null;a.globals.previousPaths.length>0&&(E=t.getPreviousPath(b));for(var S=0;S<k.linePathsTo.length;S++){var C=t.graphics.renderPaths(G(G({},y),{},{pathFrom:E===null?k.linePathsFrom[S]:E,pathTo:k.linePathsTo[S],strokeWidth:Array.isArray(t.strokeWidth)?t.strokeWidth[b]:t.strokeWidth,fill:"none",drawShadow:!1}));w.add(C);var N=i.fillPath({seriesNumber:b}),L=t.graphics.renderPaths(G(G({},y),{},{pathFrom:E===null?k.areaPathsFrom[S]:E,pathTo:k.areaPathsTo[S],strokeWidth:0,fill:N,drawShadow:!1}));if(a.config.chart.dropShadow.enabled){var A=new Ie(t.ctx),M=a.config.chart.dropShadow;A.dropShadow(L,Object.assign({},M,{noUserSpaceOnUse:!0}),b)}w.add(L)}x.forEach(function(F,z){var B=new Ut(t.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:b,dataPointIndex:z}),T=t.graphics.drawMarker(g[z].x,g[z].y,B);T.attr("rel",z),T.attr("j",z),T.attr("index",b),T.node.setAttribute("default-marker-size",B.pSize);var D=t.graphics.group({class:"apexcharts-series-markers"});D&&D.add(T),p.add(D),w.add(p);var I=a.config.dataLabels;if(I.enabled){var Y=I.formatter(a.globals.series[b][z],{seriesIndex:b,dataPointIndex:z,w:a});r.plotDataLabelsText({x:g[z].x,y:g[z].y,text:Y,textAnchor:"middle",i:b,j:b,parent:f,offsetCorrection:!1,dataLabelsConfig:G({},I)})}w.add(f)}),s.push(w)}),this.drawPolygons({parent:u}),a.config.xaxis.labels.show){var m=this.drawXAxisTexts();u.add(m)}return s.forEach(function(x){u.add(x)}),u.add(this.yaxisLabels),u}},{key:"drawPolygons",value:function(e){for(var t=this,a=this.w,i=e.parent,s=new pr(this.ctx),r=a.globals.yAxisScale[0].result.reverse(),o=r.length,l=[],h=this.size/(o-1),d=0;d<o;d++)l[d]=h*d;l.reverse();var u=[],g=[];l.forEach(function(p,f){var m=R.getPolygonPos(p,t.dataPointsLen),x="";m.forEach(function(b,v){if(f===0){var w=t.graphics.drawLine(b.x,b.y,0,0,Array.isArray(t.polygons.connectorColors)?t.polygons.connectorColors[v]:t.polygons.connectorColors);g.push(w)}v===0&&t.yaxisLabelsTextsPos.push({x:b.x,y:b.y}),x+=b.x+","+b.y+" "}),u.push(x)}),u.forEach(function(p,f){var m=t.polygons.strokeColors,x=t.polygons.strokeWidth,b=t.graphics.drawPolygon(p,Array.isArray(m)?m[f]:m,Array.isArray(x)?x[f]:x,a.globals.radarPolygons.fill.colors[f]);i.add(b)}),g.forEach(function(p){i.add(p)}),a.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach(function(p,f){var m=s.drawYAxisTexts(p.x,p.y,f,r[f]);t.yaxisLabels.add(m)})}},{key:"drawXAxisTexts",value:function(){var e=this,t=this.w,a=t.config.xaxis.labels,i=this.graphics.group({class:"apexcharts-xaxis"}),s=R.getPolygonPos(this.size,this.dataPointsLen);return t.globals.labels.forEach(function(r,o){var l=t.config.xaxis.labels.formatter,h=new qt(e.ctx);if(s[o]){var d=e.getTextPos(s[o],e.size),u=l(r,{seriesIndex:-1,dataPointIndex:o,w:t});h.plotDataLabelsText({x:d.newX,y:d.newY,text:u,textAnchor:d.textAnchor,i:o,j:o,parent:i,className:"apexcharts-xaxis-label",color:Array.isArray(a.style.colors)&&a.style.colors[o]?a.style.colors[o]:"#a8a8a8",dataLabelsConfig:G({textAnchor:d.textAnchor,dropShadow:{enabled:!1}},a),offsetCorrection:!1}).on("click",function(g){if(typeof t.config.chart.events.xAxisLabelClick=="function"){var p=Object.assign({},t,{labelIndex:o});t.config.chart.events.xAxisLabelClick(g,e.ctx,p)}})}}),i}},{key:"createPaths",value:function(e,t){var a=this,i=[],s=[],r=[],o=[];if(e.length){s=[this.graphics.move(t.x,t.y)],o=[this.graphics.move(t.x,t.y)];var l=this.graphics.move(e[0].x,e[0].y),h=this.graphics.move(e[0].x,e[0].y);e.forEach(function(d,u){l+=a.graphics.line(d.x,d.y),h+=a.graphics.line(d.x,d.y),u===e.length-1&&(l+="Z",h+="Z")}),i.push(l),r.push(h)}return{linePathsFrom:s,linePathsTo:i,areaPathsFrom:o,areaPathsTo:r}}},{key:"getTextPos",value:function(e,t){var a="middle",i=e.x,s=e.y;return Math.abs(e.x)>=10?e.x>0?(a="start",i+=10):e.x<0&&(a="end",i-=10):a="middle",Math.abs(e.y)>=t-10&&(e.y<0?s-=10:e.y>0&&(s+=10)),{textAnchor:a,newX:i,newY:s}}},{key:"getPreviousPath",value:function(e){for(var t=this.w,a=null,i=0;i<t.globals.previousPaths.length;i++){var s=t.globals.previousPaths[i];s.paths.length>0&&parseInt(s.realIndex,10)===parseInt(e,10)&&t.globals.previousPaths[i].paths[0]!==void 0&&(a=t.globals.previousPaths[i].paths[0].d)}return a}},{key:"getDataPointsPos",value:function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.dataPointsLen;e=e||[],t=t||[];for(var i=[],s=0;s<a;s++){var r={};r.x=e[s]*Math.sin(t[s]),r.y=-e[s]*Math.cos(t[s]),i.push(r)}return i}}]),n}(),ol=function(n){sa(t,fr);var e=ia(t);function t(a){var i;q(this,t),(i=e.call(this,a)).ctx=a,i.w=a.w,i.animBeginArr=[0],i.animDur=0;var s=i.w;return i.startAngle=s.config.plotOptions.radialBar.startAngle,i.endAngle=s.config.plotOptions.radialBar.endAngle,i.totalAngle=Math.abs(s.config.plotOptions.radialBar.endAngle-s.config.plotOptions.radialBar.startAngle),i.trackStartAngle=s.config.plotOptions.radialBar.track.startAngle,i.trackEndAngle=s.config.plotOptions.radialBar.track.endAngle,i.barLabels=i.w.config.plotOptions.radialBar.barLabels,i.donutDataLabels=i.w.config.plotOptions.radialBar.dataLabels,i.radialDataLabels=i.donutDataLabels,i.trackStartAngle||(i.trackStartAngle=i.startAngle),i.trackEndAngle||(i.trackEndAngle=i.endAngle),i.endAngle===360&&(i.endAngle=359.99),i.margin=parseInt(s.config.plotOptions.radialBar.track.margin,10),i.onBarLabelClick=i.onBarLabelClick.bind(gs(i)),i}return Z(t,[{key:"draw",value:function(a){var i=this.w,s=new O(this.ctx),r=s.group({class:"apexcharts-radialbar"});if(i.globals.noData)return r;var o=s.group(),l=this.defaultSize/2,h=i.globals.gridWidth/2,d=this.defaultSize/2.05;i.config.chart.sparkline.enabled||(d=d-i.config.stroke.width-i.config.chart.dropShadow.blur);var u=i.globals.fill.colors;if(i.config.plotOptions.radialBar.track.show){var g=this.drawTracks({size:d,centerX:h,centerY:l,colorArr:u,series:a});o.add(g)}var p=this.drawArcs({size:d,centerX:h,centerY:l,colorArr:u,series:a}),f=360;i.config.plotOptions.radialBar.startAngle<0&&(f=this.totalAngle);var m=(360-f)/360;if(i.globals.radialSize=d-d*m,this.radialDataLabels.value.show){var x=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);i.globals.radialSize+=x*m}return o.add(p.g),i.config.plotOptions.radialBar.hollow.position==="front"&&(p.g.add(p.elHollow),p.dataLabels&&p.g.add(p.dataLabels)),r.add(o),r}},{key:"drawTracks",value:function(a){var i=this.w,s=new O(this.ctx),r=s.group({class:"apexcharts-tracks"}),o=new Ie(this.ctx),l=new lt(this.ctx),h=this.getStrokeWidth(a);a.size=a.size-h/2;for(var d=0;d<a.series.length;d++){var u=s.group({class:"apexcharts-radialbar-track apexcharts-track"});r.add(u),u.attr({rel:d+1}),a.size=a.size-h-this.margin;var g=i.config.plotOptions.radialBar.track,p=l.fillPath({seriesNumber:0,size:a.size,fillColors:Array.isArray(g.background)?g.background[d]:g.background,solid:!0}),f=this.trackStartAngle,m=this.trackEndAngle;Math.abs(m)+Math.abs(f)>=360&&(m=360-Math.abs(this.startAngle)-.1);var x=s.drawPath({d:"",stroke:p,strokeWidth:h*parseInt(g.strokeWidth,10)/100,fill:"none",strokeOpacity:g.opacity,classes:"apexcharts-radialbar-area"});if(g.dropShadow.enabled){var b=g.dropShadow;o.dropShadow(x,b)}u.add(x),x.attr("id","apexcharts-radialbarTrack-"+d),this.animatePaths(x,{centerX:a.centerX,centerY:a.centerY,endAngle:m,startAngle:f,size:a.size,i:d,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return r}},{key:"drawArcs",value:function(a){var i=this.w,s=new O(this.ctx),r=new lt(this.ctx),o=new Ie(this.ctx),l=s.group(),h=this.getStrokeWidth(a);a.size=a.size-h/2;var d=i.config.plotOptions.radialBar.hollow.background,u=a.size-h*a.series.length-this.margin*a.series.length-h*parseInt(i.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,g=u-i.config.plotOptions.radialBar.hollow.margin;i.config.plotOptions.radialBar.hollow.image!==void 0&&(d=this.drawHollowImage(a,l,u,d));var p=this.drawHollow({size:g,centerX:a.centerX,centerY:a.centerY,fill:d||"transparent"});if(i.config.plotOptions.radialBar.hollow.dropShadow.enabled){var f=i.config.plotOptions.radialBar.hollow.dropShadow;o.dropShadow(p,f)}var m=1;!this.radialDataLabels.total.show&&i.globals.series.length>1&&(m=0);var x=null;if(this.radialDataLabels.show){var b=i.globals.dom.Paper.findOne(".apexcharts-datalabels-group");x=this.renderInnerDataLabels(b,this.radialDataLabels,{hollowSize:u,centerX:a.centerX,centerY:a.centerY,opacity:m})}i.config.plotOptions.radialBar.hollow.position==="back"&&(l.add(p),x&&l.add(x));var v=!1;i.config.plotOptions.radialBar.inverseOrder&&(v=!0);for(var w=v?a.series.length-1:0;v?w>=0:w<a.series.length;v?w--:w++){var k=s.group({class:"apexcharts-series apexcharts-radial-series",seriesName:R.escapeString(i.globals.seriesNames[w])});l.add(k),k.attr({rel:w+1,"data:realIndex":w}),this.ctx.series.addCollapsedClassToSeries(k,w),a.size=a.size-h-this.margin;var y=r.fillPath({seriesNumber:w,size:a.size,value:a.series[w]}),E=this.startAngle,S=void 0,C=R.negToZero(a.series[w]>100?100:a.series[w])/100,N=Math.round(this.totalAngle*C)+this.startAngle,L=void 0;i.globals.dataChanged&&(S=this.startAngle,L=Math.round(this.totalAngle*R.negToZero(i.globals.previousPaths[w])/100)+S),Math.abs(N)+Math.abs(E)>360&&(N-=.01),Math.abs(L)+Math.abs(S)>360&&(L-=.01);var A=N-E,M=Array.isArray(i.config.stroke.dashArray)?i.config.stroke.dashArray[w]:i.config.stroke.dashArray,F=s.drawPath({d:"",stroke:y,strokeWidth:h,fill:"none",fillOpacity:i.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+w,strokeDashArray:M});if(O.setAttrs(F.node,{"data:angle":A,"data:value":a.series[w]}),i.config.chart.dropShadow.enabled){var z=i.config.chart.dropShadow;o.dropShadow(F,z,w)}if(o.setSelectionFilter(F,0,w),this.addListeners(F,this.radialDataLabels),k.add(F),F.attr({index:0,j:w}),this.barLabels.enabled){var B=R.polarToCartesian(a.centerX,a.centerY,a.size,E),T=this.barLabels.formatter(i.globals.seriesNames[w],{seriesIndex:w,w:i}),D=["apexcharts-radialbar-label"];this.barLabels.onClick||D.push("apexcharts-no-click");var I=this.barLabels.useSeriesColors?i.globals.colors[w]:i.config.chart.foreColor;I||(I=i.config.chart.foreColor);var Y=B.x+this.barLabels.offsetX,$=B.y+this.barLabels.offsetY,K=s.drawText({x:Y,y:$,text:T,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:I,cssClass:D.join(" ")});K.on("click",this.onBarLabelClick),K.attr({rel:w+1}),E!==0&&K.attr({"transform-origin":"".concat(Y," ").concat($),transform:"rotate(".concat(E," 0 0)")}),k.add(K)}var ie=0;!this.initialAnim||i.globals.resized||i.globals.dataChanged||(ie=i.config.chart.animations.speed),i.globals.dataChanged&&(ie=i.config.chart.animations.dynamicAnimation.speed),this.animDur=ie/(1.2*a.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(F,{centerX:a.centerX,centerY:a.centerY,endAngle:N,startAngle:E,prevEndAngle:L,prevStartAngle:S,size:a.size,i:w,totalItems:2,animBeginArr:this.animBeginArr,dur:ie,shouldSetPrevPaths:!0})}return{g:l,elHollow:p,dataLabels:x}}},{key:"drawHollow",value:function(a){var i=new O(this.ctx).drawCircle(2*a.size);return i.attr({class:"apexcharts-radialbar-hollow",cx:a.centerX,cy:a.centerY,r:a.size,fill:a.fill}),i}},{key:"drawHollowImage",value:function(a,i,s,r){var o=this.w,l=new lt(this.ctx),h=R.randomId(),d=o.config.plotOptions.radialBar.hollow.image;if(o.config.plotOptions.radialBar.hollow.imageClipped)l.clippedImgArea({width:s,height:s,image:d,patternID:"pattern".concat(o.globals.cuid).concat(h)}),r="url(#pattern".concat(o.globals.cuid).concat(h,")");else{var u=o.config.plotOptions.radialBar.hollow.imageWidth,g=o.config.plotOptions.radialBar.hollow.imageHeight;if(u===void 0&&g===void 0){var p=o.globals.dom.Paper.image(d,function(m){this.move(a.centerX-m.width/2+o.config.plotOptions.radialBar.hollow.imageOffsetX,a.centerY-m.height/2+o.config.plotOptions.radialBar.hollow.imageOffsetY)});i.add(p)}else{var f=o.globals.dom.Paper.image(d,function(m){this.move(a.centerX-u/2+o.config.plotOptions.radialBar.hollow.imageOffsetX,a.centerY-g/2+o.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(u,g)});i.add(f)}}return r}},{key:"getStrokeWidth",value:function(a){var i=this.w;return a.size*(100-parseInt(i.config.plotOptions.radialBar.hollow.size,10))/100/(a.series.length+1)-this.margin}},{key:"onBarLabelClick",value:function(a){var i=parseInt(a.target.getAttribute("rel"),10)-1,s=this.barLabels.onClick,r=this.w;s&&s(r.globals.seriesNames[i],{w:r,seriesIndex:i})}}]),t}(),ll=function(n){sa(t,Zt);var e=ia(t);function t(){return q(this,t),e.apply(this,arguments)}return Z(t,[{key:"draw",value:function(a,i){var s=this.w,r=new O(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=a,this.seriesRangeStart=s.globals.seriesRangeStart,this.seriesRangeEnd=s.globals.seriesRangeEnd,this.barHelpers.initVariables(a);for(var o=r.group({class:"apexcharts-rangebar-series apexcharts-plot-series"}),l=0;l<a.length;l++){var h,d,u,g,p=void 0,f=void 0,m=s.globals.comboCharts?i[l]:l,x=this.barHelpers.getGroupIndex(m).columnGroupIndex,b=r.group({class:"apexcharts-series",seriesName:R.escapeString(s.globals.seriesNames[m]),rel:l+1,"data:realIndex":m});this.ctx.series.addCollapsedClassToSeries(b,m),a[l].length>0&&(this.visibleI=this.visibleI+1);var v=0,w=0,k=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[m][0],k=m);var y=this.barHelpers.initialPositions(m);f=y.y,g=y.zeroW,p=y.x,w=y.barWidth,v=y.barHeight,h=y.xDivision,d=y.yDivision,u=y.zeroH;for(var E=r.group({class:"apexcharts-datalabels","data:realIndex":m}),S=r.group({class:"apexcharts-rangebar-goals-markers"}),C=0;C<s.globals.dataPoints;C++){var N=this.barHelpers.getStrokeWidth(l,C,m),L=this.seriesRangeStart[l][C],A=this.seriesRangeEnd[l][C],M=null,F=null,z=null,B={x:p,y:f,strokeWidth:N,elSeries:b},T=this.seriesLen;if(s.config.plotOptions.bar.rangeBarGroupRows&&(T=1),s.config.series[l].data[C]===void 0)break;if(this.isHorizontal){z=f+v*this.visibleI;var D=(d-v*T)/2;if(s.config.series[l].data[C].x){var I=this.detectOverlappingBars({i:l,j:C,barYPosition:z,srty:D,barHeight:v,yDivision:d,initPositions:y});v=I.barHeight,z=I.barYPosition}w=(M=this.drawRangeBarPaths(G({indexes:{i:l,j:C,realIndex:m},barHeight:v,barYPosition:z,zeroW:g,yDivision:d,y1:L,y2:A},B))).barWidth}else{s.globals.isXNumeric&&(p=(s.globals.seriesX[l][C]-s.globals.minX)/this.xRatio-w/2),F=p+w*this.visibleI;var Y=(h-w*T)/2;if(s.config.series[l].data[C].x){var $=this.detectOverlappingBars({i:l,j:C,barXPosition:F,srtx:Y,barWidth:w,xDivision:h,initPositions:y});w=$.barWidth,F=$.barXPosition}v=(M=this.drawRangeColumnPaths(G({indexes:{i:l,j:C,realIndex:m,translationsIndex:k},barWidth:w,barXPosition:F,zeroH:u,xDivision:h},B))).barHeight}var K=this.barHelpers.drawGoalLine({barXPosition:M.barXPosition,barYPosition:z,goalX:M.goalX,goalY:M.goalY,barHeight:v,barWidth:w});K&&S.add(K),f=M.y,p=M.x;var ie=this.barHelpers.getPathFillColor(a,l,C,m);this.renderSeries({realIndex:m,pathFill:ie.color,lineFill:ie.useRangeColor?ie.color:s.globals.stroke.colors[m],j:C,i:l,x:p,y:f,y1:L,y2:A,pathFrom:M.pathFrom,pathTo:M.pathTo,strokeWidth:N,elSeries:b,series:a,barHeight:v,barWidth:w,barXPosition:F,barYPosition:z,columnGroupIndex:x,elDataLabelsWrap:E,elGoalsMarkers:S,visibleSeries:this.visibleI,type:"rangebar"})}o.add(b)}return o}},{key:"detectOverlappingBars",value:function(a){var i=a.i,s=a.j,r=a.barYPosition,o=a.barXPosition,l=a.srty,h=a.srtx,d=a.barHeight,u=a.barWidth,g=a.yDivision,p=a.xDivision,f=a.initPositions,m=this.w,x=[],b=m.config.series[i].data[s].rangeName,v=m.config.series[i].data[s].x,w=Array.isArray(v)?v.join(" "):v,k=m.globals.labels.map(function(E){return Array.isArray(E)?E.join(" "):E}).indexOf(w),y=m.globals.seriesRange[i].findIndex(function(E){return E.x===w&&E.overlaps.length>0});return this.isHorizontal?(r=m.config.plotOptions.bar.rangeBarGroupRows?l+g*k:l+d*this.visibleI+g*k,y>-1&&!m.config.plotOptions.bar.rangeBarOverlap&&(x=m.globals.seriesRange[i][y].overlaps).indexOf(b)>-1&&(r=(d=f.barHeight/x.length)*this.visibleI+g*(100-parseInt(this.barOptions.barHeight,10))/100/2+d*(this.visibleI+x.indexOf(b))+g*k)):(k>-1&&!m.globals.timescaleLabels.length&&(o=m.config.plotOptions.bar.rangeBarGroupRows?h+p*k:h+u*this.visibleI+p*k),y>-1&&!m.config.plotOptions.bar.rangeBarOverlap&&(x=m.globals.seriesRange[i][y].overlaps).indexOf(b)>-1&&(o=(u=f.barWidth/x.length)*this.visibleI+p*(100-parseInt(this.barOptions.barWidth,10))/100/2+u*(this.visibleI+x.indexOf(b))+p*k)),{barYPosition:r,barXPosition:o,barHeight:d,barWidth:u}}},{key:"drawRangeColumnPaths",value:function(a){var i=a.indexes,s=a.x,r=a.xDivision,o=a.barWidth,l=a.barXPosition,h=a.zeroH,d=this.w,u=i.i,g=i.j,p=i.realIndex,f=i.translationsIndex,m=this.yRatio[f],x=this.getRangeValue(p,g),b=Math.min(x.start,x.end),v=Math.max(x.start,x.end);this.series[u][g]===void 0||this.series[u][g]===null?b=h:(b=h-b/m,v=h-v/m);var w=Math.abs(v-b),k=this.barHelpers.getColumnPaths({barXPosition:l,barWidth:o,y1:b,y2:v,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:p,i:p,j:g,w:d});if(d.globals.isXNumeric){var y=this.getBarXForNumericXAxis({x:s,j:g,realIndex:p,barWidth:o});s=y.x,l=y.barXPosition}else s+=r;return{pathTo:k.pathTo,pathFrom:k.pathFrom,barHeight:w,x:s,y:x.start<0&&x.end<0?b:v,goalY:this.barHelpers.getGoalValues("y",null,h,u,g,f),barXPosition:l}}},{key:"preventBarOverflow",value:function(a){var i=this.w;return a<0&&(a=0),a>i.globals.gridWidth&&(a=i.globals.gridWidth),a}},{key:"drawRangeBarPaths",value:function(a){var i=a.indexes,s=a.y,r=a.y1,o=a.y2,l=a.yDivision,h=a.barHeight,d=a.barYPosition,u=a.zeroW,g=this.w,p=i.realIndex,f=i.j,m=this.preventBarOverflow(u+r/this.invertedYRatio),x=this.preventBarOverflow(u+o/this.invertedYRatio),b=this.getRangeValue(p,f),v=Math.abs(x-m),w=this.barHelpers.getBarpaths({barYPosition:d,barHeight:h,x1:m,x2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:p,realIndex:p,j:f,w:g});return g.globals.isXNumeric||(s+=l),{pathTo:w.pathTo,pathFrom:w.pathFrom,barWidth:v,x:b.start<0&&b.end<0?m:x,goalX:this.barHelpers.getGoalValues("x",u,null,p,f),y:s}}},{key:"getRangeValue",value:function(a,i){var s=this.w;return{start:s.globals.seriesRangeStart[a][i],end:s.globals.seriesRangeEnd[a][i]}}}]),t}(),cl=function(){function n(e){q(this,n),this.w=e.w,this.lineCtx=e}return Z(n,[{key:"sameValueSeriesFix",value:function(e,t){var a=this.w;if((a.config.fill.type==="gradient"||a.config.fill.type[e]==="gradient")&&new Le(this.lineCtx.ctx,a).seriesHaveSameValues(e)){var i=t[e].slice();i[i.length-1]=i[i.length-1]+1e-6,t[e]=i}return t}},{key:"calculatePoints",value:function(e){var t=e.series,a=e.realIndex,i=e.x,s=e.y,r=e.i,o=e.j,l=e.prevY,h=this.w,d=[],u=[],g=this.lineCtx.categoryAxisCorrection+h.config.markers.offsetX;return h.globals.isXNumeric&&(g=(h.globals.seriesX[a][0]-h.globals.minX)/this.lineCtx.xRatio+h.config.markers.offsetX),o===0&&(d.push(g),u.push(R.isNumber(t[r][0])?l+h.config.markers.offsetY:null)),d.push(i+h.config.markers.offsetX),u.push(R.isNumber(t[r][o+1])?s+h.config.markers.offsetY:null),{x:d,y:u}}},{key:"checkPreviousPaths",value:function(e){for(var t=e.pathFromLine,a=e.pathFromArea,i=e.realIndex,s=this.w,r=0;r<s.globals.previousPaths.length;r++){var o=s.globals.previousPaths[r];(o.type==="line"||o.type==="area")&&o.paths.length>0&&parseInt(o.realIndex,10)===parseInt(i,10)&&(o.type==="line"?(this.lineCtx.appendPathFrom=!1,t=s.globals.previousPaths[r].paths[0].d):o.type==="area"&&(this.lineCtx.appendPathFrom=!1,a=s.globals.previousPaths[r].paths[0].d,s.config.stroke.show&&s.globals.previousPaths[r].paths[1]&&(t=s.globals.previousPaths[r].paths[1].d)))}return{pathFromLine:t,pathFromArea:a}}},{key:"determineFirstPrevY",value:function(e){var t,a,i,s=e.i,r=e.realIndex,o=e.series,l=e.prevY,h=e.lineYPosition,d=e.translationsIndex,u=this.w,g=u.config.chart.stacked&&!u.globals.comboCharts||u.config.chart.stacked&&u.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((t=this.w.config.series[r])===null||t===void 0?void 0:t.type)==="bar"||((a=this.w.config.series[r])===null||a===void 0?void 0:a.type)==="column");if(((i=o[s])===null||i===void 0?void 0:i[0])!==void 0)l=(h=g&&s>0?this.lineCtx.prevSeriesY[s-1][0]:this.lineCtx.zeroY)-o[s][0]/this.lineCtx.yRatio[d]+2*(this.lineCtx.isReversed?o[s][0]/this.lineCtx.yRatio[d]:0);else if(g&&s>0&&o[s][0]===void 0){for(var p=s-1;p>=0;p--)if(o[p][0]!==null&&o[p][0]!==void 0){l=h=this.lineCtx.prevSeriesY[p][0];break}}return{prevY:l,lineYPosition:h}}}]),n}(),hl=function(n){for(var e,t,a,i,s=function(d){for(var u=[],g=d[0],p=d[1],f=u[0]=Ii(g,p),m=1,x=d.length-1;m<x;m++)g=p,p=d[m+1],u[m]=.5*(f+(f=Ii(g,p)));return u[m]=f,u}(n),r=n.length-1,o=[],l=0;l<r;l++)a=Ii(n[l],n[l+1]),Math.abs(a)<1e-6?s[l]=s[l+1]=0:(i=(e=s[l]/a)*e+(t=s[l+1]/a)*t)>9&&(i=3*a/Math.sqrt(i),s[l]=i*e,s[l+1]=i*t);for(var h=0;h<=r;h++)i=(n[Math.min(r,h+1)][0]-n[Math.max(0,h-1)][0])/(6*(1+s[h]*s[h])),o.push([i||0,s[h]*i||0]);return o},dl=function(n){var e=hl(n),t=n[1],a=n[0],i=[],s=e[1],r=e[0];i.push(a,[a[0]+r[0],a[1]+r[1],t[0]-s[0],t[1]-s[1],t[0],t[1]]);for(var o=2,l=e.length;o<l;o++){var h=n[o],d=e[o];i.push([h[0]-d[0],h[1]-d[1],h[0],h[1]])}return i},ul=function(n,e,t){var a=n.slice(e,t);if(e){if(t-e>1&&a[1].length<6){var i=a[0].length;a[1]=[2*a[0][i-2]-a[0][i-4],2*a[0][i-1]-a[0][i-3]].concat(a[1])}a[0]=a[0].slice(-2)}return a};function Ii(n,e){return(e[1]-n[1])/(e[0]-n[0])}var Hi=function(){function n(e,t,a){q(this,n),this.ctx=e,this.w=e.w,this.xyRatios=t,this.pointsChart=!(this.w.config.chart.type!=="bubble"&&this.w.config.chart.type!=="scatter")||a,this.scatter=new sr(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new cl(this),this.markers=new Ut(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return Z(n,[{key:"draw",value:function(e,t,a,i){var s,r=this.w,o=new O(this.ctx),l=r.globals.comboCharts?t:r.config.chart.type,h=o.group({class:"apexcharts-".concat(l,"-series apexcharts-plot-series")}),d=new Le(this.ctx,r);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,e=d.getLogSeries(e),this.yRatio=d.getLogYRatios(this.yRatio),this.prevSeriesY=[];for(var u=[],g=0;g<e.length;g++){e=this.lineHelpers.sameValueSeriesFix(g,e);var p=r.globals.comboCharts?a[g]:g,f=this.yRatio.length>1?p:0;this._initSerieVariables(e,g,p);var m=[],x=[],b=[],v=r.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,p),r.globals.isXNumeric&&r.globals.seriesX.length>0&&(v=(r.globals.seriesX[p][0]-r.globals.minX)/this.xRatio),b.push(v);var w,k=v,y=void 0,E=k,S=this.zeroY,C=this.zeroY;S=this.lineHelpers.determineFirstPrevY({i:g,realIndex:p,series:e,prevY:S,lineYPosition:0,translationsIndex:f}).prevY,r.config.stroke.curve==="monotoneCubic"&&e[g][0]===null?m.push(null):m.push(S),w=S,l==="rangeArea"&&(y=C=this.lineHelpers.determineFirstPrevY({i:g,realIndex:p,series:i,prevY:C,lineYPosition:0,translationsIndex:f}).prevY,x.push(m[0]!==null?C:null));var N=this._calculatePathsFrom({type:l,series:e,i:g,realIndex:p,translationsIndex:f,prevX:E,prevY:S,prevY2:C}),L=[m[0]],A=[x[0]],M={type:l,series:e,realIndex:p,translationsIndex:f,i:g,x:v,y:1,pX:k,pY:w,pathsFrom:N,linePaths:[],areaPaths:[],seriesIndex:a,lineYPosition:0,xArrj:b,yArrj:m,y2Arrj:x,seriesRangeEnd:i},F=this._iterateOverDataPoints(G(G({},M),{},{iterations:l==="rangeArea"?e[g].length-1:void 0,isRangeStart:!0}));if(l==="rangeArea"){for(var z=this._calculatePathsFrom({series:i,i:g,realIndex:p,prevX:E,prevY:C}),B=this._iterateOverDataPoints(G(G({},M),{},{series:i,xArrj:[v],yArrj:L,y2Arrj:A,pY:y,areaPaths:F.areaPaths,pathsFrom:z,iterations:i[g].length-1,isRangeStart:!1})),T=F.linePaths.length/2,D=0;D<T;D++)F.linePaths[D]=B.linePaths[D+T]+F.linePaths[D];F.linePaths.splice(T),F.pathFromLine=B.pathFromLine+F.pathFromLine}else F.pathFromArea+="z";this._handlePaths({type:l,realIndex:p,i:g,paths:F}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),u.push(this.elSeries)}if(((s=r.config.series[0])===null||s===void 0?void 0:s.zIndex)!==void 0&&u.sort(function($,K){return Number($.node.getAttribute("zIndex"))-Number(K.node.getAttribute("zIndex"))}),r.config.chart.stacked)for(var I=u.length-1;I>=0;I--)h.add(u[I]);else for(var Y=0;Y<u.length;Y++)h.add(u[Y]);return h}},{key:"_initSerieVariables",value:function(e,t,a){var i=this.w,s=new O(this.ctx);this.xDivision=i.globals.gridWidth/(i.globals.dataPoints-(i.config.xaxis.tickPlacement==="on"?1:0)),this.strokeWidth=Array.isArray(i.config.stroke.width)?i.config.stroke.width[a]:i.config.stroke.width;var r=0;if(this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[a],r=a),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.globals.gridHeight-this.baseLineY[r]-(this.isReversed?i.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[r]:0),this.areaBottomY=this.zeroY,(this.zeroY>i.globals.gridHeight||i.config.plotOptions.area.fillTo==="end")&&(this.areaBottomY=i.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=s.group({class:"apexcharts-series",zIndex:i.config.series[a].zIndex!==void 0?i.config.series[a].zIndex:a,seriesName:R.escapeString(i.globals.seriesNames[a])}),this.elPointsMain=s.group({class:"apexcharts-series-markers-wrap","data:realIndex":a}),i.globals.hasNullValues){var o=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[i.globals.gridHeight+i.globals.markers.largestSize]},seriesIndex:t,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});o!==null&&this.elPointsMain.add(o)}this.elDataLabelsWrap=s.group({class:"apexcharts-datalabels","data:realIndex":a});var l=e[t].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":l,rel:t+1,"data:realIndex":a}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(e){var t,a,i,s,r=e.type,o=e.series,l=e.i,h=e.realIndex,d=e.translationsIndex,u=e.prevX,g=e.prevY,p=e.prevY2,f=this.w,m=new O(this.ctx);if(o[l][0]===null){for(var x=0;x<o[l].length;x++)if(o[l][x]!==null){u=this.xDivision*x,g=this.zeroY-o[l][x]/this.yRatio[d],t=m.move(u,g),a=m.move(u,this.areaBottomY);break}}else t=m.move(u,g),r==="rangeArea"&&(t=m.move(u,p)+m.line(u,g)),a=m.move(u,this.areaBottomY)+m.line(u,g);if(i=m.move(0,this.areaBottomY)+m.line(0,this.areaBottomY),s=m.move(0,this.areaBottomY)+m.line(0,this.areaBottomY),f.globals.previousPaths.length>0){var b=this.lineHelpers.checkPreviousPaths({pathFromLine:i,pathFromArea:s,realIndex:h});i=b.pathFromLine,s=b.pathFromArea}return{prevX:u,prevY:g,linePath:t,areaPath:a,pathFromLine:i,pathFromArea:s}}},{key:"_handlePaths",value:function(e){var t=e.type,a=e.realIndex,i=e.i,s=e.paths,r=this.w,o=new O(this.ctx),l=new lt(this.ctx);this.prevSeriesY.push(s.yArrj),r.globals.seriesXvalues[a]=s.xArrj,r.globals.seriesYvalues[a]=s.yArrj;var h=r.config.forecastDataPoints;if(h.count>0&&t!=="rangeArea"){var d=r.globals.seriesXvalues[a][r.globals.seriesXvalues[a].length-h.count-1],u=o.drawRect(d,0,r.globals.gridWidth,r.globals.gridHeight,0);r.globals.dom.elForecastMask.appendChild(u.node);var g=o.drawRect(0,0,d,r.globals.gridHeight,0);r.globals.dom.elNonForecastMask.appendChild(g.node)}this.pointsChart||r.globals.delayedElements.push({el:this.elPointsMain.node,index:a});var p={i,realIndex:a,animationDelay:i,initialSpeed:r.config.chart.animations.speed,dataChangeSpeed:r.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(t)};if(t==="area")for(var f=l.fillPath({seriesNumber:a}),m=0;m<s.areaPaths.length;m++){var x=o.renderPaths(G(G({},p),{},{pathFrom:s.pathFromArea,pathTo:s.areaPaths[m],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:f}));this.elSeries.add(x)}if(r.config.stroke.show&&!this.pointsChart){var b=null;if(t==="line")b=l.fillPath({seriesNumber:a,i});else if(r.config.stroke.fill.type==="solid")b=r.globals.stroke.colors[a];else{var v=r.config.fill;r.config.fill=r.config.stroke.fill,b=l.fillPath({seriesNumber:a,i}),r.config.fill=v}for(var w=0;w<s.linePaths.length;w++){var k=b;t==="rangeArea"&&(k=l.fillPath({seriesNumber:a}));var y=G(G({},p),{},{pathFrom:s.pathFromLine,pathTo:s.linePaths[w],stroke:b,strokeWidth:this.strokeWidth,strokeLineCap:r.config.stroke.lineCap,fill:t==="rangeArea"?k:"none"}),E=o.renderPaths(y);if(this.elSeries.add(E),E.attr("fill-rule","evenodd"),h.count>0&&t!=="rangeArea"){var S=o.renderPaths(y);S.node.setAttribute("stroke-dasharray",h.dashArray),h.strokeWidth&&S.node.setAttribute("stroke-width",h.strokeWidth),this.elSeries.add(S),S.attr("clip-path","url(#forecastMask".concat(r.globals.cuid,")")),E.attr("clip-path","url(#nonForecastMask".concat(r.globals.cuid,")"))}}}}},{key:"_iterateOverDataPoints",value:function(e){var t,a,i=this,s=e.type,r=e.series,o=e.iterations,l=e.realIndex,h=e.translationsIndex,d=e.i,u=e.x,g=e.y,p=e.pX,f=e.pY,m=e.pathsFrom,x=e.linePaths,b=e.areaPaths,v=e.seriesIndex,w=e.lineYPosition,k=e.xArrj,y=e.yArrj,E=e.y2Arrj,S=e.isRangeStart,C=e.seriesRangeEnd,N=this.w,L=new O(this.ctx),A=this.yRatio,M=m.prevY,F=m.linePath,z=m.areaPath,B=m.pathFromLine,T=m.pathFromArea,D=R.isNumber(N.globals.minYArr[l])?N.globals.minYArr[l]:N.globals.minY;o||(o=N.globals.dataPoints>1?N.globals.dataPoints-1:N.globals.dataPoints);var I=function(ve,Ae){return Ae-ve/A[h]+2*(i.isReversed?ve/A[h]:0)},Y=g,$=N.config.chart.stacked&&!N.globals.comboCharts||N.config.chart.stacked&&N.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((t=this.w.config.series[l])===null||t===void 0?void 0:t.type)==="bar"||((a=this.w.config.series[l])===null||a===void 0?void 0:a.type)==="column"),K=N.config.stroke.curve;Array.isArray(K)&&(K=Array.isArray(v)?K[v[d]]:K[d]);for(var ie,he=0,X=0;X<o&&r[d].length!==0;X++){var ge=r[d][X+1]===void 0||r[d][X+1]===null;if(N.globals.isXNumeric){var oe=N.globals.seriesX[l][X+1];N.globals.seriesX[l][X+1]===void 0&&(oe=N.globals.seriesX[l][o-1]),u=(oe-N.globals.minX)/this.xRatio}else u+=this.xDivision;$?d>0&&N.globals.collapsedSeries.length<N.config.series.length-1?w=this.prevSeriesY[function(ve){for(var Ae=ve;Ae>0;Ae--){if(!(N.globals.collapsedSeriesIndices.indexOf((v==null?void 0:v[Ae])||Ae)>-1))return Ae;Ae--}return 0}(d-1)][X+1]:w=this.zeroY:w=this.zeroY,ge?g=I(D,w):(g=I(r[d][X+1],w),s==="rangeArea"&&(Y=I(C[d][X+1],w))),k.push(r[d][X+1]===null?null:u),!ge||N.config.stroke.curve!=="smooth"&&N.config.stroke.curve!=="monotoneCubic"?(y.push(g),E.push(Y)):(y.push(null),E.push(null));var ne=this.lineHelpers.calculatePoints({series:r,x:u,y:g,realIndex:l,i:d,j:X,prevY:M}),ce=this._createPaths({type:s,series:r,i:d,realIndex:l,j:X,x:u,y:g,y2:Y,xArrj:k,yArrj:y,y2Arrj:E,pX:p,pY:f,pathState:he,segmentStartX:ie,linePath:F,areaPath:z,linePaths:x,areaPaths:b,curve:K,isRangeStart:S});b=ce.areaPaths,x=ce.linePaths,p=ce.pX,f=ce.pY,he=ce.pathState,ie=ce.segmentStartX,z=ce.areaPath,F=ce.linePath,!this.appendPathFrom||N.globals.hasNullValues||K==="monotoneCubic"&&s==="rangeArea"||(B+=L.line(u,this.areaBottomY),T+=L.line(u,this.areaBottomY)),this.handleNullDataPoints(r,ne,d,X,l),this._handleMarkersAndLabels({type:s,pointsPos:ne,i:d,j:X,realIndex:l,isRangeStart:S})}return{yArrj:y,xArrj:k,pathFromArea:T,areaPaths:b,pathFromLine:B,linePaths:x,linePath:F,areaPath:z}}},{key:"_handleMarkersAndLabels",value:function(e){var t=e.type,a=e.pointsPos,i=e.isRangeStart,s=e.i,r=e.j,o=e.realIndex,l=this.w,h=new qt(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,r,{realIndex:o,pointsPos:a,zRatio:this.zRatio,elParent:this.elPointsMain});else{l.globals.series[s].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");var d=this.markers.plotChartMarkers({pointsPos:a,seriesIndex:o,j:r+1});d!==null&&this.elPointsMain.add(d)}var u=h.drawDataLabel({type:t,isRangeStart:i,pos:a,i:o,j:r+1});u!==null&&this.elDataLabelsWrap.add(u)}},{key:"_createPaths",value:function(e){var t=e.type,a=e.series,i=e.i;e.realIndex;var s,r=e.j,o=e.x,l=e.y,h=e.xArrj,d=e.yArrj,u=e.y2,g=e.y2Arrj,p=e.pX,f=e.pY,m=e.pathState,x=e.segmentStartX,b=e.linePath,v=e.areaPath,w=e.linePaths,k=e.areaPaths,y=e.curve,E=e.isRangeStart,S=new O(this.ctx),C=this.areaBottomY,N=t==="rangeArea",L=t==="rangeArea"&&E;switch(y){case"monotoneCubic":var A=E?d:g;switch(m){case 0:if(A[r+1]===null)break;m=1;case 1:if(!(N?h.length===a[i].length:r===a[i].length-2))break;case 2:var M=E?h:h.slice().reverse(),F=E?A:A.slice().reverse(),z=(s=F,M.map(function(oe,ne){return[oe,s[ne]]}).filter(function(oe){return oe[1]!==null})),B=z.length>1?dl(z):z,T=[];N&&(L?k=z:T=k.reverse());var D=0,I=0;if(function(oe,ne){for(var ce=function(at){var ye=[],Ye=0;return at.forEach(function(Pt){Pt!==null?Ye++:Ye>0&&(ye.push(Ye),Ye=0)}),Ye>0&&ye.push(Ye),ye}(oe),ve=[],Ae=0,Ne=0;Ae<ce.length;Ne+=ce[Ae++])ve[Ae]=ul(ne,Ne,Ne+ce[Ae]);return ve}(F,B).forEach(function(oe){D++;var ne=function(Ae){for(var Ne="",at=0;at<Ae.length;at++){var ye=Ae[at],Ye=ye.length;Ye>4?(Ne+="C".concat(ye[0],", ").concat(ye[1]),Ne+=", ".concat(ye[2],", ").concat(ye[3]),Ne+=", ".concat(ye[4],", ").concat(ye[5])):Ye>2&&(Ne+="S".concat(ye[0],", ").concat(ye[1]),Ne+=", ".concat(ye[2],", ").concat(ye[3]))}return Ne}(oe),ce=I,ve=(I+=oe.length)-1;L?b=S.move(z[ce][0],z[ce][1])+ne:N?b=S.move(T[ce][0],T[ce][1])+S.line(z[ce][0],z[ce][1])+ne+S.line(T[ve][0],T[ve][1]):(b=S.move(z[ce][0],z[ce][1])+ne,v=b+S.line(z[ve][0],C)+S.line(z[ce][0],C)+"z",k.push(v)),w.push(b)}),N&&D>1&&!L){var Y=w.slice(D).reverse();w.splice(D),Y.forEach(function(oe){return w.push(oe)})}m=0}break;case"smooth":var $=.35*(o-p);if(a[i][r]===null)m=0;else switch(m){case 0:if(x=p,b=L?S.move(p,g[r])+S.line(p,f):S.move(p,f),v=S.move(p,f),a[i][r+1]===null||a[i][r+1]===void 0){w.push(b),k.push(v);break}if(m=1,r<a[i].length-2){var K=S.curve(p+$,f,o-$,l,o,l);b+=K,v+=K;break}case 1:if(a[i][r+1]===null)b+=L?S.line(p,u):S.move(p,f),v+=S.line(p,C)+S.line(x,C)+"z",w.push(b),k.push(v),m=-1;else{var ie=S.curve(p+$,f,o-$,l,o,l);b+=ie,v+=ie,r>=a[i].length-2&&(L&&(b+=S.curve(o,l,o,l,o,u)+S.move(o,u)),v+=S.curve(o,l,o,l,o,C)+S.line(x,C)+"z",w.push(b),k.push(v),m=-1)}}p=o,f=l;break;default:var he=function(oe,ne,ce){var ve=[];switch(oe){case"stepline":ve=S.line(ne,null,"H")+S.line(null,ce,"V");break;case"linestep":ve=S.line(null,ce,"V")+S.line(ne,null,"H");break;case"straight":ve=S.line(ne,ce)}return ve};if(a[i][r]===null)m=0;else switch(m){case 0:if(x=p,b=L?S.move(p,g[r])+S.line(p,f):S.move(p,f),v=S.move(p,f),a[i][r+1]===null||a[i][r+1]===void 0){w.push(b),k.push(v);break}if(m=1,r<a[i].length-2){var X=he(y,o,l);b+=X,v+=X;break}case 1:if(a[i][r+1]===null)b+=L?S.line(p,u):S.move(p,f),v+=S.line(p,C)+S.line(x,C)+"z",w.push(b),k.push(v),m=-1;else{var ge=he(y,o,l);b+=ge,v+=ge,r>=a[i].length-2&&(L&&(b+=S.line(o,u)),v+=S.line(o,C)+S.line(x,C)+"z",w.push(b),k.push(v),m=-1)}}p=o,f=l}return{linePaths:w,areaPaths:k,pX:p,pY:f,pathState:m,segmentStartX:x,linePath:b,areaPath:v}}},{key:"handleNullDataPoints",value:function(e,t,a,i,s){var r=this.w;if(e[a][i]===null&&r.config.markers.showNullDataPoints||e[a].length===1){var o=this.strokeWidth-r.config.markers.strokeWidth/2;o>0||(o=0);var l=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:s,j:i+1,pSize:o,alwaysDrawMarker:!0});l!==null&&this.elPointsMain.add(l)}}}]),n}();window.TreemapSquared={},window.TreemapSquared.generate=function(){function n(o,l,h,d){this.xoffset=o,this.yoffset=l,this.height=d,this.width=h,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(u){var g,p=[],f=this.xoffset,m=this.yoffset,x=s(u)/this.height,b=s(u)/this.width;if(this.width>=this.height)for(g=0;g<u.length;g++)p.push([f,m,f+x,m+u[g]/x]),m+=u[g]/x;else for(g=0;g<u.length;g++)p.push([f,m,f+u[g]/b,m+b]),f+=u[g]/b;return p},this.cutArea=function(u){var g;if(this.width>=this.height){var p=u/this.height,f=this.width-p;g=new n(this.xoffset+p,this.yoffset,f,this.height)}else{var m=u/this.width,x=this.height-m;g=new n(this.xoffset,this.yoffset+m,this.width,x)}return g}}function e(o,l,h,d,u){d=d===void 0?0:d,u=u===void 0?0:u;var g=t(function(p,f){var m,x=[],b=f/s(p);for(m=0;m<p.length;m++)x[m]=p[m]*b;return x}(o,l*h),[],new n(d,u,l,h),[]);return function(p){var f,m,x=[];for(f=0;f<p.length;f++)for(m=0;m<p[f].length;m++)x.push(p[f][m]);return x}(g)}function t(o,l,h,d){var u,g,p;if(o.length!==0)return u=h.shortestEdge(),function(f,m,x){var b;if(f.length===0)return!0;(b=f.slice()).push(m);var v=a(f,x),w=a(b,x);return v>=w}(l,g=o[0],u)?(l.push(g),t(o.slice(1),l,h,d)):(p=h.cutArea(s(l),d),d.push(h.getCoordinates(l)),t(o,[],p,d)),d;d.push(h.getCoordinates(l))}function a(o,l){var h=Math.min.apply(Math,o),d=Math.max.apply(Math,o),u=s(o);return Math.max(Math.pow(l,2)*d/Math.pow(u,2),Math.pow(u,2)/(Math.pow(l,2)*h))}function i(o){return o&&o.constructor===Array}function s(o){var l,h=0;for(l=0;l<o.length;l++)h+=o[l];return h}function r(o){var l,h=0;if(i(o[0]))for(l=0;l<o.length;l++)h+=r(o[l]);else h=s(o);return h}return function o(l,h,d,u,g){u=u===void 0?0:u,g=g===void 0?0:g;var p,f,m=[],x=[];if(i(l[0])){for(f=0;f<l.length;f++)m[f]=r(l[f]);for(p=e(m,h,d,u,g),f=0;f<l.length;f++)x.push(o(l[f],p[f][2]-p[f][0],p[f][3]-p[f][1],p[f][0],p[f][1]))}else x=e(l,h,d,u,g);return x}}();var gl=function(){function n(e,t){q(this,n),this.ctx=e,this.w=e.w,this.strokeWidth=this.w.config.stroke.width,this.helpers=new gr(e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}return Z(n,[{key:"draw",value:function(e){var t=this,a=this.w,i=new O(this.ctx),s=new lt(this.ctx),r=i.group({class:"apexcharts-treemap"});if(a.globals.noData)return r;var o=[];return e.forEach(function(l){var h=l.map(function(d){return Math.abs(d)});o.push(h)}),this.negRange=this.helpers.checkColorRange(),a.config.series.forEach(function(l,h){l.data.forEach(function(d){Array.isArray(t.labels[h])||(t.labels[h]=[]),t.labels[h].push(d.x)})}),window.TreemapSquared.generate(o,a.globals.gridWidth,a.globals.gridHeight).forEach(function(l,h){var d=i.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:R.escapeString(a.globals.seriesNames[h]),rel:h+1,"data:realIndex":h});if(a.config.chart.dropShadow.enabled){var u=a.config.chart.dropShadow;new Ie(t.ctx).dropShadow(r,u,h)}var g=i.group({class:"apexcharts-data-labels"}),p={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};l.forEach(function(B,T){var D=B[0],I=B[1],Y=B[2],$=B[3];p.xMin=Math.min(p.xMin,D),p.yMin=Math.min(p.yMin,I),p.xMax=Math.max(p.xMax,Y),p.yMax=Math.max(p.yMax,$);var K=t.helpers.getShadeColor(a.config.chart.type,h,T,t.negRange),ie=K.color,he=s.fillPath({color:ie,seriesNumber:h,dataPointIndex:T}),X=i.drawRect(D,I,Y-D,$-I,a.config.plotOptions.treemap.borderRadius,"#fff",1,t.strokeWidth,a.config.plotOptions.treemap.useFillColorAsStroke?ie:a.globals.stroke.colors[h]);X.attr({cx:D,cy:I,index:h,i:h,j:T,width:Y-D,height:$-I,fill:he}),X.node.classList.add("apexcharts-treemap-rect"),t.helpers.addListeners(X);var ge={x:D+(Y-D)/2,y:I+($-I)/2,width:0,height:0},oe={x:D,y:I,width:Y-D,height:$-I};if(a.config.chart.animations.enabled&&!a.globals.dataChanged){var ne=1;a.globals.resized||(ne=a.config.chart.animations.speed),t.animateTreemap(X,ge,oe,ne)}if(a.globals.dataChanged){var ce=1;t.dynamicAnim.enabled&&a.globals.shouldAnimate&&(ce=t.dynamicAnim.speed,a.globals.previousPaths[h]&&a.globals.previousPaths[h][T]&&a.globals.previousPaths[h][T].rect&&(ge=a.globals.previousPaths[h][T].rect),t.animateTreemap(X,ge,oe,ce))}var ve=t.getFontSize(B),Ae=a.config.dataLabels.formatter(t.labels[h][T],{value:a.globals.series[h][T],seriesIndex:h,dataPointIndex:T,w:a});a.config.plotOptions.treemap.dataLabels.format==="truncate"&&(ve=parseInt(a.config.dataLabels.style.fontSize,10),Ae=t.truncateLabels(Ae,ve,D,I,Y,$));var Ne=null;a.globals.series[h][T]&&(Ne=t.helpers.calculateDataLabels({text:Ae,x:(D+Y)/2,y:(I+$)/2+t.strokeWidth/2+ve/3,i:h,j:T,colorProps:K,fontSize:ve,series:e})),a.config.dataLabels.enabled&&Ne&&t.rotateToFitLabel(Ne,ve,Ae,D,I,Y,$),d.add(X),Ne!==null&&d.add(Ne)});var f=a.config.plotOptions.treemap.seriesTitle;if(a.config.series.length>1&&f&&f.show){var m=a.config.series[h].name||"";if(m&&p.xMin<1/0&&p.yMin<1/0){var x=f.offsetX,b=f.offsetY,v=f.borderColor,w=f.borderWidth,k=f.borderRadius,y=f.style,E=y.color||a.config.chart.foreColor,S={left:y.padding.left,right:y.padding.right,top:y.padding.top,bottom:y.padding.bottom},C=i.getTextRects(m,y.fontSize,y.fontFamily),N=C.width+S.left+S.right,L=C.height+S.top+S.bottom,A=p.xMin+(x||0),M=p.yMin+(b||0),F=i.drawRect(A,M,N,L,k,y.background,1,w,v),z=i.drawText({x:A+S.left,y:M+S.top+.75*C.height,text:m,fontSize:y.fontSize,fontFamily:y.fontFamily,fontWeight:y.fontWeight,foreColor:E,cssClass:y.cssClass||""});d.add(F),d.add(z)}}d.add(g),r.add(d)}),r}},{key:"getFontSize",value:function(e){var t=this.w,a=function i(s){var r,o=0;if(Array.isArray(s[0]))for(r=0;r<s.length;r++)o+=i(s[r]);else for(r=0;r<s.length;r++)o+=s[r].length;return o}(this.labels)/function i(s){var r,o=0;if(Array.isArray(s[0]))for(r=0;r<s.length;r++)o+=i(s[r]);else for(r=0;r<s.length;r++)o+=1;return o}(this.labels);return function(i,s){var r=i*s,o=Math.pow(r,.5);return Math.min(o/a,parseInt(t.config.dataLabels.style.fontSize,10))}(e[2]-e[0],e[3]-e[1])}},{key:"rotateToFitLabel",value:function(e,t,a,i,s,r,o){var l=new O(this.ctx),h=l.getTextRects(a,t);if(h.width+this.w.config.stroke.width+5>r-i&&h.width<=o-s){var d=l.rotateAroundCenter(e.node);e.node.setAttribute("transform","rotate(-90 ".concat(d.x," ").concat(d.y,") translate(").concat(h.height/3,")"))}}},{key:"truncateLabels",value:function(e,t,a,i,s,r){var o=new O(this.ctx),l=o.getTextRects(e,t).width+this.w.config.stroke.width+5>s-a&&r-i>s-a?r-i:s-a,h=o.getTextBasedOnMaxWidth({text:e,maxWidth:l,fontSize:t});return e.length!==h.length&&l/t<5?"":h}},{key:"animateTreemap",value:function(e,t,a,i){var s=new Ot(this.ctx);s.animateRect(e,t,a,i,function(){s.animationCompleted(e)})}}]),n}(),mr=86400,pl=10/mr,fl=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return Z(n,[{key:"calculateTimeScaleTicks",value:function(e,t){var a=this,i=this.w;if(i.globals.allSeriesCollapsed)return i.globals.labels=[],i.globals.timescaleLabels=[],[];var s=new He(this.ctx),r=(t-e)/864e5;this.determineInterval(r),i.globals.disableZoomIn=!1,i.globals.disableZoomOut=!1,r<pl?i.globals.disableZoomIn=!0:r>5e4&&(i.globals.disableZoomOut=!0);var o=s.getTimeUnitsfromTimestamp(e,t,this.utc),l=i.globals.gridWidth/r,h=l/24,d=h/60,u=d/60,g=Math.floor(24*r),p=Math.floor(1440*r),f=Math.floor(r*mr),m=Math.floor(r),x=Math.floor(r/30),b=Math.floor(r/365),v={minMillisecond:o.minMillisecond,minSecond:o.minSecond,minMinute:o.minMinute,minHour:o.minHour,minDate:o.minDate,minMonth:o.minMonth,minYear:o.minYear},w={firstVal:v,currentMillisecond:v.minMillisecond,currentSecond:v.minSecond,currentMinute:v.minMinute,currentHour:v.minHour,currentMonthDate:v.minDate,currentDate:v.minDate,currentMonth:v.minMonth,currentYear:v.minYear,daysWidthOnXAxis:l,hoursWidthOnXAxis:h,minutesWidthOnXAxis:d,secondsWidthOnXAxis:u,numberOfSeconds:f,numberOfMinutes:p,numberOfHours:g,numberOfDays:m,numberOfMonths:x,numberOfYears:b};switch(this.tickInterval){case"years":this.generateYearScale(w);break;case"months":case"half_year":this.generateMonthScale(w);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(w);break;case"hours":this.generateHourScale(w);break;case"minutes_fives":case"minutes":this.generateMinuteScale(w);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(w)}var k=this.timeScaleArray.map(function(y){var E={position:y.position,unit:y.unit,year:y.year,day:y.day?y.day:1,hour:y.hour?y.hour:0,month:y.month+1};return y.unit==="month"?G(G({},E),{},{day:1,value:y.value+1}):y.unit==="day"||y.unit==="hour"?G(G({},E),{},{value:y.value}):y.unit==="minute"?G(G({},E),{},{value:y.value,minute:y.value}):y.unit==="second"?G(G({},E),{},{value:y.value,minute:y.minute,second:y.second}):y});return k.filter(function(y){var E=1,S=Math.ceil(i.globals.gridWidth/120),C=y.value;i.config.xaxis.tickAmount!==void 0&&(S=i.config.xaxis.tickAmount),k.length>S&&(E=Math.floor(k.length/S));var N=!1,L=!1;switch(a.tickInterval){case"years":y.unit==="year"&&(N=!0);break;case"half_year":E=7,y.unit==="year"&&(N=!0);break;case"months":E=1,y.unit==="year"&&(N=!0);break;case"months_fortnight":E=15,y.unit!=="year"&&y.unit!=="month"||(N=!0),C===30&&(L=!0);break;case"months_days":E=10,y.unit==="month"&&(N=!0),C===30&&(L=!0);break;case"week_days":E=8,y.unit==="month"&&(N=!0);break;case"days":E=1,y.unit==="month"&&(N=!0);break;case"hours":y.unit==="day"&&(N=!0);break;case"minutes_fives":case"seconds_fives":C%5!=0&&(L=!0);break;case"seconds_tens":C%10!=0&&(L=!0)}if(a.tickInterval==="hours"||a.tickInterval==="minutes_fives"||a.tickInterval==="seconds_tens"||a.tickInterval==="seconds_fives"){if(!L)return!0}else if((C%E==0||N)&&!L)return!0})}},{key:"recalcDimensionsBasedOnFormat",value:function(e,t){var a=this.w,i=this.formatDates(e),s=this.removeOverlappingTS(i);a.globals.timescaleLabels=s.slice(),new Ia(this.ctx).plotCoords()}},{key:"determineInterval",value:function(e){var t=24*e,a=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 a>15:this.tickInterval="minutes_fives";break;case a>5:this.tickInterval="minutes";break;case a>1:this.tickInterval="seconds_tens";break;case 60*a>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}},{key:"generateYearScale",value:function(e){var t=e.firstVal,a=e.currentMonth,i=e.currentYear,s=e.daysWidthOnXAxis,r=e.numberOfYears,o=t.minYear,l=0,h=new He(this.ctx),d="year";if(t.minDate>1||t.minMonth>0){var u=h.determineRemainingDaysOfYear(t.minYear,t.minMonth,t.minDate);l=(h.determineDaysOfYear(t.minYear)-u+1)*s,o=t.minYear+1,this.timeScaleArray.push({position:l,value:o,unit:d,year:o,month:R.monthMod(a+1)})}else t.minDate===1&&t.minMonth===0&&this.timeScaleArray.push({position:l,value:o,unit:d,year:i,month:R.monthMod(a+1)});for(var g=o,p=l,f=0;f<r;f++)g++,p=h.determineDaysOfYear(g-1)*s+p,this.timeScaleArray.push({position:p,value:g,unit:d,year:g,month:1})}},{key:"generateMonthScale",value:function(e){var t=e.firstVal,a=e.currentMonthDate,i=e.currentMonth,s=e.currentYear,r=e.daysWidthOnXAxis,o=e.numberOfMonths,l=i,h=0,d=new He(this.ctx),u="month",g=0;if(t.minDate>1){h=(d.determineDaysOfMonths(i+1,t.minYear)-a+1)*r,l=R.monthMod(i+1);var p=s+g,f=R.monthMod(l),m=l;l===0&&(u="year",m=p,f=1,p+=g+=1),this.timeScaleArray.push({position:h,value:m,unit:u,year:p,month:f})}else this.timeScaleArray.push({position:h,value:l,unit:u,year:s,month:R.monthMod(i)});for(var x=l+1,b=h,v=0,w=1;v<o;v++,w++){(x=R.monthMod(x))===0?(u="year",g+=1):u="month";var k=this._getYear(s,x,g);b=d.determineDaysOfMonths(x,k)*r+b;var y=x===0?k:x;this.timeScaleArray.push({position:b,value:y,unit:u,year:k,month:x===0?1:x}),x++}}},{key:"generateDayScale",value:function(e){var t=e.firstVal,a=e.currentMonth,i=e.currentYear,s=e.hoursWidthOnXAxis,r=e.numberOfDays,o=new He(this.ctx),l="day",h=t.minDate+1,d=h,u=function(w,k,y){return w>o.determineDaysOfMonths(k+1,y)&&(d=1,l="month",p=k+=1),k},g=(24-t.minHour)*s,p=h,f=u(d,a,i);t.minHour===0&&t.minDate===1?(g=0,p=R.monthMod(t.minMonth),l="month",d=t.minDate):t.minDate!==1&&t.minHour===0&&t.minMinute===0&&(g=0,h=t.minDate,p=h,f=u(d=h,a,i),p!==1&&(l="day")),this.timeScaleArray.push({position:g,value:p,unit:l,year:this._getYear(i,f,0),month:R.monthMod(f),day:d});for(var m=g,x=0;x<r;x++){l="day",f=u(d+=1,f,this._getYear(i,f,0));var b=this._getYear(i,f,0);m=24*s+m;var v=d===1?R.monthMod(f):d;this.timeScaleArray.push({position:m,value:v,unit:l,year:b,month:R.monthMod(f),day:v})}}},{key:"generateHourScale",value:function(e){var t=e.firstVal,a=e.currentDate,i=e.currentMonth,s=e.currentYear,r=e.minutesWidthOnXAxis,o=e.numberOfHours,l=new He(this.ctx),h="hour",d=function(E,S){return E>l.determineDaysOfMonths(S+1,s)&&(x=1,S+=1),{month:S,date:x}},u=function(E,S){return E>l.determineDaysOfMonths(S+1,s)?S+=1:S},g=60-(t.minMinute+t.minSecond/60),p=g*r,f=t.minHour+1,m=f;g===60&&(p=0,m=f=t.minHour);var x=a;m>=24&&(m=0,h="day",f=x+=1);var b=d(x,i).month;b=u(x,b),f>31&&(f=x=1),this.timeScaleArray.push({position:p,value:f,unit:h,day:x,hour:m,year:s,month:R.monthMod(b)}),m++;for(var v=p,w=0;w<o;w++){h="hour",m>=24&&(m=0,h="day",b=d(x+=1,b).month,b=u(x,b));var k=this._getYear(s,b,0);v=60*r+v;var y=m===0?x:m;this.timeScaleArray.push({position:v,value:y,unit:h,hour:m,day:x,year:k,month:R.monthMod(b)}),m++}}},{key:"generateMinuteScale",value:function(e){for(var t=e.currentMillisecond,a=e.currentSecond,i=e.currentMinute,s=e.currentHour,r=e.currentDate,o=e.currentMonth,l=e.currentYear,h=e.minutesWidthOnXAxis,d=e.secondsWidthOnXAxis,u=e.numberOfMinutes,g=i+1,p=r,f=o,m=l,x=s,b=(60-a-t/1e3)*d,v=0;v<u;v++)g>=60&&(g=0,(x+=1)===24&&(x=0)),this.timeScaleArray.push({position:b,value:g,unit:"minute",hour:x,minute:g,day:p,year:this._getYear(m,f,0),month:R.monthMod(f)}),b+=h,g++}},{key:"generateSecondScale",value:function(e){for(var t=e.currentMillisecond,a=e.currentSecond,i=e.currentMinute,s=e.currentHour,r=e.currentDate,o=e.currentMonth,l=e.currentYear,h=e.secondsWidthOnXAxis,d=e.numberOfSeconds,u=a+1,g=i,p=r,f=o,m=l,x=s,b=(1e3-t)/1e3*h,v=0;v<d;v++)u>=60&&(u=0,++g>=60&&(g=0,++x===24&&(x=0))),this.timeScaleArray.push({position:b,value:u,unit:"second",hour:x,minute:g,second:u,day:p,year:this._getYear(m,f,0),month:R.monthMod(f)}),b+=h,u++}},{key:"createRawDateString",value:function(e,t){var a=e.year;return e.month===0&&(e.month=1),a+="-"+("0"+e.month.toString()).slice(-2),e.unit==="day"?a+=e.unit==="day"?"-"+("0"+t).slice(-2):"-01":a+="-"+("0"+(e.day?e.day:"1")).slice(-2),e.unit==="hour"?a+=e.unit==="hour"?"T"+("0"+t).slice(-2):"T00":a+="T"+("0"+(e.hour?e.hour:"0")).slice(-2),e.unit==="minute"?a+=":"+("0"+t).slice(-2):a+=":"+(e.minute?("0"+e.minute).slice(-2):"00"),e.unit==="second"?a+=":"+("0"+t).slice(-2):a+=":00",this.utc&&(a+=".000Z"),a}},{key:"formatDates",value:function(e){var t=this,a=this.w;return e.map(function(i){var s=i.value.toString(),r=new He(t.ctx),o=t.createRawDateString(i,s),l=r.getDate(r.parseDate(o));if(t.utc||(l=r.getDate(r.parseDateWithTimezone(o))),a.config.xaxis.labels.format===void 0){var h="dd MMM",d=a.config.xaxis.labels.datetimeFormatter;i.unit==="year"&&(h=d.year),i.unit==="month"&&(h=d.month),i.unit==="day"&&(h=d.day),i.unit==="hour"&&(h=d.hour),i.unit==="minute"&&(h=d.minute),i.unit==="second"&&(h=d.second),s=r.formatDate(l,h)}else s=r.formatDate(l,a.config.xaxis.labels.format);return{dateString:o,position:i.position,value:s,unit:i.unit,year:i.year,month:i.month}})}},{key:"removeOverlappingTS",value:function(e){var t,a=this,i=new O(this.ctx),s=!1;e.length>0&&e[0].value&&e.every(function(l){return l.value.length===e[0].value.length})&&(s=!0,t=i.getTextRects(e[0].value).width);var r=0,o=e.map(function(l,h){if(h>0&&a.w.config.xaxis.labels.hideOverlappingLabels){var d=s?t:i.getTextRects(e[r].value).width,u=e[r].position;return l.position>u+d+10?(r=h,l):null}return l});return o=o.filter(function(l){return l!==null})}},{key:"_getYear",value:function(e,t,a){return e+Math.floor(t/12)+a}}]),n}(),ml=function(){function n(e,t){q(this,n),this.ctx=t,this.w=t.w,this.el=e}return Z(n,[{key:"setupElements",value:function(){var e=this.w,t=e.globals,a=e.config,i=a.chart.type;t.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].includes(i),t.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].includes(i),t.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(i)&&a.plotOptions.bar.horizontal,t.chartClass=".apexcharts".concat(t.chartID),t.dom.baseEl=this.el,t.dom.elWrap=document.createElement("div"),O.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(a.chart.offsetX,", ").concat(a.chart.offsetY,")")}),t.dom.Paper.node.style.background=a.theme.mode!=="dark"||a.chart.background?a.theme.mode!=="light"||a.chart.background?a.chart.background:"#fff":"#343A3F",this.setSVGDimensions(),t.dom.elLegendForeign=document.createElementNS(t.SVGNS,"foreignObject"),O.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.elWrap.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 a=this.w,i=this.ctx,s=a.config,r=a.globals,o={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},bar:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},l=s.chart.type||"line",h=null,d=0;r.series.forEach(function(E,S){var C=e[S].type==="column"?"bar":e[S].type||(l==="column"?"bar":l);o[C]?(C==="rangeArea"?(o[C].series.push(r.seriesRangeStart[S]),o[C].seriesRangeEnd.push(r.seriesRangeEnd[S])):o[C].series.push(E),o[C].i.push(S),C==="bar"&&(a.globals.columnSeries=o.bar)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(C)?h=C:console.warn("You have specified an unrecognized series type (".concat(C,").")),l!==C&&C!=="scatter"&&d++}),d>0&&(h&&console.warn("Chart or series type ".concat(h," cannot appear with other chart or series types.")),o.bar.series.length>0&&s.plotOptions.bar.horizontal&&(d-=o.bar.series.length,o.bar={series:[],i:[]},a.globals.columnSeries={series:[],i:[]},console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"))),r.comboCharts||(r.comboCharts=d>0);var u=new Hi(i,t),g=new Vi(i,t);i.pie=new fr(i);var p=new ol(i);i.rangeBar=new ll(i,t);var f=new nl(i),m=[];if(r.comboCharts){var x,b,v=new Le(i);if(o.area.series.length>0&&(x=m).push.apply(x,Pe(v.drawSeriesByGroup(o.area,r.areaGroups,"area",u))),o.bar.series.length>0)if(s.chart.stacked){var w=new ur(i,t);m.push(w.draw(o.bar.series,o.bar.i))}else i.bar=new Zt(i,t),m.push(i.bar.draw(o.bar.series,o.bar.i));if(o.rangeArea.series.length>0&&m.push(u.draw(o.rangeArea.series,"rangeArea",o.rangeArea.i,o.rangeArea.seriesRangeEnd)),o.line.series.length>0&&(b=m).push.apply(b,Pe(v.drawSeriesByGroup(o.line,r.lineGroups,"line",u))),o.candlestick.series.length>0&&m.push(g.draw(o.candlestick.series,"candlestick",o.candlestick.i)),o.boxPlot.series.length>0&&m.push(g.draw(o.boxPlot.series,"boxPlot",o.boxPlot.i)),o.rangeBar.series.length>0&&m.push(i.rangeBar.draw(o.rangeBar.series,o.rangeBar.i)),o.scatter.series.length>0){var k=new Hi(i,t,!0);m.push(k.draw(o.scatter.series,"scatter",o.scatter.i))}if(o.bubble.series.length>0){var y=new Hi(i,t,!0);m.push(y.draw(o.bubble.series,"bubble",o.bubble.i))}}else switch(s.chart.type){case"line":m=u.draw(r.series,"line");break;case"area":m=u.draw(r.series,"area");break;case"bar":s.chart.stacked?m=new ur(i,t).draw(r.series):(i.bar=new Zt(i,t),m=i.bar.draw(r.series));break;case"candlestick":m=new Vi(i,t).draw(r.series,"candlestick");break;case"boxPlot":m=new Vi(i,t).draw(r.series,s.chart.type);break;case"rangeBar":m=i.rangeBar.draw(r.series);break;case"rangeArea":m=u.draw(r.seriesRangeStart,"rangeArea",void 0,r.seriesRangeEnd);break;case"heatmap":m=new rl(i,t).draw(r.series);break;case"treemap":m=new gl(i,t).draw(r.series);break;case"pie":case"donut":case"polarArea":m=i.pie.draw(r.series);break;case"radialBar":m=p.draw(r.series);break;case"radar":m=f.draw(r.series);break;default:m=u.draw(r.series)}return m}},{key:"setSVGDimensions",value:function(){var e=this.w,t=e.globals,a=e.config;a.chart.width=a.chart.width||"100%",a.chart.height=a.chart.height||"auto",t.svgWidth=a.chart.width,t.svgHeight=a.chart.height;var i=R.getDimensions(this.el),s=a.chart.width.toString().split(/[0-9]+/g).pop();s==="%"?R.isNumber(i[0])&&(i[0].width===0&&(i=R.getDimensions(this.el.parentNode)),t.svgWidth=i[0]*parseInt(a.chart.width,10)/100):s!=="px"&&s!==""||(t.svgWidth=parseInt(a.chart.width,10));var r=String(a.chart.height).toString().split(/[0-9]+/g).pop();if(t.svgHeight!=="auto"&&t.svgHeight!=="")if(r==="%"){var o=R.getDimensions(this.el.parentNode);t.svgHeight=o[1]*parseInt(a.chart.height,10)/100}else t.svgHeight=parseInt(a.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),O.setAttrs(t.dom.Paper.node,{width:t.svgWidth,height:t.svgHeight}),r!=="%"){var l=a.chart.sparkline.enabled?0:t.axisCharts?a.chart.parentHeightOffset:0;t.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(t.svgHeight+l,"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,a=e.translateX;O.setAttrs(e.dom.elGraphical.node,{transform:"translate(".concat(a,", ").concat(t,")")})}},{key:"resizeNonAxisCharts",value:function(){var e=this.w,t=e.globals,a=0,i=e.config.chart.sparkline.enabled?1:15;i+=e.config.grid.padding.bottom,["top","bottom"].includes(e.config.legend.position)&&e.config.legend.show&&!e.config.legend.floating&&(a=new or(this.ctx).legendHelpers.getLegendDimensions().clwh+7);var s=e.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),r=2.05*e.globals.radialSize;if(s&&!e.config.chart.sparkline.enabled&&e.config.plotOptions.radialBar.startAngle!==0){var o=R.getBoundingClientRect(s);r=o.bottom;var l=o.bottom-o.top;r=Math.max(2.05*e.globals.radialSize,l)}var h=Math.ceil(r+t.translateY+a+i);t.dom.elLegendForeign&&t.dom.elLegendForeign.setAttribute("height",h),e.config.chart.height&&String(e.config.chart.height).includes("%")||(t.dom.elWrap.style.height="".concat(h,"px"),O.setAttrs(t.dom.Paper.node,{height:h}),t.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(h,"px"))}},{key:"coreCalculations",value:function(){new Di(this.ctx).init()}},{key:"resetGlobals",value:function(){var e=this,t=function(){return e.w.config.series.map(function(){return[]})},a=new ir,i=this.w.globals;a.initGlobalVars(i),i.seriesXvalues=t(),i.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(e.config.xaxis.crosshairs.position==="back"&&new Bi(this.ctx).drawXCrosshairs(),e.config.yaxis[0].crosshairs.position==="back"&&new Bi(this.ctx).drawYCrosshairs(),e.config.xaxis.type==="datetime"&&e.config.xaxis.labels.formatter===void 0){this.ctx.timeScale=new fl(this.ctx);var a=[];isFinite(e.globals.minX)&&isFinite(e.globals.maxX)&&!e.globals.isBarHorizontal?a=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minX,e.globals.maxX):e.globals.isBarHorizontal&&(a=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minY,e.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(a)}t=new Le(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.ctx,a=this.w;if(a.config.chart.brush.enabled&&typeof a.config.chart.events.selection!="function"){var i=Array.isArray(a.config.chart.brush.targets)?a.config.chart.brush.targets:[a.config.chart.brush.target];i.forEach(function(s){var r=t.constructor.getChartByID(s);r.w.globals.brushSource=e.ctx,typeof r.w.config.chart.events.zoomed!="function"&&(r.w.config.chart.events.zoomed=function(){return e.updateSourceChart(r)}),typeof r.w.config.chart.events.scrolled!="function"&&(r.w.config.chart.events.scrolled=function(){return e.updateSourceChart(r)})}),a.config.chart.events.selection=function(s,r){i.forEach(function(o){t.constructor.getChartByID(o).ctx.updateHelpers._updateOptions({xaxis:{min:r.xaxis.min,max:r.xaxis.max}},!1,!1,!1,!1)})}}}}]),n}(),xl=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{key:"_updateOptions",value:function(e){var t=this,a=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],s=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],r=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return new Promise(function(o){var l=[t.ctx];s&&(l=t.ctx.getSyncedCharts()),t.ctx.w.globals.isExecCalled&&(l=[t.ctx],t.ctx.w.globals.isExecCalled=!1),l.forEach(function(h,d){var u=h.w;if(u.globals.shouldAnimate=i,a||(u.globals.resized=!0,u.globals.dataChanged=!0,i&&h.series.getPreviousPaths()),e&&Ht(e)==="object"&&(h.config=new fa(e),e=Le.extendArrayProps(h.config,e,u),h.w.globals.chartID!==t.ctx.w.globals.chartID&&delete e.series,u.config=R.extend(u.config,e),r&&(u.globals.lastXAxis=e.xaxis?R.clone(e.xaxis):[],u.globals.lastYAxis=e.yaxis?R.clone(e.yaxis):[],u.globals.initialConfig=R.extend({},u.config),u.globals.initialSeries=R.clone(u.config.series),e.series))){for(var g=0;g<u.globals.collapsedSeriesIndices.length;g++){var p=u.config.series[u.globals.collapsedSeriesIndices[g]];u.globals.collapsedSeries[g].data=u.globals.axisCharts?p.data.slice():p}for(var f=0;f<u.globals.ancillaryCollapsedSeriesIndices.length;f++){var m=u.config.series[u.globals.ancillaryCollapsedSeriesIndices[f]];u.globals.ancillaryCollapsedSeries[f].data=u.globals.axisCharts?m.data.slice():m}h.series.emptyCollapsedSeries(u.config.series)}return h.update(e).then(function(){d===l.length-1&&o(h)})})})}},{key:"_updateSeries",value:function(e,t){var a=this,i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return new Promise(function(s){var r,o=a.w;return o.globals.shouldAnimate=t,o.globals.dataChanged=!0,t&&a.ctx.series.getPreviousPaths(),o.globals.axisCharts?((r=e.map(function(l,h){return a._extendSeries(l,h)})).length===0&&(r=[{data:[]}]),o.config.series=r):o.config.series=e.slice(),i&&(o.globals.initialConfig.series=R.clone(o.config.series),o.globals.initialSeries=R.clone(o.config.series)),a.ctx.update().then(function(){s(a.ctx)})})}},{key:"_extendSeries",value:function(e,t){var a=this.w,i=a.config.series[t];return G(G({},a.config.series[t]),{},{name:e.name?e.name:i==null?void 0:i.name,color:e.color?e.color:i==null?void 0:i.color,type:e.type?e.type:i==null?void 0:i.type,group:e.group?e.group:i==null?void 0:i.group,hidden:e.hidden!==void 0?e.hidden:i==null?void 0:i.hidden,data:e.data?e.data:i==null?void 0:i.data,zIndex:e.zIndex!==void 0?e.zIndex:t})}},{key:"toggleDataPointSelection",value:function(e,t){var a=this.w,i=null,s=".apexcharts-series[data\\:realIndex='".concat(e,"']");return a.globals.axisCharts?i=a.globals.dom.Paper.findOne("".concat(s," path[j='").concat(t,"'], ").concat(s," circle[j='").concat(t,"'], ").concat(s," rect[j='").concat(t,"']")):t===void 0&&(i=a.globals.dom.Paper.findOne("".concat(s," path[j='").concat(e,"']")),a.config.chart.type!=="pie"&&a.config.chart.type!=="polarArea"&&a.config.chart.type!=="donut"||this.ctx.pie.pieClicked(e)),i?(new O(this.ctx).pathMouseDown(i,null),i.node?i.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(e){var t=this.w;if(["min","max"].forEach(function(i){e.xaxis[i]!==void 0&&(t.config.xaxis[i]=e.xaxis[i],t.globals.lastXAxis[i]=e.xaxis[i])}),e.xaxis.categories&&e.xaxis.categories.length&&(t.config.xaxis.categories=e.xaxis.categories),t.config.xaxis.convertedCatToNumeric){var a=new pa(e);e=a.convertCatToNumericXaxis(e,this.ctx)}return e}},{key:"forceYAxisUpdate",value:function(e){return e.chart&&e.chart.stacked&&e.chart.stackType==="100%"&&(Array.isArray(e.yaxis)?e.yaxis.forEach(function(t,a){e.yaxis[a].min=0,e.yaxis[a].max=100}):(e.yaxis.min=0,e.yaxis.max=100)),e}},{key:"revertDefaultAxisMinMax",value:function(e){var t=this,a=this.w,i=a.globals.lastXAxis,s=a.globals.lastYAxis;e&&e.xaxis&&(i=e.xaxis),e&&e.yaxis&&(s=e.yaxis),a.config.xaxis.min=i.min,a.config.xaxis.max=i.max;var r=function(o){s[o]!==void 0&&(a.config.yaxis[o].min=s[o].min,a.config.yaxis[o].max=s[o].max)};a.config.yaxis.map(function(o,l){a.globals.zoomed||s[l]!==void 0?r(l):t.ctx.opts.yaxis[l]!==void 0&&(o.min=t.ctx.opts.yaxis[l].min,o.max=t.ctx.opts.yaxis[l].max)})}}]),n}();(function(){function n(){for(var s=arguments.length>0&&arguments[0]!==u?arguments[0]:[],r=arguments.length>1?arguments[1]:u,o=arguments.length>2?arguments[2]:u,l=arguments.length>3?arguments[3]:u,h=arguments.length>4?arguments[4]:u,d=arguments.length>5?arguments[5]:u,u=arguments.length>6?arguments[6]:u,g=s.slice(r,o||u),p=l.slice(h,d||u),f=0,m={pos:[0,0],start:[0,0]},x={pos:[0,0],start:[0,0]};g[f]=e.call(m,g[f]),p[f]=e.call(x,p[f]),g[f][0]!=p[f][0]||g[f][0]=="M"||g[f][0]=="A"&&(g[f][4]!=p[f][4]||g[f][5]!=p[f][5])?(Array.prototype.splice.apply(g,[f,1].concat(a.call(m,g[f]))),Array.prototype.splice.apply(p,[f,1].concat(a.call(x,p[f])))):(g[f]=t.call(m,g[f]),p[f]=t.call(x,p[f])),!(++f==g.length&&f==p.length);)f==g.length&&g.push(["C",m.pos[0],m.pos[1],m.pos[0],m.pos[1],m.pos[0],m.pos[1]]),f==p.length&&p.push(["C",x.pos[0],x.pos[1],x.pos[0],x.pos[1],x.pos[0],x.pos[1]]);return{start:g,dest:p}}function e(s){switch(s[0]){case"z":case"Z":s[0]="L",s[1]=this.start[0],s[2]=this.start[1];break;case"H":s[0]="L",s[2]=this.pos[1];break;case"V":s[0]="L",s[2]=s[1],s[1]=this.pos[0];break;case"T":s[0]="Q",s[3]=s[1],s[4]=s[2],s[1]=this.reflection[1],s[2]=this.reflection[0];break;case"S":s[0]="C",s[6]=s[4],s[5]=s[3],s[4]=s[2],s[3]=s[1],s[2]=this.reflection[1],s[1]=this.reflection[0]}return s}function t(s){var r=s.length;return this.pos=[s[r-2],s[r-1]],"SCQT".indexOf(s[0])!=-1&&(this.reflection=[2*this.pos[0]-s[r-4],2*this.pos[1]-s[r-3]]),s}function a(s){var r=[s];switch(s[0]){case"M":return this.pos=this.start=[s[1],s[2]],r;case"L":s[5]=s[3]=s[1],s[6]=s[4]=s[2],s[1]=this.pos[0],s[2]=this.pos[1];break;case"Q":s[6]=s[4],s[5]=s[3],s[4]=1*s[4]/3+2*s[2]/3,s[3]=1*s[3]/3+2*s[1]/3,s[2]=1*this.pos[1]/3+2*s[2]/3,s[1]=1*this.pos[0]/3+2*s[1]/3;break;case"A":r=function(o,l){var h,d,u,g,p,f,m,x,b,v,w,k,y,E,S,C,N,L,A,M,F,z,B,T,D,I,Y=Math.abs(l[1]),$=Math.abs(l[2]),K=l[3]%360,ie=l[4],he=l[5],X=l[6],ge=l[7],oe=new fe(o),ne=new fe(X,ge),ce=[];if(Y===0||$===0||oe.x===ne.x&&oe.y===ne.y)return[["C",oe.x,oe.y,ne.x,ne.y,ne.x,ne.y]];for(h=new fe((oe.x-ne.x)/2,(oe.y-ne.y)/2).transform(new Q().rotate(K)),d=h.x*h.x/(Y*Y)+h.y*h.y/($*$),d>1&&(Y*=d=Math.sqrt(d),$*=d),u=new Q().rotate(K).scale(1/Y,1/$).rotate(-K),oe=oe.transform(u),ne=ne.transform(u),g=[ne.x-oe.x,ne.y-oe.y],f=g[0]*g[0]+g[1]*g[1],p=Math.sqrt(f),g[0]/=p,g[1]/=p,m=f<4?Math.sqrt(1-f/4):0,ie===he&&(m*=-1),x=new fe((ne.x+oe.x)/2+m*-g[1],(ne.y+oe.y)/2+m*g[0]),b=new fe(oe.x-x.x,oe.y-x.y),v=new fe(ne.x-x.x,ne.y-x.y),w=Math.acos(b.x/Math.sqrt(b.x*b.x+b.y*b.y)),b.y<0&&(w*=-1),k=Math.acos(v.x/Math.sqrt(v.x*v.x+v.y*v.y)),v.y<0&&(k*=-1),he&&w>k&&(k+=2*Math.PI),!he&&w<k&&(k-=2*Math.PI),E=Math.ceil(2*Math.abs(w-k)/Math.PI),C=[],N=w,y=(k-w)/E,S=4*Math.tan(y/4)/3,F=0;F<=E;F++)A=Math.cos(N),L=Math.sin(N),M=new fe(x.x+A,x.y+L),C[F]=[new fe(M.x+S*L,M.y-S*A),M,new fe(M.x-S*L,M.y+S*A)],N+=y;for(C[0][0]=C[0][1].clone(),C[C.length-1][2]=C[C.length-1][1].clone(),u=new Q().rotate(K).scale(Y,$).rotate(-K),F=0,z=C.length;F<z;F++)C[F][0]=C[F][0].transform(u),C[F][1]=C[F][1].transform(u),C[F][2]=C[F][2].transform(u);for(F=1,z=C.length;F<z;F++)B=(M=C[F-1][2]).x,T=M.y,D=(M=C[F][0]).x,I=M.y,X=(M=C[F][1]).x,ge=M.y,ce.push(["C",B,T,D,I,X,ge]);return ce}(this.pos,s),s=r[0]}return s[0]="C",this.pos=[s[5],s[6]],this.reflection=[2*s[5]-s[3],2*s[6]-s[4]],r}function i(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;if(r===!1)return!1;for(var o=r,l=s.length;o<l;++o)if(s[o][0]=="M")return o;return!1}ae(nt,{morph:function(s,r,o,l,h){for(var d=this.parse(s),u=this.parse(r),g=0,p=0,f=!1,m=!1;g!==!1||p!==!1;){var x;f=i(d,g!==!1&&g+1),m=i(u,p!==!1&&p+1),g===!1&&(g=(x=new nt(b.start).bbox()).height==0||x.width==0?d.push(d[0])-1:d.push(["M",x.x+x.width/2,x.y+x.height/2])-1),p===!1&&(p=(x=new nt(b.dest).bbox()).height==0||x.width==0?u.push(u[0])-1:u.push(["M",x.x+x.width/2,x.y+x.height/2])-1);var b=n(d,g,f,u,p,m);d=d.slice(0,g).concat(b.start,f===!1?[]:d.slice(f)),u=u.slice(0,p).concat(b.dest,m===!1?[]:u.slice(m)),g=f!==!1&&g+b.start.length,p=m!==!1&&p+b.dest.length}this._array=d,this.destination=new nt,this.destination._array=u;var v=this.fromArray(d.map(function(w,k){var y=u[k].map(function(E,S){return S===0?E:l.step(w[S],u[k][S],o,h[k],h)});return y}));return v}})})();const xr=n=>(n.changedTouches&&(n=n.changedTouches[0]),{x:n.clientX,y:n.clientY});class bl{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&&e.which!==1&&e.buttons!==0||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(xr(e));const a=(t?"mouseup":"touchend")+".drag";ut(window,(t?"mousemove":"touchmove")+".drag",this.drag,this,{passive:!1}),ut(window,a,this.endDrag,this,{passive:!1}),this.el.fire("dragstart",{event:e,handler:this,box:this.box})}drag(e){const{box:t,lastClick:a}=this,i=this.el.point(xr(e)),s=i.x-a.x,r=i.y-a.y;if(!s&&!r)return t;const o=t.x+s,l=t.y+r;this.box=new Me(o,l,t.w,t.h),this.lastClick=i,this.el.dispatch("dragmove",{event:e,handler:this,box:this.box}).defaultPrevented||this.move(o,l)}move(e,t){this.el.type==="svg"?vt.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}),Je(window,"mousemove.drag"),Je(window,"touchmove.drag"),Je(window,"mouseup.drag"),Je(window,"touchend.drag"),this.init(!0)}}/*!
|
|
172
|
+
* @svgdotjs/svg.select.js - An extension of svg.js which allows to select elements with mouse
|
|
173
|
+
* @version 4.0.1
|
|
174
|
+
* https://github.com/svgdotjs/svg.select.js
|
|
175
|
+
*
|
|
176
|
+
* @copyright Ulrich-Matthias Schäfer
|
|
177
|
+
* @license MIT
|
|
178
|
+
*
|
|
179
|
+
* BUILT: Mon Jul 01 2024 15:04:42 GMT+0200 (Central European Summer Time)
|
|
180
|
+
*/function Oi(n,e,t,a=null){return function(i){i.preventDefault(),i.stopPropagation();var s=i.pageX||i.touches[0].pageX,r=i.pageY||i.touches[0].pageY;e.fire(n,{x:s,y:r,event:i,index:a,points:t})}}function Xi([n,e],{a:t,b:a,c:i,d:s,e:r,f:o}){return[n*t+e*i+r,n*a+e*s+o]}ae(Ve,{draggable(n=!0){return(this.remember("_draggable")||new bl(this)).init(n),this}});let br=class{constructor(n){this.el=n,n.remember("_selectHandler",this),this.selection=new vt,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const e=ra();this.observer=new e.MutationObserver(this.mutationHandler)}init(n){this.createHandle=n.createHandle||this.createHandleFn,this.createRot=n.createRot||this.createRotFn,this.updateHandle=n.updateHandle||this.updateHandleFn,this.updateRot=n.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(n,e){if(!n)return this.selection.clear().remove(),void this.observer.disconnect();this.init(e)}createSelection(){this.selection.polygon(this.handlePoints).addClass("svg_select_shape")}updateSelection(){this.selection.get(0).plot(this.handlePoints)}createResizeHandles(){this.handlePoints.forEach((n,e,t)=>{const a=this.order[e];this.createHandle.call(this,this.selection,n,e,t,a),this.selection.get(e+1).addClass("svg_select_handle svg_select_handle_"+a).on("mousedown.selection touchstart.selection",Oi(a,this.el,this.handlePoints,e))})}createHandleFn(n){n.polyline()}updateHandleFn(n,e,t,a){const i=a.at(t-1),s=a[(t+1)%a.length],r=e,o=[r[0]-i[0],r[1]-i[1]],l=[r[0]-s[0],r[1]-s[1]],h=Math.sqrt(o[0]*o[0]+o[1]*o[1]),d=Math.sqrt(l[0]*l[0]+l[1]*l[1]),u=[o[0]/h,o[1]/h],g=[l[0]/d,l[1]/d],p=[r[0]-10*u[0],r[1]-10*u[1]],f=[r[0]-10*g[0],r[1]-10*g[1]];n.plot([p,r,f])}updateResizeHandles(){this.handlePoints.forEach((n,e,t)=>{const a=this.order[e];this.updateHandle.call(this,this.selection.get(e+1),n,e,t,a)})}createRotFn(n){n.line(),n.circle(5)}getPoint(n){return this.handlePoints[this.order.indexOf(n)]}getPointHandle(n){return this.selection.get(this.order.indexOf(n)+1)}updateRotFn(n,e){const t=this.getPoint("t");n.get(0).plot(t[0],t[1],e[0],e[1]),n.get(1).center(e[0],e[1])}createRotationHandle(){const n=this.selection.group().addClass("svg_select_handle_rot").on("mousedown.selection touchstart.selection",Oi("rot",this.el,this.handlePoints));this.createRot.call(this,n)}updateRotationHandle(){const n=this.selection.findOne("g.svg_select_handle_rot");this.updateRot(n,this.rotationPoint,this.handlePoints)}updatePoints(){const n=this.el.bbox(),e=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.handlePoints=this.getHandlePoints(n).map(t=>Xi(t,e)),this.rotationPoint=Xi(this.getRotationPoint(n),e)}getHandlePoints({x:n,x2:e,y:t,y2:a,cx:i,cy:s}=this.el.bbox()){return[[n,t],[i,t],[e,t],[e,s],[e,a],[i,a],[n,a],[n,s]]}getRotationPoint({y:n,cx:e}=this.el.bbox()){return[e,n-20]}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updateResizeHandles(),this.updateRotationHandle()}};const vr=n=>function(e=!0,t={}){typeof e=="object"&&(t=e,e=!0);let a=this.remember("_"+n.name);return a||(e.prototype instanceof br?(a=new e(this),e=!0):a=new n(this),this.remember("_"+n.name,a)),a.active(e,t),this};/*!
|
|
181
|
+
* @svgdotjs/svg.resize.js - An extension for svg.js which allows to resize elements which are selected
|
|
182
|
+
* @version 2.0.4
|
|
183
|
+
* https://github.com/svgdotjs/svg.resize.js
|
|
184
|
+
*
|
|
185
|
+
* @copyright [object Object]
|
|
186
|
+
* @license MIT
|
|
187
|
+
*
|
|
188
|
+
* BUILT: Fri Sep 13 2024 12:43:14 GMT+0200 (Central European Summer Time)
|
|
189
|
+
*//*!
|
|
190
|
+
* @svgdotjs/svg.select.js - An extension of svg.js which allows to select elements with mouse
|
|
191
|
+
* @version 4.0.1
|
|
192
|
+
* https://github.com/svgdotjs/svg.select.js
|
|
193
|
+
*
|
|
194
|
+
* @copyright Ulrich-Matthias Schäfer
|
|
195
|
+
* @license MIT
|
|
196
|
+
*
|
|
197
|
+
* BUILT: Mon Jul 01 2024 15:04:42 GMT+0200 (Central European Summer Time)
|
|
198
|
+
*/function Yi(n,e,t,a=null){return function(i){i.preventDefault(),i.stopPropagation();var s=i.pageX||i.touches[0].pageX,r=i.pageY||i.touches[0].pageY;e.fire(n,{x:s,y:r,event:i,index:a,points:t})}}function Wi([n,e],{a:t,b:a,c:i,d:s,e:r,f:o}){return[n*t+e*i+r,n*a+e*s+o]}ae(Ve,{select:vr(br)}),ae([Ft,zt,Mt],{pointSelect:vr(class{constructor(n){this.el=n,n.remember("_pointSelectHandler",this),this.selection=new vt,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const e=ra();this.observer=new e.MutationObserver(this.mutationHandler)}init(n){this.createHandle=n.createHandle||this.createHandleFn,this.updateHandle=n.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(n,e){if(!n)return this.selection.clear().remove(),void this.observer.disconnect();this.init(e)}createSelection(){this.selection.polygon(this.points).addClass("svg_select_shape_pointSelect")}updateSelection(){this.selection.get(0).plot(this.points)}createPointHandles(){this.points.forEach((n,e,t)=>{this.createHandle.call(this,this.selection,n,e,t),this.selection.get(e+1).addClass("svg_select_handle_point").on("mousedown.selection touchstart.selection",Oi("point",this.el,this.points,e))})}createHandleFn(n){n.circle(5)}updateHandleFn(n,e){n.center(e[0],e[1])}updatePointHandles(){this.points.forEach((n,e,t)=>{this.updateHandle.call(this,this.selection.get(e+1),n,e,t)})}updatePoints(){const n=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.points=this.el.array().map(e=>Xi(e,n))}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updatePointHandles()}})});class yr{constructor(e){this.el=e,e.remember("_selectHandler",this),this.selection=new vt,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const t=ra();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,a)=>{const i=this.order[t];this.createHandle.call(this,this.selection,e,t,a,i),this.selection.get(t+1).addClass("svg_select_handle svg_select_handle_"+i).on("mousedown.selection touchstart.selection",Yi(i,this.el,this.handlePoints,t))})}createHandleFn(e){e.polyline()}updateHandleFn(e,t,a,i){const s=i.at(a-1),r=i[(a+1)%i.length],o=t,l=[o[0]-s[0],o[1]-s[1]],h=[o[0]-r[0],o[1]-r[1]],d=Math.sqrt(l[0]*l[0]+l[1]*l[1]),u=Math.sqrt(h[0]*h[0]+h[1]*h[1]),g=[l[0]/d,l[1]/d],p=[h[0]/u,h[1]/u],f=[o[0]-10*g[0],o[1]-10*g[1]],m=[o[0]-10*p[0],o[1]-10*p[1]];e.plot([f,o,m])}updateResizeHandles(){this.handlePoints.forEach((e,t,a)=>{const i=this.order[t];this.updateHandle.call(this,this.selection.get(t+1),e,t,a,i)})}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 a=this.getPoint("t");e.get(0).plot(a[0],a[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",Yi("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(a=>Wi(a,t)),this.rotationPoint=Wi(this.getRotationPoint(e),t)}getHandlePoints({x:e,x2:t,y:a,y2:i,cx:s,cy:r}=this.el.bbox()){return[[e,a],[s,a],[t,a],[t,r],[t,i],[s,i],[e,i],[e,r]]}getRotationPoint({y:e,cx:t}=this.el.bbox()){return[t,e-20]}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updateResizeHandles(),this.updateRotationHandle()}}const wr=n=>function(e=!0,t={}){typeof e=="object"&&(t=e,e=!0);let a=this.remember("_"+n.name);return a||(e.prototype instanceof yr?(a=new e(this),e=!0):a=new n(this),this.remember("_"+n.name,a)),a.active(e,t),this};ae(Ve,{select:wr(yr)}),ae([Ft,zt,Mt],{pointSelect:wr(class{constructor(n){this.el=n,n.remember("_pointSelectHandler",this),this.selection=new vt,this.order=["lt","t","rt","r","rb","b","lb","l","rot"],this.mutationHandler=this.mutationHandler.bind(this);const e=ra();this.observer=new e.MutationObserver(this.mutationHandler)}init(n){this.createHandle=n.createHandle||this.createHandleFn,this.updateHandle=n.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(n,e){if(!n)return this.selection.clear().remove(),void this.observer.disconnect();this.init(e)}createSelection(){this.selection.polygon(this.points).addClass("svg_select_shape_pointSelect")}updateSelection(){this.selection.get(0).plot(this.points)}createPointHandles(){this.points.forEach((n,e,t)=>{this.createHandle.call(this,this.selection,n,e,t),this.selection.get(e+1).addClass("svg_select_handle_point").on("mousedown.selection touchstart.selection",Yi("point",this.el,this.points,e))})}createHandleFn(n){n.circle(5)}updateHandleFn(n,e){n.center(e[0],e[1])}updatePointHandles(){this.points.forEach((n,e,t)=>{this.updateHandle.call(this,this.selection.get(e+1),n,e,t)})}updatePoints(){const n=this.el.parent().screenCTM().inverseO().multiplyO(this.el.screenCTM());this.points=this.el.array().map(e=>Wi(e,n))}mutationHandler(){this.updatePoints(),this.updateSelection(),this.updatePointHandles()}})});const Ha=n=>(n.changedTouches&&(n=n.changedTouches[0]),{x:n.clientX,y:n.clientY}),kr=n=>{let e=1/0,t=1/0,a=-1/0,i=-1/0;for(let s=0;s<n.length;s++){const r=n[s];e=Math.min(e,r[0]),t=Math.min(t,r[1]),a=Math.max(a,r[0]),i=Math.max(i,r[1])}return new Me(e,t,a-e,i-t)};class Cr{constructor(e){this.el=e,e.remember("_ResizeHandler",this),this.lastCoordinates=null,this.eventType="",this.lastEvent=null,this.handleResize=this.handleResize.bind(this),this.resize=this.resize.bind(this),this.endResize=this.endResize.bind(this),this.rotate=this.rotate.bind(this),this.movePoint=this.movePoint.bind(this)}active(e,t){this.preserveAspectRatio=t.preserveAspectRatio??!1,this.aroundCenter=t.aroundCenter??!1,this.grid=t.grid??0,this.degree=t.degree??0,this.el.off(".resize"),e&&(this.el.on(["lt.resize","rt.resize","rb.resize","lb.resize","t.resize","r.resize","b.resize","l.resize","rot.resize","point.resize"],this.handleResize),this.lastEvent&&(this.eventType==="rot"?this.rotate(this.lastEvent):this.eventType==="point"?this.movePoint(this.lastEvent):this.resize(this.lastEvent)))}handleResize(e){this.eventType=e.type;const{event:t,index:a,points:i}=e.detail,s=!t.type.indexOf("mouse");if(s&&(t.which||t.buttons)!==1||this.el.dispatch("beforeresize",{event:e,handler:this}).defaultPrevented)return;this.box=this.el.bbox(),this.startPoint=this.el.point(Ha(t)),this.index=a,this.points=i.slice();const r=(s?"mousemove":"touchmove")+".resize",o=(s?"mouseup":"touchcancel.resize touchend")+".resize";e.type==="point"?ut(window,r,this.movePoint):e.type==="rot"?ut(window,r,this.rotate):ut(window,r,this.resize),ut(window,o,this.endResize)}resize(e){this.lastEvent=e;const t=this.snapToGrid(this.el.point(Ha(e)));let a=t.x-this.startPoint.x,i=t.y-this.startPoint.y;this.preserveAspectRatio&&this.aroundCenter&&(a*=2,i*=2);const s=this.box.x+a,r=this.box.y+i,o=this.box.x2+a,l=this.box.y2+i;let h=new Me(this.box);if(this.eventType.includes("l")&&(h.x=Math.min(s,this.box.x2),h.x2=Math.max(s,this.box.x2)),this.eventType.includes("r")&&(h.x=Math.min(o,this.box.x),h.x2=Math.max(o,this.box.x)),this.eventType.includes("t")&&(h.y=Math.min(r,this.box.y2),h.y2=Math.max(r,this.box.y2)),this.eventType.includes("b")&&(h.y=Math.min(l,this.box.y),h.y2=Math.max(l,this.box.y)),h.width=h.x2-h.x,h.height=h.y2-h.y,this.preserveAspectRatio){const d=h.width/this.box.width,u=h.height/this.box.height,g=["lt","t","rt","r","rb","b","lb","l"],p=(g.indexOf(this.eventType)+4)%g.length,f=this.aroundCenter?[this.box.cx,this.box.cy]:this.points[p];let m=this.eventType.includes("t")||this.eventType.includes("b")?u:d;m=this.eventType.length===2?Math.max(d,u):m,h=function(x,b,v){const w=[[x.x,x.y],[x.x+x.width,x.y],[x.x+x.width,x.y+x.height],[x.x,x.y+x.height]].map(([k,y])=>{const E=k-b[0],S=(y-b[1])*v;return[E*v+b[0],S+b[1]]});return kr(w)}(this.box,f,m)}this.el.dispatch("resize",{box:new Me(h),angle:0,eventType:this.eventType,event:e,handler:this}).defaultPrevented||this.el.size(h.width,h.height).move(h.x,h.y)}movePoint(e){this.lastEvent=e;const{x:t,y:a}=this.snapToGrid(this.el.point(Ha(e))),i=this.el.array().slice();i[this.index]=[t,a],this.el.dispatch("resize",{box:kr(i),angle:0,eventType:this.eventType,event:e,handler:this}).defaultPrevented||this.el.plot(i)}rotate(e){this.lastEvent=e;const t=this.startPoint,a=this.el.point(Ha(e)),{cx:i,cy:s}=this.box,r=t.x-i,o=t.y-s,l=a.x-i,h=a.y-s,d=Math.sqrt(r*r+o*o)*Math.sqrt(l*l+h*h);if(d===0)return;let u=Math.acos((r*l+o*h)/d)/Math.PI*180;if(!u)return;a.x<t.x&&(u=-u);const g=new Q(this.el),{x:p,y:f}=new fe(i,s).transformO(g),{rotate:m}=g.decompose(),x=this.snapToAngle(m+u)-m;this.el.dispatch("resize",{box:this.box,angle:x,eventType:this.eventType,event:e,handler:this}).defaultPrevented||this.el.transform(g.rotateO(x,p,f))}endResize(e){this.eventType!=="rot"&&this.eventType!=="point"&&this.resize(e),this.lastEvent=null,this.eventType="",Je(window,"mousemove.resize touchmove.resize"),Je(window,"mouseup.resize touchend.resize")}snapToGrid(e){return this.grid&&(e.x=Math.round(e.x/this.grid)*this.grid,e.y=Math.round(e.y/this.grid)*this.grid),e}snapToAngle(e){return this.degree&&(e=Math.round(e/this.degree)*this.degree),e}}ae(Ve,{resize:function(n=!0,e={}){typeof n=="object"&&(e=n,n=!0);let t=this.remember("_ResizeHandler");return t||(n.prototype instanceof Cr?(t=new n(this),n=!0):t=new Cr(this),this.remember("_resizeHandler",t)),t.active(n,e),this}}),window.SVG===void 0&&(window.SVG=Do),window.Apex===void 0&&(window.Apex={});var Ar=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{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 Ot(this.ctx),this.ctx.axes=new Wo(this.ctx),this.ctx.core=new ml(this.ctx.el,this.ctx),this.ctx.config=new fa({}),this.ctx.data=new Pi(this.ctx),this.ctx.grid=new rr(this.ctx),this.ctx.graphics=new O(this.ctx),this.ctx.coreUtils=new Le(this.ctx),this.ctx.crosshairs=new Bi(this.ctx),this.ctx.events=new Xo(this.ctx),this.ctx.exports=new ma(this.ctx),this.ctx.fill=new lt(this.ctx),this.ctx.localization=new Yo(this.ctx),this.ctx.options=new Tt,this.ctx.responsive=new _o(this.ctx),this.ctx.series=new et(this.ctx),this.ctx.theme=new jo(this.ctx),this.ctx.formatters=new ga(this.ctx),this.ctx.titleSubtitle=new Go(this.ctx),this.ctx.legend=new or(this.ctx),this.ctx.toolbar=new lr(this.ctx),this.ctx.tooltip=new dr(this.ctx),this.ctx.dimensions=new Ia(this.ctx),this.ctx.updateHelpers=new xl(this.ctx),this.ctx.zoomPanSelection=new Jo(this.ctx),this.ctx.w.globals.tooltip=new dr(this.ctx)}}]),n}(),Sr=function(){function n(e){q(this,n),this.ctx=e,this.w=e.w}return Z(n,[{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,a=e.isUpdating,i=this.w.globals.dom.Paper.node;i.parentNode&&i.parentNode.parentNode&&!a&&(i.parentNode.parentNode.style.minHeight="unset");var s=this.w.globals.dom.baseEl;s&&this.ctx.eventList.forEach(function(o){s.removeEventListener(o,t.ctx.events.documentEvent)});var r=this.w.globals.dom;if(this.ctx.el!==null)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(r.Paper),r.Paper.remove(),r.elWrap=null,r.elGraphical=null,r.elLegendWrap=null,r.elLegendForeign=null,r.baseEl=null,r.elGridRect=null,r.elGridRectMask=null,r.elGridRectBarMask=null,r.elGridRectMarkerMask=null,r.elForecastMask=null,r.elNonForecastMask=null,r.elDefs=null}}]),n}(),_i=new WeakMap,Er=function(){function n(e,t){q(this,n),this.opts=t,this.ctx=this,this.w=new Oo(t).init(),this.el=e,this.w.globals.cuid=R.randomId(),this.w.globals.chartID=this.w.config.chart.id?R.escapeString(this.w.config.chart.id):this.w.globals.cuid,new Ar(this).initModules(),this.lastUpdateOptions=null,this.create=R.bind(this.create,this),this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this)}return Z(n,[{key:"render",value:function(){var e=this;return new Promise(function(t,a){if(R.elementExists(e.el)){Apex._chartInstances===void 0&&(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 i=e.w.config.chart.events.beforeMount;typeof i=="function"&&i(e,e.w),e.events.fireEvent("beforeMount",[e,e.w]),window.addEventListener("resize",e.windowResizeHandler),function(g,p){var f=!1;if(g.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var m=g.getBoundingClientRect();g.style.display!=="none"&&m.width!==0||(f=!0)}var x=new ResizeObserver(function(b){f&&p.call(g,b),f=!0});g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(g.children).forEach(function(b){return x.observe(b)}):x.observe(g),_i.set(p,x)}(e.el.parentNode,e.parentResizeHandler);var s=e.el.getRootNode&&e.el.getRootNode(),r=R.is("ShadowRoot",s),o=e.el.ownerDocument,l=r?s.getElementById("apexcharts-css"):o.getElementById("apexcharts-css");if(!l){var h;(l=document.createElement("style")).id="apexcharts-css",l.textContent=`@keyframes opaque {
|
|
199
|
+
0% {
|
|
200
|
+
opacity: 0
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
to {
|
|
204
|
+
opacity: 1
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@keyframes resizeanim {
|
|
209
|
+
|
|
210
|
+
0%,
|
|
211
|
+
to {
|
|
212
|
+
opacity: 0
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.apexcharts-canvas {
|
|
217
|
+
position: relative;
|
|
218
|
+
direction: ltr !important;
|
|
219
|
+
user-select: none
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.apexcharts-canvas ::-webkit-scrollbar {
|
|
223
|
+
-webkit-appearance: none;
|
|
224
|
+
width: 6px
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.apexcharts-canvas ::-webkit-scrollbar-thumb {
|
|
228
|
+
border-radius: 4px;
|
|
229
|
+
background-color: rgba(0, 0, 0, .5);
|
|
230
|
+
box-shadow: 0 0 1px rgba(255, 255, 255, .5);
|
|
231
|
+
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.apexcharts-inner {
|
|
235
|
+
position: relative
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.apexcharts-text tspan {
|
|
239
|
+
font-family: inherit
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
rect.legend-mouseover-inactive,
|
|
243
|
+
.legend-mouseover-inactive rect,
|
|
244
|
+
.legend-mouseover-inactive path,
|
|
245
|
+
.legend-mouseover-inactive circle,
|
|
246
|
+
.legend-mouseover-inactive line,
|
|
247
|
+
.legend-mouseover-inactive text.apexcharts-yaxis-title-text,
|
|
248
|
+
.legend-mouseover-inactive text.apexcharts-yaxis-label {
|
|
249
|
+
transition: .15s ease all;
|
|
250
|
+
opacity: .2
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.apexcharts-legend-text {
|
|
254
|
+
padding-left: 15px;
|
|
255
|
+
margin-left: -15px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.apexcharts-series-collapsed {
|
|
259
|
+
opacity: 0
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.apexcharts-tooltip {
|
|
263
|
+
border-radius: 5px;
|
|
264
|
+
box-shadow: 2px 2px 6px -4px #999;
|
|
265
|
+
cursor: default;
|
|
266
|
+
font-size: 14px;
|
|
267
|
+
left: 62px;
|
|
268
|
+
opacity: 0;
|
|
269
|
+
pointer-events: none;
|
|
270
|
+
position: absolute;
|
|
271
|
+
top: 20px;
|
|
272
|
+
display: flex;
|
|
273
|
+
flex-direction: column;
|
|
274
|
+
overflow: hidden;
|
|
275
|
+
white-space: nowrap;
|
|
276
|
+
z-index: 12;
|
|
277
|
+
transition: .15s ease all
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.apexcharts-tooltip.apexcharts-active {
|
|
281
|
+
opacity: 1;
|
|
282
|
+
transition: .15s ease all
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.apexcharts-tooltip.apexcharts-theme-light {
|
|
286
|
+
border: 1px solid #e3e3e3;
|
|
287
|
+
background: rgba(255, 255, 255, .96)
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.apexcharts-tooltip.apexcharts-theme-dark {
|
|
291
|
+
color: #fff;
|
|
292
|
+
background: rgba(30, 30, 30, .8)
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.apexcharts-tooltip * {
|
|
296
|
+
font-family: inherit
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.apexcharts-tooltip-title {
|
|
300
|
+
padding: 6px;
|
|
301
|
+
font-size: 15px;
|
|
302
|
+
margin-bottom: 4px
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {
|
|
306
|
+
background: #eceff1;
|
|
307
|
+
border-bottom: 1px solid #ddd
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {
|
|
311
|
+
background: rgba(0, 0, 0, .7);
|
|
312
|
+
border-bottom: 1px solid #333
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.apexcharts-tooltip-text-goals-value,
|
|
316
|
+
.apexcharts-tooltip-text-y-value,
|
|
317
|
+
.apexcharts-tooltip-text-z-value {
|
|
318
|
+
display: inline-block;
|
|
319
|
+
margin-left: 5px;
|
|
320
|
+
font-weight: 600
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.apexcharts-tooltip-text-goals-label:empty,
|
|
324
|
+
.apexcharts-tooltip-text-goals-value:empty,
|
|
325
|
+
.apexcharts-tooltip-text-y-label:empty,
|
|
326
|
+
.apexcharts-tooltip-text-y-value:empty,
|
|
327
|
+
.apexcharts-tooltip-text-z-value:empty,
|
|
328
|
+
.apexcharts-tooltip-title:empty {
|
|
329
|
+
display: none
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.apexcharts-tooltip-text-goals-label,
|
|
333
|
+
.apexcharts-tooltip-text-goals-value {
|
|
334
|
+
padding: 6px 0 5px
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.apexcharts-tooltip-goals-group,
|
|
338
|
+
.apexcharts-tooltip-text-goals-label,
|
|
339
|
+
.apexcharts-tooltip-text-goals-value {
|
|
340
|
+
display: flex
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.apexcharts-tooltip-text-goals-label:not(:empty),
|
|
344
|
+
.apexcharts-tooltip-text-goals-value:not(:empty) {
|
|
345
|
+
margin-top: -6px
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.apexcharts-tooltip-marker {
|
|
349
|
+
display: inline-block;
|
|
350
|
+
position: relative;
|
|
351
|
+
width: 16px;
|
|
352
|
+
height: 16px;
|
|
353
|
+
font-size: 16px;
|
|
354
|
+
line-height: 16px;
|
|
355
|
+
margin-right: 4px;
|
|
356
|
+
text-align: center;
|
|
357
|
+
vertical-align: middle;
|
|
358
|
+
color: inherit;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.apexcharts-tooltip-marker::before {
|
|
362
|
+
content: "";
|
|
363
|
+
display: inline-block;
|
|
364
|
+
width: 100%;
|
|
365
|
+
text-align: center;
|
|
366
|
+
color: currentcolor;
|
|
367
|
+
text-rendering: optimizeLegibility;
|
|
368
|
+
-webkit-font-smoothing: antialiased;
|
|
369
|
+
font-size: 26px;
|
|
370
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
371
|
+
line-height: 14px;
|
|
372
|
+
font-weight: 900;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.apexcharts-tooltip-marker[shape="circle"]::before {
|
|
376
|
+
content: "\\25CF";
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.apexcharts-tooltip-marker[shape="square"]::before,
|
|
380
|
+
.apexcharts-tooltip-marker[shape="rect"]::before {
|
|
381
|
+
content: "\\25A0";
|
|
382
|
+
transform: translate(-1px, -2px);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.apexcharts-tooltip-marker[shape="line"]::before {
|
|
386
|
+
content: "\\2500";
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.apexcharts-tooltip-marker[shape="diamond"]::before {
|
|
390
|
+
content: "\\25C6";
|
|
391
|
+
font-size: 28px;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.apexcharts-tooltip-marker[shape="triangle"]::before {
|
|
395
|
+
content: "\\25B2";
|
|
396
|
+
font-size: 22px;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.apexcharts-tooltip-marker[shape="cross"]::before {
|
|
400
|
+
content: "\\2715";
|
|
401
|
+
font-size: 18px;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.apexcharts-tooltip-marker[shape="plus"]::before {
|
|
405
|
+
content: "\\2715";
|
|
406
|
+
transform: rotate(45deg) translate(-1px, -1px);
|
|
407
|
+
font-size: 18px;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.apexcharts-tooltip-marker[shape="star"]::before {
|
|
411
|
+
content: "\\2605";
|
|
412
|
+
font-size: 18px;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.apexcharts-tooltip-marker[shape="sparkle"]::before {
|
|
416
|
+
content: "\\2726";
|
|
417
|
+
font-size: 20px;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.apexcharts-tooltip-series-group {
|
|
421
|
+
padding: 0 10px;
|
|
422
|
+
display: none;
|
|
423
|
+
text-align: left;
|
|
424
|
+
justify-content: left;
|
|
425
|
+
align-items: center
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {
|
|
429
|
+
opacity: 1
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.apexcharts-tooltip-series-group.apexcharts-active,
|
|
433
|
+
.apexcharts-tooltip-series-group:last-child {
|
|
434
|
+
padding-bottom: 4px
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.apexcharts-tooltip-y-group {
|
|
438
|
+
padding: 6px 0 5px
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.apexcharts-custom-tooltip,
|
|
442
|
+
.apexcharts-tooltip-box {
|
|
443
|
+
padding: 4px 8px
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.apexcharts-tooltip-boxPlot {
|
|
447
|
+
display: flex;
|
|
448
|
+
flex-direction: column-reverse
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.apexcharts-tooltip-box>div {
|
|
452
|
+
margin: 4px 0
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.apexcharts-tooltip-box span.value {
|
|
456
|
+
font-weight: 700
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.apexcharts-tooltip-rangebar {
|
|
460
|
+
padding: 5px 8px
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.apexcharts-tooltip-rangebar .category {
|
|
464
|
+
font-weight: 600;
|
|
465
|
+
color: #777
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.apexcharts-tooltip-rangebar .series-name {
|
|
469
|
+
font-weight: 700;
|
|
470
|
+
display: block;
|
|
471
|
+
margin-bottom: 5px
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.apexcharts-xaxistooltip,
|
|
475
|
+
.apexcharts-yaxistooltip {
|
|
476
|
+
opacity: 0;
|
|
477
|
+
pointer-events: none;
|
|
478
|
+
color: #373d3f;
|
|
479
|
+
font-size: 13px;
|
|
480
|
+
text-align: center;
|
|
481
|
+
border-radius: 2px;
|
|
482
|
+
position: absolute;
|
|
483
|
+
z-index: 10;
|
|
484
|
+
background: #eceff1;
|
|
485
|
+
border: 1px solid #90a4ae
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.apexcharts-xaxistooltip {
|
|
489
|
+
padding: 9px 10px;
|
|
490
|
+
transition: .15s ease all
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.apexcharts-xaxistooltip.apexcharts-theme-dark {
|
|
494
|
+
background: rgba(0, 0, 0, .7);
|
|
495
|
+
border: 1px solid rgba(0, 0, 0, .5);
|
|
496
|
+
color: #fff
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.apexcharts-xaxistooltip:after,
|
|
500
|
+
.apexcharts-xaxistooltip:before {
|
|
501
|
+
left: 50%;
|
|
502
|
+
border: solid transparent;
|
|
503
|
+
content: " ";
|
|
504
|
+
height: 0;
|
|
505
|
+
width: 0;
|
|
506
|
+
position: absolute;
|
|
507
|
+
pointer-events: none
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.apexcharts-xaxistooltip:after {
|
|
511
|
+
border-color: transparent;
|
|
512
|
+
border-width: 6px;
|
|
513
|
+
margin-left: -6px
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.apexcharts-xaxistooltip:before {
|
|
517
|
+
border-color: transparent;
|
|
518
|
+
border-width: 7px;
|
|
519
|
+
margin-left: -7px
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.apexcharts-xaxistooltip-bottom:after,
|
|
523
|
+
.apexcharts-xaxistooltip-bottom:before {
|
|
524
|
+
bottom: 100%
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.apexcharts-xaxistooltip-top:after,
|
|
528
|
+
.apexcharts-xaxistooltip-top:before {
|
|
529
|
+
top: 100%
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.apexcharts-xaxistooltip-bottom:after {
|
|
533
|
+
border-bottom-color: #eceff1
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.apexcharts-xaxistooltip-bottom:before {
|
|
537
|
+
border-bottom-color: #90a4ae
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after,
|
|
541
|
+
.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {
|
|
542
|
+
border-bottom-color: rgba(0, 0, 0, .5)
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.apexcharts-xaxistooltip-top:after {
|
|
546
|
+
border-top-color: #eceff1
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.apexcharts-xaxistooltip-top:before {
|
|
550
|
+
border-top-color: #90a4ae
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after,
|
|
554
|
+
.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {
|
|
555
|
+
border-top-color: rgba(0, 0, 0, .5)
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.apexcharts-xaxistooltip.apexcharts-active {
|
|
559
|
+
opacity: 1;
|
|
560
|
+
transition: .15s ease all
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.apexcharts-yaxistooltip {
|
|
564
|
+
padding: 4px 10px
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.apexcharts-yaxistooltip.apexcharts-theme-dark {
|
|
568
|
+
background: rgba(0, 0, 0, .7);
|
|
569
|
+
border: 1px solid rgba(0, 0, 0, .5);
|
|
570
|
+
color: #fff
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.apexcharts-yaxistooltip:after,
|
|
574
|
+
.apexcharts-yaxistooltip:before {
|
|
575
|
+
top: 50%;
|
|
576
|
+
border: solid transparent;
|
|
577
|
+
content: " ";
|
|
578
|
+
height: 0;
|
|
579
|
+
width: 0;
|
|
580
|
+
position: absolute;
|
|
581
|
+
pointer-events: none
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.apexcharts-yaxistooltip:after {
|
|
585
|
+
border-color: transparent;
|
|
586
|
+
border-width: 6px;
|
|
587
|
+
margin-top: -6px
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.apexcharts-yaxistooltip:before {
|
|
591
|
+
border-color: transparent;
|
|
592
|
+
border-width: 7px;
|
|
593
|
+
margin-top: -7px
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.apexcharts-yaxistooltip-left:after,
|
|
597
|
+
.apexcharts-yaxistooltip-left:before {
|
|
598
|
+
left: 100%
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.apexcharts-yaxistooltip-right:after,
|
|
602
|
+
.apexcharts-yaxistooltip-right:before {
|
|
603
|
+
right: 100%
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.apexcharts-yaxistooltip-left:after {
|
|
607
|
+
border-left-color: #eceff1
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.apexcharts-yaxistooltip-left:before {
|
|
611
|
+
border-left-color: #90a4ae
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after,
|
|
615
|
+
.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {
|
|
616
|
+
border-left-color: rgba(0, 0, 0, .5)
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.apexcharts-yaxistooltip-right:after {
|
|
620
|
+
border-right-color: #eceff1
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.apexcharts-yaxistooltip-right:before {
|
|
624
|
+
border-right-color: #90a4ae
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after,
|
|
628
|
+
.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {
|
|
629
|
+
border-right-color: rgba(0, 0, 0, .5)
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.apexcharts-yaxistooltip.apexcharts-active {
|
|
633
|
+
opacity: 1
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.apexcharts-yaxistooltip-hidden {
|
|
637
|
+
display: none
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.apexcharts-xcrosshairs,
|
|
641
|
+
.apexcharts-ycrosshairs {
|
|
642
|
+
pointer-events: none;
|
|
643
|
+
opacity: 0;
|
|
644
|
+
transition: .15s ease all
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.apexcharts-xcrosshairs.apexcharts-active,
|
|
648
|
+
.apexcharts-ycrosshairs.apexcharts-active {
|
|
649
|
+
opacity: 1;
|
|
650
|
+
transition: .15s ease all
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.apexcharts-ycrosshairs-hidden {
|
|
654
|
+
opacity: 0
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.apexcharts-selection-rect {
|
|
658
|
+
cursor: move
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.svg_select_shape {
|
|
662
|
+
stroke-width: 1;
|
|
663
|
+
stroke-dasharray: 10 10;
|
|
664
|
+
stroke: black;
|
|
665
|
+
stroke-opacity: 0.1;
|
|
666
|
+
pointer-events: none;
|
|
667
|
+
fill: none;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.svg_select_handle {
|
|
671
|
+
stroke-width: 3;
|
|
672
|
+
stroke: black;
|
|
673
|
+
fill: none;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.svg_select_handle_r {
|
|
677
|
+
cursor: e-resize;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.svg_select_handle_l {
|
|
681
|
+
cursor: w-resize;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.apexcharts-svg.apexcharts-zoomable.hovering-zoom {
|
|
685
|
+
cursor: crosshair
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.apexcharts-svg.apexcharts-zoomable.hovering-pan {
|
|
689
|
+
cursor: move
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.apexcharts-menu-icon,
|
|
693
|
+
.apexcharts-pan-icon,
|
|
694
|
+
.apexcharts-reset-icon,
|
|
695
|
+
.apexcharts-selection-icon,
|
|
696
|
+
.apexcharts-toolbar-custom-icon,
|
|
697
|
+
.apexcharts-zoom-icon,
|
|
698
|
+
.apexcharts-zoomin-icon,
|
|
699
|
+
.apexcharts-zoomout-icon {
|
|
700
|
+
cursor: pointer;
|
|
701
|
+
width: 20px;
|
|
702
|
+
height: 20px;
|
|
703
|
+
line-height: 24px;
|
|
704
|
+
color: #6e8192;
|
|
705
|
+
text-align: center
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.apexcharts-menu-icon svg,
|
|
709
|
+
.apexcharts-reset-icon svg,
|
|
710
|
+
.apexcharts-zoom-icon svg,
|
|
711
|
+
.apexcharts-zoomin-icon svg,
|
|
712
|
+
.apexcharts-zoomout-icon svg {
|
|
713
|
+
fill: #6e8192
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.apexcharts-selection-icon svg {
|
|
717
|
+
fill: #444;
|
|
718
|
+
transform: scale(.76)
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.apexcharts-theme-dark .apexcharts-menu-icon svg,
|
|
722
|
+
.apexcharts-theme-dark .apexcharts-pan-icon svg,
|
|
723
|
+
.apexcharts-theme-dark .apexcharts-reset-icon svg,
|
|
724
|
+
.apexcharts-theme-dark .apexcharts-selection-icon svg,
|
|
725
|
+
.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg,
|
|
726
|
+
.apexcharts-theme-dark .apexcharts-zoom-icon svg,
|
|
727
|
+
.apexcharts-theme-dark .apexcharts-zoomin-icon svg,
|
|
728
|
+
.apexcharts-theme-dark .apexcharts-zoomout-icon svg {
|
|
729
|
+
fill: #f3f4f5
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg,
|
|
733
|
+
.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,
|
|
734
|
+
.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {
|
|
735
|
+
fill: #008ffb
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.apexcharts-theme-light .apexcharts-menu-icon:hover svg,
|
|
739
|
+
.apexcharts-theme-light .apexcharts-reset-icon:hover svg,
|
|
740
|
+
.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,
|
|
741
|
+
.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,
|
|
742
|
+
.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,
|
|
743
|
+
.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg {
|
|
744
|
+
fill: #333
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.apexcharts-menu-icon,
|
|
748
|
+
.apexcharts-selection-icon {
|
|
749
|
+
position: relative
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.apexcharts-reset-icon {
|
|
753
|
+
margin-left: 5px
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.apexcharts-menu-icon,
|
|
757
|
+
.apexcharts-reset-icon,
|
|
758
|
+
.apexcharts-zoom-icon {
|
|
759
|
+
transform: scale(.85)
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
.apexcharts-zoomin-icon,
|
|
763
|
+
.apexcharts-zoomout-icon {
|
|
764
|
+
transform: scale(.7)
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.apexcharts-zoomout-icon {
|
|
768
|
+
margin-right: 3px
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
.apexcharts-pan-icon {
|
|
772
|
+
transform: scale(.62);
|
|
773
|
+
position: relative;
|
|
774
|
+
left: 1px;
|
|
775
|
+
top: 0
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
.apexcharts-pan-icon svg {
|
|
779
|
+
fill: #fff;
|
|
780
|
+
stroke: #6e8192;
|
|
781
|
+
stroke-width: 2
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
.apexcharts-pan-icon.apexcharts-selected svg {
|
|
785
|
+
stroke: #008ffb
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {
|
|
789
|
+
stroke: #333
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.apexcharts-toolbar {
|
|
793
|
+
position: absolute;
|
|
794
|
+
z-index: 11;
|
|
795
|
+
max-width: 176px;
|
|
796
|
+
text-align: right;
|
|
797
|
+
border-radius: 3px;
|
|
798
|
+
padding: 0 6px 2px;
|
|
799
|
+
display: flex;
|
|
800
|
+
justify-content: space-between;
|
|
801
|
+
align-items: center
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
.apexcharts-menu {
|
|
805
|
+
background: #fff;
|
|
806
|
+
position: absolute;
|
|
807
|
+
top: 100%;
|
|
808
|
+
border: 1px solid #ddd;
|
|
809
|
+
border-radius: 3px;
|
|
810
|
+
padding: 3px;
|
|
811
|
+
right: 10px;
|
|
812
|
+
opacity: 0;
|
|
813
|
+
min-width: 110px;
|
|
814
|
+
transition: .15s ease all;
|
|
815
|
+
pointer-events: none
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.apexcharts-menu.apexcharts-menu-open {
|
|
819
|
+
opacity: 1;
|
|
820
|
+
pointer-events: all;
|
|
821
|
+
transition: .15s ease all
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
.apexcharts-menu-item {
|
|
825
|
+
padding: 6px 7px;
|
|
826
|
+
font-size: 12px;
|
|
827
|
+
cursor: pointer
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.apexcharts-theme-light .apexcharts-menu-item:hover {
|
|
831
|
+
background: #eee
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.apexcharts-theme-dark .apexcharts-menu {
|
|
835
|
+
background: rgba(0, 0, 0, .7);
|
|
836
|
+
color: #fff
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
@media screen and (min-width:768px) {
|
|
840
|
+
.apexcharts-canvas:hover .apexcharts-toolbar {
|
|
841
|
+
opacity: 1
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
.apexcharts-canvas .apexcharts-element-hidden,
|
|
846
|
+
.apexcharts-datalabel.apexcharts-element-hidden,
|
|
847
|
+
.apexcharts-hide .apexcharts-series-points {
|
|
848
|
+
opacity: 0;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.apexcharts-hidden-element-shown {
|
|
852
|
+
opacity: 1;
|
|
853
|
+
transition: 0.25s ease all;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.apexcharts-datalabel,
|
|
857
|
+
.apexcharts-datalabel-label,
|
|
858
|
+
.apexcharts-datalabel-value,
|
|
859
|
+
.apexcharts-datalabels,
|
|
860
|
+
.apexcharts-pie-label {
|
|
861
|
+
cursor: default;
|
|
862
|
+
pointer-events: none
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
.apexcharts-pie-label-delay {
|
|
866
|
+
opacity: 0;
|
|
867
|
+
animation-name: opaque;
|
|
868
|
+
animation-duration: .3s;
|
|
869
|
+
animation-fill-mode: forwards;
|
|
870
|
+
animation-timing-function: ease
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.apexcharts-radialbar-label {
|
|
874
|
+
cursor: pointer;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
.apexcharts-annotation-rect,
|
|
878
|
+
.apexcharts-area-series .apexcharts-area,
|
|
879
|
+
.apexcharts-gridline,
|
|
880
|
+
.apexcharts-line,
|
|
881
|
+
.apexcharts-point-annotation-label,
|
|
882
|
+
.apexcharts-radar-series path:not(.apexcharts-marker),
|
|
883
|
+
.apexcharts-radar-series polygon,
|
|
884
|
+
.apexcharts-toolbar svg,
|
|
885
|
+
.apexcharts-tooltip .apexcharts-marker,
|
|
886
|
+
.apexcharts-xaxis-annotation-label,
|
|
887
|
+
.apexcharts-yaxis-annotation-label,
|
|
888
|
+
.apexcharts-zoom-rect,
|
|
889
|
+
.no-pointer-events {
|
|
890
|
+
pointer-events: none
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
.apexcharts-tooltip-active .apexcharts-marker {
|
|
894
|
+
transition: .15s ease all
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
.apexcharts-radar-series .apexcharts-yaxis {
|
|
898
|
+
pointer-events: none;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
.resize-triggers {
|
|
902
|
+
animation: 1ms resizeanim;
|
|
903
|
+
visibility: hidden;
|
|
904
|
+
opacity: 0;
|
|
905
|
+
height: 100%;
|
|
906
|
+
width: 100%;
|
|
907
|
+
overflow: hidden
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
.contract-trigger:before,
|
|
911
|
+
.resize-triggers,
|
|
912
|
+
.resize-triggers>div {
|
|
913
|
+
content: " ";
|
|
914
|
+
display: block;
|
|
915
|
+
position: absolute;
|
|
916
|
+
top: 0;
|
|
917
|
+
left: 0
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
.resize-triggers>div {
|
|
921
|
+
height: 100%;
|
|
922
|
+
width: 100%;
|
|
923
|
+
background: #eee;
|
|
924
|
+
overflow: auto
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
.contract-trigger:before {
|
|
928
|
+
overflow: hidden;
|
|
929
|
+
width: 200%;
|
|
930
|
+
height: 200%
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.apexcharts-bar-goals-markers {
|
|
934
|
+
pointer-events: none
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.apexcharts-bar-shadows {
|
|
938
|
+
pointer-events: none
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
.apexcharts-rangebar-goals-markers {
|
|
942
|
+
pointer-events: none
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.apexcharts-disable-transitions * {
|
|
946
|
+
transition: none !important;
|
|
947
|
+
}`;var d=((h=e.opts.chart)===null||h===void 0?void 0:h.nonce)||e.w.config.chart.nonce;d&&l.setAttribute("nonce",d),r?s.prepend(l):o.head.appendChild(l)}var u=e.create(e.w.config.series,{});if(!u)return t(e);e.mount(u).then(function(){typeof e.w.config.chart.events.mounted=="function"&&e.w.config.chart.events.mounted(e,e.w),e.events.fireEvent("mounted",[e,e.w]),t(u)}).catch(function(g){a(g)})}else a(new Error("Element not found"))})}},{key:"create",value:function(e,t){var a=this,i=this.w;new Ar(this).initModules();var s=this.w.globals;if(s.noData=!1,s.animationEnded=!1,!R.elementExists(this.el)||(this.responsive.checkResponsiveConfig(t),i.config.xaxis.convertedCatToNumeric&&new pa(i.config).convertCatToNumericXaxis(i.config,this.ctx),this.core.setupElements(),i.config.chart.type==="treemap"&&(i.config.grid.show=!1,i.config.yaxis[0].show=!1),s.svgWidth===0))return s.animationEnded=!0,null;var r=e;e.forEach(function(g,p){g.hidden&&(r=a.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:p}))});var o=Le.checkComboSeries(r,i.config.chart.type);s.comboCharts=o.comboCharts,s.comboBarCount=o.comboBarCount;var l=r.every(function(g){return g.data&&g.data.length===0});(r.length===0||l&&s.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(r),this.theme.init(),new Ut(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),s.noData&&s.collapsedSeries.length!==s.series.length&&!i.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),s.axisCharts&&(this.core.coreCalculations(),i.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=i.globals.minX,this.ctx.toolbar.maxX=i.globals.maxX),this.formatters.heatmapLabelFormatters(),new Le(this).getLargestMarkerSize(),this.dimensions.plotCoords();var h=this.core.xySettings();this.grid.createGridMask();var d=this.core.plotChartType(r,h),u=new qt(this);return u.bringForward(),i.config.dataLabels.background.enabled&&u.dataLabelsBackground(),this.core.shiftGraphPosition(),i.globals.dataPoints>50&&i.globals.dom.elWrap.classList.add("apexcharts-disable-transitions"),{elGraph:d,xyRatios:h,dimensions:{plot:{left:i.globals.translateX,top:i.globals.translateY,width:i.globals.gridWidth,height:i.globals.gridHeight}}}}},{key:"mount",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,a=this,i=a.w;return new Promise(function(s,r){if(a.el===null)return r(new Error("Not enough data to display or target element not found"));(t===null||i.globals.allSeriesCollapsed)&&a.series.handleNoData(),a.grid=new rr(a);var o,l,h=a.grid.drawGrid();if(a.annotations=new Ho(a),a.annotations.drawImageAnnos(),a.annotations.drawTextAnnos(),i.config.grid.position==="back"&&(h&&i.globals.dom.elGraphical.add(h.el),h!=null&&(o=h.elGridBorders)!==null&&o!==void 0&&o.node&&i.globals.dom.elGraphical.add(h.elGridBorders)),Array.isArray(t.elGraph))for(var d=0;d<t.elGraph.length;d++)i.globals.dom.elGraphical.add(t.elGraph[d]);else i.globals.dom.elGraphical.add(t.elGraph);i.config.grid.position==="front"&&(h&&i.globals.dom.elGraphical.add(h.el),h!=null&&(l=h.elGridBorders)!==null&&l!==void 0&&l.node&&i.globals.dom.elGraphical.add(h.elGridBorders)),i.config.xaxis.crosshairs.position==="front"&&a.crosshairs.drawXCrosshairs(),i.config.yaxis[0].crosshairs.position==="front"&&a.crosshairs.drawYCrosshairs(),i.config.chart.type!=="treemap"&&a.axes.drawAxis(i.config.chart.type,h);var u=new xa(e.ctx,h),g=new Ri(e.ctx,h);if(h!==null&&(u.xAxisLabelCorrections(h.xAxisTickWidth),g.setYAxisTextAlignments(),i.config.yaxis.map(function(f,m){i.globals.ignoreYAxisIndexes.indexOf(m)===-1&&g.yAxisTitleRotate(m,f.opposite)})),a.annotations.drawAxesAnnotations(),!i.globals.noData){if(i.config.tooltip.enabled&&!i.globals.noData&&a.w.globals.tooltip.drawTooltip(t.xyRatios),i.globals.axisCharts&&(i.globals.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.globals.isRangeBar))(i.config.chart.zoom.enabled||i.config.chart.selection&&i.config.chart.selection.enabled||i.config.chart.pan&&i.config.chart.pan.enabled)&&a.zoomPanSelection.init({xyRatios:t.xyRatios});else{var p=i.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(function(f){p[f]=!1})}i.config.chart.toolbar.show&&!i.globals.allSeriesCollapsed&&a.toolbar.createToolbar()}i.globals.memory.methodsToExec.length>0&&i.globals.memory.methodsToExec.forEach(function(f){f.method(f.params,!1,f.context)}),i.globals.axisCharts||i.globals.noData||a.core.resizeNonAxisCharts(),s(a)})}},{key:"destroy",value:function(){window.removeEventListener("resize",this.windowResizeHandler),function(t,a){var i=_i.get(a);i&&(i.disconnect(),_i.delete(a))}(this.el.parentNode,this.parentResizeHandler);var e=this.w.config.chart.id;e&&Apex._chartInstances.forEach(function(t,a){t.id===R.escapeString(e)&&Apex._chartInstances.splice(a,1)}),new Sr(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(e){var t=this,a=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],s=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],r=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],o=this.w;return o.globals.selection=void 0,this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(e)?this:(this.lastUpdateOptions=R.clone(e),e.series&&(this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map(function(l,h){return t.updateHelpers._extendSeries(l,h)})),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,a,i,s,r))}},{key:"updateSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],a=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(e,t,a)}},{key:"appendSeries",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],a=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],i=this.w.config.series.slice();return i.push(e),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(i,t,a)}},{key:"appendData",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],a=this;a.w.globals.dataChanged=!0,a.series.getPreviousPaths();for(var i=a.w.config.series.slice(),s=0;s<i.length;s++)if(e[s]!==null&&e[s]!==void 0)for(var r=0;r<e[s].data.length;r++)i[s].data.push(e[s].data[r]);return a.w.config.series=i,t&&(a.w.globals.initialSeries=R.clone(a.w.config.series)),this.update()}},{key:"update",value:function(e){var t=this;return new Promise(function(a,i){if(t.lastUpdateOptions&&JSON.stringify(t.lastUpdateOptions)===JSON.stringify(e))return a(t);t.lastUpdateOptions=R.clone(e),new Sr(t.ctx).clear({isUpdating:!0});var s=t.create(t.w.config.series,e);if(!s)return a(t);t.mount(s).then(function(){typeof t.w.config.chart.events.updated=="function"&&t.w.config.chart.events.updated(t,t.w),t.events.fireEvent("updated",[t,t.w]),t.w.globals.isDirty=!0,a(t)}).catch(function(r){i(r)})})}},{key:"getSyncedCharts",value:function(){var e=this.getGroupedCharts(),t=[this];return e.length&&(t=[],e.forEach(function(a){t.push(a)})),t}},{key:"getGroupedCharts",value:function(){var e=this;return Apex._chartInstances.filter(function(t){if(t.group)return!0}).map(function(t){return e.w.config.chart.group===t.group?t.chart:e})}},{key:"toggleSeries",value:function(e){return this.series.toggleSeries(e)}},{key:"highlightSeriesOnLegendHover",value:function(e,t){return this.series.toggleSeriesOnHover(e,t)}},{key:"showSeries",value:function(e){this.series.showSeries(e)}},{key:"hideSeries",value:function(e){this.series.hideSeries(e)}},{key:"highlightSeries",value:function(e){this.series.highlightSeries(e)}},{key:"isSeriesHidden",value:function(e){this.series.isSeriesHidden(e)}},{key:"resetSeries",value:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],t=!(arguments.length>1&&arguments[1]!==void 0)||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&&arguments[1]!==void 0)||arguments[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=this;a&&(i=a),i.annotations.addXaxisAnnotationExternal(e,t,i)}},{key:"addYaxisAnnotation",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=this;a&&(i=a),i.annotations.addYaxisAnnotationExternal(e,t,i)}},{key:"addPointAnnotation",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=this;a&&(i=a),i.annotations.addPointAnnotationExternal(e,t,i)}},{key:"clearAnnotations",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=this;e&&(t=e),t.annotations.clearAnnotations(t)}},{key:"removeAnnotation",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,a=this;t&&(a=t),a.annotations.removeAnnotation(a,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&&arguments[0]!==void 0?arguments[0]:0;return new Di(this.ctx).getMinYMaxY(e).highestY}},{key:"getLowestValueInSeries",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Di(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 ma(this.ctx).dataURI(e)}},{key:"getSvgString",value:function(e){return new ma(this.ctx).getSvgString(e)}},{key:"exportToCSV",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new ma(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;typeof e=="function"&&(e=e()),e&&this._windowResize()}}],[{key:"getChartByID",value:function(e){var t=R.escapeString(e);if(Apex._chartInstances){var a=Apex._chartInstances.filter(function(i){return i.id===t})[0];return a&&a.chart}}},{key:"initOnLoad",value:function(){for(var e=document.querySelectorAll("[data-apexcharts]"),t=0;t<e.length;t++)new n(e[t],JSON.parse(e[t].getAttribute("data-options"))).render()}},{key:"exec",value:function(e,t){var a=this.getChartByID(e);if(a){a.w.globals.isExecCalled=!0;var i=null;if(a.publicMethods.indexOf(t)!==-1){for(var s=arguments.length,r=new Array(s>2?s-2:0),o=2;o<s;o++)r[o-2]=arguments[o];i=a[t].apply(a,r)}return i}}},{key:"merge",value:function(e,t){return R.extend(e,t)}}]),n}();const Mr=["animationEnd","beforeMount","mounted","updated","click","mouseMove","mouseLeave","legendClick","markerClick","selection","dataPointSelection","dataPointMouseEnter","dataPointMouseLeave","beforeZoom","beforeResetZoom","zoomed","scrolled","brushScrolled"],Oa=c.defineComponent({name:"apexchart",props:{options:{type:Object},type:{type:String},series:{type:Array,required:!0},width:{default:"100%"},height:{default:"auto"}},emits:Mr,setup(n,{emit:e}){const t=c.ref(null),a=c.ref(null),i=A=>A&&typeof A=="object"&&!Array.isArray(A)&&A!=null,s=(A,M)=>{typeof Object.assign!="function"&&function(){Object.assign=function(z){if(z==null)throw new TypeError("Cannot convert undefined or null to object");let B=Object(z);for(let T=1;T<arguments.length;T++){let D=arguments[T];if(D!=null)for(let I in D)D.hasOwnProperty(I)&&(B[I]=D[I])}return B}}();let F=Object.assign({},A);return i(A)&&i(M)&&Object.keys(M).forEach(z=>{i(M[z])?z in A?F[z]=s(A[z],M[z]):Object.assign(F,{[z]:M[z]}):Object.assign(F,{[z]:M[z]})}),F},r=async()=>{if(await c.nextTick(),a.value)return;const A={chart:{type:n.type||n.options.chart.type||"line",height:n.height,width:n.width,events:{}},series:n.series},M=n.options.chart?n.options.chart.events:null;Mr.forEach(z=>{let B=(...T)=>e(z,...T);A.chart.events[z]=(...T)=>{B(...T),M&&M.hasOwnProperty(z)&&M[z](...T)}});const F=s(n.options,A);return a.value=new Er(t.value,F),a.value.render()},o=()=>(l(),r()),l=()=>{a.value.destroy(),a.value=null},h=(A,M)=>a.value.updateSeries(A,M),d=(A,M,F,z)=>a.value.updateOptions(A,M,F,z),u=A=>a.value.toggleSeries(A),g=A=>{a.value.showSeries(A)},p=A=>{a.value.hideSeries(A)},f=(A,M)=>a.value.appendSeries(A,M),m=()=>{a.value.resetSeries()},x=(A,M)=>{a.value.toggleDataPointSelection(A,M)},b=A=>a.value.appendData(A),v=(A,M)=>a.value.zoomX(A,M),w=A=>a.value.dataURI(A),k=A=>a.value.setLocale(A),y=(A,M)=>{a.value.addXaxisAnnotation(A,M)},E=(A,M)=>{a.value.addYaxisAnnotation(A,M)},S=(A,M)=>{a.value.addPointAnnotation(A,M)},C=(A,M)=>{a.value.removeAnnotation(A,M)},N=()=>{a.value.clearAnnotations()};c.onBeforeMount(()=>{window.ApexCharts=Er}),c.onMounted(()=>{t.value=c.getCurrentInstance().proxy.$el,r()}),c.onBeforeUnmount(()=>{a.value&&l()});const L=c.toRefs(n);return c.watch(L.options,()=>{!a.value&&n.options?r():a.value.updateOptions(n.options)}),c.watch(L.series,()=>{!a.value&&n.series?r():a.value.updateSeries(n.series)},{deep:!0}),c.watch(L.type,()=>{o()}),c.watch(L.width,()=>{o()}),c.watch(L.height,()=>{o()}),{chart:a,init:r,refresh:o,destroy:l,updateOptions:d,updateSeries:h,toggleSeries:u,showSeries:g,hideSeries:p,resetSeries:m,zoomX:v,toggleDataPointSelection:x,appendData:b,appendSeries:f,addXaxisAnnotation:y,addYaxisAnnotation:E,addPointAnnotation:S,removeAnnotation:C,clearAnnotations:N,setLocale:k,dataURI:w}},render(){return c.h("div",{class:"vue-apexcharts"})}}),vl=n=>{n.component(Oa.name,Oa)};Oa.install=vl;const yl={class:"vpg-chart-builder"},wl={class:"vpg-chart-type-bar"},kl=["title","onClick"],Cl={class:"vpg-icon",viewBox:"0 0 24 24",fill:"currentColor"},Al=["d"],Sl={class:"vpg-chart-type-label"},El={class:"vpg-chart-builder-content"},Ml={class:"vpg-chart-fields-panel"},Ll={class:"vpg-chart-fields-section"},Nl={class:"vpg-chart-fields-list"},Fl=["onDragstart"],zl={class:"vpg-field-name"},Tl={class:"vpg-field-type"},Pl={key:0,class:"vpg-chart-fields-empty"},Dl={class:"vpg-chart-fields-section"},Rl={class:"vpg-chart-fields-list"},Bl=["onDragstart"],Vl={class:"vpg-field-name"},Il={key:0,class:"vpg-chart-fields-empty"},Hl={class:"vpg-chart-config-panel"},Ol={class:"vpg-chart-drop-zone-wrapper"},Xl={class:"vpg-chart-zone-label"},Yl={class:"vpg-zone-field-name"},Wl=["value"],_l=["value"],jl={key:1,class:"vpg-zone-placeholder"},Gl={class:"vpg-chart-drop-zone-wrapper"},$l={class:"vpg-chart-zone-label"},Ul={class:"vpg-zone-field-name"},ql=["value"],Zl=["value"],Kl={key:1,class:"vpg-zone-placeholder"},Jl={key:0,class:"vpg-chart-drop-zone-wrapper"},Ql={class:"vpg-chart-zone-label"},ec={class:"vpg-zone-field-name"},tc=["value"],ac=["value"],ic={key:1,class:"vpg-zone-placeholder"},sc={key:1,class:"vpg-chart-drop-zone-wrapper"},rc={class:"vpg-zone-field-name"},nc=["value"],oc=["value"],lc={key:1,class:"vpg-zone-placeholder"},cc={class:"vpg-chart-guidance"},hc={class:"vpg-chart-preview-panel"},dc={key:0,class:"vpg-chart-container"},uc={key:1,class:"vpg-chart-empty-state"},gc={class:"vpg-icon-lg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},pc=["d"],fc={class:"vpg-chart-hint"},mc=c.defineComponent({__name:"ChartBuilder",props:{data:{},theme:{}},emits:["configChange"],setup(n,{emit:e}){const t=n,a=e,i=c.ref(nn()),s=c.computed(()=>en(t.data)),r=c.computed(()=>s.value.filter(T=>T.role==="dimension"||T.role==="temporal")),o=c.computed(()=>s.value.filter(T=>T.role==="measure")),l=c.ref(null),h=c.ref(null),d=c.ref(!1),u=c.computed(()=>an(i.value)),g=c.computed(()=>tn(i.value)),p=c.computed(()=>_a.find(T=>T.type===i.value.type)),f=c.computed(()=>{const T=i.value.type;switch(T){case"scatter":case"bubble":return{xAxis:"X-Axis (measure)",xAxisPlaceholder:"Drop a measure",yAxis:"Y-Axis (measure)",yAxisPlaceholder:"Drop a measure",series:"Color by (optional)",seriesPlaceholder:"Group points by dimension",showSize:T==="bubble",showSeries:!0};case"heatmap":return{xAxis:"X-Axis (dimension)",xAxisPlaceholder:"Drop a dimension",yAxis:"Y-Axis (dimension)",yAxisPlaceholder:"Drop a dimension",series:"Value / Intensity",seriesPlaceholder:"Drop a measure for color intensity",showSize:!1,showSeries:!0};case"pie":case"donut":return{xAxis:"Slices (dimension)",xAxisPlaceholder:"Drop a dimension",yAxis:"Values (measure)",yAxisPlaceholder:"Drop a measure",series:"",seriesPlaceholder:"",showSize:!1,showSeries:!1};case"radar":return{xAxis:"Axes (dimension)",xAxisPlaceholder:"Drop a dimension",yAxis:"Values (measure)",yAxisPlaceholder:"Drop a measure",series:"Compare by (optional)",seriesPlaceholder:"Group by dimension",showSize:!1,showSeries:!0};default:return{xAxis:"X-Axis (dimension)",xAxisPlaceholder:"Drop a dimension",yAxis:"Y-Axis (measure)",yAxisPlaceholder:"Drop a measure",series:"Color / Series (optional)",seriesPlaceholder:"Group by dimension",showSize:!1,showSeries:!0}}}),m=c.computed(()=>["scatter","bubble"].includes(i.value.type)),x=c.computed(()=>i.value.type==="heatmap");function b(T,D){var I;l.value=T,(I=D.dataTransfer)==null||I.setData("text/plain",T.field)}function v(){l.value=null,h.value=null}function w(T,D){D.preventDefault(),h.value=T}function k(){h.value=null}function y(T,D){if(D.preventDefault(),h.value=null,!l.value)return;const I=l.value,Y={field:I.field,label:I.label,role:I.role,aggregation:I.role==="measure"?"sum":void 0};switch(T){case"xAxis":i.value={...i.value,xAxis:Y};break;case"yAxis":i.value={...i.value,yAxis:Y};break;case"series":i.value={...i.value,seriesField:Y};break;case"size":i.value={...i.value,sizeField:Y};break;case"color":i.value={...i.value,colorField:Y};break}a("configChange",i.value)}function E(T){switch(T){case"xAxis":i.value={...i.value,xAxis:void 0};break;case"yAxis":i.value={...i.value,yAxis:void 0};break;case"series":i.value={...i.value,seriesField:void 0};break;case"size":i.value={...i.value,sizeField:void 0};break;case"color":i.value={...i.value,colorField:void 0};break}a("configChange",i.value)}function S(T){i.value={...i.value,type:T},d.value=!1,a("configChange",i.value)}function C(T,D){const I=T==="yAxis"?i.value.yAxis:i.value.sizeField;if(!I)return;const Y={...I,aggregation:D};T==="yAxis"?i.value={...i.value,yAxis:Y}:T==="size"&&(i.value={...i.value,sizeField:Y}),a("configChange",i.value)}const N=c.computed(()=>{const T=t.theme==="dark",D=i.value,I=D.options||{},Y={chart:{type:F(D.type),background:"transparent",foreColor:T?"#e2e8f0":"#334155",toolbar:{show:!0,tools:{download:!0,selection:!1,zoom:I.enableZoom??!1,zoomin:I.enableZoom??!1,zoomout:I.enableZoom??!1,pan:!1,reset:I.enableZoom??!1},export:{csv:{filename:"chart-data"},svg:{filename:"chart"},png:{filename:"chart"}}},animations:{enabled:I.animated??!0,speed:400,dynamicAnimation:{enabled:!0,speed:300}},fontFamily:"system-ui, -apple-system, sans-serif"},colors:I.colors||qi,theme:{mode:T?"dark":"light"},grid:{show:I.showGrid??!0,borderColor:T?"#334155":"#e2e8f0"},legend:{show:I.showLegend??!0,position:I.legendPosition||"top"},dataLabels:{enabled:I.showDataLabels??!1},tooltip:{theme:T?"dark":"light",style:{fontSize:"12px"},cssClass:T?"":"apexcharts-tooltip-light"},stroke:{curve:"smooth",width:D.type==="line"?3:D.type==="area"?2:0},fill:{opacity:D.type==="area"?.4:1}};return D.xAxis&&(Y.xaxis={...Y.xaxis,title:{text:I.xAxisTitle||D.xAxis.label},labels:{style:{colors:T?"#94a3b8":"#64748b"}}}),D.yAxis&&!["pie","donut","radar"].includes(D.type)&&(Y.yaxis={title:{text:I.yAxisTitle||D.yAxis.label},labels:{style:{colors:T?"#94a3b8":"#64748b"},formatter:$=>z($,I.valueFormat,I.decimals)}}),I.title&&(Y.title={text:I.title,style:{fontSize:"16px",fontWeight:600,color:T?"#e2e8f0":"#334155"}}),I.stacked&&["bar","area"].includes(D.type)&&(Y.chart.stacked=!0),(D.type==="pie"||D.type==="donut")&&(Y.plotOptions={pie:{donut:{size:D.type==="donut"?"55%":"0%",labels:{show:D.type==="donut",total:{show:!0,label:"Total",formatter:$=>{const K=$.globals.seriesTotals.reduce((ie,he)=>ie+he,0);return z(K,I.valueFormat,I.decimals)}}}}}}),D.type==="radar"&&(Y.plotOptions={radar:{polygons:{strokeColors:T?"#334155":"#e2e8f0",fill:{colors:T?["#1e293b","#0f172a"]:["#f8fafc","#f1f5f9"]}}}}),Y}),L=c.computed(()=>{var I;const T=i.value;return g.value?T.type==="pie"||T.type==="donut"?((I=Ji(t.data,T).series[0])==null?void 0:I.data)||[]:T.type==="scatter"||T.type==="bubble"?sn(t.data,T).series:T.type==="heatmap"?rn(t.data,T).series:Ki(t.data,T).series:[]}),A=c.computed(()=>{const T=i.value;return g.value?T.type==="pie"||T.type==="donut"?Ji(t.data,T).categories:Ki(t.data,T).categories:[]}),M=c.computed(()=>{const T={...N.value},D=i.value;return["pie","donut","scatter","bubble","heatmap"].includes(D.type)||(T.xaxis={...T.xaxis,categories:A.value}),(D.type==="pie"||D.type==="donut")&&(T.labels=A.value),D.type==="heatmap"&&(T.chart={...T.chart,type:"heatmap"},T.xaxis={...T.xaxis,type:"category"},T.dataLabels={enabled:!0,style:{colors:["#fff"],fontSize:"10px"},formatter:I=>I==null?"":typeof I!="number"?String(I):I>=1e6?`${(I/1e6).toFixed(1)}M`:I>=1e3?`${(I/1e3).toFixed(0)}K`:Math.round(I).toLocaleString()},T.plotOptions={heatmap:{shadeIntensity:.5,radius:2,enableShades:!0,colorScale:{inverse:!1}}},T.colors=["#6366f1"],T.legend={show:!1}),T});function F(T){return{bar:"bar",line:"line",area:"area",pie:"pie",donut:"donut",radar:"radar",scatter:"scatter",bubble:"bubble",heatmap:"heatmap"}[T]||"bar"}function z(T,D,I){if(T==null)return"";if(typeof T!="number")return String(T);if(Number.isNaN(T))return"";const Y=I??0;return D==="percent"?`${T.toFixed(Y)}%`:D==="currency"?`$${T.toLocaleString(void 0,{minimumFractionDigits:Y,maximumFractionDigits:Y})}`:Math.abs(T)>=1e3?T.toLocaleString(void 0,{maximumFractionDigits:Y}):T.toFixed(Y)}function B(T){const D={bar:"M3 3v18h18V3H3zm4 14H5v-6h2v6zm4 0H9V7h2v10zm4 0h-2V9h2v8zm4 0h-2v-4h2v4z",line:"M3.5 18.5l6-6 4 4 8-8M14.5 8.5h6v6",area:"M3 17l6-6 4 4 8-8v10H3z",pie:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8v8l5.66 5.66C14.28 19.04 13.18 20 12 20z",donut:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 14c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z",scatter:"M7 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm5-6a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm5 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm-3 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",bubble:"M7 14a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm5-5a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm5 7a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",heatmap:"M3 3h4v4H3V3zm6 0h4v4H9V3zm6 0h4v4h-4V3zM3 9h4v4H3V9zm6 0h4v4H9V9zm6 0h4v4h-4V9zM3 15h4v4H3v-4zm6 0h4v4H9v-4zm6 0h4v4h-4v-4z",radar:"M12 2L4 6v6c0 5.55 3.84 10.74 8 12 4.16-1.26 8-6.45 8-12V6l-8-4zm0 3.18l6 3v5.09c0 4.08-2.76 7.91-6 9.14V5.18z"};return D[T]||D.bar}return c.watch(()=>t.data,()=>{},{deep:!0}),c.onMounted(()=>{a("configChange",i.value)}),(T,D)=>{var I,Y,$,K,ie,he;return c.openBlock(),c.createElementBlock("div",yl,[c.createElementVNode("div",wl,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(_a),X=>(c.openBlock(),c.createElementBlock("button",{key:X.type,class:c.normalizeClass(["vpg-chart-type-btn",{active:i.value.type===X.type}]),title:X.description,onClick:ge=>S(X.type)},[(c.openBlock(),c.createElementBlock("svg",Cl,[c.createElementVNode("path",{d:B(X.type)},null,8,Al)])),c.createElementVNode("span",Sl,c.toDisplayString(X.label.replace(" Chart","")),1)],10,kl))),128))]),c.createElementVNode("div",El,[c.createElementVNode("div",Ml,[c.createElementVNode("div",Ll,[D[16]||(D[16]=c.createElementVNode("h4",{class:"vpg-chart-fields-title"},[c.createElementVNode("svg",{class:"vpg-icon-sm",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c.createElementVNode("path",{d:"M4 6h16M4 12h10M4 18h6"})]),c.createTextVNode(" Dimensions "),c.createElementVNode("span",{class:"vpg-chart-fields-hint"},"(text/date)")],-1)),c.createElementVNode("div",Nl,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(r.value,X=>(c.openBlock(),c.createElementBlock("div",{key:X.field,class:"vpg-chart-field-chip vpg-field-dimension",draggable:"true",onDragstart:ge=>b(X,ge),onDragend:v},[c.createElementVNode("span",zl,c.toDisplayString(X.label),1),c.createElementVNode("span",Tl,c.toDisplayString(X.role==="temporal"?"date":"text"),1)],40,Fl))),128)),r.value.length===0?(c.openBlock(),c.createElementBlock("div",Pl," No dimension fields detected ")):c.createCommentVNode("",!0)])]),c.createElementVNode("div",Dl,[D[18]||(D[18]=c.createElementVNode("h4",{class:"vpg-chart-fields-title"},[c.createElementVNode("svg",{class:"vpg-icon-sm",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c.createElementVNode("path",{d:"M16 8v8M12 11v5M8 14v2M4 4v16h16"})]),c.createTextVNode(" Measures "),c.createElementVNode("span",{class:"vpg-chart-fields-hint"},"(numbers)")],-1)),c.createElementVNode("div",Rl,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.value,X=>(c.openBlock(),c.createElementBlock("div",{key:X.field,class:"vpg-chart-field-chip vpg-field-measure",draggable:"true",onDragstart:ge=>b(X,ge),onDragend:v},[c.createElementVNode("span",Vl,c.toDisplayString(X.label),1),D[17]||(D[17]=c.createElementVNode("span",{class:"vpg-field-type"},"#",-1))],40,Bl))),128)),o.value.length===0?(c.openBlock(),c.createElementBlock("div",Il," No numeric fields detected ")):c.createCommentVNode("",!0)])])]),c.createElementVNode("div",Hl,[c.createElementVNode("div",Ol,[c.createElementVNode("label",Xl,c.toDisplayString(f.value.xAxis),1),c.createElementVNode("div",{class:c.normalizeClass(["vpg-chart-drop-zone",{"drag-over":h.value==="xAxis","has-field":i.value.xAxis}]),onDragover:D[2]||(D[2]=X=>w("xAxis",X)),onDragleave:k,onDrop:D[3]||(D[3]=X=>y("xAxis",X))},[i.value.xAxis?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("span",Yl,c.toDisplayString(i.value.xAxis.label),1),m.value&&i.value.xAxis.role==="measure"?(c.openBlock(),c.createElementBlock("select",{key:0,class:"vpg-zone-aggregation",value:i.value.xAxis.aggregation||"sum",onChange:D[0]||(D[0]=X=>C("xAxis",X.target.value))},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(wa),X=>(c.openBlock(),c.createElementBlock("option",{key:X.value,value:X.value},c.toDisplayString(X.symbol),9,_l))),128))],40,Wl)):c.createCommentVNode("",!0),c.createElementVNode("button",{class:"vpg-zone-remove-btn",onClick:D[1]||(D[1]=X=>E("xAxis"))},[...D[19]||(D[19]=[c.createElementVNode("svg",{class:"vpg-icon-xs",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])])],64)):(c.openBlock(),c.createElementBlock("span",jl,c.toDisplayString(f.value.xAxisPlaceholder),1))],34)]),c.createElementVNode("div",Gl,[c.createElementVNode("label",$l,c.toDisplayString(f.value.yAxis),1),c.createElementVNode("div",{class:c.normalizeClass(["vpg-chart-drop-zone",{"drag-over":h.value==="yAxis","has-field":i.value.yAxis}]),onDragover:D[6]||(D[6]=X=>w("yAxis",X)),onDragleave:k,onDrop:D[7]||(D[7]=X=>y("yAxis",X))},[i.value.yAxis?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("span",Ul,c.toDisplayString(i.value.yAxis.label),1),i.value.yAxis.role==="measure"&&!x.value?(c.openBlock(),c.createElementBlock("select",{key:0,class:"vpg-zone-aggregation",value:i.value.yAxis.aggregation||"sum",onChange:D[4]||(D[4]=X=>C("yAxis",X.target.value))},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(wa),X=>(c.openBlock(),c.createElementBlock("option",{key:X.value,value:X.value},c.toDisplayString(X.symbol),9,Zl))),128))],40,ql)):c.createCommentVNode("",!0),c.createElementVNode("button",{class:"vpg-zone-remove-btn",onClick:D[5]||(D[5]=X=>E("yAxis"))},[...D[20]||(D[20]=[c.createElementVNode("svg",{class:"vpg-icon-xs",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])])],64)):(c.openBlock(),c.createElementBlock("span",Kl,c.toDisplayString(f.value.yAxisPlaceholder),1))],34)]),f.value.showSeries?(c.openBlock(),c.createElementBlock("div",Jl,[c.createElementVNode("label",Ql,c.toDisplayString(f.value.series),1),c.createElementVNode("div",{class:c.normalizeClass(["vpg-chart-drop-zone vpg-zone-optional",{"drag-over":h.value==="series","has-field":i.value.seriesField||x.value&&i.value.colorField}]),onDragover:D[10]||(D[10]=X=>w(x.value?"color":"series",X)),onDragleave:k,onDrop:D[11]||(D[11]=X=>y(x.value?"color":"series",X))},[(x.value?i.value.colorField:i.value.seriesField)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("span",ec,c.toDisplayString(x.value?(I=i.value.colorField)==null?void 0:I.label:(Y=i.value.seriesField)==null?void 0:Y.label),1),x.value&&(($=i.value.colorField)==null?void 0:$.role)==="measure"?(c.openBlock(),c.createElementBlock("select",{key:0,class:"vpg-zone-aggregation",value:((K=i.value.colorField)==null?void 0:K.aggregation)||"sum",onChange:D[8]||(D[8]=X=>C("color",X.target.value))},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(wa),X=>(c.openBlock(),c.createElementBlock("option",{key:X.value,value:X.value},c.toDisplayString(X.symbol),9,ac))),128))],40,tc)):c.createCommentVNode("",!0),c.createElementVNode("button",{class:"vpg-zone-remove-btn",onClick:D[9]||(D[9]=X=>E(x.value?"color":"series"))},[...D[21]||(D[21]=[c.createElementVNode("svg",{class:"vpg-icon-xs",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])])],64)):(c.openBlock(),c.createElementBlock("span",ic,c.toDisplayString(f.value.seriesPlaceholder),1))],34)])):c.createCommentVNode("",!0),f.value.showSize?(c.openBlock(),c.createElementBlock("div",sc,[D[23]||(D[23]=c.createElementVNode("label",{class:"vpg-chart-zone-label"},"Size (number)",-1)),c.createElementVNode("div",{class:c.normalizeClass(["vpg-chart-drop-zone vpg-zone-optional",{"drag-over":h.value==="size","has-field":i.value.sizeField}]),onDragover:D[14]||(D[14]=X=>w("size",X)),onDragleave:k,onDrop:D[15]||(D[15]=X=>y("size",X))},[i.value.sizeField?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("span",rc,c.toDisplayString(i.value.sizeField.label),1),i.value.sizeField.role==="measure"?(c.openBlock(),c.createElementBlock("select",{key:0,class:"vpg-zone-aggregation",value:i.value.sizeField.aggregation||"sum",onChange:D[12]||(D[12]=X=>C("size",X.target.value))},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(wa),X=>(c.openBlock(),c.createElementBlock("option",{key:X.value,value:X.value},c.toDisplayString(X.symbol),9,oc))),128))],40,nc)):c.createCommentVNode("",!0),c.createElementVNode("button",{class:"vpg-zone-remove-btn",onClick:D[13]||(D[13]=X=>E("size"))},[...D[22]||(D[22]=[c.createElementVNode("svg",{class:"vpg-icon-xs",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])])],64)):(c.openBlock(),c.createElementBlock("span",lc,"Drop a number for bubble size"))],34)])):c.createCommentVNode("",!0),c.createElementVNode("div",cc,[D[24]||(D[24]=c.createElementVNode("svg",{class:"vpg-icon-sm",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[c.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),c.createElementVNode("path",{d:"M12 16v-4M12 8h.01"})],-1)),c.createElementVNode("span",null,c.toDisplayString(u.value),1)])]),c.createElementVNode("div",hc,[g.value?(c.openBlock(),c.createElementBlock("div",dc,[(c.openBlock(),c.createBlock(c.unref(Oa),{key:`${i.value.type}-${JSON.stringify(i.value.xAxis)}-${JSON.stringify(i.value.yAxis)}`,type:F(i.value.type),options:M.value,series:L.value,height:"100%"},null,8,["type","options","series"]))])):(c.openBlock(),c.createElementBlock("div",uc,[(c.openBlock(),c.createElementBlock("svg",gc,[c.createElementVNode("path",{d:B(i.value.type)},null,8,pc)])),D[25]||(D[25]=c.createElementVNode("h3",null,"Build your chart",-1)),D[26]||(D[26]=c.createElementVNode("p",null,"Drag fields from the left panel to configure your visualization",-1)),c.createElementVNode("div",fc,[c.createElementVNode("strong",null,c.toDisplayString((ie=p.value)==null?void 0:ie.label),1),c.createTextVNode(": "+c.toDisplayString((he=p.value)==null?void 0:he.description),1)])]))])])])}}}),xc={class:"vpg-range-filter"},bc={class:"vpg-range-info"},vc={class:"vpg-range-bounds"},yc={class:"vpg-slider-container"},wc={class:"vpg-slider-track"},kc=["min","max","step","value"],Cc=["min","max","step","value"],Ac={class:"vpg-range-inputs"},Sc={class:"vpg-input-group"},Ec=["placeholder","value","step"],Mc={class:"vpg-input-group"},Lc=["placeholder","value","step"],Nc={class:"vpg-range-actions"},Fc=["disabled"],zc={key:0,class:"vpg-filter-summary"},Tc=It(c.defineComponent({__name:"NumericRangeFilter",props:{dataMin:{},dataMax:{},currentRange:{}},emits:["change"],setup(n,{emit:e}){var v,w;const t=n,a=e,i=c.ref(((v=t.currentRange)==null?void 0:v.min)??null),s=c.ref(((w=t.currentRange)==null?void 0:w.max)??null),r=c.computed(()=>{const k=t.dataMax-t.dataMin;return k===0?1:k<=1?.01:k<=10?.1:k<=100?1:k<=1e3?10:10**(Math.floor(Math.log10(k))-2)});function o(k){return k===null?"":Number.isInteger(k)?k.toLocaleString():k.toLocaleString(void 0,{maximumFractionDigits:2})}const l=c.computed(()=>i.value!==null||s.value!==null),h=c.computed(()=>i.value===null||t.dataMax===t.dataMin?0:(i.value-t.dataMin)/(t.dataMax-t.dataMin)*100),d=c.computed(()=>s.value===null||t.dataMax===t.dataMin?100:(s.value-t.dataMin)/(t.dataMax-t.dataMin)*100);function u(k){const y=k.target,E=Number.parseFloat(y.value);s.value!==null&&E>s.value?i.value=s.value:i.value=E}function g(k){const y=k.target,E=Number.parseFloat(y.value);i.value!==null&&E<i.value?s.value=i.value:s.value=E}function p(k){const y=k.target,E=y.value===""?null:Number.parseFloat(y.value);E!==null&&!Number.isNaN(E)?i.value=Math.max(t.dataMin,Math.min(E,s.value??t.dataMax)):E===null&&(i.value=null)}function f(k){const y=k.target,E=y.value===""?null:Number.parseFloat(y.value);E!==null&&!Number.isNaN(E)?s.value=Math.min(t.dataMax,Math.max(E,i.value??t.dataMin)):E===null&&(s.value=null)}function m(){i.value=null,s.value=null,b()}function x(){i.value=t.dataMin,s.value=t.dataMax,b()}function b(){i.value===null&&s.value===null?a("change",null):a("change",{min:i.value,max:s.value})}return c.watch(()=>t.currentRange,k=>{i.value=(k==null?void 0:k.min)??null,s.value=(k==null?void 0:k.max)??null},{immediate:!0}),(k,y)=>(c.openBlock(),c.createElementBlock("div",xc,[c.createElementVNode("div",bc,[y[0]||(y[0]=c.createElementVNode("span",{class:"vpg-range-label"},"Data range:",-1)),c.createElementVNode("span",vc,c.toDisplayString(o(n.dataMin))+" – "+c.toDisplayString(o(n.dataMax)),1)]),c.createElementVNode("div",yc,[c.createElementVNode("div",wc,[c.createElementVNode("div",{class:"vpg-slider-fill",style:c.normalizeStyle({left:`${h.value}%`,right:`${100-d.value}%`})},null,4)]),c.createElementVNode("input",{type:"range",class:"vpg-slider vpg-slider-min",min:n.dataMin,max:n.dataMax,step:r.value,value:i.value??n.dataMin,onInput:u,onChange:b},null,40,kc),c.createElementVNode("input",{type:"range",class:"vpg-slider vpg-slider-max",min:n.dataMin,max:n.dataMax,step:r.value,value:s.value??n.dataMax,onInput:g,onChange:b},null,40,Cc)]),c.createElementVNode("div",Ac,[c.createElementVNode("div",Sc,[y[1]||(y[1]=c.createElementVNode("label",{class:"vpg-input-label"},"Min",-1)),c.createElementVNode("input",{type:"number",class:"vpg-range-input",placeholder:o(n.dataMin),value:i.value??"",step:r.value,onInput:p,onChange:b},null,40,Ec)]),y[3]||(y[3]=c.createElementVNode("span",{class:"vpg-input-separator"},"to",-1)),c.createElementVNode("div",Mc,[y[2]||(y[2]=c.createElementVNode("label",{class:"vpg-input-label"},"Max",-1)),c.createElementVNode("input",{type:"number",class:"vpg-range-input",placeholder:o(n.dataMax),value:s.value??"",step:r.value,onInput:f,onChange:b},null,40,Lc)])]),c.createElementVNode("div",Nc,[c.createElementVNode("button",{class:"vpg-range-btn",disabled:!l.value,onClick:m},[...y[4]||(y[4]=[c.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),c.createTextVNode(" Clear ",-1)])],8,Fc),c.createElementVNode("button",{class:"vpg-range-btn",onClick:x},[...y[5]||(y[5]=[c.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})],-1),c.createTextVNode(" Full Range ",-1)])])]),l.value?(c.openBlock(),c.createElementBlock("div",zc,[y[7]||(y[7]=c.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})],-1)),c.createElementVNode("span",null,[y[6]||(y[6]=c.createTextVNode(" Showing values ",-1)),c.createElementVNode("strong",null,c.toDisplayString(i.value!==null?`≥ ${o(i.value)}`:""),1),c.createTextVNode(" "+c.toDisplayString(i.value!==null&&s.value!==null?" and ":"")+" ",1),c.createElementVNode("strong",null,c.toDisplayString(s.value!==null?`≤ ${o(s.value)}`:""),1)])])):c.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-8d673357"]]),Pc={class:"vpg-filter-header"},Dc={class:"vpg-filter-title"},Rc={class:"vpg-filter-count"},Bc={class:"vpg-sort-controls"},Vc=["title"],Ic=["title"],Hc={key:0,class:"vpg-filter-tabs"},Oc={class:"vpg-search-container"},Xc={class:"vpg-values-list"},Yc=["checked","onChange"],Wc={key:0,class:"vpg-no-results"},Lr=It(c.defineComponent({__name:"ColumnFilter",props:{columnId:{},columnName:{},stats:{},selectedValues:{},sortDirection:{},numericRange:{}},emits:["filter","sort","close","rangeFilter"],setup(n,{emit:e}){const t=n,a=e,i=c.ref(""),s=c.ref(),r=c.ref(),o=c.computed(()=>t.stats.type==="number"&&t.stats.numericMin!==void 0&&t.stats.numericMax!==void 0),l=c.ref(t.numericRange?"range":"values"),h=c.ref(t.numericRange??null);c.computed(()=>{const A=[...t.stats.uniqueValues];return t.stats.nullCount>0&&A.unshift("(blank)"),A});const d=c.ref(new Set(t.selectedValues)),u=c.computed(()=>t.stats.nullCount>0),g=c.computed(()=>{const A=t.stats.uniqueValues;if(!i.value)return A;const M=i.value.toLowerCase();return A.filter(F=>F.toLowerCase().includes(M))}),p=c.computed(()=>{const A=[...g.value];return u.value&&(!i.value||"(blank)".includes(i.value.toLowerCase()))&&A.unshift("(blank)"),A});c.computed(()=>p.value.every(A=>d.value.has(A))),c.computed(()=>d.value.size===0);function f(A){d.value.has(A)?d.value.delete(A):d.value.add(A),d.value=new Set(d.value)}function m(){for(const A of p.value)d.value.add(A);d.value=new Set(d.value)}function x(){d.value.clear(),d.value=new Set(d.value)}function b(){d.value.size===0?a("filter",[]):a("filter",Array.from(d.value)),a("close")}function v(){a("sort",t.sortDirection==="asc"?null:"asc")}function w(){a("sort",t.sortDirection==="desc"?null:"desc")}function k(){d.value.clear(),d.value=new Set(d.value),a("filter",[]),a("close")}function y(A){h.value=A}function E(){a("rangeFilter",h.value),a("close")}function S(){h.value=null,a("rangeFilter",null),a("close")}function C(A){l.value=A}function N(A){s.value&&!s.value.contains(A.target)&&a("close")}function L(A){A.key==="Escape"?a("close"):A.key==="Enter"&&A.ctrlKey&&b()}return c.onMounted(()=>{c.nextTick(()=>{var A;(A=r.value)==null||A.focus()}),document.addEventListener("mousedown",N),document.addEventListener("keydown",L)}),c.onUnmounted(()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",L)}),c.watch(()=>t.selectedValues,A=>{d.value=new Set(A)},{immediate:!0}),c.watch(()=>t.numericRange,A=>{h.value=A??null,A&&(l.value="range")},{immediate:!0}),(A,M)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"dropdownRef",ref:s,class:"vpg-filter-dropdown"},[c.createElementVNode("div",Pc,[c.createElementVNode("span",Dc,c.toDisplayString(n.columnName),1),c.createElementVNode("span",Rc,c.toDisplayString(n.stats.uniqueValues.length.toLocaleString())+" unique ",1)]),c.createElementVNode("div",Bc,[c.createElementVNode("button",{class:c.normalizeClass(["vpg-sort-btn",{active:n.sortDirection==="asc"}]),title:o.value?"Sort Low to High":"Sort A to Z",onClick:v},[M[4]||(M[4]=c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})],-1)),c.createElementVNode("span",null,c.toDisplayString(o.value?"1→9":"A→Z"),1)],10,Vc),c.createElementVNode("button",{class:c.normalizeClass(["vpg-sort-btn",{active:n.sortDirection==="desc"}]),title:o.value?"Sort High to Low":"Sort Z to A",onClick:w},[M[5]||(M[5]=c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4"})],-1)),c.createElementVNode("span",null,c.toDisplayString(o.value?"9→1":"Z→A"),1)],10,Ic)]),M[11]||(M[11]=c.createElementVNode("div",{class:"vpg-divider"},null,-1)),o.value?(c.openBlock(),c.createElementBlock("div",Hc,[c.createElementVNode("button",{class:c.normalizeClass(["vpg-tab-btn",{active:l.value==="values"}]),onClick:M[0]||(M[0]=F=>C("values"))},[...M[6]||(M[6]=[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})],-1),c.createTextVNode(" Values ",-1)])],2),c.createElementVNode("button",{class:c.normalizeClass(["vpg-tab-btn",{active:l.value==="range"}]),onClick:M[1]||(M[1]=F=>C("range"))},[...M[7]||(M[7]=[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"})],-1),c.createTextVNode(" Range ",-1)])],2)])):c.createCommentVNode("",!0),!o.value||l.value==="values"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createElementVNode("div",Oc,[M[8]||(M[8]=c.createElementVNode("svg",{class:"vpg-search-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),c.withDirectives(c.createElementVNode("input",{ref_key:"searchInputRef",ref:r,"onUpdate:modelValue":M[2]||(M[2]=F=>i.value=F),type:"text",placeholder:"Search values...",class:"vpg-search-input"},null,512),[[c.vModelText,i.value]]),i.value?(c.openBlock(),c.createElementBlock("button",{key:0,class:"vpg-clear-search",onClick:M[3]||(M[3]=F=>i.value="")}," × ")):c.createCommentVNode("",!0)]),c.createElementVNode("div",{class:"vpg-bulk-actions"},[c.createElementVNode("button",{class:"vpg-bulk-btn",onClick:m},[...M[9]||(M[9]=[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),c.createTextVNode(" Select All ",-1)])]),c.createElementVNode("button",{class:"vpg-bulk-btn",onClick:x},[...M[10]||(M[10]=[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),c.createTextVNode(" Clear All ",-1)])])]),c.createElementVNode("div",Xc,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p.value,F=>(c.openBlock(),c.createElementBlock("label",{key:F,class:c.normalizeClass(["vpg-value-item",{selected:d.value.has(F)}])},[c.createElementVNode("input",{type:"checkbox",checked:d.value.has(F),class:"vpg-value-checkbox",onChange:z=>f(F)},null,40,Yc),c.createElementVNode("span",{class:c.normalizeClass(["vpg-value-text",{"vpg-blank":F==="(blank)"}])},c.toDisplayString(F),3)],2))),128)),p.value.length===0?(c.openBlock(),c.createElementBlock("div",Wc," No matching values ")):c.createCommentVNode("",!0)]),c.createElementVNode("div",{class:"vpg-filter-footer"},[c.createElementVNode("button",{class:"vpg-btn-clear",onClick:k}," Clear Filter "),c.createElementVNode("button",{class:"vpg-btn-apply",onClick:b}," Apply ")])],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[c.createVNode(Tc,{"data-min":n.stats.numericMin,"data-max":n.stats.numericMax,"current-range":h.value,onChange:y},null,8,["data-min","data-max","current-range"]),c.createElementVNode("div",{class:"vpg-filter-footer"},[c.createElementVNode("button",{class:"vpg-btn-clear",onClick:S}," Clear Filter "),c.createElementVNode("button",{class:"vpg-btn-apply",onClick:E}," Apply ")])],64))],512))}}),[["__scopeId","data-v-6c8a1b76"]]),Nr=(n,e,t)=>{if(!t)return!0;if(Sa(t)){const a=n.getValue(e);if(a==null||a==="")return!1;const i=typeof a=="number"?a:Number.parseFloat(String(a));if(Number.isNaN(i))return!1;const{min:s,max:r}=t;return!(s!==null&&i<s||r!==null&&i>r)}if(Array.isArray(t)&&t.length>0){const a=n.getValue(e),i=a==null||a===""?"(blank)":String(a);return t.includes(i)}return!0};function Fr(n){const{data:e,enableSorting:t=!0,enableFiltering:a=!0}=n,i=c.ref([]),s=c.ref([]),r=c.ref({}),o=c.ref(""),l=c.ref({}),h=c.computed(()=>e.value.length===0?[]:Object.keys(e.value[0]));function d(N){const L=`${N}-${e.value.length}`;return l.value[L]||(l.value[L]=as(e.value,N)),l.value[L]}function u(){l.value={}}const g=c.computed(()=>h.value.map(N=>{const L=d(N);return{id:N,accessorKey:N,header:N,cell:A=>is(A.getValue(),L.type),filterFn:Nr,meta:{type:L.type,uniqueCount:L.uniqueValues.length}}})),p=ya.useVueTable({get data(){return e.value},get columns(){return g.value},state:{get sorting(){return i.value},get columnFilters(){return s.value},get columnVisibility(){return r.value},get globalFilter(){return o.value}},onSortingChange:N=>{i.value=typeof N=="function"?N(i.value):N},onColumnFiltersChange:N=>{s.value=typeof N=="function"?N(s.value):N},getCoreRowModel:ya.getCoreRowModel(),getSortedRowModel:t?ya.getSortedRowModel():void 0,getFilteredRowModel:a?ya.getFilteredRowModel():void 0,filterFns:{multiSelect:Nr},enableSorting:t,enableFilters:a}),f=c.computed(()=>p.getFilteredRowModel().rows.length),m=c.computed(()=>e.value.length),x=c.computed(()=>s.value.map(N=>{const L=N.value;return L&&Sa(L)?{column:N.id,type:"range",range:L,values:[]}:{column:N.id,type:"values",values:Array.isArray(L)?L:[],range:null}}));function b(N){const L=p.getColumn(N);if(!L)return!1;const A=L.getFilterValue();return A?Sa(A)?A.min!==null||A.max!==null:Array.isArray(A)&&A.length>0:!1}function v(N,L){const A=p.getColumn(N);A&&(A.setFilterValue(L.length===0?void 0:L),s.value=p.getState().columnFilters)}function w(N,L){const A=p.getColumn(N);A&&(!L||L.min===null&&L.max===null?A.setFilterValue(void 0):A.setFilterValue(L),s.value=p.getState().columnFilters)}function k(N){const L=p.getColumn(N);if(!L)return null;const A=L.getFilterValue();return A&&Sa(A)?A:null}function y(){p.resetColumnFilters(),o.value="",s.value=[]}function E(N){const L=p.getColumn(N);if(!L)return[];const A=L.getFilterValue();return Array.isArray(A)?A:[]}function S(N){const L=i.value.find(A=>A.id===N);L?L.desc?i.value=[]:i.value=[{id:N,desc:!0}]:i.value=[{id:N,desc:!1}]}function C(N){const L=i.value.find(A=>A.id===N);return L?L.desc?"desc":"asc":null}return c.watch(e,()=>{u()}),{table:p,sorting:i,columnFilters:s,columnVisibility:r,globalFilter:o,columnKeys:h,filteredRowCount:f,totalRowCount:m,activeFilters:x,getColumnStats:d,clearStatsCache:u,hasActiveFilter:b,setColumnFilter:v,getColumnFilterValues:E,clearAllFilters:y,toggleSort:S,getSortDirection:C,setNumericRangeFilter:w,getNumericRangeFilter:k}}function zr(n,e,t){on(n,e,t)}function Tr(n,e,t,a,i){ln(n,e,t,a,i)}function Pr(n,e,t){cn(n,e,t)}function Dr(n,e,t){return hn(n,e,t)}function _c(n,e={}){const t=c.ref(e.pageSize??50),a=c.ref(e.currentPage??1),i=c.computed(()=>Math.max(1,Math.ceil(n.value.length/t.value))),s=c.computed(()=>{const f=(a.value-1)*t.value,m=f+t.value;return n.value.slice(f,m)}),r=c.computed(()=>(a.value-1)*t.value+1),o=c.computed(()=>Math.min(a.value*t.value,n.value.length));function l(f){a.value=Math.max(1,Math.min(f,i.value))}function h(){a.value<i.value&&a.value++}function d(){a.value>1&&a.value--}function u(){a.value=1}function g(){a.value=i.value}function p(f){t.value=f,a.value=1}return{pageSize:t,currentPage:a,totalPages:i,paginatedData:s,startIndex:r,endIndex:o,goToPage:l,nextPage:h,prevPage:d,firstPage:u,lastPage:g,setPageSize:p}}function jc(n,e){const t=c.ref(""),a=c.ref(!1),i=c.computed(()=>{if(!t.value.trim())return n.value;const r=a.value?t.value.trim():t.value.trim().toLowerCase();return n.value.filter(o=>{for(const l of e.value){const h=o[l];if(h==null)continue;if((a.value?String(h):String(h).toLowerCase()).includes(r))return!0}return!1})});function s(){t.value=""}return{searchTerm:t,caseSensitive:a,filteredData:i,clearSearch:s}}function Gc(n){const e=c.ref(new Set),t=c.computed(()=>Array.from(e.value).sort((p,f)=>p-f).map(p=>n.value[p]).filter(Boolean)),a=c.computed(()=>n.value.length>0&&e.value.size===n.value.length),i=c.computed(()=>e.value.size>0&&e.value.size<n.value.length);function s(p){e.value.has(p)?e.value.delete(p):e.value.add(p),e.value=new Set(e.value)}function r(p){e.value.add(p),e.value=new Set(e.value)}function o(p){e.value.delete(p),e.value=new Set(e.value)}function l(){e.value=new Set(n.value.map((p,f)=>f))}function h(){e.value=new Set}function d(){a.value?h():l()}function u(p){return e.value.has(p)}function g(p,f){const m=Math.min(p,f),x=Math.max(p,f);for(let b=m;b<=x;b++)e.value.add(b);e.value=new Set(e.value)}return{selectedRowIndices:e,selectedRows:t,allSelected:a,someSelected:i,toggleRow:s,selectRow:r,deselectRow:o,selectAll:l,deselectAll:h,toggleAll:d,isSelected:u,selectRange:g}}function $c(n,e=60,t=600){const a=c.ref({...n.value}),i=c.ref(!1),s=c.ref(null);function r(h,d){i.value=!0,s.value=h;const u=d.clientX,g=a.value[h]||150,p=m=>{const x=m.clientX-u,b=Math.max(e,Math.min(t,g+x));a.value={...a.value,[h]:b}},f=()=>{i.value=!1,s.value=null,document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f)};document.addEventListener("mousemove",p),document.addEventListener("mouseup",f)}function o(h){n.value[h]&&(a.value={...a.value,[h]:n.value[h]})}function l(){a.value={...n.value}}return{columnWidths:a,isResizing:i,resizingColumn:s,startResize:r,resetColumnWidth:o,resetAllWidths:l}}const Uc=c.ref(null),wt=c.ref(!1),tt=c.ref(wn());let ji=null;async function qc(n){Uc.value=n,ji=mn(n),tt.value=await ji,ji=null,tt.value.isValid?tt.value.type!=="free"&&console.info(`[TinyPivot] Pro license activated (${tt.value.type})`):console.warn("[TinyPivot] Invalid or expired license key. Running in free mode.")}async function Zc(n){const e=await yn(n);return e?(wt.value=!0,tt.value=e,console.info("[TinyPivot] Demo mode enabled - all Pro features unlocked for evaluation"),!0):(console.warn("[TinyPivot] Demo mode activation failed - invalid secret"),!1)}function Kc(n){xn()}function ba(){const n=c.computed(()=>wt.value),e=c.computed(()=>wt.value||An(tt.value)),t=c.computed(()=>wt.value||kn(tt.value)),a=c.computed(()=>wt.value||tt.value.features.advancedAggregations),i=c.computed(()=>wt.value||tt.value.features.percentageMode),s=c.computed(()=>wt.value||Cn(tt.value)),r=c.computed(()=>Sn(tt.value,wt.value));function o(l){return e.value?!0:(En(l),!1)}return{licenseInfo:c.computed(()=>tt.value),isDemo:n,isPro:e,canUsePivot:t,canUseAdvancedAggregations:a,canUsePercentageMode:i,canUseCharts:s,showWatermark:r,requirePro:o}}function Rr(n){const{canUsePivot:e,requirePro:t}=ba(),a=c.ref([]),i=c.ref([]),s=c.ref([]),r=c.ref(!0),o=c.ref(!0),l=c.ref(us()),h=c.ref(null),d=c.computed(()=>Pn(n.value)),u=c.computed(()=>Dn(d.value,a.value,i.value,s.value)),g=c.computed(()=>hs({rowFields:a.value,columnFields:i.value,valueFields:s.value,showRowTotals:r.value,showColumnTotals:o.value})),p=c.computed(()=>!g.value||!e.value?null:Rn(n.value,{rowFields:a.value,columnFields:i.value,valueFields:s.value,showRowTotals:r.value,showColumnTotals:o.value,calculatedFields:l.value}));function f(L){a.value.includes(L)||(a.value=[...a.value,L])}function m(L){a.value=a.value.filter(A=>A!==L)}function x(L){i.value.includes(L)||(i.value=[...i.value,L])}function b(L){i.value=i.value.filter(A=>A!==L)}function v(L,A="sum"){A!=="sum"&&!t(`${A} aggregation`)||s.value.some(M=>M.field===L&&M.aggregation===A)||(s.value=[...s.value,{field:L,aggregation:A}])}function w(L,A){A?s.value=s.value.filter(M=>!(M.field===L&&M.aggregation===A)):s.value=s.value.filter(M=>M.field!==L)}function k(L,A,M){s.value=s.value.map(F=>F.field===L&&F.aggregation===A?{...F,aggregation:M}:F)}function y(){a.value=[],i.value=[],s.value=[]}function E(L,A){if(L.area===A.area){if(L.area==="row"){const M=[...a.value],[F]=M.splice(L.index,1);M.splice(A.index,0,F),a.value=M}else if(L.area==="column"){const M=[...i.value],[F]=M.splice(L.index,1);M.splice(A.index,0,F),i.value=M}}}function S(){if(!t("Pivot Table - Auto Suggest")||d.value.length===0)return;const L=d.value.filter(M=>!M.isNumeric&&M.uniqueCount<50),A=d.value.filter(M=>M.isNumeric);L.length>0&&A.length>0&&(a.value=[L[0].field],s.value=[{field:A[0].field,aggregation:"sum"}])}function C(L){const A=l.value.findIndex(M=>M.id===L.id);A>=0?l.value=[...l.value.slice(0,A),L,...l.value.slice(A+1)]:l.value=[...l.value,L],ta(l.value)}function N(L){l.value=l.value.filter(A=>A.id!==L),s.value=s.value.filter(A=>A.field!==`calc:${L}`),ta(l.value)}return c.watch(n,L=>{if(L.length===0)return;const A=Object.keys(L[0]),M=Vn(A);if(M!==h.value){h.value=M;const F=Hn(M);if(F&&$a(F,A))a.value=F.rowFields,i.value=F.columnFields,s.value=F.valueFields,r.value=F.showRowTotals,o.value=F.showColumnTotals,F.calculatedFields&&(l.value=F.calculatedFields);else{const z={rowFields:a.value,columnFields:i.value,valueFields:s.value,showRowTotals:r.value,showColumnTotals:o.value};$a(z,A)||y()}}else{const F={rowFields:a.value,columnFields:i.value,valueFields:s.value,showRowTotals:r.value,showColumnTotals:o.value};$a(F,A)||y()}},{immediate:!0}),c.watch([a,i,s,r,o,l],()=>{if(!h.value)return;const L={rowFields:a.value,columnFields:i.value,valueFields:s.value,showRowTotals:r.value,showColumnTotals:o.value,calculatedFields:l.value};In(h.value,L)},{deep:!0}),{rowFields:a,columnFields:i,valueFields:s,showRowTotals:r,showColumnTotals:o,calculatedFields:l,availableFields:d,unassignedFields:u,isConfigured:g,pivotResult:p,addRowField:f,removeRowField:m,addColumnField:x,removeColumnField:b,addValueField:v,removeValueField:w,updateValueFieldAggregation:k,clearConfig:y,moveField:E,autoSuggestConfig:S,addCalculatedField:C,removeCalculatedField:N}}const Jc={class:"vpg-pivot-config"},Qc={class:"vpg-config-header"},eh={class:"vpg-header-actions"},th={key:0,class:"vpg-assigned-section"},ah={class:"vpg-assigned-list"},ih=["title","onDragstart"],sh={class:"vpg-item-main"},rh={class:"vpg-item-name"},nh={class:"vpg-item-actions"},oh=["title","onClick"],lh=["value","onChange"],ch=["value","disabled"],hh=["onClick"],dh={class:"vpg-unassigned-section"},uh={class:"vpg-section-header"},gh={class:"vpg-section-label"},ph={class:"vpg-count"},fh={class:"vpg-field-search"},mh={class:"vpg-field-list"},xh=["title","onDragstart"],bh={class:"vpg-field-name"},vh=["onClick"],yh=["onClick"],wh={key:1,class:"vpg-unique-count"},kh={key:0,class:"vpg-empty-hint"},Ch={key:1,class:"vpg-empty-hint"},Ah={class:"vpg-options-section"},Sh={class:"vpg-option-toggle"},Eh=["checked"],Br=It(c.defineComponent({__name:"PivotConfig",props:{availableFields:{},rowFields:{},columnFields:{},valueFields:{},showRowTotals:{type:Boolean},showColumnTotals:{type:Boolean},calculatedFields:{}},emits:["update:showRowTotals","update:showColumnTotals","clearConfig","dragStart","dragEnd","updateAggregation","addRowField","removeRowField","addColumnField","removeColumnField","addValueField","removeValueField","addCalculatedField","removeCalculatedField","updateCalculatedField"],setup(n,{emit:e}){const t=n,a=e,{canUseAdvancedAggregations:i}=ba(),s=zn;function r(M){return M!=="sum"}function o(M){return!r(M)||i.value}const l=c.ref(!1),h=c.ref(null),d=c.computed(()=>t.availableFields.filter(M=>M.isNumeric).map(M=>M.field));function u(M){h.value=M||null,l.value=!0}function g(M){h.value?a("updateCalculatedField",M):a("addCalculatedField",M),l.value=!1,h.value=null}function p(M){a("update:showRowTotals",M),a("update:showColumnTotals",M)}const f=c.computed(()=>t.calculatedFields?t.calculatedFields.map(M=>({field:`calc:${M.id}`,type:"number",uniqueCount:0,isNumeric:!0,isCalculated:!0,calcId:M.id,calcName:M.name,calcFormula:M.formula})):[]),m=c.computed(()=>[...t.availableFields.map(M=>({...M,isCalculated:!1})),...f.value]),x=c.computed(()=>{const M=new Set(t.rowFields),F=new Set(t.columnFields),z=new Map(t.valueFields.map(B=>[B.field,B]));return m.value.filter(B=>M.has(B.field)||F.has(B.field)||z.has(B.field)).map(B=>({...B,assignedTo:M.has(B.field)?"row":F.has(B.field)?"column":"value",valueConfig:z.get(B.field)}))}),b=c.computed(()=>{const M=new Set(t.rowFields),F=new Set(t.columnFields),z=new Set(t.valueFields.map(B=>B.field));return m.value.filter(B=>!M.has(B.field)&&!F.has(B.field)&&!z.has(B.field))}),v=c.computed(()=>x.value.length),w=c.ref(""),k=c.computed(()=>{if(!w.value.trim())return b.value;const M=w.value.toLowerCase().trim();return b.value.filter(F=>{const z=F.field.toLowerCase(),B=F.isCalculated&&F.calcName?F.calcName.toLowerCase():"";return z.includes(M)||B.includes(M)})});function y(M,F){if(F)return"ƒ";switch(M){case"number":return"#";case"date":return"📅";case"boolean":return"✓";default:return"Aa"}}function E(M){return M.isCalculated&&M.calcName?M.calcName:M.field}function S(M,F){var z;(z=F.dataTransfer)==null||z.setData("text/plain",M),F.dataTransfer.effectAllowed="move",a("dragStart",M,F)}function C(){a("dragEnd")}function N(M,F,z){if(!o(z)){console.warn(`[TinyPivot] "${z}" aggregation requires a Pro license. Visit https://tiny-pivot.com/#pricing to upgrade.`);return}a("updateAggregation",M,F,z)}function L(M,F){F==="row"?(a("removeRowField",M),a("addColumnField",M)):(a("removeColumnField",M),a("addRowField",M))}function A(M,F,z){F==="row"?a("removeRowField",M):F==="column"?a("removeColumnField",M):z&&a("removeValueField",M,z.aggregation)}return(M,F)=>(c.openBlock(),c.createElementBlock("div",Jc,[c.createElementVNode("div",Qc,[F[8]||(F[8]=c.createElementVNode("h3",{class:"vpg-config-title"},[c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})]),c.createTextVNode(" Fields ")],-1)),c.createElementVNode("div",eh,[v.value>0?(c.openBlock(),c.createElementBlock("button",{key:0,class:"vpg-action-btn vpg-clear-btn",title:"Clear all",onClick:F[0]||(F[0]=z=>a("clearConfig"))},[...F[7]||(F[7]=[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):c.createCommentVNode("",!0)])]),v.value>0?(c.openBlock(),c.createElementBlock("div",th,[F[10]||(F[10]=c.createElementVNode("div",{class:"vpg-section-label"}," Active ",-1)),c.createElementVNode("div",ah,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(x.value,z=>{var B;return c.openBlock(),c.createElementBlock("div",{key:z.field,class:c.normalizeClass(["vpg-assigned-item",[`vpg-type-${z.assignedTo}`,{"vpg-type-calc":z.isCalculated}]]),title:z.isCalculated?z.calcFormula:z.field,draggable:"true",onDragstart:T=>S(z.field,T),onDragend:C},[c.createElementVNode("div",sh,[c.createElementVNode("span",{class:c.normalizeClass(["vpg-item-badge",[z.assignedTo,{calc:z.isCalculated}]])},c.toDisplayString(z.isCalculated?"ƒ":z.assignedTo==="row"?"R":z.assignedTo==="column"?"C":c.unref(ns)(((B=z.valueConfig)==null?void 0:B.aggregation)||"sum")),3),c.createElementVNode("span",rh,c.toDisplayString(E(z)),1)]),c.createElementVNode("div",nh,[z.assignedTo==="row"||z.assignedTo==="column"?(c.openBlock(),c.createElementBlock("button",{key:0,class:"vpg-toggle-btn",title:z.assignedTo==="row"?"Move to Columns":"Move to Rows",onClick:c.withModifiers(T=>L(z.field,z.assignedTo),["stop"])},[...F[9]||(F[9]=[c.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})],-1)])],8,oh)):c.createCommentVNode("",!0),z.assignedTo==="value"&&z.valueConfig?(c.openBlock(),c.createElementBlock("select",{key:1,class:"vpg-agg-select",value:z.valueConfig.aggregation,onChange:T=>N(z.field,z.valueConfig.aggregation,T.target.value),onClick:F[1]||(F[1]=c.withModifiers(()=>{},["stop"]))},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(s),T=>(c.openBlock(),c.createElementBlock("option",{key:T.value,value:T.value,disabled:r(T.value)&&!c.unref(i)},c.toDisplayString(T.symbol)+" "+c.toDisplayString(T.label)+c.toDisplayString(r(T.value)&&!c.unref(i)?" (Pro)":""),9,ch))),128))],40,lh)):c.createCommentVNode("",!0),c.createElementVNode("button",{class:"vpg-remove-btn",title:"Remove",onClick:c.withModifiers(T=>A(z.field,z.assignedTo,z.valueConfig),["stop"])}," × ",8,hh)])],42,ih)}),128))])])):c.createCommentVNode("",!0),c.createElementVNode("div",dh,[c.createElementVNode("div",uh,[c.createElementVNode("div",gh,[F[11]||(F[11]=c.createTextVNode(" Available ",-1)),c.createElementVNode("span",ph,c.toDisplayString(b.value.length),1)])]),c.createElementVNode("div",fh,[F[13]||(F[13]=c.createElementVNode("svg",{class:"vpg-search-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":F[2]||(F[2]=z=>w.value=z),type:"text",placeholder:"Search fields...",class:"vpg-search-input"},null,512),[[c.vModelText,w.value]]),w.value?(c.openBlock(),c.createElementBlock("button",{key:0,class:"vpg-clear-search",onClick:F[3]||(F[3]=z=>w.value="")},[...F[12]||(F[12]=[c.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):c.createCommentVNode("",!0)]),c.createElementVNode("div",mh,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(k.value,z=>(c.openBlock(),c.createElementBlock("div",{key:z.field,class:c.normalizeClass(["vpg-field-item",{"vpg-is-numeric":z.isNumeric&&!z.isCalculated,"vpg-is-calculated":z.isCalculated}]),title:z.isCalculated?z.calcFormula:z.field,draggable:"true",onDragstart:B=>S(z.field,B),onDragend:C},[c.createElementVNode("span",{class:c.normalizeClass(["vpg-field-type-icon",{"vpg-calc-type":z.isCalculated}])},c.toDisplayString(y(z.type,z.isCalculated)),3),c.createElementVNode("span",bh,c.toDisplayString(E(z)),1),z.isCalculated?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("button",{class:"vpg-field-edit",title:"Edit calculated field",onClick:c.withModifiers(B=>{var T;return u((T=n.calculatedFields)==null?void 0:T.find(D=>D.id===z.calcId))},["stop"])}," ✎ ",8,vh),c.createElementVNode("button",{class:"vpg-field-delete",title:"Delete calculated field",onClick:c.withModifiers(B=>a("removeCalculatedField",z.calcId),["stop"])}," × ",8,yh)],64)):(c.openBlock(),c.createElementBlock("span",wh,c.toDisplayString(z.uniqueCount),1))],42,xh))),128)),k.value.length===0&&w.value?(c.openBlock(),c.createElementBlock("div",kh,' No fields match "'+c.toDisplayString(w.value)+'" ',1)):b.value.length===0?(c.openBlock(),c.createElementBlock("div",Ch," All fields assigned ")):c.createCommentVNode("",!0)])]),c.createElementVNode("div",Ah,[c.createElementVNode("label",Sh,[c.createElementVNode("input",{type:"checkbox",checked:n.showRowTotals,onChange:F[4]||(F[4]=z=>p(z.target.checked))},null,40,Eh),F[14]||(F[14]=c.createElementVNode("span",null,"Totals",-1))]),c.createElementVNode("button",{class:"vpg-calc-btn",title:"Add calculated field (e.g. Profit Margin %)",onClick:F[5]||(F[5]=z=>u())},[...F[15]||(F[15]=[c.createElementVNode("span",{class:"vpg-calc-icon"},"ƒ",-1),c.createElementVNode("span",null,"+ Calc",-1)])])]),c.createVNode(so,{show:l.value,"available-fields":d.value,"existing-field":h.value,onClose:F[6]||(F[6]=z=>{l.value=!1,h.value=null}),onSave:g},null,8,["show","available-fields","existing-field"])]))}}),[["__scopeId","data-v-7d06ac9a"]]),Mh={key:0,class:"vpg-toast"},Lh={class:"vpg-skeleton-header"},Nh={class:"vpg-header-right"},Fh={class:"vpg-filter-text"},zh={key:0,class:"vpg-filter-count"},Th={key:0,class:"vpg-filter-tooltip"},Ph={class:"vpg-tooltip-column"},Dh={class:"vpg-tooltip-values"},Rh={key:0,class:"vpg-tooltip-value vpg-range-value"},Bh={key:0,class:"vpg-tooltip-more"},Vh={key:0,class:"vpg-tooltip-summary"},Ih={key:1,class:"vpg-config-summary"},Hh={class:"vpg-summary-badge vpg-rows"},Oh={class:"vpg-summary-badge vpg-cols"},Xh={class:"vpg-summary-badge vpg-vals"},Yh={key:2,class:"vpg-font-size-toggle"},Wh=["onClick"],_h={key:0,class:"vpg-pro-required"},jh={class:"vpg-config-bar"},Gh={class:"vpg-zone-chips"},$h=["onDragstart","onDragover","onDrop"],Uh={class:"vpg-mini-name"},qh=["onClick"],Zh={key:0,class:"vpg-zone-hint"},Kh={class:"vpg-zone-chips"},Jh=["onDragstart","onDragover","onDrop"],Qh={class:"vpg-mini-name"},ed=["onClick"],td={key:0,class:"vpg-zone-hint"},ad={class:"vpg-zone-chips"},id={class:"vpg-agg-symbol"},sd={class:"vpg-mini-name"},rd=["onClick"],nd={key:0,class:"vpg-zone-hint"},od={key:0,class:"vpg-placeholder"},ld={class:"vpg-placeholder-content"},cd={class:"vpg-placeholder-text"},hd={key:1,class:"vpg-table-container"},dd={class:"vpg-pivot-table"},ud=["rowspan"],gd={class:"vpg-header-content"},pd=["colspan","onClick"],fd={class:"vpg-header-content"},md=["rowspan"],xd=["onMousedown","onMouseenter"],bd={key:0,class:"vpg-data-cell vpg-total-cell"},vd={key:0,class:"vpg-totals-row"},yd=["colspan"],wd={key:0,class:"vpg-data-cell vpg-grand-total-cell"},kd={key:2,class:"vpg-skeleton-footer"},Cd={class:"vpg-footer-info"},Ad={key:0,class:"vpg-selection-stats"},Sd={class:"vpg-stat"},Ed={class:"vpg-stat-value"},Md={class:"vpg-stat"},Ld={class:"vpg-stat-value"},Nd={class:"vpg-stat"},Fd={class:"vpg-stat-value"},zd={key:1,href:"https://tiny-pivot.com",target:"_blank",rel:"noopener"},Vr=It(c.defineComponent({__name:"PivotSkeleton",props:{rowFields:{},columnFields:{},valueFields:{},calculatedFields:{},isConfigured:{type:Boolean},draggingField:{},pivotResult:{},fontSize:{},activeFilters:{},totalRowCount:{},filteredRowCount:{}},emits:["addRowField","removeRowField","addColumnField","removeColumnField","addValueField","removeValueField","updateAggregation","reorderRowFields","reorderColumnFields"],setup(n,{emit:e}){const t=n,a=e;function i(U){var H;if(U.startsWith("calc:")){const ee=U.replace("calc:",""),_=(H=t.calculatedFields)==null?void 0:H.find(J=>J.id===ee);return(_==null?void 0:_.name)||U}return U}function s(U){return U.startsWith("calc:")}const{showWatermark:r,canUsePivot:o,isDemo:l}=ba(),h=c.ref(null),d=c.ref(null),u=c.ref(null),g=c.ref(t.fontSize||"xs"),p=[{value:"xs",label:"S"},{value:"sm",label:"M"},{value:"base",label:"L"}],f=c.computed(()=>t.activeFilters&&t.activeFilters.length>0),m=c.computed(()=>!t.activeFilters||t.activeFilters.length===0?"":t.activeFilters.map(H=>H.column).join(", ")),x=c.computed(()=>!t.activeFilters||t.activeFilters.length===0?[]:t.activeFilters.map(U=>{if(U.isRange&&U.displayText)return{column:U.column,displayText:U.displayText,isRange:!0,values:[],remaining:0};const H=U.values||[],ee=5,_=H.slice(0,ee),J=H.length-ee;return{column:U.column,values:_,remaining:J>0?J:0,isRange:!1}})),b=c.ref(!1),v=c.ref("asc"),w=c.ref("row");function k(U="row"){w.value===U?v.value=v.value==="asc"?"desc":"asc":(w.value=U,v.value="asc")}const y=c.computed(()=>{if(!t.pivotResult)return[];const U=t.pivotResult.rowHeaders.map((_,J)=>J),H=t.pivotResult.rowHeaders,ee=t.pivotResult.data;return U.sort((_,J)=>{var xe,Ee,Re,Be,Ue,it;let te;if(w.value==="row"){const je=((xe=H[_])==null?void 0:xe.join(" / "))||"",Dt=((Ee=H[J])==null?void 0:Ee.join(" / "))||"";te=je.localeCompare(Dt,void 0,{numeric:!0,sensitivity:"base"})}else{const je=w.value,Dt=((Be=(Re=ee[_])==null?void 0:Re[je])==null?void 0:Be.value)??null,va=((it=(Ue=ee[J])==null?void 0:Ue[je])==null?void 0:it.value)??null;Dt===null&&va===null?te=0:Dt===null?te=1:va===null?te=-1:te=Dt-va}return v.value==="asc"?te:-te}),U}),E=c.computed(()=>{if(!t.pivotResult||t.pivotResult.headers.length===0)return[t.valueFields.map(H=>({label:s(H.field)?`${i(H.field)} (${ea(H.aggregation)})`:`${H.field} (${ea(H.aggregation)})`,colspan:1}))];const U=[];for(let H=0;H<t.pivotResult.headers.length;H++){const ee=t.pivotResult.headers[H],_=[];let J=0;for(;J<ee.length;){const te=ee[J];let xe=1;for(;J+xe<ee.length&&ee[J+xe]===te;)xe++;_.push({label:te,colspan:xe}),J+=xe}U.push(_)}return U}),S=c.ref(null),C=c.ref(null),N=c.ref(null),L=c.ref(!1),A=c.ref(!1),M=c.ref(""),F=c.computed(()=>!C.value||!N.value?null:{minRow:Math.min(C.value.row,N.value.row),maxRow:Math.max(C.value.row,N.value.row),minCol:Math.min(C.value.col,N.value.col),maxCol:Math.max(C.value.col,N.value.col)});function z(U,H,ee){ee.preventDefault(),ee.shiftKey&&S.value?N.value={row:U,col:H}:(S.value={row:U,col:H},C.value={row:U,col:H},N.value={row:U,col:H},L.value=!0)}function B(U,H){L.value&&(N.value={row:U,col:H})}function T(){L.value=!1}function D(U,H){var xe,Ee;if(!F.value)return((xe=S.value)==null?void 0:xe.row)===U&&((Ee=S.value)==null?void 0:Ee.col)===H;const{minRow:ee,maxRow:_,minCol:J,maxCol:te}=F.value;return U>=ee&&U<=_&&H>=J&&H<=te}function I(){var xe;if(!F.value||!t.pivotResult)return;const{minRow:U,maxRow:H,minCol:ee,maxCol:_}=F.value,J=[];for(let Ee=U;Ee<=H;Ee++){const Re=y.value[Ee];if(Re===void 0)continue;const Be=[];for(let Ue=ee;Ue<=_;Ue++){const it=(xe=t.pivotResult.data[Re])==null?void 0:xe[Ue];Be.push((it==null?void 0:it.formattedValue)??"")}J.push(Be.join(" "))}const te=J.join(`
|
|
948
|
+
`);navigator.clipboard.writeText(te).then(()=>{const Ee=(H-U+1)*(_-ee+1);M.value=`Copied ${Ee} cell${Ee>1?"s":""}`,A.value=!0,setTimeout(()=>{A.value=!1},2e3)}).catch(Ee=>{console.error("Copy failed:",Ee)})}function Y(U){if(F.value){if((U.ctrlKey||U.metaKey)&&U.key==="c"){U.preventDefault(),I();return}U.key==="Escape"&&(S.value=null,C.value=null,N.value=null)}}const $=c.computed(()=>{var Re;if(!F.value||!t.pivotResult)return null;const{minRow:U,maxRow:H,minCol:ee,maxCol:_}=F.value,J=[];let te=0;for(let Be=U;Be<=H;Be++){const Ue=y.value[Be];if(Ue!==void 0)for(let it=ee;it<=_;it++){const je=(Re=t.pivotResult.data[Ue])==null?void 0:Re[it];te++,(je==null?void 0:je.value)!==null&&(je==null?void 0:je.value)!==void 0&&typeof je.value=="number"&&J.push(je.value)}}if(te<=1)return null;const xe=J.reduce((Be,Ue)=>Be+Ue,0),Ee=J.length>0?xe/J.length:0;return{count:te,numericCount:J.length,sum:xe,avg:Ee}});function K(U){return Math.abs(U)>=1e6?`${(U/1e6).toFixed(2)}M`:Math.abs(U)>=1e3?`${(U/1e3).toFixed(2)}K`:U.toFixed(2)}c.onMounted(()=>{document.addEventListener("mouseup",T),document.addEventListener("keydown",Y)}),c.onUnmounted(()=>{document.removeEventListener("mouseup",T),document.removeEventListener("keydown",Y)});function ie(U,H){H.preventDefault(),H.dataTransfer.dropEffect="move",h.value=U}function he(){h.value=null}function X(U,H){var J;H.preventDefault();const ee=(J=H.dataTransfer)==null?void 0:J.getData("text/plain");if(!ee||ee.startsWith("reorder:")){h.value=null;return}t.rowFields.includes(ee)&&a("removeRowField",ee),t.columnFields.includes(ee)&&a("removeColumnField",ee);const _=t.valueFields.find(te=>te.field===ee);switch(_&&a("removeValueField",ee,_.aggregation),U){case"row":a("addRowField",ee);break;case"column":a("addColumnField",ee);break;case"value":a("addValueField",ee,"sum");break}h.value=null}function ge(U,H,ee){d.value={zone:U,index:H},ee.dataTransfer.effectAllowed="move",ee.dataTransfer.setData("text/plain",`reorder:${U}:${H}`),requestAnimationFrame(()=>{h.value=null})}function oe(){d.value=null,u.value=null}function ne(U,H,ee){ee.preventDefault(),d.value&&d.value.zone===U&&(ee.dataTransfer.dropEffect="move",u.value={zone:U,index:H})}function ce(){u.value=null}function ve(U,H,ee){if(ee.preventDefault(),ee.stopPropagation(),!d.value||d.value.zone!==U)return;const _=d.value.index;if(_===H){d.value=null,u.value=null;return}const J=U==="row"?[...t.rowFields]:[...t.columnFields],[te]=J.splice(_,1);J.splice(H,0,te),a(U==="row"?"reorderRowFields":"reorderColumnFields",J),d.value=null,u.value=null}function Ae(U,H){var ee,_;return((ee=d.value)==null?void 0:ee.zone)===U&&((_=d.value)==null?void 0:_.index)===H}function Ne(U,H){var ee,_;return((ee=u.value)==null?void 0:ee.zone)===U&&((_=u.value)==null?void 0:_.index)===H}const at=c.ref(180),ye=c.ref(80),Ye=c.computed(()=>{const U=Math.max(t.rowFields.length,1);return Math.max(at.value/U,80)});function Pt(U){return U*Ye.value}return(U,H)=>{var ee;return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["vpg-pivot-skeleton",[`vpg-font-${g.value}`,{"vpg-is-dragging":n.draggingField}]])},[c.createVNode(c.Transition,{name:"vpg-toast"},{default:c.withCtx(()=>[A.value?(c.openBlock(),c.createElementBlock("div",Mh,[H[9]||(H[9]=c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)),c.createTextVNode(" "+c.toDisplayString(M.value),1)])):c.createCommentVNode("",!0)]),_:1}),c.createElementVNode("div",Lh,[H[13]||(H[13]=c.createElementVNode("div",{class:"vpg-skeleton-title"},[c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})]),c.createElementVNode("span",null,"Pivot Table")],-1)),c.createElementVNode("div",Nh,[f.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"vpg-filter-indicator",onMouseenter:H[0]||(H[0]=_=>b.value=!0),onMouseleave:H[1]||(H[1]=_=>b.value=!1)},[H[12]||(H[12]=c.createElementVNode("svg",{class:"vpg-filter-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})],-1)),c.createElementVNode("span",Fh,[H[10]||(H[10]=c.createTextVNode(" Filtered: ",-1)),c.createElementVNode("strong",null,c.toDisplayString(m.value),1),n.filteredRowCount!==void 0&&n.totalRowCount!==void 0?(c.openBlock(),c.createElementBlock("span",zh," ("+c.toDisplayString(n.filteredRowCount.toLocaleString())+" of "+c.toDisplayString(n.totalRowCount.toLocaleString())+" rows) ",1)):c.createCommentVNode("",!0)]),b.value?(c.openBlock(),c.createElementBlock("div",Th,[H[11]||(H[11]=c.createElementVNode("div",{class:"vpg-tooltip-header"}," Active Filters ",-1)),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(x.value,_=>(c.openBlock(),c.createElementBlock("div",{key:_.column,class:"vpg-tooltip-filter"},[c.createElementVNode("div",Ph,c.toDisplayString(_.column),1),c.createElementVNode("div",Dh,[_.isRange?(c.openBlock(),c.createElementBlock("span",Rh,c.toDisplayString(_.displayText),1)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(_.values,(J,te)=>(c.openBlock(),c.createElementBlock("span",{key:te,class:"vpg-tooltip-value"},c.toDisplayString(J),1))),128)),_.remaining>0?(c.openBlock(),c.createElementBlock("span",Bh," +"+c.toDisplayString(_.remaining)+" more ",1)):c.createCommentVNode("",!0)],64))])]))),128)),n.filteredRowCount!==void 0&&n.totalRowCount!==void 0?(c.openBlock(),c.createElementBlock("div",Vh," Showing "+c.toDisplayString(n.filteredRowCount.toLocaleString())+" of "+c.toDisplayString(n.totalRowCount.toLocaleString())+" rows ",1)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0)],32)):c.createCommentVNode("",!0),n.isConfigured?(c.openBlock(),c.createElementBlock("div",Ih,[c.createElementVNode("span",Hh,c.toDisplayString(n.rowFields.length)+" row"+c.toDisplayString(n.rowFields.length!==1?"s":""),1),c.createElementVNode("span",Oh,c.toDisplayString(n.columnFields.length)+" col"+c.toDisplayString(n.columnFields.length!==1?"s":""),1),c.createElementVNode("span",Xh,c.toDisplayString(n.valueFields.length)+" val"+c.toDisplayString(n.valueFields.length!==1?"s":""),1)])):c.createCommentVNode("",!0),n.isConfigured&&n.pivotResult?(c.openBlock(),c.createElementBlock("div",Yh,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(p,_=>c.createElementVNode("button",{key:_.value,class:c.normalizeClass(["vpg-font-size-btn",{active:g.value===_.value}]),onClick:J=>g.value=_.value},c.toDisplayString(_.label),11,Wh)),64))])):c.createCommentVNode("",!0)])]),c.unref(o)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createElementVNode("div",jh,[c.createElementVNode("div",{class:c.normalizeClass(["vpg-drop-zone vpg-row-zone",{"vpg-drag-over":h.value==="row"}]),onDragover:H[2]||(H[2]=_=>ie("row",_)),onDragleave:he,onDrop:H[3]||(H[3]=_=>X("row",_))},[H[16]||(H[16]=c.createElementVNode("div",{class:"vpg-zone-header"},[c.createElementVNode("span",{class:"vpg-zone-icon vpg-row-icon"},"↓"),c.createElementVNode("span",{class:"vpg-zone-label"},"Rows")],-1)),c.createElementVNode("div",Gh,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.rowFields,(_,J)=>(c.openBlock(),c.createElementBlock("div",{key:_,class:c.normalizeClass(["vpg-mini-chip vpg-row-chip",{"vpg-chip-dragging":Ae("row",J),"vpg-chip-drop-target":Ne("row",J)}]),draggable:"true",onDragstart:te=>ge("row",J,te),onDragend:oe,onDragover:te=>ne("row",J,te),onDragleave:ce,onDrop:te=>ve("row",J,te)},[H[15]||(H[15]=c.createElementVNode("span",{class:"vpg-drag-handle"},"⋮⋮",-1)),c.createElementVNode("span",Uh,c.toDisplayString(_),1),c.createElementVNode("button",{class:"vpg-mini-remove",onClick:c.withModifiers(te=>a("removeRowField",_),["stop"])}," × ",8,qh)],42,$h))),128)),n.rowFields.length===0?(c.openBlock(),c.createElementBlock("span",Zh,"Drop here")):c.createCommentVNode("",!0)])],34),c.createElementVNode("div",{class:c.normalizeClass(["vpg-drop-zone vpg-column-zone",{"vpg-drag-over":h.value==="column"}]),onDragover:H[4]||(H[4]=_=>ie("column",_)),onDragleave:he,onDrop:H[5]||(H[5]=_=>X("column",_))},[H[18]||(H[18]=c.createElementVNode("div",{class:"vpg-zone-header"},[c.createElementVNode("span",{class:"vpg-zone-icon vpg-column-icon"},"→"),c.createElementVNode("span",{class:"vpg-zone-label"},"Columns")],-1)),c.createElementVNode("div",Kh,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.columnFields,(_,J)=>(c.openBlock(),c.createElementBlock("div",{key:_,class:c.normalizeClass(["vpg-mini-chip vpg-column-chip",{"vpg-chip-dragging":Ae("column",J),"vpg-chip-drop-target":Ne("column",J)}]),draggable:"true",onDragstart:te=>ge("column",J,te),onDragend:oe,onDragover:te=>ne("column",J,te),onDragleave:ce,onDrop:te=>ve("column",J,te)},[H[17]||(H[17]=c.createElementVNode("span",{class:"vpg-drag-handle"},"⋮⋮",-1)),c.createElementVNode("span",Qh,c.toDisplayString(_),1),c.createElementVNode("button",{class:"vpg-mini-remove",onClick:c.withModifiers(te=>a("removeColumnField",_),["stop"])}," × ",8,ed)],42,Jh))),128)),n.columnFields.length===0?(c.openBlock(),c.createElementBlock("span",td,"Drop here")):c.createCommentVNode("",!0)])],34),c.createElementVNode("div",{class:c.normalizeClass(["vpg-drop-zone vpg-value-zone",{"vpg-drag-over":h.value==="value"}]),onDragover:H[6]||(H[6]=_=>ie("value",_)),onDragleave:he,onDrop:H[7]||(H[7]=_=>X("value",_))},[H[19]||(H[19]=c.createElementVNode("div",{class:"vpg-zone-header"},[c.createElementVNode("span",{class:"vpg-zone-icon vpg-value-icon"},"Σ"),c.createElementVNode("span",{class:"vpg-zone-label"},"Values")],-1)),c.createElementVNode("div",ad,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.valueFields,_=>(c.openBlock(),c.createElementBlock("div",{key:`${_.field}-${_.aggregation}`,class:c.normalizeClass(["vpg-mini-chip vpg-value-chip",{"vpg-calc-chip":s(_.field)}])},[c.createElementVNode("span",id,c.toDisplayString(s(_.field)?"ƒ":c.unref(ns)(_.aggregation)),1),c.createElementVNode("span",sd,c.toDisplayString(i(_.field)),1),c.createElementVNode("button",{class:"vpg-mini-remove",onClick:J=>a("removeValueField",_.field,_.aggregation)}," × ",8,rd)],2))),128)),n.valueFields.length===0?(c.openBlock(),c.createElementBlock("span",nd,"Drop numeric")):c.createCommentVNode("",!0)])],34)]),!n.isConfigured||!n.pivotResult?(c.openBlock(),c.createElementBlock("div",od,[c.createElementVNode("div",ld,[H[28]||(H[28]=c.createElementVNode("svg",{class:"vpg-placeholder-icon",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)),c.createElementVNode("span",cd,[n.valueFields.length===0?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[H[20]||(H[20]=c.createTextVNode(" Add a ",-1)),H[21]||(H[21]=c.createElementVNode("strong",null,"Values",-1)),H[22]||(H[22]=c.createTextVNode(" field to see your pivot table ",-1))],64)):n.rowFields.length===0&&n.columnFields.length===0?(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[H[23]||(H[23]=c.createTextVNode(" Add ",-1)),H[24]||(H[24]=c.createElementVNode("strong",null,"Row",-1)),H[25]||(H[25]=c.createTextVNode(" or ",-1)),H[26]||(H[26]=c.createElementVNode("strong",null,"Column",-1)),H[27]||(H[27]=c.createTextVNode(" fields to group your data ",-1))],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[c.createTextVNode(" Your pivot table will appear here ")],64))])])])):(c.openBlock(),c.createElementBlock("div",hd,[c.createElementVNode("table",dd,[c.createElementVNode("thead",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(E.value,(_,J)=>(c.openBlock(),c.createElementBlock("tr",{key:`header-${J}`,class:"vpg-column-header-row"},[J===0?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(n.rowFields.length>0?n.rowFields:["Rows"],(te,xe)=>(c.openBlock(),c.createElementBlock("th",{key:`row-header-${xe}`,class:"vpg-row-header-label",rowspan:E.value.length,style:c.normalizeStyle({width:`${Ye.value}px`,minWidth:"80px",left:`${Pt(xe)}px`}),onClick:H[8]||(H[8]=Ee=>k("row"))},[c.createElementVNode("div",gd,[c.createElementVNode("span",null,c.toDisplayString(te),1),xe===n.rowFields.length-1||n.rowFields.length===0?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["vpg-sort-indicator",{active:w.value==="row"}])},c.toDisplayString(w.value==="row"?v.value==="asc"?"↑":"↓":"⇅"),3)):c.createCommentVNode("",!0)])],12,ud))),128)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(_,(te,xe)=>(c.openBlock(),c.createElementBlock("th",{key:xe,class:"vpg-column-header-cell",colspan:te.colspan,style:c.normalizeStyle({width:`${ye.value*te.colspan}px`}),onClick:Ee=>J===E.value.length-1&&k(xe)},[c.createElementVNode("div",fd,[c.createElementVNode("span",null,c.toDisplayString(te.label),1),J===E.value.length-1?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["vpg-sort-indicator",{active:w.value===xe}])},c.toDisplayString(w.value===xe?v.value==="asc"?"↑":"↓":"⇅"),3)):c.createCommentVNode("",!0)])],12,pd))),128)),n.pivotResult.rowTotals.length>0&&J===0?(c.openBlock(),c.createElementBlock("th",{key:1,class:"vpg-total-header",rowspan:E.value.length}," Total ",8,md)):c.createCommentVNode("",!0)]))),128))]),c.createElementVNode("tbody",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(y.value,_=>(c.openBlock(),c.createElementBlock("tr",{key:_,class:"vpg-data-row"},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.pivotResult.rowHeaders[_],(J,te)=>(c.openBlock(),c.createElementBlock("th",{key:`row-${_}-${te}`,class:"vpg-row-header-cell",style:c.normalizeStyle({width:`${Ye.value}px`,minWidth:"80px",left:`${Pt(te)}px`})},c.toDisplayString(J),5))),128)),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.pivotResult.data[_],(J,te)=>(c.openBlock(),c.createElementBlock("td",{key:te,class:c.normalizeClass(["vpg-data-cell",[D(y.value.indexOf(_),te)&&"selected",J.value===null&&"vpg-is-null"]]),style:c.normalizeStyle({width:`${ye.value}px`}),onMousedown:xe=>z(y.value.indexOf(_),te,xe),onMouseenter:xe=>B(y.value.indexOf(_),te)},c.toDisplayString(J.formattedValue),47,xd))),128)),n.pivotResult.rowTotals[_]?(c.openBlock(),c.createElementBlock("td",bd,c.toDisplayString(n.pivotResult.rowTotals[_].formattedValue),1)):c.createCommentVNode("",!0)]))),128)),n.pivotResult.columnTotals.length>0?(c.openBlock(),c.createElementBlock("tr",vd,[c.createElementVNode("th",{class:"vpg-row-header-cell vpg-total-label",colspan:Math.max(n.rowFields.length,1),style:c.normalizeStyle({width:`${at.value}px`})}," Total ",12,yd),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.pivotResult.columnTotals,(_,J)=>(c.openBlock(),c.createElementBlock("td",{key:J,class:"vpg-data-cell vpg-total-cell",style:c.normalizeStyle({width:`${ye.value}px`})},c.toDisplayString(_.formattedValue),5))),128)),n.pivotResult.rowTotals.length>0?(c.openBlock(),c.createElementBlock("td",wd,c.toDisplayString(n.pivotResult.grandTotal.formattedValue),1)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0)])])])),n.isConfigured&&n.pivotResult?(c.openBlock(),c.createElementBlock("div",kd,[c.createElementVNode("span",Cd,c.toDisplayString(n.pivotResult.rowHeaders.length)+" rows × "+c.toDisplayString(((ee=n.pivotResult.data[0])==null?void 0:ee.length)||0)+" columns",1),$.value&&$.value.count>1?(c.openBlock(),c.createElementBlock("div",Ad,[c.createElementVNode("span",Sd,[H[29]||(H[29]=c.createElementVNode("span",{class:"vpg-stat-label"},"Count:",-1)),c.createElementVNode("span",Ed,c.toDisplayString($.value.count),1)]),$.value.numericCount>0?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[H[32]||(H[32]=c.createElementVNode("span",{class:"vpg-stat-divider"},"|",-1)),c.createElementVNode("span",Md,[H[30]||(H[30]=c.createElementVNode("span",{class:"vpg-stat-label"},"Sum:",-1)),c.createElementVNode("span",Ld,c.toDisplayString(K($.value.sum)),1)]),H[33]||(H[33]=c.createElementVNode("span",{class:"vpg-stat-divider"},"|",-1)),c.createElementVNode("span",Nd,[H[31]||(H[31]=c.createElementVNode("span",{class:"vpg-stat-label"},"Avg:",-1)),c.createElementVNode("span",Fd,c.toDisplayString(K($.value.avg)),1)])],64)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0)],64)):(c.openBlock(),c.createElementBlock("div",_h,[...H[14]||(H[14]=[c.createElementVNode("div",{class:"vpg-pro-content"},[c.createElementVNode("svg",{class:"vpg-pro-icon",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})]),c.createElementVNode("h3",null,"Pro Feature"),c.createElementVNode("p",null,"Pivot Table functionality requires a Pro license."),c.createElementVNode("a",{href:"https://tiny-pivot.com/#pricing",target:"_blank",class:"vpg-pro-link"}," Get Pro License → ")],-1)])])),c.unref(r)&&c.unref(o)?(c.openBlock(),c.createElementBlock("div",{key:2,class:c.normalizeClass(["vpg-watermark",{"vpg-demo-mode":c.unref(l)}])},[c.unref(l)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[H[34]||(H[34]=c.createElementVNode("span",{class:"vpg-demo-badge"},"DEMO",-1)),H[35]||(H[35]=c.createElementVNode("span",null,"Pro features unlocked for evaluation",-1)),H[36]||(H[36]=c.createElementVNode("a",{href:"https://tiny-pivot.com/#pricing",target:"_blank",rel:"noopener",class:"vpg-get-pro"}," Get Pro License → ",-1))],64)):(c.openBlock(),c.createElementBlock("a",zd," Powered by TinyPivot "))],2)):c.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-be785c2d"]]),Td={key:0,class:"vpg-toast"},Pd={class:"vpg-toolbar"},Dd={class:"vpg-toolbar-left"},Rd={key:0,class:"vpg-view-toggle"},Bd=["title"],Vd={key:0,class:"vpg-pro-badge"},Id={key:0,class:"vpg-search-container"},Hd={key:1,class:"vpg-search-box"},Od={class:"vpg-font-size-control"},Xd={class:"vpg-font-size-toggle"},Yd=["onClick"],Wd={key:1,class:"vpg-filter-info"},_d={key:2,class:"vpg-search-info"},jd={key:0,class:"vpg-pivot-status"},Gd={class:"vpg-toolbar-right"},$d=["disabled","title"],Ud={key:0,class:"vpg-loading"},qd={key:1,class:"vpg-empty"},Zd={key:2,class:"vpg-empty"},Kd={key:3,class:"vpg-table-wrapper"},Jd=["onClick"],Qd={class:"vpg-header-content"},eu={class:"vpg-header-text"},tu={class:"vpg-header-icons"},au={key:0,class:"vpg-sort-indicator"},iu={key:0,class:"vpg-icon-sm",fill:"currentColor",viewBox:"0 0 20 20"},su={key:1,class:"vpg-icon-sm",fill:"currentColor",viewBox:"0 0 20 20"},ru={key:1,class:"vpg-filter-indicator"},nu=["onMousedown"],ou=["data-row","data-col","onMousedown","onMouseenter"],lu={key:1,class:"vpg-pivot-container"},cu={key:0,class:"vpg-pivot-config-panel"},hu={key:2,class:"vpg-chart-view"},du={key:0,class:"vpg-chart-filter-bar"},uu={class:"vpg-footer"},gu={class:"vpg-footer-left"},pu={key:0,class:"vpg-filtered-note"},fu={key:1},mu={class:"vpg-filtered-count"},xu={key:0,class:"vpg-pagination"},bu=["disabled"],vu=["disabled"],yu={class:"vpg-page-info"},wu=["disabled"],ku=["disabled"],Cu={key:1,class:"vpg-selection-stats"},Au={class:"vpg-stat"},Su={class:"vpg-stat-value"},Eu={class:"vpg-stat"},Mu={class:"vpg-stat-value"},Lu={class:"vpg-stat"},Nu={class:"vpg-stat-value"},Fu={class:"vpg-footer-right"},zu={key:0,class:"vpg-demo-banner"},Tu={key:1,class:"vpg-watermark-inline"},kt=120,Ir=350,Pu=It(c.defineComponent({__name:"DataGrid",props:{data:{},loading:{type:Boolean,default:!1},rowHeight:{default:36},headerHeight:{default:40},fontSize:{default:"xs"},showPivot:{type:Boolean,default:!0},enableExport:{type:Boolean,default:!0},enableSearch:{type:Boolean,default:!0},enablePagination:{type:Boolean,default:!1},pageSize:{default:50},enableColumnResize:{type:Boolean,default:!0},enableClipboard:{type:Boolean,default:!0},theme:{default:"light"},stripedRows:{type:Boolean,default:!0},exportFilename:{default:"data-export.csv"},enableVerticalResize:{type:Boolean,default:!0},initialHeight:{default:600},minHeight:{default:300},maxHeight:{default:1200}},emits:["cellClick","selectionChange","export","copy"],setup(n,{emit:e}){const t=n,a=e,{showWatermark:i,canUsePivot:s,canUseCharts:r,isDemo:o,isPro:l}=ba(),h=c.computed(()=>{var V;return t.theme==="auto"?(V=window.matchMedia)!=null&&V.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light":t.theme}),d=c.ref(t.fontSize),u=c.ref(""),g=c.ref(!1),p=c.ref(1),f=c.ref(null),m=c.ref(0),x=c.ref(0),b=c.ref(t.initialHeight),v=c.ref(!1),w=c.ref(0),k=c.ref(0),y=c.ref(!1),E=c.ref(""),S=[{value:"xs",label:"S"},{value:"sm",label:"M"},{value:"base",label:"L"}],C=c.computed(()=>t.data),{table:N,columnKeys:L,filteredRowCount:A,totalRowCount:M,getColumnStats:F,hasActiveFilter:z,setColumnFilter:B,getColumnFilterValues:T,clearAllFilters:D,toggleSort:I,getSortDirection:Y,columnFilters:$,activeFilters:K,setNumericRangeFilter:ie,getNumericRangeFilter:he}=Fr({data:C}),X=c.computed(()=>N.getFilteredRowModel().rows.map(P=>P.original)),ge=c.computed(()=>K.value.length===0?null:K.value.map(V=>{var P;if(V.type==="range"&&V.range){const W=[];return V.range.min!==null&&W.push(`≥ ${V.range.min}`),V.range.max!==null&&W.push(`≤ ${V.range.max}`),{column:V.column,valueCount:1,displayText:W.join(" and "),isRange:!0}}return{column:V.column,valueCount:((P=V.values)==null?void 0:P.length)||0,values:V.values||[],isRange:!1}})),{rowFields:oe,columnFields:ne,valueFields:ce,showRowTotals:ve,showColumnTotals:Ae,availableFields:Ne,isConfigured:at,pivotResult:ye,addRowField:Ye,removeRowField:Pt,addColumnField:U,removeColumnField:H,addValueField:ee,removeValueField:_,updateValueFieldAggregation:J,clearConfig:te,autoSuggestConfig:xe}=Rr(X),Ee=c.computed(()=>{if(!u.value.trim()||!t.enableSearch)return Rt.value;const V=u.value.toLowerCase().trim();return Rt.value.filter(P=>{for(const W of L.value){const se=P.original[W];if(se!=null&&String(se).toLowerCase().includes(V))return!0}return!1})}),Re=c.computed(()=>Ee.value.length),Be=c.computed(()=>t.enablePagination?Math.max(1,Math.ceil(Re.value/t.pageSize)):1),Ue=c.computed(()=>{if(!t.enablePagination)return Ee.value;const V=(p.value-1)*t.pageSize,P=V+t.pageSize;return Ee.value.slice(V,P)}),it=c.computed(()=>Re.value===0?0:(p.value-1)*t.pageSize+1),je=c.computed(()=>Math.min(p.value*t.pageSize,Re.value));function Dt(){p.value<Be.value&&p.value++}function va(){p.value>1&&p.value--}c.watch([$,u],()=>{p.value=1});function Hr(){if(Fe.value==="pivot"){Du();return}const V=t.enableSearch&&u.value.trim()?Ee.value.map(P=>P.original):Rt.value.map(P=>P.original);zr(V,L.value,{filename:t.exportFilename,includeHeaders:!0}),a("export",{rowCount:V.length,filename:t.exportFilename})}function Du(){if(!ye.value)return;const V=t.exportFilename.replace(".csv","-pivot.csv");Tr({headers:ye.value.headers,rowHeaders:ye.value.rowHeaders,data:ye.value.data,rowTotals:ye.value.rowTotals,columnTotals:ye.value.columnTotals,grandTotal:ye.value.grandTotal,showRowTotals:ve.value,showColumnTotals:Ae.value},oe.value,ne.value,ce.value,{filename:V});const P=ye.value.rowHeaders.length;a("export",{rowCount:P,filename:V})}function Ru(V,P){t.enableColumnResize&&(P.preventDefault(),P.stopPropagation(),f.value=V,m.value=P.clientX,x.value=gt.value[V]||kt,document.addEventListener("mousemove",Or),document.addEventListener("mouseup",Xr))}function Or(V){if(!f.value)return;const P=V.clientX-m.value,W=Math.max(kt,Math.min(Ir,x.value+P));gt.value={...gt.value,[f.value]:W}}function Xr(){f.value=null,document.removeEventListener("mousemove",Or),document.removeEventListener("mouseup",Xr)}function Bu(V){t.enableVerticalResize&&(V.preventDefault(),v.value=!0,w.value=V.clientY,k.value=b.value,document.addEventListener("mousemove",Yr),document.addEventListener("mouseup",Wr))}function Yr(V){if(!v.value)return;const P=V.clientY-w.value,W=Math.max(t.minHeight,Math.min(t.maxHeight,k.value+P));b.value=W}function Wr(){v.value=!1,document.removeEventListener("mousemove",Yr),document.removeEventListener("mouseup",Wr)}function _r(){if(!rt.value||!t.enableClipboard)return;const V=Dr(Rt.value.map(P=>P.original),L.value,rt.value);Pr(V,()=>{const P=(rt.value.maxRow-rt.value.minRow+1)*(rt.value.maxCol-rt.value.minCol+1);E.value=`Copied ${P} cell${P>1?"s":""}`,y.value=!0,setTimeout(()=>{y.value=!1},2e3),a("copy",{text:V,cellCount:P})},P=>{E.value="Copy failed",y.value=!0,setTimeout(()=>{y.value=!1},2e3),console.error("Copy failed:",P)})}const Fe=c.ref("grid"),Vu=c.ref(null);function Iu(V){Vu.value=V}const Kt=c.ref(!0),Gi=c.ref(null),ct=c.ref(us());function Hu(V){V.id||(V.id=`calc_${Date.now()}_${Math.random().toString(36).substr(2,9)}`),ct.value=[...ct.value,V],ta(ct.value)}function Ou(V){ct.value=ct.value.filter(se=>se.id!==V),ta(ct.value);const P=`calc:${V}`,W=ce.value.find(se=>se.field===P);W&&_(P,W.aggregation)}function Xu(V){ct.value=ct.value.map(P=>P.id===V.id?V:P),ta(ct.value)}function Yu(V){Gi.value=V}function Wu(){Gi.value=null}function _u(V){oe.value=V}function ju(V){ne.value=V}const $i=c.ref(),jr=c.ref(),Rt=c.computed(()=>N.getRowModel().rows),Oe=c.ref(null),Xa=c.ref({top:0,left:0,maxHeight:400}),gt=c.ref({});function Gr(){if(typeof document>"u"||t.data.length===0)return;const V={},P=Math.min(100,t.data.length),se=document.createElement("canvas").getContext("2d");if(se){se.font="13px system-ui, -apple-system, sans-serif";for(const pe of L.value){let De=se.measureText(pe).width+56;for(let Te=0;Te<P;Te++){const ze=t.data[Te][pe],Xe=ze==null?"":String(ze),ft=se.measureText(Xe).width+28;De=Math.max(De,ft)}V[pe]=Math.min(Math.max(De,kt),Ir)}gt.value=V}}function Gu(V,P){P.stopPropagation();const W=P.currentTarget,se=W.closest(".vpg-header-cell"),pe=(se==null?void 0:se.getBoundingClientRect())||W.getBoundingClientRect(),De=280,Te=12;let ze=pe.left;ze+De>window.innerWidth-Te&&(ze=window.innerWidth-De-Te),ze=Math.max(Te,ze);const Xe=window.innerHeight-pe.bottom-Te,ft=pe.top-Te;let Bt,Vt;Xe>=300||Xe>=ft?(Bt=pe.bottom+4,Vt=Math.min(400,Xe-4)):(Vt=Math.min(400,ft-4),Bt=pe.top-Vt-4),Xa.value={top:Bt,left:ze,maxHeight:Vt},Oe.value=V}function Ya(){Oe.value=null}function $u(V,P){B(V,P)}function Uu(V,P){ie(V,P)}function qu(V,P){if(P===null)Y(V)&&(I(V),Y(V)&&I(V));else{const W=Y(V);W===null?(I(V),P==="desc"&&Y(V)==="asc"&&I(V)):W!==P&&I(V)}}const Wa=c.computed(()=>$.value.length),pt=c.ref(null),ht=c.ref(null),st=c.ref(null),Ui=c.ref(!1);function Zu(V){const P=Rt.value.length-1;P<0||(ht.value={row:0,col:V},st.value={row:P,col:V},pt.value={row:0,col:V})}function Ku(V,P){if(P.target.closest(".vpg-dropdown-arrow")){const se=L.value[V];Gu(se,P)}else Zu(V)}const rt=c.computed(()=>!ht.value||!st.value?null:{minRow:Math.min(ht.value.row,st.value.row),maxRow:Math.max(ht.value.row,st.value.row),minCol:Math.min(ht.value.col,st.value.col),maxCol:Math.max(ht.value.col,st.value.col)});function Ju(V,P){if(!rt.value)return!1;const{minRow:W,maxRow:se,minCol:pe,maxCol:De}=rt.value;return V>=W&&V<=se&&P>=pe&&P<=De}const Jt=c.computed(()=>{if(!rt.value)return null;const{minRow:V,maxRow:P,minCol:W,maxCol:se}=rt.value,pe=[];let De=0;for(let Xe=V;Xe<=P;Xe++){const ft=Rt.value[Xe];if(ft)for(let Bt=W;Bt<=se;Bt++){const Vt=L.value[Bt];if(!Vt)continue;const Qt=ft.original[Vt];if(De++,Qt!=null&&Qt!==""){const Jr=typeof Qt=="number"?Qt:Number.parseFloat(String(Qt));Number.isNaN(Jr)||pe.push(Jr)}}}if(pe.length===0)return{count:De,sum:null,avg:null,numericCount:0};const Te=pe.reduce((Xe,ft)=>Xe+ft,0),ze=Te/pe.length;return{count:De,sum:Te,avg:ze,numericCount:pe.length}});function $r(V){return V===null?"-":Math.abs(V)>=1e3?V.toLocaleString("en-US",{maximumFractionDigits:2}):V.toLocaleString("en-US",{maximumFractionDigits:4})}function Ur(V){if((V.ctrlKey||V.metaKey)&&V.key==="c"&&rt.value){V.preventDefault(),_r();return}if((V.ctrlKey||V.metaKey)&&V.key==="f"&&t.enableSearch){V.preventDefault(),g.value=!0,c.nextTick(()=>{const ze=document.querySelector(".vpg-search-input");ze==null||ze.focus()});return}if(!pt.value||Oe.value)return;const{row:P,col:W}=pt.value,pe=Ue.value.length-1,De=L.value.length-1;function Te(ze,Xe){V.shiftKey?(ht.value||(ht.value={row:P,col:W}),st.value={row:ze,col:Xe}):(ht.value={row:ze,col:Xe},st.value={row:ze,col:Xe}),pt.value={row:ze,col:Xe},Qu(ze,Xe)}switch(V.key){case"ArrowUp":V.preventDefault(),P>0&&Te(P-1,W);break;case"ArrowDown":V.preventDefault(),P<pe&&Te(P+1,W);break;case"ArrowLeft":V.preventDefault(),W>0&&Te(P,W-1);break;case"ArrowRight":V.preventDefault(),W<De&&Te(P,W+1);break;case"Escape":pt.value=null,ht.value=null,st.value=null,g.value=!1,u.value="";break}}function Qu(V,P){c.nextTick(()=>{var se;const W=(se=jr.value)==null?void 0:se.querySelector(`[data-row="${V}"][data-col="${P}"]`);W==null||W.scrollIntoView({block:"nearest",inline:"nearest"})})}function eg(V,P,W){W.preventDefault(),W.shiftKey&&pt.value?st.value={row:V,col:P}:(pt.value={row:V,col:P},ht.value={row:V,col:P},st.value={row:V,col:P},Ui.value=!0);const se=Rt.value[V];if(se){const pe=L.value[P];a("cellClick",{row:V,col:P,value:se.original[pe],rowData:se.original})}}function tg(V,P){Ui.value&&(st.value={row:V,col:P})}function qr(){Ui.value=!1}function ag(V,P){var W,se;return Ju(V,P)?!0:((W=pt.value)==null?void 0:W.row)===V&&((se=pt.value)==null?void 0:se.col)===P}const ig=/^(?:.*_)?(?:id|code|year|month|quarter|day|week|date|zip|phone|fax|ssn|ein|npi|ndc|gpi|hcpcs|icd|cpt|rx|bin|pcn|group|member|claim|rx_number|script|fill)(?:_.*)?$/i;function sg(V){return!ig.test(V)}function rg(V,P){if(V==null||V==="")return"";if(F(P).type==="number"){const se=typeof V=="number"?V:Number.parseFloat(String(V));return Number.isNaN(se)?String(V):sg(P)&&Math.abs(se)>=1e3?se.toLocaleString("en-US",{maximumFractionDigits:2}):Number.isInteger(se)?String(se):se.toLocaleString("en-US",{maximumFractionDigits:4,useGrouping:!1})}return String(V)}function Zr(){Oe.value&&Ya()}function Kr(V){var P;if(Oe.value){const W=V.target;if(W&&((P=W.closest)!=null&&P.call(W,".vpg-filter-portal")))return;Ya()}}c.onMounted(()=>{Gr(),document.addEventListener("keydown",Ur),document.addEventListener("mouseup",qr),c.nextTick(()=>{var V;(V=$i.value)==null||V.addEventListener("scroll",Zr,{passive:!0})}),window.addEventListener("scroll",Kr,{passive:!0,capture:!0})}),c.onUnmounted(()=>{var V;document.removeEventListener("keydown",Ur),document.removeEventListener("mouseup",qr),(V=$i.value)==null||V.removeEventListener("scroll",Zr),window.removeEventListener("scroll",Kr,{capture:!0})}),c.watch(()=>t.data,()=>{c.nextTick(Gr)},{immediate:!0});const ng=c.computed(()=>L.value.reduce((V,P)=>V+(gt.value[P]||kt),0));function og(V){Oe.value&&(V.target.closest(".vpg-filter-portal")||Ya())}return(V,P)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["vpg-data-grid",[`vpg-font-${d.value}`,`vpg-theme-${h.value}`,{"vpg-striped":n.stripedRows},{"vpg-resizing":f.value},{"vpg-resizing-vertical":v.value}]]),style:c.normalizeStyle({height:`${b.value}px`}),onClick:og},[c.createVNode(c.Transition,{name:"vpg-toast"},{default:c.withCtx(()=>[y.value?(c.openBlock(),c.createElementBlock("div",Td,[P[19]||(P[19]=c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)),c.createTextVNode(" "+c.toDisplayString(E.value),1)])):c.createCommentVNode("",!0)]),_:1}),c.createElementVNode("div",Pd,[c.createElementVNode("div",Dd,[n.showPivot?(c.openBlock(),c.createElementBlock("div",Rd,[c.createElementVNode("button",{class:c.normalizeClass(["vpg-view-btn",{active:Fe.value==="grid"}]),onClick:P[0]||(P[0]=W=>Fe.value="grid")},[...P[20]||(P[20]=[c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),c.createTextVNode(" Grid ",-1)])],2),c.createElementVNode("button",{class:c.normalizeClass(["vpg-view-btn vpg-pivot-btn",{active:Fe.value==="pivot"}]),onClick:P[1]||(P[1]=W=>Fe.value="pivot")},[...P[21]||(P[21]=[c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})],-1),c.createTextVNode(" Pivot ",-1)])],2),c.createElementVNode("button",{class:c.normalizeClass(["vpg-view-btn vpg-chart-btn",{active:Fe.value==="chart","vpg-pro-feature":!c.unref(r)}]),title:c.unref(r)?"Chart Builder":"Chart Builder (Pro feature)",onClick:P[2]||(P[2]=W=>c.unref(r)?Fe.value="chart":null)},[P[22]||(P[22]=c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})],-1)),P[23]||(P[23]=c.createTextVNode(" Chart ",-1)),c.unref(r)?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",Vd,"Pro"))],10,Bd)])):c.createCommentVNode("",!0),Fe.value==="grid"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[n.enableSearch?(c.openBlock(),c.createElementBlock("div",Id,[g.value?(c.openBlock(),c.createElementBlock("div",Hd,[P[26]||(P[26]=c.createElementVNode("svg",{class:"vpg-search-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":P[4]||(P[4]=W=>u.value=W),type:"text",class:"vpg-search-input",placeholder:"Search all columns...",onKeydown:P[5]||(P[5]=c.withKeys(W=>{g.value=!1,u.value=""},["escape"]))},null,544),[[c.vModelText,u.value]]),u.value?(c.openBlock(),c.createElementBlock("button",{key:0,class:"vpg-search-clear",onClick:P[6]||(P[6]=W=>u.value="")},[...P[25]||(P[25]=[c.createElementVNode("svg",{class:"vpg-icon-xs",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):c.createCommentVNode("",!0)])):(c.openBlock(),c.createElementBlock("button",{key:0,class:"vpg-icon-btn",title:"Search (Ctrl+F)",onClick:P[3]||(P[3]=W=>g.value=!0)},[...P[24]||(P[24]=[c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])]))])):c.createCommentVNode("",!0),c.createElementVNode("div",Od,[P[27]||(P[27]=c.createElementVNode("span",{class:"vpg-label"},"Size:",-1)),c.createElementVNode("div",Xd,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(S,W=>c.createElementVNode("button",{key:W.value,class:c.normalizeClass(["vpg-font-size-btn",{active:d.value===W.value}]),onClick:se=>d.value=W.value},c.toDisplayString(W.label),11,Yd)),64))])]),Wa.value>0?(c.openBlock(),c.createElementBlock("div",Wd,[P[28]||(P[28]=c.createElementVNode("svg",{class:"vpg-icon",fill:"currentColor",viewBox:"0 0 20 20"},[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1)),c.createElementVNode("span",null,c.toDisplayString(Wa.value)+" filter"+c.toDisplayString(Wa.value>1?"s":""),1)])):c.createCommentVNode("",!0),u.value?(c.openBlock(),c.createElementBlock("div",_d,[c.createElementVNode("span",null,c.toDisplayString(Re.value)+" match"+c.toDisplayString(Re.value!==1?"es":""),1)])):c.createCommentVNode("",!0)],64)):c.createCommentVNode("",!0),Fe.value==="pivot"&&c.unref(s)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[c.createElementVNode("button",{class:c.normalizeClass(["vpg-config-toggle",{active:Kt.value}]),onClick:P[7]||(P[7]=W=>Kt.value=!Kt.value)},[P[29]||(P[29]=c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})],-1)),c.createTextVNode(" "+c.toDisplayString(Kt.value?"Hide":"Show")+" Config ",1)],2),c.unref(at)?(c.openBlock(),c.createElementBlock("div",jd,[...P[30]||(P[30]=[c.createElementVNode("svg",{class:"vpg-icon",fill:"currentColor",viewBox:"0 0 20 20"},[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1),c.createElementVNode("span",null,"Pivot configured",-1)])])):c.createCommentVNode("",!0)],64)):c.createCommentVNode("",!0)]),c.createElementVNode("div",Gd,[Fe.value==="grid"&&Wa.value>0?(c.openBlock(),c.createElementBlock("button",{key:0,class:"vpg-clear-filters",onClick:P[8]||(P[8]=(...W)=>c.unref(D)&&c.unref(D)(...W))},[...P[31]||(P[31]=[c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1),c.createTextVNode(" Clear Filters ",-1)])])):c.createCommentVNode("",!0),n.enableClipboard&&rt.value&&Fe.value==="grid"?(c.openBlock(),c.createElementBlock("button",{key:1,class:"vpg-icon-btn",title:"Copy selection (Ctrl+C)",onClick:_r},[...P[32]||(P[32]=[c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)])])):c.createCommentVNode("",!0),n.enableExport&&Fe.value==="grid"?(c.openBlock(),c.createElementBlock("button",{key:2,class:"vpg-export-btn",title:"Export to CSV",onClick:Hr},[...P[33]||(P[33]=[c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1),c.createTextVNode(" Export ",-1)])])):c.createCommentVNode("",!0),n.enableExport&&Fe.value==="pivot"&&c.unref(at)?(c.openBlock(),c.createElementBlock("button",{key:3,class:c.normalizeClass(["vpg-export-btn",{"vpg-export-btn-disabled":!c.unref(l)}]),disabled:!c.unref(l),title:c.unref(l)?"Export Pivot to CSV":"Export Pivot to CSV (Pro feature)",onClick:P[9]||(P[9]=W=>c.unref(l)&&Hr())},[P[34]||(P[34]=c.createElementVNode("svg",{class:"vpg-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)),c.createTextVNode(" Export Pivot"+c.toDisplayString(c.unref(l)?"":" (Pro)"),1)],10,$d)):c.createCommentVNode("",!0)])]),Fe.value==="grid"?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"tableContainerRef",ref:$i,class:"vpg-grid-container",tabindex:"0"},[n.loading?(c.openBlock(),c.createElementBlock("div",Ud,[...P[35]||(P[35]=[c.createElementVNode("div",{class:"vpg-spinner"},null,-1),c.createElementVNode("span",null,"Loading data...",-1)])])):n.data.length===0?(c.openBlock(),c.createElementBlock("div",qd,[...P[36]||(P[36]=[c.createElementVNode("div",{class:"vpg-empty-icon"},[c.createElementVNode("svg",{class:"vpg-icon-lg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),c.createElementVNode("span",null,"No data available",-1)])])):c.unref(A)===0?(c.openBlock(),c.createElementBlock("div",Zd,[P[37]||(P[37]=c.createElementVNode("div",{class:"vpg-empty-icon vpg-warning"},[c.createElementVNode("svg",{class:"vpg-icon-lg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})])],-1)),P[38]||(P[38]=c.createElementVNode("span",null,"No matching records",-1)),c.createElementVNode("button",{class:"vpg-clear-link",onClick:P[10]||(P[10]=(...W)=>c.unref(D)&&c.unref(D)(...W))}," Clear all filters ")])):(c.openBlock(),c.createElementBlock("div",Kd,[c.createElementVNode("table",{class:"vpg-table",style:c.normalizeStyle({minWidth:`${ng.value}px`})},[c.createElementVNode("thead",null,[c.createElementVNode("tr",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(L),(W,se)=>(c.openBlock(),c.createElementBlock("th",{key:W,class:c.normalizeClass(["vpg-header-cell",{"vpg-has-filter":c.unref(z)(W),"vpg-is-sorted":c.unref(Y)(W)!==null,"vpg-is-active":Oe.value===W}]),style:c.normalizeStyle({width:`${gt.value[W]||kt}px`,minWidth:`${gt.value[W]||kt}px`}),onClick:pe=>Ku(se,pe)},[c.createElementVNode("div",Qd,[c.createElementVNode("span",eu,c.toDisplayString(W),1),c.createElementVNode("div",tu,[c.unref(Y)(W)?(c.openBlock(),c.createElementBlock("span",au,[c.unref(Y)(W)==="asc"?(c.openBlock(),c.createElementBlock("svg",iu,[...P[39]||(P[39]=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1)])])):(c.openBlock(),c.createElementBlock("svg",su,[...P[40]||(P[40]=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])]))])):c.createCommentVNode("",!0),c.unref(z)(W)?(c.openBlock(),c.createElementBlock("span",ru,[...P[41]||(P[41]=[c.createElementVNode("svg",{class:"vpg-icon-xs",fill:"currentColor",viewBox:"0 0 20 20"},[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1)])])):c.createCommentVNode("",!0),P[42]||(P[42]=c.createElementVNode("span",{class:"vpg-dropdown-arrow",title:"Filter & Sort"},[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})])],-1))])]),n.enableColumnResize?(c.openBlock(),c.createElementBlock("div",{key:0,class:"vpg-resize-handle",onMousedown:pe=>Ru(W,pe)},null,40,nu)):c.createCommentVNode("",!0)],14,Jd))),128))])]),c.createElementVNode("tbody",{ref_key:"tableBodyRef",ref:jr},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(Ue.value,(W,se)=>(c.openBlock(),c.createElementBlock("tr",{key:W.id,class:"vpg-row"},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(L),(pe,De)=>(c.openBlock(),c.createElementBlock("td",{key:pe,class:c.normalizeClass(["vpg-cell",{"vpg-selected":ag(se,De),"vpg-is-number":c.unref(F)(pe).type==="number"}]),"data-row":se,"data-col":De,style:c.normalizeStyle({width:`${gt.value[pe]||kt}px`,minWidth:`${gt.value[pe]||kt}px`}),onMousedown:Te=>eg(se,De,Te),onMouseenter:Te=>tg(se,De)},c.toDisplayString(rg(W.original[pe],pe)),47,ou))),128))]))),128))],512)],4)]))],512)):Fe.value==="pivot"?(c.openBlock(),c.createElementBlock("div",lu,[Kt.value&&c.unref(s)?(c.openBlock(),c.createElementBlock("div",cu,[c.createVNode(Br,{"available-fields":c.unref(Ne),"row-fields":c.unref(oe),"column-fields":c.unref(ne),"value-fields":c.unref(ce),"show-row-totals":c.unref(ve),"show-column-totals":c.unref(Ae),"calculated-fields":ct.value,"onUpdate:showRowTotals":P[11]||(P[11]=W=>ve.value=W),"onUpdate:showColumnTotals":P[12]||(P[12]=W=>Ae.value=W),onClearConfig:c.unref(te),onDragStart:Yu,onDragEnd:Wu,onUpdateAggregation:c.unref(J),onAddRowField:c.unref(Ye),onRemoveRowField:c.unref(Pt),onAddColumnField:c.unref(U),onRemoveColumnField:c.unref(H),onAddValueField:c.unref(ee),onRemoveValueField:c.unref(_),onAddCalculatedField:Hu,onRemoveCalculatedField:Ou,onUpdateCalculatedField:Xu},null,8,["available-fields","row-fields","column-fields","value-fields","show-row-totals","show-column-totals","calculated-fields","onClearConfig","onUpdateAggregation","onAddRowField","onRemoveRowField","onAddColumnField","onRemoveColumnField","onAddValueField","onRemoveValueField"])])):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(["vpg-pivot-main",{"vpg-full-width":!Kt.value}])},[c.createVNode(Vr,{"row-fields":c.unref(oe),"column-fields":c.unref(ne),"value-fields":c.unref(ce),"calculated-fields":ct.value,"is-configured":c.unref(at),"dragging-field":Gi.value,"pivot-result":c.unref(ye),"font-size":d.value,"active-filters":ge.value,"total-row-count":c.unref(M),"filtered-row-count":c.unref(A),onAddRowField:c.unref(Ye),onRemoveRowField:c.unref(Pt),onAddColumnField:c.unref(U),onRemoveColumnField:c.unref(H),onAddValueField:c.unref(ee),onRemoveValueField:c.unref(_),onUpdateAggregation:c.unref(J),onReorderRowFields:_u,onReorderColumnFields:ju},null,8,["row-fields","column-fields","value-fields","calculated-fields","is-configured","dragging-field","pivot-result","font-size","active-filters","total-row-count","filtered-row-count","onAddRowField","onRemoveRowField","onAddColumnField","onRemoveColumnField","onAddValueField","onRemoveValueField","onUpdateAggregation"])],2)])):Fe.value==="chart"?(c.openBlock(),c.createElementBlock("div",hu,[ge.value&&ge.value.length>0?(c.openBlock(),c.createElementBlock("div",du,[P[43]||(P[43]=c.createElementVNode("svg",{class:"vpg-icon",fill:"currentColor",viewBox:"0 0 20 20"},[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1)),c.createElementVNode("span",null,"Chart showing "+c.toDisplayString(c.unref(A).toLocaleString())+" of "+c.toDisplayString(c.unref(M).toLocaleString())+" records",1),c.createElementVNode("button",{class:"vpg-chart-clear-filters",onClick:P[13]||(P[13]=(...W)=>c.unref(D)&&c.unref(D)(...W))}," Clear filters ")])):c.createCommentVNode("",!0),c.createVNode(mc,{data:X.value,theme:h.value,onConfigChange:Iu},null,8,["data","theme"])])):c.createCommentVNode("",!0),c.createElementVNode("div",uu,[c.createElementVNode("div",gu,[Fe.value==="grid"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[n.enablePagination?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("span",null,c.toDisplayString(it.value.toLocaleString())+"-"+c.toDisplayString(je.value.toLocaleString()),1),P[44]||(P[44]=c.createElementVNode("span",{class:"vpg-separator"},"of",-1)),c.createElementVNode("span",null,c.toDisplayString(Re.value.toLocaleString()),1),Re.value!==c.unref(M)?(c.openBlock(),c.createElementBlock("span",pu," ("+c.toDisplayString(c.unref(M).toLocaleString())+" total) ",1)):c.createCommentVNode("",!0)],64)):c.unref(A)===c.unref(M)&&Re.value===c.unref(M)?(c.openBlock(),c.createElementBlock("span",fu,c.toDisplayString(c.unref(M).toLocaleString())+" records",1)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[c.createElementVNode("span",mu,c.toDisplayString(Re.value.toLocaleString()),1),P[45]||(P[45]=c.createElementVNode("span",{class:"vpg-separator"},"of",-1)),c.createElementVNode("span",null,c.toDisplayString(c.unref(M).toLocaleString()),1),P[46]||(P[46]=c.createElementVNode("span",{class:"vpg-separator"},"records",-1))],64))],64)):Fe.value==="pivot"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[P[47]||(P[47]=c.createElementVNode("span",{class:"vpg-pivot-label"},"Pivot Table",-1)),P[48]||(P[48]=c.createElementVNode("span",{class:"vpg-separator"},"•",-1)),c.createElementVNode("span",null,c.toDisplayString(c.unref(M).toLocaleString())+" source records",1)],64)):Fe.value==="chart"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[P[49]||(P[49]=c.createElementVNode("span",{class:"vpg-chart-label"},"Chart Builder",-1)),P[50]||(P[50]=c.createElementVNode("span",{class:"vpg-separator"},"•",-1)),c.createElementVNode("span",null,c.toDisplayString(c.unref(M).toLocaleString())+" records",1)],64)):c.createCommentVNode("",!0)]),n.enablePagination&&Fe.value==="grid"&&Be.value>1?(c.openBlock(),c.createElementBlock("div",xu,[c.createElementVNode("button",{class:"vpg-page-btn",disabled:p.value===1,onClick:P[14]||(P[14]=W=>p.value=1)},[...P[51]||(P[51]=[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})],-1)])],8,bu),c.createElementVNode("button",{class:"vpg-page-btn",disabled:p.value===1,onClick:va},[...P[52]||(P[52]=[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])],8,vu),c.createElementVNode("span",yu," Page "+c.toDisplayString(p.value)+" of "+c.toDisplayString(Be.value),1),c.createElementVNode("button",{class:"vpg-page-btn",disabled:p.value===Be.value,onClick:Dt},[...P[53]||(P[53]=[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],8,wu),c.createElementVNode("button",{class:"vpg-page-btn",disabled:p.value===Be.value,onClick:P[15]||(P[15]=W=>p.value=Be.value)},[...P[54]||(P[54]=[c.createElementVNode("svg",{class:"vpg-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 5l7 7-7 7M5 5l7 7-7 7"})],-1)])],8,ku)])):c.createCommentVNode("",!0),Fe.value==="grid"&&Jt.value&&Jt.value.count>1?(c.openBlock(),c.createElementBlock("div",Cu,[c.createElementVNode("span",Au,[P[55]||(P[55]=c.createElementVNode("span",{class:"vpg-stat-label"},"Count:",-1)),c.createElementVNode("span",Su,c.toDisplayString(Jt.value.count),1)]),Jt.value.numericCount>0?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[P[58]||(P[58]=c.createElementVNode("span",{class:"vpg-stat-divider"},"|",-1)),c.createElementVNode("span",Eu,[P[56]||(P[56]=c.createElementVNode("span",{class:"vpg-stat-label"},"Sum:",-1)),c.createElementVNode("span",Mu,c.toDisplayString($r(Jt.value.sum)),1)]),P[59]||(P[59]=c.createElementVNode("span",{class:"vpg-stat-divider"},"|",-1)),c.createElementVNode("span",Lu,[P[57]||(P[57]=c.createElementVNode("span",{class:"vpg-stat-label"},"Avg:",-1)),c.createElementVNode("span",Nu,c.toDisplayString($r(Jt.value.avg)),1)])],64)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),c.createElementVNode("div",Fu,[c.unref(o)?(c.openBlock(),c.createElementBlock("div",zu,[...P[60]||(P[60]=[c.createElementVNode("span",{class:"vpg-demo-badge"},"DEMO",-1),c.createElementVNode("span",null,"Pro features enabled",-1),c.createElementVNode("a",{href:"https://tiny-pivot.com/#pricing",target:"_blank",rel:"noopener"},"Get License →",-1)])])):c.unref(i)?(c.openBlock(),c.createElementBlock("span",Tu,[...P[61]||(P[61]=[c.createStaticVNode('<a href="https://tiny-pivot.com" target="_blank" rel="noopener" data-v-ebff787b><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-ebff787b><rect x="3" y="3" width="7" height="7" data-v-ebff787b></rect><rect x="14" y="3" width="7" height="7" data-v-ebff787b></rect><rect x="14" y="14" width="7" height="7" data-v-ebff787b></rect><rect x="3" y="14" width="7" height="7" data-v-ebff787b></rect></svg> Powered by TinyPivot </a>',1)])])):c.createCommentVNode("",!0)])]),n.enableVerticalResize?(c.openBlock(),c.createElementBlock("div",{key:3,class:"vpg-vertical-resize-handle",onMousedown:Bu},[...P[62]||(P[62]=[c.createElementVNode("div",{class:"vpg-resize-grip"},[c.createElementVNode("span"),c.createElementVNode("span"),c.createElementVNode("span")],-1)])],32)):c.createCommentVNode("",!0),(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[Oe.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"vpg-filter-portal",style:c.normalizeStyle({position:"fixed",top:`${Xa.value.top}px`,left:`${Xa.value.left}px`,maxHeight:`${Xa.value.maxHeight}px`,zIndex:9999})},[c.createVNode(Lr,{"column-id":Oe.value,"column-name":Oe.value,stats:c.unref(F)(Oe.value),"selected-values":c.unref(T)(Oe.value),"sort-direction":c.unref(Y)(Oe.value),"numeric-range":c.unref(he)(Oe.value),onFilter:P[16]||(P[16]=W=>$u(Oe.value,W)),onRangeFilter:P[17]||(P[17]=W=>Uu(Oe.value,W)),onSort:P[18]||(P[18]=W=>qu(Oe.value,W)),onClose:Ya},null,8,["column-id","column-name","stats","selected-values","sort-direction","numeric-range"])],4)):c.createCommentVNode("",!0)]))],6))}}),[["__scopeId","data-v-ebff787b"]]);we.ColumnFilter=Lr,we.DataGrid=Pu,we.PivotConfig=Br,we.PivotSkeleton=Vr,we.configureLicenseSecret=Kc,we.copyToClipboard=Pr,we.enableDemoMode=Zc,we.exportPivotToCSV=Tr,we.exportToCSV=zr,we.formatCellValue=is,we.formatSelectionForClipboard=Dr,we.getAggregationLabel=ea,we.getColumnUniqueValues=as,we.setLicenseKey=qc,we.useColumnResize=$c,we.useExcelGrid=Fr,we.useGlobalSearch=jc,we.useLicense=ba,we.usePagination=_c,we.usePivotTable=Rr,we.useRowSelection=Gc,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});
|
|
10
949
|
//# sourceMappingURL=tinypivot-vue.umd.cjs.map
|