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