ztd-charts-cli 0.10.0 → 0.11.1

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 (48) hide show
  1. package/dist/api.js +1 -1
  2. package/dist/{chunk-QVGOP3IE.js → chunk-JTT5G6KW.js} +1 -1
  3. package/dist/cli.js +1 -1
  4. package/dist/client/area.js +6 -6
  5. package/dist/client/bar.js +5 -5
  6. package/dist/client/barRace.js +2 -2
  7. package/dist/client/beeswarm.js +2 -2
  8. package/dist/client/box.js +6 -6
  9. package/dist/client/bubble.js +6 -6
  10. package/dist/client/bullet.js +5 -5
  11. package/dist/client/bump.js +6 -6
  12. package/dist/client/calendar.js +5 -5
  13. package/dist/client/candlestick.js +4 -4
  14. package/dist/client/chord.js +5 -5
  15. package/dist/client/choropleth.js +5 -5
  16. package/dist/client/donut.js +6 -6
  17. package/dist/client/dumbbell.js +2 -2
  18. package/dist/client/flowMap.js +4 -4
  19. package/dist/client/funnel.js +2 -2
  20. package/dist/client/gauge.js +2 -2
  21. package/dist/client/heatmap.js +5 -5
  22. package/dist/client/histogram.js +5 -5
  23. package/dist/client/line.js +6 -6
  24. package/dist/client/lollipop.js +5 -5
  25. package/dist/client/marimekko.js +6 -6
  26. package/dist/client/network.js +5 -5
  27. package/dist/client/parallel.js +6 -6
  28. package/dist/client/pareto.js +5 -5
  29. package/dist/client/pie.js +6 -6
  30. package/dist/client/radar.js +6 -6
  31. package/dist/client/radialBar.js +2 -2
  32. package/dist/client/ridgeline.js +4 -4
  33. package/dist/client/sankey.js +4 -4
  34. package/dist/client/scatter.js +6 -6
  35. package/dist/client/segmented.js +2 -2
  36. package/dist/client/skyline.js +2 -2
  37. package/dist/client/slope.js +5 -5
  38. package/dist/client/sparkline.js +6 -6
  39. package/dist/client/stream.js +6 -6
  40. package/dist/client/sunburst.js +2 -2
  41. package/dist/client/symbolMap.js +5 -5
  42. package/dist/client/tileMap.js +6 -6
  43. package/dist/client/timeline.js +10 -10
  44. package/dist/client/tree.js +5 -5
  45. package/dist/client/treemap.js +2 -2
  46. package/dist/client/waffle.js +5 -5
  47. package/dist/client/waterfall.js +5 -5
  48. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- (()=>{var Pa=Object.create;var Ur=Object.defineProperty;var La=Object.getOwnPropertyDescriptor;var _a=Object.getOwnPropertyNames;var Da=Object.getPrototypeOf,Ea=Object.prototype.hasOwnProperty;var Gn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Oa=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _a(t))!Ea.call(e,o)&&o!==n&&Ur(e,o,{get:()=>t[o],enumerable:!(r=La(t,o))||r.enumerable});return e};var C=(e,t,n)=>(n=e!=null?Pa(Da(e)):{},Oa(t||!e||!e.__esModule?Ur(n,"default",{value:e,enumerable:!0}):n,e));var U=Gn((Oc,Yr)=>{Yr.exports=globalThis.__ztdReact.react});var Jr=Gn((Ic,qr)=>{qr.exports=globalThis.__ztdReact["react-dom/client"]});var I=Gn((Zc,Mo)=>{Mo.exports=globalThis.__ztdReact["react/jsx-runtime"]});var _r=C(U(),1),pa=C(Jr(),1);var Gt=C(U(),1);var pn=C(U(),1);var Zr=C(U(),1),ct=(0,Zr.createContext)(void 0);var no=C(U(),1);var Ia=["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Qr='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',eo='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',Xe={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",accent2:"#FF8CC1",accent3:"#38C6F6",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:Qr,monoFamily:eo,radius:18,radiusCode:14,radiusMark:4},Vn={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",accent2:"#D8488C",accent3:"#659815",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:Qr,monoFamily:eo,radius:18,radiusCode:14,radiusMark:4},Wn={dark:Xe,light:Vn};function Ft(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Kn(e){let t={};for(let n of Ia){let r=e[n];typeof r=="string"&&(t[Ft(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 Xn(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 za=`
1
+ (()=>{var Pi=Object.create;var Ur=Object.defineProperty;var Li=Object.getOwnPropertyDescriptor;var _i=Object.getOwnPropertyNames;var Di=Object.getPrototypeOf,Ei=Object.prototype.hasOwnProperty;var Gn=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Oi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _i(t))!Ei.call(e,o)&&o!==n&&Ur(e,o,{get:()=>t[o],enumerable:!(r=Li(t,o))||r.enumerable});return e};var S=(e,t,n)=>(n=e!=null?Pi(Di(e)):{},Oi(t||!e||!e.__esModule?Ur(n,"default",{value:e,enumerable:!0}):n,e));var U=Gn((Ic,Yr)=>{Yr.exports=globalThis.__ztdReact.react});var Jr=Gn((zc,qr)=>{qr.exports=globalThis.__ztdReact["react-dom/client"]});var I=Gn((Qc,To)=>{To.exports=globalThis.__ztdReact["react/jsx-runtime"]});var _r=S(U(),1),pi=S(Jr(),1);var Gt=S(U(),1);var pn=S(U(),1);var Zr=S(U(),1),ct=(0,Zr.createContext)(void 0);var no=S(U(),1);var Ii=["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"],Qr='"Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif',eo='"Roboto Mono", "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace',Xe={name:"dark",bg:"#14171B",panel:"#14171B",ink:"#F1F3F5",muted:"#A3ABB5",dim:"#5B636D",accent:"#D6FD70",accentText:"#D6FD70",onAccent:"#14171B",accent2:"#FF8CC1",accent3:"#38C6F6",onInk:"#14171B",line:"#2A2F36",line2:"#22272D",neutral:"#3A414A",neutralStrong:"#5F6772",onNeutralStrong:"#F1F3F5",neutralSoft:"#262B31",lift:"#1D2126",tint:"rgba(214, 253, 112, 0.14)",fontFamily:Qr,monoFamily:eo,radius:18,radiusCode:14,radiusMark:4},Vn={name:"light",bg:"#FFFFFF",panel:"#FFFFFF",ink:"#14171B",muted:"#5D6570",dim:"#B3B9C2",accent:"#0B8FD8",accentText:"#006DA8",onAccent:"#14171B",accent2:"#D8488C",accent3:"#659815",onInk:"#FFFFFF",line:"#E6E9ED",line2:"#F0F2F5",neutral:"#D5DAE0",neutralStrong:"#9AA3AE",onNeutralStrong:"#14171B",neutralSoft:"#EEF1F4",lift:"#F4F6F8",tint:"rgba(11, 143, 216, 0.12)",fontFamily:Qr,monoFamily:eo,radius:18,radiusCode:14,radiusMark:4},Wn={dark:Xe,light:Vn};function Ft(e){return`--ztd-${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`}function Kn(e){let t={};for(let n of Ii){let r=e[n];typeof r=="string"&&(t[Ft(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 Xn(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 zi=`
2
2
  .ztd-root{position:relative;-webkit-tap-highlight-color:transparent}
3
3
  .ztd-root:focus{outline:none}
4
4
  .ztd-root:focus-visible{outline:2px solid var(--ztd-accent,${Xe.accent});outline-offset:3px;border-radius:6px}
@@ -19,10 +19,10 @@
19
19
  @keyframes ztd-pulse{0%,100%{opacity:.55}50%{opacity:1}}
20
20
  .ztd-skeleton{animation:ztd-pulse 1.4s ease-in-out infinite}
21
21
  @media (prefers-reduced-motion: reduce){.ztd-skeleton{animation:none}}
22
- `;function en(e,t,n,r,o){if(e)return t?{opacity:0}:{animation:`ztd-${n} ${Math.round(o)}ms cubic-bezier(.22,.9,.3,1) ${Math.round(r)}ms backwards`}}function tn(e,t){let[n]=(0,no.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var to=!1;function Rt(){if(to||typeof document>"u"||(to=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=za,document.head.appendChild(e)}var nn=C(U(),1),Pe=typeof window<"u"&&typeof document<"u",Ie=Pe?nn.useLayoutEffect:nn.useEffect;function rn(){return typeof performance<"u"?performance.now():Date.now()}function Y(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Ae(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var ro={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},oo={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Ba=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],Ha={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function ja(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Ga(e){return ja(Ba,e)}function io(e,t){let n=Ga(e);return{text:n?n[t]:e,...Ha[n?.id??"basic"]}}var ao={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ue(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),ao[t.toLowerCase()]&&(t=ao[t.toLowerCase()]),t.startsWith("#")){let o=t.slice(1);if((o.length===3||o.length===4)&&(o=o.split("").map(a=>a+a).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(s=>s.endsWith("%")?parseFloat(s)/100*255:parseFloat(s)),a=o[3]!==void 0?o[3].endsWith("%")?parseFloat(o[3])/100:parseFloat(o[3]):1;return i.some(s=>Number.isNaN(s))?null:[i[0],i[1],i[2],Number.isNaN(a)?1:a]}return null}function Yn(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 on(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 ut(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function so(e){return .2126*ut(e[0])+.7152*ut(e[1])+.0722*ut(e[2])}function qn(e,t,n){let r=typeof e=="string"?Ue(e):e,o=typeof t=="string"?Ue(t):t;if(!r||!o)return 0;let i=n?typeof n=="string"?Ue(n):n:null;o[3]<1&&i&&(o=on(o,i));let a=r[3]<1?on(r,o):r,s=so(a),l=so(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Va(e){return[ut(e[0]),ut(e[1]),ut(e[2])]}function Un(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 lo(e){let[t,n,r]=Va(e),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return[.2104542553*o+.793617785*i-.0040720468*a,1.9779984951*o-2.428592205*i+.4505937099*a,.0259040371*o+.7827717662*i-.808675766*a]}function Wa([e,t,n],r){let o=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[Un(4.0767416621*o-3.3077115913*i+.2309699292*a),Un(-1.2684380046*o+2.6097574011*i-.3413193965*a),Un(-.0041960863*o-.7034186147*i+1.707614701*a),r]}function an(e,t,n){let r=Ue(e),o=Ue(t);if(!r||!o)return e;let i=lo(r),a=lo(o),s=Math.max(0,Math.min(1,n));return Yn(Wa([i[0]*s+a[0]*(1-s),i[1]*s+a[1]*(1-s),i[2]*s+a[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function Jn(e,t,n){let r=t[0],o=-1;for(let i of t){let a=qn(i,e,n);a>o&&(o=a,r=i)}return r}function Ka(e,t,n){let r=Ue(e),o=Ue(t);return!r||!o?e:Yn(on([r[0],r[1],r[2],n],o))}function J(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 co(e,t){let n=Jn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return qn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Jn(t,["#FFFFFF","#000000"])}var Xa={accent:"accent",ink:"ink",strong:"neutralStrong",neutral:"neutral",soft:"neutralSoft"};function uo(e,t){return e.role==="mix"?e.raw:t(Ft(Xa[e.role]),e.raw)}function sn(e,t){let n=an(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:co(e,n),raw:n}}function Le(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=J(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{if(i===1)r[a]=J(e,"neutral");else if(s===0)r[a]=J(e,"ink");else if(s===i-1)r[a]=J(e,"neutral");else if(i===3)r[a]=J(e,"strong");else{let l=(s-1)/Math.max(1,i-2);r[a]=l<=.001?J(e,"strong"):sn(e,1-l)}}),r}var Zn="mix:";function Ye(e){return e({theme:Vn,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Zn}${o}`}).map(n=>n.fill)}function mo(e,t){return t?.startsWith(Zn)?e.mix("neutralStrong","neutral",Number(t.slice(Zn.length))):e.color(t)}function tt(e,t,n){return Le(e,t+1,n).slice(0,t)}function fo(e,t,n,r="neutral"){let o=J(e,"accent"),i=J(e,r);return Array.from({length:t},(a,s)=>n.has(s)?o:i)}function ho(e,t,n){let r=new Array(t),o=[];for(let a=0;a<t;a++)n.has(a)?r[a]=J(e,"accent"):o.push(a);let i=o.length;return o.forEach((a,s)=>{i===1?r[a]=J(e,"neutral"):s===0?r[a]=J(e,"strong"):s===i-1?r[a]=J(e,"neutral"):r[a]=sn(e,1-s/(i-1))}),r}function Ua(e,t,n=.1,r="accent"){let o=Math.max(0,Math.min(1,t)),i=n+(1-n)*o,a=Ka(e.theme[r],e.theme.panel,i);return{fill:e.paint(r),opacity:i,text:co(e,a),raw:a}}function Qn(e,t){let n=t.reverse?t.center===void 0?1-e:-e:e;if(t.steps){let r=t.center===void 0?0:-1,o=Math.max(0,Math.min(t.steps-1,Math.floor((n-r)/(1-r)*t.steps)));n=r+(1-r)*o/(t.steps-1)}return n}function Pt(e,t,n,r){let o=Qn(t,r);return Ua(e,Math.abs(o),n,o<0?"neutralStrong":"accent")}function ln(e,t,n){return{reverse:e,center:t,steps:n===void 0?void 0:Math.max(2,Math.min(12,Math.round(n)))}}var _e=C(U(),1);var un=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),he="en-US",go=new Map;function er(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=go.get(r);return o||(o=new Intl.NumberFormat(e,n),go.set(r,o)),o}function tr(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function ye(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=he,...r}=t;return tr(er(n,r).format(e))}var nr=e=>e!==0&&Math.abs(e)<.05,rr=(e,t,n="")=>`${ye(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function cn(e,t={}){if(!Number.isFinite(e))return"-";if(nr(e)&&t.maximumFractionDigits===void 0)return rr(e,t.locale??he,"%");let n=Math.abs(e);return`${ye(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function xo(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=he,...r}=t;if(Y(n)==="ko"){let o=Math.abs(e),i=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],a=i.findIndex(([s])=>o>=s);for(a<0&&(a=i.length-1);;){let[s,l]=i[a],c=o/s,m=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**m)/10**m;if(a>0&&u>=i[a-1][0]/s){a--;continue}return(e<0&&u!==0?"-":"")+ye(u,{locale:n,...r,maximumFractionDigits:m})+l}}return tr(er(n,{notation:"compact",...r}).format(e))}var Ya=(e,t=Y(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function nt(e,t=he,n){if(typeof e=="function")return e;let r=(o,i="",a="")=>{let s=er(t,o);return l=>Number.isFinite(l)?`${a}${tr(s.format(l))}${i}`:"-"};if(e&&typeof e=="object"){let{suffix:o="",prefix:i="",...a}=e;return r(a,o,i)}switch(e??n){case"integer":return r({maximumFractionDigits:0});case"decimal":return r({minimumFractionDigits:1,maximumFractionDigits:2});case"percent":return o=>cn(o,{locale:t});case"ratio":return o=>cn(o*100,{locale:t});case"compact":return o=>xo(o,{locale:t});case"currency":return r(Ya(t));default:{let o=r({maximumFractionDigits:1});return i=>nr(i)?rr(i,t):o(i)}}}function rt(e,t=he,n=0){return e!==void 0?nt(e,t):n>=1e5?r=>nr(r)?rr(r,t):xo(r,{locale:t}):r=>ye(r,{locale:t})}function qa(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var or=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Ja=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Za=["january","february","march","april","may","june","july","august","september","october","november","december"],po=e=>{let t=e.toLowerCase();return t.length<3?0:Za.findIndex(n=>n.startsWith(t))+1},bo=e=>+e+(+e<30?2e3:1900);function ko(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Qa=[/^(\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})일)?$/],wo=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,vo=/\{([^{}]+)\}/g;function mn(e,t){let n;for(let r of Qa)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?[bo(n[3]),+n[2],+n[1],1]:[bo(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=wo.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=po(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=po(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var $o=e=>Ja.test(e)||mn(e)!==null;function To(e){let t;for(let n of e){let r=typeof n=="string"?wo.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function dn(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(or(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return dn(`${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=mn(n,t);if(r)return qa(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 yo=new Map;function Lt(e,t={month:"short",day:"numeric"}){let n=dn(e);if(!n)return"-";let{locale:r=he,...o}=t,i=r+JSON.stringify(o),a=yo.get(i);return a||(a=new Intl.DateTimeFormat(r,o),yo.set(i,a)),a.format(n)}var ir=C(I(),1),fn=(0,_e.createContext)({theme:Xe,cssVars:!0});function es(e,t=Xe){return e?typeof e=="string"?Wn[e]??t:Xn(t,e):t}function hn(e){let t=(0,_e.useContext)(fn),n=e.base?Wn[e.base]:t.theme,r=(0,_e.useMemo)(()=>es(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,i=e.locale??t.locale,a=(0,_e.useMemo)(()=>({theme:r,cssVars:o,locale:i}),[r,o,i]),s=(0,_e.useMemo)(()=>Kn(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,ir.jsx)(fn.Provider,{value:a,children:(0,ir.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var ts=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function Co(e){return ts.has(e)}function ns(e,t){let n=r=>t?`var(${Ft(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?Co(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?Co(r)?e[r]:r:e[o],mix:(r,o,i)=>{let a=Math.round(Math.max(0,Math.min(1,i))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${a}%, ${n(o)})`:an(e[r],e[o],i)}}}function xe(e){let t=(0,_e.useContext)(fn);return(0,_e.useMemo)(()=>{let n=Xn(t.theme,e);return ns(n,t.cssVars)},[t.theme,t.cssVars,e])}function ke(e){let t=(0,_e.useContext)(fn);return e??t.locale??he}function So(e){return e?Kn(e):{}}var gn=C(U(),1),ar=(0,gn.createContext)(void 0);function Ao(e){let t=(0,gn.useContext)(ar);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var F=C(I(),1),rs={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},os={en:rs,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var is={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},sr=e=>os[Y(ke(e))];function lr(e){let t=xe(e.theme),n=sr(e.locale),[r,o]=(0,pn.useState)(!1),i=e.size??11.5,a=e.onToggle,s=new Set(a?e.hidden:void 0),l=e.items.filter(m=>!s.has(m.label)).length,c=(0,F.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((m,u)=>{let d=!s.has(m.label),h=d&&l===1,f=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(as,{p:t,item:m,off:!d}),(0,F.jsx)("span",{style:d?void 0:{textDecoration:"line-through"},children:m.label})]});return(0,F.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:i,color:t.paint("muted"),lineHeight:1.3},children:a?(0,F.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":d,"aria-disabled":h||void 0,onClick:()=>{h||(a(m.label),o(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:h?"default":void 0},children:f}):f},u)})});return a?(0,F.jsxs)(F.Fragment,{children:[c,(0,F.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:is,children:r?n.shown(l,e.items.length):""})]}):c}function as({p:e,item:t,off:n}){let r=mo(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,F.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,F.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,F.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,F.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function ss(e){let t=xe(e.theme),n=io(e.level,Y(ke(e.locale)));return(0,F.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function ls(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,F.jsxs)(F.Fragment,{children:[e.slice(0,r),(0,F.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function No(e){let t=xe(e.theme),n=sr(e.locale),[r,o]=(0,pn.useState)(0);Ie(()=>Rt(),[]);let i=()=>{o(d=>d+1),e.onReplay?.()},a=Array.isArray(e.legend)?(0,F.jsx)(lr,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,m=e.source!==void 0||e.note!==void 0?(0,F.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,F.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,F.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,F.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,F.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,F.jsx)(ss,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,F.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,F.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,F.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,F.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:ls(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,F.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,F.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,F.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,F.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||a?(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,F.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,F.jsx)("span",{}),a]}):null]}),(0,F.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,F.jsx)(ar.Provider,{value:r,children:(0,F.jsx)(ct.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),m?(0,F.jsxs)(F.Fragment,{children:[m,u]}):u]})}function cr(e){let t=xe(e.theme),n=sr(e.locale),r=e.height??220;if(Ie(()=>Rt(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,F.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,F.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,F.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,F.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,F.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,F.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,F.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,F.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,F.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,F.jsx)(F.Fragment,{children:e.children})}var vt=C(U(),1);var we=C(U(),1);var W=C(I(),1),bn=60;var yn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Fo(e){let{c:t,events:n}=e,r=(0,we.useId)().replace(/:/g,""),o=`${r}t`,i=`${r}d`;t.events.current=n,Ie(()=>{Rt()},[]);let a=n.length,s=!e.noNav&&a>0,l=(0,we.useContext)(ct),c=e.ariaLabel??l??e.kind,m=(0,we.useMemo)(()=>s?`${n.length}${n.slice(0,bn).map(v=>`${v.label}${v.series??""}${v.formatted??v.value??""}`).join("")}`:"",[n,s]),u=(0,we.useMemo)(()=>(0,W.jsx)(cs,{label:c,events:n,t:t.t}),[c,m,t.t]),d=(0,we.useRef)(null);(0,we.useEffect)(()=>{let v=()=>{d.current=null};return window.addEventListener("scroll",v,{capture:!0,passive:!0}),window.addEventListener("resize",v,{passive:!0}),()=>{window.removeEventListener("scroll",v,{capture:!0}),window.removeEventListener("resize",v)}},[]),(0,we.useEffect)(()=>{d.current=null},[t.width,t.height]);let h=v=>{if(v.target!==v.currentTarget)return;if(e.onKey?.(v)){v.preventDefault();return}let A=t.active,O;switch(v.key){case"ArrowRight":case"ArrowDown":O=A===null?0:(A+1)%a;break;case"ArrowLeft":case"ArrowUp":O=A===null?a-1:(A-1+a)%a;break;case"Home":O=0;break;case"End":O=a-1;break;case"Escape":if(A===null)return;O=null;break;case"Enter":case" ":A!==null&&(v.preventDefault(),t.click(A));return;default:return}v.preventDefault(),t.setActive(O,"keyboard")},{via:f,node:y,setActive:p}=t;(0,we.useEffect)(()=>{if(f!=="touch"||!y)return;let v=A=>{y.contains(A.target)||p(null)};return document.addEventListener("pointerdown",v),()=>document.removeEventListener("pointerdown",v)},[f,y,p]);let g=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,M=typeof e.renderTip=="function"&&g?e.renderTip(g):null,b=e.announce??(t.via==="keyboard"&&g?`${g.label}${g.series?` ${g.series}`:""}: ${g.formatted??g.value??""} (${(t.active??0)+1}/${a})`:""),N;if(x){let v=x.x*T,A=t.width*T,O=`clamp(${(4-v).toFixed(1)}px, -50%, calc(${(A-v-4).toFixed(1)}px - 100%))`,j=x.y<64;N={position:"absolute",left:v,top:x.y*T,transform:`translate(${O}, ${j?"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 D=v=>{d.current=null,v.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},z=v=>v?A=>{let O=d.current??(d.current=A.currentTarget.getBoundingClientRect());O.width&&v((A.clientX-O.left)/O.width*t.width,(A.clientY-O.top)/O.height*t.height,A)}:void 0,E=z(e.onPointerMove),_=z(e.onPointerDown),P=E||_?v=>{v.pointerType==="touch"&&E?.(v),_?.(v)}:void 0,R=z(e.onPointerUp),S=So(e.theme);return(0,W.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":c,"aria-describedby":i,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:v=>{t.via==="keyboard"&&!v.currentTarget.contains(v.relatedTarget)&&t.setActive(null)},onPointerLeave:D,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...S,...e.style},children:[t.pending?null:e.underlay,(0,W.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:E,onPointerDown:P,onPointerUp:R,onPointerCancel:R,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,W.jsx)("title",{id:o,children:c}),(0,W.jsx)("desc",{id:i,children:a||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,W.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,x?(0,W.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:N,children:M??(0,W.jsxs)(W.Fragment,{children:[(0,W.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((v,A)=>(0,W.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,W.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(v.strong?"ink":"muted")},children:[v.color?(0,W.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:v.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,v.label]}),(0,W.jsx)("span",{style:{fontWeight:v.strong===!1?500:700},children:v.value})]},A))]})}):null,(0,W.jsx)("span",{className:"ztd-sr",style:yn,"aria-live":"polite","aria-atomic":"true",children:b}),s&&!t.pending?u:null]})}function cs({label:e,events:t,t:n}){return(0,W.jsx)("div",{className:"ztd-sr",style:yn,children:(0,W.jsxs)("table",{children:[(0,W.jsx)("caption",{children:n.table(e)}),(0,W.jsxs)("tbody",{children:[t.slice(0,bn).map((r,o)=>(0,W.jsxs)("tr",{children:[(0,W.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,W.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>bn?(0,W.jsx)("tr",{children:(0,W.jsx)("td",{colSpan:2,children:n.more(t.length-bn)})}):null]})]})})}function ce(e){let t=e.baseline??"central";return(0,W.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}var k=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),Ne=k("label","string",!0,"Item name field"),ie=k("value","number",!0,"Value field"),us=[Ne,ie],ms=[Ne,ie],ds=[k("label","string",!0,"Stage name"),k("value","number",!0,"Users at the stage")],fs=[Ne,ie],hs=[k("label","string",!0,"Leaf (lowest level) name"),ie,k("group","string",!1,"Parent group field")],gs=[k("label","string",!0,"Leaf name"),ie,k("group","string",!1,"Parent group field")],ps=[Ne,k("value","number",!0,"Change (total rows may omit it)"),k("type","string",!1,'"total" makes a total bar')],bs=[Ne,ie],ys=[k("x","string",!0,"Column field"),k("series","string",!0,"Stacked series field"),ie],xs=[k("x","string",!0,"Column field"),k("y","string",!0,"Row field"),ie],ks=[k("axis","string",!0,"Metric (axis) field"),k("value","number",!0,"Value field",{multi:!0}),k("series","string",!1,"Series field")],ws=[k("x","number",!0,"x value"),k("y","number",!0,"y value"),k("size","number",!1,"Circle size"),k("label","string",!1,"Name")],Po=k("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),vs=[k("x","any",!0,"x field (date, number or category)"),k("y","number",!0,"y field. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field (long tables)"),k("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Po],$s=[k("x","any",!0,"x field"),k("y","number",!0,"y field. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field"),k("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}),Po],Ts=[k("x","any",!0,"x field"),k("y","number",!0,"y field",{multi:!0}),k("series","string",!1,"Series field")],Ms=[k("x","string",!0,"Category field"),k("y","number",!0,"Value field. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field"),k("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})],Cs=[Ne,ie],Ss=[k("value","number",!0,"Value field",{prop:"valueKey"}),k("target","number",!1,"Target field",{prop:"targetKey"})],As=[Ne,k("value","number",!0,"Actual value field"),k("target","number",!1,"Target field")],Ns=[k("x","any",!1,"x field"),k("y","number",!0,"y field")],Fs=[Ne,k("x","string",!1,"Period field (long tables)"),k("value","number",!1,"Value field (long tables)")],Rs=[Ne,k("start","number",!0,"Before value"),k("end","number",!0,"After value")],Ps=[Ne,ie],Ls=[k("value","number",!0,"Value field"),k("group","string",!1,"Group (row) field"),k("label","string",!1,"Dot name")],_s=[k("group","string",!0,"Group field"),k("value","number",!0,"Value field")],Ds=[k("source","string",!0,"Source node"),k("target","string",!0,"Target node"),ie],Es=[k("source","string",!0,"Sending group"),k("target","string",!0,"Receiving group"),ie],Os=[k("date","date",!0,"Date field"),ie],Is=[k("x","any",!0,"Period field"),k("series","string",!0,"Item field"),k("rank","number",!1,"Rank field (1 is first)"),k("value","number",!1,"Value field (instead of rank, largest is first)")],zs=[k("group","string",!0,"Group field"),k("value","number",!0,"Value field")],Bs=[k("label","string",!1,"Row name field")],Hs=[k("x","date",!0,"Date (period) field"),k("open","number",!0,"Open price field"),k("high","number",!0,"High price field"),k("low","number",!0,"Low price field"),k("close","number",!0,"Close price field"),k("volume","number",!1,"Volume field")],js=[Ne,ie],Gs=[k("x","any",!0,"Period field (date or category)"),k("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field (long tables, back row only)"),k("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Vs=[k("value","number",!1,"Sample value field (raw rows)"),k("group","string",!1,"Group field. Up to 2 groups overlap"),k("x0","number",!1,"Bin start (pre-binned rows)"),k("x1","number",!1,"Bin end (pre-binned rows)"),k("count","number",!1,"Samples in the bin (pre-binned rows)")],Ws=[k("region","string",!0,"Region name or code, matched to a tile of options.map"),ie],Ks=[Ne,ie,k("frame","any",!0,"Time step field: a year, a date or any ordered key. Numbers and dates play in order, other text in the order it first appears. An item with no value in a step leaves the bars for that step")],Xs=[k("source","string",!0,"Source node"),k("target","string",!0,"Target node"),k("value","number",!1,"Link weight. Without it every row counts 1")],Us=[k("label","string",!0,"Row name. Items with the same name share a row"),k("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),k("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),k("group","string",!1,"Group field (one color per group, and the legend)"),k("status","string",!1,"State of the item, written inside the bar and in the tooltip. Without group it also colors the bars and makes the legend, so a row of consecutive states reads as a status strip")],Ys=[k("label","string",!0,"Node name field"),k("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),k("group","string",!1,"Parent group field (flat rows, as in the treemap)"),k("id","string",!1,"Row id for id/parent rows. Defaults to the label"),k("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],qs=[k("region","string",!0,"Region name or code, matched to a region of options.map"),ie],Js=[k("lon","number",!1,"Longitude (degrees)"),k("lat","number",!1,"Latitude (degrees)"),k("size","number",!1,"Value (circle area). Without it all circles match"),k("label","string",!1,"Place name"),k("region","string",!1,"Region of options.map, for rows without lon and lat"),k("group","string",!1,"Group field (one color per group)")],Zs=[k("source","string",!0,"Start: a name in options.places or a region"),k("target","string",!0,"End"),k("value","number",!1,"Amount. Without it each row counts 1")],Qs=[k("x","number",!0,"x value"),k("y","number",!0,"y value"),k("series","string",!1,"Series field (one color per series)"),k("label","string",!1,"Name")],Ro={pie:us,donut:ms,funnel:ds,waffle:fs,treemap:hs,sunburst:gs,waterfall:ps,pareto:bs,marimekko:ys,heatmap:xs,radar:ks,bubble:ws,line:vs,area:$s,stream:Ts,bar:Ms,radialBar:Cs,gauge:Ss,bullet:As,sparkline:Ns,slope:Fs,dumbbell:Rs,lollipop:Ps,beeswarm:Ls,ridgeline:_s,sankey:Ds,chord:Es,calendar:Os,bump:Is,box:zs,parallel:Bs,candlestick:Hs,segmented:js,skyline:Gs,histogram:Vs,scatter:Qs,tileMap:Ws,barRace:Ks,network:Xs,timeline:Us,tree:Ys,choropleth:qs,symbolMap:Js,flowMap:Zs},mt={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"},barRace:{component:"BarRace",name:"Bar race",nameKo:"막대 레이스"},network:{component:"NetworkChart",name:"Network",nameKo:"네트워크"},timeline:{component:"Timeline",name:"Timeline",nameKo:"타임라인"},tree:{component:"Tree",name:"Tree",nameKo:"트리"},choropleth:{component:"Choropleth",name:"Choropleth map",nameKo:"단계구분도"},symbolMap:{component:"SymbolMap",name:"Symbol map",nameKo:"기호 지도"},flowMap:{component:"FlowMap",name:"Flow map",nameKo:"흐름 지도"}};function Lo(e,t){return t==="ko"?e.nameKo:e.name}function _o(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Do=["line","area","bar","scatter"],Eo=24,ur=["line","area","bar","scatter","timeline"];function mr(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Oo(e,t,n){return ur.includes(e)&&!mr(e,t,n).length&&!(e==="scatter"&&xn(n))}function xn(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function Io(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var el={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap",barChartRace:"barRace",racingBar:"barRace",racingBars:"barRace",raceBar:"barRace",arcDiagram:"network",graph:"network",nodeLink:"network",gantt:"timeline",ganttChart:"timeline",schedule:"timeline",dendrogram:"tree",orgChart:"tree",treeChart:"tree",choroplethMap:"choropleth",filledMap:"choropleth",map:"choropleth",bubbleMap:"symbolMap",proportionalSymbolMap:"symbolMap",pointMap:"symbolMap",originDestination:"flowMap",odMap:"flowMap"};function kn(e){let t=Ro[e]?e:el[e]??Object.keys(mt).find(n=>n.toLowerCase()===e.toLowerCase()||mt[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!mt[t]))return{type:t,component:mt[t].component,name:mt[t].name,nameKo:mt[t].nameKo,encoding:Ro[t]}}function zo(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 kn(e.type)?.encoding.map(a=>a.name)??Object.keys(r))n(r[i]);let o=e.options??{};for(let i of["dimensions","start","end","ranges"])n(o[i]);return[...t]}function Bo(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function tl(e,t){if(e==null||typeof e!="object")return;let n=e;if(Bo(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Bo(r,o))return;r=r[o]}return r}}function ze(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function ot(e,t){if(typeof e=="function")return e;let n=e??t;return r=>tl(r,n)}function ve(e,t){let n=ot(e,t);return(r,o)=>ze(n(r,o))}function Fe(e,t){let n=ot(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 $e(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function nl(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
23
- `||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,i=[","," ",";","|"],a=",",s=0;for(let l of i){let c=o(l);c>s&&(s=c,a=l)}return a}var rl=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Ho(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(rl.test(t)||/^[-+]?\.\d+$/.test(t)){let n=ze(t);if(Number.isFinite(n))return n}return t}function it(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let i=t.delimiter??nl(o),a=[],s=[],l="",c=!1;for(let f=0;f<o.length;f++){let y=o[f];c?y==='"'?o[f+1]==='"'?(l+='"',f++):c=!1:l+=y:y==='"'&&!l.trim()?(c=!0,l=""):y===i?(s.push(l),l=""):y===`
22
+ `;function en(e,t,n,r,o){if(e)return t?{opacity:0}:{animation:`ztd-${n} ${Math.round(o)}ms cubic-bezier(.22,.9,.3,1) ${Math.round(r)}ms backwards`}}function tn(e,t){let[n]=(0,no.useState)(!e.motion.enabled);return e.motion.enabled&&e.hydrated&&(!n||t.waiting||t.generation>0)}var to=!1;function Rt(){if(to||typeof document>"u"||(to=!0,document.getElementById("ztd-base")))return;let e=document.createElement("style");e.id="ztd-base",e.textContent=zi,document.head.appendChild(e)}var nn=S(U(),1),Pe=typeof window<"u"&&typeof document<"u",Ie=Pe?nn.useLayoutEffect:nn.useEffect;function rn(){return typeof performance<"u"?performance.now():Date.now()}function Y(e){return e!==void 0&&/^ko([-_]|$)/i.test(e)?"ko":"en"}function Ae(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var ro={chart:"chart",table:e=>`${e} data`,more:e=>`and ${e} more`,value:"Value",empty:"No data."},oo={chart:"차트",table:e=>`${e} 데이터`,more:e=>`외 ${e}개`,value:"값",empty:"데이터가 없어요."};var Bi=[{id:"basic",en:"Basic",ko:"기본"},{id:"intermediate",en:"Intermediate",ko:"중급"},{id:"advanced",en:"Advanced",ko:"심화"}],Hi={basic:{bg:"line2",fg:"ink"},intermediate:{bg:"tint",fg:"accentText"},advanced:{bg:"ink",fg:"onInk"}};function ji(e,t){let n=t.trim().toLowerCase();return e.find(r=>r.id===n||r.en.toLowerCase()===n||r.ko===t.trim())}function Gi(e){return ji(Bi,e)}function ao(e,t){let n=Gi(e);return{text:n?n[t]:e,...Hi[n?.id??"basic"]}}var io={white:"#ffffff",black:"#000000",transparent:"#00000000"};function Ue(e){if(!e)return null;let t=e.trim(),n=/^var\(\s*--[\w-]+\s*,\s*(.+)\)$/i.exec(t);if(n&&(t=n[1].trim()),io[t.toLowerCase()]&&(t=io[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 Yn(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 on(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 ut(e){let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function so(e){return .2126*ut(e[0])+.7152*ut(e[1])+.0722*ut(e[2])}function qn(e,t,n){let r=typeof e=="string"?Ue(e):e,o=typeof t=="string"?Ue(t):t;if(!r||!o)return 0;let a=n?typeof n=="string"?Ue(n):n:null;o[3]<1&&a&&(o=on(o,a));let i=r[3]<1?on(r,o):r,s=so(i),l=so(o);return(Math.max(s,l)+.05)/(Math.min(s,l)+.05)}function Vi(e){return[ut(e[0]),ut(e[1]),ut(e[2])]}function Un(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 lo(e){let[t,n,r]=Vi(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 Wi([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[Un(4.0767416621*o-3.3077115913*a+.2309699292*i),Un(-1.2684380046*o+2.6097574011*a-.3413193965*i),Un(-.0041960863*o-.7034186147*a+1.707614701*i),r]}function an(e,t,n){let r=Ue(e),o=Ue(t);if(!r||!o)return e;let a=lo(r),i=lo(o),s=Math.max(0,Math.min(1,n));return Yn(Wi([a[0]*s+i[0]*(1-s),a[1]*s+i[1]*(1-s),a[2]*s+i[2]*(1-s)],r[3]*s+o[3]*(1-s)))}function Jn(e,t,n){let r=t[0],o=-1;for(let a of t){let i=qn(a,e,n);i>o&&(o=i,r=a)}return r}function Ki(e,t,n){let r=Ue(e),o=Ue(t);return!r||!o?e:Yn(on([r[0],r[1],r[2],n],o))}function J(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 co(e,t){let n=Jn(t,[e.theme.ink,e.theme.onAccent,e.theme.onNeutralStrong]);return qn(n,t)>=4.5?n===e.theme.ink?e.paint("ink"):n===e.theme.onAccent?e.paint("onAccent"):e.paint("onNeutralStrong"):Jn(t,["#FFFFFF","#000000"])}var Xi={accent:"accent",ink:"ink",strong:"neutralStrong",neutral:"neutral",soft:"neutralSoft"};function uo(e,t){return e.role==="mix"?e.raw:t(Ft(Xi[e.role]),e.raw)}function sn(e,t){let n=an(e.theme.neutralStrong,e.theme.neutral,t);return{role:"mix",fill:e.mix("neutralStrong","neutral",t),text:co(e,n),raw:n}}function Le(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=J(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{if(a===1)r[i]=J(e,"neutral");else if(s===0)r[i]=J(e,"ink");else if(s===a-1)r[i]=J(e,"neutral");else if(a===3)r[i]=J(e,"strong");else{let l=(s-1)/Math.max(1,a-2);r[i]=l<=.001?J(e,"strong"):sn(e,1-l)}}),r}var Zn="mix:";function Ye(e){return e({theme:Vn,cssVars:!1,paint:n=>n,color:n=>n??"neutral",raw:n=>n??"neutral",mix:(n,r,o)=>`${Zn}${o}`}).map(n=>n.fill)}function mo(e,t){return t?.startsWith(Zn)?e.mix("neutralStrong","neutral",Number(t.slice(Zn.length))):e.color(t)}function tt(e,t,n){return Le(e,t+1,n).slice(0,t)}function fo(e,t,n,r="neutral"){let o=J(e,"accent"),a=J(e,r);return Array.from({length:t},(i,s)=>n.has(s)?o:a)}function ho(e,t,n){let r=new Array(t),o=[];for(let i=0;i<t;i++)n.has(i)?r[i]=J(e,"accent"):o.push(i);let a=o.length;return o.forEach((i,s)=>{a===1?r[i]=J(e,"neutral"):s===0?r[i]=J(e,"strong"):s===a-1?r[i]=J(e,"neutral"):r[i]=sn(e,1-s/(a-1))}),r}function Ui(e,t,n=.1,r="accent"){let o=Math.max(0,Math.min(1,t)),a=n+(1-n)*o,i=Ki(e.theme[r],e.theme.panel,a);return{fill:e.paint(r),opacity:a,text:co(e,i),raw:i}}function Qn(e,t){let n=t.reverse?t.center===void 0?1-e:-e:e;if(t.steps){let r=t.center===void 0?0:-1,o=Math.max(0,Math.min(t.steps-1,Math.floor((n-r)/(1-r)*t.steps)));n=r+(1-r)*o/(t.steps-1)}return n}function Pt(e,t,n,r){let o=Qn(t,r);return Ui(e,Math.abs(o),n,o<0?"neutralStrong":"accent")}function ln(e,t,n){return{reverse:e,center:t,steps:n===void 0?void 0:Math.max(2,Math.min(12,Math.round(n)))}}var _e=S(U(),1);var un=(e,t="")=>n=>Number.isFinite(n)?`${e(n)}${t}`:e(n),he="en-US",go=new Map;function er(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=go.get(r);return o||(o=new Intl.NumberFormat(e,n),go.set(r,o)),o}function tr(e){return/^[-\u2212]/.test(e)&&!/[1-9]/.test(e)?e.slice(1):e}function ye(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=he,...r}=t;return tr(er(n,r).format(e))}var nr=e=>e!==0&&Math.abs(e)<.05,rr=(e,t,n="")=>`${ye(e,{locale:t,maximumSignificantDigits:2,maximumFractionDigits:20})}${n}`;function cn(e,t={}){if(!Number.isFinite(e))return"-";if(nr(e)&&t.maximumFractionDigits===void 0)return rr(e,t.locale??he,"%");let n=Math.abs(e);return`${ye(e,{maximumFractionDigits:n>0&&n<1?1:0,...t})}%`}function xo(e,t={}){if(!Number.isFinite(e))return"-";let{locale:n=he,...r}=t;if(Y(n)==="ko"){let o=Math.abs(e),a=[[1e12,"조"],[1e8,"억"],[1e4,"만"],[1,""]],i=a.findIndex(([s])=>o>=s);for(i<0&&(i=a.length-1);;){let[s,l]=a[i],c=o/s,m=Math.max(r.minimumFractionDigits??0,r.maximumFractionDigits??(s===1||c<100?1:0)),u=Math.round(c*10**m)/10**m;if(i>0&&u>=a[i-1][0]/s){i--;continue}return(e<0&&u!==0?"-":"")+ye(u,{locale:n,...r,maximumFractionDigits:m})+l}}return tr(er(n,{notation:"compact",...r}).format(e))}var Yi=(e,t=Y(e)==="ko"?"KRW":"USD")=>({style:"currency",currency:t,maximumFractionDigits:t==="KRW"?0:2});function nt(e,t=he,n){if(typeof e=="function")return e;let r=(o,a="",i="")=>{let s=er(t,o);return l=>Number.isFinite(l)?`${i}${tr(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=>cn(o,{locale:t});case"ratio":return o=>cn(o*100,{locale:t});case"compact":return o=>xo(o,{locale:t});case"currency":return r(Yi(t));default:{let o=r({maximumFractionDigits:1});return a=>nr(a)?rr(a,t):o(a)}}}function rt(e,t=he,n=0){return e!==void 0?nt(e,t):n>=1e5?r=>nr(r)?rr(r,t):xo(r,{locale:t}):r=>ye(r,{locale:t})}function qi(e,t,n=1){let r=new Date(+e,+t-1,+n);return r.getMonth()===+t-1&&r.getDate()===+n?r:null}var or=e=>Number.isInteger(e)&&e>=1e3&&e<=9999,Ji=/^\d{4}-\d{1,2}(-\d{1,2})?([T ][\d:.]+(Z|[+-]\d{2}:?\d{2})?)?$/,Zi=["january","february","march","april","may","june","july","august","september","october","november","december"],po=e=>{let t=e.toLowerCase();return t.length<3?0:Zi.findIndex(n=>n.startsWith(t))+1},bo=e=>+e+(+e<30?2e3:1900);function ko(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}var Qi=[/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,/^(\d{4})[./]\s*(\d{1,2})[./]\s*(\d{1,2})\.?$/,/^(19\d\d|20\d\d|2100)(\d\d)(\d\d)$/,/^(\d{4})년\s*(\d{1,2})월(?:\s*(\d{1,2})일)?$/],wo=/^(\d{1,2})([./-])(\d{1,2})\2(\d{4})$/,vo=/\{([^{}]+)\}/g;function mn(e,t){let n;for(let r of Qi)if(n=r.exec(e))return[+n[1],+n[2],+(n[3]??1),n[3]?1:2];if(/^\d{4}-\d/.test(e))return null;if(n=/^(\d{2})\.\s*(\d{1,2})\.\s*(\d{1,2})\.?$/.exec(e))return t?[bo(n[3]),+n[2],+n[1],1]:[bo(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=wo.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=po(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=po(n[1]);return r?[+n[3],r,+(n[2]??1),n[2]?1:2]:null}return null}var $o=e=>Ji.test(e)||mn(e)!==null;function Mo(e){let t;for(let n of e){let r=typeof n=="string"?wo.exec(n.trim()):null;if(r){if(+r[1]>12)return!0;+r[3]>12&&(t=!1)}}return t}function dn(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(or(e))return new Date(e,0,1);if(e>=19000101&&e<=21001231)return dn(`${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=mn(n,t);if(r)return qi(r[0],r[1],r[2]);if(/^\d{4}$/.test(n))return new Date(Number(n),0,1);if(!/\d{4}/.test(n))return null;let o=new Date(n);return Number.isNaN(o.getTime())?null:o}return null}var yo=new Map;function Lt(e,t={month:"short",day:"numeric"}){let n=dn(e);if(!n)return"-";let{locale:r=he,...o}=t,a=r+JSON.stringify(o),i=yo.get(a);return i||(i=new Intl.DateTimeFormat(r,o),yo.set(a,i)),i.format(n)}var ar=S(I(),1),fn=(0,_e.createContext)({theme:Xe,cssVars:!0});function es(e,t=Xe){return e?typeof e=="string"?Wn[e]??t:Xn(t,e):t}function hn(e){let t=(0,_e.useContext)(fn),n=e.base?Wn[e.base]:t.theme,r=(0,_e.useMemo)(()=>es(e.theme,n),[e.theme,n]),o=e.cssVars??t.cssVars,a=e.locale??t.locale,i=(0,_e.useMemo)(()=>({theme:r,cssVars:o,locale:a}),[r,o,a]),s=(0,_e.useMemo)(()=>Kn(r),[r]),l=e.paint?{background:r.bg,color:r.ink,fontFamily:r.fontFamily,...s,...e.style}:{display:"contents",...s,...e.style};return(0,ar.jsx)(fn.Provider,{value:i,children:(0,ar.jsx)("div",{className:e.className,"data-ztd-theme":r.name,lang:e.locale,style:l,children:e.children})})}var ts=new Set(["bg","panel","ink","muted","dim","accent","accentText","onAccent","accent2","accent3","onInk","line","line2","neutral","neutralStrong","onNeutralStrong","neutralSoft","lift","tint"]);function So(e){return ts.has(e)}function ns(e,t){let n=r=>t?`var(${Ft(r)}, ${e[r]})`:e[r];return{theme:e,cssVars:t,paint:n,color:(r,o="neutral")=>r?So(r)?n(r):r:n(o),raw:(r,o="neutral")=>r?So(r)?e[r]:r:e[o],mix:(r,o,a)=>{let i=Math.round(Math.max(0,Math.min(1,a))*1e3)/10;return t?`color-mix(in oklab, ${n(r)} ${i}%, ${n(o)})`:an(e[r],e[o],a)}}}function xe(e){let t=(0,_e.useContext)(fn);return(0,_e.useMemo)(()=>{let n=Xn(t.theme,e);return ns(n,t.cssVars)},[t.theme,t.cssVars,e])}function ke(e){let t=(0,_e.useContext)(fn);return e??t.locale??he}function Co(e){return e?Kn(e):{}}var gn=S(U(),1),ir=(0,gn.createContext)(void 0);function Ao(e){let t=(0,gn.useContext)(ir);return e!==void 0&&t!==void 0?`${e}:${t}`:e??t}var F=S(I(),1),rs={legend:"Legend",replay:"Replay animation",replayTitle:"Replay",sample:"Sample data",loadError:"Couldn't load data",retry:"Try again",loading:"Loading",empty:"No data to show",source:"Source",shown:(e,t)=>`${e} of ${t} series shown`},os={en:rs,ko:{legend:"범례",replay:"애니메이션 다시 재생",replayTitle:"다시 재생",sample:"예시 데이터",loadError:"데이터를 불러오지 못했어요",retry:"다시 시도",loading:"불러오는 중",empty:"표시할 데이터가 없어요",source:"출처",shown:(e,t)=>`${t}개 중 ${e}개 보임`}};var as={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},sr=e=>os[Y(ke(e))];function lr(e){let t=xe(e.theme),n=sr(e.locale),[r,o]=(0,pn.useState)(!1),a=e.size??11.5,i=e.onToggle,s=new Set(i?e.hidden:void 0),l=e.items.filter(m=>!s.has(m.label)).length,c=(0,F.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((m,u)=>{let d=!s.has(m.label),h=d&&l===1,f=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(is,{p:t,item:m,off:!d}),(0,F.jsx)("span",{style:d?void 0:{textDecoration:"line-through"},children:m.label})]});return(0,F.jsx)("li",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:a,color:t.paint("muted"),lineHeight:1.3},children:i?(0,F.jsx)("button",{type:"button",className:"ztd-btn","aria-pressed":d,"aria-disabled":h||void 0,onClick:()=>{h||(i(m.label),o(!0))},style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,minWidth:24,padding:"0 2px",margin:0,border:0,borderRadius:4,background:"transparent",color:"inherit",fontSize:"inherit",lineHeight:"inherit",cursor:h?"default":void 0},children:f}):f},u)})});return i?(0,F.jsxs)(F.Fragment,{children:[c,(0,F.jsx)("span",{"aria-live":"polite","aria-atomic":"true",style:as,children:r?n.shown(l,e.items.length):""})]}):c}function is({p:e,item:t,off:n}){let r=mo(e,t.color),o=t.shape??"square";return o==="line"||o==="dash"?(0,F.jsxs)("svg",{width:14,height:8,"aria-hidden":"true",style:{flex:"none",opacity:n?.35:void 0},children:[(0,F.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,F.jsx)("circle",{cx:7,cy:4,r:2.2,fill:r}):null]}):(0,F.jsx)("span",{"aria-hidden":"true",style:{width:9,height:9,flex:"none",borderRadius:o==="circle"?9:2.5,background:r,boxShadow:t.color==="neutral"||t.color==="neutralSoft"||!t.color?`inset 0 0 0 1px ${e.paint("line2")}`:void 0,opacity:n?.35:void 0}})}function ss(e){let t=xe(e.theme),n=ao(e.level,Y(ke(e.locale)));return(0,F.jsx)("span",{style:{background:t.paint(n.bg),color:t.paint(n.fg),borderRadius:8,padding:"3px 9px",fontSize:12.5,fontWeight:700,lineHeight:"18px",whiteSpace:"nowrap",flex:"none"},children:n.text})}function ls(e,t,n){if(typeof e!="string"||!t)return e;let r=e.indexOf(t);return r<0?e:(0,F.jsxs)(F.Fragment,{children:[e.slice(0,r),(0,F.jsx)("span",{style:{color:n},children:t}),e.slice(r+t.length)]})}function No(e){let t=xe(e.theme),n=sr(e.locale),[r,o]=(0,pn.useState)(0);Ie(()=>Rt(),[]);let a=()=>{o(d=>d+1),e.onReplay?.()},i=Array.isArray(e.legend)?(0,F.jsx)(lr,{items:e.legend,theme:e.theme,locale:e.locale}):e.legend,s=e.as??"h3",l=e.number===void 0?null:typeof e.number=="number"?String(e.number).padStart(2,"0"):e.number,c=e.replay||e.onReplay,m=e.source!==void 0||e.note!==void 0?(0,F.jsxs)("p",{style:{margin:0,fontSize:12,color:t.paint("muted"),lineHeight:1.4},children:[e.source!==void 0?`${n.source}: `:null,e.source,e.source!==void 0&&e.note!==void 0?" · ":null,e.note]}):null,u=e.takeaway!==void 0||e.level||e.sample?(0,F.jsxs)("footer",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:2},children:[(0,F.jsx)("span",{style:{fontSize:17,fontWeight:800,color:t.paint("ink"),letterSpacing:-.3,lineHeight:1.3,minWidth:0},children:e.takeaway}),(0,F.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flex:"none"},children:[e.sample?(0,F.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,F.jsx)(ss,{level:e.level,theme:e.theme,locale:e.locale}):null]})]}):null;return(0,F.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,F.jsxs)("header",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[l?(0,F.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,F.jsx)(s,{style:{margin:0,fontSize:22,fontWeight:800,color:t.paint("ink"),letterSpacing:-.5,lineHeight:1.25,minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:ls(e.title,e.accent,t.paint("accentText"))}),e.actions,c?(0,F.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,F.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,F.jsx)("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),(0,F.jsx)("path",{d:"M3 3v6h6"})]})}):null]}),e.subtitle!==void 0||i?(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px 12px",flexWrap:"wrap",minHeight:18},children:[e.subtitle!==void 0?(0,F.jsx)("span",{style:{fontSize:12.5,color:t.paint("muted"),lineHeight:1.4},children:e.subtitle}):(0,F.jsx)("span",{}),i]}):null]}),(0,F.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:0,minWidth:0},children:(0,F.jsx)(ir.Provider,{value:r,children:(0,F.jsx)(ct.Provider,{value:typeof e.title=="string"||typeof e.title=="number"?String(e.title):void 0,children:e.children})})}),m?(0,F.jsxs)(F.Fragment,{children:[m,u]}):u]})}function cr(e){let t=xe(e.theme),n=sr(e.locale),r=e.height??220;if(Ie(()=>Rt(),[]),e.error){let o=typeof e.error=="string"?e.error:e.error.message;return(0,F.jsx)("div",{role:"alert",style:{height:r,display:"grid",placeItems:"center",textAlign:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,F.jsxs)("div",{style:{display:"grid",gap:8,justifyItems:"center",padding:16},children:[(0,F.jsx)("span",{style:{fontSize:14,fontWeight:700,color:t.paint("ink")},children:n.loadError}),(0,F.jsx)("span",{style:{fontSize:12,color:t.paint("muted"),maxWidth:280,wordBreak:"break-word"},children:o}),e.onRetry?(0,F.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,F.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,F.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,F.jsx)("div",{style:{height:r,display:"grid",placeItems:"center",border:`1px dashed ${t.paint("line2")}`,borderRadius:10},children:(0,F.jsx)("span",{style:{fontSize:13,color:t.paint("muted")},children:e.emptyText??n.empty})}):(0,F.jsx)(F.Fragment,{children:e.children})}var vt=S(U(),1);var we=S(U(),1);var W=S(I(),1),bn=60;var yn={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function Fo(e){let{c:t,events:n}=e,r=(0,we.useId)().replace(/:/g,""),o=`${r}t`,a=`${r}d`;t.events.current=n,Ie(()=>{Rt()},[]);let i=n.length,s=!e.noNav&&i>0,l=(0,we.useContext)(ct),c=e.ariaLabel??l??e.kind,m=(0,we.useMemo)(()=>s?`${n.length}${n.slice(0,bn).map(v=>`${v.label}${v.series??""}${v.formatted??v.value??""}`).join("")}`:"",[n,s]),u=(0,we.useMemo)(()=>(0,W.jsx)(cs,{label:c,events:n,t:t.t}),[c,m,t.t]),d=(0,we.useRef)(null);(0,we.useEffect)(()=>{let v=()=>{d.current=null};return window.addEventListener("scroll",v,{capture:!0,passive:!0}),window.addEventListener("resize",v,{passive:!0}),()=>{window.removeEventListener("scroll",v,{capture:!0}),window.removeEventListener("resize",v)}},[]),(0,we.useEffect)(()=>{d.current=null},[t.width,t.height]);let h=v=>{if(v.target!==v.currentTarget)return;if(e.onKey?.(v)){v.preventDefault();return}let A=t.active,O;switch(v.key){case"ArrowRight":case"ArrowDown":O=A===null?0:(A+1)%i;break;case"ArrowLeft":case"ArrowUp":O=A===null?i-1:(A-1+i)%i;break;case"Home":O=0;break;case"End":O=i-1;break;case"Escape":if(A===null)return;O=null;break;case"Enter":case" ":A!==null&&(v.preventDefault(),t.click(A));return;default:return}v.preventDefault(),t.setActive(O,"keyboard")},{via:f,node:y,setActive:p}=t;(0,we.useEffect)(()=>{if(f!=="touch"||!y)return;let v=A=>{y.contains(A.target)||p(null)};return document.addEventListener("pointerdown",v),()=>document.removeEventListener("pointerdown",v)},[f,y,p]);let g=t.active!==null?n[t.active]:null,x=t.showTooltip&&e.renderTip!==!1&&!t.pending&&t.via!=="sync"?e.tip:null,M=x&&!t.responsive&&t.node&&t.width&&t.node.getBoundingClientRect().width/t.width||1,T=typeof e.renderTip=="function"&&g?e.renderTip(g):null,b=e.announce??(t.via==="keyboard"&&g?`${g.label}${g.series?` ${g.series}`:""}: ${g.formatted??g.value??""} (${(t.active??0)+1}/${i})`:""),N;if(x){let v=x.x*M,A=t.width*M,O=`clamp(${(4-v).toFixed(1)}px, -50%, calc(${(A-v-4).toFixed(1)}px - 100%))`,j=x.y<64;N={position:"absolute",left:v,top:x.y*M,transform:`translate(${O}, ${j?"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*M-8)}}let D=v=>{d.current=null,v.pointerType!=="touch"&&t.via!=="keyboard"&&t.setActive(null)},z=v=>v?A=>{let O=d.current??(d.current=A.currentTarget.getBoundingClientRect());O.width&&v((A.clientX-O.left)/O.width*t.width,(A.clientY-O.top)/O.height*t.height,A)}:void 0,E=z(e.onPointerMove),_=z(e.onPointerDown),P=E||_?v=>{v.pointerType==="touch"&&E?.(v),_?.(v)}:void 0,R=z(e.onPointerUp),C=Co(e.theme);return(0,W.jsxs)("div",{ref:t.ref,className:`ztd-root${t.reduced?" ztd-still":""}${e.className?` ${e.className}`:""}`,role:"group","aria-roledescription":t.t.chart,"aria-label":c,"aria-describedby":a,tabIndex:s?0:void 0,onKeyDown:s?h:void 0,onBlur:v=>{t.via==="keyboard"&&!v.currentTarget.contains(v.relatedTarget)&&t.setActive(null)},onPointerLeave:D,style:{width:"100%",maxWidth:t.measured?void 0:"100%",fontFamily:t.p.cssVars?`var(--ztd-font, ${t.p.theme.fontFamily})`:t.p.theme.fontFamily,color:t.p.paint("ink"),...C,...e.style},children:[t.pending?null:e.underlay,(0,W.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:E,onPointerDown:P,onPointerUp:R,onPointerCancel:R,style:{fontFamily:"inherit",touchAction:"pan-y",position:e.underlay?"relative":void 0},children:[(0,W.jsx)("title",{id:o,children:c}),(0,W.jsx)("desc",{id:a,children:i||t.description!==void 0?e.description:e.emptyText??t.t.empty}),e.defs&&!t.pending?(0,W.jsx)("defs",{children:e.defs}):null,t.pending?null:e.children]}),t.pending?null:e.overlay,x?(0,W.jsx)("div",{className:"ztd-tip","aria-hidden":"true",style:N,children:T??(0,W.jsxs)(W.Fragment,{children:[(0,W.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((v,A)=>(0,W.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"space-between"},children:[(0,W.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7,color:t.p.paint(v.strong?"ink":"muted")},children:[v.color?(0,W.jsx)("span",{style:{width:8,height:8,borderRadius:999,background:v.color,display:"inline-block",boxShadow:"inset 0 0 0 1px rgba(127,127,127,0.3)"}}):null,v.label]}),(0,W.jsx)("span",{style:{fontWeight:v.strong===!1?500:700},children:v.value})]},A))]})}):null,(0,W.jsx)("span",{className:"ztd-sr",style:yn,"aria-live":"polite","aria-atomic":"true",children:b}),s&&!t.pending?u:null]})}function cs({label:e,events:t,t:n}){return(0,W.jsx)("div",{className:"ztd-sr",style:yn,children:(0,W.jsxs)("table",{children:[(0,W.jsx)("caption",{children:n.table(e)}),(0,W.jsxs)("tbody",{children:[t.slice(0,bn).map((r,o)=>(0,W.jsxs)("tr",{children:[(0,W.jsx)("th",{scope:"row",children:r.series?`${r.label} · ${r.series}`:r.label}),(0,W.jsx)("td",{children:r.formatted??r.value??""})]},o)),t.length>bn?(0,W.jsx)("tr",{children:(0,W.jsx)("td",{colSpan:2,children:n.more(t.length-bn)})}):null]})]})})}function ce(e){let t=e.baseline??"central";return(0,W.jsx)("text",{x:Math.round(e.x*10)/10,y:Math.round(e.y*10)/10,dy:t==="central"?"0.35em":t==="hanging"?"0.75em":void 0,fontSize:e.size??11,fill:e.fill??"currentColor",textAnchor:e.anchor??"start",fontWeight:e.weight??400,opacity:e.opacity===void 0||e.opacity>=1?void 0:Math.max(0,e.opacity),className:e.className,letterSpacing:e.letterSpacing,style:{pointerEvents:"none",fontVariantNumeric:"tabular-nums"},children:e.children})}var k=(e,t,n,r,o={})=>({name:e,type:t,required:n,description:r,...o}),Ne=k("label","string",!0,"Item name field"),ae=k("value","number",!0,"Value field"),us=[Ne,ae],ms=[Ne,ae],ds=[k("label","string",!0,"Stage name"),k("value","number",!0,"Users at the stage")],fs=[Ne,ae],hs=[k("label","string",!0,"Leaf (lowest level) name"),ae,k("group","string",!1,"Parent group field")],gs=[k("label","string",!0,"Leaf name"),ae,k("group","string",!1,"Parent group field")],ps=[Ne,k("value","number",!0,"Change (total rows may omit it)"),k("type","string",!1,'"total" makes a total bar')],bs=[Ne,ae],ys=[k("x","string",!0,"Column field"),k("series","string",!0,"Stacked series field"),ae],xs=[k("x","string",!0,"Column field"),k("y","string",!0,"Row field"),ae],ks=[k("axis","string",!0,"Metric (axis) field"),k("value","number",!0,"Value field",{multi:!0}),k("series","string",!1,"Series field")],ws=[k("x","number",!0,"x value"),k("y","number",!0,"y value"),k("size","number",!1,"Circle size"),k("label","string",!1,"Name")],Po=k("upper","number",!1,"Upper bound of the range band. Same shape as lower",{multi:!0}),vs=[k("x","any",!0,"x field (date, number or category)"),k("y","number",!0,"y field. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field (long tables)"),k("lower","number",!1,"Lower bound of the range band. In wide tables an array in the order of y",{multi:!0}),Po],$s=[k("x","any",!0,"x field"),k("y","number",!0,"y field. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field"),k("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}),Po],Ms=[k("x","any",!0,"x field"),k("y","number",!0,"y field",{multi:!0}),k("series","string",!1,"Series field")],Ts=[k("x","string",!0,"Category field"),k("y","number",!0,"Value field. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field"),k("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})],Ss=[Ne,ae],Cs=[k("value","number",!0,"Value field",{prop:"valueKey"}),k("target","number",!1,"Target field",{prop:"targetKey"})],As=[Ne,k("value","number",!0,"Actual value field"),k("target","number",!1,"Target field")],Ns=[k("x","any",!1,"x field"),k("y","number",!0,"y field")],Fs=[Ne,k("x","string",!1,"Period field (long tables)"),k("value","number",!1,"Value field (long tables)")],Rs=[Ne,k("start","number",!0,"Before value"),k("end","number",!0,"After value")],Ps=[Ne,ae],Ls=[k("value","number",!0,"Value field"),k("group","string",!1,"Group (row) field"),k("label","string",!1,"Dot name")],_s=[k("group","string",!0,"Group field"),k("value","number",!0,"Value field")],Ds=[k("source","string",!0,"Source node"),k("target","string",!0,"Target node"),ae],Es=[k("source","string",!0,"Sending group"),k("target","string",!0,"Receiving group"),ae],Os=[k("date","date",!0,"Date field"),ae],Is=[k("x","any",!0,"Period field"),k("series","string",!0,"Item field"),k("rank","number",!1,"Rank field (1 is first)"),k("value","number",!1,"Value field (instead of rank, largest is first)")],zs=[k("group","string",!0,"Group field"),k("value","number",!0,"Value field")],Bs=[k("label","string",!1,"Row name field")],Hs=[k("x","date",!0,"Date (period) field"),k("open","number",!0,"Open price field"),k("high","number",!0,"High price field"),k("low","number",!0,"Low price field"),k("close","number",!0,"Close price field"),k("volume","number",!1,"Volume field")],js=[Ne,ae],Gs=[k("x","any",!0,"Period field (date or category)"),k("y","number",!0,"Back row fields stacked into each block. An array for wide tables",{multi:!0}),k("series","string",!1,"Series field (long tables, back row only)"),k("front","number",!1,"Front row fields: a smaller outcome in the same unit as y (wide tables only)",{multi:!0})],Vs=[k("value","number",!1,"Sample value field (raw rows)"),k("group","string",!1,"Group field. Up to 2 groups overlap"),k("x0","number",!1,"Bin start (pre-binned rows)"),k("x1","number",!1,"Bin end (pre-binned rows)"),k("count","number",!1,"Samples in the bin (pre-binned rows)")],Ws=[k("region","string",!0,"Region name or code, matched to a tile of options.map"),ae],Ks=[Ne,ae,k("frame","any",!0,"Time step field: a year, a date or any ordered key. Numbers and dates play in order, other text in the order it first appears. An item with no value in a step leaves the bars for that step")],Xs=[k("source","string",!0,"Source node"),k("target","string",!0,"Target node"),k("value","number",!1,"Link weight. Without it every row counts 1")],Us=[k("label","string",!0,"Row name. Items with the same name share a row"),k("start","any",!0,"Start: a number (minutes, seconds, any unit) or a date or date-time"),k("end","any",!0,"End, same kind as start. Equal to start draws a point event; empty means still open"),k("group","string",!1,"Group field (one color per group, and the legend)"),k("status","string",!1,"State of the item, written inside the bar and in the tooltip. Without group it also colors the bars and makes the legend, so a row of consecutive states reads as a status strip")],Ys=[k("label","string",!0,"Node name field"),k("value","number",!1,"Value field. Sizes the dots; values add up from the leaves"),k("group","string",!1,"Parent group field (flat rows, as in the treemap)"),k("id","string",!1,"Row id for id/parent rows. Defaults to the label"),k("parent","string",!1,"Parent id field. Each row is one node, and rows with an empty parent hang under the root")],qs=[k("region","string",!0,"Region name or code, matched to a region of options.map"),ae],Js=[k("lon","number",!1,"Longitude (degrees)"),k("lat","number",!1,"Latitude (degrees)"),k("size","number",!1,"Value (circle area). Without it all circles match"),k("label","string",!1,"Place name"),k("region","string",!1,"Region of options.map, for rows without lon and lat"),k("group","string",!1,"Group field (one color per group)")],Zs=[k("source","string",!0,"Start: a name in options.places or a region"),k("target","string",!0,"End"),k("value","number",!1,"Amount. Without it each row counts 1")],Qs=[k("x","number",!0,"x value"),k("y","number",!0,"y value"),k("series","string",!1,"Series field (one color per series)"),k("label","string",!1,"Name")],Ro={pie:us,donut:ms,funnel:ds,waffle:fs,treemap:hs,sunburst:gs,waterfall:ps,pareto:bs,marimekko:ys,heatmap:xs,radar:ks,bubble:ws,line:vs,area:$s,stream:Ms,bar:Ts,radialBar:Ss,gauge:Cs,bullet:As,sparkline:Ns,slope:Fs,dumbbell:Rs,lollipop:Ps,beeswarm:Ls,ridgeline:_s,sankey:Ds,chord:Es,calendar:Os,bump:Is,box:zs,parallel:Bs,candlestick:Hs,segmented:js,skyline:Gs,histogram:Vs,scatter:Qs,tileMap:Ws,barRace:Ks,network:Xs,timeline:Us,tree:Ys,choropleth:qs,symbolMap:Js,flowMap:Zs},mt={pie:{component:"PieChart",name:"Pie chart",nameKo:"파이 차트"},donut:{component:"DonutChart",name:"Donut chart",nameKo:"도넛 차트"},funnel:{component:"FunnelChart",name:"Funnel chart",nameKo:"퍼널 차트"},waffle:{component:"WaffleChart",name:"Waffle chart",nameKo:"와플 차트"},treemap:{component:"Treemap",name:"Treemap",nameKo:"트리맵"},sunburst:{component:"SunburstChart",name:"Sunburst",nameKo:"선버스트"},waterfall:{component:"WaterfallChart",name:"Waterfall chart",nameKo:"폭포 차트"},pareto:{component:"ParetoChart",name:"Pareto chart",nameKo:"파레토 차트"},marimekko:{component:"MarimekkoChart",name:"Marimekko chart",nameKo:"마리메코 차트"},heatmap:{component:"Heatmap",name:"Heatmap",nameKo:"히트맵"},radar:{component:"RadarChart",name:"Radar chart",nameKo:"레이더 차트"},bubble:{component:"BubbleChart",name:"Bubble chart",nameKo:"버블 차트"},line:{component:"LineChart",name:"Line chart",nameKo:"라인 차트"},area:{component:"AreaChart",name:"Area chart",nameKo:"영역 차트"},stream:{component:"StreamGraph",name:"Streamgraph",nameKo:"스트림그래프"},bar:{component:"BarChart",name:"Bar chart",nameKo:"막대 차트"},radialBar:{component:"RadialBarChart",name:"Radial bar chart",nameKo:"방사형 막대"},gauge:{component:"GaugeChart",name:"Gauge",nameKo:"게이지"},bullet:{component:"BulletChart",name:"Bullet chart",nameKo:"불릿 차트"},sparkline:{component:"Sparkline",name:"Sparkline",nameKo:"스파크라인"},slope:{component:"SlopeChart",name:"Slope chart",nameKo:"슬로프 차트"},dumbbell:{component:"DumbbellChart",name:"Dumbbell chart",nameKo:"덤벨 차트"},lollipop:{component:"LollipopChart",name:"Lollipop chart",nameKo:"롤리팝 차트"},beeswarm:{component:"BeeswarmChart",name:"Beeswarm",nameKo:"비스웜"},ridgeline:{component:"RidgelineChart",name:"Ridgeline",nameKo:"릿지라인"},sankey:{component:"SankeyChart",name:"Sankey diagram",nameKo:"생키 다이어그램"},chord:{component:"ChordChart",name:"Chord diagram",nameKo:"코드 다이어그램"},calendar:{component:"CalendarHeatmap",name:"Calendar heatmap",nameKo:"캘린더 히트맵"},bump:{component:"BumpChart",name:"Bump chart",nameKo:"범프 차트"},box:{component:"BoxPlot",name:"Box / violin plot",nameKo:"박스 플롯"},parallel:{component:"ParallelCoordinates",name:"Parallel coordinates",nameKo:"평행 좌표"},candlestick:{component:"CandlestickChart",name:"Candlestick chart",nameKo:"캔들스틱"},segmented:{component:"SegmentedBar",name:"Segmented bar",nameKo:"비율 막대"},skyline:{component:"SkylineChart",name:"Skyline",nameKo:"스카이라인"},histogram:{component:"HistogramChart",name:"Histogram",nameKo:"히스토그램"},scatter:{component:"ScatterChart",name:"Scatter plot",nameKo:"산점도"},tileMap:{component:"TileMap",name:"Tile grid map",nameKo:"타일 격자 지도"},barRace:{component:"BarRace",name:"Bar race",nameKo:"막대 레이스"},network:{component:"NetworkChart",name:"Network",nameKo:"네트워크"},timeline:{component:"Timeline",name:"Timeline",nameKo:"타임라인"},tree:{component:"Tree",name:"Tree",nameKo:"트리"},choropleth:{component:"Choropleth",name:"Choropleth map",nameKo:"단계구분도"},symbolMap:{component:"SymbolMap",name:"Symbol map",nameKo:"기호 지도"},flowMap:{component:"FlowMap",name:"Flow map",nameKo:"흐름 지도"}};function Lo(e,t){return t==="ko"?e.nameKo:e.name}function _o(e,t){let n=t??e.options?.locale;return typeof n=="string"&&n?n.replace(/_/g,"-"):void 0}var Do=["line","area","bar","scatter"],Eo=24,ur=["line","area","bar","scatter","timeline"];function mr(e,t,n){return e==="bar"&&n.orientation!=="horizontal"&&n.layout!=="percent"&&n.layout!=="diverging"?[].concat(t.line??[]).map(String):[]}function Oo(e,t,n){return ur.includes(e)&&!mr(e,t,n).length&&!(e==="scatter"&&xn(n))}function xn(e){return!!e&&typeof e=="object"&&e.bin==="hex"}function Io(e){let t=e.options?.tooltip?.template;return typeof t=="string"&&t?t:void 0}var el={doughnut:"donut",column:"bar",stackedBar:"bar",groupedBar:"bar",stacked:"area",streamgraph:"stream",radial:"radialBar",radialbar:"radialBar",progress:"gauge",progressRing:"gauge",kpi:"gauge",violin:"box",boxplot:"box",calendarHeatmap:"calendar","parallel-coordinates":"parallel",parallelCoordinates:"parallel",mekko:"marimekko",spider:"radar",ohlc:"candlestick",candle:"candlestick",stock:"candlestick",segment:"segmented",segmentedBar:"segmented",proportionBar:"segmented",stackedBar100:"segmented",hist:"histogram",tilemap:"tileMap",tileGrid:"tileMap",cartogram:"tileMap",barChartRace:"barRace",racingBar:"barRace",racingBars:"barRace",raceBar:"barRace",arcDiagram:"network",graph:"network",nodeLink:"network",gantt:"timeline",ganttChart:"timeline",schedule:"timeline",dendrogram:"tree",orgChart:"tree",treeChart:"tree",choroplethMap:"choropleth",filledMap:"choropleth",map:"choropleth",bubbleMap:"symbolMap",proportionalSymbolMap:"symbolMap",pointMap:"symbolMap",originDestination:"flowMap",odMap:"flowMap"};function kn(e){let t=Ro[e]?e:el[e]??Object.keys(mt).find(n=>n.toLowerCase()===e.toLowerCase()||mt[n].component.toLowerCase()===e.toLowerCase());if(!(!t||!mt[t]))return{type:t,component:mt[t].component,name:mt[t].name,nameKo:mt[t].nameKo,encoding:Ro[t]}}function zo(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 kn(e.type)?.encoding.map(i=>i.name)??Object.keys(r))n(r[a]);let o=e.options??{};for(let a of["dimensions","start","end","ranges"])n(o[a]);return[...t]}function Bo(e,t){return Object.hasOwn(e,t)||t in e&&!(t in{})}function tl(e,t){if(e==null||typeof e!="object")return;let n=e;if(Bo(n,t))return n[t];if(t.includes(".")){let r=n;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Bo(r,o))return;r=r[o]}return r}}function ze(e){if(typeof e=="number")return Number.isFinite(e)?e:NaN;if(typeof e=="bigint")return Number(e);if(typeof e=="string"){let t=e.trim(),n=/^\(.*\)$/.test(t),r=t.replace(/[()\s%₩$€£¥원명건개회]/g,"").replace(/^\+/,"");if(!r||r.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(r))return NaN;let o=Number(r.replace(/,/g,""));return Number.isFinite(o)?n?-o:o:NaN}return e instanceof Date?e.getTime():typeof e=="boolean"?e?1:0:NaN}function ot(e,t){if(typeof e=="function")return e;let n=e??t;return r=>tl(r,n)}function ve(e,t){let n=ot(e,t);return(r,o)=>ze(n(r,o))}function Fe(e,t){let n=ot(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 $e(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function nl(e){let t=[],n=!1;for(let l=0;l<e.length&&l<4e3;l++){let c=e[l];if(c==='"')n=!n;else if(!n&&(c===`
23
+ `||c==="\r"))break;t.push(n?"":c)}let r=t.join(""),o=l=>r.split(l).length-1,a=[","," ",";","|"],i=",",s=0;for(let l of a){let c=o(l);c>s&&(s=c,i=l)}return i}var rl=/^[-+(]?[₩$€£¥]?\s?\d[\d,]*(\.\d+)?([eE][-+]?\d+)?\)?\s?(%|원|명|건|개|회)?$/;function Ho(e){let t=e.trim();if(t==="")return null;if(/^-?0\d/.test(t))return t;if(rl.test(t)||/^[-+]?\.\d+$/.test(t)){let n=ze(t);if(Number.isFinite(n))return n}return t}function at(e,t={}){let{typed:n=!0,header:r=!0}=t,o=e.replace(/^\uFEFF/,"");if(!o.trim())return[];let a=t.delimiter??nl(o),i=[],s=[],l="",c=!1;for(let f=0;f<o.length;f++){let y=o[f];c?y==='"'?o[f+1]==='"'?(l+='"',f++):c=!1:l+=y:y==='"'&&!l.trim()?(c=!0,l=""):y===a?(s.push(l),l=""):y===`
24
24
  `||y==="\r"?(y==="\r"&&o[f+1]===`
25
- `&&f++,s.push(l),a.push(s),s=[],l=""):l+=y}(l!==""||s.length)&&(s.push(l),a.push(s));let m=a.filter(f=>!(f.length===1&&f[0].trim()===""));if(!m.length)return[];let u=f=>n?Ho(f):f;if(!r)return m.map(f=>Object.fromEntries(f.map((y,p)=>[String(p),u(y)])));let d=[],h=new Set;return m[0].forEach((f,y)=>{let p=f.trim()||`col${y+1}`,g=p;for(let x=2;h.has(g);x++)g=`${p}_${x}`;h.add(g),d.push(g)}),m.slice(1).map(f=>Object.fromEntries(d.map((y,p)=>[y,u(f[p]??"")])))}function dr(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((a,s)=>String(a??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(a=>Object.fromEntries(o.map((s,l)=>[s,r&&typeof a[l]=="string"?Ho(a[l]):a[l]??null])))}function ol(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),a=Math.max(...o.map(s=>s.length));return Array.from({length:a},(s,l)=>Object.fromEntries(i.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([i,a])=>({[n]:i,[r]:a}))}function jo(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 qe(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return qe(JSON.parse(t))}catch{}return it(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?dr(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?qe(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?dr(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?qe(t.rows):Array.isArray(t.values)?dr(t.values):Array.isArray(t.items)?qe(t.items):Array.isArray(t.results)?qe(t.results):ol(t)}return[]}function wn(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)}`}function fr(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),i=e.map(()=>new Array(r).fill(0)),a=(l,c)=>{let m=e[l][c];return Number.isFinite(m)&&m>0?m:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let m=0,u=0;for(let d=0;d<n;d++){let h=a(d,c),f=h-a(d,c-1),y=0;for(let p=0;p<d;p++)y+=a(p,c)-a(p,c-1);m+=h,u+=(f/2+y)*h}m&&(l-=u/m),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,d=0;for(let h=0;h<n;h++){let f=e[h][l],y=Number.isFinite(f)?f:0;y>=0?(o[h][l]=u,u+=y,i[h][l]=u):(o[h][l]=d,d+=y,i[h][l]=d)}continue}let c=0;for(let u=0;u<n;u++)c+=a(u,l);let m=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let d=a(u,l);t==="expand"&&(d=c?d/c*100:0),o[u][l]=m,m+=d,i[u][l]=m}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,i[n-1]?.[u]??0);let m=0;for(let u=0;u<r;u++)m+=((o[0]?.[u]??0)+(i[n-1]?.[u]??0))/2;m/=r;for(let u=0;u<n;u++)for(let d=0;d<r;d++)o[u][d]-=m,i[u][d]-=m}return{y0:o,y1:i}}function Go(e,t,n=-1){if(!t.some(r=>r>=0))return-1;for(let r=e-1;r>=0;r--)if(r!==n&&!t.includes(r))return r;return-1}function Vo(e){let t=e.length,n=e.map(c=>{let m=0,u=-1/0;return c.forEach((d,h)=>{d>u&&(u=d,m=h)}),m}),r=e.map(c=>c.reduce((m,u)=>m+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,m)=>m).sort((c,m)=>n[c]-n[m]),i=[],a=[],s=0,l=0;for(let c of o)s<l?(i.push(c),s+=r[c]):(a.push(c),l+=r[c]);return[...a.reverse(),...i]}var il=Math.PI*2;function dt(e,t,n){return e<t?t:e>n?n:e}function Wo(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ft(e){return Math.round(e*100)/100}function Ko(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function Xo(e){let t=-1,n=1/0;return e.forEach((r,o)=>{r<n&&(n=r,t=o)}),t}function Uo(e){let t=e.length,n=e.reduce((l,c)=>l+c.x,0)/t,r=e.reduce((l,c)=>l+c.y,0)/t,o=0,i=0,a=0;for(let l of e)o+=(l.x-n)*(l.y-r),i+=(l.x-n)**2,a+=(l.y-r)**2;let s=i?o/i:0;return{slope:s,r2:i&&a?o*o/(i*a):0,at:l=>r+s*(l-n)}}function qo(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Yo(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 vn=new Map;function ne(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,i=vn.get(o);if(i===void 0){let a=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);qo(c)?a+=Yo(c):s+=Yo(c)}i=a+s*(n>=600?1.07:1),vn.size>5e3&&vn.clear(),vn.set(o,i)}return i*t}function ht(e,t,n,r=400){if(e=e.trim(),ne(e,n,r)<=t)return e;let o="…",i=0,a=e.length;for(;i<a;){let l=i+a+1>>1;ne(e.slice(0,l)+o,n,r)<=t?i=l:a=l-1}i>0&&(e.charCodeAt(i-1)&64512)===55296&&i--;let s=e.slice(0,i).trimEnd();return s.length<(qo(s.charCodeAt(0))?2:3)?"":s+o}function gt(e,t,n=0){return e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n}function hr(e,t,n,r,o="start",i=400){let a=ne(e,r,i);return{x:o==="start"?t:o==="middle"?t-a/2:t-a,y:n-r*.6,w:a,h:r*1.2}}var _t=C(I(),1),al=e=>Array.isArray(e)&&e.length===2;function Jo(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&al(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var sl=(e,t)=>ne(e,10.5,t?700:500)+8;function Dt(e,t,n,r="start",o){let i=sl(e,o);return{x:r==="end"?t-i:t,y:n-8,w:i,h:16}}function gr({p:e,x:t,y:n,text:r,anchor:o="start",strong:i}){let a=Dt(r,t,n,o,i);return(0,_t.jsxs)("g",{children:[(0,_t.jsx)("rect",{x:a.x,y:a.y,width:a.w,height:a.h,rx:5,fill:e.paint("panel"),opacity:.94}),(0,_t.jsx)(ce,{x:a.x+4,y:n,size:10.5,weight:i?700:500,fill:e.paint(i?"ink":"muted"),children:r})]})}var pt=C(I(),1),bt=10.5;function Zo(e,t,n){let r=e.map(t);if(new Set(r).size===r.length)return r;let o=1/0;for(let a=1;a<e.length;a++)o=Math.min(o,Math.abs(e[a]-e[a-1]));let i=o>0&&Number.isFinite(o)?Math.min(20,Math.max(2,Math.ceil(-Math.log10(o)-1e-9))):2;return e.map(a=>ye(a,{locale:n,maximumFractionDigits:i}))}function yt(e,t,n){let r=18;for(let o of Zo(e,t,n))r=Math.max(r,ne(o,bt));return Math.ceil(r+8)}function Qo(e){let{p:t,ticks:n,y:r,x0:o,x1:i,fmt:a}=e,s=e.side==="right",l=e.labels===!1?null:Zo(n,a,e.locale);return(0,pt.jsx)("g",{"aria-hidden":"true",opacity:e.opacity,children:n.map((c,m)=>{let u=Math.round(r(c))+.5,d=c===0&&e.zero!==!1;return(0,pt.jsxs)("g",{children:[(0,pt.jsx)("line",{x1:o,x2:i,y1:u,y2:u,stroke:t.paint(d?"dim":"line"),strokeWidth:1,shapeRendering:"crispEdges",opacity:d?.7:1}),l?(0,pt.jsx)(ce,{x:s?i+6:o-6,y:u,anchor:s?"start":"end",size:bt,fill:t.paint("muted"),children:l[m]}):null]},c)})})}function pr(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 je(e,t,n=4,r={}){let o=e,i=t;if(!Number.isFinite(o)||!Number.isFinite(i))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),i<0&&(i=0)),o===i)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let a=i-o,s=r.pad??.07,l=pr(a,n),c=[o,i];for(let m=0;m<4;m++){let u=Math.ceil(i/l-1e-9)*l,d=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-d<=l*.3?d:o-a*s,i===0?0:u-i<=l*.3?u:i+a*s];let h=pr(c[1]-c[0],n);if(h===l)break;l=h}return c}function ei(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),i=pr(o-r,n),a=[],s=Math.ceil(r/i-1e-9)*i;for(let l=s,c=0;l<=o+i*1e-9&&c<200;l+=i,c++)a.push(Number((Math.round(l/i)*i).toPrecision(12)));return a}function Ge(e,t){let[n,r]=e,[o,i]=t,a=r===n?0:(i-o)/(r-n),s=(l=>o+(l-n)*a);return s.domain=e,s.range=t,s.invert=l=>a===0?n:n+(l-o)/a,s.ticks=(l=4)=>ei(n,r,l),s}function Et(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[i,a]=je(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**i,10**a]}function ll(e,t,n){let r=Math.log10(e),o=Math.log10(t),i=n/Math.max(1e-9,o-r),a=(c,m=1)=>{let u=[];for(let d=Math.floor(r);d<=Math.ceil(o);d++)if(!(d%m))for(let h of c){let f=Number((h*10**d).toPrecision(12));f>=e*(1-1e-9)&&f<=t*(1+1e-9)&&u.push(f)}return u},s=i>=110?a([1,2,5]):a([1],Math.max(1,Math.ceil(24/i)));if(s.length>=2)return s;let l=a([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:ei(e,t,3)}function xt(e,t){let n=Ge([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>ll(e[0],e[1],Math.abs(t[1]-t[0])),r}function ti(e,t){let[n,r]=e,[o,i]=t,a=Math.sqrt(Math.max(0,n)),s=Math.sqrt(Math.max(0,r));return l=>s===a?i:o+(Math.sqrt(Math.max(0,l))-a)/(s-a)*(i-o)}function De(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}var cl=864e5;function ni(e,t,n,r=he){let o=t-e;if(!(o>0))return[{t:e,label:Lt(e,{locale:r,month:"short",day:"numeric"})}];let i=o/cl,a=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(m,u,d,h=!1)=>{let f=new Date(m),y=-1,p=0;for(;f.getTime()<=t&&p++<500;){if(f.getTime()>=e){let g=f.getFullYear(),x=h&&!l&&g!==y;a.push({t:f.getTime(),label:Lt(f,{locale:r,...d,...x?{year:"numeric"}:{}})}),y=g}u(f)}};if(i<=1.5){let m=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=m)??12,d=new Date(s);d.setMinutes(0,0,0),c(d,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(i<=n*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(m,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(i<=n*7*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());m.setDate(m.getDate()+(8-m.getDay())%7),c(m,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let m=i/30.44,u=Math.max(1,Math.ceil(m/Math.max(1,n))),d=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(d>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(h,f=>f.setFullYear(f.getFullYear()+d/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=h.getMonth()%d;f&&h.setMonth(h.getMonth()+(d-f)),c(h,y=>y.setMonth(y.getMonth()+d),{month:"short"},!0)}}return a}function kt(e,t){let n=new Array(e),r=new Uint8Array(e),o=i=>{if(typeof i!="string"||i.length===0||i.length>9)return-1;let a=Number(i);return Number.isInteger(a)&&a>=0&&a<e&&String(a)===i?a:-1};return new Proxy(n,{get(i,a,s){let l=o(a);return l>=0?(r[l]||(i[l]=t(l),r[l]=1),i[l]):Reflect.get(i,a,s)},has(i,a){return o(a)>=0||Reflect.has(i,a)}})}var ul=(e,t,n)=>e==="date"?dn(t,n)?.getTime()??NaN:ze(t);function ml(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&$o(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Ot(e,t,n,r,o={}){let i=ot(t,"x"),a=Array.isArray(n),s=a?n:null,l=a?null:ot(n,"y"),c=!a&&r!==void 0?ot(r,"series"):null,m=e.map((S,v)=>i(S,v)),u=o.xType??ml(m),d=o.locale??he,h,f,y;if(u==="band"){let S=m.map(A=>String(A??""));h=$e(S);let v=new Map(h.map((A,O)=>[A,O]));f=h.map((A,O)=>O),y=Int32Array.from(S,A=>v.get(A)??-1)}else{let S=u==="date"?o.dayFirst??To(m):void 0,v=m.map(j=>ul(u,j,S)),A=Array.from(new Set(v.filter(j=>Number.isFinite(j)))).sort((j,le)=>j-le),O=new Map(A.map((j,le)=>[j,le]));f=A,h=A.map(String),y=Int32Array.from(v,j=>O.get(j)??-1)}let p=o.dateFormat,g=S=>typeof S=="string"?mn(S.trim())?.[3]:void 0,x=u==="date"&&m.length<5e3?g(m[0]):void 0,T=(x===2||x===3)&&m.every(S=>g(S)===x),M=T&&x===3;if(u==="date"&&!p){let S=f.length>1?f[f.length-1]-f[0]:0;p=T&&x===2||S>864e5*120?{month:"short"}:S<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},S>864e5*800&&(p={year:"numeric",month:"short"})}let b;if(u==="band")b=h;else if(M&&!o.dateFormat){let S=Y(d)==="ko";b=f.map(v=>{let A=new Date(v),O=Math.floor(A.getMonth()/3)+1;return S?`${A.getFullYear()}년 ${O}분기`:`Q${O} ${A.getFullYear()}`})}else{let S=f.every(or),v=u==="date"?new Intl.DateTimeFormat(d,p):new Intl.NumberFormat(d,S?{useGrouping:!1}:{maximumFractionDigits:6});b=f.length>1e3?kt(f.length,A=>v.format(f[A])):f.map(A=>v.format(A))}let N=s?[...s]:c?$e(e.map((S,v)=>String(c(S,v)??""))):[""],D=new Map(N.map((S,v)=>[S,v])),z=N.map(()=>new Array(h.length).fill(NaN)),E=N.map(()=>new Array(h.length).fill(null)),_=o.aggregate??"sum",P=_==="mean"?N.map(()=>new Uint32Array(h.length)):null,R=(S,v,A,O)=>{let j=z[S][v];_==="last"?z[S][v]=A:_==="count"?z[S][v]=(Number.isFinite(j)?j:0)+1:_==="mean"?Number.isFinite(A)&&(z[S][v]=(Number.isFinite(j)?j:0)+A,P[S][v]++):z[S][v]=Number.isFinite(j)?j+(Number.isFinite(A)?A:0):A,E[S][v]=O};for(let S=0;S<e.length;S++){let v=y[S];if(v<0)continue;let A=e[S];if(s)for(let O=0;O<s.length;O++)R(O,v,ze(A[s[O]]),A);else{let O=c?D.get(String(c(A,S)??""))??0:0;R(O,v,ze(l(A,S)),A)}}if(P)for(let S=0;S<z.length;S++)for(let v=0;v<h.length;v++)P[S][v]>1&&(z[S][v]/=P[S][v]);return{type:u,keys:h,xnum:f,labels:b,series:N,values:z,rows:E}}var dl=140,zt=12,ri=14,br=20,oi=12.5;function fl(e,t,n=Eo){let r=Fe(t,t),o=new Map;e.forEach((a,s)=>{let l=r(a,s),c=o.get(l);c?c.push(a):o.set(l,[a])});let i=[...o.keys()].slice(0,n);return{values:i,groups:i.map(a=>o.get(a)),dropped:Math.max(0,o.size-n)}}function hl(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+zt)/(dl+zt))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function gl(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*zt)/t));return{pw:r,ph:typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(120,Math.min(180,Math.round(r*.62)))}}var It=e=>e.filter(Number.isFinite);function $n(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=ve(r,String(r));e.forEach((i,a)=>n.push(o(i,a)))}return It(n)}function ii(e,t,n,r,o,i){return Ot(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:i,dayFirst:n.dayFirst})}function pl(e,t,n,r,o,i){let a=Math.max(2,Math.round(i/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let b=t.flat(),N=r.refLines??{},[D,z]=De([...$n(b,r.x??"x"),...It([Number(N.x)])]),[E,_]=De([...$n(b,r.y??"y"),...It([Number(N.y)])].filter(R=>!s||R>0)),P=r.zero??!1;return{y:c??(s?Et(E,_,a):je(E,_,a,{zero:P,pad:.08})),x:r.xDomain??je(D,z,Math.max(2,Math.round(o/110)),{zero:P,pad:.06}),sameKeys:!0}}let m=e==="bar",u=m&&r.orientation==="horizontal",d=n[0]?.keys.join(""),h=n.every(b=>b.keys.join("")===d),f=n.length>0&&n.every(b=>b.type!=="band"&&b.type===n[0].type),y=r.xDomain??(!m&&f?De(n.flatMap(b=>It(b.xnum))):void 0),p=m?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(p==="percent")return{x:y,sameKeys:h};if(c)return{y:c,x:y,sameKeys:h};let g=[];t.forEach((b,N)=>{let D=n[N];if(p==="stacked"||p==="auto"&&D.series.length>1){let E=fr(D.values,"zero");E.y0.forEach(_=>g.push(..._)),E.y1.forEach(_=>g.push(..._))}else D.values.forEach(E=>g.push(...E));m&&!u&&r.line!==void 0&&ii(e,b,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(E=>g.push(...E)),m||g.push(...$n(b,r.lower),...$n(b,r.upper))}),m&&g.push(0),u||g.push(...Jo(r.annotations));for(let b of r.referenceLines??[])g.push(b.y);r.signColors&&g.push(Number(r.baseline??0));let[x,T]=De(It(g).filter(b=>!s||b>0));return{y:s?Et(x,T,a):m?je(x,T,u?Math.max(2,Math.round(o/120)):a):je(x,T,a,{zero:r.zero??e==="area"}),x:y,sameKeys:h}}function bl(e,t,n,r,o,i,a,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=Ot(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?xt:Ge)(o.y,[a-22,10]).ticks(Math.max(2,Math.round(a/70))),m=yt(c,rt(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(b=>b.series),d=r.endLabels??n.some(b=>b.series.length>1),h=m+6,f=i-(d?Math.min(i*.28,Math.max(...u.map(b=>ne(b,11,700)),20)+14):10),y=l.keys.length,[p,g]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,x=l.type==="number"?y>12:y>ni(p,g,Math.max(2,Math.floor((f-h)/64)),s).length;if(l.type==="band"||!y||x)return;let T=b=>h+(l.xnum[b]-p)/(g-p)*(f-h),M=b=>ne(l.labels[b],bt);for(let b=1;;b++){let N=Array.from({length:Math.ceil(y/b)},(D,z)=>z*b);if(b>=y||N.every((D,z)=>!z||T(D)-T(N[z-1])>=(M(D)+M(N[z-1]))/2+8))return N.map(D=>({value:l.xnum[D],label:l.labels[D]}))}}function yl(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function xl(e,t,n,r){let o=[n.x,n.y,n.series].map(i=>JSON.stringify(i??null)).join("|");return`ztd-facet-${yl(`${e}|${t}|${o}|${wn(r)}`)}`}function kl(e,t){return typeof e=="string"?t.includes(e):Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="string"&&t.includes(n))}var wl={en:{intro:(e,t)=>`${Ae(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}},yr=18;function ai(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:i}=fl(e.data,e.by),a=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=hl(s,a,e.columns),{pw:c,ph:m}=gl(s,l,e.height),u=e.scale!=="free",d=t==="scatter"?[]:o.map(P=>ii(t,P,n,n.y,n.series,n.aggregate)),h=u?pl(t,o,d,n,c,m):{sameKeys:!1},f=u?bl(t,o,d,n,h,c,m,e.locale):void 0,y=t==="bar"&&n.orientation==="horizontal",p=u&&(!y||h.sameKeys),g=u&&(y||h.x!==void 0||h.sameKeys),x=new Set(kl(e.highlight,r)?[e.highlight].flat():[]),T=x.size>0,M=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,b=e.syncId??xl(t,e.by,n,e.data),N=un(nt(n.format,e.locale),n.unit),D=wl[e.lang],z=[],E=r.map(P=>P===""?D.blank:P);return{panels:r.map((P,R)=>{let S=o[R],v=E[R],A=R%l,O;if(t!=="scatter"){let le=d[R],re=Me=>le.values.reduce((Ce,ge)=>Ce+(Number.isFinite(ge[Me])?ge[Me]:0),0),H=le.keys.map((Me,Ce)=>Ce).filter(Me=>le.values.some(Ce=>Number.isFinite(Ce[Me]))),de=H[H.length-1];z.push({first:H.length?re(H[0]):NaN,last:H.length?re(de):NaN,total:H.reduce((Me,Ce)=>Me+re(Ce),0)}),t!=="bar"&&le.series.length===1&&de!==void 0&&(O=N(le.values[0][de]))}else z.push({first:NaN,last:NaN,total:S.length});let j={data:S,width:c,height:m,ariaLabel:e.title?`${e.title}, ${v}`:v,syncId:b,highlight:T?x.has(P)?M?()=>!0:void 0:"none":e.highlight,showYAxis:!p||A===0,showXAxis:!g||R+l>=a};return h.y&&(j.yDomain=h.y),h.x&&(j.xDomain=h.x),f&&(j.xTicks=f),{value:P,label:v,props:j,last:O,isPicked:x.has(P)}}),cols:l,pw:c,ph:m,isPanelPick:T,description:vl(t,e.by,E,z,i,N,D)}}function vl(e,t,n,r,o,i,a){let s=a.intro(n.length,t),l=c=>Ko(r.map(m=>m[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=a.endHigh(n[c],i(r[c].last)));let m=n.filter((u,d)=>r[d].last<r[d].first);s+=m.length?a.falling(`${m.slice(0,5).join(", ")}${m.length>5?a.more:""}`):a.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?a.total(n[c],i(r[c].total)):a.points(n[c],r[c].total))}return o&&(s+=a.dropped(n.length,n.length+o)),s}var Te=C(U(),1);function $l(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Tl(e,t,n=1/0){let r=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=Math.min(r*.5,n))}var Tn={threshold:.25,enoughPx:96,rootMargin:"0px"};function ci(e,t=!0){let[n,r]=(0,Te.useState)({visible:!t,near:!t});return(0,Te.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(a=>{let s=Tl(a[a.length-1],Tn.threshold,Tn.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:$l(Tn.threshold),rootMargin:Tn.rootMargin}),i=new IntersectionObserver(a=>{let s=a[a.length-1];r(l=>l.near===s.isIntersecting?l:{...l,near:s.isIntersecting})},{threshold:0,rootMargin:"240px 0px 240px 0px"});return o.observe(e),i.observe(e),()=>{o.disconnect(),i.disconnect()}},[e,t]),n}function si(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Mn(e){let[t,n]=(0,Te.useState)(null),[r,o]=(0,Te.useState)(e??null),i=(0,Te.useCallback)(a=>{n(a),a&&e===void 0&&o(si(a))},[e]);return Ie(()=>{if(e!==void 0){o(e);return}if(!t)return;let a=c=>o(m=>m!==null&&Math.abs(m-c)<.5?m:c),s=()=>a(si(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let m=c[c.length-1]?.contentRect;m?a(m.width>0?Math.round(m.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,i,r]}var Ml=()=>()=>{};function wt(){return(0,Te.useSyncExternalStore)(Ml,()=>!0,()=>!1)}var li="(prefers-reduced-motion: reduce)";function Cn(e="auto"){let[t,n]=(0,Te.useState)(()=>Pe&&typeof window.matchMedia=="function"?window.matchMedia(li).matches:!1);return(0,Te.useEffect)(()=>{if(e!=="auto"||!Pe||typeof window.matchMedia!="function")return;let r=window.matchMedia(li),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var Ee=C(I(),1),Cl=60,Sl=420;function ui(e){let t=xe(),n=e.chartProps??{},[,r,o]=Mn(e.width),i=e.width??(o||480),a=ke(e.locale??n.locale),s=Y(a),l=(0,vt.useContext)(ct),c=e.title??l,m=e.chart.facetPlan,u=(0,vt.useMemo)(()=>{let g=ai({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:i,height:e.height,title:c,locale:a,lang:s});return m?m(g,n,a):g},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(g,x)=>typeof x=="function"?String(x):x),e.highlight,e.syncId,i,e.height,c,a,s,m]),d=`${(0,vt.useId)().replace(/:/g,"")}fd`,h=Cn(n.reducedMotion??"auto"),f=wt(),y=tn({motion:{enabled:n.animate!==!1&&!h&&Pe},hydrated:f},{waiting:!1,generation:0}),p=e.chart;return(0,Ee.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":d,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,Ee.jsx)("p",{id:d,style:yn,children:e.description??u.description}),(0,Ee.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:zt,rowGap:ri,...u.legend?{marginTop:yr}:null},children:u.panels.map((g,x)=>{let T=t.paint(g.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,Ee.jsxs)("div",{"data-facet":g.value,style:{minWidth:0,...en(y,!1,"fade",x*Cl,Sl)},children:[(0,Ee.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:br,fontSize:oi,fontWeight:700,lineHeight:`${br}px`,color:T},children:[(0,Ee.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.label}),g.last!==void 0?(0,Ee.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:g.last}):null]}),(0,Ee.jsx)(p,{...n,...g.props})]},g.value)})}),u.legend?(0,Ee.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:yr},children:u.legend}):null]})}var mi=["max","min","first","last","none"];function Oe(e,t,n,r,o="max"){let i=new Set,a=n.length,s=c=>{if(a&&c!=="none"){if(c==="first")i.add(0);else if(c==="last")i.add(a-1);else if(c==="max"||c==="min"){let m=-1,u=c==="max"?-1/0:1/0;r.forEach((d,h)=>{Number.isFinite(d)&&(c==="max"?d>u:d<u)&&(u=d,m=h)}),m>=0&&i.add(m)}}};if(e==null)return s(o),i;if(typeof e=="function")return t.forEach((c,m)=>{m<a&&c!==null&&c!==void 0&&e(c,m)&&i.add(m)}),i;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<a&&i.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((m,u)=>{m===c&&i.add(u)});return i}var Re=C(U(),1);async function Al(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(Y(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return it(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 it(i);let a=i.trim();return a.startsWith("{")||a.startsWith("[")?JSON.parse(a):it(i)}async function Nl(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 Al(i,t.parse,o,t.locale)}return t.select&&(r=jo(r,t.select)),t.transform?t.transform(r):qe(r)}function di(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[i,a]=(0,Re.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,Re.useState)(0),c=ke(t.locale),m=(0,Re.useRef)(t);m.current={...t,locale:c};let u=(0,Re.useRef)(e);u.current=e;let d=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],f=JSON.stringify(h.map(g=>typeof g=="object"?JSON.stringify(g):String(g))),y=(0,Re.useRef)(!1);(0,Re.useEffect)(()=>{let g=u.current;if(!g||!r){a(M=>M.status==="loading"?{...M,status:"idle"}:M);return}let x=new AbortController,T=!0;return y.current=!0,a(M=>({...M,data:o?M.data:[],status:"loading",error:null})),Nl(g,{...m.current,signal:x.signal}).then(M=>{T&&a({data:M,status:"success",error:null,updatedAt:Date.now()})}).catch(M=>{!T||x.signal.aborted||a(b=>({...b,status:"error",error:M instanceof Error?M:new Error(String(M))}))}).finally(()=>{T&&(y.current=!1)}),()=>{T=!1,y.current=!1,x.abort()}},[d,r,s,f,o]),(0,Re.useEffect)(()=>{if(!n||!r)return;let g=setInterval(()=>{y.current||l(x=>x+1)},n);return()=>clearInterval(g)},[n,r]);let p=(0,Re.useCallback)(()=>l(g=>g+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:p}}var kr=C(I(),1),Fl=["csv","svg","png"],Rl=/^[=+\-@\t\r\n=+-@]/,Pl=/var\(|color-mix\(/;function fi(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?ko(e.getTime()):String(e);return`"${(Rl.test(t)&&!Number.isFinite(ze(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Ll(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function _l(e,t){return`\uFEFF${[t.map(fi),...e.map(r=>t.map(o=>fi(r[o])))].map(r=>r.join(",")).join(`\r
25
+ `&&f++,s.push(l),i.push(s),s=[],l=""):l+=y}(l!==""||s.length)&&(s.push(l),i.push(s));let m=i.filter(f=>!(f.length===1&&f[0].trim()===""));if(!m.length)return[];let u=f=>n?Ho(f):f;if(!r)return m.map(f=>Object.fromEntries(f.map((y,p)=>[String(p),u(y)])));let d=[],h=new Set;return m[0].forEach((f,y)=>{let p=f.trim()||`col${y+1}`,g=p;for(let x=2;h.has(g);x++)g=`${p}_${x}`;h.add(g),d.push(g)}),m.slice(1).map(f=>Object.fromEntries(d.map((y,p)=>[y,u(f[p]??"")])))}function dr(e,t,n={}){if(!e.length)return[];let{typed:r=!0}=n,o=(t??e[0]).map((i,s)=>String(i??"").trim()||`col${s+1}`);return(t?e:e.slice(1)).map(i=>Object.fromEntries(o.map((s,l)=>[s,r&&typeof i[l]=="string"?Ho(i[l]):i[l]??null])))}function ol(e,t={}){let{labelKey:n="label",valueKey:r="value"}=t,o=Object.values(e);if(o.length&&o.every(a=>Array.isArray(a))){let a=Object.keys(e),i=Math.max(...o.map(s=>s.length));return Array.from({length:i},(s,l)=>Object.fromEntries(a.map(c=>[c,e[c][l]??null])))}return Object.entries(e).map(([a,i])=>({[n]:a,[r]:i}))}function jo(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 qe(e){if(e==null)return[];if(typeof e=="string"){let t=e.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{"))try{return qe(JSON.parse(t))}catch{}return at(t)}if(Array.isArray(e))return e.length?Array.isArray(e[0])?dr(e):typeof e[0]=="number"?e.map((t,n)=>({label:String(n+1),value:t})):e.filter(t=>t&&typeof t=="object"):[];if(typeof e=="object"){let t=e;return Array.isArray(t.data)?qe(t.data):Array.isArray(t.rows)&&Array.isArray(t.columns)?dr(t.rows,t.columns.map(n=>typeof n=="object"&&n&&"name"in n?String(n.name):String(n))):Array.isArray(t.rows)&&Array.isArray(t.fields)||Array.isArray(t.rows)?qe(t.rows):Array.isArray(t.values)?dr(t.values):Array.isArray(t.items)?qe(t.items):Array.isArray(t.results)?qe(t.results):ol(t)}return[]}function wn(e){if(!Array.isArray(e))try{return JSON.stringify(e??null)??""}catch{return String(e)}let t=e.length,n=a=>{try{return JSON.stringify(a)}catch{return String(a)}};if(t<=300)return n(e);let r=Math.ceil(t/60),o=[];for(let a=0;a<t;a+=r)o.push(e[a]);return o.push(e[t-1]),`${t}:${n(o)}`}function fr(e,t="zero"){let n=e.length,r=n?e[0].length:0,o=e.map(()=>new Array(r).fill(0)),a=e.map(()=>new Array(r).fill(0)),i=(l,c)=>{let m=e[l][c];return Number.isFinite(m)&&m>0?m:0},s=new Array(r).fill(0);if(t==="wiggle"&&n>0&&r>1){let l=0;for(let c=1;c<r;c++){let m=0,u=0;for(let d=0;d<n;d++){let h=i(d,c),f=h-i(d,c-1),y=0;for(let p=0;p<d;p++)y+=i(p,c)-i(p,c-1);m+=h,u+=(f/2+y)*h}m&&(l-=u/m),s[c]=l}}for(let l=0;l<r;l++){if(t==="zero"){let u=0,d=0;for(let h=0;h<n;h++){let f=e[h][l],y=Number.isFinite(f)?f:0;y>=0?(o[h][l]=u,u+=y,a[h][l]=u):(o[h][l]=d,d+=y,a[h][l]=d)}continue}let c=0;for(let u=0;u<n;u++)c+=i(u,l);let m=t==="silhouette"?-c/2:s[l];for(let u=0;u<n;u++){let d=i(u,l);t==="expand"&&(d=c?d/c*100:0),o[u][l]=m,m+=d,a[u][l]=m}}if(t==="wiggle"&&r){let l=1/0,c=-1/0;for(let u=0;u<r;u++)l=Math.min(l,o[0]?.[u]??0),c=Math.max(c,a[n-1]?.[u]??0);let m=0;for(let u=0;u<r;u++)m+=((o[0]?.[u]??0)+(a[n-1]?.[u]??0))/2;m/=r;for(let u=0;u<n;u++)for(let d=0;d<r;d++)o[u][d]-=m,a[u][d]-=m}return{y0:o,y1:a}}function Go(e,t,n=-1){if(!t.some(r=>r>=0))return-1;for(let r=e-1;r>=0;r--)if(r!==n&&!t.includes(r))return r;return-1}function Vo(e){let t=e.length,n=e.map(c=>{let m=0,u=-1/0;return c.forEach((d,h)=>{d>u&&(u=d,m=h)}),m}),r=e.map(c=>c.reduce((m,u)=>m+(Number.isFinite(u)?u:0),0)),o=Array.from({length:t},(c,m)=>m).sort((c,m)=>n[c]-n[m]),a=[],i=[],s=0,l=0;for(let c of o)s<l?(a.push(c),s+=r[c]):(i.push(c),l+=r[c]);return[...i.reverse(),...a]}var al=Math.PI*2;function dt(e,t,n){return e<t?t:e>n?n:e}function Wo(e){let t=0;for(let n of e)Number.isFinite(n)&&(t+=n);return t}function ft(e){return Math.round(e*100)/100}function Ko(e){let t=-1,n=-1/0;return e.forEach((r,o)=>{r>n&&(n=r,t=o)}),t}function Xo(e){let t=-1,n=1/0;return e.forEach((r,o)=>{r<n&&(n=r,t=o)}),t}function Uo(e){let t=e.length,n=e.reduce((l,c)=>l+c.x,0)/t,r=e.reduce((l,c)=>l+c.y,0)/t,o=0,a=0,i=0;for(let l of e)o+=(l.x-n)*(l.y-r),a+=(l.x-n)**2,i+=(l.y-r)**2;let s=a?o/a:0;return{slope:s,r2:a&&i?o*o/(a*i):0,at:l=>r+s*(l-n)}}function qo(e){return e>=44032&&e<=55203||e>=4352&&e<=4607||e>=12592&&e<=12687||e>=19968&&e<=40959}function Yo(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 vn=new Map;function ne(e,t,n=400){let r=String(e),o=`${r}|${n>=600?1:0}`,a=vn.get(o);if(a===void 0){let i=0,s=0;for(let l=0;l<r.length;l++){let c=r.charCodeAt(l);qo(c)?i+=Yo(c):s+=Yo(c)}a=i+s*(n>=600?1.07:1),vn.size>5e3&&vn.clear(),vn.set(o,a)}return a*t}function ht(e,t,n,r=400){if(e=e.trim(),ne(e,n,r)<=t)return e;let o="…",a=0,i=e.length;for(;a<i;){let l=a+i+1>>1;ne(e.slice(0,l)+o,n,r)<=t?a=l:i=l-1}a>0&&(e.charCodeAt(a-1)&64512)===55296&&a--;let s=e.slice(0,a).trimEnd();return s.length<(qo(s.charCodeAt(0))?2:3)?"":s+o}function gt(e,t,n=0){return e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n}function hr(e,t,n,r,o="start",a=400){let i=ne(e,r,a);return{x:o==="start"?t:o==="middle"?t-i/2:t-i,y:n-r*.6,w:i,h:r*1.2}}var _t=S(I(),1),il=e=>Array.isArray(e)&&e.length===2;function Jo(e){let t=[];for(let n of e??[])n.type==="line"&&typeof n.y=="number"?t.push(n.y):n.type==="band"&&il(n.y)&&t.push(Number(n.y[0]),Number(n.y[1]));return t.filter(Number.isFinite)}var sl=(e,t)=>ne(e,10.5,t?700:500)+8;function Dt(e,t,n,r="start",o){let a=sl(e,o);return{x:r==="end"?t-a:t,y:n-8,w:a,h:16}}function gr({p:e,x:t,y:n,text:r,anchor:o="start",strong:a}){let i=Dt(r,t,n,o,a);return(0,_t.jsxs)("g",{children:[(0,_t.jsx)("rect",{x:i.x,y:i.y,width:i.w,height:i.h,rx:5,fill:e.paint("panel"),opacity:.94}),(0,_t.jsx)(ce,{x:i.x+4,y:n,size:10.5,weight:a?700:500,fill:e.paint(a?"ink":"muted"),children:r})]})}var pt=S(I(),1),bt=10.5;function Zo(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=>ye(i,{locale:n,maximumFractionDigits:a}))}function yt(e,t,n){let r=18;for(let o of Zo(e,t,n))r=Math.max(r,ne(o,bt));return Math.ceil(r+8)}function Qo(e){let{p:t,ticks:n,y:r,x0:o,x1:a,fmt:i}=e,s=e.side==="right",l=e.labels===!1?null:Zo(n,i,e.locale);return(0,pt.jsx)("g",{"aria-hidden":"true",opacity:e.opacity,children:n.map((c,m)=>{let u=Math.round(r(c))+.5,d=c===0&&e.zero!==!1;return(0,pt.jsxs)("g",{children:[(0,pt.jsx)("line",{x1:o,x2:a,y1:u,y2:u,stroke:t.paint(d?"dim":"line"),strokeWidth:1,shapeRendering:"crispEdges",opacity:d?.7:1}),l?(0,pt.jsx)(ce,{x:s?a+6:o-6,y:u,anchor:s?"start":"end",size:bt,fill:t.paint("muted"),children:l[m]}):null]},c)})})}function pr(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 je(e,t,n=4,r={}){let o=e,a=t;if(!Number.isFinite(o)||!Number.isFinite(a))return[0,1];if(r.zero!==!1&&(o>0&&(o=0),a<0&&(a=0)),o===a)return o===0?[0,1]:o>0?[0,o*1.2]:[o*1.2,0];let i=a-o,s=r.pad??.07,l=pr(i,n),c=[o,a];for(let m=0;m<4;m++){let u=Math.ceil(a/l-1e-9)*l,d=Math.floor(o/l+1e-9)*l;c=[o===0?0:o-d<=l*.3?d:o-i*s,a===0?0:u-a<=l*.3?u:a+i*s];let h=pr(c[1]-c[0],n);if(h===l)break;l=h}return c}function ea(e,t,n=4){let r=Math.min(e,t),o=Math.max(e,t),a=pr(o-r,n),i=[],s=Math.ceil(r/a-1e-9)*a;for(let l=s,c=0;l<=o+a*1e-9&&c<200;l+=a,c++)i.push(Number((Math.round(l/a)*a).toPrecision(12)));return i}function Ge(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)=>ea(n,r,l),s}function Et(e,t,n=4){if(!(e>0)||!(t>0)||!Number.isFinite(e)||!Number.isFinite(t))return[1,10];let r=Math.log10(e),o=Math.log10(t);if(r===o)return[10**(r-.5),10**(r+.5)];let[a,i]=je(r,o,Math.max(n,Math.ceil(o-r)),{zero:!1});return[10**a,10**i]}function ll(e,t,n){let r=Math.log10(e),o=Math.log10(t),a=n/Math.max(1e-9,o-r),i=(c,m=1)=>{let u=[];for(let d=Math.floor(r);d<=Math.ceil(o);d++)if(!(d%m))for(let h of c){let f=Number((h*10**d).toPrecision(12));f>=e*(1-1e-9)&&f<=t*(1+1e-9)&&u.push(f)}return u},s=a>=110?i([1,2,5]):i([1],Math.max(1,Math.ceil(24/a)));if(s.length>=2)return s;let l=i([1,2,3,4,5,6,7,8,9]);return l.length>=2?l:ea(e,t,3)}function xt(e,t){let n=Ge([Math.log10(e[0]),Math.log10(e[1])],t),r=(o=>o>0?n(Math.log10(o)):Number.NaN);return r.domain=e,r.range=t,r.invert=o=>10**n.invert(o),r.ticks=()=>ll(e[0],e[1],Math.abs(t[1]-t[0])),r}function ta(e,t){let[n,r]=e,[o,a]=t,i=Math.sqrt(Math.max(0,n)),s=Math.sqrt(Math.max(0,r));return l=>s===i?a:o+(Math.sqrt(Math.max(0,l))-i)/(s-i)*(a-o)}function De(e){let t=1/0,n=-1/0;for(let r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,1]:[t,n]}var cl=864e5;function na(e,t,n,r=he){let o=t-e;if(!(o>0))return[{t:e,label:Lt(e,{locale:r,month:"short",day:"numeric"})}];let a=o/cl,i=[],s=new Date(e),l=new Date(e).getFullYear()===new Date(t).getFullYear(),c=(m,u,d,h=!1)=>{let f=new Date(m),y=-1,p=0;for(;f.getTime()<=t&&p++<500;){if(f.getTime()>=e){let g=f.getFullYear(),x=h&&!l&&g!==y;i.push({t:f.getTime(),label:Lt(f,{locale:r,...d,...x?{year:"numeric"}:{}})}),y=g}u(f)}};if(a<=1.5){let m=Math.max(1,Math.ceil(o/36e5/Math.max(1,n))),u=[1,2,3,4,6,12].find(h=>h>=m)??12,d=new Date(s);d.setMinutes(0,0,0),c(d,h=>h.setHours(h.getHours()+u),{hour:"numeric"})}else if(a<=n*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());c(m,u=>u.setDate(u.getDate()+1),{month:"numeric",day:"numeric"})}else if(a<=n*7*1.2){let m=new Date(s.getFullYear(),s.getMonth(),s.getDate());m.setDate(m.getDate()+(8-m.getDay())%7),c(m,u=>u.setDate(u.getDate()+7),{month:"numeric",day:"numeric"})}else{let m=a/30.44,u=Math.max(1,Math.ceil(m/Math.max(1,n))),d=[1,2,3,6,12,24,60].find(h=>h>=u)??120;if(d>=12){let h=new Date(s.getFullYear()+(s.getMonth()>0||s.getDate()>1?1:0),0,1);c(h,f=>f.setFullYear(f.getFullYear()+d/12),{year:"numeric"})}else{let h=new Date(s.getFullYear(),s.getMonth()+(s.getDate()>1?1:0),1),f=h.getMonth()%d;f&&h.setMonth(h.getMonth()+(d-f)),c(h,y=>y.setMonth(y.getMonth()+d),{month:"short"},!0)}}return i}function kt(e,t){let n=new Array(e),r=new Uint8Array(e),o=a=>{if(typeof a!="string"||a.length===0||a.length>9)return-1;let i=Number(a);return Number.isInteger(i)&&i>=0&&i<e&&String(i)===a?i:-1};return new Proxy(n,{get(a,i,s){let l=o(i);return l>=0?(r[l]||(a[l]=t(l),r[l]=1),a[l]):Reflect.get(a,i,s)},has(a,i){return o(i)>=0||Reflect.has(a,i)}})}var ul=(e,t,n)=>e==="date"?dn(t,n)?.getTime()??NaN:ze(t);function ml(e){let t=e.filter(n=>n!=null&&n!=="");return t.length?t.every(n=>n instanceof Date)||t.every(n=>typeof n=="string"&&$o(n.trim()))?"date":t.every(n=>typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim()))?"number":"band":"band"}function Ot(e,t,n,r,o={}){let a=ot(t,"x"),i=Array.isArray(n),s=i?n:null,l=i?null:ot(n,"y"),c=!i&&r!==void 0?ot(r,"series"):null,m=e.map((C,v)=>a(C,v)),u=o.xType??ml(m),d=o.locale??he,h,f,y;if(u==="band"){let C=m.map(A=>String(A??""));h=$e(C);let v=new Map(h.map((A,O)=>[A,O]));f=h.map((A,O)=>O),y=Int32Array.from(C,A=>v.get(A)??-1)}else{let C=u==="date"?o.dayFirst??Mo(m):void 0,v=m.map(j=>ul(u,j,C)),A=Array.from(new Set(v.filter(j=>Number.isFinite(j)))).sort((j,le)=>j-le),O=new Map(A.map((j,le)=>[j,le]));f=A,h=A.map(String),y=Int32Array.from(v,j=>O.get(j)??-1)}let p=o.dateFormat,g=C=>typeof C=="string"?mn(C.trim())?.[3]:void 0,x=u==="date"&&m.length<5e3?g(m[0]):void 0,M=(x===2||x===3)&&m.every(C=>g(C)===x),T=M&&x===3;if(u==="date"&&!p){let C=f.length>1?f[f.length-1]-f[0]:0;p=M&&x===2||C>864e5*120?{month:"short"}:C<864e5*2?{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"numeric",day:"numeric"},C>864e5*800&&(p={year:"numeric",month:"short"})}let b;if(u==="band")b=h;else if(T&&!o.dateFormat){let C=Y(d)==="ko";b=f.map(v=>{let A=new Date(v),O=Math.floor(A.getMonth()/3)+1;return C?`${A.getFullYear()}년 ${O}분기`:`Q${O} ${A.getFullYear()}`})}else{let C=f.every(or),v=u==="date"?new Intl.DateTimeFormat(d,p):new Intl.NumberFormat(d,C?{useGrouping:!1}:{maximumFractionDigits:6});b=f.length>1e3?kt(f.length,A=>v.format(f[A])):f.map(A=>v.format(A))}let N=s?[...s]:c?$e(e.map((C,v)=>String(c(C,v)??""))):[""],D=new Map(N.map((C,v)=>[C,v])),z=N.map(()=>new Array(h.length).fill(NaN)),E=N.map(()=>new Array(h.length).fill(null)),_=o.aggregate??"sum",P=_==="mean"?N.map(()=>new Uint32Array(h.length)):null,R=(C,v,A,O)=>{let j=z[C][v];_==="last"?z[C][v]=A:_==="count"?z[C][v]=(Number.isFinite(j)?j:0)+1:_==="mean"?Number.isFinite(A)&&(z[C][v]=(Number.isFinite(j)?j:0)+A,P[C][v]++):z[C][v]=Number.isFinite(j)?j+(Number.isFinite(A)?A:0):A,E[C][v]=O};for(let C=0;C<e.length;C++){let v=y[C];if(v<0)continue;let A=e[C];if(s)for(let O=0;O<s.length;O++)R(O,v,ze(A[s[O]]),A);else{let O=c?D.get(String(c(A,C)??""))??0:0;R(O,v,ze(l(A,C)),A)}}if(P)for(let C=0;C<z.length;C++)for(let v=0;v<h.length;v++)P[C][v]>1&&(z[C][v]/=P[C][v]);return{type:u,keys:h,xnum:f,labels:b,series:N,values:z,rows:E}}var dl=140,zt=12,ra=14,br=20,oa=12.5;function fl(e,t,n=Eo){let r=Fe(t,t),o=new Map;e.forEach((i,s)=>{let l=r(i,s),c=o.get(l);c?c.push(i):o.set(l,[i])});let a=[...o.keys()].slice(0,n);return{values:a,groups:a.map(i=>o.get(i)),dropped:Math.max(0,o.size-n)}}function hl(e,t,n){if(t<1)return 1;let r=Math.max(1,Math.floor((e+zt)/(dl+zt))),o=Math.max(1,Math.min(r,Number.isInteger(n)&&n>=1?n:r,t));return Math.ceil(t/Math.ceil(t/o))}function gl(e,t,n){let r=Math.max(40,Math.floor((e-(t-1)*zt)/t));return{pw:r,ph:typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(120,Math.min(180,Math.round(r*.62)))}}var It=e=>e.filter(Number.isFinite);function $n(e,t){let n=[];for(let r of Array.isArray(t)?t:t===void 0?[]:[t]){let o=ve(r,String(r));e.forEach((a,i)=>n.push(o(a,i)))}return It(n)}function aa(e,t,n,r,o,a){return Ot(t,n.x,r,o,{xType:e==="bar"?"band":n.xType,aggregate:a,dayFirst:n.dayFirst})}function pl(e,t,n,r,o,a){let i=Math.max(2,Math.round(a/70)),s=r.yScale==="log"&&(e==="line"||e==="scatter"),l=r.yDomain,c=l&&(!s||l[0]>0&&l[1]>0)?l:void 0;if(e==="scatter"){let b=t.flat(),N=r.refLines??{},[D,z]=De([...$n(b,r.x??"x"),...It([Number(N.x)])]),[E,_]=De([...$n(b,r.y??"y"),...It([Number(N.y)])].filter(R=>!s||R>0)),P=r.zero??!1;return{y:c??(s?Et(E,_,i):je(E,_,i,{zero:P,pad:.08})),x:r.xDomain??je(D,z,Math.max(2,Math.round(o/110)),{zero:P,pad:.06}),sameKeys:!0}}let m=e==="bar",u=m&&r.orientation==="horizontal",d=n[0]?.keys.join(""),h=n.every(b=>b.keys.join("")===d),f=n.length>0&&n.every(b=>b.type!=="band"&&b.type===n[0].type),y=r.xDomain??(!m&&f?De(n.flatMap(b=>It(b.xnum))):void 0),p=m?r.layout??"grouped":e==="area"?r.stack??"auto":"none";if(p==="percent")return{x:y,sameKeys:h};if(c)return{y:c,x:y,sameKeys:h};let g=[];t.forEach((b,N)=>{let D=n[N];if(p==="stacked"||p==="auto"&&D.series.length>1){let E=fr(D.values,"zero");E.y0.forEach(_=>g.push(..._)),E.y1.forEach(_=>g.push(..._))}else D.values.forEach(E=>g.push(...E));m&&!u&&r.line!==void 0&&aa(e,b,r,[].concat(r.line),void 0,r.series===void 0?r.aggregate:"mean").values.forEach(E=>g.push(...E)),m||g.push(...$n(b,r.lower),...$n(b,r.upper))}),m&&g.push(0),u||g.push(...Jo(r.annotations));for(let b of r.referenceLines??[])g.push(b.y);r.signColors&&g.push(Number(r.baseline??0));let[x,M]=De(It(g).filter(b=>!s||b>0));return{y:s?Et(x,M,i):m?je(x,M,u?Math.max(2,Math.round(o/120)):i):je(x,M,i,{zero:r.zero??e==="area"}),x:y,sameKeys:h}}function bl(e,t,n,r,o,a,i,s){if(e!=="line"&&e!=="area"||!o.x||!o.y)return;let l=Ot(t.flat(),r.x,r.y,void 0,{xType:r.xType,locale:s,dayFirst:r.dayFirst}),c=(r.yScale==="log"&&e==="line"?xt:Ge)(o.y,[i-22,10]).ticks(Math.max(2,Math.round(i/70))),m=yt(c,rt(r.format,s,Math.max(Math.abs(o.y[0]),Math.abs(o.y[1]))),s),u=n.flatMap(b=>b.series),d=r.endLabels??n.some(b=>b.series.length>1),h=m+6,f=a-(d?Math.min(a*.28,Math.max(...u.map(b=>ne(b,11,700)),20)+14):10),y=l.keys.length,[p,g]=o.x[1]===o.x[0]?[o.x[0],o.x[0]+1]:o.x,x=l.type==="number"?y>12:y>na(p,g,Math.max(2,Math.floor((f-h)/64)),s).length;if(l.type==="band"||!y||x)return;let M=b=>h+(l.xnum[b]-p)/(g-p)*(f-h),T=b=>ne(l.labels[b],bt);for(let b=1;;b++){let N=Array.from({length:Math.ceil(y/b)},(D,z)=>z*b);if(b>=y||N.every((D,z)=>!z||M(D)-M(N[z-1])>=(T(D)+T(N[z-1]))/2+8))return N.map(D=>({value:l.xnum[D],label:l.labels[D]}))}}function yl(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}function xl(e,t,n,r){let o=[n.x,n.y,n.series].map(a=>JSON.stringify(a??null)).join("|");return`ztd-facet-${yl(`${e}|${t}|${o}|${wn(r)}`)}`}function kl(e,t){return typeof e=="string"?t.includes(e):Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="string"&&t.includes(n))}var wl={en:{intro:(e,t)=>`${Ae(e,"panel")} by ${t}.`,endHigh:(e,t)=>` ${e} ends highest at ${t}.`,falling:e=>` Lower at the end than at the start: ${e}.`,noneFalling:" None is lower at the end than at the start.",total:(e,t)=>` ${e} has the largest total at ${t}.`,points:(e,t)=>` ${e} has the most points (${t}).`,dropped:(e,t)=>` Only the first ${e} of ${t} values are shown.`,more:", …",blank:"(blank)"},ko:{intro:(e,t)=>`${t}별 패널 ${e}개.`,endHigh:(e,t)=>` 마지막 값이 가장 큰 곳: ${e}(${t}).`,falling:e=>` 처음보다 끝이 낮은 곳: ${e}.`,noneFalling:" 처음보다 끝이 낮은 곳은 없어요.",total:(e,t)=>` 합계가 가장 큰 곳: ${e}(${t}).`,points:(e,t)=>` 점이 가장 많은 곳: ${e}(${t}개).`,dropped:(e,t)=>` ${t}개 중 앞의 ${e}개만 보여요.`,more:" 등",blank:"(빈 값)"}},yr=18;function ia(e){let{type:t,chartProps:n}=e,{values:r,groups:o,dropped:a}=fl(e.data,e.by),i=r.length,s=typeof e.width=="number"&&Number.isFinite(e.width)&&e.width>0?e.width:480,l=hl(s,i,e.columns),{pw:c,ph:m}=gl(s,l,e.height),u=e.scale!=="free",d=t==="scatter"?[]:o.map(P=>aa(t,P,n,n.y,n.series,n.aggregate)),h=u?pl(t,o,d,n,c,m):{sameKeys:!1},f=u?bl(t,o,d,n,h,c,m,e.locale):void 0,y=t==="bar"&&n.orientation==="horizontal",p=u&&(!y||h.sameKeys),g=u&&(y||h.x!==void 0||h.sameKeys),x=new Set(kl(e.highlight,r)?[e.highlight].flat():[]),M=x.size>0,T=t==="bar"&&!Array.isArray(n.y)&&n.series===void 0||t==="scatter"&&n.series===void 0,b=e.syncId??xl(t,e.by,n,e.data),N=un(nt(n.format,e.locale),n.unit),D=wl[e.lang],z=[],E=r.map(P=>P===""?D.blank:P);return{panels:r.map((P,R)=>{let C=o[R],v=E[R],A=R%l,O;if(t!=="scatter"){let le=d[R],re=Te=>le.values.reduce((Se,ge)=>Se+(Number.isFinite(ge[Te])?ge[Te]:0),0),H=le.keys.map((Te,Se)=>Se).filter(Te=>le.values.some(Se=>Number.isFinite(Se[Te]))),de=H[H.length-1];z.push({first:H.length?re(H[0]):NaN,last:H.length?re(de):NaN,total:H.reduce((Te,Se)=>Te+re(Se),0)}),t!=="bar"&&le.series.length===1&&de!==void 0&&(O=N(le.values[0][de]))}else z.push({first:NaN,last:NaN,total:C.length});let j={data:C,width:c,height:m,ariaLabel:e.title?`${e.title}, ${v}`:v,syncId:b,highlight:M?x.has(P)?T?()=>!0:void 0:"none":e.highlight,showYAxis:!p||A===0,showXAxis:!g||R+l>=i};return h.y&&(j.yDomain=h.y),h.x&&(j.xDomain=h.x),f&&(j.xTicks=f),{value:P,label:v,props:j,last:O,isPicked:x.has(P)}}),cols:l,pw:c,ph:m,isPanelPick:M,description:vl(t,e.by,E,z,a,N,D)}}function vl(e,t,n,r,o,a,i){let s=i.intro(n.length,t),l=c=>Ko(r.map(m=>m[c]));if(e==="line"||e==="area"){let c=l("last");c>=0&&(s+=i.endHigh(n[c],a(r[c].last)));let m=n.filter((u,d)=>r[d].last<r[d].first);s+=m.length?i.falling(`${m.slice(0,5).join(", ")}${m.length>5?i.more:""}`):i.noneFalling}else{let c=l("total");c>=0&&(s+=e==="bar"?i.total(n[c],a(r[c].total)):i.points(n[c],r[c].total))}return o&&(s+=i.dropped(n.length,n.length+o)),s}var Me=S(U(),1);function $l(e){return[...new Set([0,.01,.02,.05,.1,.15,.2,e].filter(t=>t<=e))].sort((t,n)=>t-n)}function Ml(e,t,n=1/0){let r=e.rootBounds?.height??window.innerHeight;return e.isIntersecting&&(e.intersectionRatio>=t||e.intersectionRect.height>=Math.min(r*.5,n))}var Mn={threshold:.25,enoughPx:96,rootMargin:"0px"};function ca(e,t=!0){let[n,r]=(0,Me.useState)({visible:!t,near:!t});return(0,Me.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=Ml(i[i.length-1],Mn.threshold,Mn.enoughPx);r(l=>l.visible===s?l:{...l,visible:s,near:l.near||s})},{threshold:$l(Mn.threshold),rootMargin:Mn.rootMargin}),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 sa(e){let t=e.getBoundingClientRect().width;return t>0?Math.round(t*10)/10:0}function Tn(e){let[t,n]=(0,Me.useState)(null),[r,o]=(0,Me.useState)(e??null),a=(0,Me.useCallback)(i=>{n(i),i&&e===void 0&&o(sa(i))},[e]);return Ie(()=>{if(e!==void 0){o(e);return}if(!t)return;let i=c=>o(m=>m!==null&&Math.abs(m-c)<.5?m:c),s=()=>i(sa(t));if(typeof ResizeObserver>"u")return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s);let l=new ResizeObserver(c=>{let m=c[c.length-1]?.contentRect;m?i(m.width>0?Math.round(m.width*10)/10:0):s()});return l.observe(t),()=>l.disconnect()},[t,e]),[t,a,r]}var Tl=()=>()=>{};function wt(){return(0,Me.useSyncExternalStore)(Tl,()=>!0,()=>!1)}var la="(prefers-reduced-motion: reduce)";function Sn(e="auto"){let[t,n]=(0,Me.useState)(()=>Pe&&typeof window.matchMedia=="function"?window.matchMedia(la).matches:!1);return(0,Me.useEffect)(()=>{if(e!=="auto"||!Pe||typeof window.matchMedia!="function")return;let r=window.matchMedia(la),o=()=>n(r.matches);return o(),r.addEventListener?.("change",o),()=>r.removeEventListener?.("change",o)},[e]),e===!0?!0:e===!1?!1:t}var Ee=S(I(),1),Sl=60,Cl=420;function ua(e){let t=xe(),n=e.chartProps??{},[,r,o]=Tn(e.width),a=e.width??(o||480),i=ke(e.locale??n.locale),s=Y(i),l=(0,vt.useContext)(ct),c=e.title??l,m=e.chart.facetPlan,u=(0,vt.useMemo)(()=>{let g=ia({type:e.type,data:e.data,by:e.by,columns:e.columns,scale:e.scale,chartProps:n,highlight:e.highlight,syncId:e.syncId,width:a,height:e.height,title:c,locale:i,lang:s});return m?m(g,n,i):g},[e.type,e.data,e.by,e.columns,e.scale,JSON.stringify(n,(g,x)=>typeof x=="function"?String(x):x),e.highlight,e.syncId,a,e.height,c,i,s,m]),d=`${(0,vt.useId)().replace(/:/g,"")}fd`,h=Sn(n.reducedMotion??"auto"),f=wt(),y=tn({motion:{enabled:n.animate!==!1&&!h&&Pe},hydrated:f},{waiting:!1,generation:0}),p=e.chart;return(0,Ee.jsxs)("div",{ref:r,role:"group","aria-label":c,"aria-describedby":d,className:e.className,style:{position:"relative",width:"100%",...e.style},children:[(0,Ee.jsx)("p",{id:d,style:yn,children:e.description??u.description}),(0,Ee.jsx)("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u.cols}, minmax(0, 1fr))`,columnGap:zt,rowGap:ra,...u.legend?{marginTop:yr}:null},children:u.panels.map((g,x)=>{let M=t.paint(g.isPicked?"accentText":u.isPanelPick?"muted":"ink");return(0,Ee.jsxs)("div",{"data-facet":g.value,style:{minWidth:0,...en(y,!1,"fade",x*Sl,Cl)},children:[(0,Ee.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:br,fontSize:oa,fontWeight:700,lineHeight:`${br}px`,color:M},children:[(0,Ee.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.label}),g.last!==void 0?(0,Ee.jsx)("span",{style:{flex:"none",fontVariantNumeric:"tabular-nums"},children:g.last}):null]}),(0,Ee.jsx)(p,{...n,...g.props})]},g.value)})}),u.legend?(0,Ee.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,height:yr},children:u.legend}):null]})}var ma=["max","min","first","last","none"];function Oe(e,t,n,r,o="max"){let a=new Set,i=n.length,s=c=>{if(i&&c!=="none"){if(c==="first")a.add(0);else if(c==="last")a.add(i-1);else if(c==="max"||c==="min"){let m=-1,u=c==="max"?-1/0:1/0;r.forEach((d,h)=>{Number.isFinite(d)&&(c==="max"?d>u:d<u)&&(u=d,m=h)}),m>=0&&a.add(m)}}};if(e==null)return s(o),a;if(typeof e=="function")return t.forEach((c,m)=>{m<i&&c!==null&&c!==void 0&&e(c,m)&&a.add(m)}),a;let l=Array.isArray(e)?e:[e];for(let c of l)typeof c=="number"?c>=0&&c<i&&a.add(c):c==="max"||c==="min"||c==="first"||c==="last"||c==="none"?s(c):n.forEach((m,u)=>{m===c&&a.add(u)});return a}var Re=S(U(),1);async function Al(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(Y(r)==="ko"?`데이터 대신 HTML 페이지를 받았어요. 주소를 확인해 주세요${n?`: ${n}`:"."}`:`Got an HTML page instead of data${n?` (${n})`:""}. Check the URL.`);if(t==="csv")return at(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 at(a);let i=a.trim();return i.startsWith("{")||i.startsWith("[")?JSON.parse(i):at(a)}async function Nl(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 Al(a,t.parse,o,t.locale)}return t.select&&(r=jo(r,t.select)),t.transform?t.transform(r):qe(r)}function da(e,t={}){let{refreshMs:n,enabled:r=!0,keepPrevious:o=!0}=t,[a,i]=(0,Re.useState)(()=>({data:[],status:e&&r?"loading":"idle",error:null,updatedAt:null})),[s,l]=(0,Re.useState)(0),c=ke(t.locale),m=(0,Re.useRef)(t);m.current={...t,locale:c};let u=(0,Re.useRef)(e);u.current=e;let d=typeof e=="function"?"fn":e instanceof Request?e.url:e?String(e):"",h=t.deps??[],f=JSON.stringify(h.map(g=>typeof g=="object"?JSON.stringify(g):String(g))),y=(0,Re.useRef)(!1);(0,Re.useEffect)(()=>{let g=u.current;if(!g||!r){i(T=>T.status==="loading"?{...T,status:"idle"}:T);return}let x=new AbortController,M=!0;return y.current=!0,i(T=>({...T,data:o?T.data:[],status:"loading",error:null})),Nl(g,{...m.current,signal:x.signal}).then(T=>{M&&i({data:T,status:"success",error:null,updatedAt:Date.now()})}).catch(T=>{!M||x.signal.aborted||i(b=>({...b,status:"error",error:T instanceof Error?T:new Error(String(T))}))}).finally(()=>{M&&(y.current=!1)}),()=>{M=!1,y.current=!1,x.abort()}},[d,r,s,f,o]),(0,Re.useEffect)(()=>{if(!n||!r)return;let g=setInterval(()=>{y.current||l(x=>x+1)},n);return()=>clearInterval(g)},[n,r]);let p=(0,Re.useCallback)(()=>l(g=>g+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:p}}var kr=S(I(),1),Fl=["csv","svg","png"],Rl=/^[=+\-@\t\r\n=+-@]/,Pl=/var\(|color-mix\(/;function fa(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?ko(e.getTime()):String(e);return`"${(Rl.test(t)&&!Number.isFinite(ze(t))?`'${t}`:t).replace(/"/g,'""')}"`}function Ll(e){return[...new Set(e.slice(0,200).flatMap(t=>t&&typeof t=="object"?Object.keys(t):[]))]}function _l(e,t){return`\uFEFF${[t.map(fa),...e.map(r=>t.map(o=>fa(r[o])))].map(r=>r.join(",")).join(`\r
26
26
  `)}\r
27
- `}function Dl(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function xr(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var hi=2,Je=16;function gi(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,a,s]=r.getImageData(0,0,1,1).data;return n=s===255?`rgb(${o}, ${i}, ${a})`:`rgba(${o}, ${i}, ${a}, ${Math.round(s/255*1e3)/1e3})`,t.set(e,n),n}function pi(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 bi(e,t,n){let r=e.closest(".ztd-card"),o=r?.querySelector("svg.ztd-svg");if(!r||!o)return null;let{width:i,height:a}=o.viewBox.baseVal,[s,l]=[i+Je*2,a+Je*2],c=o.cloneNode(!0),m=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((f,y)=>{let p;for(let g of Array.from(f.attributes)){if(!Pl.test(g.value))continue;let x=(p??(p=getComputedStyle(f))).getPropertyValue(g.name);x&&m[y].setAttribute(g.name,gi(x,u))}}),c.removeAttribute("style");for(let[f,y]of Object.entries({viewBox:`${-Je} ${-Je} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(f,String(y));let d=gi(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let f=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(pi("rect",{x:-Je,y:-Je,width:s,height:l,fill:d}),f),h&&c.insertBefore(pi("image",{href:h.toDataURL(),width:i,height:a}),f)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:i,vh:a,bg:d,canvas:h}}function El(e,t){let n=bi(e,hi,!1);if(!n)return;let r=hi,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,Je*r,Je*r,n.vw*r,n.vh*r);let a=URL.createObjectURL(new Blob([n.svg],{type:"image/svg+xml"})),s=new Image;s.onload=()=>{i.drawImage(s,0,0,o.width,o.height),URL.revokeObjectURL(a),o.toBlob(l=>l&&xr(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(a),s.src=a}function yi(e){let t=xe(e.theme),n=Y(ke(e.locale))==="ko",r=Dl(e.filename),o=(i,a)=>{if(i==="csv")return xr(new Blob([_l(e.data,e.columns?.length?e.columns:Ll(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(i==="png")return El(a,r);let s=bi(a,1,!0);s&&xr(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,kr.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Fl.filter(i=>!e.formats||e.formats.includes(i)).map(i=>{let a=i.toUpperCase(),s=n?`${a} 내려받기`:`Download ${a}`;return(0,kr.jsx)("button",{type:"button",className:"ztd-btn","aria-label":s,title:s,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:a},i)})})}var ki=C(I(),1);function xi(e,t=he){let n=nt(void 0,t),r=e.split(`
28
- `),o=(i,a)=>{if(a==="label")return i.label;if(a==="value")return i.formatted??(i.value===null?null:n(i.value));if(a==="series")return i.series??null;let s=i.datum&&typeof i.datum=="object"?i.datum[a]:void 0;return s==null||s===""||typeof s=="number"&&!Number.isFinite(s)?null:typeof s=="number"?n(s):s instanceof Date?Lt(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return i=>{let a=[];for(let s of r){let l=!1,c=s.replace(vo,(m,u)=>o(i,u.trim())??(l=!0,""));l||a.push(c)}return a.length?a.map((s,l)=>(0,ki.jsx)("div",{children:s},l)):null}}function wi(e,t,n=!1){let r=Fe(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),i=$e(o);if(!n)return i;let a=new Map;for(let s of o)a.set(s,(a.get(s)??0)+1);return i.map((s,l)=>[s,l]).sort((s,l)=>a.get(s[0])-a.get(l[0])||s[1]-l[1]).map(([s])=>s)}function vi(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 it(t.csv)}return null}var Ni=C(U(),1);var Z=C(U(),1);function $i(e,t){let n=xe(e.theme),[r,o,i]=Mn(e.width),a=wt(),s=e.width??(i||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,m=Cn(e.reducedMotion??"auto"),u=e.animate!==!1&&!m&&Pe,d=ci(r,e.animateOnView!==!1&&u),h=ke(e.locale),f=Y(h),y=(0,Z.useMemo)(()=>nt(e.format,h,t.format),[e.format,h,t.format]),p=(0,Z.useCallback)(H=>cn(H,{locale:h}),[h]),g=(0,Z.useMemo)(()=>un(y,e.unit),[y,e.unit]),x=(0,Z.useMemo)(()=>wn(e.data),[e.data]),[T,M]=(0,Z.useState)(null),[b,N]=(0,Z.useState)(null),D=(0,Z.useRef)([]),z=(0,Z.useRef)(e.onHover);z.current=e.onHover;let E=(0,Z.useRef)(e.onClick);E.current=e.onClick;let _=(0,Z.useRef)(null),P=(0,Z.useRef)(null),R=(0,Z.useRef)(null),S=(0,Z.useCallback)((H,de="pointer")=>{if(R.current!==H){R.current=H;let Me=H===null?null:D.current[H]??null;queueMicrotask(()=>z.current?.(Me)),P.current?.(H)}_.current=H===null?null:de,M(H),N(_.current)},[]),v=(0,Z.useCallback)(H=>{_.current!=="keyboard"&&(_.current=H===null?null:"sync",M(H),N(_.current))},[]),A=(0,Z.useCallback)(H=>{let de=D.current[H];de&&E.current?.(de)},[]),O=Ao(e.replayKey),j=e.width!==void 0||(i??0)>0,le={enabled:u,active:d.visible&&j,near:d.near,replayKey:O,dataKey:x,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},re=(0,Z.useCallback)((H,de=1)=>T===null||T===H?de:de*.38,[T]);return{p:n,width:s,height:c,measured:j,responsive:e.width===void 0,pending:Pe&&a&&e.width===void 0&&i===null,node:r,hydrated:a,ref:o,motion:le,fv:g,fmt:y,pct:p,locale:h,lang:f,t:f==="ko"?oo:ro,active:T,via:b,setActive:S,click:A,events:D,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:re,sig:x,description:e.description,reduced:m,publish:P,applySync:v}}var q=C(U(),1);function Ol(e){return 1-Math.pow(1-e,3)}function Il(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function zl(e){return e==="easeInOut"?Il:e==="linear"?t=>t:Ol}function Bl(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 $t(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),a=Math.min(e.length-1,i+1);n[r]=e[i]+(e[a]-e[i])*(o-i)}return n}function Sn(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 Ti(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 Mi(e,t,n,r){if(!t||!n||t.length!==n.length)return $t(e,r);let o=[],i=0;for(let a=0;a<n.length;a++){let s=e.slice(i,i+t[a]);i+=t[a];for(let l of $t(s,n[a]))o.push(l)}return o.length===r?o:$t(e,r)}var An=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||!Sn(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,a=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:a.slice(),exit:(t.exit??a).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),a=this.make(o,o.from??o.to,1/0,o.delay??0);i&&(a.order=i.order),r=Math.max(r,o.delay??0),n.set(o.key,a)}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),Ti(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=Sn(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 a of t){o.add(a.key);let s=this.tracks.get(a.key),l=r>0?Math.min(i*r,240):0;if(s){let c=a.to.length;s.from=Mi(s.cur,s.parts,a.parts,c),s.vel=Mi(s.curVel,s.parts,a.parts,c),s.parts=a.parts,s.to=a.to.slice(),Ti(s.from,s.vel,s.to),s.cur=s.from.slice(),s.curVel=s.vel.slice(),s.appear=(a.from??a.to).slice(),s.enter=(a.enter??s.appear).slice(),s.exit=(a.exit??s.enter).slice(),s.data=a.data,s.exiting=!1,s.t0=n+(s.t0>n?Math.max(0,s.t0-n):l),s.done=Sn(s.from,s.to)&&s.vel.every(m=>Math.abs(m)<1e-6),s.progress=s.done?1:0}else{let c=this.make(a,a.enter??a.from??a.to,n+l,0);c.done=Sn(c.from,c.to),this.tracks.set(a.key,c)}i++}for(let a of this.tracks.values())o.has(a.key)||a.exiting||(a.from=a.cur.slice(),a.vel=a.curVel.slice(),a.to=$t(a.exit,a.cur.length),a.t0=n,a.exiting=!0,a.done=!1,a.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=zl(this.easing),o=this.duration/1e3,i=this.omega,a=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=$t(s.from,c)),s.vel.length!==c&&(s.vel=$t(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let m;if(this.easing==="spring"){let u=Math.exp(-i*l),d=i*l>=8&&i*l<20,h=0;for(let f=0;f<c;f++){let y=s.from[f]-s.to[f],p=s.vel[f]+i*y;s.cur[f]=s.to[f]+(y+p*l)*u,s.curVel[f]=(s.vel[f]-i*p*l)*u,d&&h<.15&&(h=Math.max(h,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/i)))}m=i*l>=20||d&&h<.15,s.progress=Math.min(1,1-(1+i*l)*u)}else{let u=Math.min(1,l/o),d=r(u),h=Bl(this.easing,u)/o;for(let f=0;f<c;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*d,s.curVel[f]=(s.to[f]-s.from[f])*h;m=u>=1,s.progress=d}if(m){for(let u=0;u<c;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&a.push(s.key)}else n=!0}for(let s of a)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}},Bt=new Set,Nn=0;function Ci(e){Nn=0;let t=Array.from(Bt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Bt.delete(n)}Bt.size&&typeof requestAnimationFrame<"u"&&(Nn=requestAnimationFrame(Ci))}function Si(e){return Bt.add(e),!Nn&&typeof requestAnimationFrame<"u"&&(Nn=requestAnimationFrame(Ci)),()=>{Bt.delete(e)}}function Hl(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 Ai(e,t){let n=(0,q.useMemo)(()=>Hl(e),[e]),{enabled:r,active:o,near:i=!0,replayKey:a,dataKey:s,easing:l="spring",duration:c=900,stagger:m=0}=t,u=(0,q.useRef)(null),d=(0,q.useRef)("init"),h=(0,q.useRef)(null),f=(0,q.useRef)(s),y=(0,q.useRef)(a),p=(0,q.useRef)(!1),g=(0,q.useRef)(0),[,x]=(0,q.useState)(0),T=(0,q.useRef)(null),M=(0,q.useRef)(!0);u.current||(u.current=new An,u.current.configure(l,c),u.current.snap(n),h.current=n);let b=u.current;if(b.configure(l,c),h.current!==n){let P=d.current,R=!Object.is(f.current,s);b.sameTargets(n)?b.refreshData(n):!r||P==="init"?b.snap(n):P==="idle"?b.hold(n):P==="running"||R?b.update(n,rn(),m):b.snap(n),h.current=n,f.current=s}let N=(0,q.useRef)(()=>!1);N.current=P=>{if(!M.current)return!1;let R=b.step(P);return!R&&d.current==="running"&&(d.current="done"),x(S=>(S+1)%1e9),R||(T.current=null),R};let D=(0,q.useCallback)(()=>{if(!Pe||T.current||!b.animating)return;let P=R=>N.current(R);T.current=Si(P)},[b]);Ie(()=>{let P=!Object.is(y.current,a);if(y.current=a,!r){(d.current!=="done"||b.animating)&&(b.snap(h.current??n),d.current="done",x(R=>R+1));return}d.current==="init"||P&&i?(b.hold(h.current??n),d.current="idle",p.current=!1,x(R=>R+1)):P&&(p.current=!0)},[r,a]),Ie(()=>{!r||!i||!p.current||(p.current=!1,b.hold(h.current??n),d.current="idle",x(P=>P+1))},[i,r]),(0,q.useEffect)(()=>{r&&o&&d.current==="idle"&&(b.start(rn()),g.current+=1,d.current="running",D(),x(P=>P+1))},[r,o,a,b,D]),(0,q.useEffect)(()=>{b.animating&&D()}),(0,q.useEffect)(()=>(M.current=!0,()=>{M.current=!1,T.current?.(),T.current=null}),[]);let z=rn(),E=b.elapsed(z),_=r&&d.current==="idle";return{items:b.items(),get:P=>b.get(P),elapsed:_?0:E,fade:(P,R=320)=>_?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-P)/R)):1,waiting:_,animating:b.animating,generation:g.current}}var wr=C(I(),1);function Fi(e,t,n,r,o){if(r)return o==="categorical"?Le(e,t,n):ho(e,t,n);if(o==="categorical")return Le(e,t,n);let i=J(e,"strong"),a=J(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?a:i)}var jl=C(U(),1);var vr=C(I(),1);var Ri=e=>e?"neutralStrong":"accent";var Ze=C(U(),1),Li=C(I(),1);function Pi(e){let t=(0,Ze.useRef)(null),n=(0,Ze.useRef)(new Map),[r,o]=(0,Ze.useState)(0),{width:i,height:a,draw:s,progress:l,version:c,clipRight:m,manualClear:u}=e;return(0,Ze.useEffect)(()=>{let d=t.current;if(!d)return;let h=Math.min(2,window.devicePixelRatio||1),f=Math.max(1,Math.round(i*h)),y=Math.max(1,Math.round(a*h));d.width!==f&&(d.width=f),d.height!==y&&(d.height=y);let p=d.getContext("2d");if(!p)return;p.setTransform(h,0,0,h,0,0),u||p.clearRect(0,0,i,a);let g=getComputedStyle(d),x=new Map;s(p,l,(M,b)=>{let N=x.get(M);return N===void 0&&(N=g.getPropertyValue(M).trim(),x.set(M,N)),N||b}),n.current=x},[i,a,s,l,c,u,r]),(0,Ze.useEffect)(()=>{let d=t.current;if(!d||typeof matchMedia!="function")return;let h=new AbortController,f=()=>o(x=>x+1),y=()=>{let x=getComputedStyle(d);for(let[T,M]of n.current)if(x.getPropertyValue(T).trim()!==M)return f()},p=()=>{matchMedia(`(resolution: ${devicePixelRatio}dppx)`).addEventListener?.("change",()=>{p(),f()},{once:!0,signal:h.signal})};p(),matchMedia("(prefers-color-scheme: dark)").addEventListener?.("change",y,{signal:h.signal});let g=new MutationObserver(y);for(let x=d.parentElement;x;x=x.parentElement)g.observe(x,{attributes:!0});return()=>{h.abort(),g.disconnect()}},[]),(0,Li.jsx)("canvas",{ref:t,"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"100%",height:"auto",aspectRatio:`${i} / ${a}`,pointerEvents:"none",clipPath:m?`inset(0 ${(m/Math.max(1,i)*100).toFixed(3)}% 0 0)`:void 0}})}var G=C(U(),1);var Bi=C(U(),1);var Tt=C(I(),1);function $r(e,t){return ne(t[0],10)+10+e*14+ne(t[1],10)}function Tr({p:e,right:t,steps:n,scale:r,labels:o,min:i}){let a=r.center,s=t-n*14-ne(o[1],10);return(0,Tt.jsxs)("g",{"aria-hidden":"true",children:[Array.from({length:n},(l,c)=>{let m=Pt(e,a===void 0?c/(n-1):2*c/(n-1)-1,i,r);return(0,Tt.jsx)("rect",{x:s-6+c*14,y:3,width:12,height:9,rx:2,fill:m.fill,opacity:m.opacity},c)}),(0,Tt.jsx)(ce,{x:s-10,y:7.5,anchor:"end",size:10,fill:e.paint("muted"),children:o[0]}),(0,Tt.jsx)(ce,{x:t,y:7.5,anchor:"end",size:10,fill:e.paint("muted"),children:o[1]})]})}var Fn=20,jt=24,at=4,Gl=16,Vl=4,Wl=200;function Kl(e){return typeof e=="number"&&Number.isFinite(e)?dt(e,Vl,Wl):Gl}var Ht=2e5;function _i(e,t){let n=Math.max(1,Math.ceil((t.x1-t.x0)/e)+3),r=Math.max(1,Math.ceil((t.y1-t.y0)/(1.5*e/Math.sqrt(3)))+3);return n*r}function Cr(e,t){let n=Kl(e);if(_i(n,t)>Ht)for(n=Math.max(n,Math.sqrt((t.x1-t.x0)*(t.y1-t.y0)*Math.sqrt(3)/1.5/Ht));_i(n,t)>Ht;)n*=1.02;return{w:n,r:n/Math.sqrt(3),x0:t.x0,y0:t.y0}}function Xl(e,t,n){return[e.x0+(t+(n&1)/2)*e.w,e.y0+n*1.5*e.r]}function Di(e,t,n){return Ei(e,t,n,Mr),[Mr[0],Mr[1]]}var Mr=new Int32Array(2);function Ei(e,t,n,r){let o=1.5*e.r,i=(n-e.y0)/o,a=(t-e.x0)/e.w,s=Math.round(i),l=i<s?s-1:s+1,c=Math.round(a-(s&1)/2),m=Math.round(a-(l&1)/2),u=e.x0+(c+(s&1)/2)*e.w-t,d=e.y0+s*o-n,h=e.x0+(m+(l&1)/2)*e.w-t,f=e.y0+l*o-n,y=u*u+d*d<=h*h+f*f;r[0]=y?c:m,r[1]=y?s:l}function Sr(e,t,n,r){let o=Math.max(1,Math.ceil((r.x1-e.x0)/e.w)+3),i=Math.min(Math.max(1,Math.ceil((r.y1-e.y0)/(1.5*e.r))+3),Math.max(1,Math.floor(Ht/o))),a=new Int32Array(Math.min(o*i,Ht)),s=new Int32Array(2);for(let c=0;c<t.length;c++){let m=t[c],u=n[c];if(!(m>=r.x0&&m<=r.x1&&u>=r.y0&&u<=r.y1))continue;Ei(e,m,u,s);let d=s[0]+1,h=s[1]+1;d>=0&&d<o&&h>=0&&h<i&&a[h*o+d]++}let l=[];for(let c=0;c<a.length;c++){let m=a[c];if(!m)continue;let u=c%o-1,d=Math.floor(c/o)-1,[h,f]=Xl(e,u,d);l.push({col:u,row:d,cx:h,cy:f,count:m})}return l}function Ar(e){return e>14?1.5:e>6?1:0}function Nr(e,t,n=0){let r=Math.max(.1,e.r-n/Math.sqrt(3)),o=ft(r*Math.sqrt(3)/2),i=ft(r/2),a=ft(r),s=`l${o},${i}v${a}l-${o},${i}l-${o}-${i}v-${a}z`,l="";for(let c of t)l+=`M${ft(c.cx)},${ft(c.cy-r)}${s}`;return l}function Oi(e,t,n){let r=e[t];if(!r)return-1;let o=r.row&1?-1:1,i=-1,a=1/0,s=-1/0;for(let l=0;l<e.length;l++){let c=e[l].cx-r.cx,m=e[l].cy-r.cy,u=c*n[0]+m*n[1],d=Math.abs(c*n[1]-m*n[0]);if(u<=0||d>u+1e-6)continue;let h=Math.round((c*c+m*m)*1e4),f=Math.sign(c)*o;(h<a||h===a&&f>s)&&(a=h,s=f,i=l)}return i}var ue=C(I(),1),Ul={points:(e,t)=>`${t} ${e===1?"point":"points"}`,range:(e,t)=>`${e} to ${t}`,desc:(e,t)=>` Binned into ${e} ${e===1?"hexagon":"hexagons"}. Densest: ${t}.`},Yl={en:Ul,ko:{points:(e,t)=>`점 ${t}개`,range:(e,t)=>`${e}~${t}`,desc:(e,t)=>` 육각 칸 ${e}개로 묶었어요. 가장 촘촘한 칸: ${t}.`}},Rn=.14;function Hi(e,t,n,r,o){let i=new Float64Array(e),a=new Float64Array(e),[s,l]=r.domain,[c,m]=o.domain;for(let u=0;u<e;u++){let d=t(u),h=n(u),f=d>=s&&d<=l&&h>=c&&h<=m;i[u]=f?r(d):NaN,a[u]=f?o(h):NaN}return[i,a]}function ji(e,t=1/0,n=-1/0){for(let r of e)t=Math.min(t,r.count),n=Math.max(n,r.count);return[t,n]}function ql(e,t,n,r,o,i){let a=Cr(r,n),s=Sr(a,e,t,n),[l,c]=ji(s);i&&Number.isFinite(i[0])&&Number.isFinite(i[1])&&i[1]>=i[0]&&([l,c]=i);let m=ln(void 0,void 0,o??5),u=p=>c>l?dt((p-l)/(c-l),0,1):1,d=new Map,h=s.map(p=>{let g={...p,t:u(p.count)},x=Qn(g.t,m),T=d.get(x);return T?T.push(g):d.set(x,[g]),g});h.sort((p,g)=>g.count-p.count||p.row-g.row||p.col-g.col);let f=Ar(a.w),y=[...d.entries()].sort((p,g)=>p[0]-g[0]).map(([,p])=>({t:p[0].t,d:Nr(a,p,f)}));return{grid:a,cells:h,lo:Number.isFinite(l)?l:0,hi:Number.isFinite(c)?c:0,at:new Map(h.map((p,g)=>[`${p.col},${p.row}`,g])),scale:m,groups:y}}function Ii(e,t,n){let r=Math.min(e.range[0],e.range[1]),o=Math.max(e.range[0],e.range[1]),i=e.invert(dt(t,r,o)),a=e.invert(dt(n,r,o));return i<=a?[i,a]:[a,i]}function zi(e,[t,n],r,o,i=""){let a=n-t,s=a>0?Math.max(0,Math.min(6,1-Math.floor(Math.log10(a)))):2,l=o??(c=>ye(c,{locale:r,maximumFractionDigits:s}));return e.range(l(t),`${l(n)}${i}`)}function Jl(e,t,n,r){let o=r-n-12-t;return ne(e,10.5)<=o?e:o>24?ht(e,o,10.5):""}function Zl(e,t){let{raw:n,c:r}=t,[o,i]=Hi(n.length,p=>n[p].x,p=>n[p].y,t.x,t.y),a=ql(o,i,t.box,e.binSize,e.colorSteps,e.binDomain),s=Yl[r.lang],{locale:l}=r,c=e.xFormat!==void 0?t.xFmt:null,m=e.format!==void 0?r.fmt:null,u=p=>{let g=a.cells[p],{w:x,r:T}=a.grid;return{count:s.points(g.count,ye(g.count,{locale:l,maximumFractionDigits:0})),x:zi(s,Ii(t.x,g.cx-x/2,g.cx+x/2),l,c),y:zi(s,Ii(t.y,g.cy-T,g.cy+T),l,m,e.unit)}},d=p=>{if(p===null||!a.cells[p])return"";let g=u(p);return`${g.count}, ${e.xLabel??"x"} ${g.x}, ${e.yLabel??"y"} ${g.y}`},h=kt(a.cells.length,p=>{let g=u(p),x=a.cells[p];return{datum:null,index:p,key:`${x.col},${x.row}`,label:`x ${g.x}, y ${g.y}`,value:x.count,formatted:g.count}}),f=[ye(a.lo,{locale:l}),ye(a.hi,{locale:l})],y=e.binLegend!==!1&&a.cells.length&&a.hi>a.lo?{right:r.width,labels:f}:null;return{m:a,events:h,say:d,desc:a.cells.length?s.desc(a.cells.length,d(0)):"",legend:y,yTitle:e.yLabel&&y?Jl(e.yLabel,t.left,$r(a.scale.steps,f),r.width):e.yLabel,tip:p=>{if(p===null||!a.cells[p])return null;let g=u(p);return{x:a.cells[p].cx,y:a.cells[p].cy-a.grid.r,title:g.count,rows:[{label:e.xLabel??"x",value:g.x},{label:e.yLabel??"y",value:g.y}]}},at:(p,g)=>{let{box:x}=t;if(!(p>=x.x0&&p<=x.x1&&g>=x.y0&&g<=x.y1))return null;let[T,M]=Di(a.grid,p,g);return a.at.get(`${T},${M}`)??null},step:(p,g)=>!p||!a.cells.length?null:g===null||!a.cells[g]?0:Oi(a.cells,g,p)}}function Ql(e){let{p:t,box:n,active:r}=e,{m:o,legend:i}=e.v,a=`${(0,Bi.useId)().replace(/:/g,"")}hx`,s=tn(e.c,e.m),{scale:l}=o,c=r!==null?o.cells[r]:void 0,m=c?Pt(t,c.t,Rn,l):null;return(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)("defs",{children:(0,ue.jsx)("clipPath",{id:a,children:(0,ue.jsx)("rect",{x:n.x0,y:n.y0,width:Math.max(0,n.x1-n.x0),height:Math.max(0,n.y1-n.y0)})})}),(0,ue.jsxs)("g",{clipPath:`url(#${a})`,onClick:()=>r!==null&&e.onPick(r),children:[o.groups.map((u,d)=>{let h=Pt(t,u.t,Rn,l);return(0,ue.jsx)("path",{className:"ztd-mark",d:u.d,fill:h.fill,opacity:h.opacity*(c?.55:1),style:en(s,e.m.waiting,"fade",d*70,360)},d)}),c&&m?(0,ue.jsx)("path",{d:Nr(o.grid,[c],Ar(o.grid.w)),fill:m.fill,fillOpacity:m.opacity,stroke:t.paint("ink"),strokeWidth:2,strokeLinejoin:"round",pointerEvents:"none"}):null]},e.m.generation),i?(0,ue.jsx)(Tr,{p:t,right:i.right,steps:l.steps,scale:l,labels:i.labels,min:Rn}):null]})}function ec({steps:e,labels:t}){let n=xe(),r=Math.ceil($r(e,t))+8;return(0,ue.jsx)("svg",{className:"ztd-facet-legend",width:r,height:16,viewBox:`0 0 ${r} 16`,overflow:"visible",children:(0,ue.jsx)(Tr,{p:n,right:r,steps:e,scale:ln(void 0,void 0,e),labels:t,min:Rn})})}function Gi(e,t,n){let r=e.panels[0]?.props,o=r?.xDomain,i=r?.yDomain;if(t.bin!=="hex"||!o||!i)return e;let a=t.yScale==="log",{pw:s,ph:l}=e,c=t.yLabel?Fn:10,m=(a?xt:Ge)(i,[l-jt-at,c+at]),u=yt(m.ticks(Math.max(2,Math.round(l/70))),rt(t.format,n,Math.max(Math.abs(i[0]),Math.abs(i[1]))),n),d=ve(t.x,"x"),h=ve(t.y,"y"),f=1/0,y=-1/0;for(let T of e.panels){let M=T.props.data,b=T.props.showYAxis===!1?0:u,N=Ge(o,[b+6+at,s-8-at]),[D,z]=Hi(M.length,_=>d(M[_],_),_=>h(M[_],_),N,m),E={x0:b,x1:s,y0:c,y1:l-jt};[f,y]=ji(Sr(Cr(t.binSize,E),D,z,E),f,y)}let p=e.panels.map(T=>({...T,props:{...T.props,binLegend:!1,...y>=f&&{binDomain:[f,y]}}})),g=ln(void 0,void 0,t.colorSteps??5).steps??5,x=y>f?(0,ue.jsx)(ec,{steps:g,labels:[ye(f,{locale:n}),ye(y,{locale:n})]}):void 0;return{...e,panels:p,legend:x}}var Vi={view:Zl,Layer:Ql};var me=C(I(),1),tc={seriesCounts:e=>` ${Ae(e.length,"series","series")}: ${e.map(([t,n])=>`${t} ${Ae(n,"point")}`).join(", ")}.`,trend:(e,t,n,r)=>e>0?` ${n} rises as ${t} rises, R² ${r}.`:e<0?` ${n} falls as ${t} rises, R² ${r}.`:` No clear straight-line relationship between ${t} and ${n}, R² ${r}.`,refs:e=>` Reference ${e.length>1?"lines":"line"} at ${e.join(" and ")}.`,quadrants:e=>` Quadrants: ${e.map(([t,n])=>`${t} ${n}`).join("; ")}.`,slope:"Trend slope",trendTag:"Trend",outOfRange:"No points in this range."},nc={en:tc,ko:{seriesCounts:e=>` 계열 ${e.length}개: ${e.map(([t,n])=>`${t} ${n}개`).join(", ")}.`,trend:(e,t,n,r)=>e>0?` ${t} 값이 클수록 ${n} 값도 커요(R² ${r}).`:e<0?` ${t} 값이 클수록 ${n} 값은 작아요(R² ${r}).`:` ${t} 값과 ${n} 값 사이에 뚜렷한 직선 관계가 없어요(R² ${r}).`,refs:e=>` 기준선 ${e.join(", ")}.`,quadrants:e=>` 사분면: ${e.map(([t,n])=>`${t} ${n}개`).join(", ")}.`,slope:"추세 기울기",trendTag:"추세",outOfRange:"이 범위에는 점이 없어요."}};function rc(e){switch(e){case"ArrowRight":return[1,0];case"ArrowLeft":return[-1,0];case"ArrowDown":return[0,1];case"ArrowUp":return[0,-1];default:return null}}function oc(e,t,n){let r=e[t],o=n[0]+n[1]>0,i=null,a=1/0;for(let s=0;s<e.length;s++){if(s===t)continue;let l=e[s].x-r.x,c=e[s].y-r.y;if(!(l*n[0]+c*n[1]>0||l===0&&c===0&&(o?s>t:s<t)))continue;let u=l*l+c*c;(u<a||u===a&&i!==null&&Math.abs(s-t)<Math.abs(i-t))&&(a=u,i=s)}return i}function ic(e,t){let n=e.some(o=>o.hi),r=Xo(e.map(o=>n&&!o.hi?1/0:o.x*t[0]+o.y*t[1]));return r<0?null:r}function ac(e,t){let n=Math.imul((e|0)^2654435769,2246822507)^Math.imul(t+1,3266489909);return n=Math.imul(n^n>>>16,2146121005),n=Math.imul(n^n>>>15,2221713035),((n^n>>>16)>>>0)/4294967296}function sc(e){let t=[...new Set(e)].sort((r,o)=>r-o),n=1/0;for(let r=1;r<t.length;r++)n=Math.min(n,t[r]-t[r-1]);return Number.isFinite(n)?n:1}function Fr(e,t,n,r){if(typeof e!="function")return Oe(e,n,n,n.map(()=>0),"first");let o=new Map(n.map((a,s)=>[a,s])),i=new Set;return t.forEach((a,s)=>{let l=o.get(r(a,s));l!==void 0&&e(a,s)&&i.add(l)}),i}function lc(e,t,n,[r,o]){let i=t,a=n;if(e.slope){let s=t+(r-e.at(t))/e.slope,l=t+(o-e.at(t))/e.slope;i=Math.max(i,Math.min(s,l)),a=Math.min(a,Math.max(s,l))}else if(e.at(t)<r||e.at(t)>o)return null;return a>i?[i,e.at(i),a,e.at(a)]:null}function cc(e,t,n,r){let o=a=>Math.max(r.y0+9,Math.min(r.y1-9,a)),i=[{x:e.x2+2,y:o(e.y2-11),anchor:"end"},{x:e.x2+2,y:o(e.y2+11),anchor:"end"},{x:e.x1-2,y:o(e.y1-11),anchor:"start"},{x:e.x1-2,y:o(e.y1+11),anchor:"start"}];return i.find(a=>!n.some(s=>gt(s,Dt(t,a.x,a.y,a.anchor),2)))??i[0]}function uc(e,t,n,r){let o=[{x:r.x0+4,y:r.y0+10,w:t-r.x0,h:n-r.y0,anchor:"start"},{x:r.x1-4,y:r.y0+10,w:r.x1-t,h:n-r.y0,anchor:"end"},{x:r.x0+4,y:n+10,w:t-r.x0,h:r.y1-n,anchor:"start"},{x:r.x1-4,y:n+10,w:r.x1-t,h:r.y1-n,anchor:"end"}],i=[];return o.forEach((a,s)=>{let l=e[s];if(!l||a.h<22||a.w<40)return;let c=ht(l,a.w-16,10.5,500);i.push({text:c,x:a.x,y:a.y,anchor:a.anchor,box:Dt(c,a.x,a.y,a.anchor)})}),i}var Wi=11,Ki=e=>e?700:600;function mc(e,t,n,r){let o=t.map(()=>({x:0,y:0,n:0}));for(let m of e){let u=o[m.si];u&&(u.x+=m.x,u.y+=m.y,u.n++)}if(o.filter(m=>m.n).length>4)return[];let{box:i,reserved:a,grid:s}=r,l=m=>{if(m.x<i.x0+2||m.x+m.w>i.x1-2||m.y<i.y0||m.y+m.h>i.y1-2||a.some(u=>gt(u,m,2)))return!1;for(let u=Math.floor(m.x/s.cell);u<=Math.floor((m.x+m.w)/s.cell);u++)for(let d=Math.floor(m.y/s.cell);d<=Math.floor((m.y+m.h)/s.cell);d++)for(let h of s.g.get(`${u},${d}`)??[]){let f=e[h],y=Math.max(m.x,Math.min(f.x,m.x+m.w)),p=Math.max(m.y,Math.min(f.y,m.y+m.h));if(Math.hypot(f.x-y,f.y-p)<f.r+1.5)return!1}return!0},c=[];return o.forEach((m,u)=>{if(!m.n)return;let d=ne(t[u],Wi,Ki(n.has(u))),h=14,f=m.x/m.n,y=m.y/m.n,p=e.filter(g=>g.si===u).sort((g,x)=>Math.hypot(g.x-f,g.y-y)-Math.hypot(x.x-f,x.y-y));for(let g of p.slice(0,40)){let x=g.r+4,M=[{x:g.x+x,y:g.y-h/2,w:d,h},{x:g.x-x-d,y:g.y-h/2,w:d,h},{x:g.x-d/2,y:g.y-x-h,w:d,h},{x:g.x-d/2,y:g.y+x,w:d,h}].find(b=>l(b)&&!c.some(N=>gt(N.box,b,2)));if(M){c.push({si:u,y:M.y+h/2,box:M});return}}}),c}function dc(e,t){let n="";if(t.seriesNames.length){let i=t.seriesNames.map(s=>[s,0]);for(let s of t.points)i[s.si]&&i[s.si][1]++;let a=i.filter(([,s])=>s>0);a.length&&(n+=e.seriesCounts(a))}t.fit&&(n+=e.trend(t.fit.r2<.1?0:Math.sign(t.fit.slope),t.xName,t.yName,t.fit.r2.toFixed(2))),t.refs.length&&(n+=e.refs(t.refs));let{refX:r,refY:o}=t;if(t.quadrants.length&&r!==void 0&&o!==void 0){let i=[0,0,0,0];for(let s of t.points)i[(s.y>=o?0:2)+(s.x>=r?1:0)]++;let a=t.quadrants.slice(0,4).map((s,l)=>[s,i[l]]).filter(([s])=>s);a.length&&(n+=e.quadrants(a))}return n}function fc(e,t,n){let r=t.map(()=>[]);return e.forEach((o,i)=>r[o.si]?.push(i)),[...r.keys()].sort((o,i)=>Number(n.has(o))-Number(n.has(i))).map(o=>({ks:r[o],isHi:n.has(o),fill:i=>uo(t[o],i)}))}function hc({p:e,x:t,y:n,box:r}){return(0,me.jsxs)("g",{"aria-hidden":"true",pointerEvents:"none",children:[t!==null?(0,me.jsx)("line",{x1:t,x2:t,y1:r.y0,y2:r.y1,stroke:e.paint("dim"),strokeDasharray:"3 3"}):null,n!==null?(0,me.jsx)("line",{x1:r.x0,x2:r.x1,y1:n,y2:n,stroke:e.paint("dim"),strokeDasharray:"3 3"}):null]})}function gc(e){let{p:t,fade:n,fitLine:r,fitTag:o,quads:i,colors:a,hiSeries:s}=e;return(0,me.jsxs)(me.Fragment,{children:[r&&o?(0,me.jsxs)("g",{"aria-hidden":"true",pointerEvents:"none",opacity:n,children:[(0,me.jsx)("line",{...r,stroke:t.paint("muted"),strokeWidth:1.5,strokeDasharray:"6 4",strokeLinecap:"round"}),(0,me.jsx)(gr,{p:t,x:o.x,y:o.y,text:e.trendTag,anchor:o.anchor})]}):null,i.length?(0,me.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:i.map(l=>(0,me.jsx)(gr,{p:t,x:l.x,y:l.y,text:l.text,anchor:l.anchor},`${l.anchor}${l.y}`))}):null,a&&s?e.seriesLabels.map(l=>{let c=s.has(l.si);return(0,me.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",opacity:n,children:(0,me.jsx)(ce,{x:l.box.x,y:l.y,size:Wi,weight:Ki(c),fill:t.paint(c?"ink":"muted"),children:e.seriesNames[l.si]})},`s${l.si}`)}):null]})}function pc(e,[t,n],[r,o]){return e.length>0&&!e.some(i=>i.x>=t&&i.x<=n&&i.y>=r&&i.y<=o)}var Xi={text:nc,arrowStep:rc,nearestInDirection:oc,entryPoint:ic,seededUnit:ac,smallestGap:sc,uniq:$e,seriesHighlight:Fr,colors:tt,canvasGroups:fc,linearFit:Uo,fitSegment:lc,fitTagSpot:cc,quadrantTags:uc,tagBox:Dt,placeSeriesLabels:mc,describe:dc,RefLines:hc,Overlay:gc,hex:Vi,noneInside:pc};var ae=C(I(),1),bc={bubble:"Bubble chart",scatter:"Scatter plot",size:"Size",sizeWord:"size",nth:e=>`#${e}`,desc:(e,t,n)=>`${e?"Bubble chart":"Scatter plot"}. ${Ae(t,"point")}. x from ${n[0]} to ${n[1]}, y from ${n[2]} to ${n[3]}.`,logDropped:e=>` ${Ae(e,"point")} with y at or below 0 ${e===1?"is":"are"} not shown on the log scale.`},yc={en:bc,ko:{bubble:"버블 차트",scatter:"산점도",size:"크기",sizeWord:"크기",nth:e=>`${e}번`,desc:(e,t,n)=>`${e?"버블 차트":"산점도"}. 점 ${t}개. x ${n[0]}~${n[1]}, y ${n[2]}~${n[3]}.`,logDropped:e=>` 로그 눈금이라 y가 0 이하인 점 ${e}개는 뺐어요.`}},xc=[],kc=[],wc=[],vc=[],Ui=[],Yi=e=>({x:e.x1-2,y:e.y1-8});function qi(e,t){return Number(e.hi)-Number(t.hi)||t.r-e.r}var Rr=Object.assign(function(t){return(0,ae.jsx)($c,{...t,kit:Xi})},{facetPlan:Gi}),Ji=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Zi=e=>Array.isArray(e)&&e.length===2&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&e[0]<e[1]?e:void 0;function $c(e){let t=$i(e,{height:w=>Math.max(220,Math.min(320,w*.6)),duration:800,stagger:0}),{p:n,width:r,height:o}=t,i=e.kit,a=i&&e.bin==="hex"?i.hex:null,s=i?a?{fit:e.fit,refLines:e.refLines,quadrants:e.quadrants}:e:{},l=!i&&e.size!==void 0,c=e.yScale==="log",m=(0,G.useMemo)(()=>{if(s.series===void 0)return null;let w=Fe(s.series,"series");return e.data.map(($,B)=>w($,B))},[e.data,s.series]),u=(0,G.useMemo)(()=>i&&m?i.uniq(m):Ui,[i,m]),d=s.hidden?.join("")??"",h=s.quadrants?.join("")??"",f=s.jitter?Math.max(0,s.jitter.amount??.4):0,y=s.jitter?.seed??1,p=Ji(s.refLines?.x),g=Ji(s.refLines?.y),x=c&&g!==void 0&&g<=0?void 0:g,T=s.fit==="linear"&&!c,M=m!==null||T||p!==void 0||x!==void 0||f>0,b=(0,G.useMemo)(()=>{let w=ve(e.x,"x"),$=ve(e.y,"y"),B=l?ve(e.size,"size"):null,K=Fe(e.label,"label"),L=e.data.map((X,fe)=>{let lt=w(X,fe);return{d:X,i:fe,x:lt,y:$(X,fe),s:B?Math.max(0,B(X,fe)||0):1,label:K(X,fe),si:-1,px:lt}}).filter(X=>Number.isFinite(X.x)&&Number.isFinite(X.y)&&(!c||X.y>0));if(!i||f<=0&&!m)return L;let te=f>0?i.smallestGap(L.map(X=>X.x)):0,oe=new Map(u.map((X,fe)=>[X,fe])),ee=new Set(d?d.split(""):[]),Se=[];for(let X of L){if(te&&(X.px=X.x+(i.seededUnit(y,X.i)*2-1)*f*te),m){let fe=m[X.i];if(ee.has(fe))continue;X.si=oe.get(fe)??-1}Se.push(X)}return Se},[e.data,e.x,e.y,e.size,e.label,l,i,m,u,d,f,y,c]),N=(0,G.useMemo)(()=>{if(!c)return 0;let w=ve(e.x,"x"),$=ve(e.y,"y");return e.data.filter((B,K)=>Number.isFinite(w(B,K))&&$(B,K)<=0).length},[c,e.data,e.x,e.y]),D=b.length,z=!a&&t.hydrated&&D>(e.canvasThreshold??1500),E=(0,G.useMemo)(()=>({x:De(b.map(w=>w.x)),y:De(b.map(w=>w.y)),s:De(b.map(w=>w.s))}),[b]),_=(0,G.useMemo)(()=>!f&&p===void 0&&x===void 0?E:{...E,x:De(p===void 0?b.map(w=>w.px):[...b.map(w=>w.px),p]),y:x===void 0?E.y:De([E.y[0],E.y[1],x])},[E,b,f,p,x]),[P,R]=E.x,[S,v]=E.y,A=Math.max(2,Math.round(o/70)),O=Zi(e.xDomain),j=Zi(e.yDomain),le=j&&(!c||j[0]>0)?j:void 0,re=le??(c?Et(_.y[0],_.y[1],A):je(_.y[0],_.y[1],A,{zero:e.zero??!1,pad:.08})),H=O??je(_.x[0],_.x[1],Math.max(2,Math.round(r/110)),{zero:e.zero??!1,pad:.06}),de=Math.max(Math.abs(re[0]),Math.abs(re[1])),Me=Math.max(Math.abs(H[0]),Math.abs(H[1])),Ce=(0,G.useMemo)(()=>rt(e.format,t.locale,de),[e.format,t.locale,de]),ge=(0,G.useMemo)(()=>rt(e.xFormat,t.locale,Me),[e.xFormat,t.locale,Me]),Pn=a&&e.binLegend!==!1?Fn:e.yLabel?20:10,st=jt,[Ln,Vt]=e.sizeRange??(l?[4,Math.max(10,Math.min(28,r/22))]:[D>2e3?1.6:D>300?2.6:4,0]),Wt=l?Vt*.6:at,Qe=(c?xt:Ge)(re,[o-st-Wt,Pn+Wt]),Dr=Qe.ticks(A),_n=e.showYAxis!==!1,Be=_n?yt(Dr,Ce,t.locale):0,et=Ge(H,[Be+6+Wt,r-8-Wt]),[ya,xa]=E.s,ka=l?ti([Math.min(0,ya),xa||1],[Ln,Vt]):()=>Ln,se=(0,G.useMemo)(()=>({x0:Be,x1:r,y0:Pn,y1:o-st}),[Be,r,Pn,o,st]),pe=(0,G.useMemo)(()=>i&&m?i.seriesHighlight(e.highlight,e.data,u,(w,$)=>m[$]):null,[i,m,e.highlight,e.data,u]),We=(0,G.useMemo)(()=>i&&pe?i.colors(n,u.length,pe):null,[i,n,u.length,pe]),Er=(0,G.useMemo)(()=>{if(a)return new Set;if(pe){let w=new Set;return b.forEach(($,B)=>{pe.has($.si)&&w.add(B)}),w}return Oe(e.highlight,b.map(w=>w.d),b.map(w=>w.label),b.map(w=>l?w.s:w.y),l?"max":"none")},[b,e.highlight,l,pe,a]),V=(0,G.useMemo)(()=>a?xc:b.map((w,$)=>({i:$,x:et(w.px),y:Qe(w.y),r:ka(w.s),vx:w.x,vy:w.y,vs:w.s,label:w.label,hi:Er.has($),datum:w.d,si:w.si})),[b,Er,r,o,H[0],H[1],re[0],re[1],Ln,Vt,a]),Q=(0,G.useMemo)(()=>a&&a.view(e,{raw:b,x:et,y:Qe,box:se,left:Be,c:t,xFmt:ge}),[a,b,se,Be,H[0],H[1],re[0],re[1],t.lang,t.locale,ge,t.fmt,e.binSize,e.colorSteps,e.binDomain?.[0],e.binDomain?.[1],e.binLegend,e.xFormat,e.format,e.unit,e.xLabel,e.yLabel]),Or=(0,G.useMemo)(()=>[...V].sort(qi),[V]),Kt=t.motion.duration??800,wa=(0,G.useMemo)(()=>{if(z)return[{key:"__p",to:[1],from:[0],data:null}];let w=r||1;return Or.map($=>({key:`b${$.i}:${$.label}`,to:[$.x,$.y,$.r],from:[$.x,$.y,0],enter:[$.x,$.y,0],delay:$.x/w*Kt*.55,data:$}))},[Or,z,r,Kt]),Mt=Ai(wa,t.motion),Dn=(0,G.useMemo)(()=>{let $=new Map;return V.forEach((B,K)=>{let L=`${Math.floor(B.x/24)},${Math.floor(B.y/24)}`,te=$.get(L);te?te.push(K):$.set(L,[K])}),{g:$,cell:24}},[V]),va=(w,$)=>{let{g:B,cell:K}=Dn,L=Math.floor(w/K),te=Math.floor($/K),oe=-1,ee=1/0,Se=-1,X=l?Math.ceil(Vt/K)+1:1;for(let fe=-X;fe<=X;fe++)for(let lt=-X;lt<=X;lt++){let Xr=B.get(`${L+fe},${te+lt}`);if(Xr)for(let Hn of Xr){let Qt=V[Hn],jn=Math.hypot(Qt.x-w,Qt.y-$)-Qt.r;jn<=0&&(Se<0||qi(Qt,V[Se])>0)&&(Se=Hn),jn<ee&&(ee=jn,oe=Hn)}}return Se>=0?Se:ee<=10?oe:null},He=yc[t.lang],be=i?.text[t.lang],Ke=(0,G.useMemo)(()=>i&&M&&b.length>=2?i.linearFit(b):null,[i,M,b]),Ct=i&&Ke&&T?i.fitSegment(Ke,P,R,re):null,Xt=Ct?{x1:et(Ct[0]),y1:Qe(Ct[1]),x2:et(Ct[2]),y2:Qe(Ct[3])}:null,St=(0,G.useMemo)(()=>h?h.split("").map(w=>w.trim()):Ui,[h]),At=p===void 0?null:et(p),Nt=x===void 0?null:Qe(x),Ut=(0,G.useMemo)(()=>i&&St.length&&At!==null&&Nt!==null?i.quadrantTags(St,At,Nt,se):vc,[i,St,At,Nt,se]),Yt=i&&be&&Xt?i.fitTagSpot(Xt,be.trendTag,Ut.map(w=>w.box),se):null,En=Yt?.x,On=Yt?.y,In=Yt?.anchor,zn=be?.trendTag,qt=(0,G.useMemo)(()=>{if(!i||!M)return kc;let w=Ut.map($=>$.box);if(e.xLabel){let $=Yi(se);w.push(hr(e.xLabel,$.x,$.y,10.5,"end"))}return zn&&En!==void 0&&On!==void 0&&In&&w.push(i.tagBox(zn,En,On,In)),w},[i,M,Ut,e.xLabel,se,En,On,In,zn]),Bn=(0,G.useMemo)(()=>i&&t.showLabels&&pe?i.placeSeriesLabels(V,u,pe,{box:se,reserved:qt,grid:Dn}):wc,[i,t.showLabels,pe,V,u,Dn,qt,se]),$a=(0,G.useMemo)(()=>{let w=e.maxLabels??(m?0:6);if(!t.showLabels||D>400||w<=0)return[];let $=[...V].sort((L,te)=>Number(te.hi)-Number(L.hi)||te.r-L.r).filter(L=>L.label),B=[...V.map(L=>({x:L.x-L.r*.7,y:L.y-L.r*.7,w:L.r*1.4,h:L.r*1.4})),...qt,...Bn.map(L=>L.box)],K=[];for(let L of $){if(K.length>=w)break;let te=[{x:L.x+L.r+5,y:L.y,anchor:"start"},{x:L.x-L.r-5,y:L.y,anchor:"end"},{x:L.x,y:L.y-L.r-9,anchor:"middle"},{x:L.x,y:L.y+L.r+10,anchor:"middle"}];for(let oe of te){let ee=hr(L.label,oe.x,oe.y,11,oe.anchor,L.hi?800:500);if(!(ee.x<Be||ee.x+ee.w>r-2||ee.y<0||ee.y+ee.h>o-st)&&!B.some(Se=>gt(Se,ee,1))){B.push(ee),K.push({d:L,...oe});break}}}return K},[V,t.showLabels,D,e.maxLabels,m,qt,Bn,Be,r,o,st]),Ir=J(n,"accent"),zr=t.fmt,Jt=t.fv,Ta=(0,G.useMemo)(()=>Q?Q.events:kt(V.length,w=>{let $=V[w],B={datum:$.datum,index:$.i,key:`${$.i}`,label:$.label||He.nth($.i+1),value:l?$.vs:$.vy,formatted:`x ${ge($.vx)}, y ${Jt($.vy)}${l?`, ${He.sizeWord} ${zr($.vs)}`:""}`};return $.si>=0&&(B.series=u[$.si]),B}),[V,l,ge,Jt,zr,He,u,Q]),Br=Q?Q.tip(t.active):null;if(t.active!==null&&V[t.active]){let w=V[t.active],$=[{label:e.xLabel??"x",value:ge(w.vx)},{label:e.yLabel??"y",value:t.fv(w.vy)},...l?[{label:He.size,value:t.fmt(w.vs),color:w.hi?Ir.fill:n.paint("neutral")}]:[]];We&&w.si>=0&&$.unshift({label:u[w.si],value:"",color:We[w.si].fill,strong:!0}),be&&Ke&&Xt&&$.push({label:be.slope,value:`${Ke.slope>0?"+":""}${t.fv(Ke.slope)}`,strong:!1},{label:"R²",value:Ke.r2.toFixed(2),strong:!1}),Br={x:w.x,y:w.y-w.r,title:w.label||He.nth(w.i+1),rows:$}}let Ma=z?Mt.get("__p")?.[0]??1:1,Hr=n.theme.neutralStrong,jr=n.theme.accent,Gr=(0,G.useMemo)(()=>{if(i&&We&&pe)return i.canvasGroups(V,We,pe);let w=[],$=[];return V.forEach((B,K)=>(B.hi?$:w).push(K)),[{ks:w,isHi:!1,fill:B=>B("--ztd-neutral-strong",Hr)},{ks:$,isHi:!0,fill:B=>B("--ztd-accent",jr)}]},[i,V,We,pe,Hr,jr]),Ca=(0,G.useCallback)((w,$,B)=>{let K=r||1;for(let L of Gr){w.globalAlpha=L.isHi?1:.55,w.fillStyle=L.fill(B);for(let te of L.ks){let oe=V[te],ee=L.isHi?Math.min(1,$*1.2):Math.max(0,Math.min(1,($*1.4-oe.x/K*.4)*2.5));ee<=0||(w.beginPath(),w.arc(oe.x,oe.y,oe.r*ee,0,Math.PI*2),w.fill())}}w.globalAlpha=1},[Gr,V,r]),Sa=Q?w=>{let $=Q.step(i?i.arrowStep(w.key):null,t.active);return $!==null&&$>=0&&t.setActive($,"keyboard"),$!==null}:i?w=>{let $=i.arrowStep(w.key);if(!$||!V.length)return!1;let B=t.active!==null&&V[t.active]?t.active:null,K=B===null?i.entryPoint(V,$):i.nearestInDirection(V,B,$);return K!==null&&t.setActive(K,"keyboard"),!0}:void 0,Aa=et.ticks(Math.max(2,Math.round(r/110))),Vr=Yi(se),Na=He.desc(l,D,[ge(P),ge(R),Ce(S),Ce(v)]),Fa=(0,G.useMemo)(()=>{if(!i||!be||!M)return"";let w=[...p===void 0?[]:[`x ${ge(p)}`],...x===void 0?[]:[`y ${Jt(x)}`]];return i.describe(be,{points:b,seriesNames:u,fit:Ke,xName:e.xLabel??"x",yName:e.yLabel??"y",refs:w,refX:p,refY:x,quadrants:St})},[i,be,M,p,x,ge,Jt,b,u,Ke,e.xLabel,e.yLabel,St]),Zt=(0,G.useMemo)(()=>i&&be&&(O||le)&&i.noneInside(b,H,re)?be.outOfRange:"",[i,be,b,H[0],H[1],re[0],re[1],O,le]),Ra=e.description??(Zt||Na+(Q?Q.desc:"")+Fa+(N?He.logDropped(N):"")),Wr=Q?Q.yTitle:e.yLabel,Kr=i&&(At!==null||Nt!==null)?(0,ae.jsx)(i.RefLines,{p:n,x:At,y:Nt,box:se}):null;return(0,ae.jsxs)(Fo,{c:t,kind:l?He.bubble:He.scatter,ariaLabel:e.ariaLabel,description:Ra,emptyText:Zt||void 0,events:Ta,tip:Br,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(w,$,B)=>{let K=Q?Q.at(w,$):va(w,$);K!==t.active&&t.setActive(K,B.pointerType==="touch"?"touch":"pointer")},onKey:Sa,announce:Q&&t.via==="keyboard"?Q.say(t.active):void 0,underlay:z?(0,ae.jsx)(Pi,{width:r,height:o,draw:Ca,progress:Ma,version:t.sig}):void 0,children:[Wr&&_n?(0,ae.jsx)(ce,{x:Be,y:6,size:10.5,fill:n.paint("muted"),children:Wr}):null,(0,ae.jsx)(Qo,{p:n,ticks:Dr,y:Qe,x0:Be,x1:r,fmt:Ce,locale:t.locale,zero:!1,labels:_n}),(0,ae.jsxs)("g",{"aria-hidden":"true",children:[(e.showXAxis===!1?[]:Aa).map(w=>(0,ae.jsx)(ce,{x:et(w),y:o-st+13,anchor:"middle",size:bt,fill:n.paint("muted"),children:ge(w)},w)),e.xLabel?(0,ae.jsx)(ce,{x:Vr.x,y:Vr.y,anchor:"end",size:10.5,fill:n.paint("muted"),children:e.xLabel}):null]}),Q?null:Kr,a&&Q?(0,ae.jsx)(a.Layer,{p:n,v:Q,box:se,active:t.active,c:t,m:Mt,onPick:t.click}):null,Q?Kr:null,z?t.active!==null&&V[t.active]?(0,ae.jsx)("circle",{cx:V[t.active].x,cy:V[t.active].y,r:V[t.active].r+2,fill:"none",stroke:n.paint("ink"),strokeWidth:1.6,pointerEvents:"none"}):null:Mt.items.map(w=>{let $=w.data;if(!$)return null;let[B,K,L]=w.v,te=t.active===$.i,oe=We&&$.si>=0?We[$.si]:void 0,ee=oe?oe.fill:$.hi?Ir.fill:n.paint(l?"neutral":"neutralStrong");return(0,ae.jsx)("circle",{className:"ztd-mark",cx:B,cy:K,r:Math.max(0,L),fill:ee,fillOpacity:$.hi?.92:l?.85:.7,stroke:te?n.paint("ink"):n.paint("panel"),strokeWidth:te?2:l?1.2:.6,opacity:w.exiting?.3:t.active===null||te?1:.55,onPointerEnter:Se=>t.setActive($.i,Se.pointerType==="touch"?"touch":"pointer"),onClick:()=>t.click($.i)},w.key)}),i&&be?(0,ae.jsx)(i.Overlay,{p:n,fade:Mt.fade(Kt*.6,300),trendTag:be.trendTag,fitLine:Xt,fitTag:Yt,quads:Ut,seriesLabels:Bn,seriesNames:u,colors:We,hiSeries:pe}):null,$a.map(w=>(0,ae.jsx)(ce,{x:w.x,y:w.y,anchor:w.anchor,size:11,weight:w.d.hi?800:500,fill:n.paint(w.d.hi?"ink":"muted"),opacity:Mt.fade(Kt*.6,300),children:w.d.label},w.d.i)),Zt?(0,ae.jsx)(ce,{x:(se.x0+se.x1)/2,y:(se.y0+se.y1)/2,anchor:"middle",size:12,fill:n.paint("muted"),children:Zt}):null]})}var Tc=C(U(),1);var Lr=C(I(),1),Mc={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}, ${Ae(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Qi={en:Mc,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}일 이동평균`}},Pr=["ink","muted","dim"];function ea(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Pr.length)}var Cc=C(U(),1);var ia=C(I(),1),Sc={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Ae(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Ac={en:Sc,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},ta=(e,t)=>Ac[e].other(t);function na(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,a)=>({v:i.value,i:a})).sort((i,a)=>a.v-i.v).slice(0,Math.floor(t)).map(i=>i.i)),o=e.filter((i,a)=>!r.has(a));return{kept:e.filter((i,a)=>r.has(a)),other:n(o.length,Wo(o.map(i=>i.value)))}}var ra=e=>Number.isFinite(e)&&e>0?e:0;function oa(e,t,n,r){return r==="emphasis"?fo(e,t,n):Le(e,t,n)}var Nc=C(U(),1);var ca=C(I(),1);function aa(e,t){return t===!1?e.map((n,r)=>r):Vo(e)}function sa(e,t,n){let r=n.map(o=>o.reduce((i,a)=>i+(Number.isFinite(a)?a:0),0));return Oe(e,t,t,r,"max")}function la(e,t,n){let r=new Array(t.length),o=t.filter(i=>!n.has(i));for(let i of t)n.has(i)&&(r[i]=J(e,"accent"));return o.forEach((i,a)=>r[i]=o.length===1?J(e,"neutral"):sn(e,1-a/Math.max(1,o.length-1))),r}function ua(e){return!e||typeof e!="object"||Array.isArray(e)?[]:$e(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function ma(e,t){return tt(e,t+1,new Set)}var Fc=C(U(),1);var fa=C(I(),1);function da(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!mi.includes(o)&&t.forEach((i,a)=>i===o&&r.add(a));return r}var Ve=C(I(),1);function ha(e,t,n){let r=kn(e);return r?.type==="scatter"&&t?.size!==void 0&&!xn(n)?kn("bubble"):r}function Rc(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 Pc(e,t,n,r=!1){let o=ha(e.type,e.encoding,e.options);if(!o||!t.length)return[];let i=e.encoding??{},a=e.options??{},s=a.highlight,l=new Set(!r&&ur.includes(o.type)&&Array.isArray(a.hidden)?a.hidden.map(String):[]),c=u=>u.filter(d=>!l.has(d.label)),m=["pie","donut","waffle"];if(o.type==="donut"&&a.legend!=="none")return[];if(m.includes(o.type)){let u=Fe(i.label,"label"),d=ve(i.value,"value"),h=o.type==="waffle",f=t.map((b,N)=>({r:b,label:u(b,N),value:h?d(b,N):ra(d(b,N))})),{kept:y,other:p}=h?{kept:f,other:null}:na(f,a.other,(b,N)=>({r:{},label:ta(Y(n),b),value:N})),g=Oe(s,y.map(b=>b.r),y.map(b=>b.label),y.map(b=>b.value),h?"first":"max"),x=p?[...y,p]:y,T=Ye(b=>h?Le(b,x.length,g):oa(b,x.length,g,a.colorMode)),M=h&&a.shape==="arc";return x.map((b,N)=>({label:b.label,color:T[N],...M&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=ea(Array.isArray(a.ma)?a.ma:void 0,t.length),d=Qi[Y(n)];return[{label:d.up,color:a.upColor??"accent"},{label:d.down,color:a.downColor??"neutralStrong"},...u.map((h,f)=>({label:d.maLegend(h),color:Pr[f],shape:"line"}))]}if(o.type==="network"){let u=ua(a.groups);if(u.length<2)return[];let d=Ye(h=>ma(h,u.length));return u.map((h,f)=>({label:h,color:d[f],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof i.group!="string")return[];let u=Fe(i.group,"group"),d=$e(t.map((f,y)=>u(f,y)).filter(Boolean));if(d.length<2)return[];let h=Ye(f=>tt(f,d.length,new Set));return d.map((f,y)=>({label:f,color:h[y],shape:"circle"}))}if(o.type==="scatter"){if(typeof i.series!="string"||xn(a))return[];let u=Fe(i.series,"series"),d=$e(t.map((y,p)=>u(y,p)));if(d.length<2)return[];let h=Fr(s,t,d,u),f=Ye(y=>tt(y,d.length,h));return c(d.map((y,p)=>({label:y,color:f[p],shape:"circle"})))}if(o.type==="timeline"){let u=typeof i.group!="string",d=u?i.status:i.group;if(typeof d!="string")return[];let h=wi(t,d,u),f=Ye(y=>Le(y,h.length,da(s,h)));return c(h.map((y,p)=>({label:y,color:f[p],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(i.y))u=i.y;else if(typeof i.series=="string"){let T=Fe(i.series,"series");u=$e(t.map((M,b)=>T(M,b)))}let d=mr(o.type,i,a);if(d.length){let T=Oe(s,u,u,u.map(()=>0),"none"),M=Ye(N=>Le(N,u.length,T)),b=u.length<2?[{label:String((Array.isArray(i.y)?i.y[0]:i.y)??"y"),color:"neutral"}]:u.map((N,D)=>({label:N,color:M[D]}));return[...c(b),...d.map((N,D)=>({label:N,color:Ri(D),shape:"line"}))]}if(u.length<2)return[];let f=o.type==="bar"&&a.layout==="diverging"&&s===void 0?Go(u.length,Array.isArray(a.negative)?a.negative.map(T=>u.indexOf(String(T))):[],typeof a.neutral=="string"?u.indexOf(a.neutral):-1):-1,y=f>=0?new Set([f]):Oe(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((T,M)=>({label:T,color:y.has(M)?"accent":"neutralStrong",shape:"square"})));let p=a.colorMode,g=T=>Le(T,u.length,y);if((o.type==="line"||o.type==="area")&&(g=T=>Fi(T,u.length,y,o.type==="area",p)),o.type==="stream"){let T=Ot(t,i.x,i.y,i.series,{xType:a.xType,locale:n,aggregate:a.aggregate,dayFirst:a.dayFirst}),M=aa(T.values,a.reorder),b=sa(s,T.series,T.values);g=N=>la(N,M,b)}let x=Ye(g);return c(u.map((T,M)=>({label:T,color:x[M],...o.type==="line"&&{shape:"line"}})))}return[]}function Lc(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Do.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function _c(e,t,n){let{data:r,width:o,height:i,highlight:a,syncId:s,ariaLabel:l,description:c,...m}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:m,width:o,height:i,highlight:a,syncId:s,title:l,description:c}}function ga(e,t){let{spec:n}=e,r=ha(n.type,n.encoding,n.options),o=(0,Gt.useMemo)(()=>vi(n.data),[n.data]),i=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,a=_o(n,e.locale),s=ke(a),l=Y(s),c=di(i?.url??null,{parse:i?.format??"auto",select:i?.select,init:e.fetchInit,locale:s}),m=Io(n),u=(0,Gt.useMemo)(()=>m?xi(m,s):void 0,[m,s]),d=n.options?.hidden,h=Array.isArray(d)?d.map(String):[],f=h.join(""),[y,p]=(0,Gt.useState)(null);if(!r)return(0,Ve.jsx)(cr,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:a});let g=o??c.data,x=t[r.type],T={...n.options??{}},M={...Rc(r,n.encoding),...T,...u?{tooltip:u}:{},data:g,...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:a},b=n.card?.legend==="toggle"&&Oo(r.type,n.encoding??{},T),N=y&&y.base===f?y.hidden:h;b&&(M.hidden=N);let D=R=>p(S=>{let v=S&&S.base===f?S.hidden:h;return{base:f,hidden:v.includes(R)?v.filter(A=>A!==R):[...v,R]}}),z=M.height??220,E=Lc(n,r.type),_=i&&!g.length&&(c.loading||c.error||c.empty)?(0,Ve.jsx)(cr,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:z,locale:a}):E?(0,Ve.jsx)(ui,{chart:x,..._c(r.type,E,M)}):(0,Ve.jsx)(x,{...M});if(n.card){let R=n.card,S=R.legend==="auto"||R.legend==="toggle"?Pc(n,g,s,b):R.legend,v=S?.length?b?(0,Ve.jsx)(lr,{items:S,hidden:N,onToggle:D,locale:a}):S:void 0,A=R.download?(0,Ve.jsx)(yi,{data:g,columns:zo(n),filename:R.title??r.type,formats:Array.isArray(R.download)?R.download:void 0,locale:a}):void 0;_=(0,Ve.jsx)(No,{number:R.number,title:R.title??Lo(r,l),subtitle:R.subtitle,legend:v,actions:A,source:R.source||void 0,note:R.note||void 0,accent:R.accent,takeaway:R.takeaway,level:R.level,sample:R.sample,replay:R.replay!==!1,className:e.className,locale:a,children:_})}let P=e.theme??n.theme;return P&&(_=(0,Ve.jsx)(hn,{theme:P,children:_})),_}function Dc({cfg:e,components:t}){let n=wt();return ga({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function ba(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,pa.hydrateRoot)(r,(0,_r.createElement)(hn,{theme:o.theme,cssVars:!0},(0,_r.createElement)(Dc,{cfg:o,components:{[e]:t}})))}ba("scatter",Rr);})();
27
+ `}function Dl(e){return Array.from((e??"").replace(/[\\/:*?"<>|\r\n\t]+/g,"-").trim()).slice(0,80).join("")||"chart"}function xr(e,t){let n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(n.href),1e4)}var ha=2,Je=16;function ga(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 pa(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 ba(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+Je*2,i+Je*2],c=o.cloneNode(!0),m=c.querySelectorAll("*"),u=new Map;o.querySelectorAll("*").forEach((f,y)=>{let p;for(let g of Array.from(f.attributes)){if(!Pl.test(g.value))continue;let x=(p??(p=getComputedStyle(f))).getPropertyValue(g.name);x&&m[y].setAttribute(g.name,ga(x,u))}}),c.removeAttribute("style");for(let[f,y]of Object.entries({viewBox:`${-Je} ${-Je} ${s} ${l}`,width:s*t,height:l*t,"font-family":getComputedStyle(o).fontFamily}))c.setAttribute(f,String(y));let d=ga(getComputedStyle(r).backgroundColor,u),h=o.parentElement?.querySelector("canvas")??null;if(n){let f=c.querySelector("desc")?.nextSibling??c.firstChild;c.insertBefore(pa("rect",{x:-Je,y:-Je,width:s,height:l,fill:d}),f),h&&c.insertBefore(pa("image",{href:h.toDataURL(),width:a,height:i}),f)}return{svg:new XMLSerializer().serializeToString(c),w:s,h:l,vw:a,vh:i,bg:d,canvas:h}}function El(e,t){let n=ba(e,ha,!1);if(!n)return;let r=ha,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,Je*r,Je*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&&xr(l,`${t}.png`),"image/png")},s.onerror=()=>URL.revokeObjectURL(i),s.src=i}function ya(e){let t=xe(e.theme),n=Y(ke(e.locale))==="ko",r=Dl(e.filename),o=(a,i)=>{if(a==="csv")return xr(new Blob([_l(e.data,e.columns?.length?e.columns:Ll(e.data))],{type:"text/csv;charset=utf-8"}),`${r}.csv`);if(a==="png")return El(i,r);let s=ba(i,1,!0);s&&xr(new Blob([s.svg],{type:"image/svg+xml"}),`${r}.svg`)};return(0,kr.jsx)("span",{style:{display:"inline-flex",gap:6,flex:"none"},children:Fl.filter(a=>!e.formats||e.formats.includes(a)).map(a=>{let i=a.toUpperCase(),s=n?`${i} 내려받기`:`Download ${i}`;return(0,kr.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 ka=S(I(),1);function xa(e,t=he){let n=nt(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?Lt(s,{locale:t,year:"numeric",month:"short",day:"numeric"}):String(s)};return a=>{let i=[];for(let s of r){let l=!1,c=s.replace(vo,(m,u)=>o(a,u.trim())??(l=!0,""));l||i.push(c)}return i.length?i.map((s,l)=>(0,ka.jsx)("div",{children:s},l)):null}}function wa(e,t,n=!1){let r=Fe(t,"group"),o=e.map((s,l)=>r(s,l)).filter(Boolean),a=$e(o);if(!n)return a;let i=new Map;for(let s of o)i.set(s,(i.get(s)??0)+1);return a.map((s,l)=>[s,l]).sort((s,l)=>i.get(s[0])-i.get(l[0])||s[1]-l[1]).map(([s])=>s)}function va(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 at(t.csv)}return null}var Na=S(U(),1);var Z=S(U(),1);function $a(e,t){let n=xe(e.theme),[r,o,a]=Tn(e.width),i=wt(),s=e.width??(a||t.ssrWidth||480),l=typeof t.height=="function"?t.height(s):t.height,c=e.height??l,m=Sn(e.reducedMotion??"auto"),u=e.animate!==!1&&!m&&Pe,d=ca(r,e.animateOnView!==!1&&u),h=ke(e.locale),f=Y(h),y=(0,Z.useMemo)(()=>nt(e.format,h,t.format),[e.format,h,t.format]),p=(0,Z.useCallback)(H=>cn(H,{locale:h}),[h]),g=(0,Z.useMemo)(()=>un(y,e.unit),[y,e.unit]),x=(0,Z.useMemo)(()=>wn(e.data),[e.data]),[M,T]=(0,Z.useState)(null),[b,N]=(0,Z.useState)(null),D=(0,Z.useRef)([]),z=(0,Z.useRef)(e.onHover);z.current=e.onHover;let E=(0,Z.useRef)(e.onClick);E.current=e.onClick;let _=(0,Z.useRef)(null),P=(0,Z.useRef)(null),R=(0,Z.useRef)(null),C=(0,Z.useCallback)((H,de="pointer")=>{if(R.current!==H){R.current=H;let Te=H===null?null:D.current[H]??null;queueMicrotask(()=>z.current?.(Te)),P.current?.(H)}_.current=H===null?null:de,T(H),N(_.current)},[]),v=(0,Z.useCallback)(H=>{_.current!=="keyboard"&&(_.current=H===null?null:"sync",T(H),N(_.current))},[]),A=(0,Z.useCallback)(H=>{let de=D.current[H];de&&E.current?.(de)},[]),O=Ao(e.replayKey),j=e.width!==void 0||(a??0)>0,le={enabled:u,active:d.visible&&j,near:d.near,replayKey:O,dataKey:x,easing:e.easing??"spring",duration:e.duration??t.duration??900,stagger:e.stagger??t.stagger??0},re=(0,Z.useCallback)((H,de=1)=>M===null||M===H?de:de*.38,[M]);return{p:n,width:s,height:c,measured:j,responsive:e.width===void 0,pending:Pe&&i&&e.width===void 0&&a===null,node:r,hydrated:i,ref:o,motion:le,fv:g,fmt:y,pct:p,locale:h,lang:f,t:f==="ko"?oo:ro,active:M,via:b,setActive:C,click:A,events:D,showTooltip:e.tooltip!==!1,showLabels:e.showLabels!==!1,dim:re,sig:x,description:e.description,reduced:m,publish:P,applySync:v}}var q=S(U(),1);function Ol(e){return 1-Math.pow(1-e,3)}function Il(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}function zl(e){return e==="easeInOut"?Il:e==="linear"?t=>t:Ol}function Bl(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 $t(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 Cn(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 Ma(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 Ta(e,t,n,r){if(!t||!n||t.length!==n.length)return $t(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 $t(s,n[i]))o.push(l)}return o.length===r?o:$t(e,r)}var An=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||!Cn(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),Ma(n.from,n.vel,n.to),n.cur=n.from.slice(),n.curVel=n.vel.slice(),n.done=Cn(n.from,n.to),n.done&&(n.progress=1);this.entranceStart=t,this.animating=!0}update(t,n,r=0){this.step(n);let o=new Set,a=0;for(let i of t){o.add(i.key);let s=this.tracks.get(i.key),l=r>0?Math.min(a*r,240):0;if(s){let c=i.to.length;s.from=Ta(s.cur,s.parts,i.parts,c),s.vel=Ta(s.curVel,s.parts,i.parts,c),s.parts=i.parts,s.to=i.to.slice(),Ma(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=Cn(s.from,s.to)&&s.vel.every(m=>Math.abs(m)<1e-6),s.progress=s.done?1:0}else{let c=this.make(i,i.enter??i.from??i.to,n+l,0);c.done=Cn(c.from,c.to),this.tracks.set(i.key,c)}a++}for(let i of this.tracks.values())o.has(i.key)||i.exiting||(i.from=i.cur.slice(),i.vel=i.curVel.slice(),i.to=$t(i.exit,i.cur.length),i.t0=n,i.exiting=!0,i.done=!1,i.progress=0);this.animating=!0}step(t){if(!this.animating)return!1;let n=!1,r=zl(this.easing),o=this.duration/1e3,a=this.omega,i=[];for(let s of this.tracks.values()){if(s.done)continue;let l=(t-s.t0)/1e3,c=s.to.length;if(s.from.length!==c&&(s.from=$t(s.from,c)),s.vel.length!==c&&(s.vel=$t(s.vel,c)),s.cur.length!==c&&(s.cur=new Array(c).fill(0),s.curVel=new Array(c).fill(0)),!(l>0)){for(let u=0;u<c;u++)s.cur[u]=s.from[u],s.curVel[u]=0;s.progress=0,n=!0;continue}let m;if(this.easing==="spring"){let u=Math.exp(-a*l),d=a*l>=8&&a*l<20,h=0;for(let f=0;f<c;f++){let y=s.from[f]-s.to[f],p=s.vel[f]+a*y;s.cur[f]=s.to[f]+(y+p*l)*u,s.curVel[f]=(s.vel[f]-a*p*l)*u,d&&h<.15&&(h=Math.max(h,Math.abs(s.cur[f]-s.to[f]),Math.abs(s.curVel[f]/a)))}m=a*l>=20||d&&h<.15,s.progress=Math.min(1,1-(1+a*l)*u)}else{let u=Math.min(1,l/o),d=r(u),h=Bl(this.easing,u)/o;for(let f=0;f<c;f++)s.cur[f]=s.from[f]+(s.to[f]-s.from[f])*d,s.curVel[f]=(s.to[f]-s.from[f])*h;m=u>=1,s.progress=d}if(m){for(let u=0;u<c;u++)s.cur[u]=s.to[u],s.curVel[u]=0;s.done=!0,s.progress=1,s.exiting&&i.push(s.key)}else n=!0}for(let s of i)this.tracks.delete(s);return this.animating=n,n||(this.entranceStart=-1),n}elapsed(t){return this.entranceStart<0?1/0:t-this.entranceStart}get entranceLength(){return this.duration+this.maxDelay}get(t){return this.tracks.get(t)?.cur}items(){return[...this.tracks.values()].sort((t,n)=>t.order-n.order).map(t=>({key:t.key,v:t.cur,data:t.data,exiting:t.exiting,progress:t.progress}))}get size(){return this.tracks.size}},Bt=new Set,Nn=0;function Sa(e){Nn=0;let t=Array.from(Bt);for(let n of t){let r;try{r=n(e)}catch{r=!1}r||Bt.delete(n)}Bt.size&&typeof requestAnimationFrame<"u"&&(Nn=requestAnimationFrame(Sa))}function Ca(e){return Bt.add(e),!Nn&&typeof requestAnimationFrame<"u"&&(Nn=requestAnimationFrame(Sa)),()=>{Bt.delete(e)}}function Hl(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 Aa(e,t){let n=(0,q.useMemo)(()=>Hl(e),[e]),{enabled:r,active:o,near:a=!0,replayKey:i,dataKey:s,easing:l="spring",duration:c=900,stagger:m=0}=t,u=(0,q.useRef)(null),d=(0,q.useRef)("init"),h=(0,q.useRef)(null),f=(0,q.useRef)(s),y=(0,q.useRef)(i),p=(0,q.useRef)(!1),g=(0,q.useRef)(0),[,x]=(0,q.useState)(0),M=(0,q.useRef)(null),T=(0,q.useRef)(!0);u.current||(u.current=new An,u.current.configure(l,c),u.current.snap(n),h.current=n);let b=u.current;if(b.configure(l,c),h.current!==n){let P=d.current,R=!Object.is(f.current,s);b.sameTargets(n)?b.refreshData(n):!r||P==="init"?b.snap(n):P==="idle"?b.hold(n):P==="running"||R?b.update(n,rn(),m):b.snap(n),h.current=n,f.current=s}let N=(0,q.useRef)(()=>!1);N.current=P=>{if(!T.current)return!1;let R=b.step(P);return!R&&d.current==="running"&&(d.current="done"),x(C=>(C+1)%1e9),R||(M.current=null),R};let D=(0,q.useCallback)(()=>{if(!Pe||M.current||!b.animating)return;let P=R=>N.current(R);M.current=Ca(P)},[b]);Ie(()=>{let P=!Object.is(y.current,i);if(y.current=i,!r){(d.current!=="done"||b.animating)&&(b.snap(h.current??n),d.current="done",x(R=>R+1));return}d.current==="init"||P&&a?(b.hold(h.current??n),d.current="idle",p.current=!1,x(R=>R+1)):P&&(p.current=!0)},[r,i]),Ie(()=>{!r||!a||!p.current||(p.current=!1,b.hold(h.current??n),d.current="idle",x(P=>P+1))},[a,r]),(0,q.useEffect)(()=>{r&&o&&d.current==="idle"&&(b.start(rn()),g.current+=1,d.current="running",D(),x(P=>P+1))},[r,o,i,b,D]),(0,q.useEffect)(()=>{b.animating&&D()}),(0,q.useEffect)(()=>(T.current=!0,()=>{T.current=!1,M.current?.(),M.current=null}),[]);let z=rn(),E=b.elapsed(z),_=r&&d.current==="idle";return{items:b.items(),get:P=>b.get(P),elapsed:_?0:E,fade:(P,R=320)=>_?0:Number.isFinite(E)?Math.max(0,Math.min(1,(E-P)/R)):1,waiting:_,animating:b.animating,generation:g.current}}var wr=S(I(),1);function Fa(e,t,n,r,o){if(r)return o==="categorical"?Le(e,t,n):ho(e,t,n);if(o==="categorical")return Le(e,t,n);let a=J(e,"strong"),i=J(e,"accent");return Array.from({length:t},(s,l)=>n.has(l)?i:a)}var jl=S(U(),1);var vr=S(I(),1);var Ra=e=>e?"neutralStrong":"accent";var Ze=S(U(),1),La=S(I(),1);function Pa(e){let t=(0,Ze.useRef)(null),n=(0,Ze.useRef)(new Map),[r,o]=(0,Ze.useState)(0),{width:a,height:i,draw:s,progress:l,version:c,clipRight:m,manualClear:u}=e;return(0,Ze.useEffect)(()=>{let d=t.current;if(!d)return;let h=Math.min(2,window.devicePixelRatio||1),f=Math.max(1,Math.round(a*h)),y=Math.max(1,Math.round(i*h));d.width!==f&&(d.width=f),d.height!==y&&(d.height=y);let p=d.getContext("2d");if(!p)return;p.setTransform(h,0,0,h,0,0),u||p.clearRect(0,0,a,i);let g=getComputedStyle(d),x=new Map;s(p,l,(T,b)=>{let N=x.get(T);return N===void 0&&(N=g.getPropertyValue(T).trim(),x.set(T,N)),N||b}),n.current=x},[a,i,s,l,c,u,r]),(0,Ze.useEffect)(()=>{let d=t.current;if(!d||typeof matchMedia!="function")return;let h=new AbortController,f=()=>o(x=>x+1),y=()=>{let x=getComputedStyle(d);for(let[M,T]of n.current)if(x.getPropertyValue(M).trim()!==T)return f()},p=()=>{matchMedia(`(resolution: ${devicePixelRatio}dppx)`).addEventListener?.("change",()=>{p(),f()},{once:!0,signal:h.signal})};p(),matchMedia("(prefers-color-scheme: dark)").addEventListener?.("change",y,{signal:h.signal});let g=new MutationObserver(y);for(let x=d.parentElement;x;x=x.parentElement)g.observe(x,{attributes:!0});return()=>{h.abort(),g.disconnect()}},[]),(0,La.jsx)("canvas",{ref:t,"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"100%",height:"auto",aspectRatio:`${a} / ${i}`,pointerEvents:"none",clipPath:m?`inset(0 ${(m/Math.max(1,a)*100).toFixed(3)}% 0 0)`:void 0}})}var G=S(U(),1);var Ba=S(U(),1);var Mt=S(I(),1);function $r(e,t){return ne(t[0],10)+10+e*14+ne(t[1],10)}function Mr({p:e,right:t,steps:n,scale:r,labels:o,min:a}){let i=r.center,s=t-n*14-ne(o[1],10);return(0,Mt.jsxs)("g",{"aria-hidden":"true",children:[Array.from({length:n},(l,c)=>{let m=Pt(e,i===void 0?c/(n-1):2*c/(n-1)-1,a,r);return(0,Mt.jsx)("rect",{x:s-6+c*14,y:3,width:12,height:9,rx:2,fill:m.fill,opacity:m.opacity},c)}),(0,Mt.jsx)(ce,{x:s-10,y:7.5,anchor:"end",size:10,fill:e.paint("muted"),children:o[0]}),(0,Mt.jsx)(ce,{x:t,y:7.5,anchor:"end",size:10,fill:e.paint("muted"),children:o[1]})]})}var Fn=20,jt=24,it=4,Gl=16,Vl=4,Wl=200;function Kl(e){return typeof e=="number"&&Number.isFinite(e)?dt(e,Vl,Wl):Gl}var Ht=2e5;function _a(e,t){let n=Math.max(1,Math.ceil((t.x1-t.x0)/e)+3),r=Math.max(1,Math.ceil((t.y1-t.y0)/(1.5*e/Math.sqrt(3)))+3);return n*r}function Sr(e,t){let n=Kl(e);if(_a(n,t)>Ht)for(n=Math.max(n,Math.sqrt((t.x1-t.x0)*(t.y1-t.y0)*Math.sqrt(3)/1.5/Ht));_a(n,t)>Ht;)n*=1.02;return{w:n,r:n/Math.sqrt(3),x0:t.x0,y0:t.y0}}function Xl(e,t,n){return[e.x0+(t+(n&1)/2)*e.w,e.y0+n*1.5*e.r]}function Da(e,t,n){return Ea(e,t,n,Tr),[Tr[0],Tr[1]]}var Tr=new Int32Array(2);function Ea(e,t,n,r){let o=1.5*e.r,a=(n-e.y0)/o,i=(t-e.x0)/e.w,s=Math.round(a),l=a<s?s-1:s+1,c=Math.round(i-(s&1)/2),m=Math.round(i-(l&1)/2),u=e.x0+(c+(s&1)/2)*e.w-t,d=e.y0+s*o-n,h=e.x0+(m+(l&1)/2)*e.w-t,f=e.y0+l*o-n,y=u*u+d*d<=h*h+f*f;r[0]=y?c:m,r[1]=y?s:l}function Cr(e,t,n,r){let o=Math.max(1,Math.ceil((r.x1-e.x0)/e.w)+3),a=Math.min(Math.max(1,Math.ceil((r.y1-e.y0)/(1.5*e.r))+3),Math.max(1,Math.floor(Ht/o))),i=new Int32Array(Math.min(o*a,Ht)),s=new Int32Array(2);for(let c=0;c<t.length;c++){let m=t[c],u=n[c];if(!(m>=r.x0&&m<=r.x1&&u>=r.y0&&u<=r.y1))continue;Ea(e,m,u,s);let d=s[0]+1,h=s[1]+1;d>=0&&d<o&&h>=0&&h<a&&i[h*o+d]++}let l=[];for(let c=0;c<i.length;c++){let m=i[c];if(!m)continue;let u=c%o-1,d=Math.floor(c/o)-1,[h,f]=Xl(e,u,d);l.push({col:u,row:d,cx:h,cy:f,count:m})}return l}function Ar(e){return e>14?1.5:e>6?1:0}function Nr(e,t,n=0){let r=Math.max(.1,e.r-n/Math.sqrt(3)),o=ft(r*Math.sqrt(3)/2),a=ft(r/2),i=ft(r),s=`l${o},${a}v${i}l-${o},${a}l-${o}-${a}v-${i}z`,l="";for(let c of t)l+=`M${ft(c.cx)},${ft(c.cy-r)}${s}`;return l}function Oa(e,t,n){let r=e[t];if(!r)return-1;let o=r.row&1?-1:1,a=-1,i=1/0,s=-1/0;for(let l=0;l<e.length;l++){let c=e[l].cx-r.cx,m=e[l].cy-r.cy,u=c*n[0]+m*n[1],d=Math.abs(c*n[1]-m*n[0]);if(u<=0||d>u+1e-6)continue;let h=Math.round((c*c+m*m)*1e4),f=Math.sign(c)*o;(h<i||h===i&&f>s)&&(i=h,s=f,a=l)}return a}var ue=S(I(),1),Ul={points:(e,t)=>`${t} ${e===1?"point":"points"}`,range:(e,t)=>`${e} to ${t}`,desc:(e,t)=>` Binned into ${e} ${e===1?"hexagon":"hexagons"}. Densest: ${t}.`},Yl={en:Ul,ko:{points:(e,t)=>`점 ${t}개`,range:(e,t)=>`${e}~${t}`,desc:(e,t)=>` 육각 칸 ${e}개로 묶었어요. 가장 촘촘한 칸: ${t}.`}},Rn=.14;function Ha(e,t,n,r,o){let a=new Float64Array(e),i=new Float64Array(e),[s,l]=r.domain,[c,m]=o.domain;for(let u=0;u<e;u++){let d=t(u),h=n(u),f=d>=s&&d<=l&&h>=c&&h<=m;a[u]=f?r(d):NaN,i[u]=f?o(h):NaN}return[a,i]}function ja(e,t=1/0,n=-1/0){for(let r of e)t=Math.min(t,r.count),n=Math.max(n,r.count);return[t,n]}function ql(e,t,n,r,o,a){let i=Sr(r,n),s=Cr(i,e,t,n),[l,c]=ja(s);a&&Number.isFinite(a[0])&&Number.isFinite(a[1])&&a[1]>=a[0]&&([l,c]=a);let m=ln(void 0,void 0,o??5),u=p=>c>l?dt((p-l)/(c-l),0,1):1,d=new Map,h=s.map(p=>{let g={...p,t:u(p.count)},x=Qn(g.t,m),M=d.get(x);return M?M.push(g):d.set(x,[g]),g});h.sort((p,g)=>g.count-p.count||p.row-g.row||p.col-g.col);let f=Ar(i.w),y=[...d.entries()].sort((p,g)=>p[0]-g[0]).map(([,p])=>({t:p[0].t,d:Nr(i,p,f)}));return{grid:i,cells:h,lo:Number.isFinite(l)?l:0,hi:Number.isFinite(c)?c:0,at:new Map(h.map((p,g)=>[`${p.col},${p.row}`,g])),scale:m,groups:y}}function Ia(e,t,n){let r=Math.min(e.range[0],e.range[1]),o=Math.max(e.range[0],e.range[1]),a=e.invert(dt(t,r,o)),i=e.invert(dt(n,r,o));return a<=i?[a,i]:[i,a]}function za(e,[t,n],r,o,a=""){let i=n-t,s=i>0?Math.max(0,Math.min(6,1-Math.floor(Math.log10(i)))):2,l=o??(c=>ye(c,{locale:r,maximumFractionDigits:s}));return e.range(l(t),`${l(n)}${a}`)}function Jl(e,t,n,r){let o=r-n-12-t;return ne(e,10.5)<=o?e:o>24?ht(e,o,10.5):""}function Zl(e,t){let{raw:n,c:r}=t,[o,a]=Ha(n.length,p=>n[p].x,p=>n[p].y,t.x,t.y),i=ql(o,a,t.box,e.binSize,e.colorSteps,e.binDomain),s=Yl[r.lang],{locale:l}=r,c=e.xFormat!==void 0?t.xFmt:null,m=e.format!==void 0?r.fmt:null,u=p=>{let g=i.cells[p],{w:x,r:M}=i.grid;return{count:s.points(g.count,ye(g.count,{locale:l,maximumFractionDigits:0})),x:za(s,Ia(t.x,g.cx-x/2,g.cx+x/2),l,c),y:za(s,Ia(t.y,g.cy-M,g.cy+M),l,m,e.unit)}},d=p=>{if(p===null||!i.cells[p])return"";let g=u(p);return`${g.count}, ${e.xLabel??"x"} ${g.x}, ${e.yLabel??"y"} ${g.y}`},h=kt(i.cells.length,p=>{let g=u(p),x=i.cells[p];return{datum:null,index:p,key:`${x.col},${x.row}`,label:`x ${g.x}, y ${g.y}`,value:x.count,formatted:g.count}}),f=[ye(i.lo,{locale:l}),ye(i.hi,{locale:l})],y=e.binLegend!==!1&&i.cells.length&&i.hi>i.lo?{right:r.width,labels:f}:null;return{m:i,events:h,say:d,desc:i.cells.length?s.desc(i.cells.length,d(0)):"",legend:y,yTitle:e.yLabel&&y?Jl(e.yLabel,t.left,$r(i.scale.steps,f),r.width):e.yLabel,tip:p=>{if(p===null||!i.cells[p])return null;let g=u(p);return{x:i.cells[p].cx,y:i.cells[p].cy-i.grid.r,title:g.count,rows:[{label:e.xLabel??"x",value:g.x},{label:e.yLabel??"y",value:g.y}]}},at:(p,g)=>{let{box:x}=t;if(!(p>=x.x0&&p<=x.x1&&g>=x.y0&&g<=x.y1))return null;let[M,T]=Da(i.grid,p,g);return i.at.get(`${M},${T}`)??null},step:(p,g)=>!p||!i.cells.length?null:g===null||!i.cells[g]?0:Oa(i.cells,g,p)}}function Ql(e){let{p:t,box:n,active:r}=e,{m:o,legend:a}=e.v,i=`${(0,Ba.useId)().replace(/:/g,"")}hx`,s=tn(e.c,e.m),{scale:l}=o,c=r!==null?o.cells[r]:void 0,m=c?Pt(t,c.t,Rn,l):null;return(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)("defs",{children:(0,ue.jsx)("clipPath",{id:i,children:(0,ue.jsx)("rect",{x:n.x0,y:n.y0,width:Math.max(0,n.x1-n.x0),height:Math.max(0,n.y1-n.y0)})})}),(0,ue.jsxs)("g",{clipPath:`url(#${i})`,onClick:()=>r!==null&&e.onPick(r),children:[o.groups.map((u,d)=>{let h=Pt(t,u.t,Rn,l);return(0,ue.jsx)("path",{className:"ztd-mark",d:u.d,fill:h.fill,opacity:h.opacity*(c?.55:1),style:en(s,e.m.waiting,"fade",d*70,360)},d)}),c&&m?(0,ue.jsx)("path",{d:Nr(o.grid,[c],Ar(o.grid.w)),fill:m.fill,fillOpacity:m.opacity,stroke:t.paint("ink"),strokeWidth:2,strokeLinejoin:"round",pointerEvents:"none"}):null]},e.m.generation),a?(0,ue.jsx)(Mr,{p:t,right:a.right,steps:l.steps,scale:l,labels:a.labels,min:Rn}):null]})}function ec({steps:e,labels:t}){let n=xe(),r=Math.ceil($r(e,t))+8;return(0,ue.jsx)("svg",{className:"ztd-facet-legend",width:r,height:16,viewBox:`0 0 ${r} 16`,overflow:"visible",children:(0,ue.jsx)(Mr,{p:n,right:r,steps:e,scale:ln(void 0,void 0,e),labels:t,min:Rn})})}function Ga(e,t,n){let r=e.panels[0]?.props,o=r?.xDomain,a=r?.yDomain;if(t.bin!=="hex"||!o||!a)return e;let i=t.yScale==="log",{pw:s,ph:l}=e,c=t.yLabel?Fn:10,m=(i?xt:Ge)(a,[l-jt-it,c+it]),u=yt(m.ticks(Math.max(2,Math.round(l/70))),rt(t.format,n,Math.max(Math.abs(a[0]),Math.abs(a[1]))),n),d=ve(t.x,"x"),h=ve(t.y,"y"),f=1/0,y=-1/0;for(let M of e.panels){let T=M.props.data,b=M.props.showYAxis===!1?0:u,N=Ge(o,[b+6+it,s-8-it]),[D,z]=Ha(T.length,_=>d(T[_],_),_=>h(T[_],_),N,m),E={x0:b,x1:s,y0:c,y1:l-jt};[f,y]=ja(Cr(Sr(t.binSize,E),D,z,E),f,y)}let p=e.panels.map(M=>({...M,props:{...M.props,binLegend:!1,...y>=f&&{binDomain:[f,y]}}})),g=ln(void 0,void 0,t.colorSteps??5).steps??5,x=y>f?(0,ue.jsx)(ec,{steps:g,labels:[ye(f,{locale:n}),ye(y,{locale:n})]}):void 0;return{...e,panels:p,legend:x}}var Va={view:Zl,Layer:Ql};var me=S(I(),1),tc={seriesCounts:e=>` ${Ae(e.length,"series","series")}: ${e.map(([t,n])=>`${t} ${Ae(n,"point")}`).join(", ")}.`,trend:(e,t,n,r)=>e>0?` ${n} rises as ${t} rises, R² ${r}.`:e<0?` ${n} falls as ${t} rises, R² ${r}.`:` No clear straight-line relationship between ${t} and ${n}, R² ${r}.`,refs:e=>` Reference ${e.length>1?"lines":"line"} at ${e.join(" and ")}.`,quadrants:e=>` Quadrants: ${e.map(([t,n])=>`${t} ${n}`).join("; ")}.`,slope:"Trend slope",trendTag:"Trend",outOfRange:"No points in this range."},nc={en:tc,ko:{seriesCounts:e=>` 계열 ${e.length}개: ${e.map(([t,n])=>`${t} ${n}개`).join(", ")}.`,trend:(e,t,n,r)=>e>0?` ${t} 값이 클수록 ${n} 값도 커요(R² ${r}).`:e<0?` ${t} 값이 클수록 ${n} 값은 작아요(R² ${r}).`:` ${t} 값과 ${n} 값 사이에 뚜렷한 직선 관계가 없어요(R² ${r}).`,refs:e=>` 기준선 ${e.join(", ")}.`,quadrants:e=>` 사분면: ${e.map(([t,n])=>`${t} ${n}개`).join(", ")}.`,slope:"추세 기울기",trendTag:"추세",outOfRange:"이 범위에는 점이 없어요."}};function rc(e){switch(e){case"ArrowRight":return[1,0];case"ArrowLeft":return[-1,0];case"ArrowDown":return[0,1];case"ArrowUp":return[0,-1];default:return null}}function oc(e,t,n){let r=e[t],o=n[0]+n[1]>0,a=null,i=1/0;for(let s=0;s<e.length;s++){if(s===t)continue;let l=e[s].x-r.x,c=e[s].y-r.y;if(!(l*n[0]+c*n[1]>0||l===0&&c===0&&(o?s>t:s<t)))continue;let u=l*l+c*c;(u<i||u===i&&a!==null&&Math.abs(s-t)<Math.abs(a-t))&&(i=u,a=s)}return a}function ac(e,t){let n=e.some(o=>o.hi),r=Xo(e.map(o=>n&&!o.hi?1/0:o.x*t[0]+o.y*t[1]));return r<0?null:r}function ic(e,t){let n=Math.imul((e|0)^2654435769,2246822507)^Math.imul(t+1,3266489909);return n=Math.imul(n^n>>>16,2146121005),n=Math.imul(n^n>>>15,2221713035),((n^n>>>16)>>>0)/4294967296}function sc(e){let t=[...new Set(e)].sort((r,o)=>r-o),n=1/0;for(let r=1;r<t.length;r++)n=Math.min(n,t[r]-t[r-1]);return Number.isFinite(n)?n:1}function Fr(e,t,n,r){if(typeof e!="function")return Oe(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}function lc(e,t,n,[r,o]){let a=t,i=n;if(e.slope){let s=t+(r-e.at(t))/e.slope,l=t+(o-e.at(t))/e.slope;a=Math.max(a,Math.min(s,l)),i=Math.min(i,Math.max(s,l))}else if(e.at(t)<r||e.at(t)>o)return null;return i>a?[a,e.at(a),i,e.at(i)]:null}function cc(e,t,n,r){let o=i=>Math.max(r.y0+9,Math.min(r.y1-9,i)),a=[{x:e.x2+2,y:o(e.y2-11),anchor:"end"},{x:e.x2+2,y:o(e.y2+11),anchor:"end"},{x:e.x1-2,y:o(e.y1-11),anchor:"start"},{x:e.x1-2,y:o(e.y1+11),anchor:"start"}];return a.find(i=>!n.some(s=>gt(s,Dt(t,i.x,i.y,i.anchor),2)))??a[0]}function uc(e,t,n,r){let o=[{x:r.x0+4,y:r.y0+10,w:t-r.x0,h:n-r.y0,anchor:"start"},{x:r.x1-4,y:r.y0+10,w:r.x1-t,h:n-r.y0,anchor:"end"},{x:r.x0+4,y:n+10,w:t-r.x0,h:r.y1-n,anchor:"start"},{x:r.x1-4,y:n+10,w:r.x1-t,h:r.y1-n,anchor:"end"}],a=[];return o.forEach((i,s)=>{let l=e[s];if(!l||i.h<22||i.w<40)return;let c=ht(l,i.w-16,10.5,500);a.push({text:c,x:i.x,y:i.y,anchor:i.anchor,box:Dt(c,i.x,i.y,i.anchor)})}),a}var Wa=11,Ka=e=>e?700:600;function mc(e,t,n,r){let o=t.map(()=>({x:0,y:0,n:0}));for(let m of e){let u=o[m.si];u&&(u.x+=m.x,u.y+=m.y,u.n++)}if(o.filter(m=>m.n).length>4)return[];let{box:a,reserved:i,grid:s}=r,l=m=>{if(m.x<a.x0+2||m.x+m.w>a.x1-2||m.y<a.y0||m.y+m.h>a.y1-2||i.some(u=>gt(u,m,2)))return!1;for(let u=Math.floor(m.x/s.cell);u<=Math.floor((m.x+m.w)/s.cell);u++)for(let d=Math.floor(m.y/s.cell);d<=Math.floor((m.y+m.h)/s.cell);d++)for(let h of s.g.get(`${u},${d}`)??[]){let f=e[h],y=Math.max(m.x,Math.min(f.x,m.x+m.w)),p=Math.max(m.y,Math.min(f.y,m.y+m.h));if(Math.hypot(f.x-y,f.y-p)<f.r+1.5)return!1}return!0},c=[];return o.forEach((m,u)=>{if(!m.n)return;let d=ne(t[u],Wa,Ka(n.has(u))),h=14,f=m.x/m.n,y=m.y/m.n,p=e.filter(g=>g.si===u).sort((g,x)=>Math.hypot(g.x-f,g.y-y)-Math.hypot(x.x-f,x.y-y));for(let g of p.slice(0,40)){let x=g.r+4,T=[{x:g.x+x,y:g.y-h/2,w:d,h},{x:g.x-x-d,y:g.y-h/2,w:d,h},{x:g.x-d/2,y:g.y-x-h,w:d,h},{x:g.x-d/2,y:g.y+x,w:d,h}].find(b=>l(b)&&!c.some(N=>gt(N.box,b,2)));if(T){c.push({si:u,y:T.y+h/2,box:T});return}}}),c}function dc(e,t){let n="";if(t.seriesNames.length){let a=t.seriesNames.map(s=>[s,0]);for(let s of t.points)a[s.si]&&a[s.si][1]++;let i=a.filter(([,s])=>s>0);i.length&&(n+=e.seriesCounts(i))}t.fit&&(n+=e.trend(t.fit.r2<.1?0:Math.sign(t.fit.slope),t.xName,t.yName,t.fit.r2.toFixed(2))),t.refs.length&&(n+=e.refs(t.refs));let{refX:r,refY:o}=t;if(t.quadrants.length&&r!==void 0&&o!==void 0){let a=[0,0,0,0];for(let s of t.points)a[(s.y>=o?0:2)+(s.x>=r?1:0)]++;let i=t.quadrants.slice(0,4).map((s,l)=>[s,a[l]]).filter(([s])=>s);i.length&&(n+=e.quadrants(i))}return n}function fc(e,t,n){let r=t.map(()=>[]);return e.forEach((o,a)=>r[o.si]?.push(a)),[...r.keys()].sort((o,a)=>Number(n.has(o))-Number(n.has(a))).map(o=>({ks:r[o],isHi:n.has(o),fill:a=>uo(t[o],a)}))}function hc({p:e,x:t,y:n,box:r}){return(0,me.jsxs)("g",{"aria-hidden":"true",pointerEvents:"none",children:[t!==null?(0,me.jsx)("line",{x1:t,x2:t,y1:r.y0,y2:r.y1,stroke:e.paint("dim"),strokeDasharray:"3 3"}):null,n!==null?(0,me.jsx)("line",{x1:r.x0,x2:r.x1,y1:n,y2:n,stroke:e.paint("dim"),strokeDasharray:"3 3"}):null]})}function gc(e){let{p:t,fade:n,fitLine:r,fitTag:o,quads:a,colors:i,hiSeries:s}=e;return(0,me.jsxs)(me.Fragment,{children:[r&&o?(0,me.jsxs)("g",{"aria-hidden":"true",pointerEvents:"none",opacity:n,children:[(0,me.jsx)("line",{...r,stroke:t.paint("muted"),strokeWidth:1.5,strokeDasharray:"6 4",strokeLinecap:"round"}),(0,me.jsx)(gr,{p:t,x:o.x,y:o.y,text:e.trendTag,anchor:o.anchor})]}):null,a.length?(0,me.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:a.map(l=>(0,me.jsx)(gr,{p:t,x:l.x,y:l.y,text:l.text,anchor:l.anchor},`${l.anchor}${l.y}`))}):null,i&&s?e.seriesLabels.map(l=>{let c=s.has(l.si);return(0,me.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",opacity:n,children:(0,me.jsx)(ce,{x:l.box.x,y:l.y,size:Wa,weight:Ka(c),fill:t.paint(c?"ink":"muted"),children:e.seriesNames[l.si]})},`s${l.si}`)}):null]})}function pc(e,[t,n],[r,o]){return e.length>0&&!e.some(a=>a.x>=t&&a.x<=n&&a.y>=r&&a.y<=o)}var Xa={text:nc,arrowStep:rc,nearestInDirection:oc,entryPoint:ac,seededUnit:ic,smallestGap:sc,uniq:$e,seriesHighlight:Fr,colors:tt,canvasGroups:fc,linearFit:Uo,fitSegment:lc,fitTagSpot:cc,quadrantTags:uc,tagBox:Dt,placeSeriesLabels:mc,describe:dc,RefLines:hc,Overlay:gc,hex:Va,noneInside:pc};var ie=S(I(),1),bc={bubble:"Bubble chart",scatter:"Scatter plot",size:"Size",sizeWord:"size",nth:e=>`#${e}`,desc:(e,t,n)=>`${e?"Bubble chart":"Scatter plot"}. ${Ae(t,"point")}. x from ${n[0]} to ${n[1]}, y from ${n[2]} to ${n[3]}.`,logDropped:e=>` ${Ae(e,"point")} with y at or below 0 ${e===1?"is":"are"} not shown on the log scale.`},yc={en:bc,ko:{bubble:"버블 차트",scatter:"산점도",size:"크기",sizeWord:"크기",nth:e=>`${e}번`,desc:(e,t,n)=>`${e?"버블 차트":"산점도"}. 점 ${t}개. x ${n[0]}~${n[1]}, y ${n[2]}~${n[3]}.`,logDropped:e=>` 로그 눈금이라 y가 0 이하인 점 ${e}개는 뺐어요.`}},xc=[],kc=[],wc=[],vc=[],Ua=[],Ya=e=>({x:e.x1-2,y:e.y1-8});function qa(e,t){return Number(e.hi)-Number(t.hi)||t.r-e.r}var Rr=Object.assign(function(t){return(0,ie.jsx)($c,{...t,kit:Xa})},{facetPlan:Ga}),Ja=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Za=e=>Array.isArray(e)&&e.length===2&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&e[0]<e[1]?e:void 0;function $c(e){let t=$a(e,{height:w=>Math.max(220,Math.min(320,w*.6)),duration:800,stagger:0}),{p:n,width:r,height:o}=t,a=e.kit,i=a&&e.bin==="hex"?a.hex:null,s=a?i?{fit:e.fit,refLines:e.refLines,quadrants:e.quadrants}:e:{},l=!a&&e.size!==void 0,c=e.yScale==="log",m=(0,G.useMemo)(()=>{if(s.series===void 0)return null;let w=Fe(s.series,"series");return e.data.map(($,B)=>w($,B))},[e.data,s.series]),u=(0,G.useMemo)(()=>a&&m?a.uniq(m):Ua,[a,m]),d=s.hidden?.join("")??"",h=s.quadrants?.join("")??"",f=s.jitter?Math.max(0,s.jitter.amount??.4):0,y=s.jitter?.seed??1,p=Ja(s.refLines?.x),g=Ja(s.refLines?.y),x=c&&g!==void 0&&g<=0?void 0:g,M=s.fit==="linear"&&!c,T=m!==null||M||p!==void 0||x!==void 0||f>0,b=(0,G.useMemo)(()=>{let w=ve(e.x,"x"),$=ve(e.y,"y"),B=l?ve(e.size,"size"):null,K=Fe(e.label,"label"),L=e.data.map((X,fe)=>{let lt=w(X,fe);return{d:X,i:fe,x:lt,y:$(X,fe),s:B?Math.max(0,B(X,fe)||0):1,label:K(X,fe),si:-1,px:lt}}).filter(X=>Number.isFinite(X.x)&&Number.isFinite(X.y)&&(!c||X.y>0));if(!a||f<=0&&!m)return L;let te=f>0?a.smallestGap(L.map(X=>X.x)):0,oe=new Map(u.map((X,fe)=>[X,fe])),ee=new Set(d?d.split(""):[]),Ce=[];for(let X of L){if(te&&(X.px=X.x+(a.seededUnit(y,X.i)*2-1)*f*te),m){let fe=m[X.i];if(ee.has(fe))continue;X.si=oe.get(fe)??-1}Ce.push(X)}return Ce},[e.data,e.x,e.y,e.size,e.label,l,a,m,u,d,f,y,c]),N=(0,G.useMemo)(()=>{if(!c)return 0;let w=ve(e.x,"x"),$=ve(e.y,"y");return e.data.filter((B,K)=>Number.isFinite(w(B,K))&&$(B,K)<=0).length},[c,e.data,e.x,e.y]),D=b.length,z=!i&&t.hydrated&&D>(e.canvasThreshold??1500),E=(0,G.useMemo)(()=>({x:De(b.map(w=>w.x)),y:De(b.map(w=>w.y)),s:De(b.map(w=>w.s))}),[b]),_=(0,G.useMemo)(()=>!f&&p===void 0&&x===void 0?E:{...E,x:De(p===void 0?b.map(w=>w.px):[...b.map(w=>w.px),p]),y:x===void 0?E.y:De([E.y[0],E.y[1],x])},[E,b,f,p,x]),[P,R]=E.x,[C,v]=E.y,A=Math.max(2,Math.round(o/70)),O=Za(e.xDomain),j=Za(e.yDomain),le=j&&(!c||j[0]>0)?j:void 0,re=le??(c?Et(_.y[0],_.y[1],A):je(_.y[0],_.y[1],A,{zero:e.zero??!1,pad:.08})),H=O??je(_.x[0],_.x[1],Math.max(2,Math.round(r/110)),{zero:e.zero??!1,pad:.06}),de=Math.max(Math.abs(re[0]),Math.abs(re[1])),Te=Math.max(Math.abs(H[0]),Math.abs(H[1])),Se=(0,G.useMemo)(()=>rt(e.format,t.locale,de),[e.format,t.locale,de]),ge=(0,G.useMemo)(()=>rt(e.xFormat,t.locale,Te),[e.xFormat,t.locale,Te]),Pn=i&&e.binLegend!==!1?Fn:e.yLabel?20:10,st=jt,[Ln,Vt]=e.sizeRange??(l?[4,Math.max(10,Math.min(28,r/22))]:[D>2e3?1.6:D>300?2.6:4,0]),Wt=l?Vt*.6:it,Qe=(c?xt:Ge)(re,[o-st-Wt,Pn+Wt]),Dr=Qe.ticks(A),_n=e.showYAxis!==!1,Be=_n?yt(Dr,Se,t.locale):0,et=Ge(H,[Be+6+Wt,r-8-Wt]),[yi,xi]=E.s,ki=l?ta([Math.min(0,yi),xi||1],[Ln,Vt]):()=>Ln,se=(0,G.useMemo)(()=>({x0:Be,x1:r,y0:Pn,y1:o-st}),[Be,r,Pn,o,st]),pe=(0,G.useMemo)(()=>a&&m?a.seriesHighlight(e.highlight,e.data,u,(w,$)=>m[$]):null,[a,m,e.highlight,e.data,u]),We=(0,G.useMemo)(()=>a&&pe?a.colors(n,u.length,pe):null,[a,n,u.length,pe]),Er=(0,G.useMemo)(()=>{if(i)return new Set;if(pe){let w=new Set;return b.forEach(($,B)=>{pe.has($.si)&&w.add(B)}),w}return Oe(e.highlight,b.map(w=>w.d),b.map(w=>w.label),b.map(w=>l?w.s:w.y),l?"max":"none")},[b,e.highlight,l,pe,i]),V=(0,G.useMemo)(()=>i?xc:b.map((w,$)=>({i:$,x:et(w.px),y:Qe(w.y),r:ki(w.s),vx:w.x,vy:w.y,vs:w.s,label:w.label,hi:Er.has($),datum:w.d,si:w.si})),[b,Er,r,o,H[0],H[1],re[0],re[1],Ln,Vt,i]),Q=(0,G.useMemo)(()=>i&&i.view(e,{raw:b,x:et,y:Qe,box:se,left:Be,c:t,xFmt:ge}),[i,b,se,Be,H[0],H[1],re[0],re[1],t.lang,t.locale,ge,t.fmt,e.binSize,e.colorSteps,e.binDomain?.[0],e.binDomain?.[1],e.binLegend,e.xFormat,e.format,e.unit,e.xLabel,e.yLabel]),Or=(0,G.useMemo)(()=>[...V].sort(qa),[V]),Kt=t.motion.duration??800,wi=(0,G.useMemo)(()=>{if(z)return[{key:"__p",to:[1],from:[0],data:null}];let w=r||1;return Or.map($=>({key:`b${$.i}:${$.label}`,to:[$.x,$.y,$.r],from:[$.x,$.y,0],enter:[$.x,$.y,0],delay:$.x/w*Kt*.55,data:$}))},[Or,z,r,Kt]),Tt=Aa(wi,t.motion),Dn=(0,G.useMemo)(()=>{let $=new Map;return V.forEach((B,K)=>{let L=`${Math.floor(B.x/24)},${Math.floor(B.y/24)}`,te=$.get(L);te?te.push(K):$.set(L,[K])}),{g:$,cell:24}},[V]),vi=(w,$)=>{let{g:B,cell:K}=Dn,L=Math.floor(w/K),te=Math.floor($/K),oe=-1,ee=1/0,Ce=-1,X=l?Math.ceil(Vt/K)+1:1;for(let fe=-X;fe<=X;fe++)for(let lt=-X;lt<=X;lt++){let Xr=B.get(`${L+fe},${te+lt}`);if(Xr)for(let Hn of Xr){let Qt=V[Hn],jn=Math.hypot(Qt.x-w,Qt.y-$)-Qt.r;jn<=0&&(Ce<0||qa(Qt,V[Ce])>0)&&(Ce=Hn),jn<ee&&(ee=jn,oe=Hn)}}return Ce>=0?Ce:ee<=10?oe:null},He=yc[t.lang],be=a?.text[t.lang],Ke=(0,G.useMemo)(()=>a&&T&&b.length>=2?a.linearFit(b):null,[a,T,b]),St=a&&Ke&&M?a.fitSegment(Ke,P,R,re):null,Xt=St?{x1:et(St[0]),y1:Qe(St[1]),x2:et(St[2]),y2:Qe(St[3])}:null,Ct=(0,G.useMemo)(()=>h?h.split("").map(w=>w.trim()):Ua,[h]),At=p===void 0?null:et(p),Nt=x===void 0?null:Qe(x),Ut=(0,G.useMemo)(()=>a&&Ct.length&&At!==null&&Nt!==null?a.quadrantTags(Ct,At,Nt,se):vc,[a,Ct,At,Nt,se]),Yt=a&&be&&Xt?a.fitTagSpot(Xt,be.trendTag,Ut.map(w=>w.box),se):null,En=Yt?.x,On=Yt?.y,In=Yt?.anchor,zn=be?.trendTag,qt=(0,G.useMemo)(()=>{if(!a||!T)return kc;let w=Ut.map($=>$.box);if(e.xLabel){let $=Ya(se);w.push(hr(e.xLabel,$.x,$.y,10.5,"end"))}return zn&&En!==void 0&&On!==void 0&&In&&w.push(a.tagBox(zn,En,On,In)),w},[a,T,Ut,e.xLabel,se,En,On,In,zn]),Bn=(0,G.useMemo)(()=>a&&t.showLabels&&pe?a.placeSeriesLabels(V,u,pe,{box:se,reserved:qt,grid:Dn}):wc,[a,t.showLabels,pe,V,u,Dn,qt,se]),$i=(0,G.useMemo)(()=>{let w=e.maxLabels??(m?0:6);if(!t.showLabels||D>400||w<=0)return[];let $=[...V].sort((L,te)=>Number(te.hi)-Number(L.hi)||te.r-L.r).filter(L=>L.label),B=[...V.map(L=>({x:L.x-L.r*.7,y:L.y-L.r*.7,w:L.r*1.4,h:L.r*1.4})),...qt,...Bn.map(L=>L.box)],K=[];for(let L of $){if(K.length>=w)break;let te=[{x:L.x+L.r+5,y:L.y,anchor:"start"},{x:L.x-L.r-5,y:L.y,anchor:"end"},{x:L.x,y:L.y-L.r-9,anchor:"middle"},{x:L.x,y:L.y+L.r+10,anchor:"middle"}];for(let oe of te){let ee=hr(L.label,oe.x,oe.y,11,oe.anchor,L.hi?800:500);if(!(ee.x<Be||ee.x+ee.w>r-2||ee.y<0||ee.y+ee.h>o-st)&&!B.some(Ce=>gt(Ce,ee,1))){B.push(ee),K.push({d:L,...oe});break}}}return K},[V,t.showLabels,D,e.maxLabels,m,qt,Bn,Be,r,o,st]),Ir=J(n,"accent"),zr=t.fmt,Jt=t.fv,Mi=(0,G.useMemo)(()=>Q?Q.events:kt(V.length,w=>{let $=V[w],B={datum:$.datum,index:$.i,key:`${$.i}`,label:$.label||He.nth($.i+1),value:l?$.vs:$.vy,formatted:`x ${ge($.vx)}, y ${Jt($.vy)}${l?`, ${He.sizeWord} ${zr($.vs)}`:""}`};return $.si>=0&&(B.series=u[$.si]),B}),[V,l,ge,Jt,zr,He,u,Q]),Br=Q?Q.tip(t.active):null;if(t.active!==null&&V[t.active]){let w=V[t.active],$=[{label:e.xLabel??"x",value:ge(w.vx)},{label:e.yLabel??"y",value:t.fv(w.vy)},...l?[{label:He.size,value:t.fmt(w.vs),color:w.hi?Ir.fill:n.paint("neutral")}]:[]];We&&w.si>=0&&$.unshift({label:u[w.si],value:"",color:We[w.si].fill,strong:!0}),be&&Ke&&Xt&&$.push({label:be.slope,value:`${Ke.slope>0?"+":""}${t.fv(Ke.slope)}`,strong:!1},{label:"R²",value:Ke.r2.toFixed(2),strong:!1}),Br={x:w.x,y:w.y-w.r,title:w.label||He.nth(w.i+1),rows:$}}let Ti=z?Tt.get("__p")?.[0]??1:1,Hr=n.theme.neutralStrong,jr=n.theme.accent,Gr=(0,G.useMemo)(()=>{if(a&&We&&pe)return a.canvasGroups(V,We,pe);let w=[],$=[];return V.forEach((B,K)=>(B.hi?$:w).push(K)),[{ks:w,isHi:!1,fill:B=>B("--ztd-neutral-strong",Hr)},{ks:$,isHi:!0,fill:B=>B("--ztd-accent",jr)}]},[a,V,We,pe,Hr,jr]),Si=(0,G.useCallback)((w,$,B)=>{let K=r||1;for(let L of Gr){w.globalAlpha=L.isHi?1:.55,w.fillStyle=L.fill(B);for(let te of L.ks){let oe=V[te],ee=L.isHi?Math.min(1,$*1.2):Math.max(0,Math.min(1,($*1.4-oe.x/K*.4)*2.5));ee<=0||(w.beginPath(),w.arc(oe.x,oe.y,oe.r*ee,0,Math.PI*2),w.fill())}}w.globalAlpha=1},[Gr,V,r]),Ci=Q?w=>{let $=Q.step(a?a.arrowStep(w.key):null,t.active);return $!==null&&$>=0&&t.setActive($,"keyboard"),$!==null}:a?w=>{let $=a.arrowStep(w.key);if(!$||!V.length)return!1;let B=t.active!==null&&V[t.active]?t.active:null,K=B===null?a.entryPoint(V,$):a.nearestInDirection(V,B,$);return K!==null&&t.setActive(K,"keyboard"),!0}:void 0,Ai=et.ticks(Math.max(2,Math.round(r/110))),Vr=Ya(se),Ni=He.desc(l,D,[ge(P),ge(R),Se(C),Se(v)]),Fi=(0,G.useMemo)(()=>{if(!a||!be||!T)return"";let w=[...p===void 0?[]:[`x ${ge(p)}`],...x===void 0?[]:[`y ${Jt(x)}`]];return a.describe(be,{points:b,seriesNames:u,fit:Ke,xName:e.xLabel??"x",yName:e.yLabel??"y",refs:w,refX:p,refY:x,quadrants:Ct})},[a,be,T,p,x,ge,Jt,b,u,Ke,e.xLabel,e.yLabel,Ct]),Zt=(0,G.useMemo)(()=>a&&be&&(O||le)&&a.noneInside(b,H,re)?be.outOfRange:"",[a,be,b,H[0],H[1],re[0],re[1],O,le]),Ri=e.description??(Zt||Ni+(Q?Q.desc:"")+Fi+(N?He.logDropped(N):"")),Wr=Q?Q.yTitle:e.yLabel,Kr=a&&(At!==null||Nt!==null)?(0,ie.jsx)(a.RefLines,{p:n,x:At,y:Nt,box:se}):null;return(0,ie.jsxs)(Fo,{c:t,kind:l?He.bubble:He.scatter,ariaLabel:e.ariaLabel,description:Ri,emptyText:Zt||void 0,events:Mi,tip:Br,renderTip:e.tooltip,className:e.className,style:e.style,theme:e.theme,onPointerMove:(w,$,B)=>{let K=Q?Q.at(w,$):vi(w,$);K!==t.active&&t.setActive(K,B.pointerType==="touch"?"touch":"pointer")},onKey:Ci,announce:Q&&t.via==="keyboard"?Q.say(t.active):void 0,underlay:z?(0,ie.jsx)(Pa,{width:r,height:o,draw:Si,progress:Ti,version:t.sig}):void 0,children:[Wr&&_n?(0,ie.jsx)(ce,{x:Be,y:6,size:10.5,fill:n.paint("muted"),children:Wr}):null,(0,ie.jsx)(Qo,{p:n,ticks:Dr,y:Qe,x0:Be,x1:r,fmt:Se,locale:t.locale,zero:!1,labels:_n}),(0,ie.jsxs)("g",{"aria-hidden":"true",children:[(e.showXAxis===!1?[]:Ai).map(w=>(0,ie.jsx)(ce,{x:et(w),y:o-st+13,anchor:"middle",size:bt,fill:n.paint("muted"),children:ge(w)},w)),e.xLabel?(0,ie.jsx)(ce,{x:Vr.x,y:Vr.y,anchor:"end",size:10.5,fill:n.paint("muted"),children:e.xLabel}):null]}),Q?null:Kr,i&&Q?(0,ie.jsx)(i.Layer,{p:n,v:Q,box:se,active:t.active,c:t,m:Tt,onPick:t.click}):null,Q?Kr:null,z?t.active!==null&&V[t.active]?(0,ie.jsx)("circle",{cx:V[t.active].x,cy:V[t.active].y,r:V[t.active].r+2,fill:"none",stroke:n.paint("ink"),strokeWidth:1.6,pointerEvents:"none"}):null:Tt.items.map(w=>{let $=w.data;if(!$)return null;let[B,K,L]=w.v,te=t.active===$.i,oe=We&&$.si>=0?We[$.si]:void 0,ee=oe?oe.fill:$.hi?Ir.fill:n.paint(l?"neutral":"neutralStrong");return(0,ie.jsx)("circle",{className:"ztd-mark",cx:B,cy:K,r:Math.max(0,L),fill:ee,fillOpacity:$.hi?.92:l?.85:.7,stroke:te?n.paint("ink"):n.paint("panel"),strokeWidth:te?2:l?1.2:.6,opacity:w.exiting?.3:t.active===null||te?1:.55,onPointerEnter:Ce=>t.setActive($.i,Ce.pointerType==="touch"?"touch":"pointer"),onClick:()=>t.click($.i)},w.key)}),a&&be?(0,ie.jsx)(a.Overlay,{p:n,fade:Tt.fade(Kt*.6,300),trendTag:be.trendTag,fitLine:Xt,fitTag:Yt,quads:Ut,seriesLabels:Bn,seriesNames:u,colors:We,hiSeries:pe}):null,$i.map(w=>(0,ie.jsx)(ce,{x:w.x,y:w.y,anchor:w.anchor,size:11,weight:w.d.hi?800:500,fill:n.paint(w.d.hi?"ink":"muted"),opacity:Tt.fade(Kt*.6,300),children:w.d.label},w.d.i)),Zt?(0,ie.jsx)(ce,{x:(se.x0+se.x1)/2,y:(se.y0+se.y1)/2,anchor:"middle",size:12,fill:n.paint("muted"),children:Zt}):null]})}var Mc=S(U(),1);var Lr=S(I(),1),Tc={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}, ${Ae(n,"candle")}. First open ${r}, last close ${o}`,ma:e=>`MA${e}`,up:"Up",down:"Down",maLegend:e=>`${e}-day MA`},Qa={en:Tc,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}일 이동평균`}},Pr=["ink","muted","dim"];function ei(e,t){return(e??[]).filter(n=>n>=2&&n<t).slice(0,Pr.length)}var Sc=S(U(),1);var ai=S(I(),1),Cc={pie:"Pie chart",donut:"Donut chart",share:"Share",desc:(e,t,n)=>`${Ae(e,"item")}, total ${t}. ${n}.`,other:e=>`Other (${e})`},Ac={en:Cc,ko:{pie:"파이 차트",donut:"도넛 차트",share:"비중",desc:(e,t,n)=>`${e}개 항목, 합계 ${t}. ${n}.`,other:e=>`기타 ${e}개`}},ti=(e,t)=>Ac[e].other(t);function ni(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,Wo(o.map(a=>a.value)))}}var ri=e=>Number.isFinite(e)&&e>0?e:0;function oi(e,t,n,r){return r==="emphasis"?fo(e,t,n):Le(e,t,n)}var Nc=S(U(),1);var ci=S(I(),1);function ii(e,t){return t===!1?e.map((n,r)=>r):Vo(e)}function si(e,t,n){let r=n.map(o=>o.reduce((a,i)=>a+(Number.isFinite(i)?i:0),0));return Oe(e,t,t,r,"max")}function li(e,t,n){let r=new Array(t.length),o=t.filter(a=>!n.has(a));for(let a of t)n.has(a)&&(r[a]=J(e,"accent"));return o.forEach((a,i)=>r[a]=o.length===1?J(e,"neutral"):sn(e,1-i/Math.max(1,o.length-1))),r}function ui(e){return!e||typeof e!="object"||Array.isArray(e)?[]:$e(Object.values(e).filter(t=>typeof t=="string"&&t!==""))}function mi(e,t){return tt(e,t+1,new Set)}var Fc=S(U(),1);var fi=S(I(),1);var Rc=26;var Jd=Rc*.62;function di(e,t){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],r=new Set;for(let o of n)typeof o=="string"&&!ma.includes(o)&&t.forEach((a,i)=>a===o&&r.add(i));return r}var Ve=S(I(),1);function hi(e,t,n){let r=kn(e);return r?.type==="scatter"&&t?.size!==void 0&&!xn(n)?kn("bubble"):r}function Pc(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 Lc(e,t,n,r=!1){let o=hi(e.type,e.encoding,e.options);if(!o||!t.length)return[];let a=e.encoding??{},i=e.options??{},s=i.highlight,l=new Set(!r&&ur.includes(o.type)&&Array.isArray(i.hidden)?i.hidden.map(String):[]),c=u=>u.filter(d=>!l.has(d.label)),m=["pie","donut","waffle"];if(o.type==="donut"&&i.legend!=="none")return[];if(m.includes(o.type)){let u=Fe(a.label,"label"),d=ve(a.value,"value"),h=o.type==="waffle",f=t.map((b,N)=>({r:b,label:u(b,N),value:h?d(b,N):ri(d(b,N))})),{kept:y,other:p}=h?{kept:f,other:null}:ni(f,i.other,(b,N)=>({r:{},label:ti(Y(n),b),value:N})),g=Oe(s,y.map(b=>b.r),y.map(b=>b.label),y.map(b=>b.value),h?"first":"max"),x=p?[...y,p]:y,M=Ye(b=>h?Le(b,x.length,g):oi(b,x.length,g,i.colorMode)),T=h&&i.shape==="arc";return x.map((b,N)=>({label:b.label,color:M[N],...T&&{shape:"circle"}}))}if(o.type==="candlestick"){let u=ei(Array.isArray(i.ma)?i.ma:void 0,t.length),d=Qa[Y(n)];return[{label:d.up,color:i.upColor??"accent"},{label:d.down,color:i.downColor??"neutralStrong"},...u.map((h,f)=>({label:d.maLegend(h),color:Pr[f],shape:"line"}))]}if(o.type==="network"){let u=ui(i.groups);if(u.length<2)return[];let d=Ye(h=>mi(h,u.length));return u.map((h,f)=>({label:h,color:d[f],shape:"circle"}))}if(o.type==="symbolMap"){if(typeof a.group!="string")return[];let u=Fe(a.group,"group"),d=$e(t.map((f,y)=>u(f,y)).filter(Boolean));if(d.length<2)return[];let h=Ye(f=>tt(f,d.length,new Set));return d.map((f,y)=>({label:f,color:h[y],shape:"circle"}))}if(o.type==="scatter"){if(typeof a.series!="string"||xn(i))return[];let u=Fe(a.series,"series"),d=$e(t.map((y,p)=>u(y,p)));if(d.length<2)return[];let h=Fr(s,t,d,u),f=Ye(y=>tt(y,d.length,h));return c(d.map((y,p)=>({label:y,color:f[p],shape:"circle"})))}if(o.type==="timeline"){let u=typeof a.group!="string",d=u?a.status:a.group;if(typeof d!="string")return[];let h=wa(t,d,u),f=Ye(y=>Le(y,h.length,di(s,h)));return c(h.map((y,p)=>({label:y,color:f[p],shape:"square"})))}if(["marimekko","area","bar","line","stream","radar"].includes(o.type)){let u=[];if(Array.isArray(a.y))u=a.y;else if(typeof a.series=="string"){let M=Fe(a.series,"series");u=$e(t.map((T,b)=>M(T,b)))}let d=mr(o.type,a,i);if(d.length){let M=Oe(s,u,u,u.map(()=>0),"none"),T=Ye(N=>Le(N,u.length,M)),b=u.length<2?[{label:String((Array.isArray(a.y)?a.y[0]:a.y)??"y"),color:"neutral"}]:u.map((N,D)=>({label:N,color:T[D]}));return[...c(b),...d.map((N,D)=>({label:N,color:Ra(D),shape:"line"}))]}if(u.length<2)return[];let f=o.type==="bar"&&i.layout==="diverging"&&s===void 0?Go(u.length,Array.isArray(i.negative)?i.negative.map(M=>u.indexOf(String(M))):[],typeof i.neutral=="string"?u.indexOf(i.neutral):-1):-1,y=f>=0?new Set([f]):Oe(s,u,u,u.map(()=>0),"first");if(o.type==="radar")return c(u.map((M,T)=>({label:M,color:y.has(T)?"accent":"neutralStrong",shape:"square"})));let p=i.colorMode,g=M=>Le(M,u.length,y);if((o.type==="line"||o.type==="area")&&(g=M=>Fa(M,u.length,y,o.type==="area",p)),o.type==="stream"){let M=Ot(t,a.x,a.y,a.series,{xType:i.xType,locale:n,aggregate:i.aggregate,dayFirst:i.dayFirst}),T=ii(M.values,i.reorder),b=si(s,M.series,M.values);g=N=>li(N,T,b)}let x=Ye(g);return c(u.map((M,T)=>({label:M,color:x[T],...o.type==="line"&&{shape:"line"}})))}return[]}function _c(e,t){let n=e.facet;return n&&typeof n=="object"&&typeof n.by=="string"&&Do.includes(t)&&!(t==="bar"&&e.options?.layout==="diverging")?n:void 0}function Dc(e,t,n){let{data:r,width:o,height:a,highlight:i,syncId:s,ariaLabel:l,description:c,...m}=n;return{type:e,data:r??[],by:t.by,columns:t.columns,scale:t.scale,chartProps:m,width:o,height:a,highlight:i,syncId:s,title:l,description:c}}function gi(e,t){let{spec:n}=e,r=hi(n.type,n.encoding,n.options),o=(0,Gt.useMemo)(()=>va(n.data),[n.data]),a=!o&&n.data&&typeof n.data=="object"&&"url"in n.data?n.data:null,i=_o(n,e.locale),s=ke(i),l=Y(s),c=da(a?.url??null,{parse:a?.format??"auto",select:a?.select,init:e.fetchInit,locale:s}),m=Io(n),u=(0,Gt.useMemo)(()=>m?xa(m,s):void 0,[m,s]),d=n.options?.hidden,h=Array.isArray(d)?d.map(String):[],f=h.join(""),[y,p]=(0,Gt.useState)(null);if(!r)return(0,Ve.jsx)(cr,{error:l==="ko"?`알 수 없는 차트 종류: ${n.type}`:`Unknown chart type: ${n.type}`,height:e.height??200,locale:i});let g=o??c.data,x=t[r.type],M={...n.options??{}},T={...Pc(r,n.encoding),...M,...u?{tooltip:u}:{},data:g,...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},b=n.card?.legend==="toggle"&&Oo(r.type,n.encoding??{},M),N=y&&y.base===f?y.hidden:h;b&&(T.hidden=N);let D=R=>p(C=>{let v=C&&C.base===f?C.hidden:h;return{base:f,hidden:v.includes(R)?v.filter(A=>A!==R):[...v,R]}}),z=T.height??220,E=_c(n,r.type),_=a&&!g.length&&(c.loading||c.error||c.empty)?(0,Ve.jsx)(cr,{loading:c.loading,error:c.error,empty:c.empty,onRetry:c.reload,height:z,locale:i}):E?(0,Ve.jsx)(ua,{chart:x,...Dc(r.type,E,T)}):(0,Ve.jsx)(x,{...T});if(n.card){let R=n.card,C=R.legend==="auto"||R.legend==="toggle"?Lc(n,g,s,b):R.legend,v=C?.length?b?(0,Ve.jsx)(lr,{items:C,hidden:N,onToggle:D,locale:i}):C:void 0,A=R.download?(0,Ve.jsx)(ya,{data:g,columns:zo(n),filename:R.title??r.type,formats:Array.isArray(R.download)?R.download:void 0,locale:i}):void 0;_=(0,Ve.jsx)(No,{number:R.number,title:R.title??Lo(r,l),subtitle:R.subtitle,legend:v,actions:A,source:R.source||void 0,note:R.note||void 0,accent:R.accent,takeaway:R.takeaway,level:R.level,sample:R.sample,replay:R.replay!==!1,className:e.className,locale:i,children:_})}let P=e.theme??n.theme;return P&&(_=(0,Ve.jsx)(hn,{theme:P,children:_})),_}function Ec({cfg:e,components:t}){let n=wt();return gi({spec:e.spec,height:e.height,locale:e.locale,width:n?void 0:e.width,animate:n?void 0:!1},t)}function bi(e,t){let n=document.getElementById("ztd-chart-config")?.textContent,r=document.getElementById("chart");if(!n||!r)return;let o=JSON.parse(n);(0,pi.hydrateRoot)(r,(0,_r.createElement)(hn,{theme:o.theme,cssVars:!0},(0,_r.createElement)(Ec,{cfg:o,components:{[e]:t}})))}bi("scatter",Rr);})();