ztd-charts-cli 0.5.1 → 0.7.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/README.md +1 -1
- package/dist/api.js +1 -1
- package/dist/{chunk-QVXYPBAX.js → chunk-4WXNLD5P.js} +54 -19
- package/dist/cli.js +1 -1
- package/dist/client/area.js +28 -0
- package/dist/client/bar.js +28 -0
- package/dist/client/beeswarm.js +28 -0
- package/dist/client/box.js +28 -0
- package/dist/client/bubble.js +28 -0
- package/dist/client/bullet.js +28 -0
- package/dist/client/bump.js +28 -0
- package/dist/client/calendar.js +28 -0
- package/dist/client/candlestick.js +28 -0
- package/dist/client/chord.js +28 -0
- package/dist/client/donut.js +28 -0
- package/dist/client/dumbbell.js +28 -0
- package/dist/client/funnel.js +28 -0
- package/dist/client/gauge.js +28 -0
- package/dist/client/heatmap.js +28 -0
- package/dist/client/histogram.js +28 -0
- package/dist/client/line.js +28 -0
- package/dist/client/lollipop.js +28 -0
- package/dist/client/marimekko.js +28 -0
- package/dist/client/parallel.js +28 -0
- package/dist/client/pareto.js +28 -0
- package/dist/client/pie.js +28 -0
- package/dist/client/radar.js +28 -0
- package/dist/client/radialBar.js +28 -0
- package/dist/client/react.js +66 -0
- package/dist/client/ridgeline.js +28 -0
- package/dist/client/sankey.js +28 -0
- package/dist/client/scatter.js +28 -0
- package/dist/client/segmented.js +28 -0
- package/dist/client/skyline.js +28 -0
- package/dist/client/slope.js +28 -0
- package/dist/client/sparkline.js +28 -0
- package/dist/client/stream.js +28 -0
- package/dist/client/sunburst.js +28 -0
- package/dist/client/tileMap.js +28 -0
- package/dist/client/treemap.js +28 -0
- package/dist/client/waffle.js +28 -0
- package/dist/client/waterfall.js +28 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ztd-charts-cli
|
|
2
2
|
|
|
3
|
-
`ztd-charts`: the list of all
|
|
3
|
+
`ztd-charts`: the list of all 37 charts, JSON Schema, spec validation, SVG/PNG/HTML rendering, starter files, and chart suggestions from your data.
|
|
4
4
|
|
|
5
5
|
[Website](https://charts.ztd.app) · [Gallery](https://charts.ztd.app/docs/) · [GitHub](https://github.com/Junhan2/ztd-charts)
|
|
6
6
|
|
package/dist/api.js
CHANGED
|
@@ -3,16 +3,16 @@ import { existsSync, readFileSync, readdirSync } from "fs";
|
|
|
3
3
|
import { createRequire } from "module";
|
|
4
4
|
import { dirname, join, resolve } from "path";
|
|
5
5
|
import { fileURLToPath } from "url";
|
|
6
|
-
import { CHARTS, commonOptionsIn, findGroup, findLevel, getChartDef, localizeDef, schemaForIn, specLocale, specSchemaIn, suggestCharts, validateSpec, variantsIn, TYPE_ALIASES } from "ztd-charts/spec";
|
|
6
|
+
import { CHARTS, commonOptionsIn, downloadFields, FACET_TYPES, findGroup, findLevel, getChartDef, localizeDef, schemaForIn, specLocale, specSchemaIn, specTemplate, suggestCharts, validateSpec, variantsIn, TYPE_ALIASES } from "ztd-charts/spec";
|
|
7
7
|
import { inlineRows, normalizeData, parseCSV } from "ztd-charts/spec";
|
|
8
|
-
import { langOf, renderSpecToHTML, renderSpecToSVG, resolveSpecData } from "ztd-charts/server";
|
|
8
|
+
import { langOf, renderSpecToHTML, renderSpecToSVG, resolveDef, resolveSpecData } from "ztd-charts/server";
|
|
9
9
|
|
|
10
10
|
// src/messages.ts
|
|
11
11
|
import { plural } from "ztd-charts/server";
|
|
12
|
-
var VERSION = "0.
|
|
12
|
+
var VERSION = "0.7.0";
|
|
13
13
|
var SCHEMA_URL = "https://unpkg.com/ztd-charts/schema/chart-spec.schema.json";
|
|
14
14
|
var en = {
|
|
15
|
-
help: `ztd-charts ${VERSION} CLI for
|
|
15
|
+
help: `ztd-charts ${VERSION} CLI for 37 React chart types
|
|
16
16
|
|
|
17
17
|
Usage
|
|
18
18
|
ztd-charts list [--group proportion] [--level basic] [--json]
|
|
@@ -103,7 +103,7 @@ ${n} charts. Details: ztd-charts info <type>`,
|
|
|
103
103
|
})
|
|
104
104
|
};
|
|
105
105
|
var ko = {
|
|
106
|
-
help: `ztd-charts ${VERSION} React \uCC28\uD2B8
|
|
106
|
+
help: `ztd-charts ${VERSION} React \uCC28\uD2B8 37\uC885\uC744 \uC704\uD55C CLI
|
|
107
107
|
|
|
108
108
|
\uC0AC\uC6A9\uBC95
|
|
109
109
|
ztd-charts list [--group \uBE44\uC728] [--level \uAE30\uBCF8] [--json]
|
|
@@ -274,6 +274,28 @@ function jsxValue(v) {
|
|
|
274
274
|
return typeof v === "string" && j === `"${v}"` && !v.includes("&") ? j : `{${j}}`;
|
|
275
275
|
}
|
|
276
276
|
var JSX_NAME = /^[A-Za-z_$][\w$-]*$/;
|
|
277
|
+
function facetElement(component, type, facet, props) {
|
|
278
|
+
const own = [props[0]];
|
|
279
|
+
const fields = [];
|
|
280
|
+
for (const p of props.slice(1)) {
|
|
281
|
+
const at = p.indexOf("=");
|
|
282
|
+
const name = p.slice(0, at);
|
|
283
|
+
const value = p.slice(at + 1);
|
|
284
|
+
if (name === "highlight") own.push(p);
|
|
285
|
+
else fields.push(`${/^[A-Za-z_$][\w$]*$/.test(name) ? name : JSON.stringify(name)}: ${value.startsWith("{") ? value.slice(1, -1) : value}`);
|
|
286
|
+
}
|
|
287
|
+
const { columns, scale } = facet;
|
|
288
|
+
const head = [
|
|
289
|
+
`chart={${component}}`,
|
|
290
|
+
`type=${jsxValue(type)}`,
|
|
291
|
+
own[0],
|
|
292
|
+
`by=${jsxValue(facet.by)}`,
|
|
293
|
+
...Number.isInteger(columns) && columns >= 1 ? [`columns=${jsxValue(columns)}`] : [],
|
|
294
|
+
...scale === "shared" || scale === "free" ? [`scale=${jsxValue(scale)}`] : [],
|
|
295
|
+
...own.slice(1)
|
|
296
|
+
];
|
|
297
|
+
return `<ChartFacets ${head.join(" ")} chartProps={{ ${fields.join(", ")} }} />`;
|
|
298
|
+
}
|
|
277
299
|
function reactSnippet(spec, opts = {}) {
|
|
278
300
|
const ko2 = langOf(opts.locale) === "ko";
|
|
279
301
|
const def = resolveType(spec.type);
|
|
@@ -285,10 +307,17 @@ function reactSnippet(spec, opts = {}) {
|
|
|
285
307
|
const v = spec.encoding?.[c.name];
|
|
286
308
|
if (v !== void 0) props.push(`${c.prop ?? c.name}=${jsxValue(v)}`);
|
|
287
309
|
}
|
|
288
|
-
|
|
289
|
-
const
|
|
310
|
+
const template = specTemplate(spec);
|
|
311
|
+
const tipLocale = specLocale(spec);
|
|
312
|
+
for (const [k, v] of Object.entries(spec.options ?? {})) {
|
|
313
|
+
if (!JSX_NAME.test(k)) continue;
|
|
314
|
+
if (k === "tooltip" && template) props.push(`tooltip={templateTooltip(${JSON.stringify(template)}${tipLocale ? `, ${JSON.stringify(tipLocale)}` : ""})}`);
|
|
315
|
+
else props.push(`${k}=${jsxValue(v)}`);
|
|
316
|
+
}
|
|
317
|
+
const facet = spec.facet && typeof spec.facet.by === "string" && FACET_TYPES.includes(def.type) && !(def.type === "bar" && spec.options?.layout === "diverging") ? spec.facet : void 0;
|
|
318
|
+
const chartEl = facet ? facetElement(def.component, def.type, facet, props) : `<${def.component} ${props.join(" ")} />`;
|
|
290
319
|
const card = spec.card;
|
|
291
|
-
const imports = card
|
|
320
|
+
const imports = [card && "ChartCard", card?.download && "DownloadButtons", facet && "ChartFacets", def.component, template && "templateTooltip"].filter(Boolean).join(", ");
|
|
292
321
|
const more = rows && rows.length > 12 ? ko2 ? ` // \uC678 ${rows.length - 12}\uD589` : ` // and ${rows.length - 12} more rows` : "";
|
|
293
322
|
const dataLine = rows && opts.inlineData !== false ? `const ${dataVar} = ${JSON.stringify(rows.slice(0, 12), null, 2)}${more};
|
|
294
323
|
|
|
@@ -297,8 +326,13 @@ function reactSnippet(spec, opts = {}) {
|
|
|
297
326
|
let body = chartEl;
|
|
298
327
|
if (card) {
|
|
299
328
|
const cp = [];
|
|
300
|
-
for (const k of ["number", "title", "subtitle", "takeaway", "level"]) if (card[k]) cp.push(`${k}=${jsxValue(card[k])}`);
|
|
329
|
+
for (const k of ["number", "title", "subtitle", "takeaway", "level", "source", "note", "accent"]) if (card[k]) cp.push(`${k}=${jsxValue(card[k])}`);
|
|
301
330
|
if (Array.isArray(card.legend)) cp.push(`legend=${jsxValue(card.legend)}`);
|
|
331
|
+
if (card.download) {
|
|
332
|
+
const cols = downloadFields(spec);
|
|
333
|
+
const dp = [`data={${dataVar}}`, cols.length ? `columns=${jsxValue(cols)}` : "", card.title ? `filename=${jsxValue(card.title)}` : "", Array.isArray(card.download) ? `formats=${jsxValue(card.download)}` : ""];
|
|
334
|
+
cp.push(`actions={<DownloadButtons ${dp.filter(Boolean).join(" ")} />}`);
|
|
335
|
+
}
|
|
302
336
|
cp.push("replay");
|
|
303
337
|
body = `<ChartCard ${cp.join(" ")}>
|
|
304
338
|
${chartEl}
|
|
@@ -352,15 +386,15 @@ function stripEmoji(svg) {
|
|
|
352
386
|
});
|
|
353
387
|
return { svg: out, removed };
|
|
354
388
|
}
|
|
355
|
-
function
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
return
|
|
361
|
-
|
|
362
|
-
return null;
|
|
389
|
+
function clientScript(type) {
|
|
390
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
391
|
+
for (const dir of [join(here, "client"), join(here, "../dist/client")]) {
|
|
392
|
+
const react = join(dir, "react.js");
|
|
393
|
+
const chart = join(dir, `${type}.js`);
|
|
394
|
+
if (existsSync(react) && existsSync(chart)) return `${readFileSync(react, "utf8")}
|
|
395
|
+
${readFileSync(chart, "utf8")}`;
|
|
363
396
|
}
|
|
397
|
+
return null;
|
|
364
398
|
}
|
|
365
399
|
var FETCH_TIMEOUT_MS = 15e3;
|
|
366
400
|
var MAX_FETCH_BYTES = 20 * 1024 * 1024;
|
|
@@ -421,8 +455,9 @@ async function render(input, opts = {}) {
|
|
|
421
455
|
}
|
|
422
456
|
const format = opts.format ?? "svg";
|
|
423
457
|
if (format === "html") {
|
|
424
|
-
const
|
|
425
|
-
const
|
|
458
|
+
const type = opts.interactive ? resolveDef(spec.type, spec.encoding)?.type : void 0;
|
|
459
|
+
const script = type ? clientScript(type) : null;
|
|
460
|
+
const html = renderSpecToHTML(spec, { width: opts.width, height: opts.height, theme: opts.theme, frame: opts.frame, interactive: script ? { script } : false, locale });
|
|
426
461
|
return { format, html };
|
|
427
462
|
}
|
|
428
463
|
const svg = renderSpecToSVG(spec, { width: opts.width, height: opts.height, theme: opts.theme, frame: opts.frame, locale });
|
package/dist/cli.js
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
(()=>{var Ni=Object.create;var Kr=Object.defineProperty;var Pi=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var Di=Object.getPrototypeOf,Li=Object.prototype.hasOwnProperty;var Vn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Ei=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ri(t))!Li.call(e,o)&&o!==n&&Kr(e,o,{get:()=>t[o],enumerable:!(r=Pi(t,o))||r.enumerable});return e};var L=(e,t,n)=>(n=e!=null?Ni(Di(e)):{},Ei(t||!e||!e.__esModule?Kr(n,"default",{value:e,enumerable:!0}):n,e));var ee=Vn((mu,Ur)=>{Ur.exports=globalThis.__ztdReact.react});var Yr=Vn((du,Xr)=>{Xr.exports=globalThis.__ztdReact["react-dom/client"]});var G=Vn((Su,To)=>{To.exports=globalThis.__ztdReact["react/jsx-runtime"]});var Ar=L(ee(),1),hi=L(Yr(),1);var Kt=L(ee(),1);var un=L(ee(),1);var qr=L(ee(),1),$t=(0,qr.createContext)(void 0);var eo=L(ee(),1);var _i=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Zr='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Jr='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',ot={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:Zr,monoFamily:Jr,radius:18,radiusCode:14,radiusMark:4},Wn={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:Zr,monoFamily:Jr,radius:18,radiusCode:14,radiusMark:4},Gn={dark:ot,light:Wn};function Yt(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Kn(e){let t={};for(let n of _i){let r=e[n];typeof r=="string"&&(t[Yt(n)]=r)}return e.fontFamily&&(t["--ztd-font"]=e.fontFamily),e.monoFamily&&(t["--ztd-mono"]=e.monoFamily),e.radius!==void 0&&(t["--ztd-radius"]=`${e.radius}px`),e.radiusCode!==void 0&&(t["--ztd-radius-code"]=`${e.radiusCode}px`),e.radiusMark!==void 0&&(t["--ztd-radius-mark"]=`${e.radiusMark}px`),t}function Un(e,t){if(!t)return e;let n={...e};for(let r of Object.keys(t)){let o=t[r];o!==void 0&&(n[r]=o)}return n}var Ii=`
|
|
2
|
+
.ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
|
|
3
|
+
.ztd-root:focus{outline:none}
|
|
4
|
+
.ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${ot.accent});outline-offset:3px;border-radius:6px}
|
|
5
|
+
.ztd-svg{display:block;overflow:visible;user-select:none;-webkit-user-select:none}
|
|
6
|
+
.ztd-mark{transition:opacity .18s ease,fill .18s ease,stroke .18s ease,stroke-width .18s ease}
|
|
7
|
+
.ztd-tip{animation:ztd-fade .14s ease-out;transition:left .2s cubic-bezier(.22,1,.36,1),top .2s cubic-bezier(.22,1,.36,1)}
|
|
8
|
+
.ztd-guide{transition:transform .2s cubic-bezier(.22,1,.36,1)}
|
|
9
|
+
.ztd-still .ztd-tip,.ztd-still .ztd-guide{transition:none;animation:none}
|
|
10
|
+
.ztd-btn{appearance:none;font:inherit;cursor:pointer;transition:background .14s,color .14s,border-color .14s}
|
|
11
|
+
.ztd-btn:focus{outline:none}
|
|
12
|
+
.ztd-btn:focus-visible{outline:2px solid var(--ztd-accent,${ot.accent});outline-offset:2px}
|
|
13
|
+
.ztd-card{transition:border-color .16s ease}
|
|
14
|
+
.ztd-card:hover{border-color:var(--ztd-dim,${ot.dim})}
|
|
15
|
+
@media (prefers-reduced-motion: reduce){.ztd-mark,.ztd-tip,.ztd-guide,.ztd-btn,.ztd-card{transition:none;animation:none}}
|
|
16
|
+
@keyframes ztd-pop{from{opacity:0;transform:scale(.45)}to{opacity:1;transform:none}}
|
|
17
|
+
@keyframes ztd-fade{from{opacity:0}to{opacity:1}}
|
|
18
|
+
.ztd-pop{transform-box:fill-box;transform-origin:center}
|
|
19
|
+
@keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
|
|
20
|
+
.ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
|
|
21
|
+
@media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
|
|
22
|
+
`;function to(e,t,n,r,o){if(e)return t?{opacity:0}:{animation:`ztd-${n} ${Math.round(o)}ms cubic-bezier(.22,.9,.3,1) ${Math.round(r)}ms backwards`}}function no(e,t){let[n]=(0,eo.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var Qr=!1;function _t(){if(Qr||typeof document>"u"||(Qr=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=Ii,document.head.appendChild(e)}var qt=L(ee(),1),Pe=typeof window<"u"&&typeof document<"u",ze=Pe?qt.useLayoutEffect:qt.useEffect;function Zt(){return typeof performance<"u"?performance.now():Date.now()}var He=L(ee(),1),Oi=(0,He.createContext)(void 0),Jt=new Map;function Bi(e,t){let n=Jt.get(e);return n||Jt.set(e,n=new Set),n.add(t),()=>{n.delete(t),n.size||Jt.delete(e)}}function zi(e,t,n){Jt.get(e)?.forEach(r=>r(t,n))}function Hi(e,t,n){let r=e.indexOf(n.key);return r>=0||t.length>1e3?r:t.indexOf(n.label)}function ro(e,t,n,r){let o=(0,He.useContext)(Oi),a=t??o,[i]=(0,He.useState)(()=>({})),s=(0,He.useRef)({keys:n,labels:r});s.current={keys:n,labels:r},e.publish.current=a?u=>zi(a,u===null||s.current.keys[u]===void 0?null:{key:s.current.keys[u],label:s.current.labels[u]},i):null;let l=e.applySync;(0,He.useEffect)(()=>{if(a)return Bi(a,(u,d)=>{if(d===i)return;let c=u?Hi(s.current.keys,s.current.labels,u):-1;l(c<0?null:c)})},[a,i,l])}function te(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Re(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var oo={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},ao={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var ji=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],Vi={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Wi(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Gi(e){return Wi(ji,e)}function io(e,t){let n=Gi(e);return{text:n?n[t]:e,...Vi[n?.id??"basic"]}}var so={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ct(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),so[t.toLowerCase()]&&(t=so[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(i=>i+i).join("")),o.length!==6&&o.length!==8||/[^\da-f]/i.test(o))return null;let a=parseInt(o,16);return o.length===6?[a>>16&255,a>>8&255,a&255,1]:[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),parseInt(o.slice(6,8),16)/255]}let r=/^rgba?\(([^)]+)\)$/i.exec(t);if(r){let o=r[1].split(/[\s,/]+/).filter(Boolean);if(o.length<3)return null;let a=o.slice(0,3).map(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),i=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return a.some(s=>Number.isNaN(s))?null:[a[0],a[1],a[2],Number.isNaN(i)?1:i]}return null}function co(e){let t=n=>Math.round(Math.max(0,Math.min(255,n))).toString(16).padStart(2,"0");return`#${t(e[0])}${t(e[1])}${t(e[2])}${e[3]<1?t(e[3]*255):""}`.toUpperCase()}function Yn(e,t){let n=e[3];return[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n),1]}function Mt(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function lo(e){return .2126*Mt(e[0])+.7152*Mt(e[1])+.0722*Mt(e[2])}function qn(e,t,n){let r=typeof e=="string"?Ct(e):e,o=typeof t=="string"?Ct(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?Ct(n):n:null;o[3]<1&&a&&(o=Yn(o,a));let i=r[3]<1?Yn(r,o):r,s=lo(i),l=lo(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Ki(e){return[Mt(e[0]),Mt(e[1]),Mt(e[2])]}function Xn(e){let t=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.max(0,Math.min(255,t*255))}function uo(e){let[t,n,r]=Ki(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),i=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function Ui([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[Xn(4.0767416621*o-3.3077115913*a+.2309699292*i),Xn(-1.2684380046*o+2.6097574011*a-.3413193965*i),Xn(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Qt(e,t,n){let r=Ct(e),o=Ct(t);if(!r||!o)return e;let a=uo(r),i=uo(o),s=Math.max(0,Math.min(1,n));return co(Ui([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function Zn(e,t,n){let r=t[0],o=-1;for(let a of t){let i=qn(a,e,n);i>o&&(o=i,r=a)}return r}function de(e,t){let n=e.theme;switch(t){case"accent":return{role:t,fill:e.paint("accent"),text:e.paint("onAccent"),raw:n.accent};case"ink":return{role:t,fill:e.paint("ink"),text:e.paint("onInk"),raw:n.ink};case"strong":return{role:t,fill:e.paint("neutralStrong"),text:e.paint("onNeutralStrong"),raw:n.neutralStrong};case"soft":return{role:t,fill:e.paint("neutralSoft"),text:e.paint("ink"),raw:n.neutralSoft};default:return{role:"neutral",fill:e.paint("neutral"),text:e.paint("ink"),raw:n.neutral}}}function Xi(e,t){let n=Zn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return qn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Zn(t,["#FFFFFF","#000000"])}function en(e,t){let n=Qt(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:Xi(e,n),raw:n}}function je(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=de(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=de(e,"neutral");else if(s===0)r[i]=de(e,"ink");else if(s===a-1)r[i]=de(e,"neutral");else if(a===3)r[i]=de(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?de(e,"strong"):en(e,1-l)}}),r}var Jn="mix:";function It(e){return e({theme:Wn,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Jn}${o}`}).map(n=>n.fill)}function mo(e,t){return t?.startsWith(Jn)?e.mix("neutralStrong","neutral",Number(t.slice(Jn.length))):e.color(t)}function fo(e,t,n){return je(e,t+1,n).slice(0,t)}function ho(e,t,n,r="neutral"){let o=de(e,"accent"),a=de(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function go(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=de(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=de(e,"neutral"):s===0?r[i]=de(e,"strong"):s===a-1?r[i]=de(e,"neutral"):r[i]=en(e,1-s/(a-1))}),r}var De=L(ee(),1);var nn=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),fe="en-US",po=new Map;function Qn(e,t){let n=t.maximumFractionDigits!==void 0||t.style==="currency"?t:{...t,maximumFractionDigits:Math.max(1,t.minimumFractionDigits??0)},r=e+JSON.stringify(n),o=po.get(r);return o||(o=new Intl.NumberFormat(e,n),po.set(r,o)),o}function er(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function at(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=fe,...r}=t;return er(Qn(n,r).format(e))}var tr=e=>e!==0&&Math.abs(e)<.05,nr=(e,t,n="")=>`${at(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function tn(e,t={}){if(!Number.isFinite(e))return"-";if(tr(e)&&t.maximumFractionDigits===void 0)return nr(e,t.locale??fe,"%");let n=Math.abs(e);return`${at(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function ko(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=fe,...r}=t;if(te(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,l]=a[i],u=o/s,d=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||u<100?1:0)),c=Math.round(u*10**d)/10**d;if(i>0&&c>=a[i-1][0]/s){i--;continue}return(e<0&&c!==0?"-":"")+at(c,{locale:n,...r,maximumFractionDigits:d})+l}}return er(Qn(n,{notation:"compact",...r}).format(e))}var Yi=(e,t=te(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function ht(e,t=fe,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Qn(t,o);return l=>Number.isFinite(l)?`${i}${er(s.format(l))}${a}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:a="",...i}=e;return r(i,o,a)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>tn(o,{locale:t});case"ratio":return o=>tn(o*100,{locale:t});case"compact":return o=>ko(o,{locale:t});case"currency":return r(Yi(t));default:{let o=r({maximumFractionDigits:1});return a=>tr(a)?nr(a,t):o(a)}}}function Tt(e,t=fe,n=0){return e!==void 0?ht(e,t):n>=1e5?r=>tr(r)?nr(r,t):ko(r,{locale:t}):r=>at(r,{locale:t})}function qi(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var rr=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Zi=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Ji=["january","february","march","april","may","june","july","august","september","october","november","december"],bo=e=>{let t=e.toLowerCase();return t.length<3?0:Ji.findIndex(n=>n.startsWith(t))+1},yo=e=>+e+(+e<30?2e3:1900);function wo(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Qi=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],vo=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,$o=/\{([^{}]+)\}/g;function rn(e,t){let n;for(let r of Qi)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[yo(n[3]),+n[2],+n[1],1]:[yo(n[1]),+n[2],+n[3],1];if(n=/^(?:(\d{4})\s*-?\s*Q([1-4])|Q([1-4])\s*-?\s*(\d{4})|(\d{4})년\s*([1-4])분기)$/i.exec(e))return[+(n[1]??n[4]??n[5]),+(n[2]??n[3]??n[6])*3-2,1,3];if(n=vo.exec(e)){let r=+n[1],o=+n[3],a=r>12||o<=12&&t===!0;return[+n[4],a?o:r,a?r:o,1]}if(n=/^(\d{1,2})[\s-]+([a-z]{3,9})\.?[\s-]+(\d{4})$/i.exec(e)){let r=bo(n[2]);return r?[+n[3],r,+n[1],1]:null}if(n=/^([a-z]{3,9})\.?\s+(?:(\d{1,2}),?\s+)?(\d{4})$/i.exec(e)){let r=bo(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var Co=e=>Zi.test(e)||rn(e)!==null;function Mo(e){let t;for(let n of e){let r=typeof n=="string"?vo.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function on(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){if(!Number.isFinite(e))return null;if(Number.isInteger(e)){if(rr(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return on(`${e}`)}return new Date(Math.abs(e)>=1e9&&Math.abs(e)<1e10?e*1e3:e)}if(typeof e=="string"&&e.trim()){let n=e.trim(),r=rn(n,t);if(r)return qi(r[0],r[1],r[2]);if(/^\d{4}$/.test(n))return new Date(Number(n),0,1);if(!/\d{4}/.test(n))return null;let o=new Date(n);return Number.isNaN(o.getTime())?null:o}return null}var xo=new Map;function Ot(e,t={month:"short",day:"numeric"}){let n=on(e);if(!n)return"-";let{locale:r=fe,...o}=t,a=r+JSON.stringify(o),i=xo.get(a);return i||(i=new Intl.DateTimeFormat(r,o),xo.set(a,i)),i.format(n)}var or=L(G(),1),an=(0,De.createContext)({theme:ot,cssVars:!0});function es(e,t=ot){return e?typeof e=="string"?Gn[e]??t:Un(t,e):t}function sn(e){let t=(0,De.useContext)(an),n=e.base?Gn[e.base]:t.theme,r=(0,De.useMemo)(()=>es(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,De.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,De.useMemo)(()=>Kn(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,or.jsx)(an.Provider,{value:i,children:(0,or.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var ts=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function So(e){return ts.has(e)}function ns(e,t){let n=r=>t?`var(${Yt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?So(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?So(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:Qt(e[r],e[o],a)}}}function Le(e){let t=(0,De.useContext)(an);return(0,De.useMemo)(()=>{let n=Un(t.theme,e);return ns(n,t.cssVars)},[t.theme,t.cssVars,e])}function xe(e){let t=(0,De.useContext)(an);return e??t.locale??fe}function Ao(e){return e?Kn(e):{}}var ln=L(ee(),1),ar=(0,ln.createContext)(void 0);function Fo(e){let t=(0,ln.useContext)(ar);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var R=L(G(),1),rs={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},os={en:rs,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var as={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},ir=e=>os[te(xe(e))];function sr(e){let t=Le(e.theme),n=ir(e.locale),[r,o]=(0,un.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(d=>!s.has(d.label)).length,u=(0,R.jsx)("ul",{"aria-label":n.legend,style:{display:"flex",flexWrap:"wrap",justifyContent:e.align==="start"?"flex-start":"flex-end",gap:"4px 12px",margin:0,padding:0,listStyle:"none"},children:e.items.map((d,c)=>{let m=!s.has(d.label),h=m&&l===1,f=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(is,{p:t,item:d,off:!m}),(0,R.jsx)("span",{style:m?void 0:{textDecoration:"line-through"},children:d.label})]});return(0,R.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,R.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":m,"aria-disabled":h||void 0,onClick:()=>{h||(i(d.label),o(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:h?"default":void 0},children:f}):f},c)})});return i?(0,R.jsxs)(R.Fragment,{children:[u,(0,R.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:as,children:r?n.shown(l,e.items.length):""})]}):u}function is({p:e,item:t,off:n}){let r=mo(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,R.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,R.jsx)("line",{x1:1,x2:13,y1:4,y2:4,stroke:r,strokeWidth:2,strokeDasharray:o==="dash"?"3 2":void 0,strokeLinecap:"round"}),o==="line"?(0,R.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,R.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function ss(e){let t=Le(e.theme),n=io(e.level,te(xe(e.locale)));return(0,R.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function ls(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,R.jsxs)(R.Fragment,{children:[e.slice(0,r),(0,R.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function No(e){let t=Le(e.theme),n=ir(e.locale),[r,o]=(0,un.useState)(0);ze(()=>_t(),[]);let a=()=>{o(m=>m+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,R.jsx)(sr,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,u=e.replay||e.onReplay,d=e.source!==void 0||e.note!==void 0?(0,R.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,c=e.takeaway!==void 0||e.level||e.sample?(0,R.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,R.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,R.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,R.jsx)("span",{style:{fontSize:11.5,color:t.paint("muted"),whiteSpace:"nowrap"},children:typeof e.sample=="string"?e.sample:n.sample}):null,e.level?(0,R.jsx)(ss,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,R.jsxs)("section",{id:e.id,className:`ztd-card${e.className?` ${e.className}`:""}`,style:{background:t.paint("panel"),color:t.paint("ink"),border:`1px solid ${t.paint("line")}`,borderRadius:`var(--ztd-radius, ${t.theme.radius}px)`,padding:"20px 20px 16px",display:"flex",flexDirection:"column",gap:12,minWidth:0,boxSizing:"border-box",fontFamily:t.cssVars?`var(--ztd-font, ${t.theme.fontFamily})`:t.theme.fontFamily,wordBreak:"keep-all",textWrap:"balance",...e.style},children:[(0,R.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,R.jsx)("span",{style:{fontFamily:t.cssVars?`var(--ztd-mono, ${t.theme.monoFamily})`:t.theme.monoFamily,fontSize:17,fontWeight:700,color:t.paint("accentText"),letterSpacing:-.2,flex:"none"},children:l}):null,(0,R.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:ls(e.title,e.accent,t.paint("accentText"))}),e.actions,u?(0,R.jsx)("button",{type:"button",className:"ztd-btn",onClick:a,"aria-label":e.replayLabel??n.replay,title:e.replayLabel??n.replayTitle,style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,width:28,height:28,display:"inline-grid",placeItems:"center",padding:0,flex:"none"},children:(0,R.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,R.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,R.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,R.jsx)("span",{}),i]}):null]}),(0,R.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,R.jsx)(ar.Provider,{value:r,children:(0,R.jsx)($t.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),d?(0,R.jsxs)(R.Fragment,{children:[d,c]}):c]})}function lr(e){let t=Le(e.theme),n=ir(e.locale),r=e.height??220;if(ze(()=>_t(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,R.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,R.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,R.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,R.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,R.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onRetry,style:{marginTop:4,background:t.paint("ink"),color:t.paint("onInk"),border:"none",borderRadius:14,padding:"5px 14px",fontSize:12.5,fontWeight:700},children:n.retry}):null]})})}return e.loading?(0,R.jsx)("div",{role:"status","aria-busy":"true","aria-label":n.loading,style:{height:r,display:"flex",alignItems:"flex-end",gap:8,padding:"12px 4px"},children:[.55,.8,.4,.95,.65,.75,.5].map((o,a)=>(0,R.jsx)("span",{className:"ztd-skeleton",style:{flex:1,height:`${o*100}%`,background:t.paint("lift"),borderRadius:6,animationDelay:`${a*90}ms`}},a))}):e.empty?(0,R.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,R.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,R.jsx)(R.Fragment,{children:e.children})}var Rt=L(ee(),1);var ke=L(ee(),1);var Y=L(G(),1),cn=60,ur=8;function Po(e,t){return e.length>ur?[...e.slice(0,ur),{label:t(e.length-ur),value:""}]:e}var mn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Ro(e){let{c:t,events:n}=e,r=(0,ke.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,ze(()=>{_t()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,ke.useContext)($t),u=e.ariaLabel??l??e.kind,d=(0,ke.useMemo)(()=>s?`${n.length}${n.slice(0,cn).map(w=>`${w.label}${w.series??""}${w.formatted??w.value??""}`).join("")}`:"",[n,s]),c=(0,ke.useMemo)(()=>(0,Y.jsx)(us,{label:u,events:n,t:t.t}),[u,d,t.t]),m=(0,ke.useRef)(null);(0,ke.useEffect)(()=>{let w=()=>{m.current=null};return window.addEventListener("scroll",w,{capture:!0,passive:!0}),window.addEventListener("resize",w,{passive:!0}),()=>{window.removeEventListener("scroll",w,{capture:!0}),window.removeEventListener("resize",w)}},[]),(0,ke.useEffect)(()=>{m.current=null},[t.width,t.height]);let h=w=>{if(w.target!==w.currentTarget)return;if(e.onKey?.(w)){w.preventDefault();return}let P=t.active,_;switch(w.key){case"ArrowRight":case"ArrowDown":_=P===null?0:(P+1)%i;break;case"ArrowLeft":case"ArrowUp":_=P===null?i-1:(P-1+i)%i;break;case"Home":_=0;break;case"End":_=i-1;break;case"Escape":if(P===null)return;_=null;break;case"Enter":case" ":P!==null&&(w.preventDefault(),t.click(P));return;default:return}w.preventDefault(),t.setActive(_,"keyboard")},{via:f,node:p,setActive:x}=t;(0,ke.useEffect)(()=>{if(f!=="touch"||!p)return;let w=P=>{p.contains(P.target)||x(null)};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[f,p,x]);let k=t.active!==null?n[t.active]:null,$=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,S=$&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,b=typeof e.renderTip=="function"&&k?e.renderTip(k):null,v=e.announce??(t.via==="keyboard"&&k?`${k.label}${k.series?` ${k.series}`:""}: ${k.formatted??k.value??""} (${(t.active??0)+1}/${i})`:""),O;if($){let w=$.x*S,P=t.width*S,_=`clamp(${(4-w).toFixed(1)}px, -50%, calc(${(P-w-4).toFixed(1)}px - 100%))`,K=$.y<64;O={position:"absolute",left:w,top:$.y*S,transform:`translate(${_}, ${K?"16px":"calc(-100% - 14px)"})`,background:t.p.paint("panel"),color:t.p.paint("ink"),border:`1px solid ${t.p.paint("line")}`,borderRadius:12,padding:"8px 11px",pointerEvents:"none",whiteSpace:"nowrap",fontSize:12,lineHeight:"18px",zIndex:5,boxShadow:"0 10px 28px -8px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.08)",fontVariantNumeric:"tabular-nums",minWidth:112,maxWidth:Math.max(160,t.width*S-8)}}let E=w=>{m.current=null,w.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},H=w=>w?P=>{let _=m.current??(m.current=P.currentTarget.getBoundingClientRect());_.width&&w((P.clientX-_.left)/_.width*t.width,(P.clientY-_.top)/_.height*t.height,P)}:void 0,j=H(e.onPointerMove),z=H(e.onPointerDown),I=j||z?w=>{w.pointerType==="touch"&&j?.(w),z?.(w)}:void 0,F=H(e.onPointerUp),N=Ao(e.theme);return(0,Y.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":u,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:w=>{t.via==="keyboard"&&!w.currentTarget.contains(w.relatedTarget)&&t.setActive(null)},onPointerLeave:E,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...N,...e.style},children:[t.pending?null:e.underlay,(0,Y.jsxs)("svg",{className:"ztd-svg",role:"img","aria-labelledby":`${o} ${a}`,viewBox:`0 0 ${Math.max(1,Math.round(t.width*10)/10)} ${Math.max(1,Math.round(t.height*10)/10)}`,width:"100%",preserveAspectRatio:"xMidYMid meet",onPointerMove:j,onPointerDown:I,onPointerUp:F,onPointerCancel:F,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,Y.jsx)("title",{id:o,children:u}),(0,Y.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,Y.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,$?(0,Y.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:O,children:b??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:$.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:$.title}),$.rows.map((w,P)=>(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,Y.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(w.strong?"ink":"muted")},children:[w.color?(0,Y.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:w.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,w.label]}),(0,Y.jsx)("span",{style:{fontWeight:w.strong===!1?500:700},children:w.value})]},P))]})}):null,(0,Y.jsx)("span",{className:"ztd-sr",style:mn,"aria-live":"polite","aria-atomic":"true",children:v}),s&&!t.pending?c:null]})}function us({label:e,events:t,t:n}){return(0,Y.jsx)("div",{className:"ztd-sr",style:mn,children:(0,Y.jsxs)("table",{children:[(0,Y.jsx)("caption",{children:n.table(e)}),(0,Y.jsxs)("tbody",{children:[t.slice(0,cn).map((r,o)=>(0,Y.jsxs)("tr",{children:[(0,Y.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,Y.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>cn?(0,Y.jsx)("tr",{children:(0,Y.jsx)("td",{colSpan:2,children:n.more(t.length-cn)})}):null]})]})})}function pe(e){let t=e.baseline??"central";return(0,Y.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}var C=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),Ee=C("label","string",!0,"Item name field"),he=C("value","number",!0,"Value field"),cs=[Ee,he],ms=[Ee,he],ds=[C("label","string",!0,"Stage name"),C("value","number",!0,"Users at the stage")],fs=[Ee,he],hs=[C("label","string",!0,"Leaf (lowest level) name"),he,C("group","string",!1,"Parent group field")],gs=[C("label","string",!0,"Leaf name"),he,C("group","string",!1,"Parent group field")],ps=[Ee,C("value","number",!0,"Change (total rows may omit it)"),C("type","string",!1,'"total" makes a total bar')],bs=[Ee,he],ys=[C("x","string",!0,"Column field"),C("series","string",!0,"Stacked series field"),he],xs=[C("x","string",!0,"Column field"),C("y","string",!0,"Row field"),he],ks=[C("axis","string",!0,"Metric (axis) field"),C("value","number",!0,"Value field",{multi:!0}),C("series","string",!1,"Series field")],ws=[C("x","number",!0,"x value"),C("y","number",!0,"y value"),C("size","number",!1,"Circle size"),C("label","string",!1,"Name")],Lo=C("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),vs=[C("x","any",!0,"x field (date, number or category)"),C("y","number",!0,"y field. An array for wide tables",{multi:!0}),C("series","string",!1,"Series field (long tables)"),C("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Lo],$s=[C("x","any",!0,"x field"),C("y","number",!0,"y field. An array for wide tables",{multi:!0}),C("series","string",!1,"Series field"),C("lower","number",!1,'Lower bound of the range band, with stack "none" only. In wide tables an array in the order of y',{multi:!0}),Lo],Cs=[C("x","any",!0,"x field"),C("y","number",!0,"y field",{multi:!0}),C("series","string",!1,"Series field")],Ms=[C("x","string",!0,"Category field"),C("y","number",!0,"Value field. An array for wide tables",{multi:!0}),C("series","string",!1,"Series field"),C("line","number",!1,"Lines over vertical bars on the same axis, such as a target or last year. An array for several. Bars stay gray unless highlight is set, and with series the line averages rows of the same x",{multi:!0})],Ts=[Ee,he],Ss=[C("value","number",!0,"Value field",{prop:"valueKey"}),C("target","number",!1,"Target field",{prop:"targetKey"})],As=[Ee,C("value","number",!0,"Actual value field"),C("target","number",!1,"Target field")],Fs=[C("x","any",!1,"x field"),C("y","number",!0,"y field")],Ns=[Ee,C("x","string",!1,"Period field (long tables)"),C("value","number",!1,"Value field (long tables)")],Ps=[Ee,C("start","number",!0,"Before value"),C("end","number",!0,"After value")],Rs=[Ee,he],Ds=[C("value","number",!0,"Value field"),C("group","string",!1,"Group (row) field"),C("label","string",!1,"Dot name")],Ls=[C("group","string",!0,"Group field"),C("value","number",!0,"Value field")],Es=[C("source","string",!0,"Source node"),C("target","string",!0,"Target node"),he],_s=[C("source","string",!0,"Sending group"),C("target","string",!0,"Receiving group"),he],Is=[C("date","date",!0,"Date field"),he],Os=[C("x","any",!0,"Period field"),C("series","string",!0,"Item field"),C("rank","number",!1,"Rank field (1 is first)"),C("value","number",!1,"Value field (instead of rank, largest is first)")],Bs=[C("group","string",!0,"Group field"),C("value","number",!0,"Value field")],zs=[C("label","string",!1,"Row name field")],Hs=[C("x","date",!0,"Date (period) field"),C("open","number",!0,"Open price field"),C("high","number",!0,"High price field"),C("low","number",!0,"Low price field"),C("close","number",!0,"Close price field"),C("volume","number",!1,"Volume field")],js=[Ee,he],Vs=[C("x","any",!0,"Period field (date or category)"),C("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),C("series","string",!1,"Series field (long tables, back row only)"),C("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Ws=[C("value","number",!1,"Sample value field (raw rows)"),C("group","string",!1,"Group field. Up to 2 groups overlap"),C("x0","number",!1,"Bin start (pre-binned rows)"),C("x1","number",!1,"Bin end (pre-binned rows)"),C("count","number",!1,"Samples in the bin (pre-binned rows)")],Gs=[C("region","string",!0,"Region name or code, matched to a tile of options.map"),he],Ks=[C("x","number",!0,"x value"),C("y","number",!0,"y value"),C("series","string",!1,"Series field (one color per series)"),C("label","string",!1,"Name")],Do={pie:cs,donut:ms,funnel:ds,waffle:fs,treemap:hs,sunburst:gs,waterfall:ps,pareto:bs,marimekko:ys,heatmap:xs,radar:ks,bubble:ws,line:vs,area:$s,stream:Cs,bar:Ms,radialBar:Ts,gauge:Ss,bullet:As,sparkline:Fs,slope:Ns,dumbbell:Ps,lollipop:Rs,beeswarm:Ds,ridgeline:Ls,sankey:Es,chord:_s,calendar:Is,bump:Os,box:Bs,parallel:zs,candlestick:Hs,segmented:js,skyline:Vs,histogram:Ws,scatter:Ks,tileMap:Gs},St={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"}};function Eo(e,t){return t==="ko"?e.nameKo:e.name}function _o(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Io=["line","area","bar","scatter"],Oo=24,cr=["line","area","bar","scatter"];function mr(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Bo(e,t,n){return cr.includes(e)&&!mr(e,t,n).length}function zo(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var Us={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap"};function dn(e){let t=Do[e]?e:Us[e]??Object.keys(St).find(n=>n.toLowerCase()===e.toLowerCase()||St[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!St[t]))return{type:t,component:St[t].component,name:St[t].name,nameKo:St[t].nameKo,encoding:Do[t]}}function Ho(e){let t=new Set,n=a=>{Array.isArray(a)?a.forEach(n):typeof a=="string"&&a&&t.add(a)},r=e.encoding??{};for(let a of dn(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}function jo(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Xs(e,t){if(e==null||typeof e!="object")return;let n=e;if(jo(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!jo(r,o))return;r=r[o]}return r}}function Je(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function At(e,t){if(typeof e=="function")return e;let n=e??t;return r=>Xs(r,n)}function gt(e,t){let n=At(e,t);return(r,o)=>Je(n(r,o))}function Ft(e,t){let n=At(e,t);return(r,o)=>{let a=n(r,o);return a==null?"":a instanceof Date?new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,10):String(a)}}function it(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function Ys(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let u=e[l];if(u==='"')n=!n;else if(!n&&(u===`
|
|
23
|
+
`||u==="\r"))break;t.push(n?"":u)}let r=t.join(""),o=l=>r.split(l).length-1,a=[","," ",";","|"],i=",",s=0;for(let l of a){let u=o(l);u>s&&(s=u,i=l)}return i}var qs=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Vo(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(qs.test(t)||/^[-+]?\.\d+$/.test(t)){let n=Je(t);if(Number.isFinite(n))return n}return t}function pt(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??Ys(o),i=[],s=[],l="",u=!1;for(let f=0;f<o.length;f++){let p=o[f];u?p==='"'?o[f+1]==='"'?(l+='"',f++):u=!1:l+=p:p==='"'&&!l.trim()?(u=!0,l=""):p===a?(s.push(l),l=""):p===`
|
|
24
|
+
`||p==="\r"?(p==="\r"&&o[f+1]===`
|
|
25
|
+
`&&f++,s.push(l),i.push(s),s=[],l=""):l+=p}(l!==""||s.length)&&(s.push(l),i.push(s));let d=i.filter(f=>!(f.length===1&&f[0].trim()===""));if(!d.length)return[];let c=f=>n?Vo(f):f;if(!r)return d.map(f=>Object.fromEntries(f.map((p,x)=>[String(x),c(p)])));let m=[],h=new Set;return d[0].forEach((f,p)=>{let x=f.trim()||`col${p+1}`,k=x;for(let $=2;h.has(k);$++)k=`${x}_${$}`;h.add(k),m.push(k)}),d.slice(1).map(f=>Object.fromEntries(m.map((p,x)=>[p,c(f[x]??"")])))}function dr(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,l)=>[s,r&&typeof i[l]=="string"?Vo(i[l]):i[l]??null])))}function Zs(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,l)=>Object.fromEntries(a.map(u=>[u,e[u][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function Wo(e,t){let n=e;for(let r of t.split(".").filter(Boolean)){if(n===null||typeof n!="object")return;n=n[r]}return n}function st(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return st(JSON.parse(t))}catch{}return pt(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?dr(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?st(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?dr(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?st(t.rows):Array.isArray(t.values)?dr(t.values):Array.isArray(t.items)?st(t.items):Array.isArray(t.results)?st(t.results):Zs(t)}return[]}function fn(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}function Go(e,t){let n=e.length;if(t>=n||t<3)return e.slice();let r=[e[0]],o=(n-2)/(t-2),a=0;for(let i=0;i<t-2;i++){let s=Math.floor((i+1)*o)+1,l=Math.min(Math.floor((i+2)*o)+1,n),u=0,d=0;for(let x=s;x<l;x++)u+=e[x].x,d+=e[x].y;let c=Math.max(1,l-s);u/=c,d/=c;let m=Math.floor(i*o)+1,h=Math.floor((i+1)*o)+1,f=m,p=-1;for(let x=m;x<h;x++){let k=Math.abs((e[a].x-u)*(e[x].y-e[a].y)-(e[a].x-e[x].x)*(d-e[a].y));k>p&&(p=k,f=x)}r.push(e[f]),a=f}return r.push(e[n-1]),r}function Nt(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),a=e.map(()=>new Array(r).fill(0)),i=(l,u)=>{let d=e[l][u];return Number.isFinite(d)&&d>0?d:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let u=1;u<r;u++){let d=0,c=0;for(let m=0;m<n;m++){let h=i(m,u),f=h-i(m,u-1),p=0;for(let x=0;x<m;x++)p+=i(x,u)-i(x,u-1);d+=h,c+=(f/2+p)*h}d&&(l-=c/d),s[u]=l}}for(let l=0;l<r;l++){if(t==="zero"){let c=0,m=0;for(let h=0;h<n;h++){let f=e[h][l],p=Number.isFinite(f)?f:0;p>=0?(o[h][l]=c,c+=p,a[h][l]=c):(o[h][l]=m,m+=p,a[h][l]=m)}continue}let u=0;for(let c=0;c<n;c++)u+=i(c,l);let d=t==="silhouette"?-u/2:s[l];for(let c=0;c<n;c++){let m=i(c,l);t==="expand"&&(m=u?m/u*100:0),o[c][l]=d,d+=m,a[c][l]=d}}if(t==="wiggle"&&r){let l=1/0,u=-1/0;for(let c=0;c<r;c++)l=Math.min(l,o[0]?.[c]??0),u=Math.max(u,a[n-1]?.[c]??0);let d=0;for(let c=0;c<r;c++)d+=((o[0]?.[c]??0)+(a[n-1]?.[c]??0))/2;d/=r;for(let c=0;c<n;c++)for(let m=0;m<r;m++)o[c][m]-=d,a[c][m]-=d}return{y0:o,y1:a}}function Ko(e,t,n=-1){if(!t.some(r=>r>=0))return-1;for(let r=e-1;r>=0;r--)if(r!==n&&!t.includes(r))return r;return-1}function Uo(e){let t=e.length,n=e.map(u=>{let d=0,c=-1/0;return u.forEach((m,h)=>{m>c&&(c=m,d=h)}),d}),r=e.map(u=>u.reduce((d,c)=>d+(Number.isFinite(c)?c:0),0)),o=Array.from({length:t},(u,d)=>d).sort((u,d)=>n[u]-n[d]),a=[],i=[],s=0,l=0;for(let u of o)s<l?(a.push(u),s+=r[u]):(i.push(u),l+=r[u]);return[...i.reverse(),...a]}var Js=Math.PI*2;function Xo(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function W(e){return Math.round(e*100)/100}function Yo(e,t=!0){let n=e.length;if(!n)return"";let r=l=>`${t?"M":"L"}${W(l[0])},${W(l[1])}`;if(n<3)return r(e[0])+e.slice(1).map(l=>`L${W(l[0])},${W(l[1])}`).join("");let o=[],a=[];for(let l=0;l<n-1;l++){let u=e[l+1][0]-e[l][0];o.push(u),a.push(u===0?0:(e[l+1][1]-e[l][1])/u)}let i=[a[0]];for(let l=1;l<n-1;l++)if(a[l-1]*a[l]<=0)i.push(0);else{let u=2*o[l]+o[l-1],d=o[l]+2*o[l-1];i.push((u+d)/(u/a[l-1]+d/a[l]))}i.push(a[n-2]);let s=r(e[0]);for(let l=0;l<n-1;l++){let u=o[l]/3;s+=`C${W(e[l][0]+u)},${W(e[l][1]+i[l]*u)} ${W(e[l+1][0]-u)},${W(e[l+1][1]-i[l+1]*u)} ${W(e[l+1][0])},${W(e[l+1][1])}`}return s}function hn(e,t="smooth"){if(!e.length)return"";if(t==="smooth")return Yo(e);if(t==="step"){let n=`M${W(e[0][0])},${W(e[0][1])}`;for(let r=1;r<e.length;r++){let o=(e[r-1][0]+e[r][0])/2;n+=`H${W(o)}V${W(e[r][1])}H${W(e[r][0])}`}return n}return Qs(e)}function Qs(e){if(!e.length)return"";let t=`M${W(e[0][0])},${W(e[0][1])}`;for(let n=1;n<e.length;n++)t+=`L${W(e[n][0])},${W(e[n][1])}`;return t}function gn(e,t,n="smooth"){if(!e.length)return"";let r=[...t].reverse(),o=hn(e,n),a;return n==="smooth"?a=Yo(r.map(i=>[i[0],i[1]]),!1):n==="step"?a=hn(r,"step").replace(/^M/,"L"):a=r.map(i=>`L${W(i[0])},${W(i[1])}`).join(""),`${o}${a}Z`}function pn(e,t){let n=0,r=e.length-1;if(r<0)return-1;for(;r-n>1;){let o=n+r>>1;e[o]<t?n=o:r=o}return Math.abs(e[n]-t)<=Math.abs(e[r]-t)?n:r}function qo(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function Zo(e){let t=e.length,n=e.reduce((l,u)=>l+u.x,0)/t,r=e.reduce((l,u)=>l+u.y,0)/t,o=0,a=0,i=0;for(let l of e)o+=(l.x-n)*(l.y-r),a+=(l.x-n)**2,i+=(l.y-r)**2;let s=a?o/a:0;return{slope:s,r2:a&&i?o*o/(a*i):0,at:l=>r+s*(l-n)}}function Qo(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Jo(e){return e>=44032&&e<=55203?.87:e>=4352&&e<=4607||e>=12592&&e<=12687?.8:e>=19968&&e<=40959?.94:e>=48&&e<=57?.585:e===32||e===44||e===46||e===58||e===59||e===39?.26:e===37?.84:e===8722?.73:e===45?.42:e===43||e===61?.6:e===40||e===41||e===91||e===93?.34:e===47?.38:e===8361||e===36?.62:e===8230?.82:e>=65&&e<=90?e===73?.28:e===77||e===87?.86:.66:e>=97&&e<=122?e===105||e===108||e===106?.24:e===109||e===119?.84:e===102||e===116||e===114?.36:.55:.6}var bn=new Map;function ae(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=bn.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let u=r.charCodeAt(l);Qo(u)?i+=Jo(u):s+=Jo(u)}a=i+s*(n>=600?1.07:1),bn.size>5e3&&bn.clear(),bn.set(o,a)}return a*t}function Ve(e,t,n,r=400){if(e=e.trim(),ae(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;ae(e.slice(0,l)+o,n,r)<=t?a=l:i=l-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(Qo(s.charCodeAt(0))?2:3)?"":s+o}function ea(e,t,n=-1/0,r=1/0){let o=e.map((s,l)=>({y:s,i:l})).sort((s,l)=>s.y-l.y),a=new Array(e.length),i=o.map(s=>Math.max(n,Math.min(r,s.y)));for(let s=0;s<30;s++){let l=!1;for(let u=1;u<i.length;u++){let d=i[u]-i[u-1];if(d<t){let c=(t-d)/2;i[u-1]-=c,i[u]+=c,l=!0}}for(let u=0;u<i.length;u++)i[u]=Math.max(n,Math.min(r,i[u]));if(!l)break}for(let s=1;s<i.length;s++)i[s]-i[s-1]<t&&(i[s]=i[s-1]+t);if(i.length&&i[i.length-1]>r){let s=i[i.length-1]-r;for(let l=0;l<i.length;l++)i[l]-=s}return o.forEach((s,l)=>{a[s.i]=i[l]}),a}var Z=L(G(),1),bt=e=>Array.isArray(e)&&e.length===2;function yn(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&bt(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var ta=e=>e?.find(t=>t.type==="forecast")?.from,el=(e,t)=>Math.max(0,Math.min(e.x+e.w,t.x+t.w)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.h,t.y+t.h)-Math.max(e.y,t.y));function fr(e,t,n){let r=t[0],o=1/0;for(let a of t){let i=gr(e,a.x,a.y,a.anchor),s=n.reduce((l,u)=>l+el(i,u),0);if(s<o&&(r=a,o=s),s===0)break}return n.push(gr(e,r.x,r.y,r.anchor)),r}var hr=(e,t)=>Math.max(e.x0,Math.min(e.x1,t)),tl=(e,t)=>t!==null&&t>=e.x0-1&&t<=e.x1+1;function na(e,t){let n=e.xAt(t[0]),r=e.xAt(t[1]);return n===null||r===null?null:[Math.min(n,r)-e.half,Math.max(n,r)+e.half]}function ra(e,t){let n=e.y(Number(t[0])),r=e.y(Number(t[1]));return Number.isFinite(n)&&Number.isFinite(r)?[Math.max(e.top,Math.min(n,r)),Math.min(e.bottom,Math.max(n,r))]:null}function xn(e,t){let n=t===void 0?null:e.xAt(t);return n===null||n>e.x1?null:Math.max(e.x0,n-(e.edge?e.half:0))}var oa={en:{forecast:"Forecast",trend:"Trend",period:"period",weekends:"weekends shaded",lead:"Annotations"},ko:{forecast:"예측",trend:"추세",period:"기간",weekends:"주말 음영",lead:"주석"}};function aa({list:e,g:t}){if(!e?.length)return null;let{p:n}=t,r=Math.max(0,t.bottom-t.top),o=[];return e.forEach((a,i)=>{if(a.type==="band"&&bt(a.y)){let s=ra(t,a.y);if(!s)return;let[l,u]=s;o.push((0,Z.jsxs)("g",{children:[(0,Z.jsx)("rect",{x:t.x0,y:l,width:Math.max(0,t.x1-t.x0),height:Math.max(0,u-l),fill:n.paint("accent"),opacity:.1}),(0,Z.jsx)("line",{x1:t.x0,x2:t.x1,y1:l,y2:l,stroke:n.paint("accent"),strokeOpacity:.45,strokeDasharray:"3 3"}),(0,Z.jsx)("line",{x1:t.x0,x2:t.x1,y1:u,y2:u,stroke:n.paint("accent"),strokeOpacity:.45,strokeDasharray:"3 3"})]},i))}else if(a.type==="band"&&bt(a.x)||a.type==="forecast"){let s;if(a.type==="forecast"){let d=xn(t,a.from);s=d===null?null:[d,t.x1]}else s=na(t,a.x);if(!s)return;let l=hr(t,s[0]),u=hr(t,s[1]);if(u-l<.5)return;o.push((0,Z.jsx)("rect",{x:l,y:t.top,width:u-l,height:r,fill:n.paint("ink"),opacity:.05},i))}else if(a.type==="weekends"&&t.time&&t.time.t1-t.time.t0<=864e5*400){let s=Math.min(432e5,(t.time.t1-t.time.t0)/Math.max(1,t.time.n-1)/2),l=new Date(t.time.t0);l.setHours(0,0,0,0),l.setDate(l.getDate()-(l.getDay()+1)%7);for(let u=0;l.getTime()-s<=t.time.t1&&u<60;u++){let d=l.getTime();l.setDate(l.getDate()+2);let c=Math.max(t.x0,t.time.xt(d-s)),m=Math.min(t.x1,t.time.xt(l.getTime()-s));m>c&&o.push((0,Z.jsx)("rect",{x:c,y:t.top,width:m-c,height:r,fill:n.paint("ink"),opacity:.045},`${i}w${u}`)),l.setDate(l.getDate()+5)}}}),(0,Z.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:o})}var ia=(e,t)=>ae(e,10.5,t?700:500)+8;function gr(e,t,n,r="start",o){let a=ia(e,o);return{x:r==="end"?t-a:t,y:n-8,w:a,h:16}}function Bt({p:e,x:t,y:n,text:r,anchor:o="start",strong:a}){let i=gr(r,t,n,o,a);return(0,Z.jsxs)("g",{children:[(0,Z.jsx)("rect",{x:i.x,y:i.y,width:i.w,height:i.h,rx:5,fill:e.paint("panel"),opacity:.94}),(0,Z.jsx)(pe,{x:i.x+4,y:n,size:10.5,weight:a?700:500,fill:e.paint(a?"ink":"muted"),children:r})]})}function sa({list:e,g:t}){if(!e?.length)return null;let{p:n}=t,r=oa[t.lang],o=[],a=[],i=[...t.avoid??[]];return e.forEach((s,l)=>{if(s.type==="line"&&typeof s.y=="number"){let u=t.y(s.y);if(!Number.isFinite(u))return;let d=s.label?Ve(s.label,160,10.5):"",c=d?fr(d,[{x:t.x1-2,y:u-10,anchor:"end"},{x:t.x0+2,y:u-10,anchor:"start"},{x:t.x1-2,y:u+10,anchor:"end"},{x:t.x0+2,y:u+10,anchor:"start"}],i):null;o.push((0,Z.jsxs)("g",{children:[(0,Z.jsx)("line",{x1:t.x0,x2:t.x1,y1:u,y2:u,stroke:n.paint("dim"),strokeDasharray:"4 3"}),c?(0,Z.jsx)(Bt,{p:n,x:c.x,y:c.y,text:d,anchor:c.anchor}):null]},l))}else if(s.type==="band"&&s.label){let u=bt(s.y)?ra(t,s.y):[t.top,t.bottom],d=bt(s.x)?na(t,s.x):[t.x0,t.x1];if(!d||!u)return;let[c,m]=u,h=Ve(s.label,160,10.5),f=Math.min(hr(t,d[0]),t.x1-40)+4,p=fr(h,[{x:f,y:c+11,anchor:"start"},{x:f,y:m-11,anchor:"start"}],i);o.push((0,Z.jsx)(Bt,{p:n,x:p.x,y:p.y,text:h},l))}else if(s.type==="forecast"){let u=xn(t,s.from);if(u===null)return;let d=Ve(s.label??r.forecast,120,10.5),c=Math.min(u+4,t.x1-50),m=fr(d,[{x:c,y:t.top+9,anchor:"start"},{x:c,y:t.bottom-9,anchor:"start"}],i);o.push((0,Z.jsxs)("g",{children:[(0,Z.jsx)("line",{x1:u,x2:u,y1:t.top,y2:t.bottom,stroke:n.paint("dim"),strokeDasharray:"2 3"}),(0,Z.jsx)(Bt,{p:n,x:m.x,y:m.y,text:d})]},l))}else if(s.type==="event"&&s.label){let u=t.xAt(s.x);if(!tl(t,u))return;let d=Ve(s.label,140,10.5,700),c=ia(d,!0),m=Math.max(t.x0,Math.min(u-c/2,t.x1-c)),h=a.findIndex(p=>p<m-4);h<0&&(h=a.length),a[h]=m+c;let f=t.top+9+h*18;o.push((0,Z.jsxs)("g",{children:[(0,Z.jsx)("line",{x1:u,x2:u,y1:f+8,y2:t.bottom,stroke:n.paint("ink"),strokeOpacity:.45,strokeDasharray:"2 3"}),(0,Z.jsx)("circle",{cx:u,cy:t.bottom,r:2.5,fill:n.paint("ink"),opacity:.6}),(0,Z.jsx)(Bt,{p:n,x:m,y:f,text:d,strong:!0})]},l))}else if(s.type==="trend"&&t.points){let u=t.points().filter(h=>Number.isFinite(h.x)&&Number.isFinite(h.y));if(u.length<2)return;let{at:d}=Zo(u),c=u[0].x,m=u[u.length-1].x;o.push((0,Z.jsxs)("g",{children:[(0,Z.jsx)("line",{x1:c,x2:m,y1:d(c),y2:d(m),stroke:n.paint("muted"),strokeWidth:1.5,strokeDasharray:"6 4",strokeLinecap:"round"}),(0,Z.jsx)(Bt,{p:n,x:m-2,y:d(m)-11,text:Ve(s.label??r.trend,120,10.5),anchor:"end"})]},l))}}),(0,Z.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:o})}function la(e,t,n,r){if(!e?.length)return"";let o=oa[t],a=t==="ko",i=r??(l=>String(l??"")),s=e.map(l=>{let u=l.label?a?`(${l.label})`:` (${l.label})`:"";return l.type==="band"&&bt(l.y)?a?`구간 ${n(Number(l.y[0]))}~${n(Number(l.y[1]))}${u}`:`band ${n(Number(l.y[0]))} to ${n(Number(l.y[1]))}${u}`:l.type==="band"&&bt(l.x)?a?`${l.label??o.period} ${i(l.x[0])}~${i(l.x[1])}`:`${l.label??o.period} from ${i(l.x[0])} to ${i(l.x[1])}`:l.type==="line"&&typeof l.y=="number"?a?`기준선 ${n(l.y)}${u}`:`reference line at ${n(l.y)}${u}`:l.type==="event"?a?`${i(l.x)} ${l.label??""}`.trim():`${l.label??"event"} at ${i(l.x)}`:l.type==="forecast"?a?`${i(l.from)}부터 ${l.label??o.forecast}`:`${l.label??o.forecast.toLowerCase()} from ${i(l.from)}`:l.type==="trend"?a?l.label??"추세선":l.label??"trend line":l.type==="weekends"?o.weekends:""}).filter(Boolean);return s.length?` ${o.lead}: ${s.join(a?", ":"; ")}.`:""}var be=L(G(),1),_e=10.5;function ua(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let i=1;i<e.length;i++)o=Math.min(o,Math.abs(e[i]-e[i-1]));let a=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(i=>at(i,{locale:n,maximumFractionDigits:a}))}function wn(e,t,n){let r=18;for(let o of ua(e,t,n))r=Math.max(r,ae(o,_e));return Math.ceil(r+8)}function ca(e){let{p:t,ticks:n,y:r,x0:o,x1:a,fmt:i}=e,s=e.side==="right",l=e.labels===!1?null:ua(n,i,e.locale);return(0,be.jsx)("g",{"aria-hidden":"true",opacity:e.opacity,children:n.map((u,d)=>{let c=Math.round(r(u))+.5,m=u===0&&e.zero!==!1;return(0,be.jsxs)("g",{children:[(0,be.jsx)("line",{x1:o,x2:a,y1:c,y2:c,stroke:t.paint(m?"dim":"line"),strokeWidth:1,shapeRendering:"crispEdges",opacity:m?.7:1}),l?(0,be.jsx)(pe,{x:s?a+6:o-6,y:c,anchor:s?"start":"end",size:_e,fill:t.paint("muted"),children:l[d]}):null]},u)})})}function pr(e,t,n){let r=[],o=-1/0;for(let a of e){let i=ae(a.label,_e),s=Math.max(a.x-i/2,0);s<o+8||a.x-i/2<t||a.x+i/2>n||(r.push(a),o=s+i)}return r}function br(e,t,n=_e,r=8,o=400,a){let i=t.length;if(i<=1)return t.map((c,m)=>m);let s=t.map(c=>ae(c,n,o)),l=(c,m)=>Math.abs(e[m]-e[c])<(s[c]+s[m])/2+r,u=[];for(let c of a??[])u.some(m=>l(m,c))||u.push(c);let d=c=>!u.some(m=>l(m,c));for(let c=1;c<=i;c++){let m=u.slice();for(let h=0;h<i;h+=c)d(h)&&m.push(h);if(c>1&&(i-1)%c>c/2&&d(i-1)&&m.push(i-1),m.sort((h,f)=>h-f),m.every((h,f)=>!f||!l(m[f-1],h)))return m}return[0,i-1]}var kn=e=>Math.round(e*10)/10;function ma(e){let{p:t}=e;return(0,be.jsxs)("g",{className:"ztd-guide","aria-hidden":"true",pointerEvents:"none",style:{transform:`translate(${kn(e.x)}px,0px)`},children:[(0,be.jsx)("line",{x1:0,x2:0,y1:e.top,y2:e.bottom,stroke:t.paint("dim"),strokeWidth:1}),e.dots?.map(n=>(0,be.jsxs)("g",{className:"ztd-guide",style:{transform:`translate(0px,${kn(n.y)}px)`},children:[(0,be.jsx)("circle",{r:n.strong?9:7,fill:n.color,opacity:.2}),(0,be.jsx)("circle",{r:n.strong?4.2:3.2,fill:n.color,stroke:t.paint("panel"),strokeWidth:2})]},n.k))]})}function da(e){let{p:t}=e,n=Ve(e.label,160,_e,700),r=ae(n,_e,700)+14,o=Math.max(r/2+1,Math.min(e.width-r/2-1,e.x));return(0,be.jsxs)("g",{className:"ztd-guide","aria-hidden":"true",pointerEvents:"none",style:{transform:`translate(${kn(o)}px,${kn(e.y)}px)`},children:[(0,be.jsx)("rect",{x:-r/2,y:-9,width:r,height:18,rx:9,fill:t.paint("ink"),stroke:t.paint("panel"),strokeWidth:3,paintOrder:"stroke"}),(0,be.jsx)(pe,{x:0,y:0,anchor:"middle",size:_e,weight:700,fill:t.paint("onInk"),children:n})]})}function yr(e,t){if(!(e>0)||!Number.isFinite(e))return 1;let n=e/Math.max(1,t),r=Math.pow(10,Math.floor(Math.log10(n))),o=n/r;return(o>=7.071?10:o>=3.162?5:o>=1.414?2:1)*r}function lt(e,t,n=4,r={}){let o=e,a=t;if(!Number.isFinite(o)||!Number.isFinite(a))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),a<0&&(a=0)),o===a)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let i=a-o,s=r.pad??.07,l=yr(i,n),u=[o,a];for(let d=0;d<4;d++){let c=Math.ceil(a/l-1e-9)*l,m=Math.floor(o/l+1e-9)*l;u=[o===0?0:o-m<=l*.3?m:o-i*s,a===0?0:c-a<=l*.3?c:a+i*s];let h=yr(u[1]-u[0],n);if(h===l)break;l=h}return u}function fa(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=yr(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let l=s,u=0;l<=o+a*1e-9&&u<200;l+=a,u++)i.push(Number((Math.round(l/a)*a).toPrecision(12)));return i}function Me(e,t){let[n,r]=e,[o,a]=t,i=r===n?0:(a-o)/(r-n),s=(l=>o+(l-n)*i);return s.domain=e,s.range=t,s.invert=l=>i===0?n:n+(l-o)/i,s.ticks=(l=4)=>fa(n,r,l),s}function zt(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[a,i]=lt(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function nl(e,t,n){let r=Math.log10(e),o=Math.log10(t),a=n/Math.max(1e-9,o-r),i=(u,d=1)=>{let c=[];for(let m=Math.floor(r);m<=Math.ceil(o);m++)if(!(m%d))for(let h of u){let f=Number((h*10**m).toPrecision(12));f>=e*(1-1e-9)&&f<=t*(1+1e-9)&&c.push(f)}return c},s=a>=110?i([1,2,5]):i([1],Math.max(1,Math.ceil(24/a)));if(s.length>=2)return s;let l=i([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:fa(e,t,3)}function vn(e,t){let n=Me([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>nl(e[0],e[1],Math.abs(t[1]-t[0])),r}function We(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}var rl=864e5;function Ht(e,t,n,r=fe){let o=t-e;if(!(o>0))return[{t:e,label:Ot(e,{locale:r,month:"short",day:"numeric"})}];let a=o/rl,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),u=(d,c,m,h=!1)=>{let f=new Date(d),p=-1,x=0;for(;f.getTime()<=t&&x++<500;){if(f.getTime()>=e){let k=f.getFullYear(),$=h&&!l&&k!==p;i.push({t:f.getTime(),label:Ot(f,{locale:r,...m,...$?{year:"numeric"}:{}})}),p=k}c(f)}};if(a<=1.5){let d=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),c=[1,2,3,4,6,12].find(h=>h>=d)??12,m=new Date(s);m.setMinutes(0,0,0),u(m,h=>h.setHours(h.getHours()+c),{hour:"numeric"})}else if(a<=n*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());u(d,c=>c.setDate(c.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let d=new Date(s.getFullYear(),s.getMonth(),s.getDate());d.setDate(d.getDate()+(8-d.getDay())%7),u(d,c=>c.setDate(c.getDate()+7),{month:"numeric",day:"numeric"})}else{let d=a/30.44,c=Math.max(1,Math.ceil(d/Math.max(1,n))),m=[1,2,3,6,12,24,60].find(h=>h>=c)??120;if(m>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);u(h,f=>f.setFullYear(f.getFullYear()+m/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=h.getMonth()%m;f&&h.setMonth(h.getMonth()+(m-f)),u(h,p=>p.setMonth(p.getMonth()+m),{month:"short"},!0)}}return i}function jt(e,t){let n=new Array(e),r=new Uint8Array(e),o=a=>{if(typeof a!="string"||a.length===0||a.length>9)return-1;let i=Number(a);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===a?i:-1};return new Proxy(n,{get(a,i,s){let l=o(i);return l>=0?(r[l]||(a[l]=t(l),r[l]=1),a[l]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var $n=(e,t,n)=>e==="date"?on(t,n)?.getTime()??NaN:Je(t);function ha(e,t){let n=new Set(t?t.split(""):[]),r=e.series.flatMap((a,i)=>n.has(a)?[]:[i]);if(r.length===e.series.length)return[e,r];let o=a=>r.map(i=>a[i]);return[{...e,series:o(e.series),values:o(e.values),rows:o(e.rows),...e.rowValues&&{rowValues:o(e.rowValues)}},r]}function ol(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&Co(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function yt(e,t,n,r,o={}){let a=At(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:At(n,"y"),u=!i&&r!==void 0?At(r,"series"):null,d=e.map((N,w)=>a(N,w)),c=o.xType??ol(d),m=o.locale??fe,h,f,p;if(c==="band"){let N=d.map(P=>String(P??""));h=it(N);let w=new Map(h.map((P,_)=>[P,_]));f=h.map((P,_)=>_),p=Int32Array.from(N,P=>w.get(P)??-1)}else{let N=c==="date"?o.dayFirst??Mo(d):void 0,w=d.map(K=>$n(c,K,N)),P=Array.from(new Set(w.filter(K=>Number.isFinite(K)))).sort((K,le)=>K-le),_=new Map(P.map((K,le)=>[K,le]));f=P,h=P.map(String),p=Int32Array.from(w,K=>_.get(K)??-1)}let x=o.dateFormat,k=N=>typeof N=="string"?rn(N.trim())?.[3]:void 0,$=c==="date"&&d.length<5e3?k(d[0]):void 0,S=($===2||$===3)&&d.every(N=>k(N)===$),b=S&&$===3;if(c==="date"&&!x){let N=f.length>1?f[f.length-1]-f[0]:0;x=S&&$===2||N>864e5*120?{month:"short"}:N<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},N>864e5*800&&(x={year:"numeric",month:"short"})}let v;if(c==="band")v=h;else if(b&&!o.dateFormat){let N=te(m)==="ko";v=f.map(w=>{let P=new Date(w),_=Math.floor(P.getMonth()/3)+1;return N?`${P.getFullYear()}년 ${_}분기`:`Q${_} ${P.getFullYear()}`})}else{let N=f.every(rr),w=c==="date"?new Intl.DateTimeFormat(m,x):new Intl.NumberFormat(m,N?{useGrouping:!1}:{maximumFractionDigits:6});v=f.length>1e3?jt(f.length,P=>w.format(f[P])):f.map(P=>w.format(P))}let O=s?[...s]:u?it(e.map((N,w)=>String(u(N,w)??""))):[""],E=new Map(O.map((N,w)=>[N,w])),H=O.map(()=>new Array(h.length).fill(NaN)),j=O.map(()=>new Array(h.length).fill(null)),z=o.aggregate??"sum",I=z==="mean"?O.map(()=>new Uint32Array(h.length)):null,F=(N,w,P,_)=>{let K=H[N][w];z==="last"?H[N][w]=P:z==="count"?H[N][w]=(Number.isFinite(K)?K:0)+1:z==="mean"?Number.isFinite(P)&&(H[N][w]=(Number.isFinite(K)?K:0)+P,I[N][w]++):H[N][w]=Number.isFinite(K)?K+(Number.isFinite(P)?P:0):P,j[N][w]=_};for(let N=0;N<e.length;N++){let w=p[N];if(w<0)continue;let P=e[N];if(s)for(let _=0;_<s.length;_++)F(_,w,Je(P[s[_]]),P);else{let _=u?E.get(String(u(P,N)??""))??0:0;F(_,w,Je(l(P,N)),P)}}if(I)for(let N=0;N<H.length;N++)for(let w=0;w<h.length;w++)I[N][w]>1&&(H[N][w]/=I[N][w]);return{type:c,keys:h,xnum:f,labels:v,series:O,values:H,rows:j}}function ga(e,t){let n=e.keys.length;if(n<=t||t<2)return e;let r=n/t,o=[],a=[];for(let s=0;s<t;s++){let l=Math.floor(s*r),u=Math.min(n,Math.floor((s+1)*r));u<=l||(a.push([l,u]),o.push(s===0?0:s===t-1?n-1:Math.floor((l+u-1)/2)))}let i=e.values.map(s=>a.map(([l,u])=>{let d=0,c=0;for(let m=l;m<u;m++)Number.isFinite(s[m])&&(d+=s[m],c++);return c?d/c:NaN}));return{type:e.type,keys:o.map(s=>e.keys[s]),xnum:e.type==="band"?o.map((s,l)=>l):o.map(s=>e.xnum[s]),labels:jt(o.length,s=>e.labels[o[s]]),series:e.series,values:i,rows:e.rows.map(s=>o.map(l=>s[l])),rowValues:e.values.map(s=>o.map(l=>s[l]))}}var al=140,Wt=12,pa=14,xr=20,ba=12.5;function il(e,t,n=Oo){let r=Ft(t,t),o=new Map;e.forEach((i,s)=>{let l=r(i,s),u=o.get(l);u?u.push(i):o.set(l,[i])});let a=[...o.keys()].slice(0,n);return{values:a,groups:a.map(i=>o.get(i)),dropped:Math.max(0,o.size-n)}}function sl(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+Wt)/(al+Wt))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function ll(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*Wt)/t));return{pw:r,ph:typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(120,Math.min(180,Math.round(r*.62)))}}var Vt=e=>e.filter(Number.isFinite);function Cn(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=gt(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return Vt(n)}function ya(e,t,n,r,o,a){return yt(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function ul(e,t,n,r,o,a){let i=Math.max(2,Math.round(a/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,u=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let v=t.flat(),O=r.refLines??{},[E,H]=We([...Cn(v,r.x??"x"),...Vt([Number(O.x)])]),[j,z]=We([...Cn(v,r.y??"y"),...Vt([Number(O.y)])].filter(F=>!s||F>0)),I=r.zero??!1;return{y:u??(s?zt(j,z,i):lt(j,z,i,{zero:I,pad:.08})),x:r.xDomain??lt(E,H,Math.max(2,Math.round(o/110)),{zero:I,pad:.06}),sameKeys:!0}}let d=e==="bar",c=d&&r.orientation==="horizontal",m=n[0]?.keys.join(""),h=n.every(v=>v.keys.join("")===m),f=n.length>0&&n.every(v=>v.type!=="band"&&v.type===n[0].type),p=r.xDomain??(!d&&f?We(n.flatMap(v=>Vt(v.xnum))):void 0),x=d?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(x==="percent")return{x:p,sameKeys:h};if(u)return{y:u,x:p,sameKeys:h};let k=[];t.forEach((v,O)=>{let E=n[O];if(x==="stacked"||x==="auto"&&E.series.length>1){let j=Nt(E.values,"zero");j.y0.forEach(z=>k.push(...z)),j.y1.forEach(z=>k.push(...z))}else E.values.forEach(j=>k.push(...j));d&&!c&&r.line!==void 0&&ya(e,v,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(j=>k.push(...j)),d||k.push(...Cn(v,r.lower),...Cn(v,r.upper))}),d&&k.push(0),c||k.push(...yn(r.annotations));for(let v of r.referenceLines??[])k.push(v.y);r.signColors&&k.push(Number(r.baseline??0));let[$,S]=We(Vt(k).filter(v=>!s||v>0));return{y:s?zt($,S,i):d?lt($,S,c?Math.max(2,Math.round(o/120)):i):lt($,S,i,{zero:r.zero??e==="area"}),x:p,sameKeys:h}}function cl(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=yt(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),u=(r.yScale==="log"&&e==="line"?vn:Me)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),d=wn(u,Tt(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),c=n.flatMap(v=>v.series),m=r.endLabels??n.some(v=>v.series.length>1),h=d+6,f=a-(m?Math.min(a*.28,Math.max(...c.map(v=>ae(v,11,700)),20)+14):10),p=l.keys.length,[x,k]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,$=l.type==="number"?p>12:p>Ht(x,k,Math.max(2,Math.floor((f-h)/64)),s).length;if(l.type==="band"||!p||$)return;let S=v=>h+(l.xnum[v]-x)/(k-x)*(f-h),b=v=>ae(l.labels[v],_e);for(let v=1;;v++){let O=Array.from({length:Math.ceil(p/v)},(E,H)=>H*v);if(v>=p||O.every((E,H)=>!H||S(E)-S(O[H-1])>=(b(E)+b(O[H-1]))/2+8))return O.map(E=>({value:l.xnum[E],label:l.labels[E]}))}}function ml(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function dl(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${ml(`${e}|${t}|${o}|${fn(r)}`)}`}function fl(e,t){return typeof e=="string"?t.includes(e):Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="string"&&t.includes(n))}var hl={en:{intro:(e,t)=>`${Re(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}};function xa(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=il(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=sl(s,i,e.columns),{pw:u,ph:d}=ll(s,l,e.height),c=e.scale!=="free",m=t==="scatter"?[]:o.map(I=>ya(t,I,n,n.y,n.series,n.aggregate)),h=c?ul(t,o,m,n,u,d):{sameKeys:!1},f=c?cl(t,o,m,n,h,u,d,e.locale):void 0,p=t==="bar"&&n.orientation==="horizontal",x=c&&(!p||h.sameKeys),k=c&&(p||h.x!==void 0||h.sameKeys),$=new Set(fl(e.highlight,r)?[e.highlight].flat():[]),S=$.size>0,b=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,v=e.syncId??dl(t,e.by,n,e.data),O=nn(ht(n.format,e.locale),n.unit),E=hl[e.lang],H=[],j=r.map(I=>I===""?E.blank:I);return{panels:r.map((I,F)=>{let N=o[F],w=j[F],P=F%l,_;if(t!=="scatter"){let le=m[F],Ue=ve=>le.values.reduce((Ie,Ut)=>Ie+(Number.isFinite(Ut[ve])?Ut[ve]:0),0),X=le.keys.map((ve,Ie)=>Ie).filter(ve=>le.values.some(Ie=>Number.isFinite(Ie[ve]))),me=X[X.length-1];H.push({first:X.length?Ue(X[0]):NaN,last:X.length?Ue(me):NaN,total:X.reduce((ve,Ie)=>ve+Ue(Ie),0)}),t!=="bar"&&le.series.length===1&&me!==void 0&&(_=O(le.values[0][me]))}else H.push({first:NaN,last:NaN,total:N.length});let K={data:N,width:u,height:d,ariaLabel:e.title?`${e.title}, ${w}`:w,syncId:v,highlight:S?$.has(I)?b?()=>!0:void 0:"none":e.highlight,showYAxis:!x||P===0,showXAxis:!k||F+l>=i};return h.y&&(K.yDomain=h.y),h.x&&(K.xDomain=h.x),f&&(K.xTicks=f),{value:I,label:w,props:K,last:_,isPicked:$.has(I)}}),cols:l,pw:u,ph:d,isPanelPick:S,description:gl(t,e.by,j,H,a,O,E)}}function gl(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=u=>qo(r.map(d=>d[u]));if(e==="line"||e==="area"){let u=l("last");u>=0&&(s+=i.endHigh(n[u],a(r[u].last)));let d=n.filter((c,m)=>r[m].last<r[m].first);s+=d.length?i.falling(`${d.slice(0,5).join(", ")}${d.length>5?i.more:""}`):i.noneFalling}else{let u=l("total");u>=0&&(s+=e==="bar"?i.total(n[u],a(r[u].total)):i.points(n[u],r[u].total))}return o&&(s+=i.dropped(n.length,n.length+o)),s}var we=L(ee(),1);function pl(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function bl(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function va(e,t=!0){let[n,r]=(0,we.useState)({visible:!t,near:!t});return(0,we.useEffect)(()=>{if(!t){r({visible:!0,near:!0});return}if(!e)return;if(typeof IntersectionObserver>"u"){r({visible:!0,near:!0});return}let o=new IntersectionObserver(i=>{let s=bl(i[i.length-1],.25);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:pl(.25),rootMargin:"0px 0px -8% 0px"}),a=new IntersectionObserver(i=>{let s=i[i.length-1];r(l=>l.near===s.isIntersecting?l:{...l,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),a.observe(e),()=>{o.disconnect(),a.disconnect()}},[e,t]),n}function ka(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Mn(e){let[t,n]=(0,we.useState)(null),[r,o]=(0,we.useState)(e??null),a=(0,we.useCallback)(i=>{n(i),i&&e===void 0&&o(ka(i))},[e]);return ze(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=u=>o(d=>d!==null&&Math.abs(d-u)<.5?d:u),s=()=>i(ka(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(u=>{let d=u[u.length-1]?.contentRect;d?i(d.width>0?Math.round(d.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var yl=()=>()=>{};function Pt(){return(0,we.useSyncExternalStore)(yl,()=>!0,()=>!1)}var wa="(prefers-reduced-motion: reduce)";function Tn(e="auto"){let[t,n]=(0,we.useState)(()=>Pe&&typeof window.matchMedia=="function"?window.matchMedia(wa).matches:!1);return(0,we.useEffect)(()=>{if(e!=="auto"||!Pe||typeof window.matchMedia!="function")return;let r=window.matchMedia(wa),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var Ge=L(G(),1),xl=60,kl=420;function $a(e){let t=Le(),n=e.chartProps??{},[,r,o]=Mn(e.width),a=e.width??(o||480),i=xe(e.locale??n.locale),s=te(i),l=(0,Rt.useContext)($t),u=e.title??l,d=(0,Rt.useMemo)(()=>xa({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:a,height:e.height,title:u,locale:i,lang:s}),[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(x,k)=>typeof k=="function"?String(k):k),e.highlight,e.syncId,a,e.height,u,i,s]),c=`${(0,Rt.useId)().replace(/:/g,"")}fd`,m=Tn(n.reducedMotion??"auto"),h=Pt(),f=no({motion:{enabled:n.animate!==!1&&!m&&Pe},hydrated:h},{waiting:!1,generation:0}),p=e.chart;return(0,Ge.jsxs)("div",{ref:r,role:"group","aria-label":u,"aria-describedby":c,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,Ge.jsx)("p",{id:c,style:mn,children:e.description??d.description}),(0,Ge.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${d.cols}, minmax(0, 1fr))`,columnGap:Wt,rowGap:pa},children:d.panels.map((x,k)=>{let $=t.paint(x.isPicked?"accentText":d.isPanelPick?"muted":"ink");return(0,Ge.jsxs)("div",{"data-facet":x.value,style:{minWidth:0,...to(f,!1,"fade",k*xl,kl)},children:[(0,Ge.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:xr,fontSize:ba,fontWeight:700,lineHeight:`${xr}px`,color:$},children:[(0,Ge.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.label}),x.last!==void 0?(0,Ge.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:x.last}):null]}),(0,Ge.jsx)(p,{...n,...x.props})]},x.value)})})]})}function Ke(e,t,n,r,o="max"){let a=new Set,i=n.length,s=u=>{if(i&&u!=="none"){if(u==="first")a.add(0);else if(u==="last")a.add(i-1);else if(u==="max"||u==="min"){let d=-1,c=u==="max"?-1/0:1/0;r.forEach((m,h)=>{Number.isFinite(m)&&(u==="max"?m>c:m<c)&&(c=m,d=h)}),d>=0&&a.add(d)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((u,d)=>{d<i&&u!==null&&u!==void 0&&e(u,d)&&a.add(d)}),a;let l=Array.isArray(e)?e:[e];for(let u of l)typeof u=="number"?u>=0&&u<i&&a.add(u):u==="max"||u==="min"||u==="first"||u==="last"||u==="none"?s(u):n.forEach((d,c)=>{d===u&&a.add(c)});return a}var Te=L(ee(),1);async function wl(e,t="auto",n="",r){let o=e.headers.get("content-type")??"",a=await e.text();if(t==="text")return a;if(o.includes("text/html")||/^\s*<(!doctype html|html[\s>])/i.test(a))throw new Error(te(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return pt(a);if(t==="json"||o.includes("json"))return JSON.parse(a);if(o.includes("csv")||/[./]csv(\?|#|$)|output=csv|format=csv|tqx=out:csv/i.test(n))return pt(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):pt(a)}async function vl(e,t={}){let n=t.signal??new AbortController().signal,r;if(typeof e=="function")r=await e(n);else{let o=e instanceof Request?e.url:String(e),a=await fetch(e instanceof Request?e.clone():o,{...t.init,signal:n});if(!a.ok)throw new Error(`HTTP ${a.status}${a.statusText?` ${a.statusText}`:""}`);r=await wl(a,t.parse,o,t.locale)}return t.select&&(r=Wo(r,t.select)),t.transform?t.transform(r):st(r)}function Ca(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,Te.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,Te.useState)(0),u=xe(t.locale),d=(0,Te.useRef)(t);d.current={...t,locale:u};let c=(0,Te.useRef)(e);c.current=e;let m=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],f=JSON.stringify(h.map(k=>typeof k=="object"?JSON.stringify(k):String(k))),p=(0,Te.useRef)(!1);(0,Te.useEffect)(()=>{let k=c.current;if(!k||!r){i(b=>b.status==="loading"?{...b,status:"idle"}:b);return}let $=new AbortController,S=!0;return p.current=!0,i(b=>({...b,data:o?b.data:[],status:"loading",error:null})),vl(k,{...d.current,signal:$.signal}).then(b=>{S&&i({data:b,status:"success",error:null,updatedAt:Date.now()})}).catch(b=>{!S||$.signal.aborted||i(v=>({...v,status:"error",error:b instanceof Error?b:new Error(String(b))}))}).finally(()=>{S&&(p.current=!1)}),()=>{S=!1,p.current=!1,$.abort()}},[m,r,s,f,o]),(0,Te.useEffect)(()=>{if(!n||!r)return;let k=setInterval(()=>{p.current||l($=>$+1)},n);return()=>clearInterval(k)},[n,r]);let x=(0,Te.useCallback)(()=>l(k=>k+1),[]);return{data:a.data,status:a.status,loading:a.status==="loading",error:a.error,empty:a.status==="success"&&a.data.length===0,updatedAt:a.updatedAt,reload:x}}var wr=L(G(),1),$l=["csv","svg","png"],Cl=/^[=+\-@\t\r\n=+-@]/,Ml=/var\(|color-mix\(/;function Ma(e){if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(e==null||e instanceof Date&&Number.isNaN(e.getTime()))return"";let t=e instanceof Date?wo(e.getTime()):String(e);return`"${(Cl.test(t)&&!Number.isFinite(Je(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Tl(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Sl(e,t){return`\uFEFF${[t.map(Ma),...e.map(r=>t.map(o=>Ma(r[o])))].map(r=>r.join(",")).join(`\r
|
|
26
|
+
`)}\r
|
|
27
|
+
`}function Al(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function kr(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Ta=2,ut=16;function Sa(e,t){if(!/^(ok)?l(ab|ch)\(|^color\(/.test(e))return e;let n=t.get(e);if(n)return n;let r=document.createElement("canvas").getContext("2d");if(!r)return e;r.fillStyle=e,r.fillRect(0,0,1,1);let[o,a,i,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${a}, ${i})`:`rgba(${o}, ${a}, ${i}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function Aa(e,t){let n=document.createElementNS("http://www.w3.org/2000/svg",e);for(let[r,o]of Object.entries(t))n.setAttribute(r,String(o));return n}function Fa(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:a,height:i}=o.viewBox.baseVal,[s,l]=[a+ut*2,i+ut*2],u=o.cloneNode(!0),d=u.querySelectorAll("*"),c=new Map;o.querySelectorAll("*").forEach((f,p)=>{let x;for(let k of Array.from(f.attributes)){if(!Ml.test(k.value))continue;let $=(x??(x=getComputedStyle(f))).getPropertyValue(k.name);$&&d[p].setAttribute(k.name,Sa($,c))}}),u.removeAttribute("style");for(let[f,p]of Object.entries({viewBox:`${-ut} ${-ut} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))u.setAttribute(f,String(p));let m=Sa(getComputedStyle(r).backgroundColor,c),h=o.parentElement?.querySelector("canvas")??null;if(n){let f=u.querySelector("desc")?.nextSibling??u.firstChild;u.insertBefore(Aa("rect",{x:-ut,y:-ut,width:s,height:l,fill:m}),f),h&&u.insertBefore(Aa("image",{href:h.toDataURL(),width:a,height:i}),f)}return{svg:new XMLSerializer().serializeToString(u),w:s,h:l,vw:a,vh:i,bg:m,canvas:h}}function Fl(e,t){let n=Fa(e,Ta,!1);if(!n)return;let r=Ta,o=document.createElement("canvas");o.width=Math.ceil(n.w*r),o.height=Math.ceil(n.h*r);let a=o.getContext("2d");if(!a)return;a.fillStyle=n.bg,a.fillRect(0,0,o.width,o.height),n.canvas&&a.drawImage(n.canvas,ut*r,ut*r,n.vw*r,n.vh*r);let i=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{a.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(i),o.toBlob(l=>l&&kr(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function Na(e){let t=Le(e.theme),n=te(xe(e.locale))==="ko",r=Al(e.filename),o=(a,i)=>{if(a==="csv")return kr(new Blob([Sl(e.data,e.columns?.length?e.columns:Tl(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return Fl(i,r);let s=Fa(i,1,!0);s&&kr(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,wr.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:$l.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,wr.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,onClick:l=>o(a,l.currentTarget),style:{background:"transparent",color:t.paint("muted"),border:`1px solid ${t.paint("line2")}`,borderRadius:14,height:28,padding:"0 10px",fontSize:12,fontWeight:700,flex:"none"},children:i},a)})})}var Ra=L(G(),1);function Pa(e,t=fe){let n=ht(void 0,t),r=e.split(`
|
|
28
|
+
`),o=(a,i)=>{if(i==="label")return a.label;if(i==="value")return a.formatted??(a.value===null?null:n(a.value));if(i==="series")return a.series??null;let s=a.datum&&typeof a.datum=="object"?a.datum[i]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?Ot(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,u=s.replace($o,(d,c)=>o(a,c.trim())??(l=!0,""));l||i.push(u)}return i.length?i.map((s,l)=>(0,Ra.jsx)("div",{children:s},l)):null}}function Da(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;if(Array.isArray(t.values))return t.values;if(typeof t.csv=="string")return pt(t.csv)}return null}var re=L(ee(),1);var xt=L(ee(),1);var ie=L(G(),1),Nl={zoomHint:" Press Enter to zoom in.",pickHint:" Press Enter to select.",high:"High",low:"Low",resetLabel:"Show all (reset zoom)",reset:"Show all",extremes:(e,t)=>`, high ${e}, low ${t}`,range:(e,t)=>`${e} to ${t}`},Ea={en:Nl,ko:{zoomHint:" Enter를 누르면 확대해요.",pickHint:" Enter를 누르면 이 구간을 골라요.",high:"최고",low:"최저",resetLabel:"전체 보기(확대 풀기)",reset:"전체 보기",extremes:(e,t)=>`, 최고 ${e}, 최저 ${t}`,range:(e,t)=>`${e}~${t}`}},Pl=4;function Rl(e){let[t,n]=(0,xt.useState)(null),[r,o]=(0,xt.useState)(!1),a=(0,xt.useRef)(null),i=(0,xt.useRef)(null),s=()=>{a.current=null,i.current=null,o(!1),n(null)},l=(m,h,f)=>!e.enabled||e.count<2||f.pointerType==="touch"||f.button!==0||!e.inPlot(m,h)?!1:(a.current={i:e.indexAt(m),x:m,moved:!1},f.currentTarget.setPointerCapture?.(f.pointerId),!0),u=m=>{let h=a.current;if(!h)return!1;if(!h.moved&&Math.abs(m-h.x)<Pl)return!0;h.moved=!0;let f=e.indexAt(m),p=Math.min(h.i,f),x=Math.max(h.i,f);return o(!0),n(k=>k?.from===p&&k.to===x?k:{from:p,to:x}),!0},d=(m,h,f)=>{let p=a.current;if(a.current=null,f.currentTarget.hasPointerCapture?.(f.pointerId)&&f.currentTarget.releasePointerCapture(f.pointerId),!p)return;if(o(!1),!p.moved||f.type==="pointercancel"){t&&(n(null),e.onCommit(null));return}let x=e.indexAt(m),k={from:Math.min(p.i,x),to:Math.max(p.i,x)},$=k.to>k.from;n($&&e.keep!==!1?k:null),e.onCommit($?k:null)},c=(m,h)=>{if(!e.enabled)return!1;if(m.key==="Escape"&&t)return s(),e.onCommit(null),!0;if(m.key==="Enter"&&t&&i.current!==null)return i.current=null,e.keep===!1&&n(null),e.onCommit(t),!0;if(!m.shiftKey||m.key!=="ArrowLeft"&&m.key!=="ArrowRight"||e.count<2)return!1;let f=m.key==="ArrowRight"?1:-1,p=i.current??h??(f>0?0:e.count-1),x=t&&i.current!==null?t.from===p?t.to:t.from:p,k=Math.max(0,Math.min(e.count-1,x+f));return i.current=p,n(k===p?null:{from:Math.min(p,k),to:Math.max(p,k)}),!0};return{range:t,dragging:r,keyboard:t!==null&&i.current!==null,down:l,move:u,up:d,key:c}}function _a(e){let[t,n]=(0,xt.useState)(null);return t&&t.sig!==e&&n(null),{view:t&&t.sig===e?t.range:null,zoomTo:r=>n({sig:e,range:r}),reset:()=>n(null)}}function Ia(e,t,n){let r=Ea[n.lang],o=e.brush==="zoom"?"zoom":e.brush?"select":null,a=Rl({enabled:o!==null,count:n.count,indexAt:n.indexAt,inPlot:n.inPlot,keep:o!=="zoom",onCommit:l=>{let u=l?n.toXRange(l):null;e.onBrush?.(u),o==="zoom"&&u&&u.to>u.from&&t.zoomTo([u.from,u.to])}}),i={onPointerDown:o?a.down:void 0,onPointerUp:o?a.up:void 0,onKey:o?l=>l.key==="Escape"&&t.view&&!a.range?(t.reset(),!0):a.key(l,n.active):void 0,overlay:t.view?(0,ie.jsx)(Dl,{p:n.p,onReset:t.reset,text:r}):null},s=a.keyboard?o==="zoom"?r.zoomHint:r.pickHint:"";return{brush:a,frame:i,hint:s,text:r}}function Oa(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e===0?null:(t-e)/Math.abs(e)}function Ba(e,t=fe){let n=Math.round(e*1e3)/10;return`${n>0?"+":""}${at(n,{locale:t,maximumFractionDigits:1})}%`}function za(e){let{p:t,top:n,bottom:r}=e,o=Math.min(e.x0,e.x1),a=Math.max(e.x0,e.x1),i=ae(e.main,11.5,800),s=ae(e.sub,10.5,500)+6,l=i+s+16,u=Math.max(2,Math.min(e.width-l-2,(o+a)/2-l/2)),d=n+4;return(0,ie.jsxs)("g",{pointerEvents:"none","aria-hidden":"true",children:[(0,ie.jsx)("rect",{x:o,y:n,width:Math.max(1,a-o),height:Math.max(0,r-n),fill:t.paint("accent"),opacity:e.dragging?.1:.14}),(0,ie.jsx)("line",{x1:o,x2:o,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,ie.jsx)("line",{x1:a,x2:a,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,ie.jsx)("rect",{x:u,y:d,width:l,height:22,rx:8,fill:t.paint("panel"),stroke:t.paint("line")}),(0,ie.jsx)(pe,{x:u+8,y:d+11,size:11.5,weight:800,fill:t.paint("ink"),children:e.main}),(0,ie.jsx)(pe,{x:u+8+i+6,y:d+11,size:10.5,weight:500,fill:t.paint("muted"),children:e.sub})]})}function Ha(e){let{p:t,width:n,top:r,bottom:o,max:a,min:i}=e,s=Ea[e.lang];return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(La,{p:t,x:a.x,y:a.y,text:`${s.high} ${a.text}`,below:a.y-26<r+30,width:n}),(0,ie.jsx)(La,{p:t,x:i.x,y:i.y,text:`${s.low} ${i.text}`,below:i.y+26<o,width:n})]})}function La(e){let{p:t}=e,n=ae(e.text,10.5,700)+12,r=18,o=Math.max(2,Math.min(e.width-n-2,e.x-n/2)),a=e.below?e.y+8:e.y-r-8;return(0,ie.jsxs)("g",{pointerEvents:"none","aria-hidden":"true",children:[(0,ie.jsx)("circle",{cx:e.x,cy:e.y,r:3.5,fill:t.paint("ink"),stroke:t.paint("panel"),strokeWidth:2}),(0,ie.jsx)("rect",{x:o,y:a,width:n,height:r,rx:9,fill:t.paint("ink")}),(0,ie.jsx)(pe,{x:o+n/2,y:a+r/2,anchor:"middle",size:10.5,weight:700,fill:t.paint("onInk"),children:e.text})]})}function Dl(e){let{p:t}=e;return(0,ie.jsx)("button",{type:"button",className:"ztd-btn",onClick:e.onReset,"aria-label":e.text.resetLabel,style:{position:"absolute",top:0,right:0,height:24,padding:"0 10px",borderRadius:12,border:`1px solid ${t.paint("line")}`,background:t.paint("panel"),color:t.paint("muted"),fontSize:11.5,fontWeight:600,zIndex:4},children:e.text.reset})}var Ll=e=>Array.isArray(e);function Sn(e,t,n){let r=Ll(e)?e:[e];return n?t<r.length?r[t]:null:r[0]}function Va(e,t,n,r,o,a){let i=typeof t=="function"||typeof n=="function"?new Map(o.map((s,l)=>[s,l])):null;return e.map((s,l)=>{let u=new Array(s.length).fill(NaN),d=new Array(s.length).fill(NaN),c=Sn(t,l,r),m=Sn(n,l,r);if(c===null||m===null)return{lo:u,hi:d};let h=gt(c,""),f=gt(m,"");for(let p=Math.max(0,a);p<s.length;p++){let x=s[p];if(x===null)continue;let k=i?.get(x)??-1,$=h(x,k),S=f(x,k);!Number.isFinite($)||!Number.isFinite(S)||(u[p]=Math.min($,S),d[p]=Math.max($,S))}return{lo:u,hi:d}})}var vr=(e,t,n)=>Number.isFinite(e)&&Number.isFinite(t)&&(e<t||e>n);function El(e,t){let n=[],r=-1;for(let o=0;o<=e.length;o++){let a=o<e.length&&Number.isFinite(e[o])&&Number.isFinite(t[o]);a&&r<0?r=o:!a&&r>=0&&(o-1>r&&n.push([r,o-1]),r=-1)}return n}function _l(e,t,n,r,o,a,i){let s=t(a),l=t(i);if(!(l>=s))return;let u=Math.floor(s),d=Math.floor(l)-u+1,c=new Array(d).fill(1/0),m=new Array(d).fill(-1/0),h=0;for(let f=a;f<i;f++){let p=Math.min(n[f],n[f+1]),x=Math.max(r[f],r[f+1]),k=Math.floor(t(f+1))-u;for(let $=h;$<=k;$++)p<c[$]&&(c[$]=p),x>m[$]&&(m[$]=x);h=k}for(let f=0;f<d;f++){let p=Math.max(s,u+f),x=Math.min(l,u+f+1);x<=p&&f>0||(e.xl.push(p),e.xr.push(x),e.top.push(o(m[f])),e.bottom.push(o(c[f])))}}function Wa(e,t,n,r,o){let a=El(t,n);if(!a.length)return null;let i=a.reduce((u,[d,c])=>u+c-d+1,0),s={runs:[],xl:[],xr:[],top:[],bottom:[]},l=i>o;for(let[u,d]of a)if(s.runs.push(s.top.length),l)_l(s,e,t,n,r,u,d);else for(let c=u;c<=d;c++)s.xl.push(e(c)),s.top.push(r(n[c])),s.bottom.push(r(t[c]));return s.runs.push(s.top.length),s}function Il(e,t,n,r,o,a){let i=W(n[o]),s=`M${W(e[o])},${i}`;for(let l=o+1;l<a;l++){let u=W(n[l]);u!==i&&(s+=`H${W(e[l])}V${i=u}`)}i=W(r[a-1]),s+=`H${W(t[a-1])}V${i}`;for(let l=a-2;l>=o;l--){let u=W(r[l]);u!==i&&(s+=`H${W(t[l])}V${i=u}`)}return`${s}H${W(e[o])}Z`}var ja=(e,t,n,r)=>e.slice(n,r).map((o,a)=>[o,t[n+a]]);function Ga(e,t,n,r){let o="";for(let a=0;a+1<e.runs.length;a++){let i=e.runs[a],s=e.runs[a+1];s-i<1||(o+=e.xr.length?Il(e.xl,e.xr,t,n,i,s):gn(ja(e.xl,t,i,s),ja(e.xl,n,i,s),r))}return o}var se=L(ee(),1);function Ka(e,t){let n=Le(e.theme),[r,o,a]=Mn(e.width),i=Pt(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,u=e.height??l,d=Tn(e.reducedMotion??"auto"),c=e.animate!==!1&&!d&&Pe,m=va(r,e.animateOnView!==!1&&c),h=xe(e.locale),f=te(h),p=(0,se.useMemo)(()=>ht(e.format,h,t.format),[e.format,h,t.format]),x=(0,se.useCallback)(X=>tn(X,{locale:h}),[h]),k=(0,se.useMemo)(()=>nn(p,e.unit),[p,e.unit]),$=(0,se.useMemo)(()=>fn(e.data),[e.data]),[S,b]=(0,se.useState)(null),[v,O]=(0,se.useState)(null),E=(0,se.useRef)([]),H=(0,se.useRef)(e.onHover);H.current=e.onHover;let j=(0,se.useRef)(e.onClick);j.current=e.onClick;let z=(0,se.useRef)(null),I=(0,se.useRef)(null),F=(0,se.useRef)(null),N=(0,se.useCallback)((X,me="pointer")=>{if(F.current!==X){F.current=X;let ve=X===null?null:E.current[X]??null;queueMicrotask(()=>H.current?.(ve)),I.current?.(X)}z.current=X===null?null:me,b(X),O(z.current)},[]),w=(0,se.useCallback)(X=>{z.current!=="keyboard"&&(z.current=X===null?null:"sync",b(X),O(z.current))},[]),P=(0,se.useCallback)(X=>{let me=E.current[X];me&&j.current?.(me)},[]),_=Fo(e.replayKey),K=e.width!==void 0||(a??0)>0,le={enabled:c,active:m.visible&&K,near:m.near,replayKey:_,dataKey:$,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},Ue=(0,se.useCallback)((X,me=1)=>S===null||S===X?me:me*.38,[S]);return{p:n,width:s,height:u,measured:K,responsive:e.width===void 0,pending:Pe&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:le,fv:k,fmt:p,pct:x,locale:h,lang:f,t:f==="ko"?ao:oo,active:S,via:v,setActive:N,click:P,events:E,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:Ue,sig:$,description:e.description,reduced:d,publish:I,applySync:w}}var ne=L(ee(),1);function Ol(e){return 1-Math.pow(1-e,3)}function Bl(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function zl(e){return e==="easeInOut"?Bl:e==="linear"?t=>t:Ol}function Hl(e,t){return e==="linear"?1:e==="easeInOut"?t<.5?12*t*t:3*Math.pow(-2*t+2,2):3*Math.pow(1-t,2)}function Dt(e,t){if(e.length===t)return e.slice();if(!e.length)return new Array(t).fill(0);if(e.length===1||t===1)return new Array(t).fill(e[0]);let n=new Array(t);for(let r=0;r<t;r++){let o=r/(t-1)*(e.length-1),a=Math.floor(o),i=Math.min(e.length-1,a+1);n[r]=e[a]+(e[i]-e[a])*(o-a)}return n}function An(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(Number.isNaN(r)!==Number.isNaN(o)||Math.abs(r-o)>1e-6)return!1}return!0}function Ua(e,t,n){for(let r=0;r<n.length;r++)(!Number.isFinite(e[r])||!Number.isFinite(n[r]))&&(e[r]=n[r],t[r]=0)}function Xa(e,t,n,r){if(!t||!n||t.length!==n.length)return Dt(e,r);let o=[],a=0;for(let i=0;i<n.length;i++){let s=e.slice(a,a+t[i]);a+=t[i];for(let l of Dt(s,n[i]))o.push(l)}return o.length===r?o:Dt(e,r)}var Fn=class{constructor(){this.tracks=new Map;this.seq=0;this.easing="spring";this.duration=900;this.omega=8.2;this.animating=!1;this.entranceStart=-1;this.maxDelay=0}configure(t,n){this.easing=t,this.duration=Math.max(1,n),this.omega=7.4/(this.duration/1e3)}sameTargets(t){let n=0;for(let r of this.tracks.values())r.exiting||n++;if(n!==t.length)return!1;for(let r of t){let o=this.tracks.get(r.key);if(!o||o.exiting||!An(o.to,r.to))return!1}return!0}refreshData(t){for(let n of t){let r=this.tracks.get(n.key);r&&(r.data=n.data)}}make(t,n,r,o){let a=t.from??t.to,i=t.enter??a;return{key:t.key,data:t.data,from:n.slice(),vel:new Array(t.to.length).fill(0),to:t.to.slice(),appear:a.slice(),enter:i.slice(),exit:(t.exit??i).slice(),delay:o,t0:r,cur:n.slice(),curVel:new Array(t.to.length).fill(0),done:!1,exiting:!1,order:this.seq++,progress:0,parts:t.parts}}snap(t){let n=new Map;for(let r of t){let o=this.tracks.get(r.key),a=this.make(r,r.to,0,0);o&&(a.order=o.order),a.done=!0,a.progress=1,n.set(r.key,a)}this.tracks=n,this.animating=!1,this.entranceStart=-1}hold(t){let n=new Map,r=0;for(let o of t){let a=this.tracks.get(o.key),i=this.make(o,o.from??o.to,1/0,o.delay??0);a&&(i.order=a.order),r=Math.max(r,o.delay??0),n.set(o.key,i)}this.maxDelay=r,this.tracks=n,this.animating=!1,this.entranceStart=-1}start(t){for(let n of this.tracks.values())n.t0=t+n.delay,n.from=n.appear.slice(),n.vel.fill(0),Ua(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=An(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),l=r>0?Math.min(a*r,240):0;if(s){let u=i.to.length;s.from=Xa(s.cur,s.parts,i.parts,u),s.vel=Xa(s.curVel,s.parts,i.parts,u),s.parts=i.parts,s.to=i.to.slice(),Ua(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(i.from??i.to).slice(),s.enter=(i.enter??s.appear).slice(),s.exit=(i.exit??s.enter).slice(),s.data=i.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):l),s.done=An(s.from,s.to)&&s.vel.every(d=>Math.abs(d)<1e-6),s.progress=s.done?1:0}else{let u=this.make(i,i.enter??i.from??i.to,n+l,0);u.done=An(u.from,u.to),this.tracks.set(i.key,u)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=Dt(i.exit,i.cur.length),i.t0=n,i.exiting=!0,i.done=!1,i.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=zl(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,u=s.to.length;if(s.from.length!==u&&(s.from=Dt(s.from,u)),s.vel.length!==u&&(s.vel=Dt(s.vel,u)),s.cur.length!==u&&(s.cur=new Array(u).fill(0),s.curVel=new Array(u).fill(0)),!(l>0)){for(let c=0;c<u;c++)s.cur[c]=s.from[c],s.curVel[c]=0;s.progress=0,n=!0;continue}let d;if(this.easing==="spring"){let c=Math.exp(-a*l),m=a*l>=8&&a*l<20,h=0;for(let f=0;f<u;f++){let p=s.from[f]-s.to[f],x=s.vel[f]+a*p;s.cur[f]=s.to[f]+(p+x*l)*c,s.curVel[f]=(s.vel[f]-a*x*l)*c,m&&h<.15&&(h=Math.max(h,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/a)))}d=a*l>=20||m&&h<.15,s.progress=Math.min(1,1-(1+a*l)*c)}else{let c=Math.min(1,l/o),m=r(c),h=Hl(this.easing,c)/o;for(let f=0;f<u;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*m,s.curVel[f]=(s.to[f]-s.from[f])*h;d=c>=1,s.progress=m}if(d){for(let c=0;c<u;c++)s.cur[c]=s.to[c],s.curVel[c]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},Gt=new Set,Nn=0;function Ya(e){Nn=0;let t=Array.from(Gt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Gt.delete(n)}Gt.size&&typeof requestAnimationFrame<"u"&&(Nn=requestAnimationFrame(Ya))}function qa(e){return Gt.add(e),!Nn&&typeof requestAnimationFrame<"u"&&(Nn=requestAnimationFrame(Ya)),()=>{Gt.delete(e)}}function jl(e){let t=new Map,n=!1;for(let r of e){let o=(t.get(r.key)??0)+1;t.set(r.key,o),o>1&&(n=!0)}return n?(t.clear(),e.map(r=>{let o=(t.get(r.key)??0)+1;return t.set(r.key,o),o>1?{...r,key:`${r.key}#${o}`}:r})):e}function Za(e,t){let n=(0,ne.useMemo)(()=>jl(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:u=900,stagger:d=0}=t,c=(0,ne.useRef)(null),m=(0,ne.useRef)("init"),h=(0,ne.useRef)(null),f=(0,ne.useRef)(s),p=(0,ne.useRef)(i),x=(0,ne.useRef)(!1),k=(0,ne.useRef)(0),[,$]=(0,ne.useState)(0),S=(0,ne.useRef)(null),b=(0,ne.useRef)(!0);c.current||(c.current=new Fn,c.current.configure(l,u),c.current.snap(n),h.current=n);let v=c.current;if(v.configure(l,u),h.current!==n){let I=m.current,F=!Object.is(f.current,s);v.sameTargets(n)?v.refreshData(n):!r||I==="init"?v.snap(n):I==="idle"?v.hold(n):I==="running"||F?v.update(n,Zt(),d):v.snap(n),h.current=n,f.current=s}let O=(0,ne.useRef)(()=>!1);O.current=I=>{if(!b.current)return!1;let F=v.step(I);return!F&&m.current==="running"&&(m.current="done"),$(N=>(N+1)%1e9),F||(S.current=null),F};let E=(0,ne.useCallback)(()=>{if(!Pe||S.current||!v.animating)return;let I=F=>O.current(F);S.current=qa(I)},[v]);ze(()=>{let I=!Object.is(p.current,i);if(p.current=i,!r){(m.current!=="done"||v.animating)&&(v.snap(h.current??n),m.current="done",$(F=>F+1));return}m.current==="init"||I&&a?(v.hold(h.current??n),m.current="idle",x.current=!1,$(F=>F+1)):I&&(x.current=!0)},[r,i]),ze(()=>{!r||!a||!x.current||(x.current=!1,v.hold(h.current??n),m.current="idle",$(I=>I+1))},[a,r]),(0,ne.useEffect)(()=>{r&&o&&m.current==="idle"&&(v.start(Zt()),k.current+=1,m.current="running",E(),$(I=>I+1))},[r,o,i,v,E]),(0,ne.useEffect)(()=>{v.animating&&E()}),(0,ne.useEffect)(()=>(b.current=!0,()=>{b.current=!1,S.current?.(),S.current=null}),[]);let H=Zt(),j=v.elapsed(H),z=r&&m.current==="idle";return{items:v.items(),get:I=>v.get(I),elapsed:z?0:j,fade:(I,F=320)=>z?0:Number.isFinite(j)?Math.max(0,Math.min(1,(j-I)/F)):1,waiting:z,animating:v.animating,generation:k.current}}var A=L(G(),1),Vl={line:"Line chart",area:"Area chart",span:(e,t)=>`${e}: ${t}`,desc:(e,t,n,r,o)=>`${Re(e,"series","series")} (${t}), x from ${n} to ${r}, ${Re(o,"point")}`,lower:"low",upper:"high",band:e=>` Range ${e}.`,range:(e,t)=>`${e} to ${t}`,outside:(e,t)=>e?` ${Re(e,"point")} outside the range: ${t}.`:" No points outside the range.",where:(e,t)=>`${e} (${t})`,logDropped:e=>` ${Re(e,"value")} at or below 0 ${e===1?"is":"are"} not shown on the log scale.`},Wl={en:Vl,ko:{line:"라인 차트",area:"영역 차트",span:(e,t)=>`${e} 구간 ${t}`,desc:(e,t,n,r,o)=>`계열 ${e}개(${t}), x ${n}부터 ${r}까지 ${o}개 지점`,lower:"하한",upper:"상한",band:e=>` 범위 ${e}.`,range:(e,t)=>`${e}~${t}`,outside:(e,t)=>e?` 범위 밖 ${e}개 지점: ${t}.`:" 범위 밖 지점 없음.",where:(e,t)=>`${e}(${t})`,logDropped:e=>` 로그 눈금이라 0 이하 값 ${e}개는 뺐어요.`}};function Gl(e,t,n){let r=Math.max(0,Math.min(t,n)),o=Math.min(e.keys.length-1,Math.max(t,n)),a=e.keys.slice(r,o+1);return{type:e.type,keys:a,xnum:e.type==="band"?a.map((i,s)=>s):e.xnum.slice(r,o+1),labels:e.labels.slice(r,o+1),series:e.series,values:e.values.map(i=>i.slice(r,o+1)),rows:e.rows.map(i=>i.slice(r,o+1))}}function Kl(e,t,n){if(t!=="forecast")return 0;let r=e.keys.length;if(n===void 0)return r;if(e.type==="band"){let i=e.keys.indexOf(String(n));return i<0?r:i}let o=$n(e.type,n);if(!Number.isFinite(o))return r;let a=e.xnum.findIndex(i=>i>=o);return a<0?r:a}function Ul(e,t,n,r,o){let a=(d,c)=>e.series.length>1&&e.series[d]?o.where(c,e.series[d]):c,i=it(t.flatMap((d,c)=>d.lo.some(Number.isFinite)?[a(c,o.range(...n[c]))]:[]));if(!i.length)return"";let s=o.band(i.join(", "));if(!r)return s;let l=0,u=[];return t.forEach((d,c)=>{for(let m=0;m<d.lo.length;m++)vr(e.values[c][m],d.lo[m],d.hi[m])&&(l++,u.length<5&&u.push(a(c,e.labels[m])))}),s+o.outside(l,`${u.join(", ")}${l>u.length?", …":""}`)}function Ja(e,t,n,r){let o=Sn(e,t,n);return typeof o=="string"&&o?o:r}function Xl(e,t,n,r){let o=e.keys.length;if(e.type==="band"){let l=o>1?(n-t)/(o-1):0;return u=>o>1?t+u*l:(t+n)/2}let[a,i]=r??We(e.xnum),s=Me([a,i===a?a+1:i],[t,n]);return Object.assign(l=>s(e.xnum[l]),{v:s})}function Yl(e){let{c:t,model:n,xs:r,x0:o,x1:a,y:i,domain:s}=e,l=t.p,u;if(s&&n.type!=="band"&&e.fixed){let c=Me(s[1]===s[0]?[s[0],s[0]+1]:[s[0],s[1]],[o,a]);u=e.fixed.map(m=>({x:c(m.value),label:m.label}))}else if(s&&n.type!=="band"){let[c,m]=s[1]===s[0]?[s[0],s[0]+1]:s,h=n.type==="date",f=Math.max(2,Math.floor((a-6)/(h?64:70))),p=c>=1e3&&m<=9999?String:Tt(void 0,t.locale,Math.max(-c,m)),x=h?Ht(c,m,f,t.locale).map(S=>({v:S.t,label:S.label})):Me([c,m],[0,1]).ticks(f).map(S=>({v:S,label:p(S)})),k=Me([c,m],[6,a]),$=Me([c,m],[o,a]);u=pr(x.map(S=>({...S,x:k(S.v)})),-6,t.width+2).map(S=>({x:$(S.v),label:S.label}))}else if(n.type==="date"&&n.keys.length>1){let c=n.xnum[0],m=n.xnum[n.xnum.length-1],h=Math.max(2,Math.floor((a-o)/64)),f=Me([c,m],[o,a]),p=Ht(c,m,h,t.locale);if(p.length>=2&&n.keys.length>p.length)u=p.map(x=>({x:f(x.t),label:x.label}));else{let x=n.keys.map((k,$)=>r($));u=br(x,n.labels).map(k=>({x:x[k],label:n.labels[k]}))}}else if(n.type==="number"&&n.keys.length>12){let[c,m]=We(n.xnum),h=Me([c,m],[o,a]),f=c>=1e3&&m<=9999?String:Tt(void 0,t.locale,Math.max(-c,m));u=h.ticks(Math.max(2,Math.floor((a-o)/70))).map(p=>({x:h(p),label:f(p)}))}else{let c=n.keys.map((m,h)=>r(h));u=br(c,n.labels).map(m=>({x:c[m],label:n.labels[m]}))}let d=s&&n.type!=="band"?u:pr(u,-2,t.width+2);return(0,A.jsx)("g",{"aria-hidden":"true",children:d.map((c,m)=>(0,A.jsx)(pe,{x:c.x,y:i,anchor:"middle",size:_e,fill:l.paint("muted"),children:c.label},m))})}function $r(e,t,n,r,o){if(r)return o==="categorical"?je(e,t,n):go(e,t,n);if(o==="categorical")return je(e,t,n);let a=de(e,"strong"),i=de(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}function ql(e){let t=e.kind==="area",n=!t&&e.yScale==="log",r=Ka(e,{height:g=>Math.max(200,Math.min(300,g*.5)),duration:1100,stagger:120}),{p:o,width:a,height:i}=r,s=Wl[r.lang],l=(0,re.useId)().replace(/:/g,""),u=(0,re.useMemo)(()=>yt(e.data,e.x,e.y,e.series,{xType:e.xType,locale:r.locale,aggregate:e.aggregate,dayFirst:e.dayFirst}),[e.data,e.x,e.y,e.series,e.xType,r.locale,e.aggregate,e.dayFirst]),[d,c]=(0,re.useMemo)(()=>{if(!n)return[u,0];let g=0,y=u.values.map(T=>T.map(M=>M<=0?(g++,Number.NaN):M));return g?[{...u,values:y},g]:[u,0]},[u,n]),m=d.series.length,h=t?e.stack??(m>1?"stacked":"none"):"none",f=_a(r.sig),p=f.view,x=(0,re.useMemo)(()=>p?Gl(d,p[0],p[1]):d,[d,p]),k=Math.max(40,Math.round(e.maxPoints??a/2)),$=(0,re.useMemo)(()=>h!=="none"?ga(x,k):x,[x,h,k]),S=e.hidden?.join("")??"",[b,v]=(0,re.useMemo)(()=>ha($,S),[$,S]),O=b.rowValues??b.values,E=(0,re.useMemo)(()=>h==="none"?null:Nt(b.values,h==="percent"?"expand":"zero"),[b,h]),H=ta(e.annotations),{lower:j,upper:z}=e,I=Kl(b,e.bandFrom,H),F=(0,re.useMemo)(()=>{if(j===void 0||z===void 0||h!=="none")return null;let g=Va($.rows,j,z,Array.isArray(e.y),e.data,I),y=b===$?g:v.map(T=>g[T]);if(n)for(let T of y)T.lo.forEach((M,D)=>{M>0&&T.hi[D]>0||(T.lo[D]=T.hi[D]=Number.NaN)});return y.some(T=>T.lo.some(Number.isFinite))?y:null},[$,b,v,j,z,e.y,e.data,h,I,n]),N=(0,re.useMemo)(()=>{let g=[];return F?.forEach(y=>y.lo.forEach((T,M)=>Number.isFinite(T)&&g.push(T,y.hi[M]))),g.length?We(g):g},[F]),w=(0,re.useMemo)(()=>{let g=$.values.map(y=>y.reduce((T,M)=>T+(Number.isFinite(M)?M:0),0));return Ke(e.highlight,$.series,$.series,g,"first")},[$,e.highlight]),P=(0,re.useMemo)(()=>$r(o,m,w,t,e.colorMode),[t,e.colorMode,o,m,w]),_=(0,re.useMemo)(()=>b===$?w:new Set(v.flatMap((g,y)=>w.has(g)?[y]:[])),[b,$,w,v]),K=(0,re.useMemo)(()=>b===$?P:v.map(g=>P[g]),[b,$,P,v]),le=[];E?E.y1.forEach(g=>g.forEach(y=>le.push(y))):b.values.forEach(g=>g.forEach(y=>Number.isFinite(y)&&le.push(y))),le.push(...N);let Ue=e.referenceLines?.filter(g=>typeof g?.y=="number"&&Number.isFinite(g.y)&&(!n||g.y>0));Ue?.forEach(g=>le.push(g.y)),le.push(...yn(e.annotations).filter(g=>!n||g>0));let X=e.baseline??0,me=!!e.signColors&&h==="none"&&(!n||X>0);me&&le.push(X);let[ve,Ie]=We(le),Ut=e.yDomain&&(!n||e.yDomain[0]>0&&e.yDomain[1]>0)?e.yDomain:void 0,Oe=e.yLabel?22:10,Xe=22,Rn=Math.max(2,Math.round(i/70)),ct=Ut??(n?zt(ve,Ie,Rn):h==="percent"?[0,100]:lt(ve,Ie,Rn,{zero:e.zero??t})),Fr=h==="percent"?g=>`${g}%`:Tt(e.format,r.locale,Math.max(Math.abs(ct[0]),Math.abs(ct[1]))),Q=(n?vn:Me)(ct,[i-Xe,Oe]),Nr=Q.ticks(Rn),Dn=e.showYAxis!==!1,Ln=Dn?wn(Nr,Fr,r.locale):0,Pr=e.endLabels??m>1,pi=g=>{for(let y=b.keys.length-1;y>=0;y--)if(Number.isFinite(b.values[g][y]))return y;return-1},Rr=Pr?Math.min(a*.28,Math.max(...$.series.map(g=>ae(g,11,700)),20)+14):10,Se=Ln+6,ge=a-Rr,kt=p?void 0:e.xDomain,$e=Xl(b,Se,ge,kt),et=(0,re.useMemo)(()=>b.keys.map((g,y)=>$e(y)),[b,Se,ge,kt?.[0],kt?.[1]]),Lt=e.maxPoints??Math.max(60,Math.round((ge-Se)*2)),En=e.curve??"smooth",Et=Math.min(ct[1],Math.max(ct[0],0)),mt=o.color(e.downColor,"neutralStrong"),dt=Q(X),ft=$e.v,Dr=g=>ft?$n(b.type,g):b.keys.indexOf(String(g)),bi=g=>{let y=Dr(g);return ft?Number.isFinite(y)?ft(y):null:y<0?null:$e(y)},Xt=b.xnum.length-1,_n={p:o,lang:r.lang,xAt:bi,y:Q,x0:Se,x1:ge,top:Oe,bottom:i-Xe,half:ft||Xt<1?0:($e(1)-$e(0))/2,time:b.type==="date"&&ft&&Xt>0?{t0:b.xnum[0],t1:b.xnum[Xt],n:Xt+1,xt:ft}:void 0,points:()=>{let g=[..._][0]??0;return et.map((y,T)=>({x:y,y:Q(E?E.y1[g][T]:b.values[g][T])}))}},wt=xn(_n,H),yi=g=>{let y=Dr(g),T=ft?b.xnum.indexOf(y):y;return T>=0?b.labels[T]:String(g??"")},Lr=(g,y)=>me&&_.has(g)&&y<X?mt:K[g].fill,In=!e.connectNulls&&!E&&b.keys.length>1,On=(0,re.useMemo)(()=>b.series.map((g,y)=>{let T=V=>E?E.y1[y][V]:b.values[y][V],M=[];for(let V=0;V<b.keys.length;V++){if(!Number.isFinite(T(V)))continue;let B=M[M.length-1];B&&(!In||B[B.length-1]===V-1)?B.push(V):M.push([V])}let D=M.reduce((V,B)=>V+B.length,0);D>Lt&&(M=M.map(V=>Go(V.map(B=>({x:$e(B),y:T(B),k:B})),M.length>1?Math.max(3,Math.round(Lt*V.length/D)):Lt).map(B=>B.k)));let U=M.flat(),oe=0,ce=M.map(V=>[oe,oe+=V.length]),Ae=U.map(V=>Q(T(V))),Ye=E?U.map(V=>Q(E.y0[y][V])):t?U.map(()=>Q(Et)):void 0,nt={s:y,name:g,pts:Ae,xs:U.map(V=>$e(V)),base:Ye,sw:K[y],hi:_.has(y),idx:U,spans:ce},Ce=F?.[y],rt=Ce?Wa($e,Ce.lo,Ce.hi,Q,Lt):null;if(!Ce||!rt)return nt;let ye=e.outside?U.flatMap((V,B)=>vr(b.values[y][V],Ce.lo[V],Ce.hi[V])?[B]:[]):void 0;return{...nt,band:rt,out:ye}}),[b,E,K,_,Se,ge,kt?.[0],kt?.[1],i,ct[0],ct[1],Lt,t,F,e.outside,In,n]),Bn=r.motion.stagger??120,Er=(0,re.useMemo)(()=>[...On].sort((g,y)=>Number(g.hi)-Number(y.hi)),[On]),xi=(0,re.useMemo)(()=>Er.map((g,y)=>{let T=Q(Et),M=g.band?[...g.band.top,...g.band.bottom]:[],D=g.band?[g.band.top.length,g.band.bottom.length]:[];if(t){let U=g.base??g.pts.map(()=>T);return{key:`s:${g.name}`,to:[1,...g.pts,...U,...M],from:[0,...g.pts.map(()=>T),...U.map(()=>T),...M.map(()=>T)],delay:y*Bn*.5,parts:[1,g.pts.length,U.length,...D],data:g}}return{key:`s:${g.name}`,to:[1,...g.pts,...M],from:[0,...g.pts,...M],enter:[0,...g.pts,...M],delay:y*Bn,parts:[1,g.pts.length,...D],data:g}}),[Er,Bn,t,i,Et]),_r=Za(xi,r.motion),Ir=r.fv,zn=r.fmt,vt=(0,re.useMemo)(()=>{if(!F)return null;let g=Array.isArray(e.y),y=b.series.map((M,D)=>[Ja(j,v[D],g,s.lower),Ja(z,v[D],g,s.upper)]);return{range:(M,D)=>Number.isFinite(F[M].lo[D])?` (${y[M][0]} ${zn(F[M].lo[D])} ~ ${y[M][1]} ${zn(F[M].hi[D])})`:"",unnamed:typeof e.y=="string"?e.y:void 0,desc:Ul(b,F,y,e.outside===!0,s)}},[F,e.y,b,v,j,z,s,zn,e.outside]),ki=(0,re.useMemo)(()=>{if(!b.series.length)return[];let g=[..._][0]??0,y=(T,M,D)=>{let U=T||vt?.unnamed;return`${U?`${U} `:""}${Ir(O[M][D])}${vt?.range(M,D)??""}`};return jt(b.keys.length,T=>{let M=O[g]?.[T];return{datum:b.rows[g]?.[T]??null,index:T,key:b.keys[T],label:b.labels[T],value:Number.isFinite(M)?M:null,formatted:b.series.map((D,U)=>Number.isFinite(O[U][T])?y(D,U,T):null).filter(Boolean).join(", ")}})},[b,O,_,Ir,vt]),Or=(g,y)=>{let T=d.keys.indexOf(g);return T<0?y:T},{brush:tt,frame:wi,hint:vi,text:Br}=Ia(e,f,{p:o,active:r.active,lang:r.lang,count:b.keys.length,indexAt:g=>pn(et,g),inPlot:(g,y)=>g>=Se-4&&g<=ge+4&&y>=Oe&&y<=i-Xe,toXRange:g=>{let y=b.keys[g.from],T=b.keys[g.to];return{from:Or(y,g.from),to:Or(T,g.to),fromKey:y,toKey:T,fromLabel:b.labels[g.from],toLabel:b.labels[g.to]}}}),ue=r.active;ro(r,e.syncId,b.keys,b.labels);let zr=null;if(ue!==null&&b.keys[ue]!==void 0&&!tt.dragging){let g=h==="percent"?Nt(O.map(M=>[M[ue]]),"expand"):null,y=b.series.map((M,D)=>({s:M,si:D,v:O[D][ue]})).filter(M=>Number.isFinite(M.v)).sort((M,D)=>D.v-M.v).map(M=>{let D=vt?.range(M.si,ue),U=g?`${Math.round(g.y1[M.si][0]-g.y0[M.si][0])}% · ${r.fv(M.v)}`:r.fv(M.v);return{label:M.s||vt?.unnamed||r.t.value,value:D?(0,A.jsxs)(A.Fragment,{children:[U,(0,A.jsx)("span",{style:{fontWeight:500,color:o.paint("muted")},children:D})]}):U,color:Lr(M.si,M.v),strong:_.has(M.si)}}),T=Math.min(...b.series.map((M,D)=>E?Q(E.y1[D][ue]):Number.isFinite(b.values[D][ue])?Q(b.values[D][ue]):i));zr={x:$e(ue),y:Math.max(Oe,T),title:b.labels[ue],rows:Po(y,r.t.more)}}let $i=g=>{if(!b.keys.length)return;let y=pn(et,g);y>=0&&y!==r.active&&r.setActive(y,"pointer")},Hr=null,jr;if(tt.range&&tt.range.to<b.keys.length){let{from:g,to:y}=tt.range,T=[..._][0]??0,M=b.values[T]??[],D=NaN,U=NaN,oe=-1,ce=-1;for(let ye=g;ye<=y;ye++){let V=M[ye];Number.isFinite(V)&&(Number.isFinite(D)||(D=V),U=V,(oe<0||V>M[oe])&&(oe=ye),(ce<0||V<M[ce])&&(ce=ye))}let Ae=Oa(D,U),Ye=Ae!==null?Ba(Ae,r.locale):Number.isFinite(U-D)?`${U-D>=0?"+":""}${r.fv(U-D)}`:"-",nt=Br.range(b.labels[g],b.labels[y]),Ce=ye=>Q(E?E.y1[T][ye]:M[ye]),rt=i-Xe;Hr=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(za,{p:o,x0:et[g],x1:et[y],top:Oe,bottom:rt,width:a,main:Ye,sub:nt,dragging:tt.dragging}),oe>=0&&ce>=0&&oe!==ce?(0,A.jsx)(Ha,{p:o,lang:r.lang,width:a,top:Oe,bottom:rt,max:{x:et[oe],y:Ce(oe),text:r.fv(M[oe])},min:{x:et[ce],y:Ce(ce),text:r.fv(M[ce])}}):null]}),tt.dragging||(jr=`${s.span(nt,Ye)}${oe>=0?Br.extremes(r.fv(M[oe]),r.fv(M[ce])):""}.${vi}`)}let Ci=Pr?(()=>{let g=On.map(T=>{let M=pi(T.s);if(M<0)return null;let D=Q(E?(E.y0[T.s][M]+E.y1[T.s][M])/2:b.values[T.s][M]);return{d:T,y:D}}).filter(T=>T!==null),y=ea(g.map(T=>T.y),14,Oe+4,i-Xe-2);return g.map((T,M)=>({...T,ly:y[M]}))})():[],Mi=r.motion.duration??1100,Vr=e.dots??"auto",Ti=Vr===!0||Vr==="auto"&&!t&&b.keys.length<=16,Wr=t?s.area:s.line,Si=e.description??`${Wr}. ${s.desc(b.series.length,b.series.filter(Boolean).join(", ")||r.t.value,b.labels[0]??"",b.labels[b.labels.length-1]??"",b.keys.length)}.${vt?.desc??""}${la(e.annotations,r.lang,r.fv,yi)}${c?s.logDropped(c):""}`,Hn=[],Gr=[];for(let g of _r.items){let y=g.data,T=g.v,M=y.xs.length,D=T[0],U=T.slice(1,1+M),oe=y.xs.map((B,q)=>[B,U[q]??U[U.length-1]??0]),ce=me&&y.hi,Ae=y.spans,Ye=Ae.map(([B,q])=>hn(oe.slice(B,q),En)),nt=ce?Ae.map(([B],q)=>`${Ye[q]}V${W(dt)}H${W(y.xs[B])}Z`).join(""):"",Ce=B=>Ae.map(([q,Fe])=>gn(oe.slice(q,Fe),B.slice(q,Fe),En)).join(""),rt=In?Ae.filter(([B,q])=>q-B===1).map(([B])=>B):[],ye=(B,q)=>{let[Fe,qe]=oe[B],Be=ce&&qe>dt?mt:y.sw.fill;return(0,A.jsx)("circle",{cx:Fe,cy:qe,r:y.hi?3:2.2,fill:y.hi?Be:o.paint("panel"),stroke:Be,strokeWidth:y.hi?0:1.4,opacity:q},B)};if(y.band){let B=1+(t?2*M:M),q=y.band.top.length;Gr.push((0,A.jsx)("path",{d:Ga(y.band,T.slice(B,B+q),T.slice(B+q,B+2*q),En),fill:y.sw.fill,opacity:.16*D*(g.exiting?.4:1)},g.key))}let V=B=>y.out?.map(q=>{let[Fe,qe]=oe[q];return(0,A.jsx)("circle",{cx:Fe,cy:qe,r:3.6,fill:ce&&qe>dt?mt:y.sw.fill,stroke:o.paint("panel"),strokeWidth:1.5,opacity:B(q)},`o${q}`)});if(t){let B=T.slice(1+M,1+2*M),q=y.xs.map((Ne,J)=>[Ne,B[J]??Q(Et)]),Fe=Ye.join(""),qe=ce?["up","dn"].map(Ne=>(0,A.jsx)("path",{d:nt,fill:Ne==="up"?y.sw.fill:mt,opacity:.5,clipPath:`url(#${l}${Ne})`},Ne)):(0,A.jsx)("path",{d:Ce(q),fill:y.sw.fill,opacity:h==="none"?y.hi?.5:.28:1}),Be=Ne=>(ce?["up","dn"]:[null]).map(J=>(0,A.jsx)("path",{d:Fe,fill:"none",stroke:J==="dn"?mt:h==="none"?y.sw.fill:o.paint("panel"),strokeWidth:h==="none"?y.hi?2.2:1.4:1.2,strokeLinejoin:"round",strokeDasharray:Ne?"5 4":void 0,opacity:Math.min(1,D*1.4),clipPath:J?`url(#${l}${J})`:void 0},J??"s"));Hn.push((0,A.jsxs)("g",{opacity:g.exiting?.4:1,children:[qe,wt!==null?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("g",{clipPath:`url(#${l}pre)`,children:Be(!1)}),(0,A.jsx)("g",{clipPath:`url(#${l}post)`,children:Be(!0)})]}):Be(!1),rt.map(Ne=>ye(Ne,Math.min(1,D*1.4))),V(()=>Math.min(1,D*1.4))]},g.key))}else{let B=y.hi?2.6:1.7,q=D<.999,Fe=J=>Math.max(0,Math.min(1,(D-(M>1?J/(M-1):1))*8+(D>=.999?1:0))),qe=q&&Ae.length>1?Ae.flatMap(([J,Ze],jn)=>Ze-J>1?[[Ye[jn],Math.max(0,Math.min(1,(D*(M-1)-J)/(Ze-1-J)))]]:[]):[[Ye.join(""),D]],Be=J=>(ce?["up","dn"]:[null]).flatMap(Ze=>qe.map(([jn,Ai],Fi)=>(0,A.jsx)("path",{d:jn,fill:"none",stroke:Ze==="dn"?mt:y.sw.fill,strokeWidth:B,strokeLinejoin:"round",strokeLinecap:"round",pathLength:q?1:void 0,strokeDasharray:q?"1 1":J?"5 4":void 0,strokeDashoffset:q?1-Ai:void 0,clipPath:Ze?`url(#${l}${Ze})`:void 0},`${Ze??"s"}${Fi}`))),Ne=e.area&&y.hi?ce?["up","dn"].map(J=>(0,A.jsx)("path",{d:nt,fill:J==="up"?y.sw.fill:mt,opacity:.16*D,clipPath:`url(#${l}${J})`},J)):(0,A.jsx)("path",{d:Ce(oe.map(([J])=>[J,Q(Et)])),fill:`url(#${l}g)`,opacity:D}):null;Hn.push((0,A.jsxs)("g",{opacity:g.exiting?.4:1,children:[Ne,wt!==null?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("g",{clipPath:`url(#${l}pre)`,children:Be(!1)}),(0,A.jsx)("g",{clipPath:`url(#${l}post)`,children:Be(!0)})]}):Be(!1),(Ti?oe.map((J,Ze)=>Ze):rt).map(J=>ye(J,Fe(J))),V(Fe)]},g.key))}}return(0,A.jsxs)(Ro,{c:r,kind:Wr,ariaLabel:e.ariaLabel,description:Si,events:ki,tip:zr,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(g,y,T)=>{tt.move(g),T.pointerType==="touch"?r.setActive(pn(et,g),"touch"):$i(g)},...wi,announce:jr,defs:e.area||wt!==null||me?(0,A.jsxs)(A.Fragment,{children:[e.area?(0,A.jsxs)("linearGradient",{id:`${l}g`,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,A.jsx)("stop",{offset:"0%",stopColor:o.paint("accent"),stopOpacity:.28}),(0,A.jsx)("stop",{offset:"100%",stopColor:o.paint("accent"),stopOpacity:0})]}):null,wt!==null?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("clipPath",{id:`${l}pre`,children:(0,A.jsx)("rect",{x:-a,y:-i,width:a+wt,height:i*3})}),(0,A.jsx)("clipPath",{id:`${l}post`,children:(0,A.jsx)("rect",{x:wt,y:-i,width:a*2,height:i*3})})]}):null,me?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("clipPath",{id:`${l}up`,children:(0,A.jsx)("rect",{x:-a,y:-i,width:a*3,height:i+dt})}),(0,A.jsx)("clipPath",{id:`${l}dn`,children:(0,A.jsx)("rect",{x:-a,y:dt,width:a*3,height:i*2})})]}):null]}):null,children:[e.yLabel&&Dn?(0,A.jsx)(pe,{x:Ln,y:6,anchor:"start",size:10.5,fill:o.paint("muted"),children:e.yLabel}):null,(0,A.jsx)(ca,{p:o,ticks:Nr,y:Q,x0:Ln,x1:ge+4,fmt:Fr,locale:r.locale,labels:Dn}),(0,A.jsx)(aa,{list:e.annotations,g:_n}),me?(0,A.jsx)("line",{x1:Se,x2:ge,y1:dt,y2:dt,stroke:o.paint("dim"),pointerEvents:"none"}):null,Ue?.map((g,y)=>(0,A.jsx)("line",{x1:Se,x2:ge,y1:Q(g.y),y2:Q(g.y),stroke:o.paint("dim"),strokeDasharray:"3 3"},y)),(0,A.jsx)("rect",{x:Se,y:Oe,width:Math.max(0,ge-Se),height:Math.max(0,i-Xe-Oe),fill:"transparent"}),Gr,Hn,(0,A.jsx)(sa,{list:e.annotations,g:_n}),ue!==null&&b.keys[ue]!==void 0?(0,A.jsx)(ma,{p:o,x:$e(ue),top:Oe,bottom:i-Xe,dots:b.series.flatMap((g,y)=>{let T=E?E.y1[y][ue]:b.values[y][ue];return Number.isFinite(T)?[{k:y,y:Q(T),color:Lr(y,T),strong:_.has(y)}]:[]})}):null,Ue?.map((g,y)=>g.label?(0,A.jsxs)("g",{pointerEvents:"none",children:[(0,A.jsx)("rect",{x:ge-ae(g.label,10.5)-8,y:Q(g.y)-17,width:ae(g.label,10.5)+8,height:15,rx:5,fill:o.paint("panel"),opacity:.94}),(0,A.jsx)(pe,{x:ge-4,y:Q(g.y)-9.5,anchor:"end",size:10.5,fill:o.paint("muted"),children:g.label})]},`rl${y}`):null),Ci.map(g=>(0,A.jsx)(pe,{x:ge+8,y:g.ly,size:11,weight:g.d.hi?800:500,fill:o.paint(g.d.hi?"ink":"muted"),opacity:_r.fade(Mi*.75,300),children:Ve(g.d.name,Rr-10,11,g.d.hi?800:500)},g.d.name)),Hr,e.showXAxis===!1?null:(0,A.jsx)(Yl,{c:r,model:b,xs:$e,x0:Se,x1:ge,y:i-Xe+13,domain:kt,fixed:e.xTicks}),ue!==null&&b.keys[ue]!==void 0&&!tt.dragging?(0,A.jsx)(da,{p:o,x:$e(ue),y:i-Xe+13,label:b.labels[ue],width:a}):null]})}function Pn(e){return(0,A.jsx)(ql,{...e,kind:"area"})}var Zl=L(ee(),1);var Cr=L(G(),1);var Qa=e=>e?"neutralStrong":"accent";var Mr=L(G(),1);function ei(e,t,n,r){if(typeof e!="function")return Ke(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((i,s)=>[i,s])),a=new Set;return t.forEach((i,s)=>{let l=o.get(r(i,s));l!==void 0&&e(i,s)&&a.add(l)}),a}var Jl=L(ee(),1);var Sr=L(G(),1),Ql={name:"Candlestick chart",open:"Open",high:"High",low:"Low",close:"Close",change:"Change",volume:"Volume",empty:"No data.",ohlc:(e,t,n,r)=>`open ${e}, high ${t}, low ${n}, close ${r}`,span:(e,t,n)=>`${e} to ${t}: ${n}`,desc:(e,t,n,r,o)=>`${e} to ${t}, ${Re(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},ti={en:Ql,ko:{name:"캔들스틱",open:"시가",high:"고가",low:"저가",close:"종가",change:"등락률",volume:"거래량",empty:"데이터가 없어요.",ohlc:(e,t,n,r)=>`시가 ${e}, 고가 ${t}, 저가 ${n}, 종가 ${r}`,span:(e,t,n)=>`${e}부터 ${t}까지 ${n}`,desc:(e,t,n,r,o)=>`${e}부터 ${t}까지 ${n}개 봉. 첫 시가 ${r}, 마지막 종가 ${o}`,ma:e=>`${e}일선`,up:"상승",down:"하락",maLegend:e=>`${e}일 이동평균`}},Tr=["ink","muted","dim"];function ni(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Tr.length)}var eu=L(ee(),1);var si=L(G(),1),tu={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Re(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},nu={en:tu,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},ri=(e,t)=>nu[e].other(t);function oi(e,t,n){if(typeof t!="number"||!(t>=1)||e.length<=t+1)return{kept:e,other:null};let r=new Set(e.map((a,i)=>({v:a.value,i})).sort((a,i)=>i.v-a.v).slice(0,Math.floor(t)).map(a=>a.i)),o=e.filter((a,i)=>!r.has(i));return{kept:e.filter((a,i)=>r.has(i)),other:n(o.length,Xo(o.map(a=>a.value)))}}var ai=e=>Number.isFinite(e)&&e>0?e:0;function ii(e,t,n,r){return r==="emphasis"?ho(e,t,n):je(e,t,n)}var ru=L(ee(),1);var mi=L(G(),1);function li(e,t){return t===!1?e.map((n,r)=>r):Uo(e)}function ui(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return Ke(e,t,t,r,"max")}function ci(e,t,n){let r=new Array(t.length),o=t.filter(a=>!n.has(a));for(let a of t)n.has(a)&&(r[a]=de(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?de(e,"neutral"):en(e,1-i/Math.max(1,o.length-1))),r}var Qe=L(G(),1);function di(e,t){let n=dn(e);return n?.type==="scatter"&&t?.size!==void 0?dn("bubble"):n}function au(e,t={}){let n={};for(let r of e.encoding){let o=t[r.name];o!==void 0&&(n[r.prop??r.name]=o)}return n}function iu(e,t,n,r=!1){let o=di(e.type,e.encoding);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&cr.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),u=c=>c.filter(m=>!l.has(m.label)),d=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(d.includes(o.type)){let c=Ft(a.label,"label"),m=gt(a.value,"value"),h=o.type==="waffle",f=t.map((b,v)=>({r:b,label:c(b,v),value:h?m(b,v):ai(m(b,v))})),{kept:p,other:x}=h?{kept:f,other:null}:oi(f,i.other,(b,v)=>({r:{},label:ri(te(n),b),value:v})),k=Ke(s,p.map(b=>b.r),p.map(b=>b.label),p.map(b=>b.value),h?"first":"max"),$=x?[...p,x]:p,S=It(b=>h?je(b,$.length,k):ii(b,$.length,k,i.colorMode));return $.map((b,v)=>({label:b.label,color:S[v]}))}if(o.type==="candlestick"){let c=ni(Array.isArray(i.ma)?i.ma:void 0,t.length),m=ti[te(n)];return[{label:m.up,color:i.upColor??"accent"},{label:m.down,color:i.downColor??"neutralStrong"},...c.map((h,f)=>({label:m.maLegend(h),color:Tr[f],shape:"line"}))]}if(o.type==="scatter"){if(typeof a.series!="string")return[];let c=Ft(a.series,"series"),m=it(t.map((p,x)=>c(p,x)));if(m.length<2)return[];let h=ei(s,t,m,c),f=It(p=>fo(p,m.length,h));return u(m.map((p,x)=>({label:p,color:f[x],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let c=[];if(Array.isArray(a.y))c=a.y;else if(typeof a.series=="string"){let S=Ft(a.series,"series");c=it(t.map((b,v)=>S(b,v)))}let m=mr(o.type,a,i);if(m.length){let S=Ke(s,c,c,c.map(()=>0),"none"),b=It(O=>je(O,c.length,S)),v=c.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:c.map((O,E)=>({label:O,color:b[E]}));return[...u(v),...m.map((O,E)=>({label:O,color:Qa(E),shape:"line"}))]}if(c.length<2)return[];let f=o.type==="bar"&&i.layout==="diverging"&&s===void 0?Ko(c.length,Array.isArray(i.negative)?i.negative.map(S=>c.indexOf(String(S))):[],typeof i.neutral=="string"?c.indexOf(i.neutral):-1):-1,p=f>=0?new Set([f]):Ke(s,c,c,c.map(()=>0),"first");if(o.type==="radar")return u(c.map((S,b)=>({label:S,color:p.has(b)?"accent":"neutralStrong",shape:"square"})));let x=i.colorMode,k=S=>je(S,c.length,p);if((o.type==="line"||o.type==="area")&&(k=S=>$r(S,c.length,p,o.type==="area",x)),o.type==="stream"){let S=yt(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),b=li(S.values,i.reorder),v=ui(s,S.series,S.values);k=O=>ci(O,b,v)}let $=It(k);return u(c.map((S,b)=>({label:S,color:$[b],...o.type==="line"&&{shape:"line"}})))}return[]}function su(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Io.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function lu(e,t,n){let{data:r,width:o,height:a,highlight:i,syncId:s,ariaLabel:l,description:u,...d}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:d,width:o,height:a,highlight:i,syncId:s,title:l,description:u}}function fi(e,t){let{spec:n}=e,r=di(n.type,n.encoding),o=(0,Kt.useMemo)(()=>Da(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=_o(n,e.locale),s=xe(i),l=te(s),u=Ca(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),d=zo(n),c=(0,Kt.useMemo)(()=>d?Pa(d,s):void 0,[d,s]),m=n.options?.hidden,h=Array.isArray(m)?m.map(String):[],f=h.join(""),[p,x]=(0,Kt.useState)(null);if(!r)return(0,Qe.jsx)(lr,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let k=o??u.data,$=t[r.type],S={...n.options??{}},b={...au(r,n.encoding),...S,...c?{tooltip:c}:{},data:k,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.animate!==void 0?{animate:e.animate}:{},...e.replayKey!==void 0?{replayKey:e.replayKey}:{},...e.onHover?{onHover:e.onHover}:{},...e.onClick?{onClick:e.onClick}:{},locale:i},v=n.card?.legend==="toggle"&&Bo(r.type,n.encoding??{},S),O=p&&p.base===f?p.hidden:h;v&&(b.hidden=O);let E=F=>x(N=>{let w=N&&N.base===f?N.hidden:h;return{base:f,hidden:w.includes(F)?w.filter(P=>P!==F):[...w,F]}}),H=b.height??220,j=su(n,r.type),z=a&&!k.length&&(u.loading||u.error||u.empty)?(0,Qe.jsx)(lr,{loading:u.loading,error:u.error,empty:u.empty,onRetry:u.reload,height:H,locale:i}):j?(0,Qe.jsx)($a,{chart:$,...lu(r.type,j,b)}):(0,Qe.jsx)($,{...b});if(n.card){let F=n.card,N=F.legend==="auto"||F.legend==="toggle"?iu(n,k,s,v):F.legend,w=N?.length?v?(0,Qe.jsx)(sr,{items:N,hidden:O,onToggle:E,locale:i}):N:void 0,P=F.download?(0,Qe.jsx)(Na,{data:k,columns:Ho(n),filename:F.title??r.type,formats:Array.isArray(F.download)?F.download:void 0,locale:i}):void 0;z=(0,Qe.jsx)(No,{number:F.number,title:F.title??Eo(r,l),subtitle:F.subtitle,legend:w,actions:P,source:F.source||void 0,note:F.note||void 0,accent:F.accent,takeaway:F.takeaway,level:F.level,sample:F.sample,replay:F.replay!==!1,className:e.className,locale:i,children:z})}let I=e.theme??n.theme;return I&&(z=(0,Qe.jsx)(sn,{theme:I,children:z})),z}function uu({cfg:e,components:t}){let n=Pt();return fi({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function gi(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,hi.hydrateRoot)(r,(0,Ar.createElement)(sn,{theme:o.theme,cssVars:!0},(0,Ar.createElement)(uu,{cfg:o,components:{[e]:t}})))}gi("area",Pn);})();
|