@asymmetric-effort/specifyjs 0.2.100 → 0.2.103

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 (51) hide show
  1. package/dist/esm/chunks/chunk-3J4RXW7E.js +3 -0
  2. package/dist/esm/chunks/chunk-3J4RXW7E.js.map +7 -0
  3. package/dist/esm/chunks/chunk-3SXNLMCH.js +3 -0
  4. package/dist/esm/chunks/chunk-3SXNLMCH.js.map +7 -0
  5. package/dist/esm/chunks/chunk-A7AAS5ZR.js +3 -0
  6. package/dist/esm/chunks/chunk-A7AAS5ZR.js.map +7 -0
  7. package/dist/esm/chunks/chunk-E43OK6IZ.js +3 -0
  8. package/dist/esm/chunks/chunk-E43OK6IZ.js.map +7 -0
  9. package/dist/esm/chunks/chunk-LWOMFZ4C.js +3 -0
  10. package/dist/esm/chunks/chunk-LWOMFZ4C.js.map +7 -0
  11. package/dist/esm/chunks/chunk-MCXU6QF3.js +3 -0
  12. package/dist/esm/chunks/chunk-MCXU6QF3.js.map +7 -0
  13. package/dist/esm/chunks/chunk-ODCBJ22O.js +3 -0
  14. package/dist/esm/chunks/chunk-ODCBJ22O.js.map +7 -0
  15. package/dist/esm/chunks/chunk-TVDAY42P.js +3 -0
  16. package/dist/esm/chunks/chunk-TVDAY42P.js.map +7 -0
  17. package/dist/esm/chunks/chunk-VAF4KNDP.js +3 -0
  18. package/dist/esm/chunks/chunk-VAF4KNDP.js.map +7 -0
  19. package/dist/esm/chunks/chunk-ZDPD2MPQ.js +3 -0
  20. package/dist/esm/chunks/chunk-ZDPD2MPQ.js.map +7 -0
  21. package/dist/esm/chunks/metrics-56RIK7JQ.js +3 -0
  22. package/dist/esm/chunks/metrics-56RIK7JQ.js.map +7 -0
  23. package/dist/esm/client/index.js +3 -0
  24. package/dist/esm/components-barrel.js +9 -0
  25. package/dist/esm/dom/index.js +3 -0
  26. package/dist/esm/index.js +3 -0
  27. package/dist/esm/jsx-dev-runtime.js +3 -0
  28. package/dist/esm/jsx-runtime.js +3 -0
  29. package/dist/esm/server/index.js +3 -0
  30. package/dist/esm/telemetry/index.js +3 -0
  31. package/dist/specifyjs-client.esm.js +2 -2
  32. package/dist/specifyjs-client.esm.js.map +4 -4
  33. package/dist/specifyjs-components.cjs.js +1 -1
  34. package/dist/specifyjs-components.cjs.js.map +2 -2
  35. package/dist/specifyjs-components.esm.js +4 -4
  36. package/dist/specifyjs-components.esm.js.map +4 -4
  37. package/dist/specifyjs-dom.esm.js +2 -2
  38. package/dist/specifyjs-dom.esm.js.map +4 -4
  39. package/dist/specifyjs-jsx-dev-runtime.esm.js +2 -2
  40. package/dist/specifyjs-jsx-dev-runtime.esm.js.map +4 -4
  41. package/dist/specifyjs-jsx-runtime.esm.js +2 -2
  42. package/dist/specifyjs-jsx-runtime.esm.js.map +4 -4
  43. package/dist/specifyjs-server.esm.js +2 -2
  44. package/dist/specifyjs-server.esm.js.map +4 -4
  45. package/dist/specifyjs-telemetry.esm.js +2 -2
  46. package/dist/specifyjs-telemetry.esm.js.map +4 -4
  47. package/dist/specifyjs.esm.js +2 -2
  48. package/dist/specifyjs.esm.js.map +4 -4
  49. package/dist/types/components/viz/3d-force-graph/src/ForceGraph3D.d.ts +123 -0
  50. package/dist/types/components/viz/3d-force-graph/src/index.d.ts +2 -0
  51. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
+ import{a as Ut}from"./chunks/chunk-A7AAS5ZR.js";import"./chunks/chunk-VAF4KNDP.js";import"./chunks/chunk-E43OK6IZ.js";import{a as o}from"./chunks/chunk-ODCBJ22O.js";import"./chunks/chunk-3J4RXW7E.js";import"./chunks/chunk-TVDAY42P.js";import{c as X,d as se,e as jt,g as $,h as q,i as ie,m as fe}from"./chunks/chunk-MCXU6QF3.js";import{a as Ie}from"./chunks/chunk-ZDPD2MPQ.js";function Xt(e){if(!e)return new Date;let n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),r=i=>Number(n.find(s=>s.type===i)?.value??0);return new Date(r("year"),r("month")-1,r("day"),r("hour"),r("minute"),r("second"))}function Ro(e,t){let n=e.getFullYear(),r=e.getMonth(),i=e.getDate();switch(t){case"short":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${s}/${a}/${n}`}case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][r]} ${String(i).padStart(2,"0")}, ${n}`;case"iso":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${n}-${s}-${a}`}}}var Re={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function Eo(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=X(Xt(a));se(()=>{let R=setInterval(()=>{u(Xt(a))},1e3);return()=>clearInterval(R)},[a]);let h=d.getHours(),g=d.getMinutes(),c=d.getSeconds(),x=h%12*30+g*.5,p=g*6+c*.1,y=c*6,m=n/2,f=n/2,b=n/2-10,S=b-4,z=b-22,k=[];k.push(o("circle",{cx:String(m),cy:String(f),r:String(b),fill:Re.face,stroke:Re.border,"stroke-width":"3"}));for(let R=0;R<12;R++){let F=(R*30-90)*Math.PI/180,A=S-6;k.push(o("line",{x1:String(m+A*Math.cos(F)),y1:String(f+A*Math.sin(F)),x2:String(m+S*Math.cos(F)),y2:String(f+S*Math.sin(F)),stroke:Re.border,"stroke-width":"2"}));let H=String(R===0?12:R);if(k.push(o("text",{x:String(m+z*Math.cos(F)),y:String(f+z*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:Re.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},H)),t==="24h"){let L=b-38,P=String(R===0?0:R+12);k.push(o("text",{x:String(m+L*Math.cos(F)),y:String(f+L*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:Re.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},P))}}let w=(R,M,F,A)=>{let H=(R-90)*Math.PI/180;return o("line",{x1:String(m),y1:String(f),x2:String(m+M*Math.cos(H)),y2:String(f+M*Math.sin(H)),stroke:A,"stroke-width":F,"stroke-linecap":"round"})};k.push(w(x,b*.5,"4",Re.hand)),k.push(w(p,b*.75,"3",Re.hand)),s&&k.push(w(y,b*.85,"1.5",Re.second)),k.push(o("circle",{cx:String(m),cy:String(f),r:"4",fill:Re.hand}));let C=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...k)];return r&&C.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Re.numbers}},Ro(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...C)}var ht={xs:24,sm:32,md:40,lg:56,xl:80};function Io(e){return e==null?ht.md:typeof e=="number"?e:ht[e]??ht.md}function Po(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var qt=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function To(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return qt[Math.abs(t)%qt.length]}var Kt={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function Do(e,t){let n=`${-t/4}px`;switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};case"top-right":default:return{top:n,right:n}}}function Ao(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,h]=X(!1),g=Io(i),c=s==="circle"?"50%":`${Math.round(g*.15)}px`,x=a??To(r),p=`${Math.round(g*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${g}px`,height:`${g}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},m;if(t&&!u)m=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let z=Po(r);m=o("span",{style:{fontSize:p,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},z)}let f=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":x},role:"img","aria-label":n??r??"avatar"},m);if(!l)return f;let b=Math.max(8,Math.round(g*.25)),S={position:"absolute",width:`${b}px`,height:`${b}px`,borderRadius:"50%",backgroundColor:Kt[l]??Kt.offline,border:"2px solid #fff",boxSizing:"border-box",...Do(d,b)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${g}px`,height:`${g}px`,flexShrink:"0"}},f,o("span",{style:S,"aria-label":l}))}var Lo={sm:{minWidth:"16px",height:"16px",fontSize:"10px",padding:"0 4px"},md:{minWidth:"20px",height:"20px",fontSize:"12px",padding:"0 6px"},lg:{minWidth:"24px",height:"24px",fontSize:"14px",padding:"0 8px"}},Wo={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function Fo(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,h=r?{...Wo[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...Lo[s],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",...a==="solid"?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},g=u?o("span",{style:h,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return g??o("span",null);let c={...h,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var No={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},Zt={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},bt={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},Bo="6px 8px",Ho={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},Oo={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},_o={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},Ae={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Vo={...Ae,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},Jt={...Ae,opacity:"0.5",cursor:"default"},Qt={cursor:"pointer",width:"16px",height:"16px"};function Yo(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function Go(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:g,striped:c=!1,bordered:x=!1,compact:p=!1,stickyHeader:y=!1}=e,[m,f]=X(0),[b,S]=X(void 0),[z,k]=X("asc"),[w,I]=X([]),[C,R]=X({}),M=i??m,F=a??b,A=l??z,H=h??w,L=q(()=>{let j=Object.entries(C).filter(([,te])=>te.length>0);return j.length===0?n:n.filter(te=>j.every(([re,ae])=>String(te[re]??"").toLowerCase().includes(ae.toLowerCase())))},[n,C]),P=q(()=>{if(!F)return L;let j=[...L];return j.sort((te,re)=>{let ae=te[F],ne=re[F];if(ae==null&&ne==null)return 0;if(ae==null)return 1;if(ne==null)return-1;if(typeof ae=="number"&&typeof ne=="number")return A==="asc"?ae-ne:ne-ae;let ce=String(ae),de=String(ne),le=ce.localeCompare(de);return A==="asc"?le:-le}),j},[L,F,A]),v=P.length,D=r?Math.max(1,Math.ceil(v/r)):1,E=r?P.slice(M*r,(M+1)*r):P,W=$(j=>{s?s(j):f(j)},[s]),T=$(j=>{let te=F===j&&A==="asc"?"desc":"asc";d?d(j,te):(S(j),k(te))},[F,A,d]),N=$(j=>{let te=H.includes(j)?H.filter(re=>re!==j):[...H,j];g?g(te):I(te)},[H,g]),B=$(()=>{let j=E.map((ae,ne)=>r?M*r+ne:ne),re=j.every(ae=>H.includes(ae))?H.filter(ae=>!j.includes(ae)):[...new Set([...H,...j])];g?g(re):I(re)},[E,H,r,M,g]),V=$((j,te)=>{R(re=>({...re,[j]:te})),W(0)},[W]),G=t.some(j=>j.filterable),K=p?Bo:bt.padding,ee=[];if(u){let j=E.map((re,ae)=>r?M*r+ae:ae),te=j.length>0&&j.every(re=>H.includes(re));ee.push(o("th",{key:"__select_all",style:{...Zt,padding:K,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:te,onChange:B,style:Qt,"aria-label":"Select all rows"})))}for(let j of t){let te={...Zt,padding:K,...j.width?{width:j.width}:{},...j.sortable?{cursor:"pointer"}:{},...x?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},re=[j.header];j.sortable&&re.push(o("span",{style:Ho},Yo(j.key,F,A))),ee.push(o("th",{key:j.key,style:te,onClick:j.sortable?()=>T(j.key):void 0,onKeyDown:j.sortable?ae=>{let ne=ae.key;(ne==="Enter"||ne===" ")&&(ae.preventDefault(),T(j.key))}:void 0,tabIndex:j.sortable?0:void 0,role:j.sortable?"columnheader":void 0,"aria-sort":F===j.key?A==="asc"?"ascending":"descending":void 0},...re))}let J=null;if(G){let j=[];u&&j.push(o("th",{key:"__filter_spacer",style:{padding:K}}));for(let te of t)j.push(o("th",{key:`filter_${te.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},te.filterable?o("input",{type:"text",placeholder:`Filter ${te.header}...`,style:Oo,value:C[te.key]??"",onInput:re=>V(te.key,re.target.value),"aria-label":`Filter by ${te.header}`}):null));J=o("tr",{key:"__filter_row"},...j)}let Y=[];for(let j=0;j<E.length;j++){let te=E[j],re=r?M*r+j:j,ae=H.includes(re),ne={};c&&j%2===1&&(ne.backgroundColor="#f9fafb"),ae&&(ne.backgroundColor="#eff6ff");let ce=[];u&&ce.push(o("td",{key:"__select",style:{padding:K,textAlign:"center",...bt,...x?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:ae,onChange:()=>N(re),style:Qt,"aria-label":`Select row ${re+1}`})));for(let de of t){let le=te[de.key],ue=de.render?de.render(le,te):String(le??"");ce.push(o("td",{key:de.key,style:{...bt,padding:K,...x?{border:"1px solid #e5e7eb"}:{}}},ue))}Y.push(o("tr",{key:String(re),style:ne},...ce))}let U=null;if(r){let j=v===0?0:M*r+1,te=Math.min((M+1)*r,v),re=[];re.push(o("button",{key:"prev",style:M===0?Jt:Ae,onClick:M>0?()=>W(M-1):void 0,disabled:M===0,"aria-label":"Previous page"},"\u2190 Prev"));let ae=7,ne=Math.max(0,M-Math.floor(ae/2)),ce=Math.min(D,ne+ae);ce-ne<ae&&(ne=Math.max(0,ce-ae)),ne>0&&(re.push(o("button",{key:"p0",style:Ae,onClick:()=>W(0)},"1")),ne>1&&re.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let de=ne;de<ce;de++)re.push(o("button",{key:`p${de}`,style:de===M?Vo:Ae,onClick:de!==M?()=>W(de):void 0,"aria-current":de===M?"page":void 0},String(de+1)));ce<D&&(ce<D-1&&re.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),re.push(o("button",{key:`p${D-1}`,style:Ae,onClick:()=>W(D-1)},String(D)))),re.push(o("button",{key:"next",style:M>=D-1?Jt:Ae,onClick:M<D-1?()=>W(M+1):void 0,disabled:M>=D-1,"aria-label":"Next page"},"Next \u2192")),U=o("div",{style:_o},o("span",null,`Showing ${j}\u2013${te} of ${v}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...re))}let _={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},O={...No,...x?{border:"1px solid #e5e7eb"}:{}},Z=o("thead",null,o("tr",null,...ee),J),Q=o("tbody",null,...Y),oe=o("table",{style:O,role:"grid","aria-rowcount":String(v)},Z,Q);return o("div",{style:_},oe,U)}function Le(e){return e<10?`0${e}`:String(e)}function Uo(e,t){if(t){let r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),i=s=>Number(r.find(a=>a.type===s)?.value??0);return{hours:i("hour"),minutes:i("minute"),seconds:i("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function jo(e,t,n){if(n){let r={timeZone:n};if(t==="short")return Object.assign(r,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);if(t==="long")return Object.assign(r,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);Object.assign(r,{year:"numeric",month:"2-digit",day:"2-digit"});let i=new Intl.DateTimeFormat("en-CA",r).formatToParts(e),s=a=>i.find(l=>l.type===a)?.value??"";return`${s("year")}-${s("month")}-${s("day")}`}return t==="short"?`${Le(e.getMonth()+1)}/${Le(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Le(e.getMonth()+1)}-${Le(e.getDate())}`}var Xo={fontFamily:'"SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace',backgroundColor:"#1e293b",color:"#e2e8f0",padding:"16px 24px",borderRadius:"8px",display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},qo={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ko={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Zo={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function Jo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=X(new Date);se(()=>{let f=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(f)},[]);let{hours:u,minutes:h,seconds:g}=Uo(l,s),c,x=null;t==="12h"?(x=u>=12?"PM":"AM",c=u%12||12):c=u;let p=`${Le(c)}:${Le(h)}`;i&&(p+=`:${Le(g)}`);let y=[p];x!=null&&y.push(o("span",{style:Ko},x));let m=[o("span",{style:qo},...y)];return n&&m.push(o("span",{style:Zo},jo(l,r,s))),o("div",{style:Xo,...a?{class:a}:{}},...m)}var Qo={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},er={padding:"10px 14px",color:"var(--color-text, #1f2937)"},tr={borderBottom:"1px solid var(--color-border, #e5e7eb)"},nr={cursor:"pointer",transition:"background-color 0.15s ease"},or={backgroundColor:"var(--color-bg-muted, #eff6ff)"},rr={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},qe={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function ir(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:h}=e;if(t.length===0)return o("div",null,u?o("div",{style:qe},u):null,o("div",{style:rr},d),h?o("div",{style:{...qe,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let g=[];for(let c=0;c<t.length;c++){let x=t[c],p=r(x,c),y=a===c,m=c===t.length-1,f={...er,...s?nr:{},...y?or:{},...i&&!m?tr:{}};g.push(o("li",{key:p,style:f,onClick:l?()=>l(c):void 0,onKeyDown:l?b=>{let S=b.key;(S==="Enter"||S===" ")&&(b.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(x,c)))}return o("div",null,u?o("div",{style:qe},u):null,o("ul",{style:Qo,role:l?"listbox":"list"},...g),h?o("div",{style:{...qe,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function sr(e){return e??"#3b82f6"}function lr(e,t){let r={red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return i?`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${t})`:e}var ar={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}};function cr(e,t,n,r,i){let s=ar[n],a={display:"inline-flex",alignItems:"center",gap:s.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:s.fontSize,fontWeight:"500",padding:s.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...r?{cursor:"pointer"}:{},...i?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...a,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...a,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...a,backgroundColor:lr(e,.12),color:e,border:"none"};default:return a}}var dr={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"};function ur(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,h=sr(n),g=cr(h,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:dr,onClick:x=>{x.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:g,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?x=>{let p=x.key;(p==="Enter"||p===" ")&&(x.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var fr={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function gr(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=X(0),d=ie(null),u=t.length*r,h=parseInt(s,10)||400,g=Math.ceil(h/r),c=Math.max(0,Math.floor(a/r)-i),x=Math.min(t.length,Math.floor(a/r)+g+i),p=$(m=>{let f=m.target;l(f.scrollTop)},[]),y=[];for(let m=c;m<x;m++)y.push(o("div",{key:String(m),style:{position:"absolute",top:`${m*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[m],m)));return o("div",{ref:d,style:{...fr,height:s},onScroll:p},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var en={info:{icon:"\u2139\uFE0F",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"\u2705",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"\u26A0\uFE0F",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"\u274C",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function pr(e){let[t,n]=X(!0),r=e.type??"info",i=e.variant??"subtle",s=en[r]??en.info,a=e.icon??s.icon,l=e.message??e.children,d=q(()=>{let u={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(u.backgroundColor=s.filledBg,u.color=s.filledText):i==="outline"?(u.backgroundColor="transparent",u.border=`1px solid ${s.border}`,u.color=s.text):(u.backgroundColor=s.bg,u.color=s.text),u},[i,s]);return t?o("div",{role:"alert",style:d},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},a),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:l?"4px":"0"}},e.title):null,l?o("div",null,l):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:i==="filled"?"1px solid currentColor":`1px solid ${s.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"\xD7"):null):null}function mr(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)}function hr(e){let t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",s=e.backgroundColor??"#e5e7eb",a=e.height??(typeof e.size=="string"?e.size:typeof e.size=="number"?`${e.size}px`:"8px"),l=e.variant??"bar",d=fe().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let x=typeof e.size=="number"?e.size:48,p=Math.max(2,Math.round(x/10)),y=(x-p)/2,m=2*Math.PI*y,f=e.indeterminate?m*.75:m-r/100*m,b=e.indeterminate?`@keyframes liq-spin-${d}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${d}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},b?o("style",null,b):null,o("svg",{width:String(x),height:String(x),viewBox:`0 0 ${x} ${x}`,style:e.indeterminate?{animation:`liq-spin-${d} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${d} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(x/2),cy:String(x/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(p)}),o("circle",{cx:String(x/2),cy:String(x/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(p),"stroke-dasharray":String(m),"stroke-dashoffset":String(f),"stroke-linecap":"round",transform:`rotate(-90 ${x/2} ${x/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",h=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",g={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=q(()=>{let x={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(x.position="absolute",x.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,x.backgroundColor=i):(x.width=`${r}%`,x.backgroundColor=i),e.animated&&!e.indeterminate&&(x.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${br(i)} 50%, ${i} 100%)`,x.backgroundSize="200% 100%",x.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),x},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||h?o("style",null,u+h):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:g},o("div",{style:c})))}function br(e){let t=e.replace("#","");if(t.length!==6)return e;let n=Math.min(255,parseInt(t.slice(0,2),16)+40),r=Math.min(255,parseInt(t.slice(2,4),16)+40),i=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function xr(e){let t=e.variant??"text",n=e.animated!==!1,r=fe().replace(/[^a-zA-Z0-9_-]/g,""),i=q(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),s=typeof e.width=="number"?`${e.width}px`:e.width,a=typeof e.height=="number"?`${e.height}px`:e.height;if(t==="text"){let l=e.lines??1,d=[];for(let u=0;u<l;u++){let h=u===l-1&&l>1;d.push(o("div",{key:String(u),style:xt({width:h?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:xt({width:l,height:l,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:xt({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function xt(e){let t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}var yr={sm:16,md:24,lg:40},tn={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Sr(e){let t=typeof e.size=="number"?e.size:yr[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=tn[e.speed??"normal"]??tn.normal,s=e.label??"Loading",l=fe().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,h=q(()=>`@keyframes liq-rotate-${l}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[l]);return o("span",{role:"status","aria-label":s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,h),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function pe(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function ze(e,t){let n=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:n?`1px solid ${n}`:e.border??"1px solid #d1d5db",borderRadius:e.borderRadius??"6px",fontSize:e.fontSize??"14px",fontFamily:e.fontFamily??"inherit",backgroundColor:e.backgroundColor??"#ffffff",color:e.color??"#1f2937",outline:"none",transition:e.transition??"border-color 0.15s",width:"100%",boxSizing:"border-box",...t.focused&&n?{boxShadow:`0 0 0 3px ${n}22`}:{},...e.custom??{}}}var wr={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function vr(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,h=ie(null);se(()=>{h.current&&(h.current.indeterminate=a)},[a]);let g=$(()=>{l||i(!r)},[l,r,i]),c=$(C=>{l||(C.key===" "||C.key==="Enter")&&(C.preventDefault(),i(!r))},[l,r,i]),x=wr[u],p=`${x.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",m=r||a?"#3b82f6":"#ffffff",f={width:p,height:p,minWidth:p,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:m,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},b={color:"#ffffff",fontSize:`${x.icon}px`,lineHeight:"1",fontWeight:"700"},S=a?o("span",{style:b},"\u2014"):r?o("span",{style:b},"\u2713"):null,z={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},k=o("input",{ref:h,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),w=o("div",{style:f},S),I=s?o("span",{style:{fontSize:x.fontSize,color:"#374151"}},s):null;return o(pe,{error:d,htmlFor:n},o("div",{style:z,onClick:g,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},k,w,I))}var kr=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function nn(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function Ke(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}function Cr(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=kr,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[h,g]=X(!1),[c,x]=X(r),p=ie(null);se(()=>{x(r)},[r]),se(()=>{let R=M=>{p.current&&!p.current.contains(M.target)&&g(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let y=$(R=>{d||i(Ke(R))},[d,i]),m=$(R=>{let M=R.target.value;x(M);let F=M.startsWith("#")?M:`#${M}`;nn(F)&&i(Ke(F))},[i]),f=$(()=>{nn(c.startsWith("#")?c:`#${c}`)||x(r)},[c,r]),b={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},S={display:"flex",alignItems:"center",gap:"8px"},z={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"},k={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},w=s.map(R=>{let M=Ke(R)===Ke(r);return o("div",{key:R,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:R,cursor:d?"not-allowed":"pointer",border:M?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(R),onKeyDown:A=>{let H=A.key;(H==="Enter"||H===" ")&&(A.preventDefault(),y(R))},role:"button",tabIndex:d?-1:0,title:R,"aria-label":`Select color ${R}`})}),I=a?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput:m,onBlur:f,disabled:d,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,C=h?o("div",{style:z},o("div",{style:k},...w),I):null;return o(pe,{label:u,disabled:d,htmlFor:n},o("div",{ref:p,style:{position:"relative"}},o("div",{style:S,onClick:d?void 0:()=>g(!h),onKeyDown:d?void 0:R=>{let M=R.key;(M==="Enter"||M===" ")&&(R.preventDefault(),g(!h))},role:"button",tabIndex:d?-1:0,"aria-expanded":h?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:b}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),C))}function Mr(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,h]=X(r),g=ie(null),c=$(((...m)=>{let b=m[0].target.value;h(b),i?.(b)}),[i]),x={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},p={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(pe,{label:d,htmlFor:n},o("div",{style:x},o("div",{style:p},o("input",{id:n,ref:g,type:"color",value:u,onInput:c,disabled:l,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:l?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":d||"Color"})),a?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null))}var on=["January","February","March","April","May","June","July","August","September","October","November","December"],$r=["Su","Mo","Tu","We","Th","Fr","Sa"];function yt(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function zr(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(r).padStart(2,"0")).replace("DD",String(i).padStart(2,"0"))}function rn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Rr(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Er(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:h,error:g}=e,c=q(()=>yt(r),[r]),x=q(()=>yt(a),[a]),p=q(()=>yt(l),[l]),[y,m]=X(!1),[f,b]=X(()=>c?c.getFullYear():new Date().getFullYear()),[S,z]=X(()=>c?c.getMonth():new Date().getMonth()),k=ie(null),w=q(()=>new Date,[]);se(()=>{let T=N=>{k.current&&!k.current.contains(N.target)&&m(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);let I=$(()=>{z(T=>T===0?(b(N=>N-1),11):T-1)},[]),C=$(()=>{z(T=>T===11?(b(N=>N+1),0):T+1)},[]),R=$(T=>{let N=new Date(f,S,T);x&&N<x||p&&N>p||(i(Rr(N)),m(!1))},[f,S,i,x,p]),M=c?zr(c,s):"",F=q(()=>{let T=new Date(f,S,1).getDay(),N=new Date(f,S+1,0).getDate(),B=[],V=[];for(let G=0;G<T;G++)V.push(null);for(let G=1;G<=N;G++)V.push(G),V.length===7&&(B.push(V),V=[]);for(;V.length>0&&V.length<7;)V.push(null);return V.length&&B.push(V),B},[f,S]),A={...ze({},{focused:y,error:!!g}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},H={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"280px"},L={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},P={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},v={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},D=$r.map(T=>o("div",{key:T,style:{padding:"4px"}},T)),E=F.map((T,N)=>{let B=T.map((V,G)=>{if(V===null)return o("div",{key:`empty-${N}-${G}`,style:{padding:"4px"}});let K=new Date(f,S,V),ee=rn(K,w),J=c?rn(K,c):!1,Y=x&&K<x||p&&K>p,U={padding:"4px",textAlign:"center",cursor:Y?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:ee?"700":"400",backgroundColor:J?"#3b82f6":"transparent",color:J?"#ffffff":Y?"#d1d5db":ee?"#3b82f6":"#1f2937",border:ee&&!J?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${V}`,style:U,onClick:Y?void 0:()=>R(V),onKeyDown:Y?void 0:_=>{let O=_.key;(O==="Enter"||O===" ")&&(_.preventDefault(),R(V))},role:Y?void 0:"button",tabIndex:Y?void 0:0,"aria-label":`${on[S]} ${V}, ${f}`,"aria-disabled":Y?"true":void 0},String(V))});return o("div",{key:`row-${N}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...B)}),W=y?o("div",{style:H},o("div",{style:L},o("button",{type:"button",style:P,onClick:I},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${on[S]} ${f}`),o("button",{type:"button",style:P,onClick:C},"\u25B6")),o("div",{style:v},...D),...E):null;return o(pe,{label:h,error:g,disabled:d,htmlFor:n},o("div",{ref:k,style:{position:"relative"}},o("div",{id:n,style:A,onClick:d?void 0:()=>m(!y),onKeyDown:d?void 0:T=>{let N=T.key;(N==="Enter"||N===" ")&&(T.preventDefault(),m(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:M?"#1f2937":"#9ca3af"}},M||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),W))}function St(e){if(e===0)return"0 B";let t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(n===0?0:1)} ${t[n]}`}function Ir(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[h,g]=X([]),[c,x]=X(!1),[p,y]=X(""),m=ie(null),f=$(P=>{y("");let v=[];for(let E of P){if(a&&E.size>a){y(`File "${E.name}" exceeds maximum size of ${St(a)}`);continue}v.push(E)}let D=s?[...h,...v]:v.slice(0,1);g(D),r(D)},[h,s,a,r]),b=$(P=>{if(P.preventDefault(),P.stopPropagation(),x(!1),l)return;let v=P.dataTransfer;if(!v)return;let D=Array.from(v.files);f(D)},[l,f]),S=$(P=>{P.preventDefault(),P.stopPropagation(),l||x(!0)},[l]),z=$(P=>{P.preventDefault(),P.stopPropagation(),x(!1)},[]),k=$(P=>{let v=P.target;v.files&&(f(Array.from(v.files)),v.value="")},[f]),w=$(P=>{let v=h.filter((D,E)=>E!==P);g(v),r(v)},[h,r]),I=$(()=>{l||m.current&&m.current.click()},[l]),C={border:`2px dashed ${c?"#3b82f6":p?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:l?"0.6":"1"},R={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},M={fontSize:"14px",color:"#374151",marginBottom:"4px"},F={fontSize:"12px",color:"#9ca3af"},A=o("input",{id:n,ref:m,type:"file",accept:i,multiple:s,onChange:k,disabled:l,style:{display:"none"},tabIndex:-1}),H=o("div",{style:C,onClick:I,onKeyDown:P=>{let v=P.key;(v==="Enter"||v===" ")&&(P.preventDefault(),I())},onDrop:b,onDragOver:S,onDragLeave:z,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:R},"\u2191"),o("div",{style:M},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:F},i):null,a?o("div",{style:F},`Max size: ${St(a)}`):null),L=h.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...h.map((P,v)=>{let D={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},E={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${v}`,style:D},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},P.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},St(P.size))),o("button",{type:"button",style:E,onClick:W=>{W.stopPropagation(),w(v)},"aria-label":`Remove ${P.name}`},"\u2715"))})):null;return o(pe,{label:d,helpText:u,error:p||void 0,disabled:l,htmlFor:n},o("div",null,A,H,L))}function Pr(e){let[t,n]=X(!1),[r,i]=X((e.value??e.defaultValue??"").length),s=fe().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...ze(e.inputStyle??{},{focused:t,error:!!e.error}),resize:e.autoResize?"none":"vertical",lineHeight:"1.5",...e.minHeight?{minHeight:e.minHeight}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},u=$(c=>{let x=c.target,p=x.value;i(p.length),e.onChange&&e.onChange(p),e.autoResize&&(x.style.height="auto",x.style.height=`${x.scrollHeight}px`)},[e.onChange,e.autoResize]),h=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),g=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>(e.maxLength??1/0)*.9?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(pe,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,g)}function Tr(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:h,label:g,error:c}=e,[x,p]=X(!1),y=$(v=>{let D=v;return s!==void 0&&D<s&&(D=s),a!==void 0&&D>a&&(D=a),D},[s,a]),m=$(()=>{d||i(y(r+l))},[d,r,l,y,i]),f=$(()=>{d||i(y(r-l))},[d,r,l,y,i]),b=$(v=>{let D=v.target.value;if(D===""||D==="-")return;let E=parseFloat(D);isNaN(E)||i(y(E))},[y,i]),S=$(v=>{d||(v.key==="ArrowUp"?(v.preventDefault(),m()):v.key==="ArrowDown"&&(v.preventDefault(),f()))},[d,m,f]),z=s===void 0||r>s,k=a===void 0||r<a,w={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":x?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...x&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},I=v=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:d||!v?"not-allowed":"pointer",color:d||!v?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),C={flex:"1",minWidth:"32px",textAlign:"center",border:"none",borderLeft:"1px solid var(--color-border, #e5e7eb)",borderRight:"1px solid var(--color-border, #e5e7eb)",outline:"none",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text, #1f2937)",padding:"4px 2px"},R={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},M=o("button",{type:"button",style:I(z),onClick:f,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),F=u?o("span",{style:R},u):null,A=o("input",{id:n,type:"text",value:String(r),onInput:b,onKeyDown:S,onFocus:()=>p(!0),onBlur:()=>p(!1),disabled:d,style:C,"aria-label":g||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":s!==void 0?String(s):void 0,"aria-valuemax":a!==void 0?String(a):void 0}),H=h?o("span",{style:R},h):null,L=o("button",{type:"button",style:I(k),onClick:m,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),P=[M];return F&&P.push(F),P.push(A),H&&P.push(H),P.push(L),o(pe,{label:g,error:c,disabled:d,htmlFor:n},o("div",{style:w},...P))}function Dr(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:h}=e,g=$(y=>{d||s(y)},[d,s]),c=$(y=>{if(d)return;let m=r.filter(S=>!S.disabled);if(m.length===0)return;let f=m.findIndex(S=>S.value===i),b=f;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),b=f<m.length-1?f+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),b=f>0?f-1:m.length-1;else return;s(m[b].value)},[d,r,i,s]),x={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},p=r.map((y,m)=>{let f=y.value===i,b=d||!!y.disabled,S=`${n}-opt-${m}`,z={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":f?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},k={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:f?"scale(1)":"scale(0)"},w={display:"inline-flex",alignItems:"center",gap:"8px",cursor:b?"not-allowed":"pointer",opacity:b?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:S,style:w,onClick:b?void 0:I=>{I.preventDefault(),g(y.value)}},o("input",{type:"radio",id:S,name:a,value:y.value,checked:f,disabled:b,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:z},o("div",{style:k})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(pe,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:x,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...p))}function Ar(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:h=!1,error:g,label:c,helpText:x}=e,[p,y]=X(!1),[m,f]=X(""),[b,S]=X(-1),z=ie(null),k=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),w=q(()=>{if(!l||!m)return r;let T=m.toLowerCase();return r.filter(N=>N.label.toLowerCase().includes(T))},[r,m,l]),I=q(()=>{let T={},N=[];for(let B of w)B.group?(T[B.group]||(T[B.group]=[]),T[B.group].push(B)):N.push(B);return{groups:T,ungrouped:N}},[w]),C=q(()=>k.length===0?"":k.map(N=>r.find(B=>B.value===N)).filter(Boolean).map(N=>N.label).join(", "),[k,r]);se(()=>{let T=N=>{let B=N.target;z.current&&!z.current.contains(B)&&(y(!1),f(""))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);let R=$(T=>{if(d){let N=k.includes(T)?k.filter(B=>B!==T):[...k,T];s(N)}else s(T),y(!1),f("")},[d,k,s]),M=$(T=>{T.stopPropagation(),s(d?[]:"")},[d,s]),F=$(T=>{if(h)return;let N=T.key;if(!p&&(N==="Enter"||N===" "||N==="ArrowDown")){T.preventDefault(),y(!0),S(0);return}if(p){if(N==="Escape"){y(!1),f("");return}if(N==="ArrowDown")T.preventDefault(),S(B=>Math.min(B+1,w.length-1));else if(N==="ArrowUp")T.preventDefault(),S(B=>Math.max(B-1,0));else if(N==="Enter"&&b>=0&&b<w.length){T.preventDefault();let B=w[b];B.disabled||R(B.value)}}},[h,p,b,w,R]),A={...ze({},{focused:p,error:!!g}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},H={position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",maxHeight:"240px",overflowY:"auto"},L=(T,N)=>{let B=k.includes(T.value),V=N===b,G={padding:"8px 12px",cursor:T.disabled?"not-allowed":"pointer",backgroundColor:V?"#f3f4f6":B?"#eff6ff":"transparent",color:T.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:T.value,style:G,onClick:T.disabled?void 0:()=>R(T.value),onMouseEnter:()=>S(N),role:"option","aria-selected":B?"true":"false","aria-disabled":T.disabled?"true":void 0},d&&B?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,T.label)},P=()=>{let T=[],N=0,{groups:B,ungrouped:V}=I;for(let G of V)T.push(L(G,N++));for(let G of Object.keys(B)){T.push(o("div",{key:`group-${G}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},G));for(let K of B[G])T.push(L(K,N++))}return T.length===0&&T.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),T},v=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:p?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),D=o("div",{style:A,id:n,onClick:h?void 0:()=>{y(!p),S(-1)},onKeyDown:F,tabIndex:h?-1:0,role:"combobox","aria-expanded":p?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:C?"#1f2937":"#9ca3af"}},C||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&k.length>0?o("span",{onClick:M,onKeyDown:T=>{let N=T.key;(N==="Enter"||N===" ")&&(T.preventDefault(),T.stopPropagation(),M(T))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,v)),E=l&&p?o("input",{type:"text",value:m,onInput:T=>{f(T.target.value),S(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,W=p?o("div",{style:H,role:"listbox"},E,...P()):null;return o(pe,{label:c,error:g,helpText:x,disabled:h,htmlFor:n},o("div",{ref:z,style:{position:"relative"}},D,W))}function Lr(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:h=!1,marks:g,range:c=!1,label:x,error:p}=e,y=ie(null),m=ie(i);m.current=i;let[f,b]=X(null),S=q(()=>{if(c&&Array.isArray(r))return r;let N=typeof r=="number"?r:0;return[N,N]},[r,c]),z=ie(S);z.current=S;let k=N=>{let B=Math.round((N-s)/l)*l+s;return Math.max(s,Math.min(a,B))},w=N=>(N-s)/(a-s)*100,I=$(N=>{if(!y.current)return s;let B=y.current.getBoundingClientRect(),V=Math.max(0,Math.min(1,(N.clientX-B.left)/B.width));return k(s+V*(a-s))},[s,a,l]),C=$(N=>B=>{h||(B.preventDefault(),b(N))},[h]),R=$(N=>{if(h)return;let B=I(N);if(c){let V=Math.abs(B-S[0]),G=Math.abs(B-S[1]);V<=G?i([k(B),S[1]]):i([S[0],k(B)])}else i(k(B))},[h,I,c,S,i,s,a,l]);se(()=>{if(!f)return;let N=V=>{let G=I(V),K=z.current,ee=m.current;f==="single"?ee(k(G)):f==="start"?ee([Math.min(k(G),K[1]),K[1]]):f==="end"&&ee([K[0],Math.max(K[0],k(G))])},B=()=>b(null);return document.addEventListener("mousemove",N),document.addEventListener("mouseup",B),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",B)}},[f,I,s,a,l]);let M=$(N=>{if(h)return;let B=0;if(N.key==="ArrowRight"||N.key==="ArrowUp")B=l;else if(N.key==="ArrowLeft"||N.key==="ArrowDown")B=-l;else return;N.preventDefault(),c||i(k((typeof r=="number"?r:0)+B))},[h,l,c,r,i,s,a]),F={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},A=c?w(S[0]):0,H=w(c?S[1]:S[0]),L={position:"absolute",top:"0",left:`${A}%`,width:`${H-A}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},P=N=>x?N==="start"?`${x} minimum`:N==="end"?`${x} maximum`:x:N==="start"?"Minimum value":N==="end"?"Maximum value":"Value",v=(N,B,V)=>{let G={position:"absolute",top:"50%",left:`${N}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${h?"#9ca3af":"#3b82f6"}`,cursor:h?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},K={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:B==="single"||B==="start"?n:void 0,style:G,onMouseDown:C(B),role:"slider","aria-valuenow":String(V),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":P(B),tabIndex:h?-1:0,onKeyDown:M},d?o("div",{style:K},String(V)):null)},D=[];if(u)for(let N=s;N<=a;N+=l)D.push(o("div",{key:`tick-${N}`,style:{position:"absolute",top:"10px",left:`${w(N)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let E=[];if(g)for(let N of g)E.push(o("div",{key:`mark-${N.value}`,style:{position:"absolute",top:"18px",left:`${w(N.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},N.label));let W={paddingTop:d?"28px":"8px",paddingBottom:g||u?"28px":"8px",opacity:h?"0.6":"1"},T=[];return c?(T.push(v(w(S[0]),"start",S[0])),T.push(v(w(S[1]),"end",S[1]))):T.push(v(w(S[0]),"single",S[0])),o(pe,{label:x,error:p,htmlFor:n},o("div",{style:W},o("div",{ref:y,style:F,role:"presentation",onClick:R},o("div",{style:L}),...T,...D,...E)))}var Wr=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Fr={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"\u2022",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"\u201C",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"\u{1F517}",command:"createLink"},unlink:{label:"Remove link",icon:"\u26D4",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"\u2015",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"\u2718",command:"removeFormat"},undo:{label:"Undo",icon:"\u21A9",command:"undo"},redo:{label:"Redo",icon:"\u21AA",command:"redo"}};function Nr(e){let[t,n]=X(!1),r=ie(null),i=fe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??Wr,l=e.toolbarStyle??{},d=e.editorStyle??{};se(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=$((p,y)=>{if(!(e.disabled||e.readOnly)){if(p==="createLink"){let m=prompt("Enter URL:");if(!m)return;document.execCommand(p,!1,m)}else y&&p==="formatBlock"?document.execCommand(p,!1,`<${y}>`):document.execCommand(p,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),h=$(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),g=$(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),c=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:l.backgroundColor??"#f9fafb",borderBottom:l.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...a.map(p=>{let y=Fr[p];return y?o("button",{key:p,type:"button",title:y.label,onClick:()=>u(y.command,y.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:l.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:l.buttonSize??"13px",fontWeight:p==="bold"?"700":p==="italic"?"400":"500",fontStyle:p==="italic"?"italic":"normal",textDecoration:p==="underline"?"underline":p==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),x=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:d.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:d.backgroundColor??"#ffffff",color:d.color??"#1f2937",fontFamily:d.fontFamily??"inherit",fontSize:d.fontSize??"14px",lineHeight:d.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:g,onInput:h});return o(pe,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,x))}function Br(e){let[t,n]=X(!1),r=fe().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=ze(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let h=u.target.value;e.onInput&&e.onInput(h),e.onChange&&e.onChange(h)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(pe,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Hr=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Te(e){return String(e).padStart(2,"0")}function Or(e){let t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}function _r(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:h=!1,timezone:g,showTimezone:c=!1,timezones:x=Hr,onTimezoneChange:p}=e,[y,m]=X(!1),f=q(()=>Or(r),[r]),b=s==="12h",S=f.hour>=12,z=b?f.hour%12||12:f.hour,k=$((U,_,O)=>{let Z=Math.max(0,Math.min(23,U)),Q=Math.max(0,Math.min(59,_)),oe=Math.max(0,Math.min(59,O??0));i(h?`${Te(Z)}:${Te(Q)}:${Te(oe)}`:`${Te(Z)}:${Te(Q)}`)},[i,h]),w=$(U=>{let _=parseInt(U.target.value,10)||0;b&&(_=_%12,S&&(_+=12)),k(_,f.minute,f.second)},[b,S,f.minute,f.second,k]),I=$(U=>{let _=parseInt(U.target.value,10)||0;k(f.hour,_,f.second)},[f.hour,f.second,k]),C=$(U=>{let _=parseInt(U.target.value,10)||0;k(f.hour,f.minute,_)},[f.hour,f.minute,k]),R=$(()=>{if(l)return;let U=S?f.hour-12:f.hour+12;k(U,f.minute,f.second)},[l,S,f.hour,f.minute,f.second,k]),M=$(U=>{l||k(f.hour+U,f.minute,f.second)},[l,f.hour,f.minute,f.second,k]),F=$(U=>{l||k(f.hour,f.minute+U*a,f.second)},[l,f.hour,f.minute,f.second,a,k]),A=$(U=>{l||k(f.hour,f.minute,f.second+U)},[l,f.hour,f.minute,f.second,k]),H=$(U=>{let _=U.target.value;p&&p(_)},[p]),L={display:"inline-flex",alignItems:"center",gap:"4px",...ze({},{focused:y,error:!!u})},P={display:"flex",flexDirection:"column",alignItems:"center"},v={background:"none",border:"none",cursor:l?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},D={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},E={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},W=o("div",{style:P},o("button",{type:"button",style:v,onClick:()=>M(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Te(z),onChange:w,style:D,disabled:l,"aria-label":"Hour",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:v,onClick:()=>M(-1),disabled:l},"\u25BC")),T=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),N=o("div",{style:P},o("button",{type:"button",style:v,onClick:()=>F(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Te(f.minute),onChange:I,style:D,disabled:l,"aria-label":"Minute",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:v,onClick:()=>F(-1),disabled:l},"\u25BC")),B=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,V=h?o("div",{style:P},o("button",{type:"button",style:v,onClick:()=>A(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Te(f.second),onChange:C,style:D,disabled:l,"aria-label":"Second",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:v,onClick:()=>A(-1),disabled:l},"\u25BC")):null,G=b?o("button",{type:"button",style:E,onClick:R,disabled:l,"aria-label":"Toggle AM/PM"},S?"PM":"AM"):null,K={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},ee=g&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},g):null,J=c?o("select",{style:K,value:g??x[0],onChange:H,disabled:l,"aria-label":"Timezone"},...x.map(U=>o("option",{key:U,value:U},U))):null,Y=[W,T,N];return B&&Y.push(B),V&&Y.push(V),G&&Y.push(G),ee&&Y.push(ee),J&&Y.push(J),o(pe,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:L},...Y))}var Vr={sm:{trackW:32,trackH:18,thumbSize:14,offset:2},md:{trackW:44,trackH:24,thumbSize:20,offset:2},lg:{trackW:56,trackH:30,thumbSize:26,offset:2}};function Yr(e){let{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:s=!1,size:a="md",onColor:l="#3b82f6",offColor:d="#d1d5db"}=e,u=Vr[a],h=$(()=>{s||n(!t)},[s,t,n]),g=$(S=>{s||(S.key===" "||S.key==="Enter")&&(S.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?l:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},x=t?u.trackW-u.thumbSize-u.offset:u.offset,p={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${x}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},m=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,f=o("div",{style:c},o("div",{style:p}));return o("div",{style:y,onClick:h,onKeyDown:g,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[m,f]:[f,m]).filter(Boolean))}var sn={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06)",md:"0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06)",lg:"0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)"};function Gr(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=q(()=>{let h={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(h.border="1px solid #e5e7eb"),h.boxShadow=sn[n]??sn.sm,e.hoverable&&(h.cursor="pointer"),{...h,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function Ur(e){let t=q(()=>{let n={display:e.inline?"inline-flex":"flex"};return e.direction&&(n.flexDirection=e.direction),e.wrap&&(n.flexWrap=e.wrap),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyContent&&(n.justifyContent=e.justifyContent),{...n,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)}function jr(e){let t=q(()=>{let n={};return e.flex&&(n.flex=e.flex),e.grow!==void 0&&(n.flexGrow=String(e.grow)),e.shrink!==void 0&&(n.flexShrink=String(e.shrink)),e.basis&&(n.flexBasis=e.basis),e.alignSelf&&(n.alignSelf=e.alignSelf),e.order!==void 0&&(n.order=String(e.order)),{...n,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)}function Xr(e){let t=q(()=>{let n={display:"grid"};return e.minColWidth?n.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:e.columns!==void 0&&(n.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(n.gridTemplateRows=e.rows),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyItems&&(n.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(n.gridTemplateAreas=e.areas.map(r=>`"${r}"`).join(" ")),{...n,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)}function qr(e){let t=q(()=>{let n={};return e.gridColumn&&(n.gridColumn=e.gridColumn),e.gridRow&&(n.gridRow=e.gridRow),e.gridArea&&(n.gridArea=e.gridArea),e.alignSelf&&(n.alignSelf=e.alignSelf),e.justifySelf&&(n.justifySelf=e.justifySelf),{...n,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)}var ln={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function Kr(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=X(!!e.defaultCollapsed),s=ie(null),[a,l]=X("auto");se(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=$(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=$(y=>{if(!e.collapsible)return;let m=y.key;(m==="Enter"||m===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),h=q(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=ln[n]??ln.none,{...y,...e.style??{}}},[t,n,e.style]),g={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},x={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},p={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:h},o("div",{className:"panel__header",style:g,onClick:d,onKeyDown:u,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:c}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?x:{},ref:s},o("div",{className:"panel__body",style:p},e.children)))}function an(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function Zr(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":return{scrollbarWidth:"thin"};case"hover":return{scrollbarWidth:"thin"};case"auto":default:return{scrollbarWidth:"auto"}}}function Jr(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=ie(null),[s,a]=X(!0),[l,d]=X(!1),[u,h]=X(!0),[g,c]=X(!1),x=$(()=>{let b=i.current;if(!b)return;let S=2;a(b.scrollTop<=S),d(b.scrollTop+b.clientHeight>=b.scrollHeight-S),h(b.scrollLeft<=S),c(b.scrollLeft+b.clientWidth>=b.scrollWidth-S)},[]);se(()=>{x()},[x]);let p=$(()=>{r&&x()},[r,x]),y=q(()=>{let b={position:"relative",overflowX:an(t,"x"),overflowY:an(t,"y"),...Zr(n)};return e.maxHeight&&(b.maxHeight=e.maxHeight),e.maxWidth&&(b.maxWidth=e.maxWidth),e.padding&&(b.padding=e.padding),{...b,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),m=[];if(r){let b=t==="vertical"||t==="both",S=t==="horizontal"||t==="both";b&&!s&&m.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),b&&!l&&m.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),S&&!u&&m.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),S&&!g&&m.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let f={...y};return m.length>0&&(f.boxShadow=m.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:f,ref:i,onScroll:p},e.children)}function Qr(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=X(e.initialSplit??50),l=ie(null),d=ie(!1),u=$(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);se(()=>{let y=f=>{if(!d.current||!l.current)return;let b=l.current.getBoundingClientRect(),S=n?b.width:b.height,z=n?f.clientX-b.left:f.clientY-b.top;if(S<=0)return;let k=i/S*100,w=e.maxSize?e.maxSize/S*100:100-k,I=z/S*100;I=Math.max(k,Math.min(w,I)),a(I)},m=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",m),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",m)}},[n,i,e.maxSize]);let h=q(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),g=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},x={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},p=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:h,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:g},p[0]??null),o("div",{className:"splitter__divider",style:x,onMouseDown:u,onKeyDown:y=>{let m=y.key,f=2;n&&(m==="ArrowLeft"||m==="ArrowRight")?(y.preventDefault(),a(b=>{let S=m==="ArrowRight"?f:-f;return Math.max(5,Math.min(95,b+S))})):!n&&(m==="ArrowUp"||m==="ArrowDown")&&(y.preventDefault(),a(b=>{let S=m==="ArrowDown"?f:-f;return Math.max(5,Math.min(95,b+S))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(s)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:c},p[1]??null))}function ei(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(f=>!f.disabled)?.id??"",[i,s]=X(e.activeTab??r),a=e.activeTab??i,l=ie(null),d=$(f=>{s(f),e.onChange&&e.onChange(f)},[e.onChange]),u=$(f=>{let b=e.tabs.filter(C=>!C.disabled),S=b.findIndex(C=>C.id===a);if(S===-1)return;let z=t==="left"||t==="right",k=z?"ArrowUp":"ArrowLeft",w=z?"ArrowDown":"ArrowRight",I=-1;if(f.key===k?I=S>0?S-1:b.length-1:f.key===w?I=S<b.length-1?S+1:0:f.key==="Home"?I=0:f.key==="End"&&(I=b.length-1),I>=0){f.preventDefault(),d(b[I].id);let C=l.current;if(C){let M=C.querySelectorAll('[role="tab"]')[e.tabs.indexOf(b[I])];M&&M.focus()}}},[e.tabs,a,t,d]),h=t==="left"||t==="right",g=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:h?g?"row-reverse":"row":g?"column-reverse":"column",width:"100%",...e.style??{}}),[h,g,e.style]),x={display:"flex",flexDirection:h?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!h?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&h?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},p={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(f=>f.id===a),m=e.tabs.map(f=>{let b=f.id===a,S={padding:"8px 16px",border:"none",background:"none",cursor:f.disabled?"not-allowed":"pointer",opacity:f.disabled?"0.5":"1",fontSize:"14px",fontWeight:b?"600":"400",color:b?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?h?t==="left"?(S.borderRight=b?"2px solid #3b82f6":"2px solid transparent",S.marginRight="-2px"):(S.borderLeft=b?"2px solid #3b82f6":"2px solid transparent",S.marginLeft="-2px"):(S.borderBottom=b?"2px solid #3b82f6":"2px solid transparent",S.marginBottom="-2px"):n==="card"?(S.backgroundColor=b?"#ffffff":"transparent",S.borderRadius="6px 6px 0 0",b&&(S.border="1px solid #e5e7eb",S.borderBottom="1px solid #ffffff")):n==="pill"&&(S.borderRadius="9999px",S.backgroundColor=b?"#3b82f6":"transparent",S.color=b?"#ffffff":"#6b7280"),o("button",{key:f.id,role:"tab","aria-selected":String(b),"aria-controls":`tabpanel-${f.id}`,"aria-disabled":f.disabled?"true":void 0,id:`tab-${f.id}`,tabIndex:b?"0":"-1",style:S,onClick:f.disabled?void 0:()=>d(f.id),onKeyDown:u},f.icon?o("span",{className:"tabs__tab-icon"},f.icon):null,f.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":h?"vertical":"horizontal",style:x,ref:l},...m),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:p,tabIndex:"0"},y?y.content:null))}function ti(e){let t=e.items??[],n=t.length,r=e.loop!==!1,i=e.showDots!==!1,s=e.showArrows!==!1,a=e.animation??"slide",l=e.interval??5e3,d=fe().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=X(0),g=ie(null),c=ie(null),x=$(w=>{let I=w;r?I=(w%n+n)%n:I=Math.max(0,Math.min(w,n-1)),h(I),e.onChange&&e.onChange(I)},[n,r,e.onChange]),p=$(()=>x(u+1),[u,x]),y=$(()=>x(u-1),[u,x]);se(()=>{if(!e.autoPlay||n<=1)return;let w=setInterval(p,l);return()=>clearInterval(w)},[e.autoPlay,l,p,n]),se(()=>{let w=C=>{C.key==="ArrowLeft"?y():C.key==="ArrowRight"&&p()},I=c.current;if(I)return I.addEventListener("keydown",w),()=>I.removeEventListener("keydown",w)},[p,y]);let m=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",f={position:"relative",overflow:"hidden",width:"100%",outline:"none"},b=q(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),S={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},z=t.map((w,I)=>{let C=a==="fade"?{position:I===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:I===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(I),style:C},w.content,w.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},w.caption):null)}),k=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((w,I)=>o("button",{key:String(I),"aria-label":`Go to slide ${I+1}`,onclick:()=>x(I),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:I===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:f,onpointerdown:w=>{g.current=w.clientX},onpointerup:w=>{if(g.current==null)return;let I=w.clientX-g.current;I>50?y():I<-50&&p(),g.current=null}},m?o("style",null,m):null,o("div",{style:b},...z),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...S,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:p,style:{...S,right:"8px"}},"\u203A"):null,k)}function ni(e){let[t,n]=X("loading"),r=ie(null),i=fe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.lazy!==!1,a=typeof e.width=="number"?`${e.width}px`:e.width,l=typeof e.height=="number"?`${e.height}px`:e.height;se(()=>{n("loading")},[e.src]);let d=q(()=>{let x={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(x.width=a),l&&(x.height=l),e.borderRadius&&(x.borderRadius=e.borderRadius),x},[a,l,e.borderRadius]),u=q(()=>{let x={display:"block",width:"100%",height:"100%"};return e.objectFit&&(x.objectFit=e.objectFit),t==="loading"&&(x.opacity="0",x.position="absolute"),t==="error"&&(x.display="none"),x},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let x=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,x),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?h=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(h=e.placeholder);let g=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?g=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):g=e.fallback);let c=o("div",{style:d},h,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),g);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},c,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):c}function cn(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function oi(e){let t=e.controls!==!1,n=ie(null),r=fe().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=X(!1),[a,l]=X(0),[d,u]=X(0),[h,g]=X(e.muted?0:1),[c,x]=X(!!e.muted),[p,y]=X(!0),m=typeof e.width=="number"?`${e.width}px`:e.width??"100%",f=typeof e.height=="number"?`${e.height}px`:e.height??"auto";se(()=>{let R=n.current;if(!R)return;let M=()=>{s(!0),e.onPlay&&e.onPlay()},F=()=>{s(!1),e.onPause&&e.onPause()},A=()=>{s(!1),e.onEnded&&e.onEnded()},H=()=>{l(R.currentTime),u(R.duration),e.onTimeUpdate&&e.onTimeUpdate(R.currentTime,R.duration)},L=()=>{u(R.duration)};return R.addEventListener("play",M),R.addEventListener("pause",F),R.addEventListener("ended",A),R.addEventListener("timeupdate",H),R.addEventListener("loadedmetadata",L),()=>{R.removeEventListener("play",M),R.removeEventListener("pause",F),R.removeEventListener("ended",A),R.removeEventListener("timeupdate",H),R.removeEventListener("loadedmetadata",L)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let b=$(()=>{let R=n.current;R&&(R.paused?R.play():R.pause())},[]),S=$(R=>{let M=n.current;if(!M||!isFinite(M.duration))return;let F=R.currentTarget.getBoundingClientRect(),A=Math.max(0,Math.min(1,(R.clientX-F.left)/F.width));M.currentTime=A*M.duration},[]),z=$(R=>{let M=n.current,F=parseFloat(R.target.value);M&&(M.volume=F,M.muted=F===0,g(F),x(F===0))},[]),k=$(()=>{let R=n.current;R&&R.requestFullscreen&&R.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,style:{width:m,height:f,display:"block"}});let w=d>0?a/d*100:0,I={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},C=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:p?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:b,style:I},i?"\u23F8":"\u25B6"),o("div",{onclick:S,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${w}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${cn(a)} / ${cn(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:z,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:k,style:I},"\u26F6"));return o("div",{style:{position:"relative",width:m,height:f,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:b,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),C)}function we(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=ie(null),a={display:"flex",flexDirection:t==="horizontal"?"row":"column",backgroundColor:i.backgroundColor??"#ffffff",color:i.color??"#1f2937",fontFamily:i.fontFamily??"inherit",fontSize:i.fontSize??"14px",border:i.border??"1px solid #e5e7eb",borderRadius:i.borderRadius??"8px",padding:i.padding??"0",width:typeof i.width=="number"?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:typeof i.maxHeight=="number"?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},l=$(d=>{if(!r)return;let u=d,h=s.current;if(!h)return;let g=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=g.indexOf(document.activeElement);if(c<0)return;let x=t==="vertical",p=x?"ArrowDown":"ArrowRight",y=x?"ArrowUp":"ArrowLeft";if(u.key===p){u.preventDefault();let m=g[c+1];m&&m.focus()}else if(u.key===y){u.preventDefault();let m=g[c-1];m&&m.focus()}else u.key==="Home"?(u.preventDefault(),g[0]?.focus()):u.key==="End"&&(u.preventDefault(),g[g.length-1]?.focus())},[r,t]);return o("nav",{ref:s,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:l},e.children)}function _e(e,t){return{display:"flex",alignItems:"center",padding:e.padding??"10px 16px",cursor:e.cursor??"pointer",transition:e.transition??"background-color 0.15s",backgroundColor:t.active?e.activeBackground??"#eff6ff":t.hover?e.hoverBackground??"#f3f4f6":"transparent",color:t.active?e.activeColor??"#2563eb":"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",...e.separator?{borderBottom:e.separator}:{}}}function be(){let[e,t]=X(!1);return{hover:e,onMouseEnter:$(()=>t(!0),[]),onMouseLeave:$(()=>t(!1),[])}}function ri(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:h}=be(),g=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:g?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:g?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:g?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let x=$(S=>{let z=S;g||(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),r())},[g,r]),p=$(()=>{g||r()},[g,r]),m=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),f=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,b=l==="left"?[m,f]:[f,m];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":g?"true":void 0,"data-section-id":t.id,tabIndex:g?-1:0,style:c,onClick:p,onKeyDown:x,onMouseEnter:u,onMouseLeave:h},...b)}function ii(e){let{section:t,expanded:n,contentStyle:r,animated:i}=e,s={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:s},o("div",{style:a},t.content))}function si(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:h=!0,onChange:g}=e,[c,x]=X(()=>n??[]),p=$(m=>{x(f=>{let b=f.includes(m),S;return b?S=f.filter(z=>z!==m):r?S=[...f,m]:S=[m],g&&g(S),S})},[r,g]),y=q(()=>t.map(m=>{let f=c.includes(m.id),b=o(ri,{key:`header-${m.id}`,section:m,expanded:f,onToggle:()=>p(m.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),S=o(ii,{key:`content-${m.id}`,section:m,expanded:f,contentStyle:s,animated:h});return o("div",{key:m.id,"data-accordion-section":m.id,style:{width:"100%"}},b,S)}),[t,c,i,s,l,d,u,h,p]);return o(we,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var li={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function ai(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=X(!1),l=li[i],d=$(()=>{a(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!0;let p=1,y=r-1;u=[...t.slice(0,p),{label:"..."},...t.slice(t.length-y)]}let g=p=>typeof p=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},p):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},p),c=(p,y,m)=>{let f=y===m.length-1,b=h&&p.label==="..."&&y===1,S=[];return y>0&&S.push(g(n)),b?S.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):f?S.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},p.label)):p.href?S.push(o("a",{href:p.href,onClick:p.onClick?z=>{z.preventDefault(),p.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},p.label)):p.onClick?S.push(o("button",{type:"button",onClick:p.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},p.label)):S.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},p.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...S)},x=u.map((p,y)=>c(p,y,u));return o(we,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...x))}function dn(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=be(),[d,u]=X(!1),h=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let g=t.disabled===!0,x={..._e(n,{hover:!g&&s,active:!1}),position:"relative",justifyContent:"space-between",...g?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},p=$(()=>{if(!g){if(h){u(z=>!z);return}t.onClick&&t.onClick(),r&&i()}},[g,h,t,r,i]),y=$(()=>{a(),h&&u(!0)},[h,a]),m=$(()=>{l(),h&&u(!1)},[h,l]),f=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),b=h?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,S=h&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(we,{orientation:"vertical",role:"menu",styling:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",width:"200px",backgroundColor:"#ffffff"}},...t.children.map(z=>o(dn,{key:z.id,item:z,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:m},o("button",{type:"button",role:"menuitem",style:x,onClick:p,disabled:g||void 0,tabIndex:g?-1:0,"aria-disabled":g?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},f,b),S)}function ci(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,h]=X(!1),g=ie(null),c=$(()=>{h(z=>!z)},[]),x=$(()=>{h(!1)},[]);se(()=>{if(!u)return;let z=k=>{let w=g.current;w&&!w.contains(k.target)&&h(!1)};return document.addEventListener("click",z,!0),()=>{document.removeEventListener("click",z,!0)}},[u]),se(()=>{if(!u)return;let z=k=>{k.key==="Escape"&&h(!1)};return document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z)}},[u]);let p={display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 16px",fontSize:"14px",fontFamily:"inherit",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#1f2937",cursor:"pointer",outline:"none",...r??{}},y=o("button",{type:"button",style:p,onClick:c,"aria-haspopup":"true","aria-expanded":String(u)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),m=typeof d=="number"?`${d}px`:d,f={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},b={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:m,backgroundColor:"#ffffff",...i??{}},S=u?o("div",{style:f},o(we,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:b},...n.map(z=>o(dn,{key:z.id,item:z,itemStyle:s,closeOnSelect:l,onClose:x})))):null;return o("div",{ref:g,style:{position:"relative",display:"inline-block"}},y,S)}function un(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=be(),[l,d]=X(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let h=t.disabled===!0,g=$(()=>{if(!h){if(u){d(b=>!b);return}t.onClick&&t.onClick(),n()}},[h,u,t,n]),c=$(()=>{s(),u&&d(!0)},[u,s]),x=$(()=>{a(),u&&d(!1)},[u,a]),p={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:h?"default":"pointer",backgroundColor:!h&&i?"#f3f4f6":"transparent",color:h?"#9ca3af":"#1f2937",opacity:h?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),m=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"\u25B6"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,f=u&&l?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((b,S)=>o(un,{key:String(S),item:b,onClose:n,index:S})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:p,onClick:g,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,m),f)}function di(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=be(),h=ie(null),g=$(()=>{r?a():s(n)},[r,n,s,a]),c=$(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),x={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},p=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,m)=>o(un,{key:String(m),item:y,onClose:a,index:m})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:x,onClick:g,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),p)}function ui(e){let{menus:t}=e,[n,r]=X(null),i=ie(null),s=$(d=>{r(d)},[]),a=$(()=>{r(null)},[]);se(()=>{if(n===null)return;let d=u=>{let h=i.current;h&&!h.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),se(()=>{let d=i.current;if(!d)return;let u=h=>{let g=h;if(g.key==="Escape"){r(null);return}if(g.key==="ArrowRight"){g.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(g.key==="ArrowLeft"){g.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(g.key==="ArrowDown"&&n!==null){g.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let x=c.querySelector('[role="menuitem"]');x&&x.focus()}return}g.key==="Enter"||g.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(di,{key:String(u),menu:d,index:u,isOpen:n===u,anyOpen:n!==null,onOpen:s,onClose:a}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...l)}function Ze(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function fi(e,t,n){let r=n*2+5;if(e<=r)return Ze(1,e);let i=Math.max(t-n,1),s=Math.min(t+n,e),a=i>2,l=s<e-1;return!a&&l?[...Ze(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...Ze(e-n*2-2,e)]:[1,"ellipsis",...Ze(i,s),"ellipsis",e]}var Je={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#374151",fontSize:"14px",fontFamily:"inherit",cursor:"pointer",transition:"background-color 0.15s, color 0.15s",outline:"none",userSelect:"none"},gi={...Je,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},fn={...Je,color:"#9ca3af",cursor:"default",opacity:"0.5"},pi={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function mi(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),h=Math.min(Math.max(1,r),u),g=$(m=>{!d&&m>=1&&m<=u&&m!==h&&i(m)},[d,u,h,i]),c=(m,f,b)=>{let S=d||f<1||f>u||f===h;return o("button",{type:"button",onClick:()=>g(f),disabled:S||void 0,"aria-label":b,style:S?fn:Je},m)},x=fi(u,h,s),p=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",h-1,"Go to previous page"));for(let m of x)if(m==="ellipsis")y.push(o("span",{key:`ellipsis-${p++}`,style:pi},"..."));else{let f=m===h;y.push(o("button",{key:String(m),type:"button",onClick:()=>g(m),disabled:d||void 0,"aria-label":`Page ${m}`,"aria-current":f?"page":void 0,style:d?fn:f?gi:Je},String(m)))}return l&&y.push(c("\u203A",h+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(we,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function gn(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=be(),[u,h]=X(!1),g=t.children&&t.children.length>0,c=t.id===r,x=$(()=>{g&&!n&&h(I=>!I),i&&i(t.id)},[g,n,i,t.id]),p=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${p}`,justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:c?"#eff6ff":a?"#f3f4f6":"transparent",color:c?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},m=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,f=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),b=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,S=!n&&g?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,z=n&&a?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,k=o("button",{type:"button",style:y,onClick:x,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},m,f,b,S,z),w=!n&&g&&u?t.children.map(I=>o(gn,{key:I.id,item:I,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},k,w?o("div",{role:"group"},...w):null)}function hi(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,h=t.map(g=>o(gn,{key:g.id,item:g,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(we,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...h)}var Me={completed:"#2563eb",completedBg:"#2563eb",completedText:"#ffffff",active:"#2563eb",activeBorder:"#2563eb",activeText:"#2563eb",pending:"#d1d5db",pendingText:"#9ca3af",line:"#d1d5db",lineCompleted:"#2563eb",labelActive:"#1f2937",labelPending:"#9ca3af",descriptionColor:"#6b7280"};function bi(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,h=$(m=>{s&&i&&i(m)},[s,i]),g=m=>m<n?"completed":m===n?"active":"pending",c=(m,f,b)=>{let S=a==="dot"?u:d,z={width:`${S}px`,height:`${S}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return b==="completed"?o("div",{style:{...z,backgroundColor:Me.completedBg,color:Me.completedText,border:`2px solid ${Me.completed}`}},a==="circle"?f.icon||"\u2713":null):b==="active"?o("div",{style:{...z,backgroundColor:"#ffffff",color:Me.activeText,border:`2px solid ${Me.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?f.icon||String(m+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Me.active}})):o("div",{style:{...z,backgroundColor:"#ffffff",color:Me.pendingText,border:`2px solid ${Me.pending}`}},a==="circle"?f.icon||String(m+1):null)},x=m=>{if(m>=t.length-1)return null;let b=m<n?Me.lineCompleted:Me.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:b,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:b,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},p=(m,f)=>{let b=g(f),S=b==="active",z=b==="completed",k=c(f,m,b),w={fontSize:"13px",fontWeight:S?"600":"400",color:S||z?Me.labelActive:Me.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},I={fontSize:"11px",color:Me.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},C=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:w},m.label),m.description?o("span",{style:I},m.description):null),R=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},k,C):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},k,C);return o(s?"button":"div",{key:String(f),onClick:s?()=>h(f):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":S?"step":void 0},R)},y=[];return t.forEach((m,f)=>{y.push(p(m,f));let b=x(f);b&&y.push(b)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var pn={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function xi(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=be(),l=pn[n],d=t.disabled===!0,u=t.type==="toggle",[h,g]=X(!1),c=u?t.active===!0:h,x=$(()=>{!d&&t.onClick&&t.onClick()},[d,t]),p=$(()=>{!d&&!u&&g(!0)},[d,u]),y=$(()=>{u||g(!1)},[u]),m=$(()=>{a(),u||g(!1)},[u,a]),f={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!d&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:d?"#9ca3af":c?"#2563eb":"#374151",cursor:d?"default":"pointer",opacity:d?"0.5":"1",outline:"none",transition:"background-color 0.15s"},b=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,S=t.label?o("span",null,t.label):null,z=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:f,onClick:x,onMouseDown:p,onMouseUp:y,onMouseEnter:s,onMouseLeave:m,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},b,S,z)}function yi(e){let{items:t,size:n="md",variant:r="flat"}=e,i=pn[n],s=t.map(a=>a.type==="separator"?o("div",{key:a.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):a.type==="spacer"?o("div",{key:a.id,style:{flex:"1"},"aria-hidden":"true"}):o(xi,{key:a.id,item:a,size:n,variant:r}));return o(we,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:r==="raised"?"1px solid #e5e7eb":"none",borderRadius:r==="raised"?"8px":"0",padding:"4px",backgroundColor:r==="raised"?"#ffffff":"transparent",boxShadow:r==="raised"?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...s)}var Ve=class e{constructor(t,n){Ie(this,"id");Ie(this,"label");Ie(this,"children");Ie(this,"expanded");Ie(this,"icon");Ie(this,"metadata");Ie(this,"parent");Ie(this,"depth");this.id=t.id,this.label=t.label,this.expanded=t.expanded??!1,this.icon=t.icon??null,this.metadata=t.metadata??{},this.parent=n??null,this.depth=n?n.depth+1:0,this.children=(t.children??[]).map(r=>new e(r,this))}static fromData(t){return new e(t)}isLeaf(){return this.children.length===0}isRoot(){return this.parent===null}walk(t){t(this,this.depth);for(let n of this.children)n.walk(t)}find(t){if(this.id===t)return this;for(let n of this.children){let r=n.find(t);if(r)return r}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(t){let n=new e(t,this);return this.children.push(n),n}removeChild(t){let n=this.children.findIndex(r=>r.id===t);return n===-1?!1:(this.children.splice(n,1),!0)}};function mn(e){e.expanded=!0;for(let t of e.children)mn(t)}function hn(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)hn(n,t);return t}function Si(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function wi(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:h,onClick:g,focusedId:c}=e,x=be(),p=ie(null),y=c===t.id;se(()=>{y&&p.current&&p.current.focus()},[y]);let m=t.isLeaf(),f=t.depth,b=[];for(let I=0;I<f;I++){let C=t;for(let M=0;M<f-I;M++)C=C?C.parent:null;let R=C?!Si(C):!1;b.push(o("span",{key:`connector-${I}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...R?{borderLeft:`${s}px solid ${i}`}:{}}}))}let S=f>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,z=m?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:I=>{I.stopPropagation(),h(t)}},t.expanded?a:l),k=u?u(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),w=_e(d,{hover:x.hover,active:n});return o("div",{ref:p,role:"treeitem","aria-expanded":m?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":f+1,tabIndex:y?0:-1,style:{...w,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onClick:()=>g(t)},...b,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},z,k))}function vi(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:h="\u2212",iconCollapsed:g="+",nodeStyle:c={},wrapperStyle:x,renderNode:p}=e,[y,m]=X(()=>{let R=Ve.fromData(t);return a&&mn(R),R}),[f,b]=X(t.id),S=q(()=>hn(y),[y]),z=$(()=>{m(R=>{let M=Object.create(Object.getPrototypeOf(R));return Object.assign(M,R),M})},[]),k=$(R=>{R.toggle(),R.expanded?r?.(R):i?.(R),z()},[r,i,z]),w=$(R=>{b(R.id),n?.(R)},[n]),I=$(R=>{let M=R;if(!f)return;let F=S.findIndex(H=>H.id===f);if(F===-1)return;let A=S[F];switch(M.key){case"ArrowDown":{M.preventDefault();let H=S[F+1];H&&b(H.id);break}case"ArrowUp":{M.preventDefault();let H=S[F-1];H&&b(H.id);break}case"ArrowRight":{M.preventDefault(),A.isLeaf()||(A.expanded?A.children.length>0&&b(A.children[0].id):k(A));break}case"ArrowLeft":{M.preventDefault(),!A.isLeaf()&&A.expanded?k(A):A.parent&&b(A.parent.id);break}case"Enter":{M.preventDefault(),w(A);break}case" ":{M.preventDefault(),A.isLeaf()||k(A);break}case"Home":{M.preventDefault(),S.length>0&&b(S[0].id);break}case"End":{M.preventDefault(),S.length>0&&b(S[S.length-1].id);break}}},[f,S,k,w]),C=S.map(R=>o(wi,{key:R.id,node:R,isSelected:R.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:h,iconCollapsed:g,nodeStyle:c,renderNode:p,onToggle:k,onClick:w,focusedId:f}));return o(we,{role:"tree",ariaLabel:"Tree navigation",styling:x,keyboardNav:!1},o("div",{onKeyDown:I,style:{outline:"none"}},...C))}function bn(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=X(-1),[l,d]=X(null),u=ie(null);se(()=>{if(!u.current)return;u.current.focus();let c=p=>{let y=p,m=t.map((f,b)=>({item:f,i:b})).filter(({item:f})=>!f.divider);if(y.key==="ArrowDown")y.preventDefault(),a(f=>{let S=(m.findIndex(({i:z})=>z===f)+1)%m.length;return m[S].i});else if(y.key==="ArrowUp")y.preventDefault(),a(f=>{let b=m.findIndex(({i:z})=>z===f),S=b<=0?m.length-1:b-1;return m[S].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let f=t[s];f.children?d(s):!f.disabled&&f.onClick&&(f.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let x=u.current;return()=>x.removeEventListener("keydown",c)},[t,s,i,r]);let h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},g=t.map((c,x)=>{if(c.divider)return o("div",{key:`divider-${x}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let p=s===x,y=!!c.disabled,m=!!(c.children&&c.children.length>0),f={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:p&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},b=()=>{a(x),d(m?x:null)},S=()=>{if(!y){if(m){d(x);return}c.onClick&&c.onClick(),r()}},z=[];c.icon&&z.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),z.push(o("span",{style:{flex:"1"}},c.label??"")),m&&z.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let k=[o("div",{key:`item-${x}`,style:f,onMouseEnter:b,onClick:S,role:"menuitem","aria-disabled":y?"true":void 0},...z)];return m&&l===x&&k.push(o(bn,{key:`submenu-${x}`,items:c.children,position:{x:n.x+178,y:n.y+x*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${x}`,style:{position:"relative"}},...k)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...g)}function wt(e){let{items:t,children:n}=e,[r,i]=X(null),s=$(u=>{u.preventDefault();let h=u;i({x:h.clientX,y:h.clientY})},[]),a=$(()=>{i(null)},[]);se(()=>{if(!r)return;let u=g=>{a()},h=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(h),document.removeEventListener("mousedown",u)}},[r,a]),se(()=>{if(!r)return;let u=h=>{h.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(bn,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function ki(e,t){if(t)return"translate3d(0, 0, 0)";switch(e){case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"top":return"translate3d(0, -100%, 0)";case"bottom":return"translate3d(0, 100%, 0)"}}function Ci(e,t){let n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}function Mi(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[h,g]=X(!1),[c,x]=X(!1),p=ie(null),y=s?"drawer-title":void 0;if(se(()=>{if(t)g(!0),requestAnimationFrame(()=>x(!0));else{x(!1);let R=setTimeout(()=>g(!1),300);return()=>clearTimeout(R)}},[t]),se(()=>{if(!t||!d)return;let R=M=>{M.key==="Escape"&&n()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t,d,n]),se(()=>{if(!t)return;let R=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=R}},[t]),se(()=>{t&&p.current&&p.current.focus()},[t]),!h)return null;let m={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},f={...Ci(r,i),transform:ki(r,c),transition:"transform 0.3s ease"},b={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},S={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},z={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},k={padding:"20px",overflow:"auto",flex:"1"},w=()=>{l&&n()},I=[];s&&I.push(o("div",{style:b},o("h3",{id:y,style:S},s),o("button",{type:"button",style:z,onClick:n,"aria-label":"Close drawer"},"\xD7"))),I.push(o("div",{style:k},u));let C=[];return a&&C.push(o("div",{style:m,onClick:w})),C.push(o("div",{ref:p,style:f,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...I)),o("div",null,...C)}var $i={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function zi(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,h=ie(null);if(se(()=>{if(!t)return;let w=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=w}},[t]),se(()=>{if(!t||!a)return;let w=I=>{I.key==="Escape"&&n()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[t,a,n]),se(()=>{t&&h.current&&h.current.focus()},[t]),!t)return null;let g={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},c={backgroundColor:"#fff",borderRadius:i==="full"?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:i==="full"?"100vh":"90vh",width:$i[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},p={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},m={padding:"24px",overflow:"auto",flex:"1"},f={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},b=w=>{s&&w.target===w.currentTarget&&n()},S=[],z=r?"modal-title":void 0;r?S.push(o("h2",{id:z,style:p},r)):S.push(o("span",null)),d&&S.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let k=[o("div",{style:x},...S),o("div",{style:m},u)];return l&&k.push(o("div",{style:f},l)),o("div",{style:g,onClick:b,"aria-modal":"true",role:"dialog","aria-labelledby":z},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...k))}var xn=8;function Ri(e,t){let n=t+xn;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function Ei(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${xn}px`,r="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} #fff ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} #fff ${r} ${r}`}}}function Ii(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[h,g]=X(!1),c=u?r:h,x=ie(null),p=$(()=>{u?d&&d(!r):g(z=>!z)},[u,r,d]);se(()=>{if(!c||!l)return;let z=k=>{x.current&&!x.current.contains(k.target)&&(u?d&&d(!1):g(!1))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},m={...Ri(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},f=[n];a&&f.push(o("div",{style:Ei(i)}));let b=$(z=>{let k=z.key;(k==="Enter"||k===" ")&&(z.preventDefault(),p())},[p]),S=[o("div",{onClick:p,onKeyDown:b,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&S.push(o("div",{style:m},...f)),o("div",{ref:x,style:y},...S)}var Pi=0;function Ti(){return`toast-${++Pi}-${Date.now()}`}function yn(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let h=Ti();return n=[{id:h,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),h}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var Di={info:{bg:"#eff6ff",border:"#3b82f6",icon:"\u2139\uFE0F"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"\u2705"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"\u26A0\uFE0F"},error:{bg:"#fef2f2",border:"#ef4444",icon:"\u274C"}};function Ai(e){let t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),r=e.startsWith("bottom"),i=e.endsWith("left"),s=e.endsWith("right"),a=e.endsWith("center");return n&&(t.top="0"),r&&(t.bottom="0",t.flexDirection="column-reverse"),i&&(t.left="0"),s&&(t.right="0"),a&&(t.left="50%",t.transform="translateX(-50%)"),t}function Li(e){let{item:t,onDismiss:n}=e,r=Di[t.type];se(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},a={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function Sn(e){let{toaster:t}=e,[,n]=X(0);se(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=Ai(t.config.position);se(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let d=document.createElement("style");return d.id=l,d.textContent=`
3
+ @keyframes specifyjs-toast-slide-in {
4
+ from { opacity: 0; transform: translateY(-12px); }
5
+ to { opacity: 1; transform: translateY(0); }
6
+ }
7
+ `,document.head.appendChild(d),()=>{let u=document.getElementById(l);u&&u.remove()}},[]);let s=$(l=>t.dismiss(l),[t]),a=r.map(l=>o(Li,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function Wi(e={}){let t=ie(null);t.current||(t.current=yn(e));let n=t.current,r=$(()=>o(Sn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Fi=6,Ni=8;function Bi(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Ni;switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.top-i}px`,transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+i}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:`${e.left-i}px`,top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+i}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}function Hi(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Fi}px`,r="transparent",i="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${i} ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} ${i} ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} ${i}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} ${i} ${r} ${r}`}}}function Oi(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=X(!1),[d,u]=X(null),h=ie(null),g=ie(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,x=$(()=>{g.current=setTimeout(()=>{if(h.current){let b=h.current.getBoundingClientRect();u(Bi(b,n))}l(!0)},r)},[r,n]),p=$(()=>{g.current&&(clearTimeout(g.current),g.current=null),l(!1)},[]);se(()=>()=>{g.current&&clearTimeout(g.current)},[]);let y={display:"inline-block"},m={...d??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},f=[o("div",{ref:h,style:y,onMouseEnter:x,onMouseLeave:p,onFocus:x,onBlur:p,"aria-describedby":a?c:void 0},s)];return a&&d&&f.push(o("div",{id:c,style:m,role:"tooltip"},t,o("div",{style:Hi(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...f)}function kn(e,t,n,r,i){return q(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:d=>t===0?0:d/t*n,categoryScale:d=>i+d*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function _i(e,t,n){if(t&&t.length>0){if(n){let s=0;for(let a of t)for(let l of a.values)l.value>s&&(s=l.value);return s}let i=0;for(let s of t){let a=0;for(let l of s.values)a+=l.value;a>i&&(i=a)}return i}let r=0;for(let i of e)i.value>r&&(r=i.value);return r}function Vi(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Yi(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var wn=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function vn(e,t){return t||wn[e%wn.length]}function Gi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:h="#e5e7eb",title:g,padding:c=50,animate:x=!1,stacked:p,grouped:y=!1}=e,m=i==="vertical",f=n-c*2,b=r-c*2,S=m?b:f,z=m?f:b,k=p!==void 0&&p.length>0,w=q(()=>k?Yi(p):[],[k,p]),I=k?p.length:t.length,C=q(()=>_i(t,p,y),[t,p,y]),R=C>0?C:1,M=kn(I,R,S,z,a),F=$(()=>{if(!u)return[];let V=Vi(R),G=[];for(let K=V;K<=R;K+=V){let ee=M.valueScale(K);if(m){let J=c+b-ee;G.push(o("line",{key:`grid-${K}`,x1:String(c),y1:String(J),x2:String(c+f),y2:String(J),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),G.push(o("text",{key:`grid-label-${K}`,x:String(c-6),y:String(J+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}else{let J=c+ee;G.push(o("line",{key:`grid-${K}`,x1:String(J),y1:String(c),x2:String(J),y2:String(c+b),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),G.push(o("text",{key:`grid-label-${K}`,x:String(J),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}}return G},[u,R,M,m,c,f,b,h]),A=$(()=>{let V=[];return m?(V.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),V.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+f),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"}))):(V.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+f),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),V.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"}))),V},[m,c,f,b]),H=$(()=>{let V=[];for(let G=0;G<t.length;G++){let K=t[G],ee=M.valueScale(K.value),J=M.categoryScale(G),Y=K.color??s,U,_,O=String(K.value);if(m){let Z=c+J,Q=c+b-ee;U={x:String(Z),y:String(Q),width:String(M.barThickness),height:String(ee),rx:String(l),ry:String(l),fill:Y},_={x:String(Z+M.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let Z=c+J,Q=c;U={x:String(Q),y:String(Z),width:String(ee),height:String(M.barThickness),rx:String(l),ry:String(l),fill:Y},_={x:String(Q+ee+6),y:String(Z+M.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(x&&(U.style=m?`animation: barGrow 0.6s ease-out ${G*.05}s both`:`animation: barGrow 0.6s ease-out ${G*.05}s both`),V.push(o("rect",{key:`bar-${G}`,...U})),d&&V.push(o("text",{key:`val-${G}`,..._},O)),m){let Z=c+J+M.barThickness/2,Q=c+b+16;V.push(o("text",{key:`cat-${G}`,x:String(Z),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Z}, ${Q})`},K.label))}else V.push(o("text",{key:`cat-${G}`,x:String(c-6),y:String(c+J+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return V},[t,M,s,l,d,x,m,c,b]),L=$(()=>{if(!p)return[];let V=[];for(let G=0;G<p.length;G++){let K=p[G],ee=M.categoryScale(G),J=0;for(let Y=0;Y<K.values.length;Y++){let U=K.values[Y],_=M.valueScale(U.value),O=M.valueScale(J),Z=vn(Y,U.color);if(m){let Q=c+ee,oe=c+b-O-_;V.push(o("rect",{key:`sbar-${G}-${Y}`,x:String(Q),y:String(oe),width:String(M.barThickness),height:String(_),rx:Y===K.values.length-1?String(l):"0",ry:Y===K.values.length-1?String(l):"0",fill:Z,...x?{style:`animation: barGrow 0.6s ease-out ${(G*K.values.length+Y)*.03}s both`}:{}})),d&&_>14&&V.push(o("text",{key:`sval-${G}-${Y}`,x:String(Q+M.barThickness/2),y:String(oe+_/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(U.value)))}else{let Q=c+O,oe=c+ee;V.push(o("rect",{key:`sbar-${G}-${Y}`,x:String(Q),y:String(oe),width:String(_),height:String(M.barThickness),rx:Y===K.values.length-1?String(l):"0",ry:Y===K.values.length-1?String(l):"0",fill:Z,...x?{style:`animation: barGrow 0.6s ease-out ${(G*K.values.length+Y)*.03}s both`}:{}})),d&&_>20&&V.push(o("text",{key:`sval-${G}-${Y}`,x:String(Q+_/2),y:String(oe+M.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(U.value)))}J+=U.value}if(d){let Y=M.valueScale(J);m?V.push(o("text",{key:`stotal-${G}`,x:String(c+ee+M.barThickness/2),y:String(c+b-Y-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(J))):V.push(o("text",{key:`stotal-${G}`,x:String(c+Y+6),y:String(c+ee+M.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(J)))}if(m){let Y=c+ee+M.barThickness/2,U=c+b+16;V.push(o("text",{key:`scat-${G}`,x:String(Y),y:String(U),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Y}, ${U})`},K.label))}else V.push(o("text",{key:`scat-${G}`,x:String(c-6),y:String(c+ee+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return V},[p,M,l,d,x,m,c,b]),P=$(()=>{if(!p)return[];let V=w.length,G=[];for(let K=0;K<p.length;K++){let ee=p[K],J=M.categoryScale(K),Y=2,U=Math.max(1,(M.barThickness-Y*(V-1))/V);for(let _=0;_<ee.values.length;_++){let O=ee.values[_],Z=w.indexOf(O.category),Q=Z*(U+Y),oe=M.valueScale(O.value),j=vn(Z>=0?Z:_,O.color);if(m){let te=c+J+Q,re=c+b-oe;G.push(o("rect",{key:`gbar-${K}-${_}`,x:String(te),y:String(re),width:String(U),height:String(oe),rx:String(l),ry:String(l),fill:j,...x?{style:`animation: barGrow 0.6s ease-out ${(K*V+_)*.04}s both`}:{}})),d&&G.push(o("text",{key:`gval-${K}-${_}`,x:String(te+U/2),y:String(re-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(O.value)))}else{let te=c,re=c+J+Q;G.push(o("rect",{key:`gbar-${K}-${_}`,x:String(te),y:String(re),width:String(oe),height:String(U),rx:String(l),ry:String(l),fill:j,...x?{style:`animation: barGrow 0.6s ease-out ${(K*V+_)*.04}s both`}:{}})),d&&G.push(o("text",{key:`gval-${K}-${_}`,x:String(te+oe+4),y:String(re+U/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(O.value)))}}if(m){let _=c+J+M.barThickness/2,O=c+b+16;G.push(o("text",{key:`gcat-${K}`,x:String(_),y:String(O),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${_}, ${O})`},ee.label))}else G.push(o("text",{key:`gcat-${K}`,x:String(c-6),y:String(c+J+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},ee.label))}return G},[p,w,M,l,d,x,m,c,b]),v=$(()=>g?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n,c]),D=$(()=>x?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},m?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[x,m]),E=F(),W=A(),T=v(),N=D(),B;return k&&y?B=P():k?B=L():B=H(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...N,...T,...E,...W,...B)}function Fe(e){let{start:t,end:n,step:r}=e;if(r<=0||!isFinite(r))return[];let i=Math.ceil((n-t)/r)+1;if(i>1e6)return[];let s=[];for(let a=0;a<i;a++){let l=t+a*r;if(l>n+r*.001)break;s.push(l)}return s}function Qe(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e(i);isFinite(s)&&n.push({input:i,output:s})}return n}function et(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let h=t[u],g=e(h);isFinite(g)&&a.push({input:h,output:g})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),Cn(l)};return Cn(l),()=>{i=!0}}function Cn(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Ui(e,t){let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return(i<1.5?1:i<3?2:i<7?5:10)*r}function Mn(e,t){let n=t-e;if(n<=0)return[e];let r=Ui(n,8),i=Math.ceil(e/r)*r,s=[];for(let a=i;a<=t+r*.001;a+=r)s.push(Math.round(a*1e10)/1e10);return s}function $n(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var ge=40,zn=1.1,Rn=.01,En=1e6;function ji(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:h=!0,showAxes:g=!0,pointRadius:c=3,pointColor:x="#3b82f6",curveColor:p="#3b82f6",gridColor:y="#e2e8f0",axisColor:m="#94a3b8",onPointClick:f,onPointDoubleClick:b,onPointContextMenu:S,onPointHover:z}=e,[k,w]=X(d[0]),[I,C]=X(d[1]),[R,M]=X(u[0]),[F,A]=X(u[1]),H=ie(!1),L=ie(null),P=$(O=>ge+(O-k)/(I-k)*(t-2*ge),[k,I,t]),v=$(O=>n-ge-(O-R)/(F-R)*(n-2*ge),[R,F,n]),D=$(O=>k+(O-ge)/(t-2*ge)*(I-k),[k,I,t]),E=$(O=>R+(n-ge-O)/(n-2*ge)*(F-R),[R,F,n]),W=$(O=>{let Z=O;H.current=!0,L.current={mx:Z.clientX,my:Z.clientY,x0:k,x1:I,y0:R,y1:F}},[k,I,R,F]),T=$(O=>{if(!H.current||!L.current)return;let Z=O,Q=L.current,oe=Z.clientX-Q.mx,j=Z.clientY-Q.my,te=oe/(t-2*ge)*(Q.x1-Q.x0),re=j/(n-2*ge)*(Q.y1-Q.y0);w(Q.x0-te),C(Q.x1-te),M(Q.y0+re),A(Q.y1+re)},[t,n]),N=$(()=>{H.current=!1,L.current=null},[]),B=$(O=>{let Z=O;Z.preventDefault();let Q=Z.currentTarget.getBoundingClientRect(),oe=Z.clientX-Q.left,j=Z.clientY-Q.top,te=D(oe),re=E(j),ae=Z.deltaY>0?zn:1/zn,ne=(I-k)*ae,ce=(F-R)*ae;if(ne<Rn||ce<Rn||ne>En||ce>En)return;let de=(te-k)/(I-k),le=(re-R)/(F-R);w(te-de*ne),C(te+(1-de)*ne),M(re-le*ce),A(re+(1-le)*ce)},[k,I,R,F,D,E]),V=[];if(V.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let O=Mn(k,I),Z=Mn(R,F);for(let Q=0;Q<O.length;Q++){let oe=P(O[Q]);V.push(o("line",{x1:oe,y1:ge,x2:oe,y2:n-ge,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),V.push(o("text",{x:oe,y:n-ge+14,"text-anchor":"end","font-size":10,fill:m,transform:`rotate(-45, ${oe}, ${n-ge+14})`,key:`lx-${Q}`},$n(O[Q])))}for(let Q=0;Q<Z.length;Q++){let oe=v(Z[Q]);V.push(o("line",{x1:ge,y1:oe,x2:t-ge,y2:oe,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),V.push(o("text",{x:ge-6,y:oe+3,"text-anchor":"end","font-size":10,fill:m,key:`ly-${Q}`},$n(Z[Q])))}}if(g){let O=Math.max(ge,Math.min(t-ge,P(0))),Z=Math.max(ge,Math.min(n-ge,v(0)));V.push(o("line",{x1:ge,y1:Z,x2:t-ge,y2:Z,stroke:m,"stroke-width":1,key:"x-axis"})),V.push(o("line",{x1:O,y1:ge,x2:O,y2:n-ge,stroke:m,"stroke-width":1,key:"y-axis"}))}let G=q(()=>{if(!i||!l)return[];let O=a??(I-k)/s,Z=Fe({start:k,end:I,step:O});return Qe(i,Z)},[i,k,I,a,s,l]),[K,ee]=X([]),J=ie(null);se(()=>{if(!i||l){ee([]);return}let O=a??(I-k)/s,Z=Fe({start:k,end:I,step:O});return J.current&&J.current(),J.current=et(i,Z,200,Q=>{ee([...Q])}),()=>{J.current&&J.current()}},[i,k,I,a,s,l]);let Y=l?G:K;if(Y.length>0){let O=[];for(let Z=0;Z<Y.length;Z++){let Q=Y[Z],oe=P(Q.input),j=v(Q.output);O.push(`${O.length===0?"M":"L"}${oe},${j}`)}V.push(o("path",{d:O.join(" "),fill:"none",stroke:p,"stroke-width":1.5,key:"curve"}))}let U=(O,Z,Q,oe)=>{if(Z)return j=>Z({x:oe.x,y:oe.y,index:Q,event:j})};for(let O=0;O<r.length;O++){let Z=r[O],Q=P(Z.x),oe=v(Z.y),j={cx:Q,cy:oe,r:c,fill:x,cursor:"pointer",key:`pt-${O}`};f&&(j.onClick=U("click",f,O,Z)),b&&(j.onDblClick=U("dblclick",b,O,Z)),S&&(j.onContextMenu=U("contextmenu",S,O,Z)),z&&(j.onMouseOver=U("mouseover",z,O,Z)),V.push(o("circle",j))}let _=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:ge,y:ge,width:t-2*ge,height:n-2*ge})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:W,onMouseMove:T,onMouseUp:N,onMouseLeave:N,onWheel:B},_,...V)}function Pn(e,t,n){let r=0,i=0;for(let s=0;s<n;s++){let a=r*r,l=i*i;if(a+l>4)return s;i=2*r*i+t,r=a-l+e}return n}function In(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,h=0,g=0,c=0;return i<60?(h=l,g=d):i<120?(h=d,g=l):i<180?(g=l,c=d):i<240?(g=d,c=l):i<300?(h=d,c=l):(h=l,c=d),[Math.floor((h+u)*255),Math.floor((g+u)*255),Math.floor((c+u)*255)]}function Xi(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Pn){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let h=0;h<e;h++){let g=n[0]+h/e*(n[1]-n[0]);d.push(s(g,u,i))}a.push(d)}return a}function qi(e){let{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:s=100,colorScheme:a="classic",computeFunction:l=Pn,data:d,resolution:u=2,onPointClick:h,onPointHover:g,onPointDoubleClick:c,onPointContextMenu:x}=e;if(d){let E=d.length,W=E>0?d[0].length:0,T=W>0?t/W:1,N=E>0?n/E:1,B=[];for(let V=0;V<E;V++){let G=d[V];for(let K=0;K<W;K++){let ee=G[K]??0,[J,Y,U]=In(ee,s,a);B.push(o("rect",{key:`${V}-${K}`,x:String(K*T),y:String(V*N),width:String(Math.ceil(T)),height:String(Math.ceil(N)),fill:`rgb(${J},${Y},${U})`}))}}return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},...B)}let[p,y]=X(r[0]),[m,f]=X(r[1]),[b,S]=X(i[0]),[z,k]=X(i[1]),w=ie(null),I=ie(!1),C=ie(null),R=$((E,W)=>{let T=p+E/t*(m-p),N=z-W/n*(z-b);return{re:T,im:N}},[p,m,b,z,t,n]);se(()=>{let E=w.current;if(!E)return;let W=E.getContext("2d");if(!W)return;let T=W.createImageData(t,n),N=T.data;for(let B=0;B<n;B++)for(let V=0;V<t;V++){let{re:G,im:K}=R(V,B),ee=l(G,K,s),[J,Y,U]=In(ee,s,a),_=(B*t+V)*4;N[_]=J,N[_+1]=Y,N[_+2]=U,N[_+3]=255}W.putImageData(T,0,0)},[p,m,b,z,t,n,s,a,l,R]);let M=$(E=>{let W=E.target.getBoundingClientRect(),T=E.clientX-W.left,N=E.clientY-W.top,{re:B,im:V}=R(T,N),G=l(B,V,s);return{re:B,im:V,iterations:G,event:E}},[R,l,s]),F=$(E=>{I.current=!0,C.current={x:E.clientX,y:E.clientY,rMin:p,rMax:m,iMin:b,iMax:z}},[p,m,b,z]),A=$(E=>{if(g&&g(M(E)),!I.current||!C.current)return;let W=C.current,T=E.clientX-W.x,N=E.clientY-W.y,B=(W.rMax-W.rMin)/t,V=(W.iMax-W.iMin)/n;y(W.rMin-T*B),f(W.rMax-T*B),S(W.iMin+N*V),k(W.iMax+N*V)},[t,n,g,M]),H=$(()=>{I.current=!1},[]),L=$(E=>{E.preventDefault();let W=E.deltaY>0?1.15:1/1.15,T=E.target.getBoundingClientRect(),N=E.clientX-T.left,B=E.clientY-T.top,{re:V,im:G}=R(N,B);y(V+(p-V)*W),f(V+(m-V)*W),S(G+(b-G)*W),k(G+(z-G)*W)},[R,p,m,b,z]),P=$(E=>{h&&h(M(E))},[h,M]),v=$(E=>{c&&c(M(E))},[c,M]),D=$(E=>{E.preventDefault(),x&&x(M(E))},[x,M]);return o("canvas",{ref:w,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:F,onMouseMove:A,onMouseUp:H,onMouseLeave:H,onWheel:L,onClick:P,onDblClick:v,onContextMenu:D})}function Tn(e,t,n){if(e===t)return[e];let r=(t-e)/(n-1),i=[];for(let s=0;s<n;s++){let a=e+r*s;i.push(Math.round(a*1e10)/1e10)}return i}function Ki(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,h=y=>r+(y-i)/(s-i)*d,g=y=>n-r-(y-a)/(l-a)*u,c=6,x=Tn(i,s,c),p=Tn(a,l,c);return{xScale:h,yScale:g,xTicks:x,yTicks:p,xMin:i,xMax:s,yMin:a,yMax:l}}function Ln(e,t,n,r){return q(()=>Ki(e,t,n,r),[e,t,n,r])}function Dn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function An(e,t,n,r,i,s,a){let l={fill:i,key:s,...a};switch(e){case"square":return o("rect",{...l,x:t-r,y:n-r,width:r*2,height:r*2});case"diamond":{let d=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...l,points:d})}case"triangle":{let d=r*1.15,u=`${t},${n-d} ${t+r},${n+r*.6} ${t-r},${n+r*.6}`;return o("polygon",{...l,points:u})}case"triangle-down":{let d=r*1.15,u=`${t-r},${n-r*.6} ${t+r},${n-r*.6} ${t},${n+d}`;return o("polygon",{...l,points:u})}case"cross":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t-r},${n-r}L${t+r},${n+r}M${t+r},${n-r}L${t-r},${n+r}`})}case"plus":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}case"circle":default:return o("circle",{...l,cx:t,cy:n,r})}}function Zi(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:h=!0,showArea:g=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:x,yLabel:p,title:y,padding:m=50,animate:f=!1,multiLine:b}=e,S=q(()=>{let F=[...t];if(b)for(let A of b)F.push(...A.data);return F},[t,b]),z=Ln(S,n,r,m),{xScale:k,yScale:w,xTicks:I,yTicks:C}=z,R=[];if(R.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let F=0;F<I.length;F++){let A=k(I[F]);R.push(o("line",{x1:A,y1:m,x2:A,y2:r-m,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${F}`}))}for(let F=0;F<C.length;F++){let A=w(C[F]);R.push(o("line",{x1:m,y1:A,x2:n-m,y2:A,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${F}`}))}}R.push(o("line",{x1:m,y1:r-m,x2:n-m,y2:r-m,stroke:"#374151","stroke-width":1,key:"x-axis"})),R.push(o("line",{x1:m,y1:m,x2:m,y2:r-m,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let F=0;F<I.length;F++){let A=k(I[F]);R.push(o("line",{x1:A,y1:r-m,x2:A,y2:r-m+5,stroke:"#374151",key:`xtick-${F}`})),R.push(o("text",{x:A,y:r-m+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${A}, ${r-m+18})`,key:`xlabel-${F}`},Dn(I[F])))}for(let F=0;F<C.length;F++){let A=w(C[F]);R.push(o("line",{x1:m-5,y1:A,x2:m,y2:A,stroke:"#374151",key:`ytick-${F}`})),R.push(o("text",{x:m-10,y:A+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${F}`},Dn(C[F])))}function M(F,A,H,L,P,v,D,E,W,T){if(F.length===0)return;let N=[...F].sort((G,K)=>G.x-K.x);if(L){let G=w(z.yMin),K=N.map(U=>`${k(U.x)},${w(U.y)}`).join(" "),ee=k(N[0].x),J=k(N[N.length-1].x),Y=`${ee},${G} ${K} ${J},${G}`;R.push(o("polygon",{points:Y,fill:P,key:`${T}-area`}))}let V={points:N.map(G=>`${k(G.x)},${w(G.y)}`).join(" "),fill:"none",stroke:A,"stroke-width":H,"stroke-linejoin":"round","stroke-linecap":"round",key:`${T}-line`};if(f?(V["stroke-dasharray"]="1000",V["stroke-dashoffset"]="1000",R.push(o("polyline",V,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):R.push(o("polyline",V)),v)for(let G=0;G<N.length;G++){let K=k(N[G].x),ee=w(N[G].y),J=N[G].shape??W,Y=N[G].radius??E,U=`${T}-pt-${G}`;if(f){let _=An(J,K,ee,Y,D,U,{opacity:0});R.push(o("g",{key:`${U}-g`},_,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else R.push(An(J,K,ee,Y,D,U))}}if(M(t,i,s,g,c,u,l,a,d,"primary"),b)for(let F=0;F<b.length;F++){let A=b[F];M(A.data,A.color,s,!1,"transparent",u,A.color,A.pointRadius??a,A.pointShape??d,`series-${F}`)}if(b&&b.length>0){let F=[],A=[{color:i,label:"Primary"},...b.map((B,V)=>({color:B.color,label:B.label??`Series ${V+1}`}))],H=m+10,L=16,P=22,v=7.2,D=14,E=6,W=n-m*2-20,T=0,N=0;for(let B=0;B<A.length;B++){let V=A[B].label.length*v,G=D+E+V;T>0&&T+G>W&&(T=0,N+=P);let K=H+T,ee=m-30-N;F.push(o("rect",{x:K,y:ee,width:D,height:14,fill:A[B].color,rx:2,key:`legend-rect-${B}`})),F.push(o("text",{x:K+D+E,y:ee+12,"font-size":12,fill:"#374151",key:`legend-text-${B}`},A[B].label)),T+=G+L}R.push(o("g",{key:"legend"},...F))}return x&&R.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},x)),p&&R.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},p)),y&&R.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...R)}function Ji(e){let t=[];for(let n=0;n<e;n++){let r=Math.round(360*n/e);t.push(`hsl(${r}, 70%, 55%)`)}return t}function Qi(e,t){let n=t??Ji(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function Ne(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Wn(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=Ne(e,t,r,a),u=Ne(e,t,r,l),h=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,"Z"].join(" ");let g=Ne(e,t,n,l),c=Ne(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,`L ${g.x} ${g.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function Fn(e,t){let n=t?.padAngle??0,r=Qi(e,t?.colors),i=e.reduce((u,h)=>u+h.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let h=e[u],g=h.value/i*a,c=d+n/2,x=c+g;l.push({label:h.label,value:h.value,startAngle:c,endAngle:x,percentage:h.value/i*100,color:r[u]}),d=x+n/2}return l}function es(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:h,centerLabel:g,colors:c,strokeColor:x="#fff",strokeWidth:p=2,textColor:y="currentColor"}=e,m=d&&u==="right"?140:0,f=h?30:0,b=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,S=n-m,z=r-f-b,k=S/2,w=f+z/2,I=Math.min(S,z)/2-10,C=e.outerRadius??I,R=q(()=>Fn(t,{padAngle:s,colors:c}),[t,s,c]),M=[];h&&M.push(o("text",{key:"title",x:S/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},h));for(let F=0;F<R.length;F++){let A=R[F],H=Wn(k,w,i,C,A.startAngle,A.endAngle);if(M.push(o("path",{key:`slice-${F}`,d:H,fill:A.color,stroke:x,strokeWidth:p})),a||l){let L=(A.startAngle+A.endAngle)/2,P=A.percentage<5,v=P?C+14:i+(C-i)*.65,D=Ne(k,w,v,L-Math.PI/2),E=P?y:"#fff",W=P?11:12,T=[];if(a&&T.push(A.label),l&&T.push(`${A.percentage.toFixed(1)}%`),P){let N=Ne(k,w,C+2,L-Math.PI/2);M.push(o("line",{key:`connector-${F}`,x1:N.x,y1:N.y,x2:D.x,y2:D.y,stroke:"#999",strokeWidth:1}))}a&&M.push(o("text",{key:`label-${F}`,x:D.x,y:D.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:W,fill:E,pointerEvents:"none"},A.label)),l&&M.push(o("text",{key:`value-${F}`,x:D.x,y:D.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:W-1,fill:E,pointerEvents:"none"},`${A.percentage.toFixed(1)}%`))}}if(g&&i>0&&M.push(o("text",{key:"center-label",x:k,y:w,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},g)),d){let F=[];if(u==="right"){let A=S+10,H=f+20;for(let L=0;L<R.length;L++){let P=R[L],v=H+L*22;F.push(o("circle",{key:`legend-dot-${L}`,cx:A+6,cy:v,r:6,fill:P.color})),F.push(o("text",{key:`legend-text-${L}`,x:A+18,y:v,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${P.label} (${P.percentage.toFixed(1)}%)`))}}else{let A=r-b+10;for(let H=0;H<R.length;H++){let L=R[H],P=H%2,v=Math.floor(H/2),D=P*(n/2)+10,E=A+v*22;F.push(o("circle",{key:`legend-dot-${H}`,cx:D+6,cy:E,r:6,fill:L.color})),F.push(o("text",{key:`legend-text-${H}`,x:D+18,y:E,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${L.label} (${L.percentage.toFixed(1)}%)`))}}M.push(...F)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...M)}function Nn(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function ts(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:h=3,pointColor:g="#3b82f6",curveColor:c="#3b82f6",onPointClick:x,onPointDoubleClick:p,onPointContextMenu:y,onPointHover:m}=e,[f,b]=X(r[1]),[S,z]=X(0),[k,w]=X(0),[I,C]=X(null),R=t/2+S,M=n/2+k,A=Math.min(t,n)/2-30,H=A/f,L=q(()=>{let Y=Math.max(1,Math.ceil(f)),U=[],_=f/Y;for(let O=1;O<=Y;O++)U.push(_*O);return U},[f]),P=q(()=>{let Y=[];for(let U=0;U<360;U+=30)Y.push(U*Math.PI/180);return Y},[]),v=q(()=>{if(!i||!l)return[];let Y=a??2*Math.PI/s,U=Fe({start:0,end:2*Math.PI,step:Y});return Qe(i,U)},[i,s,a,l]),[D,E]=X([]),W=ie(null);se(()=>{if(!i||l){E([]);return}let Y=a??2*Math.PI/s,U=Fe({start:0,end:2*Math.PI,step:Y});return W.current&&W.current(),W.current=et(i,U,200,_=>{E([..._])}),()=>{W.current&&W.current()}},[i,s,a,l]);let T=l?v:D,N=q(()=>{if(T.length===0)return"";let Y=[];for(let U=0;U<T.length;U++){let _=T[U],O=_.output;if(O<0||!isFinite(O))continue;let{x:Z,y:Q}=Nn(O,_.input,R,M,H);Y.push(`${Y.length===0?"M":"L"}${Z.toFixed(2)},${Q.toFixed(2)}`)}return Y.join(" ")},[T,R,M,H]),B=$(Y=>{C({x:Y.clientX,y:Y.clientY,px:S,py:k})},[S,k]),V=$(Y=>{I&&(z(I.px+(Y.clientX-I.x)),w(I.py+(Y.clientY-I.y)))},[I]),G=$(()=>{C(null)},[]),K=$(Y=>{Y.preventDefault();let U=Y.deltaY>0?1.15:1/1.15;b(Math.max(.1,f*U))},[f]),ee=$((Y,U,_)=>{if(Y)return O=>Y({r:U.r,theta:U.theta,index:_,event:O})},[]),J=[];if(J.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let Y=0;Y<L.length;Y++){let U=L[Y]*H;J.push(o("circle",{cx:R,cy:M,r:U,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${Y}`})),J.push(o("text",{x:R+U+2,y:M-4,"font-size":10,fill:"#9ca3af",key:`gl-${Y}`},L[Y].toFixed(1)))}for(let Y=0;Y<P.length;Y++){let U=P[Y],_=L[L.length-1]*H,O=R+_*Math.cos(U),Z=M-_*Math.sin(U);J.push(o("line",{x1:R,y1:M,x2:O,y2:Z,stroke:"#e5e7eb","stroke-width":1,key:`al-${Y}`}));let Q=Math.round(U*180/Math.PI),oe=R+(_+14)*Math.cos(U),j=M-(_+14)*Math.sin(U);J.push(o("text",{x:oe,y:j+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${Y}`},`${Q}\xB0`))}}J.push(o("line",{x1:R-A,y1:M,x2:R+A,y2:M,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),J.push(o("line",{x1:R,y1:M-A,x2:R,y2:M+A,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),N&&J.push(o("path",{d:N,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let Y=0;Y<d.length;Y++){let U=d[Y],{x:_,y:O}=Nn(U.r,U.theta,R,M,H);J.push(o("circle",{cx:_,cy:O,r:h,fill:g,key:`pt-${Y}`,style:{cursor:"pointer"},onClick:ee(x,U,Y),onDblClick:ee(p,U,Y),onContextMenu:ee(y,U,Y),onMouseEnter:ee(m,U,Y)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:I?"grabbing":"grab"},onMouseDown:B,onMouseMove:V,onMouseUp:G,onMouseLeave:G,onWheel:K},...J)}function Bn(e){let t=1<<e,n=[];for(let r=0;r<t;r++){let i=[];for(let s=0;s<e;s++)i.push((r>>s&1)*2-1);n.push({coords:i})}return n}function Hn(e){let t=1<<e,n=[];for(let r=0;r<t;r++)for(let i=0;i<e;i++){let s=r^1<<i;s>r&&n.push({source:r,target:s})}return n}function On(e,t){let n=_n(e),r=0;for(let i=0;i<e;i++)for(let s=i+1;s<e;s++){if(r<t.length){let a=t[r];n=os(n,ns(e,i,s,a))}r++}return n}function _n(e){let t=[];for(let n=0;n<e;n++){let r=new Array(e).fill(0);r[n]=1,t.push(r)}return t}function ns(e,t,n,r){let i=_n(e),s=Math.cos(r),a=Math.sin(r);return i[t][t]=s,i[t][n]=-a,i[n][t]=a,i[n][n]=s,i}function os(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let s=new Array(n).fill(0);for(let a=0;a<n;a++)for(let l=0;l<n;l++)s[a]+=e[i][l]*t[l][a];r.push(s)}return r}function Vn(e,t){let n=e.length,r=new Array(n).fill(0);for(let i=0;i<n;i++)for(let s=0;s<n;s++)r[i]+=e[i][s]*t.coords[s];return r}function Yn(e,t=0){let n=e[0]??0,r=e[1]??0,i=0;for(let s=2;s<e.length;s++)i+=e[s]??0;if(e.length>2&&(i/=e.length-2),t>0){let s=1/(1+t*(i+2));return{x:n*s,y:r*s,depth:i}}return{x:n,y:r,depth:i}}function tt(e,t=[],n=.3,r=1){let i=Bn(e),s=Hn(e),a=On(e,t);return{vertices:i.map((d,u)=>{let h=Vn(a,d),g=Yn(h,n);return{id:u,position:d,x:g.x*r,y:g.y*r,depth:g.depth}}),edges:s,dimension:e}}function nt(e){return e*(e-1)/2}function vt(e,t=70,n=55){let r=[];for(let i=0;i<e;i++){let s=Math.round(360*i/e);r.push(`hsl(${s}, ${t}%, ${n}%)`)}return r}function rs(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,h=e.backgroundColor??"transparent",g=e.scale??Math.min(n,r)*.3,c=nt(t),x=1<<t,p=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?vt(x):e.vertexColors,[x,e.vertexColors]),[y,m]=X(()=>{let E=[];for(let W=0;W<c;W++)E.push(0);return E}),[f,b]=X(!1),S=ie({x:0,y:0}),z=ie([]),k=ie(0);se(()=>{if(d===0)return;let E=!0,W=()=>{E&&(m(T=>{let N=T.slice();for(let B=0;B<N.length;B++)N[B]=(N[B]??0)+d*(1+B*.3);return N}),k.current=requestAnimationFrame(W))};return k.current=requestAnimationFrame(W),()=>{E=!1,cancelAnimationFrame(k.current)}},[d]);let w=q(()=>tt(t,y,l,g),[t,y,l,g]),I=n/2,C=r/2,R=q(()=>w.edges.map(E=>{let W=w.vertices[E.source],T=w.vertices[E.target],N=(W.depth+T.depth)/2;return{...E,avgDepth:N,sv:W,tv:T}}).sort((E,W)=>E.avgDepth-W.avgDepth),[w]),M=q(()=>w.vertices.slice().sort((E,W)=>E.depth-W.depth),[w]),F=$(E=>{let W=E;b(!0),S.current={x:W.clientX,y:W.clientY},z.current=y.slice()},[y]),A=$(E=>{if(!f)return;let W=E,T=(W.clientX-S.current.x)*.01,N=(W.clientY-S.current.y)*.01;m(()=>{let B=z.current.slice();return B.length>0&&(B[0]=(B[0]??0)+T),B.length>1&&(B[1]=(B[1]??0)+N),B})},[f]),H=$(()=>{b(!1)},[]),L=E=>{let W=(E+2)/4;return .3+.7*Math.max(0,Math.min(1,W))},P=E=>{let W=(E+2)/4;return .6+.4*Math.max(0,Math.min(1,W))},v=R.map((E,W)=>{let T=L(E.avgDepth);return o("line",{key:`e-${E.source}-${E.target}`,x1:String(I+E.sv.x),y1:String(C+E.sv.y),x2:String(I+E.tv.x),y2:String(C+E.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(T),"stroke-linecap":"round"})}),D=M.map(E=>{let W=i*P(E.depth),T=p[E.id%p.length]??"#3b82f6",N=[o("circle",{key:`v-${E.id}-circle`,cx:String(I+E.x),cy:String(C+E.y),r:String(W),fill:T,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&N.push(o("text",{key:`v-${E.id}-label`,x:String(I+E.x),y:String(C+E.y+W+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},E.id.toString(2).padStart(t,"0"))),N});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:f?"grabbing":"grab",userSelect:"none"},onMouseDown:F,onMouseMove:A,onMouseUp:H,onMouseLeave:H},...v,...D.flat())}function is(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=nt(t),[a,l]=X(()=>new Array(s).fill(0));return se(()=>{if(n===0)return;let u=!0,h=0,g=()=>{u&&(l(c=>c.map((x,p)=>x+n*(1+p*.3))),h=requestAnimationFrame(g))};return h=requestAnimationFrame(g),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:q(()=>tt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function ss(e){let t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",s=e.gap??"12px",a=e.contain??"layout style paint",l={display:"flex",flexDirection:ls(t,n),gap:s,width:typeof e.width=="number"?`${e.width}px`:e.width??"auto",height:typeof e.height=="number"?`${e.height}px`:e.height??"auto",backgroundColor:e.backgroundColor??"#ffffff",border:e.border??"1px solid #e5e7eb",borderRadius:e.borderRadius??"8px",padding:e.padding??"16px",fontFamily:e.fontFamily??"inherit",contain:a,overflow:"hidden",position:"relative",boxSizing:"border-box",...e.boxShadow?{boxShadow:e.boxShadow}:{},...e.style??{}},d=e.title?o("div",{className:"viz-title",style:{fontSize:e.titleFontSize??"16px",fontWeight:e.titleFontWeight??"600",color:e.titleColor??"#1f2937",textAlign:r,flexShrink:"0"}},e.title):null,u=e.legend&&e.legend.length>0?cs(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,h=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),g=as(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...g)}function ls(e,t){return"column"}function as(e,t,n,r,i){let s=[];if(r==="top"&&e&&s.push(e),i==="left"||i==="right"){let a=[];i==="left"&&n&&a.push(n),r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),i==="right"&&n&&a.push(n),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if(r==="left"||r==="right"){i==="top"&&n&&s.push(n);let a=[];r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),i==="bottom"&&n&&s.push(n)}else i==="top"&&n&&s.push(n),s.push(t),i==="bottom"&&n&&s.push(n);return r==="bottom"&&e&&s.push(e),s}function cs(e,t){return o("div",{className:"viz-legend",style:{display:"flex",flexDirection:t.direction,flexWrap:"wrap",gap:`${t.gap}px`,justifyContent:t.align,alignItems:"center",fontSize:t.fontSize,color:"#6b7280",flexShrink:"0"}},...e.map((n,r)=>o("div",{key:`legend-${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},ds(n),o("span",null,n.label))))}function ds(e){let t=e.shape??"circle";return t==="line"?o("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},o("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):t==="square"?o("div",{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}):o("div",{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}function us(e){if(typeof document>"u")return;let t="specifyjs-gtag";if(document.getElementById(t))return;let n=document.createElement("script");n.id=t,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(n)}function fs(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function gs(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return se(()=>{if(n||typeof window>"u")return;us(t),fs();let a={...s};return i&&(a.anonymize_ip=!0),r&&(a.debug_mode=!0),window.gtag&&window.gtag("config",t,a),()=>{let l=document.getElementById("specifyjs-gtag");l&&l.remove()}},[t,n,r,i]),null}function ps(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:h,ariaLabel:g="Site footer"}=e;return o("footer",{className:h,role:"contentinfo","aria-label":g,style:{borderTop:i,background:s,color:a,fontSize:l,padding:d,marginTop:"48px"}},o("div",{className:"footer-inner",style:{maxWidth:u,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{className:"footer-section",style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}var jn=Ut({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null}),ms={width:600,height:400},hs={x:30,y:30},bs={top:0,left:0,width:1920,height:1080},kt=1e3;function Gn(e,t,n,r){let i=n.left+e*t.x,s=n.top+e*t.y,a=n.left+n.width-r.width,l=n.top+n.height-r.height;return a>n.left&&i>a&&(i=n.left+(i-n.left)%Math.max(1,a-n.left)),l>n.top&&s>l&&(s=n.top+(s-n.top)%Math.max(1,l-n.top)),{x:i,y:s}}function Ct(e){let t=[...e].sort((r,i)=>r.zIndex-i.zIndex),n=[];for(let r=0;r<t.length;r++)n.push({...t[r],zIndex:r+1});return n}function Un(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r];i.id!==t&&i.windowState!=="minimized"&&(n===null||i.zIndex>n.zIndex)&&(n=i)}return n}function Mt(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function $t(e){let t=e.workspaceBounds??bs,n=e.defaultWindowSize??ms,r=e.cascadeOffset??hs,[i,s]=X([]),a=$(((...S)=>{let z=S[0];s(k=>{if(k.find(H=>H.id===z.id)){let L=Mt(k)+1,P=k.map(v=>v.id===z.id?{...v,focused:!0,zIndex:L,windowState:v.windowState==="minimized"?"normal":v.windowState}:{...v,focused:!1});return L>kt&&(P=Ct(P)),P}let I=z.size??n,C=z.position??Gn(k.length,r,t,I),M=Mt(k)+1,F={id:z.id,title:z.title,icon:z.icon,position:C,size:I,windowState:"normal",zIndex:M,focused:!0,appProps:z.appProps},A=k.map(H=>({...H,focused:!1}));return A.push(F),M>kt&&(A=Ct(A)),e.onWindowOpen&&e.onWindowOpen(z.id),e.onFocusChange&&e.onFocusChange(z.id),A})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=$(((...S)=>{let z=S[0];s(k=>{let w=k.find(C=>C.id===z);if(!w)return k;let I=k.filter(C=>C.id!==z);if(w.focused&&I.length>0){let C=Un(I,z);if(C){let R=I.map(M=>({...M,focused:M.id===C.id}));return e.onWindowClose&&e.onWindowClose(z),e.onFocusChange&&e.onFocusChange(C.id),R}}return e.onWindowClose&&e.onWindowClose(z),I.length===0&&e.onFocusChange&&e.onFocusChange(null),I})}),[e.onWindowClose,e.onFocusChange]),d=$(((...S)=>{let z=S[0];s(k=>{if(!k.find(M=>M.id===z))return k;let C=Mt(k)+1,R=k.map(M=>M.id===z?{...M,focused:!0,zIndex:C}:{...M,focused:!1});return C>kt&&(R=Ct(R)),e.onFocusChange&&e.onFocusChange(z),R})}),[e.onFocusChange]),u=$(((...S)=>{let z=S[0];s(k=>{let w=k.find(C=>C.id===z);if(!w)return k;let I=k.map(C=>C.id===z?{...C,windowState:"minimized",focused:!1}:C);if(w.focused){let C=Un(I,z);C?(I=I.map(R=>({...R,focused:R.id===C.id})),e.onFocusChange&&e.onFocusChange(C.id)):e.onFocusChange&&e.onFocusChange(null)}return I})}),[e.onFocusChange]),h=$(((...S)=>{let z=S[0];s(k=>k.map(w=>w.id===z?{...w,windowState:"maximized"}:w))}),[]),g=$(((...S)=>{let z=S[0];s(k=>k.map(w=>w.id===z?{...w,windowState:"normal"}:w))}),[]),c=$(((...S)=>{let z=S[0],k=S[1];s(w=>w.map(I=>I.id===z?{...I,position:k}:I))}),[]),x=$(((...S)=>{let z=S[0],k=S[1];s(w=>w.map(I=>I.id===z?{...I,size:k}:I))}),[]),p=$(((...S)=>{s(z=>{let k=z.filter(C=>C.windowState!=="minimized");if(k.length===0)return z;let w=k.length,I=new Map;if(w===1)I.set(k[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(w===2){let C=Math.floor(t.width/2);I.set(k[0].id,{position:{x:t.left,y:t.top},size:{width:C,height:t.height}}),I.set(k[1].id,{position:{x:t.left+C,y:t.top},size:{width:t.width-C,height:t.height}})}else if(w===3){let C=Math.floor(t.width/2),R=Math.floor(t.height/2);I.set(k[0].id,{position:{x:t.left,y:t.top},size:{width:C,height:t.height}}),I.set(k[1].id,{position:{x:t.left+C,y:t.top},size:{width:t.width-C,height:R}}),I.set(k[2].id,{position:{x:t.left+C,y:t.top+R},size:{width:t.width-C,height:t.height-R}})}else{let C=Math.ceil(Math.sqrt(w)),R=Math.ceil(w/C),M=Math.floor(t.width/C),F=Math.floor(t.height/R);for(let A=0;A<k.length;A++){let H=Math.floor(A/C),L=A%C;I.set(k[A].id,{position:{x:t.left+L*M,y:t.top+H*F},size:{width:M,height:F}})}}return z.map(C=>{let R=I.get(C.id);return R?{...C,position:R.position,size:R.size,windowState:"normal"}:C})})}),[t]),y=$(((...S)=>{s(z=>{let k=z.filter(C=>C.windowState!=="minimized");if(k.length===0)return z;let w=[...k].sort((C,R)=>C.zIndex-R.zIndex),I=new Map;for(let C=0;C<w.length;C++){let R=Gn(C,r,t,w[C].size);I.set(w[C].id,{position:R,zIndex:C+1})}return z.map(C=>{let R=I.get(C.id);return R?{...C,position:R.position,zIndex:R.zIndex,windowState:"normal"}:C})})}),[r,t]),m=$(((...S)=>{s(z=>{let k=z.map(w=>({...w,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),k})}),[e.onFocusChange]),f=q(()=>{let S=i.find(z=>z.focused);return S?S.id:null},[i]),b=q(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:g,moveWindow:c,resizeWindow:x,tileWindows:p,cascadeWindows:y,minimizeAll:m,focusedWindowId:f}),[i,a,l,d,u,h,g,c,x,p,y,m,f]);return o(jn.Provider,{value:b},e.children)}function zt(){return jt(jn)}var xs=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ys=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Rt(e){return e<10?"0"+String(e):String(e)}function Ss(e,t,n){let r=e.getHours(),i=Rt(e.getMinutes()),s=Rt(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=Rt(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function ws(e){let t=xs[e.getDay()],n=ys[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function vs(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=be(),a=$(()=>{n()},[n]),l=$(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n())},[n]);return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",padding:"0 12px",height:"100%",border:"none",outline:"none",backgroundColor:r?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"700",cursor:"pointer",transition:"background-color 0.15s"}},t)}function ks(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=X(new Date);se(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=q(()=>Ss(i,t,n),[i,t,n]),l=q(()=>ws(i),[i]),d=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},l):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"6px",lineHeight:"1",padding:"0 8px"}},d,o("span",{style:{fontSize:"13px",fontWeight:"500"}},a))}function Cs(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=be(),s=$(()=>{t.onClick&&t.onClick()},[t]),a=$(l=>{let d=l;(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:s,onKeyDown:a,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 4px",height:"100%",border:"none",outline:"none",backgroundColor:n?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:t.onClick?"pointer":"default",transition:"background-color 0.15s"}},o("span",{"aria-hidden":"true"},t.icon),t.label?o("span",null,t.label):null)}function Ms(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=be();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=$(()=>{t.onClick(),n()},[t,n]),l=$(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t.onClick(),n())},[t,n]);return o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:r?"var(--panel-hover, rgba(255,255,255,0.15))":"transparent",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.1s"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label))}function $s(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=be(),[a,l]=X(!1),d=ie(null),u=$(()=>{l(m=>!m)},[]),h=$(()=>{l(!1)},[]),g=$(m=>{let f=m;(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),l(b=>!b)),f.key==="Escape"&&l(!1)},[]);se(()=>{if(!a)return;let m=f=>{let b=d.current;b&&!b.contains(f.target)&&l(!1)};return document.addEventListener("click",m,!0),()=>{document.removeEventListener("click",m,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},x=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),p=o("span",{style:c,"aria-hidden":"true"},x),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((m,f)=>o(Ms,{key:String(f),item:m,onClose:h}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown:g,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||a?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},p,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function Et(e){let{activeAppName:t,activitiesButton:n,clockFormat:r="24h",showSeconds:i=!0,showDate:s=!0,indicators:a,user:l,userMenuItems:d,height:u=28,children:h}=e,g=String(u)+"px",c=[];n&&c.push(o(vs,{key:"activities",label:n.label,onClick:n.onClick})),t&&c.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t));let x=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...c),p=[];p.push(o(ks,{key:"clock",format:r,showSeconds:i,showDate:s})),h&&p.push(h);let y=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...p),m=[];if(a&&a.length>0){let b=a.map(S=>o(Cs,{key:S.id,indicator:S}));m.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...b))}l&&m.push(o($s,{key:"user",user:l,menuItems:d}));let f=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...m);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:g,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},x,y,f)}function zs(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var Xn=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function Rs(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Xn[Math.abs(t)%Xn.length]}function Es(e){return e>99?"99+":String(e)}function Is(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function Ps(e){switch(e){case"left":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};case"right":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"top":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"bottom":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};default:return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"}}}function Ts(e,t){return t==="vertical"?e==="right"?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:e==="bottom"?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function Ds(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=X(!1),u=t.disabled??!1,h=$(()=>{u||d(!0)},[u]),g=$(()=>{d(!1)},[]),c=$(()=>{!u&&s&&s(t.id)},[u,s,t.id]),x=$(z=>{if(!u&&a){let k=z;k.preventDefault(),a(t.id,{x:k.clientX,y:k.clientY})}},[u,a,t.id]),p=`${n}px`,y=zs(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:p,height:p,objectFit:"contain",display:"block"}}):o("span",{style:{width:p,height:p,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:Rs(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),m=t.badge!=null&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},Es(t.badge)):null,f=t.active?o("span",{style:{...Ts(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,b=l?o("div",{role:"tooltip",style:{position:"absolute",...Ps(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,S={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:u?"default":"pointer",opacity:u?"0.4":"1",pointerEvents:u?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...l&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{}};return o("button",{type:"button",role:"button",style:S,"aria-label":Is(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:x,onMouseEnter:h,onMouseLeave:g,"data-dock-item-id":t.id},y,m,f,b)}function It(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[h,g]=X(!s),c=ie(null),x=$(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),g(!0))},[s]),p=$(()=>{s&&(c.current=setTimeout(()=>{g(!1)},300))},[s]),y=$(z=>{let k=z,w=k.target,I=w.closest('[role="toolbar"]');if(!I)return;let C=Array.from(I.querySelectorAll("button[data-dock-item-id]")),R=C.indexOf(w);if(R<0)return;let M=n==="vertical",F=M?"ArrowDown":"ArrowRight",A=M?"ArrowUp":"ArrowLeft";if(k.key===F){k.preventDefault();let H=C[R+1];H&&H.focus()}else if(k.key===A){k.preventDefault();let H=C[R-1];H&&H.focus()}else k.key==="Home"?(k.preventDefault(),C[0]?.focus()):k.key==="End"?(k.preventDefault(),C[C.length-1]?.focus()):(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),w.click())},[n]),m=n==="vertical",f={display:"flex",flexDirection:m?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!h&&(r==="left"?(f.transform="translateX(-100%)",f.opacity="0"):r==="right"?(f.transform="translateX(100%)",f.opacity="0"):r==="top"?(f.transform="translateY(-100%)",f.opacity="0"):r==="bottom"&&(f.transform="translateY(100%)",f.opacity="0"));let b=[];for(let z=0;z<t.length;z++){if(a&&z===t.length-1&&t.length>1){let k=m?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};b.push(o("div",{key:`sep-${z}`,style:k,"aria-hidden":"true",role:"separator"}))}b.push(o(Ds,{key:t[z].id,item:t[z],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let S=s&&!h?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:f,onMouseEnter:x,onMouseLeave:p,onKeyDown:y},S,...b,u??null)}var As="#2c001e";function Pt(e){let{backgroundColor:t=As,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,h=$(f=>{let b=f;b.target===b.currentTarget&&a&&a()},[a]),g=$(f=>{let b=f;b.target===b.currentTarget&&l&&l()},[l]),c=q(()=>{let f={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return f.backgroundColor=t,n&&(f.background=n),r&&i>=1&&(f.backgroundImage=`url(${r})`,f.backgroundSize="cover",f.backgroundPosition="center"),f},[t,n,r,i]),x=q(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),p={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];x&&y.push(o("div",{className:"desktop-background__image-overlay",style:x,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:p},u));let m=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:g,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(wt,{items:s},m):m}var Ls={width:200,height:150},Ws={x:50,y:50},Fs={width:400,height:300},he=8,Tt=20,Ns={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};function Ye(e){let{id:t,title:n,icon:r,defaultPosition:i=Ws,defaultSize:s=Fs,minSize:a=Ls,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:g=!0,zIndex:c,onClose:x,onMinimize:p,onMaximize:y,onFocus:m,onMove:f,onResize:b,children:S}=e,[z,k]=X(i.x),[w,I]=X(i.y),[C,R]=X(s.width),[M,F]=X(s.height),[A,H]=X(!1),[L,P]=X(!1),[v,D]=X(null),E=ie(null),W=ie(null),T=ie(null),N=$((ne,ce)=>{let de=Math.max(ne,a.width),le=Math.max(ce,a.height);return l&&(de=Math.min(de,l.width),le=Math.min(le,l.height)),{width:de,height:le}},[a,l]),B=$(()=>{let ne=T.current;return ne&&ne.parentElement?{width:ne.parentElement.clientWidth,height:ne.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),V=$((ne,ce,de,le)=>{let ue=B(),me=Math.max(0,Math.min(ne,ue.width-de)),Se=Math.max(0,Math.min(ce,ue.height-le));return{x:me,y:Se}},[B]),G=$(ne=>{if(!u||h==="maximized")return;let ce=ne;ce.target.closest("button")||(ce.preventDefault(),E.current={startMouseX:ce.clientX,startMouseY:ce.clientY,startPosX:z,startPosY:w},H(!0))},[u,h,z,w]),K=$(ne=>{ne.target.closest("button")||y&&y()},[y]);se(()=>{if(!A)return;let ne=de=>{let le=de,ue=E.current;if(!ue)return;let me=le.clientX-ue.startMouseX,Se=le.clientY-ue.startMouseY,ve=ue.startPosX+me,ke=ue.startPosY+Se,Ce=B();ve=Math.max(0,Math.min(ve,Ce.width-C)),ke=Math.max(0,Math.min(ke,Ce.height-M)),k(ve),I(ke),le.clientX<=Tt?D("left"):le.clientX>=Ce.width-Tt?D("right"):le.clientY<=Tt?D("top"):D(null)},ce=de=>{let le=de;H(!1);let ue=B();if(v==="left"){k(0),I(0),R(Math.floor(ue.width/2)),F(ue.height),D(null),f&&f({x:0,y:0}),b&&b({width:Math.floor(ue.width/2),height:ue.height});return}if(v==="right"){let Se=Math.floor(ue.width/2);k(Se),I(0),R(Se),F(ue.height),D(null),f&&f({x:Se,y:0}),b&&b({width:Se,height:ue.height});return}if(v==="top"){D(null),y&&y();return}D(null);let me=E.current;if(me&&f){let Se=le.clientX-me.startMouseX,ve=le.clientY-me.startMouseY,ke=me.startPosX+Se,Ce=me.startPosY+ve;ke=Math.max(0,Math.min(ke,ue.width-C)),Ce=Math.max(0,Math.min(Ce,ue.height-M)),f({x:ke,y:Ce})}E.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",ce),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",ce)}},[A,v,C,M,B,f,b,y]);let ee=$(ne=>ce=>{if(!d||h!=="normal")return;let de=ce;de.preventDefault(),de.stopPropagation(),W.current={direction:ne,startMouseX:de.clientX,startMouseY:de.clientY,startPosX:z,startPosY:w,startWidth:C,startHeight:M},P(!0)},[d,h,z,w,C,M]);se(()=>{if(!L)return;let ne=de=>{let le=de,ue=W.current;if(!ue)return;let me=le.clientX-ue.startMouseX,Se=le.clientY-ue.startMouseY,ve=ue.direction,ke=ue.startWidth,Ce=ue.startHeight,pt=ue.startPosX,mt=ue.startPosY;ve.includes("e")&&(ke=ue.startWidth+me),ve.includes("w")&&(ke=ue.startWidth-me,pt=ue.startPosX+me),ve.includes("s")&&(Ce=ue.startHeight+Se),ve.includes("n")&&(Ce=ue.startHeight-Se,mt=ue.startPosY+Se);let Xe=N(ke,Ce);ve.includes("w")&&(pt=ue.startPosX+(ue.startWidth-Xe.width)),ve.includes("n")&&(mt=ue.startPosY+(ue.startHeight-Xe.height)),R(Xe.width),F(Xe.height),k(pt),I(mt)},ce=()=>{P(!1),b&&b({width:C,height:M}),W.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",ce),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",ce)}},[L,C,M,N,b]),se(()=>{if(!g||!x)return;let ne=ce=>{ce.key==="Escape"&&x()};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[g,x]);let J=$(ne=>{m&&m()},[m]);if(h==="minimized")return null;let Y=h==="maximized",U=q(()=>{let ne={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:Y?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:g?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:Y?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return Y?(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"):(ne.top=`${w}px`,ne.left=`${z}px`,ne.width=`${C}px`,ne.height=`${M}px`),c!==void 0&&(ne.zIndex=String(c)),A&&(ne.cursor="grabbing",ne.userSelect="none"),ne},[Y,z,w,C,M,c,g,A]),_=q(()=>{let ne={display:"flex",alignItems:"center",padding:"0 8px",height:"32px",backgroundColor:"var(--window-title-bg, #2c2c2c)",color:"var(--window-title-text, #ffffff)",userSelect:"none",flexShrink:"0",cursor:u&&!Y?"grab":"default",opacity:g?"1":"0.6"};return A&&(ne.cursor="grabbing"),ne},[g,u,Y,A]),O={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},Z={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let oe=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...Z,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:ne=>{ne.stopPropagation(),p&&p()}}),o("button",{type:"button","aria-label":Y?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...Z,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:ne=>{ne.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...Z,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:ne=>{ne.stopPropagation(),x&&x()}}));Q.push(oe);let j=[];if(d&&!Y){let ne=["n","s","e","w","ne","nw","se","sw"];for(let ce=0;ce<ne.length;ce++){let de=ne[ce],le={position:"absolute",zIndex:"1"};de==="n"?(le.top="0",le.left=`${he}px`,le.right=`${he}px`,le.height=`${he}px`):de==="s"?(le.bottom="0",le.left=`${he}px`,le.right=`${he}px`,le.height=`${he}px`):de==="e"?(le.top=`${he}px`,le.right="0",le.bottom=`${he}px`,le.width=`${he}px`):de==="w"?(le.top=`${he}px`,le.left="0",le.bottom=`${he}px`,le.width=`${he}px`):de==="ne"?(le.top="0",le.right="0",le.width=`${he}px`,le.height=`${he}px`):de==="nw"?(le.top="0",le.left="0",le.width=`${he}px`,le.height=`${he}px`):de==="se"?(le.bottom="0",le.right="0",le.width=`${he}px`,le.height=`${he}px`):de==="sw"&&(le.bottom="0",le.left="0",le.width=`${he}px`,le.height=`${he}px`),le.cursor=Ns[de],j.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${de}`,style:le,onMouseDown:ee(de)}))}}let te=null;if(v){let ne={position:"fixed",backgroundColor:"rgba(66, 133, 244, 0.2)",border:"2px solid rgba(66, 133, 244, 0.5)",borderRadius:"4px",zIndex:"999999",pointerEvents:"none",transition:"all 150ms ease"};v==="left"?(ne.top="0",ne.left="0",ne.width="50%",ne.height="100%"):v==="right"?(ne.top="0",ne.right="0",ne.width="50%",ne.height="100%"):v==="top"&&(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"),te=o("div",{className:"draggable-window__snap-preview",style:ne})}let re=[];for(let ne=0;ne<j.length;ne++)re.push(j[ne]);re.push(o("div",{className:"draggable-window__title-bar",style:_,onMouseDown:G,onDblClick:K,role:"toolbar","aria-label":`${n} window controls`},...Q)),re.push(o("div",{className:"draggable-window__body",style:O},S));let ae=[o("div",{ref:T,id:`draggable-window-${t}`,className:`draggable-window ${g?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:U,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:J},...re)];return te&&ae.push(te),ae.length===1?ae[0]:o("div",{style:{display:"contents"}},...ae)}var Bs=["File","Edit","View","Insert","Format","Tools","Help"],qn={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},Hs=[{id:"bold",label:"Bold",text:"B",shortcut:"Ctrl+B",style:{fontWeight:"700"}},{id:"italic",label:"Italic",text:"I",shortcut:"Ctrl+I",style:{fontStyle:"italic"}},{id:"underline",label:"Underline",text:"U",shortcut:"Ctrl+U",style:{textDecoration:"underline"}}],Os=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],_s=["1","2","3","4","5","6","7"],Vs={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Ys(){let e=[];for(let t=0;t<=20;t++){let n=t%2===0;e.push(o("div",{key:String(t),style:{position:"absolute",left:`${t/20*100}%`,bottom:"0",width:"1px",height:n?"10px":"5px",backgroundColor:"#999"}})),n&&e.push(o("span",{key:`l${t}`,style:{position:"absolute",left:`${t/20*100}%`,top:"1px",fontSize:"8px",color:"#666",transform:"translateX(-50%)"}},String(t/2)))}return e}function Kn(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function Dt(e){let[t,n]=X(!1),[r,i]=X(!1),[s,a]=X(!1),[l,d]=X(-1),[u,h]=X(""),[g,c]=X(-1),[x,p]=X(0),[y,m]=X("3"),f=ie(null),b=$(()=>{document.execCommand("bold",!1),n(O=>!O),f.current&&f.current.focus()},[]),S=$(()=>{document.execCommand("italic",!1),i(O=>!O),f.current&&f.current.focus()},[]),z=$(()=>{document.execCommand("underline",!1),a(O=>!O),f.current&&f.current.focus()},[]),k={bold:b,italic:S,underline:z},w={bold:t,italic:r,underline:s},I=$(O=>{document.execCommand(O,!1),f.current&&f.current.focus()},[]),C=$(O=>{document.execCommand("fontSize",!1,O),m(O),f.current&&f.current.focus()},[]),R=$(O=>{c(Z=>Z===O?-1:O)},[]),M=$(O=>{switch(O){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":typeof window<"u"&&window.print&&window.print();break;case"new":f.current&&(f.current.innerHTML="",p(0));break;default:break}c(-1),f.current&&f.current.focus()},[]),F=$(()=>{if(f.current){let O=f.current.textContent??"";p(Kn(O))}},[]),A=$(()=>{c(-1)},[]),H=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),L={display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},P={display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},v={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},D={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},E={width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},W={height:"24px",backgroundColor:"var(--color-bg-subtle, #f0f0f0)",borderTop:"1px solid var(--color-border, #ccc)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"11px",color:"#666",flexShrink:"0"},T=q(()=>Ys(),[]),N=e.content??"Start typing...",B=Kn(N),V=x>0?x:B;function G(O){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:g===O?"rgba(0,0,0,0.12)":l===O?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let K={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},ee={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function J(O,Z){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:w[O]??!1?"rgba(0,0,0,0.12)":u===O?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...Z??{}}}let Y={display:"flex",alignItems:"center",padding:"2px 8px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"default",height:"24px",gap:"4px"},U={padding:"2px 4px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"pointer",height:"24px",outline:"none"},_=Bs.map((O,Z)=>{let Q=[O];return g===Z&&qn[O]&&Q.push(o("div",{key:"dropdown",style:K,className:"word-processor__menu-dropdown"},...qn[O].map((oe,j)=>o("button",{key:String(j),style:ee,onClick:te=>{te.stopPropagation(),M(oe.action)},role:"menuitem"},oe.label)))),o("button",{key:String(Z),style:G(Z),role:"menuitem","aria-label":O,onClick:()=>R(Z),onMouseEnter:()=>{d(Z)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:H},o("div",{className:"word-processor__menu-bar",style:L,role:"menubar"},..._),o("div",{className:"word-processor__toolbar",style:P,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:Y,"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"\u25BC")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Hs.map(O=>o("button",{key:O.id,style:J(O.id,O.style),title:O.shortcut?`${O.label} (${O.shortcut})`:O.label,"aria-label":O.label,"aria-pressed":String(w[O.id]??!1),onClick:k[O.id],onMouseEnter:()=>h(O.id),onMouseLeave:()=>h("")},O.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:U,"aria-label":"Font size",value:y,onChange:O=>{let Z=O.target;C(Z.value)}},..._s.map(O=>o("option",{key:O,value:O},Vs[O])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Os.map((O,Z)=>o("button",{key:String(Z),style:J(`align-${Z}`),title:O.label,"aria-label":O.label,onClick:()=>I(O.command),onMouseEnter:()=>h(`align-${Z}`),onMouseLeave:()=>h("")},O.text)))),o("div",{className:"word-processor__ruler",style:v,"aria-hidden":"true"},...T),o("main",{className:"word-processor__document-area",style:D,onClick:A},o("div",{className:"word-processor__page",style:E,contentEditable:"true",ref:f,onInput:F,suppressContentEditableWarning:!0},N)),o("div",{className:"word-processor__status-bar",style:W},o("span",null,"Page 1 of 1"),o("span",null,`${V} words`),o("span",null,"100%")))}var Gs=["File","Edit","Selection","View","Go","Run","Terminal","Help"],Zn={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},Jn=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],Lt={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},Qn=Lt["App.ts"],Us=new Set(["import","export","from","const","let","var","function","return","if","else","for","while","class","new","throw","try","catch","finally","typeof","instanceof","in","of","default","switch","case","break","continue","do","void","delete","yield","async","await"]),js=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),eo="#569cd6",Xs="#ce9178",qs="#4ec9b0",Ks="#6a9955",Zs="#dcdcaa",At="#d4d4d4",Js="#d4d4d4",Qs="#b5cea8";function el(e){if(!e.trim())return[{text:"\xA0",color:At}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:Ks});break}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let r=e[n],i=n+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;i=Math.min(i+1,e.length),t.push({text:e.slice(n,i),color:Xs}),n=i;continue}if(/[0-9]/.test(e[n])&&(n===0||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let r=n;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({text:e.slice(n,r),color:Qs}),n=r;continue}if(/[a-zA-Z_$]/.test(e[n])){let r=n;for(;r<e.length&&/[a-zA-Z0-9_$]/.test(e[r]);)r++;let i=e.slice(n,r),s=r;for(;s<e.length&&e[s]===" ";)s++;let a=s<e.length&&e[s]==="(",l=At;Us.has(i)?l=eo:js.has(i)?l=qs:a?l=Zs:(i==="true"||i==="false")&&(l=eo),t.push({text:i,color:l}),n=r;continue}if(e[n]===" "||e[n]===" "){let r=n;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r++;t.push({text:e.slice(n,r),color:At}),n=r;continue}t.push({text:e[n],color:Js}),n++}return t}function Wt(e){let[t,n]=X("App.ts"),[r,i]=X({src:!0,components:!0,hooks:!0}),[s,a]=X(-1),[l,d]=X(Qn.length),u=ie(null),h=$(_=>{n(_);let O=Lt[_];O&&d(O.length)},[]),g=$(_=>{i(O=>{let Z={},Q=Object.keys(O);for(let oe=0;oe<Q.length;oe++)Z[Q[oe]]=O[Q[oe]];return Z[_]=!O[_],Z})},[]),c=$(_=>{a(O=>O===_?-1:_)},[]),x=$(_=>{switch(_){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":u.current&&(u.current.textContent="",d(1));break;default:break}a(-1),u.current&&u.current.focus()},[]),p=$(()=>{if(u.current){let O=(u.current.textContent??"").split(`
8
+ `);d(Math.max(O.length,1))}},[]),y=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),m={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},f={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},b={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},S={...b,backgroundColor:"rgba(255,255,255,0.1)"},z={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},k={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},w={flex:"1",display:"flex",overflow:"hidden"},I={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},C={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},R={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},M=(_,O,Z)=>({padding:"3px 8px",paddingLeft:`${12+_*16}px`,fontSize:"13px",cursor:"pointer",color:O?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:Z?"rgba(255,255,255,0.08)":"transparent"}),F={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},A={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},H={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},L={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},P={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},v={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},D={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},E={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},W={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},T=8,N=30,B=Lt[t]??Qn,V=B.map((_,O)=>{let Z=el(_),Q=[],oe=0;for(let j of Z)Q.push(o("span",{key:String(oe++),style:{color:j.color}},j.text));return o("div",{key:String(O),style:{minHeight:"20px"}},...Q)}),G=Math.max(l,B.length),K=[];for(let _=0;_<G;_++)K.push(o("div",{key:String(_)},String(_+1)));let ee=_=>{if(!_.parent)return!0;if(!r[_.parent])return!1;let O=Jn.find(Z=>Z.name===_.parent&&Z.isFolder);return O?ee(O):!0},J=Gs.map((_,O)=>{let Z=[_],Q=s===O;return Q&&Zn[_]&&Z.push(o("div",{key:"dropdown",style:z,className:"ide__menu-dropdown"},...Zn[_].map((oe,j)=>o("button",{key:String(j),style:k,onClick:te=>{te.stopPropagation(),x(oe.action)},role:"menuitem"},oe.label)))),o("button",{key:String(O),style:Q?S:b,role:"menuitem","aria-label":_,onClick:()=>c(O)},...Z)}),U=Jn.map((_,O)=>{if(!ee(_))return null;let Z=!_.isFolder&&_.name===t,Q=_.isFolder?r[_.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(O),style:M(_.indent,_.isFolder,Z),onClick:_.isFolder?()=>g(_.name):()=>h(_.name)},Q,_.name)}).filter(_=>_!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:m},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:f,role:"menubar"},...J),o("div",{style:w},o("nav",{className:"ide__sidebar",style:I,"aria-label":"File explorer"},o("div",{style:R},"Explorer"),...U),o("div",{style:C}),o("div",{style:F},o("div",{style:A},o("button",{style:H,"aria-label":t},t)),o("div",{style:L},o("div",{style:P,"aria-hidden":"true"},...K),o("code",{style:v,contentEditable:"true",ref:u,onInput:p,suppressContentEditableWarning:!0},...V))),o("div",{className:"ide__minimap",style:D,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${T}px`,left:"0",right:"0",height:`${N}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...B.map((_,O)=>o("div",{key:String(O),style:{height:"2px",backgroundColor:_.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,_.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:E},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:W},"\u2387 main"),o("span",{style:W},"0 errors"),o("span",{style:W},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:W},"Ln 1, Col 1"),o("span",{style:W},"UTF-8"),o("span",{style:W},"TypeScript"))))}var tl=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],to=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],no=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],oo=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],nl=[{time:"14:32:01",symbol:"AAPL",side:"BUY",qty:50,price:189.42},{time:"14:31:45",symbol:"MSFT",side:"SELL",qty:25,price:378.95},{time:"14:30:22",symbol:"TSLA",side:"BUY",qty:100,price:247.8},{time:"14:29:58",symbol:"NVDA",side:"BUY",qty:10,price:874.5},{time:"14:28:33",symbol:"GOOGL",side:"SELL",qty:75,price:142.1}],ol=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],ro=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],io=[{price:189.45,volume:900},{price:189.5,volume:2600},{price:189.55,volume:1800},{price:189.6,volume:4400},{price:189.65,volume:3100}],so=["09:30","10:00","10:30","11:00","11:30","12:00"];function rl(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Ge(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function $e(e){return e.toFixed(2)}var Be={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},He={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},ot={width:"100%",borderCollapse:"collapse",fontSize:"12px"},xe={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},ye={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},rt={cursor:"default",transition:"background-color 0.1s"};function il(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,h)=>{let g=h/(e.length-1)*40,c=14-(u-i)/a*14;return`${g.toFixed(1)},${c.toFixed(1)}`}).join(" ");return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:l,fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function sl(e,t){let u=Math.min(...e),h=Math.max(...e),g=h-u||1,c=310/(e.length-1),x=e.map((w,I)=>{let C=40+I*c,R=15+(1-(w-u)/g)*120;return{x:C,y:R}}),p=x.map(w=>`${w.x.toFixed(1)},${w.y.toFixed(1)}`).join(" "),y="M40,135 "+x.map(w=>`L${w.x.toFixed(1)},${w.y.toFixed(1)}`).join(" ")+` L${x[x.length-1].x.toFixed(1)},135 Z`,m=[];for(let w=1;w<e.length;w++){let I=e[w]>=e[w-1]?"#00c853":"#ff1744";m.push(o("line",{key:String(w),x1:String(x[w-1].x.toFixed(1)),y1:String(x[w-1].y.toFixed(1)),x2:String(x[w].x.toFixed(1)),y2:String(x[w].y.toFixed(1)),stroke:I,strokeWidth:"2",strokeLinecap:"round"}))}let f=[];for(let w=0;w<5;w++){let I=15+w/4*120,C=h-w/4*g;f.push(o("line",{key:`g${w}`,x1:String(40),y1:String(I.toFixed(1)),x2:String(350),y2:String(I.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),f.push(o("text",{key:`yl${w}`,x:String(36),y:String((I+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},$e(C)))}let b=[],S=Math.min(so.length,e.length),z=(e.length-1)/(S-1);for(let w=0;w<S;w++){let C=40+Math.round(w*z)*c;b.push(o("text",{key:`tl${w}`,x:String(C.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},so[w]))}let k="chartGrad";return o("div",{style:Be},o("div",{style:He},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${$e(t)}`),o("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),o("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},o("defs",null,o("linearGradient",{id:k,x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),o("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),o("path",{d:y,fill:`url(#${k})`}),...f,...b,...m,o("line",{x1:String(40),y1:String((15+(1-(t-u)/g)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/g)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function ll(){let e=Math.max(...to.map(t=>t.qty),...no.map(t=>t.qty));return o("div",{style:Be},o("div",{style:He},"Order Book"),o("table",{style:ot},o("thead",null,o("tr",null,o("th",{style:xe},"Bid Price"),o("th",{style:xe},"Qty"),o("th",{style:xe},"Ask Price"),o("th",{style:xe},"Qty"))),o("tbody",null,...to.map((t,n)=>{let r=no[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:rt},o("td",{style:{...ye,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},$e(t.price)),o("td",{style:{...ye,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Ge(t.qty)),o("td",{style:{...ye,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?$e(r.price):""),o("td",{style:{...ye,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Ge(r.qty):""))}))))}function al(e){return o("div",{style:Be},o("div",{style:He},"Watchlist"),o("table",{style:ot},o("thead",null,o("tr",null,o("th",{style:xe},"Symbol"),o("th",{style:xe},"Price"),o("th",{style:xe},"Chg%"),o("th",{style:xe},"Volume"))),o("tbody",null,...tl.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:rt},o("td",{style:{...ye,fontWeight:"600",color:"#ffffff"}},t.symbol,il(t.spark,i)),o("td",{style:{...ye,fontFamily:"monospace"}},$e(r)),o("td",{style:{...ye,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${$e(t.change)}%`),o("td",{style:{...ye,fontFamily:"monospace",color:"#8888aa"}},rl(t.volume)))}))))}function cl(){let e=oo.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:Be},o("div",{style:He},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${$e(e)}`)),o("table",{style:ot},o("thead",null,o("tr",null,o("th",{style:xe},"Symbol"),o("th",{style:xe},"Qty"),o("th",{style:xe},"Avg"),o("th",{style:xe},"P&L"))),o("tbody",null,...oo.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...rt,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...ye,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...ye,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...ye,fontFamily:"monospace"}},$e(n.avgPrice)),o("td",{style:{...ye,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${$e(n.pnl)}`))}))))}function dl(){return o("div",{style:Be},o("div",{style:He},"Recent Trades"),o("table",{style:ot},o("thead",null,o("tr",null,o("th",{style:xe},"Time"),o("th",{style:xe},"Sym"),o("th",{style:xe},"Side"),o("th",{style:xe},"Qty"),o("th",{style:xe},"Price"))),o("tbody",null,...nl.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:rt},o("td",{style:{...ye,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...ye,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...ye,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...ye,fontFamily:"monospace"}},Ge(e.qty)),o("td",{style:{...ye,fontFamily:"monospace"}},$e(e.price)))}))))}function ul(){let e=Math.max(...ro.map(n=>n.volume),...io.map(n=>n.volume)),t="16px";return o("div",{style:Be},o("div",{style:He},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...ro.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},$e(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Ge(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...io.map((n,r)=>o("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},$e(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Ge(n.volume))))))}function Ft(e){let[t,n]=X(0),[r,i]=X("--:--:--"),[s,a]=X(!0);se(()=>{let x=setInterval(()=>{n(p=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(x)},[]),se(()=>{let x=()=>{let y=new Date,m=String(y.getHours()).padStart(2,"0"),f=String(y.getMinutes()).padStart(2,"0"),b=String(y.getSeconds()).padStart(2,"0");i(`${m}:${f}:${b}`)};x();let p=setInterval(x,1e3);return()=>clearInterval(p)},[]),se(()=>{let x=setInterval(()=>{a(p=>!p)},800);return()=>clearInterval(x)},[]);let l=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},h={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},g=189.42+t,c={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:l},o("header",{className:"trading-dashboard__header",style:d},o("span",{style:u},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:c}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:h},sl(ol,g),ll(),al(t),cl(),dl(),ul()))}var fl=28,gl=5e3;function pl(e){let{toasts:t,onDismiss:n}=e;if(t.length===0)return null;let r={position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},i=t.map(s=>{let a="rgba(50, 50, 50, 0.95)",l="#555";return s.severity==="warning"?(a="rgba(60, 40, 10, 0.95)",l="#f39c12"):s.severity==="error"&&(a="rgba(60, 10, 10, 0.95)",l="#e74c3c"),o("div",{key:String(s.id),className:`unity-desktop__toast unity-desktop__toast--${s.severity}`,style:{backgroundColor:a,border:`1px solid ${l}`,borderRadius:"6px",padding:"10px 14px",color:"#ffffff",fontSize:"13px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",cursor:"pointer",transition:"opacity 200ms ease"},onClick:()=>n(s.id),role:"alert","aria-live":"polite"},s.message)});return o("div",{className:"unity-desktop__toast-container",style:r,"aria-label":"Notifications"},...i)}function ml(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(e){case"Files":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["\u{1F4C1} Documents","\u{1F4C1} Downloads","\u{1F4C1} Music","\u{1F4C1} Pictures","\u{1F4C1} Videos","\u{1F4C4} readme.txt"].map(n=>o("span",{style:{cursor:"pointer"}},n))));case"Terminal":return o("div",{style:{...t,backgroundColor:"#1a1a2e",color:"#00ff41",fontFamily:"monospace",fontSize:"12px"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",null,"$ _"));case"Browser":return o("div",{style:t},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(n=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},n)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(n=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},n)));case"Word Processor":return o(Dt,null);case"IDE":return o(Wt,null);case"Trading":return o(Ft,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function hl(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,[l,d]=X([]),[u,h]=X([]),[g,c]=X(!1),[x,p]=X(!1),[y,m]=X(null),[f,b]=X({x:0,y:0}),[S,z]=X(null),k=$(()=>{c(j=>!j)},[]),w=$(j=>{h(te=>te.filter(re=>re.id!==j))},[]);se(()=>{if(u.length===0)return;let j=u[0],te=Date.now()-j.timestamp,re=Math.max(0,gl-te),ae=setTimeout(()=>{h(ne=>ne.filter(ce=>ce.id!==j.id))},re);return()=>clearTimeout(ae)},[u]);let I=ie(t);I.current=t;let C=ie(r);C.current=r;let R=$(j=>{d(te=>{if(te.find(le=>le.id===j)){let le=Math.max(...te.map(ue=>ue.zIndex))+1;return te.map(ue=>ue.id===j?{...ue,focused:!0,zIndex:le,windowState:ue.windowState==="minimized"?"normal":ue.windowState}:{...ue,focused:!1})}let ne=I.current.find(le=>le.id===j);if(!ne)return te;let ce=te.length>0?Math.max(...te.map(le=>le.zIndex))+1:1,de={id:ne.id,title:ne.label,icon:ne.icon,x:60+te.length*30,y:40+te.length*30,width:600,height:400,zIndex:ce,focused:!0,windowState:"normal"};return[...te.map(le=>({...le,focused:!1})),de]}),C.current&&C.current(j)},[]),M=t.map(j=>{let te=l.some(re=>re.id===j.id);return{id:j.id,icon:j.icon,label:j.label,active:te}}),F=l.find(j=>j.focused),A=F?F.title:void 0,H=$(()=>{p(!0)},[]),L=$(()=>{p(!1)},[]),P=$((j,te)=>{m(j),b(te)},[]),v=$(()=>{m(null)},[]),D=$(()=>{},[]),E=$(()=>{i&&i()},[i]),W=[];n&&(W.push({label:n.name,icon:void 0,onClick:D,divider:!1}),W.push({label:"",icon:void 0,onClick:D,divider:!0})),W.push({label:"Lock",icon:void 0,onClick:H,divider:!1}),W.push({label:"Logout",icon:void 0,onClick:E,divider:!1});let T=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:s==="dark"?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[s]),N={display:"flex",flex:"1",overflow:"hidden"},B={display:"flex",flexDirection:"column",height:"100%",backgroundColor:s==="dark"?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:s==="dark"?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},V={width:"100%",height:"100%",position:"relative"},G=o(Et,{activeAppName:A,activitiesButton:{label:"Activities",onClick:k},clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:W.length>0?W:void 0,height:fl}),K=o(It,{items:M,orientation:"vertical",position:"left",iconSize:36,onItemClick:R,onItemContextMenu:P}),ee=o(pl,{toasts:u,onDismiss:w}),J=l.filter(j=>j.windowState!=="minimized").map(j=>o(Ye,{key:j.id,id:j.id,title:j.title,icon:j.icon,defaultPosition:{x:j.x,y:j.y},defaultSize:{width:j.width,height:j.height},zIndex:j.zIndex,focused:j.focused,windowState:j.windowState,onClose:()=>{d(te=>te.filter(re=>re.id!==j.id))},onFocus:()=>{d(te=>{let re=Math.max(...te.map(ae=>ae.zIndex))+1;return te.map(ae=>ae.id===j.id?{...ae,focused:!0,zIndex:re}:{...ae,focused:!1})})},onMinimize:()=>{d(te=>te.map(re=>re.id===j.id?{...re,windowState:"minimized"}:re))},onMaximize:()=>{d(te=>te.map(re=>re.id===j.id?{...re,windowState:re.windowState==="maximized"?"normal":"maximized"}:re))}},ml(j.title))),Y=[];a&&Y.push(a),Y.push(...J),Y.push(ee);let U=o(Pt,{backgroundColor:s==="dark"?"#2c001e":"#e8e0e4",backgroundGradient:s==="dark"?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:V},...Y)),_=g?o("div",{style:{position:"absolute",inset:"0",zIndex:"100",backgroundColor:"rgba(0, 0, 0, 0.85)",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:"24px",padding:"48px",alignContent:"start",overflowY:"auto"},onClick:k},...t.map(j=>o("button",{key:j.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:te=>{te.stopPropagation(),c(!1),R(j.id)}},o("span",{style:{fontSize:"32px",display:"block"}},j.icon),o("span",null,j.label)))):null,O=x?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:L},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"\u{1F512}"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,Z=y?o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:v},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${f.y}px`,left:`${f.x}px`,backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"6px",padding:"4px 0",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:"9001",color:"#ffffff",fontSize:"13px"},onClick:j=>j.stopPropagation()},o("div",{style:{padding:"6px 14px",fontWeight:"600",borderBottom:"1px solid #444",marginBottom:"4px"}},t.find(j=>j.id===y)?.label||y),o("div",{style:{padding:"6px 14px",cursor:"pointer"},onClick:()=>{z(y),m(null)},role:"menuitem"},"About"))):null,Q=S?t.find(j=>j.id===S):null,oe=Q?o("div",{className:"unity-desktop__about-backdrop",style:{position:"absolute",inset:"0",zIndex:"9500",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>z(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:j=>j.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},Q.label),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"SpecifyJS Demo App"),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"MIT License"),o("div",{style:{fontSize:"13px",color:"#aaa"}},"v0.2.47"),o("button",{style:{marginTop:"16px",padding:"6px 16px",border:"1px solid #555",borderRadius:"4px",backgroundColor:"#444",color:"#fff",cursor:"pointer"},onClick:()=>z(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:T,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},G),o("div",{style:N},o("div",{className:"unity-desktop__dock",style:B},K),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},U,_)),Z,oe,O)}function bl(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o($t,{onWindowOpen:r},o(hl,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))}function xl(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,children:u}=e,h=zt(),g=q(()=>h.windows.find(b=>b.id===t),[h.windows,t]);if(!g)return h.openWindow({id:t,title:n,icon:r,position:i,size:s}),null;let c=$(()=>{h.closeWindow(t),d&&d()},[h,t,d]),x=$(()=>{h.focusWindow(t)},[h,t]),p=$(b=>{h.moveWindow(t,b)},[h,t]),y=$(b=>{h.resizeWindow(t,b)},[h,t]),m=$(()=>{h.minimizeWindow(t)},[h,t]),f=$(()=>{g&&g.windowState==="maximized"?h.restoreWindow(t):h.maximizeWindow(t)},[h,t,g]);return o(Ye,{id:t,title:n,icon:r,defaultPosition:g.position,defaultSize:g.size,minSize:a,resizable:l,windowState:g.windowState,focused:g.focused,zIndex:g.zIndex,onClose:c,onFocus:x,onMove:p,onResize:y,onMinimize:m,onMaximize:f,children:u})}var lo={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},ao={primary:{bg:"#3b82f6",color:"white",border:"#3b82f6"},secondary:{bg:"#f8fafc",color:"#0f172a",border:"#d1d5db"},outline:{bg:"transparent",color:"#0f172a",border:"#d1d5db"},ghost:{bg:"transparent",color:"#0f172a",border:"transparent"},danger:{bg:"#ef4444",color:"white",border:"#ef4444"}};function yl(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:h,active:g=!1}=e,c=q(()=>{let x=lo[i]??lo.md,p=ao[r]??ao.secondary,y={padding:x.padding,fontSize:x.fontSize,borderRadius:x.borderRadius,border:`1px solid ${p.border}`,backgroundColor:g?"#3b82f6":p.bg,color:g?"white":p.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),u&&Object.assign(y,u),y},[r,i,s,a,g,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":h,"aria-pressed":g?"true":void 0},t)}var Sl=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Oe=Math.PI/180;function wl(e,t,n,r,i,s,a,l,d,u){let h=Math.cos(r*Oe),g=Math.sin(r*Oe),c=Math.cos(i*Oe),x=Math.sin(i*Oe),p=Math.cos(s*Oe),y=Math.sin(s*Oe),m=e*p-t*y,f=e*y+t*p,b=m*c-f*x,S=m*x+f*c,z=n,k=b,w=S*h-z*g,I=S*g+z*h,C=1+a*.001*I,R=l+k*u*C,M=d-w*u*C;return{sx:R,sy:M,depth:I}}function co(e,t){let n=e.replace("#",""),r,i,s;return n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,`rgba(${r},${i},${s},${t})`}function uo(e,t){let n=e.replace("#",""),r,i,s;n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s;let a=d=>Math.max(0,Math.min(255,Math.round(d*t))),l=d=>a(d).toString(16).padStart(2,"0");return"#"+l(r)+l(i)+l(s)}function vl(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:h=2,colorScale:g=Sl,gridColor:c="#94a3b8",title:x}=e,p=q(()=>{let L=0,P=0,v=0;for(let D=0;D<t.length;D++){let E=t[D],W=E.data.length;W>L&&(L=W);for(let T=0;T<W;T++){let N=E.data[T].length;N>P&&(P=N);for(let B=0;B<N;B++){let V=Math.abs(E.data[T][B]??0);V>v&&(v=V)}}}return{maxRows:Math.max(L,1),maxCols:Math.max(P,1),maxHeight:v>0?v:1}},[t]),y=q(()=>{let L=p.maxHeight+(t.length-1)*h+p.maxHeight,P=Math.sqrt(p.maxCols*p.maxCols+p.maxRows*p.maxRows+L*L),v=Math.min(n,r)*.75;return P>0?v/P:1},[p,t.length,h,n,r]),m=n/2,f=r/2,b=$((L,P,v)=>wl(L,P,v,s,a,l,i,m,f,y),[s,a,l,i,m,f,y]),S=$(()=>{if(!u)return[];let L=[],P=Math.max(p.maxCols,p.maxRows),v=p.maxCols/2,D=p.maxRows/2,E=b(-v,-D,0),W=b(v,-D,0);L.push(o("line",{key:"axis-x",x1:String(E.sx),y1:String(E.sy),x2:String(W.sx),y2:String(W.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-x-label",x:String(W.sx+8),y:String(W.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let T=b(-v,D,0);L.push(o("line",{key:"axis-y",x1:String(E.sx),y1:String(E.sy),x2:String(T.sx),y2:String(T.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-y-label",x:String(T.sx-12),y:String(T.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let N=p.maxHeight+(t.length-1)*h,B=b(-v,-D,N);return L.push(o("line",{key:"axis-z",x1:String(E.sx),y1:String(E.sy),x2:String(B.sx),y2:String(B.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-z-label",x:String(B.sx-4),y:String(B.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),L},[u,p,t.length,h,b]),z=$(()=>{let L=[],P=p.maxCols/2,v=p.maxRows/2,D=[];for(let E=0;E<t.length;E++){let W=t[E],T=W.color??g[E%g.length],N=W.opacity??.7,B=E*h,V=W.data.length;for(let G=0;G<V-1;G++){let K=W.data[G],ee=W.data[G+1],J=Math.min(K.length,ee.length);for(let Y=0;Y<J-1;Y++){let U=Y-P,_=Y+1-P,O=G-v,Z=G+1-v,Q=(K[Y]??0)+B,oe=(K[Y+1]??0)+B,j=(ee[Y]??0)+B,te=(ee[Y+1]??0)+B,re=b(U,O,Q),ae=b(_,O,oe),ne=b(U,Z,j),ce=b(_,Z,te),de=(re.depth+ae.depth+ne.depth+ce.depth)/4,le=`${re.sx},${re.sy} ${ae.sx},${ae.sy} ${ce.sx},${ce.sy} ${ne.sx},${ne.sy}`;D.push({points:le,fill:co(T,N),stroke:uo(T,.7),strokeWidth:"0.5",depth:de,key:`quad-${E}-${G}-${Y}`})}}if(V===1||V>0&&W.data[0].length===1)for(let G=0;G<V;G++){let K=W.data[G];for(let ee=0;ee<K.length;ee++){let J=ee-P,Y=G-v,U=(K[ee]??0)+B,_=b(J,Y,U),O=3,Z=`${_.sx},${_.sy-O} ${_.sx+O},${_.sy} ${_.sx},${_.sy+O} ${_.sx-O},${_.sy}`;D.push({points:Z,fill:co(T,N),stroke:uo(T,.7),strokeWidth:"0.5",depth:_.depth,key:`point-${E}-${G}-${ee}`})}}}D.sort((E,W)=>E.depth-W.depth);for(let E=0;E<D.length;E++){let W=D[E];L.push(o("polygon",{key:W.key,points:W.points,fill:W.fill,stroke:W.stroke,"stroke-width":W.strokeWidth,"stroke-linejoin":"round"}))}return L},[t,p,h,g,b]),k=$(()=>{let L=[],P=p.maxCols/2,v=p.maxRows/2;for(let D=0;D<=p.maxRows;D++){let E=D-v,W=b(-P,E,0),T=b(P,E,0);L.push(o("line",{key:`base-h-${D}`,x1:String(W.sx),y1:String(W.sy),x2:String(T.sx),y2:String(T.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let D=0;D<=p.maxCols;D++){let E=D-P,W=b(E,-v,0),T=b(E,v,0);L.push(o("line",{key:`base-v-${D}`,x1:String(W.sx),y1:String(W.sy),x2:String(T.sx),y2:String(T.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return L},[p,c,b]),w=$(()=>{if(!d)return[];let L=[],P=p.maxCols/2,v=p.maxRows/2;for(let D=0;D<t.length;D++){let E=t[D],W=D*h,T=0,N=0;for(let K=0;K<E.data.length;K++){let ee=E.data[K];for(let J=0;J<ee.length;J++)T+=ee[J]??0,N++}let B=N>0?T/N:0,V=b(P+1,0,B+W),G=E.color??g[D%g.length];L.push(o("text",{key:`layer-label-${D}`,x:String(V.sx+8),y:String(V.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:G},E.label))}return L},[d,t,p,h,g,b]),C=$(()=>x?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n])(),R=k(),M=S(),F=z(),A=w(),H=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...C,...H,...R,...M,...F,...A)}function kl(e){if(typeof e=="string")return e;if(!isFinite(e)||isNaN(e))return"--";let t=e.toString().split("."),n=t[0],r=t.length>1?"."+t[1]:"",i=n.startsWith("-"),s=i?n.slice(1):n,a="";for(let l=0;l<s.length;l++)l>0&&(s.length-l)%3===0&&(a+=","),a+=s[l];return(i?"-":"")+a+r}function Cl(e){if(!isFinite(e)||isNaN(e))return"--";let t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}function Ml(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:h="currentColor",trendUpColor:g="#22c55e",trendDownColor:c="#ef4444",backgroundColor:x="#ffffff"}=e,p=q(()=>kl(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),m=l!=null&&l.length>1,f=n!=null&&n.length>0,b=y&&s>=0?g:c,S=20,z=f?u*.38:u*.45,k=Math.min(d*.15,48),w=k*.55,I=z+k*.4+8,C=f?I+22:z+k*.4+22,R=m?Math.min(u*.22,36):0,M=u-S-R,F=d-S*2,A=$(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:x,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,x]),H=$(()=>{let V=[],G=r+p+i;return V.push(o("text",{key:"value",x:String(d/2),y:String(z),"text-anchor":"middle","dominant-baseline":"central","font-size":String(k),"font-weight":"bold","font-family":"sans-serif",fill:h,"aria-label":`Value: ${G}`},r?o("tspan",{key:"prefix","font-size":String(w),"font-weight":"normal"},r):null,p,i?o("tspan",{key:"suffix","font-size":String(w),"font-weight":"normal"},i):null)),V},[d,z,k,w,p,r,i,h]),L=$(()=>f?[o("text",{key:"label",x:String(d/2),y:String(I),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[f,d,I,n]),P=$(()=>{if(!y)return[];let V=[],G=s,K=G>=0,ee=8,J=Cl(G),Y=(K?"+":"-")+J+(a?" "+a:""),U=d/2-40,_=C;if(K){let O=`${U},${_} ${U-ee/2},${_+ee} ${U+ee/2},${_+ee}`;V.push(o("polygon",{key:"trend-arrow",points:O,fill:b}))}else{let O=`${U},${_+ee} ${U-ee/2},${_} ${U+ee/2},${_}`;V.push(o("polygon",{key:"trend-arrow",points:O,fill:b}))}return V.push(o("text",{key:"trend-text",x:String(U+ee+4),y:String(_+ee*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:b,"aria-label":`Trend: ${Y}`},Y)),V},[y,s,a,b,d,C]),v=$(()=>{if(!m)return[];let V=[],G=l,K=[];for(let Q of G)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&K.push(Q);if(K.length<2)return[];let ee=1/0,J=-1/0;for(let Q of K)Q<ee&&(ee=Q),Q>J&&(J=Q);ee===J&&(ee-=1,J+=1);let Y=J-ee,U=F/(K.length-1),_="";for(let Q=0;Q<K.length;Q++){let oe=S+Q*U,j=M+R-(K[Q]-ee)/Y*R;Q===0?_+=`M ${oe} ${j}`:_+=` L ${oe} ${j}`}let O=S+(K.length-1)*U,Z=_+` L ${O} ${M+R} L ${S} ${M+R} Z`;return V.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),V.push(o("path",{key:"spark-fill",d:Z,fill:"url(#sparkGrad)"})),V.push(o("path",{key:"spark-line",d:_,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),V},[m,l,F,M,R,S]),D=A(),E=H(),W=L(),T=P(),N=v(),B=`${r}${p}${i}${f?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${d} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":B,style:{fontFamily:"sans-serif"}},...D,...N,...E,...W,...T)}var it=Math.PI/180;function $l(e,t,n,r,i,s,a,l){let d=Math.cos(r*it),u=Math.sin(r*it),h=Math.cos(i*it),g=Math.sin(i*it),c=e*h+n*g,x=-e*g+n*h,p=t*d-x*u,y=t*u+x*d;return{sx:s+c*l,sy:a-p*l,depth:y}}function Ue(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function Nt(e,t,n){let r=Math.sqrt(e*e+t*t+n*n);if(r<1e-10)return{theta:0,phi:0};let i=e/r,s=t/r,a=n/r,l=Math.acos(Math.max(-1,Math.min(1,a))),d=Math.atan2(s,i);return{theta:l,phi:d<0?d+2*Math.PI:d}}function De(e,t,n){let{x:r,y:i,z:s}=Ue(e),a=Math.cos(n),l=Math.sin(n),d,u,h;return t==="x"?(d=r,u=i*a-s*l,h=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,h=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,h=s),Nt(d,u,h)}function fo(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return De(e,"x",Math.PI);case"Y":return De(e,"y",Math.PI);case"Z":return De(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=Ue(e);return Nt(s,-i,r)}case"S":return De(e,"z",Math.PI/2);case"T":return De(e,"z",Math.PI/4);case"Rx":return De(e,"x",n);case"Ry":return De(e,"y",n);case"Rz":return De(e,"z",n)}}function zl(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:h=!0,showLabels:g=!0,showWireframe:c=!0,showTrail:x=!0,trailMaxPoints:p=200,trailColor:y="#ef4444",wireframeColor:m="#cbd5e1",vectorColor:f="#3b82f6",backgroundColor:b,sphereRadius:S=130,title:z,onStateChange:k}=e,[w,I]=X(t??{theta:0,phi:0}),[C,R]=X(s),[M,F]=X(a),[A,H]=X(l),L=ie([]),P=ie(!1),v=ie(null),D=ie(null);se(()=>{t&&I(t)},[t?.theta,t?.phi]);let E=ie(0);se(()=>{if(!n||n.length===0)return;E.current=0;let U=0,_=()=>{E.current>=n.length||(I(O=>{let Z=fo(O,n[E.current]);return E.current++,k&&k(Z),Z}),U=requestAnimationFrame(_))};return U=requestAnimationFrame(_),()=>cancelAnimationFrame(U)},[n]),se(()=>{let U=Ue(w);L.current.push(U),L.current.length>p&&L.current.splice(0,L.current.length-p)},[w.theta,w.phi]);let W=S*A,T=r/2,N=i/2,B=$((U,_,O)=>$l(U,_,O,M,C,T,N,W),[M,C,T,N,W]),V=$(U=>{if(!d)return;let _=U;P.current=!0,v.current={mx:_.clientX,my:_.clientY,rx:M,ry:C}},[d,M,C]),G=$(U=>{if(!P.current||!v.current)return;let _=U,O=v.current;R(O.ry+(_.clientX-O.mx)*.5),F(O.rx-(_.clientY-O.my)*.5)},[]),K=$(()=>{P.current=!1},[]),ee=$(U=>{if(!u)return;let _=U;_.preventDefault(),H(O=>Math.max(.5,Math.min(3,O*(_.deltaY>0?.95:1.05))))},[u]),J=[];if(b&&J.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b,rx:"6"})),z&&J.push(o("text",{key:"title",x:String(T),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},z)),c){let _=[];for(let Q=0;Q<=60;Q++){let oe=Q/60*2*Math.PI,j=B(Math.cos(oe),Math.sin(oe),0);_.push(`${Q===0?"M":"L"}${j.sx.toFixed(1)},${j.sy.toFixed(1)}`)}J.push(o("path",{key:"eq",d:_.join(" "),fill:"none",stroke:m,"stroke-width":"0.8",opacity:"0.5"}));let O=[];for(let Q=0;Q<=60;Q++){let oe=Q/60*2*Math.PI,j=B(Math.cos(oe),0,Math.sin(oe));O.push(`${Q===0?"M":"L"}${j.sx.toFixed(1)},${j.sy.toFixed(1)}`)}J.push(o("path",{key:"xz",d:O.join(" "),fill:"none",stroke:m,"stroke-width":"0.8",opacity:"0.4"}));let Z=[];for(let Q=0;Q<=60;Q++){let oe=Q/60*2*Math.PI,j=B(0,Math.cos(oe),Math.sin(oe));Z.push(`${Q===0?"M":"L"}${j.sx.toFixed(1)},${j.sy.toFixed(1)}`)}J.push(o("path",{key:"yz",d:Z.join(" "),fill:"none",stroke:m,"stroke-width":"0.8",opacity:"0.4"}))}let Y=[{id:"x",dir:[1,0,0],color:"#ef4444"},{id:"y",dir:[0,1,0],color:"#22c55e"},{id:"z",dir:[0,0,1],color:"#3b82f6"}];for(let U of Y){let _=B(U.dir[0]*1.15,U.dir[1]*1.15,U.dir[2]*1.15),O=B(-U.dir[0]*1.15,-U.dir[1]*1.15,-U.dir[2]*1.15),Z=B(0,0,0);J.push(o("line",{key:`axis-${U.id}`,x1:String(O.sx),y1:String(O.sy),x2:String(_.sx),y2:String(_.sy),stroke:U.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(g){let U=[{text:"|0\u27E9",pos:[0,0,1.3]},{text:"|1\u27E9",pos:[0,0,-1.3]},{text:"|+\u27E9",pos:[1.3,0,0]},{text:"|-\u27E9",pos:[-1.3,0,0]},{text:"|+i\u27E9",pos:[0,1.3,0]},{text:"|-i\u27E9",pos:[0,-1.3,0]}];for(let _ of U){let O=B(_.pos[0],_.pos[1],_.pos[2]);J.push(o("text",{key:`lbl-${_.text}`,x:String(O.sx),y:String(O.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},_.text))}}if(x&&L.current.length>1){let U=L.current,_=[];for(let O=0;O<U.length;O++){let Z=U[O],Q=B(Z.x,Z.y,Z.z);_.push(`${O===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}J.push(o("path",{key:"trail",d:_.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(h){let U=Ue(w),_=B(0,0,0),O=B(U.x,U.y,U.z);J.push(o("line",{key:"vec-line",x1:String(_.sx),y1:String(_.sy),x2:String(O.sx),y2:String(O.sy),stroke:f,"stroke-width":"2.5","stroke-linecap":"round"})),J.push(o("circle",{key:"vec-point",cx:String(O.sx),cy:String(O.sy),r:"5",fill:f,stroke:"#fff","stroke-width":"1.5"}));let Z=(w.theta*180/Math.PI).toFixed(0),Q=(w.phi*180/Math.PI).toFixed(0);J.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`\u03B8=${Z}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:D,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":z??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?P.current?"grabbing":"grab":"default"},onMouseDown:d?V:void 0,onMouseMove:d?G:void 0,onMouseUp:d?K:void 0,onMouseLeave:d?K:void 0,onWheel:u?ee:void 0},...J)}function Rl(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];typeof r=="number"&&isFinite(r)&&!isNaN(r)&&t.push(r)}return t.sort((n,r)=>n-r),t}function Bt(e,t){if(e.length===0)return 0;if(e.length===1)return e[0];let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);if(r===i)return e[r];let s=n-r;return e[r]+s*(e[i]-e[r])}function go(e){let t=Rl(e);if(t.length===0)return null;let n=Bt(t,25),r=Bt(t,50),i=Bt(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let x of t)if(x>=a){d=x;break}let u=t[t.length-1];for(let x=t.length-1;x>=0;x--)if(t[x]<=l){u=t[x];break}let h=0;for(let x of t)h+=x;let g=h/t.length,c=[];for(let x of t)(x<a||x>l)&&c.push(x);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:g,outliers:c,min:t[0],max:t[t.length-1]}}function El(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Il(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:h,padding:g=60}=e,c=i==="vertical",x=n-g*2,p=r-g*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],m=q(()=>{let v=[];for(let D of t)v.push(go(D.values));return v},[t]),f=q(()=>{let v=1/0,D=-1/0;for(let T of m){if(T===null)continue;let N=s&&T.outliers.length>0?Math.min(T.whiskerLow,T.outliers[0]):T.whiskerLow,B=s&&T.outliers.length>0?Math.max(T.whiskerHigh,T.outliers[T.outliers.length-1]):T.whiskerHigh;N<v&&(v=N),B>D&&(D=B)}isFinite(v)||(v=0,D=1);let E=D-v,W=E>0?E*.05:.5;return{min:v-W,max:D+W}},[m,s]),b=c?p:x,S=c?x:p,z=t.length>0?t.length:1,k=S/z,w=k*Math.min(Math.max(d,.1),.95),I=$(v=>{let D=f.max-f.min;return D===0?b/2:(v-f.min)/D*b},[f,b]),C=$(()=>{if(!u)return[];let v=[],D=f.max-f.min,E=El(D),W=Math.ceil(f.min/E)*E;for(let T=W;T<=f.max;T+=E){let N=I(T),B=String(Math.round(T*1e3)/1e3);if(c){let V=g+p-N;v.push(o("line",{key:`grid-${T}`,x1:String(g),y1:String(V),x2:String(g+x),y2:String(V),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),v.push(o("text",{key:`glabel-${T}`,x:String(g-6),y:String(V+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},B))}else{let V=g+N;v.push(o("line",{key:`grid-${T}`,x1:String(V),y1:String(g),x2:String(V),y2:String(g+p),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),v.push(o("text",{key:`glabel-${T}`,x:String(V),y:String(g+p+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},B))}}return v},[u,f,I,c,g,x,p]),R=$(()=>{let v=[];return v.push(o("line",{key:"axis-value",x1:String(g),y1:String(c?g:g+p),x2:String(g),y2:String(g+p),stroke:"#374151","stroke-width":"1.5"})),v.push(o("line",{key:"axis-category",x1:String(g),y1:String(g+p),x2:String(g+x),y2:String(g+p),stroke:"#374151","stroke-width":"1.5"})),v},[g,x,p,c]),M=$(()=>{let v=[];for(let D=0;D<t.length;D++){let E=m[D];if(E===null)continue;let W=t[D],T=W.color??y[D%y.length],N=k*D+k/2,B=w/2;if(c){let V=g+p-I(E.q1),G=g+p-I(E.q3),K=g+p-I(E.median),ee=g+p-I(E.whiskerLow),J=g+p-I(E.whiskerHigh),Y=g+N;v.push(o("line",{key:`wl-${D}`,x1:String(Y),y1:String(V),x2:String(Y),y2:String(ee),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`wlc-${D}`,x1:String(Y-B*.4),y1:String(ee),x2:String(Y+B*.4),y2:String(ee),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`wh-${D}`,x1:String(Y),y1:String(G),x2:String(Y),y2:String(J),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`whc-${D}`,x1:String(Y-B*.4),y1:String(J),x2:String(Y+B*.4),y2:String(J),stroke:l,"stroke-width":"1.5"}));let U=Math.min(V,G),_=Math.abs(V-G);if(v.push(o("rect",{key:`box-${D}`,x:String(Y-B),y:String(U),width:String(w),height:String(Math.max(_,1)),fill:T,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${W.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),v.push(o("line",{key:`med-${D}`,x1:String(Y-B),y1:String(K),x2:String(Y+B),y2:String(K),stroke:"#fff","stroke-width":"2.5"})),a){let O=g+p-I(E.mean);v.push(o("circle",{key:`mean-${D}`,cx:String(Y),cy:String(O),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let O=0;O<E.outliers.length;O++){let Z=g+p-I(E.outliers[O]);v.push(o("circle",{key:`out-${D}-${O}`,cx:String(Y),cy:String(Z),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[O]}`}))}v.push(o("text",{key:`cat-${D}`,x:String(Y),y:String(g+p+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},W.label))}else{let V=g+I(E.q1),G=g+I(E.q3),K=g+I(E.median),ee=g+I(E.whiskerLow),J=g+I(E.whiskerHigh),Y=g+N;v.push(o("line",{key:`wl-${D}`,x1:String(V),y1:String(Y),x2:String(ee),y2:String(Y),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`wlc-${D}`,x1:String(ee),y1:String(Y-B*.4),x2:String(ee),y2:String(Y+B*.4),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`wh-${D}`,x1:String(G),y1:String(Y),x2:String(J),y2:String(Y),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`whc-${D}`,x1:String(J),y1:String(Y-B*.4),x2:String(J),y2:String(Y+B*.4),stroke:l,"stroke-width":"1.5"}));let U=Math.min(V,G),_=Math.abs(G-V);if(v.push(o("rect",{key:`box-${D}`,x:String(U),y:String(Y-B),width:String(Math.max(_,1)),height:String(w),fill:T,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${W.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),v.push(o("line",{key:`med-${D}`,x1:String(K),y1:String(Y-B),x2:String(K),y2:String(Y+B),stroke:"#fff","stroke-width":"2.5"})),a){let O=g+I(E.mean);v.push(o("circle",{key:`mean-${D}`,cx:String(O),cy:String(Y),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let O=0;O<E.outliers.length;O++){let Z=g+I(E.outliers[O]);v.push(o("circle",{key:`out-${D}-${O}`,cx:String(Z),cy:String(Y),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[O]}`}))}v.push(o("text",{key:`cat-${D}`,x:String(g-6),y:String(Y+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},W.label))}}return v},[t,m,I,c,g,x,p,k,w,l,s,a,y]),F=$(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),A=C(),H=R(),L=M(),P=F();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Box plot",style:{fontFamily:"sans-serif"}},...P,...A,...H,...L)}function po(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Pl(e,t,n){return e<t?t:e>n?n:e}function Ht(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function Tl(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:h=4,defaultColor:g="#3b82f6",opacity:c=.7,title:x,padding:p=60}=e,y=q(()=>{let L=[];for(let P=0;P<t.length;P++){let v=t[P];Ht(v.x)&&Ht(v.y)&&Ht(v.r)&&L.push(v)}return L},[t]),m=n-p*2,f=r-p*2,b=q(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let L=1/0,P=-1/0,v=1/0,D=-1/0,E=1/0,W=-1/0;for(let T of y)T.x<L&&(L=T.x),T.x>P&&(P=T.x),T.y<v&&(v=T.y),T.y>D&&(D=T.y),T.r<E&&(E=T.r),T.r>W&&(W=T.r);return L===P&&(L-=1,P+=1),v===D&&(v-=1,D+=1),E===W&&(E=0,W=W>0?W:1),{xMin:L,xMax:P,yMin:v,yMax:D,rMin:E,rMax:W}},[y]),S=$(L=>{let P=b.xMax-b.xMin;return p+(L-b.xMin)/P*m},[b,p,m]),z=$(L=>{let P=b.yMax-b.yMin;return p+f-(L-b.yMin)/P*f},[b,p,f]),k=$(L=>{let P=b.rMax-b.rMin;if(P===0)return(h+u)/2;let v=(L-b.rMin)/P;return h+v*(u-h)},[b,h,u]),w=$(()=>{if(!a)return[];let L=[],P=po(b.xMax-b.xMin),v=Math.ceil(b.xMin/P)*P;for(let W=v;W<=b.xMax;W+=P){let T=S(W);L.push(o("line",{key:`grid-x-${W}`,x1:String(T),y1:String(p),x2:String(T),y2:String(p+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),L.push(o("text",{key:`grid-xlabel-${W}`,x:String(T),y:String(p+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(W*1e3)/1e3)))}let D=po(b.yMax-b.yMin),E=Math.ceil(b.yMin/D)*D;for(let W=E;W<=b.yMax;W+=D){let T=z(W);L.push(o("line",{key:`grid-y-${W}`,x1:String(p),y1:String(T),x2:String(p+m),y2:String(T),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),L.push(o("text",{key:`grid-ylabel-${W}`,x:String(p-6),y:String(T+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(W*1e3)/1e3)))}return L},[a,b,S,z,p,m,f]),I=$(()=>{if(!l)return[];let L=[];return L.push(o("line",{key:"axis-y",x1:String(p),y1:String(p),x2:String(p),y2:String(p+f),stroke:"#374151","stroke-width":"1.5"})),L.push(o("line",{key:"axis-x",x1:String(p),y1:String(p+f),x2:String(p+m),y2:String(p+f),stroke:"#374151","stroke-width":"1.5"})),i&&L.push(o("text",{key:"x-label",x:String(p+m/2),y:String(p+f+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&L.push(o("text",{key:"y-label",x:String(p-40),y:String(p+f/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${p-40}, ${p+f/2})`},s)),L},[l,p,m,f,i,s]),C=$(()=>{let L=[];for(let P=0;P<y.length;P++){let v=y[P],D=S(v.x),E=z(v.y),W=Pl(k(v.r),h,u),T=v.color??g;L.push(o("circle",{key:`bubble-${P}`,cx:String(D),cy:String(E),r:String(W),fill:T,opacity:String(c),stroke:T,"stroke-width":"1","stroke-opacity":"0.8","aria-label":v.label??`Bubble at (${v.x}, ${v.y}) size ${v.r}`,role:"img"})),d&&v.label&&L.push(o("text",{key:`label-${P}`,x:String(D),y:String(E-W-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},v.label))}return L},[y,S,z,k,g,c,d,h,u]),R=$(()=>x?[o("text",{key:"title",x:String(n/2),y:String(p/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n,p]),M=w(),F=I(),A=C(),H=R();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x??"Bubble chart",style:{fontFamily:"sans-serif"}},...H,...M,...F,...A)}var Dl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Al=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Ll(e){let t=e.split("-");return t.length!==3?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function mo(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function ho(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Wl(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Fl(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=ho(t[i]),l=ho(t[i+1]);return Wl(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var Nl=["#9be9a8","#40c463","#30a14e","#216e39"];function Bl(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=Nl,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:g,startDate:c,endDate:x,maxVal:p}=q(()=>{let A=new Map,H=0,L=null,P=null;for(let E of t){let W=Ll(E.date);if(isNaN(W.getTime()))continue;let T=mo(W);A.set(T,(A.get(T)??0)+E.value);let N=A.get(T);N>H&&(H=N),(L===null||W<L)&&(L=W),(P===null||W>P)&&(P=W)}if(L===null||P===null){let E=new Date;L=new Date(E.getFullYear(),0,1),P=new Date(E.getFullYear(),11,31)}let v=new Date(L);v.setDate(v.getDate()-v.getDay());let D=new Date(P);return D.setDate(D.getDate()+(6-D.getDay())),{dateMap:A,startDate:v,endDate:D,maxVal:H>0?H:1}},[t]),y=d?30:0,m=l?16:0,f=h?28:0,b=y+10,S=f+m+4,z=$(()=>{let A=[],H=new Date(c),L=0;for(;H<=x;){let P=H.getDay();P===0&&H>c&&L++;let v=mo(H),D=g.get(v),E=D!==void 0&&D>0?Fl(D/p,i):u,W=b+L*(s+a),T=S+P*(s+a);A.push(o("rect",{key:`day-${v}`,x:String(W),y:String(T),width:String(s),height:String(s),rx:"2",ry:"2",fill:E,"aria-label":`${v}: ${D??0}`})),H.setDate(H.getDate()+1)}return A},[c,x,g,p,i,u,s,a,b,S]),k=$(()=>{if(!l)return[];let A=[],H=new Date(c),L=0,P=-1;for(;H<=x;){let v=H.getDay();v===0&&H>c&&L++;let D=H.getMonth();if(D!==P&&v===0){P=D;let E=b+L*(s+a);A.push(o("text",{key:`month-${L}`,x:String(E),y:String(f+m-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Dl[D]))}H.setDate(H.getDate()+1)}return A},[l,c,x,s,a,b,f,m]),w=$(()=>{if(!d)return[];let A=[],H=[1,3,5];for(let L of H){let P=S+L*(s+a)+s/2;A.push(o("text",{key:`day-label-${L}`,x:String(y),y:String(P),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Al[L]))}return A},[d,s,a,S,y]),I=$(()=>h?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let C=I(),R=k(),M=w(),F=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map",style:{fontFamily:"sans-serif"}},...C,...R,...M,...F)}var Hl=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Pe(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Ol(e,t,n,r,i,s){let a=Pe(e,t,n,i),l=Pe(e,t,n,s),d=Pe(e,t,r,i),u=Pe(e,t,r,s),g=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${g} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${g} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function _l(e,t,n,r,i,s,a){let l=Pe(e,t,n,r),d=Pe(e,t,n,i),u=Pe(e,t,n,s),h=Pe(e,t,n,a),g=i-r,c=a-s,x=g>Math.PI?1:0,p=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${x} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${p} 1 ${h.x} ${h.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function Vl(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let x=0;for(let p=0;p<i;p++){let y=e[c]?.[p]??0;x+=Math.max(0,y)}s.push(x),a+=x}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),x=[],p=0;for(let y=0;y<i;y++)x.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:p,endAngle:p+c,value:0}),p+=c+r;return{groups:x,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let x=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+x,value:s[c]}),u+=x+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let g=[];for(let c=0;c<i;c++)for(let x=c;x<i;x++){let p=Math.max(0,e[c]?.[x]??0),y=c===x?0:Math.max(0,e[x]?.[c]??0);if(p===0&&y===0)continue;let m=p+y,f=s[c]>0?p/a*l:0,b=h[c],S=b+f;h[c]=S;let z=s[x]>0?p/a*l:0,k=h[x],w=k+z;if(h[x]=w,c===x){p>0&&g.push({sourceIndex:c,targetIndex:x,sourceStartAngle:b,sourceEndAngle:S,targetStartAngle:k,targetEndAngle:w,value:p,color:d[c].color});continue}let I=s[x]>0?y/a*l:0,R=h[x]+I;h[x]=R;let M=s[c]>0?y/a*l:0,A=h[c]+M;h[c]=A,(p>0||y>0)&&g.push({sourceIndex:c,targetIndex:x,sourceStartAngle:b,sourceEndAngle:Math.max(S,b+.001),targetStartAngle:k,targetEndAngle:Math.max(w,k+.001),value:m,color:d[c].color})}return{groups:d,chords:g}}function Yl(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=Hl,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.9,title:g}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,x=i/2,p=Math.min(r,i)/2-40,y=p*Math.max(.5,Math.min(.99,h)),m=p+16,f=q(()=>Vl(t,n,s,a),[t,n,s,a]),b=$(()=>{let C=[];for(let R=0;R<f.groups.length;R++){let M=f.groups[R];if(M.endAngle-M.startAngle<.001)continue;let A=Ol(c,x,p,y,M.startAngle,M.endAngle);if(C.push(o("path",{key:`arc-${R}`,d:A,fill:M.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${M.label}: ${M.value}`})),l){let H=(M.startAngle+M.endAngle)/2,L=Pe(c,x,m,H),D=((H-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,E=D?"start":"end",W=H*180/Math.PI-90;D||(W+=180);let T=d?`${M.label} (${M.value})`:M.label;C.push(o("text",{key:`label-${R}`,x:String(L.x),y:String(L.y),"text-anchor":E,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${W}, ${L.x}, ${L.y})`,"dominant-baseline":"central","pointer-events":"none"},T))}}return C},[f,c,x,p,y,m,l,d]),S=$(()=>{let C=[];for(let R=0;R<f.chords.length;R++){let M=f.chords[R],F=_l(c,x,y,M.sourceStartAngle,M.sourceEndAngle,M.targetStartAngle,M.targetEndAngle);C.push(o("path",{key:`ribbon-${R}`,d:F,fill:M.color,"fill-opacity":String(u),stroke:M.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return C},[f,c,x,y,u]),z=$(()=>g?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,r]),k=S(),w=b(),I=z();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Chord diagram",style:{fontFamily:"sans-serif"}},...I,...k,...w)}var Gl=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ul(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],h=[];for(let g=0;g<u.length;g++)h.push(n+r.length+g);t.push({id:d,node:s,depth:a,parentId:l,childIndices:h});for(let g=0;g<u.length;g++)r.push([u[g],a+1,d])}return{flatNodes:t,maxDepth:i}}function jl(e){let t=e.length,n=new Array(t).fill(0);for(let r=t-1;r>=0;r--){let i=e[r];if(i.childIndices.length===0)n[r]=1;else{let s=0;for(let a of i.childIndices)a<t&&(s+=n[a]);n[r]=Math.max(s,1)}}return n}function Xl(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=Ul(e);if(d.length===0)return[];let h=jl(d),g=t-s*2,c=n-s*2,x=a==="horizontal",p=u+1,y=x?p>1?(g-r)/u:0:p>1?(c-i)/u:0,m=new Array(d.length),f=h[0],b=x?c:g,S=f>0?b/f:b,z=new Array(d.length);z[0]=[0,f];let k=[0],w=0;for(;w<k.length;){let I=k[w];w++;let C=d[I],[R,M]=z[I],F=(R+M)/2,A=s+C.depth*y,H=s+(F-.5)*S,L=x?A:H,P=x?H:A,v=C.node.color??l[C.depth%l.length];m[I]={id:C.id,label:C.node.label,value:C.node.value!==void 0?String(C.node.value):"",color:v,depth:C.depth,x:L,y:P,parentId:C.parentId,childCount:C.childIndices.length,subtreeLeafCount:h[I]};let D=R;for(let E of C.childIndices)if(E<d.length){let W=h[E],T=D+W;z[E]=[D,T],D=T,k.push(E)}}return m}function ql(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:h=Gl,title:g,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let x=i==="horizontal",p=q(()=>Xl(t,n,r,s,a,c,i,h),[t,n,r,s,a,c,i,h]),y=q(()=>{let w=new Map;for(let I=0;I<p.length;I++){let C=p[I];w.set(C.id,C)}return w},[p]),m=$(()=>{if(!d)return[];let w=[];for(let I=0;I<p.length;I++){let C=p[I];if(C.parentId===null)continue;let R=y.get(C.parentId);if(!R)continue;let M,F,A,H;x?(M=R.x+s,F=R.y+a/2,A=C.x,H=C.y+a/2):(M=R.x+s/2,F=R.y+a,A=C.x+s/2,H=C.y);let L=(M+A)/2,P=(F+H)/2,v;x?v=`M ${M} ${F} C ${L} ${F}, ${L} ${H}, ${A} ${H}`:v=`M ${M} ${F} C ${M} ${P}, ${A} ${P}, ${A} ${H}`,w.push(o("path",{key:`conn-${I}`,d:v,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return w},[p,y,x,s,a,d,u]),f=$(()=>{let w=[];for(let I=0;I<p.length;I++){let C=p[I];w.push(o("rect",{key:`node-rect-${C.id}`,x:String(C.x),y:String(C.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:C.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":C.value?`${C.label}: ${C.value}`:C.label}));let R=l&&C.value?C.y+a/2-2:C.y+a/2+4;w.push(o("text",{key:`node-label-${C.id}`,x:String(C.x+s/2),y:String(R),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},C.label)),l&&C.value&&w.push(o("text",{key:`node-value-${C.id}`,x:String(C.x+s/2),y:String(C.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},C.value))}return w},[p,s,a,l]),b=$(()=>g?[o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n]),S=m(),z=f(),k=b();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Decomposition tree",style:{fontFamily:"sans-serif"}},...k,...S,...z)}var bo=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Kl(e){return bo[e%bo.length]}function xo(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],h=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??Kl(d),x:u.x??r+s*Math.cos(h),y:u.y??i+s*Math.sin(h),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function yo(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let h=Math.sqrt(u),g=l/h,c=d/h,x=n-h;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=g*x,a.y+=c*x):a.fixed?(i.x-=g*x,i.y-=c*x):(i.x-=g*x*.5,i.y-=c*x*.5,a.x+=g*x*.5,a.y+=c*x*.5);let p=i.vx-a.vx,y=i.vy-a.vy,m=p*g+y*c;m<=0||(i.fixed?(a.vx+=m*g,a.vy+=m*c):a.fixed?(i.vx-=m*g,i.vy-=m*c):(i.vx-=m*g,i.vy-=m*c,a.vx+=m*g,a.vy+=m*c))}}}function Zl(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let h=new Map;for(let b=0;b<u;b++)h.set(e[b].id,b);let g=new Float64Array(u),c=new Float64Array(u);for(let b=0;b<u;b++){let S=e[b];for(let z=b+1;z<u;z++){let k=e[z],w=S.x-k.x,I=S.y-k.y,C=w*w+I*I;C<1&&(C=1);let R=Math.sqrt(C),M=i/C,F=w/R*M,A=I/R*M;g[b]+=F,c[b]+=A,g[z]-=F,c[z]-=A}}for(let b=0;b<t.length;b++){let S=t[b],z=h.get(S.source),k=h.get(S.target);if(z===void 0||k===void 0)continue;let w=e[z],I=e[k],C=I.x-w.x,R=I.y-w.y,M=Math.sqrt(C*C+R*R);if(M<.1)continue;let F=S.weight??1,A=M-l,H=s*A*F,L=C/M*H,P=R/M*H;g[z]+=L,c[z]+=P,g[k]-=L,c[k]-=P}let x=n/2,p=r/2,y=.001;for(let b=0;b<u;b++){let S=e[b];g[b]+=(x-S.x)*y,c[b]+=(p-S.y)*y}let m=20,f=[];for(let b=0;b<u;b++){let S=e[b];if(S.fixed){f.push({...S,vx:0,vy:0});continue}let z=(S.vx+g[b])*a,k=(S.vy+c[b])*a,w=Math.sqrt(z*z+k*k),I=10;w>I&&(z=z/w*I,k=k/w*I);let C=S.x+z,R=S.y+k;C=Math.max(m,Math.min(n-m,C)),R=Math.max(m,Math.min(r-m,R)),f.push({...S,x:C,y:R,vx:z,vy:k})}return yo(f,d),f}function Jl(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.vx*r.vx+r.vy*r.vy}return t}function Ql(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:h=300,attractionForce:g=.01,damping:c=.9,edgeLength:x=100,edgeColor:p="#94a3b8",edgeWidth:y=1.5,title:m,customForce:f,trails:b}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty force-directed graph"},m?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let S=ie(xo(t,r,i)),[z,k]=X(0),w=ie(!0),I=ie(!1),C=ie(n);C.current=n;let R=ie(f);R.current=f;let M=ie(null),F=ie({repulsionForce:h,attractionForce:g,damping:c,edgeLength:x,width:r,height:i,nodeRadius:s,solidNodes:l});F.current={repulsionForce:h,attractionForce:g,damping:c,edgeLength:x,width:r,height:i,nodeRadius:s,solidNodes:l};let A=ie(new Map);se(()=>{S.current=xo(t,r,i),I.current=!1,w.current=!0,A.current=new Map,k(oe=>oe+1)},[t.length]),se(()=>{let oe=0,j=()=>{if(!w.current)return;let te=F.current,re=R.current,ae;if(re?(ae=re(S.current,C.current,te.width,te.height,M.current),te.solidNodes&&yo(ae,te.nodeRadius)):ae=Zl(S.current,C.current,te.width,te.height,te.repulsionForce,te.attractionForce,te.damping,te.edgeLength,te.nodeRadius),S.current=ae,b)for(let ne=0;ne<b.length;ne++){let ce=b[ne],de=ae.find(me=>me.id===ce.nodeId);if(!de)continue;let le=A.current.get(ce.nodeId);le||(le=[],A.current.set(ce.nodeId,le)),le.push({x:de.x,y:de.y});let ue=ce.maxPoints??200;le.length>ue&&le.splice(0,le.length-ue)}if(!re&&Jl(ae)<.01){I.current=!0,k(ne=>ne+1);return}k(ne=>ne+1),oe=requestAnimationFrame(j)};return oe=requestAnimationFrame(j),()=>{w.current=!1,cancelAnimationFrame(oe)}},[]);let H=S.current,L=$(oe=>{S.current=S.current.map(j=>j.id===oe?{...j,fixed:!j.fixed,vx:0,vy:0}:j),I.current&&(I.current=!1,w.current=!0,k(j=>j+1))},[]),P=ie(null),v=ie(null),D=$(oe=>{let j=oe,te=v.current;if(!te)return{x:j.clientX,y:j.clientY};let re=te.getBoundingClientRect(),ae=r/re.width,ne=i/re.height;return{x:(j.clientX-re.left)*ae,y:(j.clientY-re.top)*ne}},[r,i]),E=ie(!1),W=$((oe,j)=>{j.stopPropagation(),P.current=oe;let te=S.current.find(re=>re.id===oe);E.current=te?.fixed??!1,S.current=S.current.map(re=>re.id===oe?{...re,fixed:!0,vx:0,vy:0}:re)},[]),T=$(oe=>{let j=D(oe);if(M.current={x:j.x,y:j.y},!P.current)return;let te=P.current,re=20;S.current=S.current.map(ae=>ae.id===te?{...ae,x:Math.max(re,Math.min(r-re,j.x)),y:Math.max(re,Math.min(i-re,j.y))}:ae),I.current&&(I.current=!1,w.current=!0),k(ae=>ae+1)},[r,i,D]),N=$(()=>{let oe=P.current;oe&&(S.current=S.current.map(j=>j.id===oe?{...j,fixed:E.current}:j)),P.current=null},[]),B=$(()=>{P.current=null,M.current=null},[]),V=q(()=>{let oe=new Map;for(let j=0;j<H.length;j++)oe.set(H[j].id,H[j]);return oe},[z]),G=$(()=>u?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+s),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:p})))]:[],[u,s,p]),K=$(()=>{let oe=[];for(let j=0;j<n.length;j++){let te=n[j],re=V.get(te.source),ae=V.get(te.target);if(!re||!ae||te.weight!==void 0&&te.weight<=0)continue;let ne=te.weight?Math.max(.5,Math.min(6,y*te.weight)):y,ce={key:`edge-${j}`,x1:String(re.x),y1:String(re.y),x2:String(ae.x),y2:String(ae.y),stroke:te.color??p,"stroke-width":String(ne),"stroke-opacity":"0.6"};u&&(ce["marker-end"]="url(#arrowhead)"),oe.push(o("line",ce))}return oe},[z,p,y,u]),ee=$(()=>{let oe=[];for(let j=0;j<H.length;j++){let te=H[j];oe.push(o("circle",{key:`node-${te.id}`,cx:String(te.x),cy:String(te.y),r:String(s),fill:te.color,stroke:te.fixed?"#0f172a":"#fff","stroke-width":te.fixed?"3":String(a),style:{cursor:P.current===te.id?"grabbing":"grab"},onMouseDown:re=>W(te.id,re),onDblClick:()=>L(te.id),role:"button",tabIndex:0,"aria-label":`Node: ${te.label}${te.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&oe.push(o("text",{key:`label-${te.id}`,x:String(te.x),y:String(te.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},te.label))}return oe},[z,s,d,L]),J=$(()=>m?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,r]),Y=$(()=>{if(!b||b.length===0)return[];let oe=[];for(let j=0;j<b.length;j++){let te=b[j],re=A.current.get(te.nodeId);if(!re||re.length<2)continue;let ae=[];for(let ne=0;ne<re.length;ne++){let ce=re[ne];ae.push(`${ne===0?"M":"L"}${ce.x.toFixed(1)},${ce.y.toFixed(1)}`)}oe.push(o("path",{key:`trail-${te.nodeId}`,d:ae.join(" "),fill:"none",stroke:te.color??"#3b82f6","stroke-width":String(te.width??1),opacity:String(te.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return oe},[z,b]),U=G(),_=Y(),O=K(),Z=ee(),Q=J();return o("svg",{ref:v,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:P.current?"grabbing":"default"},onMouseMove:T,onMouseUp:N,onMouseLeave:B},...U,...Q,..._,...O,...Z)}var So=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function ea(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:s=!0,showValues:a=!0,showPercentage:l=!0,gapSize:d=2,colors:u=So,title:h}=e,g=i==="vertical",c=h?30:0,x=120,p=q(()=>{let C=0;for(let R=0;R<t.length;R++)t[R].value>C&&(C=t[R].value);return C>0?C:1},[t]),y=$(C=>p===0?0:Math.max(.05,C/p),[p]),m=$((C,R)=>R||(u[C%u.length]??So[0]),[u]),f=$(()=>{if(t.length===0)return[];let C=[],R=40,M=n-R*2-x,F=r-c-R*2,A=d*(t.length-1),H=Math.max(1,(F-A)/t.length),L=R+M/2;for(let P=0;P<t.length;P++){let v=t[P],D=P<t.length-1?t[P+1]:null,E=m(P,v.color),W=y(v.value),T=D!==null?y(D.value):W*.6,N=M/2*W,B=M/2*T,V=c+R+P*(H+d),G=L-N,K=L+N,ee=L+B,J=L-B,Y=`${G},${V} ${K},${V} ${ee},${V+H} ${J},${V+H}`;C.push(o("polygon",{key:`section-${P}`,points:Y,fill:E,stroke:"#fff","stroke-width":"1"}));let U=R+M+12,_=V+H/2;if(s&&C.push(o("text",{key:`label-${P}`,x:String(U),y:String(_-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},v.label)),a||l){let O="";if(a&&(O=String(v.value)),l&&t.length>0){let Z=t[0].value,Q=Z>0?Math.round(v.value/Z*100):0;O+=a?` (${Q}%)`:`${Q}%`}C.push(o("text",{key:`value-${P}`,x:String(U),y:String(_+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},O))}}return C},[t,n,r,c,d,s,a,l,m,y,x]),b=$(()=>{if(t.length===0)return[];let C=[],R=40,M=n-R*2,A=r-c-R*2-40,H=d*(t.length-1),L=Math.max(1,(M-H)/t.length),P=c+R+A/2;for(let v=0;v<t.length;v++){let D=t[v],E=v<t.length-1?t[v+1]:null,W=m(v,D.color),T=y(D.value),N=E!==null?y(E.value):T*.6,B=A/2*T,V=A/2*N,G=R+v*(L+d),K=P-B,ee=P-V,J=P+V,Y=P+B,U=`${G},${K} ${G+L},${ee} ${G+L},${J} ${G},${Y}`;C.push(o("polygon",{key:`section-${v}`,points:U,fill:W,stroke:"#fff","stroke-width":"1"}));let _=G+L/2,O=c+R+A+14;if(s&&C.push(o("text",{key:`label-${v}`,x:String(_),y:String(O),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},D.label)),a||l){let Z="";if(a&&(Z=String(D.value)),l&&t.length>0){let Q=t[0].value,oe=Q>0?Math.round(D.value/Q*100):0;Z+=a?` (${oe}%)`:`${oe}%`}C.push(o("text",{key:`value-${v}`,x:String(_),y:String(O+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Z))}}return C},[t,n,r,c,d,s,a,l,m,y]),S=$(()=>h?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n]),z=$(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),k=S(),w=g?f():b(),I=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Funnel chart",style:{fontFamily:"sans-serif"}},...k,...w,...I)}var wo=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function vo(e){if(e<=0)return 1;let t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ta(e,t){return t||wo[e%wo.length]}function na(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:h,padding:g=50}=e;if(t.length===0)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,x=q(()=>{let F=1/0,A=-1/0;for(let H of t){H.start<F&&(F=H.start);let L=H.start+H.duration;L>A&&(A=L)}return F===1/0&&(F=0,A=1),{min:F,max:A,range:A-F}},[t]),p=q(()=>{let F=t.slice();return F.sort((A,H)=>A.group!==H.group?(A.group??"").localeCompare(H.group??""):A.start-H.start),F},[t]),y=r??g*2+p.length*(i+s)+s+20,m=n-g-c-g,f=g+(h?20:0),b=$(F=>x.range===0?c+g:c+g+(F-x.min)/x.range*m,[x,m,c,g]),S=$(()=>{if(!a)return[];let F=[],A=vo(x.range),H=Math.ceil(x.min/A)*A,L=f+p.length*(i+s)+s;for(let P=H;P<=x.max;P+=A){let v=b(P);F.push(o("line",{key:`grid-${P}`,x1:String(v),y1:String(f),x2:String(v),y2:String(L),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return F},[a,x,f,p.length,i,s,b]),z=$(()=>{let F=[],A=vo(x.range),H=Math.ceil(x.min/A)*A,L=f-8;for(let P=H;P<=x.max;P+=A){let v=b(P);F.push(o("text",{key:`taxis-${P}`,x:String(v),y:String(L),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(P)))}return F.push(o("text",{key:"time-unit",x:String(n-g),y:String(L),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),F},[x,f,b,u,n,g]),k=$(()=>{let F=[],A="";for(let H=0;H<p.length;H++){let L=p[H],P=f+H*(i+s)+s,v=b(L.start),D=Math.max(2,b(L.start+L.duration)-v),E=ta(H,L.color);L.group&&L.group!==A&&(A=L.group,l&&F.push(o("text",{key:`group-${H}`,x:String(g),y:String(P+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},L.group))),F.push(o("rect",{key:`bar-${L.id}`,x:String(v),y:String(P),width:String(D),height:String(i),rx:"4",ry:"4",fill:E,role:"graphics-symbol","aria-label":`${L.label}: start ${L.start}, duration ${L.duration}`})),l&&F.push(o("text",{key:`label-${L.id}`,x:String(c+g-8),y:String(P+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},L.label.length>16?L.label.substring(0,14)+"..":L.label)),d&&D>30&&F.push(o("text",{key:`prog-${L.id}`,x:String(v+D/2),y:String(P+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${L.start}-${L.start+L.duration}`))}return F},[p,f,i,s,b,l,d,c,g]),w=$(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n,g]),I=S(),C=z(),R=k(),M=w();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...M,...I,...C,...R)}var oa=Math.PI/180;function ra(e){return e*oa}function Ee(e,t,n,r){let i=ra(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function ko(e,t,n,r,i){let s=Ee(e,t,n,i),a=Ee(e,t,n,r),l=i-r,d=Math.abs(l)>180?1:0,u=l>0?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} ${u===1?0:1} ${a.x} ${a.y}`}function ia(e,t,n){return e<t?t:e>n?n:e}function We(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function sa(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:h=!0,showTicks:g=!0,tickCount:c=10,label:x,unit:p,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:m="#374151",backgroundColor:f="#e5e7eb"}=e,b=isFinite(n)&&!isNaN(n)?n:0,S=isFinite(r)&&!isNaN(r)&&r>b?r:b+100,z=isFinite(t)&&!isNaN(t)?ia(t,b,S):b,k=(u?24:0)+(x?18:0),w=i/2,I=(s-k)*.6,C=Math.min(i/2,(s-k)*.55)-d/2-10,R=C-d,M=C-d/2,F=l-a,A=$(Y=>{let U=S-b;if(U===0)return a;let _=(Y-b)/U;return a+_*F},[b,S,a,F]),H=$(()=>{let Y=ko(w,I,M,a,l);return[o("path",{key:"bg-arc",d:Y,fill:"none",stroke:f,"stroke-width":String(d),"stroke-linecap":"round"})]},[w,I,M,a,l,f,d]),L=$(()=>{if(y.length===0)return[];let Y=[],U=F/y.length;for(let _=0;_<y.length;_++){let O=a+_*U,Z=O+U,Q=ko(w,I,M,O,Z);Y.push(o("path",{key:`seg-${_}`,d:Q,fill:"none",stroke:y[_],"stroke-width":String(d),"stroke-linecap":_===0||_===y.length-1?"round":"butt",opacity:"0.85"}))}return Y},[y,F,a,w,I,M,d]),P=$(()=>{if(!g||c<=0)return[];let Y=[],U=Math.max(1,Math.min(c,100));for(let _=0;_<=U;_++){let O=_/U,Z=a+O*F,Q=_%2===0,oe=Q?10:6,j=Ee(w,I,C+4,Z),te=Ee(w,I,C+4+oe,Z);if(Y.push(o("line",{key:`tick-${_}`,x1:String(j.x),y1:String(j.y),x2:String(te.x),y2:String(te.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let re=b+O*(S-b),ae=Ee(w,I,C+4+oe+12,Z);Y.push(o("text",{key:`tick-label-${_}`,x:String(ae.x),y:String(ae.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},We(re)))}}return Y},[g,c,a,F,w,I,C,b,S]),v=$(()=>{let Y=[],U=A(z),_=R-8,O=Ee(w,I,_,U),Z=6,Q=U+90,oe=U-90,j=Ee(w,I,Z,Q),te=Ee(w,I,Z,oe);return Y.push(o("polygon",{key:"needle",points:`${O.x},${O.y} ${j.x},${j.y} ${te.x},${te.y}`,fill:m,stroke:"none"})),Y.push(o("circle",{key:"needle-cap",cx:String(w),cy:String(I),r:"8",fill:m,stroke:"#fff","stroke-width":"2"})),Y},[z,A,w,I,R,m]),D=$(()=>{if(!u)return[];let Y=[],U=We(z),_=U+(p?" "+p:""),O=I+M+20;return Y.push(o("text",{key:"value-text",x:String(w),y:String(O),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${_}`},U,p?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+p):null)),Y},[u,z,p,w,I,M]),E=$(()=>{if(!x)return[];let Y=I+M+(u?40:20);return[o("text",{key:"label",x:String(w),y:String(Y),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},x)]},[x,w,I,M,u]),W=$(()=>{if(!h)return[];let Y=[],U=Ee(w,I,M,a),_=Ee(w,I,M,l);return Y.push(o("text",{key:"min-label",x:String(U.x-4),y:String(U.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},We(b))),Y.push(o("text",{key:"max-label",x:String(_.x+4),y:String(_.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},We(S))),Y},[h,w,I,M,a,l,b,S]),T=H(),N=L(),B=P(),V=v(),G=D(),K=E(),ee=W(),J=`Gauge: ${We(z)}${p?" "+p:""}, range ${We(b)} to ${We(S)}${x?", "+x:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(z),"aria-valuemin":String(b),"aria-valuemax":String(S),"aria-label":J,style:{fontFamily:"sans-serif"}},...T,...N,...B,...V,...G,...K,...ee)}var st={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1.3,.1 .6,.4 .8,-.1 2,-3.8 v -2.3 l 1.1,-1.1 1.4,.5 3.4,6.4 v .9 l -3.3,2.2 3.5,-.4 4.9,-1.6 z"},AK:{name:"Alaska",path:"m 15.8,572 h 2.4 l .7,.7 -1,1.2 -1.9,.2 -2.5,1.3 -3.7,-.1 2.2,-.9 .3,-1.1 2.5,-.3 z m 8.3,-1.7 1.3,.5 h .9 l .5,1.2 .3,-.6 .9,.2 1.1,1.5 0,.5 -4.2,1.9 -2.4,-.1 -1,-.5 -1.1,.7 -2,0 -1.1,-1.4 4.7,-.5 z m 5.4,-.1 1,.1 .7,.7 v 1 l -1.3,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4 .5,1.5 -1.4,1.6 .4,.9 2.3,-1.1 v -1.4 l 3.3,1.9 1.9,.7 1.9,.7 3,3.8 17,3.8 1.4,1 4,.8 .7,.5 2.8,-.2 4.9,.8 1.4,1.5 -1,1 .8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3 z m -49.5,-37.3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function la(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:h="Map of the United States"}=e,g=q(()=>Object.keys(st),[]),c=$(f=>{l&&l(f)},[l]),x=$((f,b)=>{let S=b.currentTarget;S&&S.setAttribute("fill",u),d&&d(f)},[d,u]),p=$((f,b)=>{let S=b.currentTarget;if(S){let z=r[f]??i;S.setAttribute("fill",z)}d&&d(null)},[d,r,i]),y=q(()=>{let f=[];for(let b=0;b<g.length;b++){let S=g[b],z=st[S],k=r[S]??i,w={key:`state-${S}`,d:z.path,fill:k,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":S,role:"img","aria-label":z.name,style:{cursor:l?"pointer":"default"}};if(l){let C=S;w.onClick=()=>c(C),w.onKeyDown=R=>{(R.key==="Enter"||R.key===" ")&&c(C)},w.tabindex=0,w.role="button",w["aria-label"]=z.name}let I=S;w.onMouseOver=C=>x(I,C),w.onMouseOut=C=>p(I,C),f.push(o("path",w))}return f},[g,r,i,s,a,l,c,x,p]),m=o("title",{key:"map-title"},h);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h,style:{fontFamily:"sans-serif"}},m,...y)}function Ot(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function aa(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function ca(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Ot(t[i]),l=Ot(t[i+1]);return aa(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function da(e){let{r:t,g:n,b:r}=Ot(e);return(.299*t+.587*n+.114*r)/255}var ua=["#3b82f6","#fbbf24","#ef4444"];function fa(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=ua,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:g=1,title:c,padding:x=60}=e,p=t.length,y=q(()=>{let P=0;for(let v of t)v.length>P&&(P=v.length);return P},[t]),{minVal:m,maxVal:f}=q(()=>{let P=l??1/0,v=d??-1/0;for(let D of t)for(let E of D)l===void 0&&E<P&&(P=E),d===void 0&&E>v&&(v=E);return P===1/0&&(P=0),v===-1/0&&(v=1),P===v&&(v=P+1),{minVal:P,maxVal:v}},[t,l,d]),b=c?30:0,S=n?x:20,z=r?x:20,k=i-S-20,w=s-b-z-20,I=y>0?k/y:0,C=p>0?w/p:0,R=$(()=>{let P=[];for(let v=0;v<p;v++){let D=t[v];for(let E=0;E<y;E++){let W=E<D.length?D[E]:0,T=(W-m)/(f-m),N=ca(T,a),B=S+E*I,V=b+20+v*C;if(P.push(o("rect",{key:`cell-${v}-${E}`,x:String(B),y:String(V),width:String(I),height:String(C),fill:N,stroke:h,"stroke-width":String(g)})),u){let G=da(N)>.5?"#111827":"#ffffff";P.push(o("text",{key:`val-${v}-${E}`,x:String(B+I/2),y:String(V+C/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,I*.3,C*.4)),"font-family":"sans-serif",fill:G},String(Math.round(W*100)/100)))}}}return P},[t,p,y,m,f,a,I,C,S,b,u,h,g]),M=$(()=>{let P=[];if(n)for(let v=0;v<p;v++){let D=v<n.length?n[v]:"",E=b+20+v*C+C/2;P.push(o("text",{key:`row-label-${v}`,x:String(S-8),y:String(E),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},D))}if(r)for(let v=0;v<y;v++){let D=v<r.length?r[v]:"",E=S+v*I+I/2,W=b+20+p*C+16;P.push(o("text",{key:`col-label-${v}`,x:String(E),y:String(W),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},D))}return P},[n,r,p,y,I,C,S,b]),F=$(()=>c?[o("text",{key:"title",x:String(i/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},c)]:[],[c,i]);if(p===0||y===0)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map \u2014 no data"},o("text",{x:String(i/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let A=F(),H=R(),L=M();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map",style:{fontFamily:"sans-serif"}},...A,...H,...L)}function ga(e,t){if(e.length===0)return[];let n=e[0],r=e[0];for(let a=1;a<e.length;a++){let l=e[a];l<n&&(n=l),l>r&&(r=l)}if(n===r)return[{min:n,max:r+1,count:e.length}];let i=(r-n)/t,s=[];for(let a=0;a<t;a++)s.push({min:n+a*i,max:n+(a+1)*i,count:0});for(let a=0;a<e.length;a++){let l=e[a],d=Math.floor((l-n)/i);d>=t&&(d=t-1),s[d].count++}return s}function pa(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function _t(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ma(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:h,yLabel:g,padding:c=60}=e,x=Math.max(1,Math.round(n)),p=q(()=>ga(t,x),[t,x]),y=q(()=>{let A=0;for(let H=0;H<p.length;H++)p[H].count>A&&(A=p[H].count);return A>0?A:1},[p]),m=r-c*2,f=i-c*2,b=$(()=>{if(!l)return[];let A=pa(y),H=[];for(let L=A;L<=y;L+=A){let P=c+f-L/y*f;H.push(o("line",{key:`grid-${L}`,x1:String(c),y1:String(P),x2:String(c+m),y2:String(P),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),H.push(o("text",{key:`grid-label-${L}`,x:String(c-8),y:String(P+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(L)))}return H},[l,y,c,m,f]),S=$(()=>{let A=[];return A.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+f),stroke:"#374151","stroke-width":"1.5"})),A.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+f),x2:String(c+m),y2:String(c+f),stroke:"#374151","stroke-width":"1.5"})),A},[c,m,f]),z=$(()=>{if(p.length===0)return[];let A=[],H=a*(p.length-1),L=Math.max(1,(m-H)/p.length);for(let P=0;P<p.length;P++){let v=p[P],D=v.count/y*f,E=c+P*(L+a),W=c+f-D;if(A.push(o("rect",{key:`bar-${P}`,x:String(E),y:String(W),width:String(L),height:String(D),fill:s})),d&&v.count>0&&A.push(o("text",{key:`val-${P}`,x:String(E+L/2),y:String(W-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(v.count))),p.length<=15||P%2===0||P===p.length-1){let N=(p.length===1,_t(v.min));A.push(o("text",{key:`xlabel-${P}`,x:String(E+L/2),y:String(c+f+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},N))}}if(p.length>0){let P=p[p.length-1],v=c+m;A.push(o("text",{key:"xlabel-end",x:String(v),y:String(c+f+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},_t(P.max)))}return A},[p,y,a,s,d,c,m,f]),k=$(()=>{let A=[];return u&&A.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),h&&A.push(o("text",{key:"x-label",x:String(c+m/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),g&&A.push(o("text",{key:"y-label",x:String(14),y:String(c+f/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+f/2})`},g)),A},[u,h,g,r,i,c,m,f]),w=$(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),I=b(),C=S(),R=z(),M=k(),F=w();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Histogram",style:{fontFamily:"sans-serif"}},...M,...I,...C,...R,...F)}function ha(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ba(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:h=!0,title:g,padding:c=60}=e,x=i==="vertical",p=x?30:0,y=n-c*2,m=r-c*2-p,f=x?m:y,b=x?y:m,S=q(()=>{let P=0;for(let v=0;v<t.length;v++)t[v].value>P&&(P=t[v].value);return P>0?P:1},[t]),z=q(()=>t.length===0?0:b/t.length,[t.length,b]),k=$(()=>{if(!u)return[];let P=ha(S),v=[];for(let D=P;D<=S;D+=P){let E=D/S*f;if(x){let W=c+m-E;v.push(o("line",{key:`grid-${D}`,x1:String(c),y1:String(W),x2:String(c+y),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),v.push(o("text",{key:`grid-label-${D}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}else{let W=c+E;v.push(o("line",{key:`grid-${D}`,x1:String(W),y1:String(c),x2:String(W),y2:String(c+m),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),v.push(o("text",{key:`grid-label-${D}`,x:String(W),y:String(c+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}}return v},[u,S,x,c,y,m,f]),w=$(()=>{let P=[];return x?P.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"})):P.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"})),P.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+m),x2:String(c+y),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"})),P},[x,c,y,m]),I=$(()=>{if(t.length===0)return[];let P=[];for(let v=0;v<t.length;v++){let D=t[v],E=D.value/S*f,W=z*v+z/2,T=D.color??d;if(x){let N=c+W,B=c+m,V=c+m-E;P.push(o("line",{key:`stem-${v}`,x1:String(N),y1:String(B),x2:String(N),y2:String(V),stroke:s,"stroke-width":String(a)})),P.push(o("circle",{key:`dot-${v}`,cx:String(N),cy:String(V),r:String(l),fill:T})),h&&P.push(o("text",{key:`val-${v}`,x:String(N),y:String(V-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value)));let G=N,K=c+m+16;P.push(o("text",{key:`cat-${v}`,x:String(G),y:String(K),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${G}, ${K})`},D.label))}else{let N=c+W,B=c,V=c+E;P.push(o("line",{key:`stem-${v}`,x1:String(B),y1:String(N),x2:String(V),y2:String(N),stroke:s,"stroke-width":String(a)})),P.push(o("circle",{key:`dot-${v}`,cx:String(V),cy:String(N),r:String(l),fill:T})),h&&P.push(o("text",{key:`val-${v}`,x:String(V+l+4),y:String(N+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value))),P.push(o("text",{key:`cat-${v}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},D.label))}}return P},[t,S,z,d,l,s,a,h,x,c,y,m,f]),C=$(()=>g?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n,c]),R=$(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),M=k(),F=w(),A=I(),H=C(),L=R();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Lollipop chart",style:{fontFamily:"sans-serif"}},...H,...M,...F,...A,...L)}function Vt(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function xa(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function ya(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Vt(t[i]),l=Vt(t[i+1]);return xa(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Sa(e){let{r:t,g:n,b:r}=Vt(e);return(.299*t+.587*n+.114*r)/255}var wa=["#f0f9ff","#3b82f6","#1e3a8a"];function va(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=wa,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:g,padding:c=70,symmetric:x=!1}=e,p=r??n,y=i??n,m=t.length,f=q(()=>{let T=0;for(let N of t)N.length>T&&(T=N.length);return T},[t]),b=q(()=>{if(!x||m===0)return t;let T=[],N=Math.max(m,f);for(let B=0;B<N;B++){let V=[];for(let G=0;G<N;G++){let K=t[B],ee=K&&G<K.length?K[G]:0,J=t[G],Y=J&&B<J.length?J[B]:0;ee!==0?V.push(ee):V.push(Y)}T.push(V)}return T},[t,x,m,f]),S=b.length,z=q(()=>{let T=0;for(let N of b)N.length>T&&(T=N.length);return T},[b]),{minVal:k,maxVal:w}=q(()=>{let T=1/0,N=-1/0;for(let B of b)for(let V of B)V<T&&(T=V),V>N&&(N=V);return T===1/0&&(T=0),N===-1/0&&(N=1),T===N&&(N=T+1),{minVal:T,maxVal:N}},[b]),I=g?30:0,C=p?c:20,R=y?c:20,M=s-C-20,F=a-I-R-20,A=z>0?M/z:0,H=S>0?F/S:0,L=$(()=>{let T=[];for(let N=0;N<S;N++){let B=b[N];for(let V=0;V<z;V++){let G=V<B.length?B[V]:0,K=(G-k)/(w-k),ee=ya(K,l),J=C+V*A,Y=I+20+N*H,U=N===V,_=U&&u?"currentColor":h,O=U&&u?"2":"1";if(T.push(o("rect",{key:`cell-${N}-${V}`,x:String(J),y:String(Y),width:String(A),height:String(H),fill:ee,stroke:_,"stroke-width":O})),d){let Z=Sa(ee)>.5?"#111827":"#ffffff",Q=Math.min(12,A*.3,H*.35);T.push(o("text",{key:`val-${N}-${V}`,x:String(J+A/2),y:String(Y+H/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":U&&u?"bold":"normal","font-family":"sans-serif",fill:Z},String(Math.round(G*100)/100)))}}}return T},[b,S,z,k,w,l,A,H,C,I,d,u,h]),P=$(()=>{let T=[];if(p)for(let N=0;N<S;N++){let B=N<p.length?p[N]:"",V=I+20+N*H+H/2;T.push(o("text",{key:`row-label-${N}`,x:String(C-8),y:String(V),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},B))}if(y)for(let N=0;N<z;N++){let B=N<y.length?y[N]:"",V=C+N*A+A/2,G=I+20+S*H+12;T.push(o("text",{key:`col-label-${N}`,x:String(V),y:String(G),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},B))}return T},[p,y,S,z,A,H,C,I]),v=$(()=>g?[o("text",{key:"title",x:String(s/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},g)]:[],[g,s]);if(S===0||z===0)return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Matrix \u2014 no data"},o("text",{x:String(s/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let D=v(),E=L(),W=P();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Matrix visualization",style:{fontFamily:"sans-serif"}},...D,...E,...W)}var ka=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function lt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Ca(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Ma(e,t,n,r,i,s,a){let l=[];if(lt(e)<=0)return l;let h=Ca(e)+1,g=s==="horizontal",c=g?i/h:r/h,x=[];for(x.push({node:e,depth:0,spanStart:g?t:n,spanEnd:g?t+r:n+i,colorIndex:0});x.length>0;){let p=x.shift(),{node:y,depth:m,spanStart:f,spanEnd:b,colorIndex:S}=p,z=lt(y);if(z<=0)continue;let k=b-f,w,I,C,R;if(g?(w=f,I=n+m*c,C=k,R=c):(w=t+m*c,I=f,C=c,R=k),l.push({x:w,y:I,w:C,h:R,label:y.label,value:z,color:y.color??a[S%a.length],depth:m}),y.children&&y.children.length>0){let M=f;for(let F=0;F<y.children.length;F++){let A=y.children[F],H=lt(A);if(H<=0)continue;let L=H/z*k;x.push({node:A,depth:m+1,spanStart:M,spanEnd:M+L,colorIndex:m===0?F:S}),M+=L}}}return l}function $a(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=ka,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:g=10}=e,c=h?30:0,x=g,p=g+c,y=n-g*2,m=r-g*2-c;if(q(()=>lt(t),[t])<=0||y<=0||m<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let b=q(()=>Ma(t,x,p,y,m,i,l),[t,x,p,y,m,i,l]),S=[];h&&S.push(o("text",{key:"title",x:String(n/2),y:String(g+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let z=0;z<b.length;z++){let k=b[z];if(S.push(o("rect",{key:`cell-${z}`,x:String(k.x),y:String(k.y),width:String(Math.max(0,k.w)),height:String(Math.max(0,k.h)),fill:k.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${k.label}: ${k.value}`})),s&&k.w>20&&k.h>14){let w=Math.floor(k.w/7),I=k.label.length>w?k.label.substring(0,Math.max(1,w-2))+"..":k.label;S.push(o("text",{key:`label-${z}`,x:String(k.x+k.w/2),y:String(k.y+k.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},I))}a&&k.w>30&&k.h>28&&S.push(o("text",{key:`value-${z}`,x:String(k.x+k.w/2),y:String(k.y+k.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(k.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Partition diagram",style:{fontFamily:"sans-serif"}},...S)}function Yt(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Co(e,t){let n=new Set;for(let i of e)n.add(Yt(i,t));let r=Array.from(n);return r.sort(),r}function at(e,t){if(e.length===0)return 0;switch(t){case"count":return e.length;case"sum":{let n=0;for(let r of e)n+=r;return n}case"avg":{let n=0;for(let r of e)n+=r;return n/e.length}case"min":{let n=e[0];for(let r=1;r<e.length;r++)e[r]<n&&(n=e[r]);return n}case"max":{let n=e[0];for(let r=1;r<e.length;r++)e[r]>n&&(n=e[r]);return n}}}function ct(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function za(e,t,n,r,i){let s=Co(e,t),a=Co(e,n),l=new Map;for(let x of e){let p=Yt(x,t),y=Yt(x,n),m=`${p}::${y}`;l.has(m)||l.set(m,[]);let f=l.get(m),b=0;for(let S of r){let z=x[S];if(typeof z=="number")b+=z;else if(typeof z=="string"){let k=parseFloat(z);isNaN(k)||(b+=k)}}f.push(b)}let d=new Map;for(let[x,p]of l)d.set(x,at(p,i));let u=new Map;for(let x of s){let p=[];for(let y of a){let m=d.get(`${x}::${y}`);m!==void 0&&p.push(m)}u.set(x,at(p,i==="count"?"sum":i))}let h=new Map;for(let x of a){let p=[];for(let y of s){let m=d.get(`${y}::${x}`);m!==void 0&&p.push(m)}h.set(x,at(p,i==="count"?"sum":i))}let g=[];for(let x of u.values())g.push(x);let c=at(g,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:h,grandTotal:c}}function Ra(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:h="#3b82f6",cellPadding:g=8}=e;if(t.length===0||n.length===0&&r.length===0||i.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(a/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));let c=q(()=>za(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:x,colKeys:p,cells:y,rowTotals:m,colTotals:f,grandTotal:b}=c,S=u?30:0,z=p.length+(d?1:0),k=x.length+(d?1:0),w=1+z,I=1+k,C=Math.max(40,(a-g*2)/w),R=Math.max(20,Math.min(36,(l-S-g*2)/I)),M=C*w,F=R*I,A=Math.max(0,(a-M)/2),H=S+Math.max(0,(l-S-F)/2),L=[];u&&L.push(o("text",{key:"title",x:String(a/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),L.push(o("rect",{key:"header-row-bg",x:String(A),y:String(H),width:String(M),height:String(R),fill:h})),L.push(o("rect",{key:"header-col-bg",x:String(A),y:String(H+R),width:String(C),height:String(R*k),fill:h,opacity:"0.85"})),L.push(o("text",{key:"corner",x:String(A+C/2),y:String(H+R/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let P=0;P<p.length;P++){let v=A+(P+1)*C,D=Math.floor(C/7),E=p[P],W=E.length>D?E.substring(0,Math.max(1,D-2))+"..":E;L.push(o("text",{key:`ch-${P}`,x:String(v+C/2),y:String(H+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},W))}d&&L.push(o("text",{key:"ch-total",x:String(A+(p.length+1)*C+C/2),y:String(H+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let P=0;P<x.length;P++){let v=x[P],D=H+(P+1)*R;P%2===0&&L.push(o("rect",{key:`row-bg-${P}`,x:String(A+C),y:String(D),width:String(C*z),height:String(R),fill:"#f9fafb"}));let E=Math.floor(C/7),W=v.length>E?v.substring(0,Math.max(1,E-2))+"..":v;L.push(o("text",{key:`rh-${P}`,x:String(A+C/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},W));for(let T=0;T<p.length;T++){let N=p[T],B=`${v}::${N}`,V=y.get(B),G=A+(T+1)*C;L.push(o("rect",{key:`border-${P}-${T}`,x:String(G),y:String(D),width:String(C),height:String(R),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),L.push(o("text",{key:`cell-${P}-${T}`,x:String(G+C/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},V!==void 0?ct(V):"-"))}if(d){let T=A+(p.length+1)*C,N=m.get(v)??0;L.push(o("rect",{key:`rt-bg-${P}`,x:String(T),y:String(D),width:String(C),height:String(R),fill:"#eff6ff"})),L.push(o("text",{key:`rt-${P}`,x:String(T+C/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},ct(N)))}}if(d){let P=H+(x.length+1)*R;L.push(o("rect",{key:"total-row-bg",x:String(A),y:String(P),width:String(M),height:String(R),fill:"#eff6ff"})),L.push(o("text",{key:"total-label",x:String(A+C/2),y:String(P+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let D=0;D<p.length;D++){let E=p[D],W=f.get(E)??0,T=A+(D+1)*C;L.push(o("text",{key:`ct-${D}`,x:String(T+C/2),y:String(P+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},ct(W)))}let v=A+(p.length+1)*C;L.push(o("text",{key:"grand-total",x:String(v+C/2),y:String(P+R/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},ct(b)))}return L.push(o("rect",{key:"outer-border",x:String(A),y:String(H),width:String(M),height:String(F),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...L)}function dt(e,t){return Math.PI*2*e/t-Math.PI/2}function ut(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Ea(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:h="#d1d5db",title:g}=e,c=t.length,x=g?30:0,p=d&&n.length>0?30:0,y=60,m=Math.min((r-y*2)/2,(i-y*2-x-p)/2),f=r/2,b=y+x+m,S=q(()=>{let L=[];for(let P=0;P<c;P++){let v=t[P]?.max;if(v!==void 0&&v>0){L.push(v);continue}let D=0;for(let E of n){let W=E.values[P];W!==void 0&&W>D&&(D=W)}L.push(D>0?D:1)}return L},[t,n,c]),z=$(()=>{if(c<3)return[];let L=[];for(let P=1;P<=s;P++){let v=m*P/s,D=[];for(let E=0;E<c;E++){let W=dt(E,c),T=ut(f,b,v,W);D.push(`${T.x},${T.y}`)}L.push(o("polygon",{key:`ring-${P}`,points:D.join(" "),fill:"none",stroke:h,"stroke-width":P===s?"1.5":"0.5","stroke-dasharray":P===s?"none":"3 2"}))}for(let P=0;P<c;P++){let v=dt(P,c),D=ut(f,b,m,v);L.push(o("line",{key:`spoke-${P}`,x1:String(f),y1:String(b),x2:String(D.x),y2:String(D.y),stroke:h,"stroke-width":"0.75"}))}return L},[c,s,m,f,b,h]),k=$(()=>{if(!a||c<3)return[];let L=[],P=16;for(let v=0;v<c;v++){let D=dt(v,c),E=ut(f,b,m+P,D),W="middle";E.x<f-5?W="end":E.x>f+5&&(W="start");let T=Math.abs(E.y-b)<5?"0.35em":E.y<b?"0em":"0.7em";L.push(o("text",{key:`label-${v}`,x:String(E.x),y:String(E.y),"text-anchor":W,dy:T,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[v]?.label??`Axis ${v}`))}return L},[a,c,t,m,f,b]),w=$(()=>{if(c<3||n.length===0)return[];let L=[];for(let P=0;P<n.length;P++){let v=n[P],D=[],E=[],W=[];for(let T=0;T<c;T++){let N=v.values[T]??0,B=S[T],V=Math.min(N/B,1),G=m*V,K=dt(T,c),ee=ut(f,b,G,K);D.push(`${ee.x},${ee.y}`),u&&E.push(o("circle",{key:`dot-${P}-${T}`,cx:String(ee.x),cy:String(ee.y),r:"3.5",fill:v.color,stroke:"#fff","stroke-width":"1.5"})),l&&W.push(o("text",{key:`val-${P}-${T}`,x:String(ee.x),y:String(ee.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:v.color},String(Math.round(N*100)/100)))}L.push(o("polygon",{key:`series-fill-${P}`,points:D.join(" "),fill:v.color,"fill-opacity":String(v.fillOpacity??.15),stroke:"none"})),L.push(o("polygon",{key:`series-line-${P}`,points:D.join(" "),fill:"none",stroke:v.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let T of E)L.push(T);for(let T of W)L.push(T)}return L},[c,n,S,m,f,b,u,l]),I=$(()=>{if(!d||n.length===0)return[];let L=[],P=b+m+40,v=100,D=n.length*v,E=f-D/2;for(let W=0;W<n.length;W++){let T=n[W],N=E+W*v;L.push(o("rect",{key:`legend-swatch-${W}`,x:String(N),y:String(P),width:"12",height:"12",rx:"2",fill:T.color})),L.push(o("text",{key:`legend-text-${W}`,x:String(N+16),y:String(P+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},T.label))}return L},[d,n,f,b,m]),C=$(()=>g?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},g)]:[],[g,r]);if(c<3)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Radar chart \u2014 insufficient axes"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"Radar chart requires at least 3 axes."));let R=z(),M=k(),F=w(),A=I(),H=C();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Radar chart",style:{fontFamily:"sans-serif"}},...H,...R,...M,...F,...A)}var Ia=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Pa(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let h of u){let g=n.get(h),c=d+1;(g===void 0||c>g)&&n.set(h,c),s.includes(h)||s.push(h)}}for(let l of e)n.has(l)||n.set(l,0);return n}function Ta(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,h=t.filter(M=>M.value>0),g=e.map(M=>M.id),c=Pa(g,h),x=new Map,p=new Map;for(let M of g)x.set(M,0),p.set(M,0);for(let M of h)p.set(M.source,(p.get(M.source)??0)+M.value),x.set(M.target,(x.get(M.target)??0)+M.value);let y=0;for(let M of c.values())M>y&&(y=M);let m=new Map;for(let M=0;M<=y;M++)m.set(M,[]);for(let[M,F]of c)m.get(F).push(M);let f=new Map,b=y>0?(d-i)/y:0;for(let M=0;M<=y;M++)f.set(M,a+M*b);let S=new Map;for(let M=0;M<e.length;M++)S.set(e[M].id,e[M]);let z=[],k=new Map;for(let M=0;M<=y;M++){let F=m.get(M);if(F.length===0)continue;let A=0;for(let v of F){let D=x.get(v)??0,E=p.get(v)??0;A+=Math.max(D,E,1)}let H=u-s*(F.length-1),L=A>0?H/A:1,P=a;for(let v=0;v<F.length;v++){let D=F[v],E=S.get(D),W=x.get(D)??0,T=p.get(D)??0,N=Math.max(W,T,1),B=Math.max(4,N*L),V=e.findIndex(K=>K.id===D),G={id:D,label:E.label,color:E.color??l[V%l.length],column:M,x:f.get(M),y:P,height:B,totalIn:W,totalOut:T,totalValue:N};z.push(G),k.set(D,G),P+=B+s}}let w=new Map,I=new Map;for(let M of g)w.set(M,0),I.set(M,0);let C=[...h].sort((M,F)=>F.value-M.value),R=[];for(let M of C){let F=k.get(M.source),A=k.get(M.target);if(!F||!A)continue;let H=F.totalOut||1,L=A.totalIn||1,P=M.value/H*F.height,v=M.value/L*A.height,D=Math.max(1,(P+v)/2),E=w.get(M.source),W=I.get(M.target),T=F.y+E+P/2,N=A.y+W+v/2;w.set(M.source,E+P),I.set(M.target,W+v);let B=S.get(M.source);R.push({source:M.source,target:M.target,value:M.value,color:M.color??B?.color??F.color,sourceY:T,targetY:N,width:D})}return{layoutNodes:z,layoutLinks:R}}function Da(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:h=Ia,title:g,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let x=q(()=>Ta(t,n,r,i,s,a,c,h),[t,n,r,i,s,a,c,h]),p=$(()=>{let z=[];for(let k=0;k<x.layoutLinks.length;k++){let w=x.layoutLinks[k],I=x.layoutNodes.find(H=>H.id===w.source),C=x.layoutNodes.find(H=>H.id===w.target);if(!I||!C)continue;let R=I.x+s,M=C.x,F=(R+M)/2,A=`M ${R} ${w.sourceY} C ${F} ${w.sourceY}, ${F} ${w.targetY}, ${M} ${w.targetY}`;z.push(o("path",{key:`link-${k}`,d:A,fill:"none",stroke:w.color,"stroke-width":String(Math.max(1,w.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&w.value>0&&z.push(o("text",{key:`link-val-${k}`,x:String(F),y:String((w.sourceY+w.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(w.value)))}return z},[x,s,u,d]),y=$(()=>{let z=[];for(let k=0;k<x.layoutNodes.length;k++){let w=x.layoutNodes[k];if(z.push(o("rect",{key:`node-${w.id}`,x:String(w.x),y:String(w.y),width:String(s),height:String(w.height),fill:w.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${w.label}: ${w.totalValue}`})),l){let I=x.layoutNodes.reduce((L,P)=>Math.max(L,P.column),0),C=w.column===I,R=C?w.x+s+6:w.x-6,M=C?"start":"end",F=w.column===0,A=F?w.x-6:R,H=F?"end":M;z.push(o("text",{key:`label-${w.id}`,x:String(A),y:String(w.y+w.height/2+4),"text-anchor":H,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},w.label))}}return z},[x,s,l]),m=$(()=>g?[o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,r,c]),f=p(),b=y(),S=m();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Sankey diagram",style:{fontFamily:"sans-serif"}},...S,...f,...b)}var Aa=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Gt=2*Math.PI;function je(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function La(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Wa(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,h=e+r*Math.cos(d),g=t+r*Math.sin(d),c=e+r*Math.cos(u),x=t+r*Math.sin(u),p=e+n*Math.cos(u),y=t+n*Math.sin(u),m=e+n*Math.cos(d),f=t+n*Math.sin(d);if(a>=Gt-.001){let b=d+Math.PI,S=e+r*Math.cos(b),z=t+r*Math.sin(b),k=e+n*Math.cos(b),w=t+n*Math.sin(b);return[`M ${h} ${g}`,`A ${r} ${r} 0 1 1 ${S} ${z}`,`A ${r} ${r} 0 1 1 ${h} ${g}`,`L ${m} ${f}`,`A ${n} ${n} 0 1 0 ${k} ${w}`,`A ${n} ${n} 0 1 0 ${m} ${f}`,"Z"].join(" ")}return[`M ${h} ${g}`,`A ${r} ${r} 0 ${l} 1 ${c} ${x}`,`L ${p} ${y}`,`A ${n} ${n} 0 ${l} 0 ${m} ${f}`,"Z"].join(" ")}function Fa(e,t,n,r){let i=[],s=je(e);if(s<=0)return i;let a=La(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let h=0;h<e.children.length;h++){let g=e.children[h],c=je(g);if(c<=0)continue;let x=c/s*Gt;d.push({node:g,startAngle:u,endAngle:u+x,depth:0,colorIndex:h}),u+=x}}else return i.push({startAngle:0,endAngle:Gt,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:h,startAngle:g,endAngle:c,depth:x,colorIndex:p}=u,y=je(h);if(y<=0)continue;let m=t+x*l,f=m+l;if(i.push({startAngle:g,endAngle:c,innerR:m,outerR:f,label:h.label,value:y,color:h.color??r[p%r.length],depth:x}),h.children&&h.children.length>0){let b=g,S=c-g;for(let z=0;z<h.children.length;z++){let k=h.children[z],w=je(k);if(w<=0)continue;let I=w/y*S;d.push({node:k,startAngle:b,endAngle:b+I,depth:x+1,colorIndex:p}),b+=I}}}return i}function Na(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=Aa,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,g=r/2,c=u?20:0,x=Math.min(h,g-c)-10;if(q(()=>je(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(h),y:String(g),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=q(()=>Fa(t,i,x,a),[t,i,x,a]),m=[];u&&m.push(o("text",{key:"title",x:String(h),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let f=g+c/2;for(let b=0;b<y.length;b++){let S=y[b],z=Wa(h,f,S.innerR,S.outerR,S.startAngle,S.endAngle);if(m.push(o("path",{key:`arc-${b}`,d:z,fill:S.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${S.label}: ${S.value}`})),s){let k=S.endAngle-S.startAngle,w=S.startAngle+k/2-Math.PI/2,I=(S.innerR+S.outerR)/2,C=S.outerR-S.innerR,R=k*I;if(R>20&&C>14){let M=h+I*Math.cos(w),F=f+I*Math.sin(w),A=Math.floor(Math.min(R,C)/7),H=S.label.length>A?S.label.substring(0,Math.max(1,A-1))+"..":S.label;m.push(o("text",{key:`label-${b}`,x:String(M),y:String(F+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},H))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...m)}var Ba=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ft(e){if(!e.children||e.children.length===0)return Math.max(0,e.value);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Mo(e,t){if(e.length===0||t<=0)return 1/0;let n=0;for(let s of e)n+=s;if(n<=0)return 1/0;let r=n/t,i=0;for(let s of e){if(s<=0)continue;let a=s/r,l=Math.max(a/r,r/a);l>i&&(i=l)}return i}function Ha(e,t,n,r,i,s){let a=[],l=[],d=ft(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],h=r*i,g=[];for(let c=0;c<u.length;c++){let x=u[c],p=ft(x);p<=0||g.push({label:x.label,value:p,area:p/d*h,color:x.color??s[c%s.length],node:x})}for(g.sort((c,x)=>x.area-c.area),l.push({nodes:g,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:x,rect:p,depth:y}=c;if(x.length===0)continue;let m={...p},f=0;for(;f<x.length&&m.w>0&&m.h>0;){let b=m.w>=m.h,S=b?m.h:m.w,z=[],k=[];z.push(x[f]),k.push(x[f].area),f++;let w=Mo(k,S);for(;f<x.length;){let M=[...k,x[f].area],F=Mo(M,S);if(F>w)break;z.push(x[f]),k.push(x[f].area),w=F,f++}let I=0;for(let M of k)I+=M;let C=S>0?I/S:0,R=0;for(let M=0;M<z.length;M++){let F=z[M],A=C>0?F.area/C:0,H,L,P,v;if(b?(H=m.x,L=m.y+R,P=C,v=A):(H=m.x+R,L=m.y,P=A,v=C),a.push({x:H,y:L,w:P,h:v,label:F.label,value:F.value,color:F.color,depth:y}),F.node.children&&F.node.children.length>0){let E=H+2,W=L+2+14,T=P-4,N=v-4-14;if(T>4&&N>4){let B=[],V=F.value,G=T*N;for(let K=0;K<F.node.children.length;K++){let ee=F.node.children[K],J=ft(ee);J<=0||B.push({label:ee.label,value:J,area:J/V*G,color:ee.color??s[(K+y+1)%s.length],node:ee})}B.sort((K,ee)=>ee.area-K.area),l.push({nodes:B,rect:{x:E,y:W,w:T,h:N},depth:y+1})}}R+=A}b?m={x:m.x+C,y:m.y,w:m.w-C,h:m.h}:m={x:m.x,y:m.y+C,w:m.w,h:m.h-C}}}return a}function Oa(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Ba,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,g=h?30:0,c=u,x=u+g,p=n-u*2,y=r-u*2-g;if(q(()=>ft(t),[t])<=0||p<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let f=q(()=>Ha(t,c,x,p,y,a),[t,c,x,p,y,a]),b=[];h&&b.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let S=0;S<f.length;S++){let z=f[S];if(b.push(o("rect",{key:`cell-${S}`,x:String(z.x),y:String(z.y),width:String(Math.max(0,z.w)),height:String(Math.max(0,z.h)),fill:z.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${z.label}: ${z.value}`})),i&&z.w>20&&z.h>14){let k=Math.floor(z.w/7),w=z.label.length>k?z.label.substring(0,Math.max(1,k-2))+"..":z.label;b.push(o("text",{key:`label-${S}`,x:String(z.x+4),y:String(z.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},w))}s&&z.w>30&&z.h>28&&b.push(o("text",{key:`value-${S}`,x:String(z.x+4),y:String(z.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(z.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)}function $o(e){let t=e.replace("#",""),n,r,i;return t.length===3?(n=parseInt(t[0]+t[0],16),r=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(i)?0:i}}function _a(e,t,n){let r=s=>Math.max(0,Math.min(255,Math.round(s))),i=s=>r(s).toString(16).padStart(2,"0");return"#"+i(e)+i(t)+i(n)}function zo(e,t){if(t.length===0)return"#3b82f6";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=n*r,s=Math.floor(i),a=Math.min(s+1,r),l=i-s,d=$o(t[s]),u=$o(t[a]);return _a(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function gt(e,t){if(e<=0)return 1;let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return i<=1.5?r:i<=3.5?2*r:i<=7.5?5*r:10*r}function Va(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let h=Math.max(2,Math.min(50,r)),g=d/(h-1),c=u/(h-1);if(n){let p=[];for(let b=0;b<h;b++)for(let S=0;S<h;S++)p.push({x:i+S*g,y:a+b*c});let m=n(p,{gridSize:h,xMin:i,xMax:s,yMin:a,yMax:l}),f=[];for(let b=0;b<p.length;b++){let S=p[b],z=m[b]??{dx:0,dy:0},k=Math.sqrt(z.dx*z.dx+z.dy*z.dy);f.push({x:S.x,y:S.y,dx:z.dx,dy:z.dy,magnitude:k})}return f}if(!t)return[];let x=[];for(let p=0;p<h;p++)for(let y=0;y<h;y++){let m=i+y*g,f=a+p*c,b=t(m,f),S=Math.sqrt(b.dx*b.dx+b.dy*b.dy);x.push({x:m,y:f,dx:b.dx,dy:b.dy,magnitude:S})}return x}function Ya(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:h,yMax:g,xSpan:c,ySpan:x,showGrid:p,showAxes:y,colorByMagnitude:m,colorScale:f,arrowColor:b,arrowWidth:S,effectiveArrowScale:z,maxMagnitude:k,title:w,tickFontSize:I}=i,C=F=>s+(F-d)/c*a,R=F=>s+(g-F)/x*l;if(e.clearRect(0,0,t,n),w&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(w,t/2,s/2+4),e.restore()),p){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${I}px sans-serif`,e.fillStyle="#6b7280";let F=gt(c,10),A=Math.ceil(d/F)*F;for(let P=A;P<=u;P+=F){let v=C(P);e.beginPath(),e.moveTo(v,s),e.lineTo(v,s+l),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(P*100)/100),v,s+l+4)}let H=gt(x,10),L=Math.ceil(h/H)*H;for(let P=L;P<=g;P+=H){let v=R(P);e.beginPath(),e.moveTo(s,v),e.lineTo(s+a,v),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(P*100)/100),s-6,v)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=S,h<=0&&g>=0){let F=R(0);e.beginPath(),e.moveTo(s,F),e.lineTo(s+a,F),e.stroke()}if(d<=0&&u>=0){let F=C(0);e.beginPath(),e.moveTo(F,s),e.lineTo(F,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let M=4;for(let F=0;F<r.length;F++){let A=r[F],H=A.magnitude??Math.sqrt(A.dx*A.dx+A.dy*A.dy);if(H<1e-10)continue;let L=C(A.x),P=R(A.y),v=A.dx*z,D=-A.dy*z,E=L+v,W=P+D,T;if(m){let B=H/k;T=zo(B,f)}else T=b;e.save(),e.strokeStyle=T,e.lineWidth=S,e.lineCap="round",e.beginPath(),e.moveTo(L,P),e.lineTo(E,W),e.stroke();let N=Math.sqrt(v*v+D*D);if(N>2){let B=v/N,V=D/N,G=-V,K=B,ee=Math.min(M,N*.4),J=E-B*ee+G*ee*.5,Y=W-V*ee+K*ee*.5,U=E-B*ee-G*ee*.5,_=W-V*ee-K*ee*.5;e.fillStyle=T,e.beginPath(),e.moveTo(E,W),e.lineTo(J,Y),e.lineTo(U,_),e.closePath(),e.fill()}e.restore()}}function Ga(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:a=[-5,5],yRange:l=[-5,5],arrowScale:d=1,arrowColor:u="#3b82f6",showGrid:h=!0,showAxes:g=!0,colorByMagnitude:c=!1,colorScale:x=["#3b82f6","#8b5cf6","#ef4444"],title:p,padding:y=50,tickFontSize:m=10,arrowWidth:f=1.5,renderer:b="svg",useGPU:S=!1,computeWorker:z}=e,k=Math.max(2,Math.min(50,s)),w=r-y*2,I=i-y*2,C=a[0],R=a[1],M=l[0],F=l[1],A=R-C,H=F-M,L=q(()=>J=>y+(J-C)/A*w,[y,C,A,w]),P=q(()=>J=>y+(F-J)/H*I,[y,F,H,I]),v=q(()=>Va(t,n,z,k,C,R,M,F,A,H),[t,n,z,k,C,R,M,F,A,H]),D=q(()=>{let J=0;for(let Y=0;Y<v.length;Y++){let U=v[Y],_=U.magnitude??Math.sqrt(U.dx*U.dx+U.dy*U.dy);_>J&&(J=_)}return J>0?J:1},[v]),E=q(()=>Math.min(w,I)/Math.max(k,2)/(2*D)*d,[w,I,k,D,d]);if(b==="canvas"){let J=ie(null),Y=ie(0);return se(()=>{let U=J.current;if(!U)return;let _=U.getContext("2d");if(_)return Y.current&&cancelAnimationFrame(Y.current),Y.current=requestAnimationFrame(()=>{Ya(_,r,i,v,{padding:y,chartWidth:w,chartHeight:I,xMin:C,xMax:R,yMin:M,yMax:F,xSpan:A,ySpan:H,showGrid:h,showAxes:g,colorByMagnitude:c,colorScale:x,arrowColor:u,arrowWidth:f,effectiveArrowScale:E,maxMagnitude:D,title:p,tickFontSize:m})}),()=>{Y.current&&cancelAnimationFrame(Y.current)}},[v,r,i,y,w,I,C,R,M,F,A,H,h,g,c,x,u,f,E,D,p,m]),o("canvas",{ref:J,width:r,height:i,role:"img","aria-label":p??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let W=$(()=>{if(!h)return[];let J=[],Y=gt(A,10),U=Math.ceil(C/Y)*Y;for(let Z=U;Z<=R;Z+=Y){let Q=L(Z);J.push(o("line",{key:`gridv-${Z}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+I),stroke:"#e5e7eb","stroke-width":"0.5"})),J.push(o("text",{key:`xtick-${Z}`,x:String(Q),y:String(y+I+16),"text-anchor":"middle","font-size":String(m),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}let _=gt(H,10),O=Math.ceil(M/_)*_;for(let Z=O;Z<=F;Z+=_){let Q=P(Z);J.push(o("line",{key:`gridh-${Z}`,x1:String(y),y1:String(Q),x2:String(y+w),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),J.push(o("text",{key:`ytick-${Z}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(m),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}return J},[h,C,R,M,F,A,H,L,P,y,w,I]),T=$(()=>{if(!g)return[];let J=[];if(M<=0&&F>=0){let Y=P(0);J.push(o("line",{key:"axis-x",x1:String(y),y1:String(Y),x2:String(y+w),y2:String(Y),stroke:"#374151","stroke-width":String(f)}))}if(C<=0&&R>=0){let Y=L(0);J.push(o("line",{key:"axis-y",x1:String(Y),y1:String(y),x2:String(Y),y2:String(y+I),stroke:"#374151","stroke-width":String(f)}))}return J.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(w),height:String(I),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),J},[g,C,R,M,F,L,P,y,w,I]),N=$(()=>{let J=[];for(let U=0;U<v.length;U++){let _=v[U],O=_.magnitude??Math.sqrt(_.dx*_.dx+_.dy*_.dy);if(O<1e-10)continue;let Z=L(_.x),Q=P(_.y),oe=_.dx*E,j=-_.dy*E,te=Z+oe,re=Q+j,ae;if(c){let ce=O/D;ae=zo(ce,x)}else ae=u;J.push(o("line",{key:`arrow-line-${U}`,x1:String(Z),y1:String(Q),x2:String(te),y2:String(re),stroke:ae,"stroke-width":String(f),"stroke-linecap":"round"}));let ne=Math.sqrt(oe*oe+j*j);if(ne>2){let ce=oe/ne,de=j/ne,le=-de,ue=ce,me=Math.min(4,ne*.4),Se=te-ce*me+le*me*.5,ve=re-de*me+ue*me*.5,ke=te-ce*me-le*me*.5,Ce=re-de*me-ue*me*.5;J.push(o("polygon",{key:`arrow-head-${U}`,points:`${te},${re} ${Se},${ve} ${ke},${Ce}`,fill:ae}))}}return J},[v,L,P,E,c,D,x,u]),B=$(()=>p?[o("text",{key:"title",x:String(r/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,r,y]),V=W(),G=T(),K=N(),ee=B();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Vector field plot",style:{fontFamily:"sans-serif"}},...ee,...V,...G,...K)}function Ua(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r],s=i.type??(i.value>=0?"increase":"decrease");if(s==="total")t.push({label:i.label,value:n,type:"total",start:0,end:n});else{let a=n;n+=i.value,t.push({label:i.label,value:i.value,type:s,start:a,end:n})}}return t}function ja(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Xa(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:a="#3b82f6",connectorColor:l="#94a3b8",showValues:d=!0,showGrid:u=!0,showConnectors:h=!0,title:g,padding:c=60}=e,x=n-c*2,p=r-c*2,y=q(()=>Ua(t),[t]),{minVal:m,maxVal:f}=q(()=>{let D=0,E=0;for(let W=0;W<y.length;W++){let T=y[W];T.start<D&&(D=T.start),T.end<D&&(D=T.end),T.start>E&&(E=T.start),T.end>E&&(E=T.end)}return D===E&&(E=D+1),{minVal:D,maxVal:E}},[y]),b=f-m,S=$(D=>c+p-(D-m)/b*p,[c,p,m,b]),z=q(()=>y.length===0?0:x/y.length,[y.length,x]),k=6,w=Math.max(1,z-k),I=$(()=>{if(!u)return[];let D=ja(b),E=[],W=Math.ceil(m/D)*D;for(let T=W;T<=f;T+=D){let N=S(T);E.push(o("line",{key:`grid-${T}`,x1:String(c),y1:String(N),x2:String(c+x),y2:String(N),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),E.push(o("text",{key:`grid-label-${T}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(T)))}return E},[u,b,m,f,S,c,x]),C=$(()=>{let D=[];D.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"}));let E=m<=0&&f>=0?S(0):c+p;return D.push(o("line",{key:"axis-x",x1:String(c),y1:String(E),x2:String(c+x),y2:String(E),stroke:"#374151","stroke-width":"1.5"})),D},[c,x,p,m,f,S]),R=$(()=>{if(y.length===0)return[];let D=[];for(let E=0;E<y.length;E++){let W=y[E],T=c+E*z+k/2,N=Math.max(W.start,W.end),B=Math.min(W.start,W.end),V=S(N),G=S(B),K=Math.max(0,G-V),ee;if(W.type==="total"?ee=a:W.type==="decrease"?ee=s:ee=i,D.push(o("rect",{key:`bar-${E}`,x:String(T),y:String(V),width:String(w),height:String(K),fill:ee,rx:"2",ry:"2"})),d){let J=W.type==="decrease"||W.value<0?G+14:V-4,Y=W.type==="total"?String(W.value):(W.value>=0?"+":"")+String(W.value);D.push(o("text",{key:`val-${E}`,x:String(T+w/2),y:String(J),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},Y))}if(D.push(o("text",{key:`cat-${E}`,x:String(T+w/2),y:String(c+p+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},W.label)),h&&E<y.length-1){let J=y[E+1],Y=S(W.end),U=c+(E+1)*z+k/2;J.type!=="total"&&D.push(o("line",{key:`conn-${E}`,x1:String(T+w),y1:String(Y),x2:String(U),y2:String(Y),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return D},[y,z,w,S,i,s,a,l,d,h,c,p]),M=$(()=>g?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n,c]),F=$(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),A=I(),H=C(),L=R(),P=M(),v=F();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Waterfall chart",style:{fontFamily:"sans-serif"}},...P,...A,...H,...L,...v)}var qa=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Ka=[0,-45,45,90];function Za(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),h=Math.abs(Math.sin(d)),g=a*u+l*h,c=a*h+l*u;return{x:r-g/2,y:i-c/2,w:g,h:c}}function Ja(e,t){return!(e.x+e.w<t.x||t.x+t.w<e.x||e.y+e.h<t.y||t.y+t.h<e.y)}function Qa(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function ec(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}function tc(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=qa,rotations:d=Ka,padding:u=4,spiral:h="archimedean",title:g}=e,c=q(()=>{if(t.length===0)return[];let p=t.map((w,I)=>({...w,originalIndex:I})).filter(w=>w.text.length>0&&w.weight>0).sort((w,I)=>I.weight-w.weight);if(p.length===0)return[];let y=p[p.length-1].weight,f=p[0].weight-y;function b(w){if(f===0)return(i+s)/2;let I=(w-y)/f;return i+I*(s-i)}let S=[],z=n/2,k=r/2;for(let w=0;w<p.length;w++){let I=p[w],C=b(I.weight),R=d[ec(I.text)%d.length],M=I.color??l[w%l.length],F=!1,A=500,H=h==="archimedean"?4:5;for(let L=0;L<A;L++){let P,v;if(h==="archimedean"){let B=L*.1,V=H*B;P=V*Math.cos(B),v=V*Math.sin(B)}else{let B=Math.floor(L/4)+1,V=L%4,G=(L%4===0?0:L)*H;switch(V){case 0:P=B*H*4,v=G;break;case 1:P=-G,v=B*H*4;break;case 2:P=-B*H*4,v=-G;break;default:P=G,v=-B*H*4;break}}let D=z+P,E=k+v,W=Za(I.text,C,R,D,E),T={x:W.x-u,y:W.y-u,w:W.w+u*2,h:W.h+u*2};if(!Qa(T,n,r))continue;let N=!1;for(let B of S)if(Ja(T,B.bbox)){N=!0;break}if(!N){S.push({text:I.text,x:D,y:E,fontSize:C,rotation:R,color:M,bbox:T}),F=!0;break}}}return S},[t,n,r,i,s,l,d,u,h]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let x=[];g&&x.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},g));for(let p=0;p<c.length;p++){let y=c[p],m=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;x.push(o("text",{key:`word-${p}`,transform:m,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Word cloud",style:{fontFamily:a}},...x)}var nc={0:"#1e293b",1:"#3b82f6"},oc="#666";function rc(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:h="#0f172a",padding:g=10,onCellClick:c,onCellHover:x,title:p}=e,y=n??nc,m=t.length,f=q(()=>{let D=0;for(let E=0;E<t.length;E++){let W=t[E];W!==void 0&&W.length>D&&(D=W.length)}return D},[t]),b=u?20:0,S=p?24:0,z=q(()=>{let D=r-g*2-b,E=i-g*2-b-S;if(m===0||f===0)return{cellWidth:0,cellHeight:0};let W=Math.max(0,(D-s*(f-1))/f),T=Math.max(0,(E-s*(m-1))/m);return{cellWidth:W,cellHeight:T}},[r,i,g,m,f,s,b,S]),k=$(D=>{let E=y[D];return E!==void 0?E:oc},[y]),w=$(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),I=$(()=>p?[o("text",{key:"title",x:String(r/2),y:String(g+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},p)]:[],[p,r,g]),C=$(()=>{if(!l||m===0||f===0)return[];let{cellWidth:D,cellHeight:E}=z,W=g+b,T=g+b+S,N=f*D+(f-1)*s,B=m*E+(m-1)*s,V=[];for(let G=0;G<=f;G++){let K=W+G*(D+s)-s/2;V.push(o("line",{key:`vgrid-${G}`,x1:String(K),y1:String(T-s/2),x2:String(K),y2:String(T+B+s/2),stroke:d,"stroke-width":"0.5"}))}for(let G=0;G<=m;G++){let K=T+G*(E+s)-s/2;V.push(o("line",{key:`hgrid-${G}`,x1:String(W-s/2),y1:String(K),x2:String(W+N+s/2),y2:String(K),stroke:d,"stroke-width":"0.5"}))}return V},[l,m,f,z,g,b,S,s,d]),R=$(()=>{if(!u||m===0||f===0)return[];let{cellWidth:D,cellHeight:E}=z,W=g+b,T=g+b+S,N=[];for(let B=0;B<f;B++){let V=W+B*(D+s)+D/2,G=T-6;N.push(o("text",{key:`col-idx-${B}`,x:String(V),y:String(G),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(B)))}for(let B=0;B<m;B++){let V=W-6,G=T+B*(E+s)+E/2+3;N.push(o("text",{key:`row-idx-${B}`,x:String(V),y:String(G),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(B)))}return N},[u,m,f,z,g,b,S,s]),M=$(()=>{if(m===0||f===0)return[];let{cellWidth:D,cellHeight:E}=z,W=g+b,T=g+b+S,N=[];for(let B=0;B<m;B++){let V=t[B];if(V!==void 0)for(let G=0;G<f;G++){let K=G<V.length?V[G]:0,ee=W+G*(D+s),J=T+B*(E+s),Y=k(K),U={key:`cell-${B}-${G}`,x:String(ee),y:String(J),width:String(D),height:String(E),fill:Y,rx:String(a),ry:String(a)};if(c){let _=B,O=G,Z=K;U.onClick=()=>c(_,O,Z),U.role="button",U.tabIndex=0}if(x){let _=B,O=G,Z=K;U.onMouseEnter=()=>x(_,O,Z)}N.push(o("rect",U))}}return N},[m,f,t,z,g,b,S,s,a,k,c,x]),F=w(),A=I(),H=C(),L=R(),P=M(),v=p?`${p} \u2014 ${m}x${f} discrete grid`:`${m}x${f} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":v},F,...A,...H,...L,...P)}export{si as Accordion,pr as Alert,Eo as AnalogClock,Ao as Avatar,Fo as Badge,Gi as BarGraph,Ml as BigNumber,zl as BlochSphere,Il as BoxPlot,ai as Breadcrumb,Tl as BubbleChart,yl as Button,Bl as CalendarHeatMap,Gr as Card,ti as Carousel,ji as CartesianGraph2D,vr as Checkbox,Yl as ChordDiagram,Cr as ColorPicker,Mr as ColorWheel,qi as ComplexGraph2D,wt as ContextMenu,Go as DataGrid,Er as DatePicker,ql as DecompositionTree,Jo as DigitalClock,rc as DiscreteCartesian2D,Mi as Drawer,ci as Dropdown,mr as EmptyState,Ir as FileUpload,Ur as FlexContainer,jr as FlexItem,ps as Footer,Ql as ForceGraph,pe as FormFieldWrapper,ea as FunnelChart,na as GanttChart,sa as Gauge,gs as GoogleAnalytics,Xr as Grid,qr as GridItem,fa as HeatMap,ma as Histogram,rs as HypercubeGraph,Wt as IDE,ni as Image,Zi as LineGraph,ir as ListView,ba as LollipopChart,va as Matrix,ui as Menubar,zi as Modal,Pr as MultilineField,we as NavWrapper,Tr as NumberSpinner,mi as Pagination,Kr as Panel,$a as Partition,es as PieGraph,Ra as PivotTable,ts as PolarGraph2D,Ii as Popover,hr as ProgressBar,Ea as RadarChart,Dr as RadioGroup,Da as SankeyDiagram,Jr as ScrollContainer,Ar as Select,hi as Sidebar,xr as Skeleton,Lr as Slider,Sr as Spinner,Qr as Splitter,bi as Stepper,Na as Sunburst,ei as Tabs,ur as Tag,Nr as TextEditor,Br as TextField,vl as ThreeDLayers,_r as TimePicker,Sn as ToastContainer,Yr as Toggle,yi as Toolbar,Oi as Tooltip,Ft as TradingDashboard,Oa as TreeMap,vi as TreeNav,Ve as TreeNode,la as USStateMap,st as US_STATE_PATHS,xl as UnityApp,bl as UnityDesktop,Ga as VectorField,oi as VideoPlayer,gr as VirtualScroll,ss as VizWrapper,Xa as WaterfallChart,tc as WordCloud,Dt as WordProcessor,fo as applyGate,Ue as blochToCartesian,ze as buildInputStyle,_e as buildNavItemStyle,On as buildRotationMatrix,Nt as cartesianToBloch,go as computeBoxStats,Xi as computeMandelbrotGrid,Fn as computeSlices,yn as createToaster,Wn as describeArc,Hn as generateEdges,tt as generateHypercube,vt as generatePalette,Bn as generateVertices,nt as numRotationAngles,Yn as projectTo2D,Vn as transformVec,kn as useBarGraphScales,be as useHover,is as useHypercube,Ln as useLineGraphScales,Wi as useToast};
9
+ //# sourceMappingURL=components-barrel.js.map