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