@asymmetric-effort/specifyjs 0.2.143 → 0.2.150

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.
@@ -1,8 +1,8 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
- "use strict";var dt=Object.defineProperty;var Hi=Object.getOwnPropertyDescriptor;var _i=Object.getOwnPropertyNames;var Oi=Object.prototype.hasOwnProperty;var Vi=(e,t,n)=>t in e?dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Yi=(e,t)=>{for(var n in t)dt(e,n,{get:t[n],enumerable:!0})},Gi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _i(t))!Oi.call(e,i)&&i!==n&&dt(e,i,{get:()=>t[i],enumerable:!(r=Hi(t,i))||r.enumerable});return e};var Ui=e=>Gi(dt({},"__esModule",{value:!0}),e);var Te=(e,t,n)=>Vi(e,typeof t!="symbol"?t+"":t,n);var au={};Yi(au,{Accordion:()=>zo,Alert:()=>Gn,AnalogClock:()=>zn,AppContextProvider:()=>Le,Avatar:()=>An,Badge:()=>Ln,BarGraph:()=>nr,BigNumber:()=>ei,BlochSphere:()=>ti,BoxPlot:()=>ni,Breadcrumb:()=>To,BubbleChart:()=>ri,Button:()=>Kr,CalendarHeatMap:()=>ai,Card:()=>ho,Carousel:()=>Eo,CartesianGraph2D:()=>cr,Checkbox:()=>Zn,ChordDiagram:()=>li,ColorPicker:()=>Qn,ColorWheel:()=>eo,ComplexGraph2D:()=>pr,ContextMenu:()=>xt,DataGrid:()=>Bn,DatePicker:()=>oo,DecompositionTree:()=>ci,DigitalClock:()=>Hn,DiscreteCartesian2D:()=>Bi,DragDropProvider:()=>it,Drawer:()=>Xo,Dropdown:()=>Ao,EmptyState:()=>Un,FileUpload:()=>ro,FlexContainer:()=>bo,FlexItem:()=>xo,Footer:()=>Pr,ForceGraph:()=>pi,FormFieldWrapper:()=>ge,FunnelChart:()=>mi,GanttChart:()=>xi,Gauge:()=>Si,GoogleAnalytics:()=>Mr,Grid:()=>yo,GridItem:()=>So,HeatMap:()=>wi,Histogram:()=>ki,HypercubeGraph:()=>wr,IDE:()=>kt,Image:()=>Ro,LineGraph:()=>br,ListView:()=>_n,LollipopChart:()=>Ci,Matrix:()=>Mi,Menubar:()=>Fo,MessageBusProvider:()=>ot,Modal:()=>qo,MultilineField:()=>io,NavWrapper:()=>Se,NumberSpinner:()=>so,Pagination:()=>No,Panel:()=>wo,Partition:()=>Pi,PieGraph:()=>xr,PivotTable:()=>Ri,PolarGraph2D:()=>Sr,Popover:()=>Zo,ProgressBar:()=>jn,RadarChart:()=>$i,RadioGroup:()=>ao,SankeyDiagram:()=>Ii,ScrollContainer:()=>Co,Select:()=>lo,Sidebar:()=>Ho,Skeleton:()=>Xn,Slider:()=>co,Spinner:()=>Kn,Splitter:()=>Mo,Stepper:()=>_o,Sunburst:()=>zi,Tabs:()=>Po,Tag:()=>On,TextEditor:()=>uo,TextField:()=>fo,ThreeDLayers:()=>Qr,TimePicker:()=>po,ToastContainer:()=>Gt,Toggle:()=>go,Toolbar:()=>Vo,Tooltip:()=>Qo,TradingDashboard:()=>Pt,TreeMap:()=>Di,TreeNav:()=>Uo,TreeNode:()=>Ge,USStateMap:()=>vi,US_STATE_PATHS:()=>lt,UnityApp:()=>jr,UnityDesktop:()=>Ur,VectorField:()=>Fi,VideoPlayer:()=>Io,VirtualScroll:()=>Vn,VizWrapper:()=>Cr,WaterfallChart:()=>Wi,WordCloud:()=>Ni,WordProcessor:()=>wt,applyGate:()=>mn,blochToCartesian:()=>Qe,buildInputStyle:()=>Re,buildNavItemStyle:()=>Ye,buildRotationMatrix:()=>Jt,cartesianToBloch:()=>Rt,computeBoxStats:()=>bn,computeMandelbrotGrid:()=>fr,computeSlices:()=>qt,createToaster:()=>Yt,describeArc:()=>Xt,generateEdges:()=>Zt,generateHypercube:()=>et,generatePalette:()=>vt,generateVertices:()=>Kt,numRotationAngles:()=>tt,projectTo2D:()=>en,transformVec:()=>Qt,useAppId:()=>Xe,useBarGraphScales:()=>Ut,useChannel:()=>rt,useDragDrop:()=>He,useDraggable:()=>sn,useDropZone:()=>an,useHover:()=>xe,useHypercube:()=>kr,useLineGraphScales:()=>jt,useMessageBus:()=>qe,useToast:()=>Jo});module.exports=Ui(au);var ft=Symbol.for("spec.element"),ji=Symbol.for("spec.fragment"),cu=Symbol.for("spec.portal"),Cn=Symbol.for("spec.provider"),Mn=Symbol.for("spec.consumer"),Xi=Symbol.for("spec.forward_ref"),qi=Symbol.for("spec.memo"),Ki=Symbol.for("spec.lazy"),Zi=Symbol.for("spec.suspense"),Ji=Symbol.for("spec.strict_mode"),Qi=Symbol.for("spec.profiler");function o(e,t,...n){let r=null,i=null,s={};if(t!=null){t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(i=t.ref);for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&a!=="key"&&a!=="ref"&&a!=="__proto__"&&a!=="constructor"&&a!=="prototype"&&(s[a]=t[a])}if(n.length===1?s.children=n[0]:n.length>1&&(s.children=n),typeof e=="function"&&e.defaultProps){let a=e.defaultProps;for(let l of Object.keys(a))l!=="__proto__"&&l!=="constructor"&&s[l]===void 0&&(s[l]=a[l])}return{$$typeof:ft,type:e,props:s,key:r,ref:i}}function Ee(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Cn,_context:t},r={$$typeof:Mn,_context:t};return t.Provider=n,t.Consumer=r,t}var Oe=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};Oe.prototype.isSpecComponent=!0;var pt=class extends Oe{shouldComponentUpdate(t,n){return!En(this.props,t)||!En(this.state,n)}};pt.prototype.isPureSpecComponent=!0;function En(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let a of n)if(!Object.prototype.hasOwnProperty.call(s,a)||!Object.is(i[a],s[a]))return!1;return!0}var Rn=null;function We(){if(Rn===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Rn}function j(e){return We().useState(e)}function se(e,t){return We().useEffect(e,t)}function ke(e){return We().useContext(e)}function k(e,t){return We().useCallback(e,t)}function X(e,t){return We().useMemo(e,t)}function oe(e){return We().useRef(e)}function fe(){return We().useId()}var Ve=Ee({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function $n(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var ts={pathname:$n(),hash:typeof window<"u"?window.location.hash:""},ns=new Set;function os(){ts={pathname:$n(),hash:typeof window<"u"?window.location.hash:""};for(let e of ns)e()}typeof window<"u"&&window.addEventListener("hashchange",os);var Gd=Ee({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function In(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 gs(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 Ie={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function zn(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[u,d]=j(In(a));se(()=>{let I=setInterval(()=>{d(In(a))},1e3);return()=>clearInterval(I)},[a]);let x=u.getHours(),m=u.getMinutes(),c=u.getSeconds(),p=x%12*30+m*.5,f=m*6+c*.1,y=c*6,h=n/2,g=n/2,b=n/2-10,S=b-4,A=b-22,T=[];T.push(o("circle",{cx:String(h),cy:String(g),r:String(b),fill:Ie.face,stroke:Ie.border,"stroke-width":"3"}));for(let I=0;I<12;I++){let F=(I*30-90)*Math.PI/180,R=S-6;T.push(o("line",{x1:String(h+R*Math.cos(F)),y1:String(g+R*Math.sin(F)),x2:String(h+S*Math.cos(F)),y2:String(g+S*Math.sin(F)),stroke:Ie.border,"stroke-width":"2"}));let W=String(I===0?12:I);if(T.push(o("text",{x:String(h+A*Math.cos(F)),y:String(g+A*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:Ie.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},W)),t==="24h"){let z=b-38,w=String(I===0?0:I+12);T.push(o("text",{x:String(h+z*Math.cos(F)),y:String(g+z*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:Ie.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},w))}}let M=(I,P,F,R)=>{let W=(I-90)*Math.PI/180;return o("line",{x1:String(h),y1:String(g),x2:String(h+P*Math.cos(W)),y2:String(g+P*Math.sin(W)),stroke:R,"stroke-width":F,"stroke-linecap":"round"})};T.push(M(p,b*.5,"4",Ie.hand)),T.push(M(f,b*.75,"3",Ie.hand)),s&&T.push(M(y,b*.85,"1.5",Ie.second)),T.push(o("circle",{cx:String(h),cy:String(g),r:"4",fill:Ie.hand}));let L=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...T)];return r&&L.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ie.numbers}},gs(u,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var Bt={xs:24,sm:32,md:40,lg:56,xl:80};function ms(e){return e==null?Bt.md:typeof e=="number"?e:Bt[e]??Bt.md}function hs(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 Tn=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function bs(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Tn[Math.abs(t)%Tn.length]}var Dn={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function xs(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 An(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:u="bottom-right"}=e,[d,x]=j(!1),m=ms(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,p=a??bs(r),f=`${Math.round(m*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${m}px`,height:`${m}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},h;if(t&&!d)h=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>x(!0)});else{let A=hs(r);h=o("span",{style:{fontSize:f,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},A)}let g=o("div",{style:{...y,backgroundColor:t&&!d?"transparent":p},role:"img","aria-label":n??r??"avatar"},h);if(!l)return g;let b=Math.max(8,Math.round(m*.25)),S={position:"absolute",width:`${b}px`,height:`${b}px`,borderRadius:"50%",backgroundColor:Dn[l]??Dn.offline,border:"2px solid #fff",boxSizing:"border-box",...xs(u,b)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},g,o("span",{style:S,"aria-label":l}))}var ys={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"}},Ss={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function Ln(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,u=null;!r&&t!=null&&(u=n!=null&&t>n?`${n}+`:String(t));let d=r||t!=null&&t>0,x=r?{...Ss[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...ys[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}`}},m=d?o("span",{style:x,"aria-label":r?"notification":`count ${u}`},u):null;if(l==null)return m??o("span",null);let c={...x,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,d?o("span",{style:c,"aria-label":r?"notification":`count ${u}`},u):null)}var vs={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},Fn={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},Ht={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},ws="6px 8px",ks={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},Cs={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},Ms={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},Ne={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Ps={...Ne,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},Wn={...Ne,opacity:"0.5",cursor:"default"},Nn={cursor:"pointer",width:"16px",height:"16px"};function Es(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function Bn(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:u,selectable:d=!1,selectedRows:x,onSelectionChange:m,striped:c=!1,bordered:p=!1,compact:f=!1,stickyHeader:y=!1}=e,[h,g]=j(0),[b,S]=j(void 0),[A,T]=j("asc"),[M,D]=j([]),[L,I]=j({}),P=i??h,F=a??b,R=l??A,W=x??M,z=X(()=>{let J=Object.entries(L).filter(([,re])=>re.length>0);return J.length===0?n:n.filter(re=>J.every(([ae,ne])=>String(re[ae]??"").toLowerCase().includes(ne.toLowerCase())))},[n,L]),w=X(()=>{if(!F)return z;let J=[...z];return J.sort((re,ae)=>{let ne=re[F],ee=ae[F];if(ne==null&&ee==null)return 0;if(ne==null)return 1;if(ee==null)return-1;if(typeof ne=="number"&&typeof ee=="number")return R==="asc"?ne-ee:ee-ne;let le=String(ne),ue=String(ee),ce=le.localeCompare(ue);return R==="asc"?ce:-ce}),J},[z,F,R]),v=w.length,E=r?Math.max(1,Math.ceil(v/r)):1,C=r?w.slice(P*r,(P+1)*r):w,N=k(J=>{s?s(J):g(J)},[s]),$=k(J=>{let re=F===J&&R==="asc"?"desc":"asc";u?u(J,re):(S(J),T(re))},[F,R,u]),B=k(J=>{let re=W.includes(J)?W.filter(ae=>ae!==J):[...W,J];m?m(re):D(re)},[W,m]),H=k(()=>{let J=C.map((ne,ee)=>r?P*r+ee:ee),ae=J.every(ne=>W.includes(ne))?W.filter(ne=>!J.includes(ne)):[...new Set([...W,...J])];m?m(ae):D(ae)},[C,W,r,P,m]),O=k((J,re)=>{I(ae=>({...ae,[J]:re})),N(0)},[N]),G=t.some(J=>J.filterable),q=f?ws:Ht.padding,te=[];if(d){let J=C.map((ae,ne)=>r?P*r+ne:ne),re=J.length>0&&J.every(ae=>W.includes(ae));te.push(o("th",{key:"__select_all",style:{...Fn,padding:q,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:re,onChange:H,style:Nn,"aria-label":"Select all rows"})))}for(let J of t){let re={...Fn,padding:q,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...p?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},ae=[J.header];J.sortable&&ae.push(o("span",{style:ks},Es(J.key,F,R))),te.push(o("th",{key:J.key,style:re,onClick:J.sortable?()=>$(J.key):void 0,onKeyDown:J.sortable?ne=>{let ee=ne.key;(ee==="Enter"||ee===" ")&&(ne.preventDefault(),$(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":F===J.key?R==="asc"?"ascending":"descending":void 0},...ae))}let Z=null;if(G){let J=[];d&&J.push(o("th",{key:"__filter_spacer",style:{padding:q}}));for(let re of t)J.push(o("th",{key:`filter_${re.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},re.filterable?o("input",{type:"text",placeholder:`Filter ${re.header}...`,style:Cs,value:L[re.key]??"",onInput:ae=>O(re.key,ae.target.value),"aria-label":`Filter by ${re.header}`}):null));Z=o("tr",{key:"__filter_row"},...J)}let Y=[];for(let J=0;J<C.length;J++){let re=C[J],ae=r?P*r+J:J,ne=W.includes(ae),ee={};c&&J%2===1&&(ee.backgroundColor="#f9fafb"),ne&&(ee.backgroundColor="#eff6ff");let le=[];d&&le.push(o("td",{key:"__select",style:{padding:q,textAlign:"center",...Ht,...p?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:ne,onChange:()=>B(ae),style:Nn,"aria-label":`Select row ${ae+1}`})));for(let ue of t){let ce=re[ue.key],de=ue.render?ue.render(ce,re):String(ce??"");le.push(o("td",{key:ue.key,style:{...Ht,padding:q,...p?{border:"1px solid #e5e7eb"}:{}}},de))}Y.push(o("tr",{key:String(ae),style:ee},...le))}let U=null;if(r){let J=v===0?0:P*r+1,re=Math.min((P+1)*r,v),ae=[];ae.push(o("button",{key:"prev",style:P===0?Wn:Ne,onClick:P>0?()=>N(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let ne=7,ee=Math.max(0,P-Math.floor(ne/2)),le=Math.min(E,ee+ne);le-ee<ne&&(ee=Math.max(0,le-ne)),ee>0&&(ae.push(o("button",{key:"p0",style:Ne,onClick:()=>N(0)},"1")),ee>1&&ae.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let ue=ee;ue<le;ue++)ae.push(o("button",{key:`p${ue}`,style:ue===P?Ps:Ne,onClick:ue!==P?()=>N(ue):void 0,"aria-current":ue===P?"page":void 0},String(ue+1)));le<E&&(le<E-1&&ae.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),ae.push(o("button",{key:`p${E-1}`,style:Ne,onClick:()=>N(E-1)},String(E)))),ae.push(o("button",{key:"next",style:P>=E-1?Wn:Ne,onClick:P<E-1?()=>N(P+1):void 0,disabled:P>=E-1,"aria-label":"Next page"},"Next \u2192")),U=o("div",{style:Ms},o("span",null,`Showing ${J}\u2013${re} of ${v}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...ae))}let V={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},_={...vs,...p?{border:"1px solid #e5e7eb"}:{}},K=o("thead",null,o("tr",null,...te),Z),Q=o("tbody",null,...Y),ie=o("table",{style:_,role:"grid","aria-rowcount":String(v)},K,Q);return o("div",{style:V},ie,U)}function Be(e){return e<10?`0${e}`:String(e)}function Rs(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 $s(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"?`${Be(e.getMonth()+1)}/${Be(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Be(e.getMonth()+1)}-${Be(e.getDate())}`}var Is={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"},zs={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ts={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Ds={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function Hn(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,u]=j(new Date);se(()=>{let g=setInterval(()=>{u(new Date)},1e3);return()=>clearInterval(g)},[]);let{hours:d,minutes:x,seconds:m}=Rs(l,s),c,p=null;t==="12h"?(p=d>=12?"PM":"AM",c=d%12||12):c=d;let f=`${Be(c)}:${Be(x)}`;i&&(f+=`:${Be(m)}`);let y=[f];p!=null&&y.push(o("span",{style:Ts},p));let h=[o("span",{style:zs},...y)];return n&&h.push(o("span",{style:Ds},$s(l,r,s))),o("div",{style:Is,...a?{class:a}:{}},...h)}var As={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Ls={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Fs={borderBottom:"1px solid var(--color-border, #e5e7eb)"},Ws={cursor:"pointer",transition:"background-color 0.15s ease"},Ns={backgroundColor:"var(--color-bg-muted, #eff6ff)"},Bs={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},gt={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 _n(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:u="No items",header:d,footer:x}=e;if(t.length===0)return o("div",null,d?o("div",{style:gt},d):null,o("div",{style:Bs},u),x?o("div",{style:{...gt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},x):null);let m=[];for(let c=0;c<t.length;c++){let p=t[c],f=r(p,c),y=a===c,h=c===t.length-1,g={...Ls,...s?Ws:{},...y?Ns:{},...i&&!h?Fs:{}};m.push(o("li",{key:f,style:g,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(p,c)))}return o("div",null,d?o("div",{style:gt},d):null,o("ul",{style:As,role:l?"listbox":"list"},...m),x?o("div",{style:{...gt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},x):null)}function Hs(e){return e??"#3b82f6"}function _s(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 Os={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 Vs(e,t,n,r,i){let s=Os[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:_s(e,.12),color:e,border:"none"};default:return a}}var Ys={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 On(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:u,disabled:d=!1}=e,x=Hs(n),m=Vs(x,r,i,!!u,d),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:Ys,onClick:p=>{p.stopPropagation(),!d&&a&&a()},"aria-label":`Remove ${t}`,disabled:d},"\xD7")),o("span",{style:m,role:u?"button":void 0,tabIndex:u&&!d?"0":void 0,onClick:!d&&u?u:void 0,onKeyDown:u&&!d?p=>{let f=p.key;(f==="Enter"||f===" ")&&(p.preventDefault(),u())}:void 0,"aria-disabled":d?"true":void 0},...c)}var Gs={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function Vn(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=j(0),u=oe(null),d=t.length*r,x=parseInt(s,10)||400,m=Math.ceil(x/r),c=Math.max(0,Math.floor(a/r)-i),p=Math.min(t.length,Math.floor(a/r)+m+i),f=k(h=>{let g=h.target;l(g.scrollTop)},[]),y=[];for(let h=c;h<p;h++)y.push(o("div",{key:String(h),style:{position:"absolute",top:`${h*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[h],h)));return o("div",{ref:u,style:{...Gs,height:s},onScroll:f},o("div",{style:{height:`${d}px`,position:"relative",width:"100%"}},...y))}var Yn={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 Gn(e){let[t,n]=j(!0),r=e.type??"info",i=e.variant??"subtle",s=Yn[r]??Yn.info,a=e.icon??s.icon,l=e.message??e.children,u=X(()=>{let d={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(d.backgroundColor=s.filledBg,d.color=s.filledText):i==="outline"?(d.backgroundColor="transparent",d.border=`1px solid ${s.border}`,d.color=s.text):(d.backgroundColor=s.bg,d.color=s.text),d},[i,s]);return t?o("div",{role:"alert",style:u},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 Un(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 jn(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",u=fe().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let p=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(p/10)),y=(p-f)/2,h=2*Math.PI*y,g=e.indeterminate?h*.75:h-r/100*h,b=e.indeterminate?`@keyframes liq-spin-${u}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${u}{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(p),height:String(p),viewBox:`0 0 ${p} ${p}`,style:e.indeterminate?{animation:`liq-spin-${u} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${u} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(h),"stroke-dashoffset":String(g),"stroke-linecap":"round",transform:`rotate(-90 ${p/2} ${p/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let d=e.animated||e.indeterminate?`@keyframes liq-shimmer-${u}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",x=e.indeterminate?`@keyframes liq-indeterminate-${u}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",m={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=X(()=>{let p={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(p.position="absolute",p.animation=`liq-indeterminate-${u} 1.5s ease-in-out infinite`,p.backgroundColor=i):(p.width=`${r}%`,p.backgroundColor=i),e.animated&&!e.indeterminate&&(p.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${Us(i)} 50%, ${i} 100%)`,p.backgroundSize="200% 100%",p.animation=`liq-shimmer-${u} 1.5s ease-in-out infinite`),p},[r,i,a,e.animated,e.indeterminate,u]);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%"}},d||x?o("style",null,d+x):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:m},o("div",{style:c})))}function Us(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 Xn(e){let t=e.variant??"text",n=e.animated!==!1,r=fe().replace(/[^a-zA-Z0-9_-]/g,""),i=X(()=>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,u=[];for(let d=0;d<l;d++){let x=d===l-1&&l>1;u.push(o("div",{key:String(d),style:_t({width:x?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:d<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...u)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:_t({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:_t({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function _t(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 js={sm:16,md:24,lg:40},qn={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Kn(e){let t=typeof e.size=="number"?e.size:js[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=qn[e.speed??"normal"]??qn.normal,s=e.label??"Loading",l=fe().replace(/[^a-zA-Z0-9_-]/g,""),u=(t-r)/2,d=2*Math.PI*u,x=X(()=>`@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,x),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(u),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${d*.7} ${d*.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 ge(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 Re(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 Xs={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function Zn(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:u,size:d="md"}=e,x=oe(null);se(()=>{x.current&&(x.current.indeterminate=a)},[a]);let m=k(()=>{l||i(!r)},[l,r,i]),c=k(L=>{l||(L.key===" "||L.key==="Enter")&&(L.preventDefault(),i(!r))},[l,r,i]),p=Xs[d],f=`${p.box}px`,y=u?"#ef4444":r||a?"#3b82f6":"#d1d5db",h=r||a?"#3b82f6":"#ffffff",g={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:h,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},b={color:"#ffffff",fontSize:`${p.icon}px`,lineHeight:"1",fontWeight:"700"},S=a?o("span",{style:b},"\u2014"):r?o("span",{style:b},"\u2713"):null,A={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},T=o("input",{ref:x,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}),M=o("div",{style:g},S),D=s?o("span",{style:{fontSize:p.fontSize,color:"#374151"}},s):null;return o(ge,{error:u,htmlFor:n},o("div",{style:A,onClick:m,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},T,M,D))}var qs=["#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 Jn(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function mt(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 Qn(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=qs,showInput:a=!0,showAlpha:l=!1,disabled:u=!1,label:d}=e,[x,m]=j(!1),[c,p]=j(r),f=oe(null);se(()=>{p(r)},[r]),se(()=>{let I=P=>{f.current&&!f.current.contains(P.target)&&m(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let y=k(I=>{u||i(mt(I))},[u,i]),h=k(I=>{let P=I.target.value;p(P);let F=P.startsWith("#")?P:`#${P}`;Jn(F)&&i(mt(F))},[i]),g=k(()=>{Jn(c.startsWith("#")?c:`#${c}`)||p(r)},[c,r]),b={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:u?"not-allowed":"pointer",flexShrink:"0"},S={display:"flex",alignItems:"center",gap:"8px"},A={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"},T={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},M=s.map(I=>{let P=mt(I)===mt(r);return o("div",{key:I,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:I,cursor:u?"not-allowed":"pointer",border:P?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(I),onKeyDown:R=>{let W=R.key;(W==="Enter"||W===" ")&&(R.preventDefault(),y(I))},role:"button",tabIndex:u?-1:0,title:I,"aria-label":`Select color ${I}`})}),D=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:h,onBlur:g,disabled:u,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,L=x?o("div",{style:A},o("div",{style:T},...M),D):null;return o(ge,{label:d,disabled:u,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:S,onClick:u?void 0:()=>m(!x),onKeyDown:u?void 0:I=>{let P=I.key;(P==="Enter"||P===" ")&&(I.preventDefault(),m(!x))},role:"button",tabIndex:u?-1:0,"aria-expanded":x?"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),L))}function eo(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:u}=e,[d,x]=j(r),m=oe(null),c=k(((...h)=>{let b=h[0].target.value;x(b),i?.(b)}),[i]),p={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},f={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:d,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(ge,{label:u,htmlFor:n},o("div",{style:p},o("div",{style:f},o("input",{id:n,ref:m,type:"color",value:d,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":u||"Color"})),a?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},d):null))}var to=["January","February","March","April","May","June","July","August","September","October","November","December"],Ks=["Su","Mo","Tu","We","Th","Fr","Sa"];function Ot(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function Zs(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 no(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Js(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function oo(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:u=!1,placeholder:d="Select date...",label:x,error:m}=e,c=X(()=>Ot(r),[r]),p=X(()=>Ot(a),[a]),f=X(()=>Ot(l),[l]),[y,h]=j(!1),[g,b]=j(()=>c?c.getFullYear():new Date().getFullYear()),[S,A]=j(()=>c?c.getMonth():new Date().getMonth()),T=oe(null),M=X(()=>new Date,[]);se(()=>{let $=B=>{T.current&&!T.current.contains(B.target)&&h(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]);let D=k(()=>{A($=>$===0?(b(B=>B-1),11):$-1)},[]),L=k(()=>{A($=>$===11?(b(B=>B+1),0):$+1)},[]),I=k($=>{let B=new Date(g,S,$);p&&B<p||f&&B>f||(i(Js(B)),h(!1))},[g,S,i,p,f]),P=c?Zs(c,s):"",F=X(()=>{let $=new Date(g,S,1).getDay(),B=new Date(g,S+1,0).getDate(),H=[],O=[];for(let G=0;G<$;G++)O.push(null);for(let G=1;G<=B;G++)O.push(G),O.length===7&&(H.push(O),O=[]);for(;O.length>0&&O.length<7;)O.push(null);return O.length&&H.push(O),H},[g,S]),R={...Re({},{focused:y,error:!!m}),cursor:u?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},W={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"},z={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},w={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"},E=Ks.map($=>o("div",{key:$,style:{padding:"4px"}},$)),C=F.map(($,B)=>{let H=$.map((O,G)=>{if(O===null)return o("div",{key:`empty-${B}-${G}`,style:{padding:"4px"}});let q=new Date(g,S,O),te=no(q,M),Z=c?no(q,c):!1,Y=p&&q<p||f&&q>f,U={padding:"4px",textAlign:"center",cursor:Y?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:te?"700":"400",backgroundColor:Z?"#3b82f6":"transparent",color:Z?"#ffffff":Y?"#d1d5db":te?"#3b82f6":"#1f2937",border:te&&!Z?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${O}`,style:U,onClick:Y?void 0:()=>I(O),onKeyDown:Y?void 0:V=>{let _=V.key;(_==="Enter"||_===" ")&&(V.preventDefault(),I(O))},role:Y?void 0:"button",tabIndex:Y?void 0:0,"aria-label":`${to[S]} ${O}, ${g}`,"aria-disabled":Y?"true":void 0},String(O))});return o("div",{key:`row-${B}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...H)}),N=y?o("div",{style:W},o("div",{style:z},o("button",{type:"button",style:w,onClick:D},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${to[S]} ${g}`),o("button",{type:"button",style:w,onClick:L},"\u25B6")),o("div",{style:v},...E),...C):null;return o(ge,{label:x,error:m,disabled:u,htmlFor:n},o("div",{ref:T,style:{position:"relative"}},o("div",{id:n,style:R,onClick:u?void 0:()=>h(!y),onKeyDown:u?void 0:$=>{let B=$.key;(B==="Enter"||B===" ")&&($.preventDefault(),h(!y))},tabIndex:u?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:P?"#1f2937":"#9ca3af"}},P||d),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),N))}function Vt(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 ro(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:u,helpText:d}=e,[x,m]=j([]),[c,p]=j(!1),[f,y]=j(""),h=oe(null),g=k(w=>{y("");let v=[];for(let C of w){if(a&&C.size>a){y(`File "${C.name}" exceeds maximum size of ${Vt(a)}`);continue}v.push(C)}let E=s?[...x,...v]:v.slice(0,1);m(E),r(E)},[x,s,a,r]),b=k(w=>{if(w.preventDefault(),w.stopPropagation(),p(!1),l)return;let v=w.dataTransfer;if(!v)return;let E=Array.from(v.files);g(E)},[l,g]),S=k(w=>{w.preventDefault(),w.stopPropagation(),l||p(!0)},[l]),A=k(w=>{w.preventDefault(),w.stopPropagation(),p(!1)},[]),T=k(w=>{let v=w.target;v.files&&(g(Array.from(v.files)),v.value="")},[g]),M=k(w=>{let v=x.filter((E,C)=>C!==w);m(v),r(v)},[x,r]),D=k(()=>{l||h.current&&h.current.click()},[l]),L={border:`2px dashed ${c?"#3b82f6":f?"#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"},I={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},P={fontSize:"14px",color:"#374151",marginBottom:"4px"},F={fontSize:"12px",color:"#9ca3af"},R=o("input",{id:n,ref:h,type:"file",accept:i,multiple:s,onChange:T,disabled:l,style:{display:"none"},tabIndex:-1}),W=o("div",{style:L,onClick:D,onKeyDown:w=>{let v=w.key;(v==="Enter"||v===" ")&&(w.preventDefault(),D())},onDrop:b,onDragOver:S,onDragLeave:A,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:I},"\u2191"),o("div",{style:P},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: ${Vt(a)}`):null),z=x.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...x.map((w,v)=>{let E={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},C={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${v}`,style:E},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},w.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},Vt(w.size))),o("button",{type:"button",style:C,onClick:N=>{N.stopPropagation(),M(v)},"aria-label":`Remove ${w.name}`},"\u2715"))})):null;return o(ge,{label:u,helpText:d,error:f||void 0,disabled:l,htmlFor:n},o("div",null,R,W,z))}function io(e){let[t,n]=j(!1),[r,i]=j((e.value??e.defaultValue??"").length),s=fe().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,u={...Re(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}:{}},d=k(c=>{let p=c.target,f=p.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(p.style.height="auto",p.style.height=`${p.scrollHeight}px`)},[e.onChange,e.autoResize]),x=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:u,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:d}),m=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(ge,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},x,m)}function so(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:u=!1,prefix:d,suffix:x,label:m,error:c}=e,[p,f]=j(!1),y=k(v=>{let E=v;return s!==void 0&&E<s&&(E=s),a!==void 0&&E>a&&(E=a),E},[s,a]),h=k(()=>{u||i(y(r+l))},[u,r,l,y,i]),g=k(()=>{u||i(y(r-l))},[u,r,l,y,i]),b=k(v=>{let E=v.target.value;if(E===""||E==="-")return;let C=parseFloat(E);isNaN(C)||i(y(C))},[y,i]),S=k(v=>{u||(v.key==="ArrowUp"?(v.preventDefault(),h()):v.key==="ArrowDown"&&(v.preventDefault(),g()))},[u,h,g]),A=s===void 0||r>s,T=a===void 0||r<a,M={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":p?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:u?"0.6":"1",...p&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},D=v=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:u||!v?"not-allowed":"pointer",color:u||!v?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),L={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"},I={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},P=o("button",{type:"button",style:D(A),onClick:g,disabled:u,"aria-label":"Decrement",tabIndex:-1},"\u2212"),F=d?o("span",{style:I},d):null,R=o("input",{id:n,type:"text",value:String(r),onInput:b,onKeyDown:S,onFocus:()=>f(!0),onBlur:()=>f(!1),disabled:u,style:L,"aria-label":m||"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}),W=x?o("span",{style:I},x):null,z=o("button",{type:"button",style:D(T),onClick:h,disabled:u,"aria-label":"Increment",tabIndex:-1},"+"),w=[P];return F&&w.push(F),w.push(R),W&&w.push(W),w.push(z),o(ge,{label:m,error:c,disabled:u,htmlFor:n},o("div",{style:M},...w))}function ao(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:u=!1,error:d,label:x}=e,m=k(y=>{u||s(y)},[u,s]),c=k(y=>{if(u)return;let h=r.filter(S=>!S.disabled);if(h.length===0)return;let g=h.findIndex(S=>S.value===i),b=g;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),b=g<h.length-1?g+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),b=g>0?g-1:h.length-1;else return;s(h[b].value)},[u,r,i,s]),p={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((y,h)=>{let g=y.value===i,b=u||!!y.disabled,S=`${n}-opt-${h}`,A={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${d?"#ef4444":g?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},T={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:g?"scale(1)":"scale(0)"},M={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:M,onClick:b?void 0:D=>{D.preventDefault(),m(y.value)}},o("input",{type:"radio",id:S,name:a,value:y.value,checked:g,disabled:b,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:A},o("div",{style:T})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(ge,{label:x,error:d,htmlFor:`${n}-opt-0`},o("div",{id:n,style:p,role:"radiogroup","aria-label":x,onKeyDown:c,tabIndex:u?-1:0},...f))}function lo(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:u=!1,clearable:d=!1,disabled:x=!1,error:m,label:c,helpText:p}=e,[f,y]=j(!1),[h,g]=j(""),[b,S]=j(-1),A=oe(null),T=X(()=>Array.isArray(i)?i:i?[i]:[],[i]),M=X(()=>{if(!l||!h)return r;let $=h.toLowerCase();return r.filter(B=>B.label.toLowerCase().includes($))},[r,h,l]),D=X(()=>{let $={},B=[];for(let H of M)H.group?($[H.group]||($[H.group]=[]),$[H.group].push(H)):B.push(H);return{groups:$,ungrouped:B}},[M]),L=X(()=>T.length===0?"":T.map(B=>r.find(H=>H.value===B)).filter(Boolean).map(B=>B.label).join(", "),[T,r]);se(()=>{let $=B=>{let H=B.target;A.current&&!A.current.contains(H)&&(y(!1),g(""))};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]);let I=k($=>{if(u){let B=T.includes($)?T.filter(H=>H!==$):[...T,$];s(B)}else s($),y(!1),g("")},[u,T,s]),P=k($=>{$.stopPropagation(),s(u?[]:"")},[u,s]),F=k($=>{if(x)return;let B=$.key;if(!f&&(B==="Enter"||B===" "||B==="ArrowDown")){$.preventDefault(),y(!0),S(0);return}if(f){if(B==="Escape"){y(!1),g("");return}if(B==="ArrowDown")$.preventDefault(),S(H=>Math.min(H+1,M.length-1));else if(B==="ArrowUp")$.preventDefault(),S(H=>Math.max(H-1,0));else if(B==="Enter"&&b>=0&&b<M.length){$.preventDefault();let H=M[b];H.disabled||I(H.value)}}},[x,f,b,M,I]),R={...Re({},{focused:f,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:x?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},W={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"},z=($,B)=>{let H=T.includes($.value),O=B===b,G={padding:"8px 12px",cursor:$.disabled?"not-allowed":"pointer",backgroundColor:O?"#f3f4f6":H?"#eff6ff":"transparent",color:$.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:$.value,style:G,onClick:$.disabled?void 0:()=>I($.value),onMouseEnter:()=>S(B),role:"option","aria-selected":H?"true":"false","aria-disabled":$.disabled?"true":void 0},u&&H?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,$.label)},w=()=>{let $=[],B=0,{groups:H,ungrouped:O}=D;for(let G of O)$.push(z(G,B++));for(let G of Object.keys(H)){$.push(o("div",{key:`group-${G}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},G));for(let q of H[G])$.push(z(q,B++))}return $.length===0&&$.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),$},v=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:f?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),E=o("div",{style:R,id:n,onClick:x?void 0:()=>{y(!f),S(-1)},onKeyDown:F,tabIndex:x?-1:0,role:"combobox","aria-expanded":f?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:L?"#1f2937":"#9ca3af"}},L||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},d&&T.length>0?o("span",{onClick:P,onKeyDown:$=>{let B=$.key;(B==="Enter"||B===" ")&&($.preventDefault(),$.stopPropagation(),P($))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,v)),C=l&&f?o("input",{type:"text",value:h,onInput:$=>{g($.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,N=f?o("div",{style:W,role:"listbox"},C,...w()):null;return o(ge,{label:c,error:m,helpText:p,disabled:x,htmlFor:n},o("div",{ref:A,style:{position:"relative"}},E,N))}function co(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:u=!1,showTicks:d=!1,disabled:x=!1,marks:m,range:c=!1,label:p,error:f}=e,y=oe(null),h=oe(i);h.current=i;let[g,b]=j(null),S=X(()=>{if(c&&Array.isArray(r))return r;let B=typeof r=="number"?r:0;return[B,B]},[r,c]),A=oe(S);A.current=S;let T=B=>{let H=Math.round((B-s)/l)*l+s;return Math.max(s,Math.min(a,H))},M=B=>(B-s)/(a-s)*100,D=k(B=>{if(!y.current)return s;let H=y.current.getBoundingClientRect(),O=Math.max(0,Math.min(1,(B.clientX-H.left)/H.width));return T(s+O*(a-s))},[s,a,l]),L=k(B=>H=>{x||(H.preventDefault(),b(B))},[x]),I=k(B=>{if(x)return;let H=D(B);if(c){let O=Math.abs(H-S[0]),G=Math.abs(H-S[1]);O<=G?i([T(H),S[1]]):i([S[0],T(H)])}else i(T(H))},[x,D,c,S,i,s,a,l]);se(()=>{if(!g)return;let B=O=>{let G=D(O),q=A.current,te=h.current;g==="single"?te(T(G)):g==="start"?te([Math.min(T(G),q[1]),q[1]]):g==="end"&&te([q[0],Math.max(q[0],T(G))])},H=()=>b(null);return document.addEventListener("mousemove",B),document.addEventListener("mouseup",H),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",H)}},[g,D,s,a,l]);let P=k(B=>{if(x)return;let H=0;if(B.key==="ArrowRight"||B.key==="ArrowUp")H=l;else if(B.key==="ArrowLeft"||B.key==="ArrowDown")H=-l;else return;B.preventDefault(),c||i(T((typeof r=="number"?r:0)+H))},[x,l,c,r,i,s,a]),F={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:x?"not-allowed":"pointer"},R=c?M(S[0]):0,W=M(c?S[1]:S[0]),z={position:"absolute",top:"0",left:`${R}%`,width:`${W-R}%`,height:"100%",backgroundColor:x?"#9ca3af":"#3b82f6",borderRadius:"3px"},w=B=>p?B==="start"?`${p} minimum`:B==="end"?`${p} maximum`:p:B==="start"?"Minimum value":B==="end"?"Maximum value":"Value",v=(B,H,O)=>{let G={position:"absolute",top:"50%",left:`${B}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${x?"#9ca3af":"#3b82f6"}`,cursor:x?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},q={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:H==="single"||H==="start"?n:void 0,style:G,onMouseDown:L(H),role:"slider","aria-valuenow":String(O),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":w(H),tabIndex:x?-1:0,onKeyDown:P},u?o("div",{style:q},String(O)):null)},E=[];if(d)for(let B=s;B<=a;B+=l)E.push(o("div",{key:`tick-${B}`,style:{position:"absolute",top:"10px",left:`${M(B)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let C=[];if(m)for(let B of m)C.push(o("div",{key:`mark-${B.value}`,style:{position:"absolute",top:"18px",left:`${M(B.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},B.label));let N={paddingTop:u?"28px":"8px",paddingBottom:m||d?"28px":"8px",opacity:x?"0.6":"1"},$=[];return c?($.push(v(M(S[0]),"start",S[0])),$.push(v(M(S[1]),"end",S[1]))):$.push(v(M(S[0]),"single",S[0])),o(ge,{label:p,error:f,htmlFor:n},o("div",{style:N},o("div",{ref:y,style:F,role:"presentation",onClick:I},o("div",{style:z}),...$,...E,...C)))}var Qs=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],ea={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 uo(e){let[t,n]=j(!1),r=oe(null),i=fe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??Qs,l=e.toolbarStyle??{},u=e.editorStyle??{};se(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let d=k((f,y)=>{if(!(e.disabled||e.readOnly)){if(f==="createLink"){let h=prompt("Enter URL:");if(!h)return;document.execCommand(f,!1,h)}else y&&f==="formatBlock"?document.execCommand(f,!1,`<${y}>`):document.execCommand(f,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),x=k(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=k(()=>{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(f=>{let y=ea[f];return y?o("button",{key:f,type:"button",title:y.label,onClick:()=>d(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:f==="bold"?"700":f==="italic"?"400":"500",fontStyle:f==="italic"?"italic":"normal",textDecoration:f==="underline"?"underline":f==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),p=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:u.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:u.backgroundColor??"#ffffff",color:u.color??"#1f2937",fontFamily:u.fontFamily??"inherit",fontSize:u.fontSize??"14px",lineHeight:u.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:m,onInput:x});return o(ge,{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,p))}function fo(e){let[t,n]=j(!1),r=fe().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Re(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:d=>{n(!1),e.onBlur&&e.onBlur(d.target.value)},onInput:d=>{let x=d.target.value;e.onInput&&e.onInput(x),e.onChange&&e.onChange(x)},onKeyDown:d=>{d.key==="Enter"&&e.onEnter&&e.onEnter(d.target.value)}}),u=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(ge,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},u)}var ta=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Ae(e){return String(e).padStart(2,"0")}function na(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 po(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:u,error:d,showSeconds:x=!1,timezone:m,showTimezone:c=!1,timezones:p=ta,onTimezoneChange:f}=e,[y,h]=j(!1),g=X(()=>na(r),[r]),b=s==="12h",S=g.hour>=12,A=b?g.hour%12||12:g.hour,T=k((U,V,_)=>{let K=Math.max(0,Math.min(23,U)),Q=Math.max(0,Math.min(59,V)),ie=Math.max(0,Math.min(59,_??0));i(x?`${Ae(K)}:${Ae(Q)}:${Ae(ie)}`:`${Ae(K)}:${Ae(Q)}`)},[i,x]),M=k(U=>{let V=parseInt(U.target.value,10)||0;b&&(V=V%12,S&&(V+=12)),T(V,g.minute,g.second)},[b,S,g.minute,g.second,T]),D=k(U=>{let V=parseInt(U.target.value,10)||0;T(g.hour,V,g.second)},[g.hour,g.second,T]),L=k(U=>{let V=parseInt(U.target.value,10)||0;T(g.hour,g.minute,V)},[g.hour,g.minute,T]),I=k(()=>{if(l)return;let U=S?g.hour-12:g.hour+12;T(U,g.minute,g.second)},[l,S,g.hour,g.minute,g.second,T]),P=k(U=>{l||T(g.hour+U,g.minute,g.second)},[l,g.hour,g.minute,g.second,T]),F=k(U=>{l||T(g.hour,g.minute+U*a,g.second)},[l,g.hour,g.minute,g.second,a,T]),R=k(U=>{l||T(g.hour,g.minute,g.second+U)},[l,g.hour,g.minute,g.second,T]),W=k(U=>{let V=U.target.value;f&&f(V)},[f]),z={display:"inline-flex",alignItems:"center",gap:"4px",...Re({},{focused:y,error:!!d})},w={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"},E={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},C={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},N=o("div",{style:w},o("button",{type:"button",style:v,onClick:()=>P(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ae(A),onChange:M,style:E,disabled:l,"aria-label":"Hour",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:v,onClick:()=>P(-1),disabled:l},"\u25BC")),$=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),B=o("div",{style:w},o("button",{type:"button",style:v,onClick:()=>F(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ae(g.minute),onChange:D,style:E,disabled:l,"aria-label":"Minute",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:v,onClick:()=>F(-1),disabled:l},"\u25BC")),H=x?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,O=x?o("div",{style:w},o("button",{type:"button",style:v,onClick:()=>R(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ae(g.second),onChange:L,style:E,disabled:l,"aria-label":"Second",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:v,onClick:()=>R(-1),disabled:l},"\u25BC")):null,G=b?o("button",{type:"button",style:C,onClick:I,disabled:l,"aria-label":"Toggle AM/PM"},S?"PM":"AM"):null,q={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},te=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,Z=c?o("select",{style:q,value:m??p[0],onChange:W,disabled:l,"aria-label":"Timezone"},...p.map(U=>o("option",{key:U,value:U},U))):null,Y=[N,$,B];return H&&Y.push(H),O&&Y.push(O),G&&Y.push(G),te&&Y.push(te),Z&&Y.push(Z),o(ge,{label:u,error:d,disabled:l,htmlFor:n},o("div",{id:n,style:z},...Y))}var oa={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 go(e){let{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:s=!1,size:a="md",onColor:l="#3b82f6",offColor:u="#d1d5db"}=e,d=oa[a],x=k(()=>{s||n(!t)},[s,t,n]),m=k(S=>{s||(S.key===" "||S.key==="Enter")&&(S.preventDefault(),n(!t))},[s,t,n]),c={width:`${d.trackW}px`,height:`${d.trackH}px`,borderRadius:`${d.trackH}px`,backgroundColor:t?l:u,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},p=t?d.trackW-d.thumbSize-d.offset:d.offset,f={width:`${d.thumbSize}px`,height:`${d.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${d.offset}px`,left:`${p}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"},h=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,g=o("div",{style:c},o("div",{style:f}));return o("div",{style:y,onClick:x,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[h,g]:[g,h]).filter(Boolean))}var mo={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 ho(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=X(()=>{let x={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(x.border="1px solid #e5e7eb"),x.boxShadow=mo[n]??mo.sm,e.hoverable&&(x.cursor="pointer"),{...x,...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"},u={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},d=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,d?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:u},e.footer):null)}function bo(e){let t=X(()=>{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 xo(e){let t=X(()=>{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 yo(e){let t=X(()=>{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 So(e){let t=X(()=>{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 vo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function wo(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=j(!!e.defaultCollapsed),s=oe(null),[a,l]=j("auto");se(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let u=k(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),d=k(y=>{if(!e.collapsible)return;let h=y.key;(h==="Enter"||h===" ")&&(y.preventDefault(),u())},[e.collapsible,u]),x=X(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=vo[n]??vo.none,{...y,...e.style??{}}},[t,n,e.style]),m={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"},p={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},f={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:x},o("div",{className:"panel__header",style:m,onClick:u,onKeyDown:d,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?p:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function ko(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function ra(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 Co(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=oe(null),[s,a]=j(!0),[l,u]=j(!1),[d,x]=j(!0),[m,c]=j(!1),p=k(()=>{let b=i.current;if(!b)return;let S=2;a(b.scrollTop<=S),u(b.scrollTop+b.clientHeight>=b.scrollHeight-S),x(b.scrollLeft<=S),c(b.scrollLeft+b.clientWidth>=b.scrollWidth-S)},[]);se(()=>{p()},[p]);let f=k(()=>{r&&p()},[r,p]),y=X(()=>{let b={position:"relative",overflowX:ko(t,"x"),overflowY:ko(t,"y"),...ra(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]),h=[];if(r){let b=t==="vertical"||t==="both",S=t==="horizontal"||t==="both";b&&!s&&h.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),b&&!l&&h.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),S&&!d&&h.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),S&&!m&&h.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let g={...y};return h.length>0&&(g.boxShadow=h.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:g,ref:i,onScroll:f},e.children)}function Mo(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=j(e.initialSplit??50),l=oe(null),u=oe(!1),d=k(y=>{y.preventDefault(),u.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);se(()=>{let y=g=>{if(!u.current||!l.current)return;let b=l.current.getBoundingClientRect(),S=n?b.width:b.height,A=n?g.clientX-b.left:g.clientY-b.top;if(S<=0)return;let T=i/S*100,M=e.maxSize?e.maxSize/S*100:100-T,D=A/S*100;D=Math.max(T,Math.min(M,D)),a(D)},h=()=>{u.current&&(u.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",h),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",h)}},[n,i,e.maxSize]);let x=X(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=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"},p={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%"}},f=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:x,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},f[0]??null),o("div",{className:"splitter__divider",style:p,onMouseDown:d,onKeyDown:y=>{let h=y.key,g=2;n&&(h==="ArrowLeft"||h==="ArrowRight")?(y.preventDefault(),a(b=>{let S=h==="ArrowRight"?g:-g;return Math.max(5,Math.min(95,b+S))})):!n&&(h==="ArrowUp"||h==="ArrowDown")&&(y.preventDefault(),a(b=>{let S=h==="ArrowDown"?g:-g;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},f[1]??null))}function Po(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(g=>!g.disabled)?.id??"",[i,s]=j(e.activeTab??r),a=e.activeTab??i,l=oe(null),u=k(g=>{s(g),e.onChange&&e.onChange(g)},[e.onChange]),d=k(g=>{let b=e.tabs.filter(L=>!L.disabled),S=b.findIndex(L=>L.id===a);if(S===-1)return;let A=t==="left"||t==="right",T=A?"ArrowUp":"ArrowLeft",M=A?"ArrowDown":"ArrowRight",D=-1;if(g.key===T?D=S>0?S-1:b.length-1:g.key===M?D=S<b.length-1?S+1:0:g.key==="Home"?D=0:g.key==="End"&&(D=b.length-1),D>=0){g.preventDefault(),u(b[D].id);let L=l.current;if(L){let P=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(b[D])];P&&P.focus()}}},[e.tabs,a,t,u]),x=t==="left"||t==="right",m=t==="bottom"||t==="right",c=X(()=>({display:"flex",flexDirection:x?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[x,m,e.style]),p={display:"flex",flexDirection:x?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!x?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&x?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},f={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(g=>g.id===a),h=e.tabs.map(g=>{let b=g.id===a,S={padding:"8px 16px",border:"none",background:"none",cursor:g.disabled?"not-allowed":"pointer",opacity:g.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"?x?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:g.id,role:"tab","aria-selected":String(b),"aria-controls":`tabpanel-${g.id}`,"aria-disabled":g.disabled?"true":void 0,id:`tab-${g.id}`,tabIndex:b?"0":"-1",style:S,onClick:g.disabled?void 0:()=>u(g.id),onKeyDown:d},g.icon?o("span",{className:"tabs__tab-icon"},g.icon):null,g.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":x?"vertical":"horizontal",style:p,ref:l},...h),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},y?y.content:null))}function Eo(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,u=fe().replace(/[^a-zA-Z0-9_-]/g,""),[d,x]=j(0),m=oe(null),c=oe(null),p=k(M=>{let D=M;r?D=(M%n+n)%n:D=Math.max(0,Math.min(M,n-1)),x(D),e.onChange&&e.onChange(D)},[n,r,e.onChange]),f=k(()=>p(d+1),[d,p]),y=k(()=>p(d-1),[d,p]);se(()=>{if(!e.autoPlay||n<=1)return;let M=setInterval(f,l);return()=>clearInterval(M)},[e.autoPlay,l,f,n]),se(()=>{let M=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&f()},D=c.current;if(D)return D.addEventListener("keydown",M),()=>D.removeEventListener("keydown",M)},[f,y]);let h=a==="fade"?`@keyframes liq-fade-in-${u}{from{opacity:0}to{opacity:1}}`:"",g={position:"relative",overflow:"hidden",width:"100%",outline:"none"},b=X(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${d*100}%)`,width:"100%"},[d,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)"},A=t.map((M,D)=>{let L=a==="fade"?{position:D===d?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:D===d?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(D),style:L},M.content,M.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},M.caption):null)}),T=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((M,D)=>o("button",{key:String(D),"aria-label":`Go to slide ${D+1}`,onclick:()=>p(D),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:D===d?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:g,onpointerdown:M=>{m.current=M.clientX},onpointerup:M=>{if(m.current==null)return;let D=M.clientX-m.current;D>50?y():D<-50&&f(),m.current=null}},h?o("style",null,h):null,o("div",{style:b},...A),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:f,style:{...S,right:"8px"}},"\u203A"):null,T)}function Ro(e){let[t,n]=j("loading"),r=oe(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 u=X(()=>{let p={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(p.width=a),l&&(p.height=l),e.borderRadius&&(p.borderRadius=e.borderRadius),p},[a,l,e.borderRadius]),d=X(()=>{let p={display:"block",width:"100%",height:"100%"};return e.objectFit&&(p.objectFit=e.objectFit),t==="loading"&&(p.opacity="0",p.position="absolute"),t==="error"&&(p.display="none"),p},[e.objectFit,t]),x=null;if(t==="loading")if(e.placeholder==="skeleton"){let p=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;x=o("div",null,o("style",null,p),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"?x=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(x=e.placeholder);let m=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?m=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):m=e.fallback);let c=o("div",{style:u},x,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:d,onload:()=>n("loaded"),onerror:()=>n("error")}),m);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 $o(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 Io(e){let t=e.controls!==!1,n=oe(null),r=fe().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=j(!1),[a,l]=j(0),[u,d]=j(0),[x,m]=j(e.muted?0:1),[c,p]=j(!!e.muted),[f,y]=j(!0),h=typeof e.width=="number"?`${e.width}px`:e.width??"100%",g=typeof e.height=="number"?`${e.height}px`:e.height??"auto";se(()=>{let I=n.current;if(!I)return;let P=()=>{s(!0),e.onPlay&&e.onPlay()},F=()=>{s(!1),e.onPause&&e.onPause()},R=()=>{s(!1),e.onEnded&&e.onEnded()},W=()=>{l(I.currentTime),d(I.duration),e.onTimeUpdate&&e.onTimeUpdate(I.currentTime,I.duration)},z=()=>{d(I.duration)};return I.addEventListener("play",P),I.addEventListener("pause",F),I.addEventListener("ended",R),I.addEventListener("timeupdate",W),I.addEventListener("loadedmetadata",z),()=>{I.removeEventListener("play",P),I.removeEventListener("pause",F),I.removeEventListener("ended",R),I.removeEventListener("timeupdate",W),I.removeEventListener("loadedmetadata",z)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let b=k(()=>{let I=n.current;I&&(I.paused?I.play():I.pause())},[]),S=k(I=>{let P=n.current;if(!P||!isFinite(P.duration))return;let F=I.currentTarget.getBoundingClientRect(),R=Math.max(0,Math.min(1,(I.clientX-F.left)/F.width));P.currentTime=R*P.duration},[]),A=k(I=>{let P=n.current,F=parseFloat(I.target.value);P&&(P.volume=F,P.muted=F===0,m(F),p(F===0))},[]),T=k(()=>{let I=n.current;I&&I.requestFullscreen&&I.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:h,height:g,display:"block"}});let M=u>0?a/u*100:0,D={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},L=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:f?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:b,style:D},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:`${M}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${$o(a)} / ${$o(u)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:x),oninput:A,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:T,style:D},"\u26F6"));return o("div",{style:{position:"relative",width:h,height:g,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"}}),L)}function Se(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=oe(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=k(u=>{if(!r)return;let d=u,x=s.current;if(!x)return;let m=Array.from(x.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let p=t==="vertical",f=p?"ArrowDown":"ArrowRight",y=p?"ArrowUp":"ArrowLeft";if(d.key===f){d.preventDefault();let h=m[c+1];h&&h.focus()}else if(d.key===y){d.preventDefault();let h=m[c-1];h&&h.focus()}else d.key==="Home"?(d.preventDefault(),m[0]?.focus()):d.key==="End"&&(d.preventDefault(),m[m.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 Ye(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 xe(){let[e,t]=j(!1);return{hover:e,onMouseEnter:k(()=>t(!0),[]),onMouseLeave:k(()=>t(!1),[])}}function ia(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:u,onMouseEnter:d,onMouseLeave:x}=xe(),m=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:m?"#f9fafb":u?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:m?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:m?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let p=k(S=>{let A=S;m||(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),r())},[m,r]),f=k(()=>{m||r()},[m,r]),h=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),g=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"?[h,g]:[g,h];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":m?"true":void 0,"data-section-id":t.id,tabIndex:m?-1:0,style:c,onClick:f,onKeyDown:p,onMouseEnter:d,onMouseLeave:x},...b)}function sa(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 zo(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:u="\u2212",iconPosition:d="right",animated:x=!0,onChange:m}=e,[c,p]=j(()=>n??[]),f=k(h=>{p(g=>{let b=g.includes(h),S;return b?S=g.filter(A=>A!==h):r?S=[...g,h]:S=[h],m&&m(S),S})},[r,m]),y=X(()=>t.map(h=>{let g=c.includes(h.id),b=o(ia,{key:`header-${h.id}`,section:h,expanded:g,onToggle:()=>f(h.id),headerStyle:i,expandIcon:l,collapseIcon:u,iconPosition:d}),S=o(sa,{key:`content-${h.id}`,section:h,expanded:g,contentStyle:s,animated:x});return o("div",{key:h.id,"data-accordion-section":h.id,style:{width:"100%"}},b,S)}),[t,c,i,s,l,u,d,x,f]);return o(Se,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var aa={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function To(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=j(!1),l=aa[i],u=k(()=>{a(!0)},[]),d=t,x=!1;if(r&&r>1&&t.length>r&&!s){x=!0;let f=1,y=r-1;d=[...t.slice(0,f),{label:"..."},...t.slice(t.length-y)]}let m=f=>typeof f=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},f):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},f),c=(f,y,h)=>{let g=y===h.length-1,b=x&&f.label==="..."&&y===1,S=[];return y>0&&S.push(m(n)),b?S.push(o("button",{type:"button",onClick:u,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):g?S.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},f.label)):f.href?S.push(o("a",{href:f.href,onClick:f.onClick?A=>{A.preventDefault(),f.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},f.label)):f.onClick?S.push(o("button",{type:"button",onClick:f.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},f.label)):S.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},f.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...S)},p=d.map((f,y)=>c(f,y,d));return o(Se,{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"}},...p))}function Do(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=xe(),[u,d]=j(!1),x=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let m=t.disabled===!0,p={...Ye(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=k(()=>{if(!m){if(x){d(A=>!A);return}t.onClick&&t.onClick(),r&&i()}},[m,x,t,r,i]),y=k(()=>{a(),x&&d(!0)},[x,a]),h=k(()=>{l(),x&&d(!1)},[x,l]),g=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=x?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,S=x&&u?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(Se,{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(A=>o(Do,{key:A.id,item:A,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:h},o("button",{type:"button",role:"menuitem",style:p,onClick:f,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":x||void 0,"aria-expanded":x?String(u):void 0},g,b),S)}function Ao(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:u="220px"}=e,[d,x]=j(!1),m=oe(null),c=k(()=>{x(A=>!A)},[]),p=k(()=>{x(!1)},[]);se(()=>{if(!d)return;let A=T=>{let M=m.current;M&&!M.contains(T.target)&&x(!1)};return document.addEventListener("click",A,!0),()=>{document.removeEventListener("click",A,!0)}},[d]),se(()=>{if(!d)return;let A=T=>{T.key==="Escape"&&x(!1)};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[d]);let f={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:f,onClick:c,"aria-haspopup":"true","aria-expanded":String(d)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:d?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),h=typeof u=="number"?`${u}px`:u,g={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:h,backgroundColor:"#ffffff",...i??{}},S=d?o("div",{style:g},o(Se,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:b},...n.map(A=>o(Do,{key:A.id,item:A,itemStyle:s,closeOnSelect:l,onClose:p})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,S)}function Lo(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=xe(),[l,u]=j(!1),d=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let x=t.disabled===!0,m=k(()=>{if(!x){if(d){u(b=>!b);return}t.onClick&&t.onClick(),n()}},[x,d,t,n]),c=k(()=>{s(),d&&u(!0)},[d,s]),p=k(()=>{a(),d&&u(!1)},[d,a]),f={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:x?"default":"pointer",backgroundColor:!x&&i?"#f3f4f6":"transparent",color:x?"#9ca3af":"#1f2937",opacity:x?"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)),h=d?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,g=d&&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(Lo,{key:String(S),item:b,onClose:n,index:S})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:p},o("button",{type:"button",role:"menuitem",style:f,onClick:m,disabled:x||void 0,tabIndex:-1,"aria-disabled":x||void 0,"aria-haspopup":d||void 0,"aria-expanded":d?l:void 0},y,h),g)}function la(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:u,onMouseLeave:d}=xe(),x=oe(null),m=k(()=>{r?a():s(n)},[r,n,s,a]),c=k(()=>{u(),i&&!r&&s(n)},[i,r,n,s,u]),p={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"},f=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,h)=>o(Lo,{key:String(h),item:y,onClose:a,index:h})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:d},o("button",{ref:x,type:"button",role:"menuitem",style:p,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function Fo(e){let{menus:t}=e,[n,r]=j(null),i=oe(null),s=k(u=>{r(u)},[]),a=k(()=>{r(null)},[]);se(()=>{if(n===null)return;let u=d=>{let x=i.current;x&&!x.contains(d.target)&&r(null)};return document.addEventListener("click",u,!0),()=>{document.removeEventListener("click",u,!0)}},[n]),se(()=>{let u=i.current;if(!u)return;let d=x=>{let m=x;if(m.key==="Escape"){r(null);return}if(m.key==="ArrowRight"){m.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(m.key==="ArrowLeft"){m.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(m.key==="ArrowDown"&&n!==null){m.preventDefault();let c=u.querySelector('[role="menu"]');if(c){let p=c.querySelector('[role="menuitem"]');p&&p.focus()}return}m.key==="Enter"||m.key};return u.addEventListener("keydown",d),()=>{u.removeEventListener("keydown",d)}},[n,t.length]);let l=t.map((u,d)=>o(la,{key:String(d),menu:u,index:d,isOpen:n===d,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 ht(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ca(e,t,n){let r=n*2+5;if(e<=r)return ht(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?[...ht(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...ht(e-n*2-2,e)]:[1,"ellipsis",...ht(i,s),"ellipsis",e]}var bt={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"},ua={...bt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Wo={...bt,color:"#9ca3af",cursor:"default",opacity:"0.5"},da={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function No(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:u=!1}=e,d=Math.max(1,Math.ceil(t/n)),x=Math.min(Math.max(1,r),d),m=k(h=>{!u&&h>=1&&h<=d&&h!==x&&i(h)},[u,d,x,i]),c=(h,g,b)=>{let S=u||g<1||g>d||g===x;return o("button",{type:"button",onClick:()=>m(g),disabled:S||void 0,"aria-label":b,style:S?Wo:bt},h)},p=ca(d,x,s),f=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",x-1,"Go to previous page"));for(let h of p)if(h==="ellipsis")y.push(o("span",{key:`ellipsis-${f++}`,style:da},"..."));else{let g=h===x;y.push(o("button",{key:String(h),type:"button",onClick:()=>m(h),disabled:u||void 0,"aria-label":`Page ${h}`,"aria-current":g?"page":void 0,style:u?Wo:g?ua:bt},String(h)))}return l&&y.push(c("\u203A",x+1,"Go to next page")),a&&y.push(c("\xBB",d,"Go to last page")),o(Se,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function Bo(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:u}=xe(),[d,x]=j(!1),m=t.children&&t.children.length>0,c=t.id===r,p=k(()=>{m&&!n&&x(D=>!D),i&&i(t.id)},[m,n,i,t.id]),f=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${f}`,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"},h=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,g=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&&m?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:d?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,A=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,T=o("button",{type:"button",style:y,onClick:p,onMouseEnter:l,onMouseLeave:u,"aria-selected":c?"true":"false",title:n?t.label:void 0},h,g,b,S,A),M=!n&&m&&d?t.children.map(D=>o(Bo,{key:D.id,item:D,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},T,M?o("div",{role:"group"},...M):null)}function Ho(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,u=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,d=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,x=t.map(m=>o(Bo,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(Se,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:u,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},d,...x)}var Pe={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 _o(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",u=a==="circle"?32:12,d=a==="dot"?12:32,x=k(h=>{s&&i&&i(h)},[s,i]),m=h=>h<n?"completed":h===n?"active":"pending",c=(h,g,b)=>{let S=a==="dot"?d:u,A={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:{...A,backgroundColor:Pe.completedBg,color:Pe.completedText,border:`2px solid ${Pe.completed}`}},a==="circle"?g.icon||"\u2713":null):b==="active"?o("div",{style:{...A,backgroundColor:"#ffffff",color:Pe.activeText,border:`2px solid ${Pe.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?g.icon||String(h+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Pe.active}})):o("div",{style:{...A,backgroundColor:"#ffffff",color:Pe.pendingText,border:`2px solid ${Pe.pending}`}},a==="circle"?g.icon||String(h+1):null)},p=h=>{if(h>=t.length-1)return null;let b=h<n?Pe.lineCompleted:Pe.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"?d:u)/2-1}px`,transition:"background-color 0.2s"}})},f=(h,g)=>{let b=m(g),S=b==="active",A=b==="completed",T=c(g,h,b),M={fontSize:"13px",fontWeight:S?"600":"400",color:S||A?Pe.labelActive:Pe.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},D={fontSize:"11px",color:Pe.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},L=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:M},h.label),h.description?o("span",{style:D},h.description):null),I=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},T,L):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},T,L);return o(s?"button":"div",{key:String(g),onClick:s?()=>x(g):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},I)},y=[];return t.forEach((h,g)=>{y.push(f(h,g));let b=p(g);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 Oo={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 fa(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=xe(),l=Oo[n],u=t.disabled===!0,d=t.type==="toggle",[x,m]=j(!1),c=d?t.active===!0:x,p=k(()=>{!u&&t.onClick&&t.onClick()},[u,t]),f=k(()=>{!u&&!d&&m(!0)},[u,d]),y=k(()=>{d||m(!1)},[d]),h=k(()=>{a(),d||m(!1)},[d,a]),g={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":!u&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:u?"#9ca3af":c?"#2563eb":"#374151",cursor:u?"default":"pointer",opacity:u?"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,A=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:g,onClick:p,onMouseDown:f,onMouseUp:y,onMouseEnter:s,onMouseLeave:h,disabled:u||void 0,"aria-pressed":d?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},b,S,A)}function Vo(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Oo[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(fa,{key:a.id,item:a,size:n,variant:r}));return o(Se,{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 Ge=class e{constructor(t,n){Te(this,"id");Te(this,"label");Te(this,"children");Te(this,"expanded");Te(this,"icon");Te(this,"metadata");Te(this,"parent");Te(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 Yo(e){e.expanded=!0;for(let t of e.children)Yo(t)}function Go(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)Go(n,t);return t}function pa(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function ga(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:u,renderNode:d,onToggle:x,onClick:m,focusedId:c}=e,p=xe(),f=oe(null),y=c===t.id;se(()=>{y&&f.current&&f.current.focus()},[y]);let h=t.isLeaf(),g=t.depth,b=[];for(let D=0;D<g;D++){let L=t;for(let P=0;P<g-D;P++)L=L?L.parent:null;let I=L?!pa(L):!1;b.push(o("span",{key:`connector-${D}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...I?{borderLeft:`${s}px solid ${i}`}:{}}}))}let S=g>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,A=h?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:D=>{D.stopPropagation(),x(t)}},t.expanded?a:l),T=d?d(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),M=Ye(u,{hover:p.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":h?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":g+1,tabIndex:y?0:-1,style:{...M,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:p.onMouseEnter,onMouseLeave:p.onMouseLeave,onClick:()=>m(t)},...b,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:u.padding??"6px 10px",minWidth:"0"}},A,T))}function Uo(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:u=1,indentPx:d=20,iconExpanded:x="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:p,renderNode:f}=e,[y,h]=j(()=>{let I=Ge.fromData(t);return a&&Yo(I),I}),[g,b]=j(t.id),S=X(()=>Go(y),[y]),A=k(()=>{h(I=>{let P=Object.create(Object.getPrototypeOf(I));return Object.assign(P,I),P})},[]),T=k(I=>{I.toggle(),I.expanded?r?.(I):i?.(I),A()},[r,i,A]),M=k(I=>{b(I.id),n?.(I)},[n]),D=k(I=>{let P=I;if(!g)return;let F=S.findIndex(W=>W.id===g);if(F===-1)return;let R=S[F];switch(P.key){case"ArrowDown":{P.preventDefault();let W=S[F+1];W&&b(W.id);break}case"ArrowUp":{P.preventDefault();let W=S[F-1];W&&b(W.id);break}case"ArrowRight":{P.preventDefault(),R.isLeaf()||(R.expanded?R.children.length>0&&b(R.children[0].id):T(R));break}case"ArrowLeft":{P.preventDefault(),!R.isLeaf()&&R.expanded?T(R):R.parent&&b(R.parent.id);break}case"Enter":{P.preventDefault(),M(R);break}case" ":{P.preventDefault(),R.isLeaf()||T(R);break}case"Home":{P.preventDefault(),S.length>0&&b(S[0].id);break}case"End":{P.preventDefault(),S.length>0&&b(S[S.length-1].id);break}}},[g,S,T,M]),L=S.map(I=>o(ga,{key:I.id,node:I,isSelected:I.id===s,indentPx:d,lineColor:l,lineWidth:u,iconExpanded:x,iconCollapsed:m,nodeStyle:c,renderNode:f,onToggle:T,onClick:M,focusedId:g}));return o(Se,{role:"tree",ariaLabel:"Tree navigation",styling:p,keyboardNav:!1},o("div",{onKeyDown:D,style:{outline:"none"}},...L))}function jo(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=j(-1),[l,u]=j(null),d=oe(null);se(()=>{if(!d.current)return;d.current.focus();let c=f=>{let y=f,h=t.map((g,b)=>({item:g,i:b})).filter(({item:g})=>!g.divider);if(y.key==="ArrowDown")y.preventDefault(),a(g=>{let S=(h.findIndex(({i:A})=>A===g)+1)%h.length;return h[S].i});else if(y.key==="ArrowUp")y.preventDefault(),a(g=>{let b=h.findIndex(({i:A})=>A===g),S=b<=0?h.length-1:b-1;return h[S].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&u(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let g=t[s];g.children?u(s):!g.disabled&&g.onClick&&(g.onClick(),r())}}else y.key==="Escape"&&r()};d.current.addEventListener("keydown",c);let p=d.current;return()=>p.removeEventListener("keydown",c)},[t,s,i,r]);let x={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"},m=t.map((c,p)=>{if(c.divider)return o("div",{key:`divider-${p}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===p,y=!!c.disabled,h=!!(c.children&&c.children.length>0),g={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:f&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},b=()=>{a(p),u(h?p:null)},S=()=>{if(!y){if(h){u(p);return}c.onClick&&c.onClick(),r()}},A=[];c.icon&&A.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),A.push(o("span",{style:{flex:"1"}},c.label??"")),h&&A.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let T=[o("div",{key:`item-${p}`,style:g,onMouseEnter:b,onClick:S,role:"menuitem","aria-disabled":y?"true":void 0},...A)];return h&&l===p&&T.push(o(jo,{key:`submenu-${p}`,items:c.children,position:{x:n.x+178,y:n.y+p*36},onClose:()=>u(null),depth:i+1})),o("div",{key:`wrap-${p}`,style:{position:"relative"}},...T)});return o("div",{ref:d,style:x,tabIndex:-1,role:"menu"},...m)}function xt(e){let{items:t,children:n}=e,[r,i]=j(null),s=k(d=>{d.preventDefault();let x=d;i({x:x.clientX,y:x.clientY})},[]),a=k(()=>{i(null)},[]);se(()=>{if(!r)return;let d=m=>{a()},x=setTimeout(()=>{document.addEventListener("mousedown",d)},0);return()=>{clearTimeout(x),document.removeEventListener("mousedown",d)}},[r,a]),se(()=>{if(!r)return;let d=x=>{x.key==="Escape"&&a()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[r,a]);let u=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&u.push(o(jo,{items:t,position:r,onClose:a,depth:0})),o("div",null,...u)}function ma(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 ha(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 Xo(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:u=!0,children:d}=e,[x,m]=j(!1),[c,p]=j(!1),f=oe(null),y=s?"drawer-title":void 0;if(se(()=>{if(t)m(!0),requestAnimationFrame(()=>p(!0));else{p(!1);let I=setTimeout(()=>m(!1),300);return()=>clearTimeout(I)}},[t]),se(()=>{if(!t||!u)return;let I=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,u,n]),se(()=>{if(!t)return;let I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[t]),se(()=>{t&&f.current&&f.current.focus()},[t]),!x)return null;let h={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"},g={...ha(r,i),transform:ma(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"},A={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},T={padding:"20px",overflow:"auto",flex:"1"},M=()=>{l&&n()},D=[];s&&D.push(o("div",{style:b},o("h3",{id:y,style:S},s),o("button",{type:"button",style:A,onClick:n,"aria-label":"Close drawer"},"\xD7"))),D.push(o("div",{style:T},d));let L=[];return a&&L.push(o("div",{style:h,onClick:M})),L.push(o("div",{ref:f,style:g,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...D)),o("div",null,...L)}var ba={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function qo(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:u=!0,children:d}=e,x=oe(null);if(se(()=>{if(!t)return;let M=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=M}},[t]),se(()=>{if(!t||!a)return;let M=D=>{D.key==="Escape"&&n()};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[t,a,n]),se(()=>{t&&x.current&&x.current.focus()},[t]),!t)return null;let m={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:ba[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},p={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},f={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"},h={padding:"24px",overflow:"auto",flex:"1"},g={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},b=M=>{s&&M.target===M.currentTarget&&n()},S=[],A=r?"modal-title":void 0;r?S.push(o("h2",{id:A,style:f},r)):S.push(o("span",null)),u&&S.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let T=[o("div",{style:p},...S),o("div",{style:h},d)];return l&&T.push(o("div",{style:g},l)),o("div",{style:m,onClick:b,"aria-modal":"true",role:"dialog","aria-labelledby":A},o("div",{ref:x,style:c,tabIndex:-1,role:"document"},...T))}var Ko=8;function xa(e,t){let n=t+Ko;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 ya(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Ko}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 Zo(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:u}=e,d=r!==void 0,[x,m]=j(!1),c=d?r:x,p=oe(null),f=k(()=>{d?u&&u(!r):m(A=>!A)},[d,r,u]);se(()=>{if(!c||!l)return;let A=T=>{p.current&&!p.current.contains(T.target)&&(d?u&&u(!1):m(!1))};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[c,l,d,u]);let y={position:"relative",display:"inline-block"},h={...xa(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"},g=[n];a&&g.push(o("div",{style:ya(i)}));let b=k(A=>{let T=A.key;(T==="Enter"||T===" ")&&(A.preventDefault(),f())},[f]),S=[o("div",{onClick:f,onKeyDown:b,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&S.push(o("div",{style:h},...g)),o("div",{ref:p,style:y},...S)}var Sa=0;function va(){return`toast-${++Sa}-${Date.now()}`}function Yt(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(u=>u())}function s(u,d={}){let x=va();return n=[{id:x,message:u,type:d.type??"info",duration:d.duration??t.defaultDuration,action:d.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),x}function a(u){n=n.filter(d=>d.id!==u),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:u=>(r.add(u),()=>{r.delete(u)}),getToasts:()=>n,config:t}}var wa={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 ka(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 Ca(e){let{item:t,onDismiss:n}=e,r=wa[t.type];se(()=>{if(t.duration<=0)return;let d=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(d)},[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"},u=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&u.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),u.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...u)}function Gt(e){let{toaster:t}=e,[,n]=j(0);se(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=ka(t.config.position);se(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let u=document.createElement("style");return u.id=l,u.textContent=`
2
+ "use strict";var Pt=Object.defineProperty;var zs=Object.getOwnPropertyDescriptor;var As=Object.getOwnPropertyNames;var Ls=Object.prototype.hasOwnProperty;var Fs=(e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ns=(e,t)=>{for(var n in t)Pt(e,n,{get:t[n],enumerable:!0})},Ws=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of As(t))!Ls.call(e,i)&&i!==n&&Pt(e,i,{get:()=>t[i],enumerable:!(r=zs(t,i))||r.enumerable});return e};var Bs=e=>Ws(Pt({},"__esModule",{value:!0}),e);var Ve=(e,t,n)=>Fs(e,typeof t!="symbol"?t+"":t,n);var au={};Ns(au,{Accordion:()=>tr,Alert:()=>ho,AnalogClock:()=>to,AppContextProvider:()=>Xe,Avatar:()=>ro,Badge:()=>io,BarGraph:()=>Er,BigNumber:()=>Bi,BlochSphere:()=>Oi,BoxPlot:()=>Hi,Breadcrumb:()=>nr,BubbleChart:()=>Yi,Button:()=>Li,CalendarHeatMap:()=>ji,Card:()=>Oo,Carousel:()=>Zo,CartesianGraph2D:()=>zr,Checkbox:()=>wo,ChordDiagram:()=>Gi,ColorPicker:()=>Co,ColorWheel:()=>Mo,ComplexGraph2D:()=>Nr,ContextMenu:()=>Lt,DataGrid:()=>co,DatePicker:()=>Po,DecompositionTree:()=>Xi,DigitalClock:()=>uo,DiscreteCartesian2D:()=>Cs,DragDropProvider:()=>St,Drawer:()=>xr,Dropdown:()=>rr,EmptyState:()=>bo,FileUpload:()=>Io,FlexContainer:()=>Ho,FlexItem:()=>_o,Footer:()=>Kr,ForceGraph:()=>Ji,FormFieldWrapper:()=>we,FunnelChart:()=>es,GanttChart:()=>os,Gauge:()=>is,GoogleAnalytics:()=>qr,Grid:()=>Yo,GridItem:()=>Vo,HeatMap:()=>as,Histogram:()=>ls,HypercubeGraph:()=>jr,IDE:()=>Ot,Image:()=>Jo,LineGraph:()=>Hr,ListView:()=>po,LollipopChart:()=>cs,Matrix:()=>ds,Menubar:()=>sr,MessageBusProvider:()=>xt,Modal:()=>yr,MultilineField:()=>$o,NavWrapper:()=>Pe,NumberSpinner:()=>Do,Pagination:()=>lr,Panel:()=>jo,Partition:()=>us,PieGraph:()=>_r,PivotTable:()=>fs,PolarGraph2D:()=>Vr,Popover:()=>vr,ProgressBar:()=>xo,RadarChart:()=>gs,RadioGroup:()=>To,SankeyDiagram:()=>ms,ScrollContainer:()=>Xo,Select:()=>zo,Sidebar:()=>dr,Skeleton:()=>yo,Slider:()=>Ao,Spinner:()=>vo,Splitter:()=>qo,Stepper:()=>ur,Sunburst:()=>hs,Tabs:()=>Ko,Tag:()=>fo,TextEditor:()=>Lo,TextField:()=>Fo,ThreeDLayers:()=>Wi,TimePicker:()=>No,ToastContainer:()=>cn,Toggle:()=>Wo,Toolbar:()=>fr,Tooltip:()=>kr,TradingDashboard:()=>Yt,TreeMap:()=>xs,TreeNav:()=>hr,TreeNode:()=>rt,USStateMap:()=>ss,US_STATE_PATHS:()=>Et,UnityApp:()=>Ti,UnityDesktop:()=>Di,VectorField:()=>vs,VideoPlayer:()=>er,VirtualScroll:()=>go,VizWrapper:()=>Xr,WaterfallChart:()=>ws,WordCloud:()=>ks,WordProcessor:()=>Bt,applyGate:()=>Bn,blochToCartesian:()=>gt,buildInputStyle:()=>Be,buildNavItemStyle:()=>ot,buildRotationMatrix:()=>hn,cartesianToBloch:()=>jt,computeBoxStats:()=>Hn,computeMandelbrotGrid:()=>Fr,computeSlices:()=>fn,createToaster:()=>ln,describeArc:()=>pn,generateEdges:()=>mn,generateHypercube:()=>mt,generatePalette:()=>Wt,generateVertices:()=>gn,numRotationAngles:()=>ht,projectTo2D:()=>xn,transformVec:()=>bn,useAppId:()=>at,useBarGraphScales:()=>dn,useChannel:()=>yt,useDragDrop:()=>Qe,useDraggable:()=>vt,useDropZone:()=>wt,useHover:()=>Ce,useHypercube:()=>Gr,useLineGraphScales:()=>un,useMessageBus:()=>qe,useToast:()=>wr});module.exports=Bs(au);var It=Symbol.for("spec.element"),Os=Symbol.for("spec.fragment"),cu=Symbol.for("spec.portal"),Xn=Symbol.for("spec.provider"),qn=Symbol.for("spec.consumer"),Hs=Symbol.for("spec.forward_ref"),_s=Symbol.for("spec.memo"),Ys=Symbol.for("spec.lazy"),Vs=Symbol.for("spec.suspense"),Us=Symbol.for("spec.strict_mode"),js=Symbol.for("spec.profiler");function o(e,t,...n){let r=null,i=null,s={};if(t!=null){t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(i=t.ref);for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&a!=="key"&&a!=="ref"&&a!=="__proto__"&&a!=="constructor"&&a!=="prototype"&&(s[a]=t[a])}if(n.length===1?s.children=n[0]:n.length>1&&(s.children=n),typeof e=="function"&&e.defaultProps){let a=e.defaultProps;for(let l of Object.keys(a))l!=="__proto__"&&l!=="constructor"&&s[l]===void 0&&(s[l]=a[l])}return{$$typeof:It,type:e,props:s,key:r,ref:i}}function We(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Xn,_context:t},r={$$typeof:qn,_context:t};return t.Provider=n,t.Consumer=r,t}var tt=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};tt.prototype.isSpecComponent=!0;var $t=class extends tt{shouldComponentUpdate(t,n){return!Zn(this.props,t)||!Zn(this.state,n)}};$t.prototype.isPureSpecComponent=!0;function Zn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let a of n)if(!Object.prototype.hasOwnProperty.call(s,a)||!Object.is(i[a],s[a]))return!1;return!0}var Jn=null;function je(){if(Jn===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Jn}function G(e){return je().useState(e)}function re(e,t){return je().useEffect(e,t)}function Ae(e){return je().useContext(e)}function en(e,t,n){return je().useReducer(e,t,n)}function S(e,t){return je().useCallback(e,t)}function q(e,t){return je().useMemo(e,t)}function te(e){return je().useRef(e)}function xe(){return je().useId()}var nt=We({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Qn(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Xs={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""},qs=new Set;function Ks(){Xs={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""};for(let e of qs)e()}typeof window<"u"&&window.addEventListener("hashchange",Ks);var Up=We({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function eo(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 aa(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 He={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function to(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=G(eo(a));re(()=>{let I=setInterval(()=>{u(eo(a))},1e3);return()=>clearInterval(I)},[a]);let b=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),f=b%12*30+m*.5,g=m*6+c*.1,y=c*6,h=n/2,p=n/2,x=n/2-10,v=x-4,T=x-22,D=[];D.push(o("circle",{cx:String(h),cy:String(p),r:String(x),fill:He.face,stroke:He.border,"stroke-width":"3"}));for(let I=0;I<12;I++){let F=(I*30-90)*Math.PI/180,R=v-6;D.push(o("line",{x1:String(h+R*Math.cos(F)),y1:String(p+R*Math.sin(F)),x2:String(h+v*Math.cos(F)),y2:String(p+v*Math.sin(F)),stroke:He.border,"stroke-width":"2"}));let N=String(I===0?12:I);if(D.push(o("text",{x:String(h+T*Math.cos(F)),y:String(p+T*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:He.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},N)),t==="24h"){let A=x-38,k=String(I===0?0:I+12);D.push(o("text",{x:String(h+A*Math.cos(F)),y:String(p+A*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:He.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(I,M,F,R)=>{let N=(I-90)*Math.PI/180;return o("line",{x1:String(h),y1:String(p),x2:String(h+M*Math.cos(N)),y2:String(p+M*Math.sin(N)),stroke:R,"stroke-width":F,"stroke-linecap":"round"})};D.push(C(f,x*.5,"4",He.hand)),D.push(C(g,x*.75,"3",He.hand)),s&&D.push(C(y,x*.85,"1.5",He.second)),D.push(o("circle",{cx:String(h),cy:String(p),r:"4",fill:He.hand}));let L=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...D)];return r&&L.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:He.numbers}},aa(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var nn={xs:24,sm:32,md:40,lg:56,xl:80};function la(e){return e==null?nn.md:typeof e=="number"?e:nn[e]??nn.md}function ca(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 no=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function da(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return no[Math.abs(t)%no.length]}var oo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function ua(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 ro(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,b]=G(!1),m=la(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,f=a??da(r),g=`${Math.round(m*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${m}px`,height:`${m}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},h;if(t&&!u)h=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>b(!0)});else{let T=ca(r);h=o("span",{style:{fontSize:g,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},T)}let p=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":f},role:"img","aria-label":n??r??"avatar"},h);if(!l)return p;let x=Math.max(8,Math.round(m*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:oo[l]??oo.offline,border:"2px solid #fff",boxSizing:"border-box",...ua(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},p,o("span",{style:v,"aria-label":l}))}var pa={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"}},fa={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function io(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,b=r?{...fa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...pa[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}`}},m=u?o("span",{style:b,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return m??o("span",null);let c={...b,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 ga={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},so={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},on={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},ma="6px 8px",ha={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},ba={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},xa={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},Ze={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},ya={...Ze,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},ao={...Ze,opacity:"0.5",cursor:"default"},lo={cursor:"pointer",width:"16px",height:"16px"};function Sa(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function co(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:b,onSelectionChange:m,striped:c=!1,bordered:f=!1,compact:g=!1,stickyHeader:y=!1}=e,[h,p]=G(0),[x,v]=G(void 0),[T,D]=G("asc"),[C,P]=G([]),[L,I]=G({}),M=i??h,F=a??x,R=l??T,N=b??C,A=q(()=>{let J=Object.entries(L).filter(([,ae])=>ae.length>0);return J.length===0?n:n.filter(ae=>J.every(([de,le])=>String(ae[de]??"").toLowerCase().includes(le.toLowerCase())))},[n,L]),k=q(()=>{if(!F)return A;let J=[...A];return J.sort((ae,de)=>{let le=ae[F],ne=de[F];if(le==null&&ne==null)return 0;if(le==null)return 1;if(ne==null)return-1;if(typeof le=="number"&&typeof ne=="number")return R==="asc"?le-ne:ne-le;let fe=String(le),oe=String(ne),ie=fe.localeCompare(oe);return R==="asc"?ie:-ie}),J},[A,F,R]),w=k.length,$=r?Math.max(1,Math.ceil(w/r)):1,E=r?k.slice(M*r,(M+1)*r):k,W=S(J=>{s?s(J):p(J)},[s]),z=S(J=>{let ae=F===J&&R==="asc"?"desc":"asc";d?d(J,ae):(v(J),D(ae))},[F,R,d]),B=S(J=>{let ae=N.includes(J)?N.filter(de=>de!==J):[...N,J];m?m(ae):P(ae)},[N,m]),O=S(()=>{let J=E.map((le,ne)=>r?M*r+ne:ne),de=J.every(le=>N.includes(le))?N.filter(le=>!J.includes(le)):[...new Set([...N,...J])];m?m(de):P(de)},[E,N,r,M,m]),_=S((J,ae)=>{I(de=>({...de,[J]:ae})),W(0)},[W]),U=t.some(J=>J.filterable),X=g?ma:on.padding,ee=[];if(u){let J=E.map((de,le)=>r?M*r+le:le),ae=J.length>0&&J.every(de=>N.includes(de));ee.push(o("th",{key:"__select_all",style:{...so,padding:X,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:ae,onChange:O,style:lo,"aria-label":"Select all rows"})))}for(let J of t){let ae={...so,padding:X,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...f?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},de=[J.header];J.sortable&&de.push(o("span",{style:ha},Sa(J.key,F,R))),ee.push(o("th",{key:J.key,style:ae,onClick:J.sortable?()=>z(J.key):void 0,onKeyDown:J.sortable?le=>{let ne=le.key;(ne==="Enter"||ne===" ")&&(le.preventDefault(),z(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":F===J.key?R==="asc"?"ascending":"descending":void 0},...de))}let Z=null;if(U){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:X}}));for(let ae of t)J.push(o("th",{key:`filter_${ae.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},ae.filterable?o("input",{type:"text",placeholder:`Filter ${ae.header}...`,style:ba,value:L[ae.key]??"",onInput:de=>_(ae.key,de.target.value),"aria-label":`Filter by ${ae.header}`}):null));Z=o("tr",{key:"__filter_row"},...J)}let V=[];for(let J=0;J<E.length;J++){let ae=E[J],de=r?M*r+J:J,le=N.includes(de),ne={};c&&J%2===1&&(ne.backgroundColor="#f9fafb"),le&&(ne.backgroundColor="#eff6ff");let fe=[];u&&fe.push(o("td",{key:"__select",style:{padding:X,textAlign:"center",...on,...f?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:le,onChange:()=>B(de),style:lo,"aria-label":`Select row ${de+1}`})));for(let oe of t){let ie=ae[oe.key],ue=oe.render?oe.render(ie,ae):String(ie??"");fe.push(o("td",{key:oe.key,style:{...on,padding:X,...f?{border:"1px solid #e5e7eb"}:{}}},ue))}V.push(o("tr",{key:String(de),style:ne},...fe))}let j=null;if(r){let J=w===0?0:M*r+1,ae=Math.min((M+1)*r,w),de=[];de.push(o("button",{key:"prev",style:M===0?ao:Ze,onClick:M>0?()=>W(M-1):void 0,disabled:M===0,"aria-label":"Previous page"},"\u2190 Prev"));let le=7,ne=Math.max(0,M-Math.floor(le/2)),fe=Math.min($,ne+le);fe-ne<le&&(ne=Math.max(0,fe-le)),ne>0&&(de.push(o("button",{key:"p0",style:Ze,onClick:()=>W(0)},"1")),ne>1&&de.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let oe=ne;oe<fe;oe++)de.push(o("button",{key:`p${oe}`,style:oe===M?ya:Ze,onClick:oe!==M?()=>W(oe):void 0,"aria-current":oe===M?"page":void 0},String(oe+1)));fe<$&&(fe<$-1&&de.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),de.push(o("button",{key:`p${$-1}`,style:Ze,onClick:()=>W($-1)},String($)))),de.push(o("button",{key:"next",style:M>=$-1?ao:Ze,onClick:M<$-1?()=>W(M+1):void 0,disabled:M>=$-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:xa},o("span",null,`Showing ${J}\u2013${ae} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...de))}let H={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},Y={...ga,...f?{border:"1px solid #e5e7eb"}:{}},K=o("thead",null,o("tr",null,...ee),Z),Q=o("tbody",null,...V),se=o("table",{style:Y,role:"grid","aria-rowcount":String(w)},K,Q);return o("div",{style:H},se,j)}function Je(e){return e<10?`0${e}`:String(e)}function va(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 wa(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"?`${Je(e.getMonth()+1)}/${Je(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Je(e.getMonth()+1)}-${Je(e.getDate())}`}var ka={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"},Ca={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ma={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Ea={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function uo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=G(new Date);re(()=>{let p=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(p)},[]);let{hours:u,minutes:b,seconds:m}=va(l,s),c,f=null;t==="12h"?(f=u>=12?"PM":"AM",c=u%12||12):c=u;let g=`${Je(c)}:${Je(b)}`;i&&(g+=`:${Je(m)}`);let y=[g];f!=null&&y.push(o("span",{style:Ma},f));let h=[o("span",{style:Ca},...y)];return n&&h.push(o("span",{style:Ea},wa(l,r,s))),o("div",{style:ka,...a?{class:a}:{}},...h)}var Ra={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Pa={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Ia={borderBottom:"1px solid var(--color-border, #e5e7eb)"},$a={cursor:"pointer",transition:"background-color 0.15s ease"},Da={backgroundColor:"var(--color-bg-muted, #eff6ff)"},Ta={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Dt={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 po(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:b}=e;if(t.length===0)return o("div",null,u?o("div",{style:Dt},u):null,o("div",{style:Ta},d),b?o("div",{style:{...Dt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null);let m=[];for(let c=0;c<t.length;c++){let f=t[c],g=r(f,c),y=a===c,h=c===t.length-1,p={...Pa,...s?$a:{},...y?Da:{},...i&&!h?Ia:{}};m.push(o("li",{key:g,style:p,onClick:l?()=>l(c):void 0,onKeyDown:l?x=>{let v=x.key;(v==="Enter"||v===" ")&&(x.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(f,c)))}return o("div",null,u?o("div",{style:Dt},u):null,o("ul",{style:Ra,role:l?"listbox":"list"},...m),b?o("div",{style:{...Dt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null)}function za(e){return e??"#3b82f6"}function Aa(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 La={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 Fa(e,t,n,r,i){let s=La[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:Aa(e,.12),color:e,border:"none"};default:return a}}var Na={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 fo(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,b=za(n),m=Fa(b,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:Na,onClick:f=>{f.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:m,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?f=>{let g=f.key;(g==="Enter"||g===" ")&&(f.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var Wa={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function go(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=G(0),d=te(null),u=t.length*r,b=parseInt(s,10)||400,m=Math.ceil(b/r),c=Math.max(0,Math.floor(a/r)-i),f=Math.min(t.length,Math.floor(a/r)+m+i),g=S(h=>{let p=h.target;l(p.scrollTop)},[]),y=[];for(let h=c;h<f;h++)y.push(o("div",{key:String(h),style:{position:"absolute",top:`${h*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[h],h)));return o("div",{ref:d,style:{...Wa,height:s},onScroll:g},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var mo={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 ho(e){let[t,n]=G(!0),r=e.type??"info",i=e.variant??"subtle",s=mo[r]??mo.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 bo(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 xo(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=xe().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let f=typeof e.size=="number"?e.size:48,g=Math.max(2,Math.round(f/10)),y=(f-g)/2,h=2*Math.PI*y,p=e.indeterminate?h*.75:h-r/100*h,x=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"}},x?o("style",null,x):null,o("svg",{width:String(f),height:String(f),viewBox:`0 0 ${f} ${f}`,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(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(g)}),o("circle",{cx:String(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(g),"stroke-dasharray":String(h),"stroke-dashoffset":String(p),"stroke-linecap":"round",transform:`rotate(-90 ${f/2} ${f/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}}`:"",b=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",m={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=q(()=>{let f={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(f.position="absolute",f.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,f.backgroundColor=i):(f.width=`${r}%`,f.backgroundColor=i),e.animated&&!e.indeterminate&&(f.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${Ba(i)} 50%, ${i} 100%)`,f.backgroundSize="200% 100%",f.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),f},[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||b?o("style",null,u+b):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:m},o("div",{style:c})))}function Ba(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 yo(e){let t=e.variant??"text",n=e.animated!==!1,r=xe().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 b=u===l-1&&l>1;d.push(o("div",{key:String(u),style:rn({width:b?"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:rn({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:rn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function rn(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 Oa={sm:16,md:24,lg:40},So={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function vo(e){let t=typeof e.size=="number"?e.size:Oa[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=So[e.speed??"normal"]??So.normal,s=e.label??"Loading",l=xe().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,b=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,b),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 we(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 Be(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 Ha={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function wo(e){let t=xe().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,b=te(null);re(()=>{b.current&&(b.current.indeterminate=a)},[a]);let m=S(()=>{l||i(!r)},[l,r,i]),c=S(L=>{l||(L.key===" "||L.key==="Enter")&&(L.preventDefault(),i(!r))},[l,r,i]),f=Ha[u],g=`${f.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",h=r||a?"#3b82f6":"#ffffff",p={width:g,height:g,minWidth:g,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:h,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${f.icon}px`,lineHeight:"1",fontWeight:"700"},v=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,T={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},D=o("input",{ref:b,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}),C=o("div",{style:p},v),P=s?o("span",{style:{fontSize:f.fontSize,color:"#374151"}},s):null;return o(we,{error:d,htmlFor:n},o("div",{style:T,onClick:m,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},D,C,P))}var _a=["#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 ko(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function Tt(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 Co(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=_a,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[b,m]=G(!1),[c,f]=G(r),g=te(null);re(()=>{f(r)},[r]),re(()=>{let I=M=>{g.current&&!g.current.contains(M.target)&&m(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let y=S(I=>{d||i(Tt(I))},[d,i]),h=S(I=>{let M=I.target.value;f(M);let F=M.startsWith("#")?M:`#${M}`;ko(F)&&i(Tt(F))},[i]),p=S(()=>{ko(c.startsWith("#")?c:`#${c}`)||f(r)},[c,r]),x={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},v={display:"flex",alignItems:"center",gap:"8px"},T={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"},D={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(I=>{let M=Tt(I)===Tt(r);return o("div",{key:I,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:I,cursor:d?"not-allowed":"pointer",border:M?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(I),onKeyDown:R=>{let N=R.key;(N==="Enter"||N===" ")&&(R.preventDefault(),y(I))},role:"button",tabIndex:d?-1:0,title:I,"aria-label":`Select color ${I}`})}),P=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:h,onBlur:p,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,L=b?o("div",{style:T},o("div",{style:D},...C),P):null;return o(we,{label:u,disabled:d,htmlFor:n},o("div",{ref:g,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>m(!b),onKeyDown:d?void 0:I=>{let M=I.key;(M==="Enter"||M===" ")&&(I.preventDefault(),m(!b))},role:"button",tabIndex:d?-1:0,"aria-expanded":b?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:x}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),L))}function Mo(e){let t=xe().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,b]=G(r),m=te(null),c=S(((...h)=>{let x=h[0].target.value;b(x),i?.(x)}),[i]),f={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},g={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(we,{label:d,htmlFor:n},o("div",{style:f},o("div",{style:g},o("input",{id:n,ref:m,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 Eo=["January","February","March","April","May","June","July","August","September","October","November","December"],Ya=["Su","Mo","Tu","We","Th","Fr","Sa"];function sn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function Va(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 Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ua(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Po(e){let t=xe().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:b,error:m}=e,c=q(()=>sn(r),[r]),f=q(()=>sn(a),[a]),g=q(()=>sn(l),[l]),[y,h]=G(!1),[p,x]=G(()=>c?c.getFullYear():new Date().getFullYear()),[v,T]=G(()=>c?c.getMonth():new Date().getMonth()),D=te(null),C=q(()=>new Date,[]);re(()=>{let z=B=>{D.current&&!D.current.contains(B.target)&&h(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let P=S(()=>{T(z=>z===0?(x(B=>B-1),11):z-1)},[]),L=S(()=>{T(z=>z===11?(x(B=>B+1),0):z+1)},[]),I=S(z=>{let B=new Date(p,v,z);f&&B<f||g&&B>g||(i(Ua(B)),h(!1))},[p,v,i,f,g]),M=c?Va(c,s):"",F=q(()=>{let z=new Date(p,v,1).getDay(),B=new Date(p,v+1,0).getDate(),O=[],_=[];for(let U=0;U<z;U++)_.push(null);for(let U=1;U<=B;U++)_.push(U),_.length===7&&(O.push(_),_=[]);for(;_.length>0&&_.length<7;)_.push(null);return _.length&&O.push(_),O},[p,v]),R={...Be({},{focused:y,error:!!m}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},N={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"},A={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},k={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},w={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},$=Ya.map(z=>o("div",{key:z,style:{padding:"4px"}},z)),E=F.map((z,B)=>{let O=z.map((_,U)=>{if(_===null)return o("div",{key:`empty-${B}-${U}`,style:{padding:"4px"}});let X=new Date(p,v,_),ee=Ro(X,C),Z=c?Ro(X,c):!1,V=f&&X<f||g&&X>g,j={padding:"4px",textAlign:"center",cursor:V?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:ee?"700":"400",backgroundColor:Z?"#3b82f6":"transparent",color:Z?"#ffffff":V?"#d1d5db":ee?"#3b82f6":"#1f2937",border:ee&&!Z?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${_}`,style:j,onClick:V?void 0:()=>I(_),onKeyDown:V?void 0:H=>{let Y=H.key;(Y==="Enter"||Y===" ")&&(H.preventDefault(),I(_))},role:V?void 0:"button",tabIndex:V?void 0:0,"aria-label":`${Eo[v]} ${_}, ${p}`,"aria-disabled":V?"true":void 0},String(_))});return o("div",{key:`row-${B}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...O)}),W=y?o("div",{style:N},o("div",{style:A},o("button",{type:"button",style:k,onClick:P},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Eo[v]} ${p}`),o("button",{type:"button",style:k,onClick:L},"\u25B6")),o("div",{style:w},...$),...E):null;return o(we,{label:b,error:m,disabled:d,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},o("div",{id:n,style:R,onClick:d?void 0:()=>h(!y),onKeyDown:d?void 0:z=>{let B=z.key;(B==="Enter"||B===" ")&&(z.preventDefault(),h(!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 an(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 Io(e){let t=xe().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,[b,m]=G([]),[c,f]=G(!1),[g,y]=G(""),h=te(null),p=S(k=>{y("");let w=[];for(let E of k){if(a&&E.size>a){y(`File "${E.name}" exceeds maximum size of ${an(a)}`);continue}w.push(E)}let $=s?[...b,...w]:w.slice(0,1);m($),r($)},[b,s,a,r]),x=S(k=>{if(k.preventDefault(),k.stopPropagation(),f(!1),l)return;let w=k.dataTransfer;if(!w)return;let $=Array.from(w.files);p($)},[l,p]),v=S(k=>{k.preventDefault(),k.stopPropagation(),l||f(!0)},[l]),T=S(k=>{k.preventDefault(),k.stopPropagation(),f(!1)},[]),D=S(k=>{let w=k.target;w.files&&(p(Array.from(w.files)),w.value="")},[p]),C=S(k=>{let w=b.filter(($,E)=>E!==k);m(w),r(w)},[b,r]),P=S(()=>{l||h.current&&h.current.click()},[l]),L={border:`2px dashed ${c?"#3b82f6":g?"#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"},I={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},M={fontSize:"14px",color:"#374151",marginBottom:"4px"},F={fontSize:"12px",color:"#9ca3af"},R=o("input",{id:n,ref:h,type:"file",accept:i,multiple:s,onChange:D,disabled:l,style:{display:"none"},tabIndex:-1}),N=o("div",{style:L,onClick:P,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),P())},onDrop:x,onDragOver:v,onDragLeave:T,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:I},"\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: ${an(a)}`):null),A=b.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...b.map((k,w)=>{let $={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-${w}`,style:$},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},k.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},an(k.size))),o("button",{type:"button",style:E,onClick:W=>{W.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(we,{label:d,helpText:u,error:g||void 0,disabled:l,htmlFor:n},o("div",null,R,N,A))}function $o(e){let[t,n]=G(!1),[r,i]=G((e.value??e.defaultValue??"").length),s=xe().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...Be(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=S(c=>{let f=c.target,g=f.value;i(g.length),e.onChange&&e.onChange(g),e.autoResize&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)},[e.onChange,e.autoResize]),b=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}),m=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(we,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},b,m)}function Do(e){let t=xe().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:b,label:m,error:c}=e,[f,g]=G(!1),y=S(w=>{let $=w;return s!==void 0&&$<s&&($=s),a!==void 0&&$>a&&($=a),$},[s,a]),h=S(()=>{d||i(y(r+l))},[d,r,l,y,i]),p=S(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=S(w=>{let $=w.target.value;if($===""||$==="-")return;let E=parseFloat($);isNaN(E)||i(y(E))},[y,i]),v=S(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),h()):w.key==="ArrowDown"&&(w.preventDefault(),p()))},[d,h,p]),T=s===void 0||r>s,D=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":f?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...f&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},P=w=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:d||!w?"not-allowed":"pointer",color:d||!w?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),L={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"},I={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:P(T),onClick:p,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),F=u?o("span",{style:I},u):null,R=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:v,onFocus:()=>g(!0),onBlur:()=>g(!1),disabled:d,style:L,"aria-label":m||"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}),N=b?o("span",{style:I},b):null,A=o("button",{type:"button",style:P(D),onClick:h,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[M];return F&&k.push(F),k.push(R),N&&k.push(N),k.push(A),o(we,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function To(e){let t=xe().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:b}=e,m=S(y=>{d||s(y)},[d,s]),c=S(y=>{if(d)return;let h=r.filter(v=>!v.disabled);if(h.length===0)return;let p=h.findIndex(v=>v.value===i),x=p;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),x=p<h.length-1?p+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),x=p>0?p-1:h.length-1;else return;s(h[x].value)},[d,r,i,s]),f={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},g=r.map((y,h)=>{let p=y.value===i,x=d||!!y.disabled,v=`${n}-opt-${h}`,T={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":p?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},D={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:p?"scale(1)":"scale(0)"},C={display:"inline-flex",alignItems:"center",gap:"8px",cursor:x?"not-allowed":"pointer",opacity:x?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:v,style:C,onClick:x?void 0:P=>{P.preventDefault(),m(y.value)}},o("input",{type:"radio",id:v,name:a,value:y.value,checked:p,disabled:x,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:T},o("div",{style:D})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(we,{label:b,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:f,role:"radiogroup","aria-label":b,onKeyDown:c,tabIndex:d?-1:0},...g))}function zo(e){let t=xe().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:b=!1,error:m,label:c,helpText:f}=e,[g,y]=G(!1),[h,p]=G(""),[x,v]=G(-1),T=te(null),D=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=q(()=>{if(!l||!h)return r;let z=h.toLowerCase();return r.filter(B=>B.label.toLowerCase().includes(z))},[r,h,l]),P=q(()=>{let z={},B=[];for(let O of C)O.group?(z[O.group]||(z[O.group]=[]),z[O.group].push(O)):B.push(O);return{groups:z,ungrouped:B}},[C]),L=q(()=>D.length===0?"":D.map(B=>r.find(O=>O.value===B)).filter(Boolean).map(B=>B.label).join(", "),[D,r]);re(()=>{let z=B=>{let O=B.target;T.current&&!T.current.contains(O)&&(y(!1),p(""))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let I=S(z=>{if(d){let B=D.includes(z)?D.filter(O=>O!==z):[...D,z];s(B)}else s(z),y(!1),p("")},[d,D,s]),M=S(z=>{z.stopPropagation(),s(d?[]:"")},[d,s]),F=S(z=>{if(b)return;let B=z.key;if(!g&&(B==="Enter"||B===" "||B==="ArrowDown")){z.preventDefault(),y(!0),v(0);return}if(g){if(B==="Escape"){y(!1),p("");return}if(B==="ArrowDown")z.preventDefault(),v(O=>Math.min(O+1,C.length-1));else if(B==="ArrowUp")z.preventDefault(),v(O=>Math.max(O-1,0));else if(B==="Enter"&&x>=0&&x<C.length){z.preventDefault();let O=C[x];O.disabled||I(O.value)}}},[b,g,x,C,I]),R={...Be({},{focused:g,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:b?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},N={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"},A=(z,B)=>{let O=D.includes(z.value),_=B===x,U={padding:"8px 12px",cursor:z.disabled?"not-allowed":"pointer",backgroundColor:_?"#f3f4f6":O?"#eff6ff":"transparent",color:z.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:z.value,style:U,onClick:z.disabled?void 0:()=>I(z.value),onMouseEnter:()=>v(B),role:"option","aria-selected":O?"true":"false","aria-disabled":z.disabled?"true":void 0},d&&O?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,z.label)},k=()=>{let z=[],B=0,{groups:O,ungrouped:_}=P;for(let U of _)z.push(A(U,B++));for(let U of Object.keys(O)){z.push(o("div",{key:`group-${U}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},U));for(let X of O[U])z.push(A(X,B++))}return z.length===0&&z.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),z},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:g?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),$=o("div",{style:R,id:n,onClick:b?void 0:()=>{y(!g),v(-1)},onKeyDown:F,tabIndex:b?-1:0,role:"combobox","aria-expanded":g?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:L?"#1f2937":"#9ca3af"}},L||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&D.length>0?o("span",{onClick:M,onKeyDown:z=>{let B=z.key;(B==="Enter"||B===" ")&&(z.preventDefault(),z.stopPropagation(),M(z))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,w)),E=l&&g?o("input",{type:"text",value:h,onInput:z=>{p(z.target.value),v(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,W=g?o("div",{style:N,role:"listbox"},E,...k()):null;return o(we,{label:c,error:m,helpText:f,disabled:b,htmlFor:n},o("div",{ref:T,style:{position:"relative"}},$,W))}function Ao(e){let t=xe().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:b=!1,marks:m,range:c=!1,label:f,error:g}=e,y=te(null),h=te(i);h.current=i;let[p,x]=G(null),v=q(()=>{if(c&&Array.isArray(r))return r;let B=typeof r=="number"?r:0;return[B,B]},[r,c]),T=te(v);T.current=v;let D=B=>{let O=Math.round((B-s)/l)*l+s;return Math.max(s,Math.min(a,O))},C=B=>(B-s)/(a-s)*100,P=S(B=>{if(!y.current)return s;let O=y.current.getBoundingClientRect(),_=Math.max(0,Math.min(1,(B.clientX-O.left)/O.width));return D(s+_*(a-s))},[s,a,l]),L=S(B=>O=>{b||(O.preventDefault(),x(B))},[b]),I=S(B=>{if(b)return;let O=P(B);if(c){let _=Math.abs(O-v[0]),U=Math.abs(O-v[1]);_<=U?i([D(O),v[1]]):i([v[0],D(O)])}else i(D(O))},[b,P,c,v,i,s,a,l]);re(()=>{if(!p)return;let B=_=>{let U=P(_),X=T.current,ee=h.current;p==="single"?ee(D(U)):p==="start"?ee([Math.min(D(U),X[1]),X[1]]):p==="end"&&ee([X[0],Math.max(X[0],D(U))])},O=()=>x(null);return document.addEventListener("mousemove",B),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",O)}},[p,P,s,a,l]);let M=S(B=>{if(b)return;let O=0;if(B.key==="ArrowRight"||B.key==="ArrowUp")O=l;else if(B.key==="ArrowLeft"||B.key==="ArrowDown")O=-l;else return;B.preventDefault(),c||i(D((typeof r=="number"?r:0)+O))},[b,l,c,r,i,s,a]),F={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:b?"not-allowed":"pointer"},R=c?C(v[0]):0,N=C(c?v[1]:v[0]),A={position:"absolute",top:"0",left:`${R}%`,width:`${N-R}%`,height:"100%",backgroundColor:b?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=B=>f?B==="start"?`${f} minimum`:B==="end"?`${f} maximum`:f:B==="start"?"Minimum value":B==="end"?"Maximum value":"Value",w=(B,O,_)=>{let U={position:"absolute",top:"50%",left:`${B}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${b?"#9ca3af":"#3b82f6"}`,cursor:b?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},X={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:O==="single"||O==="start"?n:void 0,style:U,onMouseDown:L(O),role:"slider","aria-valuenow":String(_),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(O),tabIndex:b?-1:0,onKeyDown:M},d?o("div",{style:X},String(_)):null)},$=[];if(u)for(let B=s;B<=a;B+=l)$.push(o("div",{key:`tick-${B}`,style:{position:"absolute",top:"10px",left:`${C(B)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let E=[];if(m)for(let B of m)E.push(o("div",{key:`mark-${B.value}`,style:{position:"absolute",top:"18px",left:`${C(B.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},B.label));let W={paddingTop:d?"28px":"8px",paddingBottom:m||u?"28px":"8px",opacity:b?"0.6":"1"},z=[];return c?(z.push(w(C(v[0]),"start",v[0])),z.push(w(C(v[1]),"end",v[1]))):z.push(w(C(v[0]),"single",v[0])),o(we,{label:f,error:g,htmlFor:n},o("div",{style:W},o("div",{ref:y,style:F,role:"presentation",onClick:I},o("div",{style:A}),...z,...$,...E)))}var ja=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Ga={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 Lo(e){let[t,n]=G(!1),r=te(null),i=xe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??ja,l=e.toolbarStyle??{},d=e.editorStyle??{};re(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=S((g,y)=>{if(!(e.disabled||e.readOnly)){if(g==="createLink"){let h=prompt("Enter URL:");if(!h)return;document.execCommand(g,!1,h)}else y&&g==="formatBlock"?document.execCommand(g,!1,`<${y}>`):document.execCommand(g,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),b=S(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=S(()=>{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(g=>{let y=Ga[g];return y?o("button",{key:g,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:g==="bold"?"700":g==="italic"?"400":"500",fontStyle:g==="italic"?"italic":"normal",textDecoration:g==="underline"?"underline":g==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),f=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:m,onInput:b});return o(we,{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,f))}function Fo(e){let[t,n]=G(!1),r=xe().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Be(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 b=u.target.value;e.onInput&&e.onInput(b),e.onChange&&e.onChange(b)},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(we,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Xa=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Ge(e){return String(e).padStart(2,"0")}function qa(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 No(e){let t=xe().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:b=!1,timezone:m,showTimezone:c=!1,timezones:f=Xa,onTimezoneChange:g}=e,[y,h]=G(!1),p=q(()=>qa(r),[r]),x=s==="12h",v=p.hour>=12,T=x?p.hour%12||12:p.hour,D=S((j,H,Y)=>{let K=Math.max(0,Math.min(23,j)),Q=Math.max(0,Math.min(59,H)),se=Math.max(0,Math.min(59,Y??0));i(b?`${Ge(K)}:${Ge(Q)}:${Ge(se)}`:`${Ge(K)}:${Ge(Q)}`)},[i,b]),C=S(j=>{let H=parseInt(j.target.value,10)||0;x&&(H=H%12,v&&(H+=12)),D(H,p.minute,p.second)},[x,v,p.minute,p.second,D]),P=S(j=>{let H=parseInt(j.target.value,10)||0;D(p.hour,H,p.second)},[p.hour,p.second,D]),L=S(j=>{let H=parseInt(j.target.value,10)||0;D(p.hour,p.minute,H)},[p.hour,p.minute,D]),I=S(()=>{if(l)return;let j=v?p.hour-12:p.hour+12;D(j,p.minute,p.second)},[l,v,p.hour,p.minute,p.second,D]),M=S(j=>{l||D(p.hour+j,p.minute,p.second)},[l,p.hour,p.minute,p.second,D]),F=S(j=>{l||D(p.hour,p.minute+j*a,p.second)},[l,p.hour,p.minute,p.second,a,D]),R=S(j=>{l||D(p.hour,p.minute,p.second+j)},[l,p.hour,p.minute,p.second,D]),N=S(j=>{let H=j.target.value;g&&g(H)},[g]),A={display:"inline-flex",alignItems:"center",gap:"4px",...Be({},{focused:y,error:!!u})},k={display:"flex",flexDirection:"column",alignItems:"center"},w={background:"none",border:"none",cursor:l?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},$={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:k},o("button",{type:"button",style:w,onClick:()=>M(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ge(T),onChange:C,style:$,disabled:l,"aria-label":"Hour",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>M(-1),disabled:l},"\u25BC")),z=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),B=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>F(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ge(p.minute),onChange:P,style:$,disabled:l,"aria-label":"Minute",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>F(-1),disabled:l},"\u25BC")),O=b?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,_=b?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>R(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ge(p.second),onChange:L,style:$,disabled:l,"aria-label":"Second",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>R(-1),disabled:l},"\u25BC")):null,U=x?o("button",{type:"button",style:E,onClick:I,disabled:l,"aria-label":"Toggle AM/PM"},v?"PM":"AM"):null,X={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=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,Z=c?o("select",{style:X,value:m??f[0],onChange:N,disabled:l,"aria-label":"Timezone"},...f.map(j=>o("option",{key:j,value:j},j))):null,V=[W,z,B];return O&&V.push(O),_&&V.push(_),U&&V.push(U),ee&&V.push(ee),Z&&V.push(Z),o(we,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:A},...V))}var Ka={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 Wo(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=Ka[a],b=S(()=>{s||n(!t)},[s,t,n]),m=S(v=>{s||(v.key===" "||v.key==="Enter")&&(v.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"},f=t?u.trackW-u.thumbSize-u.offset:u.offset,g={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${f}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"},h=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,p=o("div",{style:c},o("div",{style:g}));return o("div",{style:y,onClick:b,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[h,p]:[p,h]).filter(Boolean))}var Bo={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 Oo(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=q(()=>{let b={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(b.border="1px solid #e5e7eb"),b.boxShadow=Bo[n]??Bo.sm,e.hoverable&&(b.cursor="pointer"),{...b,...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 Ho(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 _o(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 Yo(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 Vo(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 Uo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function jo(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=G(!!e.defaultCollapsed),s=te(null),[a,l]=G("auto");re(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=S(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=S(y=>{if(!e.collapsible)return;let h=y.key;(h==="Enter"||h===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),b=q(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Uo[n]??Uo.none,{...y,...e.style??{}}},[t,n,e.style]),m={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"},f={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},g={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:b},o("div",{className:"panel__header",style:m,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?f:{},ref:s},o("div",{className:"panel__body",style:g},e.children)))}function Go(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function Za(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 Xo(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=te(null),[s,a]=G(!0),[l,d]=G(!1),[u,b]=G(!0),[m,c]=G(!1),f=S(()=>{let x=i.current;if(!x)return;let v=2;a(x.scrollTop<=v),d(x.scrollTop+x.clientHeight>=x.scrollHeight-v),b(x.scrollLeft<=v),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-v)},[]);re(()=>{f()},[f]);let g=S(()=>{r&&f()},[r,f]),y=q(()=>{let x={position:"relative",overflowX:Go(t,"x"),overflowY:Go(t,"y"),...Za(n)};return e.maxHeight&&(x.maxHeight=e.maxHeight),e.maxWidth&&(x.maxWidth=e.maxWidth),e.padding&&(x.padding=e.padding),{...x,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),h=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&h.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&h.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&h.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!m&&h.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let p={...y};return h.length>0&&(p.boxShadow=h.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:p,ref:i,onScroll:g},e.children)}function qo(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=G(e.initialSplit??50),l=te(null),d=te(!1),u=S(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);re(()=>{let y=p=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,T=n?p.clientX-x.left:p.clientY-x.top;if(v<=0)return;let D=i/v*100,C=e.maxSize?e.maxSize/v*100:100-D,P=T/v*100;P=Math.max(D,Math.min(C,P)),a(P)},h=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",h),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",h)}},[n,i,e.maxSize]);let b=q(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=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"},f={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%"}},g=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:b,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},g[0]??null),o("div",{className:"splitter__divider",style:f,onMouseDown:u,onKeyDown:y=>{let h=y.key,p=2;n&&(h==="ArrowLeft"||h==="ArrowRight")?(y.preventDefault(),a(x=>{let v=h==="ArrowRight"?p:-p;return Math.max(5,Math.min(95,x+v))})):!n&&(h==="ArrowUp"||h==="ArrowDown")&&(y.preventDefault(),a(x=>{let v=h==="ArrowDown"?p:-p;return Math.max(5,Math.min(95,x+v))}))},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},g[1]??null))}function Ko(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(p=>!p.disabled)?.id??"",[i,s]=G(e.activeTab??r),a=e.activeTab??i,l=te(null),d=S(p=>{s(p),e.onChange&&e.onChange(p)},[e.onChange]),u=S(p=>{let x=e.tabs.filter(L=>!L.disabled),v=x.findIndex(L=>L.id===a);if(v===-1)return;let T=t==="left"||t==="right",D=T?"ArrowUp":"ArrowLeft",C=T?"ArrowDown":"ArrowRight",P=-1;if(p.key===D?P=v>0?v-1:x.length-1:p.key===C?P=v<x.length-1?v+1:0:p.key==="Home"?P=0:p.key==="End"&&(P=x.length-1),P>=0){p.preventDefault(),d(x[P].id);let L=l.current;if(L){let M=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[P])];M&&M.focus()}}},[e.tabs,a,t,d]),b=t==="left"||t==="right",m=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:b?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[b,m,e.style]),f={display:"flex",flexDirection:b?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!b?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&b?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},g={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(p=>p.id===a),h=e.tabs.map(p=>{let x=p.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:p.disabled?"not-allowed":"pointer",opacity:p.disabled?"0.5":"1",fontSize:"14px",fontWeight:x?"600":"400",color:x?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?b?t==="left"?(v.borderRight=x?"2px solid #3b82f6":"2px solid transparent",v.marginRight="-2px"):(v.borderLeft=x?"2px solid #3b82f6":"2px solid transparent",v.marginLeft="-2px"):(v.borderBottom=x?"2px solid #3b82f6":"2px solid transparent",v.marginBottom="-2px"):n==="card"?(v.backgroundColor=x?"#ffffff":"transparent",v.borderRadius="6px 6px 0 0",x&&(v.border="1px solid #e5e7eb",v.borderBottom="1px solid #ffffff")):n==="pill"&&(v.borderRadius="9999px",v.backgroundColor=x?"#3b82f6":"transparent",v.color=x?"#ffffff":"#6b7280"),o("button",{key:p.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${p.id}`,"aria-disabled":p.disabled?"true":void 0,id:`tab-${p.id}`,tabIndex:x?"0":"-1",style:v,onClick:p.disabled?void 0:()=>d(p.id),onKeyDown:u},p.icon?o("span",{className:"tabs__tab-icon"},p.icon):null,p.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":b?"vertical":"horizontal",style:f,ref:l},...h),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:g,tabIndex:"0"},y?y.content:null))}function Zo(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=xe().replace(/[^a-zA-Z0-9_-]/g,""),[u,b]=G(0),m=te(null),c=te(null),f=S(C=>{let P=C;r?P=(C%n+n)%n:P=Math.max(0,Math.min(C,n-1)),b(P),e.onChange&&e.onChange(P)},[n,r,e.onChange]),g=S(()=>f(u+1),[u,f]),y=S(()=>f(u-1),[u,f]);re(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(g,l);return()=>clearInterval(C)},[e.autoPlay,l,g,n]),re(()=>{let C=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&g()},P=c.current;if(P)return P.addEventListener("keydown",C),()=>P.removeEventListener("keydown",C)},[g,y]);let h=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",p={position:"relative",overflow:"hidden",width:"100%",outline:"none"},x=q(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),v={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)"},T=t.map((C,P)=>{let L=a==="fade"?{position:P===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:P===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(P),style:L},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),D=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,P)=>o("button",{key:String(P),"aria-label":`Go to slide ${P+1}`,onclick:()=>f(P),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:P===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:p,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let P=C.clientX-m.current;P>50?y():P<-50&&g(),m.current=null}},h?o("style",null,h):null,o("div",{style:x},...T),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...v,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:g,style:{...v,right:"8px"}},"\u203A"):null,D)}function Jo(e){let[t,n]=G("loading"),r=te(null),i=xe().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;re(()=>{n("loading")},[e.src]);let d=q(()=>{let f={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(f.width=a),l&&(f.height=l),e.borderRadius&&(f.borderRadius=e.borderRadius),f},[a,l,e.borderRadius]),u=q(()=>{let f={display:"block",width:"100%",height:"100%"};return e.objectFit&&(f.objectFit=e.objectFit),t==="loading"&&(f.opacity="0",f.position="absolute"),t==="error"&&(f.display="none"),f},[e.objectFit,t]),b=null;if(t==="loading")if(e.placeholder==="skeleton"){let f=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;b=o("div",null,o("style",null,f),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"?b=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(b=e.placeholder);let m=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?m=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):m=e.fallback);let c=o("div",{style:d},b,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),m);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 Qo(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 er(e){let t=e.controls!==!1,n=te(null),r=xe().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=G(!1),[a,l]=G(0),[d,u]=G(0),[b,m]=G(e.muted?0:1),[c,f]=G(!!e.muted),[g,y]=G(!0),h=typeof e.width=="number"?`${e.width}px`:e.width??"100%",p=typeof e.height=="number"?`${e.height}px`:e.height??"auto";re(()=>{let I=n.current;if(!I)return;let M=()=>{s(!0),e.onPlay&&e.onPlay()},F=()=>{s(!1),e.onPause&&e.onPause()},R=()=>{s(!1),e.onEnded&&e.onEnded()},N=()=>{l(I.currentTime),u(I.duration),e.onTimeUpdate&&e.onTimeUpdate(I.currentTime,I.duration)},A=()=>{u(I.duration)};return I.addEventListener("play",M),I.addEventListener("pause",F),I.addEventListener("ended",R),I.addEventListener("timeupdate",N),I.addEventListener("loadedmetadata",A),()=>{I.removeEventListener("play",M),I.removeEventListener("pause",F),I.removeEventListener("ended",R),I.removeEventListener("timeupdate",N),I.removeEventListener("loadedmetadata",A)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let x=S(()=>{let I=n.current;I&&(I.paused?I.play():I.pause())},[]),v=S(I=>{let M=n.current;if(!M||!isFinite(M.duration))return;let F=I.currentTarget.getBoundingClientRect(),R=Math.max(0,Math.min(1,(I.clientX-F.left)/F.width));M.currentTime=R*M.duration},[]),T=S(I=>{let M=n.current,F=parseFloat(I.target.value);M&&(M.volume=F,M.muted=F===0,m(F),f(F===0))},[]),D=S(()=>{let I=n.current;I&&I.requestFullscreen&&I.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:h,height:p,display:"block"}});let C=d>0?a/d*100:0,P={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},L=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:g?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:x,style:P},i?"\u23F8":"\u25B6"),o("div",{onclick:v,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${Qo(a)} / ${Qo(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:b),oninput:T,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:D,style:P},"\u26F6"));return o("div",{style:{position:"relative",width:h,height:p,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:x,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function Pe(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=te(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=S(d=>{if(!r)return;let u=d,b=s.current;if(!b)return;let m=Array.from(b.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let f=t==="vertical",g=f?"ArrowDown":"ArrowRight",y=f?"ArrowUp":"ArrowLeft";if(u.key===g){u.preventDefault();let h=m[c+1];h&&h.focus()}else if(u.key===y){u.preventDefault();let h=m[c-1];h&&h.focus()}else u.key==="Home"?(u.preventDefault(),m[0]?.focus()):u.key==="End"&&(u.preventDefault(),m[m.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 ot(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 Ce(){let[e,t]=G(!1);return{hover:e,onMouseEnter:S(()=>t(!0),[]),onMouseLeave:S(()=>t(!1),[])}}function Ja(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:b}=Ce(),m=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:m?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:m?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:m?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let f=S(v=>{let T=v;m||(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),r())},[m,r]),g=S(()=>{m||r()},[m,r]),h=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),p=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,x=l==="left"?[h,p]:[p,h];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":m?"true":void 0,"data-section-id":t.id,tabIndex:m?-1:0,style:c,onClick:g,onKeyDown:f,onMouseEnter:u,onMouseLeave:b},...x)}function Qa(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 tr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:b=!0,onChange:m}=e,[c,f]=G(()=>n??[]),g=S(h=>{f(p=>{let x=p.includes(h),v;return x?v=p.filter(T=>T!==h):r?v=[...p,h]:v=[h],m&&m(v),v})},[r,m]),y=q(()=>t.map(h=>{let p=c.includes(h.id),x=o(Ja,{key:`header-${h.id}`,section:h,expanded:p,onToggle:()=>g(h.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(Qa,{key:`content-${h.id}`,section:h,expanded:p,contentStyle:s,animated:b});return o("div",{key:h.id,"data-accordion-section":h.id,style:{width:"100%"}},x,v)}),[t,c,i,s,l,d,u,b,g]);return o(Pe,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var el={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function nr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=G(!1),l=el[i],d=S(()=>{a(!0)},[]),u=t,b=!1;if(r&&r>1&&t.length>r&&!s){b=!0;let g=1,y=r-1;u=[...t.slice(0,g),{label:"..."},...t.slice(t.length-y)]}let m=g=>typeof g=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},g):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},g),c=(g,y,h)=>{let p=y===h.length-1,x=b&&g.label==="..."&&y===1,v=[];return y>0&&v.push(m(n)),x?v.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"},"...")):p?v.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},g.label)):g.href?v.push(o("a",{href:g.href,onClick:g.onClick?T=>{T.preventDefault(),g.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},g.label)):g.onClick?v.push(o("button",{type:"button",onClick:g.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},g.label)):v.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},g.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...v)},f=u.map((g,y)=>c(g,y,u));return o(Pe,{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"}},...f))}function or(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Ce(),[d,u]=G(!1),b=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let m=t.disabled===!0,f={...ot(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},g=S(()=>{if(!m){if(b){u(T=>!T);return}t.onClick&&t.onClick(),r&&i()}},[m,b,t,r,i]),y=S(()=>{a(),b&&u(!0)},[b,a]),h=S(()=>{l(),b&&u(!1)},[b,l]),p=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)),x=b?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,v=b&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(Pe,{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(T=>o(or,{key:T.id,item:T,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:h},o("button",{type:"button",role:"menuitem",style:f,onClick:g,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":b||void 0,"aria-expanded":b?String(d):void 0},p,x),v)}function rr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,b]=G(!1),m=te(null),c=S(()=>{b(T=>!T)},[]),f=S(()=>{b(!1)},[]);re(()=>{if(!u)return;let T=D=>{let C=m.current;C&&!C.contains(D.target)&&b(!1)};return document.addEventListener("click",T,!0),()=>{document.removeEventListener("click",T,!0)}},[u]),re(()=>{if(!u)return;let T=D=>{D.key==="Escape"&&b(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[u]);let g={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:g,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")),h=typeof d=="number"?`${d}px`:d,p={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},x={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:h,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:p},o(Pe,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(T=>o(or,{key:T.id,item:T,itemStyle:s,closeOnSelect:l,onClose:f})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,v)}function ir(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ce(),[l,d]=G(!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 b=t.disabled===!0,m=S(()=>{if(!b){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[b,u,t,n]),c=S(()=>{s(),u&&d(!0)},[u,s]),f=S(()=>{a(),u&&d(!1)},[u,a]),g={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:b?"default":"pointer",backgroundColor:!b&&i?"#f3f4f6":"transparent",color:b?"#9ca3af":"#1f2937",opacity:b?"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)),h=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,p=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((x,v)=>o(ir,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:f},o("button",{type:"button",role:"menuitem",style:g,onClick:m,disabled:b||void 0,tabIndex:-1,"aria-disabled":b||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,h),p)}function tl(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Ce(),b=te(null),m=S(()=>{r?a():s(n)},[r,n,s,a]),c=S(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),f={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"},g=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,h)=>o(ir,{key:String(h),item:y,onClose:a,index:h})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:b,type:"button",role:"menuitem",style:f,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),g)}function sr(e){let{menus:t}=e,[n,r]=G(null),i=te(null),s=S(d=>{r(d)},[]),a=S(()=>{r(null)},[]);re(()=>{if(n===null)return;let d=u=>{let b=i.current;b&&!b.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),re(()=>{let d=i.current;if(!d)return;let u=b=>{let m=b;if(m.key==="Escape"){r(null);return}if(m.key==="ArrowRight"){m.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(m.key==="ArrowLeft"){m.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(m.key==="ArrowDown"&&n!==null){m.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let f=c.querySelector('[role="menuitem"]');f&&f.focus()}return}m.key==="Enter"||m.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(tl,{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 zt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function nl(e,t,n){let r=n*2+5;if(e<=r)return zt(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?[...zt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...zt(e-n*2-2,e)]:[1,"ellipsis",...zt(i,s),"ellipsis",e]}var At={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"},ol={...At,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},ar={...At,color:"#9ca3af",cursor:"default",opacity:"0.5"},rl={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function lr(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)),b=Math.min(Math.max(1,r),u),m=S(h=>{!d&&h>=1&&h<=u&&h!==b&&i(h)},[d,u,b,i]),c=(h,p,x)=>{let v=d||p<1||p>u||p===b;return o("button",{type:"button",onClick:()=>m(p),disabled:v||void 0,"aria-label":x,style:v?ar:At},h)},f=nl(u,b,s),g=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",b-1,"Go to previous page"));for(let h of f)if(h==="ellipsis")y.push(o("span",{key:`ellipsis-${g++}`,style:rl},"..."));else{let p=h===b;y.push(o("button",{key:String(h),type:"button",onClick:()=>m(h),disabled:d||void 0,"aria-label":`Page ${h}`,"aria-current":p?"page":void 0,style:d?ar:p?ol:At},String(h)))}return l&&y.push(c("\u203A",b+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(Pe,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function cr(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Ce(),[u,b]=G(!1),m=t.children&&t.children.length>0,c=t.id===r,f=S(()=>{m&&!n&&b(P=>!P),i&&i(t.id)},[m,n,i,t.id]),g=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${g}`,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"},h=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,p=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),x=!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,v=!n&&m?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,T=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,D=o("button",{type:"button",style:y,onClick:f,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},h,p,x,v,T),C=!n&&m&&u?t.children.map(P=>o(cr,{key:P.id,item:P,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},D,C?o("div",{role:"group"},...C):null)}function dr(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,b=t.map(m=>o(cr,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(Pe,{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,...b)}var Le={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 ur(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,b=S(h=>{s&&i&&i(h)},[s,i]),m=h=>h<n?"completed":h===n?"active":"pending",c=(h,p,x)=>{let v=a==="dot"?u:d,T={width:`${v}px`,height:`${v}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 x==="completed"?o("div",{style:{...T,backgroundColor:Le.completedBg,color:Le.completedText,border:`2px solid ${Le.completed}`}},a==="circle"?p.icon||"\u2713":null):x==="active"?o("div",{style:{...T,backgroundColor:"#ffffff",color:Le.activeText,border:`2px solid ${Le.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?p.icon||String(h+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Le.active}})):o("div",{style:{...T,backgroundColor:"#ffffff",color:Le.pendingText,border:`2px solid ${Le.pending}`}},a==="circle"?p.icon||String(h+1):null)},f=h=>{if(h>=t.length-1)return null;let x=h<n?Le.lineCompleted:Le.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:x,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:x,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},g=(h,p)=>{let x=m(p),v=x==="active",T=x==="completed",D=c(p,h,x),C={fontSize:"13px",fontWeight:v?"600":"400",color:v||T?Le.labelActive:Le.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},P={fontSize:"11px",color:Le.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},L=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:C},h.label),h.description?o("span",{style:P},h.description):null),I=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},D,L):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},D,L);return o(s?"button":"div",{key:String(p),onClick:s?()=>b(p):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":v?"step":void 0},I)},y=[];return t.forEach((h,p)=>{y.push(g(h,p));let x=f(p);x&&y.push(x)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var pr={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 il(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ce(),l=pr[n],d=t.disabled===!0,u=t.type==="toggle",[b,m]=G(!1),c=u?t.active===!0:b,f=S(()=>{!d&&t.onClick&&t.onClick()},[d,t]),g=S(()=>{!d&&!u&&m(!0)},[d,u]),y=S(()=>{u||m(!1)},[u]),h=S(()=>{a(),u||m(!1)},[u,a]),p={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"},x=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,v=t.label?o("span",null,t.label):null,T=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:p,onClick:f,onMouseDown:g,onMouseUp:y,onMouseEnter:s,onMouseLeave:h,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},x,v,T)}function fr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=pr[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(il,{key:a.id,item:a,size:n,variant:r}));return o(Pe,{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 rt=class e{constructor(t,n){Ve(this,"id");Ve(this,"label");Ve(this,"children");Ve(this,"expanded");Ve(this,"icon");Ve(this,"metadata");Ve(this,"parent");Ve(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 gr(e){e.expanded=!0;for(let t of e.children)gr(t)}function mr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)mr(n,t);return t}function sl(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function al(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:b,onClick:m,focusedId:c}=e,f=Ce(),g=te(null),y=c===t.id;re(()=>{y&&g.current&&g.current.focus()},[y]);let h=t.isLeaf(),p=t.depth,x=[];for(let P=0;P<p;P++){let L=t;for(let M=0;M<p-P;M++)L=L?L.parent:null;let I=L?!sl(L):!1;x.push(o("span",{key:`connector-${P}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...I?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=p>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,T=h?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:P=>{P.stopPropagation(),b(t)}},t.expanded?a:l),D=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),C=ot(d,{hover:f.hover,active:n});return o("div",{ref:g,role:"treeitem","aria-expanded":h?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":p+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:f.onMouseEnter,onMouseLeave:f.onMouseLeave,onClick:()=>m(t)},...x,v,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},T,D))}function hr(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:b="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:f,renderNode:g}=e,[y,h]=G(()=>{let I=rt.fromData(t);return a&&gr(I),I}),[p,x]=G(t.id),v=q(()=>mr(y),[y]),T=S(()=>{h(I=>{let M=Object.create(Object.getPrototypeOf(I));return Object.assign(M,I),M})},[]),D=S(I=>{I.toggle(),I.expanded?r?.(I):i?.(I),T()},[r,i,T]),C=S(I=>{x(I.id),n?.(I)},[n]),P=S(I=>{let M=I;if(!p)return;let F=v.findIndex(N=>N.id===p);if(F===-1)return;let R=v[F];switch(M.key){case"ArrowDown":{M.preventDefault();let N=v[F+1];N&&x(N.id);break}case"ArrowUp":{M.preventDefault();let N=v[F-1];N&&x(N.id);break}case"ArrowRight":{M.preventDefault(),R.isLeaf()||(R.expanded?R.children.length>0&&x(R.children[0].id):D(R));break}case"ArrowLeft":{M.preventDefault(),!R.isLeaf()&&R.expanded?D(R):R.parent&&x(R.parent.id);break}case"Enter":{M.preventDefault(),C(R);break}case" ":{M.preventDefault(),R.isLeaf()||D(R);break}case"Home":{M.preventDefault(),v.length>0&&x(v[0].id);break}case"End":{M.preventDefault(),v.length>0&&x(v[v.length-1].id);break}}},[p,v,D,C]),L=v.map(I=>o(al,{key:I.id,node:I,isSelected:I.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:b,iconCollapsed:m,nodeStyle:c,renderNode:g,onToggle:D,onClick:C,focusedId:p}));return o(Pe,{role:"tree",ariaLabel:"Tree navigation",styling:f,keyboardNav:!1},o("div",{onKeyDown:P,style:{outline:"none"}},...L))}function br(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=G(-1),[l,d]=G(null),u=te(null);re(()=>{if(!u.current)return;u.current.focus();let c=g=>{let y=g,h=t.map((p,x)=>({item:p,i:x})).filter(({item:p})=>!p.divider);if(y.key==="ArrowDown")y.preventDefault(),a(p=>{let v=(h.findIndex(({i:T})=>T===p)+1)%h.length;return h[v].i});else if(y.key==="ArrowUp")y.preventDefault(),a(p=>{let x=h.findIndex(({i:T})=>T===p),v=x<=0?h.length-1:x-1;return h[v].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 p=t[s];p.children?d(s):!p.disabled&&p.onClick&&(p.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let f=u.current;return()=>f.removeEventListener("keydown",c)},[t,s,i,r]);let b={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"},m=t.map((c,f)=>{if(c.divider)return o("div",{key:`divider-${f}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let g=s===f,y=!!c.disabled,h=!!(c.children&&c.children.length>0),p={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:g&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(f),d(h?f:null)},v=()=>{if(!y){if(h){d(f);return}c.onClick&&c.onClick(),r()}},T=[];c.icon&&T.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),T.push(o("span",{style:{flex:"1"}},c.label??"")),h&&T.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let D=[o("div",{key:`item-${f}`,style:p,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":y?"true":void 0},...T)];return h&&l===f&&D.push(o(br,{key:`submenu-${f}`,items:c.children,position:{x:n.x+178,y:n.y+f*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${f}`,style:{position:"relative"}},...D)});return o("div",{ref:u,style:b,tabIndex:-1,role:"menu"},...m)}function Lt(e){let{items:t,children:n}=e,[r,i]=G(null),s=S(u=>{u.preventDefault();let b=u;i({x:b.clientX,y:b.clientY})},[]),a=S(()=>{i(null)},[]);re(()=>{if(!r)return;let u=m=>{a()},b=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(b),document.removeEventListener("mousedown",u)}},[r,a]),re(()=>{if(!r)return;let u=b=>{b.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(br,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function ll(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 cl(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 xr(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,[b,m]=G(!1),[c,f]=G(!1),g=te(null),y=s?"drawer-title":void 0;if(re(()=>{if(t)m(!0),requestAnimationFrame(()=>f(!0));else{f(!1);let I=setTimeout(()=>m(!1),300);return()=>clearTimeout(I)}},[t]),re(()=>{if(!t||!d)return;let I=M=>{M.key==="Escape"&&n()};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,d,n]),re(()=>{if(!t)return;let I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[t]),re(()=>{t&&g.current&&g.current.focus()},[t]),!b)return null;let h={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"},p={...cl(r,i),transform:ll(r,c),transition:"transform 0.3s ease"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},v={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},T={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},D={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},P=[];s&&P.push(o("div",{style:x},o("h3",{id:y,style:v},s),o("button",{type:"button",style:T,onClick:n,"aria-label":"Close drawer"},"\xD7"))),P.push(o("div",{style:D},u));let L=[];return a&&L.push(o("div",{style:h,onClick:C})),L.push(o("div",{ref:g,style:p,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...P)),o("div",null,...L)}var dl={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function yr(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,b=te(null);if(re(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),re(()=>{if(!t||!a)return;let C=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),re(()=>{t&&b.current&&b.current.focus()},[t]),!t)return null;let m={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:dl[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},f={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},g={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"},h={padding:"24px",overflow:"auto",flex:"1"},p={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=C=>{s&&C.target===C.currentTarget&&n()},v=[],T=r?"modal-title":void 0;r?v.push(o("h2",{id:T,style:g},r)):v.push(o("span",null)),d&&v.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let D=[o("div",{style:f},...v),o("div",{style:h},u)];return l&&D.push(o("div",{style:p},l)),o("div",{style:m,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":T},o("div",{ref:b,style:c,tabIndex:-1,role:"document"},...D))}var Sr=8;function ul(e,t){let n=t+Sr;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 pl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Sr}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 vr(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,[b,m]=G(!1),c=u?r:b,f=te(null),g=S(()=>{u?d&&d(!r):m(T=>!T)},[u,r,d]);re(()=>{if(!c||!l)return;let T=D=>{f.current&&!f.current.contains(D.target)&&(u?d&&d(!1):m(!1))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},h={...ul(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"},p=[n];a&&p.push(o("div",{style:pl(i)}));let x=S(T=>{let D=T.key;(D==="Enter"||D===" ")&&(T.preventDefault(),g())},[g]),v=[o("div",{onClick:g,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&v.push(o("div",{style:h},...p)),o("div",{ref:f,style:y},...v)}var fl=0;function gl(){return`toast-${++fl}-${Date.now()}`}function ln(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 b=gl();return n=[{id:b,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),b}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 ml={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 hl(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 bl(e){let{item:t,onDismiss:n}=e,r=ml[t.type];re(()=>{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 cn(e){let{toaster:t}=e,[,n]=G(0);re(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=hl(t.config.position);re(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let d=document.createElement("style");return d.id=l,d.textContent=`
3
3
  @keyframes specifyjs-toast-slide-in {
4
4
  from { opacity: 0; transform: translateY(-12px); }
5
5
  to { opacity: 1; transform: translateY(0); }
6
6
  }
7
- `,document.head.appendChild(u),()=>{let d=document.getElementById(l);d&&d.remove()}},[]);let s=k(l=>t.dismiss(l),[t]),a=r.map(l=>o(Ca,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function Jo(e={}){let t=oe(null);t.current||(t.current=Yt(e));let n=t.current,r=k(()=>o(Gt,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Ma=6,Pa=8;function Ea(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Pa;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 Ra(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Ma}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 Qo(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=j(!1),[u,d]=j(null),x=oe(null),m=oe(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,p=k(()=>{m.current=setTimeout(()=>{if(x.current){let b=x.current.getBoundingClientRect();d(Ea(b,n))}l(!0)},r)},[r,n]),f=k(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);se(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},h={...u??{},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"},g=[o("div",{ref:x,style:y,onMouseEnter:p,onMouseLeave:f,onFocus:p,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&u&&g.push(o("div",{id:c,style:h,role:"tooltip"},t,o("div",{style:Ra(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...g)}function Ut(e,t,n,r,i){return X(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:u=>t===0?0:u/t*n,categoryScale:u=>i+u*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function $a(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 Ia(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 za(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 er=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function tr(e,t){return t||er[e%er.length]}function nr(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:u=!0,showGrid:d=!0,gridColor:x="#e5e7eb",title:m,padding:c=50,animate:p=!1,stacked:f,grouped:y=!1}=e,h=i==="vertical",g=n-c*2,b=r-c*2,S=h?b:g,A=h?g:b,T=f!==void 0&&f.length>0,M=X(()=>T?za(f):[],[T,f]),D=T?f.length:t.length,L=X(()=>$a(t,f,y),[t,f,y]),I=L>0?L:1,P=Ut(D,I,S,A,a),F=k(()=>{if(!d)return[];let O=Ia(I),G=[];for(let q=O;q<=I;q+=O){let te=P.valueScale(q);if(h){let Z=c+b-te;G.push(o("line",{key:`grid-${q}`,x1:String(c),y1:String(Z),x2:String(c+g),y2:String(Z),stroke:x,"stroke-width":"1","stroke-dasharray":"4 2"})),G.push(o("text",{key:`grid-label-${q}`,x:String(c-6),y:String(Z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(q)))}else{let Z=c+te;G.push(o("line",{key:`grid-${q}`,x1:String(Z),y1:String(c),x2:String(Z),y2:String(c+b),stroke:x,"stroke-width":"1","stroke-dasharray":"4 2"})),G.push(o("text",{key:`grid-label-${q}`,x:String(Z),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(q)))}}return G},[d,I,P,h,c,g,b,x]),R=k(()=>{let O=[];return h?(O.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"})),O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+g),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"}))):(O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+g),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),O.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"}))),O},[h,c,g,b]),W=k(()=>{let O=[];for(let G=0;G<t.length;G++){let q=t[G],te=P.valueScale(q.value),Z=P.categoryScale(G),Y=q.color??s,U,V,_=String(q.value);if(h){let K=c+Z,Q=c+b-te;U={x:String(K),y:String(Q),width:String(P.barThickness),height:String(te),rx:String(l),ry:String(l),fill:Y},V={x:String(K+P.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let K=c+Z,Q=c;U={x:String(Q),y:String(K),width:String(te),height:String(P.barThickness),rx:String(l),ry:String(l),fill:Y},V={x:String(Q+te+6),y:String(K+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(p&&(U.style=h?`animation: barGrow 0.6s ease-out ${G*.05}s both`:`animation: barGrow 0.6s ease-out ${G*.05}s both`),O.push(o("rect",{key:`bar-${G}`,...U})),u&&O.push(o("text",{key:`val-${G}`,...V},_)),h){let K=c+Z+P.barThickness/2,Q=c+b+16;O.push(o("text",{key:`cat-${G}`,x:String(K),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${K}, ${Q})`},q.label))}else O.push(o("text",{key:`cat-${G}`,x:String(c-6),y:String(c+Z+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},q.label))}return O},[t,P,s,l,u,p,h,c,b]),z=k(()=>{if(!f)return[];let O=[];for(let G=0;G<f.length;G++){let q=f[G],te=P.categoryScale(G),Z=0;for(let Y=0;Y<q.values.length;Y++){let U=q.values[Y],V=P.valueScale(U.value),_=P.valueScale(Z),K=tr(Y,U.color);if(h){let Q=c+te,ie=c+b-_-V;O.push(o("rect",{key:`sbar-${G}-${Y}`,x:String(Q),y:String(ie),width:String(P.barThickness),height:String(V),rx:Y===q.values.length-1?String(l):"0",ry:Y===q.values.length-1?String(l):"0",fill:K,...p?{style:`animation: barGrow 0.6s ease-out ${(G*q.values.length+Y)*.03}s both`}:{}})),u&&V>14&&O.push(o("text",{key:`sval-${G}-${Y}`,x:String(Q+P.barThickness/2),y:String(ie+V/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(U.value)))}else{let Q=c+_,ie=c+te;O.push(o("rect",{key:`sbar-${G}-${Y}`,x:String(Q),y:String(ie),width:String(V),height:String(P.barThickness),rx:Y===q.values.length-1?String(l):"0",ry:Y===q.values.length-1?String(l):"0",fill:K,...p?{style:`animation: barGrow 0.6s ease-out ${(G*q.values.length+Y)*.03}s both`}:{}})),u&&V>20&&O.push(o("text",{key:`sval-${G}-${Y}`,x:String(Q+V/2),y:String(ie+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(U.value)))}Z+=U.value}if(u){let Y=P.valueScale(Z);h?O.push(o("text",{key:`stotal-${G}`,x:String(c+te+P.barThickness/2),y:String(c+b-Y-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z))):O.push(o("text",{key:`stotal-${G}`,x:String(c+Y+6),y:String(c+te+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z)))}if(h){let Y=c+te+P.barThickness/2,U=c+b+16;O.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})`},q.label))}else O.push(o("text",{key:`scat-${G}`,x:String(c-6),y:String(c+te+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},q.label))}return O},[f,P,l,u,p,h,c,b]),w=k(()=>{if(!f)return[];let O=M.length,G=[];for(let q=0;q<f.length;q++){let te=f[q],Z=P.categoryScale(q),Y=2,U=Math.max(1,(P.barThickness-Y*(O-1))/O);for(let V=0;V<te.values.length;V++){let _=te.values[V],K=M.indexOf(_.category),Q=K*(U+Y),ie=P.valueScale(_.value),J=tr(K>=0?K:V,_.color);if(h){let re=c+Z+Q,ae=c+b-ie;G.push(o("rect",{key:`gbar-${q}-${V}`,x:String(re),y:String(ae),width:String(U),height:String(ie),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(q*O+V)*.04}s both`}:{}})),u&&G.push(o("text",{key:`gval-${q}-${V}`,x:String(re+U/2),y:String(ae-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(_.value)))}else{let re=c,ae=c+Z+Q;G.push(o("rect",{key:`gbar-${q}-${V}`,x:String(re),y:String(ae),width:String(ie),height:String(U),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(q*O+V)*.04}s both`}:{}})),u&&G.push(o("text",{key:`gval-${q}-${V}`,x:String(re+ie+4),y:String(ae+U/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(_.value)))}}if(h){let V=c+Z+P.barThickness/2,_=c+b+16;G.push(o("text",{key:`gcat-${q}`,x:String(V),y:String(_),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${V}, ${_})`},te.label))}else G.push(o("text",{key:`gcat-${q}`,x:String(c-6),y:String(c+Z+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},te.label))}return G},[f,M,P,l,u,p,h,c,b]),v=k(()=>m?[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"},m)]:[],[m,n,c]),E=k(()=>p?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},h?"@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; } }"))]:[],[p,h]),C=F(),N=R(),$=v(),B=E(),H;return T&&y?H=w():T?H=z():H=W(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...B,...$,...C,...N,...H)}function Ue(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 yt(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 St(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let u=Math.min(s+n,t.length);for(let d=s;d<u;d++){let x=t[d],m=e(x);isFinite(m)&&a.push({input:x,output:m})}if(s=u,s>=t.length){r(a,!0);return}r(a,!1),or(l)};return or(l),()=>{i=!0}}function or(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Ta(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 rr(e,t){let n=t-e;if(n<=0)return[e];let r=Ta(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 ir(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var pe=40,sr=1.1,ar=.01,lr=1e6;function cr(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:u=[-5,5],yRange:d=[-5,5],showGrid:x=!0,showAxes:m=!0,pointRadius:c=3,pointColor:p="#3b82f6",curveColor:f="#3b82f6",gridColor:y="#e2e8f0",axisColor:h="#94a3b8",onPointClick:g,onPointDoubleClick:b,onPointContextMenu:S,onPointHover:A}=e,[T,M]=j(u[0]),[D,L]=j(u[1]),[I,P]=j(d[0]),[F,R]=j(d[1]),W=oe(!1),z=oe(null),w=k(_=>pe+(_-T)/(D-T)*(t-2*pe),[T,D,t]),v=k(_=>n-pe-(_-I)/(F-I)*(n-2*pe),[I,F,n]),E=k(_=>T+(_-pe)/(t-2*pe)*(D-T),[T,D,t]),C=k(_=>I+(n-pe-_)/(n-2*pe)*(F-I),[I,F,n]),N=k(_=>{let K=_;W.current=!0,z.current={mx:K.clientX,my:K.clientY,x0:T,x1:D,y0:I,y1:F}},[T,D,I,F]),$=k(_=>{if(!W.current||!z.current)return;let K=_,Q=z.current,ie=K.clientX-Q.mx,J=K.clientY-Q.my,re=ie/(t-2*pe)*(Q.x1-Q.x0),ae=J/(n-2*pe)*(Q.y1-Q.y0);M(Q.x0-re),L(Q.x1-re),P(Q.y0+ae),R(Q.y1+ae)},[t,n]),B=k(()=>{W.current=!1,z.current=null},[]),H=k(_=>{let K=_;K.preventDefault();let Q=K.currentTarget.getBoundingClientRect(),ie=K.clientX-Q.left,J=K.clientY-Q.top,re=E(ie),ae=C(J),ne=K.deltaY>0?sr:1/sr,ee=(D-T)*ne,le=(F-I)*ne;if(ee<ar||le<ar||ee>lr||le>lr)return;let ue=(re-T)/(D-T),ce=(ae-I)/(F-I);M(re-ue*ee),L(re+(1-ue)*ee),P(ae-ce*le),R(ae+(1-ce)*le)},[T,D,I,F,E,C]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),x){let _=rr(T,D),K=rr(I,F);for(let Q=0;Q<_.length;Q++){let ie=w(_[Q]);O.push(o("line",{x1:ie,y1:pe,x2:ie,y2:n-pe,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),O.push(o("text",{x:ie,y:n-pe+14,"text-anchor":"end","font-size":10,fill:h,transform:`rotate(-45, ${ie}, ${n-pe+14})`,key:`lx-${Q}`},ir(_[Q])))}for(let Q=0;Q<K.length;Q++){let ie=v(K[Q]);O.push(o("line",{x1:pe,y1:ie,x2:t-pe,y2:ie,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),O.push(o("text",{x:pe-6,y:ie+3,"text-anchor":"end","font-size":10,fill:h,key:`ly-${Q}`},ir(K[Q])))}}if(m){let _=Math.max(pe,Math.min(t-pe,w(0))),K=Math.max(pe,Math.min(n-pe,v(0)));O.push(o("line",{x1:pe,y1:K,x2:t-pe,y2:K,stroke:h,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:_,y1:pe,x2:_,y2:n-pe,stroke:h,"stroke-width":1,key:"y-axis"}))}let G=X(()=>{if(!i||!l)return[];let _=a??(D-T)/s,K=Ue({start:T,end:D,step:_});return yt(i,K)},[i,T,D,a,s,l]),[q,te]=j([]),Z=oe(null);se(()=>{if(!i||l){te([]);return}let _=a??(D-T)/s,K=Ue({start:T,end:D,step:_});return Z.current&&Z.current(),Z.current=St(i,K,200,Q=>{te([...Q])}),()=>{Z.current&&Z.current()}},[i,T,D,a,s,l]);let Y=l?G:q;if(Y.length>0){let _=[];for(let K=0;K<Y.length;K++){let Q=Y[K],ie=w(Q.input),J=v(Q.output);_.push(`${_.length===0?"M":"L"}${ie},${J}`)}O.push(o("path",{d:_.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let U=(_,K,Q,ie)=>{if(K)return J=>K({x:ie.x,y:ie.y,index:Q,event:J})};for(let _=0;_<r.length;_++){let K=r[_],Q=w(K.x),ie=v(K.y),J={cx:Q,cy:ie,r:c,fill:p,cursor:"pointer",key:`pt-${_}`};g&&(J.onClick=U("click",g,_,K)),b&&(J.onDblClick=U("dblclick",b,_,K)),S&&(J.onContextMenu=U("contextmenu",S,_,K)),A&&(J.onMouseOver=U("mouseover",A,_,K)),O.push(o("circle",J))}let V=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:pe,y:pe,width:t-2*pe,height:n-2*pe})));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:N,onMouseMove:$,onMouseUp:B,onMouseLeave:B,onWheel:H},V,...O)}function dr(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 ur(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,u=l*(1-Math.abs(i/60%2-1)),d=a-l/2,x=0,m=0,c=0;return i<60?(x=l,m=u):i<120?(x=u,m=l):i<180?(m=l,c=u):i<240?(m=u,c=l):i<300?(x=u,c=l):(x=l,c=u),[Math.floor((x+d)*255),Math.floor((m+d)*255),Math.floor((c+d)*255)]}function fr(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=dr){let a=[];for(let l=0;l<t;l++){let u=[],d=r[1]-l/t*(r[1]-r[0]);for(let x=0;x<e;x++){let m=n[0]+x/e*(n[1]-n[0]);u.push(s(m,d,i))}a.push(u)}return a}function pr(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=dr,data:u,resolution:d=2,onPointClick:x,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:p}=e;if(u){let C=u.length,N=C>0?u[0].length:0,$=N>0?t/N:1,B=C>0?n/C:1,H=[];for(let O=0;O<C;O++){let G=u[O];for(let q=0;q<N;q++){let te=G[q]??0,[Z,Y,U]=ur(te,s,a);H.push(o("rect",{key:`${O}-${q}`,x:String(q*$),y:String(O*B),width:String(Math.ceil($)),height:String(Math.ceil(B)),fill:`rgb(${Z},${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%"}},...H)}let[f,y]=j(r[0]),[h,g]=j(r[1]),[b,S]=j(i[0]),[A,T]=j(i[1]),M=oe(null),D=oe(!1),L=oe(null),I=k((C,N)=>{let $=f+C/t*(h-f),B=A-N/n*(A-b);return{re:$,im:B}},[f,h,b,A,t,n]);se(()=>{let C=M.current;if(!C)return;let N=C.getContext("2d");if(!N)return;let $=N.createImageData(t,n),B=$.data;for(let H=0;H<n;H++)for(let O=0;O<t;O++){let{re:G,im:q}=I(O,H),te=l(G,q,s),[Z,Y,U]=ur(te,s,a),V=(H*t+O)*4;B[V]=Z,B[V+1]=Y,B[V+2]=U,B[V+3]=255}N.putImageData($,0,0)},[f,h,b,A,t,n,s,a,l,I]);let P=k(C=>{let N=C.target.getBoundingClientRect(),$=C.clientX-N.left,B=C.clientY-N.top,{re:H,im:O}=I($,B),G=l(H,O,s);return{re:H,im:O,iterations:G,event:C}},[I,l,s]),F=k(C=>{D.current=!0,L.current={x:C.clientX,y:C.clientY,rMin:f,rMax:h,iMin:b,iMax:A}},[f,h,b,A]),R=k(C=>{if(m&&m(P(C)),!D.current||!L.current)return;let N=L.current,$=C.clientX-N.x,B=C.clientY-N.y,H=(N.rMax-N.rMin)/t,O=(N.iMax-N.iMin)/n;y(N.rMin-$*H),g(N.rMax-$*H),S(N.iMin+B*O),T(N.iMax+B*O)},[t,n,m,P]),W=k(()=>{D.current=!1},[]),z=k(C=>{C.preventDefault();let N=C.deltaY>0?1.15:1/1.15,$=C.target.getBoundingClientRect(),B=C.clientX-$.left,H=C.clientY-$.top,{re:O,im:G}=I(B,H);y(O+(f-O)*N),g(O+(h-O)*N),S(G+(b-G)*N),T(G+(A-G)*N)},[I,f,h,b,A]),w=k(C=>{x&&x(P(C))},[x,P]),v=k(C=>{c&&c(P(C))},[c,P]),E=k(C=>{C.preventDefault(),p&&p(P(C))},[p,P]);return o("canvas",{ref:M,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:F,onMouseMove:R,onMouseUp:W,onMouseLeave:W,onWheel:z,onClick:w,onDblClick:v,onContextMenu:E})}function gr(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 Da(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 u=t-r*2,d=n-r*2,x=y=>r+(y-i)/(s-i)*u,m=y=>n-r-(y-a)/(l-a)*d,c=6,p=gr(i,s,c),f=gr(a,l,c);return{xScale:x,yScale:m,xTicks:p,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function jt(e,t,n,r){return X(()=>Da(e,t,n,r),[e,t,n,r])}function mr(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function hr(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 u=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...l,points:u})}case"triangle":{let u=r*1.15,d=`${t},${n-u} ${t+r},${n+r*.6} ${t-r},${n+r*.6}`;return o("polygon",{...l,points:d})}case"triangle-down":{let u=r*1.15,d=`${t-r},${n-r*.6} ${t+r},${n-r*.6} ${t},${n+u}`;return o("polygon",{...l,points:d})}case"cross":{let u=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(u*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 u=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(u*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 br(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:u="circle",showPoints:d=!0,showGrid:x=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:p,yLabel:f,title:y,padding:h=50,animate:g=!1,multiLine:b}=e,S=X(()=>{let F=[...t];if(b)for(let R of b)F.push(...R.data);return F},[t,b]),A=jt(S,n,r,h),{xScale:T,yScale:M,xTicks:D,yTicks:L}=A,I=[];if(I.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),x){for(let F=0;F<D.length;F++){let R=T(D[F]);I.push(o("line",{x1:R,y1:h,x2:R,y2:r-h,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${F}`}))}for(let F=0;F<L.length;F++){let R=M(L[F]);I.push(o("line",{x1:h,y1:R,x2:n-h,y2:R,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${F}`}))}}I.push(o("line",{x1:h,y1:r-h,x2:n-h,y2:r-h,stroke:"#374151","stroke-width":1,key:"x-axis"})),I.push(o("line",{x1:h,y1:h,x2:h,y2:r-h,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let F=0;F<D.length;F++){let R=T(D[F]);I.push(o("line",{x1:R,y1:r-h,x2:R,y2:r-h+5,stroke:"#374151",key:`xtick-${F}`})),I.push(o("text",{x:R,y:r-h+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${R}, ${r-h+18})`,key:`xlabel-${F}`},mr(D[F])))}for(let F=0;F<L.length;F++){let R=M(L[F]);I.push(o("line",{x1:h-5,y1:R,x2:h,y2:R,stroke:"#374151",key:`ytick-${F}`})),I.push(o("text",{x:h-10,y:R+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${F}`},mr(L[F])))}function P(F,R,W,z,w,v,E,C,N,$){if(F.length===0)return;let B=[...F].sort((G,q)=>G.x-q.x);if(z){let G=M(A.yMin),q=B.map(U=>`${T(U.x)},${M(U.y)}`).join(" "),te=T(B[0].x),Z=T(B[B.length-1].x),Y=`${te},${G} ${q} ${Z},${G}`;I.push(o("polygon",{points:Y,fill:w,key:`${$}-area`}))}let O={points:B.map(G=>`${T(G.x)},${M(G.y)}`).join(" "),fill:"none",stroke:R,"stroke-width":W,"stroke-linejoin":"round","stroke-linecap":"round",key:`${$}-line`};if(g?(O["stroke-dasharray"]="1000",O["stroke-dashoffset"]="1000",I.push(o("polyline",O,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):I.push(o("polyline",O)),v)for(let G=0;G<B.length;G++){let q=T(B[G].x),te=M(B[G].y),Z=B[G].shape??N,Y=B[G].radius??C,U=`${$}-pt-${G}`;if(g){let V=hr(Z,q,te,Y,E,U,{opacity:0});I.push(o("g",{key:`${U}-g`},V,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else I.push(hr(Z,q,te,Y,E,U))}}if(P(t,i,s,m,c,d,l,a,u,"primary"),b)for(let F=0;F<b.length;F++){let R=b[F];P(R.data,R.color,s,!1,"transparent",d,R.color,R.pointRadius??a,R.pointShape??u,`series-${F}`)}if(b&&b.length>0){let F=[],R=[{color:i,label:"Primary"},...b.map((H,O)=>({color:H.color,label:H.label??`Series ${O+1}`}))],W=h+10,z=16,w=22,v=7.2,E=14,C=6,N=n-h*2-20,$=0,B=0;for(let H=0;H<R.length;H++){let O=R[H].label.length*v,G=E+C+O;$>0&&$+G>N&&($=0,B+=w);let q=W+$,te=h-30-B;F.push(o("rect",{x:q,y:te,width:E,height:14,fill:R[H].color,rx:2,key:`legend-rect-${H}`})),F.push(o("text",{x:q+E+C,y:te+12,"font-size":12,fill:"#374151",key:`legend-text-${H}`},R[H].label)),$+=G+z}I.push(o("g",{key:"legend"},...F))}return p&&I.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},p)),f&&I.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"},f)),y&&I.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"},...I)}function Aa(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 La(e,t){let n=t??Aa(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function je(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Xt(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,u=je(e,t,r,a),d=je(e,t,r,l),x=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${x} 1 ${d.x} ${d.y}`,"Z"].join(" ");let m=je(e,t,n,l),c=je(e,t,n,a);return[`M ${u.x} ${u.y}`,`A ${r} ${r} 0 ${x} 1 ${d.x} ${d.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${x} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function qt(e,t){let n=t?.padAngle??0,r=La(e,t?.colors),i=e.reduce((d,x)=>d+x.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],u=0;for(let d=0;d<e.length;d++){let x=e[d],m=x.value/i*a,c=u+n/2,p=c+m;l.push({label:x.label,value:x.value,startAngle:c,endAngle:p,percentage:x.value/i*100,color:r[d]}),u=p+n/2}return l}function xr(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:u=!0,legendPosition:d="right",title:x,centerLabel:m,colors:c,strokeColor:p="#fff",strokeWidth:f=2,textColor:y="currentColor"}=e,h=u&&d==="right"?140:0,g=x?30:0,b=u&&d==="bottom"?Math.ceil(t.length/2)*22+10:0,S=n-h,A=r-g-b,T=S/2,M=g+A/2,D=Math.min(S,A)/2-10,L=e.outerRadius??D,I=X(()=>qt(t,{padAngle:s,colors:c}),[t,s,c]),P=[];x&&P.push(o("text",{key:"title",x:S/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},x));for(let F=0;F<I.length;F++){let R=I[F],W=Xt(T,M,i,L,R.startAngle,R.endAngle);if(P.push(o("path",{key:`slice-${F}`,d:W,fill:R.color,stroke:p,strokeWidth:f})),a||l){let z=(R.startAngle+R.endAngle)/2,w=R.percentage<5,v=w?L+14:i+(L-i)*.65,E=je(T,M,v,z-Math.PI/2),C=w?y:"#fff",N=w?11:12,$=[];if(a&&$.push(R.label),l&&$.push(`${R.percentage.toFixed(1)}%`),w){let B=je(T,M,L+2,z-Math.PI/2);P.push(o("line",{key:`connector-${F}`,x1:B.x,y1:B.y,x2:E.x,y2:E.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${F}`,x:E.x,y:E.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N,fill:C,pointerEvents:"none"},R.label)),l&&P.push(o("text",{key:`value-${F}`,x:E.x,y:E.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N-1,fill:C,pointerEvents:"none"},`${R.percentage.toFixed(1)}%`))}}if(m&&i>0&&P.push(o("text",{key:"center-label",x:T,y:M,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},m)),u){let F=[];if(d==="right"){let R=S+10,W=g+20;for(let z=0;z<I.length;z++){let w=I[z],v=W+z*22;F.push(o("circle",{key:`legend-dot-${z}`,cx:R+6,cy:v,r:6,fill:w.color})),F.push(o("text",{key:`legend-text-${z}`,x:R+18,y:v,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${w.label} (${w.percentage.toFixed(1)}%)`))}}else{let R=r-b+10;for(let W=0;W<I.length;W++){let z=I[W],w=W%2,v=Math.floor(W/2),E=w*(n/2)+10,C=R+v*22;F.push(o("circle",{key:`legend-dot-${W}`,cx:E+6,cy:C,r:6,fill:z.color})),F.push(o("text",{key:`legend-text-${W}`,x:E+18,y:C,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${z.label} (${z.percentage.toFixed(1)}%)`))}}P.push(...F)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function yr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Sr(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:u=[],showGrid:d=!0,pointRadius:x=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:p,onPointDoubleClick:f,onPointContextMenu:y,onPointHover:h}=e,[g,b]=j(r[1]),[S,A]=j(0),[T,M]=j(0),[D,L]=j(null),I=t/2+S,P=n/2+T,R=Math.min(t,n)/2-30,W=R/g,z=X(()=>{let Y=Math.max(1,Math.ceil(g)),U=[],V=g/Y;for(let _=1;_<=Y;_++)U.push(V*_);return U},[g]),w=X(()=>{let Y=[];for(let U=0;U<360;U+=30)Y.push(U*Math.PI/180);return Y},[]),v=X(()=>{if(!i||!l)return[];let Y=a??2*Math.PI/s,U=Ue({start:0,end:2*Math.PI,step:Y});return yt(i,U)},[i,s,a,l]),[E,C]=j([]),N=oe(null);se(()=>{if(!i||l){C([]);return}let Y=a??2*Math.PI/s,U=Ue({start:0,end:2*Math.PI,step:Y});return N.current&&N.current(),N.current=St(i,U,200,V=>{C([...V])}),()=>{N.current&&N.current()}},[i,s,a,l]);let $=l?v:E,B=X(()=>{if($.length===0)return"";let Y=[];for(let U=0;U<$.length;U++){let V=$[U],_=V.output;if(_<0||!isFinite(_))continue;let{x:K,y:Q}=yr(_,V.input,I,P,W);Y.push(`${Y.length===0?"M":"L"}${K.toFixed(2)},${Q.toFixed(2)}`)}return Y.join(" ")},[$,I,P,W]),H=k(Y=>{L({x:Y.clientX,y:Y.clientY,px:S,py:T})},[S,T]),O=k(Y=>{D&&(A(D.px+(Y.clientX-D.x)),M(D.py+(Y.clientY-D.y)))},[D]),G=k(()=>{L(null)},[]),q=k(Y=>{Y.preventDefault();let U=Y.deltaY>0?1.15:1/1.15;b(Math.max(.1,g*U))},[g]),te=k((Y,U,V)=>{if(Y)return _=>Y({r:U.r,theta:U.theta,index:V,event:_})},[]),Z=[];if(Z.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),d){for(let Y=0;Y<z.length;Y++){let U=z[Y]*W;Z.push(o("circle",{cx:I,cy:P,r:U,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${Y}`})),Z.push(o("text",{x:I+U+2,y:P-4,"font-size":10,fill:"#9ca3af",key:`gl-${Y}`},z[Y].toFixed(1)))}for(let Y=0;Y<w.length;Y++){let U=w[Y],V=z[z.length-1]*W,_=I+V*Math.cos(U),K=P-V*Math.sin(U);Z.push(o("line",{x1:I,y1:P,x2:_,y2:K,stroke:"#e5e7eb","stroke-width":1,key:`al-${Y}`}));let Q=Math.round(U*180/Math.PI),ie=I+(V+14)*Math.cos(U),J=P-(V+14)*Math.sin(U);Z.push(o("text",{x:ie,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${Y}`},`${Q}\xB0`))}}Z.push(o("line",{x1:I-R,y1:P,x2:I+R,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),Z.push(o("line",{x1:I,y1:P-R,x2:I,y2:P+R,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),B&&Z.push(o("path",{d:B,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let Y=0;Y<u.length;Y++){let U=u[Y],{x:V,y:_}=yr(U.r,U.theta,I,P,W);Z.push(o("circle",{cx:V,cy:_,r:x,fill:m,key:`pt-${Y}`,style:{cursor:"pointer"},onClick:te(p,U,Y),onDblClick:te(f,U,Y),onContextMenu:te(y,U,Y),onMouseEnter:te(h,U,Y)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:D?"grabbing":"grab"},onMouseDown:H,onMouseMove:O,onMouseUp:G,onMouseLeave:G,onWheel:q},...Z)}function Kt(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 Zt(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 Jt(e,t){let n=vr(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=Wa(n,Fa(e,i,s,a))}r++}return n}function vr(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 Fa(e,t,n,r){let i=vr(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 Wa(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 Qt(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 en(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 et(e,t=[],n=.3,r=1){let i=Kt(e),s=Zt(e),a=Jt(e,t);return{vertices:i.map((u,d)=>{let x=Qt(a,u),m=en(x,n);return{id:d,position:u,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function tt(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 wr(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,u=e.rotationSpeed??.008,d=e.showLabels??!1,x=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=tt(t),p=1<<t,f=X(()=>e.vertexColors==="auto"||e.vertexColors===void 0?vt(p):e.vertexColors,[p,e.vertexColors]),[y,h]=j(()=>{let C=[];for(let N=0;N<c;N++)C.push(0);return C}),[g,b]=j(!1),S=oe({x:0,y:0}),A=oe([]),T=oe(0);se(()=>{if(u===0)return;let C=!0,N=()=>{C&&(h($=>{let B=$.slice();for(let H=0;H<B.length;H++)B[H]=(B[H]??0)+u*(1+H*.3);return B}),T.current=requestAnimationFrame(N))};return T.current=requestAnimationFrame(N),()=>{C=!1,cancelAnimationFrame(T.current)}},[u]);let M=X(()=>et(t,y,l,m),[t,y,l,m]),D=n/2,L=r/2,I=X(()=>M.edges.map(C=>{let N=M.vertices[C.source],$=M.vertices[C.target],B=(N.depth+$.depth)/2;return{...C,avgDepth:B,sv:N,tv:$}}).sort((C,N)=>C.avgDepth-N.avgDepth),[M]),P=X(()=>M.vertices.slice().sort((C,N)=>C.depth-N.depth),[M]),F=k(C=>{let N=C;b(!0),S.current={x:N.clientX,y:N.clientY},A.current=y.slice()},[y]),R=k(C=>{if(!g)return;let N=C,$=(N.clientX-S.current.x)*.01,B=(N.clientY-S.current.y)*.01;h(()=>{let H=A.current.slice();return H.length>0&&(H[0]=(H[0]??0)+$),H.length>1&&(H[1]=(H[1]??0)+B),H})},[g]),W=k(()=>{b(!1)},[]),z=C=>{let N=(C+2)/4;return .3+.7*Math.max(0,Math.min(1,N))},w=C=>{let N=(C+2)/4;return .6+.4*Math.max(0,Math.min(1,N))},v=I.map((C,N)=>{let $=z(C.avgDepth);return o("line",{key:`e-${C.source}-${C.target}`,x1:String(D+C.sv.x),y1:String(L+C.sv.y),x2:String(D+C.tv.x),y2:String(L+C.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String($),"stroke-linecap":"round"})}),E=P.map(C=>{let N=i*w(C.depth),$=f[C.id%f.length]??"#3b82f6",B=[o("circle",{key:`v-${C.id}-circle`,cx:String(D+C.x),cy:String(L+C.y),r:String(N),fill:$,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return d&&B.push(o("text",{key:`v-${C.id}-label`,x:String(D+C.x),y:String(L+C.y+N+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},C.id.toString(2).padStart(t,"0"))),B});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:x,cursor:g?"grabbing":"grab",userSelect:"none"},onMouseDown:F,onMouseMove:R,onMouseUp:W,onMouseLeave:W},...v,...E.flat())}function kr(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=tt(t),[a,l]=j(()=>new Array(s).fill(0));return se(()=>{if(n===0)return;let d=!0,x=0,m=()=>{d&&(l(c=>c.map((p,f)=>p+n*(1+f*.3))),x=requestAnimationFrame(m))};return x=requestAnimationFrame(m),()=>{d=!1,cancelAnimationFrame(x)}},[n]),{data:X(()=>et(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Cr(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:Na(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??{}},u=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,d=e.legend&&e.legend.length>0?Ha(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,x=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=Ba(u,x,d,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function Na(e,t){return"column"}function Ba(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 Ha(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"}},_a(n),o("span",null,n.label))))}function _a(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 Oa(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 Va(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function Mr(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return se(()=>{if(n||typeof window>"u")return;Oa(t),Va();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 Pr(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:u="24px",maxWidth:d="1200px",className:x,ariaLabel:m="Site footer"}=e;return o("footer",{className:x,role:"contentinfo","aria-label":m,style:{borderTop:i,background:s,color:a,fontSize:l,padding:u,marginTop:"48px"}},o("div",{className:"footer-inner",style:{maxWidth:d,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 $r=Ee({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),Ya={width:600,height:400},Ga={x:30,y:30},Ua={top:0,left:0,width:1920,height:1080},tn=1e3;function Er(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 nn(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 Rr(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 on(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function rn(e){let t=e.workspaceBounds??Ua,n=e.defaultWindowSize??Ya,r=e.cascadeOffset??Ga,[i,s]=j([]),a=k(((...F)=>{let R=F[0];s(W=>{if(W.find(B=>B.id===R.id)){let H=on(W)+1,O=W.map(G=>G.id===R.id?{...G,focused:!0,zIndex:H,windowState:G.windowState==="minimized"?"normal":G.windowState}:{...G,focused:!1});return H>tn&&(O=nn(O)),O}let w=R.size??n,v=R.position??Er(W.length,r,t,w),C=on(W)+1,N={id:R.id,title:R.title,icon:R.icon,position:v,size:w,windowState:"normal",zIndex:C,focused:!0,appProps:R.appProps},$=W.map(B=>({...B,focused:!1}));return $.push(N),C>tn&&($=nn($)),e.onWindowOpen&&e.onWindowOpen(R.id),e.onFocusChange&&e.onFocusChange(R.id),$})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=k(((...F)=>{let R=F[0];S(W=>{if(W[R]){let z={...W};return delete z[R],z}return W}),T(W=>{if(W.has(R)){let z=new Map(W);return z.delete(R),z}return W}),s(W=>{let z=W.find(v=>v.id===R);if(!z)return W;let w=W.filter(v=>v.id!==R);if(z.focused&&w.length>0){let v=Rr(w,R);if(v){let E=w.map(C=>({...C,focused:C.id===v.id}));return e.onWindowClose&&e.onWindowClose(R),e.onFocusChange&&e.onFocusChange(v.id),E}}return e.onWindowClose&&e.onWindowClose(R),w.length===0&&e.onFocusChange&&e.onFocusChange(null),w})}),[e.onWindowClose,e.onFocusChange]),u=k(((...F)=>{let R=F[0];s(W=>{if(!W.find(C=>C.id===R))return W;let v=on(W)+1,E=W.map(C=>C.id===R?{...C,focused:!0,zIndex:v}:{...C,focused:!1});return v>tn&&(E=nn(E)),e.onFocusChange&&e.onFocusChange(R),E})}),[e.onFocusChange]),d=k(((...F)=>{let R=F[0];s(W=>{let z=W.find(v=>v.id===R);if(!z)return W;let w=W.map(v=>v.id===R?{...v,windowState:"minimized",focused:!1}:v);if(z.focused){let v=Rr(w,R);v?(w=w.map(E=>({...E,focused:E.id===v.id})),e.onFocusChange&&e.onFocusChange(v.id)):e.onFocusChange&&e.onFocusChange(null)}return w})}),[e.onFocusChange]),x=k(((...F)=>{let R=F[0];s(W=>W.map(z=>z.id===R?{...z,windowState:"maximized"}:z))}),[]),m=k(((...F)=>{let R=F[0];s(W=>W.map(z=>z.id===R?{...z,windowState:"normal"}:z))}),[]),c=k(((...F)=>{let R=F[0],W=F[1];s(z=>z.map(w=>w.id===R?{...w,position:W}:w))}),[]),p=k(((...F)=>{let R=F[0],W=F[1];s(z=>z.map(w=>w.id===R?{...w,size:W}:w))}),[]),f=k(((...F)=>{s(R=>{let W=R.filter(v=>v.windowState!=="minimized");if(W.length===0)return R;let z=W.length,w=new Map;if(z===1)w.set(W[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(z===2){let v=Math.floor(t.width/2);w.set(W[0].id,{position:{x:t.left,y:t.top},size:{width:v,height:t.height}}),w.set(W[1].id,{position:{x:t.left+v,y:t.top},size:{width:t.width-v,height:t.height}})}else if(z===3){let v=Math.floor(t.width/2),E=Math.floor(t.height/2);w.set(W[0].id,{position:{x:t.left,y:t.top},size:{width:v,height:t.height}}),w.set(W[1].id,{position:{x:t.left+v,y:t.top},size:{width:t.width-v,height:E}}),w.set(W[2].id,{position:{x:t.left+v,y:t.top+E},size:{width:t.width-v,height:t.height-E}})}else{let v=Math.ceil(Math.sqrt(z)),E=Math.ceil(z/v),C=Math.floor(t.width/v),N=Math.floor(t.height/E);for(let $=0;$<W.length;$++){let B=Math.floor($/v),H=$%v;w.set(W[$].id,{position:{x:t.left+H*C,y:t.top+B*N},size:{width:C,height:N}})}}return R.map(v=>{let E=w.get(v.id);return E?{...v,position:E.position,size:E.size,windowState:"normal"}:v})})}),[t]),y=k(((...F)=>{s(R=>{let W=R.filter(v=>v.windowState!=="minimized");if(W.length===0)return R;let z=[...W].sort((v,E)=>v.zIndex-E.zIndex),w=new Map;for(let v=0;v<z.length;v++){let E=Er(v,r,t,z[v].size);w.set(z[v].id,{position:E,zIndex:v+1})}return R.map(v=>{let E=w.get(v.id);return E?{...v,position:E.position,zIndex:E.zIndex,windowState:"normal"}:v})})}),[r,t]),h=k(((...F)=>{s(R=>{let W=R.map(z=>({...z,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),W})}),[e.onFocusChange]),g=X(()=>{let F=i.find(R=>R.focused);return F?F.id:null},[i]),[b,S]=j({}),[A,T]=j(new Map),M=k(((...F)=>{let R=F[0],W=F[1];S(z=>({...z,[R]:W}))}),[]),D=k(((...F)=>{let R=F[0];S(W=>{let z={...W};return delete z[R],z})}),[]),L=X(()=>g&&b[g]?b[g]:null,[g,b]),I=k(((...F)=>{let R=F[0],W=F[1];T(z=>{let w=new Map(z),v=w.get(R);return w.set(R,{...v,...W}),w})}),[]),P=X(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:u,minimizeWindow:d,maximizeWindow:x,restoreWindow:m,moveWindow:c,resizeWindow:p,tileWindows:f,cascadeWindows:y,minimizeAll:h,focusedWindowId:g,setMenuBar:M,clearMenuBar:D,activeMenuBar:L,signalDock:I,dockSignals:A}),[i,a,l,u,d,x,m,c,p,f,y,h,g,M,D,L,I,A]);return o($r.Provider,{value:P},e.children)}function nt(){return ke($r)}var Ir=Ee({appId:""});function Le(e){let t=X(()=>({appId:e.appId}),[e.appId]);return o(Ir.Provider,{value:t},e.children)}function Xe(){return ke(Ir).appId}var zr=Ee({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function ot(e){let t=oe([]),n=oe([]),r=k(((...l)=>{let u=l[0],d=l[1],x=l[2],m=l[3]||"",c={channel:u,from:m,to:x||null,payload:d,timestamp:Date.now()},p=t.current;for(let y=0;y<p.length;y++){let h=p[y];h.channel===u&&(c.to&&h.appId!==c.to||!c.to&&h.appId===m||h.handler(c))}let f=n.current;for(let y=0;y<f.length;y++)f[y].handler(c)}),[]),i=k(((...l)=>{let u=l[0],d=l[1],x=l[2]||"",m={channel:u,handler:d,appId:x};return t.current=[...t.current,m],()=>{t.current=t.current.filter(c=>c!==m)}}),[]),s=k(((...l)=>{let d={handler:l[0]};return n.current=[...n.current,d],()=>{n.current=n.current.filter(x=>x!==d)}}),[]),a=X(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(zr.Provider,{value:a},e.children)}function qe(){let e=ke(zr),t=Xe(),n=k(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=k(((...i)=>{let s=i[0],a=i[1];return e.subscribe(s,a,t)}),[e.subscribe,t]);return X(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function rt(e,t){let n=qe(),r=oe(t);r.current=t,se(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var Tr=Ee({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function it(e){let[t,n]=j(null),[r,i]=j({x:0,y:0}),s=oe(new Map),a=oe(null),l=t!==null,u=k(((...p)=>{let f=p[0];n(f)}),[]),d=k(((...p)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),x=k(((...p)=>{let f=p[0],y=p[1];return s.current=new Map(s.current),s.current.set(f,y),()=>{s.current=new Map(s.current),s.current.delete(f),a.current===f&&(a.current=null)}}),[]);se(()=>{if(!l)return;let p=h=>{let g=h;i({x:g.clientX,y:g.clientY});let b=document.elementFromPoint(g.clientX,g.clientY);if(!b)return;let S=null,A=s.current;A.forEach((M,D)=>{let L=document.querySelector(`[data-dropzone-id="${D}"]`);L&&L.contains(b)&&(S=D)});let T=a.current;if(S!==T){if(T){let M=A.get(T);M&&M.onDragLeave&&M.onDragLeave()}if(S){let M=A.get(S);M&&M.onDragEnter&&t&&M.acceptTypes.indexOf(t.type)!==-1&&M.onDragEnter(t)}a.current=S}},f=h=>{let g=a.current;if(g&&t){let b=s.current.get(g);b&&b.acceptTypes.indexOf(t.type)!==-1&&b.onDrop(t)}a.current=null,n(null)},y=h=>{h.key==="Escape"&&d()};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",y)}},[l,t,d]);let m=X(()=>({startDrag:u,cancelDrag:d,registerDropZone:x,currentDrag:t,isDragging:l}),[u,d,x,t,l]),c=l?o("div",{className:"drag-drop-preview",style:{position:"fixed",left:`${r.x+12}px`,top:`${r.y+12}px`,pointerEvents:"none",zIndex:"10000",opacity:"0.8",padding:"6px 10px",backgroundColor:"rgba(50, 50, 50, 0.9)",color:"#ffffff",borderRadius:"4px",fontSize:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",whiteSpace:"nowrap"}},t&&t.preview?String(t.preview):`Dragging ${t?t.type:""}`):null;return o(Tr.Provider,{value:m},e.children,c)}function He(){return ke(Tr)}function sn(e,t){let n=He(),r=Xe(),i=oe(t);i.current=t;let s=k(l=>{l.preventDefault(),n.startDrag({type:e,data:i.current,sourceAppId:r||""})},[n,e,r]),a=n.isDragging&&n.currentDrag!==null&&n.currentDrag.type===e;return X(()=>({onMouseDown:s,isDragging:a}),[s,a])}function an(e){let t=He(),[n,r]=j(!1),i=oe(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=oe(e);s.current=e,se(()=>t.registerDropZone(i.current,{acceptTypes:s.current.acceptTypes,onDragEnter:u=>{r(!0),s.current.onDragEnter&&s.current.onDragEnter(u)},onDragLeave:()=>{r(!1),s.current.onDragLeave&&s.current.onDragLeave()},onDrop:u=>{r(!1),s.current.onDrop(u)}}),[t]);let a=t.isDragging&&t.currentDrag!==null&&e.acceptTypes.indexOf(t.currentDrag.type)!==-1;return X(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var ja=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ln(e){return e<10?"0"+String(e):String(e)}function qa(e,t,n){let r=e.getHours(),i=ln(e.getMinutes()),s=ln(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=ln(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function Ka(e){let t=ja[e.getDay()],n=Xa[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Za(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=xe(),a=k(()=>{n()},[n]),l=k(u=>{let d=u;(d.key==="Enter"||d.key===" ")&&(d.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 Ja(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=j(new Date);se(()=>{let d=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(d)}},[]);let a=X(()=>qa(i,t,n),[i,t,n]),l=X(()=>Ka(i),[i]),u=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"}},u,o("span",{style:{fontSize:"13px",fontWeight:"500"}},a))}function Qa(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=xe(),s=k(()=>{t.onClick&&t.onClick()},[t]),a=k(l=>{let u=l;(u.key==="Enter"||u.key===" ")&&(u.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 el(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=xe();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=k(()=>{t.onClick(),n()},[t,n]),l=k(u=>{let d=u;(d.key==="Enter"||d.key===" ")&&(d.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 tl(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=xe(),[a,l]=j(!1),u=oe(null),d=k(()=>{l(h=>!h)},[]),x=k(()=>{l(!1)},[]),m=k(h=>{let g=h;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l(b=>!b)),g.key==="Escape"&&l(!1)},[]);se(()=>{if(!a)return;let h=g=>{let b=u.current;b&&!b.contains(g.target)&&l(!1)};return document.addEventListener("click",h,!0),()=>{document.removeEventListener("click",h,!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"},p=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),f=o("span",{style:c,"aria-hidden":"true"},p),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((h,g)=>o(el,{key:String(g),item:h,onClose:x}))):null;return o("div",{ref:u,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:d,onKeyDown:m,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"}},f,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function nl(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=xe(),[s,a]=j(!1),l=oe(null),u=k(()=>{a(c=>!c)},[]),d=k(()=>{a(!1)},[]),x=k(c=>{let p=c;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a(f=>!f)),p.key==="Escape"&&a(!1)},[]);se(()=>{if(!s)return;let c=p=>{let f=l.current;f&&!f.contains(p.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let m=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"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"}},...t.items.map((c,p)=>c.divider?o("div",{key:"div-"+String(p),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(p),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),d()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:"transparent",color:c.disabled?"rgba(255,255,255,0.4)":"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:c.disabled?"default":"pointer",boxSizing:"border-box"}},o("span",null,c.checked?"\u2713 ":"",c.label||""),c.shortcut?o("span",{style:{fontSize:"11px",opacity:"0.6",marginLeft:"16px"}},c.shortcut):null))):null;return o("div",{ref:l,className:"system-tray__app-menu",style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(s),tabIndex:0,onClick:u,onKeyDown:x,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",padding:"0 10px",height:"100%",border:"none",outline:"none",backgroundColor:n||s?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"500",cursor:"pointer",transition:"background-color 0.15s"}},t.label),m)}function cn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:u,userMenuItems:d,height:x=28,children:m}=e,c=String(x)+"px",p=[];if(n&&p.push(o(Za,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let S=0;S<r.menus.length;S++)p.push(o(nl,{key:"appmenu-"+String(S),menu:r.menus[S]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),y=[];y.push(o(Ja,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let h=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),g=[];if(l&&l.length>0){let S=l.map(A=>o(Qa,{key:A.id,indicator:A}));g.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...S))}u&&g.push(o(tl,{key:"user",user:u,menuItems:d}));let b=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...g);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},f,h,b)}function ol(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var Dr=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function rl(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Dr[Math.abs(t)%Dr.length]}function il(e){return e>99?"99+":String(e)}function sl(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function al(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 ll(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 cl(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,u]=j(!1),d=t.disabled??!1,x=k(()=>{d||u(!0)},[d]),m=k(()=>{u(!1)},[]),c=k(()=>{!d&&s&&s(t.id)},[d,s,t.id]),p=k(T=>{if(!d&&a){let M=T;M.preventDefault(),a(t.id,{x:M.clientX,y:M.clientY})}},[d,a,t.id]),f=`${n}px`,y=ol(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:f,height:f,objectFit:"contain",display:"block"}}):o("span",{style:{width:f,height:f,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:rl(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),h=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"},il(t.badge)):null,g=t.active?o("span",{style:{...ll(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,b=t.progress!=null&&t.progress>0?o("div",{style:{position:"absolute",bottom:"2px",left:"6px",right:"6px",height:"3px",backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"2px",overflow:"hidden",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},o("div",{style:{width:`${Math.min(1,Math.max(0,t.progress))*100}%`,height:"100%",backgroundColor:"var(--dock-progress-color, #3b82f6)",borderRadius:"2px",transition:"width 200ms ease"}})):null,S=l?o("div",{role:"tooltip",style:{position:"absolute",...al(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,A={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:d?"default":"pointer",opacity:d?"0.4":"1",pointerEvents:d?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...l&&!d?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{},...t.urgent&&!d?{animation:"dock-urgent-pulse 0.6s ease-in-out infinite alternate"}:{}};return o("button",{type:"button",role:"button",style:A,"aria-label":sl(t),"aria-pressed":t.active?"true":"false","aria-disabled":d?"true":void 0,tabIndex:d?-1:0,onClick:c,onContextMenu:p,onMouseEnter:x,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,h,g,b,S)}function un(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:u,children:d}=e,[x,m]=j(!s),c=oe(null),p=k(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),m(!0))},[s]),f=k(()=>{s&&(c.current=setTimeout(()=>{m(!1)},300))},[s]),y=k(A=>{let T=A,M=T.target,D=M.closest('[role="toolbar"]');if(!D)return;let L=Array.from(D.querySelectorAll("button[data-dock-item-id]")),I=L.indexOf(M);if(I<0)return;let P=n==="vertical",F=P?"ArrowDown":"ArrowRight",R=P?"ArrowUp":"ArrowLeft";if(T.key===F){T.preventDefault();let W=L[I+1];W&&W.focus()}else if(T.key===R){T.preventDefault();let W=L[I-1];W&&W.focus()}else T.key==="Home"?(T.preventDefault(),L[0]?.focus()):T.key==="End"?(T.preventDefault(),L[L.length-1]?.focus()):(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),M.click())},[n]),h=n==="vertical",g={display:"flex",flexDirection:h?"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&&!x&&(r==="left"?(g.transform="translateX(-100%)",g.opacity="0"):r==="right"?(g.transform="translateX(100%)",g.opacity="0"):r==="top"?(g.transform="translateY(-100%)",g.opacity="0"):r==="bottom"&&(g.transform="translateY(100%)",g.opacity="0"));let b=[];for(let A=0;A<t.length;A++){if(a&&A===t.length-1&&t.length>1){let T=h?{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-${A}`,style:T,"aria-hidden":"true",role:"separator"}))}b.push(o(cl,{key:t[A].id,item:t[A],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:u}))}let S=s&&!x?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:g,onMouseEnter:p,onMouseLeave:f,onKeyDown:y},S,...b,d??null)}var ul="#2c001e";function dn(e){let{backgroundColor:t=ul,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:u="visible",children:d}=e,x=k(g=>{let b=g;b.target===b.currentTarget&&a&&a()},[a]),m=k(g=>{let b=g;b.target===b.currentTarget&&l&&l()},[l]),c=X(()=>{let g={position:"relative",width:"100%",height:"100%",overflow:u,cursor:"default",margin:"0",padding:"0"};return g.backgroundColor=t,n&&(g.background=n),r&&i>=1&&(g.backgroundImage=`url(${r})`,g.backgroundSize="cover",g.backgroundPosition="center"),g},[t,n,r,i]),p=X(()=>!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]),f={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];p&&y.push(o("div",{className:"desktop-background__image-overlay",style:p,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:f},d));let h=o("div",{className:"desktop-background",style:c,onClick:x,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(xt,{items:s},h):h}var dl={width:200,height:150},fl={x:50,y:50},pl={width:400,height:300},ye=8,fn=20,gl={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 st(e){let{id:t,title:n,icon:r,defaultPosition:i=fl,defaultSize:s=pl,minSize:a=dl,maxSize:l,resizable:u=!0,draggable:d=!0,windowState:x="normal",focused:m=!0,zIndex:c,onClose:p,onMinimize:f,onMaximize:y,onFocus:h,onMove:g,onResize:b,children:S}=e,[A,T]=j(i.x),[M,D]=j(i.y),[L,I]=j(s.width),[P,F]=j(s.height),[R,W]=j(!1),[z,w]=j(!1),[v,E]=j(null),C=oe(null),N=oe(null),$=oe(null),B=k((ee,le)=>{let ue=Math.max(ee,a.width),ce=Math.max(le,a.height);return l&&(ue=Math.min(ue,l.width),ce=Math.min(ce,l.height)),{width:ue,height:ce}},[a,l]),H=k(()=>{let ee=$.current;return ee&&ee.parentElement?{width:ee.parentElement.clientWidth,height:ee.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),O=k((ee,le,ue,ce)=>{let de=H(),me=Math.max(0,Math.min(ee,de.width-ue)),he=Math.max(0,Math.min(le,de.height-ce));return{x:me,y:he}},[H]),G=k(ee=>{if(!d||x==="maximized")return;let le=ee;le.target.closest("button")||(le.preventDefault(),C.current={startMouseX:le.clientX,startMouseY:le.clientY,startPosX:A,startPosY:M},W(!0))},[d,x,A,M]),q=k(ee=>{ee.target.closest("button")||y&&y()},[y]);se(()=>{if(!R)return;let ee=ue=>{let ce=ue,de=C.current;if(!de)return;let me=ce.clientX-de.startMouseX,he=ce.clientY-de.startMouseY,be=de.startPosX+me,Ce=de.startPosY+he,Me=H();be=Math.max(0,Math.min(be,Me.width-L)),Ce=Math.max(0,Math.min(Ce,Me.height-P)),T(be),D(Ce),ce.clientX<=fn?E("left"):ce.clientX>=Me.width-fn?E("right"):ce.clientY<=fn?E("top"):E(null)},le=ue=>{let ce=ue;W(!1);let de=H();if(v==="left"){T(0),D(0),I(Math.floor(de.width/2)),F(de.height),E(null),g&&g({x:0,y:0}),b&&b({width:Math.floor(de.width/2),height:de.height});return}if(v==="right"){let he=Math.floor(de.width/2);T(he),D(0),I(he),F(de.height),E(null),g&&g({x:he,y:0}),b&&b({width:he,height:de.height});return}if(v==="top"){E(null),y&&y();return}E(null);let me=C.current;if(me&&g){let he=ce.clientX-me.startMouseX,be=ce.clientY-me.startMouseY,Ce=me.startPosX+he,Me=me.startPosY+be;Ce=Math.max(0,Math.min(Ce,de.width-L)),Me=Math.max(0,Math.min(Me,de.height-P)),g({x:Ce,y:Me})}C.current=null};return document.addEventListener("mousemove",ee),document.addEventListener("mouseup",le),()=>{document.removeEventListener("mousemove",ee),document.removeEventListener("mouseup",le)}},[R,v,L,P,H,g,b,y]);let te=k(ee=>le=>{if(!u||x!=="normal")return;let ue=le;ue.preventDefault(),ue.stopPropagation(),N.current={direction:ee,startMouseX:ue.clientX,startMouseY:ue.clientY,startPosX:A,startPosY:M,startWidth:L,startHeight:P},w(!0)},[u,x,A,M,L,P]);se(()=>{if(!z)return;let ee=ue=>{let ce=ue,de=N.current;if(!de)return;let me=ce.clientX-de.startMouseX,he=ce.clientY-de.startMouseY,be=de.direction,Ce=de.startWidth,Me=de.startHeight,Ft=de.startPosX,Wt=de.startPosY;be.includes("e")&&(Ce=de.startWidth+me),be.includes("w")&&(Ce=de.startWidth-me,Ft=de.startPosX+me),be.includes("s")&&(Me=de.startHeight+he),be.includes("n")&&(Me=de.startHeight-he,Wt=de.startPosY+he);let ut=B(Ce,Me);be.includes("w")&&(Ft=de.startPosX+(de.startWidth-ut.width)),be.includes("n")&&(Wt=de.startPosY+(de.startHeight-ut.height)),I(ut.width),F(ut.height),T(Ft),D(Wt)},le=()=>{w(!1),b&&b({width:L,height:P}),N.current=null};return document.addEventListener("mousemove",ee),document.addEventListener("mouseup",le),()=>{document.removeEventListener("mousemove",ee),document.removeEventListener("mouseup",le)}},[z,L,P,B,b]),se(()=>{if(!m||!p)return;let ee=le=>{le.key==="Escape"&&p()};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[m,p]);let Z=k(ee=>{h&&h()},[h]);if(x==="minimized")return null;let Y=x==="maximized",U=X(()=>{let ee={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:m?"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?(ee.top="0",ee.left="0",ee.width="100%",ee.height="100%"):(ee.top=`${M}px`,ee.left=`${A}px`,ee.width=`${L}px`,ee.height=`${P}px`),c!==void 0&&(ee.zIndex=String(c)),R&&(ee.cursor="grabbing",ee.userSelect="none"),ee},[Y,A,M,L,P,c,m,R]),V=X(()=>{let ee={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:d&&!Y?"grab":"default",opacity:m?"1":"0.6"};return R&&(ee.cursor="grabbing"),ee},[m,d,Y,R]),_={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},K={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 ie=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:{...K,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:ee=>{ee.stopPropagation(),f&&f()}}),o("button",{type:"button","aria-label":Y?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...K,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:ee=>{ee.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...K,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:ee=>{ee.stopPropagation(),p&&p()}}));Q.push(ie);let J=[];if(u&&!Y){let ee=["n","s","e","w","ne","nw","se","sw"];for(let le=0;le<ee.length;le++){let ue=ee[le],ce={position:"absolute",zIndex:"1"};ue==="n"?(ce.top="0",ce.left=`${ye}px`,ce.right=`${ye}px`,ce.height=`${ye}px`):ue==="s"?(ce.bottom="0",ce.left=`${ye}px`,ce.right=`${ye}px`,ce.height=`${ye}px`):ue==="e"?(ce.top=`${ye}px`,ce.right="0",ce.bottom=`${ye}px`,ce.width=`${ye}px`):ue==="w"?(ce.top=`${ye}px`,ce.left="0",ce.bottom=`${ye}px`,ce.width=`${ye}px`):ue==="ne"?(ce.top="0",ce.right="0",ce.width=`${ye}px`,ce.height=`${ye}px`):ue==="nw"?(ce.top="0",ce.left="0",ce.width=`${ye}px`,ce.height=`${ye}px`):ue==="se"?(ce.bottom="0",ce.right="0",ce.width=`${ye}px`,ce.height=`${ye}px`):ue==="sw"&&(ce.bottom="0",ce.left="0",ce.width=`${ye}px`,ce.height=`${ye}px`),ce.cursor=gl[ue],J.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${ue}`,style:ce,onMouseDown:te(ue)}))}}let re=null;if(v){let ee={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"?(ee.top="0",ee.left="0",ee.width="50%",ee.height="100%"):v==="right"?(ee.top="0",ee.right="0",ee.width="50%",ee.height="100%"):v==="top"&&(ee.top="0",ee.left="0",ee.width="100%",ee.height="100%"),re=o("div",{className:"draggable-window__snap-preview",style:ee})}let ae=[];for(let ee=0;ee<J.length;ee++)ae.push(J[ee]);ae.push(o("div",{className:"draggable-window__title-bar",style:V,onMouseDown:G,onDblClick:q,role:"toolbar","aria-label":`${n} window controls`},...Q)),ae.push(o("div",{className:"draggable-window__body",style:_},S));let ne=[o("div",{ref:$,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${x}`,style:U,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:Z},...ae)];return re&&ne.push(re),ne.length===1?ne[0]:o("div",{style:{display:"contents"}},...ne)}var ml=["File","Edit","View","Insert","Format","Tools","Help"],Ar={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"}]},hl=[{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"}}],bl=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],xl=["1","2","3","4","5","6","7"],yl={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Sl(){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 Lr(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function wt(e){let[t,n]=j(!1),[r,i]=j(!1),[s,a]=j(!1),[l,u]=j(-1),[d,x]=j(""),[m,c]=j(-1),[p,f]=j(0),[y,h]=j("3"),g=oe(null),b=k(()=>{document.execCommand("bold",!1),n(_=>!_),g.current&&g.current.focus()},[]),S=k(()=>{document.execCommand("italic",!1),i(_=>!_),g.current&&g.current.focus()},[]),A=k(()=>{document.execCommand("underline",!1),a(_=>!_),g.current&&g.current.focus()},[]),T={bold:b,italic:S,underline:A},M={bold:t,italic:r,underline:s},D=k(_=>{document.execCommand(_,!1),g.current&&g.current.focus()},[]),L=k(_=>{document.execCommand("fontSize",!1,_),h(_),g.current&&g.current.focus()},[]),I=k(_=>{c(K=>K===_?-1:_)},[]),P=k(_=>{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"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":g.current&&(g.current.innerHTML="",f(0));break;default:break}c(-1),g.current&&g.current.focus()},[]),F=k(()=>{if(g.current){let _=g.current.textContent??"";f(Lr(_))}},[]),R=k(()=>{c(-1)},[]),W=X(()=>({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"}),[]),z={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"},w={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"},E={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},C={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"},N={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"},$=X(()=>Sl(),[]),B=e.content??"Start typing...",H=Lr(B),O=p>0?p:H;function G(_){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:m===_?"rgba(0,0,0,0.12)":l===_?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let q={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"},te={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function Z(_,K){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:M[_]??!1?"rgba(0,0,0,0.12)":d===_?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...K??{}}}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"},V=ml.map((_,K)=>{let Q=[_];return m===K&&Ar[_]&&Q.push(o("div",{key:"dropdown",style:q,className:"word-processor__menu-dropdown"},...Ar[_].map((ie,J)=>o("button",{key:String(J),style:te,onClick:re=>{re.stopPropagation(),P(ie.action)},role:"menuitem"},ie.label)))),o("button",{key:String(K),style:G(K),role:"menuitem","aria-label":_,onClick:()=>I(K),onMouseEnter:()=>{u(K)},onMouseLeave:()=>u(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:W},o("div",{className:"word-processor__menu-bar",style:z,role:"menubar"},...V),o("div",{className:"word-processor__toolbar",style:w,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"}},...hl.map(_=>o("button",{key:_.id,style:Z(_.id,_.style),title:_.shortcut?`${_.label} (${_.shortcut})`:_.label,"aria-label":_.label,"aria-pressed":String(M[_.id]??!1),onClick:T[_.id],onMouseEnter:()=>x(_.id),onMouseLeave:()=>x("")},_.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:_=>{let K=_.target;L(K.value)}},...xl.map(_=>o("option",{key:_,value:_},yl[_])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...bl.map((_,K)=>o("button",{key:String(K),style:Z(`align-${K}`),title:_.label,"aria-label":_.label,onClick:()=>D(_.command),onMouseEnter:()=>x(`align-${K}`),onMouseLeave:()=>x("")},_.text)))),o("div",{className:"word-processor__ruler",style:v,"aria-hidden":"true"},...$),o("main",{className:"word-processor__document-area",style:E,onClick:R},o("div",{className:"word-processor__page",style:C,contentEditable:"true",ref:g,onInput:F,suppressContentEditableWarning:!0},B)),o("div",{className:"word-processor__status-bar",style:N},o("span",null,"Page 1 of 1"),o("span",null,`${O} words`),o("span",null,"100%")))}var vl=["File","Edit","Selection","View","Go","Run","Terminal","Help"],Fr={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"}]},Wr=[{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}],gn={"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"]',"}"]},Nr=gn["App.ts"],wl=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"]),kl=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),Br="#569cd6",Cl="#ce9178",Ml="#4ec9b0",Pl="#6a9955",El="#dcdcaa",pn="#d4d4d4",Rl="#d4d4d4",$l="#b5cea8";function Il(e){if(!e.trim())return[{text:"\xA0",color:pn}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:Pl});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:Cl}),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:$l}),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=pn;wl.has(i)?l=Br:kl.has(i)?l=Ml:a?l=El:(i==="true"||i==="false")&&(l=Br),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:pn}),n=r;continue}t.push({text:e[n],color:Rl}),n++}return t}function kt(e){let[t,n]=j("App.ts"),[r,i]=j({src:!0,components:!0,hooks:!0}),[s,a]=j(-1),[l,u]=j(Nr.length),d=oe(null),x=k(V=>{n(V);let _=gn[V];_&&u(_.length)},[]),m=k(V=>{i(_=>{let K={},Q=Object.keys(_);for(let ie=0;ie<Q.length;ie++)K[Q[ie]]=_[Q[ie]];return K[V]=!_[V],K})},[]),c=k(V=>{a(_=>_===V?-1:V)},[]),p=k(V=>{switch(V){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":d.current&&(d.current.textContent="",u(1));break;default:break}a(-1),d.current&&d.current.focus()},[]),f=k(()=>{if(d.current){let _=(d.current.textContent??"").split(`
8
- `);u(Math.max(_.length,1))}},[]),y=X(()=>({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"}),[]),h={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},g={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)"},A={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"},T={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},M={flex:"1",display:"flex",overflow:"hidden"},D={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},L={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},I={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},P=(V,_,K)=>({padding:"3px 8px",paddingLeft:`${12+V*16}px`,fontSize:"13px",cursor:"pointer",color:_?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:K?"rgba(255,255,255,0.08)":"transparent"}),F={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},R={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},W={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},z={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},w={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"},E={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},C={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},N={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},$=8,B=30,H=gn[t]??Nr,O=H.map((V,_)=>{let K=Il(V),Q=[],ie=0;for(let J of K)Q.push(o("span",{key:String(ie++),style:{color:J.color}},J.text));return o("div",{key:String(_),style:{minHeight:"20px"}},...Q)}),G=Math.max(l,H.length),q=[];for(let V=0;V<G;V++)q.push(o("div",{key:String(V)},String(V+1)));let te=V=>{if(!V.parent)return!0;if(!r[V.parent])return!1;let _=Wr.find(K=>K.name===V.parent&&K.isFolder);return _?te(_):!0},Z=vl.map((V,_)=>{let K=[V],Q=s===_;return Q&&Fr[V]&&K.push(o("div",{key:"dropdown",style:A,className:"ide__menu-dropdown"},...Fr[V].map((ie,J)=>o("button",{key:String(J),style:T,onClick:re=>{re.stopPropagation(),p(ie.action)},role:"menuitem"},ie.label)))),o("button",{key:String(_),style:Q?S:b,role:"menuitem","aria-label":V,onClick:()=>c(_)},...K)}),U=Wr.map((V,_)=>{if(!te(V))return null;let K=!V.isFolder&&V.name===t,Q=V.isFolder?r[V.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(_),style:P(V.indent,V.isFolder,K),onClick:V.isFolder?()=>m(V.name):()=>x(V.name)},Q,V.name)}).filter(V=>V!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:h},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:g,role:"menubar"},...Z),o("div",{style:M},o("nav",{className:"ide__sidebar",style:D,"aria-label":"File explorer"},o("div",{style:I},"Explorer"),...U),o("div",{style:L}),o("div",{style:F},o("div",{style:R},o("button",{style:W,"aria-label":t},t)),o("div",{style:z},o("div",{style:w,"aria-hidden":"true"},...q),o("code",{style:v,contentEditable:"true",ref:d,onInput:f,suppressContentEditableWarning:!0},...O))),o("div",{className:"ide__minimap",style:E,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${$}px`,left:"0",right:"0",height:`${B}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...H.map((V,_)=>o("div",{key:String(_),style:{height:"2px",backgroundColor:V.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,V.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:C},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:N},"\u2387 main"),o("span",{style:N},"0 errors"),o("span",{style:N},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:N},"Ln 1, Col 1"),o("span",{style:N},"UTF-8"),o("span",{style:N},"TypeScript"))))}var zl=[{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]}],Hr=[{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}],_r=[{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}],Or=[{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}],Tl=[{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}],Dl=[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],Vr=[{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}],Yr=[{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}],Gr=["09:30","10:00","10:30","11:00","11:30","12:00"];function Al(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function at(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function $e(e){return e.toFixed(2)}var Ke={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},Ze={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Ct={width:"100%",borderCollapse:"collapse",fontSize:"12px"},ve={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},we={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},Mt={cursor:"default",transition:"background-color 0.1s"};function Ll(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((d,x)=>{let m=x/(e.length-1)*40,c=14-(d-i)/a*14;return`${m.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 Fl(e,t){let d=Math.min(...e),x=Math.max(...e),m=x-d||1,c=310/(e.length-1),p=e.map((M,D)=>{let L=40+D*c,I=15+(1-(M-d)/m)*120;return{x:L,y:I}}),f=p.map(M=>`${M.x.toFixed(1)},${M.y.toFixed(1)}`).join(" "),y="M40,135 "+p.map(M=>`L${M.x.toFixed(1)},${M.y.toFixed(1)}`).join(" ")+` L${p[p.length-1].x.toFixed(1)},135 Z`,h=[];for(let M=1;M<e.length;M++){let D=e[M]>=e[M-1]?"#00c853":"#ff1744";h.push(o("line",{key:String(M),x1:String(p[M-1].x.toFixed(1)),y1:String(p[M-1].y.toFixed(1)),x2:String(p[M].x.toFixed(1)),y2:String(p[M].y.toFixed(1)),stroke:D,strokeWidth:"2",strokeLinecap:"round"}))}let g=[];for(let M=0;M<5;M++){let D=15+M/4*120,L=x-M/4*m;g.push(o("line",{key:`g${M}`,x1:String(40),y1:String(D.toFixed(1)),x2:String(350),y2:String(D.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),g.push(o("text",{key:`yl${M}`,x:String(36),y:String((D+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},$e(L)))}let b=[],S=Math.min(Gr.length,e.length),A=(e.length-1)/(S-1);for(let M=0;M<S;M++){let L=40+Math.round(M*A)*c;b.push(o("text",{key:`tl${M}`,x:String(L.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},Gr[M]))}let T="chartGrad";return o("div",{style:Ke},o("div",{style:Ze},"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:T,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(#${T})`}),...g,...b,...h,o("line",{x1:String(40),y1:String((15+(1-(t-d)/m)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-d)/m)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function Wl(){let e=Math.max(...Hr.map(t=>t.qty),..._r.map(t=>t.qty));return o("div",{style:Ke},o("div",{style:Ze},"Order Book"),o("table",{style:Ct},o("thead",null,o("tr",null,o("th",{style:ve},"Bid Price"),o("th",{style:ve},"Qty"),o("th",{style:ve},"Ask Price"),o("th",{style:ve},"Qty"))),o("tbody",null,...Hr.map((t,n)=>{let r=_r[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:Mt},o("td",{style:{...we,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},$e(t.price)),o("td",{style:{...we,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},at(t.qty)),o("td",{style:{...we,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?$e(r.price):""),o("td",{style:{...we,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?at(r.qty):""))}))))}function Nl(e){return o("div",{style:Ke},o("div",{style:Ze},"Watchlist"),o("table",{style:Ct},o("thead",null,o("tr",null,o("th",{style:ve},"Symbol"),o("th",{style:ve},"Price"),o("th",{style:ve},"Chg%"),o("th",{style:ve},"Volume"))),o("tbody",null,...zl.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:Mt},o("td",{style:{...we,fontWeight:"600",color:"#ffffff"}},t.symbol,Ll(t.spark,i)),o("td",{style:{...we,fontFamily:"monospace"}},$e(r)),o("td",{style:{...we,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${$e(t.change)}%`),o("td",{style:{...we,fontFamily:"monospace",color:"#8888aa"}},Al(t.volume)))}))))}function Bl(){let e=Or.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:Ke},o("div",{style:Ze},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${$e(e)}`)),o("table",{style:Ct},o("thead",null,o("tr",null,o("th",{style:ve},"Symbol"),o("th",{style:ve},"Qty"),o("th",{style:ve},"Avg"),o("th",{style:ve},"P&L"))),o("tbody",null,...Or.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...Mt,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...we,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...we,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...we,fontFamily:"monospace"}},$e(n.avgPrice)),o("td",{style:{...we,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${$e(n.pnl)}`))}))))}function Hl(){return o("div",{style:Ke},o("div",{style:Ze},"Recent Trades"),o("table",{style:Ct},o("thead",null,o("tr",null,o("th",{style:ve},"Time"),o("th",{style:ve},"Sym"),o("th",{style:ve},"Side"),o("th",{style:ve},"Qty"),o("th",{style:ve},"Price"))),o("tbody",null,...Tl.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:Mt},o("td",{style:{...we,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...we,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...we,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...we,fontFamily:"monospace"}},at(e.qty)),o("td",{style:{...we,fontFamily:"monospace"}},$e(e.price)))}))))}function _l(){let e=Math.max(...Vr.map(n=>n.volume),...Yr.map(n=>n.volume)),t="16px";return o("div",{style:Ke},o("div",{style:Ze},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...Vr.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"}},at(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...Yr.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"}},at(n.volume))))))}function Pt(e){let[t,n]=j(0),[r,i]=j("--:--:--"),[s,a]=j(!0);se(()=>{let p=setInterval(()=>{n(f=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(p)},[]),se(()=>{let p=()=>{let y=new Date,h=String(y.getHours()).padStart(2,"0"),g=String(y.getMinutes()).padStart(2,"0"),b=String(y.getSeconds()).padStart(2,"0");i(`${h}:${g}:${b}`)};p();let f=setInterval(p,1e3);return()=>clearInterval(f)},[]),se(()=>{let p=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(p)},[]);let l=X(()=>({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"}),[]),u={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},d={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},x={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},m=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:u},o("span",{style:d},"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:x},Fl(Dl,m),Wl(),Nl(t),Bl(),Hl(),_l()))}var Ol=28,Vl=5e3;function Yl(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 Gl(){let e=qe(),t=oe(!1);return se(()=>{t.current||(t.current=!0,e.publish("terminal-output",{text:"Terminal session started",pid:1}))},[e]),o("div",{style:{padding:"16px",fontSize:"12px",color:"#00ff41",height:"100%",overflow:"auto",backgroundColor:"#1a1a2e",fontFamily:"monospace"}},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",{style:{opacity:"0.6",marginTop:"8px",fontSize:"10px"}},"[Published terminal-output message]"),o("div",null,"$ _"))}function Ul(){let[e,t]=j([]),n=He();rt("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=k(s=>{s.preventDefault(),n.startDrag({type:"application/file",data:{name:"readme.txt",size:1024},sourceAppId:"files",preview:"readme.txt"})},[n]);return o("div",{style:{padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"}},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"].map(s=>o("span",{style:{cursor:"pointer"}},s)),o("span",{style:{cursor:"grab",padding:"4px 8px",border:"1px dashed #94a3b8",borderRadius:"4px",backgroundColor:"rgba(148, 163, 184, 0.1)"},onMouseDown:r,"aria-label":"Drag readme.txt"},"\u{1F4C4} readme.txt (drag me)")),e.length>0?o("div",{style:{marginTop:"12px",padding:"8px",backgroundColor:"rgba(0,0,0,0.05)",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace"}},o("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Messages received:"),...e.map((s,a)=>o("div",{key:String(a),style:{color:"#64748b"}},s))):null)}function jl(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(e){case"Files":return o(Le,{appId:"files"},o(Ul,null));case"Terminal":return o(Le,{appId:"terminal"},o(Gl,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(wt,null);case"IDE":return o(kt,null);case"Trading":return o(Pt,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function Xl(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=nt(),u=l.activeMenuBar,d=l.dockSignals,[x,m]=j([]),[c,p]=j([]),[f,y]=j(!1),[h,g]=j(!1),[b,S]=j(null),[A,T]=j({x:0,y:0}),[M,D]=j(null),L=k(()=>{y(ne=>!ne)},[]),I=k(ne=>{p(ee=>ee.filter(le=>le.id!==ne))},[]);se(()=>{if(c.length===0)return;let ne=c[0],ee=Date.now()-ne.timestamp,le=Math.max(0,Vl-ee),ue=setTimeout(()=>{p(ce=>ce.filter(de=>de.id!==ne.id))},le);return()=>clearTimeout(ue)},[c]);let P=oe(t);P.current=t;let F=oe(r);F.current=r;let R=k(ne=>{m(ee=>{if(ee.find(he=>he.id===ne)){let he=Math.max(...ee.map(be=>be.zIndex))+1;return ee.map(be=>be.id===ne?{...be,focused:!0,zIndex:he,windowState:be.windowState==="minimized"?"normal":be.windowState}:{...be,focused:!1})}let ce=P.current.find(he=>he.id===ne);if(!ce)return ee;let de=ee.length>0?Math.max(...ee.map(he=>he.zIndex))+1:1,me={id:ce.id,title:ce.label,icon:ce.icon,x:60+ee.length*30,y:40+ee.length*30,width:600,height:400,zIndex:de,focused:!0,windowState:"normal"};return[...ee.map(he=>({...he,focused:!1})),me]}),ne==="files"&&l.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),ne==="terminal"&&l.signalDock("terminal",{badge:3}),F.current&&F.current(ne)},[l]),W=t.map(ne=>{let ee=x.some(ce=>ce.id===ne.id),le=d.get(ne.id),ue={id:ne.id,icon:ne.icon,label:le?.tooltip||ne.label,active:ee};return le&&(le.badge!=null&&(ue.badge=le.badge>0?le.badge:void 0),le.progress!=null&&(ue.progress=le.progress>0?le.progress:void 0),le.urgent&&(ue.urgent=!0)),ue}),z=x.find(ne=>ne.focused),w=z?z.title:void 0,v=k(()=>{g(!0)},[]),E=k(()=>{g(!1)},[]),C=k((ne,ee)=>{S(ne),T(ee)},[]),N=k(()=>{S(null)},[]),$=k(()=>{},[]),B=k(()=>{i&&i()},[i]),H=[];n&&(H.push({label:n.name,icon:void 0,onClick:$,divider:!1}),H.push({label:"",icon:void 0,onClick:$,divider:!0})),H.push({label:"Lock",icon:void 0,onClick:v,divider:!1}),H.push({label:"Logout",icon:void 0,onClick:B,divider:!1});let O=X(()=>({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]),G={display:"flex",flex:"1",overflow:"hidden"},q={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"},te={width:"100%",height:"100%",position:"relative"},Z=o(cn,{activeAppName:w,activitiesButton:{label:"Activities",onClick:L},appMenuBar:u||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:H.length>0?H:void 0,height:Ol}),Y=o(un,{items:W,orientation:"vertical",position:"left",iconSize:36,onItemClick:R,onItemContextMenu:C}),U=o(Yl,{toasts:c,onDismiss:I}),V=x.filter(ne=>ne.windowState!=="minimized").map(ne=>o(st,{key:ne.id,id:ne.id,title:ne.title,icon:ne.icon,defaultPosition:{x:ne.x,y:ne.y},defaultSize:{width:ne.width,height:ne.height},zIndex:ne.zIndex,focused:ne.focused,windowState:ne.windowState,onClose:()=>{m(ee=>ee.filter(le=>le.id!==ne.id))},onFocus:()=>{m(ee=>{let le=Math.max(...ee.map(ue=>ue.zIndex))+1;return ee.map(ue=>ue.id===ne.id?{...ue,focused:!0,zIndex:le}:{...ue,focused:!1})})},onMinimize:()=>{m(ee=>ee.map(le=>le.id===ne.id?{...le,windowState:"minimized"}:le))},onMaximize:()=>{m(ee=>ee.map(le=>le.id===ne.id?{...le,windowState:le.windowState==="maximized"?"normal":"maximized"}:le))}},jl(ne.title))),_=[];a&&_.push(a),_.push(...V),_.push(U);let K=o(dn,{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:te},..._)),Q=f?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:L},...t.map(ne=>o("button",{key:ne.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:ee=>{ee.stopPropagation(),y(!1),R(ne.id)}},o("span",{style:{fontSize:"32px",display:"block"}},ne.icon),o("span",null,ne.label)))):null,ie=h?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:E},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,J=b?o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:N},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${A.y}px`,left:`${A.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:ne=>ne.stopPropagation()},o("div",{style:{padding:"6px 14px",fontWeight:"600",borderBottom:"1px solid #444",marginBottom:"4px"}},t.find(ne=>ne.id===b)?.label||b),o("div",{style:{padding:"6px 14px",cursor:"pointer"},onClick:()=>{D(b),S(null)},role:"menuitem"},"About"))):null,re=M?t.find(ne=>ne.id===M):null,ae=re?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:()=>D(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:ne=>ne.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},re.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:()=>D(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:O,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},Z),o("div",{style:G},o("div",{className:"unity-desktop__dock",style:q},Y),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},K,Q)),J,ae,ie)}function Ur(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(rn,{onWindowOpen:r},o(ot,null,o(it,null,o(Xl,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function jr(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:u,menuBar:d,onActivate:x,onDeactivate:m,children:c}=e,p=nt(),f=X(()=>p.windows.find(D=>D.id===t),[p.windows,t]);se(()=>(d?p.setMenuBar(t,d):p.clearMenuBar(t),()=>{p.clearMenuBar(t)}),[d,t,p]);let y=oe(!1),h=f?f.focused:!1;se(()=>{let D=y.current;y.current=h,h&&!D?x&&x():!h&&D&&m&&m()},[h,x,m]);let g=k(()=>{p.closeWindow(t),u&&u()},[p,t,u]),b=k(()=>{p.focusWindow(t)},[p,t]),S=k(D=>{p.moveWindow(t,D)},[p,t]),A=k(D=>{p.resizeWindow(t,D)},[p,t]),T=k(()=>{p.minimizeWindow(t)},[p,t]),M=k(()=>{f&&f.windowState==="maximized"?p.restoreWindow(t):p.maximizeWindow(t)},[p,t,f]);return f?o(Le,{appId:t},o(st,{id:t,title:n,icon:r,defaultPosition:f.position,defaultSize:f.size,minSize:a,resizable:l,windowState:f.windowState,focused:f.focused,zIndex:f.zIndex,onClose:g,onFocus:b,onMove:S,onResize:A,onMinimize:T,onMaximize:M,children:c})):(p.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var Xr={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},qr={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 Kr(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:u,style:d,ariaLabel:x,active:m=!1}=e,c=X(()=>{let p=Xr[i]??Xr.md,f=qr[r]??qr.secondary,y={padding:p.padding,fontSize:p.fontSize,borderRadius:p.borderRadius,border:`1px solid ${f.border}`,backgroundColor:m?"#3b82f6":f.bg,color:m?"white":f.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%"),d&&Object.assign(y,d),y},[r,i,s,a,m,d]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:u,style:c,"aria-label":x,"aria-pressed":m?"true":void 0},t)}var ql=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Je=Math.PI/180;function Kl(e,t,n,r,i,s,a,l,u,d){let x=Math.cos(r*Je),m=Math.sin(r*Je),c=Math.cos(i*Je),p=Math.sin(i*Je),f=Math.cos(s*Je),y=Math.sin(s*Je),h=e*f-t*y,g=e*y+t*f,b=h*c-g*p,S=h*p+g*c,A=n,T=b,M=S*x-A*m,D=S*m+A*x,L=1+a*.001*D,I=l+T*d*L,P=u-M*d*L;return{sx:I,sy:P,depth:D}}function Zr(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 Jr(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=u=>Math.max(0,Math.min(255,Math.round(u*t))),l=u=>a(u).toString(16).padStart(2,"0");return"#"+l(r)+l(i)+l(s)}function Qr(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:u=!0,showAxes:d=!0,layerSpacing:x=2,colorScale:m=ql,gridColor:c="#94a3b8",title:p}=e,f=X(()=>{let z=0,w=0,v=0;for(let E=0;E<t.length;E++){let C=t[E],N=C.data.length;N>z&&(z=N);for(let $=0;$<N;$++){let B=C.data[$].length;B>w&&(w=B);for(let H=0;H<B;H++){let O=Math.abs(C.data[$][H]??0);O>v&&(v=O)}}}return{maxRows:Math.max(z,1),maxCols:Math.max(w,1),maxHeight:v>0?v:1}},[t]),y=X(()=>{let z=f.maxHeight+(t.length-1)*x+f.maxHeight,w=Math.sqrt(f.maxCols*f.maxCols+f.maxRows*f.maxRows+z*z),v=Math.min(n,r)*.75;return w>0?v/w:1},[f,t.length,x,n,r]),h=n/2,g=r/2,b=k((z,w,v)=>Kl(z,w,v,s,a,l,i,h,g,y),[s,a,l,i,h,g,y]),S=k(()=>{if(!d)return[];let z=[],w=Math.max(f.maxCols,f.maxRows),v=f.maxCols/2,E=f.maxRows/2,C=b(-v,-E,0),N=b(v,-E,0);z.push(o("line",{key:"axis-x",x1:String(C.sx),y1:String(C.sy),x2:String(N.sx),y2:String(N.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-x-label",x:String(N.sx+8),y:String(N.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let $=b(-v,E,0);z.push(o("line",{key:"axis-y",x1:String(C.sx),y1:String(C.sy),x2:String($.sx),y2:String($.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-y-label",x:String($.sx-12),y:String($.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let B=f.maxHeight+(t.length-1)*x,H=b(-v,-E,B);return z.push(o("line",{key:"axis-z",x1:String(C.sx),y1:String(C.sy),x2:String(H.sx),y2:String(H.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-z-label",x:String(H.sx-4),y:String(H.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),z},[d,f,t.length,x,b]),A=k(()=>{let z=[],w=f.maxCols/2,v=f.maxRows/2,E=[];for(let C=0;C<t.length;C++){let N=t[C],$=N.color??m[C%m.length],B=N.opacity??.7,H=C*x,O=N.data.length;for(let G=0;G<O-1;G++){let q=N.data[G],te=N.data[G+1],Z=Math.min(q.length,te.length);for(let Y=0;Y<Z-1;Y++){let U=Y-w,V=Y+1-w,_=G-v,K=G+1-v,Q=(q[Y]??0)+H,ie=(q[Y+1]??0)+H,J=(te[Y]??0)+H,re=(te[Y+1]??0)+H,ae=b(U,_,Q),ne=b(V,_,ie),ee=b(U,K,J),le=b(V,K,re),ue=(ae.depth+ne.depth+ee.depth+le.depth)/4,ce=`${ae.sx},${ae.sy} ${ne.sx},${ne.sy} ${le.sx},${le.sy} ${ee.sx},${ee.sy}`;E.push({points:ce,fill:Zr($,B),stroke:Jr($,.7),strokeWidth:"0.5",depth:ue,key:`quad-${C}-${G}-${Y}`})}}if(O===1||O>0&&N.data[0].length===1)for(let G=0;G<O;G++){let q=N.data[G];for(let te=0;te<q.length;te++){let Z=te-w,Y=G-v,U=(q[te]??0)+H,V=b(Z,Y,U),_=3,K=`${V.sx},${V.sy-_} ${V.sx+_},${V.sy} ${V.sx},${V.sy+_} ${V.sx-_},${V.sy}`;E.push({points:K,fill:Zr($,B),stroke:Jr($,.7),strokeWidth:"0.5",depth:V.depth,key:`point-${C}-${G}-${te}`})}}}E.sort((C,N)=>C.depth-N.depth);for(let C=0;C<E.length;C++){let N=E[C];z.push(o("polygon",{key:N.key,points:N.points,fill:N.fill,stroke:N.stroke,"stroke-width":N.strokeWidth,"stroke-linejoin":"round"}))}return z},[t,f,x,m,b]),T=k(()=>{let z=[],w=f.maxCols/2,v=f.maxRows/2;for(let E=0;E<=f.maxRows;E++){let C=E-v,N=b(-w,C,0),$=b(w,C,0);z.push(o("line",{key:`base-h-${E}`,x1:String(N.sx),y1:String(N.sy),x2:String($.sx),y2:String($.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let E=0;E<=f.maxCols;E++){let C=E-w,N=b(C,-v,0),$=b(C,v,0);z.push(o("line",{key:`base-v-${E}`,x1:String(N.sx),y1:String(N.sy),x2:String($.sx),y2:String($.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return z},[f,c,b]),M=k(()=>{if(!u)return[];let z=[],w=f.maxCols/2,v=f.maxRows/2;for(let E=0;E<t.length;E++){let C=t[E],N=E*x,$=0,B=0;for(let q=0;q<C.data.length;q++){let te=C.data[q];for(let Z=0;Z<te.length;Z++)$+=te[Z]??0,B++}let H=B>0?$/B:0,O=b(w+1,0,H+N),G=C.color??m[E%m.length];z.push(o("text",{key:`layer-label-${E}`,x:String(O.sx+8),y:String(O.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:G},C.label))}return z},[u,t,f,x,m,b]),L=k(()=>p?[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"},p)]:[],[p,n])(),I=T(),P=S(),F=A(),R=M(),W=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":p??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...W,...I,...P,...F,...R)}function Zl(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 Jl(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 ei(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:u=280,height:d=160,valueColor:x="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:p="#ffffff"}=e,f=X(()=>Zl(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),h=l!=null&&l.length>1,g=n!=null&&n.length>0,b=y&&s>=0?m:c,S=20,A=g?d*.38:d*.45,T=Math.min(u*.15,48),M=T*.55,D=A+T*.4+8,L=g?D+22:A+T*.4+22,I=h?Math.min(d*.22,36):0,P=d-S-I,F=u-S*2,R=k(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:p,stroke:"#e5e7eb","stroke-width":"1"})],[u,d,p]),W=k(()=>{let O=[],G=r+f+i;return O.push(o("text",{key:"value",x:String(u/2),y:String(A),"text-anchor":"middle","dominant-baseline":"central","font-size":String(T),"font-weight":"bold","font-family":"sans-serif",fill:x,"aria-label":`Value: ${G}`},r?o("tspan",{key:"prefix","font-size":String(M),"font-weight":"normal"},r):null,f,i?o("tspan",{key:"suffix","font-size":String(M),"font-weight":"normal"},i):null)),O},[u,A,T,M,f,r,i,x]),z=k(()=>g?[o("text",{key:"label",x:String(u/2),y:String(D),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[g,u,D,n]),w=k(()=>{if(!y)return[];let O=[],G=s,q=G>=0,te=8,Z=Jl(G),Y=(q?"+":"-")+Z+(a?" "+a:""),U=u/2-40,V=L;if(q){let _=`${U},${V} ${U-te/2},${V+te} ${U+te/2},${V+te}`;O.push(o("polygon",{key:"trend-arrow",points:_,fill:b}))}else{let _=`${U},${V+te} ${U-te/2},${V} ${U+te/2},${V}`;O.push(o("polygon",{key:"trend-arrow",points:_,fill:b}))}return O.push(o("text",{key:"trend-text",x:String(U+te+4),y:String(V+te*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:b,"aria-label":`Trend: ${Y}`},Y)),O},[y,s,a,b,u,L]),v=k(()=>{if(!h)return[];let O=[],G=l,q=[];for(let Q of G)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&q.push(Q);if(q.length<2)return[];let te=1/0,Z=-1/0;for(let Q of q)Q<te&&(te=Q),Q>Z&&(Z=Q);te===Z&&(te-=1,Z+=1);let Y=Z-te,U=F/(q.length-1),V="";for(let Q=0;Q<q.length;Q++){let ie=S+Q*U,J=P+I-(q[Q]-te)/Y*I;Q===0?V+=`M ${ie} ${J}`:V+=` L ${ie} ${J}`}let _=S+(q.length-1)*U,K=V+` L ${_} ${P+I} L ${S} ${P+I} Z`;return O.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"})))),O.push(o("path",{key:"spark-fill",d:K,fill:"url(#sparkGrad)"})),O.push(o("path",{key:"spark-line",d:V,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),O},[h,l,F,P,I,S]),E=R(),C=W(),N=z(),$=w(),B=v(),H=`${r}${f}${i}${g?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${u} ${d}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":H,style:{fontFamily:"sans-serif"}},...E,...B,...C,...N,...$)}var Et=Math.PI/180;function Ql(e,t,n,r,i,s,a,l){let u=Math.cos(r*Et),d=Math.sin(r*Et),x=Math.cos(i*Et),m=Math.sin(i*Et),c=e*x+n*m,p=-e*m+n*x,f=t*u-p*d,y=t*d+p*u;return{sx:s+c*l,sy:a-f*l,depth:y}}function Qe(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 Rt(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))),u=Math.atan2(s,i);return{theta:l,phi:u<0?u+2*Math.PI:u}}function Fe(e,t,n){let{x:r,y:i,z:s}=Qe(e),a=Math.cos(n),l=Math.sin(n),u,d,x;return t==="x"?(u=r,d=i*a-s*l,x=i*l+s*a):t==="y"?(u=r*a+s*l,d=i,x=-r*l+s*a):(u=r*a-i*l,d=r*l+i*a,x=s),Rt(u,d,x)}function mn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return Fe(e,"x",Math.PI);case"Y":return Fe(e,"y",Math.PI);case"Z":return Fe(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=Qe(e);return Rt(s,-i,r)}case"S":return Fe(e,"z",Math.PI/2);case"T":return Fe(e,"z",Math.PI/4);case"Rx":return Fe(e,"x",n);case"Ry":return Fe(e,"y",n);case"Rz":return Fe(e,"z",n)}}function ti(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:u=!0,zoomable:d=!0,showVector:x=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:p=!0,trailMaxPoints:f=200,trailColor:y="#ef4444",wireframeColor:h="#cbd5e1",vectorColor:g="#3b82f6",backgroundColor:b,sphereRadius:S=130,title:A,onStateChange:T}=e,[M,D]=j(t??{theta:0,phi:0}),[L,I]=j(s),[P,F]=j(a),[R,W]=j(l),z=oe([]),w=oe(!1),v=oe(null),E=oe(null);se(()=>{t&&D(t)},[t?.theta,t?.phi]);let C=oe(0);se(()=>{if(!n||n.length===0)return;C.current=0;let U=0,V=()=>{C.current>=n.length||(D(_=>{let K=mn(_,n[C.current]);return C.current++,T&&T(K),K}),U=requestAnimationFrame(V))};return U=requestAnimationFrame(V),()=>cancelAnimationFrame(U)},[n]),se(()=>{let U=Qe(M);z.current.push(U),z.current.length>f&&z.current.splice(0,z.current.length-f)},[M.theta,M.phi]);let N=S*R,$=r/2,B=i/2,H=k((U,V,_)=>Ql(U,V,_,P,L,$,B,N),[P,L,$,B,N]),O=k(U=>{if(!u)return;let V=U;w.current=!0,v.current={mx:V.clientX,my:V.clientY,rx:P,ry:L}},[u,P,L]),G=k(U=>{if(!w.current||!v.current)return;let V=U,_=v.current;I(_.ry+(V.clientX-_.mx)*.5),F(_.rx-(V.clientY-_.my)*.5)},[]),q=k(()=>{w.current=!1},[]),te=k(U=>{if(!d)return;let V=U;V.preventDefault(),W(_=>Math.max(.5,Math.min(3,_*(V.deltaY>0?.95:1.05))))},[d]),Z=[];if(b&&Z.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b,rx:"6"})),A&&Z.push(o("text",{key:"title",x:String($),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},A)),c){let V=[];for(let Q=0;Q<=60;Q++){let ie=Q/60*2*Math.PI,J=H(Math.cos(ie),Math.sin(ie),0);V.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"eq",d:V.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.5"}));let _=[];for(let Q=0;Q<=60;Q++){let ie=Q/60*2*Math.PI,J=H(Math.cos(ie),0,Math.sin(ie));_.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"xz",d:_.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}));let K=[];for(let Q=0;Q<=60;Q++){let ie=Q/60*2*Math.PI,J=H(0,Math.cos(ie),Math.sin(ie));K.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"yz",d:K.join(" "),fill:"none",stroke:h,"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 V=H(U.dir[0]*1.15,U.dir[1]*1.15,U.dir[2]*1.15),_=H(-U.dir[0]*1.15,-U.dir[1]*1.15,-U.dir[2]*1.15),K=H(0,0,0);Z.push(o("line",{key:`axis-${U.id}`,x1:String(_.sx),y1:String(_.sy),x2:String(V.sx),y2:String(V.sy),stroke:U.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(m){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 V of U){let _=H(V.pos[0],V.pos[1],V.pos[2]);Z.push(o("text",{key:`lbl-${V.text}`,x:String(_.sx),y:String(_.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},V.text))}}if(p&&z.current.length>1){let U=z.current,V=[];for(let _=0;_<U.length;_++){let K=U[_],Q=H(K.x,K.y,K.z);V.push(`${_===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}Z.push(o("path",{key:"trail",d:V.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(x){let U=Qe(M),V=H(0,0,0),_=H(U.x,U.y,U.z);Z.push(o("line",{key:"vec-line",x1:String(V.sx),y1:String(V.sy),x2:String(_.sx),y2:String(_.sy),stroke:g,"stroke-width":"2.5","stroke-linecap":"round"})),Z.push(o("circle",{key:"vec-point",cx:String(_.sx),cy:String(_.sy),r:"5",fill:g,stroke:"#fff","stroke-width":"1.5"}));let K=(M.theta*180/Math.PI).toFixed(0),Q=(M.phi*180/Math.PI).toFixed(0);Z.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=${K}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:E,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":A??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:u?w.current?"grabbing":"grab":"default"},onMouseDown:u?O:void 0,onMouseMove:u?G:void 0,onMouseUp:u?q:void 0,onMouseLeave:u?q:void 0,onWheel:d?te:void 0},...Z)}function ec(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 hn(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 bn(e){let t=ec(e);if(t.length===0)return null;let n=hn(t,25),r=hn(t,50),i=hn(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,u=t[0];for(let p of t)if(p>=a){u=p;break}let d=t[t.length-1];for(let p=t.length-1;p>=0;p--)if(t[p]<=l){d=t[p];break}let x=0;for(let p of t)x+=p;let m=x/t.length,c=[];for(let p of t)(p<a||p>l)&&c.push(p);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:u,whiskerHigh:d,mean:m,outliers:c,min:t[0],max:t[t.length-1]}}function tc(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 ni(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:u=.6,showGrid:d=!0,title:x,padding:m=60}=e,c=i==="vertical",p=n-m*2,f=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],h=X(()=>{let v=[];for(let E of t)v.push(bn(E.values));return v},[t]),g=X(()=>{let v=1/0,E=-1/0;for(let $ of h){if($===null)continue;let B=s&&$.outliers.length>0?Math.min($.whiskerLow,$.outliers[0]):$.whiskerLow,H=s&&$.outliers.length>0?Math.max($.whiskerHigh,$.outliers[$.outliers.length-1]):$.whiskerHigh;B<v&&(v=B),H>E&&(E=H)}isFinite(v)||(v=0,E=1);let C=E-v,N=C>0?C*.05:.5;return{min:v-N,max:E+N}},[h,s]),b=c?f:p,S=c?p:f,A=t.length>0?t.length:1,T=S/A,M=T*Math.min(Math.max(u,.1),.95),D=k(v=>{let E=g.max-g.min;return E===0?b/2:(v-g.min)/E*b},[g,b]),L=k(()=>{if(!d)return[];let v=[],E=g.max-g.min,C=tc(E),N=Math.ceil(g.min/C)*C;for(let $=N;$<=g.max;$+=C){let B=D($),H=String(Math.round($*1e3)/1e3);if(c){let O=m+f-B;v.push(o("line",{key:`grid-${$}`,x1:String(m),y1:String(O),x2:String(m+p),y2:String(O),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),v.push(o("text",{key:`glabel-${$}`,x:String(m-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}else{let O=m+B;v.push(o("line",{key:`grid-${$}`,x1:String(O),y1:String(m),x2:String(O),y2:String(m+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),v.push(o("text",{key:`glabel-${$}`,x:String(O),y:String(m+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}}return v},[d,g,D,c,m,p,f]),I=k(()=>{let v=[];return v.push(o("line",{key:"axis-value",x1:String(m),y1:String(c?m:m+f),x2:String(m),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),v.push(o("line",{key:"axis-category",x1:String(m),y1:String(m+f),x2:String(m+p),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),v},[m,p,f,c]),P=k(()=>{let v=[];for(let E=0;E<t.length;E++){let C=h[E];if(C===null)continue;let N=t[E],$=N.color??y[E%y.length],B=T*E+T/2,H=M/2;if(c){let O=m+f-D(C.q1),G=m+f-D(C.q3),q=m+f-D(C.median),te=m+f-D(C.whiskerLow),Z=m+f-D(C.whiskerHigh),Y=m+B;v.push(o("line",{key:`wl-${E}`,x1:String(Y),y1:String(O),x2:String(Y),y2:String(te),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`wlc-${E}`,x1:String(Y-H*.4),y1:String(te),x2:String(Y+H*.4),y2:String(te),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`wh-${E}`,x1:String(Y),y1:String(G),x2:String(Y),y2:String(Z),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`whc-${E}`,x1:String(Y-H*.4),y1:String(Z),x2:String(Y+H*.4),y2:String(Z),stroke:l,"stroke-width":"1.5"}));let U=Math.min(O,G),V=Math.abs(O-G);if(v.push(o("rect",{key:`box-${E}`,x:String(Y-H),y:String(U),width:String(M),height:String(Math.max(V,1)),fill:$,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${C.q1.toFixed(1)}, median=${C.median.toFixed(1)}, Q3=${C.q3.toFixed(1)}`,role:"img"})),v.push(o("line",{key:`med-${E}`,x1:String(Y-H),y1:String(q),x2:String(Y+H),y2:String(q),stroke:"#fff","stroke-width":"2.5"})),a){let _=m+f-D(C.mean);v.push(o("circle",{key:`mean-${E}`,cx:String(Y),cy:String(_),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${C.mean.toFixed(1)}`}))}if(s)for(let _=0;_<C.outliers.length;_++){let K=m+f-D(C.outliers[_]);v.push(o("circle",{key:`out-${E}-${_}`,cx:String(Y),cy:String(K),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${C.outliers[_]}`}))}v.push(o("text",{key:`cat-${E}`,x:String(Y),y:String(m+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}else{let O=m+D(C.q1),G=m+D(C.q3),q=m+D(C.median),te=m+D(C.whiskerLow),Z=m+D(C.whiskerHigh),Y=m+B;v.push(o("line",{key:`wl-${E}`,x1:String(O),y1:String(Y),x2:String(te),y2:String(Y),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`wlc-${E}`,x1:String(te),y1:String(Y-H*.4),x2:String(te),y2:String(Y+H*.4),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`wh-${E}`,x1:String(G),y1:String(Y),x2:String(Z),y2:String(Y),stroke:l,"stroke-width":"1.5"})),v.push(o("line",{key:`whc-${E}`,x1:String(Z),y1:String(Y-H*.4),x2:String(Z),y2:String(Y+H*.4),stroke:l,"stroke-width":"1.5"}));let U=Math.min(O,G),V=Math.abs(G-O);if(v.push(o("rect",{key:`box-${E}`,x:String(U),y:String(Y-H),width:String(Math.max(V,1)),height:String(M),fill:$,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${C.q1.toFixed(1)}, median=${C.median.toFixed(1)}, Q3=${C.q3.toFixed(1)}`,role:"img"})),v.push(o("line",{key:`med-${E}`,x1:String(q),y1:String(Y-H),x2:String(q),y2:String(Y+H),stroke:"#fff","stroke-width":"2.5"})),a){let _=m+D(C.mean);v.push(o("circle",{key:`mean-${E}`,cx:String(_),cy:String(Y),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${C.mean.toFixed(1)}`}))}if(s)for(let _=0;_<C.outliers.length;_++){let K=m+D(C.outliers[_]);v.push(o("circle",{key:`out-${E}-${_}`,cx:String(K),cy:String(Y),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${C.outliers[_]}`}))}v.push(o("text",{key:`cat-${E}`,x:String(m-6),y:String(Y+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}}return v},[t,h,D,c,m,p,f,T,M,l,s,a,y]),F=k(()=>x?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n,m]),R=L(),W=I(),z=P(),w=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":x??"Box plot",style:{fontFamily:"sans-serif"}},...w,...R,...W,...z)}function oi(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 nc(e,t,n){return e<t?t:e>n?n:e}function xn(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function ri(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:u=!1,maxBubbleRadius:d=40,minBubbleRadius:x=4,defaultColor:m="#3b82f6",opacity:c=.7,title:p,padding:f=60}=e,y=X(()=>{let z=[];for(let w=0;w<t.length;w++){let v=t[w];xn(v.x)&&xn(v.y)&&xn(v.r)&&z.push(v)}return z},[t]),h=n-f*2,g=r-f*2,b=X(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let z=1/0,w=-1/0,v=1/0,E=-1/0,C=1/0,N=-1/0;for(let $ of y)$.x<z&&(z=$.x),$.x>w&&(w=$.x),$.y<v&&(v=$.y),$.y>E&&(E=$.y),$.r<C&&(C=$.r),$.r>N&&(N=$.r);return z===w&&(z-=1,w+=1),v===E&&(v-=1,E+=1),C===N&&(C=0,N=N>0?N:1),{xMin:z,xMax:w,yMin:v,yMax:E,rMin:C,rMax:N}},[y]),S=k(z=>{let w=b.xMax-b.xMin;return f+(z-b.xMin)/w*h},[b,f,h]),A=k(z=>{let w=b.yMax-b.yMin;return f+g-(z-b.yMin)/w*g},[b,f,g]),T=k(z=>{let w=b.rMax-b.rMin;if(w===0)return(x+d)/2;let v=(z-b.rMin)/w;return x+v*(d-x)},[b,x,d]),M=k(()=>{if(!a)return[];let z=[],w=oi(b.xMax-b.xMin),v=Math.ceil(b.xMin/w)*w;for(let N=v;N<=b.xMax;N+=w){let $=S(N);z.push(o("line",{key:`grid-x-${N}`,x1:String($),y1:String(f),x2:String($),y2:String(f+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-xlabel-${N}`,x:String($),y:String(f+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}let E=oi(b.yMax-b.yMin),C=Math.ceil(b.yMin/E)*E;for(let N=C;N<=b.yMax;N+=E){let $=A(N);z.push(o("line",{key:`grid-y-${N}`,x1:String(f),y1:String($),x2:String(f+h),y2:String($),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-ylabel-${N}`,x:String(f-6),y:String($+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}return z},[a,b,S,A,f,h,g]),D=k(()=>{if(!l)return[];let z=[];return z.push(o("line",{key:"axis-y",x1:String(f),y1:String(f),x2:String(f),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),z.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+g),x2:String(f+h),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),i&&z.push(o("text",{key:"x-label",x:String(f+h/2),y:String(f+g+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&z.push(o("text",{key:"y-label",x:String(f-40),y:String(f+g/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${f-40}, ${f+g/2})`},s)),z},[l,f,h,g,i,s]),L=k(()=>{let z=[];for(let w=0;w<y.length;w++){let v=y[w],E=S(v.x),C=A(v.y),N=nc(T(v.r),x,d),$=v.color??m;z.push(o("circle",{key:`bubble-${w}`,cx:String(E),cy:String(C),r:String(N),fill:$,opacity:String(c),stroke:$,"stroke-width":"1","stroke-opacity":"0.8","aria-label":v.label??`Bubble at (${v.x}, ${v.y}) size ${v.r}`,role:"img"})),u&&v.label&&z.push(o("text",{key:`label-${w}`,x:String(E),y:String(C-N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},v.label))}return z},[y,S,A,T,m,c,u,x,d]),I=k(()=>p?[o("text",{key:"title",x:String(n/2),y:String(f/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,f]),P=M(),F=D(),R=L(),W=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Bubble chart",style:{fontFamily:"sans-serif"}},...W,...P,...F,...R)}var oc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function ic(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 ii(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 si(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 sc(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 ac(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=si(t[i]),l=si(t[i+1]);return sc(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var lc=["#9be9a8","#40c463","#30a14e","#216e39"];function ai(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=lc,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:u=!0,emptyColor:d="#ebedf0",title:x}=e,{dateMap:m,startDate:c,endDate:p,maxVal:f}=X(()=>{let R=new Map,W=0,z=null,w=null;for(let C of t){let N=ic(C.date);if(isNaN(N.getTime()))continue;let $=ii(N);R.set($,(R.get($)??0)+C.value);let B=R.get($);B>W&&(W=B),(z===null||N<z)&&(z=N),(w===null||N>w)&&(w=N)}if(z===null||w===null){let C=new Date;z=new Date(C.getFullYear(),0,1),w=new Date(C.getFullYear(),11,31)}let v=new Date(z);v.setDate(v.getDate()-v.getDay());let E=new Date(w);return E.setDate(E.getDate()+(6-E.getDay())),{dateMap:R,startDate:v,endDate:E,maxVal:W>0?W:1}},[t]),y=u?30:0,h=l?16:0,g=x?28:0,b=y+10,S=g+h+4,A=k(()=>{let R=[],W=new Date(c),z=0;for(;W<=p;){let w=W.getDay();w===0&&W>c&&z++;let v=ii(W),E=m.get(v),C=E!==void 0&&E>0?ac(E/f,i):d,N=b+z*(s+a),$=S+w*(s+a);R.push(o("rect",{key:`day-${v}`,x:String(N),y:String($),width:String(s),height:String(s),rx:"2",ry:"2",fill:C,"aria-label":`${v}: ${E??0}`})),W.setDate(W.getDate()+1)}return R},[c,p,m,f,i,d,s,a,b,S]),T=k(()=>{if(!l)return[];let R=[],W=new Date(c),z=0,w=-1;for(;W<=p;){let v=W.getDay();v===0&&W>c&&z++;let E=W.getMonth();if(E!==w&&v===0){w=E;let C=b+z*(s+a);R.push(o("text",{key:`month-${z}`,x:String(C),y:String(g+h-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},oc[E]))}W.setDate(W.getDate()+1)}return R},[l,c,p,s,a,b,g,h]),M=k(()=>{if(!u)return[];let R=[],W=[1,3,5];for(let z of W){let w=S+z*(s+a)+s/2;R.push(o("text",{key:`day-label-${z}`,x:String(y),y:String(w),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},rc[z]))}return R},[u,s,a,S,y]),D=k(()=>x?[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"},x)]:[],[x,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":x??"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 L=D(),I=T(),P=M(),F=A();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??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...I,...P,...F)}var cc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function De(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function uc(e,t,n,r,i,s){let a=De(e,t,n,i),l=De(e,t,n,s),u=De(e,t,r,i),d=De(e,t,r,s),m=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${m} 1 ${l.x} ${l.y}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${m} 0 ${u.x} ${u.y}`,"Z"].join(" ")}function dc(e,t,n,r,i,s,a){let l=De(e,t,n,r),u=De(e,t,n,i),d=De(e,t,n,s),x=De(e,t,n,a),m=i-r,c=a-s,p=m>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${p} 1 ${u.x} ${u.y}`,`Q ${e} ${t} ${d.x} ${d.y}`,`A ${n} ${n} 0 ${f} 1 ${x.x} ${x.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function fc(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 p=0;for(let f=0;f<i;f++){let y=e[c]?.[f]??0;p+=Math.max(0,y)}s.push(p),a+=p}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),p=[],f=0;for(let y=0;y<i;y++)p.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:f,endAngle:f+c,value:0}),f+=c+r;return{groups:p,chords:[]}}let l=2*Math.PI-i*r,u=[],d=0;for(let c=0;c<i;c++){let p=s[c]/a*l;u.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:d,endAngle:d+p,value:s[c]}),d+=p+r}let x=[];for(let c=0;c<i;c++)x.push(u[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let p=c;p<i;p++){let f=Math.max(0,e[c]?.[p]??0),y=c===p?0:Math.max(0,e[p]?.[c]??0);if(f===0&&y===0)continue;let h=f+y,g=s[c]>0?f/a*l:0,b=x[c],S=b+g;x[c]=S;let A=s[p]>0?f/a*l:0,T=x[p],M=T+A;if(x[p]=M,c===p){f>0&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:b,sourceEndAngle:S,targetStartAngle:T,targetEndAngle:M,value:f,color:u[c].color});continue}let D=s[p]>0?y/a*l:0,I=x[p]+D;x[p]=I;let P=s[c]>0?y/a*l:0,R=x[c]+P;x[c]=R,(f>0||y>0)&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:b,sourceEndAngle:Math.max(S,b+.001),targetStartAngle:T,targetEndAngle:Math.max(M,T+.001),value:h,color:u[c].color})}return{groups:u,chords:m}}function li(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=cc,padAngle:a=.05,showLabels:l=!0,showValues:u=!1,ribbonOpacity:d=.5,innerRadiusRatio:x=.9,title:m}=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":m??"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,p=i/2,f=Math.min(r,i)/2-40,y=f*Math.max(.5,Math.min(.99,x)),h=f+16,g=X(()=>fc(t,n,s,a),[t,n,s,a]),b=k(()=>{let L=[];for(let I=0;I<g.groups.length;I++){let P=g.groups[I];if(P.endAngle-P.startAngle<.001)continue;let R=uc(c,p,f,y,P.startAngle,P.endAngle);if(L.push(o("path",{key:`arc-${I}`,d:R,fill:P.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${P.label}: ${P.value}`})),l){let W=(P.startAngle+P.endAngle)/2,z=De(c,p,h,W),E=((W-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,C=E?"start":"end",N=W*180/Math.PI-90;E||(N+=180);let $=u?`${P.label} (${P.value})`:P.label;L.push(o("text",{key:`label-${I}`,x:String(z.x),y:String(z.y),"text-anchor":C,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${N}, ${z.x}, ${z.y})`,"dominant-baseline":"central","pointer-events":"none"},$))}}return L},[g,c,p,f,y,h,l,u]),S=k(()=>{let L=[];for(let I=0;I<g.chords.length;I++){let P=g.chords[I],F=dc(c,p,y,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);L.push(o("path",{key:`ribbon-${I}`,d:F,fill:P.color,"fill-opacity":String(d),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[g,c,p,y,d]),A=k(()=>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]),T=S(),M=b(),D=A();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??"Chord diagram",style:{fontFamily:"sans-serif"}},...D,...T,...M)}var pc=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function gc(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),u=n++;i=Math.max(i,a);let d=s.children??[],x=[];for(let m=0;m<d.length;m++)x.push(n+r.length+m);t.push({id:u,node:s,depth:a,parentId:l,childIndices:x});for(let m=0;m<d.length;m++)r.push([d[m],a+1,u])}return{flatNodes:t,maxDepth:i}}function mc(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 hc(e,t,n,r,i,s,a,l){let{flatNodes:u,maxDepth:d}=gc(e);if(u.length===0)return[];let x=mc(u),m=t-s*2,c=n-s*2,p=a==="horizontal",f=d+1,y=p?f>1?(m-r)/d:0:f>1?(c-i)/d:0,h=new Array(u.length),g=x[0],b=p?c:m,S=g>0?b/g:b,A=new Array(u.length);A[0]=[0,g];let T=[0],M=0;for(;M<T.length;){let D=T[M];M++;let L=u[D],[I,P]=A[D],F=(I+P)/2,R=s+L.depth*y,W=s+(F-.5)*S,z=p?R:W,w=p?W:R,v=L.node.color??l[L.depth%l.length];h[D]={id:L.id,label:L.node.label,value:L.node.value!==void 0?String(L.node.value):"",color:v,depth:L.depth,x:z,y:w,parentId:L.parentId,childCount:L.childIndices.length,subtreeLeafCount:x[D]};let E=I;for(let C of L.childIndices)if(C<u.length){let N=x[C],$=E+N;A[C]=[E,$],E=$,T.push(C)}}return h}function ci(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:u=!0,connectorColor:d="#94a3b8",colors:x=pc,title:m,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":m??"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 p=i==="horizontal",f=X(()=>hc(t,n,r,s,a,c,i,x),[t,n,r,s,a,c,i,x]),y=X(()=>{let M=new Map;for(let D=0;D<f.length;D++){let L=f[D];M.set(L.id,L)}return M},[f]),h=k(()=>{if(!u)return[];let M=[];for(let D=0;D<f.length;D++){let L=f[D];if(L.parentId===null)continue;let I=y.get(L.parentId);if(!I)continue;let P,F,R,W;p?(P=I.x+s,F=I.y+a/2,R=L.x,W=L.y+a/2):(P=I.x+s/2,F=I.y+a,R=L.x+s/2,W=L.y);let z=(P+R)/2,w=(F+W)/2,v;p?v=`M ${P} ${F} C ${z} ${F}, ${z} ${W}, ${R} ${W}`:v=`M ${P} ${F} C ${P} ${w}, ${R} ${w}, ${R} ${W}`,M.push(o("path",{key:`conn-${D}`,d:v,fill:"none",stroke:d,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return M},[f,y,p,s,a,u,d]),g=k(()=>{let M=[];for(let D=0;D<f.length;D++){let L=f[D];M.push(o("rect",{key:`node-rect-${L.id}`,x:String(L.x),y:String(L.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:L.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":L.value?`${L.label}: ${L.value}`:L.label}));let I=l&&L.value?L.y+a/2-2:L.y+a/2+4;M.push(o("text",{key:`node-label-${L.id}`,x:String(L.x+s/2),y:String(I),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},L.label)),l&&L.value&&M.push(o("text",{key:`node-value-${L.id}`,x:String(L.x+s/2),y:String(L.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},L.value))}return M},[f,s,a,l]),b=k(()=>m?[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"},m)]:[],[m,n]),S=h(),A=g(),T=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":m??"Decomposition tree",style:{fontFamily:"sans-serif"}},...T,...S,...A)}var ui=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function bc(e){return ui[e%ui.length]}function di(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let u=0;u<a;u++){let d=e[u],x=2*Math.PI*u/Math.max(a,1);l.push({id:d.id,label:d.label??d.id,color:d.color??bc(u),x:d.x??r+s*Math.cos(x),y:d.y??i+s*Math.sin(x),vx:0,vy:0,fixed:d.fixed??!1,solid:d.solid??!0})}return l}function fi(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,u=a.y-i.y,d=l*l+u*u;if(d>=n*n||d<1e-4)continue;let x=Math.sqrt(d),m=l/x,c=u/x,p=n-x;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*p,a.y+=c*p):a.fixed?(i.x-=m*p,i.y-=c*p):(i.x-=m*p*.5,i.y-=c*p*.5,a.x+=m*p*.5,a.y+=c*p*.5);let f=i.vx-a.vx,y=i.vy-a.vy,h=f*m+y*c;h<=0||(i.fixed?(a.vx+=h*m,a.vy+=h*c):a.fixed?(i.vx-=h*m,i.vy-=h*c):(i.vx-=h*m,i.vy-=h*c,a.vx+=h*m,a.vy+=h*c))}}}function xc(e,t,n,r,i,s,a,l,u=12){let d=e.length;if(d===0)return e;let x=new Map;for(let b=0;b<d;b++)x.set(e[b].id,b);let m=new Float64Array(d),c=new Float64Array(d);for(let b=0;b<d;b++){let S=e[b];for(let A=b+1;A<d;A++){let T=e[A],M=S.x-T.x,D=S.y-T.y,L=M*M+D*D;L<1&&(L=1);let I=Math.sqrt(L),P=i/L,F=M/I*P,R=D/I*P;m[b]+=F,c[b]+=R,m[A]-=F,c[A]-=R}}for(let b=0;b<t.length;b++){let S=t[b],A=x.get(S.source),T=x.get(S.target);if(A===void 0||T===void 0)continue;let M=e[A],D=e[T],L=D.x-M.x,I=D.y-M.y,P=Math.sqrt(L*L+I*I);if(P<.1)continue;let F=S.weight??1,R=P-l,W=s*R*F,z=L/P*W,w=I/P*W;m[A]+=z,c[A]+=w,m[T]-=z,c[T]-=w}let p=n/2,f=r/2,y=.001;for(let b=0;b<d;b++){let S=e[b];m[b]+=(p-S.x)*y,c[b]+=(f-S.y)*y}let h=20,g=[];for(let b=0;b<d;b++){let S=e[b];if(S.fixed){g.push({...S,vx:0,vy:0});continue}let A=(S.vx+m[b])*a,T=(S.vy+c[b])*a,M=Math.sqrt(A*A+T*T),D=10;M>D&&(A=A/M*D,T=T/M*D);let L=S.x+A,I=S.y+T;L=Math.max(h,Math.min(n-h,L)),I=Math.max(h,Math.min(r-h,I)),g.push({...S,x:L,y:I,vx:A,vy:T})}return fi(g,u),g}function yc(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 pi(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:u=!0,showArrows:d=!1,repulsionForce:x=300,attractionForce:m=.01,damping:c=.9,edgeLength:p=100,edgeColor:f="#94a3b8",edgeWidth:y=1.5,title:h,customForce:g,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":h??"Empty force-directed graph"},h?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"},h):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=oe(di(t,r,i)),[A,T]=j(0),M=oe(!0),D=oe(!1),L=oe(n);L.current=n;let I=oe(g);I.current=g;let P=oe(null),F=oe({repulsionForce:x,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l});F.current={repulsionForce:x,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l};let R=oe(new Map);se(()=>{S.current=di(t,r,i),D.current=!1,M.current=!0,R.current=new Map,T(ie=>ie+1)},[t.length]),se(()=>{let ie=0,J=()=>{if(!M.current)return;let re=F.current,ae=I.current,ne;if(ae?(ne=ae(S.current,L.current,re.width,re.height,P.current),re.solidNodes&&fi(ne,re.nodeRadius)):ne=xc(S.current,L.current,re.width,re.height,re.repulsionForce,re.attractionForce,re.damping,re.edgeLength,re.nodeRadius),S.current=ne,b)for(let ee=0;ee<b.length;ee++){let le=b[ee],ue=ne.find(me=>me.id===le.nodeId);if(!ue)continue;let ce=R.current.get(le.nodeId);ce||(ce=[],R.current.set(le.nodeId,ce)),ce.push({x:ue.x,y:ue.y});let de=le.maxPoints??200;ce.length>de&&ce.splice(0,ce.length-de)}if(!ae&&yc(ne)<.01){D.current=!0,T(ee=>ee+1);return}T(ee=>ee+1),ie=requestAnimationFrame(J)};return ie=requestAnimationFrame(J),()=>{M.current=!1,cancelAnimationFrame(ie)}},[]);let W=S.current,z=k(ie=>{S.current=S.current.map(J=>J.id===ie?{...J,fixed:!J.fixed,vx:0,vy:0}:J),D.current&&(D.current=!1,M.current=!0,T(J=>J+1))},[]),w=oe(null),v=oe(null),E=k(ie=>{let J=ie,re=v.current;if(!re)return{x:J.clientX,y:J.clientY};let ae=re.getBoundingClientRect(),ne=r/ae.width,ee=i/ae.height;return{x:(J.clientX-ae.left)*ne,y:(J.clientY-ae.top)*ee}},[r,i]),C=oe(!1),N=k((ie,J)=>{J.stopPropagation(),w.current=ie;let re=S.current.find(ae=>ae.id===ie);C.current=re?.fixed??!1,S.current=S.current.map(ae=>ae.id===ie?{...ae,fixed:!0,vx:0,vy:0}:ae)},[]),$=k(ie=>{let J=E(ie);if(P.current={x:J.x,y:J.y},!w.current)return;let re=w.current,ae=20;S.current=S.current.map(ne=>ne.id===re?{...ne,x:Math.max(ae,Math.min(r-ae,J.x)),y:Math.max(ae,Math.min(i-ae,J.y))}:ne),D.current&&(D.current=!1,M.current=!0),T(ne=>ne+1)},[r,i,E]),B=k(()=>{let ie=w.current;ie&&(S.current=S.current.map(J=>J.id===ie?{...J,fixed:C.current}:J)),w.current=null},[]),H=k(()=>{w.current=null,P.current=null},[]),O=X(()=>{let ie=new Map;for(let J=0;J<W.length;J++)ie.set(W[J].id,W[J]);return ie},[A]),G=k(()=>d?[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:f})))]:[],[d,s,f]),q=k(()=>{let ie=[];for(let J=0;J<n.length;J++){let re=n[J],ae=O.get(re.source),ne=O.get(re.target);if(!ae||!ne||re.weight!==void 0&&re.weight<=0)continue;let ee=re.weight?Math.max(.5,Math.min(6,y*re.weight)):y,le={key:`edge-${J}`,x1:String(ae.x),y1:String(ae.y),x2:String(ne.x),y2:String(ne.y),stroke:re.color??f,"stroke-width":String(ee),"stroke-opacity":"0.6"};d&&(le["marker-end"]="url(#arrowhead)"),ie.push(o("line",le))}return ie},[A,f,y,d]),te=k(()=>{let ie=[];for(let J=0;J<W.length;J++){let re=W[J];ie.push(o("circle",{key:`node-${re.id}`,cx:String(re.x),cy:String(re.y),r:String(s),fill:re.color,stroke:re.fixed?"#0f172a":"#fff","stroke-width":re.fixed?"3":String(a),style:{cursor:w.current===re.id?"grabbing":"grab"},onMouseDown:ae=>N(re.id,ae),onDblClick:()=>z(re.id),role:"button",tabIndex:0,"aria-label":`Node: ${re.label}${re.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),u&&ie.push(o("text",{key:`label-${re.id}`,x:String(re.x),y:String(re.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},re.label))}return ie},[A,s,u,z]),Z=k(()=>h?[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"},h)]:[],[h,r]),Y=k(()=>{if(!b||b.length===0)return[];let ie=[];for(let J=0;J<b.length;J++){let re=b[J],ae=R.current.get(re.nodeId);if(!ae||ae.length<2)continue;let ne=[];for(let ee=0;ee<ae.length;ee++){let le=ae[ee];ne.push(`${ee===0?"M":"L"}${le.x.toFixed(1)},${le.y.toFixed(1)}`)}ie.push(o("path",{key:`trail-${re.nodeId}`,d:ne.join(" "),fill:"none",stroke:re.color??"#3b82f6","stroke-width":String(re.width??1),opacity:String(re.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return ie},[A,b]),U=G(),V=Y(),_=q(),K=te(),Q=Z();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":h??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:w.current?"grabbing":"default"},onMouseMove:$,onMouseUp:B,onMouseLeave:H},...U,...Q,...V,..._,...K)}var gi=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function mi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:s=!0,showValues:a=!0,showPercentage:l=!0,gapSize:u=2,colors:d=gi,title:x}=e,m=i==="vertical",c=x?30:0,p=120,f=X(()=>{let L=0;for(let I=0;I<t.length;I++)t[I].value>L&&(L=t[I].value);return L>0?L:1},[t]),y=k(L=>f===0?0:Math.max(.05,L/f),[f]),h=k((L,I)=>I||(d[L%d.length]??gi[0]),[d]),g=k(()=>{if(t.length===0)return[];let L=[],I=40,P=n-I*2-p,F=r-c-I*2,R=u*(t.length-1),W=Math.max(1,(F-R)/t.length),z=I+P/2;for(let w=0;w<t.length;w++){let v=t[w],E=w<t.length-1?t[w+1]:null,C=h(w,v.color),N=y(v.value),$=E!==null?y(E.value):N*.6,B=P/2*N,H=P/2*$,O=c+I+w*(W+u),G=z-B,q=z+B,te=z+H,Z=z-H,Y=`${G},${O} ${q},${O} ${te},${O+W} ${Z},${O+W}`;L.push(o("polygon",{key:`section-${w}`,points:Y,fill:C,stroke:"#fff","stroke-width":"1"}));let U=I+P+12,V=O+W/2;if(s&&L.push(o("text",{key:`label-${w}`,x:String(U),y:String(V-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},v.label)),a||l){let _="";if(a&&(_=String(v.value)),l&&t.length>0){let K=t[0].value,Q=K>0?Math.round(v.value/K*100):0;_+=a?` (${Q}%)`:`${Q}%`}L.push(o("text",{key:`value-${w}`,x:String(U),y:String(V+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return L},[t,n,r,c,u,s,a,l,h,y,p]),b=k(()=>{if(t.length===0)return[];let L=[],I=40,P=n-I*2,R=r-c-I*2-40,W=u*(t.length-1),z=Math.max(1,(P-W)/t.length),w=c+I+R/2;for(let v=0;v<t.length;v++){let E=t[v],C=v<t.length-1?t[v+1]:null,N=h(v,E.color),$=y(E.value),B=C!==null?y(C.value):$*.6,H=R/2*$,O=R/2*B,G=I+v*(z+u),q=w-H,te=w-O,Z=w+O,Y=w+H,U=`${G},${q} ${G+z},${te} ${G+z},${Z} ${G},${Y}`;L.push(o("polygon",{key:`section-${v}`,points:U,fill:N,stroke:"#fff","stroke-width":"1"}));let V=G+z/2,_=c+I+R+14;if(s&&L.push(o("text",{key:`label-${v}`,x:String(V),y:String(_),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},E.label)),a||l){let K="";if(a&&(K=String(E.value)),l&&t.length>0){let Q=t[0].value,ie=Q>0?Math.round(E.value/Q*100):0;K+=a?` (${ie}%)`:`${ie}%`}L.push(o("text",{key:`value-${v}`,x:String(V),y:String(_+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},K))}}return L},[t,n,r,c,u,s,a,l,h,y]),S=k(()=>x?[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"},x)]:[],[x,n]),A=k(()=>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]),T=S(),M=m?g():b(),D=A();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??"Funnel chart",style:{fontFamily:"sans-serif"}},...T,...M,...D)}var hi=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function bi(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 Sc(e,t){return t||hi[e%hi.length]}function xi(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:u=!1,timeUnit:d="days",title:x,padding:m=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":x??"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,p=X(()=>{let F=1/0,R=-1/0;for(let W of t){W.start<F&&(F=W.start);let z=W.start+W.duration;z>R&&(R=z)}return F===1/0&&(F=0,R=1),{min:F,max:R,range:R-F}},[t]),f=X(()=>{let F=t.slice();return F.sort((R,W)=>R.group!==W.group?(R.group??"").localeCompare(W.group??""):R.start-W.start),F},[t]),y=r??m*2+f.length*(i+s)+s+20,h=n-m-c-m,g=m+(x?20:0),b=k(F=>p.range===0?c+m:c+m+(F-p.min)/p.range*h,[p,h,c,m]),S=k(()=>{if(!a)return[];let F=[],R=bi(p.range),W=Math.ceil(p.min/R)*R,z=g+f.length*(i+s)+s;for(let w=W;w<=p.max;w+=R){let v=b(w);F.push(o("line",{key:`grid-${w}`,x1:String(v),y1:String(g),x2:String(v),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return F},[a,p,g,f.length,i,s,b]),A=k(()=>{let F=[],R=bi(p.range),W=Math.ceil(p.min/R)*R,z=g-8;for(let w=W;w<=p.max;w+=R){let v=b(w);F.push(o("text",{key:`taxis-${w}`,x:String(v),y:String(z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(w)))}return F.push(o("text",{key:"time-unit",x:String(n-m),y:String(z),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},d)),F},[p,g,b,d,n,m]),T=k(()=>{let F=[],R="";for(let W=0;W<f.length;W++){let z=f[W],w=g+W*(i+s)+s,v=b(z.start),E=Math.max(2,b(z.start+z.duration)-v),C=Sc(W,z.color);z.group&&z.group!==R&&(R=z.group,l&&F.push(o("text",{key:`group-${W}`,x:String(m),y:String(w+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},z.group))),F.push(o("rect",{key:`bar-${z.id}`,x:String(v),y:String(w),width:String(E),height:String(i),rx:"4",ry:"4",fill:C,role:"graphics-symbol","aria-label":`${z.label}: start ${z.start}, duration ${z.duration}`})),l&&F.push(o("text",{key:`label-${z.id}`,x:String(c+m-8),y:String(w+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},z.label.length>16?z.label.substring(0,14)+"..":z.label)),u&&E>30&&F.push(o("text",{key:`prog-${z.id}`,x:String(v+E/2),y:String(w+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${z.start}-${z.start+z.duration}`))}return F},[f,g,i,s,b,l,u,c,m]),M=k(()=>x?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},x)]:[],[x,n,m]),D=S(),L=A(),I=T(),P=M();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...D,...L,...I)}var vc=Math.PI/180;function wc(e){return e*vc}function ze(e,t,n,r){let i=wc(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function yi(e,t,n,r,i){let s=ze(e,t,n,i),a=ze(e,t,n,r),l=i-r,u=Math.abs(l)>180?1:0,d=l>0?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${u} ${d===1?0:1} ${a.x} ${a.y}`}function kc(e,t,n){return e<t?t:e>n?n:e}function _e(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function Si(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:u=20,showValue:d=!0,showMinMax:x=!0,showTicks:m=!0,tickCount:c=10,label:p,unit:f,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:h="#374151",backgroundColor:g="#e5e7eb"}=e,b=isFinite(n)&&!isNaN(n)?n:0,S=isFinite(r)&&!isNaN(r)&&r>b?r:b+100,A=isFinite(t)&&!isNaN(t)?kc(t,b,S):b,T=(d?24:0)+(p?18:0),M=i/2,D=(s-T)*.6,L=Math.min(i/2,(s-T)*.55)-u/2-10,I=L-u,P=L-u/2,F=l-a,R=k(Y=>{let U=S-b;if(U===0)return a;let V=(Y-b)/U;return a+V*F},[b,S,a,F]),W=k(()=>{let Y=yi(M,D,P,a,l);return[o("path",{key:"bg-arc",d:Y,fill:"none",stroke:g,"stroke-width":String(u),"stroke-linecap":"round"})]},[M,D,P,a,l,g,u]),z=k(()=>{if(y.length===0)return[];let Y=[],U=F/y.length;for(let V=0;V<y.length;V++){let _=a+V*U,K=_+U,Q=yi(M,D,P,_,K);Y.push(o("path",{key:`seg-${V}`,d:Q,fill:"none",stroke:y[V],"stroke-width":String(u),"stroke-linecap":V===0||V===y.length-1?"round":"butt",opacity:"0.85"}))}return Y},[y,F,a,M,D,P,u]),w=k(()=>{if(!m||c<=0)return[];let Y=[],U=Math.max(1,Math.min(c,100));for(let V=0;V<=U;V++){let _=V/U,K=a+_*F,Q=V%2===0,ie=Q?10:6,J=ze(M,D,L+4,K),re=ze(M,D,L+4+ie,K);if(Y.push(o("line",{key:`tick-${V}`,x1:String(J.x),y1:String(J.y),x2:String(re.x),y2:String(re.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let ae=b+_*(S-b),ne=ze(M,D,L+4+ie+12,K);Y.push(o("text",{key:`tick-label-${V}`,x:String(ne.x),y:String(ne.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},_e(ae)))}}return Y},[m,c,a,F,M,D,L,b,S]),v=k(()=>{let Y=[],U=R(A),V=I-8,_=ze(M,D,V,U),K=6,Q=U+90,ie=U-90,J=ze(M,D,K,Q),re=ze(M,D,K,ie);return Y.push(o("polygon",{key:"needle",points:`${_.x},${_.y} ${J.x},${J.y} ${re.x},${re.y}`,fill:h,stroke:"none"})),Y.push(o("circle",{key:"needle-cap",cx:String(M),cy:String(D),r:"8",fill:h,stroke:"#fff","stroke-width":"2"})),Y},[A,R,M,D,I,h]),E=k(()=>{if(!d)return[];let Y=[],U=_e(A),V=U+(f?" "+f:""),_=D+P+20;return Y.push(o("text",{key:"value-text",x:String(M),y:String(_),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${V}`},U,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),Y},[d,A,f,M,D,P]),C=k(()=>{if(!p)return[];let Y=D+P+(d?40:20);return[o("text",{key:"label",x:String(M),y:String(Y),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},p)]},[p,M,D,P,d]),N=k(()=>{if(!x)return[];let Y=[],U=ze(M,D,P,a),V=ze(M,D,P,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"},_e(b))),Y.push(o("text",{key:"max-label",x:String(V.x+4),y:String(V.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},_e(S))),Y},[x,M,D,P,a,l,b,S]),$=W(),B=z(),H=w(),O=v(),G=E(),q=C(),te=N(),Z=`Gauge: ${_e(A)}${f?" "+f:""}, range ${_e(b)} to ${_e(S)}${p?", "+p:""}`;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(A),"aria-valuemin":String(b),"aria-valuemax":String(S),"aria-label":Z,style:{fontFamily:"sans-serif"}},...$,...B,...H,...O,...G,...q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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 vi(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:u,hoverColor:d="#FFD700",title:x="Map of the United States"}=e,m=X(()=>Object.keys(lt),[]),c=k(g=>{l&&l(g)},[l]),p=k((g,b)=>{let S=b.currentTarget;S&&S.setAttribute("fill",d),u&&u(g)},[u,d]),f=k((g,b)=>{let S=b.currentTarget;if(S){let A=r[g]??i;S.setAttribute("fill",A)}u&&u(null)},[u,r,i]),y=X(()=>{let g=[];for(let b=0;b<m.length;b++){let S=m[b],A=lt[S],T=r[S]??i,M={key:`state-${S}`,d:A.path,fill:T,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":S,role:"img","aria-label":A.name,style:{cursor:l?"pointer":"default"}};if(l){let L=S;M.onClick=()=>c(L),M.onKeyDown=I=>{(I.key==="Enter"||I.key===" ")&&c(L)},M.tabindex=0,M.role="button",M["aria-label"]=A.name}let D=S;M.onMouseOver=L=>p(D,L),M.onMouseOut=L=>f(D,L),g.push(o("path",M))}return g},[m,r,i,s,a,l,c,p,f]),h=o("title",{key:"map-title"},x);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x,style:{fontFamily:"sans-serif"}},h,...y)}function yn(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 Cc(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 Mc(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=yn(t[i]),l=yn(t[i+1]);return Cc(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Pc(e){let{r:t,g:n,b:r}=yn(e);return(.299*t+.587*n+.114*r)/255}var Ec=["#3b82f6","#fbbf24","#ef4444"];function wi(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Ec,minValue:l,maxValue:u,showValues:d=!1,cellBorderColor:x="#fff",cellBorderWidth:m=1,title:c,padding:p=60}=e,f=t.length,y=X(()=>{let w=0;for(let v of t)v.length>w&&(w=v.length);return w},[t]),{minVal:h,maxVal:g}=X(()=>{let w=l??1/0,v=u??-1/0;for(let E of t)for(let C of E)l===void 0&&C<w&&(w=C),u===void 0&&C>v&&(v=C);return w===1/0&&(w=0),v===-1/0&&(v=1),w===v&&(v=w+1),{minVal:w,maxVal:v}},[t,l,u]),b=c?30:0,S=n?p:20,A=r?p:20,T=i-S-20,M=s-b-A-20,D=y>0?T/y:0,L=f>0?M/f:0,I=k(()=>{let w=[];for(let v=0;v<f;v++){let E=t[v];for(let C=0;C<y;C++){let N=C<E.length?E[C]:0,$=(N-h)/(g-h),B=Mc($,a),H=S+C*D,O=b+20+v*L;if(w.push(o("rect",{key:`cell-${v}-${C}`,x:String(H),y:String(O),width:String(D),height:String(L),fill:B,stroke:x,"stroke-width":String(m)})),d){let G=Pc(B)>.5?"#111827":"#ffffff";w.push(o("text",{key:`val-${v}-${C}`,x:String(H+D/2),y:String(O+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,D*.3,L*.4)),"font-family":"sans-serif",fill:G},String(Math.round(N*100)/100)))}}}return w},[t,f,y,h,g,a,D,L,S,b,d,x,m]),P=k(()=>{let w=[];if(n)for(let v=0;v<f;v++){let E=v<n.length?n[v]:"",C=b+20+v*L+L/2;w.push(o("text",{key:`row-label-${v}`,x:String(S-8),y:String(C),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},E))}if(r)for(let v=0;v<y;v++){let E=v<r.length?r[v]:"",C=S+v*D+D/2,N=b+20+f*L+16;w.push(o("text",{key:`col-label-${v}`,x:String(C),y:String(N),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},E))}return w},[n,r,f,y,D,L,S,b]),F=k(()=>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(f===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 R=F(),W=I(),z=P();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"}},...R,...W,...z)}function Rc(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],u=Math.floor((l-n)/i);u>=t&&(u=t-1),s[u].count++}return s}function $c(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 Sn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ki(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:u=!0,title:d,xLabel:x,yLabel:m,padding:c=60}=e,p=Math.max(1,Math.round(n)),f=X(()=>Rc(t,p),[t,p]),y=X(()=>{let R=0;for(let W=0;W<f.length;W++)f[W].count>R&&(R=f[W].count);return R>0?R:1},[f]),h=r-c*2,g=i-c*2,b=k(()=>{if(!l)return[];let R=$c(y),W=[];for(let z=R;z<=y;z+=R){let w=c+g-z/y*g;W.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(w),x2:String(c+h),y2:String(w),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),W.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(w+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return W},[l,y,c,h,g]),S=k(()=>{let R=[];return R.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),R.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+g),x2:String(c+h),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),R},[c,h,g]),A=k(()=>{if(f.length===0)return[];let R=[],W=a*(f.length-1),z=Math.max(1,(h-W)/f.length);for(let w=0;w<f.length;w++){let v=f[w],E=v.count/y*g,C=c+w*(z+a),N=c+g-E;if(R.push(o("rect",{key:`bar-${w}`,x:String(C),y:String(N),width:String(z),height:String(E),fill:s})),u&&v.count>0&&R.push(o("text",{key:`val-${w}`,x:String(C+z/2),y:String(N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(v.count))),f.length<=15||w%2===0||w===f.length-1){let B=(f.length===1,Sn(v.min));R.push(o("text",{key:`xlabel-${w}`,x:String(C+z/2),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},B))}}if(f.length>0){let w=f[f.length-1],v=c+h;R.push(o("text",{key:"xlabel-end",x:String(v),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Sn(w.max)))}return R},[f,y,a,s,u,c,h,g]),T=k(()=>{let R=[];return d&&R.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"},d)),x&&R.push(o("text",{key:"x-label",x:String(c+h/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},x)),m&&R.push(o("text",{key:"y-label",x:String(14),y:String(c+g/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+g/2})`},m)),R},[d,x,m,r,i,c,h,g]),M=k(()=>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]),D=b(),L=S(),I=A(),P=T(),F=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":d??"Histogram",style:{fontFamily:"sans-serif"}},...P,...D,...L,...I,...F)}function Ic(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 Ci(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:u="#3b82f6",showGrid:d=!0,showValues:x=!0,title:m,padding:c=60}=e,p=i==="vertical",f=p?30:0,y=n-c*2,h=r-c*2-f,g=p?h:y,b=p?y:h,S=X(()=>{let w=0;for(let v=0;v<t.length;v++)t[v].value>w&&(w=t[v].value);return w>0?w:1},[t]),A=X(()=>t.length===0?0:b/t.length,[t.length,b]),T=k(()=>{if(!d)return[];let w=Ic(S),v=[];for(let E=w;E<=S;E+=w){let C=E/S*g;if(p){let N=c+h-C;v.push(o("line",{key:`grid-${E}`,x1:String(c),y1:String(N),x2:String(c+y),y2:String(N),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),v.push(o("text",{key:`grid-label-${E}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(E)))}else{let N=c+C;v.push(o("line",{key:`grid-${E}`,x1:String(N),y1:String(c),x2:String(N),y2:String(c+h),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),v.push(o("text",{key:`grid-label-${E}`,x:String(N),y:String(c+h+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(E)))}}return v},[d,S,p,c,y,h,g]),M=k(()=>{let w=[];return p?w.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})):w.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+h),x2:String(c+y),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),w},[p,c,y,h]),D=k(()=>{if(t.length===0)return[];let w=[];for(let v=0;v<t.length;v++){let E=t[v],C=E.value/S*g,N=A*v+A/2,$=E.color??u;if(p){let B=c+N,H=c+h,O=c+h-C;w.push(o("line",{key:`stem-${v}`,x1:String(B),y1:String(H),x2:String(B),y2:String(O),stroke:s,"stroke-width":String(a)})),w.push(o("circle",{key:`dot-${v}`,cx:String(B),cy:String(O),r:String(l),fill:$})),x&&w.push(o("text",{key:`val-${v}`,x:String(B),y:String(O-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(E.value)));let G=B,q=c+h+16;w.push(o("text",{key:`cat-${v}`,x:String(G),y:String(q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${G}, ${q})`},E.label))}else{let B=c+N,H=c,O=c+C;w.push(o("line",{key:`stem-${v}`,x1:String(H),y1:String(B),x2:String(O),y2:String(B),stroke:s,"stroke-width":String(a)})),w.push(o("circle",{key:`dot-${v}`,cx:String(O),cy:String(B),r:String(l),fill:$})),x&&w.push(o("text",{key:`val-${v}`,x:String(O+l+4),y:String(B+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(E.value))),w.push(o("text",{key:`cat-${v}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},E.label))}}return w},[t,S,A,u,l,s,a,x,p,c,y,h,g]),L=k(()=>m?[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"},m)]:[],[m,n,c]),I=k(()=>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]),P=T(),F=M(),R=D(),W=L(),z=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Lollipop chart",style:{fontFamily:"sans-serif"}},...W,...P,...F,...R,...z)}function vn(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 zc(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 Tc(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=vn(t[i]),l=vn(t[i+1]);return zc(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Dc(e){let{r:t,g:n,b:r}=vn(e);return(.299*t+.587*n+.114*r)/255}var Ac=["#f0f9ff","#3b82f6","#1e3a8a"];function Mi(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Ac,showValues:u=!0,showDiagonal:d=!0,cellBorderColor:x="#e5e7eb",title:m,padding:c=70,symmetric:p=!1}=e,f=r??n,y=i??n,h=t.length,g=X(()=>{let $=0;for(let B of t)B.length>$&&($=B.length);return $},[t]),b=X(()=>{if(!p||h===0)return t;let $=[],B=Math.max(h,g);for(let H=0;H<B;H++){let O=[];for(let G=0;G<B;G++){let q=t[H],te=q&&G<q.length?q[G]:0,Z=t[G],Y=Z&&H<Z.length?Z[H]:0;te!==0?O.push(te):O.push(Y)}$.push(O)}return $},[t,p,h,g]),S=b.length,A=X(()=>{let $=0;for(let B of b)B.length>$&&($=B.length);return $},[b]),{minVal:T,maxVal:M}=X(()=>{let $=1/0,B=-1/0;for(let H of b)for(let O of H)O<$&&($=O),O>B&&(B=O);return $===1/0&&($=0),B===-1/0&&(B=1),$===B&&(B=$+1),{minVal:$,maxVal:B}},[b]),D=m?30:0,L=f?c:20,I=y?c:20,P=s-L-20,F=a-D-I-20,R=A>0?P/A:0,W=S>0?F/S:0,z=k(()=>{let $=[];for(let B=0;B<S;B++){let H=b[B];for(let O=0;O<A;O++){let G=O<H.length?H[O]:0,q=(G-T)/(M-T),te=Tc(q,l),Z=L+O*R,Y=D+20+B*W,U=B===O,V=U&&d?"currentColor":x,_=U&&d?"2":"1";if($.push(o("rect",{key:`cell-${B}-${O}`,x:String(Z),y:String(Y),width:String(R),height:String(W),fill:te,stroke:V,"stroke-width":_})),u){let K=Dc(te)>.5?"#111827":"#ffffff",Q=Math.min(12,R*.3,W*.35);$.push(o("text",{key:`val-${B}-${O}`,x:String(Z+R/2),y:String(Y+W/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":U&&d?"bold":"normal","font-family":"sans-serif",fill:K},String(Math.round(G*100)/100)))}}}return $},[b,S,A,T,M,l,R,W,L,D,u,d,x]),w=k(()=>{let $=[];if(f)for(let B=0;B<S;B++){let H=B<f.length?f[B]:"",O=D+20+B*W+W/2;$.push(o("text",{key:`row-label-${B}`,x:String(L-8),y:String(O),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}if(y)for(let B=0;B<A;B++){let H=B<y.length?y[B]:"",O=L+B*R+R/2,G=D+20+S*W+12;$.push(o("text",{key:`col-label-${B}`,x:String(O),y:String(G),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}return $},[f,y,S,A,R,W,L,D]),v=k(()=>m?[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"},m)]:[],[m,s]);if(S===0||A===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":m??"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 E=v(),C=z(),N=w();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Matrix visualization",style:{fontFamily:"sans-serif"}},...E,...C,...N)}var Lc=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function $t(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 Fc(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 Wc(e,t,n,r,i,s,a){let l=[];if($t(e)<=0)return l;let x=Fc(e)+1,m=s==="horizontal",c=m?i/x:r/x,p=[];for(p.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});p.length>0;){let f=p.shift(),{node:y,depth:h,spanStart:g,spanEnd:b,colorIndex:S}=f,A=$t(y);if(A<=0)continue;let T=b-g,M,D,L,I;if(m?(M=g,D=n+h*c,L=T,I=c):(M=t+h*c,D=g,L=c,I=T),l.push({x:M,y:D,w:L,h:I,label:y.label,value:A,color:y.color??a[S%a.length],depth:h}),y.children&&y.children.length>0){let P=g;for(let F=0;F<y.children.length;F++){let R=y.children[F],W=$t(R);if(W<=0)continue;let z=W/A*T;p.push({node:R,depth:h+1,spanStart:P,spanEnd:P+z,colorIndex:h===0?F:S}),P+=z}}}return l}function Pi(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Lc,borderColor:u="#ffffff",borderWidth:d=1,title:x,padding:m=10}=e,c=x?30:0,p=m,f=m+c,y=n-m*2,h=r-m*2-c;if(X(()=>$t(t),[t])<=0||y<=0||h<=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":x??"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=X(()=>Wc(t,p,f,y,h,i,l),[t,p,f,y,h,i,l]),S=[];x&&S.push(o("text",{key:"title",x:String(n/2),y:String(m+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x));for(let A=0;A<b.length;A++){let T=b[A];if(S.push(o("rect",{key:`cell-${A}`,x:String(T.x),y:String(T.y),width:String(Math.max(0,T.w)),height:String(Math.max(0,T.h)),fill:T.color,stroke:u,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${T.label}: ${T.value}`})),s&&T.w>20&&T.h>14){let M=Math.floor(T.w/7),D=T.label.length>M?T.label.substring(0,Math.max(1,M-2))+"..":T.label;S.push(o("text",{key:`label-${A}`,x:String(T.x+T.w/2),y:String(T.y+T.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},D))}a&&T.w>30&&T.h>28&&S.push(o("text",{key:`value-${A}`,x:String(T.x+T.w/2),y:String(T.y+T.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(T.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":x??"Partition diagram",style:{fontFamily:"sans-serif"}},...S)}function wn(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Ei(e,t){let n=new Set;for(let i of e)n.add(wn(i,t));let r=Array.from(n);return r.sort(),r}function It(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 zt(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Nc(e,t,n,r,i){let s=Ei(e,t),a=Ei(e,n),l=new Map;for(let p of e){let f=wn(p,t),y=wn(p,n),h=`${f}::${y}`;l.has(h)||l.set(h,[]);let g=l.get(h),b=0;for(let S of r){let A=p[S];if(typeof A=="number")b+=A;else if(typeof A=="string"){let T=parseFloat(A);isNaN(T)||(b+=T)}}g.push(b)}let u=new Map;for(let[p,f]of l)u.set(p,It(f,i));let d=new Map;for(let p of s){let f=[];for(let y of a){let h=u.get(`${p}::${y}`);h!==void 0&&f.push(h)}d.set(p,It(f,i==="count"?"sum":i))}let x=new Map;for(let p of a){let f=[];for(let y of s){let h=u.get(`${y}::${p}`);h!==void 0&&f.push(h)}x.set(p,It(f,i==="count"?"sum":i))}let m=[];for(let p of d.values())m.push(p);let c=It(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:u,rowTotals:d,colTotals:x,grandTotal:c}}function Ri(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:u=!0,title:d,headerColor:x="#3b82f6",cellPadding:m=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":d??"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=X(()=>Nc(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:p,colKeys:f,cells:y,rowTotals:h,colTotals:g,grandTotal:b}=c,S=d?30:0,A=f.length+(u?1:0),T=p.length+(u?1:0),M=1+A,D=1+T,L=Math.max(40,(a-m*2)/M),I=Math.max(20,Math.min(36,(l-S-m*2)/D)),P=L*M,F=I*D,R=Math.max(0,(a-P)/2),W=S+Math.max(0,(l-S-F)/2),z=[];d&&z.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"},d)),z.push(o("rect",{key:"header-row-bg",x:String(R),y:String(W),width:String(P),height:String(I),fill:x})),z.push(o("rect",{key:"header-col-bg",x:String(R),y:String(W+I),width:String(L),height:String(I*T),fill:x,opacity:"0.85"})),z.push(o("text",{key:"corner",x:String(R+L/2),y:String(W+I/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let w=0;w<f.length;w++){let v=R+(w+1)*L,E=Math.floor(L/7),C=f[w],N=C.length>E?C.substring(0,Math.max(1,E-2))+"..":C;z.push(o("text",{key:`ch-${w}`,x:String(v+L/2),y:String(W+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N))}u&&z.push(o("text",{key:"ch-total",x:String(R+(f.length+1)*L+L/2),y:String(W+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let w=0;w<p.length;w++){let v=p[w],E=W+(w+1)*I;w%2===0&&z.push(o("rect",{key:`row-bg-${w}`,x:String(R+L),y:String(E),width:String(L*A),height:String(I),fill:"#f9fafb"}));let C=Math.floor(L/7),N=v.length>C?v.substring(0,Math.max(1,C-2))+"..":v;z.push(o("text",{key:`rh-${w}`,x:String(R+L/2),y:String(E+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N));for(let $=0;$<f.length;$++){let B=f[$],H=`${v}::${B}`,O=y.get(H),G=R+($+1)*L;z.push(o("rect",{key:`border-${w}-${$}`,x:String(G),y:String(E),width:String(L),height:String(I),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),z.push(o("text",{key:`cell-${w}-${$}`,x:String(G+L/2),y:String(E+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O!==void 0?zt(O):"-"))}if(u){let $=R+(f.length+1)*L,B=h.get(v)??0;z.push(o("rect",{key:`rt-bg-${w}`,x:String($),y:String(E),width:String(L),height:String(I),fill:"#eff6ff"})),z.push(o("text",{key:`rt-${w}`,x:String($+L/2),y:String(E+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},zt(B)))}}if(u){let w=W+(p.length+1)*I;z.push(o("rect",{key:"total-row-bg",x:String(R),y:String(w),width:String(P),height:String(I),fill:"#eff6ff"})),z.push(o("text",{key:"total-label",x:String(R+L/2),y:String(w+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let E=0;E<f.length;E++){let C=f[E],N=g.get(C)??0,$=R+(E+1)*L;z.push(o("text",{key:`ct-${E}`,x:String($+L/2),y:String(w+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},zt(N)))}let v=R+(f.length+1)*L;z.push(o("text",{key:"grand-total",x:String(v+L/2),y:String(w+I/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},zt(b)))}return z.push(o("rect",{key:"outer-border",x:String(R),y:String(W),width:String(P),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":d??"Pivot table",style:{fontFamily:"sans-serif"}},...z)}function Tt(e,t){return Math.PI*2*e/t-Math.PI/2}function Dt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function $i(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:u=!0,showDots:d=!0,gridColor:x="#d1d5db",title:m}=e,c=t.length,p=m?30:0,f=u&&n.length>0?30:0,y=60,h=Math.min((r-y*2)/2,(i-y*2-p-f)/2),g=r/2,b=y+p+h,S=X(()=>{let z=[];for(let w=0;w<c;w++){let v=t[w]?.max;if(v!==void 0&&v>0){z.push(v);continue}let E=0;for(let C of n){let N=C.values[w];N!==void 0&&N>E&&(E=N)}z.push(E>0?E:1)}return z},[t,n,c]),A=k(()=>{if(c<3)return[];let z=[];for(let w=1;w<=s;w++){let v=h*w/s,E=[];for(let C=0;C<c;C++){let N=Tt(C,c),$=Dt(g,b,v,N);E.push(`${$.x},${$.y}`)}z.push(o("polygon",{key:`ring-${w}`,points:E.join(" "),fill:"none",stroke:x,"stroke-width":w===s?"1.5":"0.5","stroke-dasharray":w===s?"none":"3 2"}))}for(let w=0;w<c;w++){let v=Tt(w,c),E=Dt(g,b,h,v);z.push(o("line",{key:`spoke-${w}`,x1:String(g),y1:String(b),x2:String(E.x),y2:String(E.y),stroke:x,"stroke-width":"0.75"}))}return z},[c,s,h,g,b,x]),T=k(()=>{if(!a||c<3)return[];let z=[],w=16;for(let v=0;v<c;v++){let E=Tt(v,c),C=Dt(g,b,h+w,E),N="middle";C.x<g-5?N="end":C.x>g+5&&(N="start");let $=Math.abs(C.y-b)<5?"0.35em":C.y<b?"0em":"0.7em";z.push(o("text",{key:`label-${v}`,x:String(C.x),y:String(C.y),"text-anchor":N,dy:$,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[v]?.label??`Axis ${v}`))}return z},[a,c,t,h,g,b]),M=k(()=>{if(c<3||n.length===0)return[];let z=[];for(let w=0;w<n.length;w++){let v=n[w],E=[],C=[],N=[];for(let $=0;$<c;$++){let B=v.values[$]??0,H=S[$],O=Math.min(B/H,1),G=h*O,q=Tt($,c),te=Dt(g,b,G,q);E.push(`${te.x},${te.y}`),d&&C.push(o("circle",{key:`dot-${w}-${$}`,cx:String(te.x),cy:String(te.y),r:"3.5",fill:v.color,stroke:"#fff","stroke-width":"1.5"})),l&&N.push(o("text",{key:`val-${w}-${$}`,x:String(te.x),y:String(te.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:v.color},String(Math.round(B*100)/100)))}z.push(o("polygon",{key:`series-fill-${w}`,points:E.join(" "),fill:v.color,"fill-opacity":String(v.fillOpacity??.15),stroke:"none"})),z.push(o("polygon",{key:`series-line-${w}`,points:E.join(" "),fill:"none",stroke:v.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let $ of C)z.push($);for(let $ of N)z.push($)}return z},[c,n,S,h,g,b,d,l]),D=k(()=>{if(!u||n.length===0)return[];let z=[],w=b+h+40,v=100,E=n.length*v,C=g-E/2;for(let N=0;N<n.length;N++){let $=n[N],B=C+N*v;z.push(o("rect",{key:`legend-swatch-${N}`,x:String(B),y:String(w),width:"12",height:"12",rx:"2",fill:$.color})),z.push(o("text",{key:`legend-text-${N}`,x:String(B+16),y:String(w+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},$.label))}return z},[u,n,g,b,h]),L=k(()=>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:"currentColor"},m)]:[],[m,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":m??"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 I=A(),P=T(),F=M(),R=D(),W=L();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??"Radar chart",style:{fontFamily:"sans-serif"}},...W,...I,...P,...F,...R)}var Bc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Hc(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 u=r.get(l.target);u&&u.add(l.source);let d=i.get(l.source);d&&d.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 u=n.get(l),d=i.get(l)??[];for(let x of d){let m=n.get(x),c=u+1;(m===void 0||c>m)&&n.set(x,c),s.includes(x)||s.push(x)}}for(let l of e)n.has(l)||n.set(l,0);return n}function _c(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let u=n-a*2,d=r-a*2,x=t.filter(P=>P.value>0),m=e.map(P=>P.id),c=Hc(m,x),p=new Map,f=new Map;for(let P of m)p.set(P,0),f.set(P,0);for(let P of x)f.set(P.source,(f.get(P.source)??0)+P.value),p.set(P.target,(p.get(P.target)??0)+P.value);let y=0;for(let P of c.values())P>y&&(y=P);let h=new Map;for(let P=0;P<=y;P++)h.set(P,[]);for(let[P,F]of c)h.get(F).push(P);let g=new Map,b=y>0?(u-i)/y:0;for(let P=0;P<=y;P++)g.set(P,a+P*b);let S=new Map;for(let P=0;P<e.length;P++)S.set(e[P].id,e[P]);let A=[],T=new Map;for(let P=0;P<=y;P++){let F=h.get(P);if(F.length===0)continue;let R=0;for(let v of F){let E=p.get(v)??0,C=f.get(v)??0;R+=Math.max(E,C,1)}let W=d-s*(F.length-1),z=R>0?W/R:1,w=a;for(let v=0;v<F.length;v++){let E=F[v],C=S.get(E),N=p.get(E)??0,$=f.get(E)??0,B=Math.max(N,$,1),H=Math.max(4,B*z),O=e.findIndex(q=>q.id===E),G={id:E,label:C.label,color:C.color??l[O%l.length],column:P,x:g.get(P),y:w,height:H,totalIn:N,totalOut:$,totalValue:B};A.push(G),T.set(E,G),w+=H+s}}let M=new Map,D=new Map;for(let P of m)M.set(P,0),D.set(P,0);let L=[...x].sort((P,F)=>F.value-P.value),I=[];for(let P of L){let F=T.get(P.source),R=T.get(P.target);if(!F||!R)continue;let W=F.totalOut||1,z=R.totalIn||1,w=P.value/W*F.height,v=P.value/z*R.height,E=Math.max(1,(w+v)/2),C=M.get(P.source),N=D.get(P.target),$=F.y+C+w/2,B=R.y+N+v/2;M.set(P.source,C+w),D.set(P.target,N+v);let H=S.get(P.source);I.push({source:P.source,target:P.target,value:P.value,color:P.color??H?.color??F.color,sourceY:$,targetY:B,width:E})}return{layoutNodes:A,layoutLinks:I}}function Ii(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:u=!1,linkOpacity:d=.4,colors:x=Bc,title:m,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":m??"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 p=X(()=>_c(t,n,r,i,s,a,c,x),[t,n,r,i,s,a,c,x]),f=k(()=>{let A=[];for(let T=0;T<p.layoutLinks.length;T++){let M=p.layoutLinks[T],D=p.layoutNodes.find(W=>W.id===M.source),L=p.layoutNodes.find(W=>W.id===M.target);if(!D||!L)continue;let I=D.x+s,P=L.x,F=(I+P)/2,R=`M ${I} ${M.sourceY} C ${F} ${M.sourceY}, ${F} ${M.targetY}, ${P} ${M.targetY}`;A.push(o("path",{key:`link-${T}`,d:R,fill:"none",stroke:M.color,"stroke-width":String(Math.max(1,M.width)),"stroke-opacity":String(d),"stroke-linecap":"butt"})),u&&M.value>0&&A.push(o("text",{key:`link-val-${T}`,x:String(F),y:String((M.sourceY+M.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(M.value)))}return A},[p,s,d,u]),y=k(()=>{let A=[];for(let T=0;T<p.layoutNodes.length;T++){let M=p.layoutNodes[T];if(A.push(o("rect",{key:`node-${M.id}`,x:String(M.x),y:String(M.y),width:String(s),height:String(M.height),fill:M.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${M.label}: ${M.totalValue}`})),l){let D=p.layoutNodes.reduce((z,w)=>Math.max(z,w.column),0),L=M.column===D,I=L?M.x+s+6:M.x-6,P=L?"start":"end",F=M.column===0,R=F?M.x-6:I,W=F?"end":P;A.push(o("text",{key:`label-${M.id}`,x:String(R),y:String(M.y+M.height/2+4),"text-anchor":W,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},M.label))}}return A},[p,s,l]),h=k(()=>m?[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"},m)]:[],[m,r,c]),g=f(),b=y(),S=h();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??"Sankey diagram",style:{fontFamily:"sans-serif"}},...S,...g,...b)}var Oc=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],kn=2*Math.PI;function ct(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 Vc(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 Yc(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,u=i-Math.PI/2,d=s-Math.PI/2,x=e+r*Math.cos(u),m=t+r*Math.sin(u),c=e+r*Math.cos(d),p=t+r*Math.sin(d),f=e+n*Math.cos(d),y=t+n*Math.sin(d),h=e+n*Math.cos(u),g=t+n*Math.sin(u);if(a>=kn-.001){let b=u+Math.PI,S=e+r*Math.cos(b),A=t+r*Math.sin(b),T=e+n*Math.cos(b),M=t+n*Math.sin(b);return[`M ${x} ${m}`,`A ${r} ${r} 0 1 1 ${S} ${A}`,`A ${r} ${r} 0 1 1 ${x} ${m}`,`L ${h} ${g}`,`A ${n} ${n} 0 1 0 ${T} ${M}`,`A ${n} ${n} 0 1 0 ${h} ${g}`,"Z"].join(" ")}return[`M ${x} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${p}`,`L ${f} ${y}`,`A ${n} ${n} 0 ${l} 0 ${h} ${g}`,"Z"].join(" ")}function Gc(e,t,n,r){let i=[],s=ct(e);if(s<=0)return i;let a=Vc(e),l=a>0?(n-t)/(a+1):n-t,u=[];if(e.children&&e.children.length>0){let d=0;for(let x=0;x<e.children.length;x++){let m=e.children[x],c=ct(m);if(c<=0)continue;let p=c/s*kn;u.push({node:m,startAngle:d,endAngle:d+p,depth:0,colorIndex:x}),d+=p}}else return i.push({startAngle:0,endAngle:kn,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;u.length>0;){let d=u.shift(),{node:x,startAngle:m,endAngle:c,depth:p,colorIndex:f}=d,y=ct(x);if(y<=0)continue;let h=t+p*l,g=h+l;if(i.push({startAngle:m,endAngle:c,innerR:h,outerR:g,label:x.label,value:y,color:x.color??r[f%r.length],depth:p}),x.children&&x.children.length>0){let b=m,S=c-m;for(let A=0;A<x.children.length;A++){let T=x.children[A],M=ct(T);if(M<=0)continue;let D=M/y*S;u.push({node:T,startAngle:b,endAngle:b+D,depth:p+1,colorIndex:f}),b+=D}}}return i}function zi(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=Oc,strokeColor:l="#ffffff",strokeWidth:u=1,title:d}=e,x=n/2,m=r/2,c=d?20:0,p=Math.min(x,m-c)-10;if(X(()=>ct(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":d??"Empty sunburst chart"},o("text",{x:String(x),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=X(()=>Gc(t,i,p,a),[t,i,p,a]),h=[];d&&h.push(o("text",{key:"title",x:String(x),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},d));let g=m+c/2;for(let b=0;b<y.length;b++){let S=y[b],A=Yc(x,g,S.innerR,S.outerR,S.startAngle,S.endAngle);if(h.push(o("path",{key:`arc-${b}`,d:A,fill:S.color,stroke:l,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${S.label}: ${S.value}`})),s){let T=S.endAngle-S.startAngle,M=S.startAngle+T/2-Math.PI/2,D=(S.innerR+S.outerR)/2,L=S.outerR-S.innerR,I=T*D;if(I>20&&L>14){let P=x+D*Math.cos(M),F=g+D*Math.sin(M),R=Math.floor(Math.min(I,L)/7),W=S.label.length>R?S.label.substring(0,Math.max(1,R-1))+"..":S.label;h.push(o("text",{key:`label-${b}`,x:String(P),y:String(F+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},W))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":d??"Sunburst chart",style:{fontFamily:"sans-serif"}},...h)}var Uc=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function At(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 Ti(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 jc(e,t,n,r,i,s){let a=[],l=[],u=At(e);if(u<=0||r<=0||i<=0)return a;let d=e.children&&e.children.length>0?e.children:[e],x=r*i,m=[];for(let c=0;c<d.length;c++){let p=d[c],f=At(p);f<=0||m.push({label:p.label,value:f,area:f/u*x,color:p.color??s[c%s.length],node:p})}for(m.sort((c,p)=>p.area-c.area),l.push({nodes:m,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:p,rect:f,depth:y}=c;if(p.length===0)continue;let h={...f},g=0;for(;g<p.length&&h.w>0&&h.h>0;){let b=h.w>=h.h,S=b?h.h:h.w,A=[],T=[];A.push(p[g]),T.push(p[g].area),g++;let M=Ti(T,S);for(;g<p.length;){let P=[...T,p[g].area],F=Ti(P,S);if(F>M)break;A.push(p[g]),T.push(p[g].area),M=F,g++}let D=0;for(let P of T)D+=P;let L=S>0?D/S:0,I=0;for(let P=0;P<A.length;P++){let F=A[P],R=L>0?F.area/L:0,W,z,w,v;if(b?(W=h.x,z=h.y+I,w=L,v=R):(W=h.x+I,z=h.y,w=R,v=L),a.push({x:W,y:z,w,h:v,label:F.label,value:F.value,color:F.color,depth:y}),F.node.children&&F.node.children.length>0){let C=W+2,N=z+2+14,$=w-4,B=v-4-14;if($>4&&B>4){let H=[],O=F.value,G=$*B;for(let q=0;q<F.node.children.length;q++){let te=F.node.children[q],Z=At(te);Z<=0||H.push({label:te.label,value:Z,area:Z/O*G,color:te.color??s[(q+y+1)%s.length],node:te})}H.sort((q,te)=>te.area-q.area),l.push({nodes:H,rect:{x:C,y:N,w:$,h:B},depth:y+1})}}I+=R}b?h={x:h.x+L,y:h.y,w:h.w-L,h:h.h}:h={x:h.x,y:h.y+L,w:h.w,h:h.h-L}}}return a}function Di(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Uc,borderColor:l="#ffffff",borderWidth:u=2,padding:d=2,title:x}=e,m=x?30:0,c=d,p=d+m,f=n-d*2,y=r-d*2-m;if(X(()=>At(t),[t])<=0||f<=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":x??"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 g=X(()=>jc(t,c,p,f,y,a),[t,c,p,f,y,a]),b=[];x&&b.push(o("text",{key:"title",x:String(n/2),y:String(d+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x));for(let S=0;S<g.length;S++){let A=g[S];if(b.push(o("rect",{key:`cell-${S}`,x:String(A.x),y:String(A.y),width:String(Math.max(0,A.w)),height:String(Math.max(0,A.h)),fill:A.color,stroke:l,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${A.label}: ${A.value}`})),i&&A.w>20&&A.h>14){let T=Math.floor(A.w/7),M=A.label.length>T?A.label.substring(0,Math.max(1,T-2))+"..":A.label;b.push(o("text",{key:`label-${S}`,x:String(A.x+4),y:String(A.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},M))}s&&A.w>30&&A.h>28&&b.push(o("text",{key:`value-${S}`,x:String(A.x+4),y:String(A.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(A.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":x??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)}function Ai(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 Xc(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 Li(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,u=Ai(t[s]),d=Ai(t[a]);return Xc(u.r+(d.r-u.r)*l,u.g+(d.g-u.g)*l,u.b+(d.b-u.b)*l)}function Lt(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 qc(e,t,n,r,i,s,a,l,u,d){if(e&&e.length>0)return e;let x=Math.max(2,Math.min(50,r)),m=u/(x-1),c=d/(x-1);if(n){let f=[];for(let b=0;b<x;b++)for(let S=0;S<x;S++)f.push({x:i+S*m,y:a+b*c});let h=n(f,{gridSize:x,xMin:i,xMax:s,yMin:a,yMax:l}),g=[];for(let b=0;b<f.length;b++){let S=f[b],A=h[b]??{dx:0,dy:0},T=Math.sqrt(A.dx*A.dx+A.dy*A.dy);g.push({x:S.x,y:S.y,dx:A.dx,dy:A.dy,magnitude:T})}return g}if(!t)return[];let p=[];for(let f=0;f<x;f++)for(let y=0;y<x;y++){let h=i+y*m,g=a+f*c,b=t(h,g),S=Math.sqrt(b.dx*b.dx+b.dy*b.dy);p.push({x:h,y:g,dx:b.dx,dy:b.dy,magnitude:S})}return p}function Kc(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:u,xMax:d,yMin:x,yMax:m,xSpan:c,ySpan:p,showGrid:f,showAxes:y,colorByMagnitude:h,colorScale:g,arrowColor:b,arrowWidth:S,effectiveArrowScale:A,maxMagnitude:T,title:M,tickFontSize:D}=i,L=F=>s+(F-u)/c*a,I=F=>s+(m-F)/p*l;if(e.clearRect(0,0,t,n),M&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(M,t/2,s/2+4),e.restore()),f){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${D}px sans-serif`,e.fillStyle="#6b7280";let F=Lt(c,10),R=Math.ceil(u/F)*F;for(let w=R;w<=d;w+=F){let v=L(w);e.beginPath(),e.moveTo(v,s),e.lineTo(v,s+l),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(w*100)/100),v,s+l+4)}let W=Lt(p,10),z=Math.ceil(x/W)*W;for(let w=z;w<=m;w+=W){let v=I(w);e.beginPath(),e.moveTo(s,v),e.lineTo(s+a,v),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(w*100)/100),s-6,v)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=S,x<=0&&m>=0){let F=I(0);e.beginPath(),e.moveTo(s,F),e.lineTo(s+a,F),e.stroke()}if(u<=0&&d>=0){let F=L(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 P=4;for(let F=0;F<r.length;F++){let R=r[F],W=R.magnitude??Math.sqrt(R.dx*R.dx+R.dy*R.dy);if(W<1e-10)continue;let z=L(R.x),w=I(R.y),v=R.dx*A,E=-R.dy*A,C=z+v,N=w+E,$;if(h){let H=W/T;$=Li(H,g)}else $=b;e.save(),e.strokeStyle=$,e.lineWidth=S,e.lineCap="round",e.beginPath(),e.moveTo(z,w),e.lineTo(C,N),e.stroke();let B=Math.sqrt(v*v+E*E);if(B>2){let H=v/B,O=E/B,G=-O,q=H,te=Math.min(P,B*.4),Z=C-H*te+G*te*.5,Y=N-O*te+q*te*.5,U=C-H*te-G*te*.5,V=N-O*te-q*te*.5;e.fillStyle=$,e.beginPath(),e.moveTo(C,N),e.lineTo(Z,Y),e.lineTo(U,V),e.closePath(),e.fill()}e.restore()}}function Fi(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:a=[-5,5],yRange:l=[-5,5],arrowScale:u=1,arrowColor:d="#3b82f6",showGrid:x=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:p=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:y=50,tickFontSize:h=10,arrowWidth:g=1.5,renderer:b="svg",useGPU:S=!1,computeWorker:A}=e,T=Math.max(2,Math.min(50,s)),M=r-y*2,D=i-y*2,L=a[0],I=a[1],P=l[0],F=l[1],R=I-L,W=F-P,z=X(()=>Z=>y+(Z-L)/R*M,[y,L,R,M]),w=X(()=>Z=>y+(F-Z)/W*D,[y,F,W,D]),v=X(()=>qc(t,n,A,T,L,I,P,F,R,W),[t,n,A,T,L,I,P,F,R,W]),E=X(()=>{let Z=0;for(let Y=0;Y<v.length;Y++){let U=v[Y],V=U.magnitude??Math.sqrt(U.dx*U.dx+U.dy*U.dy);V>Z&&(Z=V)}return Z>0?Z:1},[v]),C=X(()=>Math.min(M,D)/Math.max(T,2)/(2*E)*u,[M,D,T,E,u]);if(b==="canvas"){let Z=oe(null),Y=oe(0);return se(()=>{let U=Z.current;if(!U)return;let V=U.getContext("2d");if(V)return Y.current&&cancelAnimationFrame(Y.current),Y.current=requestAnimationFrame(()=>{Kc(V,r,i,v,{padding:y,chartWidth:M,chartHeight:D,xMin:L,xMax:I,yMin:P,yMax:F,xSpan:R,ySpan:W,showGrid:x,showAxes:m,colorByMagnitude:c,colorScale:p,arrowColor:d,arrowWidth:g,effectiveArrowScale:C,maxMagnitude:E,title:f,tickFontSize:h})}),()=>{Y.current&&cancelAnimationFrame(Y.current)}},[v,r,i,y,M,D,L,I,P,F,R,W,x,m,c,p,d,g,C,E,f,h]),o("canvas",{ref:Z,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let N=k(()=>{if(!x)return[];let Z=[],Y=Lt(R,10),U=Math.ceil(L/Y)*Y;for(let K=U;K<=I;K+=Y){let Q=z(K);Z.push(o("line",{key:`gridv-${K}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+D),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`xtick-${K}`,x:String(Q),y:String(y+D+16),"text-anchor":"middle","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}let V=Lt(W,10),_=Math.ceil(P/V)*V;for(let K=_;K<=F;K+=V){let Q=w(K);Z.push(o("line",{key:`gridh-${K}`,x1:String(y),y1:String(Q),x2:String(y+M),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`ytick-${K}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}return Z},[x,L,I,P,F,R,W,z,w,y,M,D]),$=k(()=>{if(!m)return[];let Z=[];if(P<=0&&F>=0){let Y=w(0);Z.push(o("line",{key:"axis-x",x1:String(y),y1:String(Y),x2:String(y+M),y2:String(Y),stroke:"#374151","stroke-width":String(g)}))}if(L<=0&&I>=0){let Y=z(0);Z.push(o("line",{key:"axis-y",x1:String(Y),y1:String(y),x2:String(Y),y2:String(y+D),stroke:"#374151","stroke-width":String(g)}))}return Z.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(M),height:String(D),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),Z},[m,L,I,P,F,z,w,y,M,D]),B=k(()=>{let Z=[];for(let U=0;U<v.length;U++){let V=v[U],_=V.magnitude??Math.sqrt(V.dx*V.dx+V.dy*V.dy);if(_<1e-10)continue;let K=z(V.x),Q=w(V.y),ie=V.dx*C,J=-V.dy*C,re=K+ie,ae=Q+J,ne;if(c){let le=_/E;ne=Li(le,p)}else ne=d;Z.push(o("line",{key:`arrow-line-${U}`,x1:String(K),y1:String(Q),x2:String(re),y2:String(ae),stroke:ne,"stroke-width":String(g),"stroke-linecap":"round"}));let ee=Math.sqrt(ie*ie+J*J);if(ee>2){let le=ie/ee,ue=J/ee,ce=-ue,de=le,me=Math.min(4,ee*.4),he=re-le*me+ce*me*.5,be=ae-ue*me+de*me*.5,Ce=re-le*me-ce*me*.5,Me=ae-ue*me-de*me*.5;Z.push(o("polygon",{key:`arrow-head-${U}`,points:`${re},${ae} ${he},${be} ${Ce},${Me}`,fill:ne}))}}return Z},[v,z,w,C,c,E,p,d]),H=k(()=>f?[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"},f)]:[],[f,r,y]),O=N(),G=$(),q=B(),te=H();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif"}},...te,...O,...G,...q)}function Zc(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 Jc(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 Wi(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:a="#3b82f6",connectorColor:l="#94a3b8",showValues:u=!0,showGrid:d=!0,showConnectors:x=!0,title:m,padding:c=60}=e,p=n-c*2,f=r-c*2,y=X(()=>Zc(t),[t]),{minVal:h,maxVal:g}=X(()=>{let E=0,C=0;for(let N=0;N<y.length;N++){let $=y[N];$.start<E&&(E=$.start),$.end<E&&(E=$.end),$.start>C&&(C=$.start),$.end>C&&(C=$.end)}return E===C&&(C=E+1),{minVal:E,maxVal:C}},[y]),b=g-h,S=k(E=>c+f-(E-h)/b*f,[c,f,h,b]),A=X(()=>y.length===0?0:p/y.length,[y.length,p]),T=6,M=Math.max(1,A-T),D=k(()=>{if(!d)return[];let E=Jc(b),C=[],N=Math.ceil(h/E)*E;for(let $=N;$<=g;$+=E){let B=S($);C.push(o("line",{key:`grid-${$}`,x1:String(c),y1:String(B),x2:String(c+p),y2:String(B),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),C.push(o("text",{key:`grid-label-${$}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}return C},[d,b,h,g,S,c,p]),L=k(()=>{let E=[];E.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"}));let C=h<=0&&g>=0?S(0):c+f;return E.push(o("line",{key:"axis-x",x1:String(c),y1:String(C),x2:String(c+p),y2:String(C),stroke:"#374151","stroke-width":"1.5"})),E},[c,p,f,h,g,S]),I=k(()=>{if(y.length===0)return[];let E=[];for(let C=0;C<y.length;C++){let N=y[C],$=c+C*A+T/2,B=Math.max(N.start,N.end),H=Math.min(N.start,N.end),O=S(B),G=S(H),q=Math.max(0,G-O),te;if(N.type==="total"?te=a:N.type==="decrease"?te=s:te=i,E.push(o("rect",{key:`bar-${C}`,x:String($),y:String(O),width:String(M),height:String(q),fill:te,rx:"2",ry:"2"})),u){let Z=N.type==="decrease"||N.value<0?G+14:O-4,Y=N.type==="total"?String(N.value):(N.value>=0?"+":"")+String(N.value);E.push(o("text",{key:`val-${C}`,x:String($+M/2),y:String(Z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},Y))}if(E.push(o("text",{key:`cat-${C}`,x:String($+M/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},N.label)),x&&C<y.length-1){let Z=y[C+1],Y=S(N.end),U=c+(C+1)*A+T/2;Z.type!=="total"&&E.push(o("line",{key:`conn-${C}`,x1:String($+M),y1:String(Y),x2:String(U),y2:String(Y),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return E},[y,A,M,S,i,s,a,l,u,x,c,f]),P=k(()=>m?[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"},m)]:[],[m,n,c]),F=k(()=>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]),R=D(),W=L(),z=I(),w=P(),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":m??"Waterfall chart",style:{fontFamily:"sans-serif"}},...w,...R,...W,...z,...v)}var Qc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],eu=[0,-45,45,90];function tu(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,u=n*Math.PI/180,d=Math.abs(Math.cos(u)),x=Math.abs(Math.sin(u)),m=a*d+l*x,c=a*x+l*d;return{x:r-m/2,y:i-c/2,w:m,h:c}}function nu(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 ou(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function ru(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 Ni(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=Qc,rotations:u=eu,padding:d=4,spiral:x="archimedean",title:m}=e,c=X(()=>{if(t.length===0)return[];let f=t.map((M,D)=>({...M,originalIndex:D})).filter(M=>M.text.length>0&&M.weight>0).sort((M,D)=>D.weight-M.weight);if(f.length===0)return[];let y=f[f.length-1].weight,g=f[0].weight-y;function b(M){if(g===0)return(i+s)/2;let D=(M-y)/g;return i+D*(s-i)}let S=[],A=n/2,T=r/2;for(let M=0;M<f.length;M++){let D=f[M],L=b(D.weight),I=u[ru(D.text)%u.length],P=D.color??l[M%l.length],F=!1,R=500,W=x==="archimedean"?4:5;for(let z=0;z<R;z++){let w,v;if(x==="archimedean"){let H=z*.1,O=W*H;w=O*Math.cos(H),v=O*Math.sin(H)}else{let H=Math.floor(z/4)+1,O=z%4,G=(z%4===0?0:z)*W;switch(O){case 0:w=H*W*4,v=G;break;case 1:w=-G,v=H*W*4;break;case 2:w=-H*W*4,v=-G;break;default:w=G,v=-H*W*4;break}}let E=A+w,C=T+v,N=tu(D.text,L,I,E,C),$={x:N.x-d,y:N.y-d,w:N.w+d*2,h:N.h+d*2};if(!ou($,n,r))continue;let B=!1;for(let H of S)if(nu($,H.bbox)){B=!0;break}if(!B){S.push({text:D.text,x:E,y:C,fontSize:L,rotation:I,color:P,bbox:$}),F=!0;break}}}return S},[t,n,r,i,s,l,u,d,x]);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":m??"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 p=[];m&&p.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"},m));for(let f=0;f<c.length;f++){let y=c[f],h=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;p.push(o("text",{key:`word-${f}`,transform:h,"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":m??"Word cloud",style:{fontFamily:a}},...p)}var iu={0:"#1e293b",1:"#3b82f6"},su="#666";function Bi(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:u="#334155",showIndices:d=!1,backgroundColor:x="#0f172a",padding:m=10,onCellClick:c,onCellHover:p,title:f}=e,y=n??iu,h=t.length,g=X(()=>{let E=0;for(let C=0;C<t.length;C++){let N=t[C];N!==void 0&&N.length>E&&(E=N.length)}return E},[t]),b=d?20:0,S=f?24:0,A=X(()=>{let E=r-m*2-b,C=i-m*2-b-S;if(h===0||g===0)return{cellWidth:0,cellHeight:0};let N=Math.max(0,(E-s*(g-1))/g),$=Math.max(0,(C-s*(h-1))/h);return{cellWidth:N,cellHeight:$}},[r,i,m,h,g,s,b,S]),T=k(E=>{let C=y[E];return C!==void 0?C:su},[y]),M=k(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x}),[r,i,x]),D=k(()=>f?[o("text",{key:"title",x:String(r/2),y:String(m+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},f)]:[],[f,r,m]),L=k(()=>{if(!l||h===0||g===0)return[];let{cellWidth:E,cellHeight:C}=A,N=m+b,$=m+b+S,B=g*E+(g-1)*s,H=h*C+(h-1)*s,O=[];for(let G=0;G<=g;G++){let q=N+G*(E+s)-s/2;O.push(o("line",{key:`vgrid-${G}`,x1:String(q),y1:String($-s/2),x2:String(q),y2:String($+H+s/2),stroke:u,"stroke-width":"0.5"}))}for(let G=0;G<=h;G++){let q=$+G*(C+s)-s/2;O.push(o("line",{key:`hgrid-${G}`,x1:String(N-s/2),y1:String(q),x2:String(N+B+s/2),y2:String(q),stroke:u,"stroke-width":"0.5"}))}return O},[l,h,g,A,m,b,S,s,u]),I=k(()=>{if(!d||h===0||g===0)return[];let{cellWidth:E,cellHeight:C}=A,N=m+b,$=m+b+S,B=[];for(let H=0;H<g;H++){let O=N+H*(E+s)+E/2,G=$-6;B.push(o("text",{key:`col-idx-${H}`,x:String(O),y:String(G),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}for(let H=0;H<h;H++){let O=N-6,G=$+H*(C+s)+C/2+3;B.push(o("text",{key:`row-idx-${H}`,x:String(O),y:String(G),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}return B},[d,h,g,A,m,b,S,s]),P=k(()=>{if(h===0||g===0)return[];let{cellWidth:E,cellHeight:C}=A,N=m+b,$=m+b+S,B=[];for(let H=0;H<h;H++){let O=t[H];if(O!==void 0)for(let G=0;G<g;G++){let q=G<O.length?O[G]:0,te=N+G*(E+s),Z=$+H*(C+s),Y=T(q),U={key:`cell-${H}-${G}`,x:String(te),y:String(Z),width:String(E),height:String(C),fill:Y,rx:String(a),ry:String(a)};if(c){let V=H,_=G,K=q;U.onClick=()=>c(V,_,K),U.role="button",U.tabIndex=0}if(p){let V=H,_=G,K=q;U.onMouseEnter=()=>p(V,_,K)}B.push(o("rect",U))}}return B},[h,g,t,A,m,b,S,s,a,T,c,p]),F=M(),R=D(),W=L(),z=I(),w=P(),v=f?`${f} \u2014 ${h}x${g} discrete grid`:`${h}x${g} 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,...R,...W,...z,...w)}
7
+ `,document.head.appendChild(d),()=>{let u=document.getElementById(l);u&&u.remove()}},[]);let s=S(l=>t.dismiss(l),[t]),a=r.map(l=>o(bl,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function wr(e={}){let t=te(null);t.current||(t.current=ln(e));let n=t.current,r=S(()=>o(cn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var xl=6,yl=8;function Sl(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=yl;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 vl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${xl}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 kr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=G(!1),[d,u]=G(null),b=te(null),m=te(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,f=S(()=>{m.current=setTimeout(()=>{if(b.current){let x=b.current.getBoundingClientRect();u(Sl(x,n))}l(!0)},r)},[r,n]),g=S(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);re(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},h={...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"},p=[o("div",{ref:b,style:y,onMouseEnter:f,onMouseLeave:g,onFocus:f,onBlur:g,"aria-describedby":a?c:void 0},s)];return a&&d&&p.push(o("div",{id:c,style:h,role:"tooltip"},t,o("div",{style:vl(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...p)}function dn(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 wl(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 kl(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 Cl(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 Cr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Mr(e,t){return t||Cr[e%Cr.length]}function Er(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:b="#e5e7eb",title:m,padding:c=50,animate:f=!1,stacked:g,grouped:y=!1}=e,h=i==="vertical",p=n-c*2,x=r-c*2,v=h?x:p,T=h?p:x,D=g!==void 0&&g.length>0,C=q(()=>D?Cl(g):[],[D,g]),P=D?g.length:t.length,L=q(()=>wl(t,g,y),[t,g,y]),I=L>0?L:1,M=dn(P,I,v,T,a),F=S(()=>{if(!u)return[];let _=kl(I),U=[];for(let X=_;X<=I;X+=_){let ee=M.valueScale(X);if(h){let Z=c+x-ee;U.push(o("line",{key:`grid-${X}`,x1:String(c),y1:String(Z),x2:String(c+p),y2:String(Z),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${X}`,x:String(c-6),y:String(Z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}else{let Z=c+ee;U.push(o("line",{key:`grid-${X}`,x1:String(Z),y1:String(c),x2:String(Z),y2:String(c+x),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${X}`,x:String(Z),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}}return U},[u,I,M,h,c,p,x,b]),R=S(()=>{let _=[];return h?(_.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),_.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+p),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(_.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+p),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),_.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))),_},[h,c,p,x]),N=S(()=>{let _=[];for(let U=0;U<t.length;U++){let X=t[U],ee=M.valueScale(X.value),Z=M.categoryScale(U),V=X.color??s,j,H,Y=String(X.value);if(h){let K=c+Z,Q=c+x-ee;j={x:String(K),y:String(Q),width:String(M.barThickness),height:String(ee),rx:String(l),ry:String(l),fill:V},H={x:String(K+M.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let K=c+Z,Q=c;j={x:String(Q),y:String(K),width:String(ee),height:String(M.barThickness),rx:String(l),ry:String(l),fill:V},H={x:String(Q+ee+6),y:String(K+M.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(f&&(j.style=h?`animation: barGrow 0.6s ease-out ${U*.05}s both`:`animation: barGrow 0.6s ease-out ${U*.05}s both`),_.push(o("rect",{key:`bar-${U}`,...j})),d&&_.push(o("text",{key:`val-${U}`,...H},Y)),h){let K=c+Z+M.barThickness/2,Q=c+x+16;_.push(o("text",{key:`cat-${U}`,x:String(K),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${K}, ${Q})`},X.label))}else _.push(o("text",{key:`cat-${U}`,x:String(c-6),y:String(c+Z+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return _},[t,M,s,l,d,f,h,c,x]),A=S(()=>{if(!g)return[];let _=[];for(let U=0;U<g.length;U++){let X=g[U],ee=M.categoryScale(U),Z=0;for(let V=0;V<X.values.length;V++){let j=X.values[V],H=M.valueScale(j.value),Y=M.valueScale(Z),K=Mr(V,j.color);if(h){let Q=c+ee,se=c+x-Y-H;_.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(se),width:String(M.barThickness),height:String(H),rx:V===X.values.length-1?String(l):"0",ry:V===X.values.length-1?String(l):"0",fill:K,...f?{style:`animation: barGrow 0.6s ease-out ${(U*X.values.length+V)*.03}s both`}:{}})),d&&H>14&&_.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+M.barThickness/2),y:String(se+H/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let Q=c+Y,se=c+ee;_.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(se),width:String(H),height:String(M.barThickness),rx:V===X.values.length-1?String(l):"0",ry:V===X.values.length-1?String(l):"0",fill:K,...f?{style:`animation: barGrow 0.6s ease-out ${(U*X.values.length+V)*.03}s both`}:{}})),d&&H>20&&_.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+H/2),y:String(se+M.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}Z+=j.value}if(d){let V=M.valueScale(Z);h?_.push(o("text",{key:`stotal-${U}`,x:String(c+ee+M.barThickness/2),y:String(c+x-V-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z))):_.push(o("text",{key:`stotal-${U}`,x:String(c+V+6),y:String(c+ee+M.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z)))}if(h){let V=c+ee+M.barThickness/2,j=c+x+16;_.push(o("text",{key:`scat-${U}`,x:String(V),y:String(j),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${V}, ${j})`},X.label))}else _.push(o("text",{key:`scat-${U}`,x:String(c-6),y:String(c+ee+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return _},[g,M,l,d,f,h,c,x]),k=S(()=>{if(!g)return[];let _=C.length,U=[];for(let X=0;X<g.length;X++){let ee=g[X],Z=M.categoryScale(X),V=2,j=Math.max(1,(M.barThickness-V*(_-1))/_);for(let H=0;H<ee.values.length;H++){let Y=ee.values[H],K=C.indexOf(Y.category),Q=K*(j+V),se=M.valueScale(Y.value),J=Mr(K>=0?K:H,Y.color);if(h){let ae=c+Z+Q,de=c+x-se;U.push(o("rect",{key:`gbar-${X}-${H}`,x:String(ae),y:String(de),width:String(j),height:String(se),rx:String(l),ry:String(l),fill:J,...f?{style:`animation: barGrow 0.6s ease-out ${(X*_+H)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${X}-${H}`,x:String(ae+j/2),y:String(de-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}else{let ae=c,de=c+Z+Q;U.push(o("rect",{key:`gbar-${X}-${H}`,x:String(ae),y:String(de),width:String(se),height:String(j),rx:String(l),ry:String(l),fill:J,...f?{style:`animation: barGrow 0.6s ease-out ${(X*_+H)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${X}-${H}`,x:String(ae+se+4),y:String(de+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}}if(h){let H=c+Z+M.barThickness/2,Y=c+x+16;U.push(o("text",{key:`gcat-${X}`,x:String(H),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${H}, ${Y})`},ee.label))}else U.push(o("text",{key:`gcat-${X}`,x:String(c-6),y:String(c+Z+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},ee.label))}return U},[g,C,M,l,d,f,h,c,x]),w=S(()=>m?[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"},m)]:[],[m,n,c]),$=S(()=>f?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},h?"@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; } }"))]:[],[f,h]),E=F(),W=R(),z=w(),B=$(),O;return D&&y?O=k():D?O=A():O=N(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...B,...z,...E,...W,...O)}function it(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 Ft(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 Nt(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 b=t[u],m=e(b);isFinite(m)&&a.push({input:b,output:m})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),Rr(l)};return Rr(l),()=>{i=!0}}function Rr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Ml(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 Pr(e,t){let n=t-e;if(n<=0)return[e];let r=Ml(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 Ir(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var Se=40,$r=1.1,Dr=.01,Tr=1e6;function zr(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:b=!0,showAxes:m=!0,pointRadius:c=3,pointColor:f="#3b82f6",curveColor:g="#3b82f6",gridColor:y="#e2e8f0",axisColor:h="#94a3b8",onPointClick:p,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:T}=e,[D,C]=G(d[0]),[P,L]=G(d[1]),[I,M]=G(u[0]),[F,R]=G(u[1]),N=te(!1),A=te(null),k=S(Y=>Se+(Y-D)/(P-D)*(t-2*Se),[D,P,t]),w=S(Y=>n-Se-(Y-I)/(F-I)*(n-2*Se),[I,F,n]),$=S(Y=>D+(Y-Se)/(t-2*Se)*(P-D),[D,P,t]),E=S(Y=>I+(n-Se-Y)/(n-2*Se)*(F-I),[I,F,n]),W=S(Y=>{let K=Y;N.current=!0,A.current={mx:K.clientX,my:K.clientY,x0:D,x1:P,y0:I,y1:F}},[D,P,I,F]),z=S(Y=>{if(!N.current||!A.current)return;let K=Y,Q=A.current,se=K.clientX-Q.mx,J=K.clientY-Q.my,ae=se/(t-2*Se)*(Q.x1-Q.x0),de=J/(n-2*Se)*(Q.y1-Q.y0);C(Q.x0-ae),L(Q.x1-ae),M(Q.y0+de),R(Q.y1+de)},[t,n]),B=S(()=>{N.current=!1,A.current=null},[]),O=S(Y=>{let K=Y;K.preventDefault();let Q=K.currentTarget.getBoundingClientRect(),se=K.clientX-Q.left,J=K.clientY-Q.top,ae=$(se),de=E(J),le=K.deltaY>0?$r:1/$r,ne=(P-D)*le,fe=(F-I)*le;if(ne<Dr||fe<Dr||ne>Tr||fe>Tr)return;let oe=(ae-D)/(P-D),ie=(de-I)/(F-I);C(ae-oe*ne),L(ae+(1-oe)*ne),M(de-ie*fe),R(de+(1-ie)*fe)},[D,P,I,F,$,E]),_=[];if(_.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),b){let Y=Pr(D,P),K=Pr(I,F);for(let Q=0;Q<Y.length;Q++){let se=k(Y[Q]);_.push(o("line",{x1:se,y1:Se,x2:se,y2:n-Se,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),_.push(o("text",{x:se,y:n-Se+14,"text-anchor":"end","font-size":10,fill:h,transform:`rotate(-45, ${se}, ${n-Se+14})`,key:`lx-${Q}`},Ir(Y[Q])))}for(let Q=0;Q<K.length;Q++){let se=w(K[Q]);_.push(o("line",{x1:Se,y1:se,x2:t-Se,y2:se,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),_.push(o("text",{x:Se-6,y:se+3,"text-anchor":"end","font-size":10,fill:h,key:`ly-${Q}`},Ir(K[Q])))}}if(m){let Y=Math.max(Se,Math.min(t-Se,k(0))),K=Math.max(Se,Math.min(n-Se,w(0)));_.push(o("line",{x1:Se,y1:K,x2:t-Se,y2:K,stroke:h,"stroke-width":1,key:"x-axis"})),_.push(o("line",{x1:Y,y1:Se,x2:Y,y2:n-Se,stroke:h,"stroke-width":1,key:"y-axis"}))}let U=q(()=>{if(!i||!l)return[];let Y=a??(P-D)/s,K=it({start:D,end:P,step:Y});return Ft(i,K)},[i,D,P,a,s,l]),[X,ee]=G([]),Z=te(null);re(()=>{if(!i||l){ee([]);return}let Y=a??(P-D)/s,K=it({start:D,end:P,step:Y});return Z.current&&Z.current(),Z.current=Nt(i,K,200,Q=>{ee([...Q])}),()=>{Z.current&&Z.current()}},[i,D,P,a,s,l]);let V=l?U:X;if(V.length>0){let Y=[];for(let K=0;K<V.length;K++){let Q=V[K],se=k(Q.input),J=w(Q.output);Y.push(`${Y.length===0?"M":"L"}${se},${J}`)}_.push(o("path",{d:Y.join(" "),fill:"none",stroke:g,"stroke-width":1.5,key:"curve"}))}let j=(Y,K,Q,se)=>{if(K)return J=>K({x:se.x,y:se.y,index:Q,event:J})};for(let Y=0;Y<r.length;Y++){let K=r[Y],Q=k(K.x),se=w(K.y),J={cx:Q,cy:se,r:c,fill:f,cursor:"pointer",key:`pt-${Y}`};p&&(J.onClick=j("click",p,Y,K)),x&&(J.onDblClick=j("dblclick",x,Y,K)),v&&(J.onContextMenu=j("contextmenu",v,Y,K)),T&&(J.onMouseOver=j("mouseover",T,Y,K)),_.push(o("circle",J))}let H=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:Se,y:Se,width:t-2*Se,height:n-2*Se})));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:z,onMouseUp:B,onMouseLeave:B,onWheel:O},H,..._)}function Lr(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 Ar(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,b=0,m=0,c=0;return i<60?(b=l,m=d):i<120?(b=d,m=l):i<180?(m=l,c=d):i<240?(m=d,c=l):i<300?(b=d,c=l):(b=l,c=d),[Math.floor((b+u)*255),Math.floor((m+u)*255),Math.floor((c+u)*255)]}function Fr(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Lr){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let b=0;b<e;b++){let m=n[0]+b/e*(n[1]-n[0]);d.push(s(m,u,i))}a.push(d)}return a}function Nr(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=Lr,data:d,resolution:u=2,onPointClick:b,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:f}=e;if(d){let E=d.length,W=E>0?d[0].length:0,z=W>0?t/W:1,B=E>0?n/E:1,O=[];for(let _=0;_<E;_++){let U=d[_];for(let X=0;X<W;X++){let ee=U[X]??0,[Z,V,j]=Ar(ee,s,a);O.push(o("rect",{key:`${_}-${X}`,x:String(X*z),y:String(_*B),width:String(Math.ceil(z)),height:String(Math.ceil(B)),fill:`rgb(${Z},${V},${j})`}))}}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%"}},...O)}let[g,y]=G(r[0]),[h,p]=G(r[1]),[x,v]=G(i[0]),[T,D]=G(i[1]),C=te(null),P=te(!1),L=te(null),I=S((E,W)=>{let z=g+E/t*(h-g),B=T-W/n*(T-x);return{re:z,im:B}},[g,h,x,T,t,n]);re(()=>{let E=C.current;if(!E)return;let W=E.getContext("2d");if(!W)return;let z=W.createImageData(t,n),B=z.data;for(let O=0;O<n;O++)for(let _=0;_<t;_++){let{re:U,im:X}=I(_,O),ee=l(U,X,s),[Z,V,j]=Ar(ee,s,a),H=(O*t+_)*4;B[H]=Z,B[H+1]=V,B[H+2]=j,B[H+3]=255}W.putImageData(z,0,0)},[g,h,x,T,t,n,s,a,l,I]);let M=S(E=>{let W=E.target.getBoundingClientRect(),z=E.clientX-W.left,B=E.clientY-W.top,{re:O,im:_}=I(z,B),U=l(O,_,s);return{re:O,im:_,iterations:U,event:E}},[I,l,s]),F=S(E=>{P.current=!0,L.current={x:E.clientX,y:E.clientY,rMin:g,rMax:h,iMin:x,iMax:T}},[g,h,x,T]),R=S(E=>{if(m&&m(M(E)),!P.current||!L.current)return;let W=L.current,z=E.clientX-W.x,B=E.clientY-W.y,O=(W.rMax-W.rMin)/t,_=(W.iMax-W.iMin)/n;y(W.rMin-z*O),p(W.rMax-z*O),v(W.iMin+B*_),D(W.iMax+B*_)},[t,n,m,M]),N=S(()=>{P.current=!1},[]),A=S(E=>{E.preventDefault();let W=E.deltaY>0?1.15:1/1.15,z=E.target.getBoundingClientRect(),B=E.clientX-z.left,O=E.clientY-z.top,{re:_,im:U}=I(B,O);y(_+(g-_)*W),p(_+(h-_)*W),v(U+(x-U)*W),D(U+(T-U)*W)},[I,g,h,x,T]),k=S(E=>{b&&b(M(E))},[b,M]),w=S(E=>{c&&c(M(E))},[c,M]),$=S(E=>{E.preventDefault(),f&&f(M(E))},[f,M]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:F,onMouseMove:R,onMouseUp:N,onMouseLeave:N,onWheel:A,onClick:k,onDblClick:w,onContextMenu:$})}function Wr(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 El(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,b=y=>r+(y-i)/(s-i)*d,m=y=>n-r-(y-a)/(l-a)*u,c=6,f=Wr(i,s,c),g=Wr(a,l,c);return{xScale:b,yScale:m,xTicks:f,yTicks:g,xMin:i,xMax:s,yMin:a,yMax:l}}function un(e,t,n,r){return q(()=>El(e,t,n,r),[e,t,n,r])}function Br(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Or(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 Hr(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:b=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:f,yLabel:g,title:y,padding:h=50,animate:p=!1,multiLine:x}=e,v=q(()=>{let F=[...t];if(x)for(let R of x)F.push(...R.data);return F},[t,x]),T=un(v,n,r,h),{xScale:D,yScale:C,xTicks:P,yTicks:L}=T,I=[];if(I.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),b){for(let F=0;F<P.length;F++){let R=D(P[F]);I.push(o("line",{x1:R,y1:h,x2:R,y2:r-h,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${F}`}))}for(let F=0;F<L.length;F++){let R=C(L[F]);I.push(o("line",{x1:h,y1:R,x2:n-h,y2:R,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${F}`}))}}I.push(o("line",{x1:h,y1:r-h,x2:n-h,y2:r-h,stroke:"#374151","stroke-width":1,key:"x-axis"})),I.push(o("line",{x1:h,y1:h,x2:h,y2:r-h,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let F=0;F<P.length;F++){let R=D(P[F]);I.push(o("line",{x1:R,y1:r-h,x2:R,y2:r-h+5,stroke:"#374151",key:`xtick-${F}`})),I.push(o("text",{x:R,y:r-h+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${R}, ${r-h+18})`,key:`xlabel-${F}`},Br(P[F])))}for(let F=0;F<L.length;F++){let R=C(L[F]);I.push(o("line",{x1:h-5,y1:R,x2:h,y2:R,stroke:"#374151",key:`ytick-${F}`})),I.push(o("text",{x:h-10,y:R+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${F}`},Br(L[F])))}function M(F,R,N,A,k,w,$,E,W,z){if(F.length===0)return;let B=[...F].sort((U,X)=>U.x-X.x);if(A){let U=C(T.yMin),X=B.map(j=>`${D(j.x)},${C(j.y)}`).join(" "),ee=D(B[0].x),Z=D(B[B.length-1].x),V=`${ee},${U} ${X} ${Z},${U}`;I.push(o("polygon",{points:V,fill:k,key:`${z}-area`}))}let _={points:B.map(U=>`${D(U.x)},${C(U.y)}`).join(" "),fill:"none",stroke:R,"stroke-width":N,"stroke-linejoin":"round","stroke-linecap":"round",key:`${z}-line`};if(p?(_["stroke-dasharray"]="1000",_["stroke-dashoffset"]="1000",I.push(o("polyline",_,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):I.push(o("polyline",_)),w)for(let U=0;U<B.length;U++){let X=D(B[U].x),ee=C(B[U].y),Z=B[U].shape??W,V=B[U].radius??E,j=`${z}-pt-${U}`;if(p){let H=Or(Z,X,ee,V,$,j,{opacity:0});I.push(o("g",{key:`${j}-g`},H,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else I.push(Or(Z,X,ee,V,$,j))}}if(M(t,i,s,m,c,u,l,a,d,"primary"),x)for(let F=0;F<x.length;F++){let R=x[F];M(R.data,R.color,s,!1,"transparent",u,R.color,R.pointRadius??a,R.pointShape??d,`series-${F}`)}if(x&&x.length>0){let F=[],R=[{color:i,label:"Primary"},...x.map((O,_)=>({color:O.color,label:O.label??`Series ${_+1}`}))],N=h+10,A=16,k=22,w=7.2,$=14,E=6,W=n-h*2-20,z=0,B=0;for(let O=0;O<R.length;O++){let _=R[O].label.length*w,U=$+E+_;z>0&&z+U>W&&(z=0,B+=k);let X=N+z,ee=h-30-B;F.push(o("rect",{x:X,y:ee,width:$,height:14,fill:R[O].color,rx:2,key:`legend-rect-${O}`})),F.push(o("text",{x:X+$+E,y:ee+12,"font-size":12,fill:"#374151",key:`legend-text-${O}`},R[O].label)),z+=U+A}I.push(o("g",{key:"legend"},...F))}return f&&I.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},f)),g&&I.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"},g)),y&&I.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"},...I)}function Rl(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 Pl(e,t){let n=t??Rl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function st(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function pn(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=st(e,t,r,a),u=st(e,t,r,l),b=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${b} 1 ${u.x} ${u.y}`,"Z"].join(" ");let m=st(e,t,n,l),c=st(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${b} 1 ${u.x} ${u.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${b} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function fn(e,t){let n=t?.padAngle??0,r=Pl(e,t?.colors),i=e.reduce((u,b)=>u+b.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 b=e[u],m=b.value/i*a,c=d+n/2,f=c+m;l.push({label:b.label,value:b.value,startAngle:c,endAngle:f,percentage:b.value/i*100,color:r[u]}),d=f+n/2}return l}function _r(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:b,centerLabel:m,colors:c,strokeColor:f="#fff",strokeWidth:g=2,textColor:y="currentColor"}=e,h=d&&u==="right"?140:0,p=b?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-h,T=r-p-x,D=v/2,C=p+T/2,P=Math.min(v,T)/2-10,L=e.outerRadius??P,I=q(()=>fn(t,{padAngle:s,colors:c}),[t,s,c]),M=[];b&&M.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},b));for(let F=0;F<I.length;F++){let R=I[F],N=pn(D,C,i,L,R.startAngle,R.endAngle);if(M.push(o("path",{key:`slice-${F}`,d:N,fill:R.color,stroke:f,strokeWidth:g})),a||l){let A=(R.startAngle+R.endAngle)/2,k=R.percentage<5,w=k?L+14:i+(L-i)*.65,$=st(D,C,w,A-Math.PI/2),E=k?y:"#fff",W=k?11:12,z=[];if(a&&z.push(R.label),l&&z.push(`${R.percentage.toFixed(1)}%`),k){let B=st(D,C,L+2,A-Math.PI/2);M.push(o("line",{key:`connector-${F}`,x1:B.x,y1:B.y,x2:$.x,y2:$.y,stroke:"#999",strokeWidth:1}))}a&&M.push(o("text",{key:`label-${F}`,x:$.x,y:$.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:W,fill:E,pointerEvents:"none"},R.label)),l&&M.push(o("text",{key:`value-${F}`,x:$.x,y:$.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:W-1,fill:E,pointerEvents:"none"},`${R.percentage.toFixed(1)}%`))}}if(m&&i>0&&M.push(o("text",{key:"center-label",x:D,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},m)),d){let F=[];if(u==="right"){let R=v+10,N=p+20;for(let A=0;A<I.length;A++){let k=I[A],w=N+A*22;F.push(o("circle",{key:`legend-dot-${A}`,cx:R+6,cy:w,r:6,fill:k.color})),F.push(o("text",{key:`legend-text-${A}`,x:R+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let R=r-x+10;for(let N=0;N<I.length;N++){let A=I[N],k=N%2,w=Math.floor(N/2),$=k*(n/2)+10,E=R+w*22;F.push(o("circle",{key:`legend-dot-${N}`,cx:$+6,cy:E,r:6,fill:A.color})),F.push(o("text",{key:`legend-text-${N}`,x:$+18,y:E,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${A.label} (${A.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 Yr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Vr(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:b=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:f,onPointDoubleClick:g,onPointContextMenu:y,onPointHover:h}=e,[p,x]=G(r[1]),[v,T]=G(0),[D,C]=G(0),[P,L]=G(null),I=t/2+v,M=n/2+D,R=Math.min(t,n)/2-30,N=R/p,A=q(()=>{let V=Math.max(1,Math.ceil(p)),j=[],H=p/V;for(let Y=1;Y<=V;Y++)j.push(H*Y);return j},[p]),k=q(()=>{let V=[];for(let j=0;j<360;j+=30)V.push(j*Math.PI/180);return V},[]),w=q(()=>{if(!i||!l)return[];let V=a??2*Math.PI/s,j=it({start:0,end:2*Math.PI,step:V});return Ft(i,j)},[i,s,a,l]),[$,E]=G([]),W=te(null);re(()=>{if(!i||l){E([]);return}let V=a??2*Math.PI/s,j=it({start:0,end:2*Math.PI,step:V});return W.current&&W.current(),W.current=Nt(i,j,200,H=>{E([...H])}),()=>{W.current&&W.current()}},[i,s,a,l]);let z=l?w:$,B=q(()=>{if(z.length===0)return"";let V=[];for(let j=0;j<z.length;j++){let H=z[j],Y=H.output;if(Y<0||!isFinite(Y))continue;let{x:K,y:Q}=Yr(Y,H.input,I,M,N);V.push(`${V.length===0?"M":"L"}${K.toFixed(2)},${Q.toFixed(2)}`)}return V.join(" ")},[z,I,M,N]),O=S(V=>{L({x:V.clientX,y:V.clientY,px:v,py:D})},[v,D]),_=S(V=>{P&&(T(P.px+(V.clientX-P.x)),C(P.py+(V.clientY-P.y)))},[P]),U=S(()=>{L(null)},[]),X=S(V=>{V.preventDefault();let j=V.deltaY>0?1.15:1/1.15;x(Math.max(.1,p*j))},[p]),ee=S((V,j,H)=>{if(V)return Y=>V({r:j.r,theta:j.theta,index:H,event:Y})},[]),Z=[];if(Z.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let V=0;V<A.length;V++){let j=A[V]*N;Z.push(o("circle",{cx:I,cy:M,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${V}`})),Z.push(o("text",{x:I+j+2,y:M-4,"font-size":10,fill:"#9ca3af",key:`gl-${V}`},A[V].toFixed(1)))}for(let V=0;V<k.length;V++){let j=k[V],H=A[A.length-1]*N,Y=I+H*Math.cos(j),K=M-H*Math.sin(j);Z.push(o("line",{x1:I,y1:M,x2:Y,y2:K,stroke:"#e5e7eb","stroke-width":1,key:`al-${V}`}));let Q=Math.round(j*180/Math.PI),se=I+(H+14)*Math.cos(j),J=M-(H+14)*Math.sin(j);Z.push(o("text",{x:se,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${V}`},`${Q}\xB0`))}}Z.push(o("line",{x1:I-R,y1:M,x2:I+R,y2:M,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),Z.push(o("line",{x1:I,y1:M-R,x2:I,y2:M+R,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),B&&Z.push(o("path",{d:B,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let V=0;V<d.length;V++){let j=d[V],{x:H,y:Y}=Yr(j.r,j.theta,I,M,N);Z.push(o("circle",{cx:H,cy:Y,r:b,fill:m,key:`pt-${V}`,style:{cursor:"pointer"},onClick:ee(f,j,V),onDblClick:ee(g,j,V),onContextMenu:ee(y,j,V),onMouseEnter:ee(h,j,V)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:P?"grabbing":"grab"},onMouseDown:O,onMouseMove:_,onMouseUp:U,onMouseLeave:U,onWheel:X},...Z)}function gn(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 mn(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 hn(e,t){let n=Ur(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=$l(n,Il(e,i,s,a))}r++}return n}function Ur(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 Il(e,t,n,r){let i=Ur(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 $l(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 bn(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 xn(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 mt(e,t=[],n=.3,r=1){let i=gn(e),s=mn(e),a=hn(e,t);return{vertices:i.map((d,u)=>{let b=bn(a,d),m=xn(b,n);return{id:u,position:d,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function ht(e){return e*(e-1)/2}function Wt(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 jr(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,b=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=ht(t),f=1<<t,g=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Wt(f):e.vertexColors,[f,e.vertexColors]),[y,h]=G(()=>{let E=[];for(let W=0;W<c;W++)E.push(0);return E}),[p,x]=G(!1),v=te({x:0,y:0}),T=te([]),D=te(0);re(()=>{if(d===0)return;let E=!0,W=()=>{E&&(h(z=>{let B=z.slice();for(let O=0;O<B.length;O++)B[O]=(B[O]??0)+d*(1+O*.3);return B}),D.current=requestAnimationFrame(W))};return D.current=requestAnimationFrame(W),()=>{E=!1,cancelAnimationFrame(D.current)}},[d]);let C=q(()=>mt(t,y,l,m),[t,y,l,m]),P=n/2,L=r/2,I=q(()=>C.edges.map(E=>{let W=C.vertices[E.source],z=C.vertices[E.target],B=(W.depth+z.depth)/2;return{...E,avgDepth:B,sv:W,tv:z}}).sort((E,W)=>E.avgDepth-W.avgDepth),[C]),M=q(()=>C.vertices.slice().sort((E,W)=>E.depth-W.depth),[C]),F=S(E=>{let W=E;x(!0),v.current={x:W.clientX,y:W.clientY},T.current=y.slice()},[y]),R=S(E=>{if(!p)return;let W=E,z=(W.clientX-v.current.x)*.01,B=(W.clientY-v.current.y)*.01;h(()=>{let O=T.current.slice();return O.length>0&&(O[0]=(O[0]??0)+z),O.length>1&&(O[1]=(O[1]??0)+B),O})},[p]),N=S(()=>{x(!1)},[]),A=E=>{let W=(E+2)/4;return .3+.7*Math.max(0,Math.min(1,W))},k=E=>{let W=(E+2)/4;return .6+.4*Math.max(0,Math.min(1,W))},w=I.map((E,W)=>{let z=A(E.avgDepth);return o("line",{key:`e-${E.source}-${E.target}`,x1:String(P+E.sv.x),y1:String(L+E.sv.y),x2:String(P+E.tv.x),y2:String(L+E.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(z),"stroke-linecap":"round"})}),$=M.map(E=>{let W=i*k(E.depth),z=g[E.id%g.length]??"#3b82f6",B=[o("circle",{key:`v-${E.id}-circle`,cx:String(P+E.x),cy:String(L+E.y),r:String(W),fill:z,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&B.push(o("text",{key:`v-${E.id}-label`,x:String(P+E.x),y:String(L+E.y+W+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},E.id.toString(2).padStart(t,"0"))),B});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:b,cursor:p?"grabbing":"grab",userSelect:"none"},onMouseDown:F,onMouseMove:R,onMouseUp:N,onMouseLeave:N},...w,...$.flat())}function Gr(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=ht(t),[a,l]=G(()=>new Array(s).fill(0));return re(()=>{if(n===0)return;let u=!0,b=0,m=()=>{u&&(l(c=>c.map((f,g)=>f+n*(1+g*.3))),b=requestAnimationFrame(m))};return b=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(b)}},[n]),{data:q(()=>mt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Xr(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:Dl(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?zl(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,b=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=Tl(d,b,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function Dl(e,t){return"column"}function Tl(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 zl(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"}},Al(n),o("span",null,n.label))))}function Al(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 Ll(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 Fl(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function qr(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return re(()=>{if(n||typeof window>"u")return;Ll(t),Fl();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 Kr(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:b,ariaLabel:m="Site footer"}=e;return o("footer",{className:b,role:"contentinfo","aria-label":m,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 Qr=We({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),Nl={width:600,height:400},Wl={x:30,y:30},Bl={top:0,left:0,width:1920,height:1080},yn=1e3;function Zr(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 Sn(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 Jr(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 vn(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function wn(e){let t=e.workspaceBounds??Bl,n=e.defaultWindowSize??Nl,r=e.cascadeOffset??Wl,[i,s]=G([]),a=S(((...F)=>{let R=F[0];s(N=>{if(N.find(B=>B.id===R.id)){let O=vn(N)+1,_=N.map(U=>U.id===R.id?{...U,focused:!0,zIndex:O,windowState:U.windowState==="minimized"?"normal":U.windowState}:{...U,focused:!1});return O>yn&&(_=Sn(_)),_}let k=R.size??n,w=R.position??Zr(N.length,r,t,k),E=vn(N)+1,W={id:R.id,title:R.title,icon:R.icon,position:w,size:k,windowState:"normal",zIndex:E,focused:!0,appProps:R.appProps},z=N.map(B=>({...B,focused:!1}));return z.push(W),E>yn&&(z=Sn(z)),e.onWindowOpen&&e.onWindowOpen(R.id),e.onFocusChange&&e.onFocusChange(R.id),z})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=S(((...F)=>{let R=F[0];v(N=>{if(N[R]){let A={...N};return delete A[R],A}return N}),D(N=>{if(N.has(R)){let A=new Map(N);return A.delete(R),A}return N}),s(N=>{let A=N.find(w=>w.id===R);if(!A)return N;let k=N.filter(w=>w.id!==R);if(A.focused&&k.length>0){let w=Jr(k,R);if(w){let $=k.map(E=>({...E,focused:E.id===w.id}));return e.onWindowClose&&e.onWindowClose(R),e.onFocusChange&&e.onFocusChange(w.id),$}}return e.onWindowClose&&e.onWindowClose(R),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=S(((...F)=>{let R=F[0];s(N=>{if(!N.find(E=>E.id===R))return N;let w=vn(N)+1,$=N.map(E=>E.id===R?{...E,focused:!0,zIndex:w}:{...E,focused:!1});return w>yn&&($=Sn($)),e.onFocusChange&&e.onFocusChange(R),$})}),[e.onFocusChange]),u=S(((...F)=>{let R=F[0];s(N=>{let A=N.find(w=>w.id===R);if(!A)return N;let k=N.map(w=>w.id===R?{...w,windowState:"minimized",focused:!1}:w);if(A.focused){let w=Jr(k,R);w?(k=k.map($=>({...$,focused:$.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),b=S(((...F)=>{let R=F[0];s(N=>N.map(A=>A.id===R?{...A,windowState:"maximized"}:A))}),[]),m=S(((...F)=>{let R=F[0];s(N=>N.map(A=>A.id===R?{...A,windowState:"normal"}:A))}),[]),c=S(((...F)=>{let R=F[0],N=F[1];s(A=>A.map(k=>k.id===R?{...k,position:N}:k))}),[]),f=S(((...F)=>{let R=F[0],N=F[1];s(A=>A.map(k=>k.id===R?{...k,size:N}:k))}),[]),g=S(((...F)=>{s(R=>{let N=R.filter(w=>w.windowState!=="minimized");if(N.length===0)return R;let A=N.length,k=new Map;if(A===1)k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(A===2){let w=Math.floor(t.width/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:t.height}})}else if(A===3){let w=Math.floor(t.width/2),$=Math.floor(t.height/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:$}}),k.set(N[2].id,{position:{x:t.left+w,y:t.top+$},size:{width:t.width-w,height:t.height-$}})}else{let w=Math.ceil(Math.sqrt(A)),$=Math.ceil(A/w),E=Math.floor(t.width/w),W=Math.floor(t.height/$);for(let z=0;z<N.length;z++){let B=Math.floor(z/w),O=z%w;k.set(N[z].id,{position:{x:t.left+O*E,y:t.top+B*W},size:{width:E,height:W}})}}return R.map(w=>{let $=k.get(w.id);return $?{...w,position:$.position,size:$.size,windowState:"normal"}:w})})}),[t]),y=S(((...F)=>{s(R=>{let N=R.filter(w=>w.windowState!=="minimized");if(N.length===0)return R;let A=[...N].sort((w,$)=>w.zIndex-$.zIndex),k=new Map;for(let w=0;w<A.length;w++){let $=Zr(w,r,t,A[w].size);k.set(A[w].id,{position:$,zIndex:w+1})}return R.map(w=>{let $=k.get(w.id);return $?{...w,position:$.position,zIndex:$.zIndex,windowState:"normal"}:w})})}),[r,t]),h=S(((...F)=>{s(R=>{let N=R.map(A=>({...A,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),N})}),[e.onFocusChange]),p=q(()=>{let F=i.find(R=>R.focused);return F?F.id:null},[i]),[x,v]=G({}),[T,D]=G(new Map),C=S(((...F)=>{let R=F[0],N=F[1];v(A=>({...A,[R]:N}))}),[]),P=S(((...F)=>{let R=F[0];v(N=>{let A={...N};return delete A[R],A})}),[]),L=q(()=>p&&x[p]?x[p]:null,[p,x]),I=S(((...F)=>{let R=F[0],N=F[1];D(A=>{let k=new Map(A),w=k.get(R);return k.set(R,{...w,...N}),k})}),[]),M=q(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:b,restoreWindow:m,moveWindow:c,resizeWindow:f,tileWindows:g,cascadeWindows:y,minimizeAll:h,focusedWindowId:p,setMenuBar:C,clearMenuBar:P,activeMenuBar:L,signalDock:I,dockSignals:T}),[i,a,l,d,u,b,m,c,f,g,y,h,p,C,P,L,I,T]);return o(Qr.Provider,{value:M},e.children)}function bt(){return Ae(Qr)}var ei=We({appId:""});function Xe(e){let t=q(()=>({appId:e.appId}),[e.appId]);return o(ei.Provider,{value:t},e.children)}function at(){return Ae(ei).appId}var ti=We({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function xt(e){let t=te([]),n=te([]),r=S(((...l)=>{let d=l[0],u=l[1],b=l[2],m=l[3]||"",c={channel:d,from:m,to:b||null,payload:u,timestamp:Date.now()},f=t.current;for(let y=0;y<f.length;y++){let h=f[y];h.channel===d&&(c.to&&h.appId!==c.to||!c.to&&h.appId===m||h.handler(c))}let g=n.current;for(let y=0;y<g.length;y++)g[y].handler(c)}),[]),i=S(((...l)=>{let d=l[0],u=l[1],b=l[2]||"",m={channel:d,handler:u,appId:b};return t.current=[...t.current,m],()=>{t.current=t.current.filter(c=>c!==m)}}),[]),s=S(((...l)=>{let u={handler:l[0]};return n.current=[...n.current,u],()=>{n.current=n.current.filter(b=>b!==u)}}),[]),a=q(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(ti.Provider,{value:a},e.children)}function qe(){let e=Ae(ti),t=at(),n=S(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=S(((...i)=>{let s=i[0],a=i[1];return e.subscribe(s,a,t)}),[e.subscribe,t]);return q(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function yt(e,t){let n=qe(),r=te(t);r.current=t,re(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var ni=We({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function St(e){let[t,n]=G(null),[r,i]=G({x:0,y:0}),s=te(new Map),a=te(null),l=t!==null,d=S(((...f)=>{let g=f[0];n(g)}),[]),u=S(((...f)=>{if(a.current){let g=s.current.get(a.current);g&&g.onDragLeave&&g.onDragLeave(),a.current=null}n(null)}),[]),b=S(((...f)=>{let g=f[0],y=f[1];return s.current=new Map(s.current),s.current.set(g,y),()=>{s.current=new Map(s.current),s.current.delete(g),a.current===g&&(a.current=null)}}),[]);re(()=>{if(!l)return;let f=h=>{let p=h;i({x:p.clientX,y:p.clientY});let x=document.elementFromPoint(p.clientX,p.clientY);if(!x)return;let v=null,T=s.current;T.forEach((C,P)=>{let L=document.querySelector(`[data-dropzone-id="${P}"]`);L&&L.contains(x)&&(v=P)});let D=a.current;if(v!==D){if(D){let C=T.get(D);C&&C.onDragLeave&&C.onDragLeave()}if(v){let C=T.get(v);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=v}},g=h=>{let p=a.current;if(p&&t){let x=s.current.get(p);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},y=h=>{h.key==="Escape"&&u()};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",g),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",g),document.removeEventListener("keydown",y)}},[l,t,u]);let m=q(()=>({startDrag:d,cancelDrag:u,registerDropZone:b,currentDrag:t,isDragging:l}),[d,u,b,t,l]),c=l?o("div",{className:"drag-drop-preview",style:{position:"fixed",left:`${r.x+12}px`,top:`${r.y+12}px`,pointerEvents:"none",zIndex:"10000",opacity:"0.8",padding:"6px 10px",backgroundColor:"rgba(50, 50, 50, 0.9)",color:"#ffffff",borderRadius:"4px",fontSize:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",whiteSpace:"nowrap"}},t&&t.preview?String(t.preview):`Dragging ${t?t.type:""}`):null;return o(ni.Provider,{value:m},e.children,c)}function Qe(){return Ae(ni)}function vt(e,t){let n=Qe(),r=at(),i=te(t);i.current=t;let s=S(l=>{l.preventDefault(),n.startDrag({type:e,data:i.current,sourceAppId:r||""})},[n,e,r]),a=n.isDragging&&n.currentDrag!==null&&n.currentDrag.type===e;return q(()=>({onMouseDown:s,isDragging:a}),[s,a])}function wt(e){let t=Qe(),[n,r]=G(!1),i=te(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=te(e);s.current=e,re(()=>t.registerDropZone(i.current,{acceptTypes:s.current.acceptTypes,onDragEnter:d=>{r(!0),s.current.onDragEnter&&s.current.onDragEnter(d)},onDragLeave:()=>{r(!1),s.current.onDragLeave&&s.current.onDragLeave()},onDrop:d=>{r(!1),s.current.onDrop(d)}}),[t]);let a=t.isDragging&&t.currentDrag!==null&&e.acceptTypes.indexOf(t.currentDrag.type)!==-1;return q(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var Ol=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Hl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kn(e){return e<10?"0"+String(e):String(e)}function _l(e,t,n){let r=e.getHours(),i=kn(e.getMinutes()),s=kn(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=kn(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function Yl(e){let t=Ol[e.getDay()],n=Hl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Vl(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ce(),a=S(()=>{n()},[n]),l=S(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 Ul(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=G(new Date);re(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=q(()=>_l(i,t,n),[i,t,n]),l=q(()=>Yl(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 jl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ce(),s=S(()=>{t.onClick&&t.onClick()},[t]),a=S(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 Gl(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ce();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=S(()=>{t.onClick(),n()},[t,n]),l=S(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 Xl(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ce(),[a,l]=G(!1),d=te(null),u=S(()=>{l(h=>!h)},[]),b=S(()=>{l(!1)},[]),m=S(h=>{let p=h;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),l(x=>!x)),p.key==="Escape"&&l(!1)},[]);re(()=>{if(!a)return;let h=p=>{let x=d.current;x&&!x.contains(p.target)&&l(!1)};return document.addEventListener("click",h,!0),()=>{document.removeEventListener("click",h,!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"},f=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),g=o("span",{style:c,"aria-hidden":"true"},f),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((h,p)=>o(Gl,{key:String(p),item:h,onClose:b}))):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:m,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"}},g,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function ql(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ce(),[s,a]=G(!1),l=te(null),d=S(()=>{a(c=>!c)},[]),u=S(()=>{a(!1)},[]),b=S(c=>{let f=c;(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),a(g=>!g)),f.key==="Escape"&&a(!1)},[]);re(()=>{if(!s)return;let c=f=>{let g=l.current;g&&!g.contains(f.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let m=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"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"}},...t.items.map((c,f)=>c.divider?o("div",{key:"div-"+String(f),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(f),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),u()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:"transparent",color:c.disabled?"rgba(255,255,255,0.4)":"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:c.disabled?"default":"pointer",boxSizing:"border-box"}},o("span",null,c.checked?"\u2713 ":"",c.label||""),c.shortcut?o("span",{style:{fontSize:"11px",opacity:"0.6",marginLeft:"16px"}},c.shortcut):null))):null;return o("div",{ref:l,className:"system-tray__app-menu",style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(s),tabIndex:0,onClick:d,onKeyDown:b,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",padding:"0 10px",height:"100%",border:"none",outline:"none",backgroundColor:n||s?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"500",cursor:"pointer",transition:"background-color 0.15s"}},t.label),m)}function Cn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:b=28,children:m}=e,c=String(b)+"px",f=[];if(n&&f.push(o(Vl,{key:"activities",label:n.label,onClick:n.onClick})),t&&f.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let v=0;v<r.menus.length;v++)f.push(o(ql,{key:"appmenu-"+String(v),menu:r.menus[v]}));let g=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...f),y=[];y.push(o(Ul,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let h=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),p=[];if(l&&l.length>0){let v=l.map(T=>o(jl,{key:T.id,indicator:T}));p.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&p.push(o(Xl,{key:"user",user:d,menuItems:u}));let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...p);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},g,h,x)}function Kl(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var oi=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function Zl(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return oi[Math.abs(t)%oi.length]}function Jl(e){return e>99?"99+":String(e)}function Ql(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function ec(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 tc(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 nc(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=G(!1),u=t.disabled??!1,b=S(()=>{u||d(!0)},[u]),m=S(()=>{d(!1)},[]),c=S(()=>{!u&&s&&s(t.id)},[u,s,t.id]),f=S(D=>{if(!u&&a){let C=D;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),g=`${n}px`,y=Kl(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:g,height:g,objectFit:"contain",display:"block"}}):o("span",{style:{width:g,height:g,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:Zl(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),h=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"},Jl(t.badge)):null,p=t.active?o("span",{style:{...tc(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,x=t.progress!=null&&t.progress>0?o("div",{style:{position:"absolute",bottom:"2px",left:"6px",right:"6px",height:"3px",backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"2px",overflow:"hidden",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},o("div",{style:{width:`${Math.min(1,Math.max(0,t.progress))*100}%`,height:"100%",backgroundColor:"var(--dock-progress-color, #3b82f6)",borderRadius:"2px",transition:"width 200ms ease"}})):null,v=l?o("div",{role:"tooltip",style:{position:"absolute",...ec(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,T={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)"}:{},...t.urgent&&!u?{animation:"dock-urgent-pulse 0.6s ease-in-out infinite alternate"}:{}};return o("button",{type:"button",role:"button",style:T,"aria-label":Ql(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:f,onMouseEnter:b,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,h,p,x,v)}function Mn(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,[b,m]=G(!s),c=te(null),f=S(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),m(!0))},[s]),g=S(()=>{s&&(c.current=setTimeout(()=>{m(!1)},300))},[s]),y=S(T=>{let D=T,C=D.target,P=C.closest('[role="toolbar"]');if(!P)return;let L=Array.from(P.querySelectorAll("button[data-dock-item-id]")),I=L.indexOf(C);if(I<0)return;let M=n==="vertical",F=M?"ArrowDown":"ArrowRight",R=M?"ArrowUp":"ArrowLeft";if(D.key===F){D.preventDefault();let N=L[I+1];N&&N.focus()}else if(D.key===R){D.preventDefault();let N=L[I-1];N&&N.focus()}else D.key==="Home"?(D.preventDefault(),L[0]?.focus()):D.key==="End"?(D.preventDefault(),L[L.length-1]?.focus()):(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),C.click())},[n]),h=n==="vertical",p={display:"flex",flexDirection:h?"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&&!b&&(r==="left"?(p.transform="translateX(-100%)",p.opacity="0"):r==="right"?(p.transform="translateX(100%)",p.opacity="0"):r==="top"?(p.transform="translateY(-100%)",p.opacity="0"):r==="bottom"&&(p.transform="translateY(100%)",p.opacity="0"));let x=[];for(let T=0;T<t.length;T++){if(a&&T===t.length-1&&t.length>1){let D=h?{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"};x.push(o("div",{key:`sep-${T}`,style:D,"aria-hidden":"true",role:"separator"}))}x.push(o(nc,{key:t[T].id,item:t[T],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let v=s&&!b?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:p,onMouseEnter:f,onMouseLeave:g,onKeyDown:y},v,...x,u??null)}var oc="#2c001e";function En(e){let{backgroundColor:t=oc,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,b=S(p=>{let x=p;x.target===x.currentTarget&&a&&a()},[a]),m=S(p=>{let x=p;x.target===x.currentTarget&&l&&l()},[l]),c=q(()=>{let p={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return p.backgroundColor=t,n&&(p.background=n),r&&i>=1&&(p.backgroundImage=`url(${r})`,p.backgroundSize="cover",p.backgroundPosition="center"),p},[t,n,r,i]),f=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]),g={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];f&&y.push(o("div",{className:"desktop-background__image-overlay",style:f,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:g},u));let h=o("div",{className:"desktop-background",style:c,onClick:b,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(Lt,{items:s},h):h}var rc={width:200,height:150},ic={x:50,y:50},sc={width:400,height:300},Me=8,Rn=20,ac={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 kt(e){let{id:t,title:n,icon:r,defaultPosition:i=ic,defaultSize:s=sc,minSize:a=rc,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:b="normal",focused:m=!0,zIndex:c,onClose:f,onMinimize:g,onMaximize:y,onFocus:h,onMove:p,onResize:x,children:v}=e,[T,D]=G(i.x),[C,P]=G(i.y),[L,I]=G(s.width),[M,F]=G(s.height),[R,N]=G(!1),[A,k]=G(!1),[w,$]=G(null),E=te(null),W=te(null),z=te(null),B=S((ne,fe)=>{let oe=Math.max(ne,a.width),ie=Math.max(fe,a.height);return l&&(oe=Math.min(oe,l.width),ie=Math.min(ie,l.height)),{width:oe,height:ie}},[a,l]),O=S(()=>{let ne=z.current;return ne&&ne.parentElement?{width:ne.parentElement.clientWidth,height:ne.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),_=S((ne,fe,oe,ie)=>{let ue=O(),he=Math.max(0,Math.min(ne,ue.width-oe)),be=Math.max(0,Math.min(fe,ue.height-ie));return{x:he,y:be}},[O]),U=S(ne=>{if(!u||b==="maximized")return;let fe=ne;fe.target.closest("button")||(fe.preventDefault(),E.current={startMouseX:fe.clientX,startMouseY:fe.clientY,startPosX:T,startPosY:C},N(!0))},[u,b,T,C]),X=S(ne=>{ne.target.closest("button")||y&&y()},[y]);re(()=>{if(!R)return;let ne=oe=>{let ie=oe,ue=E.current;if(!ue)return;let he=ie.clientX-ue.startMouseX,be=ie.clientY-ue.startMouseY,pe=ue.startPosX+he,ge=ue.startPosY+be,ye=O();pe=Math.max(0,Math.min(pe,ye.width-L)),ge=Math.max(0,Math.min(ge,ye.height-M)),D(pe),P(ge),ie.clientX<=Rn?$("left"):ie.clientX>=ye.width-Rn?$("right"):ie.clientY<=Rn?$("top"):$(null)},fe=oe=>{let ie=oe;N(!1);let ue=O();if(w==="left"){D(0),P(0),I(Math.floor(ue.width/2)),F(ue.height),$(null),p&&p({x:0,y:0}),x&&x({width:Math.floor(ue.width/2),height:ue.height});return}if(w==="right"){let be=Math.floor(ue.width/2);D(be),P(0),I(be),F(ue.height),$(null),p&&p({x:be,y:0}),x&&x({width:be,height:ue.height});return}if(w==="top"){$(null),y&&y();return}$(null);let he=E.current;if(he&&p){let be=ie.clientX-he.startMouseX,pe=ie.clientY-he.startMouseY,ge=he.startPosX+be,ye=he.startPosY+pe;ge=Math.max(0,Math.min(ge,ue.width-L)),ye=Math.max(0,Math.min(ye,ue.height-M)),p({x:ge,y:ye})}E.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",fe)}},[R,w,L,M,O,p,x,y]);let ee=S(ne=>fe=>{if(!d||b!=="normal")return;let oe=fe;oe.preventDefault(),oe.stopPropagation(),W.current={direction:ne,startMouseX:oe.clientX,startMouseY:oe.clientY,startPosX:T,startPosY:C,startWidth:L,startHeight:M},k(!0)},[d,b,T,C,L,M]);re(()=>{if(!A)return;let ne=oe=>{let ie=oe,ue=W.current;if(!ue)return;let he=ie.clientX-ue.startMouseX,be=ie.clientY-ue.startMouseY,pe=ue.direction,ge=ue.startWidth,ye=ue.startHeight,ve=ue.startPosX,De=ue.startPosY;pe.includes("e")&&(ge=ue.startWidth+he),pe.includes("w")&&(ge=ue.startWidth-he,ve=ue.startPosX+he),pe.includes("s")&&(ye=ue.startHeight+be),pe.includes("n")&&(ye=ue.startHeight-be,De=ue.startPosY+be);let ce=B(ge,ye);pe.includes("w")&&(ve=ue.startPosX+(ue.startWidth-ce.width)),pe.includes("n")&&(De=ue.startPosY+(ue.startHeight-ce.height)),I(ce.width),F(ce.height),D(ve),P(De)},fe=()=>{k(!1),x&&x({width:L,height:M}),W.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",fe)}},[A,L,M,B,x]),re(()=>{if(!m||!f)return;let ne=fe=>{fe.key==="Escape"&&f()};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[m,f]);let Z=S(ne=>{h&&h()},[h]);if(b==="minimized")return null;let V=b==="maximized",j=q(()=>{let ne={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:V?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:m?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:V?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return V?(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"):(ne.top=`${C}px`,ne.left=`${T}px`,ne.width=`${L}px`,ne.height=`${M}px`),c!==void 0&&(ne.zIndex=String(c)),R&&(ne.cursor="grabbing",ne.userSelect="none"),ne},[V,T,C,L,M,c,m,R]),H=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&&!V?"grab":"default",opacity:m?"1":"0.6"};return R&&(ne.cursor="grabbing"),ne},[m,u,V,R]),Y={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},K={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 se=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:{...K,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:ne=>{ne.stopPropagation(),g&&g()}}),o("button",{type:"button","aria-label":V?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...K,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:{...K,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:ne=>{ne.stopPropagation(),f&&f()}}));Q.push(se);let J=[];if(d&&!V){let ne=["n","s","e","w","ne","nw","se","sw"];for(let fe=0;fe<ne.length;fe++){let oe=ne[fe],ie={position:"absolute",zIndex:"1"};oe==="n"?(ie.top="0",ie.left=`${Me}px`,ie.right=`${Me}px`,ie.height=`${Me}px`):oe==="s"?(ie.bottom="0",ie.left=`${Me}px`,ie.right=`${Me}px`,ie.height=`${Me}px`):oe==="e"?(ie.top=`${Me}px`,ie.right="0",ie.bottom=`${Me}px`,ie.width=`${Me}px`):oe==="w"?(ie.top=`${Me}px`,ie.left="0",ie.bottom=`${Me}px`,ie.width=`${Me}px`):oe==="ne"?(ie.top="0",ie.right="0",ie.width=`${Me}px`,ie.height=`${Me}px`):oe==="nw"?(ie.top="0",ie.left="0",ie.width=`${Me}px`,ie.height=`${Me}px`):oe==="se"?(ie.bottom="0",ie.right="0",ie.width=`${Me}px`,ie.height=`${Me}px`):oe==="sw"&&(ie.bottom="0",ie.left="0",ie.width=`${Me}px`,ie.height=`${Me}px`),ie.cursor=ac[oe],J.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${oe}`,style:ie,onMouseDown:ee(oe)}))}}let ae=null;if(w){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"};w==="left"?(ne.top="0",ne.left="0",ne.width="50%",ne.height="100%"):w==="right"?(ne.top="0",ne.right="0",ne.width="50%",ne.height="100%"):w==="top"&&(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"),ae=o("div",{className:"draggable-window__snap-preview",style:ne})}let de=[];for(let ne=0;ne<J.length;ne++)de.push(J[ne]);de.push(o("div",{className:"draggable-window__title-bar",style:H,onMouseDown:U,onDblClick:X,role:"toolbar","aria-label":`${n} window controls`},...Q)),de.push(o("div",{className:"draggable-window__body",style:Y},v));let le=[o("div",{ref:z,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${b}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:Z},...de)];return ae&&le.push(ae),le.length===1?le[0]:o("div",{style:{display:"contents"}},...le)}var lc=["File","Edit","View","Insert","Format","Tools","Help"],ri={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"}]},cc=[{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"}}],dc=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],uc=["1","2","3","4","5","6","7"],pc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function fc(){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 ii(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function Bt(e){let[t,n]=G(!1),[r,i]=G(!1),[s,a]=G(!1),[l,d]=G(-1),[u,b]=G(""),[m,c]=G(-1),[f,g]=G(0),[y,h]=G("3"),p=te(null),x=S(()=>{document.execCommand("bold",!1),n(Y=>!Y),p.current&&p.current.focus()},[]),v=S(()=>{document.execCommand("italic",!1),i(Y=>!Y),p.current&&p.current.focus()},[]),T=S(()=>{document.execCommand("underline",!1),a(Y=>!Y),p.current&&p.current.focus()},[]),D={bold:x,italic:v,underline:T},C={bold:t,italic:r,underline:s},P=S(Y=>{document.execCommand(Y,!1),p.current&&p.current.focus()},[]),L=S(Y=>{document.execCommand("fontSize",!1,Y),h(Y),p.current&&p.current.focus()},[]),I=S(Y=>{c(K=>K===Y?-1:Y)},[]),M=S(Y=>{switch(Y){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":p.current&&(p.current.innerHTML="",g(0));break;default:break}c(-1),p.current&&p.current.focus()},[]),F=S(()=>{if(p.current){let Y=p.current.textContent??"";g(ii(Y))}},[]),R=S(()=>{c(-1)},[]),N=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"}),[]),A={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"},k={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"},w={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},$={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"},z=q(()=>fc(),[]),B=e.content??"Start typing...",O=ii(B),_=f>0?f:O;function U(Y){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:m===Y?"rgba(0,0,0,0.12)":l===Y?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let X={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 Z(Y,K){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[Y]??!1?"rgba(0,0,0,0.12)":u===Y?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...K??{}}}let V={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"},j={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"},H=lc.map((Y,K)=>{let Q=[Y];return m===K&&ri[Y]&&Q.push(o("div",{key:"dropdown",style:X,className:"word-processor__menu-dropdown"},...ri[Y].map((se,J)=>o("button",{key:String(J),style:ee,onClick:ae=>{ae.stopPropagation(),M(se.action)},role:"menuitem"},se.label)))),o("button",{key:String(K),style:U(K),role:"menuitem","aria-label":Y,onClick:()=>I(K),onMouseEnter:()=>{d(K)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:N},o("div",{className:"word-processor__menu-bar",style:A,role:"menubar"},...H),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:V,"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"}},...cc.map(Y=>o("button",{key:Y.id,style:Z(Y.id,Y.style),title:Y.shortcut?`${Y.label} (${Y.shortcut})`:Y.label,"aria-label":Y.label,"aria-pressed":String(C[Y.id]??!1),onClick:D[Y.id],onMouseEnter:()=>b(Y.id),onMouseLeave:()=>b("")},Y.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:j,"aria-label":"Font size",value:y,onChange:Y=>{let K=Y.target;L(K.value)}},...uc.map(Y=>o("option",{key:Y,value:Y},pc[Y])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...dc.map((Y,K)=>o("button",{key:String(K),style:Z(`align-${K}`),title:Y.label,"aria-label":Y.label,onClick:()=>P(Y.command),onMouseEnter:()=>b(`align-${K}`),onMouseLeave:()=>b("")},Y.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...z),o("main",{className:"word-processor__document-area",style:$,onClick:R},o("div",{className:"word-processor__page",style:E,contentEditable:"true",ref:p,onInput:F,suppressContentEditableWarning:!0},B)),o("div",{className:"word-processor__status-bar",style:W},o("span",null,"Page 1 of 1"),o("span",null,`${_} words`),o("span",null,"100%")))}var gc=["File","Edit","Selection","View","Go","Run","Terminal","Help"],si={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"}]},ai=[{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}],In={"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"]',"}"]},li=In["App.ts"],mc=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"]),hc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),ci="#569cd6",bc="#ce9178",xc="#4ec9b0",yc="#6a9955",Sc="#dcdcaa",Pn="#d4d4d4",vc="#d4d4d4",wc="#b5cea8";function kc(e){if(!e.trim())return[{text:"\xA0",color:Pn}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:yc});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:bc}),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:wc}),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=Pn;mc.has(i)?l=ci:hc.has(i)?l=xc:a?l=Sc:(i==="true"||i==="false")&&(l=ci),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:Pn}),n=r;continue}t.push({text:e[n],color:vc}),n++}return t}function Ot(e){let[t,n]=G("App.ts"),[r,i]=G({src:!0,components:!0,hooks:!0}),[s,a]=G(-1),[l,d]=G(li.length),u=te(null),b=S(H=>{n(H);let Y=In[H];Y&&d(Y.length)},[]),m=S(H=>{i(Y=>{let K={},Q=Object.keys(Y);for(let se=0;se<Q.length;se++)K[Q[se]]=Y[Q[se]];return K[H]=!Y[H],K})},[]),c=S(H=>{a(Y=>Y===H?-1:H)},[]),f=S(H=>{switch(H){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()},[]),g=S(()=>{if(u.current){let Y=(u.current.textContent??"").split(`
8
+ `);d(Math.max(Y.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"}),[]),h={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},p={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},x={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},v={...x,backgroundColor:"rgba(255,255,255,0.1)"},T={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"},D={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},C={flex:"1",display:"flex",overflow:"hidden"},P={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},L={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},I={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},M=(H,Y,K)=>({padding:"3px 8px",paddingLeft:`${12+H*16}px`,fontSize:"13px",cursor:"pointer",color:Y?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:K?"rgba(255,255,255,0.08)":"transparent"}),F={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},R={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},N={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},A={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},k={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},w={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},$={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"},z=8,B=30,O=In[t]??li,_=O.map((H,Y)=>{let K=kc(H),Q=[],se=0;for(let J of K)Q.push(o("span",{key:String(se++),style:{color:J.color}},J.text));return o("div",{key:String(Y),style:{minHeight:"20px"}},...Q)}),U=Math.max(l,O.length),X=[];for(let H=0;H<U;H++)X.push(o("div",{key:String(H)},String(H+1)));let ee=H=>{if(!H.parent)return!0;if(!r[H.parent])return!1;let Y=ai.find(K=>K.name===H.parent&&K.isFolder);return Y?ee(Y):!0},Z=gc.map((H,Y)=>{let K=[H],Q=s===Y;return Q&&si[H]&&K.push(o("div",{key:"dropdown",style:T,className:"ide__menu-dropdown"},...si[H].map((se,J)=>o("button",{key:String(J),style:D,onClick:ae=>{ae.stopPropagation(),f(se.action)},role:"menuitem"},se.label)))),o("button",{key:String(Y),style:Q?v:x,role:"menuitem","aria-label":H,onClick:()=>c(Y)},...K)}),j=ai.map((H,Y)=>{if(!ee(H))return null;let K=!H.isFolder&&H.name===t,Q=H.isFolder?r[H.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(Y),style:M(H.indent,H.isFolder,K),onClick:H.isFolder?()=>m(H.name):()=>b(H.name)},Q,H.name)}).filter(H=>H!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:h},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:p,role:"menubar"},...Z),o("div",{style:C},o("nav",{className:"ide__sidebar",style:P,"aria-label":"File explorer"},o("div",{style:I},"Explorer"),...j),o("div",{style:L}),o("div",{style:F},o("div",{style:R},o("button",{style:N,"aria-label":t},t)),o("div",{style:A},o("div",{style:k,"aria-hidden":"true"},...X),o("code",{style:w,contentEditable:"true",ref:u,onInput:g,suppressContentEditableWarning:!0},..._))),o("div",{className:"ide__minimap",style:$,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${z}px`,left:"0",right:"0",height:`${B}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...O.map((H,Y)=>o("div",{key:String(Y),style:{height:"2px",backgroundColor:H.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,H.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 Cc=[{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]}],di=[{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}],ui=[{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}],pi=[{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}],Mc=[{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}],Ec=[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],fi=[{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}],gi=[{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}],mi=["09:30","10:00","10:30","11:00","11:30","12:00"];function Rc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Ct(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Oe(e){return e.toFixed(2)}var lt={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},ct={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Ht={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Ie={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},$e={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},_t={cursor:"default",transition:"background-color 0.1s"};function Pc(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,b)=>{let m=b/(e.length-1)*40,c=14-(u-i)/a*14;return`${m.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 Ic(e,t){let u=Math.min(...e),b=Math.max(...e),m=b-u||1,c=310/(e.length-1),f=e.map((C,P)=>{let L=40+P*c,I=15+(1-(C-u)/m)*120;return{x:L,y:I}}),g=f.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+f.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${f[f.length-1].x.toFixed(1)},135 Z`,h=[];for(let C=1;C<e.length;C++){let P=e[C]>=e[C-1]?"#00c853":"#ff1744";h.push(o("line",{key:String(C),x1:String(f[C-1].x.toFixed(1)),y1:String(f[C-1].y.toFixed(1)),x2:String(f[C].x.toFixed(1)),y2:String(f[C].y.toFixed(1)),stroke:P,strokeWidth:"2",strokeLinecap:"round"}))}let p=[];for(let C=0;C<5;C++){let P=15+C/4*120,L=b-C/4*m;p.push(o("line",{key:`g${C}`,x1:String(40),y1:String(P.toFixed(1)),x2:String(350),y2:String(P.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),p.push(o("text",{key:`yl${C}`,x:String(36),y:String((P+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Oe(L)))}let x=[],v=Math.min(mi.length,e.length),T=(e.length-1)/(v-1);for(let C=0;C<v;C++){let L=40+Math.round(C*T)*c;x.push(o("text",{key:`tl${C}`,x:String(L.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},mi[C]))}let D="chartGrad";return o("div",{style:lt},o("div",{style:ct},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Oe(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:D,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(#${D})`}),...p,...x,...h,o("line",{x1:String(40),y1:String((15+(1-(t-u)/m)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/m)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function $c(){let e=Math.max(...di.map(t=>t.qty),...ui.map(t=>t.qty));return o("div",{style:lt},o("div",{style:ct},"Order Book"),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Bid Price"),o("th",{style:Ie},"Qty"),o("th",{style:Ie},"Ask Price"),o("th",{style:Ie},"Qty"))),o("tbody",null,...di.map((t,n)=>{let r=ui[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:_t},o("td",{style:{...$e,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Oe(t.price)),o("td",{style:{...$e,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Ct(t.qty)),o("td",{style:{...$e,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Oe(r.price):""),o("td",{style:{...$e,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Ct(r.qty):""))}))))}function Dc(e){return o("div",{style:lt},o("div",{style:ct},"Watchlist"),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Symbol"),o("th",{style:Ie},"Price"),o("th",{style:Ie},"Chg%"),o("th",{style:Ie},"Volume"))),o("tbody",null,...Cc.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:_t},o("td",{style:{...$e,fontWeight:"600",color:"#ffffff"}},t.symbol,Pc(t.spark,i)),o("td",{style:{...$e,fontFamily:"monospace"}},Oe(r)),o("td",{style:{...$e,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Oe(t.change)}%`),o("td",{style:{...$e,fontFamily:"monospace",color:"#8888aa"}},Rc(t.volume)))}))))}function Tc(){let e=pi.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:lt},o("div",{style:ct},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Oe(e)}`)),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Symbol"),o("th",{style:Ie},"Qty"),o("th",{style:Ie},"Avg"),o("th",{style:Ie},"P&L"))),o("tbody",null,...pi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{..._t,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...$e,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...$e,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...$e,fontFamily:"monospace"}},Oe(n.avgPrice)),o("td",{style:{...$e,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Oe(n.pnl)}`))}))))}function zc(){return o("div",{style:lt},o("div",{style:ct},"Recent Trades"),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Time"),o("th",{style:Ie},"Sym"),o("th",{style:Ie},"Side"),o("th",{style:Ie},"Qty"),o("th",{style:Ie},"Price"))),o("tbody",null,...Mc.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:_t},o("td",{style:{...$e,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...$e,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...$e,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...$e,fontFamily:"monospace"}},Ct(e.qty)),o("td",{style:{...$e,fontFamily:"monospace"}},Oe(e.price)))}))))}function Ac(){let e=Math.max(...fi.map(n=>n.volume),...gi.map(n=>n.volume)),t="16px";return o("div",{style:lt},o("div",{style:ct},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...fi.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"}},Oe(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"}},Ct(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...gi.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"}},Oe(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"}},Ct(n.volume))))))}function Yt(e){let[t,n]=G(0),[r,i]=G("--:--:--"),[s,a]=G(!0);re(()=>{let f=setInterval(()=>{n(g=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(f)},[]),re(()=>{let f=()=>{let y=new Date,h=String(y.getHours()).padStart(2,"0"),p=String(y.getMinutes()).padStart(2,"0"),x=String(y.getSeconds()).padStart(2,"0");i(`${h}:${p}:${x}`)};f();let g=setInterval(f,1e3);return()=>clearInterval(g)},[]),re(()=>{let f=setInterval(()=>{a(g=>!g)},800);return()=>clearInterval(f)},[]);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"},b={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},m=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:b},Ic(Ec,m),$c(),Dc(t),Tc(),zc(),Ac()))}var dt=["transparent","#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function $n(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:b,onGridToggle:m,onSearch:c}=e,[f,g]=G(""),y=S(P=>{let L=P.target.value;g(L),c(L)},[c]),h={display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.95)",borderBottom:"1px solid #e2e8f0",fontSize:"12px",flexShrink:"0",flexWrap:"wrap"},p={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},x={...p,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},v={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},T={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},D={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=dt.map(P=>{let L=P===r,I=P===i,M=()=>{L&&b?b(I?null:P):u(P)},F="1px solid rgba(0,0,0,0.15)";I?F="3px solid #ef4444":L&&(F="2px solid #3b82f6");let R=P==="transparent";return o("button",{key:P,title:R?"Transparent":P,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:R?"#ffffff":P,backgroundImage:R?"linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%)":"none",backgroundSize:R?"6px 6px":"auto",backgroundPosition:R?"0 0, 3px 3px":"0 0",border:F,cursor:"pointer",padding:"0",flexShrink:"0",opacity:I?"1":i?"0.5":"1"},onClick:M,"aria-label":I?`Clear color filter ${P}`:`Select color ${P}`,"data-testid":`color-swatch-${P}`})});return o("div",{className:"board-toolbar",style:h,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:p,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:T}),o("button",{style:p,onClick:l,"data-testid":"btn-zoom-out","aria-label":"Zoom out"},"-"),o("span",{style:v,onClick:d,"data-testid":"zoom-level",role:"status","aria-label":`Zoom ${Math.round(t*100)}%`},`${Math.round(t*100)}%`),o("button",{style:p,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:T}),...C,o("div",{style:T}),o("button",{style:n?x:p,onClick:m,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:T}),o("input",{type:"text",placeholder:"Search cards...",value:f,onInput:y,style:D,"data-testid":"search-input","aria-label":"Search cards"}))}var Dn={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},hi=dt,bi=[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"},{label:"Critical",value:"critical"}];function Tn(e){let{card:t,selected:n,onSelect:r,onMove:i,onResize:s,onDelete:a,onDoubleClick:l,onUpdate:d,onDragStart:u,onDuplicate:b,onChangeColor:m,onChangePriority:c,onAnchorDragStart:f,onCardContextMenu:g}=e,[y,h]=G(!1),[p,x]=G(!1),[v,T]=G(!1),[D,C]=G(t.title||""),[P,L]=G(t.description||""),I=te(null),M=te(null),F=te(null),R=te(null),N=te(null),A=t.priority?Dn[t.priority]||"#94a3b8":"transparent",{onMouseDown:k,isDragging:w}=vt("application/project-card",{id:t.id,title:t.title,description:t.description,color:t.color}),$=S(pe=>{let ge=pe;ge.preventDefault(),ge.stopPropagation(),g&&g(t.id,{x:ge.clientX,y:ge.clientY})},[t.id,g]);re(()=>{if(p&&R.current){let pe=R.current;pe.focus();let ge=pe.value.length;pe.setSelectionRange(ge,ge)}},[p]),re(()=>{if(v&&N.current){let pe=N.current;pe.focus();let ge=pe.value.length;pe.setSelectionRange(ge,ge)}},[v]);let E=S(pe=>{pe.preventDefault(),pe.stopPropagation(),C(t.title||""),x(!0)},[t.title]),W=S(pe=>{C(pe.target.value)},[]),z=S(()=>{let pe=D.trim();pe&&pe!==t.title&&d&&d(t.id,{title:pe}),x(!1)},[D,t.id,t.title,d]),B=S(pe=>{let ge=pe;ge.key==="Enter"?(ge.preventDefault(),z()):ge.key==="Escape"&&(ge.preventDefault(),x(!1))},[z]),O=S(()=>{z()},[z]),_=S(pe=>{pe.stopPropagation(),L(t.description||""),T(!0)},[t.description]),U=S(pe=>{L(pe.target.value)},[]),X=S(()=>{P!==t.description&&d&&d(t.id,{description:P}),T(!1)},[P,t.id,t.description,d]),ee=S(pe=>{let ge=pe;ge.key==="Escape"&&(ge.preventDefault(),X())},[X]),Z=S(()=>{X()},[X]),V=S((pe,ge)=>{let ye=ge;if(ye.preventDefault(),ye.stopPropagation(),f){let ve=t.position.x+t.size.width/2,De=t.position.y+t.size.height/2,ce=ve,me=De;pe==="top"?(ce=ve,me=t.position.y):pe==="bottom"?(ce=ve,me=t.position.y+t.size.height):pe==="left"?(ce=t.position.x,me=De):pe==="right"&&(ce=t.position.x+t.size.width,me=De),f(t.id,pe,ce,me)}},[t.id,t.position,t.size,f]),j=S(pe=>{let ge=pe,ye=ge.target;if(ye.dataset&&(ye.dataset.role==="delete"||ye.dataset.role==="resize"||ye.dataset.role==="anchor"||ye.dataset.role==="drag-handle"||ye.dataset.role==="inline-edit"))return;ge.preventDefault(),ge.stopPropagation(),r(t.id),I.current={x:ge.clientX,y:ge.clientY,cardX:t.position.x,cardY:t.position.y};let ve=ce=>{let me=ce;if(!I.current)return;let ke=me.clientX-I.current.x,Ee=me.clientY-I.current.y;i(t.id,{x:I.current.cardX+ke,y:I.current.cardY+Ee})},De=()=>{I.current=null,document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",De)};document.addEventListener("mousemove",ve),document.addEventListener("mouseup",De),u&&u(t.id,pe)},[t.id,t.position.x,t.position.y,r,i,u]),H=S(pe=>{let ge=pe;ge.preventDefault(),ge.stopPropagation(),M.current={x:ge.clientX,y:ge.clientY,w:t.size.width,h:t.size.height};let ye=De=>{let ce=De;if(!M.current)return;let me=ce.clientX-M.current.x,ke=ce.clientY-M.current.y,Ee=Math.max(120,M.current.w+me),ze=Math.max(80,M.current.h+ke);s(t.id,{width:Ee,height:ze})},ve=()=>{M.current=null,document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",ve)};document.addEventListener("mousemove",ye),document.addEventListener("mouseup",ve)},[t.id,t.size.width,t.size.height,s]),Y=S(pe=>{pe.preventDefault(),pe.stopPropagation()},[]),K=S(pe=>{pe.preventDefault(),pe.stopPropagation(),a(t.id)},[t.id,a]),Q={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:t.color||"#fef9c3",borderRadius:"6px",borderLeft:`4px solid ${A}`,boxShadow:n?"0 0 0 2px #3b82f6, 0 4px 12px rgba(0,0,0,0.15)":"0 2px 8px rgba(0,0,0,0.1)",cursor:"grab",userSelect:"none",overflow:"hidden",display:"flex",flexDirection:"column",padding:"8px 10px",boxSizing:"border-box",transition:"box-shadow 150ms ease"},se={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},J={fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},ae={position:"absolute",top:"4px",right:"4px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.15)",color:"#333",fontSize:"12px",lineHeight:"18px",textAlign:"center",cursor:"pointer",display:y?"block":"none",border:"none",padding:"0"},de={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},le=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((pe,ge)=>o("span",{key:String(ge),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},pe))):null,ne=t.assignee?o("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",fontSize:"10px",color:"#555"},"data-testid":`card-assignee-${t.id}`},o("span",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"#3b82f6",color:"#fff",fontSize:"9px",fontWeight:"700",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0"}},t.assignee.charAt(0).toUpperCase()),o("span",{},t.assignee)):null,fe={position:"absolute",top:"4px",right:"24px",width:"18px",height:"18px",borderRadius:"3px",backgroundColor:w?"rgba(59,130,246,0.4)":"rgba(0,0,0,0.1)",color:"#333",fontSize:"10px",lineHeight:"18px",textAlign:"center",cursor:"grab",display:y?"block":"none",border:"none",padding:"0"},oe={position:"absolute",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #ffffff",cursor:"crosshair",display:y?"block":"none",zIndex:"10",boxSizing:"border-box"},ie={...oe,top:"-5px",left:"50%",transform:"translateX(-50%)"},ue={...oe,top:"50%",right:"-5px",transform:"translateY(-50%)"},he={...oe,bottom:"-5px",left:"50%",transform:"translateX(-50%)"},be={...oe,top:"50%",left:"-5px",transform:"translateY(-50%)"};return o("div",{ref:F,className:"board-card",style:Q,onMouseDown:j,onDblClick:Y,onContextMenu:$,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),"data-card-id":t.id,"data-testid":`card-${t.id}`,role:"button","aria-label":`Card: ${t.title}`,tabIndex:0},p?o("input",{ref:R,type:"text",value:D,onInput:W,style:{...se,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",padding:"0",margin:"0",fontFamily:"inherit",boxSizing:"border-box"},"data-role":"inline-edit","data-testid":`card-title-input-${t.id}`,onKeyDown:B,onBlur:O,onMouseDown:pe=>pe.stopPropagation()}):o("div",{style:se,onDblClick:E,"data-testid":`card-title-${t.id}`},t.title||"Untitled"),v?o("textarea",{ref:N,value:P,onInput:U,style:{...J,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",padding:"0",margin:"0",fontFamily:"inherit",resize:"none",boxSizing:"border-box"},"data-role":"inline-edit","data-testid":`card-desc-input-${t.id}`,onKeyDown:ee,onBlur:Z,onMouseDown:pe=>pe.stopPropagation()}):o("div",{style:J,onClick:_,"data-testid":`card-desc-${t.id}`},t.description||""),le,ne,o("div",{style:fe,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.id}`,onMouseDown:pe=>{pe.stopPropagation(),k(pe)},"aria-label":`Export drag handle for ${t.title}`,title:"Drag to export card"},"\u2630"),o("button",{style:ae,"data-role":"delete","data-testid":`card-delete-${t.id}`,onClick:K,"aria-label":`Delete ${t.title}`,tabIndex:-1},"\xD7"),o("div",{style:de,"data-role":"resize",onMouseDown:H,"aria-label":"Resize card"}),o("div",{style:ie,"data-role":"anchor","data-anchor":"top","data-testid":`anchor-top-${t.id}`,onMouseDown:pe=>V("top",pe),"aria-label":"Connection anchor top"}),o("div",{style:ue,"data-role":"anchor","data-anchor":"right","data-testid":`anchor-right-${t.id}`,onMouseDown:pe=>V("right",pe),"aria-label":"Connection anchor right"}),o("div",{style:he,"data-role":"anchor","data-anchor":"bottom","data-testid":`anchor-bottom-${t.id}`,onMouseDown:pe=>V("bottom",pe),"aria-label":"Connection anchor bottom"}),o("div",{style:be,"data-role":"anchor","data-anchor":"left","data-testid":`anchor-left-${t.id}`,onMouseDown:pe=>V("left",pe),"aria-label":"Connection anchor left"}))}function zn(e){let{card:t,onSave:n,onClose:r}=e,[i,s]=G(t.title),[a,l]=G(t.description),d=te(null),u=te(null);re(()=>{d.current&&(d.current.focus(),d.current.select())},[]);let b=S(()=>{n(t.id,{title:i,description:a}),r()},[t.id,i,a,n,r]),m=S(D=>{D.key==="Escape"&&b()},[b]),c=S(D=>{D.target===u.current&&b()},[b]),f=S(D=>{s(D.target.value)},[]),g=S(D=>{l(D.target.value)},[]),y=S(D=>{let C=D;if(C.key==="Tab"){C.preventDefault();let P=C.target.parentElement?.querySelector("textarea");P&&P.focus()}C.key==="Escape"&&b()},[b]),h={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"},p={backgroundColor:t.color||"#fef9c3",borderRadius:"8px",padding:"16px",width:`${Math.max(t.size.width,200)}px`,boxShadow:"0 8px 24px rgba(0,0,0,0.2)",display:"flex",flexDirection:"column",gap:"8px"},x={border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",padding:"6px 8px",fontSize:"14px",fontWeight:"600",backgroundColor:"rgba(255,255,255,0.7)",color:"#1a1a1a",outline:"none",width:"100%",boxSizing:"border-box"},v={border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",padding:"6px 8px",fontSize:"12px",backgroundColor:"rgba(255,255,255,0.7)",color:"#333",outline:"none",resize:"vertical",minHeight:"60px",width:"100%",boxSizing:"border-box",fontFamily:"inherit"},T={padding:"6px 14px",border:"none",borderRadius:"4px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"12px",fontWeight:"600",alignSelf:"flex-end"};return o("div",{ref:u,className:"card-editor-overlay",style:h,onClick:c,onKeyDown:m,"data-testid":"card-editor-overlay"},o("div",{style:p,"data-testid":"card-editor",role:"dialog","aria-label":`Edit card: ${t.title}`},o("input",{ref:d,type:"text",value:i,onInput:f,onKeyDown:y,style:x,placeholder:"Card title","data-testid":"card-editor-title","aria-label":"Card title"}),o("textarea",{value:a,onInput:g,onKeyDown:m,style:v,placeholder:"Description...","data-testid":"card-editor-description","aria-label":"Card description"}),o("button",{style:T,onClick:b,"data-testid":"card-editor-save"},"Done")))}function xi(e){return{x:e.position.x+e.size.width/2,y:e.position.y+e.size.height/2}}function Lc(e){switch(e){case"dashed":return"8,4";case"dotted":return"2,4";default:return"none"}}function An(e){let{connections:t,cards:n,selectedConnectionId:r,onSelectConnection:i,canvasWidth:s,canvasHeight:a}=e,l=new Map;for(let m=0;m<n.length;m++)l.set(n[m].id,n[m]);let d=S(m=>{i(m)},[i]),u=[];for(let m=0;m<t.length;m++){let c=t[m],f=l.get(c.fromCardId),g=l.get(c.toCardId);if(!f||!g)continue;let y=xi(f),h=xi(g),p=c.id===r,x=p?"#3b82f6":"#94a3b8",v=Lc(c.style),T=h.x-y.x,D=h.y-y.y,C=Math.sqrt(T*T+D*D),P=Math.min(40,C*.15),L=C>0?-D/C:0,I=C>0?T/C:0,M=(y.x+h.x)/2,F=(y.y+h.y)/2,R=M+L*P,N=F+I*P,A=`M ${y.x} ${y.y} Q ${R} ${N} ${h.x} ${h.y}`;u.push(o("path",{key:`hit-${c.id}`,d:A,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer"},onClick:()=>d(c.id),"data-testid":`connection-hit-${c.id}`})),u.push(o("path",{key:c.id,d:A,fill:"none",stroke:x,"stroke-width":p?"3":"2","stroke-dasharray":v,"pointer-events":"none","data-testid":`connection-${c.id}`})),c.label&&u.push(o("text",{key:`label-${c.id}`,x:String(R),y:String(N-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none"},c.label))}return o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(s),height:String(a),className:"connections-overlay","data-testid":"connections-overlay",role:"img","aria-label":"Card connections"},o("g",{style:{pointerEvents:"auto"}},...u))}var ut=20,pt=5e3;function Si(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Ln(e,t,n,r){let i=r??40;if(e.length===0)return{panX:0,panY:0,zoom:1};let s=1/0,a=1/0,l=-1/0,d=-1/0;for(let h=0;h<e.length;h++){let p=e[h];p.position.x<s&&(s=p.position.x),p.position.y<a&&(a=p.position.y);let x=p.position.x+p.size.width,v=p.position.y+p.size.height;x>l&&(l=x),v>d&&(d=v)}let u=l-s+i*2,b=d-a+i*2,m=t/u,c=n/b,f=Math.max(.25,Math.min(4,Math.min(m,c))),g=-s*f+(t-(l-s)*f)/2,y=-a*f+(n-(d-a)*f)/2;return{panX:g,panY:y,zoom:f}}var yi=0;function Fc(){return yi++,`conn-${Date.now()}-${yi}`}function Fn(e){let{state:t,dispatch:n,searchQuery:r,gridEnabled:i,selectedCardId:s,onSelectCard:a,colorFilter:l,showConnections:d}=e,u=d!==!1,{cards:b,connections:m,viewport:c}=t,[f,g]=G(null),[y,h]=G(null),[p,x]=G(null),[v,T]=G(!1),[D,C]=G(!1),P=te(null),L=te(!1),I=te(null),[M,F]=G(null),R=te(M);R.current=M;let N=S(ce=>{let me=ce;if(me.target.closest(".board-card"))return;let Ee=me.button===1,ze=me.button===0&&me.shiftKey;Ee||ze?(me.preventDefault(),L.current=!0,I.current={x:me.clientX,y:me.clientY,panX:c.panX,panY:c.panY}):me.button===0&&(a(null),h(null))},[c.panX,c.panY,a]);re(()=>{let ce=ke=>{if(!L.current||!I.current)return;let Ee=ke,ze=Ee.clientX-I.current.x,Fe=Ee.clientY-I.current.y;n({type:"PAN",panX:I.current.panX+ze,panY:I.current.panY+Fe})},me=()=>{L.current=!1,I.current=null};return document.addEventListener("mousemove",ce),document.addEventListener("mouseup",me),()=>{document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",me)}},[n]);let A=S(ce=>{let me=ce;if(!me.ctrlKey)return;me.preventDefault();let ke=me.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+ke})},[c.zoom,n]),k=te(null);re(()=>{let ce=P.current;if(!ce)return;let me=Ne=>{let Te=[];for(let Re=0;Re<Ne.touches.length;Re++)Te.push({x:Ne.touches[Re].clientX,y:Ne.touches[Re].clientY});return Te},ke=(Ne,Te)=>Math.sqrt((Ne.x-Te.x)**2+(Ne.y-Te.y)**2),Ee=Ne=>{let Te=Ne;if(Te.touches.length===2){Te.preventDefault();let Re=me(Te);k.current={touches:Re,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:ke(Re[0],Re[1])}}},ze=Ne=>{let Te=Ne;if(Te.touches.length!==2||!k.current)return;Te.preventDefault();let Re=me(Te),Ye=k.current,Ms=(Ye.touches[0].x+Ye.touches[1].x)/2,Es=(Ye.touches[0].y+Ye.touches[1].y)/2,Rs=(Re[0].x+Re[1].x)/2,Ps=(Re[0].y+Re[1].y)/2,Is=Rs-Ms,$s=Ps-Es;n({type:"PAN",panX:Ye.panX+Is,panY:Ye.panY+$s});let Ds=ke(Re[0],Re[1]);if(Ye.dist>0){let Ts=Ds/Ye.dist;n({type:"ZOOM",zoom:Ye.zoom*Ts})}},Fe=()=>{k.current=null};return ce.addEventListener("touchstart",Ee,{passive:!1}),ce.addEventListener("touchmove",ze,{passive:!1}),ce.addEventListener("touchend",Fe),()=>{ce.removeEventListener("touchstart",Ee),ce.removeEventListener("touchmove",ze),ce.removeEventListener("touchend",Fe)}},[c.panX,c.panY,c.zoom,n]),re(()=>{let ce=me=>{let ke=me;(ke.key==="Delete"||ke.key==="Backspace")&&(y?(n({type:"REMOVE_CONNECTION",connectionId:y}),h(null)):s&&(n({type:"REMOVE_CARD",cardId:s}),a(null)))};return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[y,s,n,a]);let w=S(ce=>{a(ce),h(null)},[a]),$=S((ce,me)=>{let ke=me;i&&(ke={x:Math.round(me.x/ut)*ut,y:Math.round(me.y/ut)*ut}),n({type:"MOVE_CARD",cardId:ce,position:ke})},[n,i]),E=S((ce,me)=>{n({type:"RESIZE_CARD",cardId:ce,size:me})},[n]),W=S(ce=>{n({type:"REMOVE_CARD",cardId:ce}),s===ce&&a(null)},[n,s,a]),z=S(ce=>{},[]),B=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:me})},[n]),O=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:me})},[n]),_=S(()=>{g(null)},[]),U=S(ce=>{h(ce),a(null)},[a]),X=S(ce=>{n({type:"REMOVE_CONNECTION",connectionId:ce}),h(null)},[n]),ee=S(ce=>{let me=`card-${Date.now()}-dup`;n({type:"DUPLICATE_CARD",cardId:ce,newId:me})},[n]),Z=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:{color:me}})},[n]),V=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:{priority:me}})},[n]),j=S((ce,me)=>{x({cardId:ce,x:me.x,y:me.y}),T(!1),C(!1)},[]),H=S(()=>{x(null),T(!1),C(!1)},[]);re(()=>{if(!p)return;let ce=()=>{H()},me=setTimeout(()=>{document.addEventListener("click",ce),document.addEventListener("contextmenu",ce)},0);return()=>{clearTimeout(me),document.removeEventListener("click",ce),document.removeEventListener("contextmenu",ce)}},[p,H]);let Y=S(ce=>{if(ce.stopPropagation(),p){let me=`card-${Date.now()}-dup`;n({type:"DUPLICATE_CARD",cardId:p.cardId,newId:me})}H()},[p,n,H]),K=S(ce=>{ce.stopPropagation(),p&&(n({type:"REMOVE_CARD",cardId:p.cardId}),s===p.cardId&&a(null)),H()},[p,n,s,a,H]),Q=S(()=>{T(!0),C(!1)},[]),se=S(()=>{C(!0),T(!1)},[]),J=S(ce=>{p&&n({type:"UPDATE_CARD",cardId:p.cardId,updates:{color:ce}}),H()},[p,n,H]),ae=S(ce=>{p&&n({type:"UPDATE_CARD",cardId:p.cardId,updates:{priority:ce}}),H()},[p,n,H]),de=S((ce,me,ke,Ee)=>{F({fromCardId:ce,fromAnchor:me,fromX:ke,fromY:Ee,toX:ke,toY:Ee})},[]);re(()=>{if(!R.current)return;let ce=ke=>{let Ee=ke;if(!R.current)return;let ze=Si(Ee.clientX,Ee.clientY,c);F(Fe=>Fe?{...Fe,toX:ze.x,toY:ze.y}:null)},me=ke=>{let Ee=ke;if(!R.current)return;let ze=R.current,Fe=Ee.target,Ne=Fe.closest?Fe.closest("[data-anchor]"):null,Te=Fe.closest?Fe.closest("[data-card-id]"):null;if(Ne&&Te){let Re=Te.getAttribute("data-card-id");Re&&Re!==ze.fromCardId&&n({type:"ADD_CONNECTION",connection:{id:Fc(),fromCardId:ze.fromCardId,toCardId:Re}})}F(null)};return document.addEventListener("mousemove",ce),document.addEventListener("mouseup",me),()=>{document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",me)}},[M,c,n]);let le=r.toLowerCase(),ne=le?b.filter(ce=>ce.title.toLowerCase().includes(le)):b,fe=new Set;if(le)for(let ce=0;ce<b.length;ce++)b[ce].title.toLowerCase().includes(le)||fe.add(b[ce].id);if(l)for(let ce=0;ce<b.length;ce++)b[ce].color!==l&&fe.add(b[ce].id);let oe={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:L.current?"grabbing":"default",backgroundImage:"radial-gradient(circle, #d1d5db 1px, transparent 1px)",backgroundSize:`${ut}px ${ut}px`},ie={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${pt}px`,height:`${pt}px`},ue=b.map(ce=>{let me=fe.has(ce.id),ke=o(Tn,{key:ce.id,card:ce,selected:ce.id===s,onSelect:w,onMove:$,onResize:E,onDelete:W,onDoubleClick:z,onUpdate:B,onDuplicate:ee,onChangeColor:Z,onChangePriority:V,onAnchorDragStart:de,onCardContextMenu:j});return me?o("div",{key:`dim-${ce.id}`,style:{opacity:"0.3"}},ke):ke}),he=f?b.find(ce=>ce.id===f):null,be=he?o(zn,{card:he,onSave:O,onClose:_}):null,pe=M?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"5"},width:String(pt),height:String(pt),"data-testid":"connection-drag-line"},o("line",{x1:String(M.fromX),y1:String(M.fromY),x2:String(M.toX),y2:String(M.toY),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6,4","pointer-events":"none"})):null,ge={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},ye={position:"absolute",left:"100%",top:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"120px"},ve=p?b.find(ce=>ce.id===p.cardId):null,De=p?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${p.x}px`,top:`${p.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10000",minWidth:"160px",fontSize:"13px",color:"#1a1a1a"},"data-testid":`context-menu-${p.cardId}`,role:"menu","aria-label":"Card context menu"},o("div",{style:ge,onClick:Y,role:"menuitem","data-testid":`context-menu-duplicate-${p.cardId}`},"Duplicate"),o("div",{style:ge,onClick:K,role:"menuitem","data-testid":`context-menu-delete-${p.cardId}`},"Delete"),o("div",{style:{...ge,position:"relative"},onMouseEnter:Q,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-color-${p.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),v?o("div",{style:ye,role:"menu","data-testid":`context-submenu-color-${p.cardId}`},...hi.map(ce=>o("div",{key:ce,style:{...ge,gap:"8px"},onClick:me=>{me.stopPropagation(),J(ce)},role:"menuitem","data-testid":`context-color-${ce}`},o("span",{style:{width:"14px",height:"14px",borderRadius:"50%",backgroundColor:ce,border:"1px solid rgba(0,0,0,0.15)",display:"inline-block",flexShrink:"0"}}),ve&&ce===ve.color?"\u2713":""))):null),o("div",{style:{...ge,position:"relative"},onMouseEnter:se,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-priority-${p.cardId}`},"Set Priority",o("span",{style:{marginLeft:"8px"}},"\u25B6"),D?o("div",{style:ye,role:"menu","data-testid":`context-submenu-priority-${p.cardId}`},...bi.map(ce=>o("div",{key:ce.value,style:{...ge,gap:"8px"},onClick:me=>{me.stopPropagation(),ae(ce.value)},role:"menuitem","data-testid":`context-priority-${ce.value}`},o("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:Dn[ce.value]||"#94a3b8",display:"inline-block",flexShrink:"0"}}),ce.label,ve&&ce.value===ve.priority?" \u2713":""))):null)):null;return o("div",{ref:P,className:"board-canvas",style:oe,onMouseDown:N,onWheel:A,"data-testid":"board-canvas",role:"application","aria-label":"Project board canvas",tabIndex:0},o("div",{className:"board-canvas__inner",style:ie,"data-testid":"board-canvas-inner"},u?o(An,{connections:m,cards:b,selectedConnectionId:y,onSelectConnection:U,onDeleteConnection:X,canvasWidth:pt,canvasHeight:pt}):null,pe,...ue),be,De)}var vi=50,Vt={id:crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:"Untitled",cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}};function wi(e,t){switch(t.type){case"ADD_CARD":return{...e,cards:[...e.cards,t.card]};case"REMOVE_CARD":return{...e,cards:e.cards.filter(n=>n.id!==t.cardId),connections:e.connections.filter(n=>n.fromCardId!==t.cardId&&n.toCardId!==t.cardId)};case"MOVE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,position:t.position,updatedAt:Date.now()}:n)};case"RESIZE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,size:t.size,updatedAt:Date.now()}:n)};case"UPDATE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,...t.updates,updatedAt:Date.now()}:n)};case"DUPLICATE_CARD":{let n=e.cards.find(s=>s.id===t.cardId);if(!n)return e;let r=t.offset||{x:20,y:20},i={...n,id:t.newId,position:{x:n.position.x+r.x,y:n.position.y+r.y},createdAt:Date.now(),updatedAt:Date.now()};return{...e,cards:[...e.cards,i]}}case"ADD_CONNECTION":return{...e,connections:[...e.connections,t.connection]};case"REMOVE_CONNECTION":return{...e,connections:e.connections.filter(n=>n.id!==t.connectionId)};case"PAN":return{...e,viewport:{...e.viewport,panX:t.panX,panY:t.panY}};case"ZOOM":{let n=Math.max(.25,Math.min(4,t.zoom));return{...e,viewport:{...e.viewport,zoom:n}}}case"SET_BOARD":return t.state;default:return e}}function Nc(e){return e.type==="PAN"||e.type==="ZOOM"}function ki(e,t){switch(t.type){case"UNDO":{if(e.past.length===0)return e;let n=e.past[e.past.length-1];return{past:e.past.slice(0,e.past.length-1),present:n,future:[e.present,...e.future]}}case"REDO":{if(e.future.length===0)return e;let n=e.future[0],r=e.future.slice(1);return{past:[...e.past,e.present],present:n,future:r}}case"BOARD_ACTION":{let n=wi(e.present,t.action);if(n===e.present)return e;if(Nc(t.action))return{...e,present:n};if(t.action.type==="SET_BOARD")return{past:[],present:n,future:[]};let r=[...e.past,e.present];return r.length>vi&&r.splice(0,r.length-vi),{past:r,present:n,future:[]}}default:return e}}function Nn(e,t){let n={past:[],present:Vt,future:[]},[r,i]=en(ki,n),s=S(m=>{i({type:"BOARD_ACTION",action:m})},[i]),a=S(()=>{i({type:"UNDO"})},[i]),l=S(()=>{i({type:"REDO"})},[i]),d=te(!1);re(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{s({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,s]);let u=te(null),b=te(r.present);return b.current=r.present,re(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,b.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,r.present]),{state:r.present,dispatch:s,undo:a,redo:l,canUndo:r.past.length>0,canRedo:r.future.length>0}}var Ci={cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}},Mt=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):Ci}catch{return Ci}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Wn(e){let{cards:t,onCardDropped:n,children:r}=e,i=qe(),s=te([]);re(()=>{let u=s.current,b=new Set(u.map(c=>c.id)),m=new Set(t.map(c=>c.id));for(let c of t)b.has(c.id)||i.publish("project-board",{event:"card-created",card:c});for(let c of u)m.has(c.id)||i.publish("project-board",{event:"card-deleted",cardId:c.id});for(let c of t)if(b.has(c.id)){let f=u.find(g=>g.id===c.id);f&&f.updatedAt!==c.updatedAt&&i.publish("project-board",{event:"card-updated",card:c})}s.current=t},[t,i]);let a=S(u=>{if(u.type==="text/plain"&&typeof u.data=="string")n(u.data,"");else if(u.type==="application/json"){let b=u.data;n(String(b.title||"Dropped Item"),String(b.description||""))}},[n]),{isOver:l}=wt({acceptTypes:["text/plain","application/json","application/project-card"],onDrop:a}),d={width:"100%",height:"100%",...l?{outline:"2px dashed #3b82f6",outlineOffset:"-2px"}:{}};return o("div",{style:d,"data-dropzone-id":"project-board-dropzone"},r)}var Mi=0;function Ei(){return Mi++,`card-${Date.now()}-${Mi}`}var Wc=new Mt,Bc=[{id:"sample-1",title:"Auth API",description:"Design the auth flow",color:"#3b82f6",position:{x:50,y:50},size:{width:180,height:120},priority:"high",assignee:"Alice",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-2",title:"Dashboard",description:"Build the main dashboard",color:"#22c55e",position:{x:300,y:80},size:{width:180,height:120},priority:"medium",assignee:"Bob",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-3",title:"Deploy",description:"Set up CI pipeline",color:"#f59e0b",position:{x:150,y:250},size:{width:180,height:120},priority:"low",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-4",title:"Docs",description:"Write API reference",color:"#a855f7",position:{x:400,y:280},size:{width:180,height:120},priority:"medium",assignee:"Carol",createdAt:Date.now(),updatedAt:Date.now()}],Oc={id:"sample-board-001",name:"Sample Project",cards:Bc,connections:[{id:"sample-conn-1",fromCardId:"sample-1",toCardId:"sample-2"}],viewport:{panX:0,panY:0,zoom:1}};function Hc(e){return e.cards.length===0&&e.connections.length===0}function Ri(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Nn(Wc,t),[d,u]=G(dt[0]),[b,m]=G(!1),[c,f]=G(""),[g,y]=G(null),[h,p]=G(null),[x,v]=G(!0),[T,D]=G(n.name||"Untitled"),[C,P]=G(!1),[L,I]=G(""),M=te(!1);re(()=>{!M.current&&Hc(n)?(M.current=!0,r({type:"SET_BOARD",state:Oc})):n.cards.length>0&&(M.current=!0)},[n,r]);let F=S(()=>{let le=(-n.viewport.panX+300)/n.viewport.zoom,ne=(-n.viewport.panY+200)/n.viewport.zoom,fe=(Math.random()-.5)*300,oe=(Math.random()-.5)*200,ie={id:Ei(),title:"New Card",description:"",color:d,position:{x:Math.round(le+fe),y:Math.round(ne+oe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:ie})},[n.viewport,d,r]),R=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),N=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),A=S(()=>{r({type:"ZOOM",zoom:1})},[r]),k=S(()=>{m(le=>!le)},[]),w=S(le=>{f(le)},[]),$=S(le=>{y(le)},[]),E=S(le=>{p(le)},[]),W=S(()=>{r({type:"SET_BOARD",state:Vt}),y(null)},[r]),z=S(()=>{let le=JSON.stringify(n,null,2),ne=new Blob([le],{type:"application/json"}),fe=URL.createObjectURL(ne),oe=document.createElement("a");oe.href=fe,oe.download=`board-${t}.json`,oe.style.display="none",document.body.appendChild(oe),oe.click(),document.body.removeChild(oe),URL.revokeObjectURL(fe)},[n,t]),B=S(()=>{let le=document.createElement("input");le.type="file",le.accept=".json,application/json",le.style.display="none",le.addEventListener("change",()=>{let ne=le.files&&le.files[0];if(!ne)return;let fe=new FileReader;fe.onload=()=>{try{let oe=JSON.parse(fe.result);oe&&oe.cards&&oe.viewport&&r({type:"SET_BOARD",state:oe})}catch{}},fe.readAsText(ne)}),document.body.appendChild(le),le.click(),document.body.removeChild(le)},[r]),O=S(()=>{window.print()},[]),_=S(()=>{n.cards.length>0&&y(n.cards[0].id)},[n.cards]),U=S(()=>{v(le=>!le)},[]),X=S(()=>{g&&(r({type:"REMOVE_CARD",cardId:g}),y(null))},[g,r]),ee=S(()=>{if(n.cards.length===0)return;let fe=Ln(n.cards,800,600);r({type:"PAN",panX:fe.panX,panY:fe.panY}),r({type:"ZOOM",zoom:fe.zoom})},[n.cards,r]),Z=S(()=>{I(T),P(!0)},[T]),V=S(()=>{let le=L.trim();le&&D(le),P(!1)},[L]),j=S(()=>{P(!1)},[]),H=S(le=>{I(le.target.value)},[]),Y=S(le=>{let ne=le;ne.key==="Enter"&&(ne.preventDefault(),V()),ne.key==="Escape"&&(ne.preventDefault(),j())},[V,j]);re(()=>{let le={menus:[{label:"File",items:[{label:"New Board",onClick:W},{label:"Export JSON",onClick:z},{label:"Import JSON",onClick:B},{divider:!0},{label:"Print",onClick:O}]},{label:"Edit",items:[{label:"Undo",shortcut:"Ctrl+Z",onClick:i,disabled:!a},{label:"Redo",shortcut:"Ctrl+Y",onClick:s,disabled:!l},{divider:!0},{label:"Select All",shortcut:"Ctrl+A",onClick:_},{label:"Delete Selected",onClick:X}]},{label:"View",items:[{label:"Zoom In",onClick:R},{label:"Zoom Out",onClick:N},{label:"Fit All",onClick:ee},{divider:!0},{label:"Toggle Grid",onClick:k},{label:x?"Hide Connections":"Show Connections",onClick:U}]}]}},[W,z,B,O,i,s,a,l,_,X,R,N,ee,k,U,x]),re(()=>{let le=ne=>{let fe=ne;fe.ctrlKey&&fe.key==="z"?(fe.preventDefault(),i()):fe.ctrlKey&&fe.key==="y"&&(fe.preventDefault(),s())};return document.addEventListener("keydown",le),()=>document.removeEventListener("keydown",le)},[i,s]);let K={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},Q=S((le,ne)=>{let fe=(-n.viewport.panX+300)/n.viewport.zoom,oe=(-n.viewport.panY+200)/n.viewport.zoom,ie=(Math.random()-.5)*300,ue=(Math.random()-.5)*200,he={id:Ei(),title:le,description:ne,color:d,position:{x:Math.round(fe+ie),y:Math.round(oe+ue)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:he})},[n.viewport,d,r]),se={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},J={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},ae=o("div",{style:se,"data-testid":"app-menu-bar"},o("button",{style:J,onClick:Z,title:"Project menu"},"Project"),o("button",{style:J,title:"Settings"},"Settings"),o("button",{style:J,title:"Help"},"Help"),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${T}`)),de=C?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:j},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:le=>le.stopPropagation(),role:"dialog","aria-label":"Rename project"},o("div",{style:{fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"}},"Rename Project"),o("input",{type:"text",value:L,onInput:H,onKeyDown:Y,autoFocus:!0,style:{width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},"data-testid":"rename-input"}),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{onClick:j,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:V,style:{padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},"data-testid":"rename-confirm"},"Rename")))):null;return o("div",{className:"project-manager-app",style:K,"data-testid":"project-manager-app"},ae,o($n,{zoom:n.viewport.zoom,gridEnabled:b,selectedColor:d,colorFilter:h,onNewCard:F,onZoomIn:R,onZoomOut:N,onZoomReset:A,onColorSelect:u,onColorFilter:E,onGridToggle:k,onSearch:w}),o(Wn,{cards:n.cards,onCardDropped:Q},o(Fn,{state:n,dispatch:r,searchQuery:c,gridEnabled:b,selectedCardId:g,onSelectCard:$,colorFilter:h,showConnections:x})),de)}var _c=28,Yc=5e3;var Pi=0;function Ii(e){return Pi++,`${e}-${Pi}`}function $i(e){return e.replace(/\s*\(\d+\)$/,"")}function Vc(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 Uc(){let e=qe(),t=te(!1);return re(()=>{t.current||(t.current=!0,e.publish("terminal-output",{text:"Terminal session started",pid:1}))},[e]),o("div",{style:{padding:"16px",fontSize:"12px",color:"#00ff41",height:"100%",overflow:"auto",backgroundColor:"#1a1a2e",fontFamily:"monospace"}},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",{style:{opacity:"0.6",marginTop:"8px",fontSize:"10px"}},"[Published terminal-output message]"),o("div",null,"$ _"))}function jc(){let[e,t]=G([]),n=Qe();yt("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=S(s=>{s.preventDefault(),n.startDrag({type:"application/file",data:{name:"readme.txt",size:1024},sourceAppId:"files",preview:"readme.txt"})},[n]);return o("div",{style:{padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"}},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"].map(s=>o("span",{style:{cursor:"pointer"}},s)),o("span",{style:{cursor:"grab",padding:"4px 8px",border:"1px dashed #94a3b8",borderRadius:"4px",backgroundColor:"rgba(148, 163, 184, 0.1)"},onMouseDown:r,"aria-label":"Drag readme.txt"},"\u{1F4C4} readme.txt (drag me)")),e.length>0?o("div",{style:{marginTop:"12px",padding:"8px",backgroundColor:"rgba(0,0,0,0.05)",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace"}},o("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Messages received:"),...e.map((s,a)=>o("div",{key:String(a),style:{color:"#64748b"}},s))):null)}function Gc(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch($i(e)){case"Files":return o(Xe,{appId:"files"},o(jc,null));case"Terminal":return o(Xe,{appId:"terminal"},o(Uc,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(r=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},r)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(r=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},r)));case"Word Processor":return o(Bt,null);case"IDE":return o(Ot,null);case"Trading":return o(Yt,null);case"Project Board":return o(Ri,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function Xc(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=bt(),d=l.activeMenuBar,u=l.dockSignals,b=te(l);b.current=l;let[m,c]=G([]),[f,g]=G([]),[y,h]=G(!1),[p,x]=G(!1),[v,T]=G(null),[D,C]=G({x:0,y:0}),[P,L]=G(null),I=S(()=>{h(oe=>!oe)},[]),M=S(oe=>{g(ie=>ie.filter(ue=>ue.id!==oe))},[]);re(()=>{if(f.length===0)return;let oe=f[0],ie=Date.now()-oe.timestamp,ue=Math.max(0,Yc-ie),he=setTimeout(()=>{g(be=>be.filter(pe=>pe.id!==oe.id))},ue);return()=>clearTimeout(he)},[f]);let F=te(t);F.current=t;let R=te(r);R.current=r;let N=S(oe=>{let ue=F.current.find(he=>he.id===oe);ue&&(c(he=>{let pe=he.filter(ce=>ce.appId===oe).length+1,ge=pe===1?ue.label:`${ue.label} (${pe})`,ye=Ii(oe),ve=he.length>0?Math.max(...he.map(ce=>ce.zIndex))+1:1,De={id:ye,appId:ue.id,title:ge,icon:ue.icon,x:60+he.length*30,y:40+he.length*30,width:600,height:400,zIndex:ve,focused:!0,windowState:"normal"};return[...he.map(ce=>({...ce,focused:!1})),De]}),oe==="files"&&b.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),oe==="terminal"&&b.current.signalDock("terminal",{badge:3}),R.current&&R.current(oe))},[]),A=S(oe=>{c(ie=>{if(!ie.find(be=>be.id===oe))return ie;let he=Math.max(...ie.map(be=>be.zIndex))+1;return ie.map(be=>be.id===oe?{...be,focused:!0,zIndex:he,windowState:be.windowState==="minimized"?"normal":be.windowState}:{...be,focused:!1})})},[]),k=S(oe=>{c(ie=>{let ue=ie.filter(ge=>ge.appId===oe);if(ue.length===0)return ie;let be=[...ue].sort((ge,ye)=>ye.zIndex-ge.zIndex)[0],pe=Math.max(...ie.map(ge=>ge.zIndex))+1;return ie.map(ge=>ge.id===be.id?{...ge,focused:!0,zIndex:pe,windowState:ge.windowState==="minimized"?"normal":ge.windowState}:{...ge,focused:!1})}),c(ie=>{if(ie.filter(he=>he.appId===oe).length===0){let be=F.current.find(ve=>ve.id===oe);if(!be)return ie;let pe=Ii(oe),ge=ie.length>0?Math.max(...ie.map(ve=>ve.zIndex))+1:1,ye={id:pe,appId:be.id,title:be.label,icon:be.icon,x:60+ie.length*30,y:40+ie.length*30,width:600,height:400,zIndex:ge,focused:!0,windowState:"normal"};return oe==="files"&&b.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),oe==="terminal"&&b.current.signalDock("terminal",{badge:3}),R.current&&R.current(oe),[...ie.map(ve=>({...ve,focused:!1})),ye]}return ie})},[]),w=t.map(oe=>{let ie=m.some(be=>be.appId===oe.id),ue=u.get(oe.id),he={id:oe.id,icon:oe.icon,label:ue?.tooltip||oe.label,active:ie};return ue&&(ue.badge!=null&&(he.badge=ue.badge>0?ue.badge:void 0),ue.progress!=null&&(he.progress=ue.progress>0?ue.progress:void 0),ue.urgent&&(he.urgent=!0)),he}),$=m.find(oe=>oe.focused),E=$?$.title:void 0,W=S(()=>{x(!0)},[]),z=S(()=>{x(!1)},[]),B=S((oe,ie)=>{T(oe),C(ie)},[]),O=S(()=>{T(null)},[]),_=S(()=>{},[]),U=S(()=>{i&&i()},[i]),X=[];n&&(X.push({label:n.name,icon:void 0,onClick:_,divider:!1}),X.push({label:"",icon:void 0,onClick:_,divider:!0})),X.push({label:"Lock",icon:void 0,onClick:W,divider:!1}),X.push({label:"Logout",icon:void 0,onClick:U,divider:!1});let ee=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]),Z={display:"flex",flex:"1",overflow:"hidden"},V={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"},j={width:"100%",height:"100%",position:"relative"},H=o(Cn,{activeAppName:E,activitiesButton:{label:"Activities",onClick:I},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:X.length>0?X:void 0,height:_c}),Y=o(Mn,{items:w,orientation:"vertical",position:"left",iconSize:36,onItemClick:k,onItemContextMenu:B}),K=o(Vc,{toasts:f,onDismiss:M}),Q=m.filter(oe=>oe.windowState!=="minimized").map(oe=>o(kt,{key:oe.id,id:oe.id,title:oe.title,icon:oe.icon,defaultPosition:{x:oe.x,y:oe.y},defaultSize:{width:oe.width,height:oe.height},zIndex:oe.zIndex,focused:oe.focused,windowState:oe.windowState,onClose:()=>{c(ie=>ie.filter(ue=>ue.id!==oe.id))},onFocus:()=>{c(ie=>{let ue=Math.max(...ie.map(he=>he.zIndex))+1;return ie.map(he=>he.id===oe.id?{...he,focused:!0,zIndex:ue}:{...he,focused:!1})})},onMinimize:()=>{c(ie=>ie.map(ue=>ue.id===oe.id?{...ue,windowState:"minimized"}:ue))},onMaximize:()=>{c(ie=>ie.map(ue=>ue.id===oe.id?{...ue,windowState:ue.windowState==="maximized"?"normal":"maximized"}:ue))}},Gc(oe.title))),se=[];a&&se.push(a),se.push(...Q),se.push(K);let J=o(En,{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:j},...se)),ae=y?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:I},...t.map(oe=>o("button",{key:oe.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:ie=>{ie.stopPropagation(),h(!1),k(oe.id)}},o("span",{style:{fontSize:"32px",display:"block"}},oe.icon),o("span",null,oe.label)))):null,de=p?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:z},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,le=(()=>{if(!v)return null;let oe=t.find(ge=>ge.id===v),ie=m.filter(ge=>ge.appId===v),ue={padding:"6px 14px",cursor:"pointer"},he={onMouseEnter:ge=>{ge.currentTarget.style.backgroundColor="#444"},onMouseLeave:ge=>{ge.currentTarget.style.backgroundColor="transparent"}},be={borderBottom:"1px solid #444",margin:"4px 0"},pe=[];return pe.push(o("div",{key:"new",style:ue,...he,onClick:()=>{N(v),T(null)},role:"menuitem"},"\u25CF New")),ie.length>0&&(pe.push(o("div",{key:"sep-1",style:be})),ie.forEach((ge,ye)=>{let ve=ie.length===1?oe?.label||ge.title:`${oe?.label||$i(ge.title)} (${ye+1})`;pe.push(o("div",{key:`inst-${ge.id}`,style:ue,...he,onClick:()=>{A(ge.id),T(null)},role:"menuitem"},ve))})),pe.push(o("div",{key:"sep-2",style:be})),pe.push(o("div",{key:"about",style:ue,...he,onClick:()=>{L(v),T(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:O},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${D.y}px`,left:`${D.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:ge=>ge.stopPropagation()},...pe))})(),ne=P?t.find(oe=>oe.id===P):null,fe=ne?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:()=>L(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:oe=>oe.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},ne.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:()=>L(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:ee,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},H),o("div",{style:Z},o("div",{className:"unity-desktop__dock",style:V},Y),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},J,ae)),le,fe,de)}function Di(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(wn,{onWindowOpen:r},o(xt,null,o(St,null,o(Xc,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function Ti(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:b,onDeactivate:m,children:c}=e,f=bt(),g=q(()=>f.windows.find(P=>P.id===t),[f.windows,t]);re(()=>(u?f.setMenuBar(t,u):f.clearMenuBar(t),()=>{f.clearMenuBar(t)}),[u,t,f]);let y=te(!1),h=g?g.focused:!1;re(()=>{let P=y.current;y.current=h,h&&!P?b&&b():!h&&P&&m&&m()},[h,b,m]);let p=S(()=>{f.closeWindow(t),d&&d()},[f,t,d]),x=S(()=>{f.focusWindow(t)},[f,t]),v=S(P=>{f.moveWindow(t,P)},[f,t]),T=S(P=>{f.resizeWindow(t,P)},[f,t]),D=S(()=>{f.minimizeWindow(t)},[f,t]),C=S(()=>{g&&g.windowState==="maximized"?f.restoreWindow(t):f.maximizeWindow(t)},[f,t,g]);return g?o(Xe,{appId:t},o(kt,{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:p,onFocus:x,onMove:v,onResize:T,onMinimize:D,onMaximize:C,children:c})):(f.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var zi={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},Ai={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 Li(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:b,active:m=!1}=e,c=q(()=>{let f=zi[i]??zi.md,g=Ai[r]??Ai.secondary,y={padding:f.padding,fontSize:f.fontSize,borderRadius:f.borderRadius,border:`1px solid ${g.border}`,backgroundColor:m?"#3b82f6":g.bg,color:m?"white":g.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,m,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":b,"aria-pressed":m?"true":void 0},t)}var qc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],ft=Math.PI/180;function Kc(e,t,n,r,i,s,a,l,d,u){let b=Math.cos(r*ft),m=Math.sin(r*ft),c=Math.cos(i*ft),f=Math.sin(i*ft),g=Math.cos(s*ft),y=Math.sin(s*ft),h=e*g-t*y,p=e*y+t*g,x=h*c-p*f,v=h*f+p*c,T=n,D=x,C=v*b-T*m,P=v*m+T*b,L=1+a*.001*P,I=l+D*u*L,M=d-C*u*L;return{sx:I,sy:M,depth:P}}function Fi(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 Ni(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 Wi(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:b=2,colorScale:m=qc,gridColor:c="#94a3b8",title:f}=e,g=q(()=>{let A=0,k=0,w=0;for(let $=0;$<t.length;$++){let E=t[$],W=E.data.length;W>A&&(A=W);for(let z=0;z<W;z++){let B=E.data[z].length;B>k&&(k=B);for(let O=0;O<B;O++){let _=Math.abs(E.data[z][O]??0);_>w&&(w=_)}}}return{maxRows:Math.max(A,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),y=q(()=>{let A=g.maxHeight+(t.length-1)*b+g.maxHeight,k=Math.sqrt(g.maxCols*g.maxCols+g.maxRows*g.maxRows+A*A),w=Math.min(n,r)*.75;return k>0?w/k:1},[g,t.length,b,n,r]),h=n/2,p=r/2,x=S((A,k,w)=>Kc(A,k,w,s,a,l,i,h,p,y),[s,a,l,i,h,p,y]),v=S(()=>{if(!u)return[];let A=[],k=Math.max(g.maxCols,g.maxRows),w=g.maxCols/2,$=g.maxRows/2,E=x(-w,-$,0),W=x(w,-$,0);A.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"})),A.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 z=x(-w,$,0);A.push(o("line",{key:"axis-y",x1:String(E.sx),y1:String(E.sy),x2:String(z.sx),y2:String(z.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-y-label",x:String(z.sx-12),y:String(z.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let B=g.maxHeight+(t.length-1)*b,O=x(-w,-$,B);return A.push(o("line",{key:"axis-z",x1:String(E.sx),y1:String(E.sy),x2:String(O.sx),y2:String(O.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-z-label",x:String(O.sx-4),y:String(O.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),A},[u,g,t.length,b,x]),T=S(()=>{let A=[],k=g.maxCols/2,w=g.maxRows/2,$=[];for(let E=0;E<t.length;E++){let W=t[E],z=W.color??m[E%m.length],B=W.opacity??.7,O=E*b,_=W.data.length;for(let U=0;U<_-1;U++){let X=W.data[U],ee=W.data[U+1],Z=Math.min(X.length,ee.length);for(let V=0;V<Z-1;V++){let j=V-k,H=V+1-k,Y=U-w,K=U+1-w,Q=(X[V]??0)+O,se=(X[V+1]??0)+O,J=(ee[V]??0)+O,ae=(ee[V+1]??0)+O,de=x(j,Y,Q),le=x(H,Y,se),ne=x(j,K,J),fe=x(H,K,ae),oe=(de.depth+le.depth+ne.depth+fe.depth)/4,ie=`${de.sx},${de.sy} ${le.sx},${le.sy} ${fe.sx},${fe.sy} ${ne.sx},${ne.sy}`;$.push({points:ie,fill:Fi(z,B),stroke:Ni(z,.7),strokeWidth:"0.5",depth:oe,key:`quad-${E}-${U}-${V}`})}}if(_===1||_>0&&W.data[0].length===1)for(let U=0;U<_;U++){let X=W.data[U];for(let ee=0;ee<X.length;ee++){let Z=ee-k,V=U-w,j=(X[ee]??0)+O,H=x(Z,V,j),Y=3,K=`${H.sx},${H.sy-Y} ${H.sx+Y},${H.sy} ${H.sx},${H.sy+Y} ${H.sx-Y},${H.sy}`;$.push({points:K,fill:Fi(z,B),stroke:Ni(z,.7),strokeWidth:"0.5",depth:H.depth,key:`point-${E}-${U}-${ee}`})}}}$.sort((E,W)=>E.depth-W.depth);for(let E=0;E<$.length;E++){let W=$[E];A.push(o("polygon",{key:W.key,points:W.points,fill:W.fill,stroke:W.stroke,"stroke-width":W.strokeWidth,"stroke-linejoin":"round"}))}return A},[t,g,b,m,x]),D=S(()=>{let A=[],k=g.maxCols/2,w=g.maxRows/2;for(let $=0;$<=g.maxRows;$++){let E=$-w,W=x(-k,E,0),z=x(k,E,0);A.push(o("line",{key:`base-h-${$}`,x1:String(W.sx),y1:String(W.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let $=0;$<=g.maxCols;$++){let E=$-k,W=x(E,-w,0),z=x(E,w,0);A.push(o("line",{key:`base-v-${$}`,x1:String(W.sx),y1:String(W.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return A},[g,c,x]),C=S(()=>{if(!d)return[];let A=[],k=g.maxCols/2,w=g.maxRows/2;for(let $=0;$<t.length;$++){let E=t[$],W=$*b,z=0,B=0;for(let X=0;X<E.data.length;X++){let ee=E.data[X];for(let Z=0;Z<ee.length;Z++)z+=ee[Z]??0,B++}let O=B>0?z/B:0,_=x(k+1,0,O+W),U=E.color??m[$%m.length];A.push(o("text",{key:`layer-label-${$}`,x:String(_.sx+8),y:String(_.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:U},E.label))}return A},[d,t,g,b,m,x]),L=S(()=>f?[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"},f)]:[],[f,n])(),I=D(),M=v(),F=T(),R=C(),N=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":f??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...N,...I,...M,...F,...R)}function Zc(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 Jc(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 Bi(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:b="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:f="#ffffff"}=e,g=q(()=>Zc(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),h=l!=null&&l.length>1,p=n!=null&&n.length>0,x=y&&s>=0?m:c,v=20,T=p?u*.38:u*.45,D=Math.min(d*.15,48),C=D*.55,P=T+D*.4+8,L=p?P+22:T+D*.4+22,I=h?Math.min(u*.22,36):0,M=u-v-I,F=d-v*2,R=S(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:f,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,f]),N=S(()=>{let _=[],U=r+g+i;return _.push(o("text",{key:"value",x:String(d/2),y:String(T),"text-anchor":"middle","dominant-baseline":"central","font-size":String(D),"font-weight":"bold","font-family":"sans-serif",fill:b,"aria-label":`Value: ${U}`},r?o("tspan",{key:"prefix","font-size":String(C),"font-weight":"normal"},r):null,g,i?o("tspan",{key:"suffix","font-size":String(C),"font-weight":"normal"},i):null)),_},[d,T,D,C,g,r,i,b]),A=S(()=>p?[o("text",{key:"label",x:String(d/2),y:String(P),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[p,d,P,n]),k=S(()=>{if(!y)return[];let _=[],U=s,X=U>=0,ee=8,Z=Jc(U),V=(X?"+":"-")+Z+(a?" "+a:""),j=d/2-40,H=L;if(X){let Y=`${j},${H} ${j-ee/2},${H+ee} ${j+ee/2},${H+ee}`;_.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}else{let Y=`${j},${H+ee} ${j-ee/2},${H} ${j+ee/2},${H}`;_.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}return _.push(o("text",{key:"trend-text",x:String(j+ee+4),y:String(H+ee*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${V}`},V)),_},[y,s,a,x,d,L]),w=S(()=>{if(!h)return[];let _=[],U=l,X=[];for(let Q of U)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&X.push(Q);if(X.length<2)return[];let ee=1/0,Z=-1/0;for(let Q of X)Q<ee&&(ee=Q),Q>Z&&(Z=Q);ee===Z&&(ee-=1,Z+=1);let V=Z-ee,j=F/(X.length-1),H="";for(let Q=0;Q<X.length;Q++){let se=v+Q*j,J=M+I-(X[Q]-ee)/V*I;Q===0?H+=`M ${se} ${J}`:H+=` L ${se} ${J}`}let Y=v+(X.length-1)*j,K=H+` L ${Y} ${M+I} L ${v} ${M+I} Z`;return _.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"})))),_.push(o("path",{key:"spark-fill",d:K,fill:"url(#sparkGrad)"})),_.push(o("path",{key:"spark-line",d:H,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),_},[h,l,F,M,I,v]),$=R(),E=N(),W=A(),z=k(),B=w(),O=`${r}${g}${i}${p?`, ${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":O,style:{fontFamily:"sans-serif"}},...$,...B,...E,...W,...z)}var Ut=Math.PI/180;function Qc(e,t,n,r,i,s,a,l){let d=Math.cos(r*Ut),u=Math.sin(r*Ut),b=Math.cos(i*Ut),m=Math.sin(i*Ut),c=e*b+n*m,f=-e*m+n*b,g=t*d-f*u,y=t*u+f*d;return{sx:s+c*l,sy:a-g*l,depth:y}}function gt(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 jt(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 Ke(e,t,n){let{x:r,y:i,z:s}=gt(e),a=Math.cos(n),l=Math.sin(n),d,u,b;return t==="x"?(d=r,u=i*a-s*l,b=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,b=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,b=s),jt(d,u,b)}function Bn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return Ke(e,"x",Math.PI);case"Y":return Ke(e,"y",Math.PI);case"Z":return Ke(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=gt(e);return jt(s,-i,r)}case"S":return Ke(e,"z",Math.PI/2);case"T":return Ke(e,"z",Math.PI/4);case"Rx":return Ke(e,"x",n);case"Ry":return Ke(e,"y",n);case"Rz":return Ke(e,"z",n)}}function Oi(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:b=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:f=!0,trailMaxPoints:g=200,trailColor:y="#ef4444",wireframeColor:h="#cbd5e1",vectorColor:p="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:T,onStateChange:D}=e,[C,P]=G(t??{theta:0,phi:0}),[L,I]=G(s),[M,F]=G(a),[R,N]=G(l),A=te([]),k=te(!1),w=te(null),$=te(null);re(()=>{t&&P(t)},[t?.theta,t?.phi]);let E=te(0);re(()=>{if(!n||n.length===0)return;E.current=0;let j=0,H=()=>{E.current>=n.length||(P(Y=>{let K=Bn(Y,n[E.current]);return E.current++,D&&D(K),K}),j=requestAnimationFrame(H))};return j=requestAnimationFrame(H),()=>cancelAnimationFrame(j)},[n]),re(()=>{let j=gt(C);A.current.push(j),A.current.length>g&&A.current.splice(0,A.current.length-g)},[C.theta,C.phi]);let W=v*R,z=r/2,B=i/2,O=S((j,H,Y)=>Qc(j,H,Y,M,L,z,B,W),[M,L,z,B,W]),_=S(j=>{if(!d)return;let H=j;k.current=!0,w.current={mx:H.clientX,my:H.clientY,rx:M,ry:L}},[d,M,L]),U=S(j=>{if(!k.current||!w.current)return;let H=j,Y=w.current;I(Y.ry+(H.clientX-Y.mx)*.5),F(Y.rx-(H.clientY-Y.my)*.5)},[]),X=S(()=>{k.current=!1},[]),ee=S(j=>{if(!u)return;let H=j;H.preventDefault(),N(Y=>Math.max(.5,Math.min(3,Y*(H.deltaY>0?.95:1.05))))},[u]),Z=[];if(x&&Z.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),T&&Z.push(o("text",{key:"title",x:String(z),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},T)),c){let H=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,J=O(Math.cos(se),Math.sin(se),0);H.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"eq",d:H.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.5"}));let Y=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,J=O(Math.cos(se),0,Math.sin(se));Y.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"xz",d:Y.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}));let K=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,J=O(0,Math.cos(se),Math.sin(se));K.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"yz",d:K.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}))}let V=[{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 j of V){let H=O(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),Y=O(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),K=O(0,0,0);Z.push(o("line",{key:`axis-${j.id}`,x1:String(Y.sx),y1:String(Y.sy),x2:String(H.sx),y2:String(H.sy),stroke:j.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(m){let j=[{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 H of j){let Y=O(H.pos[0],H.pos[1],H.pos[2]);Z.push(o("text",{key:`lbl-${H.text}`,x:String(Y.sx),y:String(Y.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},H.text))}}if(f&&A.current.length>1){let j=A.current,H=[];for(let Y=0;Y<j.length;Y++){let K=j[Y],Q=O(K.x,K.y,K.z);H.push(`${Y===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}Z.push(o("path",{key:"trail",d:H.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(b){let j=gt(C),H=O(0,0,0),Y=O(j.x,j.y,j.z);Z.push(o("line",{key:"vec-line",x1:String(H.sx),y1:String(H.sy),x2:String(Y.sx),y2:String(Y.sy),stroke:p,"stroke-width":"2.5","stroke-linecap":"round"})),Z.push(o("circle",{key:"vec-point",cx:String(Y.sx),cy:String(Y.sy),r:"5",fill:p,stroke:"#fff","stroke-width":"1.5"}));let K=(C.theta*180/Math.PI).toFixed(0),Q=(C.phi*180/Math.PI).toFixed(0);Z.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=${K}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:$,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":T??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?_:void 0,onMouseMove:d?U:void 0,onMouseUp:d?X:void 0,onMouseLeave:d?X:void 0,onWheel:u?ee:void 0},...Z)}function ed(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 On(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 Hn(e){let t=ed(e);if(t.length===0)return null;let n=On(t,25),r=On(t,50),i=On(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let f of t)if(f>=a){d=f;break}let u=t[t.length-1];for(let f=t.length-1;f>=0;f--)if(t[f]<=l){u=t[f];break}let b=0;for(let f of t)b+=f;let m=b/t.length,c=[];for(let f of t)(f<a||f>l)&&c.push(f);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:m,outliers:c,min:t[0],max:t[t.length-1]}}function td(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 Hi(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:b,padding:m=60}=e,c=i==="vertical",f=n-m*2,g=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],h=q(()=>{let w=[];for(let $ of t)w.push(Hn($.values));return w},[t]),p=q(()=>{let w=1/0,$=-1/0;for(let z of h){if(z===null)continue;let B=s&&z.outliers.length>0?Math.min(z.whiskerLow,z.outliers[0]):z.whiskerLow,O=s&&z.outliers.length>0?Math.max(z.whiskerHigh,z.outliers[z.outliers.length-1]):z.whiskerHigh;B<w&&(w=B),O>$&&($=O)}isFinite(w)||(w=0,$=1);let E=$-w,W=E>0?E*.05:.5;return{min:w-W,max:$+W}},[h,s]),x=c?g:f,v=c?f:g,T=t.length>0?t.length:1,D=v/T,C=D*Math.min(Math.max(d,.1),.95),P=S(w=>{let $=p.max-p.min;return $===0?x/2:(w-p.min)/$*x},[p,x]),L=S(()=>{if(!u)return[];let w=[],$=p.max-p.min,E=td($),W=Math.ceil(p.min/E)*E;for(let z=W;z<=p.max;z+=E){let B=P(z),O=String(Math.round(z*1e3)/1e3);if(c){let _=m+g-B;w.push(o("line",{key:`grid-${z}`,x1:String(m),y1:String(_),x2:String(m+f),y2:String(_),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(m-6),y:String(_+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},O))}else{let _=m+B;w.push(o("line",{key:`grid-${z}`,x1:String(_),y1:String(m),x2:String(_),y2:String(m+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(_),y:String(m+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},O))}}return w},[u,p,P,c,m,f,g]),I=S(()=>{let w=[];return w.push(o("line",{key:"axis-value",x1:String(m),y1:String(c?m:m+g),x2:String(m),y2:String(m+g),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-category",x1:String(m),y1:String(m+g),x2:String(m+f),y2:String(m+g),stroke:"#374151","stroke-width":"1.5"})),w},[m,f,g,c]),M=S(()=>{let w=[];for(let $=0;$<t.length;$++){let E=h[$];if(E===null)continue;let W=t[$],z=W.color??y[$%y.length],B=D*$+D/2,O=C/2;if(c){let _=m+g-P(E.q1),U=m+g-P(E.q3),X=m+g-P(E.median),ee=m+g-P(E.whiskerLow),Z=m+g-P(E.whiskerHigh),V=m+B;w.push(o("line",{key:`wl-${$}`,x1:String(V),y1:String(_),x2:String(V),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${$}`,x1:String(V-O*.4),y1:String(ee),x2:String(V+O*.4),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${$}`,x1:String(V),y1:String(U),x2:String(V),y2:String(Z),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${$}`,x1:String(V-O*.4),y1:String(Z),x2:String(V+O*.4),y2:String(Z),stroke:l,"stroke-width":"1.5"}));let j=Math.min(_,U),H=Math.abs(_-U);if(w.push(o("rect",{key:`box-${$}`,x:String(V-O),y:String(j),width:String(C),height:String(Math.max(H,1)),fill:z,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"})),w.push(o("line",{key:`med-${$}`,x1:String(V-O),y1:String(X),x2:String(V+O),y2:String(X),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+g-P(E.mean);w.push(o("circle",{key:`mean-${$}`,cx:String(V),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 Y=0;Y<E.outliers.length;Y++){let K=m+g-P(E.outliers[Y]);w.push(o("circle",{key:`out-${$}-${Y}`,cx:String(V),cy:String(K),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}w.push(o("text",{key:`cat-${$}`,x:String(V),y:String(m+g+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},W.label))}else{let _=m+P(E.q1),U=m+P(E.q3),X=m+P(E.median),ee=m+P(E.whiskerLow),Z=m+P(E.whiskerHigh),V=m+B;w.push(o("line",{key:`wl-${$}`,x1:String(_),y1:String(V),x2:String(ee),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${$}`,x1:String(ee),y1:String(V-O*.4),x2:String(ee),y2:String(V+O*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${$}`,x1:String(U),y1:String(V),x2:String(Z),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${$}`,x1:String(Z),y1:String(V-O*.4),x2:String(Z),y2:String(V+O*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(_,U),H=Math.abs(U-_);if(w.push(o("rect",{key:`box-${$}`,x:String(j),y:String(V-O),width:String(Math.max(H,1)),height:String(C),fill:z,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"})),w.push(o("line",{key:`med-${$}`,x1:String(X),y1:String(V-O),x2:String(X),y2:String(V+O),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+P(E.mean);w.push(o("circle",{key:`mean-${$}`,cx:String(Y),cy:String(V),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<E.outliers.length;Y++){let K=m+P(E.outliers[Y]);w.push(o("circle",{key:`out-${$}-${Y}`,cx:String(K),cy:String(V),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}w.push(o("text",{key:`cat-${$}`,x:String(m-6),y:String(V+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},W.label))}}return w},[t,h,P,c,m,f,g,D,C,l,s,a,y]),F=S(()=>b?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,n,m]),R=L(),N=I(),A=M(),k=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":b??"Box plot",style:{fontFamily:"sans-serif"}},...k,...R,...N,...A)}function _i(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 nd(e,t,n){return e<t?t:e>n?n:e}function _n(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function Yi(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:b=4,defaultColor:m="#3b82f6",opacity:c=.7,title:f,padding:g=60}=e,y=q(()=>{let A=[];for(let k=0;k<t.length;k++){let w=t[k];_n(w.x)&&_n(w.y)&&_n(w.r)&&A.push(w)}return A},[t]),h=n-g*2,p=r-g*2,x=q(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let A=1/0,k=-1/0,w=1/0,$=-1/0,E=1/0,W=-1/0;for(let z of y)z.x<A&&(A=z.x),z.x>k&&(k=z.x),z.y<w&&(w=z.y),z.y>$&&($=z.y),z.r<E&&(E=z.r),z.r>W&&(W=z.r);return A===k&&(A-=1,k+=1),w===$&&(w-=1,$+=1),E===W&&(E=0,W=W>0?W:1),{xMin:A,xMax:k,yMin:w,yMax:$,rMin:E,rMax:W}},[y]),v=S(A=>{let k=x.xMax-x.xMin;return g+(A-x.xMin)/k*h},[x,g,h]),T=S(A=>{let k=x.yMax-x.yMin;return g+p-(A-x.yMin)/k*p},[x,g,p]),D=S(A=>{let k=x.rMax-x.rMin;if(k===0)return(b+u)/2;let w=(A-x.rMin)/k;return b+w*(u-b)},[x,b,u]),C=S(()=>{if(!a)return[];let A=[],k=_i(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let W=w;W<=x.xMax;W+=k){let z=v(W);A.push(o("line",{key:`grid-x-${W}`,x1:String(z),y1:String(g),x2:String(z),y2:String(g+p),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-xlabel-${W}`,x:String(z),y:String(g+p+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(W*1e3)/1e3)))}let $=_i(x.yMax-x.yMin),E=Math.ceil(x.yMin/$)*$;for(let W=E;W<=x.yMax;W+=$){let z=T(W);A.push(o("line",{key:`grid-y-${W}`,x1:String(g),y1:String(z),x2:String(g+h),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-ylabel-${W}`,x:String(g-6),y:String(z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(W*1e3)/1e3)))}return A},[a,x,v,T,g,h,p]),P=S(()=>{if(!l)return[];let A=[];return A.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+p),stroke:"#374151","stroke-width":"1.5"})),A.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+p),x2:String(g+h),y2:String(g+p),stroke:"#374151","stroke-width":"1.5"})),i&&A.push(o("text",{key:"x-label",x:String(g+h/2),y:String(g+p+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&A.push(o("text",{key:"y-label",x:String(g-40),y:String(g+p/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${g-40}, ${g+p/2})`},s)),A},[l,g,h,p,i,s]),L=S(()=>{let A=[];for(let k=0;k<y.length;k++){let w=y[k],$=v(w.x),E=T(w.y),W=nd(D(w.r),b,u),z=w.color??m;A.push(o("circle",{key:`bubble-${k}`,cx:String($),cy:String(E),r:String(W),fill:z,opacity:String(c),stroke:z,"stroke-width":"1","stroke-opacity":"0.8","aria-label":w.label??`Bubble at (${w.x}, ${w.y}) size ${w.r}`,role:"img"})),d&&w.label&&A.push(o("text",{key:`label-${k}`,x:String($),y:String(E-W-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return A},[y,v,T,D,m,c,d,b,u]),I=S(()=>f?[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"},f)]:[],[f,n,g]),M=C(),F=P(),R=L(),N=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Bubble chart",style:{fontFamily:"sans-serif"}},...N,...M,...F,...R)}var od=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function id(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 Vi(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 Ui(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 sd(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 ad(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=Ui(t[i]),l=Ui(t[i+1]);return sd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var ld=["#9be9a8","#40c463","#30a14e","#216e39"];function ji(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=ld,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:b}=e,{dateMap:m,startDate:c,endDate:f,maxVal:g}=q(()=>{let R=new Map,N=0,A=null,k=null;for(let E of t){let W=id(E.date);if(isNaN(W.getTime()))continue;let z=Vi(W);R.set(z,(R.get(z)??0)+E.value);let B=R.get(z);B>N&&(N=B),(A===null||W<A)&&(A=W),(k===null||W>k)&&(k=W)}if(A===null||k===null){let E=new Date;A=new Date(E.getFullYear(),0,1),k=new Date(E.getFullYear(),11,31)}let w=new Date(A);w.setDate(w.getDate()-w.getDay());let $=new Date(k);return $.setDate($.getDate()+(6-$.getDay())),{dateMap:R,startDate:w,endDate:$,maxVal:N>0?N:1}},[t]),y=d?30:0,h=l?16:0,p=b?28:0,x=y+10,v=p+h+4,T=S(()=>{let R=[],N=new Date(c),A=0;for(;N<=f;){let k=N.getDay();k===0&&N>c&&A++;let w=Vi(N),$=m.get(w),E=$!==void 0&&$>0?ad($/g,i):u,W=x+A*(s+a),z=v+k*(s+a);R.push(o("rect",{key:`day-${w}`,x:String(W),y:String(z),width:String(s),height:String(s),rx:"2",ry:"2",fill:E,"aria-label":`${w}: ${$??0}`})),N.setDate(N.getDate()+1)}return R},[c,f,m,g,i,u,s,a,x,v]),D=S(()=>{if(!l)return[];let R=[],N=new Date(c),A=0,k=-1;for(;N<=f;){let w=N.getDay();w===0&&N>c&&A++;let $=N.getMonth();if($!==k&&w===0){k=$;let E=x+A*(s+a);R.push(o("text",{key:`month-${A}`,x:String(E),y:String(p+h-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},od[$]))}N.setDate(N.getDate()+1)}return R},[l,c,f,s,a,x,p,h]),C=S(()=>{if(!d)return[];let R=[],N=[1,3,5];for(let A of N){let k=v+A*(s+a)+s/2;R.push(o("text",{key:`day-label-${A}`,x:String(y),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},rd[A]))}return R},[d,s,a,v,y]),P=S(()=>b?[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"},b)]:[],[b,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":b??"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 L=P(),I=D(),M=C(),F=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":b??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...I,...M,...F)}var cd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ue(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function dd(e,t,n,r,i,s){let a=Ue(e,t,n,i),l=Ue(e,t,n,s),d=Ue(e,t,r,i),u=Ue(e,t,r,s),m=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${m} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${m} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function ud(e,t,n,r,i,s,a){let l=Ue(e,t,n,r),d=Ue(e,t,n,i),u=Ue(e,t,n,s),b=Ue(e,t,n,a),m=i-r,c=a-s,f=m>Math.PI?1:0,g=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${f} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${g} 1 ${b.x} ${b.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function pd(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 f=0;for(let g=0;g<i;g++){let y=e[c]?.[g]??0;f+=Math.max(0,y)}s.push(f),a+=f}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),f=[],g=0;for(let y=0;y<i;y++)f.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:g,endAngle:g+c,value:0}),g+=c+r;return{groups:f,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let f=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+f,value:s[c]}),u+=f+r}let b=[];for(let c=0;c<i;c++)b.push(d[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let f=c;f<i;f++){let g=Math.max(0,e[c]?.[f]??0),y=c===f?0:Math.max(0,e[f]?.[c]??0);if(g===0&&y===0)continue;let h=g+y,p=s[c]>0?g/a*l:0,x=b[c],v=x+p;b[c]=v;let T=s[f]>0?g/a*l:0,D=b[f],C=D+T;if(b[f]=C,c===f){g>0&&m.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:D,targetEndAngle:C,value:g,color:d[c].color});continue}let P=s[f]>0?y/a*l:0,I=b[f]+P;b[f]=I;let M=s[c]>0?y/a*l:0,R=b[c]+M;b[c]=R,(g>0||y>0)&&m.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:D,targetEndAngle:Math.max(C,D+.001),value:h,color:d[c].color})}return{groups:d,chords:m}}function Gi(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=cd,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:b=.9,title:m}=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":m??"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,f=i/2,g=Math.min(r,i)/2-40,y=g*Math.max(.5,Math.min(.99,b)),h=g+16,p=q(()=>pd(t,n,s,a),[t,n,s,a]),x=S(()=>{let L=[];for(let I=0;I<p.groups.length;I++){let M=p.groups[I];if(M.endAngle-M.startAngle<.001)continue;let R=dd(c,f,g,y,M.startAngle,M.endAngle);if(L.push(o("path",{key:`arc-${I}`,d:R,fill:M.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${M.label}: ${M.value}`})),l){let N=(M.startAngle+M.endAngle)/2,A=Ue(c,f,h,N),$=((N-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,E=$?"start":"end",W=N*180/Math.PI-90;$||(W+=180);let z=d?`${M.label} (${M.value})`:M.label;L.push(o("text",{key:`label-${I}`,x:String(A.x),y:String(A.y),"text-anchor":E,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${W}, ${A.x}, ${A.y})`,"dominant-baseline":"central","pointer-events":"none"},z))}}return L},[p,c,f,g,y,h,l,d]),v=S(()=>{let L=[];for(let I=0;I<p.chords.length;I++){let M=p.chords[I],F=ud(c,f,y,M.sourceStartAngle,M.sourceEndAngle,M.targetStartAngle,M.targetEndAngle);L.push(o("path",{key:`ribbon-${I}`,d:F,fill:M.color,"fill-opacity":String(u),stroke:M.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[p,c,f,y,u]),T=S(()=>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]),D=v(),C=x(),P=T();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??"Chord diagram",style:{fontFamily:"sans-serif"}},...P,...D,...C)}var fd=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function gd(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??[],b=[];for(let m=0;m<u.length;m++)b.push(n+r.length+m);t.push({id:d,node:s,depth:a,parentId:l,childIndices:b});for(let m=0;m<u.length;m++)r.push([u[m],a+1,d])}return{flatNodes:t,maxDepth:i}}function md(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 hd(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=gd(e);if(d.length===0)return[];let b=md(d),m=t-s*2,c=n-s*2,f=a==="horizontal",g=u+1,y=f?g>1?(m-r)/u:0:g>1?(c-i)/u:0,h=new Array(d.length),p=b[0],x=f?c:m,v=p>0?x/p:x,T=new Array(d.length);T[0]=[0,p];let D=[0],C=0;for(;C<D.length;){let P=D[C];C++;let L=d[P],[I,M]=T[P],F=(I+M)/2,R=s+L.depth*y,N=s+(F-.5)*v,A=f?R:N,k=f?N:R,w=L.node.color??l[L.depth%l.length];h[P]={id:L.id,label:L.node.label,value:L.node.value!==void 0?String(L.node.value):"",color:w,depth:L.depth,x:A,y:k,parentId:L.parentId,childCount:L.childIndices.length,subtreeLeafCount:b[P]};let $=I;for(let E of L.childIndices)if(E<d.length){let W=b[E],z=$+W;T[E]=[$,z],$=z,D.push(E)}}return h}function Xi(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:b=fd,title:m,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":m??"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 f=i==="horizontal",g=q(()=>hd(t,n,r,s,a,c,i,b),[t,n,r,s,a,c,i,b]),y=q(()=>{let C=new Map;for(let P=0;P<g.length;P++){let L=g[P];C.set(L.id,L)}return C},[g]),h=S(()=>{if(!d)return[];let C=[];for(let P=0;P<g.length;P++){let L=g[P];if(L.parentId===null)continue;let I=y.get(L.parentId);if(!I)continue;let M,F,R,N;f?(M=I.x+s,F=I.y+a/2,R=L.x,N=L.y+a/2):(M=I.x+s/2,F=I.y+a,R=L.x+s/2,N=L.y);let A=(M+R)/2,k=(F+N)/2,w;f?w=`M ${M} ${F} C ${A} ${F}, ${A} ${N}, ${R} ${N}`:w=`M ${M} ${F} C ${M} ${k}, ${R} ${k}, ${R} ${N}`,C.push(o("path",{key:`conn-${P}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[g,y,f,s,a,d,u]),p=S(()=>{let C=[];for(let P=0;P<g.length;P++){let L=g[P];C.push(o("rect",{key:`node-rect-${L.id}`,x:String(L.x),y:String(L.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:L.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":L.value?`${L.label}: ${L.value}`:L.label}));let I=l&&L.value?L.y+a/2-2:L.y+a/2+4;C.push(o("text",{key:`node-label-${L.id}`,x:String(L.x+s/2),y:String(I),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},L.label)),l&&L.value&&C.push(o("text",{key:`node-value-${L.id}`,x:String(L.x+s/2),y:String(L.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},L.value))}return C},[g,s,a,l]),x=S(()=>m?[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"},m)]:[],[m,n]),v=h(),T=p(),D=x();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Decomposition tree",style:{fontFamily:"sans-serif"}},...D,...v,...T)}var qi=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function bd(e){return qi[e%qi.length]}function Ki(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],b=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??bd(d),x:u.x??r+s*Math.cos(b),y:u.y??i+s*Math.sin(b),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function Zi(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 b=Math.sqrt(u),m=l/b,c=d/b,f=n-b;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*f,a.y+=c*f):a.fixed?(i.x-=m*f,i.y-=c*f):(i.x-=m*f*.5,i.y-=c*f*.5,a.x+=m*f*.5,a.y+=c*f*.5);let g=i.vx-a.vx,y=i.vy-a.vy,h=g*m+y*c;h<=0||(i.fixed?(a.vx+=h*m,a.vy+=h*c):a.fixed?(i.vx-=h*m,i.vy-=h*c):(i.vx-=h*m,i.vy-=h*c,a.vx+=h*m,a.vy+=h*c))}}}function xd(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let b=new Map;for(let x=0;x<u;x++)b.set(e[x].id,x);let m=new Float64Array(u),c=new Float64Array(u);for(let x=0;x<u;x++){let v=e[x];for(let T=x+1;T<u;T++){let D=e[T],C=v.x-D.x,P=v.y-D.y,L=C*C+P*P;L<1&&(L=1);let I=Math.sqrt(L),M=i/L,F=C/I*M,R=P/I*M;m[x]+=F,c[x]+=R,m[T]-=F,c[T]-=R}}for(let x=0;x<t.length;x++){let v=t[x],T=b.get(v.source),D=b.get(v.target);if(T===void 0||D===void 0)continue;let C=e[T],P=e[D],L=P.x-C.x,I=P.y-C.y,M=Math.sqrt(L*L+I*I);if(M<.1)continue;let F=v.weight??1,R=M-l,N=s*R*F,A=L/M*N,k=I/M*N;m[T]+=A,c[T]+=k,m[D]-=A,c[D]-=k}let f=n/2,g=r/2,y=.001;for(let x=0;x<u;x++){let v=e[x];m[x]+=(f-v.x)*y,c[x]+=(g-v.y)*y}let h=20,p=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){p.push({...v,vx:0,vy:0});continue}let T=(v.vx+m[x])*a,D=(v.vy+c[x])*a,C=Math.sqrt(T*T+D*D),P=10;C>P&&(T=T/C*P,D=D/C*P);let L=v.x+T,I=v.y+D;L=Math.max(h,Math.min(n-h,L)),I=Math.max(h,Math.min(r-h,I)),p.push({...v,x:L,y:I,vx:T,vy:D})}return Zi(p,d),p}function yd(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 Ji(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:b=300,attractionForce:m=.01,damping:c=.9,edgeLength:f=100,edgeColor:g="#94a3b8",edgeWidth:y=1.5,title:h,customForce:p,trails:x}=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":h??"Empty force-directed graph"},h?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"},h):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 v=te(Ki(t,r,i)),[T,D]=G(0),C=te(!0),P=te(!1),L=te(n);L.current=n;let I=te(p);I.current=p;let M=te(null),F=te({repulsionForce:b,attractionForce:m,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l});F.current={repulsionForce:b,attractionForce:m,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l};let R=te(new Map);re(()=>{v.current=Ki(t,r,i),P.current=!1,C.current=!0,R.current=new Map,D(se=>se+1)},[t.length]),re(()=>{let se=0,J=()=>{if(!C.current)return;let ae=F.current,de=I.current,le;if(de?(le=de(v.current,L.current,ae.width,ae.height,M.current),ae.solidNodes&&Zi(le,ae.nodeRadius)):le=xd(v.current,L.current,ae.width,ae.height,ae.repulsionForce,ae.attractionForce,ae.damping,ae.edgeLength,ae.nodeRadius),v.current=le,x)for(let ne=0;ne<x.length;ne++){let fe=x[ne],oe=le.find(he=>he.id===fe.nodeId);if(!oe)continue;let ie=R.current.get(fe.nodeId);ie||(ie=[],R.current.set(fe.nodeId,ie)),ie.push({x:oe.x,y:oe.y});let ue=fe.maxPoints??200;ie.length>ue&&ie.splice(0,ie.length-ue)}if(!de&&yd(le)<.01){P.current=!0,D(ne=>ne+1);return}D(ne=>ne+1),se=requestAnimationFrame(J)};return se=requestAnimationFrame(J),()=>{C.current=!1,cancelAnimationFrame(se)}},[]);let N=v.current,A=S(se=>{v.current=v.current.map(J=>J.id===se?{...J,fixed:!J.fixed,vx:0,vy:0}:J),P.current&&(P.current=!1,C.current=!0,D(J=>J+1))},[]),k=te(null),w=te(null),$=S(se=>{let J=se,ae=w.current;if(!ae)return{x:J.clientX,y:J.clientY};let de=ae.getBoundingClientRect(),le=r/de.width,ne=i/de.height;return{x:(J.clientX-de.left)*le,y:(J.clientY-de.top)*ne}},[r,i]),E=te(!1),W=S((se,J)=>{J.stopPropagation(),k.current=se;let ae=v.current.find(de=>de.id===se);E.current=ae?.fixed??!1,v.current=v.current.map(de=>de.id===se?{...de,fixed:!0,vx:0,vy:0}:de)},[]),z=S(se=>{let J=$(se);if(M.current={x:J.x,y:J.y},!k.current)return;let ae=k.current,de=20;v.current=v.current.map(le=>le.id===ae?{...le,x:Math.max(de,Math.min(r-de,J.x)),y:Math.max(de,Math.min(i-de,J.y))}:le),P.current&&(P.current=!1,C.current=!0),D(le=>le+1)},[r,i,$]),B=S(()=>{let se=k.current;se&&(v.current=v.current.map(J=>J.id===se?{...J,fixed:E.current}:J)),k.current=null},[]),O=S(()=>{k.current=null,M.current=null},[]),_=q(()=>{let se=new Map;for(let J=0;J<N.length;J++)se.set(N[J].id,N[J]);return se},[T]),U=S(()=>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:g})))]:[],[u,s,g]),X=S(()=>{let se=[];for(let J=0;J<n.length;J++){let ae=n[J],de=_.get(ae.source),le=_.get(ae.target);if(!de||!le||ae.weight!==void 0&&ae.weight<=0)continue;let ne=ae.weight?Math.max(.5,Math.min(6,y*ae.weight)):y,fe={key:`edge-${J}`,x1:String(de.x),y1:String(de.y),x2:String(le.x),y2:String(le.y),stroke:ae.color??g,"stroke-width":String(ne),"stroke-opacity":"0.6"};u&&(fe["marker-end"]="url(#arrowhead)"),se.push(o("line",fe))}return se},[T,g,y,u]),ee=S(()=>{let se=[];for(let J=0;J<N.length;J++){let ae=N[J];se.push(o("circle",{key:`node-${ae.id}`,cx:String(ae.x),cy:String(ae.y),r:String(s),fill:ae.color,stroke:ae.fixed?"#0f172a":"#fff","stroke-width":ae.fixed?"3":String(a),style:{cursor:k.current===ae.id?"grabbing":"grab"},onMouseDown:de=>W(ae.id,de),onDblClick:()=>A(ae.id),role:"button",tabIndex:0,"aria-label":`Node: ${ae.label}${ae.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&se.push(o("text",{key:`label-${ae.id}`,x:String(ae.x),y:String(ae.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},ae.label))}return se},[T,s,d,A]),Z=S(()=>h?[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"},h)]:[],[h,r]),V=S(()=>{if(!x||x.length===0)return[];let se=[];for(let J=0;J<x.length;J++){let ae=x[J],de=R.current.get(ae.nodeId);if(!de||de.length<2)continue;let le=[];for(let ne=0;ne<de.length;ne++){let fe=de[ne];le.push(`${ne===0?"M":"L"}${fe.x.toFixed(1)},${fe.y.toFixed(1)}`)}se.push(o("path",{key:`trail-${ae.nodeId}`,d:le.join(" "),fill:"none",stroke:ae.color??"#3b82f6","stroke-width":String(ae.width??1),opacity:String(ae.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return se},[T,x]),j=U(),H=V(),Y=X(),K=ee(),Q=Z();return o("svg",{ref:w,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:z,onMouseUp:B,onMouseLeave:O},...j,...Q,...H,...Y,...K)}var Qi=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function es(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=Qi,title:b}=e,m=i==="vertical",c=b?30:0,f=120,g=q(()=>{let L=0;for(let I=0;I<t.length;I++)t[I].value>L&&(L=t[I].value);return L>0?L:1},[t]),y=S(L=>g===0?0:Math.max(.05,L/g),[g]),h=S((L,I)=>I||(u[L%u.length]??Qi[0]),[u]),p=S(()=>{if(t.length===0)return[];let L=[],I=40,M=n-I*2-f,F=r-c-I*2,R=d*(t.length-1),N=Math.max(1,(F-R)/t.length),A=I+M/2;for(let k=0;k<t.length;k++){let w=t[k],$=k<t.length-1?t[k+1]:null,E=h(k,w.color),W=y(w.value),z=$!==null?y($.value):W*.6,B=M/2*W,O=M/2*z,_=c+I+k*(N+d),U=A-B,X=A+B,ee=A+O,Z=A-O,V=`${U},${_} ${X},${_} ${ee},${_+N} ${Z},${_+N}`;L.push(o("polygon",{key:`section-${k}`,points:V,fill:E,stroke:"#fff","stroke-width":"1"}));let j=I+M+12,H=_+N/2;if(s&&L.push(o("text",{key:`label-${k}`,x:String(j),y:String(H-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let Y="";if(a&&(Y=String(w.value)),l&&t.length>0){let K=t[0].value,Q=K>0?Math.round(w.value/K*100):0;Y+=a?` (${Q}%)`:`${Q}%`}L.push(o("text",{key:`value-${k}`,x:String(j),y:String(H+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},Y))}}return L},[t,n,r,c,d,s,a,l,h,y,f]),x=S(()=>{if(t.length===0)return[];let L=[],I=40,M=n-I*2,R=r-c-I*2-40,N=d*(t.length-1),A=Math.max(1,(M-N)/t.length),k=c+I+R/2;for(let w=0;w<t.length;w++){let $=t[w],E=w<t.length-1?t[w+1]:null,W=h(w,$.color),z=y($.value),B=E!==null?y(E.value):z*.6,O=R/2*z,_=R/2*B,U=I+w*(A+d),X=k-O,ee=k-_,Z=k+_,V=k+O,j=`${U},${X} ${U+A},${ee} ${U+A},${Z} ${U},${V}`;L.push(o("polygon",{key:`section-${w}`,points:j,fill:W,stroke:"#fff","stroke-width":"1"}));let H=U+A/2,Y=c+I+R+14;if(s&&L.push(o("text",{key:`label-${w}`,x:String(H),y:String(Y),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},$.label)),a||l){let K="";if(a&&(K=String($.value)),l&&t.length>0){let Q=t[0].value,se=Q>0?Math.round($.value/Q*100):0;K+=a?` (${se}%)`:`${se}%`}L.push(o("text",{key:`value-${w}`,x:String(H),y:String(Y+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},K))}}return L},[t,n,r,c,d,s,a,l,h,y]),v=S(()=>b?[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"},b)]:[],[b,n]),T=S(()=>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]),D=v(),C=m?p():x(),P=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":b??"Funnel chart",style:{fontFamily:"sans-serif"}},...D,...C,...P)}var ts=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ns(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 Sd(e,t){return t||ts[e%ts.length]}function os(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:b,padding:m=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":b??"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,f=q(()=>{let F=1/0,R=-1/0;for(let N of t){N.start<F&&(F=N.start);let A=N.start+N.duration;A>R&&(R=A)}return F===1/0&&(F=0,R=1),{min:F,max:R,range:R-F}},[t]),g=q(()=>{let F=t.slice();return F.sort((R,N)=>R.group!==N.group?(R.group??"").localeCompare(N.group??""):R.start-N.start),F},[t]),y=r??m*2+g.length*(i+s)+s+20,h=n-m-c-m,p=m+(b?20:0),x=S(F=>f.range===0?c+m:c+m+(F-f.min)/f.range*h,[f,h,c,m]),v=S(()=>{if(!a)return[];let F=[],R=ns(f.range),N=Math.ceil(f.min/R)*R,A=p+g.length*(i+s)+s;for(let k=N;k<=f.max;k+=R){let w=x(k);F.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(p),x2:String(w),y2:String(A),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return F},[a,f,p,g.length,i,s,x]),T=S(()=>{let F=[],R=ns(f.range),N=Math.ceil(f.min/R)*R,A=p-8;for(let k=N;k<=f.max;k+=R){let w=x(k);F.push(o("text",{key:`taxis-${k}`,x:String(w),y:String(A),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(k)))}return F.push(o("text",{key:"time-unit",x:String(n-m),y:String(A),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),F},[f,p,x,u,n,m]),D=S(()=>{let F=[],R="";for(let N=0;N<g.length;N++){let A=g[N],k=p+N*(i+s)+s,w=x(A.start),$=Math.max(2,x(A.start+A.duration)-w),E=Sd(N,A.color);A.group&&A.group!==R&&(R=A.group,l&&F.push(o("text",{key:`group-${N}`,x:String(m),y:String(k+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},A.group))),F.push(o("rect",{key:`bar-${A.id}`,x:String(w),y:String(k),width:String($),height:String(i),rx:"4",ry:"4",fill:E,role:"graphics-symbol","aria-label":`${A.label}: start ${A.start}, duration ${A.duration}`})),l&&F.push(o("text",{key:`label-${A.id}`,x:String(c+m-8),y:String(k+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},A.label.length>16?A.label.substring(0,14)+"..":A.label)),d&&$>30&&F.push(o("text",{key:`prog-${A.id}`,x:String(w+$/2),y:String(k+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${A.start}-${A.start+A.duration}`))}return F},[g,p,i,s,x,l,d,c,m]),C=S(()=>b?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},b)]:[],[b,n,m]),P=v(),L=T(),I=D(),M=C();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Gantt chart",style:{fontFamily:"sans-serif"}},...M,...P,...L,...I)}var vd=Math.PI/180;function wd(e){return e*vd}function _e(e,t,n,r){let i=wd(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function rs(e,t,n,r,i){let s=_e(e,t,n,i),a=_e(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 kd(e,t,n){return e<t?t:e>n?n:e}function et(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function is(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:b=!0,showTicks:m=!0,tickCount:c=10,label:f,unit:g,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:h="#374151",backgroundColor:p="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,T=isFinite(t)&&!isNaN(t)?kd(t,x,v):x,D=(u?24:0)+(f?18:0),C=i/2,P=(s-D)*.6,L=Math.min(i/2,(s-D)*.55)-d/2-10,I=L-d,M=L-d/2,F=l-a,R=S(V=>{let j=v-x;if(j===0)return a;let H=(V-x)/j;return a+H*F},[x,v,a,F]),N=S(()=>{let V=rs(C,P,M,a,l);return[o("path",{key:"bg-arc",d:V,fill:"none",stroke:p,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,P,M,a,l,p,d]),A=S(()=>{if(y.length===0)return[];let V=[],j=F/y.length;for(let H=0;H<y.length;H++){let Y=a+H*j,K=Y+j,Q=rs(C,P,M,Y,K);V.push(o("path",{key:`seg-${H}`,d:Q,fill:"none",stroke:y[H],"stroke-width":String(d),"stroke-linecap":H===0||H===y.length-1?"round":"butt",opacity:"0.85"}))}return V},[y,F,a,C,P,M,d]),k=S(()=>{if(!m||c<=0)return[];let V=[],j=Math.max(1,Math.min(c,100));for(let H=0;H<=j;H++){let Y=H/j,K=a+Y*F,Q=H%2===0,se=Q?10:6,J=_e(C,P,L+4,K),ae=_e(C,P,L+4+se,K);if(V.push(o("line",{key:`tick-${H}`,x1:String(J.x),y1:String(J.y),x2:String(ae.x),y2:String(ae.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let de=x+Y*(v-x),le=_e(C,P,L+4+se+12,K);V.push(o("text",{key:`tick-label-${H}`,x:String(le.x),y:String(le.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},et(de)))}}return V},[m,c,a,F,C,P,L,x,v]),w=S(()=>{let V=[],j=R(T),H=I-8,Y=_e(C,P,H,j),K=6,Q=j+90,se=j-90,J=_e(C,P,K,Q),ae=_e(C,P,K,se);return V.push(o("polygon",{key:"needle",points:`${Y.x},${Y.y} ${J.x},${J.y} ${ae.x},${ae.y}`,fill:h,stroke:"none"})),V.push(o("circle",{key:"needle-cap",cx:String(C),cy:String(P),r:"8",fill:h,stroke:"#fff","stroke-width":"2"})),V},[T,R,C,P,I,h]),$=S(()=>{if(!u)return[];let V=[],j=et(T),H=j+(g?" "+g:""),Y=P+M+20;return V.push(o("text",{key:"value-text",x:String(C),y:String(Y),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${H}`},j,g?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+g):null)),V},[u,T,g,C,P,M]),E=S(()=>{if(!f)return[];let V=P+M+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(V),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},f)]},[f,C,P,M,u]),W=S(()=>{if(!b)return[];let V=[],j=_e(C,P,M,a),H=_e(C,P,M,l);return V.push(o("text",{key:"min-label",x:String(j.x-4),y:String(j.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},et(x))),V.push(o("text",{key:"max-label",x:String(H.x+4),y:String(H.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},et(v))),V},[b,C,P,M,a,l,x,v]),z=N(),B=A(),O=k(),_=w(),U=$(),X=E(),ee=W(),Z=`Gauge: ${et(T)}${g?" "+g:""}, range ${et(x)} to ${et(v)}${f?", "+f:""}`;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(T),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":Z,style:{fontFamily:"sans-serif"}},...z,...B,...O,..._,...U,...X,...ee)}var Et={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.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){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:b="Map of the United States"}=e,m=q(()=>Object.keys(Et),[]),c=S(p=>{l&&l(p)},[l]),f=S((p,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(p)},[d,u]),g=S((p,x)=>{let v=x.currentTarget;if(v){let T=r[p]??i;v.setAttribute("fill",T)}d&&d(null)},[d,r,i]),y=q(()=>{let p=[];for(let x=0;x<m.length;x++){let v=m[x],T=Et[v],D=r[v]??i,C={key:`state-${v}`,d:T.path,fill:D,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":v,role:"img","aria-label":T.name,style:{cursor:l?"pointer":"default"}};if(l){let L=v;C.onClick=()=>c(L),C.onKeyDown=I=>{(I.key==="Enter"||I.key===" ")&&c(L)},C.tabindex=0,C.role="button",C["aria-label"]=T.name}let P=v;C.onMouseOver=L=>f(P,L),C.onMouseOut=L=>g(P,L),p.push(o("path",C))}return p},[m,r,i,s,a,l,c,f,g]),h=o("title",{key:"map-title"},b);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b,style:{fontFamily:"sans-serif"}},h,...y)}function Yn(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 Cd(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 Md(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=Yn(t[i]),l=Yn(t[i+1]);return Cd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Ed(e){let{r:t,g:n,b:r}=Yn(e);return(.299*t+.587*n+.114*r)/255}var Rd=["#3b82f6","#fbbf24","#ef4444"];function as(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Rd,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:b="#fff",cellBorderWidth:m=1,title:c,padding:f=60}=e,g=t.length,y=q(()=>{let k=0;for(let w of t)w.length>k&&(k=w.length);return k},[t]),{minVal:h,maxVal:p}=q(()=>{let k=l??1/0,w=d??-1/0;for(let $ of t)for(let E of $)l===void 0&&E<k&&(k=E),d===void 0&&E>w&&(w=E);return k===1/0&&(k=0),w===-1/0&&(w=1),k===w&&(w=k+1),{minVal:k,maxVal:w}},[t,l,d]),x=c?30:0,v=n?f:20,T=r?f:20,D=i-v-20,C=s-x-T-20,P=y>0?D/y:0,L=g>0?C/g:0,I=S(()=>{let k=[];for(let w=0;w<g;w++){let $=t[w];for(let E=0;E<y;E++){let W=E<$.length?$[E]:0,z=(W-h)/(p-h),B=Md(z,a),O=v+E*P,_=x+20+w*L;if(k.push(o("rect",{key:`cell-${w}-${E}`,x:String(O),y:String(_),width:String(P),height:String(L),fill:B,stroke:b,"stroke-width":String(m)})),u){let U=Ed(B)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${E}`,x:String(O+P/2),y:String(_+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,P*.3,L*.4)),"font-family":"sans-serif",fill:U},String(Math.round(W*100)/100)))}}}return k},[t,g,y,h,p,a,P,L,v,x,u,b,m]),M=S(()=>{let k=[];if(n)for(let w=0;w<g;w++){let $=w<n.length?n[w]:"",E=x+20+w*L+L/2;k.push(o("text",{key:`row-label-${w}`,x:String(v-8),y:String(E),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},$))}if(r)for(let w=0;w<y;w++){let $=w<r.length?r[w]:"",E=v+w*P+P/2,W=x+20+g*L+16;k.push(o("text",{key:`col-label-${w}`,x:String(E),y:String(W),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},$))}return k},[n,r,g,y,P,L,v,x]),F=S(()=>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(g===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 R=F(),N=I(),A=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"}},...R,...N,...A)}function Pd(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 Id(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 Vn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ls(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:b,yLabel:m,padding:c=60}=e,f=Math.max(1,Math.round(n)),g=q(()=>Pd(t,f),[t,f]),y=q(()=>{let R=0;for(let N=0;N<g.length;N++)g[N].count>R&&(R=g[N].count);return R>0?R:1},[g]),h=r-c*2,p=i-c*2,x=S(()=>{if(!l)return[];let R=Id(y),N=[];for(let A=R;A<=y;A+=R){let k=c+p-A/y*p;N.push(o("line",{key:`grid-${A}`,x1:String(c),y1:String(k),x2:String(c+h),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),N.push(o("text",{key:`grid-label-${A}`,x:String(c-8),y:String(k+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(A)))}return N},[l,y,c,h,p]),v=S(()=>{let R=[];return R.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"})),R.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+p),x2:String(c+h),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"})),R},[c,h,p]),T=S(()=>{if(g.length===0)return[];let R=[],N=a*(g.length-1),A=Math.max(1,(h-N)/g.length);for(let k=0;k<g.length;k++){let w=g[k],$=w.count/y*p,E=c+k*(A+a),W=c+p-$;if(R.push(o("rect",{key:`bar-${k}`,x:String(E),y:String(W),width:String(A),height:String($),fill:s})),d&&w.count>0&&R.push(o("text",{key:`val-${k}`,x:String(E+A/2),y:String(W-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(w.count))),g.length<=15||k%2===0||k===g.length-1){let B=(g.length===1,Vn(w.min));R.push(o("text",{key:`xlabel-${k}`,x:String(E+A/2),y:String(c+p+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},B))}}if(g.length>0){let k=g[g.length-1],w=c+h;R.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+p+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Vn(k.max)))}return R},[g,y,a,s,d,c,h,p]),D=S(()=>{let R=[];return u&&R.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)),b&&R.push(o("text",{key:"x-label",x:String(c+h/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},b)),m&&R.push(o("text",{key:"y-label",x:String(14),y:String(c+p/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+p/2})`},m)),R},[u,b,m,r,i,c,h,p]),C=S(()=>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]),P=x(),L=v(),I=T(),M=D(),F=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":u??"Histogram",style:{fontFamily:"sans-serif"}},...M,...P,...L,...I,...F)}function $d(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 cs(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:b=!0,title:m,padding:c=60}=e,f=i==="vertical",g=f?30:0,y=n-c*2,h=r-c*2-g,p=f?h:y,x=f?y:h,v=q(()=>{let k=0;for(let w=0;w<t.length;w++)t[w].value>k&&(k=t[w].value);return k>0?k:1},[t]),T=q(()=>t.length===0?0:x/t.length,[t.length,x]),D=S(()=>{if(!u)return[];let k=$d(v),w=[];for(let $=k;$<=v;$+=k){let E=$/v*p;if(f){let W=c+h-E;w.push(o("line",{key:`grid-${$}`,x1:String(c),y1:String(W),x2:String(c+y),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${$}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}else{let W=c+E;w.push(o("line",{key:`grid-${$}`,x1:String(W),y1:String(c),x2:String(W),y2:String(c+h),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${$}`,x:String(W),y:String(c+h+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}}return w},[u,v,f,c,y,h,p]),C=S(()=>{let k=[];return f?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})):k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+h),x2:String(c+y),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),k},[f,c,y,h]),P=S(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let $=t[w],E=$.value/v*p,W=T*w+T/2,z=$.color??d;if(f){let B=c+W,O=c+h,_=c+h-E;k.push(o("line",{key:`stem-${w}`,x1:String(B),y1:String(O),x2:String(B),y2:String(_),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(B),cy:String(_),r:String(l),fill:z})),b&&k.push(o("text",{key:`val-${w}`,x:String(B),y:String(_-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String($.value)));let U=B,X=c+h+16;k.push(o("text",{key:`cat-${w}`,x:String(U),y:String(X),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${X})`},$.label))}else{let B=c+W,O=c,_=c+E;k.push(o("line",{key:`stem-${w}`,x1:String(O),y1:String(B),x2:String(_),y2:String(B),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(_),cy:String(B),r:String(l),fill:z})),b&&k.push(o("text",{key:`val-${w}`,x:String(_+l+4),y:String(B+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String($.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},$.label))}}return k},[t,v,T,d,l,s,a,b,f,c,y,h,p]),L=S(()=>m?[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"},m)]:[],[m,n,c]),I=S(()=>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=D(),F=C(),R=P(),N=L(),A=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Lollipop chart",style:{fontFamily:"sans-serif"}},...N,...M,...F,...R,...A)}function Un(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 Dd(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 Td(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=Un(t[i]),l=Un(t[i+1]);return Dd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function zd(e){let{r:t,g:n,b:r}=Un(e);return(.299*t+.587*n+.114*r)/255}var Ad=["#f0f9ff","#3b82f6","#1e3a8a"];function ds(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Ad,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:b="#e5e7eb",title:m,padding:c=70,symmetric:f=!1}=e,g=r??n,y=i??n,h=t.length,p=q(()=>{let z=0;for(let B of t)B.length>z&&(z=B.length);return z},[t]),x=q(()=>{if(!f||h===0)return t;let z=[],B=Math.max(h,p);for(let O=0;O<B;O++){let _=[];for(let U=0;U<B;U++){let X=t[O],ee=X&&U<X.length?X[U]:0,Z=t[U],V=Z&&O<Z.length?Z[O]:0;ee!==0?_.push(ee):_.push(V)}z.push(_)}return z},[t,f,h,p]),v=x.length,T=q(()=>{let z=0;for(let B of x)B.length>z&&(z=B.length);return z},[x]),{minVal:D,maxVal:C}=q(()=>{let z=1/0,B=-1/0;for(let O of x)for(let _ of O)_<z&&(z=_),_>B&&(B=_);return z===1/0&&(z=0),B===-1/0&&(B=1),z===B&&(B=z+1),{minVal:z,maxVal:B}},[x]),P=m?30:0,L=g?c:20,I=y?c:20,M=s-L-20,F=a-P-I-20,R=T>0?M/T:0,N=v>0?F/v:0,A=S(()=>{let z=[];for(let B=0;B<v;B++){let O=x[B];for(let _=0;_<T;_++){let U=_<O.length?O[_]:0,X=(U-D)/(C-D),ee=Td(X,l),Z=L+_*R,V=P+20+B*N,j=B===_,H=j&&u?"currentColor":b,Y=j&&u?"2":"1";if(z.push(o("rect",{key:`cell-${B}-${_}`,x:String(Z),y:String(V),width:String(R),height:String(N),fill:ee,stroke:H,"stroke-width":Y})),d){let K=zd(ee)>.5?"#111827":"#ffffff",Q=Math.min(12,R*.3,N*.35);z.push(o("text",{key:`val-${B}-${_}`,x:String(Z+R/2),y:String(V+N/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":j&&u?"bold":"normal","font-family":"sans-serif",fill:K},String(Math.round(U*100)/100)))}}}return z},[x,v,T,D,C,l,R,N,L,P,d,u,b]),k=S(()=>{let z=[];if(g)for(let B=0;B<v;B++){let O=B<g.length?g[B]:"",_=P+20+B*N+N/2;z.push(o("text",{key:`row-label-${B}`,x:String(L-8),y:String(_),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O))}if(y)for(let B=0;B<T;B++){let O=B<y.length?y[B]:"",_=L+B*R+R/2,U=P+20+v*N+12;z.push(o("text",{key:`col-label-${B}`,x:String(_),y:String(U),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O))}return z},[g,y,v,T,R,N,L,P]),w=S(()=>m?[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"},m)]:[],[m,s]);if(v===0||T===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":m??"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 $=w(),E=A(),W=k();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Matrix visualization",style:{fontFamily:"sans-serif"}},...$,...E,...W)}var Ld=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Gt(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 Fd(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 Nd(e,t,n,r,i,s,a){let l=[];if(Gt(e)<=0)return l;let b=Fd(e)+1,m=s==="horizontal",c=m?i/b:r/b,f=[];for(f.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});f.length>0;){let g=f.shift(),{node:y,depth:h,spanStart:p,spanEnd:x,colorIndex:v}=g,T=Gt(y);if(T<=0)continue;let D=x-p,C,P,L,I;if(m?(C=p,P=n+h*c,L=D,I=c):(C=t+h*c,P=p,L=c,I=D),l.push({x:C,y:P,w:L,h:I,label:y.label,value:T,color:y.color??a[v%a.length],depth:h}),y.children&&y.children.length>0){let M=p;for(let F=0;F<y.children.length;F++){let R=y.children[F],N=Gt(R);if(N<=0)continue;let A=N/T*D;f.push({node:R,depth:h+1,spanStart:M,spanEnd:M+A,colorIndex:h===0?F:v}),M+=A}}}return l}function us(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Ld,borderColor:d="#ffffff",borderWidth:u=1,title:b,padding:m=10}=e,c=b?30:0,f=m,g=m+c,y=n-m*2,h=r-m*2-c;if(q(()=>Gt(t),[t])<=0||y<=0||h<=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":b??"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 x=q(()=>Nd(t,f,g,y,h,i,l),[t,f,g,y,h,i,l]),v=[];b&&v.push(o("text",{key:"title",x:String(n/2),y:String(m+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b));for(let T=0;T<x.length;T++){let D=x[T];if(v.push(o("rect",{key:`cell-${T}`,x:String(D.x),y:String(D.y),width:String(Math.max(0,D.w)),height:String(Math.max(0,D.h)),fill:D.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${D.label}: ${D.value}`})),s&&D.w>20&&D.h>14){let C=Math.floor(D.w/7),P=D.label.length>C?D.label.substring(0,Math.max(1,C-2))+"..":D.label;v.push(o("text",{key:`label-${T}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},P))}a&&D.w>30&&D.h>28&&v.push(o("text",{key:`value-${T}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(D.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":b??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function jn(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function ps(e,t){let n=new Set;for(let i of e)n.add(jn(i,t));let r=Array.from(n);return r.sort(),r}function Xt(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 qt(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Wd(e,t,n,r,i){let s=ps(e,t),a=ps(e,n),l=new Map;for(let f of e){let g=jn(f,t),y=jn(f,n),h=`${g}::${y}`;l.has(h)||l.set(h,[]);let p=l.get(h),x=0;for(let v of r){let T=f[v];if(typeof T=="number")x+=T;else if(typeof T=="string"){let D=parseFloat(T);isNaN(D)||(x+=D)}}p.push(x)}let d=new Map;for(let[f,g]of l)d.set(f,Xt(g,i));let u=new Map;for(let f of s){let g=[];for(let y of a){let h=d.get(`${f}::${y}`);h!==void 0&&g.push(h)}u.set(f,Xt(g,i==="count"?"sum":i))}let b=new Map;for(let f of a){let g=[];for(let y of s){let h=d.get(`${y}::${f}`);h!==void 0&&g.push(h)}b.set(f,Xt(g,i==="count"?"sum":i))}let m=[];for(let f of u.values())m.push(f);let c=Xt(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:b,grandTotal:c}}function fs(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:b="#3b82f6",cellPadding:m=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(()=>Wd(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:f,colKeys:g,cells:y,rowTotals:h,colTotals:p,grandTotal:x}=c,v=u?30:0,T=g.length+(d?1:0),D=f.length+(d?1:0),C=1+T,P=1+D,L=Math.max(40,(a-m*2)/C),I=Math.max(20,Math.min(36,(l-v-m*2)/P)),M=L*C,F=I*P,R=Math.max(0,(a-M)/2),N=v+Math.max(0,(l-v-F)/2),A=[];u&&A.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)),A.push(o("rect",{key:"header-row-bg",x:String(R),y:String(N),width:String(M),height:String(I),fill:b})),A.push(o("rect",{key:"header-col-bg",x:String(R),y:String(N+I),width:String(L),height:String(I*D),fill:b,opacity:"0.85"})),A.push(o("text",{key:"corner",x:String(R+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let k=0;k<g.length;k++){let w=R+(k+1)*L,$=Math.floor(L/7),E=g[k],W=E.length>$?E.substring(0,Math.max(1,$-2))+"..":E;A.push(o("text",{key:`ch-${k}`,x:String(w+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},W))}d&&A.push(o("text",{key:"ch-total",x:String(R+(g.length+1)*L+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<f.length;k++){let w=f[k],$=N+(k+1)*I;k%2===0&&A.push(o("rect",{key:`row-bg-${k}`,x:String(R+L),y:String($),width:String(L*T),height:String(I),fill:"#f9fafb"}));let E=Math.floor(L/7),W=w.length>E?w.substring(0,Math.max(1,E-2))+"..":w;A.push(o("text",{key:`rh-${k}`,x:String(R+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},W));for(let z=0;z<g.length;z++){let B=g[z],O=`${w}::${B}`,_=y.get(O),U=R+(z+1)*L;A.push(o("rect",{key:`border-${k}-${z}`,x:String(U),y:String($),width:String(L),height:String(I),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),A.push(o("text",{key:`cell-${k}-${z}`,x:String(U+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_!==void 0?qt(_):"-"))}if(d){let z=R+(g.length+1)*L,B=h.get(w)??0;A.push(o("rect",{key:`rt-bg-${k}`,x:String(z),y:String($),width:String(L),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:`rt-${k}`,x:String(z+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},qt(B)))}}if(d){let k=N+(f.length+1)*I;A.push(o("rect",{key:"total-row-bg",x:String(R),y:String(k),width:String(M),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:"total-label",x:String(R+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let $=0;$<g.length;$++){let E=g[$],W=p.get(E)??0,z=R+($+1)*L;A.push(o("text",{key:`ct-${$}`,x:String(z+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},qt(W)))}let w=R+(g.length+1)*L;A.push(o("text",{key:"grand-total",x:String(w+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},qt(x)))}return A.push(o("rect",{key:"outer-border",x:String(R),y:String(N),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"}},...A)}function Kt(e,t){return Math.PI*2*e/t-Math.PI/2}function Zt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function gs(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:b="#d1d5db",title:m}=e,c=t.length,f=m?30:0,g=d&&n.length>0?30:0,y=60,h=Math.min((r-y*2)/2,(i-y*2-f-g)/2),p=r/2,x=y+f+h,v=q(()=>{let A=[];for(let k=0;k<c;k++){let w=t[k]?.max;if(w!==void 0&&w>0){A.push(w);continue}let $=0;for(let E of n){let W=E.values[k];W!==void 0&&W>$&&($=W)}A.push($>0?$:1)}return A},[t,n,c]),T=S(()=>{if(c<3)return[];let A=[];for(let k=1;k<=s;k++){let w=h*k/s,$=[];for(let E=0;E<c;E++){let W=Kt(E,c),z=Zt(p,x,w,W);$.push(`${z.x},${z.y}`)}A.push(o("polygon",{key:`ring-${k}`,points:$.join(" "),fill:"none",stroke:b,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=Kt(k,c),$=Zt(p,x,h,w);A.push(o("line",{key:`spoke-${k}`,x1:String(p),y1:String(x),x2:String($.x),y2:String($.y),stroke:b,"stroke-width":"0.75"}))}return A},[c,s,h,p,x,b]),D=S(()=>{if(!a||c<3)return[];let A=[],k=16;for(let w=0;w<c;w++){let $=Kt(w,c),E=Zt(p,x,h+k,$),W="middle";E.x<p-5?W="end":E.x>p+5&&(W="start");let z=Math.abs(E.y-x)<5?"0.35em":E.y<x?"0em":"0.7em";A.push(o("text",{key:`label-${w}`,x:String(E.x),y:String(E.y),"text-anchor":W,dy:z,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return A},[a,c,t,h,p,x]),C=S(()=>{if(c<3||n.length===0)return[];let A=[];for(let k=0;k<n.length;k++){let w=n[k],$=[],E=[],W=[];for(let z=0;z<c;z++){let B=w.values[z]??0,O=v[z],_=Math.min(B/O,1),U=h*_,X=Kt(z,c),ee=Zt(p,x,U,X);$.push(`${ee.x},${ee.y}`),u&&E.push(o("circle",{key:`dot-${k}-${z}`,cx:String(ee.x),cy:String(ee.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&W.push(o("text",{key:`val-${k}-${z}`,x:String(ee.x),y:String(ee.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(B*100)/100)))}A.push(o("polygon",{key:`series-fill-${k}`,points:$.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),A.push(o("polygon",{key:`series-line-${k}`,points:$.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let z of E)A.push(z);for(let z of W)A.push(z)}return A},[c,n,v,h,p,x,u,l]),P=S(()=>{if(!d||n.length===0)return[];let A=[],k=x+h+40,w=100,$=n.length*w,E=p-$/2;for(let W=0;W<n.length;W++){let z=n[W],B=E+W*w;A.push(o("rect",{key:`legend-swatch-${W}`,x:String(B),y:String(k),width:"12",height:"12",rx:"2",fill:z.color})),A.push(o("text",{key:`legend-text-${W}`,x:String(B+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},z.label))}return A},[d,n,p,x,h]),L=S(()=>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:"currentColor"},m)]:[],[m,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":m??"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 I=T(),M=D(),F=C(),R=P(),N=L();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??"Radar chart",style:{fontFamily:"sans-serif"}},...N,...I,...M,...F,...R)}var Bd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Od(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 b of u){let m=n.get(b),c=d+1;(m===void 0||c>m)&&n.set(b,c),s.includes(b)||s.push(b)}}for(let l of e)n.has(l)||n.set(l,0);return n}function Hd(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,b=t.filter(M=>M.value>0),m=e.map(M=>M.id),c=Od(m,b),f=new Map,g=new Map;for(let M of m)f.set(M,0),g.set(M,0);for(let M of b)g.set(M.source,(g.get(M.source)??0)+M.value),f.set(M.target,(f.get(M.target)??0)+M.value);let y=0;for(let M of c.values())M>y&&(y=M);let h=new Map;for(let M=0;M<=y;M++)h.set(M,[]);for(let[M,F]of c)h.get(F).push(M);let p=new Map,x=y>0?(d-i)/y:0;for(let M=0;M<=y;M++)p.set(M,a+M*x);let v=new Map;for(let M=0;M<e.length;M++)v.set(e[M].id,e[M]);let T=[],D=new Map;for(let M=0;M<=y;M++){let F=h.get(M);if(F.length===0)continue;let R=0;for(let w of F){let $=f.get(w)??0,E=g.get(w)??0;R+=Math.max($,E,1)}let N=u-s*(F.length-1),A=R>0?N/R:1,k=a;for(let w=0;w<F.length;w++){let $=F[w],E=v.get($),W=f.get($)??0,z=g.get($)??0,B=Math.max(W,z,1),O=Math.max(4,B*A),_=e.findIndex(X=>X.id===$),U={id:$,label:E.label,color:E.color??l[_%l.length],column:M,x:p.get(M),y:k,height:O,totalIn:W,totalOut:z,totalValue:B};T.push(U),D.set($,U),k+=O+s}}let C=new Map,P=new Map;for(let M of m)C.set(M,0),P.set(M,0);let L=[...b].sort((M,F)=>F.value-M.value),I=[];for(let M of L){let F=D.get(M.source),R=D.get(M.target);if(!F||!R)continue;let N=F.totalOut||1,A=R.totalIn||1,k=M.value/N*F.height,w=M.value/A*R.height,$=Math.max(1,(k+w)/2),E=C.get(M.source),W=P.get(M.target),z=F.y+E+k/2,B=R.y+W+w/2;C.set(M.source,E+k),P.set(M.target,W+w);let O=v.get(M.source);I.push({source:M.source,target:M.target,value:M.value,color:M.color??O?.color??F.color,sourceY:z,targetY:B,width:$})}return{layoutNodes:T,layoutLinks:I}}function ms(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:b=Bd,title:m,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":m??"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 f=q(()=>Hd(t,n,r,i,s,a,c,b),[t,n,r,i,s,a,c,b]),g=S(()=>{let T=[];for(let D=0;D<f.layoutLinks.length;D++){let C=f.layoutLinks[D],P=f.layoutNodes.find(N=>N.id===C.source),L=f.layoutNodes.find(N=>N.id===C.target);if(!P||!L)continue;let I=P.x+s,M=L.x,F=(I+M)/2,R=`M ${I} ${C.sourceY} C ${F} ${C.sourceY}, ${F} ${C.targetY}, ${M} ${C.targetY}`;T.push(o("path",{key:`link-${D}`,d:R,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&T.push(o("text",{key:`link-val-${D}`,x:String(F),y:String((C.sourceY+C.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(C.value)))}return T},[f,s,u,d]),y=S(()=>{let T=[];for(let D=0;D<f.layoutNodes.length;D++){let C=f.layoutNodes[D];if(T.push(o("rect",{key:`node-${C.id}`,x:String(C.x),y:String(C.y),width:String(s),height:String(C.height),fill:C.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${C.label}: ${C.totalValue}`})),l){let P=f.layoutNodes.reduce((A,k)=>Math.max(A,k.column),0),L=C.column===P,I=L?C.x+s+6:C.x-6,M=L?"start":"end",F=C.column===0,R=F?C.x-6:I,N=F?"end":M;T.push(o("text",{key:`label-${C.id}`,x:String(R),y:String(C.y+C.height/2+4),"text-anchor":N,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},C.label))}}return T},[f,s,l]),h=S(()=>m?[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"},m)]:[],[m,r,c]),p=g(),x=y(),v=h();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??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...p,...x)}var _d=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Gn=2*Math.PI;function Rt(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 Yd(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 Vd(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,b=e+r*Math.cos(d),m=t+r*Math.sin(d),c=e+r*Math.cos(u),f=t+r*Math.sin(u),g=e+n*Math.cos(u),y=t+n*Math.sin(u),h=e+n*Math.cos(d),p=t+n*Math.sin(d);if(a>=Gn-.001){let x=d+Math.PI,v=e+r*Math.cos(x),T=t+r*Math.sin(x),D=e+n*Math.cos(x),C=t+n*Math.sin(x);return[`M ${b} ${m}`,`A ${r} ${r} 0 1 1 ${v} ${T}`,`A ${r} ${r} 0 1 1 ${b} ${m}`,`L ${h} ${p}`,`A ${n} ${n} 0 1 0 ${D} ${C}`,`A ${n} ${n} 0 1 0 ${h} ${p}`,"Z"].join(" ")}return[`M ${b} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${f}`,`L ${g} ${y}`,`A ${n} ${n} 0 ${l} 0 ${h} ${p}`,"Z"].join(" ")}function Ud(e,t,n,r){let i=[],s=Rt(e);if(s<=0)return i;let a=Yd(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let b=0;b<e.children.length;b++){let m=e.children[b],c=Rt(m);if(c<=0)continue;let f=c/s*Gn;d.push({node:m,startAngle:u,endAngle:u+f,depth:0,colorIndex:b}),u+=f}}else return i.push({startAngle:0,endAngle:Gn,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:b,startAngle:m,endAngle:c,depth:f,colorIndex:g}=u,y=Rt(b);if(y<=0)continue;let h=t+f*l,p=h+l;if(i.push({startAngle:m,endAngle:c,innerR:h,outerR:p,label:b.label,value:y,color:b.color??r[g%r.length],depth:f}),b.children&&b.children.length>0){let x=m,v=c-m;for(let T=0;T<b.children.length;T++){let D=b.children[T],C=Rt(D);if(C<=0)continue;let P=C/y*v;d.push({node:D,startAngle:x,endAngle:x+P,depth:f+1,colorIndex:g}),x+=P}}}return i}function hs(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=_d,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,b=n/2,m=r/2,c=u?20:0,f=Math.min(b,m-c)-10;if(q(()=>Rt(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(b),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=q(()=>Ud(t,i,f,a),[t,i,f,a]),h=[];u&&h.push(o("text",{key:"title",x:String(b),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let p=m+c/2;for(let x=0;x<y.length;x++){let v=y[x],T=Vd(b,p,v.innerR,v.outerR,v.startAngle,v.endAngle);if(h.push(o("path",{key:`arc-${x}`,d:T,fill:v.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${v.label}: ${v.value}`})),s){let D=v.endAngle-v.startAngle,C=v.startAngle+D/2-Math.PI/2,P=(v.innerR+v.outerR)/2,L=v.outerR-v.innerR,I=D*P;if(I>20&&L>14){let M=b+P*Math.cos(C),F=p+P*Math.sin(C),R=Math.floor(Math.min(I,L)/7),N=v.label.length>R?v.label.substring(0,Math.max(1,R-1))+"..":v.label;h.push(o("text",{key:`label-${x}`,x:String(M),y:String(F+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},N))}}}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"}},...h)}var jd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Jt(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 bs(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 Gd(e,t,n,r,i,s){let a=[],l=[],d=Jt(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],b=r*i,m=[];for(let c=0;c<u.length;c++){let f=u[c],g=Jt(f);g<=0||m.push({label:f.label,value:g,area:g/d*b,color:f.color??s[c%s.length],node:f})}for(m.sort((c,f)=>f.area-c.area),l.push({nodes:m,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:f,rect:g,depth:y}=c;if(f.length===0)continue;let h={...g},p=0;for(;p<f.length&&h.w>0&&h.h>0;){let x=h.w>=h.h,v=x?h.h:h.w,T=[],D=[];T.push(f[p]),D.push(f[p].area),p++;let C=bs(D,v);for(;p<f.length;){let M=[...D,f[p].area],F=bs(M,v);if(F>C)break;T.push(f[p]),D.push(f[p].area),C=F,p++}let P=0;for(let M of D)P+=M;let L=v>0?P/v:0,I=0;for(let M=0;M<T.length;M++){let F=T[M],R=L>0?F.area/L:0,N,A,k,w;if(x?(N=h.x,A=h.y+I,k=L,w=R):(N=h.x+I,A=h.y,k=R,w=L),a.push({x:N,y:A,w:k,h:w,label:F.label,value:F.value,color:F.color,depth:y}),F.node.children&&F.node.children.length>0){let E=N+2,W=A+2+14,z=k-4,B=w-4-14;if(z>4&&B>4){let O=[],_=F.value,U=z*B;for(let X=0;X<F.node.children.length;X++){let ee=F.node.children[X],Z=Jt(ee);Z<=0||O.push({label:ee.label,value:Z,area:Z/_*U,color:ee.color??s[(X+y+1)%s.length],node:ee})}O.sort((X,ee)=>ee.area-X.area),l.push({nodes:O,rect:{x:E,y:W,w:z,h:B},depth:y+1})}}I+=R}x?h={x:h.x+L,y:h.y,w:h.w-L,h:h.h}:h={x:h.x,y:h.y+L,w:h.w,h:h.h-L}}}return a}function xs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=jd,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:b}=e,m=b?30:0,c=u,f=u+m,g=n-u*2,y=r-u*2-m;if(q(()=>Jt(t),[t])<=0||g<=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":b??"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 p=q(()=>Gd(t,c,f,g,y,a),[t,c,f,g,y,a]),x=[];b&&x.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"},b));for(let v=0;v<p.length;v++){let T=p[v];if(x.push(o("rect",{key:`cell-${v}`,x:String(T.x),y:String(T.y),width:String(Math.max(0,T.w)),height:String(Math.max(0,T.h)),fill:T.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${T.label}: ${T.value}`})),i&&T.w>20&&T.h>14){let D=Math.floor(T.w/7),C=T.label.length>D?T.label.substring(0,Math.max(1,D-2))+"..":T.label;x.push(o("text",{key:`label-${v}`,x:String(T.x+4),y:String(T.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&T.w>30&&T.h>28&&x.push(o("text",{key:`value-${v}`,x:String(T.x+4),y:String(T.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(T.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":b??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function ys(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 Xd(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 Ss(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=ys(t[s]),u=ys(t[a]);return Xd(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function Qt(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 qd(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let b=Math.max(2,Math.min(50,r)),m=d/(b-1),c=u/(b-1);if(n){let g=[];for(let x=0;x<b;x++)for(let v=0;v<b;v++)g.push({x:i+v*m,y:a+x*c});let h=n(g,{gridSize:b,xMin:i,xMax:s,yMin:a,yMax:l}),p=[];for(let x=0;x<g.length;x++){let v=g[x],T=h[x]??{dx:0,dy:0},D=Math.sqrt(T.dx*T.dx+T.dy*T.dy);p.push({x:v.x,y:v.y,dx:T.dx,dy:T.dy,magnitude:D})}return p}if(!t)return[];let f=[];for(let g=0;g<b;g++)for(let y=0;y<b;y++){let h=i+y*m,p=a+g*c,x=t(h,p),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);f.push({x:h,y:p,dx:x.dx,dy:x.dy,magnitude:v})}return f}function Kd(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:b,yMax:m,xSpan:c,ySpan:f,showGrid:g,showAxes:y,colorByMagnitude:h,colorScale:p,arrowColor:x,arrowWidth:v,effectiveArrowScale:T,maxMagnitude:D,title:C,tickFontSize:P}=i,L=F=>s+(F-d)/c*a,I=F=>s+(m-F)/f*l;if(e.clearRect(0,0,t,n),C&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(C,t/2,s/2+4),e.restore()),g){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${P}px sans-serif`,e.fillStyle="#6b7280";let F=Qt(c,10),R=Math.ceil(d/F)*F;for(let k=R;k<=u;k+=F){let w=L(k);e.beginPath(),e.moveTo(w,s),e.lineTo(w,s+l),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(k*100)/100),w,s+l+4)}let N=Qt(f,10),A=Math.ceil(b/N)*N;for(let k=A;k<=m;k+=N){let w=I(k);e.beginPath(),e.moveTo(s,w),e.lineTo(s+a,w),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(k*100)/100),s-6,w)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=v,b<=0&&m>=0){let F=I(0);e.beginPath(),e.moveTo(s,F),e.lineTo(s+a,F),e.stroke()}if(d<=0&&u>=0){let F=L(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 R=r[F],N=R.magnitude??Math.sqrt(R.dx*R.dx+R.dy*R.dy);if(N<1e-10)continue;let A=L(R.x),k=I(R.y),w=R.dx*T,$=-R.dy*T,E=A+w,W=k+$,z;if(h){let O=N/D;z=Ss(O,p)}else z=x;e.save(),e.strokeStyle=z,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(A,k),e.lineTo(E,W),e.stroke();let B=Math.sqrt(w*w+$*$);if(B>2){let O=w/B,_=$/B,U=-_,X=O,ee=Math.min(M,B*.4),Z=E-O*ee+U*ee*.5,V=W-_*ee+X*ee*.5,j=E-O*ee-U*ee*.5,H=W-_*ee-X*ee*.5;e.fillStyle=z,e.beginPath(),e.moveTo(E,W),e.lineTo(Z,V),e.lineTo(j,H),e.closePath(),e.fill()}e.restore()}}function vs(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:b=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:f=["#3b82f6","#8b5cf6","#ef4444"],title:g,padding:y=50,tickFontSize:h=10,arrowWidth:p=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:T}=e,D=Math.max(2,Math.min(50,s)),C=r-y*2,P=i-y*2,L=a[0],I=a[1],M=l[0],F=l[1],R=I-L,N=F-M,A=q(()=>Z=>y+(Z-L)/R*C,[y,L,R,C]),k=q(()=>Z=>y+(F-Z)/N*P,[y,F,N,P]),w=q(()=>qd(t,n,T,D,L,I,M,F,R,N),[t,n,T,D,L,I,M,F,R,N]),$=q(()=>{let Z=0;for(let V=0;V<w.length;V++){let j=w[V],H=j.magnitude??Math.sqrt(j.dx*j.dx+j.dy*j.dy);H>Z&&(Z=H)}return Z>0?Z:1},[w]),E=q(()=>Math.min(C,P)/Math.max(D,2)/(2*$)*d,[C,P,D,$,d]);if(x==="canvas"){let Z=te(null),V=te(0);return re(()=>{let j=Z.current;if(!j)return;let H=j.getContext("2d");if(H)return V.current&&cancelAnimationFrame(V.current),V.current=requestAnimationFrame(()=>{Kd(H,r,i,w,{padding:y,chartWidth:C,chartHeight:P,xMin:L,xMax:I,yMin:M,yMax:F,xSpan:R,ySpan:N,showGrid:b,showAxes:m,colorByMagnitude:c,colorScale:f,arrowColor:u,arrowWidth:p,effectiveArrowScale:E,maxMagnitude:$,title:g,tickFontSize:h})}),()=>{V.current&&cancelAnimationFrame(V.current)}},[w,r,i,y,C,P,L,I,M,F,R,N,b,m,c,f,u,p,E,$,g,h]),o("canvas",{ref:Z,width:r,height:i,role:"img","aria-label":g??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let W=S(()=>{if(!b)return[];let Z=[],V=Qt(R,10),j=Math.ceil(L/V)*V;for(let K=j;K<=I;K+=V){let Q=A(K);Z.push(o("line",{key:`gridv-${K}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+P),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`xtick-${K}`,x:String(Q),y:String(y+P+16),"text-anchor":"middle","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}let H=Qt(N,10),Y=Math.ceil(M/H)*H;for(let K=Y;K<=F;K+=H){let Q=k(K);Z.push(o("line",{key:`gridh-${K}`,x1:String(y),y1:String(Q),x2:String(y+C),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`ytick-${K}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}return Z},[b,L,I,M,F,R,N,A,k,y,C,P]),z=S(()=>{if(!m)return[];let Z=[];if(M<=0&&F>=0){let V=k(0);Z.push(o("line",{key:"axis-x",x1:String(y),y1:String(V),x2:String(y+C),y2:String(V),stroke:"#374151","stroke-width":String(p)}))}if(L<=0&&I>=0){let V=A(0);Z.push(o("line",{key:"axis-y",x1:String(V),y1:String(y),x2:String(V),y2:String(y+P),stroke:"#374151","stroke-width":String(p)}))}return Z.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String(P),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),Z},[m,L,I,M,F,A,k,y,C,P]),B=S(()=>{let Z=[];for(let j=0;j<w.length;j++){let H=w[j],Y=H.magnitude??Math.sqrt(H.dx*H.dx+H.dy*H.dy);if(Y<1e-10)continue;let K=A(H.x),Q=k(H.y),se=H.dx*E,J=-H.dy*E,ae=K+se,de=Q+J,le;if(c){let fe=Y/$;le=Ss(fe,f)}else le=u;Z.push(o("line",{key:`arrow-line-${j}`,x1:String(K),y1:String(Q),x2:String(ae),y2:String(de),stroke:le,"stroke-width":String(p),"stroke-linecap":"round"}));let ne=Math.sqrt(se*se+J*J);if(ne>2){let fe=se/ne,oe=J/ne,ie=-oe,ue=fe,he=Math.min(4,ne*.4),be=ae-fe*he+ie*he*.5,pe=de-oe*he+ue*he*.5,ge=ae-fe*he-ie*he*.5,ye=de-oe*he-ue*he*.5;Z.push(o("polygon",{key:`arrow-head-${j}`,points:`${ae},${de} ${be},${pe} ${ge},${ye}`,fill:le}))}}return Z},[w,A,k,E,c,$,f,u]),O=S(()=>g?[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"},g)]:[],[g,r,y]),_=W(),U=z(),X=B(),ee=O();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??"Vector field plot",style:{fontFamily:"sans-serif"}},...ee,..._,...U,...X)}function Zd(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 Jd(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 ws(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:b=!0,title:m,padding:c=60}=e,f=n-c*2,g=r-c*2,y=q(()=>Zd(t),[t]),{minVal:h,maxVal:p}=q(()=>{let $=0,E=0;for(let W=0;W<y.length;W++){let z=y[W];z.start<$&&($=z.start),z.end<$&&($=z.end),z.start>E&&(E=z.start),z.end>E&&(E=z.end)}return $===E&&(E=$+1),{minVal:$,maxVal:E}},[y]),x=p-h,v=S($=>c+g-($-h)/x*g,[c,g,h,x]),T=q(()=>y.length===0?0:f/y.length,[y.length,f]),D=6,C=Math.max(1,T-D),P=S(()=>{if(!u)return[];let $=Jd(x),E=[],W=Math.ceil(h/$)*$;for(let z=W;z<=p;z+=$){let B=v(z);E.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(B),x2:String(c+f),y2:String(B),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),E.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return E},[u,x,h,p,v,c,f]),L=S(()=>{let $=[];$.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"}));let E=h<=0&&p>=0?v(0):c+g;return $.push(o("line",{key:"axis-x",x1:String(c),y1:String(E),x2:String(c+f),y2:String(E),stroke:"#374151","stroke-width":"1.5"})),$},[c,f,g,h,p,v]),I=S(()=>{if(y.length===0)return[];let $=[];for(let E=0;E<y.length;E++){let W=y[E],z=c+E*T+D/2,B=Math.max(W.start,W.end),O=Math.min(W.start,W.end),_=v(B),U=v(O),X=Math.max(0,U-_),ee;if(W.type==="total"?ee=a:W.type==="decrease"?ee=s:ee=i,$.push(o("rect",{key:`bar-${E}`,x:String(z),y:String(_),width:String(C),height:String(X),fill:ee,rx:"2",ry:"2"})),d){let Z=W.type==="decrease"||W.value<0?U+14:_-4,V=W.type==="total"?String(W.value):(W.value>=0?"+":"")+String(W.value);$.push(o("text",{key:`val-${E}`,x:String(z+C/2),y:String(Z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},V))}if($.push(o("text",{key:`cat-${E}`,x:String(z+C/2),y:String(c+g+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},W.label)),b&&E<y.length-1){let Z=y[E+1],V=v(W.end),j=c+(E+1)*T+D/2;Z.type!=="total"&&$.push(o("line",{key:`conn-${E}`,x1:String(z+C),y1:String(V),x2:String(j),y2:String(V),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return $},[y,T,C,v,i,s,a,l,d,b,c,g]),M=S(()=>m?[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"},m)]:[],[m,n,c]),F=S(()=>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]),R=P(),N=L(),A=I(),k=M(),w=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":m??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...R,...N,...A,...w)}var Qd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],eu=[0,-45,45,90];function tu(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)),b=Math.abs(Math.sin(d)),m=a*u+l*b,c=a*b+l*u;return{x:r-m/2,y:i-c/2,w:m,h:c}}function nu(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 ou(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function ru(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 ks(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=Qd,rotations:d=eu,padding:u=4,spiral:b="archimedean",title:m}=e,c=q(()=>{if(t.length===0)return[];let g=t.map((C,P)=>({...C,originalIndex:P})).filter(C=>C.text.length>0&&C.weight>0).sort((C,P)=>P.weight-C.weight);if(g.length===0)return[];let y=g[g.length-1].weight,p=g[0].weight-y;function x(C){if(p===0)return(i+s)/2;let P=(C-y)/p;return i+P*(s-i)}let v=[],T=n/2,D=r/2;for(let C=0;C<g.length;C++){let P=g[C],L=x(P.weight),I=d[ru(P.text)%d.length],M=P.color??l[C%l.length],F=!1,R=500,N=b==="archimedean"?4:5;for(let A=0;A<R;A++){let k,w;if(b==="archimedean"){let O=A*.1,_=N*O;k=_*Math.cos(O),w=_*Math.sin(O)}else{let O=Math.floor(A/4)+1,_=A%4,U=(A%4===0?0:A)*N;switch(_){case 0:k=O*N*4,w=U;break;case 1:k=-U,w=O*N*4;break;case 2:k=-O*N*4,w=-U;break;default:k=U,w=-O*N*4;break}}let $=T+k,E=D+w,W=tu(P.text,L,I,$,E),z={x:W.x-u,y:W.y-u,w:W.w+u*2,h:W.h+u*2};if(!ou(z,n,r))continue;let B=!1;for(let O of v)if(nu(z,O.bbox)){B=!0;break}if(!B){v.push({text:P.text,x:$,y:E,fontSize:L,rotation:I,color:M,bbox:z}),F=!0;break}}}return v},[t,n,r,i,s,l,d,u,b]);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":m??"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 f=[];m&&f.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"},m));for(let g=0;g<c.length;g++){let y=c[g],h=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;f.push(o("text",{key:`word-${g}`,transform:h,"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":m??"Word cloud",style:{fontFamily:a}},...f)}var iu={0:"#1e293b",1:"#3b82f6"},su="#666";function Cs(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:b="#0f172a",padding:m=10,onCellClick:c,onCellHover:f,title:g}=e,y=n??iu,h=t.length,p=q(()=>{let $=0;for(let E=0;E<t.length;E++){let W=t[E];W!==void 0&&W.length>$&&($=W.length)}return $},[t]),x=u?20:0,v=g?24:0,T=q(()=>{let $=r-m*2-x,E=i-m*2-x-v;if(h===0||p===0)return{cellWidth:0,cellHeight:0};let W=Math.max(0,($-s*(p-1))/p),z=Math.max(0,(E-s*(h-1))/h);return{cellWidth:W,cellHeight:z}},[r,i,m,h,p,s,x,v]),D=S($=>{let E=y[$];return E!==void 0?E:su},[y]),C=S(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b}),[r,i,b]),P=S(()=>g?[o("text",{key:"title",x:String(r/2),y:String(m+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},g)]:[],[g,r,m]),L=S(()=>{if(!l||h===0||p===0)return[];let{cellWidth:$,cellHeight:E}=T,W=m+x,z=m+x+v,B=p*$+(p-1)*s,O=h*E+(h-1)*s,_=[];for(let U=0;U<=p;U++){let X=W+U*($+s)-s/2;_.push(o("line",{key:`vgrid-${U}`,x1:String(X),y1:String(z-s/2),x2:String(X),y2:String(z+O+s/2),stroke:d,"stroke-width":"0.5"}))}for(let U=0;U<=h;U++){let X=z+U*(E+s)-s/2;_.push(o("line",{key:`hgrid-${U}`,x1:String(W-s/2),y1:String(X),x2:String(W+B+s/2),y2:String(X),stroke:d,"stroke-width":"0.5"}))}return _},[l,h,p,T,m,x,v,s,d]),I=S(()=>{if(!u||h===0||p===0)return[];let{cellWidth:$,cellHeight:E}=T,W=m+x,z=m+x+v,B=[];for(let O=0;O<p;O++){let _=W+O*($+s)+$/2,U=z-6;B.push(o("text",{key:`col-idx-${O}`,x:String(_),y:String(U),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(O)))}for(let O=0;O<h;O++){let _=W-6,U=z+O*(E+s)+E/2+3;B.push(o("text",{key:`row-idx-${O}`,x:String(_),y:String(U),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(O)))}return B},[u,h,p,T,m,x,v,s]),M=S(()=>{if(h===0||p===0)return[];let{cellWidth:$,cellHeight:E}=T,W=m+x,z=m+x+v,B=[];for(let O=0;O<h;O++){let _=t[O];if(_!==void 0)for(let U=0;U<p;U++){let X=U<_.length?_[U]:0,ee=W+U*($+s),Z=z+O*(E+s),V=D(X),j={key:`cell-${O}-${U}`,x:String(ee),y:String(Z),width:String($),height:String(E),fill:V,rx:String(a),ry:String(a)};if(c){let H=O,Y=U,K=X;j.onClick=()=>c(H,Y,K),j.role="button",j.tabIndex=0}if(f){let H=O,Y=U,K=X;j.onMouseEnter=()=>f(H,Y,K)}B.push(o("rect",j))}}return B},[h,p,t,T,m,x,v,s,a,D,c,f]),F=C(),R=P(),N=L(),A=I(),k=M(),w=g?`${g} \u2014 ${h}x${p} discrete grid`:`${h}x${p} 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":w},F,...R,...N,...A,...k)}