ztd-charts-cli 0.5.0 → 0.6.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/dist/api.d.ts +23 -1
- package/dist/api.js +5 -1
- package/dist/{chunk-LVCEIXBR.js → chunk-4K4P2AWW.js} +50 -19
- package/dist/cli.js +2 -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/treemap.js +28 -0
- package/dist/client/waffle.js +28 -0
- package/dist/client/waterfall.js +28 -0
- package/package.json +3 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
(()=>{var jr=Object.create;var rn=Object.defineProperty;var Vr=Object.getOwnPropertyDescriptor;var Wr=Object.getOwnPropertyNames;var Kr=Object.getPrototypeOf,Gr=Object.prototype.hasOwnProperty;var xt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Ur=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wr(t))!Gr.call(e,o)&&o!==n&&rn(e,o,{get:()=>t[o],enumerable:!(r=Vr(t,o))||r.enumerable});return e};var A=(e,t,n)=>(n=e!=null?jr(Kr(e)):{},Ur(t||!e||!e.__esModule?rn(n,"default",{value:e,enumerable:!0}):n,e));var Y=xt((Va,on)=>{on.exports=globalThis.__ztdReact.react});var sn=xt((Wa,an)=>{an.exports=globalThis.__ztdReact["react-dom/client"]});var z=xt((ti,Nn)=>{Nn.exports=globalThis.__ztdReact["react/jsx-runtime"]});var Jt=A(Y(),1),Er=A(sn(),1);var je=A(Y(),1);var ot=A(Y(),1);var ln=A(Y(),1),Ke=(0,ln.createContext)(void 0);var dn=A(Y(),1);var Yr=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],cn='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',un='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',we={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:cn,monoFamily:un,radius:18,radiusCode:14,radiusMark:4},qr={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:cn,monoFamily:un,radius:18,radiusCode:14,radiusMark:4},kt={dark:we,light:qr};function vt(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function wt(e){let t={};for(let n of Yr){let r=e[n];typeof r=="string"&&(t[vt(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 Ct(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 Xr=`
|
|
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,${we.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,${we.accent});outline-offset:2px}
|
|
13
|
+
.ztd-card{transition:border-color .16s ease}
|
|
14
|
+
.ztd-card:hover{border-color:var(--ztd-dim,${we.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 fn(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 hn(e,t){let[n]=(0,dn.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var mn=!1;function Oe(){if(mn||typeof document>"u"||(mn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=Xr,document.head.appendChild(e)}var Ge=A(Y(),1),ye=typeof window<"u"&&typeof document<"u",pe=ye?Ge.useLayoutEffect:Ge.useEffect;function Ue(){return typeof performance<"u"?performance.now():Date.now()}function Q(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Fe(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var gn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},pn={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Jr=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],Zr={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Qr(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function eo(e){return Qr(Jr,e)}function bn(e,t){let n=eo(e);return{text:n?n[t]:e,...Zr[n?.id??"basic"]}}var ue=A(Y(),1);var wn=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),xe="en-US",yn=new Map;function $t(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=yn.get(r);return o||(o=new Intl.NumberFormat(e,n),yn.set(r,o)),o}function Mt(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function St(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=xe,...r}=t;return Mt($t(n,r).format(e))}var Cn=e=>e!==0&&Math.abs(e)<.05,$n=(e,t,n="")=>`${St(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function Ye(e,t={}){if(!Number.isFinite(e))return"-";if(Cn(e)&&t.maximumFractionDigits===void 0)return $n(e,t.locale??xe,"%");let n=Math.abs(e);return`${St(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function to(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=xe,...r}=t;if(Q(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],c=o/s,b=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**b)/10**b;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+St(u,{locale:n,...r,maximumFractionDigits:b})+l}}return Mt($t(n,{notation:"compact",...r}).format(e))}var no=(e,t=Q(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function qe(e,t=xe,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=$t(t,o);return l=>Number.isFinite(l)?`${i}${Mt(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=>Ye(o,{locale:t});case"ratio":return o=>Ye(o*100,{locale:t});case"compact":return o=>to(o,{locale:t});case"currency":return r(no(t));default:{let o=r({maximumFractionDigits:1});return a=>Cn(a)?$n(a,t):o(a)}}}function ro(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var oo=e=>Number.isInteger(e)&&e>=1e3&&e<=9999;var ao=["january","february","march","april","may","june","july","august","september","october","november","december"],xn=e=>{let t=e.toLowerCase();return t.length<3?0:ao.findIndex(n=>n.startsWith(t))+1},kn=e=>+e+(+e<30?2e3:1900);function Xe(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var io=[/^(\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})일)?$/],Mn=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Sn=/\{([^{}]+)\}/g;function so(e,t){let n;for(let r of io)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?[kn(n[3]),+n[2],+n[1],1]:[kn(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=Mn.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=xn(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=xn(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}function Tn(e){let t;for(let n of e){let r=typeof n=="string"?Mn.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function Je(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(oo(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return Je(`${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=so(n,t);if(r)return ro(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 vn=new Map;function Ze(e,t={month:"short",day:"numeric"}){let n=Je(e);if(!n)return"-";let{locale:r=xe,...o}=t,a=r+JSON.stringify(o),i=vn.get(a);return i||(i=new Intl.DateTimeFormat(r,o),vn.set(a,i)),i.format(n)}var An={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ce(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),An[t.toLowerCase()]&&(t=An[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 At(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 Qe(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 Pe(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Rn(e){return .2126*Pe(e[0])+.7152*Pe(e[1])+.0722*Pe(e[2])}function Rt(e,t,n){let r=typeof e=="string"?Ce(e):e,o=typeof t=="string"?Ce(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?Ce(n):n:null;o[3]<1&&a&&(o=Qe(o,a));let i=r[3]<1?Qe(r,o):r,s=Rn(i),l=Rn(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function lo(e){return[Pe(e[0]),Pe(e[1]),Pe(e[2])]}function Tt(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 Dn(e){let[t,n,r]=lo(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 co([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[Tt(4.0767416621*o-3.3077115913*a+.2309699292*i),Tt(-1.2684380046*o+2.6097574011*a-.3413193965*i),Tt(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Dt(e,t,n){let r=Ce(e),o=Ce(t);if(!r||!o)return e;let a=Dn(r),i=Dn(o),s=Math.max(0,Math.min(1,n));return At(co([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 Nt(e,t,n){let r=t[0],o=-1;for(let a of t){let i=Rt(a,e,n);i>o&&(o=i,r=a)}return r}var Ft=A(z(),1),et=(0,ue.createContext)({theme:we,cssVars:!0});function uo(e,t=we){return e?typeof e=="string"?kt[e]??t:Ct(t,e):t}function nt(e){let t=(0,ue.useContext)(et),n=e.base?kt[e.base]:t.theme,r=(0,ue.useMemo)(()=>uo(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,ue.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,ue.useMemo)(()=>wt(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Ft.jsx)(et.Provider,{value:i,children:(0,Ft.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var mo=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function tt(e){return mo.has(e)}function fo(e,t){let n=r=>t?`var(${vt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?tt(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?tt(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)})`:Dt(e[r],e[o],a)}}}function ke(e){let t=(0,ue.useContext)(et);return(0,ue.useMemo)(()=>{let n=Ct(t.theme,e);return fo(n,t.cssVars)},[t.theme,t.cssVars,e])}function me(e){let t=(0,ue.useContext)(et);return e??t.locale??xe}function Fn(e){return e?wt(e):{}}var rt=A(Y(),1),Pt=(0,rt.createContext)(void 0);function Pn(e){let t=(0,rt.useContext)(Pt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var x=A(z(),1),ho={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`},go={en:ho,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var po={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Lt=e=>go[Q(me(e))];function Et(e){let t=ke(e.theme),n=Lt(e.locale),[r,o]=(0,ot.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(b=>!s.has(b.label)).length,c=(0,x.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((b,u)=>{let f=!s.has(b.label),m=f&&l===1,d=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(bo,{p:t,item:b,off:!f}),(0,x.jsx)("span",{style:f?void 0:{textDecoration:"line-through"},children:b.label})]});return(0,x.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,x.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":f,"aria-disabled":m||void 0,onClick:()=>{m||(i(b.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:m?"default":void 0},children:d}):d},u)})});return i?(0,x.jsxs)(x.Fragment,{children:[c,(0,x.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:po,children:r?n.shown(l,e.items.length):""})]}):c}function bo({p:e,item:t,off:n}){let r=t.color?tt(t.color)?e.paint(t.color):t.color:e.paint("neutral"),o=t.shape??"square";return o==="line"||o==="dash"?(0,x.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,x.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,x.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,x.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 yo(e){let t=ke(e.theme),n=bn(e.level,Q(me(e.locale)));return(0,x.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 xo(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,x.jsxs)(x.Fragment,{children:[e.slice(0,r),(0,x.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function Ln(e){let t=ke(e.theme),n=Lt(e.locale),[r,o]=(0,ot.useState)(0);pe(()=>Oe(),[]);let a=()=>{o(f=>f+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,x.jsx)(Et,{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,c=e.replay||e.onReplay,b=e.source!==void 0||e.note!==void 0?(0,x.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,u=e.takeaway!==void 0||e.level||e.sample?(0,x.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,x.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,x.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,x.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,x.jsx)(yo,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,x.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,x.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,x.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,x.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:xo(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,x.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,x.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,x.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,x.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,x.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,x.jsx)("span",{}),i]}):null]}),(0,x.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,x.jsx)(Pt.Provider,{value:r,children:(0,x.jsx)(Ke.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),b?(0,x.jsxs)(x.Fragment,{children:[b,u]}):u]})}function _t(e){let t=ke(e.theme),n=Lt(e.locale),r=e.height??220;if(pe(()=>Oe(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,x.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,x.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,x.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,x.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,x.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,x.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,x.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,x.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,x.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,x.jsx)(x.Fragment,{children:e.children})}function $e(e,t,n,r,o="max"){let a=new Set,i=n.length,s=c=>{if(i&&c!=="none"){if(c==="first")a.add(0);else if(c==="last")a.add(i-1);else if(c==="max"||c==="min"){let b=-1,u=c==="max"?-1/0:1/0;r.forEach((f,m)=>{Number.isFinite(f)&&(c==="max"?f>u:f<u)&&(u=f,b=m)}),b>=0&&a.add(b)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((c,b)=>{b<i&&c!==null&&c!==void 0&&e(c,b)&&a.add(b)}),a;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<i&&a.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((b,u)=>{b===c&&a.add(u)});return a}function ko(e,t,n){let r=Ce(e),o=Ce(t);return!r||!o?e:At(Qe([r[0],r[1],r[2],n],o))}function vo(e,t){let n=Nt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Rt(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Nt(t,["#FFFFFF","#000000"])}function Be(e,t){let n=new Array(e),r=[];for(let a=0;a<e;a++)t.has(a)?n[a]="accent":r.push(a);let o=r.length;return r.forEach((a,i)=>{o===1?n[a]="neutral":i===0?n[a]="ink":i===o-1?n[a]="neutral":n[a]="neutralStrong"}),n}function En(e,t){return Be(e+1,t).slice(0,e)}function wo(e,t,n=.1,r="accent"){let o=Math.max(0,Math.min(1,t)),a=n+(1-n)*o,i=ko(e.theme[r],e.theme.panel,a);return{fill:e.paint(r),opacity:a,text:vo(e,i),raw:i}}function It(e,t){let n=t.reverse?t.center===void 0?1-e:-e:e;if(t.steps){let r=t.center===void 0?0:-1,o=Math.max(0,Math.min(t.steps-1,Math.floor((n-r)/(1-r)*t.steps)));n=r+(1-r)*o/(t.steps-1)}return n}function _n(e,t,n,r){let o=It(t,r);return wo(e,Math.abs(o),n,o<0?"neutralStrong":"accent")}function In(e,t,n){return{reverse:e,center:t,steps:n===void 0?void 0:Math.max(2,Math.min(12,Math.round(n)))}}function On(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function Co(e,t){if(e==null||typeof e!="object")return;let n=e;if(On(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!On(r,o))return;r=r[o]}return r}}function ze(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=>Co(r,n)}function it(e,t){let n=at(e,t);return(r,o)=>ze(n(r,o))}function st(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 Ot(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var se=A(Y(),1);function $o(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
|
|
23
|
+
`||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,a=[","," ",";","|"],i=",",s=0;for(let l of a){let c=o(l);c>s&&(s=c,i=l)}return i}var Mo=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Bn(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(Mo.test(t)||/^[-+]?\.\d+$/.test(t)){let n=ze(t);if(Number.isFinite(n))return n}return t}function De(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??$o(o),i=[],s=[],l="",c=!1;for(let d=0;d<o.length;d++){let g=o[d];c?g==='"'?o[d+1]==='"'?(l+='"',d++):c=!1:l+=g:g==='"'&&!l.trim()?(c=!0,l=""):g===a?(s.push(l),l=""):g===`
|
|
24
|
+
`||g==="\r"?(g==="\r"&&o[d+1]===`
|
|
25
|
+
`&&d++,s.push(l),i.push(s),s=[],l=""):l+=g}(l!==""||s.length)&&(s.push(l),i.push(s));let b=i.filter(d=>!(d.length===1&&d[0].trim()===""));if(!b.length)return[];let u=d=>n?Bn(d):d;if(!r)return b.map(d=>Object.fromEntries(d.map((g,S)=>[String(S),u(g)])));let f=[],m=new Set;return b[0].forEach((d,g)=>{let S=d.trim()||`col${g+1}`,k=S;for(let v=2;m.has(k);v++)k=`${S}_${v}`;m.add(k),f.push(k)}),b.slice(1).map(d=>Object.fromEntries(f.map((g,S)=>[g,u(d[S]??"")])))}function Bt(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"?Bn(i[l]):i[l]??null])))}function So(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(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function zn(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 Me(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Me(JSON.parse(t))}catch{}return De(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?Bt(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)?Me(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?Bt(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)?Me(t.rows):Array.isArray(t.values)?Bt(t.values):Array.isArray(t.items)?Me(t.items):Array.isArray(t.results)?Me(t.results):So(t)}return[]}function Hn(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)}`}async function To(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(Q(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return De(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 De(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):De(a)}async function Ao(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 To(a,t.parse,o,t.locale)}return t.select&&(r=zn(r,t.select)),t.transform?t.transform(r):Me(r)}function jn(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,se.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,se.useState)(0),c=me(t.locale),b=(0,se.useRef)(t);b.current={...t,locale:c};let u=(0,se.useRef)(e);u.current=e;let f=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",m=t.deps??[],d=JSON.stringify(m.map(k=>typeof k=="object"?JSON.stringify(k):String(k))),g=(0,se.useRef)(!1);(0,se.useEffect)(()=>{let k=u.current;if(!k||!r){i(y=>y.status==="loading"?{...y,status:"idle"}:y);return}let v=new AbortController,D=!0;return g.current=!0,i(y=>({...y,data:o?y.data:[],status:"loading",error:null})),Ao(k,{...b.current,signal:v.signal}).then(y=>{D&&i({data:y,status:"success",error:null,updatedAt:Date.now()})}).catch(y=>{!D||v.signal.aborted||i(T=>({...T,status:"error",error:y instanceof Error?y:new Error(String(y))}))}).finally(()=>{D&&(g.current=!1)}),()=>{D=!1,g.current=!1,v.abort()}},[f,r,s,d,o]),(0,se.useEffect)(()=>{if(!n||!r)return;let k=setInterval(()=>{g.current||l(v=>v+1)},n);return()=>clearInterval(k)},[n,r]);let S=(0,se.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:S}}var Ht=A(z(),1),Ro=["csv","svg","png"],Do=/^[=+\-@\t\r\n=+-@]/,No=/var\(|color-mix\(/;function Vn(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?Xe(e.getTime()):String(e);return`"${(Do.test(t)&&!Number.isFinite(ze(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Fo(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Po(e,t){return`\uFEFF${[t.map(Vn),...e.map(r=>t.map(o=>Vn(r[o])))].map(r=>r.join(",")).join(`\r
|
|
26
|
+
`)}\r
|
|
27
|
+
`}function Lo(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function zt(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var Wn=2,Se=16;function Kn(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 Gn(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 Un(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+Se*2,i+Se*2],c=o.cloneNode(!0),b=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((d,g)=>{let S;for(let k of Array.from(d.attributes)){if(!No.test(k.value))continue;let v=(S??(S=getComputedStyle(d))).getPropertyValue(k.name);v&&b[g].setAttribute(k.name,Kn(v,u))}}),c.removeAttribute("style");for(let[d,g]of Object.entries({viewBox:`${-Se} ${-Se} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(d,String(g));let f=Kn(getComputedStyle(r).backgroundColor,u),m=o.parentElement?.querySelector("canvas")??null;if(n){let d=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(Gn("rect",{x:-Se,y:-Se,width:s,height:l,fill:f}),d),m&&c.insertBefore(Gn("image",{href:m.toDataURL(),width:a,height:i}),d)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:a,vh:i,bg:f,canvas:m}}function Eo(e,t){let n=Un(e,Wn,!1);if(!n)return;let r=Wn,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,Se*r,Se*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&&zt(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function Yn(e){let t=ke(e.theme),n=Q(me(e.locale))==="ko",r=Lo(e.filename),o=(a,i)=>{if(a==="csv")return zt(new Blob([Po(e.data,e.columns?.length?e.columns:Fo(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return Eo(i,r);let s=Un(i,1,!0);s&&zt(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,Ht.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Ro.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,Ht.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 Xn=A(z(),1);function qn(e,t=xe){let n=qe(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?Ze(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,c=s.replace(Sn,(b,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,Xn.jsx)("div",{children:s},l)):null}}var h=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),de=h("label","string",!0,"Item name field"),ne=h("value","number",!0,"Value field"),_o=[de,ne],Io=[de,ne],Oo=[h("label","string",!0,"Stage name"),h("value","number",!0,"Users at the stage")],Bo=[de,ne],zo=[h("label","string",!0,"Leaf (lowest level) name"),ne,h("group","string",!1,"Parent group field")],Ho=[h("label","string",!0,"Leaf name"),ne,h("group","string",!1,"Parent group field")],jo=[de,h("value","number",!0,"Change (total rows may omit it)"),h("type","string",!1,'"total" makes a total bar')],Vo=[de,ne],Wo=[h("x","string",!0,"Column field"),h("series","string",!0,"Stacked series field"),ne],Ko=[h("x","string",!0,"Column field"),h("y","string",!0,"Row field"),ne],Go=[h("axis","string",!0,"Metric (axis) field"),h("value","number",!0,"Value field",{multi:!0}),h("series","string",!1,"Series field")],Uo=[h("x","number",!0,"x value"),h("y","number",!0,"y value"),h("size","number",!1,"Circle size"),h("label","string",!1,"Name")],Zn=h("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),Yo=[h("x","any",!0,"x field (date, number or category)"),h("y","number",!0,"y field. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field (long tables)"),h("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Zn],qo=[h("x","any",!0,"x field"),h("y","number",!0,"y field. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field"),h("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}),Zn],Xo=[h("x","any",!0,"x field"),h("y","number",!0,"y field",{multi:!0}),h("series","string",!1,"Series field")],Jo=[h("x","string",!0,"Category field"),h("y","number",!0,"Value field. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field"),h("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})],Zo=[de,ne],Qo=[h("value","number",!0,"Value field",{prop:"valueKey"}),h("target","number",!1,"Target field",{prop:"targetKey"})],ea=[de,h("value","number",!0,"Actual value field"),h("target","number",!1,"Target field")],ta=[h("x","any",!1,"x field"),h("y","number",!0,"y field")],na=[de,h("x","string",!1,"Period field (long tables)"),h("value","number",!1,"Value field (long tables)")],ra=[de,h("start","number",!0,"Before value"),h("end","number",!0,"After value")],oa=[de,ne],aa=[h("value","number",!0,"Value field"),h("group","string",!1,"Group (row) field"),h("label","string",!1,"Dot name")],ia=[h("group","string",!0,"Group field"),h("value","number",!0,"Value field")],sa=[h("source","string",!0,"Source node"),h("target","string",!0,"Target node"),ne],la=[h("source","string",!0,"Sending group"),h("target","string",!0,"Receiving group"),ne],ca=[h("date","date",!0,"Date field"),ne],ua=[h("x","any",!0,"Period field"),h("series","string",!0,"Item field"),h("rank","number",!1,"Rank field (1 is first)"),h("value","number",!1,"Value field (instead of rank, largest is first)")],ma=[h("group","string",!0,"Group field"),h("value","number",!0,"Value field")],da=[h("label","string",!1,"Row name field")],fa=[h("x","date",!0,"Date (period) field"),h("open","number",!0,"Open price field"),h("high","number",!0,"High price field"),h("low","number",!0,"Low price field"),h("close","number",!0,"Close price field"),h("volume","number",!1,"Volume field")],ha=[de,ne],ga=[h("x","any",!0,"Period field (date or category)"),h("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),h("series","string",!1,"Series field (long tables, back row only)"),h("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],pa=[h("value","number",!1,"Sample value field (raw rows)"),h("group","string",!1,"Group field. Up to 2 groups overlap"),h("x0","number",!1,"Bin start (pre-binned rows)"),h("x1","number",!1,"Bin end (pre-binned rows)"),h("count","number",!1,"Samples in the bin (pre-binned rows)")],ba=[h("x","number",!0,"x value"),h("y","number",!0,"y value"),h("series","string",!1,"Series field (one color per series)"),h("label","string",!1,"Name")],Jn={pie:_o,donut:Io,funnel:Oo,waffle:Bo,treemap:zo,sunburst:Ho,waterfall:jo,pareto:Vo,marimekko:Wo,heatmap:Ko,radar:Go,bubble:Uo,line:Yo,area:qo,stream:Xo,bar:Jo,radialBar:Zo,gauge:Qo,bullet:ea,sparkline:ta,slope:na,dumbbell:ra,lollipop:oa,beeswarm:aa,ridgeline:ia,sankey:sa,chord:la,calendar:ca,bump:ua,box:ma,parallel:da,candlestick:fa,segmented:ha,skyline:ga,histogram:pa,scatter:ba},Le={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:"산점도"}};function Qn(e,t){return t==="ko"?e.nameKo:e.name}function er(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var jt=["line","area","bar","scatter"];function Vt(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"?[].concat(t.line??[]).map(String):[]}function tr(e,t,n){return jt.includes(e)&&!Vt(e,t,n).length}function nr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var ya={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"};function lt(e){let t=Jn[e]?e:ya[e]??Object.keys(Le).find(n=>n.toLowerCase()===e.toLowerCase()||Le[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!Le[t]))return{type:t,component:Le[t].component,name:Le[t].name,nameKo:Le[t].nameKo,encoding:Jn[t]}}function rr(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 lt(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]}var xa=Math.PI*2;function or(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ar(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 De(t.csv)}return null}var oe=A(Y(),1);var L=A(z(),1),ct=60;var ir={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function sr(e){let{c:t,events:n}=e,r=(0,oe.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,pe(()=>{Oe()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,oe.useContext)(Ke),c=e.ariaLabel??l??e.kind,b=(0,oe.useMemo)(()=>s?`${n.length}${n.slice(0,ct).map(w=>`${w.label}${w.series??""}${w.formatted??w.value??""}`).join("")}`:"",[n,s]),u=(0,oe.useMemo)(()=>(0,L.jsx)(ka,{label:c,events:n,t:t.t}),[c,b,t.t]),f=(0,oe.useRef)(null);(0,oe.useEffect)(()=>{let w=()=>{f.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,oe.useEffect)(()=>{f.current=null},[t.width,t.height]);let m=w=>{if(w.target!==w.currentTarget)return;if(e.onKey?.(w)){w.preventDefault();return}let O=t.active,j;switch(w.key){case"ArrowRight":case"ArrowDown":j=O===null?0:(O+1)%i;break;case"ArrowLeft":case"ArrowUp":j=O===null?i-1:(O-1+i)%i;break;case"Home":j=0;break;case"End":j=i-1;break;case"Escape":if(O===null)return;j=null;break;case"Enter":case" ":O!==null&&(w.preventDefault(),t.click(O));return;default:return}w.preventDefault(),t.setActive(j,"keyboard")},{via:d,node:g,setActive:S}=t;(0,oe.useEffect)(()=>{if(d!=="touch"||!g)return;let w=O=>{g.contains(O.target)||S(null)};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[d,g,S]);let k=t.active!==null?n[t.active]:null,v=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,D=v&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,y=typeof e.renderTip=="function"&&k?e.renderTip(k):null,T=e.announce??(t.via==="keyboard"&&k?`${k.label}${k.series?` ${k.series}`:""}: ${k.formatted??k.value??""} (${(t.active??0)+1}/${i})`:""),H;if(v){let w=v.x*D,O=t.width*D,j=`clamp(${(4-w).toFixed(1)}px, -50%, calc(${(O-w-4).toFixed(1)}px - 100%))`,be=v.y<64;H={position:"absolute",left:w,top:v.y*D,transform:`translate(${j}, ${be?"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*D-8)}}let F=w=>{f.current=null,w.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},E=w=>w?O=>{let j=f.current??(f.current=O.currentTarget.getBoundingClientRect());j.width&&w((O.clientX-j.left)/j.width*t.width,(O.clientY-j.top)/j.height*t.height,O)}:void 0,q=E(e.onPointerMove),_=E(e.onPointerDown),M=q||_?w=>{w.pointerType==="touch"&&q?.(w),_?.(w)}:void 0,N=E(e.onPointerUp),X=Fn(e.theme);return(0,L.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":c,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?m:void 0,onBlur:w=>{t.via==="keyboard"&&!w.currentTarget.contains(w.relatedTarget)&&t.setActive(null)},onPointerLeave:F,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"),...X,...e.style},children:[t.pending?null:e.underlay,(0,L.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:q,onPointerDown:M,onPointerUp:N,onPointerCancel:N,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,L.jsx)("title",{id:o,children:c}),(0,L.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,L.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,v?(0,L.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:H,children:y??(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{style:{fontWeight:600,fontSize:11.5,color:t.p.paint("muted"),marginBottom:v.rows.length?4:0,overflow:"hidden",textOverflow:"ellipsis"},children:v.title}),v.rows.map((w,O)=>(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,L.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(w.strong?"ink":"muted")},children:[w.color?(0,L.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,L.jsx)("span",{style:{fontWeight:w.strong===!1?500:700},children:w.value})]},O))]})}):null,(0,L.jsx)("span",{className:"ztd-sr",style:ir,"aria-live":"polite","aria-atomic":"true",children:T}),s&&!t.pending?u:null]})}function ka({label:e,events:t,t:n}){return(0,L.jsx)("div",{className:"ztd-sr",style:ir,children:(0,L.jsxs)("table",{children:[(0,L.jsx)("caption",{children:n.table(e)}),(0,L.jsxs)("tbody",{children:[t.slice(0,ct).map((r,o)=>(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,L.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>ct?(0,L.jsx)("tr",{children:(0,L.jsx)("td",{colSpan:2,children:n.more(t.length-ct)})}):null]})]})})}function ut(e){let t=e.baseline??"central";return(0,L.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})}function va(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function lr(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 mt=new Map;function cr(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=mt.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);va(c)?i+=lr(c):s+=lr(c)}a=i+s*(n>=600?1.07:1),mt.size>5e3&&mt.clear(),mt.set(o,a)}return a*t}function ur(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]}function Wt(e){let t=[];for(let n=0;n<e.length;n++)Number.isFinite(e[n])&&t.push(e[n]);return t.length?(t.sort((n,r)=>n-r),t.length<24?t[t.length-1]:t[Math.min(t.length-1,Math.floor(t.length*.95))]||t[t.length-1]):1}function Kt(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 G=A(Y(),1);var ae=A(Y(),1);function wa(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Ca(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function fr(e,t=!0){let[n,r]=(0,ae.useState)({visible:!t,near:!t});return(0,ae.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=Ca(i[i.length-1],.25);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:wa(.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 mr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function hr(e){let[t,n]=(0,ae.useState)(null),[r,o]=(0,ae.useState)(e??null),a=(0,ae.useCallback)(i=>{n(i),i&&e===void 0&&o(mr(i))},[e]);return pe(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=c=>o(b=>b!==null&&Math.abs(b-c)<.5?b:c),s=()=>i(mr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let b=c[c.length-1]?.contentRect;b?i(b.width>0?Math.round(b.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var $a=()=>()=>{};function dt(){return(0,ae.useSyncExternalStore)($a,()=>!0,()=>!1)}var dr="(prefers-reduced-motion: reduce)";function gr(e="auto"){let[t,n]=(0,ae.useState)(()=>ye&&typeof window.matchMedia=="function"?window.matchMedia(dr).matches:!1);return(0,ae.useEffect)(()=>{if(e!=="auto"||!ye||typeof window.matchMedia!="function")return;let r=window.matchMedia(dr),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}function pr(e,t){let n=ke(e.theme),[r,o,a]=hr(e.width),i=dt(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,b=gr(e.reducedMotion??"auto"),u=e.animate!==!1&&!b&&ye,f=fr(r,e.animateOnView!==!1&&u),m=me(e.locale),d=Q(m),g=(0,G.useMemo)(()=>qe(e.format,m,t.format),[e.format,m,t.format]),S=(0,G.useCallback)(U=>Ye(U,{locale:m}),[m]),k=(0,G.useMemo)(()=>wn(g,e.unit),[g,e.unit]),v=(0,G.useMemo)(()=>Hn(e.data),[e.data]),[D,y]=(0,G.useState)(null),[T,H]=(0,G.useState)(null),F=(0,G.useRef)([]),E=(0,G.useRef)(e.onHover);E.current=e.onHover;let q=(0,G.useRef)(e.onClick);q.current=e.onClick;let _=(0,G.useRef)(null),M=(0,G.useRef)(null),N=(0,G.useRef)(null),X=(0,G.useCallback)((U,fe="pointer")=>{if(N.current!==U){N.current=U;let Ve=U===null?null:F.current[U]??null;queueMicrotask(()=>E.current?.(Ve)),M.current?.(U)}_.current=U===null?null:fe,y(U),H(_.current)},[]),w=(0,G.useCallback)(U=>{_.current!=="keyboard"&&(_.current=U===null?null:"sync",y(U),H(_.current))},[]),O=(0,G.useCallback)(U=>{let fe=F.current[U];fe&&q.current?.(fe)},[]),j=Pn(e.replayKey),be=e.width!==void 0||(a??0)>0,pt={enabled:u,active:f.visible&&be,near:f.near,replayKey:j,dataKey:v,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},ve=(0,G.useCallback)((U,fe=1)=>D===null||D===U?fe:fe*.38,[D]);return{p:n,width:s,height:c,measured:be,responsive:e.width===void 0,pending:ye&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:pt,fv:k,fmt:g,pct:S,locale:m,lang:d,t:d==="ko"?pn:gn,active:D,via:T,setActive:X,click:O,events:F,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:ve,sig:v,description:e.description,reduced:b,publish:M,applySync:w}}var V=A(Y(),1);function Ma(e){return 1-Math.pow(1-e,3)}function Sa(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Ta(e){return e==="easeInOut"?Sa:e==="linear"?t=>t:Ma}function Aa(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 Ee(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 ft(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 br(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 yr(e,t,n,r){if(!t||!n||t.length!==n.length)return Ee(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 Ee(s,n[i]))o.push(l)}return o.length===r?o:Ee(e,r)}var ht=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||!ft(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),br(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=ft(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 c=i.to.length;s.from=yr(s.cur,s.parts,i.parts,c),s.vel=yr(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),br(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=ft(s.from,s.to)&&s.vel.every(b=>Math.abs(b)<1e-6),s.progress=s.done?1:0}else{let c=this.make(i,i.enter??i.from??i.to,n+l,0);c.done=ft(c.from,c.to),this.tracks.set(i.key,c)}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=Ee(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=Ta(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,c=s.to.length;if(s.from.length!==c&&(s.from=Ee(s.from,c)),s.vel.length!==c&&(s.vel=Ee(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let b;if(this.easing==="spring"){let u=Math.exp(-a*l),f=a*l>=8&&a*l<20,m=0;for(let d=0;d<c;d++){let g=s.from[d]-s.to[d],S=s.vel[d]+a*g;s.cur[d]=s.to[d]+(g+S*l)*u,s.curVel[d]=(s.vel[d]-a*S*l)*u,f&&m<.15&&(m=Math.max(m,Math.abs(s.cur[d]-s.to[d]),Math.abs(s.curVel[d]/a)))}b=a*l>=20||f&&m<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),f=r(u),m=Aa(this.easing,u)/o;for(let d=0;d<c;d++)s.cur[d]=s.from[d]+(s.to[d]-s.from[d])*f,s.curVel[d]=(s.to[d]-s.from[d])*m;b=u>=1,s.progress=f}if(b){for(let u=0;u<c;u++)s.cur[u]=s.to[u],s.curVel[u]=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}},He=new Set,gt=0;function xr(e){gt=0;let t=Array.from(He);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||He.delete(n)}He.size&&typeof requestAnimationFrame<"u"&&(gt=requestAnimationFrame(xr))}function kr(e){return He.add(e),!gt&&typeof requestAnimationFrame<"u"&&(gt=requestAnimationFrame(xr)),()=>{He.delete(e)}}function Ra(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 vr(e,t){let n=(0,V.useMemo)(()=>Ra(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:c=900,stagger:b=0}=t,u=(0,V.useRef)(null),f=(0,V.useRef)("init"),m=(0,V.useRef)(null),d=(0,V.useRef)(s),g=(0,V.useRef)(i),S=(0,V.useRef)(!1),k=(0,V.useRef)(0),[,v]=(0,V.useState)(0),D=(0,V.useRef)(null),y=(0,V.useRef)(!0);u.current||(u.current=new ht,u.current.configure(l,c),u.current.snap(n),m.current=n);let T=u.current;if(T.configure(l,c),m.current!==n){let M=f.current,N=!Object.is(d.current,s);T.sameTargets(n)?T.refreshData(n):!r||M==="init"?T.snap(n):M==="idle"?T.hold(n):M==="running"||N?T.update(n,Ue(),b):T.snap(n),m.current=n,d.current=s}let H=(0,V.useRef)(()=>!1);H.current=M=>{if(!y.current)return!1;let N=T.step(M);return!N&&f.current==="running"&&(f.current="done"),v(X=>(X+1)%1e9),N||(D.current=null),N};let F=(0,V.useCallback)(()=>{if(!ye||D.current||!T.animating)return;let M=N=>H.current(N);D.current=kr(M)},[T]);pe(()=>{let M=!Object.is(g.current,i);if(g.current=i,!r){(f.current!=="done"||T.animating)&&(T.snap(m.current??n),f.current="done",v(N=>N+1));return}f.current==="init"||M&&a?(T.hold(m.current??n),f.current="idle",S.current=!1,v(N=>N+1)):M&&(S.current=!0)},[r,i]),pe(()=>{!r||!a||!S.current||(S.current=!1,T.hold(m.current??n),f.current="idle",v(M=>M+1))},[a,r]),(0,V.useEffect)(()=>{r&&o&&f.current==="idle"&&(T.start(Ue()),k.current+=1,f.current="running",F(),v(M=>M+1))},[r,o,i,T,F]),(0,V.useEffect)(()=>{T.animating&&F()}),(0,V.useEffect)(()=>(y.current=!0,()=>{y.current=!1,D.current?.(),D.current=null}),[]);let E=Ue(),q=T.elapsed(E),_=r&&f.current==="idle";return{items:T.items(),get:M=>T.get(M),elapsed:_?0:q,fade:(M,N=320)=>_?0:Number.isFinite(q)?Math.max(0,Math.min(1,(q-M)/N)):1,waiting:_,animating:T.animating,generation:k.current}}var Da=A(Y(),1);var Cr=A(z(),1);var wr=e=>e?"neutralStrong":"accent";var Te=A(Y(),1),Mr=A(z(),1);function $r(e){let t=(0,Te.useRef)(null),n=(0,Te.useRef)(new Map),[r,o]=(0,Te.useState)(0),{width:a,height:i,draw:s,progress:l,version:c,clipRight:b,manualClear:u}=e;return(0,Te.useEffect)(()=>{let f=t.current;if(!f)return;let m=Math.min(2,window.devicePixelRatio||1),d=Math.max(1,Math.round(a*m)),g=Math.max(1,Math.round(i*m));f.width!==d&&(f.width=d),f.height!==g&&(f.height=g);let S=f.getContext("2d");if(!S)return;S.setTransform(m,0,0,m,0,0),u||S.clearRect(0,0,a,i);let k=getComputedStyle(f),v=new Map;s(S,l,(y,T)=>{let H=v.get(y);return H===void 0&&(H=k.getPropertyValue(y).trim(),v.set(y,H)),H||T}),n.current=v},[a,i,s,l,c,u,r]),(0,Te.useEffect)(()=>{let f=t.current;if(!f||typeof matchMedia!="function")return;let m=new AbortController,d=()=>o(v=>v+1),g=()=>{let v=getComputedStyle(f);for(let[D,y]of n.current)if(v.getPropertyValue(D).trim()!==y)return d()},S=()=>{matchMedia(`(resolution: ${devicePixelRatio}dppx)`).addEventListener?.("change",()=>{S(),d()},{once:!0,signal:m.signal})};S(),matchMedia("(prefers-color-scheme: dark)").addEventListener?.("change",g,{signal:m.signal});let k=new MutationObserver(g);for(let v=f.parentElement;v;v=v.parentElement)k.observe(v,{attributes:!0});return()=>{m.abort(),k.disconnect()}},[]),(0,Mr.jsx)("canvas",{ref:t,"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"100%",height:"auto",aspectRatio:`${a} / ${i}`,pointerEvents:"none",clipPath:b?`inset(0 ${(b/Math.max(1,a)*100).toFixed(3)}% 0 0)`:void 0}})}var Gt=A(z(),1);function Sr(e,t,n,r){if(typeof e!="function")return $e(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 J=A(Y(),1);var le=A(z(),1),Na={kind:"Calendar heatmap",desc:(e,t)=>`${Fe(e,"day")}, max ${t}`},Fa={en:Na,ko:{kind:"캘린더 히트맵",desc:(e,t)=>`${e}일, 최대 ${t}`}},Pa=864e5,Ut=.18;function Yt(e){let t=(0,J.useMemo)(()=>{let p=at(e.date,"date"),C=it(e.value,"value"),R=new Map,W=e.dayFirst??Tn(e.data.map((P,B)=>p(P,B)));e.data.forEach((P,B)=>{let ce=Je(p(P,B),W);if(!ce)return;let re=new Date(ce.getFullYear(),ce.getMonth(),ce.getDate()).getTime(),he=R.get(re),ee=C(P,B),te=he?.v??NaN;R.set(re,{v:Number.isFinite(ee)?(Number.isFinite(te)?te:0)+ee:te,d:P})});let $=[...R.keys()].sort((P,B)=>P-B),Z=$.length?[...new Set($.map(P=>new Date(P).getFullYear()))].sort():[];return{byDay:R,keys:$,years:Z}},[e.data,e.date,e.value,e.dayFirst]),n=Math.max(1,t.years.length),r=n>1,o=pr(e,{height:p=>r?n*Math.max(70,Math.min(110,p/8))+18:Math.max(120,Math.min(190,p/4.6+24)),duration:700}),{p:a,width:i,height:s}=o,l=e.weekStart??0,c=(0,J.useMemo)(()=>{let p=new Intl.DateTimeFormat(o.locale,{weekday:"short"});return Array.from({length:7},(C,R)=>p.format(new Date(2024,0,7+R)))},[o.locale]),b=Math.max(22,Math.ceil(Math.max(...[1,3,5].map(p=>cr(c[(p+l)%7],9.5))))+10),u=16,f=e.gap??2.5,m=(0,J.useMemo)(()=>{let p=[];if(!t.keys.length)return p;let C=new Date(t.keys[0]),R=new Date(t.keys[t.keys.length-1]);return(r?t.years.map($=>[new Date($,0,1),new Date($,11,31)]):[[C,R]]).forEach(([$,Z],P)=>{let B=new Date($);B.setDate(B.getDate()-(B.getDay()-l+7)%7);let ce=Z.getTime();for(let re=new Date($.getFullYear(),$.getMonth(),$.getDate());re.getTime()<=ce;re.setDate(re.getDate()+1)){let he=re.getTime(),ee=Math.floor((he-B.getTime()+36e5)/(7*Pa)),te=t.byDay.get(he);p.push({i:p.length,t:he,week:ee,wd:(re.getDay()-l+7)%7,year:P,value:te?te.v:0,datum:te?.d??null})}}),p},[t,r,l]),d=(0,J.useMemo)(()=>{let p=1;for(let R of m)R.week+1>p&&(p=R.week+1);let C=m.map(R=>R.value);return{weeks:p,ext:ur(C),top95:Wt(C.filter(R=>R>0))}},[m]),{weeks:g,top95:S}=d,[k,v]=d.ext,D=o.hydrated&&m.length>(e.canvasThreshold??4e3),y=(s-(r?4:0))/n,T=Math.max(0,Math.min((i-b-2)/g,(y-u-4)/7)),H=T-f>=2?f:T*f/(f+2),F=T-H,E=F+H,q=g*E,_=b+Math.max(0,(i-b-q)/2),M=Math.max(1e-9,S-Math.min(0,k))||1,N=(0,J.useMemo)(()=>In(e.colorReverse,e.colorCenter,e.colorSteps),[e.colorReverse,e.colorCenter,e.colorSteps]),X=N.center,w=(0,J.useMemo)(()=>X===void 0?0:Math.max(1e-9,Wt(m.filter(p=>p.value).map(p=>Math.abs(p.value-X)))),[m,X]),O=(0,J.useCallback)(p=>X===void 0?Math.min(1,(p-Math.min(0,k))/M):Math.max(-1,Math.min(1,(p-X)/w)),[X,w,k,M]),j=(0,J.useMemo)(()=>$e(e.highlight,m.map(p=>p.datum),Kt(m.length,p=>Xe(m[p].t)),e.colorReverse?m.map(p=>p.datum?p.value:NaN):m.map(p=>p.value),e.colorReverse?"min":"max"),[m,e.highlight,e.colorReverse]),be=o.motion.duration??700,pt=(0,J.useMemo)(()=>[{key:"__clock",to:[1],from:[0],delay:D?0:be*.9,data:0}],[be,D]),ve=vr(pt,o.motion),U=(0,J.useMemo)(()=>new Intl.DateTimeFormat(o.locale,{month:"long",day:"numeric",weekday:"short",...r?{year:"numeric"}:{}}),[o.locale,r]),fe=o.fv,Ve=(0,J.useMemo)(()=>Kt(m.length,p=>{let C=m[p],R=Number.isFinite(C.value);return{datum:C.datum,index:C.i,key:String(C.t),label:U.format(C.t),value:R?C.value:null,formatted:R?fe(C.value):"-"}}),[m,U,fe]),bt=p=>({x:_+p.week*E,y:p.year*y+u+p.wd*E}),Zt=null;if(o.active!==null&&m[o.active]){let p=m[o.active],C=bt(p);Zt={x:C.x+F/2,y:C.y,title:Ve[o.active].label,rows:[{label:o.t.value,value:Number.isFinite(p.value)?o.fv(p.value):"-",color:a.paint("accent")}]}}let We=o.pending,Qt=(0,J.useMemo)(()=>{let p=[];if(We)return p;let C="";for(let R of m){let W=new Date(R.t),$=`${R.year}-${W.getMonth()}`;if($!==C&&W.getDate()<=7){let Z=_+R.week*E,P=R.year*y+7,B=p[p.length-1];(!B||B.y!==P||Z-B.x>=26)&&p.push({x:Z,y:P,label:Ze(W,{month:"short",locale:o.locale})}),C=$}}return p},[We,m,_,E,y,o.locale]),yt=Fa[o.lang],Ir=e.description??`${yt.kind}. ${yt.desc(m.length,o.fv(v))}.`,en=hn(o,ve),Or=(0,J.useMemo)(()=>{let p=new Int32Array(n*g*7).fill(-1);for(let C of m)p[(C.year*g+C.week)*7+C.wd]=C.i;return p},[m,n,g]),tn=(0,J.useMemo)(()=>{if(D||We)return null;let p=new Map;for(let C of m){let R=`${C.year}:${C.week}`,W=p.get(R);W?W.push(C):p.set(R,[C])}return[...p.entries()].map(([C,R])=>{let W=R[0].week;return(0,le.jsx)("g",{style:fn(en,ve.waiting,"fade",W/Math.max(1,g-1)*be*.9,320),children:R.map($=>{let Z={x:_+$.week*E,y:$.year*y+u+$.wd*E},P=$.value?_n(a,O($.value),Ut,N):null,B=j.has($.i);return(0,le.jsx)("rect",{x:Z.x,y:Z.y,width:F,height:F,rx:Math.min(2.5,F/3),fill:P?P.fill:a.paint("neutralSoft"),opacity:P?P.opacity:void 0,stroke:B?a.paint("ink"):"none",strokeWidth:1.2},$.i)})},C)})},[D,We,m,en,ve.waiting,ve.generation,g,be,_,E,y,u,F,a,N,O,j]),Br=(0,J.useMemo)(()=>(0,le.jsxs)("g",{"aria-hidden":"true",children:[Qt.map((p,C)=>(0,le.jsx)(ut,{x:p.x,y:p.y,size:10,fill:a.paint("muted"),children:p.label},C)),Array.from({length:n},(p,C)=>[1,3,5].map(R=>(0,le.jsx)(ut,{x:_-6,y:C*y+u+R*E+F/2,anchor:"end",size:9.5,fill:a.paint("muted"),children:c[(R+l)%7]},`${C}-${R}`))),r?t.years.map((p,C)=>(0,le.jsx)(ut,{x:2,y:C*y+7,size:10,weight:700,fill:a.paint("ink"),children:String(p)},p)):null]}),[Qt,n,_,y,u,E,F,l,r,t.years,a,c]),zr=D?ve.get("__clock")?.[0]??1:1,Hr=(0,J.useMemo)(()=>{let p=null,C="",R=($,Z,P,B,ce)=>{let re=Math.min(2.5,F/3),he=F>=5&&typeof $.roundRect=="function",ee=32,te=Array.from({length:ee+1},()=>[]),ge=Array.from({length:ee+1},()=>[]),_e=[],Ie=[];for(let I=0;I<m.length;I++){let ie=m[I];if(ie.value){let K=It(O(ie.value),N);(K<0?ge:te)[Math.round((Ut+(1-Ut)*Math.min(1,Math.abs(K)))*ee)].push(I)}else _e.push(I);j.has(ie.i)&&Ie.push(I)}let Ne=I=>{$.beginPath();for(let ie of I){let K=m[ie],Re=_+K.week*E,nn=K.year*y+u+K.wd*E;he?$.roundRect(Re,nn,F,F,re):$.rect(Re,nn,F,F)}};$.fillStyle=P,Ne(_e),$.fill();for(let[I,ie]of[[te,Z],[ge,ce]]){$.fillStyle=ie;for(let K=1;K<=ee;K++)I[K].length&&($.globalAlpha=K/ee,Ne(I[K]),$.fill())}$.globalAlpha=1,Ie.length&&($.strokeStyle=B,$.lineWidth=1.2,Ne(Ie),$.stroke())},W=null;return($,Z,P)=>{let B=P("--ztd-accent",a.theme.accent),ce=P("--ztd-neutral-soft",a.theme.neutralSoft),re=P("--ztd-ink",a.theme.ink),he=P("--ztd-neutral-strong",a.theme.neutralStrong),ee=$.canvas.width,te=$.canvas.height,ge=ee/Math.max(1,i),_e=`${B}|${ce}|${re}|${he}|${ee}x${te}`;if(!p||C!==_e||!W){p=p??document.createElement("canvas"),p.width=ee,p.height=te;let I=p.getContext("2d");if(!I)return;I.setTransform(ge,0,0,ge,0,0),I.clearRect(0,0,i,s),R(I,B,ce,re,he),C=_e,$.clearRect(0,0,i,s),W=new Float32Array(g)}let Ie=Math.max(1,g-1),Ne=I=>Math.round(Math.min(ee,Math.max(0,(_+I*E-H/2)*ge)));for(let I=0;I<g;I++){let ie=Math.max(0,Math.min(1,(Z-I/Ie*.75)/.25));if(ie===W[I])continue;let K=Ne(I),Re=I===g-1?ee:Ne(I+1);Re>K&&($.clearRect(K/ge,0,(Re-K)/ge,s),ie>0&&($.globalAlpha=ie,$.drawImage(p,K,0,Re-K,te,K/ge,0,(Re-K)/ge,s))),W[I]=ie}$.globalAlpha=1}},[m,g,_,E,H,y,F,j,i,s,a.theme.accent,a.theme.neutralSoft,a.theme.ink,a.theme.neutralStrong,N,O]);return(0,le.jsxs)(sr,{c:o,kind:yt.kind,ariaLabel:e.ariaLabel,description:Ir,events:Ve,tip:Zt,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(p,C,R)=>{let W=Math.floor((p-_)/E),$=Math.floor(C/y),Z=Math.floor((C-$*y-u)/E),P=$>=0&&$<n&&W>=0&&W<g&&Z>=0&&Z<7?Or[($*g+W)*7+Z]:-1,B=P>=0?P:null;B!==o.active&&o.setActive(B,R.pointerType==="touch"?"touch":"pointer")},onKey:p=>{let C=p.key==="ArrowRight"?7:p.key==="ArrowLeft"?-7:0;return!C||o.active===null?!1:(m[o.active+C]&&o.setActive(o.active+C,"keyboard"),!0)},underlay:D?(0,le.jsx)($r,{width:i,height:s,draw:Hr,progress:zr,version:o.sig,manualClear:!0}):void 0,children:[Br,tn?(0,le.jsx)("g",{children:tn},ve.generation):null,o.active!==null&&m[o.active]?(0,le.jsx)("rect",{x:bt(m[o.active]).x-.5,y:bt(m[o.active]).y-.5,width:F+1,height:F+1,rx:Math.min(3,F/3),fill:"none",stroke:a.paint("ink"),strokeWidth:1.6,pointerEvents:"none"}):null]})}var La=A(Y(),1);var Xt=A(z(),1),Ea={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}, ${Fe(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Tr={en:Ea,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}일 이동평균`}},qt=["ink","muted","dim"];function Ar(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,qt.length)}var _a=A(Y(),1);var Fr=A(z(),1),Ia={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Fe(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Oa={en:Ia,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},Rr=(e,t)=>Oa[e].other(t);function Dr(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,or(o.map(a=>a.value)))}}var Nr=e=>Number.isFinite(e)&&e>0?e:0;var Ae=A(z(),1);function Pr(e,t){let n=lt(e);return n?.type==="scatter"&&t?.size!==void 0?lt("bubble"):n}function Ba(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 za(e,t,n,r=!1){let o=Pr(e.type,e.encoding);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&jt.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(f=>!l.has(f.label)),b=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(b.includes(o.type)){let u=st(a.label,"label"),f=it(a.value,"value"),m=o.type==="waffle",d=t.map((y,T)=>({r:y,label:u(y,T),value:m?f(y,T):Nr(f(y,T))})),{kept:g,other:S}=m?{kept:d,other:null}:Dr(d,i.other,(y,T)=>({r:{},label:Rr(Q(n),y),value:T})),k=$e(s,g.map(y=>y.r),g.map(y=>y.label),g.map(y=>y.value),m?"first":"max"),v=S?[...g,S]:g,D=Be(v.length,k);return v.map((y,T)=>({label:y.label,color:D[T]}))}if(o.type==="candlestick"){let u=Ar(Array.isArray(i.ma)?i.ma:void 0,t.length),f=Tr[Q(n)];return[{label:f.up,color:i.upColor??"accent"},{label:f.down,color:i.downColor??"neutralStrong"},...u.map((m,d)=>({label:f.maLegend(m),color:qt[d],shape:"line"}))]}if(o.type==="scatter"){if(typeof a.series!="string")return[];let u=st(a.series,"series"),f=Ot(t.map((d,g)=>u(d,g)));if(f.length<2)return[];let m=En(f.length,Sr(s,t,f,u));return c(f.map((d,g)=>({label:d,color:m[g],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let g=st(a.series,"series");u=Ot(t.map((S,k)=>g(S,k)))}let f=Vt(o.type,a,i);if(f.length){let g=Be(u.length,$e(s,u,u,u.map(()=>0),"none")),S=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((k,v)=>({label:k,color:g[v]}));return[...c(S),...f.map((k,v)=>({label:k,color:wr(v),shape:"line"}))]}if(u.length<2)return[];let m=$e(s,u,u,u.map(()=>0),"first");if(o.type==="line"||o.type==="radar")return c(u.map((g,S)=>({label:g,color:m.has(S)?"accent":"neutralStrong",shape:o.type==="line"?"line":"square"})));let d=Be(u.length,m);return c(u.map((g,S)=>({label:g,color:d[S]})))}return[]}function Lr(e,t){let{spec:n}=e,r=Pr(n.type,n.encoding),o=(0,je.useMemo)(()=>ar(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=er(n,e.locale),s=me(i),l=Q(s),c=jn(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),b=nr(n),u=(0,je.useMemo)(()=>b?qn(b,s):void 0,[b,s]),f=n.options?.hidden,m=Array.isArray(f)?f.map(String):[],d=m.join(""),[g,S]=(0,je.useState)(null);if(!r)return(0,Ae.jsx)(_t,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let k=o??c.data,v=t[r.type],D={...n.options??{}},y={...Ba(r,n.encoding),...D,...u?{tooltip:u}:{},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},T=n.card?.legend==="toggle"&&tr(r.type,n.encoding??{},D),H=g&&g.base===d?g.hidden:m;T&&(y.hidden=H);let F=M=>S(N=>{let X=N&&N.base===d?N.hidden:m;return{base:d,hidden:X.includes(M)?X.filter(w=>w!==M):[...X,M]}}),E=y.height??220,q=a&&!k.length&&(c.loading||c.error||c.empty)?(0,Ae.jsx)(_t,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:E,locale:i}):(0,Ae.jsx)(v,{...y});if(n.card){let M=n.card,N=M.legend==="auto"||M.legend==="toggle"?za(n,k,s,T):M.legend,X=N?.length?T?(0,Ae.jsx)(Et,{items:N,hidden:H,onToggle:F,locale:i}):N:void 0,w=M.download?(0,Ae.jsx)(Yn,{data:k,columns:rr(n),filename:M.title??r.type,formats:Array.isArray(M.download)?M.download:void 0,locale:i}):void 0;q=(0,Ae.jsx)(Ln,{number:M.number,title:M.title??Qn(r,l),subtitle:M.subtitle,legend:X,actions:w,source:M.source||void 0,note:M.note||void 0,accent:M.accent,takeaway:M.takeaway,level:M.level,sample:M.sample,replay:M.replay!==!1,className:e.className,locale:i,children:q})}let _=e.theme??n.theme;return _&&(q=(0,Ae.jsx)(nt,{theme:_,children:q})),q}function Ha({cfg:e,components:t}){let n=dt();return Lr({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function _r(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,Er.hydrateRoot)(r,(0,Jt.createElement)(nt,{theme:o.theme,cssVars:!0},(0,Jt.createElement)(Ha,{cfg:o,components:{[e]:t}})))}_r("calendar",Yt);})();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
(()=>{var Eo=Object.create;var $n=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Oo=Object.getPrototypeOf,Io=Object.prototype.hasOwnProperty;var Pt=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var zo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bo(t))!Io.call(e,o)&&o!==n&&$n(e,o,{get:()=>t[o],enumerable:!(r=_o(t,o))||r.enumerable});return e};var A=(e,t,n)=>(n=e!=null?Eo(Oo(e)):{},zo(t||!e||!e.__esModule?$n(n,"default",{value:e,enumerable:!0}):n,e));var K=Pt((Vi,Mn)=>{Mn.exports=globalThis.__ztdReact.react});var Tn=Pt((ji,Sn)=>{Sn.exports=globalThis.__ztdReact["react-dom/client"]});var E=Pt((ts,Zn)=>{Zn.exports=globalThis.__ztdReact["react/jsx-runtime"]});var cn=A(K(),1),xo=A(Tn(),1);var Ze=A(K(),1);var ft=A(K(),1);var An=A(K(),1),rt=(0,An.createContext)(void 0);var jo=A(K(),1);var Ho=["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Rn='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',Pn='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',$e={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:Rn,monoFamily:Pn,radius:18,radiusCode:14,radiusMark:4},Vo={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:Rn,monoFamily:Pn,radius:18,radiusCode:14,radiusMark:4},Nt={dark:$e,light:Vo};function Dt(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Ft(e){let t={};for(let n of Ho){let r=e[n];typeof r=="string"&&(t[Dt(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 Lt(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 Wo=`
|
|
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,${$e.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,${$e.accent});outline-offset:2px}
|
|
13
|
+
.ztd-card{transition:border-color .16s ease}
|
|
14
|
+
.ztd-card:hover{border-color:var(--ztd-dim,${$e.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
|
+
`;var Nn=!1;function Ke(){if(Nn||typeof document>"u"||(Nn=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=Wo,document.head.appendChild(e)}var ot=A(K(),1),xe=typeof window<"u"&&typeof document<"u",ge=xe?ot.useLayoutEffect:ot.useEffect;function at(){return typeof performance<"u"?performance.now():Date.now()}var pe=A(K(),1),Ko=(0,pe.createContext)(void 0),it=new Map;function Go(e,t){let n=it.get(e);return n||it.set(e,n=new Set),n.add(t),()=>{n.delete(t),n.size||it.delete(e)}}function Uo(e,t,n){it.get(e)?.forEach(r=>r(t,n))}function Yo(e,t,n){let r=e.indexOf(n.key);return r>=0||t.length>1e3?r:t.indexOf(n.label)}function Dn(e,t,n,r){let o=(0,pe.useContext)(Ko),a=t??o,[i]=(0,pe.useState)(()=>({})),s=(0,pe.useRef)({keys:n,labels:r});s.current={keys:n,labels:r},e.publish.current=a?u=>Uo(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,pe.useEffect)(()=>{if(a)return Go(a,(u,h)=>{if(h===i)return;let m=u?Yo(s.current.keys,s.current.labels,u):-1;l(m<0?null:m)})},[a,i,l])}function X(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function st(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Fn={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},Ln={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Xo=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],qo={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function Zo(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Jo(e){return Zo(Xo,e)}function En(e,t){let n=Jo(e);return{text:n?n[t]:e,...qo[n?.id??"basic"]}}var le=A(K(),1);var zn=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),J="en-US",_n=new Map;function Et(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=_n.get(r);return o||(o=new Intl.NumberFormat(e,n),_n.set(r,o)),o}function _t(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function Me(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=J,...r}=t;return _t(Et(n,r).format(e))}var Bt=e=>e!==0&&Math.abs(e)<.05,Ot=(e,t,n="")=>`${Me(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function lt(e,t={}){if(!Number.isFinite(e))return"-";if(Bt(e)&&t.maximumFractionDigits===void 0)return Ot(e,t.locale??J,"%");let n=Math.abs(e);return`${Me(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function Hn(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=J,...r}=t;if(X(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,h=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||u<100?1:0)),m=Math.round(u*10**h)/10**h;if(i>0&&m>=a[i-1][0]/s){i--;continue}return(e<0&&m!==0?"-":"")+Me(m,{locale:n,...r,maximumFractionDigits:h})+l}}return _t(Et(n,{notation:"compact",...r}).format(e))}var Qo=(e,t=X(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function Ge(e,t=J,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=Et(t,o);return l=>Number.isFinite(l)?`${i}${_t(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=>lt(o,{locale:t});case"ratio":return o=>lt(o*100,{locale:t});case"compact":return o=>Hn(o,{locale:t});case"currency":return r(Qo(t));default:{let o=r({maximumFractionDigits:1});return a=>Bt(a)?Ot(a,t):o(a)}}}function Vn(e,t=J,n=0){return e!==void 0?Ge(e,t):n>=1e5?r=>Bt(r)?Ot(r,t):Hn(r,{locale:t}):r=>Me(r,{locale:t})}function ea(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var ta=e=>Number.isInteger(e)&&e>=1e3&&e<=9999;var na=["january","february","march","april","may","june","july","august","september","october","november","december"],Bn=e=>{let t=e.toLowerCase();return t.length<3?0:na.findIndex(n=>n.startsWith(t))+1},On=e=>+e+(+e<30?2e3:1900);function jn(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var ra=[/^(\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})일)?$/],Wn=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,Kn=/\{([^{}]+)\}/g;function oa(e,t){let n;for(let r of ra)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?[On(n[3]),+n[2],+n[1],1]:[On(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=Wn.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=Bn(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=Bn(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}function Gn(e){let t;for(let n of e){let r=typeof n=="string"?Wn.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function Oe(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(ta(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return Oe(`${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=oa(n,t);if(r)return ea(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 In=new Map;function Se(e,t={month:"short",day:"numeric"}){let n=Oe(e);if(!n)return"-";let{locale:r=J,...o}=t,a=r+JSON.stringify(o),i=In.get(a);return i||(i=new Intl.DateTimeFormat(r,o),In.set(a,i)),i.format(n)}var Un={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ie(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),Un[t.toLowerCase()]&&(t=Un[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 qn(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 zt(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 ze(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Yn(e){return .2126*ze(e[0])+.7152*ze(e[1])+.0722*ze(e[2])}function Ht(e,t,n){let r=typeof e=="string"?Ie(e):e,o=typeof t=="string"?Ie(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?Ie(n):n:null;o[3]<1&&a&&(o=zt(o,a));let i=r[3]<1?zt(r,o):r,s=Yn(i),l=Yn(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function aa(e){return[ze(e[0]),ze(e[1]),ze(e[2])]}function It(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 Xn(e){let[t,n,r]=aa(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 ia([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[It(4.0767416621*o-3.3077115913*a+.2309699292*i),It(-1.2684380046*o+2.6097574011*a-.3413193965*i),It(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function Vt(e,t,n){let r=Ie(e),o=Ie(t);if(!r||!o)return e;let a=Xn(r),i=Xn(o),s=Math.max(0,Math.min(1,n));return qn(ia([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 jt(e,t,n){let r=t[0],o=-1;for(let a of t){let i=Ht(a,e,n);i>o&&(o=i,r=a)}return r}var Wt=A(E(),1),ut=(0,le.createContext)({theme:$e,cssVars:!0});function sa(e,t=$e){return e?typeof e=="string"?Nt[e]??t:Lt(t,e):t}function mt(e){let t=(0,le.useContext)(ut),n=e.base?Nt[e.base]:t.theme,r=(0,le.useMemo)(()=>sa(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,le.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,le.useMemo)(()=>Ft(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,Wt.jsx)(ut.Provider,{value:i,children:(0,Wt.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var la=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function ct(e){return la.has(e)}function ua(e,t){let n=r=>t?`var(${Dt(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?ct(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?ct(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)})`:Vt(e[r],e[o],a)}}}function ke(e){let t=(0,le.useContext)(ut);return(0,le.useMemo)(()=>{let n=Lt(t.theme,e);return ua(n,t.cssVars)},[t.theme,t.cssVars,e])}function ue(e){let t=(0,le.useContext)(ut);return e??t.locale??J}function Jn(e){return e?Ft(e):{}}var dt=A(K(),1),Kt=(0,dt.createContext)(void 0);function Qn(e){let t=(0,dt.useContext)(Kt);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var M=A(E(),1),ca={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`},ma={en:ca,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var da={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Gt=e=>ma[X(ue(e))];function Ut(e){let t=ke(e.theme),n=Gt(e.locale),[r,o]=(0,ft.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(h=>!s.has(h.label)).length,u=(0,M.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((h,m)=>{let d=!s.has(h.label),p=d&&l===1,g=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(fa,{p:t,item:h,off:!d}),(0,M.jsx)("span",{style:d?void 0:{textDecoration:"line-through"},children:h.label})]});return(0,M.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,M.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":d,"aria-disabled":p||void 0,onClick:()=>{p||(i(h.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:p?"default":void 0},children:g}):g},m)})});return i?(0,M.jsxs)(M.Fragment,{children:[u,(0,M.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:da,children:r?n.shown(l,e.items.length):""})]}):u}function fa({p:e,item:t,off:n}){let r=t.color?ct(t.color)?e.paint(t.color):t.color:e.paint("neutral"),o=t.shape??"square";return o==="line"||o==="dash"?(0,M.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,M.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,M.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,M.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 ha(e){let t=ke(e.theme),n=En(e.level,X(ue(e.locale)));return(0,M.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 ga(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,M.jsxs)(M.Fragment,{children:[e.slice(0,r),(0,M.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function er(e){let t=ke(e.theme),n=Gt(e.locale),[r,o]=(0,ft.useState)(0);ge(()=>Ke(),[]);let a=()=>{o(d=>d+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,M.jsx)(Ut,{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,h=e.source!==void 0||e.note!==void 0?(0,M.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,m=e.takeaway!==void 0||e.level||e.sample?(0,M.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,M.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,M.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,M.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,M.jsx)(ha,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,M.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,M.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,M.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,M.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,M.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:ga(e.title,e.accent,t.paint("accentText"))}),e.actions,u?(0,M.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,M.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,M.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,M.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,M.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,M.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,M.jsx)("span",{}),i]}):null]}),(0,M.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,M.jsx)(Kt.Provider,{value:r,children:(0,M.jsx)(rt.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),h?(0,M.jsxs)(M.Fragment,{children:[h,m]}):m]})}function Yt(e){let t=ke(e.theme),n=Gt(e.locale),r=e.height??220;if(ge(()=>Ke(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,M.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,M.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,M.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,M.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,M.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,M.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,M.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,M.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,M.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,M.jsx)(M.Fragment,{children:e.children})}function Te(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 h=-1,m=u==="max"?-1/0:1/0;r.forEach((d,p)=>{Number.isFinite(d)&&(u==="max"?d>m:d<m)&&(m=d,h=p)}),h>=0&&a.add(h)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((u,h)=>{h<i&&u!==null&&u!==void 0&&e(u,h)&&a.add(h)}),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((h,m)=>{h===u&&a.add(m)});return a}function tr(e,t){let n=jt(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return Ht(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):jt(t,["#FFFFFF","#000000"])}function Ue(e,t){let n=new Array(e),r=[];for(let a=0;a<e;a++)t.has(a)?n[a]="accent":r.push(a);let o=r.length;return r.forEach((a,i)=>{o===1?n[a]="neutral":i===0?n[a]="ink":i===o-1?n[a]="neutral":n[a]="neutralStrong"}),n}function nr(e,t){return Ue(e+1,t).slice(0,e)}function rr(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function pa(e,t){if(e==null||typeof e!="object")return;let n=e;if(rr(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!rr(r,o))return;r=r[o]}return r}}function Ye(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 ht(e,t){if(typeof e=="function")return e;let n=e??t;return r=>pa(r,n)}function Ae(e,t){let n=ht(e,t);return(r,o)=>Ye(n(r,o))}function gt(e,t){let n=ht(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 Xt(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var se=A(K(),1);function ba(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 ya=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function or(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(ya.test(t)||/^[-+]?\.\d+$/.test(t)){let n=Ye(t);if(Number.isFinite(n))return n}return t}function Le(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??ba(o),i=[],s=[],l="",u=!1;for(let g=0;g<o.length;g++){let b=o[g];u?b==='"'?o[g+1]==='"'?(l+='"',g++):u=!1:l+=b:b==='"'&&!l.trim()?(u=!0,l=""):b===a?(s.push(l),l=""):b===`
|
|
24
|
+
`||b==="\r"?(b==="\r"&&o[g+1]===`
|
|
25
|
+
`&&g++,s.push(l),i.push(s),s=[],l=""):l+=b}(l!==""||s.length)&&(s.push(l),i.push(s));let h=i.filter(g=>!(g.length===1&&g[0].trim()===""));if(!h.length)return[];let m=g=>n?or(g):g;if(!r)return h.map(g=>Object.fromEntries(g.map((b,c)=>[String(c),m(b)])));let d=[],p=new Set;return h[0].forEach((g,b)=>{let c=g.trim()||`col${b+1}`,y=c;for(let $=2;p.has(y);$++)y=`${c}_${$}`;p.add(y),d.push(y)}),h.slice(1).map(g=>Object.fromEntries(d.map((b,c)=>[b,m(g[c]??"")])))}function qt(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"?or(i[l]):i[l]??null])))}function xa(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 ar(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 Re(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return Re(JSON.parse(t))}catch{}return Le(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?qt(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)?Re(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?qt(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)?Re(t.rows):Array.isArray(t.values)?qt(t.values):Array.isArray(t.items)?Re(t.items):Array.isArray(t.results)?Re(t.results):xa(t)}return[]}function ir(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)}`}async function ka(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(X(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return Le(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 Le(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):Le(a)}async function va(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 ka(a,t.parse,o,t.locale)}return t.select&&(r=ar(r,t.select)),t.transform?t.transform(r):Re(r)}function sr(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,se.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,se.useState)(0),u=ue(t.locale),h=(0,se.useRef)(t);h.current={...t,locale:u};let m=(0,se.useRef)(e);m.current=e;let d=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",p=t.deps??[],g=JSON.stringify(p.map(y=>typeof y=="object"?JSON.stringify(y):String(y))),b=(0,se.useRef)(!1);(0,se.useEffect)(()=>{let y=m.current;if(!y||!r){i(T=>T.status==="loading"?{...T,status:"idle"}:T);return}let $=new AbortController,R=!0;return b.current=!0,i(T=>({...T,data:o?T.data:[],status:"loading",error:null})),va(y,{...h.current,signal:$.signal}).then(T=>{R&&i({data:T,status:"success",error:null,updatedAt:Date.now()})}).catch(T=>{!R||$.signal.aborted||i(v=>({...v,status:"error",error:T instanceof Error?T:new Error(String(T))}))}).finally(()=>{R&&(b.current=!1)}),()=>{R=!1,b.current=!1,$.abort()}},[d,r,s,g,o]),(0,se.useEffect)(()=>{if(!n||!r)return;let y=setInterval(()=>{b.current||l($=>$+1)},n);return()=>clearInterval(y)},[n,r]);let c=(0,se.useCallback)(()=>l(y=>y+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:c}}var Jt=A(E(),1),wa=["csv","svg","png"],Ca=/^[=+\-@\t\r\n=+-@]/,$a=/var\(|color-mix\(/;function lr(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?jn(e.getTime()):String(e);return`"${(Ca.test(t)&&!Number.isFinite(Ye(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Ma(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function Sa(e,t){return`\uFEFF${[t.map(lr),...e.map(r=>t.map(o=>lr(r[o])))].map(r=>r.join(",")).join(`\r
|
|
26
|
+
`)}\r
|
|
27
|
+
`}function Ta(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function Zt(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var ur=2,Pe=16;function cr(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 mr(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 dr(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+Pe*2,i+Pe*2],u=o.cloneNode(!0),h=u.querySelectorAll("*"),m=new Map;o.querySelectorAll("*").forEach((g,b)=>{let c;for(let y of Array.from(g.attributes)){if(!$a.test(y.value))continue;let $=(c??(c=getComputedStyle(g))).getPropertyValue(y.name);$&&h[b].setAttribute(y.name,cr($,m))}}),u.removeAttribute("style");for(let[g,b]of Object.entries({viewBox:`${-Pe} ${-Pe} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))u.setAttribute(g,String(b));let d=cr(getComputedStyle(r).backgroundColor,m),p=o.parentElement?.querySelector("canvas")??null;if(n){let g=u.querySelector("desc")?.nextSibling??u.firstChild;u.insertBefore(mr("rect",{x:-Pe,y:-Pe,width:s,height:l,fill:d}),g),p&&u.insertBefore(mr("image",{href:p.toDataURL(),width:a,height:i}),g)}return{svg:new XMLSerializer().serializeToString(u),w:s,h:l,vw:a,vh:i,bg:d,canvas:p}}function Aa(e,t){let n=dr(e,ur,!1);if(!n)return;let r=ur,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,Pe*r,Pe*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&&Zt(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function fr(e){let t=ke(e.theme),n=X(ue(e.locale))==="ko",r=Ta(e.filename),o=(a,i)=>{if(a==="csv")return Zt(new Blob([Sa(e.data,e.columns?.length?e.columns:Ma(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return Aa(i,r);let s=dr(i,1,!0);s&&Zt(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,Jt.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:wa.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,Jt.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 gr=A(E(),1);function hr(e,t=J){let n=Ge(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?Se(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(Kn,(h,m)=>o(a,m.trim())??(l=!0,""));l||i.push(u)}return i.length?i.map((s,l)=>(0,gr.jsx)("div",{children:s},l)):null}}var x=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),ce=x("label","string",!0,"Item name field"),Q=x("value","number",!0,"Value field"),Ra=[ce,Q],Pa=[ce,Q],Na=[x("label","string",!0,"Stage name"),x("value","number",!0,"Users at the stage")],Da=[ce,Q],Fa=[x("label","string",!0,"Leaf (lowest level) name"),Q,x("group","string",!1,"Parent group field")],La=[x("label","string",!0,"Leaf name"),Q,x("group","string",!1,"Parent group field")],Ea=[ce,x("value","number",!0,"Change (total rows may omit it)"),x("type","string",!1,'"total" makes a total bar')],_a=[ce,Q],Ba=[x("x","string",!0,"Column field"),x("series","string",!0,"Stacked series field"),Q],Oa=[x("x","string",!0,"Column field"),x("y","string",!0,"Row field"),Q],Ia=[x("axis","string",!0,"Metric (axis) field"),x("value","number",!0,"Value field",{multi:!0}),x("series","string",!1,"Series field")],za=[x("x","number",!0,"x value"),x("y","number",!0,"y value"),x("size","number",!1,"Circle size"),x("label","string",!1,"Name")],br=x("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),Ha=[x("x","any",!0,"x field (date, number or category)"),x("y","number",!0,"y field. An array for wide tables",{multi:!0}),x("series","string",!1,"Series field (long tables)"),x("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),br],Va=[x("x","any",!0,"x field"),x("y","number",!0,"y field. An array for wide tables",{multi:!0}),x("series","string",!1,"Series field"),x("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}),br],ja=[x("x","any",!0,"x field"),x("y","number",!0,"y field",{multi:!0}),x("series","string",!1,"Series field")],Wa=[x("x","string",!0,"Category field"),x("y","number",!0,"Value field. An array for wide tables",{multi:!0}),x("series","string",!1,"Series field"),x("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})],Ka=[ce,Q],Ga=[x("value","number",!0,"Value field",{prop:"valueKey"}),x("target","number",!1,"Target field",{prop:"targetKey"})],Ua=[ce,x("value","number",!0,"Actual value field"),x("target","number",!1,"Target field")],Ya=[x("x","any",!1,"x field"),x("y","number",!0,"y field")],Xa=[ce,x("x","string",!1,"Period field (long tables)"),x("value","number",!1,"Value field (long tables)")],qa=[ce,x("start","number",!0,"Before value"),x("end","number",!0,"After value")],Za=[ce,Q],Ja=[x("value","number",!0,"Value field"),x("group","string",!1,"Group (row) field"),x("label","string",!1,"Dot name")],Qa=[x("group","string",!0,"Group field"),x("value","number",!0,"Value field")],ei=[x("source","string",!0,"Source node"),x("target","string",!0,"Target node"),Q],ti=[x("source","string",!0,"Sending group"),x("target","string",!0,"Receiving group"),Q],ni=[x("date","date",!0,"Date field"),Q],ri=[x("x","any",!0,"Period field"),x("series","string",!0,"Item field"),x("rank","number",!1,"Rank field (1 is first)"),x("value","number",!1,"Value field (instead of rank, largest is first)")],oi=[x("group","string",!0,"Group field"),x("value","number",!0,"Value field")],ai=[x("label","string",!1,"Row name field")],ii=[x("x","date",!0,"Date (period) field"),x("open","number",!0,"Open price field"),x("high","number",!0,"High price field"),x("low","number",!0,"Low price field"),x("close","number",!0,"Close price field"),x("volume","number",!1,"Volume field")],si=[ce,Q],li=[x("x","any",!0,"Period field (date or category)"),x("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),x("series","string",!1,"Series field (long tables, back row only)"),x("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],ui=[x("value","number",!1,"Sample value field (raw rows)"),x("group","string",!1,"Group field. Up to 2 groups overlap"),x("x0","number",!1,"Bin start (pre-binned rows)"),x("x1","number",!1,"Bin end (pre-binned rows)"),x("count","number",!1,"Samples in the bin (pre-binned rows)")],ci=[x("x","number",!0,"x value"),x("y","number",!0,"y value"),x("series","string",!1,"Series field (one color per series)"),x("label","string",!1,"Name")],pr={pie:Ra,donut:Pa,funnel:Na,waffle:Da,treemap:Fa,sunburst:La,waterfall:Ea,pareto:_a,marimekko:Ba,heatmap:Oa,radar:Ia,bubble:za,line:Ha,area:Va,stream:ja,bar:Wa,radialBar:Ka,gauge:Ga,bullet:Ua,sparkline:Ya,slope:Xa,dumbbell:qa,lollipop:Za,beeswarm:Ja,ridgeline:Qa,sankey:ei,chord:ti,calendar:ni,bump:ri,box:oi,parallel:ai,candlestick:ii,segmented:si,skyline:li,histogram:ui,scatter:ci},He={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:"산점도"}};function yr(e,t){return t==="ko"?e.nameKo:e.name}function xr(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Qt=["line","area","bar","scatter"];function en(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"?[].concat(t.line??[]).map(String):[]}function kr(e,t,n){return Qt.includes(e)&&!en(e,t,n).length}function vr(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var mi={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"};function pt(e){let t=pr[e]?e:mi[e]??Object.keys(He).find(n=>n.toLowerCase()===e.toLowerCase()||He[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!He[t]))return{type:t,component:He[t].component,name:He[t].name,nameKo:He[t].nameKo,encoding:pr[t]}}function wr(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 pt(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]}var di=Math.PI*2;function Cr(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function $r(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 Mr(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 Le(t.csv)}return null}var oe=A(K(),1);var L=A(E(),1),bt=60;var Sr={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Tr(e){let{c:t,events:n}=e,r=(0,oe.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,ge(()=>{Ke()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,oe.useContext)(rt),u=e.ariaLabel??l??e.kind,h=(0,oe.useMemo)(()=>s?`${n.length}${n.slice(0,bt).map(C=>`${C.label}${C.series??""}${C.formatted??C.value??""}`).join("")}`:"",[n,s]),m=(0,oe.useMemo)(()=>(0,L.jsx)(fi,{label:u,events:n,t:t.t}),[u,h,t.t]),d=(0,oe.useRef)(null);(0,oe.useEffect)(()=>{let C=()=>{d.current=null};return window.addEventListener("scroll",C,{capture:!0,passive:!0}),window.addEventListener("resize",C,{passive:!0}),()=>{window.removeEventListener("scroll",C,{capture:!0}),window.removeEventListener("resize",C)}},[]),(0,oe.useEffect)(()=>{d.current=null},[t.width,t.height]);let p=C=>{if(C.target!==C.currentTarget)return;if(e.onKey?.(C)){C.preventDefault();return}let P=t.active,B;switch(C.key){case"ArrowRight":case"ArrowDown":B=P===null?0:(P+1)%i;break;case"ArrowLeft":case"ArrowUp":B=P===null?i-1:(P-1+i)%i;break;case"Home":B=0;break;case"End":B=i-1;break;case"Escape":if(P===null)return;B=null;break;case"Enter":case" ":P!==null&&(C.preventDefault(),t.click(P));return;default:return}C.preventDefault(),t.setActive(B,"keyboard")},{via:g,node:b,setActive:c}=t;(0,oe.useEffect)(()=>{if(g!=="touch"||!b)return;let C=P=>{b.contains(P.target)||c(null)};return document.addEventListener("pointerdown",C),()=>document.removeEventListener("pointerdown",C)},[g,b,c]);let y=t.active!==null?n[t.active]:null,$=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,R=$&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,T=typeof e.renderTip=="function"&&y?e.renderTip(y):null,v=e.announce??(t.via==="keyboard"&&y?`${y.label}${y.series?` ${y.series}`:""}: ${y.formatted??y.value??""} (${(t.active??0)+1}/${i})`:""),I;if($){let C=$.x*R,P=t.width*R,B=`clamp(${(4-C).toFixed(1)}px, -50%, calc(${(P-C-4).toFixed(1)}px - 100%))`,me=$.y<64;I={position:"absolute",left:C,top:$.y*R,transform:`translate(${B}, ${me?"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*R-8)}}let G=C=>{d.current=null,C.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},ne=C=>C?P=>{let B=d.current??(d.current=P.currentTarget.getBoundingClientRect());B.width&&C((P.clientX-B.left)/B.width*t.width,(P.clientY-B.top)/B.height*t.height,P)}:void 0,W=ne(e.onPointerMove),O=ne(e.onPointerDown),S=W||O?C=>{C.pointerType==="touch"&&W?.(C),O?.(C)}:void 0,N=ne(e.onPointerUp),re=Jn(e.theme);return(0,L.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?p:void 0,onBlur:C=>{t.via==="keyboard"&&!C.currentTarget.contains(C.relatedTarget)&&t.setActive(null)},onPointerLeave:G,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"),...re,...e.style},children:[t.pending?null:e.underlay,(0,L.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:W,onPointerDown:S,onPointerUp:N,onPointerCancel:N,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,L.jsx)("title",{id:o,children:u}),(0,L.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,L.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,$?(0,L.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:I,children:T??(0,L.jsxs)(L.Fragment,{children:[(0,L.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((C,P)=>(0,L.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,L.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(C.strong?"ink":"muted")},children:[C.color?(0,L.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:C.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,C.label]}),(0,L.jsx)("span",{style:{fontWeight:C.strong===!1?500:700},children:C.value})]},P))]})}):null,(0,L.jsx)("span",{className:"ztd-sr",style:Sr,"aria-live":"polite","aria-atomic":"true",children:v}),s&&!t.pending?m:null]})}function fi({label:e,events:t,t:n}){return(0,L.jsx)("div",{className:"ztd-sr",style:Sr,children:(0,L.jsxs)("table",{children:[(0,L.jsx)("caption",{children:n.table(e)}),(0,L.jsxs)("tbody",{children:[t.slice(0,bt).map((r,o)=>(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,L.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>bt?(0,L.jsx)("tr",{children:(0,L.jsx)("td",{colSpan:2,children:n.more(t.length-bt)})}):null]})]})})}function ee(e){let t=e.baseline??"central";return(0,L.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})}function Rr(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Ar(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 yt=new Map;function Z(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=yt.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let u=r.charCodeAt(l);Rr(u)?i+=Ar(u):s+=Ar(u)}a=i+s*(n>=600?1.07:1),yt.size>5e3&&yt.clear(),yt.set(o,a)}return a*t}function Ne(e,t,n,r=400){if(e=e.trim(),Z(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;Z(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<(Rr(s.charCodeAt(0))?2:3)?"":s+o}var te=A(E(),1),ve=10.5;function kt(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=>Me(i,{locale:n,maximumFractionDigits:a}))}function Pr(e,t,n){let r=18;for(let o of kt(e,t,n))r=Math.max(r,Z(o,ve));return Math.ceil(r+8)}function Nr(e){let{p:t,ticks:n,y:r,x0:o,x1:a,fmt:i}=e,s=e.side==="right",l=e.labels===!1?null:kt(n,i,e.locale);return(0,te.jsx)("g",{"aria-hidden":"true",opacity:e.opacity,children:n.map((u,h)=>{let m=Math.round(r(u))+.5,d=u===0&&e.zero!==!1;return(0,te.jsxs)("g",{children:[(0,te.jsx)("line",{x1:o,x2:a,y1:m,y2:m,stroke:t.paint(d?"dim":"line"),strokeWidth:1,shapeRendering:"crispEdges",opacity:d?.7:1}),l?(0,te.jsx)(ee,{x:s?a+6:o-6,y:m,anchor:s?"start":"end",size:ve,fill:t.paint("muted"),children:l[h]}):null]},u)})})}function Dr(e,t,n){let r=[],o=-1/0;for(let a of e){let i=Z(a.label,ve),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}var xt=e=>Math.round(e*10)/10;function Fr(e){let{p:t}=e;return(0,te.jsxs)("g",{className:"ztd-guide","aria-hidden":"true",pointerEvents:"none",style:{transform:`translate(${xt(e.x)}px,0px)`},children:[(0,te.jsx)("line",{x1:0,x2:0,y1:e.top,y2:e.bottom,stroke:t.paint("dim"),strokeWidth:1}),e.dots?.map(n=>(0,te.jsxs)("g",{className:"ztd-guide",style:{transform:`translate(0px,${xt(n.y)}px)`},children:[(0,te.jsx)("circle",{r:n.strong?9:7,fill:n.color,opacity:.2}),(0,te.jsx)("circle",{r:n.strong?4.2:3.2,fill:n.color,stroke:t.paint("panel"),strokeWidth:2})]},n.k))]})}function Lr(e){let{p:t}=e,n=Ne(e.label,160,ve,700),r=Z(n,ve,700)+14,o=Math.max(r/2+1,Math.min(e.width-r/2-1,e.x));return(0,te.jsxs)("g",{className:"ztd-guide","aria-hidden":"true",pointerEvents:"none",style:{transform:`translate(${xt(o)}px,${xt(e.y)}px)`},children:[(0,te.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,te.jsx)(ee,{x:0,y:0,anchor:"middle",size:ve,weight:700,fill:t.paint("onInk"),children:n})]})}var Ee=A(K(),1);var V=A(E(),1),hi={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}`},_r={en:hi,ko:{zoomHint:" Enter를 누르면 확대해요.",pickHint:" Enter를 누르면 이 구간을 골라요.",high:"최고",low:"최저",resetLabel:"전체 보기(확대 풀기)",reset:"전체 보기",extremes:(e,t)=>`, 최고 ${e}, 최저 ${t}`,range:(e,t)=>`${e}~${t}`}},gi=4;function pi(e){let[t,n]=(0,Ee.useState)(null),[r,o]=(0,Ee.useState)(!1),a=(0,Ee.useRef)(null),i=(0,Ee.useRef)(null),s=()=>{a.current=null,i.current=null,o(!1),n(null)},l=(d,p,g)=>!e.enabled||e.count<2||g.pointerType==="touch"||g.button!==0||!e.inPlot(d,p)?!1:(a.current={i:e.indexAt(d),x:d,moved:!1},g.currentTarget.setPointerCapture?.(g.pointerId),!0),u=d=>{let p=a.current;if(!p)return!1;if(!p.moved&&Math.abs(d-p.x)<gi)return!0;p.moved=!0;let g=e.indexAt(d),b=Math.min(p.i,g),c=Math.max(p.i,g);return o(!0),n(y=>y?.from===b&&y.to===c?y:{from:b,to:c}),!0},h=(d,p,g)=>{let b=a.current;if(a.current=null,g.currentTarget.hasPointerCapture?.(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId),!b)return;if(o(!1),!b.moved||g.type==="pointercancel"){t&&(n(null),e.onCommit(null));return}let c=e.indexAt(d),y={from:Math.min(b.i,c),to:Math.max(b.i,c)},$=y.to>y.from;n($&&e.keep!==!1?y:null),e.onCommit($?y:null)},m=(d,p)=>{if(!e.enabled)return!1;if(d.key==="Escape"&&t)return s(),e.onCommit(null),!0;if(d.key==="Enter"&&t&&i.current!==null)return i.current=null,e.keep===!1&&n(null),e.onCommit(t),!0;if(!d.shiftKey||d.key!=="ArrowLeft"&&d.key!=="ArrowRight"||e.count<2)return!1;let g=d.key==="ArrowRight"?1:-1,b=i.current??p??(g>0?0:e.count-1),c=t&&i.current!==null?t.from===b?t.to:t.from:b,y=Math.max(0,Math.min(e.count-1,c+g));return i.current=b,n(y===b?null:{from:Math.min(b,y),to:Math.max(b,y)}),!0};return{range:t,dragging:r,keyboard:t!==null&&i.current!==null,down:l,move:u,up:h,key:m}}function Br(e){let[t,n]=(0,Ee.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 Or(e,t,n){let r=_r[n.lang],o=e.brush==="zoom"?"zoom":e.brush?"select":null,a=pi({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,V.jsx)(bi,{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 vt(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e===0?null:(t-e)/Math.abs(e)}function wt(e,t=J){let n=Math.round(e*1e3)/10;return`${n>0?"+":""}${Me(n,{locale:t,maximumFractionDigits:1})}%`}function Ir(e){let{p:t,top:n,bottom:r}=e,o=Math.min(e.x0,e.x1),a=Math.max(e.x0,e.x1),i=Z(e.main,11.5,800),s=Z(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)),h=n+4;return(0,V.jsxs)("g",{pointerEvents:"none","aria-hidden":"true",children:[(0,V.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,V.jsx)("line",{x1:o,x2:o,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,V.jsx)("line",{x1:a,x2:a,y1:n,y2:r,stroke:t.paint("accent"),strokeWidth:1,opacity:.7}),(0,V.jsx)("rect",{x:u,y:h,width:l,height:22,rx:8,fill:t.paint("panel"),stroke:t.paint("line")}),(0,V.jsx)(ee,{x:u+8,y:h+11,size:11.5,weight:800,fill:t.paint("ink"),children:e.main}),(0,V.jsx)(ee,{x:u+8+i+6,y:h+11,size:10.5,weight:500,fill:t.paint("muted"),children:e.sub})]})}function zr(e){let{p:t,width:n,top:r,bottom:o,max:a,min:i}=e,s=_r[e.lang];return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Er,{p:t,x:a.x,y:a.y,text:`${s.high} ${a.text}`,below:a.y-26<r+30,width:n}),(0,V.jsx)(Er,{p:t,x:i.x,y:i.y,text:`${s.low} ${i.text}`,below:i.y+26<o,width:n})]})}function Er(e){let{p:t}=e,n=Z(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,V.jsxs)("g",{pointerEvents:"none","aria-hidden":"true",children:[(0,V.jsx)("circle",{cx:e.x,cy:e.y,r:3.5,fill:t.paint("ink"),stroke:t.paint("panel"),strokeWidth:2}),(0,V.jsx)("rect",{x:o,y:a,width:n,height:r,rx:9,fill:t.paint("ink")}),(0,V.jsx)(ee,{x:o+n/2,y:a+r/2,anchor:"middle",size:10.5,weight:700,fill:t.paint("onInk"),children:e.text})]})}function bi(e){let{p:t}=e;return(0,V.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 _=A(E(),1),_e=e=>Array.isArray(e)&&e.length===2;function Hr(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&_e(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var yi=(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 tn(e,t,n){let r=t[0],o=1/0;for(let a of t){let i=rn(e,a.x,a.y,a.anchor),s=n.reduce((l,u)=>l+yi(i,u),0);if(s<o&&(r=a,o=s),s===0)break}return n.push(rn(e,r.x,r.y,r.anchor)),r}var nn=(e,t)=>Math.max(e.x0,Math.min(e.x1,t)),xi=(e,t)=>t!==null&&t>=e.x0-1&&t<=e.x1+1;function Vr(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 jr(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 Wr(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 Kr={en:{forecast:"Forecast",trend:"Trend",period:"period",weekends:"weekends shaded",lead:"Annotations"},ko:{forecast:"예측",trend:"추세",period:"기간",weekends:"주말 음영",lead:"주석"}};function Gr({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"&&_e(a.y)){let s=jr(t,a.y);if(!s)return;let[l,u]=s;o.push((0,_.jsxs)("g",{children:[(0,_.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,_.jsx)("line",{x1:t.x0,x2:t.x1,y1:l,y2:l,stroke:n.paint("accent"),strokeOpacity:.45,strokeDasharray:"3 3"}),(0,_.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"&&_e(a.x)||a.type==="forecast"){let s;if(a.type==="forecast"){let h=Wr(t,a.from);s=h===null?null:[h,t.x1]}else s=Vr(t,a.x);if(!s)return;let l=nn(t,s[0]),u=nn(t,s[1]);if(u-l<.5)return;o.push((0,_.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 h=l.getTime();l.setDate(l.getDate()+2);let m=Math.max(t.x0,t.time.xt(h-s)),d=Math.min(t.x1,t.time.xt(l.getTime()-s));d>m&&o.push((0,_.jsx)("rect",{x:m,y:t.top,width:d-m,height:r,fill:n.paint("ink"),opacity:.045},`${i}w${u}`)),l.setDate(l.getDate()+5)}}}),(0,_.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:o})}var Ur=(e,t)=>Z(e,10.5,t?700:500)+8;function rn(e,t,n,r="start",o){let a=Ur(e,o);return{x:r==="end"?t-a:t,y:n-8,w:a,h:16}}function Xe({p:e,x:t,y:n,text:r,anchor:o="start",strong:a}){let i=rn(r,t,n,o,a);return(0,_.jsxs)("g",{children:[(0,_.jsx)("rect",{x:i.x,y:i.y,width:i.w,height:i.h,rx:5,fill:e.paint("panel"),opacity:.94}),(0,_.jsx)(ee,{x:i.x+4,y:n,size:10.5,weight:a?700:500,fill:e.paint(a?"ink":"muted"),children:r})]})}function Yr({list:e,g:t}){if(!e?.length)return null;let{p:n}=t,r=Kr[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 h=s.label?Ne(s.label,160,10.5):"",m=h?tn(h,[{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,_.jsxs)("g",{children:[(0,_.jsx)("line",{x1:t.x0,x2:t.x1,y1:u,y2:u,stroke:n.paint("dim"),strokeDasharray:"4 3"}),m?(0,_.jsx)(Xe,{p:n,x:m.x,y:m.y,text:h,anchor:m.anchor}):null]},l))}else if(s.type==="band"&&s.label){let u=_e(s.y)?jr(t,s.y):[t.top,t.bottom],h=_e(s.x)?Vr(t,s.x):[t.x0,t.x1];if(!h||!u)return;let[m,d]=u,p=Ne(s.label,160,10.5),g=Math.min(nn(t,h[0]),t.x1-40)+4,b=tn(p,[{x:g,y:m+11,anchor:"start"},{x:g,y:d-11,anchor:"start"}],i);o.push((0,_.jsx)(Xe,{p:n,x:b.x,y:b.y,text:p},l))}else if(s.type==="forecast"){let u=Wr(t,s.from);if(u===null)return;let h=Ne(s.label??r.forecast,120,10.5),m=Math.min(u+4,t.x1-50),d=tn(h,[{x:m,y:t.top+9,anchor:"start"},{x:m,y:t.bottom-9,anchor:"start"}],i);o.push((0,_.jsxs)("g",{children:[(0,_.jsx)("line",{x1:u,x2:u,y1:t.top,y2:t.bottom,stroke:n.paint("dim"),strokeDasharray:"2 3"}),(0,_.jsx)(Xe,{p:n,x:d.x,y:d.y,text:h})]},l))}else if(s.type==="event"&&s.label){let u=t.xAt(s.x);if(!xi(t,u))return;let h=Ne(s.label,140,10.5,700),m=Ur(h,!0),d=Math.max(t.x0,Math.min(u-m/2,t.x1-m)),p=a.findIndex(b=>b<d-4);p<0&&(p=a.length),a[p]=d+m;let g=t.top+9+p*18;o.push((0,_.jsxs)("g",{children:[(0,_.jsx)("line",{x1:u,x2:u,y1:g+8,y2:t.bottom,stroke:n.paint("ink"),strokeOpacity:.45,strokeDasharray:"2 3"}),(0,_.jsx)("circle",{cx:u,cy:t.bottom,r:2.5,fill:n.paint("ink"),opacity:.6}),(0,_.jsx)(Xe,{p:n,x:d,y:g,text:h,strong:!0})]},l))}else if(s.type==="trend"&&t.points){let u=t.points().filter(p=>Number.isFinite(p.x)&&Number.isFinite(p.y));if(u.length<2)return;let{at:h}=$r(u),m=u[0].x,d=u[u.length-1].x;o.push((0,_.jsxs)("g",{children:[(0,_.jsx)("line",{x1:m,x2:d,y1:h(m),y2:h(d),stroke:n.paint("muted"),strokeWidth:1.5,strokeDasharray:"6 4",strokeLinecap:"round"}),(0,_.jsx)(Xe,{p:n,x:d-2,y:h(d)-11,text:Ne(s.label??r.trend,120,10.5),anchor:"end"})]},l))}}),(0,_.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:o})}function Xr(e,t,n,r){if(!e?.length)return"";let o=Kr[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"&&_e(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"&&_e(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?", ":"; ")}.`:""}function on(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 qr(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=on(i,n),u=[o,a];for(let h=0;h<4;h++){let m=Math.ceil(a/l-1e-9)*l,d=Math.floor(o/l+1e-9)*l;u=[o===0?0:o-d<=l*.3?d:o-i*s,a===0?0:m-a<=l*.3?m:a+i*s];let p=on(u[1]-u[0],n);if(p===l)break;l=p}return u}function ki(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=on(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 an(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)=>ki(n,r,l),s}var vi=864e5;function Zr(e,t,n,r=J){let o=t-e;if(!(o>0))return[{t:e,label:Se(e,{locale:r,month:"short",day:"numeric"})}];let a=o/vi,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),u=(h,m,d,p=!1)=>{let g=new Date(h),b=-1,c=0;for(;g.getTime()<=t&&c++<500;){if(g.getTime()>=e){let y=g.getFullYear(),$=p&&!l&&y!==b;i.push({t:g.getTime(),label:Se(g,{locale:r,...d,...$?{year:"numeric"}:{}})}),b=y}m(g)}};if(a<=1.5){let h=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),m=[1,2,3,4,6,12].find(p=>p>=h)??12,d=new Date(s);d.setMinutes(0,0,0),u(d,p=>p.setHours(p.getHours()+m),{hour:"numeric"})}else if(a<=n*1.2){let h=new Date(s.getFullYear(),s.getMonth(),s.getDate());u(h,m=>m.setDate(m.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let h=new Date(s.getFullYear(),s.getMonth(),s.getDate());h.setDate(h.getDate()+(8-h.getDay())%7),u(h,m=>m.setDate(m.getDate()+7),{month:"numeric",day:"numeric"})}else{let h=a/30.44,m=Math.max(1,Math.ceil(h/Math.max(1,n))),d=[1,2,3,6,12,24,60].find(p=>p>=m)??120;if(d>=12){let p=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);u(p,g=>g.setFullYear(g.getFullYear()+d/12),{year:"numeric"})}else{let p=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),g=p.getMonth()%d;g&&p.setMonth(p.getMonth()+(d-g)),u(p,b=>b.setMonth(b.getMonth()+d),{month:"short"},!0)}}return i}var j=A(K(),1);var ae=A(K(),1);function wi(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Ci(e,t){let n=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=n*.5)}function eo(e,t=!0){let[n,r]=(0,ae.useState)({visible:!t,near:!t});return(0,ae.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=Ci(i[i.length-1],.25);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:wi(.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 Jr(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function to(e){let[t,n]=(0,ae.useState)(null),[r,o]=(0,ae.useState)(e??null),a=(0,ae.useCallback)(i=>{n(i),i&&e===void 0&&o(Jr(i))},[e]);return ge(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=u=>o(h=>h!==null&&Math.abs(h-u)<.5?h:u),s=()=>i(Jr(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(u=>{let h=u[u.length-1]?.contentRect;h?i(h.width>0?Math.round(h.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var $i=()=>()=>{};function Ct(){return(0,ae.useSyncExternalStore)($i,()=>!0,()=>!1)}var Qr="(prefers-reduced-motion: reduce)";function no(e="auto"){let[t,n]=(0,ae.useState)(()=>xe&&typeof window.matchMedia=="function"?window.matchMedia(Qr).matches:!1);return(0,ae.useEffect)(()=>{if(e!=="auto"||!xe||typeof window.matchMedia!="function")return;let r=window.matchMedia(Qr),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}function ro(e,t){let n=ke(e.theme),[r,o,a]=to(e.width),i=Ct(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,u=e.height??l,h=no(e.reducedMotion??"auto"),m=e.animate!==!1&&!h&&xe,d=eo(r,e.animateOnView!==!1&&m),p=ue(e.locale),g=X(p),b=(0,j.useMemo)(()=>Ge(e.format,p,t.format),[e.format,p,t.format]),c=(0,j.useCallback)(Y=>lt(Y,{locale:p}),[p]),y=(0,j.useMemo)(()=>zn(b,e.unit),[b,e.unit]),$=(0,j.useMemo)(()=>ir(e.data),[e.data]),[R,T]=(0,j.useState)(null),[v,I]=(0,j.useState)(null),G=(0,j.useRef)([]),ne=(0,j.useRef)(e.onHover);ne.current=e.onHover;let W=(0,j.useRef)(e.onClick);W.current=e.onClick;let O=(0,j.useRef)(null),S=(0,j.useRef)(null),N=(0,j.useRef)(null),re=(0,j.useCallback)((Y,de="pointer")=>{if(N.current!==Y){N.current=Y;let Je=Y===null?null:G.current[Y]??null;queueMicrotask(()=>ne.current?.(Je)),S.current?.(Y)}O.current=Y===null?null:de,T(Y),I(O.current)},[]),C=(0,j.useCallback)(Y=>{O.current!=="keyboard"&&(O.current=Y===null?null:"sync",T(Y),I(O.current))},[]),P=(0,j.useCallback)(Y=>{let de=G.current[Y];de&&W.current?.(de)},[]),B=Qn(e.replayKey),me=e.width!==void 0||(a??0)>0,U={enabled:m,active:d.visible&&me,near:d.near,replayKey:B,dataKey:$,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},z=(0,j.useCallback)((Y,de=1)=>R===null||R===Y?de:de*.38,[R]);return{p:n,width:s,height:u,measured:me,responsive:e.width===void 0,pending:xe&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:U,fv:y,fmt:b,pct:c,locale:p,lang:g,t:g==="ko"?Ln:Fn,active:R,via:v,setActive:re,click:P,events:G,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:z,sig:$,description:e.description,reduced:h,publish:S,applySync:C}}var H=A(K(),1);function Mi(e){return 1-Math.pow(1-e,3)}function Si(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function Ti(e){return e==="easeInOut"?Si:e==="linear"?t=>t:Mi}function Ai(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 Ve(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 $t(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 oo(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 ao(e,t,n,r){if(!t||!n||t.length!==n.length)return Ve(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 Ve(s,n[i]))o.push(l)}return o.length===r?o:Ve(e,r)}var Mt=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||!$t(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),oo(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=$t(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=ao(s.cur,s.parts,i.parts,u),s.vel=ao(s.curVel,s.parts,i.parts,u),s.parts=i.parts,s.to=i.to.slice(),oo(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=$t(s.from,s.to)&&s.vel.every(h=>Math.abs(h)<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=$t(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=Ve(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=Ti(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=Ve(s.from,u)),s.vel.length!==u&&(s.vel=Ve(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 m=0;m<u;m++)s.cur[m]=s.from[m],s.curVel[m]=0;s.progress=0,n=!0;continue}let h;if(this.easing==="spring"){let m=Math.exp(-a*l),d=a*l>=8&&a*l<20,p=0;for(let g=0;g<u;g++){let b=s.from[g]-s.to[g],c=s.vel[g]+a*b;s.cur[g]=s.to[g]+(b+c*l)*m,s.curVel[g]=(s.vel[g]-a*c*l)*m,d&&p<.15&&(p=Math.max(p,Math.abs(s.cur[g]-s.to[g]),Math.abs(s.curVel[g]/a)))}h=a*l>=20||d&&p<.15,s.progress=Math.min(1,1-(1+a*l)*m)}else{let m=Math.min(1,l/o),d=r(m),p=Ai(this.easing,m)/o;for(let g=0;g<u;g++)s.cur[g]=s.from[g]+(s.to[g]-s.from[g])*d,s.curVel[g]=(s.to[g]-s.from[g])*p;h=m>=1,s.progress=d}if(h){for(let m=0;m<u;m++)s.cur[m]=s.to[m],s.curVel[m]=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}},qe=new Set,St=0;function io(e){St=0;let t=Array.from(qe);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||qe.delete(n)}qe.size&&typeof requestAnimationFrame<"u"&&(St=requestAnimationFrame(io))}function so(e){return qe.add(e),!St&&typeof requestAnimationFrame<"u"&&(St=requestAnimationFrame(io)),()=>{qe.delete(e)}}function Ri(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 lo(e,t){let n=(0,H.useMemo)(()=>Ri(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:u=900,stagger:h=0}=t,m=(0,H.useRef)(null),d=(0,H.useRef)("init"),p=(0,H.useRef)(null),g=(0,H.useRef)(s),b=(0,H.useRef)(i),c=(0,H.useRef)(!1),y=(0,H.useRef)(0),[,$]=(0,H.useState)(0),R=(0,H.useRef)(null),T=(0,H.useRef)(!0);m.current||(m.current=new Mt,m.current.configure(l,u),m.current.snap(n),p.current=n);let v=m.current;if(v.configure(l,u),p.current!==n){let S=d.current,N=!Object.is(g.current,s);v.sameTargets(n)?v.refreshData(n):!r||S==="init"?v.snap(n):S==="idle"?v.hold(n):S==="running"||N?v.update(n,at(),h):v.snap(n),p.current=n,g.current=s}let I=(0,H.useRef)(()=>!1);I.current=S=>{if(!T.current)return!1;let N=v.step(S);return!N&&d.current==="running"&&(d.current="done"),$(re=>(re+1)%1e9),N||(R.current=null),N};let G=(0,H.useCallback)(()=>{if(!xe||R.current||!v.animating)return;let S=N=>I.current(N);R.current=so(S)},[v]);ge(()=>{let S=!Object.is(b.current,i);if(b.current=i,!r){(d.current!=="done"||v.animating)&&(v.snap(p.current??n),d.current="done",$(N=>N+1));return}d.current==="init"||S&&a?(v.hold(p.current??n),d.current="idle",c.current=!1,$(N=>N+1)):S&&(c.current=!0)},[r,i]),ge(()=>{!r||!a||!c.current||(c.current=!1,v.hold(p.current??n),d.current="idle",$(S=>S+1))},[a,r]),(0,H.useEffect)(()=>{r&&o&&d.current==="idle"&&(v.start(at()),y.current+=1,d.current="running",G(),$(S=>S+1))},[r,o,i,v,G]),(0,H.useEffect)(()=>{v.animating&&G()}),(0,H.useEffect)(()=>(T.current=!0,()=>{T.current=!1,R.current?.(),R.current=null}),[]);let ne=at(),W=v.elapsed(ne),O=r&&d.current==="idle";return{items:v.items(),get:S=>v.get(S),elapsed:O?0:W,fade:(S,N=320)=>O?0:Number.isFinite(W)?Math.max(0,Math.min(1,(W-S)/N)):1,waiting:O,animating:v.animating,generation:y.current}}var Pi=A(K(),1);var co=A(E(),1);var uo=e=>e?"neutralStrong":"accent";var sn=A(E(),1);function mo(e,t,n,r){if(typeof e!="function")return Te(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 ie=A(K(),1);var F=A(E(),1),Ni={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}, ${st(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},ln={en:Ni,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}일 이동평균`}},Tt=["ink","muted","dim"];function un(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Tt.length)}function Di(e,t,n){let r=ht(t.x,"date"),o=Ae(t.open,"open"),a=Ae(t.high,"high"),i=Ae(t.low,"low"),s=Ae(t.close,"close"),l=t.volume===void 0?null:Ae(t.volume,"volume"),u=t.dayFirst??Gn(e.map((c,y)=>r(c,y))),h=e.map((c,y)=>{let $=r(c,y),R=typeof $=="number"&&Math.abs($)<=1e10||typeof $=="string"&&/^\d{4}$/.test($.trim())?null:Oe($,u);return{d:c,i:y,xv:$,dt:R,t:R?R.getTime():y,c:s(c,y),o:o(c,y),h:a(c,y),l:i(c,y),v:l?l(c,y):NaN}}),m=h.every(c=>c.dt),d=h.filter(c=>Number.isFinite(c.c));m&&d.sort((c,y)=>c.t-y.t);let p=[],g=new Set,b=NaN;return d.forEach((c,y)=>{let $=Number.isFinite(c.o)?c.o:Number.isFinite(b)?b:c.c,R=Math.max($,c.c,Number.isFinite(c.h)?c.h:-1/0),T=Math.min($,c.c,Number.isFinite(c.l)?c.l:1/0),v=c.dt?Se(c.dt,{locale:n,year:"numeric",month:"short",day:"numeric"}):String(c.xv??y+1),I=c.dt?String(c.t):String(c.xv);g.has(I)&&(I=`${I}#${y}`),g.add(I),p.push({i:y,span:1,key:I,label:v,t:m?c.t:y,o:$,h:R,l:T,c:c.c,v:c.v,datum:c.d}),b=c.c}),{candles:p,dated:m}}function Fi(e,t){if(e.length<=t||t<2)return e;let n=Math.ceil(e.length/t),r=[];for(let o=0;o<e.length;o+=n){let a=e.slice(o,o+n),i=a[0],s=a[a.length-1],l=-1/0,u=1/0,h=0,m=!1;for(let d of a)l=Math.max(l,d.h),u=Math.min(u,d.l),Number.isFinite(d.v)&&(h+=d.v,m=!0);r.push({i:i.i,span:a.reduce((d,p)=>d+p.span,0),key:i.key,label:a.length>1?`${i.label} ~ ${s.label}`:i.label,t:i.t,o:i.o,h:l,l:u,c:s.c,v:m?h:NaN,datum:s.datum})}return r}function Li(e,t){let n=new Array(e.length).fill(NaN);if(t<1)return n;let r=0;for(let o=0;o<e.length;o++)r+=e[o],o>=t&&(r-=e[o-t]),o>=t-1&&(n[o]=r/t);return n}function At(e){let t=ro(e,{height:f=>Math.max(240,Math.min(340,f*.55)),duration:700,format:"number"}),{p:n,width:r,height:o}=t,a=(0,ie.useMemo)(()=>Di(e.data,e,t.locale),[e.data,e.x,e.open,e.high,e.low,e.close,e.volume,e.dayFirst,t.locale]),i=a.dated,s=Br(t.sig),l=s.view,u=(0,ie.useMemo)(()=>l?a.candles.slice(l[0],l[1]+1):a.candles,[a,l]),{up:h,down:m}=(0,ie.useMemo)(()=>{let f=(k,w)=>({fill:n.color(k,w),text:tr(n,n.raw(k,w))});return{up:f(e.upColor,"accent"),down:f(e.downColor,"neutralStrong")}},[n,e.upColor,e.downColor]),d=10,p=22,g=Math.max(40,r-56),b=Math.max(8,Math.round(e.maxCandles??g/4)),{cs:c,lo:y,hi:$,vmax:R,hasVolume:T}=(0,ie.useMemo)(()=>{let f=Fi(u,b),k=1/0,w=-1/0,D=0,Ce=!1;for(let ye of f)k=Math.min(k,ye.l),w=Math.max(w,ye.h),Number.isFinite(ye.v)&&(D=Math.max(D,ye.v),Ce=!0);let Fe=!Number.isFinite(k);return{cs:f,lo:Fe?0:k,hi:Fe?1:w,vmax:D,hasVolume:e.volume!==void 0&&Ce}},[u,b,e.volume]),v=c.length,I=T?Math.max(28,(o-d-p)*.18):0,G=o-p-(T?I+8:0),ne=Math.max(2,Math.round((G-d)/60)),W=Hr(e.annotations),O=e.yDomain??qr(Math.min(y,...W),Math.max($,...W),ne,{zero:!1}),S=Vn(e.format,t.locale,0),N=an(O,[0,1]).ticks(ne),re=Math.max(Pr(N,S,t.locale),Z(S($),10.5,700)+14)+4,C=4,P=r-re,B=v?(P-C)/v:1,me=Math.max(1,Math.min(18,B*.64)),U=f=>C+B*(f+.5),z=an(O,[G,d]),Y=f=>o-p-(R>0&&Number.isFinite(f)?f/R*I:0),de=(0,ie.useMemo)(()=>Te(e.highlight,c.map(f=>f.datum),c.map(f=>f.label),c.map(f=>f.c),"last"),[e.highlight,c]),Je=de.size?Math.max(...de):-1,je=Math.min(700,12*v),vo=(0,ie.useMemo)(()=>c.map((f,k)=>{let w=(z(f.o)+z(f.c))/2,D=o-p;return{key:f.key,to:[z(f.o),z(f.c),z(f.h),z(f.l),Y(f.v)],from:[w,w,w,w,D],enter:[w,w,w,w,D],delay:v>1?k/(v-1)*je:0,data:k}}),[c,o,O[0],O[1],I,R,je]),Qe=lo(vo,t.motion),mn=(0,ie.useMemo)(()=>{let f=a.candles.map(k=>k.c);return un(e.ma,f.length).map(k=>({d:k,v:Li(f,k)}))},[e.ma,a]),Be=(0,ie.useMemo)(()=>mn.map(f=>({d:f.d,v:c.map(k=>f.v[k.i+k.span-1])})),[mn,c]),wo=(0,ie.useMemo)(()=>Be.map(f=>{let k="";return f.v.forEach((w,D)=>{Number.isFinite(w)&&(k+=`${k?"L":"M"}${U(D).toFixed(1)},${z(w).toFixed(1)}`)}),k}),[Be,P,G,O[0],O[1]]),fe=t.fv,q=ln[t.lang],Co=(0,ie.useMemo)(()=>c.map((f,k)=>({datum:f.datum,index:k,key:f.key,label:f.label,value:f.c,formatted:q.ohlc(fe(f.o),fe(f.h),fe(f.l),fe(f.c))})),[c,fe,q]),$o=f=>f>0?c[f-1].c:NaN,dn=f=>Math.max(0,Math.min(v-1,Math.floor((f-C)/B))),{brush:be,frame:Mo,hint:So,text:et}=Or(e,s,{p:n,active:t.active,lang:t.lang,count:v,indexAt:dn,inPlot:(f,k)=>f>=C&&f<=P&&k>=d&&k<=o-p,toXRange:f=>{let k=c[f.from],w=c[f.to];return{from:k.i,to:w.i+w.span-1,fromKey:k.key,toKey:w.key,fromLabel:k.label,toLabel:w.label}}});Dn(t,e.syncId,c.map(f=>f.key),c.map(f=>f.label));let fn=null;if(t.active!==null&&c[t.active]&&!be.dragging){let f=c[t.active],k=vt($o(t.active),f.c),w=f.c>=f.o?h.fill:m.fill;fn={x:U(t.active),y:z(f.h),title:f.label,rows:[{label:q.open,value:t.fv(f.o),strong:!1},{label:q.high,value:t.fv(f.h),strong:!1},{label:q.low,value:t.fv(f.l),strong:!1},{label:q.close,value:t.fv(f.c),color:w},...k!==null?[{label:q.change,value:wt(k,t.locale)}]:[],...Number.isFinite(f.v)?[{label:q.volume,value:t.fmt(f.v),strong:!1}]:[]]}}let hn=null,gn;if(be.range&&be.range.to<v){let{from:f,to:k}=be.range,w=f,D=f;for(let he=f;he<=k;he++)c[he].h>c[w].h&&(w=he),c[he].l<c[D].l&&(D=he);let Ce=vt(c[f].o,c[k].c),Fe=Ce!==null?wt(Ce,t.locale):"-",ye=he=>i?Se(he.t,{locale:t.locale,month:"short",day:"numeric"}):he.label,tt=et.range(ye(c[f]),ye(c[k]));hn=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ir,{p:n,x0:U(f)-B/2,x1:U(k)+B/2,top:d,bottom:o-p,width:r,main:Fe,sub:tt,dragging:be.dragging}),(0,F.jsx)(zr,{p:n,lang:t.lang,width:r,top:d,bottom:G,max:{x:U(w),y:z(c[w].h),text:t.fv(c[w].h)},min:{x:U(D),y:z(c[D].l),text:t.fv(c[D].l)}})]}),be.dragging||(gn=`${q.span(c[f].label,c[k].label,Fe)}${et.extremes(t.fv(c[w].h),t.fv(c[D].l))}.${So}`)}let we=Je>=0?c[Je]:null,We=we?Math.max(d+8,Math.min(G-8,z(we.c))):null,pn=null;if(we&&We!==null){let f=we.c>=we.o?h:m,k=S(we.c),w=Z(k,10.5,700)+10;pn=(0,F.jsxs)("g",{pointerEvents:"none",opacity:Qe.fade(je+200,300),"aria-hidden":"true",children:[(0,F.jsx)("line",{x1:C,x2:P,y1:z(we.c),y2:z(we.c),stroke:f.fill,strokeWidth:1,strokeDasharray:"2 3",opacity:.85}),(0,F.jsx)("rect",{x:P+3,y:We-9,width:w,height:18,rx:5,fill:f.fill}),(0,F.jsx)(ee,{x:P+3+w/2,y:We,anchor:"middle",size:10.5,weight:700,fill:f.text,children:k})]})}let To=(0,ie.useMemo)(()=>{let f=[];if(v>1){let k=Math.max(2,Math.floor((P-C)/80));if(i){let w=0;for(let D of Zr(c[0].t,c[v-1].t,k,t.locale)){for(;w<v-1&&c[w+1].t<=D.t;)w++;f.push({x:U(w),label:D.label})}}else{let w=Math.max(1,Math.ceil(v/k));for(let D=0;D<v;D+=w)f.push({x:U(D),label:c[D].label})}}return Dr(f,0,P+2)},[c,i,P,t.locale]),Ao=(0,ie.useMemo)(()=>{if(!v)return`${q.name}. ${q.empty}`;let f=vt(c[0].o,c[v-1].c);return`${q.name}. ${q.desc(c[0].label,c[v-1].label,v,fe(c[0].o),fe(c[v-1].c))}${f!==null?` (${wt(f,t.locale)})`:""}${et.extremes(fe($),fe(y))}.`},[c,v,y,$,fe,t.locale,q,et]),bn=Tt.map(f=>n.paint(f)),yn=v>1&&(c[v-1].t-c[0].t)/(v-1)||1,xn=f=>{if(f<=c[0].t)return U(0)-(c[0].t-f)/yn*B;if(f>=c[v-1].t)return U(v-1)+(f-c[v-1].t)/yn*B;let k=0,w=v-1;for(;w-k>1;){let D=k+w>>1;c[D].t<=f?k=D:w=D}return U(k)+(f-c[k].t)/(c[w].t-c[k].t||1)*B},kn=f=>{let k=i?Oe(f)?.getTime():void 0;return c.findIndex(w=>i?w.t===k:w.key===String(f)||w.label===String(f))},Ro=f=>{if(!v)return null;if(i){let w=Oe(f);return w?xn(w.getTime()):null}let k=kn(f);return k<0?null:U(k)},Po=f=>c[kn(f)]?.label??String(f??""),vn={p:n,lang:t.lang,xAt:Ro,half:B/2,y:z,x0:C,x1:P,top:d+(Be.length?14:0),bottom:G,time:i&&v>1?{t0:c[0].t,t1:c[v-1].t,n:v,xt:xn}:void 0,points:()=>c.map((f,k)=>({x:U(k),y:z(f.c)}))},wn=t.active!==null&&c[t.active]?t.active:v-1,Cn=C+2,No=Be.map((f,k)=>{let w=`${q.ma(f.d)} ${Number.isFinite(f.v[wn])?S(f.v[wn]):"-"}`,D=(0,F.jsx)(ee,{x:Cn,y:d+2,size:10,weight:700,fill:bn[k],children:w},f.d);return Cn+=Z(w,10,700)+10,D});return(0,F.jsxs)(Tr,{c:t,kind:q.name,ariaLabel:e.ariaLabel,description:e.description??`${Ao}${Xr(e.annotations,t.lang,t.fv,Po)}`,events:Co,tip:fn,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(f,k,w)=>{v&&(be.move(f),t.setActive(dn(f),w.pointerType==="touch"?"touch":"pointer"))},...Mo,announce:gn,children:[(0,F.jsx)(Nr,{p:n,ticks:N,y:z,x0:C,x1:P,fmt:S,locale:t.locale,side:"right",zero:!1,labels:!1}),(0,F.jsx)("g",{"aria-hidden":"true",children:kt(N,S,t.locale).map((f,k)=>We!==null&&Math.abs(z(N[k])-We)<14?null:(0,F.jsx)(ee,{x:P+6,y:Math.round(z(N[k]))+.5,size:ve,fill:n.paint("muted"),children:f},N[k]))}),(0,F.jsx)("rect",{x:C,y:d,width:Math.max(0,P-C),height:Math.max(0,o-p-d),fill:"transparent"}),(0,F.jsx)(Gr,{list:e.annotations,g:vn}),T?(0,F.jsx)("line",{x1:C,x2:P,y1:o-p+.5,y2:o-p+.5,stroke:n.paint("line")}):null,Qe.items.map(f=>{let k=f.data,w=c[k];if(!w)return null;let[D,Ce,Fe,ye,tt]=f.v,Rt=w.c>=w.o?h.fill:m.fill,nt=U(k),Do=Math.min(D,Ce),Fo=Math.max(1,Math.abs(Ce-D)),Lo=t.active!==null&&t.active!==k?.55:1;return(0,F.jsxs)("g",{opacity:f.exiting?.3:Lo,children:[T&&Number.isFinite(w.v)?(0,F.jsx)("rect",{x:nt-me/2,y:tt,width:me,height:Math.max(0,o-p-tt),fill:Rt,opacity:.32}):null,(0,F.jsx)("line",{x1:nt,x2:nt,y1:Fe,y2:ye,stroke:Rt,strokeWidth:1}),(0,F.jsx)("rect",{x:nt-me/2,y:Do,width:me,height:Fo,rx:me>=6?1.5:0,fill:Rt})]},f.key)}),wo.map((f,k)=>f?(0,F.jsx)("path",{d:f,fill:"none",stroke:bn[k],strokeWidth:k===0?1.4:1.2,strokeLinejoin:"round",opacity:Qe.fade(je,400)*.9,pointerEvents:"none"},Be[k].d):null),Be.length>0?(0,F.jsx)("g",{"aria-hidden":"true",opacity:Qe.fade(je,400),children:No}):null,(0,F.jsx)(Yr,{list:e.annotations,g:vn}),pn,t.active!==null&&c[t.active]&&!be.dragging?(0,F.jsx)(Fr,{p:n,x:U(t.active),top:d,bottom:o-p,dots:[{k:0,y:z(c[t.active].c),color:c[t.active].c>=c[t.active].o?h.fill:m.fill,strong:!0}]}):null,hn,(0,F.jsx)("g",{"aria-hidden":"true",children:To.map((f,k)=>(0,F.jsx)(ee,{x:f.x,y:o-p+13,anchor:"middle",size:ve,fill:n.paint("muted"),children:f.label},k))}),t.active!==null&&c[t.active]&&!be.dragging?(0,F.jsx)(Lr,{p:n,x:U(t.active),y:o-p+13,label:c[t.active].label,width:r}):null]})}var Ei=A(K(),1);var po=A(E(),1),_i={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${st(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Bi={en:_i,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},fo=(e,t)=>Bi[e].other(t);function ho(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,Cr(o.map(a=>a.value)))}}var go=e=>Number.isFinite(e)&&e>0?e:0;var De=A(E(),1);function bo(e,t){let n=pt(e);return n?.type==="scatter"&&t?.size!==void 0?pt("bubble"):n}function Oi(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 Ii(e,t,n,r=!1){let o=bo(e.type,e.encoding);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&Qt.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),u=m=>m.filter(d=>!l.has(d.label)),h=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(h.includes(o.type)){let m=gt(a.label,"label"),d=Ae(a.value,"value"),p=o.type==="waffle",g=t.map((T,v)=>({r:T,label:m(T,v),value:p?d(T,v):go(d(T,v))})),{kept:b,other:c}=p?{kept:g,other:null}:ho(g,i.other,(T,v)=>({r:{},label:fo(X(n),T),value:v})),y=Te(s,b.map(T=>T.r),b.map(T=>T.label),b.map(T=>T.value),p?"first":"max"),$=c?[...b,c]:b,R=Ue($.length,y);return $.map((T,v)=>({label:T.label,color:R[v]}))}if(o.type==="candlestick"){let m=un(Array.isArray(i.ma)?i.ma:void 0,t.length),d=ln[X(n)];return[{label:d.up,color:i.upColor??"accent"},{label:d.down,color:i.downColor??"neutralStrong"},...m.map((p,g)=>({label:d.maLegend(p),color:Tt[g],shape:"line"}))]}if(o.type==="scatter"){if(typeof a.series!="string")return[];let m=gt(a.series,"series"),d=Xt(t.map((g,b)=>m(g,b)));if(d.length<2)return[];let p=nr(d.length,mo(s,t,d,m));return u(d.map((g,b)=>({label:g,color:p[b],shape:"circle"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let m=[];if(Array.isArray(a.y))m=a.y;else if(typeof a.series=="string"){let b=gt(a.series,"series");m=Xt(t.map((c,y)=>b(c,y)))}let d=en(o.type,a,i);if(d.length){let b=Ue(m.length,Te(s,m,m,m.map(()=>0),"none")),c=m.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:m.map((y,$)=>({label:y,color:b[$]}));return[...u(c),...d.map((y,$)=>({label:y,color:uo($),shape:"line"}))]}if(m.length<2)return[];let p=Te(s,m,m,m.map(()=>0),"first");if(o.type==="line"||o.type==="radar")return u(m.map((b,c)=>({label:b,color:p.has(c)?"accent":"neutralStrong",shape:o.type==="line"?"line":"square"})));let g=Ue(m.length,p);return u(m.map((b,c)=>({label:b,color:g[c]})))}return[]}function yo(e,t){let{spec:n}=e,r=bo(n.type,n.encoding),o=(0,Ze.useMemo)(()=>Mr(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=xr(n,e.locale),s=ue(i),l=X(s),u=sr(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),h=vr(n),m=(0,Ze.useMemo)(()=>h?hr(h,s):void 0,[h,s]),d=n.options?.hidden,p=Array.isArray(d)?d.map(String):[],g=p.join(""),[b,c]=(0,Ze.useState)(null);if(!r)return(0,De.jsx)(Yt,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let y=o??u.data,$=t[r.type],R={...n.options??{}},T={...Oi(r,n.encoding),...R,...m?{tooltip:m}:{},data:y,...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"&&kr(r.type,n.encoding??{},R),I=b&&b.base===g?b.hidden:p;v&&(T.hidden=I);let G=S=>c(N=>{let re=N&&N.base===g?N.hidden:p;return{base:g,hidden:re.includes(S)?re.filter(C=>C!==S):[...re,S]}}),ne=T.height??220,W=a&&!y.length&&(u.loading||u.error||u.empty)?(0,De.jsx)(Yt,{loading:u.loading,error:u.error,empty:u.empty,onRetry:u.reload,height:ne,locale:i}):(0,De.jsx)($,{...T});if(n.card){let S=n.card,N=S.legend==="auto"||S.legend==="toggle"?Ii(n,y,s,v):S.legend,re=N?.length?v?(0,De.jsx)(Ut,{items:N,hidden:I,onToggle:G,locale:i}):N:void 0,C=S.download?(0,De.jsx)(fr,{data:y,columns:wr(n),filename:S.title??r.type,formats:Array.isArray(S.download)?S.download:void 0,locale:i}):void 0;W=(0,De.jsx)(er,{number:S.number,title:S.title??yr(r,l),subtitle:S.subtitle,legend:re,actions:C,source:S.source||void 0,note:S.note||void 0,accent:S.accent,takeaway:S.takeaway,level:S.level,sample:S.sample,replay:S.replay!==!1,className:e.className,locale:i,children:W})}let O=e.theme??n.theme;return O&&(W=(0,De.jsx)(mt,{theme:O,children:W})),W}function zi({cfg:e,components:t}){let n=Ct();return yo({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function ko(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,xo.hydrateRoot)(r,(0,cn.createElement)(mt,{theme:o.theme,cssVars:!0},(0,cn.createElement)(zi,{cfg:o,components:{[e]:t}})))}ko("candlestick",At);})();
|