apexcharts 7.2.0 → 7.4.0
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/LICENSE +30 -11
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +545 -463
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.esm.js +1149 -801
- package/dist/apexcharts.js +684 -254
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +684 -254
- package/dist/area.common.js +1 -1
- package/dist/area.esm.js +1 -1
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +20 -10
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +20 -10
- package/dist/bubble.common.js +1 -1
- package/dist/bubble.esm.js +1 -1
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +20 -10
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +20 -10
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +545 -463
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +20 -10
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +364 -26
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/drilldown.js +1 -1
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +2 -2
- package/dist/features/exports.esm.js +12 -14
- package/dist/features/exports.js +2 -2
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +14 -1
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/legend.js +1 -1
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +38 -38
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +11 -11
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +1 -1
- package/dist/features/renderer-canvas.esm.js +1 -1
- package/dist/features/renderer-canvas.js +1 -1
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +11 -11
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +1 -1
- package/dist/features/streamgraph.esm.js +1 -1
- package/dist/features/streamgraph.js +1 -1
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +172 -25
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +1 -1
- package/dist/features/trellis.esm.js +1 -1
- package/dist/features/trellis.js +1 -1
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +2 -2
- package/dist/features/weave.esm.js +180 -2
- package/dist/features/weave.js +2 -2
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +20 -10
- package/dist/line.common.js +1 -1
- package/dist/line.esm.js +1 -1
- package/dist/line.js +1 -1
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +1 -1
- package/dist/radar.esm.js +1 -1
- package/dist/radar.js +1 -1
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +20 -10
- package/dist/rangeArea.common.js +1 -1
- package/dist/rangeArea.esm.js +1 -1
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +20 -10
- package/dist/scatter.common.js +1 -1
- package/dist/scatter.esm.js +1 -1
- package/dist/streamgraph.common.js +1 -1
- package/dist/streamgraph.esm.js +1 -1
- package/dist/sunburst.common.js +1 -1
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/treemap.js +1 -1
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +1 -1
- package/dist/unit.esm.js +79 -79
- package/dist/unit.js +1 -1
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +20 -10
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +20 -10
- package/package.json +2 -2
- package/src/apexcharts.js +39 -15
- package/src/charts/common/bar/Helpers.js +31 -12
- package/src/modules/Data.js +8 -2
- package/src/modules/Exports.js +14 -12
- package/src/modules/Formatters.js +24 -1
- package/src/modules/Range.js +28 -1
- package/src/modules/Toolbar.js +112 -2
- package/src/modules/ZoomPanSelection.js +85 -7
- package/src/modules/accessibility/KeyboardNavigation.js +14 -0
- package/src/modules/axes/YAxis.js +12 -15
- package/src/modules/helpers/UpdateHelpers.js +25 -8
- package/src/modules/settings/Globals.js +5 -10
- package/src/modules/settings/Options.js +15 -0
- package/src/modules/weave/PluginAPI.js +57 -1
- package/src/modules/weave/WeaveHost.js +148 -0
- package/src/ssr/DOMShim.js +50 -0
- package/src/types/internal.d.ts +1 -1
- package/src/utils/Utils.js +6 -9
- package/types/apexcharts.d.ts +17 -0
|
@@ -38,7 +38,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
/*!
|
|
41
|
-
* ApexCharts v7.
|
|
41
|
+
* ApexCharts v7.4.0
|
|
42
42
|
* (c) 2018-2026 ApexCharts
|
|
43
43
|
*/
|
|
44
44
|
import * as _core from "apexcharts/core";
|
|
@@ -175,14 +175,14 @@ const l = class {
|
|
|
175
175
|
const t2 = __spreadProps(__spreadValues({}, n2), { signatureVerified: true });
|
|
176
176
|
return void (this.licenseKey === e2 ? this.publish(t2) : this.notify(t2));
|
|
177
177
|
}
|
|
178
|
-
const
|
|
179
|
-
this.licenseKey === e2 ? this.publish(
|
|
178
|
+
const u = "Invalid license key. The license signature does not verify.", h = { data: i2.data, expired: false, message: u, signatureVerified: true, valid: false };
|
|
179
|
+
this.licenseKey === e2 ? this.publish(h) : this.notify(h), t(`[Apex] ${u}`);
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
l.publicKeysSpki = ["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="], l.verdicts = /* @__PURE__ */ new Map(), l.verifying = /* @__PURE__ */ new Set(), l.warnedUnverifiable = false, l.epoch = 0;
|
|
184
184
|
let o = l;
|
|
185
|
-
const
|
|
185
|
+
const j = class {
|
|
186
186
|
static applyStyles(e2) {
|
|
187
187
|
Object.assign(e2.style, this.CRITICAL_STYLES, { backgroundImage: this.createWatermarkPattern(), backgroundRepeat: "repeat" });
|
|
188
188
|
}
|
|
@@ -240,8 +240,8 @@ const A = class {
|
|
|
240
240
|
})));
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
|
-
|
|
244
|
-
let
|
|
243
|
+
j.WATERMARK_ATTR = "data-apexcharts-watermark", j.WATERMARK_TEXT = "APEXCHARTS", j.ATTR = "data-apexcharts-watermark", j.CRITICAL_STYLES = { bottom: "0", display: "block", left: "0", msUserSelect: "none", opacity: "1", pointerEvents: "none", position: "absolute", right: "0", top: "0", userSelect: "none", visibility: "visible", webkitUserSelect: "none", zIndex: "10000" }, j.managed = /* @__PURE__ */ new Set(), j.subscribed = false;
|
|
244
|
+
let C = j;
|
|
245
245
|
const PRICING_URL = "https://apexcharts.com/pricing";
|
|
246
246
|
let _perspectivesTokenDecoded = false;
|
|
247
247
|
const enforced = /* @__PURE__ */ new Set();
|
|
@@ -295,15 +295,15 @@ function licensedForPremium(key) {
|
|
|
295
295
|
return typeof plan === "string" && PREMIUM_PLANS.has(plan.toLowerCase());
|
|
296
296
|
}
|
|
297
297
|
function reinstateWatermark(ctx, elWrap) {
|
|
298
|
-
const node =
|
|
298
|
+
const node = C.add(elWrap, { manage: false });
|
|
299
299
|
if (!node || typeof MutationObserver === "undefined") return;
|
|
300
300
|
if (ctx._wmNodeObserver && ctx._wmObservedNode === node) return;
|
|
301
301
|
if (ctx._wmNodeObserver) ctx._wmNodeObserver.disconnect();
|
|
302
302
|
const nodeObs = new MutationObserver(() => {
|
|
303
|
-
const n2 =
|
|
303
|
+
const n2 = C.node(elWrap);
|
|
304
304
|
if (!n2) return;
|
|
305
305
|
nodeObs.disconnect();
|
|
306
|
-
|
|
306
|
+
C.applyStyles(n2);
|
|
307
307
|
nodeObs.takeRecords();
|
|
308
308
|
nodeObs.observe(n2, { attributes: true, attributeFilter: ["style"] });
|
|
309
309
|
});
|
|
@@ -315,7 +315,7 @@ function addWatermark(ctx, elWrap) {
|
|
|
315
315
|
reinstateWatermark(ctx, elWrap);
|
|
316
316
|
if (typeof MutationObserver === "undefined" || ctx._wmWrapObserver) return;
|
|
317
317
|
const wrapObs = new MutationObserver(() => {
|
|
318
|
-
if (!
|
|
318
|
+
if (!C.node(elWrap)) reinstateWatermark(ctx, elWrap);
|
|
319
319
|
});
|
|
320
320
|
wrapObs.observe(elWrap, { childList: true });
|
|
321
321
|
ctx._wmWrapObserver = wrapObs;
|
|
@@ -331,7 +331,7 @@ function teardownWatermark(ctx, elWrap) {
|
|
|
331
331
|
}
|
|
332
332
|
ctx._wmObservedNode = null;
|
|
333
333
|
const wrap = elWrap || ctx.w && ctx.w.dom && ctx.w.dom.elWrap;
|
|
334
|
-
if (wrap)
|
|
334
|
+
if (wrap) C.remove(wrap, { manage: false });
|
|
335
335
|
}
|
|
336
336
|
function notifyTrial(ctx, key, features) {
|
|
337
337
|
if (ctx._premiumLicenseNotified) return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexStoryboard={})}(this,function(e){"use strict";var t=Object.defineProperty,n=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,o=(e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,l=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&o(e,n,t[n]);if(s)for(var n of s(t))a.call(t,n)&&o(e,n,t[n]);return e},c=(e,t)=>n(e,i(t));const d=globalThis.ApexCharts,u=globalThis.ApexCharts.__internals.__apex_Environment_Environment,h=globalThis.ApexCharts.__internals;h.__apex_Animations,h.__apex_Animations_computeStagger,h.__apex_Animations_applyAnimationPolicy;const p=h.__apex_Animations_prefersReducedMotion;h.__apex_Animations_applyProgressiveReveal;const f=globalThis.console;function v(e,...t){f.error(e,...t)}function y(e){f.warn(e)}const m="APEX-",g=new Date("2027-07-31T00:00:00Z"),b="__apex_license_v1__";function x(){const e=globalThis;let t=e[b];return t||(t={key:null,listeners:new Set,result:null},e[b]=t),t}const w=class{static get licenseKey(){return x().key}static set licenseKey(e){x().key=e}static get listeners(){return x().listeners}static get validationResult(){return x().result}static set validationResult(e){x().result=e}static getKey(){return this.licenseKey}static getLicenseStatus(){return this.licenseKey?(this.validationResult=this.validateKey(this.licenseKey),this.validationResult):{expired:!1,signatureVerified:!1,valid:!1}}static isKeyValid(e){return!!e&&this.validateKey(e).valid}static isLicenseValid(){return this.getLicenseStatus().valid}static onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}static setLicense(e){var t,n;if(!e)return this.licenseKey=null,void this.publish({expired:!1,signatureVerified:!1,valid:!1});const i=this.validateKey(e);i.valid||e===this.licenseKey||!(null==(n=this.validationResult)?void 0:n.valid)?(this.licenseKey=e,this.publish(i),i.valid||v(`[Apex] ${i.message}`)):y(`[Apex] Ignoring license key: ${null!=(t=i.message)?t:"it is not valid"} A valid license is already active on this page.`)}static validateKey(e){const t=this.parseKey(e),n=this.validateStructure(e,t);if(!n.valid||!(null==t?void 0:t.signature))return n;const i=this.verdicts.get(e);return!1===i?{data:t.data,expired:!1,message:"Invalid license key. The license signature does not verify.",signatureVerified:!0,valid:!1}:(void 0===i&&this.verifySignature(e,t,n),c(l({},n),{signatureVerified:!0===i}))}static _resetSignatureState(){this.verdicts.clear(),this.verifying.clear(),this.warnedUnverifiable=!1,this.epoch++}static base64ToBytes(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(4*Math.ceil(t.length/4),"="),i=globalThis.atob;if("function"!=typeof i)throw new Error("no base64 decoder available");const s=i(n),r=new Uint8Array(s.length);for(let e=0;e<s.length;e++)r[e]=s.charCodeAt(e);return r}static canonicalPayload(e){const t=e.domains&&e.domains.length>0?e.domains.join(","):"";return`v1|${e.issueDate}|${e.expiryDate}|${e.plan}|${t}`}static notify(e){for(const t of this.listeners)try{t(e)}catch(e){}}static parseKey(e){if("string"!=typeof e||!e.startsWith(m))return null;const t=e.slice(5);if(!t)return null;try{const e=(new TextDecoder).decode(this.base64ToBytes(t)),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{data:{domains:Array.isArray(n.domains)?n.domains:void 0,expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0},signature:"string"==typeof n.sig&&n.sig?n.sig:null}:null}catch(e){return null}}static publish(e){this.validationResult=e,this.notify(e)}static validateStructure(e,t){const n=e=>({expired:!1,message:e,signatureVerified:!1,valid:!1});if("string"!=typeof e||!e.startsWith(m))return n('Invalid license key format. License key must start with "APEX-".');if(!t)return n("Invalid license key. Unable to decode license data.");const{data:i,signature:s}=t;if(!s&&new Date>=g)return n("This license key is in the old unsigned format, which is no longer accepted. Please request a replacement key.");if(new Date(i.expiryDate)<new Date)return{data:i,expired:!0,message:`License expired on ${i.expiryDate}. Please renew your license.`,signatureVerified:!1,valid:!1};if(i.domains&&i.domains.length>0){const e="undefined"==typeof location?"":location.hostname;if(!i.domains.some(t=>e===t||e.endsWith(`.${t}`)))return{data:i,expired:!1,message:`License is not valid for this domain (${e}). Allowed domains: ${i.domains.join(", ")}.`,signatureVerified:!1,valid:!1}}return{data:i,expired:!1,signatureVerified:!1,valid:!0}}static verifySignature(e,t,n){return i=this,s=null,r=function*(){var i;if(this.verifying.has(e)||this.verdicts.has(e))return;this.verifying.add(e);const s=this.epoch,r=null==(i=globalThis.crypto)?void 0:i.subtle;if(!r||0===this.publicKeysSpki.length)return this.verifying.delete(e),void(this.warnedUnverifiable||(this.warnedUnverifiable=!0,y(r?"[Apex] No license signing key is configured in this build, so license signatures cannot be verified.":"[Apex] Web Crypto is unavailable (a secure context is required), so the license signature cannot be verified.")));const a=(new TextEncoder).encode(this.canonicalPayload(t.data));let o=!1;for(const e of this.publicKeysSpki){try{const n=yield r.importKey("spki",this.base64ToBytes(e),{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]);o=yield r.verify({hash:"SHA-256",name:"ECDSA"},n,this.base64ToBytes(t.signature),a)}catch(e){o=!1}if(o)break}if(this.verifying.delete(e),this.epoch!==s)return;if(this.verdicts.set(e,o),o){const t=c(l({},n),{signatureVerified:!0});return void(this.licenseKey===e?this.publish(t):this.notify(t))}const d="Invalid license key. The license signature does not verify.",u={data:t.data,expired:!1,message:d,signatureVerified:!0,valid:!1};this.licenseKey===e?this.publish(u):this.notify(u),v(`[Apex] ${d}`)},new Promise((e,t)=>{var n=e=>{try{o(r.next(e))}catch(e){t(e)}},a=e=>{try{o(r.throw(e))}catch(e){t(e)}},o=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,a);o((r=r.apply(i,s)).next())});var i,s,r}};w.publicKeysSpki=["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="],w.verdicts=new Map,w.verifying=new Set,w.warnedUnverifiable=!1,w.epoch=0;let _=w;const A=class{static applyStyles(e){Object.assign(e.style,this.CRITICAL_STYLES,{backgroundImage:this.createWatermarkPattern(),backgroundRepeat:"repeat"})}static node(e){return e?e.querySelector(`[${this.WATERMARK_ATTR}]`):null}static add(e,t){return e&&"undefined"!=typeof document?(this.setManaged(e,t),this.paint(e)):null}static exists(e){return!!this.node(e)}static remove(e,t){e&&(this.setManaged(e,t),this.erase(e))}static untrack(e){this.managed.delete(e)}static createWatermarkPattern(){const e=this.WATERMARK_TEXT;return`url("data:image/svg+xml,${encodeURIComponent(`\n <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200">\n <text\n x="50%"\n y="50%"\n dominant-baseline="middle"\n text-anchor="middle"\n font-family="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif"\n font-size="18"\n font-weight="600"\n fill="rgba(134, 134, 134, 0.1)"\n transform="rotate(-35, 100, 60)"\n >${e}</text>\n </svg>\n `.trim())}")`}static erase(e){var t;null==(t=this.node(e))||t.remove()}static paint(e){let t=this.node(e);return t||(t=document.createElement("div"),t.setAttribute(this.WATERMARK_ATTR,""),e.appendChild(t)),this.applyStyles(t),"function"==typeof getComputedStyle&&"static"===getComputedStyle(e).position&&(e.style.position="relative"),t}static reconcile(){const e=_.isLicenseValid();for(const t of this.managed)t.isConnected?e?this.erase(t):this.paint(t):this.managed.delete(t)}static setManaged(e,t){!1!==(null==t?void 0:t.manage)?this.track(e):this.managed.delete(e)}static track(e){this.managed.add(e),this.subscribed||(this.subscribed=!0,_.onChange(()=>{this.reconcile()}))}};A.WATERMARK_ATTR="data-apexcharts-watermark",A.WATERMARK_TEXT="APEXCHARTS",A.ATTR="data-apexcharts-watermark",A.CRITICAL_STYLES={bottom:"0",display:"block",left:"0",msUserSelect:"none",opacity:"1",pointerEvents:"none",position:"absolute",right:"0",top:"0",userSelect:"none",visibility:"visible",webkitUserSelect:"none",zIndex:"10000"},A.managed=new Set,A.subscribed=!1;let S=A;const k="https://apexcharts.com/pricing";let T=!1;const O=new Set;function E(){T=!0,K()}const I=new Set(["premium","enterprise"]);function C(e,t){const n=S.add(t,{manage:!1});if(!n||"undefined"==typeof MutationObserver)return;if(e._wmNodeObserver&&e._wmObservedNode===n)return;e._wmNodeObserver&&e._wmNodeObserver.disconnect();const i=new MutationObserver(()=>{const e=S.node(t);e&&(i.disconnect(),S.applyStyles(e),i.takeRecords(),i.observe(e,{attributes:!0,attributeFilter:["style"]}))});i.observe(n,{attributes:!0,attributeFilter:["style"]}),e._wmNodeObserver=i,e._wmObservedNode=n}function R(e,t){e._wmWrapObserver&&(e._wmWrapObserver.disconnect(),e._wmWrapObserver=null),e._wmNodeObserver&&(e._wmNodeObserver.disconnect(),e._wmNodeObserver=null),e._wmObservedNode=null;const n=t||e.w&&e.w.dom&&e.w.dom.elWrap;n&&S.remove(n,{manage:!1})}function P(e,t){try{if(!u.isBrowser())return;if(e&&e.globals&&e.globals.isDestroyed)return void O.delete(t);const n=e&&e.dom&&e.dom.elWrap;if(!n)return;const i=function(e,t){const n=e&&e.config&&e.config.chart||{},i=[];"unit"===n.type&&i.push("unit"),"raincloud"===n.requestedType&&i.push("raincloud"),t.trellis&&"function"==typeof t.trellis.isActive&&t.trellis.isActive()&&i.push("trellis"),t.storyboard&&t.storyboard._used&&i.push("storyboard");const s=n.link;return t.linkedViews&&s&&(!0===s.enabled||"function"==typeof s.dimension)&&i.push("link"),t.ink&&n.ink&&!0===n.ink.enabled&&i.push("ink"),t.measure&&n.measure&&!0===n.measure.enabled&&i.push("measure"),t.contextMenu&&n.contextMenu&&!0===n.contextMenu.enabled&&i.push("context-menu"),t.perspectives&&(t.perspectives._used||T)&&i.push("perspectives"),t.history&&n.history&&!0===n.history.enabled&&i.push("history"),i}(e,t);if(0===i.length)return O.delete(t),void R(t,n);O.add(t);const s=function(e){const t=e&&e.config&&e.config.chart&&e.config.chart.license;if(t)return t;const n=_.getKey();if(n)return n;const i=u.getApex();return i&&i.license?i.license:null}(e);if(function(e){if(!e)return!1;const t=_.validateKey(e);if(!t.valid)return!1;const n=t.data&&t.data.plan;return"string"==typeof n&&I.has(n.toLowerCase())}(s))return void R(t,n);!function(e,t){if(C(e,t),"undefined"==typeof MutationObserver||e._wmWrapObserver)return;const n=new MutationObserver(()=>{S.node(t)||C(e,t)});n.observe(t,{childList:!0}),e._wmWrapObserver=n}(t,n),function(e,t,n){if(e._premiumLicenseNotified)return;e._premiumLicenseNotified=!0;const i=n.length>1;if(!t)return void console.warn(`[ApexCharts] Premium feature${i?"s":""} in use (${n.join(", ")}) without a license. Running in trial mode with a watermark. Get a license: ${k}`);const s=_.validateKey(t);if(s.valid){const e=s.data&&s.data.plan||"current";return void console.warn(`[ApexCharts] Premium feature${i?"s":""} in use (${n.join(", ")}) require a Premium or Enterprise license; the ${e} plan does not include ${i?"them":"it"}. Running in trial mode with a watermark. Upgrade: ${k}`)}t!==_.getKey()&&console.error(`[Apex] ${s.message}`)}(t,s,i)}catch(e){}}function K(){if(!u.isBrowser())return;const e=new Set,t=u.getApex(),n=t&&t._chartInstances;Array.isArray(n)&&n.forEach(t=>{const n=t&&t.chart;n&&n.w&&!n.w.globals.isDestroyed&&(e.add(n),P(n.w,n))}),Array.from(O).forEach(t=>{const n=t&&t.w,i=n&&n.dom&&n.dom.elWrap;n&&!n.globals.isDestroyed&&i&&!1!==i.isConnected?e.has(t)||P(n,t):O.delete(t)})}_.onChange(K);const D=globalThis.ApexCharts.__internals.__apex_Utils;function $(e,t){const n=null!=e,i=null!=t;return n||i?{min:n?e:null,max:i?t:null}:null}function M(e){return Array.isArray(e)?e.map(e=>Array.isArray(e)?e.slice():e):[]}function L(e,t){return"function"==typeof e&&t?e===t.addXaxisAnnotation?"xaxis":e===t.addYaxisAnnotation?"yaxis":e===t.addPointAnnotation?"point":null:null}function N(e,t){const n=e.config.annotations?D.clone(e.config.annotations):null,i=[],s=e.globals.memory&&e.globals.memory.methodsToExec||[];for(const e of s){if(!e||"addAnnotation"!==e.label)continue;const n=L(e.method,t);n&&i.push({kind:n,params:D.clone(e.params)})}return{static:n,dynamic:i}}function j(e){const t=e&&e.measure;if(!t||"function"!=typeof t.getPins)return null;const n=t.getPins();return Array.isArray(n)&&n.length?{pins:n}:null}function U(e,t,{animate:n=!0,mergeOptions:i}={}){var s,r;if(!e||!t)return;"number"==typeof t.v&&t.v>1&&console.warn(`[apexcharts] ViewState v${t.v} is newer than this build understands (v1); applying best-effort.`),e.clearAnnotations();const a=i?D.clone(i):{},o=t.window&&t.window.xaxis;a.xaxis=Object.assign({},a.xaxis,o?{min:null!=(s=o.min)?s:void 0,max:null!=(r=o.max)?r:void 0}:{min:void 0,max:void 0});const l=t.window&&t.window.yaxis;if(Array.isArray(l)&&(a.yaxis=l.map(e=>{var t,n;return e?{min:null!=(t=e.min)?t:void 0,max:null!=(n=e.max)?n:void 0}:{}})),t.theme){const e={};null!=t.theme.mode&&(e.mode=t.theme.mode),null!=t.theme.palette&&(e.palette=t.theme.palette),Object.keys(e).length&&(a.theme=Object.assign({},a.theme,e))}t.annotations&&t.annotations.static&&(a.annotations=D.clone(t.annotations.static)),e.updateOptions(a,!1,n,!1,!1),function(e,t){if(!e||!t)return;const n=e.w;n.interact.zoomed=!!t.zoomed,function(e,t,n){const i=e.w;if(null==t&&null==n)return;const s=i.globals.seriesNames||[],r=new Set([...t||[],...n||[]]),a=new Set([...i.globals.collapsedSeriesIndices||[],...i.globals.ancillaryCollapsedSeriesIndices||[]]);for(let t=0;t<s.length;t++){const n=s[t];if(null==n)continue;const i=r.has(t),o=a.has(t);i&&!o?e.hideSeries(n):!i&&o&&e.showSeries(n)}}(e,t.collapsed,t.ancillaryCollapsed),t.annotations&&Array.isArray(t.annotations.dynamic)&&t.annotations.dynamic.forEach(t=>{const n=function(e){switch(e){case"xaxis":return"addXaxisAnnotation";case"yaxis":return"addYaxisAnnotation";case"point":return"addPointAnnotation";default:return null}}(t.kind);n&&"function"==typeof e[n]&&e[n](t.params,!0)});(function(e,t){Array.isArray(t)&&(e.w.interact.selectedDataPoints=M(t))})(e,t.selectedDataPoints),t.locale&&t.locale!==n.config.chart.defaultLocale&&e.setLocale(t.locale);e.measure&&"function"==typeof e.measure.setPins&&e.measure.setPins(t.measure&&t.measure.pins||[])}(e,t)}const B="apex";function W(e){return function(e){if("undefined"!=typeof Buffer)return Buffer.from(e,"utf-8").toString("base64");const t=(new TextEncoder).encode(e);let n="";for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function V(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";return function(e){if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return(new TextDecoder).decode(n)}(t)}class z{constructor(e,t){this.w=e,this.ctx=t,this._saved=[],this._counter=0,this._used=!1}capture(){const e={v:1,view:function(e,t){var n,i;const s=e.config.xaxis||{},r=(Array.isArray(e.config.yaxis)?e.config.yaxis:e.config.yaxis?[e.config.yaxis]:[]).map(e=>$(e&&e.min,e&&e.max)),a=r.some(e=>null!==e),o=e.config.theme,l=t&&t.drilldown;return{v:1,window:{xaxis:$(s.min,s.max),yaxis:a?r:null},zoomed:!!e.interact.zoomed,collapsed:(e.globals.collapsedSeriesIndices||[]).slice(),ancillaryCollapsed:(e.globals.ancillaryCollapsedSeriesIndices||[]).slice(),selectedDataPoints:M(e.interact.selectedDataPoints),theme:o?{mode:null!=(n=o.mode)?n:null,palette:null!=(i=o.palette)?i:null}:null,locale:e.config.chart&&e.config.chart.defaultLocale||null,annotations:N(e,t),drill:l&&l.depth>0?{path:l.path.slice()}:null,measure:j(t)}}(this.w,this.ctx)},t=this._serializableDelta();return t&&Object.keys(t).length&&(e.options=t),e}_serializableDelta(){const e=this.w.config,t=e.chart&&e.chart.perspectives&&e.chart.perspectives.serializeOptions||["theme","xaxis","yaxis","title","subtitle"],n={};return t.forEach(t=>{if(void 0!==e[t]){const i=function(e){try{return JSON.parse(JSON.stringify(e))}catch(e){return}}(e[t]);void 0!==i&&(n[t]=i)}}),n}encode(e){const t=e||this.capture();return W(JSON.stringify(t))}decode(e){return z.decode(e)}toURL(){if(!u.isBrowser())return"";const e=this.encode(this.capture()),t=new URL(window.location.href);return t.hash=`${B}=${e}`,t.toString()}apply(e,t={}){const n="string"==typeof e?z.decode(e):e;if(!n||!n.view)return;this._used=!0,P(this.w,this.ctx);const i=void 0===t.animate||t.animate,s=D.extend(n.options?D.clone(n.options):{},t.mergeOptions||{}),r=Object.keys(s).length?s:void 0;(this.w.config.chart.group?this.ctx.getSyncedCharts():[this.ctx]).forEach(e=>{U(e,n.view,{animate:i,mergeOptions:r})})}save(e){const t="perspective-"+ ++this._counter;return this._saved.push({id:t,name:e||t,token:this.capture()}),this._used=!0,P(this.w,this.ctx),t}list(){return this._saved.map(e=>({id:e.id,name:e.name,token:e.token}))}delete(e){const t=this._saved.findIndex(t=>t.id===e);t>-1&&this._saved.splice(t,1)}teardown(){this._saved=[],this._counter=0}static decode(e){if("string"!=typeof e||!e)return null;try{const t=JSON.parse(V(e));return t&&"object"==typeof t?1!==t.v?(console.warn(`apexcharts: unsupported perspective version ${t.v} (expected 1).`),null):t:null}catch(e){return console.warn("apexcharts: failed to decode perspective token.",e),null}}static fromURL(e){try{const t=e||(u.isBrowser()?window.location.href:"");if(!t)return null;const n=new URL(t).hash.replace(/^#/,"");if(!n)return null;const i=n.split("&").map(e=>e.split("=")).find(e=>e[0]===B);return i&&null!=i[1]?z.decode(decodeURIComponent(i[1])):null}catch(e){return null}}}d.registerFeatures({perspectives:z}),d.perspectives={decode:e=>(E(),z.decode(e)),fromURL:e=>(E(),z.fromURL(e))},d.registerFeatures({storyboard:class{constructor(e,t){this.w=e,this.ctx=t,this._beats=[],this._observer=null,this._activeIndex=-1,this._animate=!0,this._warnedNoPerspectives=!1,this._used=!1}bind(e={}){var t;if(this.unbind(),!u.isBrowser())return 0;const n=this.ctx.el&&this.ctx.el.ownerDocument;if(!n||"undefined"==typeof IntersectionObserver)return 0;let i=null;if(e.scroller&&(i="string"==typeof e.scroller?n.querySelector(e.scroller):e.scroller),this._beats=this._resolveBeats(n,i,e.beats),!this._beats.length)return 0;this._animate=!1!==e.animate;const s=Math.min(Math.max(null!=(t=e.offset)?t:.5,0),1),r=+(100*s).toFixed(3),a=+(100-100*s).toFixed(3);return this._observer=new IntersectionObserver(e=>this._onIntersect(e),{root:i,rootMargin:`-${r}% 0px -${a}%`,threshold:0}),this._beats.forEach(e=>{var t;return null==(t=this._observer)?void 0:t.observe(e.el)}),this._used=!0,P(this.w,this.ctx),this._beats.length}_resolveBeats(e,t,n){const i=[];if(Array.isArray(n))return n.forEach((t,n)=>{var s,r;if(!t)return;const a=t.el&&"object"==typeof t.el?t.el:t.selector?e.querySelector(t.selector):null;a?i.push({el:a,key:null!=(r=null!=(s=t.key)?s:a.getAttribute("data-apex-beat"))?r:String(n),view:t.view,options:t.options,announce:t.announce,onEnter:"function"==typeof t.onEnter?t.onEnter:void 0}):console.warn(`apexcharts: storyboard beat ${n} has no resolvable element; skipped.`)}),i;return(t||e).querySelectorAll("[data-apex-beat]").forEach((e,t)=>{i.push({el:e,key:e.getAttribute("data-apex-beat")||String(t),view:e.getAttribute("data-apex-view")||void 0,options:void 0,announce:e.getAttribute("data-apex-announce")||void 0,onEnter:void 0})}),i}_onIntersect(e){e.forEach(e=>{const t=this._beats.findIndex(t=>t.el===e.target);t<0||(e.isIntersecting?this._activate(t):t===this._activeIndex&&e.rootBounds&&e.boundingClientRect.top>=e.rootBounds.bottom&&t>0&&this._activate(t-1))})}_activate(e,t={}){var n,i;if(e===this._activeIndex)return;const s=this._beats[e];if(!s)return;const r=e>this._activeIndex?"down":"up";this._activeIndex=e;const a=(void 0!==t.animate?t.animate:this._animate)&&!p();if(null!=s.view||s.options)if(this.ctx.perspectives){const e=null!=(n=s.view)?n:{},t="string"==typeof e||e.view?e:{view:this._normalizeView(e)};this.ctx.perspectives.apply(t,{animate:a,mergeOptions:s.options})}else this._warnedNoPerspectives||(this._warnedNoPerspectives=!0,console.warn('apexcharts: storyboard beats carry views but the perspectives feature is not bundled. import "apexcharts/features/storyboard" (which includes it) or drive beats via onEnter.'));const o={index:e,key:s.key,el:s.el,direction:r};s.onEnter&&s.onEnter(this.ctx,o),s.announce&&this._announce(s.announce),"function"==typeof this.w.config.chart.events.beatChange&&this.w.config.chart.events.beatChange(this.ctx,o),null==(i=this.ctx.events)||i.fireEvent("beatChange",[this.ctx,o])}_normalizeView(e){const t=e.annotations&&e.annotations.static||{};return c(l({},e),{annotations:{static:l({points:[],xaxis:[],yaxis:[],texts:[],images:[]},t),dynamic:e.annotations&&e.annotations.dynamic||[]}})}goTo(e,t={}){const n="number"==typeof e?e:this._beats.findIndex(t=>t.key===e);n>=0&&n<this._beats.length&&this._activate(n,t)}current(){if(this._activeIndex<0)return null;const e=this._beats[this._activeIndex];return{index:this._activeIndex,key:e?e.key:null}}unbind(){this._observer&&(this._observer.disconnect(),this._observer=null),this._beats=[],this._activeIndex=-1,this._used=!1,P(this.w,this.ctx)}teardown(){this.unbind()}_announce(e){const t=this.w;if(!t.config.chart.accessibility.announcements.enabled)return;const n=t.dom.baseEl;if(!n)return;const i=n.querySelector(".apexcharts-sr-status");i&&(i.textContent="",setTimeout(()=>{i.textContent=e},0))}}}),e.default=d,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,i=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,l=(t,e)=>{for(var r in e||(e={}))o.call(e,r)&&i(t,r,e[r]);if(n)for(var r of n(e))s.call(e,r)&&i(t,r,e[r]);return t},a=(t,n)=>e(t,r(n));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const c=h(require("apexcharts/core")),u=c.__apex_Graphics,d=c.__apex_Utils;class f{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/f.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*f.xRatio(t)}static screenXToPlotPx(t,e){const r=t.dom.baseEl,n=r&&r.querySelector(".apexcharts-svg");if(!n)return e-t.layout.translateX;const o=n.getBoundingClientRect(),s=t.globals.svgWidth?o.width/t.globals.svgWidth:1;return(e-o.left)/(s||1)-t.layout.translateX}}const g=c.__apex_Environment_Environment;const m=["wiggle","silhouette","zero","expand"],p=["inside-out","inverse","none"];function b(t,e,r){const n=r&&void 0!==r[e]?r[e]:e+1;return null==t?{x:n,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,rest:t}:{x:n,y:t,rest:{}}}function y(t,e){var r,n;const o=e.config,s=e.globals;if(!Array.isArray(t))return t;s.streamgraphRawSeries||(s.streamgraphRawSeries=t.map(t=>a(l({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const i=s.streamgraphRawSeries;if(i.some(t=>function(t){for(let e=0;e<t.length;e++){const r=t[e],n=Array.isArray(r)?r[1]:r&&"object"==typeof r?r.y:r;if(Array.isArray(n)&&2===n.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.streamgraphData=null,t;const h=(null==(r=o.plotOptions)?void 0:r.streamgraph)||{},c=-1!==m.indexOf(h.offset)?h.offset:"wiggle",u=-1!==p.indexOf(h.order)?h.order:"inside-out",f=null==(n=o.xaxis)?void 0:n.categories,g=s.collapsedSeriesIndices||[],{xs:y,rows:x,grids:v}=function(t,e){var r;const n=[],o=[],s=new Map,i=[];for(let a=0;a<t.length;a++){const h=Array.isArray(null==(r=t[a])?void 0:r.data)?t[a].data:[],c=new Map;for(let t=0;t<h.length;t++){const{x:r,y:i,rest:a}=b(h[t],t,e),u=r instanceof Date?r.getTime():r;s.has(u)||(s.set(u,n.length),n.push(r),o.push(l({},a))),c.set(s.get(u),d.parseNumber(i))}i.push(c)}return{xs:n,rows:o,grids:i}}(i,f),w=function(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r]instanceof Date?t[r].getTime():t[r];if("number"!=typeof n||!isFinite(n))return null;e.push(r)}const r=e.map(e=>({j:e,v:t[e]instanceof Date?t[e].getTime():t[e]}));r.sort((t,e)=>t.v-e.v);const n=r.map(t=>t.j);for(let t=0;t<n.length;t++)if(n[t]!==t)return n;return null}(y),_=w?w.map(t=>y[t]):y,A=w?w.map(t=>x[t]):x,S=_.length;let O=!1;const F=[];for(let t=0;t<i.length;t++){const e=new Array(S);for(let r=0;r<S;r++){const n=v[t].get(w?w[r]:r);let o=null==n?0:Number(n);isFinite(o)||(o=0),o<0&&(O=!0,o=0),e[r]=o}F.push(e)}O&&!s.streamgraphWarnedNegative&&(s.streamgraphWarnedNegative=!0);const P=[];for(let t=0;t<i.length;t++)-1===g.indexOf(t)&&P.push(t);let T=F;if("expand"===c){T=F.map(t=>t.slice());for(let t=0;t<S;t++){let e=0;for(let r=0;r<P.length;r++)e+=T[P[r]][t];if(e)for(let r=0;r<P.length;r++)T[P[r]][t]/=e}}const M=function(t,e,r){if("none"===t)return e.slice();if("inverse"===t)return e.slice().reverse();const n={},o={};for(let t=0;t<e.length;t++){const s=e[t],i=r[s];let l=0,a=-1/0,h=0;for(let t=0;t<i.length;t++)l+=i[t],i[t]>a&&(a=i[t],h=t);n[s]=l,o[s]=h}const s=e.slice().sort((t,e)=>o[t]-o[e]||t-e);let i=0,l=0;const a=[],h=[];for(let t=0;t<s.length;t++){const e=s[t];i<l?(i+=n[e],a.push(e)):(l+=n[e],h.push(e))}return h.reverse().concat(a)}(u,P,T),W=function(t,e,r,n){const o=new Array(n).fill(0);if(0===n||0===e.length)return o;if("zero"===t||"expand"===t)return o;if("silhouette"===t){for(let t=0;t<n;t++){let n=0;for(let o=0;o<e.length;o++)n+=r[e[o]][t];o[t]=-n/2}return o}let s=0;for(let t=1;t<n;t++){let n=0,i=0;for(let o=0;o<e.length;o++){const s=r[e[o]],l=s[t];let a=(l-s[t-1])/2;for(let n=0;n<o;n++){const o=r[e[n]];a+=o[t]-o[t-1]}n+=l,i+=a*l}n&&(s-=i/n),o[t]=s}return o}(c,M,T,S),E=i.map(()=>null),j=i.map(()=>null);for(let t=0;t<M.length;t++)E[M[t]]=new Array(S),j[M[t]]=new Array(S);for(let t=0;t<S;t++){let e=W[t];for(let r=0;r<M.length;r++){const n=M[r],o=E[n],s=j[n];o[t]=e,e+=T[n][t],s[t]=e}}return e.streamgraphData={names:i.map((t,e)=>{var r;return null!=(r=null==t?void 0:t.name)?r:`Series ${e+1}`}),xs:_,values:F,lows:E,highs:j,order:M,offset:c,hidden:i.map((t,e)=>e).filter(t=>-1!==g.indexOf(t))},i.map((t,e)=>{const r=E[e],n=j[e];if(!r||!n)return a(l({},t),{data:[]});const o=new Array(S);for(let t=0;t<S;t++)o[t]=a(l({},A[t]),{x:_[t],y:[r[t],n[t]]});return a(l({},t),{data:o})})}const x="__apexcharts_series_transforms__";var v,w;globalThis[x]||(globalThis[x]={}),v="streamgraph","function"==typeof(w=y)&&(globalThis[x][v]=w),c.default.registerFeatures({streamgraph:class{constructor(t,e){this.w=t,this.ctx=e,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(t){var e;const r=this.w,n=r.globals,o=r.layout.gridHeight,s=n.maxY-n.minY;if(!s||!isFinite(s))return o/2;const i=(t-n.minY)/s;return(null==(e=r.config.yaxis[0])?void 0:e.reversed)?i*o:o-i*o}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var t,e,r,n,o,s,i;const l=this.w;if(!this.isActive())return;const a=null==(e=null==(t=l.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels;if(!a||!1===a.show)return;const h=l.dom.elGraphical,c=l.streamgraphData;if(!h||!c)return;this.removeLabels();const d=new u(l,this.ctx),f=d.group({class:"apexcharts-streamgraph-labels"}),g=(null==(r=a.style)?void 0:r.fontSize)||"auto",m=(null==(n=a.style)?void 0:n.fontFamily)||l.config.chart.fontFamily,p=(null==(o=a.style)?void 0:o.fontWeight)||600,b=null==a.minWidth?24:a.minWidth,y=[];for(let t=0;t<c.order.length;t++){const e=c.order[t],r=this._placeLabel(e,{fontSize:g,fontFamily:m,fontWeight:p,minWidth:b,graphics:d});r&&y.push(r)}let x=0;for(const t of this._deconflict(y)){const e=t.k,r=d.drawText({x:t.x,y:t.y,text:t.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:t.fontSize,fontFamily:m,fontWeight:p,foreColor:(null==(i=null==(s=a.style)?void 0:s.colors)?void 0:i[e])||t.color,cssClass:"apexcharts-streamgraph-label"});r.node.setAttribute("data:realIndex",String(e)),f.add(r),x++}if(!x)return;const v=h.node.querySelector(".apexcharts-xaxis");v?h.node.insertBefore(f.node,v):h.add(f),this.holdUntilBandsLand(f)}_placeLabel(t,{fontSize:e,fontFamily:r,fontWeight:n,minWidth:o,graphics:s}){const i=this.w,l=i.streamgraphData,a=l.lows[t],h=l.highs[t];if(!a||!h)return null;const c=i.globals.seriesXvalues[t],u=a.length;if(!Array.isArray(c)||c.length<u||0===u)return null;const d=new Array(u);let f=0;for(let t=0;t<u;t++){const e=Math.abs(this._yPx(h[t])-this._yPx(a[t]));d[t]=e,e>f&&(f=e)}if(f<=0)return null;const g=this._resolveFontSize(e,f),m=String(l.names[t]);let p=g,b=s.getTextRects(m,`${p}px`,r,"",!0,n);if(f<b.height+6)return null;const y=this._widestRun(d,c,b.height+6,u);if(!y)return null;if(b.width>y.width&&"auto"===e){const t=Math.floor(p*(y.width/b.width));if(t<this._autoBounds().min)return null;if(p=t,b=s.getTextRects(m,`${p}px`,r,"",!0,n),f<b.height+6)return null}const x=b.height+6,v=[];for(const e of this._runs(d,x,u)){const n=Number(c[e.l]),i=Number(c[e.r]);if(!isFinite(n)||!isFinite(i))continue;let l=i-n;if(l<=0&&u>1){const t=Math.abs(Number(c[Math.min(e.r+1,u-1)])-Number(c[Math.max(e.l-1,0)]));l=isFinite(t)?t:0}if(l<o||l<.35*b.width)continue;const d=b.width<=l?m:s.getTextBasedOnMaxWidth({text:m,maxWidth:l,fontSize:`${p}px`,fontFamily:r});if(!d||"..."===d)continue;const f=d===m?b.width:b.width*(d.length/m.length),g=[n+l/2];l>2.2*f&&g.push(n+f/2+2,i-f/2-2);for(const r of g){let n=e.l,o=1/0;for(let t=e.l;t<=e.r;t++){const e=Math.abs(Number(c[t])-r);e<o&&(o=e,n=t)}v.push({x:r,y:(this._yPx(a[n])+this._yPx(h[n]))/2,text:d,color:this._contrastOn(t),fontSize:`${p}px`,width:f,height:b.height})}if(v.length>=6)break}return v.length?{k:t,weight:f,candidates:v}:null}_runs(t,e,r){const n=[];let o=0;for(;o<r;){if(t[o]<e){o++;continue}let s=o,i=t[o];for(;s+1<r&&t[s+1]>=e;)s++,t[s]>i&&(i=t[s]);n.push({l:o,r:s,maxT:i}),o=s+1}return n.sort((t,e)=>e.maxT-t.maxT)}_widestRun(t,e,r,n){let o=-1;for(const s of this._runs(t,r,n)){const t=Number(e[s.r])-Number(e[s.l]);isFinite(t)&&t>o&&(o=t)}return o>=0?{width:o}:null}_deconflict(t){const e=t.slice().sort((t,e)=>e.weight-t.weight),r=[],n=t=>!r.some(e=>t.left<e.box.right&&t.right>e.box.left&&t.top<e.box.bottom&&t.bottom>e.box.top);for(const t of e)for(const e of t.candidates){const o={left:e.x-e.width/2,right:e.x+e.width/2,top:e.y-e.height/2,bottom:e.y+e.height/2};if(n(o)){r.push(a(l({k:t.k},e),{box:o}));break}}return r}_autoBounds(){var t,e;const r=(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels)||{};return{min:null==r.minFontSize?9:r.minFontSize,max:null==r.maxFontSize?30:r.maxFontSize}}_resolveFontSize(t,e){if("auto"!==t){const e=parseFloat(t);return isFinite(e)&&e>0?e:12}const{min:r,max:n}=this._autoBounds();return Math.max(r,Math.min(n,Math.round(.36*e)))}_contrastOn(t){var e;const r=this.w,n=null==(e=r.globals.colors)?void 0:e[t],o="string"==typeof n?d.parseHex(n):null;return o?d.relativeLuminance(o)>.45?"#000000":"#ffffff":r.config.chart.foreColor}removeLabels(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-streamgraph-labels");e&&e.parentNode&&e.parentNode.removeChild(e)}bindHover(){const t=this.w;if(!g.isBrowser())return;if(!1===this._hoverCfg().show)return;const e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");e&&!e.__apexStreamHover&&(e.__apexStreamHover=!0,e.addEventListener("mousemove",t=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(t))}),e.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var t,e;return(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.hover)||{}}_bandAt(t){const e=this.w,r=e.streamgraphData;if(!r||!r.order.length)return-1;const n=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");if(!n)return-1;const o=n.getBoundingClientRect(),s=e.globals.svgWidth?o.width/e.globals.svgWidth:1,i=f.screenXToPlotPx(e,t.clientX),l=(t.clientY-o.top)/(s||1)-e.layout.translateY;if(i<0||i>e.layout.gridWidth)return-1;if(l<0||l>e.layout.gridHeight)return-1;const a=e.globals.seriesXvalues[r.order[0]];if(!Array.isArray(a)||!a.length)return-1;const h=e.interact?e.interact.capturedDataPointIndex:-1;let c=-1;if(h>=0&&h<a.length)c=h;else{let t=1/0;for(let e=0;e<a.length;e++){const r=Math.abs(Number(a[e])-i);r<t&&(t=r,c=e)}}if(c<0)return-1;let u=-1,d=1/0;for(let t=0;t<r.order.length;t++){const e=r.order[t],n=this._yPx(r.highs[e][c]),o=this._yPx(r.lows[e][c]),s=Math.min(n,o),i=Math.max(n,o);if(l>=s&&l<=i)return e;const a=l<s?s-l:l-i;a<d&&(d=a,u=e)}return u}_dim(t){const e=this.w;if(t===this._hovered)return;this._hovered=t;const r=this._hoverCfg(),n=null==r.opacity?.35:r.opacity,o=e.dom.baseEl.querySelectorAll(".apexcharts-series"),s=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),i=(e,r)=>t<0||r===t;for(let t=0;t<o.length;t++){const e=o[t];e.style.transition="opacity .15s ease",e.style.opacity=i(0,Number(e.getAttribute("data:realIndex")))?"":String(n)}for(let t=0;t<s.length;t++){const r=s[t];r.style.transition="opacity .15s ease, fill .15s ease",i(0,Number(r.getAttribute("data:realIndex")))?this._restoreLabel(r):(r.getAttribute("data:fill")||r.setAttribute("data:fill",r.getAttribute("fill")||""),r.setAttribute("fill",e.config.chart.foreColor),r.style.opacity="0.65")}}_restoreLabel(t){const e=t.getAttribute("data:fill");e&&t.setAttribute("fill",e),t.style.opacity=""}clearDim(){this._hovered=-1;const t=this.w;if(!t.dom.baseEl)return;const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");for(let t=0;t<e.length;t++){e[t].style.opacity=""}const r=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let t=0;t<r.length;t++)this._restoreLabel(r[t])}holdUntilBandsLand(t){const e=this.w;g.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default}),exports.streamgraphTransform=y;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexStreamgraph={})}(this,function(t){"use strict";var e=Object.defineProperty,r=Object.defineProperties,n=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=(t,r,n)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,l=(t,e)=>{for(var r in e||(e={}))o.call(e,r)&&i(t,r,e[r]);if(s)for(var r of s(e))a.call(e,r)&&i(t,r,e[r]);return t},h=(t,e)=>r(t,n(e));const c=globalThis.ApexCharts,u=globalThis.ApexCharts.__internals.__apex_Graphics,d=globalThis.ApexCharts.__internals.__apex_Utils;class f{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/f.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*f.xRatio(t)}static screenXToPlotPx(t,e){const r=t.dom.baseEl,n=r&&r.querySelector(".apexcharts-svg");if(!n)return e-t.layout.translateX;const s=n.getBoundingClientRect(),o=t.globals.svgWidth?s.width/t.globals.svgWidth:1;return(e-s.left)/(o||1)-t.layout.translateX}}const g=globalThis.ApexCharts.__internals.__apex_Environment_Environment;const p=["wiggle","silhouette","zero","expand"],m=["inside-out","inverse","none"];function x(t,e,r){const n=r&&void 0!==r[e]?r[e]:e+1;return null==t?{x:n,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:n,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:n,y:t.y,rest:t}:{x:n,y:t,rest:{}}}function b(t,e){var r,n;const s=e.config,o=e.globals;if(!Array.isArray(t))return t;o.streamgraphRawSeries||(o.streamgraphRawSeries=t.map(t=>h(l({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const a=o.streamgraphRawSeries;if(a.some(t=>function(t){for(let e=0;e<t.length;e++){const r=t[e],n=Array.isArray(r)?r[1]:r&&"object"==typeof r?r.y:r;if(Array.isArray(n)&&2===n.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.streamgraphData=null,t;const i=(null==(r=s.plotOptions)?void 0:r.streamgraph)||{},c=-1!==p.indexOf(i.offset)?i.offset:"wiggle",u=-1!==m.indexOf(i.order)?i.order:"inside-out",f=null==(n=s.xaxis)?void 0:n.categories,g=o.collapsedSeriesIndices||[],{xs:b,rows:y,grids:v}=function(t,e){var r;const n=[],s=[],o=new Map,a=[];for(let i=0;i<t.length;i++){const h=Array.isArray(null==(r=t[i])?void 0:r.data)?t[i].data:[],c=new Map;for(let t=0;t<h.length;t++){const{x:r,y:a,rest:i}=x(h[t],t,e),u=r instanceof Date?r.getTime():r;o.has(u)||(o.set(u,n.length),n.push(r),s.push(l({},i))),c.set(o.get(u),d.parseNumber(a))}a.push(c)}return{xs:n,rows:s,grids:a}}(a,f),w=function(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r]instanceof Date?t[r].getTime():t[r];if("number"!=typeof n||!isFinite(n))return null;e.push(r)}const r=e.map(e=>({j:e,v:t[e]instanceof Date?t[e].getTime():t[e]}));r.sort((t,e)=>t.v-e.v);const n=r.map(t=>t.j);for(let t=0;t<n.length;t++)if(n[t]!==t)return n;return null}(b),_=w?w.map(t=>b[t]):b,A=w?w.map(t=>y[t]):y,S=_.length;let T=!1;const F=[];for(let t=0;t<a.length;t++){const e=new Array(S);for(let r=0;r<S;r++){const n=v[t].get(w?w[r]:r);let s=null==n?0:Number(n);isFinite(s)||(s=0),s<0&&(T=!0,s=0),e[r]=s}F.push(e)}T&&!o.streamgraphWarnedNegative&&(o.streamgraphWarnedNegative=!0,console.warn('ApexCharts: a streamgraph stacks parts of a whole, so negative values have no band to draw and were treated as 0. Use a stacked area (chart.type: "area", chart.stacked: true) for data that goes below zero.'));const O=[];for(let t=0;t<a.length;t++)-1===g.indexOf(t)&&O.push(t);let P=F;if("expand"===c){P=F.map(t=>t.slice());for(let t=0;t<S;t++){let e=0;for(let r=0;r<O.length;r++)e+=P[O[r]][t];if(e)for(let r=0;r<O.length;r++)P[O[r]][t]/=e}}const W=function(t,e,r){if("none"===t)return e.slice();if("inverse"===t)return e.slice().reverse();const n={},s={};for(let t=0;t<e.length;t++){const o=e[t],a=r[o];let i=0,l=-1/0,h=0;for(let t=0;t<a.length;t++)i+=a[t],a[t]>l&&(l=a[t],h=t);n[o]=i,s[o]=h}const o=e.slice().sort((t,e)=>s[t]-s[e]||t-e);let a=0,i=0;const l=[],h=[];for(let t=0;t<o.length;t++){const e=o[t];a<i?(a+=n[e],l.push(e)):(i+=n[e],h.push(e))}return h.reverse().concat(l)}(u,O,P),C=function(t,e,r,n){const s=new Array(n).fill(0);if(0===n||0===e.length)return s;if("zero"===t||"expand"===t)return s;if("silhouette"===t){for(let t=0;t<n;t++){let n=0;for(let s=0;s<e.length;s++)n+=r[e[s]][t];s[t]=-n/2}return s}let o=0;for(let t=1;t<n;t++){let n=0,a=0;for(let s=0;s<e.length;s++){const o=r[e[s]],i=o[t];let l=(i-o[t-1])/2;for(let n=0;n<s;n++){const s=r[e[n]];l+=s[t]-s[t-1]}n+=i,a+=l*i}n&&(o-=a/n),s[t]=o}return s}(c,W,P,S),E=a.map(()=>null),M=a.map(()=>null);for(let t=0;t<W.length;t++)E[W[t]]=new Array(S),M[W[t]]=new Array(S);for(let t=0;t<S;t++){let e=C[t];for(let r=0;r<W.length;r++){const n=W[r],s=E[n],o=M[n];s[t]=e,e+=P[n][t],o[t]=e}}return e.streamgraphData={names:a.map((t,e)=>{var r;return null!=(r=null==t?void 0:t.name)?r:`Series ${e+1}`}),xs:_,values:F,lows:E,highs:M,order:W,offset:c,hidden:a.map((t,e)=>e).filter(t=>-1!==g.indexOf(t))},a.map((t,e)=>{const r=E[e],n=M[e];if(!r||!n)return h(l({},t),{data:[]});const s=new Array(S);for(let t=0;t<S;t++)s[t]=h(l({},A[t]),{x:_[t],y:[r[t],n[t]]});return h(l({},t),{data:s})})}const y="__apexcharts_series_transforms__";var v,w;globalThis[y]||(globalThis[y]={}),v="streamgraph","function"==typeof(w=b)?globalThis[y][v]=w:console.warn(`ApexCharts: registerSeriesTransform("${v}") expects a function (series, w) => series.`),c.registerFeatures({streamgraph:class{constructor(t,e){this.w=t,this.ctx=e,this._hovered=-1}isActive(){return"streamgraph"===this.w.config.chart.requestedType}_yPx(t){var e;const r=this.w,n=r.globals,s=r.layout.gridHeight,o=n.maxY-n.minY;if(!o||!isFinite(o))return s/2;const a=(t-n.minY)/o;return(null==(e=r.config.yaxis[0])?void 0:e.reversed)?a*s:s-a*s}draw(){this.isActive()&&(this.clearDim(),this.bindHover(),this.drawLabels())}drawLabels(){var t,e,r,n,s,o,a;const i=this.w;if(!this.isActive())return;const l=null==(e=null==(t=i.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels;if(!l||!1===l.show)return;const h=i.dom.elGraphical,c=i.streamgraphData;if(!h||!c)return;this.removeLabels();const d=new u(i,this.ctx),f=d.group({class:"apexcharts-streamgraph-labels"}),g=(null==(r=l.style)?void 0:r.fontSize)||"auto",p=(null==(n=l.style)?void 0:n.fontFamily)||i.config.chart.fontFamily,m=(null==(s=l.style)?void 0:s.fontWeight)||600,x=null==l.minWidth?24:l.minWidth,b=[];for(let t=0;t<c.order.length;t++){const e=c.order[t],r=this._placeLabel(e,{fontSize:g,fontFamily:p,fontWeight:m,minWidth:x,graphics:d});r&&b.push(r)}let y=0;for(const t of this._deconflict(b)){const e=t.k,r=d.drawText({x:t.x,y:t.y,text:t.text,textAnchor:"middle",dominantBaseline:"middle",fontSize:t.fontSize,fontFamily:p,fontWeight:m,foreColor:(null==(a=null==(o=l.style)?void 0:o.colors)?void 0:a[e])||t.color,cssClass:"apexcharts-streamgraph-label"});r.node.setAttribute("data:realIndex",String(e)),f.add(r),y++}if(!y)return;const v=h.node.querySelector(".apexcharts-xaxis");v?h.node.insertBefore(f.node,v):h.add(f),this.holdUntilBandsLand(f)}_placeLabel(t,{fontSize:e,fontFamily:r,fontWeight:n,minWidth:s,graphics:o}){const a=this.w,i=a.streamgraphData,l=i.lows[t],h=i.highs[t];if(!l||!h)return null;const c=a.globals.seriesXvalues[t],u=l.length;if(!Array.isArray(c)||c.length<u||0===u)return null;const d=new Array(u);let f=0;for(let t=0;t<u;t++){const e=Math.abs(this._yPx(h[t])-this._yPx(l[t]));d[t]=e,e>f&&(f=e)}if(f<=0)return null;const g=this._resolveFontSize(e,f),p=String(i.names[t]);let m=g,x=o.getTextRects(p,`${m}px`,r,"",!0,n);if(f<x.height+6)return null;const b=this._widestRun(d,c,x.height+6,u);if(!b)return null;if(x.width>b.width&&"auto"===e){const t=Math.floor(m*(b.width/x.width));if(t<this._autoBounds().min)return null;if(m=t,x=o.getTextRects(p,`${m}px`,r,"",!0,n),f<x.height+6)return null}const y=x.height+6,v=[];for(const e of this._runs(d,y,u)){const n=Number(c[e.l]),a=Number(c[e.r]);if(!isFinite(n)||!isFinite(a))continue;let i=a-n;if(i<=0&&u>1){const t=Math.abs(Number(c[Math.min(e.r+1,u-1)])-Number(c[Math.max(e.l-1,0)]));i=isFinite(t)?t:0}if(i<s||i<.35*x.width)continue;const d=x.width<=i?p:o.getTextBasedOnMaxWidth({text:p,maxWidth:i,fontSize:`${m}px`,fontFamily:r});if(!d||"..."===d)continue;const f=d===p?x.width:x.width*(d.length/p.length),g=[n+i/2];i>2.2*f&&g.push(n+f/2+2,a-f/2-2);for(const r of g){let n=e.l,s=1/0;for(let t=e.l;t<=e.r;t++){const e=Math.abs(Number(c[t])-r);e<s&&(s=e,n=t)}v.push({x:r,y:(this._yPx(l[n])+this._yPx(h[n]))/2,text:d,color:this._contrastOn(t),fontSize:`${m}px`,width:f,height:x.height})}if(v.length>=6)break}return v.length?{k:t,weight:f,candidates:v}:null}_runs(t,e,r){const n=[];let s=0;for(;s<r;){if(t[s]<e){s++;continue}let o=s,a=t[s];for(;o+1<r&&t[o+1]>=e;)o++,t[o]>a&&(a=t[o]);n.push({l:s,r:o,maxT:a}),s=o+1}return n.sort((t,e)=>e.maxT-t.maxT)}_widestRun(t,e,r,n){let s=-1;for(const o of this._runs(t,r,n)){const t=Number(e[o.r])-Number(e[o.l]);isFinite(t)&&t>s&&(s=t)}return s>=0?{width:s}:null}_deconflict(t){const e=t.slice().sort((t,e)=>e.weight-t.weight),r=[],n=t=>!r.some(e=>t.left<e.box.right&&t.right>e.box.left&&t.top<e.box.bottom&&t.bottom>e.box.top);for(const t of e)for(const e of t.candidates){const s={left:e.x-e.width/2,right:e.x+e.width/2,top:e.y-e.height/2,bottom:e.y+e.height/2};if(n(s)){r.push(h(l({k:t.k},e),{box:s}));break}}return r}_autoBounds(){var t,e;const r=(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.labels)||{};return{min:null==r.minFontSize?9:r.minFontSize,max:null==r.maxFontSize?30:r.maxFontSize}}_resolveFontSize(t,e){if("auto"!==t){const e=parseFloat(t);return isFinite(e)&&e>0?e:12}const{min:r,max:n}=this._autoBounds();return Math.max(r,Math.min(n,Math.round(.36*e)))}_contrastOn(t){var e;const r=this.w,n=null==(e=r.globals.colors)?void 0:e[t],s="string"==typeof n?d.parseHex(n):null;return s?d.relativeLuminance(s)>.45?"#000000":"#ffffff":r.config.chart.foreColor}removeLabels(){const t=this.w.dom.elGraphical,e=t&&t.node.querySelector(".apexcharts-streamgraph-labels");e&&e.parentNode&&e.parentNode.removeChild(e)}bindHover(){const t=this.w;if(!g.isBrowser())return;if(!1===this._hoverCfg().show)return;const e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-svg");e&&!e.__apexStreamHover&&(e.__apexStreamHover=!0,e.addEventListener("mousemove",t=>{this.isActive()&&this.w.streamgraphData&&this._dim(this._bandAt(t))}),e.addEventListener("mouseleave",()=>{this._dim(-1)}))}_hoverCfg(){var t,e;return(null==(e=null==(t=this.w.config.plotOptions)?void 0:t.streamgraph)?void 0:e.hover)||{}}_bandAt(t){const e=this.w,r=e.streamgraphData;if(!r||!r.order.length)return-1;const n=e.dom.baseEl&&e.dom.baseEl.querySelector(".apexcharts-svg");if(!n)return-1;const s=n.getBoundingClientRect(),o=e.globals.svgWidth?s.width/e.globals.svgWidth:1,a=f.screenXToPlotPx(e,t.clientX),i=(t.clientY-s.top)/(o||1)-e.layout.translateY;if(a<0||a>e.layout.gridWidth)return-1;if(i<0||i>e.layout.gridHeight)return-1;const l=e.globals.seriesXvalues[r.order[0]];if(!Array.isArray(l)||!l.length)return-1;const h=e.interact?e.interact.capturedDataPointIndex:-1;let c=-1;if(h>=0&&h<l.length)c=h;else{let t=1/0;for(let e=0;e<l.length;e++){const r=Math.abs(Number(l[e])-a);r<t&&(t=r,c=e)}}if(c<0)return-1;let u=-1,d=1/0;for(let t=0;t<r.order.length;t++){const e=r.order[t],n=this._yPx(r.highs[e][c]),s=this._yPx(r.lows[e][c]),o=Math.min(n,s),a=Math.max(n,s);if(i>=o&&i<=a)return e;const l=i<o?o-i:i-a;l<d&&(d=l,u=e)}return u}_dim(t){const e=this.w;if(t===this._hovered)return;this._hovered=t;const r=this._hoverCfg(),n=null==r.opacity?.35:r.opacity,s=e.dom.baseEl.querySelectorAll(".apexcharts-series"),o=e.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label"),a=(e,r)=>t<0||r===t;for(let t=0;t<s.length;t++){const e=s[t];e.style.transition="opacity .15s ease",e.style.opacity=a(0,Number(e.getAttribute("data:realIndex")))?"":String(n)}for(let t=0;t<o.length;t++){const r=o[t];r.style.transition="opacity .15s ease, fill .15s ease",a(0,Number(r.getAttribute("data:realIndex")))?this._restoreLabel(r):(r.getAttribute("data:fill")||r.setAttribute("data:fill",r.getAttribute("fill")||""),r.setAttribute("fill",e.config.chart.foreColor),r.style.opacity="0.65")}}_restoreLabel(t){const e=t.getAttribute("data:fill");e&&t.setAttribute("fill",e),t.style.opacity=""}clearDim(){this._hovered=-1;const t=this.w;if(!t.dom.baseEl)return;const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");for(let t=0;t<e.length;t++){e[t].style.opacity=""}const r=t.dom.baseEl.querySelectorAll(".apexcharts-streamgraph-label");for(let t=0;t<r.length;t++)this._restoreLabel(r[t])}holdUntilBandsLand(t){const e=this.w;g.isBrowser()&&e.globals.shouldAnimate&&!e.globals.animationEnded&&(t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node,holdUntilComplete:!0}))}}}),t.default=c,t.streamgraphTransform=b,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,o=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,l=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&o(t,i,e[i]);if(s)for(var i of s(e))a.call(e,i)&&o(t,i,e[i]);return t},r=(t,s)=>e(t,i(s));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_Graphics,u=h.__apex_axes_AxesUtils,m=h.__apex_Data,g=h.__apex_Series,p=h.__apex_Utils,x=h.__apex_Environment_Environment,f=h.__apex_BrowserAPIs_BrowserAPIs,b=h.__apex_math_SVGNS;class y{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const n=i[t],a=document.createElementNS(b,"image");a.setAttribute("x",n.getAttribute("x")||"0"),a.setAttribute("y",n.getAttribute("y")||"0"),a.setAttribute("width",n.getAttribute("width")||"0"),a.setAttribute("height",n.getAttribute("height")||"0"),a.setAttribute("href",s),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(a,n)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!x.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=f.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!x.isBrowser())return Promise.resolve([]);const t=[],e=[],i=e=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const i=e.match(/font-family\s*:\s*([^;}]+)/i);if(!i)return;const s=i[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:s.toLowerCase(),css:e})})};return Array.from(document.styleSheets||[]).forEach(t=>{let s=null;try{s=t.cssRules}catch(t){s=null}s?Array.from(s).forEach(t=>{5===t.type&&t.cssText&&i(t.cssText)}):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(i).catch(()=>{}))}),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!x.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(b,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t){const e=[],i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let s;for(;null!==(s=i.exec(t));)s[2].startsWith("data:")||e.push(s[2]);return e.length?Promise.all(e.map(t=>this.fetchAsDataUri(t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{const i=this.w;let s=t||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;s||(s=1);const n=i.globals.svgWidth*s,a=i.globals.svgHeight*s,o=i.dom.elWrap.cloneNode(!0);o.style.width=n+"px",o.style.height=a+"px",this.inlineCanvasLayers(o),this.applyExportStyles(o);const l=(new XMLSerializer).serializeToString(o);let r=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${i.globals.svgWidth}px" height="${i.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${n}px; height:${a}px;">\n ${l}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(r);1!==s&&this.scaleSvgNode(c,s),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{r=(new XMLSerializer).serializeToString(c),e(r.replace(/ /g," "))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const a=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(a).catch(()=>this.getBase64FromUrl(n).then(a).catch(t=>{}))});return Promise.all(s)}getBase64FromUrl(t){return x.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return x.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=t?t.scale||t.width/i.globals.svgWidth:1,n=document.createElement("canvas");n.width=i.globals.svgWidth*s,n.height=parseInt(i.dom.elWrap.style.height,10)*s;const a=this.resolveExportBackground(),o=n.getContext("2d");o&&(o.fillStyle=a,o.fillRect(0,0,n.width,n.height),this.getSvgString(s).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{o.drawImage(s,0,0);const t=n;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=n.toDataURL("image/png");e({imgURI:t})}},s.src=i}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const n=this.w;t||(t=n.config.series);let a=[];const o=[];let l="";const r=n.seriesData.series.map((t,e)=>-1===n.globals.collapsedSeriesIndices.indexOf(e)?t:[]),c=t=>{if(null==t||p.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)?`'${e}`:e},h=t=>"function"==typeof n.config.chart.toolbar.export.csv.categoryFormatter?n.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===n.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():p.isNumber(t)?t:c(t.split(i).join("")),d=t=>"function"==typeof n.config.chart.toolbar.export.csv.valueFormatter?n.config.chart.toolbar.export.csv.valueFormatter(t):c(t),x=Math.max(...t.map(t=>t.data?t.data.length:0)),f=new m(this.w),b=new u(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),y=t=>{let e="";if(n.globals.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(n.globals.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new g(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=b.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;"datetime"===n.config.xaxis.type&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),p.isNumber(e)?e:e.split(i).join(""))},w=(e,s)=>{var l,c,u,m,g,p;if(a.length&&0===s&&o.push(a.join(i)),e.data){const b=e.data.length?e.data:[...Array(x)].map(()=>"");for(let x=0;x<b.length;x++){a=[];let b=y(x);if("nullvalue"!==b){if(b||(f.isFormatXY()?b=t[s].data[x].x:f.isFormat2DArray()&&(b=t[s].data[x]?t[s].data[x][0]:"")),0===s){a.push(h(b));for(let e=0;e<n.seriesData.series.length;e++){const i=f.isFormatXY()?null==(l=t[e].data[x])?void 0:l.y:r[e][x];a.push(d(i))}}("candlestick"===n.config.chart.type||e.type&&"candlestick"===e.type)&&(a.pop(),a.push(n.candleData.seriesCandleO[s][x]),a.push(n.candleData.seriesCandleH[s][x]),a.push(n.candleData.seriesCandleL[s][x]),a.push(n.candleData.seriesCandleC[s][x])),("boxPlot"===n.config.chart.type||e.type&&"boxPlot"===e.type)&&(a.pop(),a.push(n.candleData.seriesCandleO[s][x]),a.push(n.candleData.seriesCandleH[s][x]),a.push(n.candleData.seriesCandleM[s][x]),a.push(n.candleData.seriesCandleL[s][x]),a.push(n.candleData.seriesCandleC[s][x])),"rangeBar"===n.config.chart.type&&(a.pop(),a.push(n.rangeData.seriesRangeStart[s][x]),a.push(n.rangeData.seriesRangeEnd[s][x])),("violin"===n.config.chart.type||e.type&&"violin"===e.type)&&(a.pop(),a.push(null==(c=n.violinData.seriesViolinMin[s])?void 0:c[x]),a.push(null==(u=n.violinData.seriesViolinMax[s])?void 0:u[x]),a.push(null!=(p=null==(g=null==(m=n.violinData.seriesViolinPoints[s])?void 0:m[x])?void 0:g.length)?p:0)),a.length&&o.push(a.join(i))}}}};a.push(n.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===n.config.chart.type?(a.push("minimum"),a.push("q1"),a.push("median"),a.push("q3"),a.push("maximum")):"candlestick"===n.config.chart.type?(a.push("open"),a.push("high"),a.push("low"),a.push("close")):"rangeBar"===n.config.chart.type?(a.push("minimum"),a.push("maximum")):"violin"===n.config.chart.type?(a.push("minimum"),a.push("maximum"),a.push("observations")):t.map((t,e)=>{const s=(t.name?t.name:`series-${e}`)+"";n.globals.axisCharts&&a.push(s.split(i).join("")?s.split(i).join(""):`series-${e}`)}),n.globals.axisCharts||(a.push(n.config.chart.toolbar.export.csv.headerValue),o.push(a.join(i))),n.globals.allSeriesHasEqualX||!n.globals.axisCharts||n.config.xaxis.categories.length||n.config.labels.length?t.map((t,e)=>{n.globals.axisCharts?w(t,e):(a=[],a.push(h(n.labelData.labels[e])),a.push(d(r[e])),o.push(a.join(i)))}):(()=>{const e=new Set,s={};t.forEach((i,n)=>{null==i||i.data.forEach(i=>{let a,o;if(f.isFormatXY())a=i.x,o=i.y;else{if(!f.isFormat2DArray())return;a=i[0],o=i[1]}s[a]||(s[a]=Array(t.length).fill("")),s[a][n]=d(o),e.add(a)})}),a.length&&o.push(a.join(i)),Array.from(e).sort().forEach(t=>{const e=s[t];o.push([h(t),...e].join(i))})})(),l+=o.join(s),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+l),e||n.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,i){if(x.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}class w{constructor(t,e){this.w=t,this.ctx=e,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,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null}createToolbar(){var t,e;const i=this.w,s=()=>f.createElementNS("http://www.w3.org/1999/xhtml","div"),n=()=>{const t=f.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},a=s();if(a.setAttribute("class","apexcharts-toolbar"),a.style.top=i.config.chart.toolbar.offsetY+"px",a.style.right=3-i.config.chart.toolbar.offsetX+"px",i.dom.elWrap.appendChild(a),this.elZoom=n(),this.elZoomIn=n(),this.elZoomOut=n(),this.elPan=n(),this.elSelection=n(),this.elMeasure=n(),this.elZoomReset=n(),this.elMenuIcon=n(),this.elMenu=s(),this.elCustomIcons=[],this.t=i.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(n());const o=[],l=(t,e,s)=>{const n=t.toLowerCase();this.t[n]&&i.config.chart.zoom.enabled&&o.push({el:e,icon:"string"==typeof this.t[n]?this.t[n]:s,title:this.localeValues[t],class:`apexcharts-${n}-icon`})};l("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),l("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const r=t=>{this.t[t]&&i.config.chart[t].enabled&&o.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};r("zoom"),r("selection"),this.t.pan&&i.config.chart.zoom.enabled&&o.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&i.config.chart.measure&&i.config.chart.measure.enabled&&o.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),l("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&o.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)o.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});o.forEach((t,e)=>{t.index&&p.moveIndexInArray(o,e,t.index)});for(let t=0;t<o.length;t++)d.setAttrs(o[t].el,{class:o[t].class,title:o[t].title,"aria-label":o[t].title}),o[t].el.innerHTML=o[t].icon,a.appendChild(o[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!i.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!i.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!i.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!i.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),this._createHamburgerMenu(a),i.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):i.interact.panEnabled?this.elPan.classList.add(this.selectedClass):i.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):i.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(e=null==(t=this.ctx.measure)?void 0:t.startMeasure)||e.call(t)),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),d.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(f.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,d.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,n,a,o,l,r;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(a=this.elPan)||a.addEventListener("click",this.togglePanning.bind(this)),null==(o=this.elMeasure)||o.addEventListener("click",this.toggleMeasure.bind(this)),null==(l=this.elMenuIcon)||l.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let 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));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(r=this.elMenuIcon)||r.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",n=!!e.w.globals[s];i.toggleOtherControls();const a="selection"===t?i.elSelection:i.elZoom;n||(e.w.globals[s]=!0,a.classList.add(i.selectedClass)),a.setAttribute("aria-pressed",String(!!e.w.globals[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,a=!n.interact.measureEnabled;this.toggleOtherControls(),a&&(n.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(n.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.ctx.toolbar,i=!!t.w.interact.panEnabled;e.toggleOtherControls(),i||(t.w.interact.panEnabled=!0,e.elPan.classList.add(e.selectedClass)),e.elPan.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();this.minX=e,this.maxX=i;const s=(e+i)/2,n=(e+s)/2,a=(i+s)/2,o=this._getNewMinXMaxX(n,a);t.interact.disableZoomIn||this.zoomUpdateOptions(o.minX,o.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if(this.minX=e,this.maxX=i,"datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,n=e-(s-e),a=i-(s-i),o=this._getNewMinXMaxX(n,a);t.interact.disableZoomOut||this.zoomUpdateOptions(o.minX,o.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const a={xaxis:s};if(!i.globals.initialConfig)return;const o=p.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(a.yaxis=o),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(a,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,o)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new y(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.w;if(!e.interact.zoomed)return;if(e.globals.lastXAxis.min=e.globals.initialConfig.xaxis.min,e.globals.lastXAxis.max=e.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof e.config.chart.events.beforeResetZoom){const i=e.config.chart.events.beforeResetZoom(t,e);i&&t.updateHelpers.revertDefaultAxisMinMax(i)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max});const i=t.ctx.series.emptyCollapsedSeries(p.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(i,e.config.chart.animations.dynamicAnimation.enabled),e.interact.zoomed=!1})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class v{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/v.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*v.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const n=s.getBoundingClientRect(),a=t.globals.svgWidth?n.width/t.globals.svgWidth:1;return(e-n.left)/(a||1)-t.layout.translateX}}const S=h.__apex_index_Box;h.default.registerFeatures({toolbar:w,zoomPanSelection:class extends w{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new d(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new S(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.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=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,a=i.config.chart.toolbar.autoSelected;if("measure"!==a&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===a?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(a),i.interact.shiftWasPressed=!1)),!e.target)return;const o=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(o.contains("apexcharts-legend-marker")||o.contains("apexcharts-legend-text")||l&&l.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=this._gridRect();if(!t)return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this.clientY-t.top,this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w,s=this._gridRect();s&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this.clientY-s.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){t.preventDefault();const e=this._wheel();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=this._gridRect();if(!s||!s.width)return;const{min:n,max:a}=this._currentXWindow(),o=a-n,l=Math.min(Math.max((e.clientX-s.left)/s.width,0),1);let r=o*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));r<i&&(r=i),r>c.max-c.min&&(r=c.max-c.min)}let h=n+l*o-l*r,d=h+r;const u=1e-9*o;if(Math.abs(h-n)<u&&Math.abs(d-a)<u)return;if(isNaN(h)||isNaN(d))return;const m=this.getBeforeZoomRange({min:h,max:d},void 0);m&&m.xaxis&&(h=m.xaxis.min,d=m.xaxis.max),this._applyXRange(h,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?p.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,n)=>"l"===n||"r"===n?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(r(l({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=v.dataXToPx(t,t.config.chart.selection.xaxis.min),s=v.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:n=0,translateY:a=0}){const o=this.w,l=this.zoomRect,r=this.selectionRect;if(this.dragged||null!==o.interact.selection){const c={transform:"translate("+n+", "+a+")"};o.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),l.attr({x:t,y:e,width:i,height:s,fill:o.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":o.config.chart.zoom.zoomedArea.fill.opacity,stroke:o.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":o.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":o.config.chart.zoom.zoomedArea.stroke.opacity}),d.setAttrs(l.node,c)),o.interact.selectionEnabled&&(r.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:o.config.chart.selection.fill.color,"fill-opacity":o.config.chart.selection.fill.opacity,stroke:o.config.chart.selection.stroke.color,"stroke-width":o.config.chart.selection.stroke.width,"stroke-dasharray":o.config.chart.selection.stroke.dashArray,"stroke-opacity":o.config.chart.selection.stroke.opacity}),d.setAttrs(r.node,c))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,n=t=>Math.min(Math.max(t,0),e),a=n(i),o=n(i+s);a===i&&o===i+s||(t.attr({x:a,width:o-a}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t,n=this._gridRect();if(!n)return;const a=s.startX-1,o=s.startY;let c=!1,h=!1;const d=this._screenXToPlotPx(s.clientX),u=s.clientY-n.top;let m=d-a,g=u-o,p={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(m+a)>i.layout.gridWidth?m=i.layout.gridWidth-a:d<0&&(m=a),a>d&&(c=!0,m=Math.abs(m)),o>u&&(h=!0,g=Math.abs(g)),p="x"===e?{x:c?a-m:a,y:0,width:m,height:i.layout.gridHeight}:"y"===e?{x:0,y:h?o-g:o,width:i.layout.gridWidth,height:g}:{x:c?a-m:a,y:h?o-g:o,width:m,height:g},p=r(l({},p),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(p),s.selectionDragging("resizing"),p}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:a}=e.detail,o=this.constraints;let{x:l,y:r}=a;l<o.x&&(l=o.x),r<o.y&&(r=o.y),a.x2>o.x2&&(l=o.x2-a.w),a.y2>o.y2&&(r=o.y2-a.h),n.move(l,r);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const m=s.config.chart.link,g=!(!m||!m.enabled&&"function"!=typeof m.dimension);("function"==typeof s.config.chart.events.selection||g)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},h))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;const n=this._gridRect();if(!n)return;const a=this.selectionRect.node.getBoundingClientRect(),o=this.xyRatios;let l,r,c,h;const d=this._screenXToPlotPx(a.left),u=this._screenXToPlotPx(a.right);if(e.axisFlags.isRangeBar)l=e.globals.yAxisScale[0].niceMin+d*o.invertedYRatio,r=e.globals.yAxisScale[0].niceMin+u*o.invertedYRatio,c=0,h=1;else{if(!e.globals.xAxisScale)return;l=v.pxToDataX(e,d),r=v.pxToDataX(e,u),c=e.globals.yAxisScale[0].niceMin+(n.bottom-a.bottom)*o.yRatio[0],h=e.globals.yAxisScale[0].niceMax-(a.top-n.top)*o.yRatio[0]}const m={xaxis:{min:l,max:r},yaxis:{min:c,max:h}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,m),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,m),null==(t=this.ctx.linkedViews)||t.onSourceSelection(m.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,n=t,a=this.xyRatios,o=this.ctx.toolbar,l=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect(),r=n._gridRect();if(!r)return;const c=this._screenXToPlotPx(l.left),h=this._screenXToPlotPx(l.right),d=l.top-r.top,u=l.bottom-r.top;let m,g;s.axisFlags.isRangeBar?(m=s.globals.yAxisScale[0].niceMin+c*a.invertedYRatio,g=s.globals.yAxisScale[0].niceMin+h*a.invertedYRatio):(m=v.pxToDataX(s,c),g=v.pxToDataX(s,h));const x=[],f=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-a.yRatio[i]*d,o=s.globals.yAxisScale[e].niceMax-a.yRatio[i]*u;x.push(n),f.push(o)}),n.dragged&&(n.dragX>10||n.dragY>10)&&m!==g)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=p.clone(s.globals.initialConfig.yaxis),i=p.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(m=Math.floor(m),g=Math.floor(g),m<1&&(m=1,g=s.globals.dataPoints),g-m<2&&(g=m+1)),"xy"!==e&&"x"!==e||(i={min:m,max:g}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=f[i],t[i].max=x[i]}),o){const e=o.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const a={xaxis:i};s.config.chart.group||(a.yaxis=t),n.ctx.updateHelpers._updateOptions(a,!1,n.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof s.config.chart.events.zoomed&&o.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,a=null;if(a={min:m,max:g},"xy"===e||"y"===e){const e=p.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=f[i],e[i].max=x[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:a,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(a)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,a=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,a)}panScrolled(t,e){var i,s;const n=this.w,a=this.xyRatios;if(!n.globals.initialConfig)return;const o=p.clone(n.globals.initialConfig.yaxis);let l=a.xRatio,r=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(l=a.invertedYRatio,r=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=r+n.layout.gridWidth/15*l,e=c+n.layout.gridWidth/15*l):"right"===this.moveDirection&&(t=r-n.layout.gridWidth/15*l,e=c-n.layout.gridWidth/15*l),!n.axisFlags.isRangeBar){const a=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,o=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<a||e>o)&&(t=r,e=c)}const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=o),this.updateScrolledChart(h,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_gridRect(){const t=this.w.dom.baseEl,e=t&&t.querySelector(".apexcharts-grid");return e?e.getBoundingClientRect():null}_screenXToPlotPx(t){return v.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const n=this._currentXWindow(),a=i&&e-t>n.max-n.min,o=this._clampBounds();if(o){const i=e-t;t<o.min&&(e=(t=o.min)+i),e>o.max&&(t=(e=o.max)-i),t<o.min&&(t=o.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=a?Math.ceil(e):Math.floor(e),t<1&&(t=1),o&&e>o.max&&(e=Math.floor(o.max)),e-t<2))return!1;if(!(e>t))return!1;const l={xaxis:{min:t,max:e}};return s.config.chart.group||(l.yaxis=p.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(l,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"===s){this._cancelInertia();const s=this._gridRect();if(!s)return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t,s);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],n=this._currentXWindow(),a=e.layout.gridWidth||1;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,ratio0:(n.max-n.min)/a},i.samples=[{x:s.clientX,t:t.timeStamp}]}return}"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t)}_beginPinch(t,e){const i=this.w,s=t.touches[0],n=t.touches[1],a=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,o=(s.clientX+n.clientX)/2-e.left-i.globals.barPadForNumericAxis,{min:l,max:r}=this._currentXWindow();this._m().pinch={d0:a,cx0:o,minX0:l,maxX0:r,gridWidth:i.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i)return;const s=this._gridRect();if(!s)return;const n=t.touches[0],a=t.touches[1],o=Math.hypot(a.clientX-n.clientX,a.clientY-n.clientY)||1,l=(n.clientX+a.clientX)/2-s.left-e.globals.barPadForNumericAxis,r=i.maxX0-i.minX0,c=r*(i.d0/o);let h=i.minX0+i.cx0/i.gridWidth*r-l/i.gridWidth*c,d=h+c;const u=this._clampBounds();if(u){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(u.max-u.min));if(d-h<i){const t=(h+d)/2;h=t-i/2,d=t+i/2}}this._applyXRange(h,d,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?p.clone(t.globals.initialConfig.yaxis):[],a=this.ctx.toolbar;a&&a.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),a=Math.abs(s.clientY-i.startY);if(n<6&&a<6)return void this._pushSample(s.clientX,t.timeStamp);if(a>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let a=t,o=null;i.busy=!0;const l=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==o)return o=t,void(i.inertiaRAF=requestAnimationFrame(l));const s=t-o;if(o=t,a*=Math.pow(n,s/16.6667),Math.abs(a)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const r=this._currentXWindow(),c=e.layout.gridWidth||1,h=(r.max-r.min)/c,d=a*s*h,u=this._applyXRange(r.min-d,r.max-d,!1),m=this._clampBounds();if(!u||m&&(d>0&&u.minX<=m.min+1e-6*(m.max-m.min)||d<0&&u.maxX>=m.max-1e-6*(m.max-m.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(l)};i.inertiaRAF=requestAnimationFrame(l)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default});
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,l=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&a(t,i,e[i]);if(s)for(var i of s(e))o.call(e,i)&&a(t,i,e[i]);return t},r=(t,s)=>e(t,i(s));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_Graphics,u=h.__apex_axes_AxesUtils,m=h.__apex_Data,g=h.__apex_Series,p=h.__apex_Utils,x=h.__apex_Environment_Environment,f=h.__apex_BrowserAPIs_BrowserAPIs,b=h.__apex_math_SVGNS;class y{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const n=i[t],o=document.createElementNS(b,"image");o.setAttribute("x",n.getAttribute("x")||"0"),o.setAttribute("y",n.getAttribute("y")||"0"),o.setAttribute("width",n.getAttribute("width")||"0"),o.setAttribute("height",n.getAttribute("height")||"0"),o.setAttribute("href",s),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(o,n)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!x.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=f.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!x.isBrowser())return Promise.resolve([]);const t=[],e=[],i=e=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const i=e.match(/font-family\s*:\s*([^;}]+)/i);if(!i)return;const s=i[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:s.toLowerCase(),css:e})})};return Array.from(document.styleSheets||[]).forEach(t=>{let s=null;try{s=t.cssRules}catch(t){s=null}s?Array.from(s).forEach(t=>{5===t.type&&t.cssText&&i(t.cssText)}):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(i).catch(()=>{}))}),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!x.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(b,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t){const e=[],i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let s;for(;null!==(s=i.exec(t));)s[2].startsWith("data:")||e.push(s[2]);return e.length?Promise.all(e.map(t=>this.fetchAsDataUri(t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{const i=this.w;let s=t||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;s||(s=1);const n=i.globals.svgWidth*s,o=i.globals.svgHeight*s,a=i.dom.elWrap.cloneNode(!0);a.style.width=n+"px",a.style.height=o+"px",this.inlineCanvasLayers(a),this.applyExportStyles(a);const l=(new XMLSerializer).serializeToString(a);let r=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${i.globals.svgWidth}px" height="${i.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${n}px; height:${o}px;">\n ${l}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(r);1!==s&&this.scaleSvgNode(c,s),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{r=(new XMLSerializer).serializeToString(c),e(r.replace(/ /g," "))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const o=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(o).catch(()=>this.getBase64FromUrl(n).then(o).catch(t=>{}))});return Promise.all(s)}getBase64FromUrl(t){return x.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return x.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=t?t.scale||t.width/i.globals.svgWidth:1,n=document.createElement("canvas");n.width=i.globals.svgWidth*s,n.height=parseInt(i.dom.elWrap.style.height,10)*s;const o=this.resolveExportBackground(),a=n.getContext("2d");a&&(a.fillStyle=o,a.fillRect(0,0,n.width,n.height),this.getSvgString(s).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{a.drawImage(s,0,0);const t=n;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=n.toDataURL("image/png");e({imgURI:t})}},s.src=i}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const n=this.w;t||(t=n.config.series);let o=[];const a=[];let l="";const r=n.seriesData.series.map((t,e)=>-1===n.globals.collapsedSeriesIndices.indexOf(e)?t:[]),c=t=>{if(null==t||p.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)?`'${e}`:e},h=t=>"function"==typeof n.config.chart.toolbar.export.csv.categoryFormatter?n.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===n.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():p.isNumber(t)?t:c(t.split(i).join("")),d=t=>"function"==typeof n.config.chart.toolbar.export.csv.valueFormatter?n.config.chart.toolbar.export.csv.valueFormatter(t):c(t),x=Math.max(...t.map(t=>t.data?t.data.length:0)),f=new m(this.w),b=new u(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),y=t=>{let e="";if(n.globals.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(n.globals.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new g(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=b.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;"datetime"===n.config.xaxis.type&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),p.isNumber(e)?e:e.split(i).join(""))},w=(e,s)=>{var l,c,u,m,g,p;if(o.length&&0===s&&a.push(o.join(i)),e.data){const b=e.data.length?e.data:[...Array(x)].map(()=>"");for(let x=0;x<b.length;x++){o=[];let b=y(x);if("nullvalue"!==b){if(b||(f.isFormatXY()?b=t[s].data[x].x:f.isFormat2DArray()&&(b=t[s].data[x]?t[s].data[x][0]:"")),0===s){o.push(h(b));for(let e=0;e<n.seriesData.series.length;e++){const i=f.isFormatXY()?null==(l=t[e].data[x])?void 0:l.y:r[e][x];o.push(d(i))}}("candlestick"===n.config.chart.type||e.type&&"candlestick"===e.type)&&(o.pop(),o.push(n.candleData.seriesCandleO[s][x]),o.push(n.candleData.seriesCandleH[s][x]),o.push(n.candleData.seriesCandleL[s][x]),o.push(n.candleData.seriesCandleC[s][x])),("boxPlot"===n.config.chart.type||e.type&&"boxPlot"===e.type)&&(o.pop(),o.push(n.candleData.seriesCandleO[s][x]),o.push(n.candleData.seriesCandleH[s][x]),o.push(n.candleData.seriesCandleM[s][x]),o.push(n.candleData.seriesCandleL[s][x]),o.push(n.candleData.seriesCandleC[s][x])),"rangeBar"===n.config.chart.type&&(o.pop(),o.push(n.rangeData.seriesRangeStart[s][x]),o.push(n.rangeData.seriesRangeEnd[s][x])),("violin"===n.config.chart.type||e.type&&"violin"===e.type)&&(o.pop(),o.push(null==(c=n.violinData.seriesViolinMin[s])?void 0:c[x]),o.push(null==(u=n.violinData.seriesViolinMax[s])?void 0:u[x]),o.push(null!=(p=null==(g=null==(m=n.violinData.seriesViolinPoints[s])?void 0:m[x])?void 0:g.length)?p:0)),o.length&&a.push(o.join(i))}}}};o.push(n.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===n.config.chart.type?(o.push("minimum"),o.push("q1"),o.push("median"),o.push("q3"),o.push("maximum")):"candlestick"===n.config.chart.type?(o.push("open"),o.push("high"),o.push("low"),o.push("close")):"rangeBar"===n.config.chart.type?(o.push("minimum"),o.push("maximum")):"violin"===n.config.chart.type?(o.push("minimum"),o.push("maximum"),o.push("observations")):t.map((t,e)=>{const s=(t.name?t.name:`series-${e}`)+"";n.globals.axisCharts&&o.push(s.split(i).join("")?s.split(i).join(""):`series-${e}`)}),n.globals.axisCharts||(o.push(n.config.chart.toolbar.export.csv.headerValue),a.push(o.join(i))),n.globals.allSeriesHasEqualX||!n.globals.axisCharts||n.config.xaxis.categories.length||n.config.labels.length?t.map((t,e)=>{n.globals.axisCharts?w(t,e):(o=[],o.push(h(n.labelData.labels[e])),o.push(d(r[e])),a.push(o.join(i)))}):(()=>{const e=new Map;t.forEach((i,s)=>{null==i||i.data.forEach(i=>{let n,o;if(f.isFormatXY())n=i.x,o=i.y;else{if(!f.isFormat2DArray())return;n=i[0],o=i[1]}const a=String(n);let l=e.get(a);l||(l={cat:n,values:Array(t.length).fill("")},e.set(a,l)),l.values[s]=d(o)})}),o.length&&a.push(o.join(i)),Array.from(e.keys()).sort().forEach(t=>{const{cat:s,values:n}=e.get(t);a.push([h(s),...n].join(i))})})(),l+=a.join(s),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+l),e||n.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,i){if(x.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}class w{constructor(t,e){this.w=t,this.ctx=e,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,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null,this._drawnForZoom=null}resetControlAllowed(){const t=this.w.config.chart;if(!t.zoom||!t.zoom.enabled)return!1;const e=void 0===t.zoom.resetControl?"auto":t.zoom.resetControl;if("auto"!==e)return!!e;return!(t.toolbar&&t.toolbar.show&&t.toolbar.tools&&t.toolbar.tools.reset)}resetControlDue(){return!!this.w.interact.zoomed&&this.resetControlAllowed()}createToolbar(t={}){var e,i,s;const n=this.w,o=!!t.resetOnly,a=()=>f.createElementNS("http://www.w3.org/1999/xhtml","div"),c=()=>{const t=f.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},h=a();if(h.setAttribute("class","apexcharts-toolbar"),h.style.top=n.config.chart.toolbar.offsetY+"px",h.style.right=3-n.config.chart.toolbar.offsetX+"px",n.dom.elWrap.appendChild(h),this.elZoom=c(),this.elZoomIn=c(),this.elZoomOut=c(),this.elPan=c(),this.elSelection=c(),this.elMeasure=c(),this.elZoomReset=c(),this.elMenuIcon=c(),this.elMenu=a(),this.elCustomIcons=[],this.t=n.config.chart.toolbar.tools,this._drawnForZoom=null,o?(this.t={zoom:!1,zoomin:!1,zoomout:!1,selection:!1,pan:!1,measure:!1,download:!1,customIcons:[],reset:!0},this._drawnForZoom="wrap"):!this.t.reset&&this.resetControlDue()&&(this.t=r(l({},this.t),{reset:!0}),this._drawnForZoom="control"),Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(c());const u=[],m=(t,e,i)=>{const s=t.toLowerCase();this.t[s]&&n.config.chart.zoom.enabled&&u.push({el:e,icon:"string"==typeof this.t[s]?this.t[s]:i,title:this.localeValues[t],class:`apexcharts-${s}-icon`})};m("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),m("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const g=t=>{this.t[t]&&n.config.chart[t].enabled&&u.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};g("zoom"),g("selection"),this.t.pan&&n.config.chart.zoom.enabled&&u.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&n.config.chart.measure&&n.config.chart.measure.enabled&&u.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),m("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&u.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)u.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});u.forEach((t,e)=>{t.index&&p.moveIndexInArray(u,e,t.index)});for(let t=0;t<u.length;t++)d.setAttrs(u[t].el,{class:u[t].class,title:u[t].title,"aria-label":u[t].title}),u[t].el.innerHTML=u[t].icon,h.appendChild(u[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!n.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!n.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!n.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!n.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),o||this._createHamburgerMenu(h),o?null==(e=this.elZoomReset)||e.addEventListener("click",this.handleZoomReset.bind(this)):(n.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):n.interact.panEnabled?this.elPan.classList.add(this.selectedClass):n.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):n.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(s=null==(i=this.ctx.measure)?void 0:i.startMeasure)||s.call(i)),this.addToolbarEventListeners())}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),d.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(f.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,d.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,n,o,a,l,r;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(o=this.elPan)||o.addEventListener("click",this.togglePanning.bind(this)),null==(a=this.elMeasure)||a.addEventListener("click",this.toggleMeasure.bind(this)),null==(l=this.elMenuIcon)||l.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let 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));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(r=this.elMenuIcon)||r.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",n=!!e.w.globals[s];i.toggleOtherControls();const o="selection"===t?i.elSelection:i.elZoom;n||(e.w.globals[s]=!0,o.classList.add(i.selectedClass)),o.setAttribute("aria-pressed",String(!!e.w.globals[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,o=!n.interact.measureEnabled;this.toggleOtherControls(),o&&(n.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(n.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.ctx.toolbar,i=!!t.w.interact.panEnabled;e.toggleOtherControls(),i||(t.w.interact.panEnabled=!0,e.elPan.classList.add(e.selectedClass)),e.elPan.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();this.minX=e,this.maxX=i;const s=(e+i)/2,n=(e+s)/2,o=(i+s)/2,a=this._getNewMinXMaxX(n,o);t.interact.disableZoomIn||this.zoomUpdateOptions(a.minX,a.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if(this.minX=e,this.maxX=i,"datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,n=e-(s-e),o=i-(s-i),a=this._getNewMinXMaxX(n,o);t.interact.disableZoomOut||this.zoomUpdateOptions(a.minX,a.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const o={xaxis:s};if(!i.globals.initialConfig)return;const a=p.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(o.yaxis=a),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,a)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new y(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}clearZoomAffordance(){const t=this._drawnForZoom;if(this._drawnForZoom=null,!t||!this.elZoomReset)return;const e=this.elZoomReset.parentNode,i="wrap"===t?e:this.elZoomReset;i&&i.parentNode&&i.parentNode.removeChild(i)}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{var e;const i=t.w;if(!i.interact.zoomed)return;if(i.globals.lastXAxis.min=i.globals.initialConfig.xaxis.min,i.globals.lastXAxis.max=i.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof i.config.chart.events.beforeResetZoom){const e=i.config.chart.events.beforeResetZoom(t,i);e&&t.updateHelpers.revertDefaultAxisMinMax(e)}"function"==typeof i.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:i.config.xaxis.min,max:i.config.xaxis.max});const s=t.ctx.series.emptyCollapsedSeries(p.clone(i.globals.initialSeries));t.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled),i.interact.zoomed=!1,null==(e=t.ctx.toolbar)||e.clearZoomAffordance()})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class v{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/v.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*v.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const n=s.getBoundingClientRect(),o=t.globals.svgWidth?n.width/t.globals.svgWidth:1;return(e-n.left)/(o||1)-t.layout.translateX}}const S=h.__apex_index_Box;h.default.registerFeatures({toolbar:w,zoomPanSelection:class extends w{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new d(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new S(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.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=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this.hoverArea.addEventListener("keydown",i.escapeResetEvent.bind(i),{capture:!1,passive:!0}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,o=i.config.chart.toolbar.autoSelected;if("measure"!==o&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===o?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(o),i.interact.shiftWasPressed=!1)),!e.target)return;const a=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(a.contains("apexcharts-legend-marker")||a.contains("apexcharts-legend-text")||l&&l.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=this._gridRect();if(!t)return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this.clientY-t.top,this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w,s=this._gridRect();s&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this.clientY-s.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_focusForKeyboard(){var t,e;const i=this.w.dom.Paper&&this.w.dom.Paper.node;if(i&&"function"==typeof i.focus&&null!==i.getAttribute("tabindex")){null==(e=null==(t=this.ctx.keyboardNavigation)?void 0:t.notePointerFocus)||e.call(t);try{i.focus({preventScroll:!0})}catch(t){i.focus()}}}escapeResetEvent(t){if("Escape"!==t.key&&"Esc"!==t.key)return;if(!this.w.interact.zoomed)return;const e=this.ctx.keyboardNavigation;e&&e.active||this.resetControlAllowed()&&this.handleZoomReset()}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){t.preventDefault();const e=this._wheel();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=this._gridRect();if(!s||!s.width)return;const{min:n,max:o}=this._currentXWindow(),a=o-n,l=Math.min(Math.max((e.clientX-s.left)/s.width,0),1);let r=a*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));r<i&&(r=i),r>c.max-c.min&&(r=c.max-c.min)}let h=n+l*a-l*r,d=h+r;const u=1e-9*a;if(Math.abs(h-n)<u&&Math.abs(d-o)<u)return;if(isNaN(h)||isNaN(d))return;const m=this.getBeforeZoomRange({min:h,max:d},void 0);m&&m.xaxis&&(h=m.xaxis.min,d=m.xaxis.max),this._applyXRange(h,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?p.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,n)=>"l"===n||"r"===n?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(r(l({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=v.dataXToPx(t,t.config.chart.selection.xaxis.min),s=v.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:n=0,translateY:o=0}){const a=this.w,l=this.zoomRect,r=this.selectionRect;if(this.dragged||null!==a.interact.selection){const c={transform:"translate("+n+", "+o+")"};a.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),l.attr({x:t,y:e,width:i,height:s,fill:a.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":a.config.chart.zoom.zoomedArea.fill.opacity,stroke:a.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":a.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":a.config.chart.zoom.zoomedArea.stroke.opacity}),d.setAttrs(l.node,c)),a.interact.selectionEnabled&&(r.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:a.config.chart.selection.fill.color,"fill-opacity":a.config.chart.selection.fill.opacity,stroke:a.config.chart.selection.stroke.color,"stroke-width":a.config.chart.selection.stroke.width,"stroke-dasharray":a.config.chart.selection.stroke.dashArray,"stroke-opacity":a.config.chart.selection.stroke.opacity}),d.setAttrs(r.node,c))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,n=t=>Math.min(Math.max(t,0),e),o=n(i),a=n(i+s);o===i&&a===i+s||(t.attr({x:o,width:a-o}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t,n=this._gridRect();if(!n)return;const o=s.startX-1,a=s.startY;let c=!1,h=!1;const d=this._screenXToPlotPx(s.clientX),u=s.clientY-n.top;let m=d-o,g=u-a,p={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(m+o)>i.layout.gridWidth?m=i.layout.gridWidth-o:d<0&&(m=o),o>d&&(c=!0,m=Math.abs(m)),a>u&&(h=!0,g=Math.abs(g)),p="x"===e?{x:c?o-m:o,y:0,width:m,height:i.layout.gridHeight}:"y"===e?{x:0,y:h?a-g:a,width:i.layout.gridWidth,height:g}:{x:c?o-m:o,y:h?a-g:a,width:m,height:g},p=r(l({},p),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(p),s.selectionDragging("resizing"),p}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:o}=e.detail,a=this.constraints;let{x:l,y:r}=o;l<a.x&&(l=a.x),r<a.y&&(r=a.y),o.x2>a.x2&&(l=a.x2-o.w),o.y2>a.y2&&(r=a.y2-o.h),n.move(l,r);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const m=s.config.chart.link,g=!(!m||!m.enabled&&"function"!=typeof m.dimension);("function"==typeof s.config.chart.events.selection||g)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},h))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;const n=this._gridRect();if(!n)return;const o=this.selectionRect.node.getBoundingClientRect(),a=this.xyRatios;let l,r,c,h;const d=this._screenXToPlotPx(o.left),u=this._screenXToPlotPx(o.right);if(e.axisFlags.isRangeBar)l=e.globals.yAxisScale[0].niceMin+d*a.invertedYRatio,r=e.globals.yAxisScale[0].niceMin+u*a.invertedYRatio,c=0,h=1;else{if(!e.globals.xAxisScale)return;l=v.pxToDataX(e,d),r=v.pxToDataX(e,u),c=e.globals.yAxisScale[0].niceMin+(n.bottom-o.bottom)*a.yRatio[0],h=e.globals.yAxisScale[0].niceMax-(o.top-n.top)*a.yRatio[0]}const m={xaxis:{min:l,max:r},yaxis:{min:c,max:h}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,m),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,m),null==(t=this.ctx.linkedViews)||t.onSourceSelection(m.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,n=t,o=this.xyRatios,a=this.ctx.toolbar,l=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect(),r=n._gridRect();if(!r)return;const c=this._screenXToPlotPx(l.left),h=this._screenXToPlotPx(l.right),d=l.top-r.top,u=l.bottom-r.top;let m,g;s.axisFlags.isRangeBar?(m=s.globals.yAxisScale[0].niceMin+c*o.invertedYRatio,g=s.globals.yAxisScale[0].niceMin+h*o.invertedYRatio):(m=v.pxToDataX(s,c),g=v.pxToDataX(s,h));const x=[],f=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*d,a=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*u;x.push(n),f.push(a)}),n.dragged&&(n.dragX>10||n.dragY>10)&&m!==g)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=p.clone(s.globals.initialConfig.yaxis),i=p.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(m=Math.floor(m),g=Math.floor(g),m<1&&(m=1,g=s.globals.dataPoints),g-m<2&&(g=m+1)),"xy"!==e&&"x"!==e||(i={min:m,max:g}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=f[i],t[i].max=x[i]}),a){const e=a.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const o={xaxis:i};s.config.chart.group||(o.yaxis=t);const l=n.ctx.updateHelpers._updateOptions(o,!1,n.w.config.chart.animations.dynamicAnimation.enabled);l&&"function"==typeof l.then?l.then(()=>n._focusForKeyboard()):n._focusForKeyboard(),"function"==typeof s.config.chart.events.zoomed&&a.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,o=null;if(o={min:m,max:g},"xy"===e||"y"===e){const e=p.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=f[i],e[i].max=x[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:o,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(o)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,o=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,o)}panScrolled(t,e){var i,s;const n=this.w,o=this.xyRatios;if(!n.globals.initialConfig)return;const a=p.clone(n.globals.initialConfig.yaxis);let l=o.xRatio,r=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(l=o.invertedYRatio,r=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=r+n.layout.gridWidth/15*l,e=c+n.layout.gridWidth/15*l):"right"===this.moveDirection&&(t=r-n.layout.gridWidth/15*l,e=c-n.layout.gridWidth/15*l),!n.axisFlags.isRangeBar){const o=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,a=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<o||e>a)&&(t=r,e=c)}const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=a),this.updateScrolledChart(h,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_gridRect(){const t=this.w.dom.baseEl,e=t&&t.querySelector(".apexcharts-grid");return e?e.getBoundingClientRect():null}_screenXToPlotPx(t){return v.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const n=this._currentXWindow(),o=i&&e-t>n.max-n.min,a=this._clampBounds();if(a){const i=e-t;t<a.min&&(e=(t=a.min)+i),e>a.max&&(t=(e=a.max)-i),t<a.min&&(t=a.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=o?Math.ceil(e):Math.floor(e),t<1&&(t=1),a&&e>a.max&&(e=Math.floor(a.max)),e-t<2))return!1;if(!(e>t))return!1;const l={xaxis:{min:t,max:e}};return s.config.chart.group||(l.yaxis=p.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(l,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"===s){this._cancelInertia();const s=this._gridRect();if(!s)return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t,s);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],n=this._currentXWindow(),o=e.layout.gridWidth||1;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,ratio0:(n.max-n.min)/o},i.samples=[{x:s.clientX,t:t.timeStamp}]}return}"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t)}_beginPinch(t,e){const i=this.w,s=t.touches[0],n=t.touches[1],o=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,a=(s.clientX+n.clientX)/2-e.left-i.globals.barPadForNumericAxis,{min:l,max:r}=this._currentXWindow();this._m().pinch={d0:o,cx0:a,minX0:l,maxX0:r,gridWidth:i.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i)return;const s=this._gridRect();if(!s)return;const n=t.touches[0],o=t.touches[1],a=Math.hypot(o.clientX-n.clientX,o.clientY-n.clientY)||1,l=(n.clientX+o.clientX)/2-s.left-e.globals.barPadForNumericAxis,r=i.maxX0-i.minX0,c=r*(i.d0/a);let h=i.minX0+i.cx0/i.gridWidth*r-l/i.gridWidth*c,d=h+c;const u=this._clampBounds();if(u){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(u.max-u.min));if(d-h<i){const t=(h+d)/2;h=t-i/2,d=t+i/2}}this._applyXRange(h,d,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?p.clone(t.globals.initialConfig.yaxis):[],o=this.ctx.toolbar;o&&o.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),o=Math.abs(s.clientY-i.startY);if(n<6&&o<6)return void this._pushSample(s.clientX,t.timeStamp);if(o>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let o=t,a=null;i.busy=!0;const l=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==a)return a=t,void(i.inertiaRAF=requestAnimationFrame(l));const s=t-a;if(a=t,o*=Math.pow(n,s/16.6667),Math.abs(o)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const r=this._currentXWindow(),c=e.layout.gridWidth||1,h=(r.max-r.min)/c,d=o*s*h,u=this._applyXRange(r.min-d,r.max-d,!1),m=this._clampBounds();if(!u||m&&(d>0&&u.minX<=m.min+1e-6*(m.max-m.min)||d<0&&u.maxX>=m.max-1e-6*(m.max-m.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(l)};i.inertiaRAF=requestAnimationFrame(l)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default});
|