@asymmetric-effort/specifyjs 0.2.143 → 0.2.145

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 ht=Object.defineProperty;var us=Object.getOwnPropertyDescriptor;var ps=Object.getOwnPropertyNames;var fs=Object.prototype.hasOwnProperty;var gs=(e,t,n)=>t in e?ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ms=(e,t)=>{for(var n in t)ht(e,n,{get:t[n],enumerable:!0})},hs=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ps(t))!fs.call(e,i)&&i!==n&&ht(e,i,{get:()=>t[i],enumerable:!(r=us(t,i))||r.enumerable});return e};var bs=e=>hs(ht({},"__esModule",{value:!0}),e);var ze=(e,t,n)=>gs(e,typeof t!="symbol"?t+"":t,n);var Hd={};ms(Hd,{Accordion:()=>Go,Alert:()=>io,AnalogClock:()=>Gn,AppContextProvider:()=>Fe,Avatar:()=>Xn,Badge:()=>qn,BarGraph:()=>hr,BigNumber:()=>Mi,BlochSphere:()=>Ei,BoxPlot:()=>Pi,Breadcrumb:()=>Uo,BubbleChart:()=>$i,Button:()=>vi,CalendarHeatMap:()=>zi,Card:()=>Io,Carousel:()=>Ho,CartesianGraph2D:()=>kr,Checkbox:()=>po,ChordDiagram:()=>Ti,ColorPicker:()=>go,ColorWheel:()=>mo,ComplexGraph2D:()=>Pr,ContextMenu:()=>kt,DataGrid:()=>Qn,DatePicker:()=>xo,DecompositionTree:()=>Ai,DigitalClock:()=>eo,DiscreteCartesian2D:()=>ds,DragDropProvider:()=>lt,Drawer:()=>lr,Dropdown:()=>Xo,EmptyState:()=>so,FileUpload:()=>yo,FlexContainer:()=>Do,FlexItem:()=>zo,Footer:()=>Or,ForceGraph:()=>Wi,FormFieldWrapper:()=>he,FunnelChart:()=>Oi,GanttChart:()=>Yi,Gauge:()=>Gi,GoogleAnalytics:()=>Br,Grid:()=>To,GridItem:()=>Ao,HeatMap:()=>ji,Histogram:()=>Xi,HypercubeGraph:()=>Fr,IDE:()=>Rt,Image:()=>_o,LineGraph:()=>Dr,ListView:()=>to,LollipopChart:()=>qi,Matrix:()=>Ki,Menubar:()=>Ko,MessageBusProvider:()=>st,Modal:()=>cr,MultilineField:()=>So,NavWrapper:()=>Se,NumberSpinner:()=>vo,Pagination:()=>Jo,Panel:()=>Fo,Partition:()=>Zi,PieGraph:()=>zr,PivotTable:()=>Qi,PolarGraph2D:()=>Ar,Popover:()=>ur,ProgressBar:()=>ao,RadarChart:()=>es,RadioGroup:()=>wo,SankeyDiagram:()=>ts,ScrollContainer:()=>Wo,Select:()=>ko,Sidebar:()=>er,Skeleton:()=>lo,Slider:()=>Co,Spinner:()=>uo,Splitter:()=>Bo,Stepper:()=>tr,Sunburst:()=>ns,Tabs:()=>Oo,Tag:()=>no,TextEditor:()=>Mo,TextField:()=>Eo,ThreeDLayers:()=>Ci,TimePicker:()=>Po,ToastContainer:()=>Jt,Toggle:()=>Ro,Toolbar:()=>or,Tooltip:()=>fr,TradingDashboard:()=>Dt,TreeMap:()=>rs,TreeNav:()=>sr,TreeNode:()=>Ue,USStateMap:()=>Ui,US_STATE_PATHS:()=>ft,UnityApp:()=>xi,UnityDesktop:()=>bi,VectorField:()=>as,VideoPlayer:()=>Vo,VirtualScroll:()=>oo,VizWrapper:()=>Wr,WaterfallChart:()=>ls,WordCloud:()=>cs,WordProcessor:()=>Pt,applyGate:()=>$n,blochToCartesian:()=>nt,buildInputStyle:()=>Re,buildNavItemStyle:()=>Ge,buildRotationMatrix:()=>sn,cartesianToBloch:()=>At,computeBoxStats:()=>Dn,computeMandelbrotGrid:()=>Er,computeSlices:()=>nn,createToaster:()=>Zt,describeArc:()=>tn,generateEdges:()=>rn,generateHypercube:()=>ot,generatePalette:()=>Et,generateVertices:()=>on,numRotationAngles:()=>rt,projectTo2D:()=>ln,transformVec:()=>an,useAppId:()=>qe,useBarGraphScales:()=>Qt,useChannel:()=>at,useDragDrop:()=>He,useDraggable:()=>fn,useDropZone:()=>ct,useHover:()=>xe,useHypercube:()=>Nr,useLineGraphScales:()=>en,useMessageBus:()=>Ne,useToast:()=>pr});module.exports=bs(Hd);var bt=Symbol.for("spec.element"),xs=Symbol.for("spec.fragment"),Yd=Symbol.for("spec.portal"),Wn=Symbol.for("spec.provider"),Bn=Symbol.for("spec.consumer"),ys=Symbol.for("spec.forward_ref"),Ss=Symbol.for("spec.memo"),vs=Symbol.for("spec.lazy"),ws=Symbol.for("spec.suspense"),ks=Symbol.for("spec.strict_mode"),Cs=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:bt,type:e,props:s,key:r,ref:i}}function Pe(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Wn,_context:t},r={$$typeof:Bn,_context:t};return t.Provider=n,t.Consumer=r,t}var Ye=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){}};Ye.prototype.isSpecComponent=!0;var xt=class extends Ye{shouldComponentUpdate(t,n){return!Hn(this.props,t)||!Hn(this.state,n)}};xt.prototype.isPureSpecComponent=!0;function Hn(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 _n=null;function Ae(){if(_n===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return _n}function j(e){return Ae().useState(e)}function ie(e,t){return Ae().useEffect(e,t)}function Ce(e){return Ae().useContext(e)}function Vt(e,t,n){return Ae().useReducer(e,t,n)}function v(e,t){return Ae().useCallback(e,t)}function X(e,t){return Ae().useMemo(e,t)}function oe(e){return Ae().useRef(e)}function pe(){return Ae().useId()}var Ve=Pe({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Yn(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Es={pathname:Yn(),hash:typeof window<"u"?window.location.hash:""},Ps=new Set;function Rs(){Es={pathname:Yn(),hash:typeof window<"u"?window.location.hash:""};for(let e of Ps)e()}typeof window<"u"&&window.addEventListener("hashchange",Rs);var Mp=Pe({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function Vn(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 Bs(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 Gn(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=j(Vn(a));ie(()=>{let T=setInterval(()=>{u(Vn(a))},1e3);return()=>clearInterval(T)},[a]);let b=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),g=b%12*30+m*.5,f=m*6+c*.1,y=c*6,h=n/2,p=n/2,x=n/2-10,S=x-4,z=x-22,R=[];R.push(o("circle",{cx:String(h),cy:String(p),r:String(x),fill:Ie.face,stroke:Ie.border,"stroke-width":"3"}));for(let T=0;T<12;T++){let L=(T*30-90)*Math.PI/180,D=S-6;R.push(o("line",{x1:String(h+D*Math.cos(L)),y1:String(p+D*Math.sin(L)),x2:String(h+S*Math.cos(L)),y2:String(p+S*Math.sin(L)),stroke:Ie.border,"stroke-width":"2"}));let W=String(T===0?12:T);if(R.push(o("text",{x:String(h+z*Math.cos(L)),y:String(p+z*Math.sin(L)),"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 A=x-38,k=String(T===0?0:T+12);R.push(o("text",{x:String(h+A*Math.cos(L)),y:String(p+A*Math.sin(L)),"text-anchor":"middle","dominant-baseline":"central",fill:Ie.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(T,P,L,D)=>{let W=(T-90)*Math.PI/180;return o("line",{x1:String(h),y1:String(p),x2:String(h+P*Math.cos(W)),y2:String(p+P*Math.sin(W)),stroke:D,"stroke-width":L,"stroke-linecap":"round"})};R.push(C(g,x*.5,"4",Ie.hand)),R.push(C(f,x*.75,"3",Ie.hand)),s&&R.push(C(y,x*.85,"1.5",Ie.second)),R.push(o("circle",{cx:String(h),cy:String(p),r:"4",fill:Ie.hand}));let F=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...R)];return r&&F.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ie.numbers}},Bs(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...F)}var Ut={xs:24,sm:32,md:40,lg:56,xl:80};function Os(e){return e==null?Ut.md:typeof e=="number"?e:Ut[e]??Ut.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 Un=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function _s(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Un[Math.abs(t)%Un.length]}var jn={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function Ys(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 Xn(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,b]=j(!1),m=Os(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,g=a??_s(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&&!u)h=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>b(!0)});else{let z=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"},z)}let p=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":g},role:"img","aria-label":n??r??"avatar"},h);if(!l)return p;let x=Math.max(8,Math.round(m*.25)),S={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:jn[l]??jn.offline,border:"2px solid #fff",boxSizing:"border-box",...Ys(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},p,o("span",{style:S,"aria-label":l}))}var Vs={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"}},Gs={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function qn(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?{...Gs[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...Vs[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 Us={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},Kn={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},jt={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},js="6px 8px",Xs={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},qs={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},Ks={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},Be={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Zs={...Be,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},Zn={...Be,opacity:"0.5",cursor:"default"},Jn={cursor:"pointer",width:"16px",height:"16px"};function Js(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function Qn(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:g=!1,compact:f=!1,stickyHeader:y=!1}=e,[h,p]=j(0),[x,S]=j(void 0),[z,R]=j("asc"),[C,I]=j([]),[F,T]=j({}),P=i??h,L=a??x,D=l??z,W=b??C,A=X(()=>{let ee=Object.entries(F).filter(([,se])=>se.length>0);return ee.length===0?n:n.filter(se=>ee.every(([ae,K])=>String(se[ae]??"").toLowerCase().includes(K.toLowerCase())))},[n,F]),k=X(()=>{if(!L)return A;let ee=[...A];return ee.sort((se,ae)=>{let K=se[L],Z=ae[L];if(K==null&&Z==null)return 0;if(K==null)return 1;if(Z==null)return-1;if(typeof K=="number"&&typeof Z=="number")return D==="asc"?K-Z:Z-K;let le=String(K),de=String(Z),ce=le.localeCompare(de);return D==="asc"?ce:-ce}),ee},[A,L,D]),w=k.length,E=r?Math.max(1,Math.ceil(w/r)):1,M=r?k.slice(P*r,(P+1)*r):k,N=v(ee=>{s?s(ee):p(ee)},[s]),$=v(ee=>{let se=L===ee&&D==="asc"?"desc":"asc";d?d(ee,se):(S(ee),R(se))},[L,D,d]),B=v(ee=>{let se=W.includes(ee)?W.filter(ae=>ae!==ee):[...W,ee];m?m(se):I(se)},[W,m]),H=v(()=>{let ee=M.map((K,Z)=>r?P*r+Z:Z),ae=ee.every(K=>W.includes(K))?W.filter(K=>!ee.includes(K)):[...new Set([...W,...ee])];m?m(ae):I(ae)},[M,W,r,P,m]),V=v((ee,se)=>{T(ae=>({...ae,[ee]:se})),N(0)},[N]),U=t.some(ee=>ee.filterable),J=f?js:jt.padding,ne=[];if(u){let ee=M.map((ae,K)=>r?P*r+K:K),se=ee.length>0&&ee.every(ae=>W.includes(ae));ne.push(o("th",{key:"__select_all",style:{...Kn,padding:J,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:se,onChange:H,style:Jn,"aria-label":"Select all rows"})))}for(let ee of t){let se={...Kn,padding:J,...ee.width?{width:ee.width}:{},...ee.sortable?{cursor:"pointer"}:{},...g?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},ae=[ee.header];ee.sortable&&ae.push(o("span",{style:Xs},Js(ee.key,L,D))),ne.push(o("th",{key:ee.key,style:se,onClick:ee.sortable?()=>$(ee.key):void 0,onKeyDown:ee.sortable?K=>{let Z=K.key;(Z==="Enter"||Z===" ")&&(K.preventDefault(),$(ee.key))}:void 0,tabIndex:ee.sortable?0:void 0,role:ee.sortable?"columnheader":void 0,"aria-sort":L===ee.key?D==="asc"?"ascending":"descending":void 0},...ae))}let te=null;if(U){let ee=[];u&&ee.push(o("th",{key:"__filter_spacer",style:{padding:J}}));for(let se of t)ee.push(o("th",{key:`filter_${se.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},se.filterable?o("input",{type:"text",placeholder:`Filter ${se.header}...`,style:qs,value:F[se.key]??"",onInput:ae=>V(se.key,ae.target.value),"aria-label":`Filter by ${se.header}`}):null));te=o("tr",{key:"__filter_row"},...ee)}let G=[];for(let ee=0;ee<M.length;ee++){let se=M[ee],ae=r?P*r+ee:ee,K=W.includes(ae),Z={};c&&ee%2===1&&(Z.backgroundColor="#f9fafb"),K&&(Z.backgroundColor="#eff6ff");let le=[];u&&le.push(o("td",{key:"__select",style:{padding:J,textAlign:"center",...jt,...g?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:K,onChange:()=>B(ae),style:Jn,"aria-label":`Select row ${ae+1}`})));for(let de of t){let ce=se[de.key],ue=de.render?de.render(ce,se):String(ce??"");le.push(o("td",{key:de.key,style:{...jt,padding:J,...g?{border:"1px solid #e5e7eb"}:{}}},ue))}G.push(o("tr",{key:String(ae),style:Z},...le))}let _=null;if(r){let ee=w===0?0:P*r+1,se=Math.min((P+1)*r,w),ae=[];ae.push(o("button",{key:"prev",style:P===0?Zn:Be,onClick:P>0?()=>N(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let K=7,Z=Math.max(0,P-Math.floor(K/2)),le=Math.min(E,Z+K);le-Z<K&&(Z=Math.max(0,le-K)),Z>0&&(ae.push(o("button",{key:"p0",style:Be,onClick:()=>N(0)},"1")),Z>1&&ae.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let de=Z;de<le;de++)ae.push(o("button",{key:`p${de}`,style:de===P?Zs:Be,onClick:de!==P?()=>N(de):void 0,"aria-current":de===P?"page":void 0},String(de+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:Be,onClick:()=>N(E-1)},String(E)))),ae.push(o("button",{key:"next",style:P>=E-1?Zn:Be,onClick:P<E-1?()=>N(P+1):void 0,disabled:P>=E-1,"aria-label":"Next page"},"Next \u2192")),_=o("div",{style:Ks},o("span",null,`Showing ${ee}\u2013${se} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...ae))}let O={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},Y={...Us,...g?{border:"1px solid #e5e7eb"}:{}},q=o("thead",null,o("tr",null,...ne),te),Q=o("tbody",null,...G),re=o("table",{style:Y,role:"grid","aria-rowcount":String(w)},q,Q);return o("div",{style:O},re,_)}function Oe(e){return e<10?`0${e}`:String(e)}function Qs(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 ea(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"?`${Oe(e.getMonth()+1)}/${Oe(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Oe(e.getMonth()+1)}-${Oe(e.getDate())}`}var ta={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"},na={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},oa={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},ra={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function eo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=j(new Date);ie(()=>{let p=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(p)},[]);let{hours:u,minutes:b,seconds:m}=Qs(l,s),c,g=null;t==="12h"?(g=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${Oe(c)}:${Oe(b)}`;i&&(f+=`:${Oe(m)}`);let y=[f];g!=null&&y.push(o("span",{style:oa},g));let h=[o("span",{style:na},...y)];return n&&h.push(o("span",{style:ra},ea(l,r,s))),o("div",{style:ta,...a?{class:a}:{}},...h)}var ia={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},sa={padding:"10px 14px",color:"var(--color-text, #1f2937)"},aa={borderBottom:"1px solid var(--color-border, #e5e7eb)"},la={cursor:"pointer",transition:"background-color 0.15s ease"},ca={backgroundColor:"var(--color-bg-muted, #eff6ff)"},da={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},yt={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 to(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:yt},u):null,o("div",{style:da},d),b?o("div",{style:{...yt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null);let m=[];for(let c=0;c<t.length;c++){let g=t[c],f=r(g,c),y=a===c,h=c===t.length-1,p={...sa,...s?la:{},...y?ca:{},...i&&!h?aa:{}};m.push(o("li",{key:f,style:p,onClick:l?()=>l(c):void 0,onKeyDown:l?x=>{let S=x.key;(S==="Enter"||S===" ")&&(x.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(g,c)))}return o("div",null,u?o("div",{style:yt},u):null,o("ul",{style:ia,role:l?"listbox":"list"},...m),b?o("div",{style:{...yt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null)}function ua(e){return e??"#3b82f6"}function pa(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 fa={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 ga(e,t,n,r,i){let s=fa[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:pa(e,.12),color:e,border:"none"};default:return a}}var ma={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 no(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=ua(n),m=ga(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:ma,onClick:g=>{g.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?g=>{let f=g.key;(f==="Enter"||f===" ")&&(g.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var ha={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function oo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=j(0),d=oe(null),u=t.length*r,b=parseInt(s,10)||400,m=Math.ceil(b/r),c=Math.max(0,Math.floor(a/r)-i),g=Math.min(t.length,Math.floor(a/r)+m+i),f=v(h=>{let p=h.target;l(p.scrollTop)},[]),y=[];for(let h=c;h<g;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:{...ha,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var ro={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 io(e){let[t,n]=j(!0),r=e.type??"info",i=e.variant??"subtle",s=ro[r]??ro.info,a=e.icon??s.icon,l=e.message??e.children,d=X(()=>{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 so(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 ao(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=pe().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let g=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(g/10)),y=(g-f)/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(g),height:String(g),viewBox:`0 0 ${g} ${g}`,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(g/2),cy:String(g/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(g/2),cy:String(g/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(h),"stroke-dashoffset":String(p),"stroke-linecap":"round",transform:`rotate(-90 ${g/2} ${g/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=X(()=>{let g={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(g.position="absolute",g.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,g.backgroundColor=i):(g.width=`${r}%`,g.backgroundColor=i),e.animated&&!e.indeterminate&&(g.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${ba(i)} 50%, ${i} 100%)`,g.backgroundSize="200% 100%",g.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),g},[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 lo(e){let t=e.variant??"text",n=e.animated!==!1,r=pe().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,d=[];for(let u=0;u<l;u++){let b=u===l-1&&l>1;d.push(o("div",{key:String(u),style:Xt({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:Xt({width:l,height:l,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:Xt({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function Xt(e){let t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}var xa={sm:16,md:24,lg:40},co={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function uo(e){let t=typeof e.size=="number"?e.size:xa[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=co[e.speed??"normal"]??co.normal,s=e.label??"Loading",l=pe().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,b=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,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 he(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 ya={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function po(e){let t=pe().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=oe(null);ie(()=>{b.current&&(b.current.indeterminate=a)},[a]);let m=v(()=>{l||i(!r)},[l,r,i]),c=v(F=>{l||(F.key===" "||F.key==="Enter")&&(F.preventDefault(),i(!r))},[l,r,i]),g=ya[u],f=`${g.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",h=r||a?"#3b82f6":"#ffffff",p={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"},x={color:"#ffffff",fontSize:`${g.icon}px`,lineHeight:"1",fontWeight:"700"},S=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,z={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},R=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},S),I=s?o("span",{style:{fontSize:g.fontSize,color:"#374151"}},s):null;return o(he,{error:d,htmlFor:n},o("div",{style:z,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},R,C,I))}var Sa=["#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 fo(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function St(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 go(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=Sa,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[b,m]=j(!1),[c,g]=j(r),f=oe(null);ie(()=>{g(r)},[r]),ie(()=>{let T=P=>{f.current&&!f.current.contains(P.target)&&m(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);let y=v(T=>{d||i(St(T))},[d,i]),h=v(T=>{let P=T.target.value;g(P);let L=P.startsWith("#")?P:`#${P}`;fo(L)&&i(St(L))},[i]),p=v(()=>{fo(c.startsWith("#")?c:`#${c}`)||g(r)},[c,r]),x={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},S={display:"flex",alignItems:"center",gap:"8px"},z={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"},R={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(T=>{let P=St(T)===St(r);return o("div",{key:T,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:T,cursor:d?"not-allowed":"pointer",border:P?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(T),onKeyDown:D=>{let W=D.key;(W==="Enter"||W===" ")&&(D.preventDefault(),y(T))},role:"button",tabIndex:d?-1:0,title:T,"aria-label":`Select color ${T}`})}),I=a?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput: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,F=b?o("div",{style:z},o("div",{style:R},...C),I):null;return o(he,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:S,onClick:d?void 0:()=>m(!b),onKeyDown:d?void 0:T=>{let P=T.key;(P==="Enter"||P===" ")&&(T.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),F))}function mo(e){let t=pe().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]=j(r),m=oe(null),c=v(((...h)=>{let x=h[0].target.value;b(x),i?.(x)}),[i]),g={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},f={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(he,{label:d,htmlFor:n},o("div",{style:g},o("div",{style:f},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 ho=["January","February","March","April","May","June","July","August","September","October","November","December"],va=["Su","Mo","Tu","We","Th","Fr","Sa"];function qt(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function wa(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 bo(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function ka(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function xo(e){let t=pe().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=X(()=>qt(r),[r]),g=X(()=>qt(a),[a]),f=X(()=>qt(l),[l]),[y,h]=j(!1),[p,x]=j(()=>c?c.getFullYear():new Date().getFullYear()),[S,z]=j(()=>c?c.getMonth():new Date().getMonth()),R=oe(null),C=X(()=>new Date,[]);ie(()=>{let $=B=>{R.current&&!R.current.contains(B.target)&&h(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]);let I=v(()=>{z($=>$===0?(x(B=>B-1),11):$-1)},[]),F=v(()=>{z($=>$===11?(x(B=>B+1),0):$+1)},[]),T=v($=>{let B=new Date(p,S,$);g&&B<g||f&&B>f||(i(ka(B)),h(!1))},[p,S,i,g,f]),P=c?wa(c,s):"",L=X(()=>{let $=new Date(p,S,1).getDay(),B=new Date(p,S+1,0).getDate(),H=[],V=[];for(let U=0;U<$;U++)V.push(null);for(let U=1;U<=B;U++)V.push(U),V.length===7&&(H.push(V),V=[]);for(;V.length>0&&V.length<7;)V.push(null);return V.length&&H.push(V),H},[p,S]),D={...Re({},{focused:y,error:!!m}),cursor:d?"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"},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"},E=va.map($=>o("div",{key:$,style:{padding:"4px"}},$)),M=L.map(($,B)=>{let H=$.map((V,U)=>{if(V===null)return o("div",{key:`empty-${B}-${U}`,style:{padding:"4px"}});let J=new Date(p,S,V),ne=bo(J,C),te=c?bo(J,c):!1,G=g&&J<g||f&&J>f,_={padding:"4px",textAlign:"center",cursor:G?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:ne?"700":"400",backgroundColor:te?"#3b82f6":"transparent",color:te?"#ffffff":G?"#d1d5db":ne?"#3b82f6":"#1f2937",border:ne&&!te?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${V}`,style:_,onClick:G?void 0:()=>T(V),onKeyDown:G?void 0:O=>{let Y=O.key;(Y==="Enter"||Y===" ")&&(O.preventDefault(),T(V))},role:G?void 0:"button",tabIndex:G?void 0:0,"aria-label":`${ho[S]} ${V}, ${p}`,"aria-disabled":G?"true":void 0},String(V))});return o("div",{key:`row-${B}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...H)}),N=y?o("div",{style:W},o("div",{style:A},o("button",{type:"button",style:k,onClick:I},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${ho[S]} ${p}`),o("button",{type:"button",style:k,onClick:F},"\u25B6")),o("div",{style:w},...E),...M):null;return o(he,{label:b,error:m,disabled:d,htmlFor:n},o("div",{ref:R,style:{position:"relative"}},o("div",{id:n,style:D,onClick:d?void 0:()=>h(!y),onKeyDown:d?void 0:$=>{let B=$.key;(B==="Enter"||B===" ")&&($.preventDefault(),h(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:P?"#1f2937":"#9ca3af"}},P||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),N))}function Kt(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 yo(e){let t=pe().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]=j([]),[c,g]=j(!1),[f,y]=j(""),h=oe(null),p=v(k=>{y("");let w=[];for(let M of k){if(a&&M.size>a){y(`File "${M.name}" exceeds maximum size of ${Kt(a)}`);continue}w.push(M)}let E=s?[...b,...w]:w.slice(0,1);m(E),r(E)},[b,s,a,r]),x=v(k=>{if(k.preventDefault(),k.stopPropagation(),g(!1),l)return;let w=k.dataTransfer;if(!w)return;let E=Array.from(w.files);p(E)},[l,p]),S=v(k=>{k.preventDefault(),k.stopPropagation(),l||g(!0)},[l]),z=v(k=>{k.preventDefault(),k.stopPropagation(),g(!1)},[]),R=v(k=>{let w=k.target;w.files&&(p(Array.from(w.files)),w.value="")},[p]),C=v(k=>{let w=b.filter((E,M)=>M!==k);m(w),r(w)},[b,r]),I=v(()=>{l||h.current&&h.current.click()},[l]),F={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"},T={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},P={fontSize:"14px",color:"#374151",marginBottom:"4px"},L={fontSize:"12px",color:"#9ca3af"},D=o("input",{id:n,ref:h,type:"file",accept:i,multiple:s,onChange:R,disabled:l,style:{display:"none"},tabIndex:-1}),W=o("div",{style:F,onClick:I,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),I())},onDrop:x,onDragOver:S,onDragLeave:z,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:T},"\u2191"),o("div",{style:P},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:L},i):null,a?o("div",{style:L},`Max size: ${Kt(a)}`):null),A=b.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...b.map((k,w)=>{let E={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},M={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${w}`,style:E},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"}},Kt(k.size))),o("button",{type:"button",style:M,onClick:N=>{N.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(he,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,D,W,A))}function So(e){let[t,n]=j(!1),[r,i]=j((e.value??e.defaultValue??"").length),s=pe().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...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}:{}},u=v(c=>{let g=c.target,f=g.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(g.style.height="auto",g.style.height=`${g.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(he,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},b,m)}function vo(e){let t=pe().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,[g,f]=j(!1),y=v(w=>{let E=w;return s!==void 0&&E<s&&(E=s),a!==void 0&&E>a&&(E=a),E},[s,a]),h=v(()=>{d||i(y(r+l))},[d,r,l,y,i]),p=v(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=v(w=>{let E=w.target.value;if(E===""||E==="-")return;let M=parseFloat(E);isNaN(M)||i(y(M))},[y,i]),S=v(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),h()):w.key==="ArrowDown"&&(w.preventDefault(),p()))},[d,h,p]),z=s===void 0||r>s,R=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":g?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...g&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},I=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"}),F={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"},T={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:I(z),onClick:p,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),L=u?o("span",{style:T},u):null,D=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:S,onFocus:()=>f(!0),onBlur:()=>f(!1),disabled:d,style:F,"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=b?o("span",{style:T},b):null,A=o("button",{type:"button",style:I(R),onClick:h,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[P];return L&&k.push(L),k.push(D),W&&k.push(W),k.push(A),o(he,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function wo(e){let t=pe().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=v(y=>{d||s(y)},[d,s]),c=v(y=>{if(d)return;let h=r.filter(S=>!S.disabled);if(h.length===0)return;let p=h.findIndex(S=>S.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]),g={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((y,h)=>{let p=y.value===i,x=d||!!y.disabled,S=`${n}-opt-${h}`,z={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"},R={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:S,style:C,onClick:x?void 0:I=>{I.preventDefault(),m(y.value)}},o("input",{type:"radio",id:S,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:z},o("div",{style:R})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(he,{label:b,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:g,role:"radiogroup","aria-label":b,onKeyDown:c,tabIndex:d?-1:0},...f))}function ko(e){let t=pe().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:g}=e,[f,y]=j(!1),[h,p]=j(""),[x,S]=j(-1),z=oe(null),R=X(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=X(()=>{if(!l||!h)return r;let $=h.toLowerCase();return r.filter(B=>B.label.toLowerCase().includes($))},[r,h,l]),I=X(()=>{let $={},B=[];for(let H of C)H.group?($[H.group]||($[H.group]=[]),$[H.group].push(H)):B.push(H);return{groups:$,ungrouped:B}},[C]),F=X(()=>R.length===0?"":R.map(B=>r.find(H=>H.value===B)).filter(Boolean).map(B=>B.label).join(", "),[R,r]);ie(()=>{let $=B=>{let H=B.target;z.current&&!z.current.contains(H)&&(y(!1),p(""))};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]);let T=v($=>{if(d){let B=R.includes($)?R.filter(H=>H!==$):[...R,$];s(B)}else s($),y(!1),p("")},[d,R,s]),P=v($=>{$.stopPropagation(),s(d?[]:"")},[d,s]),L=v($=>{if(b)return;let B=$.key;if(!f&&(B==="Enter"||B===" "||B==="ArrowDown")){$.preventDefault(),y(!0),S(0);return}if(f){if(B==="Escape"){y(!1),p("");return}if(B==="ArrowDown")$.preventDefault(),S(H=>Math.min(H+1,C.length-1));else if(B==="ArrowUp")$.preventDefault(),S(H=>Math.max(H-1,0));else if(B==="Enter"&&x>=0&&x<C.length){$.preventDefault();let H=C[x];H.disabled||T(H.value)}}},[b,f,x,C,T]),D={...Re({},{focused:f,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:b?"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"},A=($,B)=>{let H=R.includes($.value),V=B===x,U={padding:"8px 12px",cursor:$.disabled?"not-allowed":"pointer",backgroundColor:V?"#f3f4f6":H?"#eff6ff":"transparent",color:$.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:$.value,style:U,onClick:$.disabled?void 0:()=>T($.value),onMouseEnter:()=>S(B),role:"option","aria-selected":H?"true":"false","aria-disabled":$.disabled?"true":void 0},d&&H?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,$.label)},k=()=>{let $=[],B=0,{groups:H,ungrouped:V}=I;for(let U of V)$.push(A(U,B++));for(let U of Object.keys(H)){$.push(o("div",{key:`group-${U}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},U));for(let J of H[U])$.push(A(J,B++))}return $.length===0&&$.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),$},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:f?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),E=o("div",{style:D,id:n,onClick:b?void 0:()=>{y(!f),S(-1)},onKeyDown:L,tabIndex:b?-1:0,role:"combobox","aria-expanded":f?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:F?"#1f2937":"#9ca3af"}},F||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&R.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,w)),M=l&&f?o("input",{type:"text",value:h,onInput:$=>{p($.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"},M,...k()):null;return o(he,{label:c,error:m,helpText:g,disabled:b,htmlFor:n},o("div",{ref:z,style:{position:"relative"}},E,N))}function Co(e){let t=pe().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:g,error:f}=e,y=oe(null),h=oe(i);h.current=i;let[p,x]=j(null),S=X(()=>{if(c&&Array.isArray(r))return r;let B=typeof r=="number"?r:0;return[B,B]},[r,c]),z=oe(S);z.current=S;let R=B=>{let H=Math.round((B-s)/l)*l+s;return Math.max(s,Math.min(a,H))},C=B=>(B-s)/(a-s)*100,I=v(B=>{if(!y.current)return s;let H=y.current.getBoundingClientRect(),V=Math.max(0,Math.min(1,(B.clientX-H.left)/H.width));return R(s+V*(a-s))},[s,a,l]),F=v(B=>H=>{b||(H.preventDefault(),x(B))},[b]),T=v(B=>{if(b)return;let H=I(B);if(c){let V=Math.abs(H-S[0]),U=Math.abs(H-S[1]);V<=U?i([R(H),S[1]]):i([S[0],R(H)])}else i(R(H))},[b,I,c,S,i,s,a,l]);ie(()=>{if(!p)return;let B=V=>{let U=I(V),J=z.current,ne=h.current;p==="single"?ne(R(U)):p==="start"?ne([Math.min(R(U),J[1]),J[1]]):p==="end"&&ne([J[0],Math.max(J[0],R(U))])},H=()=>x(null);return document.addEventListener("mousemove",B),document.addEventListener("mouseup",H),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",H)}},[p,I,s,a,l]);let P=v(B=>{if(b)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(R((typeof r=="number"?r:0)+H))},[b,l,c,r,i,s,a]),L={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:b?"not-allowed":"pointer"},D=c?C(S[0]):0,W=C(c?S[1]:S[0]),A={position:"absolute",top:"0",left:`${D}%`,width:`${W-D}%`,height:"100%",backgroundColor:b?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=B=>g?B==="start"?`${g} minimum`:B==="end"?`${g} maximum`:g:B==="start"?"Minimum value":B==="end"?"Maximum value":"Value",w=(B,H,V)=>{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"},J={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:U,onMouseDown:F(H),role:"slider","aria-valuenow":String(V),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(H),tabIndex:b?-1:0,onKeyDown:P},d?o("div",{style:J},String(V)):null)},E=[];if(u)for(let B=s;B<=a;B+=l)E.push(o("div",{key:`tick-${B}`,style:{position:"absolute",top:"10px",left:`${C(B)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let M=[];if(m)for(let B of m)M.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 N={paddingTop:d?"28px":"8px",paddingBottom:m||u?"28px":"8px",opacity:b?"0.6":"1"},$=[];return c?($.push(w(C(S[0]),"start",S[0])),$.push(w(C(S[1]),"end",S[1]))):$.push(w(C(S[0]),"single",S[0])),o(he,{label:g,error:f,htmlFor:n},o("div",{style:N},o("div",{ref:y,style:L,role:"presentation",onClick:T},o("div",{style:A}),...$,...E,...M)))}var Ca=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Ma={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 Mo(e){let[t,n]=j(!1),r=oe(null),i=pe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??Ca,l=e.toolbarStyle??{},d=e.editorStyle??{};ie(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=v((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]),b=v(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=v(()=>{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=Ma[f];return y?o("button",{key:f,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: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})),g=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(he,{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,g))}function Eo(e){let[t,n]=j(!1),r=pe().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: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(he,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Ea=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Le(e){return String(e).padStart(2,"0")}function Pa(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=pe().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:g=Ea,onTimezoneChange:f}=e,[y,h]=j(!1),p=X(()=>Pa(r),[r]),x=s==="12h",S=p.hour>=12,z=x?p.hour%12||12:p.hour,R=v((_,O,Y)=>{let q=Math.max(0,Math.min(23,_)),Q=Math.max(0,Math.min(59,O)),re=Math.max(0,Math.min(59,Y??0));i(b?`${Le(q)}:${Le(Q)}:${Le(re)}`:`${Le(q)}:${Le(Q)}`)},[i,b]),C=v(_=>{let O=parseInt(_.target.value,10)||0;x&&(O=O%12,S&&(O+=12)),R(O,p.minute,p.second)},[x,S,p.minute,p.second,R]),I=v(_=>{let O=parseInt(_.target.value,10)||0;R(p.hour,O,p.second)},[p.hour,p.second,R]),F=v(_=>{let O=parseInt(_.target.value,10)||0;R(p.hour,p.minute,O)},[p.hour,p.minute,R]),T=v(()=>{if(l)return;let _=S?p.hour-12:p.hour+12;R(_,p.minute,p.second)},[l,S,p.hour,p.minute,p.second,R]),P=v(_=>{l||R(p.hour+_,p.minute,p.second)},[l,p.hour,p.minute,p.second,R]),L=v(_=>{l||R(p.hour,p.minute+_*a,p.second)},[l,p.hour,p.minute,p.second,a,R]),D=v(_=>{l||R(p.hour,p.minute,p.second+_)},[l,p.hour,p.minute,p.second,R]),W=v(_=>{let O=_.target.value;f&&f(O)},[f]),A={display:"inline-flex",alignItems:"center",gap:"4px",...Re({},{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"},E={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},M={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:k},o("button",{type:"button",style:w,onClick:()=>P(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Le(z),onChange:C,style:E,disabled:l,"aria-label":"Hour",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>P(-1),disabled:l},"\u25BC")),$=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),B=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>L(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Le(p.minute),onChange:I,style:E,disabled:l,"aria-label":"Minute",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>L(-1),disabled:l},"\u25BC")),H=b?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,V=b?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>D(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Le(p.second),onChange:F,style:E,disabled:l,"aria-label":"Second",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>D(-1),disabled:l},"\u25BC")):null,U=x?o("button",{type:"button",style:M,onClick:T,disabled:l,"aria-label":"Toggle AM/PM"},S?"PM":"AM"):null,J={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},ne=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,te=c?o("select",{style:J,value:m??g[0],onChange:W,disabled:l,"aria-label":"Timezone"},...g.map(_=>o("option",{key:_,value:_},_))):null,G=[N,$,B];return H&&G.push(H),V&&G.push(V),U&&G.push(U),ne&&G.push(ne),te&&G.push(te),o(he,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:A},...G))}var Ra={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 Ro(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=Ra[a],b=v(()=>{s||n(!t)},[s,t,n]),m=v(S=>{s||(S.key===" "||S.key==="Enter")&&(S.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?l:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},g=t?u.trackW-u.thumbSize-u.offset:u.offset,f={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${g}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:f}));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 $o={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 Io(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=X(()=>{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=$o[n]??$o.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 Do(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 zo(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 To(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 Ao(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 Lo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function Fo(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=j(!!e.defaultCollapsed),s=oe(null),[a,l]=j("auto");ie(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=v(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=v(y=>{if(!e.collapsible)return;let h=y.key;(h==="Enter"||h===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),b=X(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Lo[n]??Lo.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"},g={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},f={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?g:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function No(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function $a(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 Wo(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=oe(null),[s,a]=j(!0),[l,d]=j(!1),[u,b]=j(!0),[m,c]=j(!1),g=v(()=>{let x=i.current;if(!x)return;let S=2;a(x.scrollTop<=S),d(x.scrollTop+x.clientHeight>=x.scrollHeight-S),b(x.scrollLeft<=S),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-S)},[]);ie(()=>{g()},[g]);let f=v(()=>{r&&g()},[r,g]),y=X(()=>{let x={position:"relative",overflowX:No(t,"x"),overflowY:No(t,"y"),...$a(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",S=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)"),S&&!u&&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 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:f},e.children)}function Bo(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),d=oe(!1),u=v(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);ie(()=>{let y=p=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),S=n?x.width:x.height,z=n?p.clientX-x.left:p.clientY-x.top;if(S<=0)return;let R=i/S*100,C=e.maxSize?e.maxSize/S*100:100-R,I=z/S*100;I=Math.max(R,Math.min(C,I)),a(I)},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=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"},g={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:b,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},f[0]??null),o("div",{className:"splitter__divider",style:g,onMouseDown:u,onKeyDown:y=>{let h=y.key,p=2;n&&(h==="ArrowLeft"||h==="ArrowRight")?(y.preventDefault(),a(x=>{let S=h==="ArrowRight"?p:-p;return Math.max(5,Math.min(95,x+S))})):!n&&(h==="ArrowUp"||h==="ArrowDown")&&(y.preventDefault(),a(x=>{let S=h==="ArrowDown"?p:-p;return Math.max(5,Math.min(95,x+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 Oo(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(p=>!p.disabled)?.id??"",[i,s]=j(e.activeTab??r),a=e.activeTab??i,l=oe(null),d=v(p=>{s(p),e.onChange&&e.onChange(p)},[e.onChange]),u=v(p=>{let x=e.tabs.filter(F=>!F.disabled),S=x.findIndex(F=>F.id===a);if(S===-1)return;let z=t==="left"||t==="right",R=z?"ArrowUp":"ArrowLeft",C=z?"ArrowDown":"ArrowRight",I=-1;if(p.key===R?I=S>0?S-1:x.length-1:p.key===C?I=S<x.length-1?S+1:0:p.key==="Home"?I=0:p.key==="End"&&(I=x.length-1),I>=0){p.preventDefault(),d(x[I].id);let F=l.current;if(F){let P=F.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[I])];P&&P.focus()}}},[e.tabs,a,t,d]),b=t==="left"||t==="right",m=t==="bottom"||t==="right",c=X(()=>({display:"flex",flexDirection:b?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[b,m,e.style]),g={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"},f={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,S={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"?(S.borderRight=x?"2px solid #3b82f6":"2px solid transparent",S.marginRight="-2px"):(S.borderLeft=x?"2px solid #3b82f6":"2px solid transparent",S.marginLeft="-2px"):(S.borderBottom=x?"2px solid #3b82f6":"2px solid transparent",S.marginBottom="-2px"):n==="card"?(S.backgroundColor=x?"#ffffff":"transparent",S.borderRadius="6px 6px 0 0",x&&(S.border="1px solid #e5e7eb",S.borderBottom="1px solid #ffffff")):n==="pill"&&(S.borderRadius="9999px",S.backgroundColor=x?"#3b82f6":"transparent",S.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:S,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:g,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 Ho(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=pe().replace(/[^a-zA-Z0-9_-]/g,""),[u,b]=j(0),m=oe(null),c=oe(null),g=v(C=>{let I=C;r?I=(C%n+n)%n:I=Math.max(0,Math.min(C,n-1)),b(I),e.onChange&&e.onChange(I)},[n,r,e.onChange]),f=v(()=>g(u+1),[u,g]),y=v(()=>g(u-1),[u,g]);ie(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(f,l);return()=>clearInterval(C)},[e.autoPlay,l,f,n]),ie(()=>{let C=F=>{F.key==="ArrowLeft"?y():F.key==="ArrowRight"&&f()},I=c.current;if(I)return I.addEventListener("keydown",C),()=>I.removeEventListener("keydown",C)},[f,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=X(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),S={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},z=t.map((C,I)=>{let F=a==="fade"?{position:I===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:I===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(I),style:F},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),R=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,I)=>o("button",{key:String(I),"aria-label":`Go to slide ${I+1}`,onclick:()=>g(I),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:I===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:p,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let I=C.clientX-m.current;I>50?y():I<-50&&f(),m.current=null}},h?o("style",null,h):null,o("div",{style:x},...z),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...S,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:f,style:{...S,right:"8px"}},"\u203A"):null,R)}function _o(e){let[t,n]=j("loading"),r=oe(null),i=pe().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;ie(()=>{n("loading")},[e.src]);let d=X(()=>{let g={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(g.width=a),l&&(g.height=l),e.borderRadius&&(g.borderRadius=e.borderRadius),g},[a,l,e.borderRadius]),u=X(()=>{let g={display:"block",width:"100%",height:"100%"};return e.objectFit&&(g.objectFit=e.objectFit),t==="loading"&&(g.opacity="0",g.position="absolute"),t==="error"&&(g.display="none"),g},[e.objectFit,t]),b=null;if(t==="loading")if(e.placeholder==="skeleton"){let g=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;b=o("div",null,o("style",null,g),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 Yo(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 Vo(e){let t=e.controls!==!1,n=oe(null),r=pe().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=j(!1),[a,l]=j(0),[d,u]=j(0),[b,m]=j(e.muted?0:1),[c,g]=j(!!e.muted),[f,y]=j(!0),h=typeof e.width=="number"?`${e.width}px`:e.width??"100%",p=typeof e.height=="number"?`${e.height}px`:e.height??"auto";ie(()=>{let T=n.current;if(!T)return;let P=()=>{s(!0),e.onPlay&&e.onPlay()},L=()=>{s(!1),e.onPause&&e.onPause()},D=()=>{s(!1),e.onEnded&&e.onEnded()},W=()=>{l(T.currentTime),u(T.duration),e.onTimeUpdate&&e.onTimeUpdate(T.currentTime,T.duration)},A=()=>{u(T.duration)};return T.addEventListener("play",P),T.addEventListener("pause",L),T.addEventListener("ended",D),T.addEventListener("timeupdate",W),T.addEventListener("loadedmetadata",A),()=>{T.removeEventListener("play",P),T.removeEventListener("pause",L),T.removeEventListener("ended",D),T.removeEventListener("timeupdate",W),T.removeEventListener("loadedmetadata",A)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let x=v(()=>{let T=n.current;T&&(T.paused?T.play():T.pause())},[]),S=v(T=>{let P=n.current;if(!P||!isFinite(P.duration))return;let L=T.currentTarget.getBoundingClientRect(),D=Math.max(0,Math.min(1,(T.clientX-L.left)/L.width));P.currentTime=D*P.duration},[]),z=v(T=>{let P=n.current,L=parseFloat(T.target.value);P&&(P.volume=L,P.muted=L===0,m(L),g(L===0))},[]),R=v(()=>{let T=n.current;T&&T.requestFullscreen&&T.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,I={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},F=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:x,style:I},i?"\u23F8":"\u25B6"),o("div",{onclick:S,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${Yo(a)} / ${Yo(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:b),oninput:z,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:R,style:I},"\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"}}),F)}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=v(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 g=t==="vertical",f=g?"ArrowDown":"ArrowRight",y=g?"ArrowUp":"ArrowLeft";if(u.key===f){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 Ge(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:v(()=>t(!0),[]),onMouseLeave:v(()=>t(!1),[])}}function Ia(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:b}=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":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 g=v(S=>{let z=S;m||(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),r())},[m,r]),f=v(()=>{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:f,onKeyDown:g,onMouseEnter:u,onMouseLeave:b},...x)}function Da(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 Go(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,g]=j(()=>n??[]),f=v(h=>{g(p=>{let x=p.includes(h),S;return x?S=p.filter(z=>z!==h):r?S=[...p,h]:S=[h],m&&m(S),S})},[r,m]),y=X(()=>t.map(h=>{let p=c.includes(h.id),x=o(Ia,{key:`header-${h.id}`,section:h,expanded:p,onToggle:()=>f(h.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),S=o(Da,{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,S)}),[t,c,i,s,l,d,u,b,f]);return o(Se,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var za={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function Uo(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=j(!1),l=za[i],d=v(()=>{a(!0)},[]),u=t,b=!1;if(r&&r>1&&t.length>r&&!s){b=!0;let f=1,y=r-1;u=[...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 p=y===h.length-1,x=b&&f.label==="..."&&y===1,S=[];return y>0&&S.push(m(n)),x?S.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):p?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?z=>{z.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)},g=u.map((f,y)=>c(f,y,u));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"}},...g))}function jo(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=xe(),[d,u]=j(!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,g={...Ge(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=v(()=>{if(!m){if(b){u(z=>!z);return}t.onClick&&t.onClick(),r&&i()}},[m,b,t,r,i]),y=v(()=>{a(),b&&u(!0)},[b,a]),h=v(()=>{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,S=b&&d?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(z=>o(jo,{key:z.id,item:z,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:h},o("button",{type:"button",role:"menuitem",style:g,onClick:f,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),S)}function Xo(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]=j(!1),m=oe(null),c=v(()=>{b(z=>!z)},[]),g=v(()=>{b(!1)},[]);ie(()=>{if(!u)return;let z=R=>{let C=m.current;C&&!C.contains(R.target)&&b(!1)};return document.addEventListener("click",z,!0),()=>{document.removeEventListener("click",z,!0)}},[u]),ie(()=>{if(!u)return;let z=R=>{R.key==="Escape"&&b(!1)};return document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z)}},[u]);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(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??{}},S=u?o("div",{style:p},o(Se,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(z=>o(jo,{key:z.id,item:z,itemStyle:s,closeOnSelect:l,onClose:g})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,S)}function qo(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=xe(),[l,d]=j(!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=v(()=>{if(!b){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[b,u,t,n]),c=v(()=>{s(),u&&d(!0)},[u,s]),g=v(()=>{a(),u&&d(!1)},[u,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: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,S)=>o(qo,{key:String(S),item:x,onClose:n,index:S})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:g},o("button",{type:"button",role:"menuitem",style:f,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 Ta(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=xe(),b=oe(null),m=v(()=>{r?a():s(n)},[r,n,s,a]),c=v(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),g={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(qo,{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:g,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function Ko(e){let{menus:t}=e,[n,r]=j(null),i=oe(null),s=v(d=>{r(d)},[]),a=v(()=>{r(null)},[]);ie(()=>{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]),ie(()=>{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 g=c.querySelector('[role="menuitem"]');g&&g.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(Ta,{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 vt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Aa(e,t,n){let r=n*2+5;if(e<=r)return vt(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?[...vt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...vt(e-n*2-2,e)]:[1,"ellipsis",...vt(i,s),"ellipsis",e]}var wt={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"},La={...wt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Zo={...wt,color:"#9ca3af",cursor:"default",opacity:"0.5"},Fa={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Jo(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=v(h=>{!d&&h>=1&&h<=u&&h!==b&&i(h)},[d,u,b,i]),c=(h,p,x)=>{let S=d||p<1||p>u||p===b;return o("button",{type:"button",onClick:()=>m(p),disabled:S||void 0,"aria-label":x,style:S?Zo:wt},h)},g=Aa(u,b,s),f=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 g)if(h==="ellipsis")y.push(o("span",{key:`ellipsis-${f++}`,style:Fa},"..."));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?Zo:p?La:wt},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(Se,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function Qo(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=xe(),[u,b]=j(!1),m=t.children&&t.children.length>0,c=t.id===r,g=v(()=>{m&&!n&&b(I=>!I),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,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,S=!n&&m?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,z=n&&a?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,R=o("button",{type:"button",style:y,onClick:g,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},h,p,x,S,z),C=!n&&m&&u?t.children.map(I=>o(Qo,{key:I.id,item:I,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},R,C?o("div",{role:"group"},...C):null)}function er(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(Qo,{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:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...b)}var Ee={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 tr(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=v(h=>{s&&i&&i(h)},[s,i]),m=h=>h<n?"completed":h===n?"active":"pending",c=(h,p,x)=>{let S=a==="dot"?u:d,z={width:`${S}px`,height:`${S}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return x==="completed"?o("div",{style:{...z,backgroundColor:Ee.completedBg,color:Ee.completedText,border:`2px solid ${Ee.completed}`}},a==="circle"?p.icon||"\u2713":null):x==="active"?o("div",{style:{...z,backgroundColor:"#ffffff",color:Ee.activeText,border:`2px solid ${Ee.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:Ee.active}})):o("div",{style:{...z,backgroundColor:"#ffffff",color:Ee.pendingText,border:`2px solid ${Ee.pending}`}},a==="circle"?p.icon||String(h+1):null)},g=h=>{if(h>=t.length-1)return null;let x=h<n?Ee.lineCompleted:Ee.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"}})},f=(h,p)=>{let x=m(p),S=x==="active",z=x==="completed",R=c(p,h,x),C={fontSize:"13px",fontWeight:S?"600":"400",color:S||z?Ee.labelActive:Ee.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},I={fontSize:"11px",color:Ee.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},F=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:I},h.description):null),T=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},R,F):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},R,F);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":S?"step":void 0},T)},y=[];return t.forEach((h,p)=>{y.push(f(h,p));let x=g(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 nr={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 Na(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=xe(),l=nr[n],d=t.disabled===!0,u=t.type==="toggle",[b,m]=j(!1),c=u?t.active===!0:b,g=v(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=v(()=>{!d&&!u&&m(!0)},[d,u]),y=v(()=>{u||m(!1)},[u]),h=v(()=>{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,S=t.label?o("span",null,t.label):null,z=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:p,onClick:g,onMouseDown:f,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,S,z)}function or(e){let{items:t,size:n="md",variant:r="flat"}=e,i=nr[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(Na,{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 Ue=class e{constructor(t,n){ze(this,"id");ze(this,"label");ze(this,"children");ze(this,"expanded");ze(this,"icon");ze(this,"metadata");ze(this,"parent");ze(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 rr(e){e.expanded=!0;for(let t of e.children)rr(t)}function ir(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)ir(n,t);return t}function Wa(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function Ba(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,g=xe(),f=oe(null),y=c===t.id;ie(()=>{y&&f.current&&f.current.focus()},[y]);let h=t.isLeaf(),p=t.depth,x=[];for(let I=0;I<p;I++){let F=t;for(let P=0;P<p-I;P++)F=F?F.parent:null;let T=F?!Wa(F):!1;x.push(o("span",{key:`connector-${I}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...T?{borderLeft:`${s}px solid ${i}`}:{}}}))}let S=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,z=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:I=>{I.stopPropagation(),b(t)}},t.expanded?a:l),R=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=Ge(d,{hover:g.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":p+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:g.onMouseEnter,onMouseLeave:g.onMouseLeave,onClick:()=>m(t)},...x,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},z,R))}function sr(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:g,renderNode:f}=e,[y,h]=j(()=>{let T=Ue.fromData(t);return a&&rr(T),T}),[p,x]=j(t.id),S=X(()=>ir(y),[y]),z=v(()=>{h(T=>{let P=Object.create(Object.getPrototypeOf(T));return Object.assign(P,T),P})},[]),R=v(T=>{T.toggle(),T.expanded?r?.(T):i?.(T),z()},[r,i,z]),C=v(T=>{x(T.id),n?.(T)},[n]),I=v(T=>{let P=T;if(!p)return;let L=S.findIndex(W=>W.id===p);if(L===-1)return;let D=S[L];switch(P.key){case"ArrowDown":{P.preventDefault();let W=S[L+1];W&&x(W.id);break}case"ArrowUp":{P.preventDefault();let W=S[L-1];W&&x(W.id);break}case"ArrowRight":{P.preventDefault(),D.isLeaf()||(D.expanded?D.children.length>0&&x(D.children[0].id):R(D));break}case"ArrowLeft":{P.preventDefault(),!D.isLeaf()&&D.expanded?R(D):D.parent&&x(D.parent.id);break}case"Enter":{P.preventDefault(),C(D);break}case" ":{P.preventDefault(),D.isLeaf()||R(D);break}case"Home":{P.preventDefault(),S.length>0&&x(S[0].id);break}case"End":{P.preventDefault(),S.length>0&&x(S[S.length-1].id);break}}},[p,S,R,C]),F=S.map(T=>o(Ba,{key:T.id,node:T,isSelected:T.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:b,iconCollapsed:m,nodeStyle:c,renderNode:f,onToggle:R,onClick:C,focusedId:p}));return o(Se,{role:"tree",ariaLabel:"Tree navigation",styling:g,keyboardNav:!1},o("div",{onKeyDown:I,style:{outline:"none"}},...F))}function ar(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=j(-1),[l,d]=j(null),u=oe(null);ie(()=>{if(!u.current)return;u.current.focus();let c=f=>{let y=f,h=t.map((p,x)=>({item:p,i:x})).filter(({item:p})=>!p.divider);if(y.key==="ArrowDown")y.preventDefault(),a(p=>{let S=(h.findIndex(({i:z})=>z===p)+1)%h.length;return h[S].i});else if(y.key==="ArrowUp")y.preventDefault(),a(p=>{let x=h.findIndex(({i:z})=>z===p),S=x<=0?h.length-1:x-1;return h[S].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let 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 g=u.current;return()=>g.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,g)=>{if(c.divider)return o("div",{key:`divider-${g}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===g,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:f&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(g),d(h?g:null)},S=()=>{if(!y){if(h){d(g);return}c.onClick&&c.onClick(),r()}},z=[];c.icon&&z.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),z.push(o("span",{style:{flex:"1"}},c.label??"")),h&&z.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let R=[o("div",{key:`item-${g}`,style:p,onMouseEnter:x,onClick:S,role:"menuitem","aria-disabled":y?"true":void 0},...z)];return h&&l===g&&R.push(o(ar,{key:`submenu-${g}`,items:c.children,position:{x:n.x+178,y:n.y+g*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${g}`,style:{position:"relative"}},...R)});return o("div",{ref:u,style:b,tabIndex:-1,role:"menu"},...m)}function kt(e){let{items:t,children:n}=e,[r,i]=j(null),s=v(u=>{u.preventDefault();let b=u;i({x:b.clientX,y:b.clientY})},[]),a=v(()=>{i(null)},[]);ie(()=>{if(!r)return;let u=m=>{a()},b=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(b),document.removeEventListener("mousedown",u)}},[r,a]),ie(()=>{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(ar,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function Oa(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 lr(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]=j(!1),[c,g]=j(!1),f=oe(null),y=s?"drawer-title":void 0;if(ie(()=>{if(t)m(!0),requestAnimationFrame(()=>g(!0));else{g(!1);let T=setTimeout(()=>m(!1),300);return()=>clearTimeout(T)}},[t]),ie(()=>{if(!t||!d)return;let T=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[t,d,n]),ie(()=>{if(!t)return;let T=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=T}},[t]),ie(()=>{t&&f.current&&f.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={...Ha(r,i),transform:Oa(r,c),transition:"transform 0.3s ease"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},S={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},z={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},R={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},I=[];s&&I.push(o("div",{style:x},o("h3",{id:y,style:S},s),o("button",{type:"button",style:z,onClick:n,"aria-label":"Close drawer"},"\xD7"))),I.push(o("div",{style:R},u));let F=[];return a&&F.push(o("div",{style:h,onClick:C})),F.push(o("div",{ref:f,style:p,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...I)),o("div",null,...F)}var _a={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function cr(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=oe(null);if(ie(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),ie(()=>{if(!t||!a)return;let C=I=>{I.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),ie(()=>{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:_a[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},g={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"},p={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=C=>{s&&C.target===C.currentTarget&&n()},S=[],z=r?"modal-title":void 0;r?S.push(o("h2",{id:z,style:f},r)):S.push(o("span",null)),d&&S.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let R=[o("div",{style:g},...S),o("div",{style:h},u)];return l&&R.push(o("div",{style:p},l)),o("div",{style:m,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":z},o("div",{ref:b,style:c,tabIndex:-1,role:"document"},...R))}var dr=8;function Ya(e,t){let n=t+dr;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 Va(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${dr}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 ur(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]=j(!1),c=u?r:b,g=oe(null),f=v(()=>{u?d&&d(!r):m(z=>!z)},[u,r,d]);ie(()=>{if(!c||!l)return;let z=R=>{g.current&&!g.current.contains(R.target)&&(u?d&&d(!1):m(!1))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},h={...Ya(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:Va(i)}));let x=v(z=>{let R=z.key;(R==="Enter"||R===" ")&&(z.preventDefault(),f())},[f]),S=[o("div",{onClick:f,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&S.push(o("div",{style:h},...p)),o("div",{ref:g,style:y},...S)}var Ga=0;function Ua(){return`toast-${++Ga}-${Date.now()}`}function Zt(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=Ua();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 ja={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 Xa(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 qa(e){let{item:t,onDismiss:n}=e,r=ja[t.type];ie(()=>{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 Jt(e){let{toaster:t}=e,[,n]=j(0);ie(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=Xa(t.config.position);ie(()=>{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,...te)}var lt={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1.3,.1 .6,.4 .8,-.1 2,-3.8 v -2.3 l 1.1,-1.1 1.4,.5 3.4,6.4 v .9 l -3.3,2.2 3.5,-.4 4.9,-1.6 z"},AK:{name:"Alaska",path:"m 15.8,572 h 2.4 l .7,.7 -1,1.2 -1.9,.2 -2.5,1.3 -3.7,-.1 2.2,-.9 .3,-1.1 2.5,-.3 z m 8.3,-1.7 1.3,.5 h .9 l .5,1.2 .3,-.6 .9,.2 1.1,1.5 0,.5 -4.2,1.9 -2.4,-.1 -1,-.5 -1.1,.7 -2,0 -1.1,-1.4 4.7,-.5 z m 5.4,-.1 1,.1 .7,.7 v 1 l -1.3,.1 -.9,-1.1 z m 2.5,.3 1.3,-.1 -.1,1 -1.1,.6 z m .3,2.2 3.4,-.1 .2,1.1 -1.3,.1 -.3,-.5 -.8,.6 -.4,-.6 -.9,-.2 z m 166.3,7.6 2.1,.1 -1,1.9 -1.1,-.1 -.4,-.8 .5,-1.3 m -1.1,-2.9 .6,-1.3 -.2,-2.3 2.4,-.5 4.5,4.4 1.3,3.4 1.9,1.6 .3,5.1 -1.4,0 -1.3,-2.3 -3.1,-2.4 h -.6 l 1.1,2.8 1.7,.2 .2,2.1 -.9,.1 -4.1,-4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 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function 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=v(l=>t.dismiss(l),[t]),a=r.map(l=>o(qa,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function pr(e={}){let t=oe(null);t.current||(t.current=Zt(e));let n=t.current,r=v(()=>o(Jt,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Ka=6,Za=8;function Ja(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Za;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 Qa(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Ka}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 fr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=j(!1),[d,u]=j(null),b=oe(null),m=oe(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,g=v(()=>{m.current=setTimeout(()=>{if(b.current){let x=b.current.getBoundingClientRect();u(Ja(x,n))}l(!0)},r)},[r,n]),f=v(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);ie(()=>()=>{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:g,onMouseLeave:f,onFocus:g,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&p.push(o("div",{id:c,style:h,role:"tooltip"},t,o("div",{style:Qa(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...p)}function Qt(e,t,n,r,i){return X(()=>{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 el(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 tl(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 nl(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 gr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function mr(e,t){return t||gr[e%gr.length]}function hr(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:g=!1,stacked:f,grouped:y=!1}=e,h=i==="vertical",p=n-c*2,x=r-c*2,S=h?x:p,z=h?p:x,R=f!==void 0&&f.length>0,C=X(()=>R?nl(f):[],[R,f]),I=R?f.length:t.length,F=X(()=>el(t,f,y),[t,f,y]),T=F>0?F:1,P=Qt(I,T,S,z,a),L=v(()=>{if(!u)return[];let V=tl(T),U=[];for(let J=V;J<=T;J+=V){let ne=P.valueScale(J);if(h){let te=c+x-ne;U.push(o("line",{key:`grid-${J}`,x1:String(c),y1:String(te),x2:String(c+p),y2:String(te),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${J}`,x:String(c-6),y:String(te+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(J)))}else{let te=c+ne;U.push(o("line",{key:`grid-${J}`,x1:String(te),y1:String(c),x2:String(te),y2:String(c+x),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${J}`,x:String(te),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(J)))}}return U},[u,T,P,h,c,p,x,b]),D=v(()=>{let V=[];return h?(V.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"})),V.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"}))):(V.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"})),V.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"}))),V},[h,c,p,x]),W=v(()=>{let V=[];for(let U=0;U<t.length;U++){let J=t[U],ne=P.valueScale(J.value),te=P.categoryScale(U),G=J.color??s,_,O,Y=String(J.value);if(h){let q=c+te,Q=c+x-ne;_={x:String(q),y:String(Q),width:String(P.barThickness),height:String(ne),rx:String(l),ry:String(l),fill:G},O={x:String(q+P.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let q=c+te,Q=c;_={x:String(Q),y:String(q),width:String(ne),height:String(P.barThickness),rx:String(l),ry:String(l),fill:G},O={x:String(Q+ne+6),y:String(q+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(g&&(_.style=h?`animation: barGrow 0.6s ease-out ${U*.05}s both`:`animation: barGrow 0.6s ease-out ${U*.05}s both`),V.push(o("rect",{key:`bar-${U}`,..._})),d&&V.push(o("text",{key:`val-${U}`,...O},Y)),h){let q=c+te+P.barThickness/2,Q=c+x+16;V.push(o("text",{key:`cat-${U}`,x:String(q),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${q}, ${Q})`},J.label))}else V.push(o("text",{key:`cat-${U}`,x:String(c-6),y:String(c+te+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},J.label))}return V},[t,P,s,l,d,g,h,c,x]),A=v(()=>{if(!f)return[];let V=[];for(let U=0;U<f.length;U++){let J=f[U],ne=P.categoryScale(U),te=0;for(let G=0;G<J.values.length;G++){let _=J.values[G],O=P.valueScale(_.value),Y=P.valueScale(te),q=mr(G,_.color);if(h){let Q=c+ne,re=c+x-Y-O;V.push(o("rect",{key:`sbar-${U}-${G}`,x:String(Q),y:String(re),width:String(P.barThickness),height:String(O),rx:G===J.values.length-1?String(l):"0",ry:G===J.values.length-1?String(l):"0",fill:q,...g?{style:`animation: barGrow 0.6s ease-out ${(U*J.values.length+G)*.03}s both`}:{}})),d&&O>14&&V.push(o("text",{key:`sval-${U}-${G}`,x:String(Q+P.barThickness/2),y:String(re+O/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(_.value)))}else{let Q=c+Y,re=c+ne;V.push(o("rect",{key:`sbar-${U}-${G}`,x:String(Q),y:String(re),width:String(O),height:String(P.barThickness),rx:G===J.values.length-1?String(l):"0",ry:G===J.values.length-1?String(l):"0",fill:q,...g?{style:`animation: barGrow 0.6s ease-out ${(U*J.values.length+G)*.03}s both`}:{}})),d&&O>20&&V.push(o("text",{key:`sval-${U}-${G}`,x:String(Q+O/2),y:String(re+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(_.value)))}te+=_.value}if(d){let G=P.valueScale(te);h?V.push(o("text",{key:`stotal-${U}`,x:String(c+ne+P.barThickness/2),y:String(c+x-G-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(te))):V.push(o("text",{key:`stotal-${U}`,x:String(c+G+6),y:String(c+ne+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(te)))}if(h){let G=c+ne+P.barThickness/2,_=c+x+16;V.push(o("text",{key:`scat-${U}`,x:String(G),y:String(_),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${G}, ${_})`},J.label))}else V.push(o("text",{key:`scat-${U}`,x:String(c-6),y:String(c+ne+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},J.label))}return V},[f,P,l,d,g,h,c,x]),k=v(()=>{if(!f)return[];let V=C.length,U=[];for(let J=0;J<f.length;J++){let ne=f[J],te=P.categoryScale(J),G=2,_=Math.max(1,(P.barThickness-G*(V-1))/V);for(let O=0;O<ne.values.length;O++){let Y=ne.values[O],q=C.indexOf(Y.category),Q=q*(_+G),re=P.valueScale(Y.value),ee=mr(q>=0?q:O,Y.color);if(h){let se=c+te+Q,ae=c+x-re;U.push(o("rect",{key:`gbar-${J}-${O}`,x:String(se),y:String(ae),width:String(_),height:String(re),rx:String(l),ry:String(l),fill:ee,...g?{style:`animation: barGrow 0.6s ease-out ${(J*V+O)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${J}-${O}`,x:String(se+_/2),y:String(ae-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}else{let se=c,ae=c+te+Q;U.push(o("rect",{key:`gbar-${J}-${O}`,x:String(se),y:String(ae),width:String(re),height:String(_),rx:String(l),ry:String(l),fill:ee,...g?{style:`animation: barGrow 0.6s ease-out ${(J*V+O)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${J}-${O}`,x:String(se+re+4),y:String(ae+_/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}}if(h){let O=c+te+P.barThickness/2,Y=c+x+16;U.push(o("text",{key:`gcat-${J}`,x:String(O),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${O}, ${Y})`},ne.label))}else U.push(o("text",{key:`gcat-${J}`,x:String(c-6),y:String(c+te+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},ne.label))}return U},[f,C,P,l,d,g,h,c,x]),w=v(()=>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=v(()=>g?[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; } }"))]:[],[g,h]),M=L(),N=D(),$=w(),B=E(),H;return R&&y?H=k():R?H=A():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,...$,...M,...N,...H)}function je(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 Ct(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 Mt(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),br(l)};return br(l),()=>{i=!0}}function br(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function ol(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 xr(e,t){let n=t-e;if(n<=0)return[e];let r=ol(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 yr(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var me=40,Sr=1.1,vr=.01,wr=1e6;function kr(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:g="#3b82f6",curveColor:f="#3b82f6",gridColor:y="#e2e8f0",axisColor:h="#94a3b8",onPointClick:p,onPointDoubleClick:x,onPointContextMenu:S,onPointHover:z}=e,[R,C]=j(d[0]),[I,F]=j(d[1]),[T,P]=j(u[0]),[L,D]=j(u[1]),W=oe(!1),A=oe(null),k=v(Y=>me+(Y-R)/(I-R)*(t-2*me),[R,I,t]),w=v(Y=>n-me-(Y-T)/(L-T)*(n-2*me),[T,L,n]),E=v(Y=>R+(Y-me)/(t-2*me)*(I-R),[R,I,t]),M=v(Y=>T+(n-me-Y)/(n-2*me)*(L-T),[T,L,n]),N=v(Y=>{let q=Y;W.current=!0,A.current={mx:q.clientX,my:q.clientY,x0:R,x1:I,y0:T,y1:L}},[R,I,T,L]),$=v(Y=>{if(!W.current||!A.current)return;let q=Y,Q=A.current,re=q.clientX-Q.mx,ee=q.clientY-Q.my,se=re/(t-2*me)*(Q.x1-Q.x0),ae=ee/(n-2*me)*(Q.y1-Q.y0);C(Q.x0-se),F(Q.x1-se),P(Q.y0+ae),D(Q.y1+ae)},[t,n]),B=v(()=>{W.current=!1,A.current=null},[]),H=v(Y=>{let q=Y;q.preventDefault();let Q=q.currentTarget.getBoundingClientRect(),re=q.clientX-Q.left,ee=q.clientY-Q.top,se=E(re),ae=M(ee),K=q.deltaY>0?Sr:1/Sr,Z=(I-R)*K,le=(L-T)*K;if(Z<vr||le<vr||Z>wr||le>wr)return;let de=(se-R)/(I-R),ce=(ae-T)/(L-T);C(se-de*Z),F(se+(1-de)*Z),P(ae-ce*le),D(ae+(1-ce)*le)},[R,I,T,L,E,M]),V=[];if(V.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),b){let Y=xr(R,I),q=xr(T,L);for(let Q=0;Q<Y.length;Q++){let re=k(Y[Q]);V.push(o("line",{x1:re,y1:me,x2:re,y2:n-me,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),V.push(o("text",{x:re,y:n-me+14,"text-anchor":"end","font-size":10,fill:h,transform:`rotate(-45, ${re}, ${n-me+14})`,key:`lx-${Q}`},yr(Y[Q])))}for(let Q=0;Q<q.length;Q++){let re=w(q[Q]);V.push(o("line",{x1:me,y1:re,x2:t-me,y2:re,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),V.push(o("text",{x:me-6,y:re+3,"text-anchor":"end","font-size":10,fill:h,key:`ly-${Q}`},yr(q[Q])))}}if(m){let Y=Math.max(me,Math.min(t-me,k(0))),q=Math.max(me,Math.min(n-me,w(0)));V.push(o("line",{x1:me,y1:q,x2:t-me,y2:q,stroke:h,"stroke-width":1,key:"x-axis"})),V.push(o("line",{x1:Y,y1:me,x2:Y,y2:n-me,stroke:h,"stroke-width":1,key:"y-axis"}))}let U=X(()=>{if(!i||!l)return[];let Y=a??(I-R)/s,q=je({start:R,end:I,step:Y});return Ct(i,q)},[i,R,I,a,s,l]),[J,ne]=j([]),te=oe(null);ie(()=>{if(!i||l){ne([]);return}let Y=a??(I-R)/s,q=je({start:R,end:I,step:Y});return te.current&&te.current(),te.current=Mt(i,q,200,Q=>{ne([...Q])}),()=>{te.current&&te.current()}},[i,R,I,a,s,l]);let G=l?U:J;if(G.length>0){let Y=[];for(let q=0;q<G.length;q++){let Q=G[q],re=k(Q.input),ee=w(Q.output);Y.push(`${Y.length===0?"M":"L"}${re},${ee}`)}V.push(o("path",{d:Y.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let _=(Y,q,Q,re)=>{if(q)return ee=>q({x:re.x,y:re.y,index:Q,event:ee})};for(let Y=0;Y<r.length;Y++){let q=r[Y],Q=k(q.x),re=w(q.y),ee={cx:Q,cy:re,r:c,fill:g,cursor:"pointer",key:`pt-${Y}`};p&&(ee.onClick=_("click",p,Y,q)),x&&(ee.onDblClick=_("dblclick",x,Y,q)),S&&(ee.onContextMenu=_("contextmenu",S,Y,q)),z&&(ee.onMouseOver=_("mouseover",z,Y,q)),V.push(o("circle",ee))}let O=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:me,y:me,width:t-2*me,height:n-2*me})));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},O,...V)}function Mr(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 Cr(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 Er(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Mr){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 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=Mr,data:d,resolution:u=2,onPointClick:b,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:g}=e;if(d){let M=d.length,N=M>0?d[0].length:0,$=N>0?t/N:1,B=M>0?n/M:1,H=[];for(let V=0;V<M;V++){let U=d[V];for(let J=0;J<N;J++){let ne=U[J]??0,[te,G,_]=Cr(ne,s,a);H.push(o("rect",{key:`${V}-${J}`,x:String(J*$),y:String(V*B),width:String(Math.ceil($)),height:String(Math.ceil(B)),fill:`rgb(${te},${G},${_})`}))}}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,p]=j(r[1]),[x,S]=j(i[0]),[z,R]=j(i[1]),C=oe(null),I=oe(!1),F=oe(null),T=v((M,N)=>{let $=f+M/t*(h-f),B=z-N/n*(z-x);return{re:$,im:B}},[f,h,x,z,t,n]);ie(()=>{let M=C.current;if(!M)return;let N=M.getContext("2d");if(!N)return;let $=N.createImageData(t,n),B=$.data;for(let H=0;H<n;H++)for(let V=0;V<t;V++){let{re:U,im:J}=T(V,H),ne=l(U,J,s),[te,G,_]=Cr(ne,s,a),O=(H*t+V)*4;B[O]=te,B[O+1]=G,B[O+2]=_,B[O+3]=255}N.putImageData($,0,0)},[f,h,x,z,t,n,s,a,l,T]);let P=v(M=>{let N=M.target.getBoundingClientRect(),$=M.clientX-N.left,B=M.clientY-N.top,{re:H,im:V}=T($,B),U=l(H,V,s);return{re:H,im:V,iterations:U,event:M}},[T,l,s]),L=v(M=>{I.current=!0,F.current={x:M.clientX,y:M.clientY,rMin:f,rMax:h,iMin:x,iMax:z}},[f,h,x,z]),D=v(M=>{if(m&&m(P(M)),!I.current||!F.current)return;let N=F.current,$=M.clientX-N.x,B=M.clientY-N.y,H=(N.rMax-N.rMin)/t,V=(N.iMax-N.iMin)/n;y(N.rMin-$*H),p(N.rMax-$*H),S(N.iMin+B*V),R(N.iMax+B*V)},[t,n,m,P]),W=v(()=>{I.current=!1},[]),A=v(M=>{M.preventDefault();let N=M.deltaY>0?1.15:1/1.15,$=M.target.getBoundingClientRect(),B=M.clientX-$.left,H=M.clientY-$.top,{re:V,im:U}=T(B,H);y(V+(f-V)*N),p(V+(h-V)*N),S(U+(x-U)*N),R(U+(z-U)*N)},[T,f,h,x,z]),k=v(M=>{b&&b(P(M))},[b,P]),w=v(M=>{c&&c(P(M))},[c,P]),E=v(M=>{M.preventDefault(),g&&g(P(M))},[g,P]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:L,onMouseMove:D,onMouseUp:W,onMouseLeave:W,onWheel:A,onClick:k,onDblClick:w,onContextMenu:E})}function Rr(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 rl(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,g=Rr(i,s,c),f=Rr(a,l,c);return{xScale:b,yScale:m,xTicks:g,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function en(e,t,n,r){return X(()=>rl(e,t,n,r),[e,t,n,r])}function $r(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Ir(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 Dr(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:g,yLabel:f,title:y,padding:h=50,animate:p=!1,multiLine:x}=e,S=X(()=>{let L=[...t];if(x)for(let D of x)L.push(...D.data);return L},[t,x]),z=en(S,n,r,h),{xScale:R,yScale:C,xTicks:I,yTicks:F}=z,T=[];if(T.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),b){for(let L=0;L<I.length;L++){let D=R(I[L]);T.push(o("line",{x1:D,y1:h,x2:D,y2:r-h,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${L}`}))}for(let L=0;L<F.length;L++){let D=C(F[L]);T.push(o("line",{x1:h,y1:D,x2:n-h,y2:D,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${L}`}))}}T.push(o("line",{x1:h,y1:r-h,x2:n-h,y2:r-h,stroke:"#374151","stroke-width":1,key:"x-axis"})),T.push(o("line",{x1:h,y1:h,x2:h,y2:r-h,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let L=0;L<I.length;L++){let D=R(I[L]);T.push(o("line",{x1:D,y1:r-h,x2:D,y2:r-h+5,stroke:"#374151",key:`xtick-${L}`})),T.push(o("text",{x:D,y:r-h+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${D}, ${r-h+18})`,key:`xlabel-${L}`},$r(I[L])))}for(let L=0;L<F.length;L++){let D=C(F[L]);T.push(o("line",{x1:h-5,y1:D,x2:h,y2:D,stroke:"#374151",key:`ytick-${L}`})),T.push(o("text",{x:h-10,y:D+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${L}`},$r(F[L])))}function P(L,D,W,A,k,w,E,M,N,$){if(L.length===0)return;let B=[...L].sort((U,J)=>U.x-J.x);if(A){let U=C(z.yMin),J=B.map(_=>`${R(_.x)},${C(_.y)}`).join(" "),ne=R(B[0].x),te=R(B[B.length-1].x),G=`${ne},${U} ${J} ${te},${U}`;T.push(o("polygon",{points:G,fill:k,key:`${$}-area`}))}let V={points:B.map(U=>`${R(U.x)},${C(U.y)}`).join(" "),fill:"none",stroke:D,"stroke-width":W,"stroke-linejoin":"round","stroke-linecap":"round",key:`${$}-line`};if(p?(V["stroke-dasharray"]="1000",V["stroke-dashoffset"]="1000",T.push(o("polyline",V,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):T.push(o("polyline",V)),w)for(let U=0;U<B.length;U++){let J=R(B[U].x),ne=C(B[U].y),te=B[U].shape??N,G=B[U].radius??M,_=`${$}-pt-${U}`;if(p){let O=Ir(te,J,ne,G,E,_,{opacity:0});T.push(o("g",{key:`${_}-g`},O,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else T.push(Ir(te,J,ne,G,E,_))}}if(P(t,i,s,m,c,u,l,a,d,"primary"),x)for(let L=0;L<x.length;L++){let D=x[L];P(D.data,D.color,s,!1,"transparent",u,D.color,D.pointRadius??a,D.pointShape??d,`series-${L}`)}if(x&&x.length>0){let L=[],D=[{color:i,label:"Primary"},...x.map((H,V)=>({color:H.color,label:H.label??`Series ${V+1}`}))],W=h+10,A=16,k=22,w=7.2,E=14,M=6,N=n-h*2-20,$=0,B=0;for(let H=0;H<D.length;H++){let V=D[H].label.length*w,U=E+M+V;$>0&&$+U>N&&($=0,B+=k);let J=W+$,ne=h-30-B;L.push(o("rect",{x:J,y:ne,width:E,height:14,fill:D[H].color,rx:2,key:`legend-rect-${H}`})),L.push(o("text",{x:J+E+M,y:ne+12,"font-size":12,fill:"#374151",key:`legend-text-${H}`},D[H].label)),$+=U+A}T.push(o("g",{key:"legend"},...L))}return g&&T.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},g)),f&&T.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&&T.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"},...T)}function il(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 sl(e,t){let n=t??il(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function Xe(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function tn(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=Xe(e,t,r,a),u=Xe(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=Xe(e,t,n,l),c=Xe(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 nn(e,t){let n=t?.padAngle??0,r=sl(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,g=c+m;l.push({label:b.label,value:b.value,startAngle:c,endAngle:g,percentage:b.value/i*100,color:r[u]}),d=g+n/2}return l}function zr(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:g="#fff",strokeWidth:f=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,S=n-h,z=r-p-x,R=S/2,C=p+z/2,I=Math.min(S,z)/2-10,F=e.outerRadius??I,T=X(()=>nn(t,{padAngle:s,colors:c}),[t,s,c]),P=[];b&&P.push(o("text",{key:"title",x:S/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},b));for(let L=0;L<T.length;L++){let D=T[L],W=tn(R,C,i,F,D.startAngle,D.endAngle);if(P.push(o("path",{key:`slice-${L}`,d:W,fill:D.color,stroke:g,strokeWidth:f})),a||l){let A=(D.startAngle+D.endAngle)/2,k=D.percentage<5,w=k?F+14:i+(F-i)*.65,E=Xe(R,C,w,A-Math.PI/2),M=k?y:"#fff",N=k?11:12,$=[];if(a&&$.push(D.label),l&&$.push(`${D.percentage.toFixed(1)}%`),k){let B=Xe(R,C,F+2,A-Math.PI/2);P.push(o("line",{key:`connector-${L}`,x1:B.x,y1:B.y,x2:E.x,y2:E.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${L}`,x:E.x,y:E.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N,fill:M,pointerEvents:"none"},D.label)),l&&P.push(o("text",{key:`value-${L}`,x:E.x,y:E.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N-1,fill:M,pointerEvents:"none"},`${D.percentage.toFixed(1)}%`))}}if(m&&i>0&&P.push(o("text",{key:"center-label",x:R,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},m)),d){let L=[];if(u==="right"){let D=S+10,W=p+20;for(let A=0;A<T.length;A++){let k=T[A],w=W+A*22;L.push(o("circle",{key:`legend-dot-${A}`,cx:D+6,cy:w,r:6,fill:k.color})),L.push(o("text",{key:`legend-text-${A}`,x:D+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let D=r-x+10;for(let W=0;W<T.length;W++){let A=T[W],k=W%2,w=Math.floor(W/2),E=k*(n/2)+10,M=D+w*22;L.push(o("circle",{key:`legend-dot-${W}`,cx:E+6,cy:M,r:6,fill:A.color})),L.push(o("text",{key:`legend-text-${W}`,x:E+18,y:M,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${A.label} (${A.percentage.toFixed(1)}%)`))}}P.push(...L)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function Tr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Ar(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:g,onPointDoubleClick:f,onPointContextMenu:y,onPointHover:h}=e,[p,x]=j(r[1]),[S,z]=j(0),[R,C]=j(0),[I,F]=j(null),T=t/2+S,P=n/2+R,D=Math.min(t,n)/2-30,W=D/p,A=X(()=>{let G=Math.max(1,Math.ceil(p)),_=[],O=p/G;for(let Y=1;Y<=G;Y++)_.push(O*Y);return _},[p]),k=X(()=>{let G=[];for(let _=0;_<360;_+=30)G.push(_*Math.PI/180);return G},[]),w=X(()=>{if(!i||!l)return[];let G=a??2*Math.PI/s,_=je({start:0,end:2*Math.PI,step:G});return Ct(i,_)},[i,s,a,l]),[E,M]=j([]),N=oe(null);ie(()=>{if(!i||l){M([]);return}let G=a??2*Math.PI/s,_=je({start:0,end:2*Math.PI,step:G});return N.current&&N.current(),N.current=Mt(i,_,200,O=>{M([...O])}),()=>{N.current&&N.current()}},[i,s,a,l]);let $=l?w:E,B=X(()=>{if($.length===0)return"";let G=[];for(let _=0;_<$.length;_++){let O=$[_],Y=O.output;if(Y<0||!isFinite(Y))continue;let{x:q,y:Q}=Tr(Y,O.input,T,P,W);G.push(`${G.length===0?"M":"L"}${q.toFixed(2)},${Q.toFixed(2)}`)}return G.join(" ")},[$,T,P,W]),H=v(G=>{F({x:G.clientX,y:G.clientY,px:S,py:R})},[S,R]),V=v(G=>{I&&(z(I.px+(G.clientX-I.x)),C(I.py+(G.clientY-I.y)))},[I]),U=v(()=>{F(null)},[]),J=v(G=>{G.preventDefault();let _=G.deltaY>0?1.15:1/1.15;x(Math.max(.1,p*_))},[p]),ne=v((G,_,O)=>{if(G)return Y=>G({r:_.r,theta:_.theta,index:O,event:Y})},[]),te=[];if(te.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let G=0;G<A.length;G++){let _=A[G]*W;te.push(o("circle",{cx:T,cy:P,r:_,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${G}`})),te.push(o("text",{x:T+_+2,y:P-4,"font-size":10,fill:"#9ca3af",key:`gl-${G}`},A[G].toFixed(1)))}for(let G=0;G<k.length;G++){let _=k[G],O=A[A.length-1]*W,Y=T+O*Math.cos(_),q=P-O*Math.sin(_);te.push(o("line",{x1:T,y1:P,x2:Y,y2:q,stroke:"#e5e7eb","stroke-width":1,key:`al-${G}`}));let Q=Math.round(_*180/Math.PI),re=T+(O+14)*Math.cos(_),ee=P-(O+14)*Math.sin(_);te.push(o("text",{x:re,y:ee+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${G}`},`${Q}\xB0`))}}te.push(o("line",{x1:T-D,y1:P,x2:T+D,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),te.push(o("line",{x1:T,y1:P-D,x2:T,y2:P+D,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),B&&te.push(o("path",{d:B,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let G=0;G<d.length;G++){let _=d[G],{x:O,y:Y}=Tr(_.r,_.theta,T,P,W);te.push(o("circle",{cx:O,cy:Y,r:b,fill:m,key:`pt-${G}`,style:{cursor:"pointer"},onClick:ne(g,_,G),onDblClick:ne(f,_,G),onContextMenu:ne(y,_,G),onMouseEnter:ne(h,_,G)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:I?"grabbing":"grab"},onMouseDown:H,onMouseMove:V,onMouseUp:U,onMouseLeave:U,onWheel:J},...te)}function on(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 rn(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 sn(e,t){let n=Lr(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=ll(n,al(e,i,s,a))}r++}return n}function Lr(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 al(e,t,n,r){let i=Lr(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 ll(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 an(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 ln(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 ot(e,t=[],n=.3,r=1){let i=on(e),s=rn(e),a=sn(e,t);return{vertices:i.map((d,u)=>{let b=an(a,d),m=ln(b,n);return{id:u,position:d,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function rt(e){return e*(e-1)/2}function Et(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 Fr(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=rt(t),g=1<<t,f=X(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Et(g):e.vertexColors,[g,e.vertexColors]),[y,h]=j(()=>{let M=[];for(let N=0;N<c;N++)M.push(0);return M}),[p,x]=j(!1),S=oe({x:0,y:0}),z=oe([]),R=oe(0);ie(()=>{if(d===0)return;let M=!0,N=()=>{M&&(h($=>{let B=$.slice();for(let H=0;H<B.length;H++)B[H]=(B[H]??0)+d*(1+H*.3);return B}),R.current=requestAnimationFrame(N))};return R.current=requestAnimationFrame(N),()=>{M=!1,cancelAnimationFrame(R.current)}},[d]);let C=X(()=>ot(t,y,l,m),[t,y,l,m]),I=n/2,F=r/2,T=X(()=>C.edges.map(M=>{let N=C.vertices[M.source],$=C.vertices[M.target],B=(N.depth+$.depth)/2;return{...M,avgDepth:B,sv:N,tv:$}}).sort((M,N)=>M.avgDepth-N.avgDepth),[C]),P=X(()=>C.vertices.slice().sort((M,N)=>M.depth-N.depth),[C]),L=v(M=>{let N=M;x(!0),S.current={x:N.clientX,y:N.clientY},z.current=y.slice()},[y]),D=v(M=>{if(!p)return;let N=M,$=(N.clientX-S.current.x)*.01,B=(N.clientY-S.current.y)*.01;h(()=>{let H=z.current.slice();return H.length>0&&(H[0]=(H[0]??0)+$),H.length>1&&(H[1]=(H[1]??0)+B),H})},[p]),W=v(()=>{x(!1)},[]),A=M=>{let N=(M+2)/4;return .3+.7*Math.max(0,Math.min(1,N))},k=M=>{let N=(M+2)/4;return .6+.4*Math.max(0,Math.min(1,N))},w=T.map((M,N)=>{let $=A(M.avgDepth);return o("line",{key:`e-${M.source}-${M.target}`,x1:String(I+M.sv.x),y1:String(F+M.sv.y),x2:String(I+M.tv.x),y2:String(F+M.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String($),"stroke-linecap":"round"})}),E=P.map(M=>{let N=i*k(M.depth),$=f[M.id%f.length]??"#3b82f6",B=[o("circle",{key:`v-${M.id}-circle`,cx:String(I+M.x),cy:String(F+M.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 u&&B.push(o("text",{key:`v-${M.id}-label`,x:String(I+M.x),y:String(F+M.y+N+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},M.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:L,onMouseMove:D,onMouseUp:W,onMouseLeave:W},...w,...E.flat())}function Nr(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=rt(t),[a,l]=j(()=>new Array(s).fill(0));return ie(()=>{if(n===0)return;let u=!0,b=0,m=()=>{u&&(l(c=>c.map((g,f)=>g+n*(1+f*.3))),b=requestAnimationFrame(m))};return b=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(b)}},[n]),{data:X(()=>ot(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Wr(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:cl(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?ul(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=dl(d,b,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function cl(e,t){return"column"}function dl(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 ul(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"}},pl(n),o("span",null,n.label))))}function pl(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 fl(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 gl(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function Br(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return ie(()=>{if(n||typeof window>"u")return;fl(t),gl();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 Or(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 Yr=Pe({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),ml={width:600,height:400},hl={x:30,y:30},bl={top:0,left:0,width:1920,height:1080},cn=1e3;function Hr(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 dn(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 _r(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 un(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function pn(e){let t=e.workspaceBounds??bl,n=e.defaultWindowSize??ml,r=e.cascadeOffset??hl,[i,s]=j([]),a=v(((...L)=>{let D=L[0];s(W=>{if(W.find(B=>B.id===D.id)){let H=un(W)+1,V=W.map(U=>U.id===D.id?{...U,focused:!0,zIndex:H,windowState:U.windowState==="minimized"?"normal":U.windowState}:{...U,focused:!1});return H>cn&&(V=dn(V)),V}let k=D.size??n,w=D.position??Hr(W.length,r,t,k),M=un(W)+1,N={id:D.id,title:D.title,icon:D.icon,position:w,size:k,windowState:"normal",zIndex:M,focused:!0,appProps:D.appProps},$=W.map(B=>({...B,focused:!1}));return $.push(N),M>cn&&($=dn($)),e.onWindowOpen&&e.onWindowOpen(D.id),e.onFocusChange&&e.onFocusChange(D.id),$})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=v(((...L)=>{let D=L[0];S(W=>{if(W[D]){let A={...W};return delete A[D],A}return W}),R(W=>{if(W.has(D)){let A=new Map(W);return A.delete(D),A}return W}),s(W=>{let A=W.find(w=>w.id===D);if(!A)return W;let k=W.filter(w=>w.id!==D);if(A.focused&&k.length>0){let w=_r(k,D);if(w){let E=k.map(M=>({...M,focused:M.id===w.id}));return e.onWindowClose&&e.onWindowClose(D),e.onFocusChange&&e.onFocusChange(w.id),E}}return e.onWindowClose&&e.onWindowClose(D),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=v(((...L)=>{let D=L[0];s(W=>{if(!W.find(M=>M.id===D))return W;let w=un(W)+1,E=W.map(M=>M.id===D?{...M,focused:!0,zIndex:w}:{...M,focused:!1});return w>cn&&(E=dn(E)),e.onFocusChange&&e.onFocusChange(D),E})}),[e.onFocusChange]),u=v(((...L)=>{let D=L[0];s(W=>{let A=W.find(w=>w.id===D);if(!A)return W;let k=W.map(w=>w.id===D?{...w,windowState:"minimized",focused:!1}:w);if(A.focused){let w=_r(k,D);w?(k=k.map(E=>({...E,focused:E.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),b=v(((...L)=>{let D=L[0];s(W=>W.map(A=>A.id===D?{...A,windowState:"maximized"}:A))}),[]),m=v(((...L)=>{let D=L[0];s(W=>W.map(A=>A.id===D?{...A,windowState:"normal"}:A))}),[]),c=v(((...L)=>{let D=L[0],W=L[1];s(A=>A.map(k=>k.id===D?{...k,position:W}:k))}),[]),g=v(((...L)=>{let D=L[0],W=L[1];s(A=>A.map(k=>k.id===D?{...k,size:W}:k))}),[]),f=v(((...L)=>{s(D=>{let W=D.filter(w=>w.windowState!=="minimized");if(W.length===0)return D;let A=W.length,k=new Map;if(A===1)k.set(W[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(W[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(W[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),E=Math.floor(t.height/2);k.set(W[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(W[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:E}}),k.set(W[2].id,{position:{x:t.left+w,y:t.top+E},size:{width:t.width-w,height:t.height-E}})}else{let w=Math.ceil(Math.sqrt(A)),E=Math.ceil(A/w),M=Math.floor(t.width/w),N=Math.floor(t.height/E);for(let $=0;$<W.length;$++){let B=Math.floor($/w),H=$%w;k.set(W[$].id,{position:{x:t.left+H*M,y:t.top+B*N},size:{width:M,height:N}})}}return D.map(w=>{let E=k.get(w.id);return E?{...w,position:E.position,size:E.size,windowState:"normal"}:w})})}),[t]),y=v(((...L)=>{s(D=>{let W=D.filter(w=>w.windowState!=="minimized");if(W.length===0)return D;let A=[...W].sort((w,E)=>w.zIndex-E.zIndex),k=new Map;for(let w=0;w<A.length;w++){let E=Hr(w,r,t,A[w].size);k.set(A[w].id,{position:E,zIndex:w+1})}return D.map(w=>{let E=k.get(w.id);return E?{...w,position:E.position,zIndex:E.zIndex,windowState:"normal"}:w})})}),[r,t]),h=v(((...L)=>{s(D=>{let W=D.map(A=>({...A,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),W})}),[e.onFocusChange]),p=X(()=>{let L=i.find(D=>D.focused);return L?L.id:null},[i]),[x,S]=j({}),[z,R]=j(new Map),C=v(((...L)=>{let D=L[0],W=L[1];S(A=>({...A,[D]:W}))}),[]),I=v(((...L)=>{let D=L[0];S(W=>{let A={...W};return delete A[D],A})}),[]),F=X(()=>p&&x[p]?x[p]:null,[p,x]),T=v(((...L)=>{let D=L[0],W=L[1];R(A=>{let k=new Map(A),w=k.get(D);return k.set(D,{...w,...W}),k})}),[]),P=X(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:b,restoreWindow:m,moveWindow:c,resizeWindow:g,tileWindows:f,cascadeWindows:y,minimizeAll:h,focusedWindowId:p,setMenuBar:C,clearMenuBar:I,activeMenuBar:F,signalDock:T,dockSignals:z}),[i,a,l,d,u,b,m,c,g,f,y,h,p,C,I,F,T,z]);return o(Yr.Provider,{value:P},e.children)}function it(){return Ce(Yr)}var Vr=Pe({appId:""});function Fe(e){let t=X(()=>({appId:e.appId}),[e.appId]);return o(Vr.Provider,{value:t},e.children)}function qe(){return Ce(Vr).appId}var Gr=Pe({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function st(e){let t=oe([]),n=oe([]),r=v(((...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()},g=t.current;for(let y=0;y<g.length;y++){let h=g[y];h.channel===d&&(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=v(((...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=v(((...l)=>{let u={handler:l[0]};return n.current=[...n.current,u],()=>{n.current=n.current.filter(b=>b!==u)}}),[]),a=X(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(Gr.Provider,{value:a},e.children)}function Ne(){let e=Ce(Gr),t=qe(),n=v(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=v(((...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 at(e,t){let n=Ne(),r=oe(t);r.current=t,ie(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var Ur=Pe({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function lt(e){let[t,n]=j(null),[r,i]=j({x:0,y:0}),s=oe(new Map),a=oe(null),l=t!==null,d=v(((...g)=>{let f=g[0];n(f)}),[]),u=v(((...g)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),b=v(((...g)=>{let f=g[0],y=g[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)}}),[]);ie(()=>{if(!l)return;let g=h=>{let p=h;i({x:p.clientX,y:p.clientY});let x=document.elementFromPoint(p.clientX,p.clientY);if(!x)return;let S=null,z=s.current;z.forEach((C,I)=>{let F=document.querySelector(`[data-dropzone-id="${I}"]`);F&&F.contains(x)&&(S=I)});let R=a.current;if(S!==R){if(R){let C=z.get(R);C&&C.onDragLeave&&C.onDragLeave()}if(S){let C=z.get(S);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=S}},f=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",g),document.addEventListener("mouseup",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",y)}},[l,t,u]);let m=X(()=>({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(Ur.Provider,{value:m},e.children,c)}function He(){return Ce(Ur)}function fn(e,t){let n=He(),r=qe(),i=oe(t);i.current=t;let s=v(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 ct(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,ie(()=>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 X(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var xl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],yl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gn(e){return e<10?"0"+String(e):String(e)}function Sl(e,t,n){let r=e.getHours(),i=gn(e.getMinutes()),s=gn(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=gn(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function vl(e){let t=xl[e.getDay()],n=yl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function wl(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=xe(),a=v(()=>{n()},[n]),l=v(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 kl(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=j(new Date);ie(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=X(()=>Sl(i,t,n),[i,t,n]),l=X(()=>vl(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 Cl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=xe(),s=v(()=>{t.onClick&&t.onClick()},[t]),a=v(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 Ml(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=v(()=>{t.onClick(),n()},[t,n]),l=v(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 El(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=xe(),[a,l]=j(!1),d=oe(null),u=v(()=>{l(h=>!h)},[]),b=v(()=>{l(!1)},[]),m=v(h=>{let p=h;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),l(x=>!x)),p.key==="Escape"&&l(!1)},[]);ie(()=>{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"},g=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"},g),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(Ml,{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"}},f,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function Pl(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=xe(),[s,a]=j(!1),l=oe(null),d=v(()=>{a(c=>!c)},[]),u=v(()=>{a(!1)},[]),b=v(c=>{let g=c;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),a(f=>!f)),g.key==="Escape"&&a(!1)},[]);ie(()=>{if(!s)return;let c=g=>{let f=l.current;f&&!f.contains(g.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,g)=>c.divider?o("div",{key:"div-"+String(g),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(g),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 mn(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",g=[];if(n&&g.push(o(wl,{key:"activities",label:n.label,onClick:n.onClick})),t&&g.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++)g.push(o(Pl,{key:"appmenu-"+String(S),menu:r.menus[S]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...g),y=[];y.push(o(kl,{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 S=l.map(z=>o(Cl,{key:z.id,indicator:z}));p.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...S))}d&&p.push(o(El,{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"}},f,h,x)}function Rl(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var jr=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function $l(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return jr[Math.abs(t)%jr.length]}function Il(e){return e>99?"99+":String(e)}function Dl(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function zl(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 Tl(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 Al(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=j(!1),u=t.disabled??!1,b=v(()=>{u||d(!0)},[u]),m=v(()=>{d(!1)},[]),c=v(()=>{!u&&s&&s(t.id)},[u,s,t.id]),g=v(R=>{if(!u&&a){let C=R;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),f=`${n}px`,y=Rl(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:$l(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,p=t.active?o("span",{style:{...Tl(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,S=l?o("div",{role:"tooltip",style:{position:"absolute",...zl(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,z={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:z,"aria-label":Dl(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:g,onMouseEnter:b,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,h,p,x,S)}function hn(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]=j(!s),c=oe(null),g=v(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),m(!0))},[s]),f=v(()=>{s&&(c.current=setTimeout(()=>{m(!1)},300))},[s]),y=v(z=>{let R=z,C=R.target,I=C.closest('[role="toolbar"]');if(!I)return;let F=Array.from(I.querySelectorAll("button[data-dock-item-id]")),T=F.indexOf(C);if(T<0)return;let P=n==="vertical",L=P?"ArrowDown":"ArrowRight",D=P?"ArrowUp":"ArrowLeft";if(R.key===L){R.preventDefault();let W=F[T+1];W&&W.focus()}else if(R.key===D){R.preventDefault();let W=F[T-1];W&&W.focus()}else R.key==="Home"?(R.preventDefault(),F[0]?.focus()):R.key==="End"?(R.preventDefault(),F[F.length-1]?.focus()):(R.key==="Enter"||R.key===" ")&&(R.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 z=0;z<t.length;z++){if(a&&z===t.length-1&&t.length>1){let R=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-${z}`,style:R,"aria-hidden":"true",role:"separator"}))}x.push(o(Al,{key:t[z].id,item:t[z],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let S=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:g,onMouseLeave:f,onKeyDown:y},S,...x,u??null)}var Ll="#2c001e";function bn(e){let{backgroundColor:t=Ll,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,b=v(p=>{let x=p;x.target===x.currentTarget&&a&&a()},[a]),m=v(p=>{let x=p;x.target===x.currentTarget&&l&&l()},[l]),c=X(()=>{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]),g=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=[];g&&y.push(o("div",{className:"desktop-background__image-overlay",style:g,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:f},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(kt,{items:s},h):h}var Fl={width:200,height:150},Nl={x:50,y:50},Wl={width:400,height:300},ye=8,xn=20,Bl={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 dt(e){let{id:t,title:n,icon:r,defaultPosition:i=Nl,defaultSize:s=Wl,minSize:a=Fl,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:b="normal",focused:m=!0,zIndex:c,onClose:g,onMinimize:f,onMaximize:y,onFocus:h,onMove:p,onResize:x,children:S}=e,[z,R]=j(i.x),[C,I]=j(i.y),[F,T]=j(s.width),[P,L]=j(s.height),[D,W]=j(!1),[A,k]=j(!1),[w,E]=j(null),M=oe(null),N=oe(null),$=oe(null),B=v((Z,le)=>{let de=Math.max(Z,a.width),ce=Math.max(le,a.height);return l&&(de=Math.min(de,l.width),ce=Math.min(ce,l.height)),{width:de,height:ce}},[a,l]),H=v(()=>{let Z=$.current;return Z&&Z.parentElement?{width:Z.parentElement.clientWidth,height:Z.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),V=v((Z,le,de,ce)=>{let ue=H(),fe=Math.max(0,Math.min(Z,ue.width-de)),ge=Math.max(0,Math.min(le,ue.height-ce));return{x:fe,y:ge}},[H]),U=v(Z=>{if(!u||b==="maximized")return;let le=Z;le.target.closest("button")||(le.preventDefault(),M.current={startMouseX:le.clientX,startMouseY:le.clientY,startPosX:z,startPosY:C},W(!0))},[u,b,z,C]),J=v(Z=>{Z.target.closest("button")||y&&y()},[y]);ie(()=>{if(!D)return;let Z=de=>{let ce=de,ue=M.current;if(!ue)return;let fe=ce.clientX-ue.startMouseX,ge=ce.clientY-ue.startMouseY,be=ue.startPosX+fe,ke=ue.startPosY+ge,Me=H();be=Math.max(0,Math.min(be,Me.width-F)),ke=Math.max(0,Math.min(ke,Me.height-P)),R(be),I(ke),ce.clientX<=xn?E("left"):ce.clientX>=Me.width-xn?E("right"):ce.clientY<=xn?E("top"):E(null)},le=de=>{let ce=de;W(!1);let ue=H();if(w==="left"){R(0),I(0),T(Math.floor(ue.width/2)),L(ue.height),E(null),p&&p({x:0,y:0}),x&&x({width:Math.floor(ue.width/2),height:ue.height});return}if(w==="right"){let ge=Math.floor(ue.width/2);R(ge),I(0),T(ge),L(ue.height),E(null),p&&p({x:ge,y:0}),x&&x({width:ge,height:ue.height});return}if(w==="top"){E(null),y&&y();return}E(null);let fe=M.current;if(fe&&p){let ge=ce.clientX-fe.startMouseX,be=ce.clientY-fe.startMouseY,ke=fe.startPosX+ge,Me=fe.startPosY+be;ke=Math.max(0,Math.min(ke,ue.width-F)),Me=Math.max(0,Math.min(Me,ue.height-P)),p({x:ke,y:Me})}M.current=null};return document.addEventListener("mousemove",Z),document.addEventListener("mouseup",le),()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",le)}},[D,w,F,P,H,p,x,y]);let ne=v(Z=>le=>{if(!d||b!=="normal")return;let de=le;de.preventDefault(),de.stopPropagation(),N.current={direction:Z,startMouseX:de.clientX,startMouseY:de.clientY,startPosX:z,startPosY:C,startWidth:F,startHeight:P},k(!0)},[d,b,z,C,F,P]);ie(()=>{if(!A)return;let Z=de=>{let ce=de,ue=N.current;if(!ue)return;let fe=ce.clientX-ue.startMouseX,ge=ce.clientY-ue.startMouseY,be=ue.direction,ke=ue.startWidth,Me=ue.startHeight,_t=ue.startPosX,Yt=ue.startPosY;be.includes("e")&&(ke=ue.startWidth+fe),be.includes("w")&&(ke=ue.startWidth-fe,_t=ue.startPosX+fe),be.includes("s")&&(Me=ue.startHeight+ge),be.includes("n")&&(Me=ue.startHeight-ge,Yt=ue.startPosY+ge);let mt=B(ke,Me);be.includes("w")&&(_t=ue.startPosX+(ue.startWidth-mt.width)),be.includes("n")&&(Yt=ue.startPosY+(ue.startHeight-mt.height)),T(mt.width),L(mt.height),R(_t),I(Yt)},le=()=>{k(!1),x&&x({width:F,height:P}),N.current=null};return document.addEventListener("mousemove",Z),document.addEventListener("mouseup",le),()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",le)}},[A,F,P,B,x]),ie(()=>{if(!m||!g)return;let Z=le=>{le.key==="Escape"&&g()};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[m,g]);let te=v(Z=>{h&&h()},[h]);if(b==="minimized")return null;let G=b==="maximized",_=X(()=>{let Z={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:G?"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:G?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return G?(Z.top="0",Z.left="0",Z.width="100%",Z.height="100%"):(Z.top=`${C}px`,Z.left=`${z}px`,Z.width=`${F}px`,Z.height=`${P}px`),c!==void 0&&(Z.zIndex=String(c)),D&&(Z.cursor="grabbing",Z.userSelect="none"),Z},[G,z,C,F,P,c,m,D]),O=X(()=>{let Z={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&&!G?"grab":"default",opacity:m?"1":"0.6"};return D&&(Z.cursor="grabbing"),Z},[m,u,G,D]),Y={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},q={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 re=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:{...q,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:Z=>{Z.stopPropagation(),f&&f()}}),o("button",{type:"button","aria-label":G?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...q,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:Z=>{Z.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...q,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:Z=>{Z.stopPropagation(),g&&g()}}));Q.push(re);let ee=[];if(d&&!G){let Z=["n","s","e","w","ne","nw","se","sw"];for(let le=0;le<Z.length;le++){let de=Z[le],ce={position:"absolute",zIndex:"1"};de==="n"?(ce.top="0",ce.left=`${ye}px`,ce.right=`${ye}px`,ce.height=`${ye}px`):de==="s"?(ce.bottom="0",ce.left=`${ye}px`,ce.right=`${ye}px`,ce.height=`${ye}px`):de==="e"?(ce.top=`${ye}px`,ce.right="0",ce.bottom=`${ye}px`,ce.width=`${ye}px`):de==="w"?(ce.top=`${ye}px`,ce.left="0",ce.bottom=`${ye}px`,ce.width=`${ye}px`):de==="ne"?(ce.top="0",ce.right="0",ce.width=`${ye}px`,ce.height=`${ye}px`):de==="nw"?(ce.top="0",ce.left="0",ce.width=`${ye}px`,ce.height=`${ye}px`):de==="se"?(ce.bottom="0",ce.right="0",ce.width=`${ye}px`,ce.height=`${ye}px`):de==="sw"&&(ce.bottom="0",ce.left="0",ce.width=`${ye}px`,ce.height=`${ye}px`),ce.cursor=Bl[de],ee.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${de}`,style:ce,onMouseDown:ne(de)}))}}let se=null;if(w){let Z={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"?(Z.top="0",Z.left="0",Z.width="50%",Z.height="100%"):w==="right"?(Z.top="0",Z.right="0",Z.width="50%",Z.height="100%"):w==="top"&&(Z.top="0",Z.left="0",Z.width="100%",Z.height="100%"),se=o("div",{className:"draggable-window__snap-preview",style:Z})}let ae=[];for(let Z=0;Z<ee.length;Z++)ae.push(ee[Z]);ae.push(o("div",{className:"draggable-window__title-bar",style:O,onMouseDown:U,onDblClick:J,role:"toolbar","aria-label":`${n} window controls`},...Q)),ae.push(o("div",{className:"draggable-window__body",style:Y},S));let K=[o("div",{ref:$,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${b}`,style:_,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:te},...ae)];return se&&K.push(se),K.length===1?K[0]:o("div",{style:{display:"contents"}},...K)}var Ol=["File","Edit","View","Insert","Format","Tools","Help"],Xr={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"}}],_l=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],Yl=["1","2","3","4","5","6","7"],Vl={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Gl(){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 qr(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function Pt(e){let[t,n]=j(!1),[r,i]=j(!1),[s,a]=j(!1),[l,d]=j(-1),[u,b]=j(""),[m,c]=j(-1),[g,f]=j(0),[y,h]=j("3"),p=oe(null),x=v(()=>{document.execCommand("bold",!1),n(Y=>!Y),p.current&&p.current.focus()},[]),S=v(()=>{document.execCommand("italic",!1),i(Y=>!Y),p.current&&p.current.focus()},[]),z=v(()=>{document.execCommand("underline",!1),a(Y=>!Y),p.current&&p.current.focus()},[]),R={bold:x,italic:S,underline:z},C={bold:t,italic:r,underline:s},I=v(Y=>{document.execCommand(Y,!1),p.current&&p.current.focus()},[]),F=v(Y=>{document.execCommand("fontSize",!1,Y),h(Y),p.current&&p.current.focus()},[]),T=v(Y=>{c(q=>q===Y?-1:Y)},[]),P=v(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="",f(0));break;default:break}c(-1),p.current&&p.current.focus()},[]),L=v(()=>{if(p.current){let Y=p.current.textContent??"";f(qr(Y))}},[]),D=v(()=>{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"}),[]),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"},E={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},M={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(()=>Gl(),[]),B=e.content??"Start typing...",H=qr(B),V=g>0?g:H;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 J={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"},ne={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function te(Y,q){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",...q??{}}}let G={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"},_={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"},O=Ol.map((Y,q)=>{let Q=[Y];return m===q&&Xr[Y]&&Q.push(o("div",{key:"dropdown",style:J,className:"word-processor__menu-dropdown"},...Xr[Y].map((re,ee)=>o("button",{key:String(ee),style:ne,onClick:se=>{se.stopPropagation(),P(re.action)},role:"menuitem"},re.label)))),o("button",{key:String(q),style:U(q),role:"menuitem","aria-label":Y,onClick:()=>T(q),onMouseEnter:()=>{d(q)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:W},o("div",{className:"word-processor__menu-bar",style:A,role:"menubar"},...O),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:G,"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(Y=>o("button",{key:Y.id,style:te(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:R[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:_,"aria-label":"Font size",value:y,onChange:Y=>{let q=Y.target;F(q.value)}},...Yl.map(Y=>o("option",{key:Y,value:Y},Vl[Y])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},..._l.map((Y,q)=>o("button",{key:String(q),style:te(`align-${q}`),title:Y.label,"aria-label":Y.label,onClick:()=>I(Y.command),onMouseEnter:()=>b(`align-${q}`),onMouseLeave:()=>b("")},Y.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...$),o("main",{className:"word-processor__document-area",style:E,onClick:D},o("div",{className:"word-processor__page",style:M,contentEditable:"true",ref:p,onInput:L,suppressContentEditableWarning:!0},B)),o("div",{className:"word-processor__status-bar",style:N},o("span",null,"Page 1 of 1"),o("span",null,`${V} words`),o("span",null,"100%")))}var Ul=["File","Edit","Selection","View","Go","Run","Terminal","Help"],Kr={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"}]},Zr=[{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}],Sn={"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"]',"}"]},Jr=Sn["App.ts"],jl=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"]),Xl=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),Qr="#569cd6",ql="#ce9178",Kl="#4ec9b0",Zl="#6a9955",Jl="#dcdcaa",yn="#d4d4d4",Ql="#d4d4d4",ec="#b5cea8";function tc(e){if(!e.trim())return[{text:"\xA0",color:yn}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:Zl});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:ql}),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:ec}),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=yn;jl.has(i)?l=Qr:Xl.has(i)?l=Kl:a?l=Jl:(i==="true"||i==="false")&&(l=Qr),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:yn}),n=r;continue}t.push({text:e[n],color:Ql}),n++}return t}function Rt(e){let[t,n]=j("App.ts"),[r,i]=j({src:!0,components:!0,hooks:!0}),[s,a]=j(-1),[l,d]=j(Jr.length),u=oe(null),b=v(O=>{n(O);let Y=Sn[O];Y&&d(Y.length)},[]),m=v(O=>{i(Y=>{let q={},Q=Object.keys(Y);for(let re=0;re<Q.length;re++)q[Q[re]]=Y[Q[re]];return q[O]=!Y[O],q})},[]),c=v(O=>{a(Y=>Y===O?-1:O)},[]),g=v(O=>{switch(O){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":u.current&&(u.current.textContent="",d(1));break;default:break}a(-1),u.current&&u.current.focus()},[]),f=v(()=>{if(u.current){let Y=(u.current.textContent??"").split(`
8
+ `);d(Math.max(Y.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)"},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"},S={...x,backgroundColor:"rgba(255,255,255,0.1)"},z={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},R={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"},I={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},F={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},T={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},P=(O,Y,q)=>({padding:"3px 8px",paddingLeft:`${12+O*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:q?"rgba(255,255,255,0.08)":"transparent"}),L={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},D={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"},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"},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"},M={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=Sn[t]??Jr,V=H.map((O,Y)=>{let q=tc(O),Q=[],re=0;for(let ee of q)Q.push(o("span",{key:String(re++),style:{color:ee.color}},ee.text));return o("div",{key:String(Y),style:{minHeight:"20px"}},...Q)}),U=Math.max(l,H.length),J=[];for(let O=0;O<U;O++)J.push(o("div",{key:String(O)},String(O+1)));let ne=O=>{if(!O.parent)return!0;if(!r[O.parent])return!1;let Y=Zr.find(q=>q.name===O.parent&&q.isFolder);return Y?ne(Y):!0},te=Ul.map((O,Y)=>{let q=[O],Q=s===Y;return Q&&Kr[O]&&q.push(o("div",{key:"dropdown",style:z,className:"ide__menu-dropdown"},...Kr[O].map((re,ee)=>o("button",{key:String(ee),style:R,onClick:se=>{se.stopPropagation(),g(re.action)},role:"menuitem"},re.label)))),o("button",{key:String(Y),style:Q?S:x,role:"menuitem","aria-label":O,onClick:()=>c(Y)},...q)}),_=Zr.map((O,Y)=>{if(!ne(O))return null;let q=!O.isFolder&&O.name===t,Q=O.isFolder?r[O.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(Y),style:P(O.indent,O.isFolder,q),onClick:O.isFolder?()=>m(O.name):()=>b(O.name)},Q,O.name)}).filter(O=>O!==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"},...te),o("div",{style:C},o("nav",{className:"ide__sidebar",style:I,"aria-label":"File explorer"},o("div",{style:T},"Explorer"),..._),o("div",{style:F}),o("div",{style:L},o("div",{style:D},o("button",{style:W,"aria-label":t},t)),o("div",{style:A},o("div",{style:k,"aria-hidden":"true"},...J),o("code",{style:w,contentEditable:"true",ref:u,onInput:f,suppressContentEditableWarning:!0},...V))),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((O,Y)=>o("div",{key:String(Y),style:{height:"2px",backgroundColor:O.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,O.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:M},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 nc=[{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]}],ei=[{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}],ti=[{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}],ni=[{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}],oc=[{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}],rc=[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],oi=[{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}],ri=[{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}],ii=["09:30","10:00","10:30","11:00","11:30","12:00"];function ic(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ut(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"},$t={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"},It={cursor:"default",transition:"background-color 0.1s"};function sc(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 ac(e,t){let u=Math.min(...e),b=Math.max(...e),m=b-u||1,c=310/(e.length-1),g=e.map((C,I)=>{let F=40+I*c,T=15+(1-(C-u)/m)*120;return{x:F,y:T}}),f=g.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+g.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${g[g.length-1].x.toFixed(1)},135 Z`,h=[];for(let C=1;C<e.length;C++){let I=e[C]>=e[C-1]?"#00c853":"#ff1744";h.push(o("line",{key:String(C),x1:String(g[C-1].x.toFixed(1)),y1:String(g[C-1].y.toFixed(1)),x2:String(g[C].x.toFixed(1)),y2:String(g[C].y.toFixed(1)),stroke:I,strokeWidth:"2",strokeLinecap:"round"}))}let p=[];for(let C=0;C<5;C++){let I=15+C/4*120,F=b-C/4*m;p.push(o("line",{key:`g${C}`,x1:String(40),y1:String(I.toFixed(1)),x2:String(350),y2:String(I.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),p.push(o("text",{key:`yl${C}`,x:String(36),y:String((I+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},$e(F)))}let x=[],S=Math.min(ii.length,e.length),z=(e.length-1)/(S-1);for(let C=0;C<S;C++){let F=40+Math.round(C*z)*c;x.push(o("text",{key:`tl${C}`,x:String(F.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},ii[C]))}let R="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:R,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(#${R})`}),...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 lc(){let e=Math.max(...ei.map(t=>t.qty),...ti.map(t=>t.qty));return o("div",{style:Ke},o("div",{style:Ze},"Order Book"),o("table",{style:$t},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,...ei.map((t,n)=>{let r=ti[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:It},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"}},ut(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?ut(r.qty):""))}))))}function cc(e){return o("div",{style:Ke},o("div",{style:Ze},"Watchlist"),o("table",{style:$t},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,...nc.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:It},o("td",{style:{...we,fontWeight:"600",color:"#ffffff"}},t.symbol,sc(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"}},ic(t.volume)))}))))}function dc(){let e=ni.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:$t},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,...ni.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...It,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 uc(){return o("div",{style:Ke},o("div",{style:Ze},"Recent Trades"),o("table",{style:$t},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,...oc.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:It},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"}},ut(e.qty)),o("td",{style:{...we,fontFamily:"monospace"}},$e(e.price)))}))))}function pc(){let e=Math.max(...oi.map(n=>n.volume),...ri.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"}},...oi.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"}},ut(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...ri.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"}},ut(n.volume))))))}function Dt(e){let[t,n]=j(0),[r,i]=j("--:--:--"),[s,a]=j(!0);ie(()=>{let g=setInterval(()=>{n(f=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(g)},[]),ie(()=>{let g=()=>{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}`)};g();let f=setInterval(g,1e3);return()=>clearInterval(f)},[]),ie(()=>{let g=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(g)},[]);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"}),[]),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},ac(rc,m),lc(),cc(t),dc(),uc(),pc()))}var Je=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function vn(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,[g,f]=j(""),y=v(I=>{let F=I.target.value;f(F),c(F)},[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"},S={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},z={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},R={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=Je.map(I=>{let F=I===r,T=I===i,P=()=>{F&&b?b(T?null:I):u(I)},L="1px solid rgba(0,0,0,0.15)";return T?L="3px solid #ef4444":F&&(L="2px solid #3b82f6"),o("button",{key:I,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:I,border:L,cursor:"pointer",padding:"0",flexShrink:"0",opacity:T?"1":i?"0.5":"1"},onClick:P,"aria-label":T?`Clear color filter ${I}`:`Select color ${I}`,"data-testid":`color-swatch-${I}`})});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:z}),o("button",{style:p,onClick:l,"data-testid":"btn-zoom-out","aria-label":"Zoom out"},"-"),o("span",{style:S,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:z}),...C,o("div",{style:z}),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:z}),o("input",{type:"text",placeholder:"Search cards...",value:g,onInput:y,style:R,"data-testid":"search-input","aria-label":"Search cards"}))}var si={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},fc=Je,gc=[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"},{label:"Critical",value:"critical"}];function wn(e){let{card:t,selected:n,onSelect:r,onMove:i,onResize:s,onDelete:a,onDoubleClick:l,onDragStart:d,onDuplicate:u,onChangeColor:b,onChangePriority:m,onAnchorDragStart:c}=e,[g,f]=j(!1),[y,h]=j(null),[p,x]=j(!1),[S,z]=j(!1),R=oe(null),C=oe(null),I=oe(null),F=oe(null),T=t.priority?si[t.priority]||"#94a3b8":"transparent",P=v(K=>{let Z=K;Z.preventDefault(),Z.stopPropagation(),h({x:Z.clientX,y:Z.clientY}),x(!1),z(!1)},[]),L=v(()=>{h(null),x(!1),z(!1)},[]);ie(()=>{if(!y)return;let K=()=>{L()},Z=setTimeout(()=>{document.addEventListener("click",K),document.addEventListener("contextmenu",K)},0);return()=>{clearTimeout(Z),document.removeEventListener("click",K),document.removeEventListener("contextmenu",K)}},[y,L]);let D=v(K=>{K.stopPropagation(),L(),u&&u(t.id)},[t.id,u,L]),W=v(K=>{K.stopPropagation(),L(),a(t.id)},[t.id,a,L]),A=v(()=>{x(!0),z(!1)},[]),k=v(()=>{z(!0),x(!1)},[]),w=v(K=>{L(),b&&b(t.id,K)},[t.id,b,L]),E=v(K=>{L(),m&&m(t.id,K)},[t.id,m,L]),M=v((K,Z)=>{let le=Z;if(le.preventDefault(),le.stopPropagation(),c){let de=t.position.x+t.size.width/2,ce=t.position.y+t.size.height/2,ue=de,fe=ce;K==="top"?(ue=de,fe=t.position.y):K==="bottom"?(ue=de,fe=t.position.y+t.size.height):K==="left"?(ue=t.position.x,fe=ce):K==="right"&&(ue=t.position.x+t.size.width,fe=ce),c(t.id,K,ue,fe)}},[t.id,t.position,t.size,c]),N=v(K=>{let Z=K,le=Z.target;if(le.dataset&&(le.dataset.role==="delete"||le.dataset.role==="resize"||le.dataset.role==="anchor"))return;Z.preventDefault(),Z.stopPropagation(),r(t.id),R.current={x:Z.clientX,y:Z.clientY,cardX:t.position.x,cardY:t.position.y};let de=ue=>{let fe=ue;if(!R.current)return;let ge=fe.clientX-R.current.x,be=fe.clientY-R.current.y;i(t.id,{x:R.current.cardX+ge,y:R.current.cardY+be})},ce=()=>{R.current=null,document.removeEventListener("mousemove",de),document.removeEventListener("mouseup",ce)};document.addEventListener("mousemove",de),document.addEventListener("mouseup",ce),d&&d(t.id,K)},[t.id,t.position.x,t.position.y,r,i,d]),$=v(K=>{let Z=K;Z.preventDefault(),Z.stopPropagation(),C.current={x:Z.clientX,y:Z.clientY,w:t.size.width,h:t.size.height};let le=ce=>{let ue=ce;if(!C.current)return;let fe=ue.clientX-C.current.x,ge=ue.clientY-C.current.y,be=Math.max(120,C.current.w+fe),ke=Math.max(80,C.current.h+ge);s(t.id,{width:be,height:ke})},de=()=>{C.current=null,document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",de)};document.addEventListener("mousemove",le),document.addEventListener("mouseup",de)},[t.id,t.size.width,t.size.height,s]),B=v(K=>{K.preventDefault(),K.stopPropagation(),l(t.id)},[t.id,l]),H=v(K=>{K.preventDefault(),K.stopPropagation(),a(t.id)},[t.id,a]),V={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 ${T}`,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"},U={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"},ne={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:g?"block":"none",border:"none",padding:"0"},te={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},G=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((K,Z)=>o("span",{key:String(Z),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},K))):null,_={position:"absolute",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #ffffff",cursor:"crosshair",display:g?"block":"none",zIndex:"10",boxSizing:"border-box"},O={..._,top:"-5px",left:"50%",transform:"translateX(-50%)"},Y={..._,top:"50%",right:"-5px",transform:"translateY(-50%)"},q={..._,bottom:"-5px",left:"50%",transform:"translateX(-50%)"},Q={..._,top:"50%",left:"-5px",transform:"translateY(-50%)"},re={position:"fixed",left:y?`${y.x}px`:"0",top:y?`${y.y}px`:"0",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"},ee={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},se={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"},ae=y?o("div",{ref:F,className:"card-context-menu",style:re,"data-testid":`context-menu-${t.id}`,role:"menu","aria-label":"Card context menu"},o("div",{style:ee,onClick:D,role:"menuitem","data-testid":`context-menu-duplicate-${t.id}`},"Duplicate"),o("div",{style:ee,onClick:W,role:"menuitem","data-testid":`context-menu-delete-${t.id}`},"Delete"),o("div",{style:{...ee,position:"relative"},onMouseEnter:A,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-color-${t.id}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),p?o("div",{style:se,role:"menu","data-testid":`context-submenu-color-${t.id}`},...fc.map(K=>o("div",{key:K,style:{...ee,gap:"8px"},onClick:Z=>{Z.stopPropagation(),w(K)},role:"menuitem","data-testid":`context-color-${K}`},o("span",{style:{width:"14px",height:"14px",borderRadius:"50%",backgroundColor:K,border:"1px solid rgba(0,0,0,0.15)",display:"inline-block",flexShrink:"0"}}),K===t.color?"\u2713":""))):null),o("div",{style:{...ee,position:"relative"},onMouseEnter:k,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-priority-${t.id}`},"Set Priority",o("span",{style:{marginLeft:"8px"}},"\u25B6"),S?o("div",{style:se,role:"menu","data-testid":`context-submenu-priority-${t.id}`},...gc.map(K=>o("div",{key:K.value,style:{...ee,gap:"8px"},onClick:Z=>{Z.stopPropagation(),E(K.value)},role:"menuitem","data-testid":`context-priority-${K.value}`},o("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:si[K.value]||"#94a3b8",display:"inline-block",flexShrink:"0"}}),K.label,K.value===t.priority?" \u2713":""))):null)):null;return o("div",{ref:I,className:"board-card",style:V,onMouseDown:N,onDblClick:B,onContextMenu:P,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),"data-card-id":t.id,"data-testid":`card-${t.id}`,role:"button","aria-label":`Card: ${t.title}`,tabIndex:0},o("div",{style:U},t.title||"Untitled"),o("div",{style:J},t.description||""),G,o("button",{style:ne,"data-role":"delete","data-testid":`card-delete-${t.id}`,onClick:H,"aria-label":`Delete ${t.title}`,tabIndex:-1},"\xD7"),o("div",{style:te,"data-role":"resize",onMouseDown:$,"aria-label":"Resize card"}),o("div",{style:O,"data-role":"anchor","data-anchor":"top","data-testid":`anchor-top-${t.id}`,onMouseDown:K=>M("top",K),"aria-label":"Connection anchor top"}),o("div",{style:Y,"data-role":"anchor","data-anchor":"right","data-testid":`anchor-right-${t.id}`,onMouseDown:K=>M("right",K),"aria-label":"Connection anchor right"}),o("div",{style:q,"data-role":"anchor","data-anchor":"bottom","data-testid":`anchor-bottom-${t.id}`,onMouseDown:K=>M("bottom",K),"aria-label":"Connection anchor bottom"}),o("div",{style:Q,"data-role":"anchor","data-anchor":"left","data-testid":`anchor-left-${t.id}`,onMouseDown:K=>M("left",K),"aria-label":"Connection anchor left"}),ae)}function kn(e){let{card:t,onSave:n,onClose:r}=e,[i,s]=j(t.title),[a,l]=j(t.description),d=oe(null),u=oe(null);ie(()=>{d.current&&(d.current.focus(),d.current.select())},[]);let b=v(()=>{n(t.id,{title:i,description:a}),r()},[t.id,i,a,n,r]),m=v(R=>{R.key==="Escape"&&b()},[b]),c=v(R=>{R.target===u.current&&b()},[b]),g=v(R=>{s(R.target.value)},[]),f=v(R=>{l(R.target.value)},[]),y=v(R=>{let C=R;if(C.key==="Tab"){C.preventDefault();let I=C.target.parentElement?.querySelector("textarea");I&&I.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"},S={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"},z={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:g,onKeyDown:y,style:x,placeholder:"Card title","data-testid":"card-editor-title","aria-label":"Card title"}),o("textarea",{value:a,onInput:f,onKeyDown:m,style:S,placeholder:"Description...","data-testid":"card-editor-description","aria-label":"Card description"}),o("button",{style:z,onClick:b,"data-testid":"card-editor-save"},"Done")))}function ai(e){return{x:e.position.x+e.size.width/2,y:e.position.y+e.size.height/2}}function mc(e){switch(e){case"dashed":return"8,4";case"dotted":return"2,4";default:return"none"}}function Cn(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=v(m=>{i(m)},[i]),u=[];for(let m=0;m<t.length;m++){let c=t[m],g=l.get(c.fromCardId),f=l.get(c.toCardId);if(!g||!f)continue;let y=ai(g),h=ai(f),p=c.id===r,x=p?"#3b82f6":"#94a3b8",S=mc(c.style);if(u.push(o("line",{key:`hit-${c.id}`,x1:String(y.x),y1:String(y.y),x2:String(h.x),y2:String(h.y),stroke:"transparent","stroke-width":"12",style:{cursor:"pointer"},onClick:()=>d(c.id),"data-testid":`connection-hit-${c.id}`})),u.push(o("line",{key:c.id,x1:String(y.x),y1:String(y.y),x2:String(h.x),y2:String(h.y),stroke:x,"stroke-width":p?"3":"2","stroke-dasharray":S,"pointer-events":"none","data-testid":`connection-${c.id}`})),c.label){let z=(y.x+h.x)/2,R=(y.y+h.y)/2;u.push(o("text",{key:`label-${c.id}`,x:String(z),y:String(R-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 Qe=20,et=5e3;function ci(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Mn(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,S=p.position.y+p.size.height;x>l&&(l=x),S>d&&(d=S)}let u=l-s+i*2,b=d-a+i*2,m=t/u,c=n/b,g=Math.max(.25,Math.min(4,Math.min(m,c))),f=-s*g+(t-(l-s)*g)/2,y=-a*g+(n-(d-a)*g)/2;return{panX:f,panY:y,zoom:g}}var li=0;function hc(){return li++,`conn-${Date.now()}-${li}`}function En(e){let{state:t,dispatch:n,searchQuery:r,gridEnabled:i,selectedCardId:s,onSelectCard:a,colorFilter:l}=e,{cards:d,connections:u,viewport:b}=t,[m,c]=j(null),[g,f]=j(null),y=oe(null),h=oe(!1),p=oe(null),[x,S]=j(null),z=oe(x);z.current=x;let R=v(_=>{let O=_;if(O.target.closest(".board-card"))return;let q=O.button===1,Q=O.button===0&&O.shiftKey;q||Q?(O.preventDefault(),h.current=!0,p.current={x:O.clientX,y:O.clientY,panX:b.panX,panY:b.panY}):O.button===0&&(a(null),f(null))},[b.panX,b.panY,a]);ie(()=>{let _=Y=>{if(!h.current||!p.current)return;let q=Y,Q=q.clientX-p.current.x,re=q.clientY-p.current.y;n({type:"PAN",panX:p.current.panX+Q,panY:p.current.panY+re})},O=()=>{h.current=!1,p.current=null};return document.addEventListener("mousemove",_),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",O)}},[n]);let C=v(_=>{let O=_;if(!O.ctrlKey)return;O.preventDefault();let Y=O.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:b.zoom+Y})},[b.zoom,n]);ie(()=>{let _=O=>{let Y=O;(Y.key==="Delete"||Y.key==="Backspace")&&(g?(n({type:"REMOVE_CONNECTION",connectionId:g}),f(null)):s&&(n({type:"REMOVE_CARD",cardId:s}),a(null)))};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[g,s,n,a]);let I=v(_=>{a(_),f(null)},[a]),F=v((_,O)=>{let Y=O;i&&(Y={x:Math.round(O.x/Qe)*Qe,y:Math.round(O.y/Qe)*Qe}),n({type:"MOVE_CARD",cardId:_,position:Y})},[n,i]),T=v((_,O)=>{n({type:"RESIZE_CARD",cardId:_,size:O})},[n]),P=v(_=>{n({type:"REMOVE_CARD",cardId:_}),s===_&&a(null)},[n,s,a]),L=v(_=>{c(_)},[]),D=v((_,O)=>{n({type:"UPDATE_CARD",cardId:_,updates:O})},[n]),W=v(()=>{c(null)},[]),A=v(_=>{f(_),a(null)},[a]),k=v(_=>{n({type:"REMOVE_CONNECTION",connectionId:_}),f(null)},[n]),w=v(_=>{let O=`card-${Date.now()}-dup`;n({type:"DUPLICATE_CARD",cardId:_,newId:O})},[n]),E=v((_,O)=>{n({type:"UPDATE_CARD",cardId:_,updates:{color:O}})},[n]),M=v((_,O)=>{n({type:"UPDATE_CARD",cardId:_,updates:{priority:O}})},[n]),N=v((_,O,Y,q)=>{S({fromCardId:_,fromAnchor:O,fromX:Y,fromY:q,toX:Y,toY:q})},[]);ie(()=>{if(!z.current)return;let _=Y=>{let q=Y;if(!z.current)return;let Q=ci(q.clientX,q.clientY,b);S(re=>re?{...re,toX:Q.x,toY:Q.y}:null)},O=Y=>{let q=Y;if(!z.current)return;let Q=z.current,re=q.target,ee=re.closest?re.closest("[data-anchor]"):null,se=re.closest?re.closest("[data-card-id]"):null;if(ee&&se){let ae=se.getAttribute("data-card-id");ae&&ae!==Q.fromCardId&&n({type:"ADD_CONNECTION",connection:{id:hc(),fromCardId:Q.fromCardId,toCardId:ae}})}S(null)};return document.addEventListener("mousemove",_),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",O)}},[x,b,n]);let $=r.toLowerCase(),B=$?d.filter(_=>_.title.toLowerCase().includes($)):d,H=new Set;if($)for(let _=0;_<d.length;_++)d[_].title.toLowerCase().includes($)||H.add(d[_].id);if(l)for(let _=0;_<d.length;_++)d[_].color!==l&&H.add(d[_].id);let V={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:h.current?"grabbing":"default",backgroundImage:"radial-gradient(circle, #d1d5db 1px, transparent 1px)",backgroundSize:`${Qe}px ${Qe}px`},U={transform:`translate(${b.panX}px, ${b.panY}px) scale(${b.zoom})`,transformOrigin:"0 0",position:"relative",width:`${et}px`,height:`${et}px`},J=d.map(_=>{let O=H.has(_.id),Y=o(wn,{key:_.id,card:_,selected:_.id===s,onSelect:I,onMove:F,onResize:T,onDelete:P,onDoubleClick:L,onDuplicate:w,onChangeColor:E,onChangePriority:M,onAnchorDragStart:N});return O?o("div",{key:`dim-${_.id}`,style:{opacity:"0.3"}},Y):Y}),ne=m?d.find(_=>_.id===m):null,te=ne?o(kn,{card:ne,onSave:D,onClose:W}):null,G=x?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"5"},width:String(et),height:String(et),"data-testid":"connection-drag-line"},o("line",{x1:String(x.fromX),y1:String(x.fromY),x2:String(x.toX),y2:String(x.toY),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6,4","pointer-events":"none"})):null;return o("div",{ref:y,className:"board-canvas",style:V,onMouseDown:R,onWheel:C,"data-testid":"board-canvas",role:"application","aria-label":"Project board canvas",tabIndex:0},o("div",{className:"board-canvas__inner",style:U,"data-testid":"board-canvas-inner"},o(Cn,{connections:u,cards:d,selectedConnectionId:g,onSelectConnection:A,onDeleteConnection:k,canvasWidth:et,canvasHeight:et}),G,...J),te)}var di=50,zt={cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}};function ui(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 bc(e){return e.type==="PAN"||e.type==="ZOOM"}function pi(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=ui(e.present,t.action);if(n===e.present)return e;if(bc(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>di&&r.splice(0,r.length-di),{past:r,present:n,future:[]}}default:return e}}function Pn(e,t){let n={past:[],present:zt,future:[]},[r,i]=Vt(pi,n),s=v(m=>{i({type:"BOARD_ACTION",action:m})},[i]),a=v(()=>{i({type:"UNDO"})},[i]),l=v(()=>{i({type:"REDO"})},[i]),d=oe(!1);ie(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{s({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,s]);let u=oe(null),b=oe(r.present);return b.current=r.present,ie(()=>{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 fi={cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}},pt=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):fi}catch{return fi}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Rn(e){let{cards:t,onCardDropped:n,children:r}=e,i=Ne(),s=oe([]);ie(()=>{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 g=u.find(f=>f.id===c.id);g&&g.updatedAt!==c.updatedAt&&i.publish("project-board",{event:"card-updated",card:c})}s.current=t},[t,i]);let a=v(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}=ct({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 gi=0;function mi(){return gi++,`card-${Date.now()}-${gi}`}var xc=new pt,yc=[{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",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",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",createdAt:Date.now(),updatedAt:Date.now()}],Sc={cards:yc,connections:[{id:"sample-conn-1",fromCardId:"sample-1",toCardId:"sample-2"}],viewport:{panX:0,panY:0,zoom:1}};function vc(e){return e.cards.length===0&&e.connections.length===0}function hi(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Pn(xc,t),[d,u]=j(Je[0]),[b,m]=j(!1),[c,g]=j(""),[f,y]=j(null),[h,p]=j(null),x=oe(!1);ie(()=>{!x.current&&vc(n)?(x.current=!0,r({type:"SET_BOARD",state:Sc})):n.cards.length>0&&(x.current=!0)},[n,r]);let S=v(()=>{let E=(-n.viewport.panX+300)/n.viewport.zoom,M=(-n.viewport.panY+200)/n.viewport.zoom,N={id:mi(),title:"New Card",description:"",color:d,position:{x:Math.round(E),y:Math.round(M)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:N})},[n.viewport,d,r]),z=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),R=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),C=v(()=>{r({type:"ZOOM",zoom:1})},[r]),I=v(()=>{m(E=>!E)},[]),F=v(E=>{g(E)},[]),T=v(E=>{y(E)},[]),P=v(E=>{p(E)},[]),L=v(()=>{r({type:"SET_BOARD",state:zt}),y(null)},[r]),D=v(()=>{let E=JSON.stringify(n,null,2),M=new Blob([E],{type:"application/json"}),N=URL.createObjectURL(M),$=document.createElement("a");$.href=N,$.download=`board-${t}.json`,$.style.display="none",document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(N)},[n,t]),W=v(()=>{f&&(r({type:"REMOVE_CARD",cardId:f}),y(null))},[f,r]),A=v(()=>{if(n.cards.length===0)return;let N=Mn(n.cards,800,600);r({type:"PAN",panX:N.panX,panY:N.panY}),r({type:"ZOOM",zoom:N.zoom})},[n.cards,r]);ie(()=>{let E={menus:[{label:"File",items:[{label:"New Board",onClick:L},{label:"Export JSON",onClick:D},{divider:!0}]},{label:"Edit",items:[{label:"Undo",shortcut:"Ctrl+Z",onClick:i,disabled:!a},{label:"Redo",shortcut:"Ctrl+Y",onClick:s,disabled:!l},{divider:!0},{label:"Delete Selected",onClick:W}]},{label:"View",items:[{label:"Zoom In",onClick:z},{label:"Zoom Out",onClick:R},{label:"Fit All",onClick:A},{divider:!0},{label:"Toggle Grid",onClick:I}]}]}},[L,D,i,s,a,l,W,z,R,A,I]),ie(()=>{let E=M=>{let N=M;N.ctrlKey&&N.key==="z"?(N.preventDefault(),i()):N.ctrlKey&&N.key==="y"&&(N.preventDefault(),s())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[i,s]);let k={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},w=v((E,M)=>{let N=(-n.viewport.panX+300)/n.viewport.zoom,$=(-n.viewport.panY+200)/n.viewport.zoom,B={id:mi(),title:E,description:M,color:d,position:{x:Math.round(N),y:Math.round($)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:B})},[n.viewport,d,r]);return o("div",{className:"project-manager-app",style:k,"data-testid":"project-manager-app"},o(vn,{zoom:n.viewport.zoom,gridEnabled:b,selectedColor:d,colorFilter:h,onNewCard:S,onZoomIn:z,onZoomOut:R,onZoomReset:C,onColorSelect:u,onColorFilter:P,onGridToggle:I,onSearch:F}),o(Rn,{cards:n.cards,onCardDropped:w},o(En,{state:n,dispatch:r,searchQuery:c,gridEnabled:b,selectedCardId:f,onSelectCard:T,colorFilter:h})))}var wc=28,kc=5e3;function Cc(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 Mc(){let e=Ne(),t=oe(!1);return ie(()=>{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 Ec(){let[e,t]=j([]),n=He();at("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=v(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 Pc(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(e){case"Files":return o(Fe,{appId:"files"},o(Ec,null));case"Terminal":return o(Fe,{appId:"terminal"},o(Mc,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(Pt,null);case"IDE":return o(Rt,null);case"Trading":return o(Dt,null);case"Project Board":return o(hi,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function Rc(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=it(),d=l.activeMenuBar,u=l.dockSignals,[b,m]=j([]),[c,g]=j([]),[f,y]=j(!1),[h,p]=j(!1),[x,S]=j(null),[z,R]=j({x:0,y:0}),[C,I]=j(null),F=v(()=>{y(K=>!K)},[]),T=v(K=>{g(Z=>Z.filter(le=>le.id!==K))},[]);ie(()=>{if(c.length===0)return;let K=c[0],Z=Date.now()-K.timestamp,le=Math.max(0,kc-Z),de=setTimeout(()=>{g(ce=>ce.filter(ue=>ue.id!==K.id))},le);return()=>clearTimeout(de)},[c]);let P=oe(t);P.current=t;let L=oe(r);L.current=r;let D=v(K=>{m(Z=>{if(Z.find(ge=>ge.id===K)){let ge=Math.max(...Z.map(be=>be.zIndex))+1;return Z.map(be=>be.id===K?{...be,focused:!0,zIndex:ge,windowState:be.windowState==="minimized"?"normal":be.windowState}:{...be,focused:!1})}let ce=P.current.find(ge=>ge.id===K);if(!ce)return Z;let ue=Z.length>0?Math.max(...Z.map(ge=>ge.zIndex))+1:1,fe={id:ce.id,title:ce.label,icon:ce.icon,x:60+Z.length*30,y:40+Z.length*30,width:600,height:400,zIndex:ue,focused:!0,windowState:"normal"};return[...Z.map(ge=>({...ge,focused:!1})),fe]}),K==="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:()=>{}}]}]}),K==="terminal"&&l.signalDock("terminal",{badge:3}),L.current&&L.current(K)},[l]),W=t.map(K=>{let Z=b.some(ce=>ce.id===K.id),le=u.get(K.id),de={id:K.id,icon:K.icon,label:le?.tooltip||K.label,active:Z};return le&&(le.badge!=null&&(de.badge=le.badge>0?le.badge:void 0),le.progress!=null&&(de.progress=le.progress>0?le.progress:void 0),le.urgent&&(de.urgent=!0)),de}),A=b.find(K=>K.focused),k=A?A.title:void 0,w=v(()=>{p(!0)},[]),E=v(()=>{p(!1)},[]),M=v((K,Z)=>{S(K),R(Z)},[]),N=v(()=>{S(null)},[]),$=v(()=>{},[]),B=v(()=>{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:w,divider:!1}),H.push({label:"Logout",icon:void 0,onClick:B,divider:!1});let V=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]),U={display:"flex",flex:"1",overflow:"hidden"},J={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"},ne={width:"100%",height:"100%",position:"relative"},te=o(mn,{activeAppName:k,activitiesButton:{label:"Activities",onClick:F},appMenuBar:d||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:wc}),G=o(hn,{items:W,orientation:"vertical",position:"left",iconSize:36,onItemClick:D,onItemContextMenu:M}),_=o(Cc,{toasts:c,onDismiss:T}),O=b.filter(K=>K.windowState!=="minimized").map(K=>o(dt,{key:K.id,id:K.id,title:K.title,icon:K.icon,defaultPosition:{x:K.x,y:K.y},defaultSize:{width:K.width,height:K.height},zIndex:K.zIndex,focused:K.focused,windowState:K.windowState,onClose:()=>{m(Z=>Z.filter(le=>le.id!==K.id))},onFocus:()=>{m(Z=>{let le=Math.max(...Z.map(de=>de.zIndex))+1;return Z.map(de=>de.id===K.id?{...de,focused:!0,zIndex:le}:{...de,focused:!1})})},onMinimize:()=>{m(Z=>Z.map(le=>le.id===K.id?{...le,windowState:"minimized"}:le))},onMaximize:()=>{m(Z=>Z.map(le=>le.id===K.id?{...le,windowState:le.windowState==="maximized"?"normal":"maximized"}:le))}},Pc(K.title))),Y=[];a&&Y.push(a),Y.push(...O),Y.push(_);let q=o(bn,{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:ne},...Y)),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:F},...t.map(K=>o("button",{key:K.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:Z=>{Z.stopPropagation(),y(!1),D(K.id)}},o("span",{style:{fontSize:"32px",display:"block"}},K.icon),o("span",null,K.label)))):null,re=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,ee=x?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:`${z.y}px`,left:`${z.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:K=>K.stopPropagation()},o("div",{style:{padding:"6px 14px",fontWeight:"600",borderBottom:"1px solid #444",marginBottom:"4px"}},t.find(K=>K.id===x)?.label||x),o("div",{style:{padding:"6px 14px",cursor:"pointer"},onClick:()=>{I(x),S(null)},role:"menuitem"},"About"))):null,se=C?t.find(K=>K.id===C):null,ae=se?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:()=>I(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:K=>K.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},se.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:()=>I(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:V,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},te),o("div",{style:U},o("div",{className:"unity-desktop__dock",style:J},G),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},q,Q)),ee,ae,re)}function bi(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(pn,{onWindowOpen:r},o(st,null,o(lt,null,o(Rc,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function xi(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,g=it(),f=X(()=>g.windows.find(I=>I.id===t),[g.windows,t]);ie(()=>(u?g.setMenuBar(t,u):g.clearMenuBar(t),()=>{g.clearMenuBar(t)}),[u,t,g]);let y=oe(!1),h=f?f.focused:!1;ie(()=>{let I=y.current;y.current=h,h&&!I?b&&b():!h&&I&&m&&m()},[h,b,m]);let p=v(()=>{g.closeWindow(t),d&&d()},[g,t,d]),x=v(()=>{g.focusWindow(t)},[g,t]),S=v(I=>{g.moveWindow(t,I)},[g,t]),z=v(I=>{g.resizeWindow(t,I)},[g,t]),R=v(()=>{g.minimizeWindow(t)},[g,t]),C=v(()=>{f&&f.windowState==="maximized"?g.restoreWindow(t):g.maximizeWindow(t)},[g,t,f]);return f?o(Fe,{appId:t},o(dt,{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:p,onFocus:x,onMove:S,onResize:z,onMinimize:R,onMaximize:C,children:c})):(g.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var yi={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},Si={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 vi(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=X(()=>{let g=yi[i]??yi.md,f=Si[r]??Si.secondary,y={padding:g.padding,fontSize:g.fontSize,borderRadius:g.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%"),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 $c=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],tt=Math.PI/180;function Ic(e,t,n,r,i,s,a,l,d,u){let b=Math.cos(r*tt),m=Math.sin(r*tt),c=Math.cos(i*tt),g=Math.sin(i*tt),f=Math.cos(s*tt),y=Math.sin(s*tt),h=e*f-t*y,p=e*y+t*f,x=h*c-p*g,S=h*g+p*c,z=n,R=x,C=S*b-z*m,I=S*m+z*b,F=1+a*.001*I,T=l+R*u*F,P=d-C*u*F;return{sx:T,sy:P,depth:I}}function wi(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 ki(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 Ci(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=$c,gridColor:c="#94a3b8",title:g}=e,f=X(()=>{let A=0,k=0,w=0;for(let E=0;E<t.length;E++){let M=t[E],N=M.data.length;N>A&&(A=N);for(let $=0;$<N;$++){let B=M.data[$].length;B>k&&(k=B);for(let H=0;H<B;H++){let V=Math.abs(M.data[$][H]??0);V>w&&(w=V)}}}return{maxRows:Math.max(A,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),y=X(()=>{let A=f.maxHeight+(t.length-1)*b+f.maxHeight,k=Math.sqrt(f.maxCols*f.maxCols+f.maxRows*f.maxRows+A*A),w=Math.min(n,r)*.75;return k>0?w/k:1},[f,t.length,b,n,r]),h=n/2,p=r/2,x=v((A,k,w)=>Ic(A,k,w,s,a,l,i,h,p,y),[s,a,l,i,h,p,y]),S=v(()=>{if(!u)return[];let A=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,E=f.maxRows/2,M=x(-w,-E,0),N=x(w,-E,0);A.push(o("line",{key:"axis-x",x1:String(M.sx),y1:String(M.sy),x2:String(N.sx),y2:String(N.sy),stroke:"#374151","stroke-width":"1.5"})),A.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 $=x(-w,E,0);A.push(o("line",{key:"axis-y",x1:String(M.sx),y1:String(M.sy),x2:String($.sx),y2:String($.sy),stroke:"#374151","stroke-width":"1.5"})),A.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)*b,H=x(-w,-E,B);return A.push(o("line",{key:"axis-z",x1:String(M.sx),y1:String(M.sy),x2:String(H.sx),y2:String(H.sy),stroke:"#374151","stroke-width":"1.5"})),A.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")),A},[u,f,t.length,b,x]),z=v(()=>{let A=[],k=f.maxCols/2,w=f.maxRows/2,E=[];for(let M=0;M<t.length;M++){let N=t[M],$=N.color??m[M%m.length],B=N.opacity??.7,H=M*b,V=N.data.length;for(let U=0;U<V-1;U++){let J=N.data[U],ne=N.data[U+1],te=Math.min(J.length,ne.length);for(let G=0;G<te-1;G++){let _=G-k,O=G+1-k,Y=U-w,q=U+1-w,Q=(J[G]??0)+H,re=(J[G+1]??0)+H,ee=(ne[G]??0)+H,se=(ne[G+1]??0)+H,ae=x(_,Y,Q),K=x(O,Y,re),Z=x(_,q,ee),le=x(O,q,se),de=(ae.depth+K.depth+Z.depth+le.depth)/4,ce=`${ae.sx},${ae.sy} ${K.sx},${K.sy} ${le.sx},${le.sy} ${Z.sx},${Z.sy}`;E.push({points:ce,fill:wi($,B),stroke:ki($,.7),strokeWidth:"0.5",depth:de,key:`quad-${M}-${U}-${G}`})}}if(V===1||V>0&&N.data[0].length===1)for(let U=0;U<V;U++){let J=N.data[U];for(let ne=0;ne<J.length;ne++){let te=ne-k,G=U-w,_=(J[ne]??0)+H,O=x(te,G,_),Y=3,q=`${O.sx},${O.sy-Y} ${O.sx+Y},${O.sy} ${O.sx},${O.sy+Y} ${O.sx-Y},${O.sy}`;E.push({points:q,fill:wi($,B),stroke:ki($,.7),strokeWidth:"0.5",depth:O.depth,key:`point-${M}-${U}-${ne}`})}}}E.sort((M,N)=>M.depth-N.depth);for(let M=0;M<E.length;M++){let N=E[M];A.push(o("polygon",{key:N.key,points:N.points,fill:N.fill,stroke:N.stroke,"stroke-width":N.strokeWidth,"stroke-linejoin":"round"}))}return A},[t,f,b,m,x]),R=v(()=>{let A=[],k=f.maxCols/2,w=f.maxRows/2;for(let E=0;E<=f.maxRows;E++){let M=E-w,N=x(-k,M,0),$=x(k,M,0);A.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 M=E-k,N=x(M,-w,0),$=x(M,w,0);A.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 A},[f,c,x]),C=v(()=>{if(!d)return[];let A=[],k=f.maxCols/2,w=f.maxRows/2;for(let E=0;E<t.length;E++){let M=t[E],N=E*b,$=0,B=0;for(let J=0;J<M.data.length;J++){let ne=M.data[J];for(let te=0;te<ne.length;te++)$+=ne[te]??0,B++}let H=B>0?$/B:0,V=x(k+1,0,H+N),U=M.color??m[E%m.length];A.push(o("text",{key:`layer-label-${E}`,x:String(V.sx+8),y:String(V.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:U},M.label))}return A},[d,t,f,b,m,x]),F=v(()=>g?[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"},g)]:[],[g,n])(),T=R(),P=S(),L=z(),D=C(),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":g??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...F,...W,...T,...P,...L,...D)}function Dc(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 zc(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 Mi(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:g="#ffffff"}=e,f=X(()=>Dc(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,S=20,z=p?u*.38:u*.45,R=Math.min(d*.15,48),C=R*.55,I=z+R*.4+8,F=p?I+22:z+R*.4+22,T=h?Math.min(u*.22,36):0,P=u-S-T,L=d-S*2,D=v(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:g,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,g]),W=v(()=>{let V=[],U=r+f+i;return V.push(o("text",{key:"value",x:String(d/2),y:String(z),"text-anchor":"middle","dominant-baseline":"central","font-size":String(R),"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,f,i?o("tspan",{key:"suffix","font-size":String(C),"font-weight":"normal"},i):null)),V},[d,z,R,C,f,r,i,b]),A=v(()=>p?[o("text",{key:"label",x:String(d/2),y:String(I),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[p,d,I,n]),k=v(()=>{if(!y)return[];let V=[],U=s,J=U>=0,ne=8,te=zc(U),G=(J?"+":"-")+te+(a?" "+a:""),_=d/2-40,O=F;if(J){let Y=`${_},${O} ${_-ne/2},${O+ne} ${_+ne/2},${O+ne}`;V.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}else{let Y=`${_},${O+ne} ${_-ne/2},${O} ${_+ne/2},${O}`;V.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}return V.push(o("text",{key:"trend-text",x:String(_+ne+4),y:String(O+ne*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${G}`},G)),V},[y,s,a,x,d,F]),w=v(()=>{if(!h)return[];let V=[],U=l,J=[];for(let Q of U)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&J.push(Q);if(J.length<2)return[];let ne=1/0,te=-1/0;for(let Q of J)Q<ne&&(ne=Q),Q>te&&(te=Q);ne===te&&(ne-=1,te+=1);let G=te-ne,_=L/(J.length-1),O="";for(let Q=0;Q<J.length;Q++){let re=S+Q*_,ee=P+T-(J[Q]-ne)/G*T;Q===0?O+=`M ${re} ${ee}`:O+=` L ${re} ${ee}`}let Y=S+(J.length-1)*_,q=O+` L ${Y} ${P+T} L ${S} ${P+T} Z`;return V.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),V.push(o("path",{key:"spark-fill",d:q,fill:"url(#sparkGrad)"})),V.push(o("path",{key:"spark-line",d:O,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),V},[h,l,L,P,T,S]),E=D(),M=W(),N=A(),$=k(),B=w(),H=`${r}${f}${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":H,style:{fontFamily:"sans-serif"}},...E,...B,...M,...N,...$)}var Tt=Math.PI/180;function Tc(e,t,n,r,i,s,a,l){let d=Math.cos(r*Tt),u=Math.sin(r*Tt),b=Math.cos(i*Tt),m=Math.sin(i*Tt),c=e*b+n*m,g=-e*m+n*b,f=t*d-g*u,y=t*u+g*d;return{sx:s+c*l,sy:a-f*l,depth:y}}function nt(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 At(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 We(e,t,n){let{x:r,y:i,z:s}=nt(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),At(d,u,b)}function $n(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return We(e,"x",Math.PI);case"Y":return We(e,"y",Math.PI);case"Z":return We(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=nt(e);return At(s,-i,r)}case"S":return We(e,"z",Math.PI/2);case"T":return We(e,"z",Math.PI/4);case"Rx":return We(e,"x",n);case"Ry":return We(e,"y",n);case"Rz":return We(e,"z",n)}}function Ei(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:g=!0,trailMaxPoints:f=200,trailColor:y="#ef4444",wireframeColor:h="#cbd5e1",vectorColor:p="#3b82f6",backgroundColor:x,sphereRadius:S=130,title:z,onStateChange:R}=e,[C,I]=j(t??{theta:0,phi:0}),[F,T]=j(s),[P,L]=j(a),[D,W]=j(l),A=oe([]),k=oe(!1),w=oe(null),E=oe(null);ie(()=>{t&&I(t)},[t?.theta,t?.phi]);let M=oe(0);ie(()=>{if(!n||n.length===0)return;M.current=0;let _=0,O=()=>{M.current>=n.length||(I(Y=>{let q=$n(Y,n[M.current]);return M.current++,R&&R(q),q}),_=requestAnimationFrame(O))};return _=requestAnimationFrame(O),()=>cancelAnimationFrame(_)},[n]),ie(()=>{let _=nt(C);A.current.push(_),A.current.length>f&&A.current.splice(0,A.current.length-f)},[C.theta,C.phi]);let N=S*D,$=r/2,B=i/2,H=v((_,O,Y)=>Tc(_,O,Y,P,F,$,B,N),[P,F,$,B,N]),V=v(_=>{if(!d)return;let O=_;k.current=!0,w.current={mx:O.clientX,my:O.clientY,rx:P,ry:F}},[d,P,F]),U=v(_=>{if(!k.current||!w.current)return;let O=_,Y=w.current;T(Y.ry+(O.clientX-Y.mx)*.5),L(Y.rx-(O.clientY-Y.my)*.5)},[]),J=v(()=>{k.current=!1},[]),ne=v(_=>{if(!u)return;let O=_;O.preventDefault(),W(Y=>Math.max(.5,Math.min(3,Y*(O.deltaY>0?.95:1.05))))},[u]),te=[];if(x&&te.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),z&&te.push(o("text",{key:"title",x:String($),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},z)),c){let O=[];for(let Q=0;Q<=60;Q++){let re=Q/60*2*Math.PI,ee=H(Math.cos(re),Math.sin(re),0);O.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}te.push(o("path",{key:"eq",d:O.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.5"}));let Y=[];for(let Q=0;Q<=60;Q++){let re=Q/60*2*Math.PI,ee=H(Math.cos(re),0,Math.sin(re));Y.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}te.push(o("path",{key:"xz",d:Y.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}));let q=[];for(let Q=0;Q<=60;Q++){let re=Q/60*2*Math.PI,ee=H(0,Math.cos(re),Math.sin(re));q.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}te.push(o("path",{key:"yz",d:q.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}))}let G=[{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 _ of G){let O=H(_.dir[0]*1.15,_.dir[1]*1.15,_.dir[2]*1.15),Y=H(-_.dir[0]*1.15,-_.dir[1]*1.15,-_.dir[2]*1.15),q=H(0,0,0);te.push(o("line",{key:`axis-${_.id}`,x1:String(Y.sx),y1:String(Y.sy),x2:String(O.sx),y2:String(O.sy),stroke:_.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(m){let _=[{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 O of _){let Y=H(O.pos[0],O.pos[1],O.pos[2]);te.push(o("text",{key:`lbl-${O.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"}},O.text))}}if(g&&A.current.length>1){let _=A.current,O=[];for(let Y=0;Y<_.length;Y++){let q=_[Y],Q=H(q.x,q.y,q.z);O.push(`${Y===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}te.push(o("path",{key:"trail",d:O.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(b){let _=nt(C),O=H(0,0,0),Y=H(_.x,_.y,_.z);te.push(o("line",{key:"vec-line",x1:String(O.sx),y1:String(O.sy),x2:String(Y.sx),y2:String(Y.sy),stroke:p,"stroke-width":"2.5","stroke-linecap":"round"})),te.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 q=(C.theta*180/Math.PI).toFixed(0),Q=(C.phi*180/Math.PI).toFixed(0);te.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=${q}\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":z??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?V:void 0,onMouseMove:d?U:void 0,onMouseUp:d?J:void 0,onMouseLeave:d?J:void 0,onWheel:u?ne:void 0},...te)}function Ac(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 In(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 Dn(e){let t=Ac(e);if(t.length===0)return null;let n=In(t,25),r=In(t,50),i=In(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let g of t)if(g>=a){d=g;break}let u=t[t.length-1];for(let g=t.length-1;g>=0;g--)if(t[g]<=l){u=t[g];break}let b=0;for(let g of t)b+=g;let m=b/t.length,c=[];for(let g of t)(g<a||g>l)&&c.push(g);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 Lc(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 Pi(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",g=n-m*2,f=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],h=X(()=>{let w=[];for(let E of t)w.push(Dn(E.values));return w},[t]),p=X(()=>{let w=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<w&&(w=B),H>E&&(E=H)}isFinite(w)||(w=0,E=1);let M=E-w,N=M>0?M*.05:.5;return{min:w-N,max:E+N}},[h,s]),x=c?f:g,S=c?g:f,z=t.length>0?t.length:1,R=S/z,C=R*Math.min(Math.max(d,.1),.95),I=v(w=>{let E=p.max-p.min;return E===0?x/2:(w-p.min)/E*x},[p,x]),F=v(()=>{if(!u)return[];let w=[],E=p.max-p.min,M=Lc(E),N=Math.ceil(p.min/M)*M;for(let $=N;$<=p.max;$+=M){let B=I($),H=String(Math.round($*1e3)/1e3);if(c){let V=m+f-B;w.push(o("line",{key:`grid-${$}`,x1:String(m),y1:String(V),x2:String(m+g),y2:String(V),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${$}`,x:String(m-6),y:String(V+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}else{let V=m+B;w.push(o("line",{key:`grid-${$}`,x1:String(V),y1:String(m),x2:String(V),y2:String(m+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${$}`,x:String(V),y:String(m+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}}return w},[u,p,I,c,m,g,f]),T=v(()=>{let w=[];return w.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"})),w.push(o("line",{key:"axis-category",x1:String(m),y1:String(m+f),x2:String(m+g),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),w},[m,g,f,c]),P=v(()=>{let w=[];for(let E=0;E<t.length;E++){let M=h[E];if(M===null)continue;let N=t[E],$=N.color??y[E%y.length],B=R*E+R/2,H=C/2;if(c){let V=m+f-I(M.q1),U=m+f-I(M.q3),J=m+f-I(M.median),ne=m+f-I(M.whiskerLow),te=m+f-I(M.whiskerHigh),G=m+B;w.push(o("line",{key:`wl-${E}`,x1:String(G),y1:String(V),x2:String(G),y2:String(ne),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${E}`,x1:String(G-H*.4),y1:String(ne),x2:String(G+H*.4),y2:String(ne),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${E}`,x1:String(G),y1:String(U),x2:String(G),y2:String(te),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${E}`,x1:String(G-H*.4),y1:String(te),x2:String(G+H*.4),y2:String(te),stroke:l,"stroke-width":"1.5"}));let _=Math.min(V,U),O=Math.abs(V-U);if(w.push(o("rect",{key:`box-${E}`,x:String(G-H),y:String(_),width:String(C),height:String(Math.max(O,1)),fill:$,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${E}`,x1:String(G-H),y1:String(J),x2:String(G+H),y2:String(J),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+f-I(M.mean);w.push(o("circle",{key:`mean-${E}`,cx:String(G),cy:String(Y),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<M.outliers.length;Y++){let q=m+f-I(M.outliers[Y]);w.push(o("circle",{key:`out-${E}-${Y}`,cx:String(G),cy:String(q),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[Y]}`}))}w.push(o("text",{key:`cat-${E}`,x:String(G),y:String(m+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}else{let V=m+I(M.q1),U=m+I(M.q3),J=m+I(M.median),ne=m+I(M.whiskerLow),te=m+I(M.whiskerHigh),G=m+B;w.push(o("line",{key:`wl-${E}`,x1:String(V),y1:String(G),x2:String(ne),y2:String(G),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${E}`,x1:String(ne),y1:String(G-H*.4),x2:String(ne),y2:String(G+H*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${E}`,x1:String(U),y1:String(G),x2:String(te),y2:String(G),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${E}`,x1:String(te),y1:String(G-H*.4),x2:String(te),y2:String(G+H*.4),stroke:l,"stroke-width":"1.5"}));let _=Math.min(V,U),O=Math.abs(U-V);if(w.push(o("rect",{key:`box-${E}`,x:String(_),y:String(G-H),width:String(Math.max(O,1)),height:String(C),fill:$,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${E}`,x1:String(J),y1:String(G-H),x2:String(J),y2:String(G+H),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+I(M.mean);w.push(o("circle",{key:`mean-${E}`,cx:String(Y),cy:String(G),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<M.outliers.length;Y++){let q=m+I(M.outliers[Y]);w.push(o("circle",{key:`out-${E}-${Y}`,cx:String(q),cy:String(G),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[Y]}`}))}w.push(o("text",{key:`cat-${E}`,x:String(m-6),y:String(G+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}}return w},[t,h,I,c,m,g,f,R,C,l,s,a,y]),L=v(()=>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]),D=F(),W=T(),A=P(),k=L();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,...D,...W,...A)}function Ri(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 Fc(e,t,n){return e<t?t:e>n?n:e}function zn(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function $i(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:g,padding:f=60}=e,y=X(()=>{let A=[];for(let k=0;k<t.length;k++){let w=t[k];zn(w.x)&&zn(w.y)&&zn(w.r)&&A.push(w)}return A},[t]),h=n-f*2,p=r-f*2,x=X(()=>{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,E=-1/0,M=1/0,N=-1/0;for(let $ of y)$.x<A&&(A=$.x),$.x>k&&(k=$.x),$.y<w&&(w=$.y),$.y>E&&(E=$.y),$.r<M&&(M=$.r),$.r>N&&(N=$.r);return A===k&&(A-=1,k+=1),w===E&&(w-=1,E+=1),M===N&&(M=0,N=N>0?N:1),{xMin:A,xMax:k,yMin:w,yMax:E,rMin:M,rMax:N}},[y]),S=v(A=>{let k=x.xMax-x.xMin;return f+(A-x.xMin)/k*h},[x,f,h]),z=v(A=>{let k=x.yMax-x.yMin;return f+p-(A-x.yMin)/k*p},[x,f,p]),R=v(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=v(()=>{if(!a)return[];let A=[],k=Ri(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let N=w;N<=x.xMax;N+=k){let $=S(N);A.push(o("line",{key:`grid-x-${N}`,x1:String($),y1:String(f),x2:String($),y2:String(f+p),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-xlabel-${N}`,x:String($),y:String(f+p+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}let E=Ri(x.yMax-x.yMin),M=Math.ceil(x.yMin/E)*E;for(let N=M;N<=x.yMax;N+=E){let $=z(N);A.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"})),A.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 A},[a,x,S,z,f,h,p]),I=v(()=>{if(!l)return[];let A=[];return A.push(o("line",{key:"axis-y",x1:String(f),y1:String(f),x2:String(f),y2:String(f+p),stroke:"#374151","stroke-width":"1.5"})),A.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+p),x2:String(f+h),y2:String(f+p),stroke:"#374151","stroke-width":"1.5"})),i&&A.push(o("text",{key:"x-label",x:String(f+h/2),y:String(f+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(f-40),y:String(f+p/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${f-40}, ${f+p/2})`},s)),A},[l,f,h,p,i,s]),F=v(()=>{let A=[];for(let k=0;k<y.length;k++){let w=y[k],E=S(w.x),M=z(w.y),N=Fc(R(w.r),b,u),$=w.color??m;A.push(o("circle",{key:`bubble-${k}`,cx:String(E),cy:String(M),r:String(N),fill:$,opacity:String(c),stroke:$,"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(E),y:String(M-N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return A},[y,S,z,R,m,c,d,b,u]),T=v(()=>g?[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"},g)]:[],[g,n,f]),P=C(),L=I(),D=F(),W=T();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Bubble chart",style:{fontFamily:"sans-serif"}},...W,...P,...L,...D)}var Nc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Bc(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 Di(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 Oc(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 Hc(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=Di(t[i]),l=Di(t[i+1]);return Oc(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var _c=["#9be9a8","#40c463","#30a14e","#216e39"];function zi(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=_c,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:b}=e,{dateMap:m,startDate:c,endDate:g,maxVal:f}=X(()=>{let D=new Map,W=0,A=null,k=null;for(let M of t){let N=Bc(M.date);if(isNaN(N.getTime()))continue;let $=Ii(N);D.set($,(D.get($)??0)+M.value);let B=D.get($);B>W&&(W=B),(A===null||N<A)&&(A=N),(k===null||N>k)&&(k=N)}if(A===null||k===null){let M=new Date;A=new Date(M.getFullYear(),0,1),k=new Date(M.getFullYear(),11,31)}let w=new Date(A);w.setDate(w.getDate()-w.getDay());let E=new Date(k);return E.setDate(E.getDate()+(6-E.getDay())),{dateMap:D,startDate:w,endDate:E,maxVal:W>0?W:1}},[t]),y=d?30:0,h=l?16:0,p=b?28:0,x=y+10,S=p+h+4,z=v(()=>{let D=[],W=new Date(c),A=0;for(;W<=g;){let k=W.getDay();k===0&&W>c&&A++;let w=Ii(W),E=m.get(w),M=E!==void 0&&E>0?Hc(E/f,i):u,N=x+A*(s+a),$=S+k*(s+a);D.push(o("rect",{key:`day-${w}`,x:String(N),y:String($),width:String(s),height:String(s),rx:"2",ry:"2",fill:M,"aria-label":`${w}: ${E??0}`})),W.setDate(W.getDate()+1)}return D},[c,g,m,f,i,u,s,a,x,S]),R=v(()=>{if(!l)return[];let D=[],W=new Date(c),A=0,k=-1;for(;W<=g;){let w=W.getDay();w===0&&W>c&&A++;let E=W.getMonth();if(E!==k&&w===0){k=E;let M=x+A*(s+a);D.push(o("text",{key:`month-${A}`,x:String(M),y:String(p+h-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Nc[E]))}W.setDate(W.getDate()+1)}return D},[l,c,g,s,a,x,p,h]),C=v(()=>{if(!d)return[];let D=[],W=[1,3,5];for(let A of W){let k=S+A*(s+a)+s/2;D.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"},Wc[A]))}return D},[d,s,a,S,y]),I=v(()=>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 F=I(),T=R(),P=C(),L=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Calendar heat map",style:{fontFamily:"sans-serif"}},...F,...T,...P,...L)}var Yc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Te(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Vc(e,t,n,r,i,s){let a=Te(e,t,n,i),l=Te(e,t,n,s),d=Te(e,t,r,i),u=Te(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 Gc(e,t,n,r,i,s,a){let l=Te(e,t,n,r),d=Te(e,t,n,i),u=Te(e,t,n,s),b=Te(e,t,n,a),m=i-r,c=a-s,g=m>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${g} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${f} 1 ${b.x} ${b.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function Uc(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 g=0;for(let f=0;f<i;f++){let y=e[c]?.[f]??0;g+=Math.max(0,y)}s.push(g),a+=g}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),g=[],f=0;for(let y=0;y<i;y++)g.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:g,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let g=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+g,value:s[c]}),u+=g+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 g=c;g<i;g++){let f=Math.max(0,e[c]?.[g]??0),y=c===g?0:Math.max(0,e[g]?.[c]??0);if(f===0&&y===0)continue;let h=f+y,p=s[c]>0?f/a*l:0,x=b[c],S=x+p;b[c]=S;let z=s[g]>0?f/a*l:0,R=b[g],C=R+z;if(b[g]=C,c===g){f>0&&m.push({sourceIndex:c,targetIndex:g,sourceStartAngle:x,sourceEndAngle:S,targetStartAngle:R,targetEndAngle:C,value:f,color:d[c].color});continue}let I=s[g]>0?y/a*l:0,T=b[g]+I;b[g]=T;let P=s[c]>0?y/a*l:0,D=b[c]+P;b[c]=D,(f>0||y>0)&&m.push({sourceIndex:c,targetIndex:g,sourceStartAngle:x,sourceEndAngle:Math.max(S,x+.001),targetStartAngle:R,targetEndAngle:Math.max(C,R+.001),value:h,color:d[c].color})}return{groups:d,chords:m}}function Ti(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=Yc,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,g=i/2,f=Math.min(r,i)/2-40,y=f*Math.max(.5,Math.min(.99,b)),h=f+16,p=X(()=>Uc(t,n,s,a),[t,n,s,a]),x=v(()=>{let F=[];for(let T=0;T<p.groups.length;T++){let P=p.groups[T];if(P.endAngle-P.startAngle<.001)continue;let D=Vc(c,g,f,y,P.startAngle,P.endAngle);if(F.push(o("path",{key:`arc-${T}`,d:D,fill:P.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${P.label}: ${P.value}`})),l){let W=(P.startAngle+P.endAngle)/2,A=Te(c,g,h,W),E=((W-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,M=E?"start":"end",N=W*180/Math.PI-90;E||(N+=180);let $=d?`${P.label} (${P.value})`:P.label;F.push(o("text",{key:`label-${T}`,x:String(A.x),y:String(A.y),"text-anchor":M,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${N}, ${A.x}, ${A.y})`,"dominant-baseline":"central","pointer-events":"none"},$))}}return F},[p,c,g,f,y,h,l,d]),S=v(()=>{let F=[];for(let T=0;T<p.chords.length;T++){let P=p.chords[T],L=Gc(c,g,y,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);F.push(o("path",{key:`ribbon-${T}`,d:L,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return F},[p,c,g,y,u]),z=v(()=>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]),R=S(),C=x(),I=z();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Chord diagram",style:{fontFamily:"sans-serif"}},...I,...R,...C)}var jc=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Xc(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 qc(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 Kc(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=Xc(e);if(d.length===0)return[];let b=qc(d),m=t-s*2,c=n-s*2,g=a==="horizontal",f=u+1,y=g?f>1?(m-r)/u:0:f>1?(c-i)/u:0,h=new Array(d.length),p=b[0],x=g?c:m,S=p>0?x/p:x,z=new Array(d.length);z[0]=[0,p];let R=[0],C=0;for(;C<R.length;){let I=R[C];C++;let F=d[I],[T,P]=z[I],L=(T+P)/2,D=s+F.depth*y,W=s+(L-.5)*S,A=g?D:W,k=g?W:D,w=F.node.color??l[F.depth%l.length];h[I]={id:F.id,label:F.node.label,value:F.node.value!==void 0?String(F.node.value):"",color:w,depth:F.depth,x:A,y:k,parentId:F.parentId,childCount:F.childIndices.length,subtreeLeafCount:b[I]};let E=T;for(let M of F.childIndices)if(M<d.length){let N=b[M],$=E+N;z[M]=[E,$],E=$,R.push(M)}}return h}function Ai(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=jc,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 g=i==="horizontal",f=X(()=>Kc(t,n,r,s,a,c,i,b),[t,n,r,s,a,c,i,b]),y=X(()=>{let C=new Map;for(let I=0;I<f.length;I++){let F=f[I];C.set(F.id,F)}return C},[f]),h=v(()=>{if(!d)return[];let C=[];for(let I=0;I<f.length;I++){let F=f[I];if(F.parentId===null)continue;let T=y.get(F.parentId);if(!T)continue;let P,L,D,W;g?(P=T.x+s,L=T.y+a/2,D=F.x,W=F.y+a/2):(P=T.x+s/2,L=T.y+a,D=F.x+s/2,W=F.y);let A=(P+D)/2,k=(L+W)/2,w;g?w=`M ${P} ${L} C ${A} ${L}, ${A} ${W}, ${D} ${W}`:w=`M ${P} ${L} C ${P} ${k}, ${D} ${k}, ${D} ${W}`,C.push(o("path",{key:`conn-${I}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[f,y,g,s,a,d,u]),p=v(()=>{let C=[];for(let I=0;I<f.length;I++){let F=f[I];C.push(o("rect",{key:`node-rect-${F.id}`,x:String(F.x),y:String(F.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:F.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":F.value?`${F.label}: ${F.value}`:F.label}));let T=l&&F.value?F.y+a/2-2:F.y+a/2+4;C.push(o("text",{key:`node-label-${F.id}`,x:String(F.x+s/2),y:String(T),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},F.label)),l&&F.value&&C.push(o("text",{key:`node-value-${F.id}`,x:String(F.x+s/2),y:String(F.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},F.value))}return C},[f,s,a,l]),x=v(()=>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(),z=p(),R=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"}},...R,...S,...z)}var Li=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Zc(e){return Li[e%Li.length]}function Fi(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??Zc(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 Ni(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,g=n-b;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*g,a.y+=c*g):a.fixed?(i.x-=m*g,i.y-=c*g):(i.x-=m*g*.5,i.y-=c*g*.5,a.x+=m*g*.5,a.y+=c*g*.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 Jc(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 S=e[x];for(let z=x+1;z<u;z++){let R=e[z],C=S.x-R.x,I=S.y-R.y,F=C*C+I*I;F<1&&(F=1);let T=Math.sqrt(F),P=i/F,L=C/T*P,D=I/T*P;m[x]+=L,c[x]+=D,m[z]-=L,c[z]-=D}}for(let x=0;x<t.length;x++){let S=t[x],z=b.get(S.source),R=b.get(S.target);if(z===void 0||R===void 0)continue;let C=e[z],I=e[R],F=I.x-C.x,T=I.y-C.y,P=Math.sqrt(F*F+T*T);if(P<.1)continue;let L=S.weight??1,D=P-l,W=s*D*L,A=F/P*W,k=T/P*W;m[z]+=A,c[z]+=k,m[R]-=A,c[R]-=k}let g=n/2,f=r/2,y=.001;for(let x=0;x<u;x++){let S=e[x];m[x]+=(g-S.x)*y,c[x]+=(f-S.y)*y}let h=20,p=[];for(let x=0;x<u;x++){let S=e[x];if(S.fixed){p.push({...S,vx:0,vy:0});continue}let z=(S.vx+m[x])*a,R=(S.vy+c[x])*a,C=Math.sqrt(z*z+R*R),I=10;C>I&&(z=z/C*I,R=R/C*I);let F=S.x+z,T=S.y+R;F=Math.max(h,Math.min(n-h,F)),T=Math.max(h,Math.min(r-h,T)),p.push({...S,x:F,y:T,vx:z,vy:R})}return Ni(p,d),p}function Qc(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 Wi(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:g=100,edgeColor:f="#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 S=oe(Fi(t,r,i)),[z,R]=j(0),C=oe(!0),I=oe(!1),F=oe(n);F.current=n;let T=oe(p);T.current=p;let P=oe(null),L=oe({repulsionForce:b,attractionForce:m,damping:c,edgeLength:g,width:r,height:i,nodeRadius:s,solidNodes:l});L.current={repulsionForce:b,attractionForce:m,damping:c,edgeLength:g,width:r,height:i,nodeRadius:s,solidNodes:l};let D=oe(new Map);ie(()=>{S.current=Fi(t,r,i),I.current=!1,C.current=!0,D.current=new Map,R(re=>re+1)},[t.length]),ie(()=>{let re=0,ee=()=>{if(!C.current)return;let se=L.current,ae=T.current,K;if(ae?(K=ae(S.current,F.current,se.width,se.height,P.current),se.solidNodes&&Ni(K,se.nodeRadius)):K=Jc(S.current,F.current,se.width,se.height,se.repulsionForce,se.attractionForce,se.damping,se.edgeLength,se.nodeRadius),S.current=K,x)for(let Z=0;Z<x.length;Z++){let le=x[Z],de=K.find(fe=>fe.id===le.nodeId);if(!de)continue;let ce=D.current.get(le.nodeId);ce||(ce=[],D.current.set(le.nodeId,ce)),ce.push({x:de.x,y:de.y});let ue=le.maxPoints??200;ce.length>ue&&ce.splice(0,ce.length-ue)}if(!ae&&Qc(K)<.01){I.current=!0,R(Z=>Z+1);return}R(Z=>Z+1),re=requestAnimationFrame(ee)};return re=requestAnimationFrame(ee),()=>{C.current=!1,cancelAnimationFrame(re)}},[]);let W=S.current,A=v(re=>{S.current=S.current.map(ee=>ee.id===re?{...ee,fixed:!ee.fixed,vx:0,vy:0}:ee),I.current&&(I.current=!1,C.current=!0,R(ee=>ee+1))},[]),k=oe(null),w=oe(null),E=v(re=>{let ee=re,se=w.current;if(!se)return{x:ee.clientX,y:ee.clientY};let ae=se.getBoundingClientRect(),K=r/ae.width,Z=i/ae.height;return{x:(ee.clientX-ae.left)*K,y:(ee.clientY-ae.top)*Z}},[r,i]),M=oe(!1),N=v((re,ee)=>{ee.stopPropagation(),k.current=re;let se=S.current.find(ae=>ae.id===re);M.current=se?.fixed??!1,S.current=S.current.map(ae=>ae.id===re?{...ae,fixed:!0,vx:0,vy:0}:ae)},[]),$=v(re=>{let ee=E(re);if(P.current={x:ee.x,y:ee.y},!k.current)return;let se=k.current,ae=20;S.current=S.current.map(K=>K.id===se?{...K,x:Math.max(ae,Math.min(r-ae,ee.x)),y:Math.max(ae,Math.min(i-ae,ee.y))}:K),I.current&&(I.current=!1,C.current=!0),R(K=>K+1)},[r,i,E]),B=v(()=>{let re=k.current;re&&(S.current=S.current.map(ee=>ee.id===re?{...ee,fixed:M.current}:ee)),k.current=null},[]),H=v(()=>{k.current=null,P.current=null},[]),V=X(()=>{let re=new Map;for(let ee=0;ee<W.length;ee++)re.set(W[ee].id,W[ee]);return re},[z]),U=v(()=>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:f})))]:[],[u,s,f]),J=v(()=>{let re=[];for(let ee=0;ee<n.length;ee++){let se=n[ee],ae=V.get(se.source),K=V.get(se.target);if(!ae||!K||se.weight!==void 0&&se.weight<=0)continue;let Z=se.weight?Math.max(.5,Math.min(6,y*se.weight)):y,le={key:`edge-${ee}`,x1:String(ae.x),y1:String(ae.y),x2:String(K.x),y2:String(K.y),stroke:se.color??f,"stroke-width":String(Z),"stroke-opacity":"0.6"};u&&(le["marker-end"]="url(#arrowhead)"),re.push(o("line",le))}return re},[z,f,y,u]),ne=v(()=>{let re=[];for(let ee=0;ee<W.length;ee++){let se=W[ee];re.push(o("circle",{key:`node-${se.id}`,cx:String(se.x),cy:String(se.y),r:String(s),fill:se.color,stroke:se.fixed?"#0f172a":"#fff","stroke-width":se.fixed?"3":String(a),style:{cursor:k.current===se.id?"grabbing":"grab"},onMouseDown:ae=>N(se.id,ae),onDblClick:()=>A(se.id),role:"button",tabIndex:0,"aria-label":`Node: ${se.label}${se.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&re.push(o("text",{key:`label-${se.id}`,x:String(se.x),y:String(se.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},se.label))}return re},[z,s,d,A]),te=v(()=>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]),G=v(()=>{if(!x||x.length===0)return[];let re=[];for(let ee=0;ee<x.length;ee++){let se=x[ee],ae=D.current.get(se.nodeId);if(!ae||ae.length<2)continue;let K=[];for(let Z=0;Z<ae.length;Z++){let le=ae[Z];K.push(`${Z===0?"M":"L"}${le.x.toFixed(1)},${le.y.toFixed(1)}`)}re.push(o("path",{key:`trail-${se.nodeId}`,d:K.join(" "),fill:"none",stroke:se.color??"#3b82f6","stroke-width":String(se.width??1),opacity:String(se.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return re},[z,x]),_=U(),O=G(),Y=J(),q=ne(),Q=te();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:$,onMouseUp:B,onMouseLeave:H},..._,...Q,...O,...Y,...q)}var Bi=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function Oi(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=Bi,title:b}=e,m=i==="vertical",c=b?30:0,g=120,f=X(()=>{let F=0;for(let T=0;T<t.length;T++)t[T].value>F&&(F=t[T].value);return F>0?F:1},[t]),y=v(F=>f===0?0:Math.max(.05,F/f),[f]),h=v((F,T)=>T||(u[F%u.length]??Bi[0]),[u]),p=v(()=>{if(t.length===0)return[];let F=[],T=40,P=n-T*2-g,L=r-c-T*2,D=d*(t.length-1),W=Math.max(1,(L-D)/t.length),A=T+P/2;for(let k=0;k<t.length;k++){let w=t[k],E=k<t.length-1?t[k+1]:null,M=h(k,w.color),N=y(w.value),$=E!==null?y(E.value):N*.6,B=P/2*N,H=P/2*$,V=c+T+k*(W+d),U=A-B,J=A+B,ne=A+H,te=A-H,G=`${U},${V} ${J},${V} ${ne},${V+W} ${te},${V+W}`;F.push(o("polygon",{key:`section-${k}`,points:G,fill:M,stroke:"#fff","stroke-width":"1"}));let _=T+P+12,O=V+W/2;if(s&&F.push(o("text",{key:`label-${k}`,x:String(_),y:String(O-(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 q=t[0].value,Q=q>0?Math.round(w.value/q*100):0;Y+=a?` (${Q}%)`:`${Q}%`}F.push(o("text",{key:`value-${k}`,x:String(_),y:String(O+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},Y))}}return F},[t,n,r,c,d,s,a,l,h,y,g]),x=v(()=>{if(t.length===0)return[];let F=[],T=40,P=n-T*2,D=r-c-T*2-40,W=d*(t.length-1),A=Math.max(1,(P-W)/t.length),k=c+T+D/2;for(let w=0;w<t.length;w++){let E=t[w],M=w<t.length-1?t[w+1]:null,N=h(w,E.color),$=y(E.value),B=M!==null?y(M.value):$*.6,H=D/2*$,V=D/2*B,U=T+w*(A+d),J=k-H,ne=k-V,te=k+V,G=k+H,_=`${U},${J} ${U+A},${ne} ${U+A},${te} ${U},${G}`;F.push(o("polygon",{key:`section-${w}`,points:_,fill:N,stroke:"#fff","stroke-width":"1"}));let O=U+A/2,Y=c+T+D+14;if(s&&F.push(o("text",{key:`label-${w}`,x:String(O),y:String(Y),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},E.label)),a||l){let q="";if(a&&(q=String(E.value)),l&&t.length>0){let Q=t[0].value,re=Q>0?Math.round(E.value/Q*100):0;q+=a?` (${re}%)`:`${re}%`}F.push(o("text",{key:`value-${w}`,x:String(O),y:String(Y+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},q))}}return F},[t,n,r,c,d,s,a,l,h,y]),S=v(()=>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]),z=v(()=>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=S(),C=m?p():x(),I=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Funnel chart",style:{fontFamily:"sans-serif"}},...R,...C,...I)}var Hi=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function _i(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 ed(e,t){return t||Hi[e%Hi.length]}function Yi(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,g=X(()=>{let L=1/0,D=-1/0;for(let W of t){W.start<L&&(L=W.start);let A=W.start+W.duration;A>D&&(D=A)}return L===1/0&&(L=0,D=1),{min:L,max:D,range:D-L}},[t]),f=X(()=>{let L=t.slice();return L.sort((D,W)=>D.group!==W.group?(D.group??"").localeCompare(W.group??""):D.start-W.start),L},[t]),y=r??m*2+f.length*(i+s)+s+20,h=n-m-c-m,p=m+(b?20:0),x=v(L=>g.range===0?c+m:c+m+(L-g.min)/g.range*h,[g,h,c,m]),S=v(()=>{if(!a)return[];let L=[],D=_i(g.range),W=Math.ceil(g.min/D)*D,A=p+f.length*(i+s)+s;for(let k=W;k<=g.max;k+=D){let w=x(k);L.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 L},[a,g,p,f.length,i,s,x]),z=v(()=>{let L=[],D=_i(g.range),W=Math.ceil(g.min/D)*D,A=p-8;for(let k=W;k<=g.max;k+=D){let w=x(k);L.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 L.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)),L},[g,p,x,u,n,m]),R=v(()=>{let L=[],D="";for(let W=0;W<f.length;W++){let A=f[W],k=p+W*(i+s)+s,w=x(A.start),E=Math.max(2,x(A.start+A.duration)-w),M=ed(W,A.color);A.group&&A.group!==D&&(D=A.group,l&&L.push(o("text",{key:`group-${W}`,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))),L.push(o("rect",{key:`bar-${A.id}`,x:String(w),y:String(k),width:String(E),height:String(i),rx:"4",ry:"4",fill:M,role:"graphics-symbol","aria-label":`${A.label}: start ${A.start}, duration ${A.duration}`})),l&&L.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&&E>30&&L.push(o("text",{key:`prog-${A.id}`,x:String(w+E/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 L},[f,p,i,s,x,l,d,c,m]),C=v(()=>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]),I=S(),F=z(),T=R(),P=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"}},...P,...I,...F,...T)}var td=Math.PI/180;function nd(e){return e*td}function De(e,t,n,r){let i=nd(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Vi(e,t,n,r,i){let s=De(e,t,n,i),a=De(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 od(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 Gi(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:g,unit:f,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:h="#374151",backgroundColor:p="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,S=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,z=isFinite(t)&&!isNaN(t)?od(t,x,S):x,R=(u?24:0)+(g?18:0),C=i/2,I=(s-R)*.6,F=Math.min(i/2,(s-R)*.55)-d/2-10,T=F-d,P=F-d/2,L=l-a,D=v(G=>{let _=S-x;if(_===0)return a;let O=(G-x)/_;return a+O*L},[x,S,a,L]),W=v(()=>{let G=Vi(C,I,P,a,l);return[o("path",{key:"bg-arc",d:G,fill:"none",stroke:p,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,I,P,a,l,p,d]),A=v(()=>{if(y.length===0)return[];let G=[],_=L/y.length;for(let O=0;O<y.length;O++){let Y=a+O*_,q=Y+_,Q=Vi(C,I,P,Y,q);G.push(o("path",{key:`seg-${O}`,d:Q,fill:"none",stroke:y[O],"stroke-width":String(d),"stroke-linecap":O===0||O===y.length-1?"round":"butt",opacity:"0.85"}))}return G},[y,L,a,C,I,P,d]),k=v(()=>{if(!m||c<=0)return[];let G=[],_=Math.max(1,Math.min(c,100));for(let O=0;O<=_;O++){let Y=O/_,q=a+Y*L,Q=O%2===0,re=Q?10:6,ee=De(C,I,F+4,q),se=De(C,I,F+4+re,q);if(G.push(o("line",{key:`tick-${O}`,x1:String(ee.x),y1:String(ee.y),x2:String(se.x),y2:String(se.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let ae=x+Y*(S-x),K=De(C,I,F+4+re+12,q);G.push(o("text",{key:`tick-label-${O}`,x:String(K.x),y:String(K.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},_e(ae)))}}return G},[m,c,a,L,C,I,F,x,S]),w=v(()=>{let G=[],_=D(z),O=T-8,Y=De(C,I,O,_),q=6,Q=_+90,re=_-90,ee=De(C,I,q,Q),se=De(C,I,q,re);return G.push(o("polygon",{key:"needle",points:`${Y.x},${Y.y} ${ee.x},${ee.y} ${se.x},${se.y}`,fill:h,stroke:"none"})),G.push(o("circle",{key:"needle-cap",cx:String(C),cy:String(I),r:"8",fill:h,stroke:"#fff","stroke-width":"2"})),G},[z,D,C,I,T,h]),E=v(()=>{if(!u)return[];let G=[],_=_e(z),O=_+(f?" "+f:""),Y=I+P+20;return G.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: ${O}`},_,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),G},[u,z,f,C,I,P]),M=v(()=>{if(!g)return[];let G=I+P+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(G),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},g)]},[g,C,I,P,u]),N=v(()=>{if(!b)return[];let G=[],_=De(C,I,P,a),O=De(C,I,P,l);return G.push(o("text",{key:"min-label",x:String(_.x-4),y:String(_.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},_e(x))),G.push(o("text",{key:"max-label",x:String(O.x+4),y:String(O.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},_e(S))),G},[b,C,I,P,a,l,x,S]),$=W(),B=A(),H=k(),V=w(),U=E(),J=M(),ne=N(),te=`Gauge: ${_e(z)}${f?" "+f:""}, range ${_e(x)} to ${_e(S)}${g?", "+g:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(z),"aria-valuemin":String(x),"aria-valuemax":String(S),"aria-label":te,style:{fontFamily:"sans-serif"}},...$,...B,...H,...V,...U,...J,...ne)}var ft={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,-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 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function Ui(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:b="Map of the United States"}=e,m=X(()=>Object.keys(ft),[]),c=v(p=>{l&&l(p)},[l]),g=v((p,x)=>{let S=x.currentTarget;S&&S.setAttribute("fill",u),d&&d(p)},[d,u]),f=v((p,x)=>{let S=x.currentTarget;if(S){let z=r[p]??i;S.setAttribute("fill",z)}d&&d(null)},[d,r,i]),y=X(()=>{let p=[];for(let x=0;x<m.length;x++){let S=m[x],z=ft[S],R=r[S]??i,C={key:`state-${S}`,d:z.path,fill:R,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":S,role:"img","aria-label":z.name,style:{cursor:l?"pointer":"default"}};if(l){let F=S;C.onClick=()=>c(F),C.onKeyDown=T=>{(T.key==="Enter"||T.key===" ")&&c(F)},C.tabindex=0,C.role="button",C["aria-label"]=z.name}let I=S;C.onMouseOver=F=>g(I,F),C.onMouseOut=F=>f(I,F),p.push(o("path",C))}return p},[m,r,i,s,a,l,c,g,f]),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 Tn(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 rd(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 id(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=Tn(t[i]),l=Tn(t[i+1]);return rd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function sd(e){let{r:t,g:n,b:r}=Tn(e);return(.299*t+.587*n+.114*r)/255}var ad=["#3b82f6","#fbbf24","#ef4444"];function ji(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=ad,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:b="#fff",cellBorderWidth:m=1,title:c,padding:g=60}=e,f=t.length,y=X(()=>{let k=0;for(let w of t)w.length>k&&(k=w.length);return k},[t]),{minVal:h,maxVal:p}=X(()=>{let k=l??1/0,w=d??-1/0;for(let E of t)for(let M of E)l===void 0&&M<k&&(k=M),d===void 0&&M>w&&(w=M);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,S=n?g:20,z=r?g:20,R=i-S-20,C=s-x-z-20,I=y>0?R/y:0,F=f>0?C/f:0,T=v(()=>{let k=[];for(let w=0;w<f;w++){let E=t[w];for(let M=0;M<y;M++){let N=M<E.length?E[M]:0,$=(N-h)/(p-h),B=id($,a),H=S+M*I,V=x+20+w*F;if(k.push(o("rect",{key:`cell-${w}-${M}`,x:String(H),y:String(V),width:String(I),height:String(F),fill:B,stroke:b,"stroke-width":String(m)})),u){let U=sd(B)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${M}`,x:String(H+I/2),y:String(V+F/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,I*.3,F*.4)),"font-family":"sans-serif",fill:U},String(Math.round(N*100)/100)))}}}return k},[t,f,y,h,p,a,I,F,S,x,u,b,m]),P=v(()=>{let k=[];if(n)for(let w=0;w<f;w++){let E=w<n.length?n[w]:"",M=x+20+w*F+F/2;k.push(o("text",{key:`row-label-${w}`,x:String(S-8),y:String(M),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},E))}if(r)for(let w=0;w<y;w++){let E=w<r.length?r[w]:"",M=S+w*I+I/2,N=x+20+f*F+16;k.push(o("text",{key:`col-label-${w}`,x:String(M),y:String(N),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},E))}return k},[n,r,f,y,I,F,S,x]),L=v(()=>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 D=L(),W=T(),A=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"}},...D,...W,...A)}function ld(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 cd(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 An(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Xi(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,g=Math.max(1,Math.round(n)),f=X(()=>ld(t,g),[t,g]),y=X(()=>{let D=0;for(let W=0;W<f.length;W++)f[W].count>D&&(D=f[W].count);return D>0?D:1},[f]),h=r-c*2,p=i-c*2,x=v(()=>{if(!l)return[];let D=cd(y),W=[];for(let A=D;A<=y;A+=D){let k=c+p-A/y*p;W.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"})),W.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 W},[l,y,c,h,p]),S=v(()=>{let D=[];return D.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"})),D.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"})),D},[c,h,p]),z=v(()=>{if(f.length===0)return[];let D=[],W=a*(f.length-1),A=Math.max(1,(h-W)/f.length);for(let k=0;k<f.length;k++){let w=f[k],E=w.count/y*p,M=c+k*(A+a),N=c+p-E;if(D.push(o("rect",{key:`bar-${k}`,x:String(M),y:String(N),width:String(A),height:String(E),fill:s})),d&&w.count>0&&D.push(o("text",{key:`val-${k}`,x:String(M+A/2),y:String(N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(w.count))),f.length<=15||k%2===0||k===f.length-1){let B=(f.length===1,An(w.min));D.push(o("text",{key:`xlabel-${k}`,x:String(M+A/2),y:String(c+p+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},B))}}if(f.length>0){let k=f[f.length-1],w=c+h;D.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"},An(k.max)))}return D},[f,y,a,s,d,c,h,p]),R=v(()=>{let D=[];return u&&D.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&&D.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&&D.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)),D},[u,b,m,r,i,c,h,p]),C=v(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),I=x(),F=S(),T=z(),P=R(),L=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"}},...P,...I,...F,...T,...L)}function dd(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 qi(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,g=i==="vertical",f=g?30:0,y=n-c*2,h=r-c*2-f,p=g?h:y,x=g?y:h,S=X(()=>{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]),z=X(()=>t.length===0?0:x/t.length,[t.length,x]),R=v(()=>{if(!u)return[];let k=dd(S),w=[];for(let E=k;E<=S;E+=k){let M=E/S*p;if(g){let N=c+h-M;w.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"})),w.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+M;w.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"})),w.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 w},[u,S,g,c,y,h,p]),C=v(()=>{let k=[];return g?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},[g,c,y,h]),I=v(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let E=t[w],M=E.value/S*p,N=z*w+z/2,$=E.color??d;if(g){let B=c+N,H=c+h,V=c+h-M;k.push(o("line",{key:`stem-${w}`,x1:String(B),y1:String(H),x2:String(B),y2:String(V),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(B),cy:String(V),r:String(l),fill:$})),b&&k.push(o("text",{key:`val-${w}`,x:String(B),y:String(V-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(E.value)));let U=B,J=c+h+16;k.push(o("text",{key:`cat-${w}`,x:String(U),y:String(J),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${J})`},E.label))}else{let B=c+N,H=c,V=c+M;k.push(o("line",{key:`stem-${w}`,x1:String(H),y1:String(B),x2:String(V),y2:String(B),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(V),cy:String(B),r:String(l),fill:$})),b&&k.push(o("text",{key:`val-${w}`,x:String(V+l+4),y:String(B+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(E.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"},E.label))}}return k},[t,S,z,d,l,s,a,b,g,c,y,h,p]),F=v(()=>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]),T=v(()=>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=R(),L=C(),D=I(),W=F(),A=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??"Lollipop chart",style:{fontFamily:"sans-serif"}},...W,...P,...L,...D,...A)}function Ln(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 ud(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 pd(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=Ln(t[i]),l=Ln(t[i+1]);return ud(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function fd(e){let{r:t,g:n,b:r}=Ln(e);return(.299*t+.587*n+.114*r)/255}var gd=["#f0f9ff","#3b82f6","#1e3a8a"];function Ki(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=gd,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:b="#e5e7eb",title:m,padding:c=70,symmetric:g=!1}=e,f=r??n,y=i??n,h=t.length,p=X(()=>{let $=0;for(let B of t)B.length>$&&($=B.length);return $},[t]),x=X(()=>{if(!g||h===0)return t;let $=[],B=Math.max(h,p);for(let H=0;H<B;H++){let V=[];for(let U=0;U<B;U++){let J=t[H],ne=J&&U<J.length?J[U]:0,te=t[U],G=te&&H<te.length?te[H]:0;ne!==0?V.push(ne):V.push(G)}$.push(V)}return $},[t,g,h,p]),S=x.length,z=X(()=>{let $=0;for(let B of x)B.length>$&&($=B.length);return $},[x]),{minVal:R,maxVal:C}=X(()=>{let $=1/0,B=-1/0;for(let H of x)for(let V of H)V<$&&($=V),V>B&&(B=V);return $===1/0&&($=0),B===-1/0&&(B=1),$===B&&(B=$+1),{minVal:$,maxVal:B}},[x]),I=m?30:0,F=f?c:20,T=y?c:20,P=s-F-20,L=a-I-T-20,D=z>0?P/z:0,W=S>0?L/S:0,A=v(()=>{let $=[];for(let B=0;B<S;B++){let H=x[B];for(let V=0;V<z;V++){let U=V<H.length?H[V]:0,J=(U-R)/(C-R),ne=pd(J,l),te=F+V*D,G=I+20+B*W,_=B===V,O=_&&u?"currentColor":b,Y=_&&u?"2":"1";if($.push(o("rect",{key:`cell-${B}-${V}`,x:String(te),y:String(G),width:String(D),height:String(W),fill:ne,stroke:O,"stroke-width":Y})),d){let q=fd(ne)>.5?"#111827":"#ffffff",Q=Math.min(12,D*.3,W*.35);$.push(o("text",{key:`val-${B}-${V}`,x:String(te+D/2),y:String(G+W/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":_&&u?"bold":"normal","font-family":"sans-serif",fill:q},String(Math.round(U*100)/100)))}}}return $},[x,S,z,R,C,l,D,W,F,I,d,u,b]),k=v(()=>{let $=[];if(f)for(let B=0;B<S;B++){let H=B<f.length?f[B]:"",V=I+20+B*W+W/2;$.push(o("text",{key:`row-label-${B}`,x:String(F-8),y:String(V),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}if(y)for(let B=0;B<z;B++){let H=B<y.length?y[B]:"",V=F+B*D+D/2,U=I+20+S*W+12;$.push(o("text",{key:`col-label-${B}`,x:String(V),y:String(U),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}return $},[f,y,S,z,D,W,F,I]),w=v(()=>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||z===0)return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":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=w(),M=A(),N=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,...M,...N)}var md=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Lt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function hd(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 bd(e,t,n,r,i,s,a){let l=[];if(Lt(e)<=0)return l;let b=hd(e)+1,m=s==="horizontal",c=m?i/b:r/b,g=[];for(g.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});g.length>0;){let f=g.shift(),{node:y,depth:h,spanStart:p,spanEnd:x,colorIndex:S}=f,z=Lt(y);if(z<=0)continue;let R=x-p,C,I,F,T;if(m?(C=p,I=n+h*c,F=R,T=c):(C=t+h*c,I=p,F=c,T=R),l.push({x:C,y:I,w:F,h:T,label:y.label,value:z,color:y.color??a[S%a.length],depth:h}),y.children&&y.children.length>0){let P=p;for(let L=0;L<y.children.length;L++){let D=y.children[L],W=Lt(D);if(W<=0)continue;let A=W/z*R;g.push({node:D,depth:h+1,spanStart:P,spanEnd:P+A,colorIndex:h===0?L:S}),P+=A}}}return l}function Zi(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=md,borderColor:d="#ffffff",borderWidth:u=1,title:b,padding:m=10}=e,c=b?30:0,g=m,f=m+c,y=n-m*2,h=r-m*2-c;if(X(()=>Lt(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=X(()=>bd(t,g,f,y,h,i,l),[t,g,f,y,h,i,l]),S=[];b&&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"},b));for(let z=0;z<x.length;z++){let R=x[z];if(S.push(o("rect",{key:`cell-${z}`,x:String(R.x),y:String(R.y),width:String(Math.max(0,R.w)),height:String(Math.max(0,R.h)),fill:R.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${R.label}: ${R.value}`})),s&&R.w>20&&R.h>14){let C=Math.floor(R.w/7),I=R.label.length>C?R.label.substring(0,Math.max(1,C-2))+"..":R.label;S.push(o("text",{key:`label-${z}`,x:String(R.x+R.w/2),y:String(R.y+R.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},I))}a&&R.w>30&&R.h>28&&S.push(o("text",{key:`value-${z}`,x:String(R.x+R.w/2),y:String(R.y+R.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(R.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"}},...S)}function Fn(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Ji(e,t){let n=new Set;for(let i of e)n.add(Fn(i,t));let r=Array.from(n);return r.sort(),r}function Ft(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 Nt(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function xd(e,t,n,r,i){let s=Ji(e,t),a=Ji(e,n),l=new Map;for(let g of e){let f=Fn(g,t),y=Fn(g,n),h=`${f}::${y}`;l.has(h)||l.set(h,[]);let p=l.get(h),x=0;for(let S of r){let z=g[S];if(typeof z=="number")x+=z;else if(typeof z=="string"){let R=parseFloat(z);isNaN(R)||(x+=R)}}p.push(x)}let d=new Map;for(let[g,f]of l)d.set(g,Ft(f,i));let u=new Map;for(let g of s){let f=[];for(let y of a){let h=d.get(`${g}::${y}`);h!==void 0&&f.push(h)}u.set(g,Ft(f,i==="count"?"sum":i))}let b=new Map;for(let g of a){let f=[];for(let y of s){let h=d.get(`${y}::${g}`);h!==void 0&&f.push(h)}b.set(g,Ft(f,i==="count"?"sum":i))}let m=[];for(let g of u.values())m.push(g);let c=Ft(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:b,grandTotal:c}}function Qi(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=X(()=>xd(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:g,colKeys:f,cells:y,rowTotals:h,colTotals:p,grandTotal:x}=c,S=u?30:0,z=f.length+(d?1:0),R=g.length+(d?1:0),C=1+z,I=1+R,F=Math.max(40,(a-m*2)/C),T=Math.max(20,Math.min(36,(l-S-m*2)/I)),P=F*C,L=T*I,D=Math.max(0,(a-P)/2),W=S+Math.max(0,(l-S-L)/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(D),y:String(W),width:String(P),height:String(T),fill:b})),A.push(o("rect",{key:"header-col-bg",x:String(D),y:String(W+T),width:String(F),height:String(T*R),fill:b,opacity:"0.85"})),A.push(o("text",{key:"corner",x:String(D+F/2),y:String(W+T/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let k=0;k<f.length;k++){let w=D+(k+1)*F,E=Math.floor(F/7),M=f[k],N=M.length>E?M.substring(0,Math.max(1,E-2))+"..":M;A.push(o("text",{key:`ch-${k}`,x:String(w+F/2),y:String(W+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N))}d&&A.push(o("text",{key:"ch-total",x:String(D+(f.length+1)*F+F/2),y:String(W+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<g.length;k++){let w=g[k],E=W+(k+1)*T;k%2===0&&A.push(o("rect",{key:`row-bg-${k}`,x:String(D+F),y:String(E),width:String(F*z),height:String(T),fill:"#f9fafb"}));let M=Math.floor(F/7),N=w.length>M?w.substring(0,Math.max(1,M-2))+"..":w;A.push(o("text",{key:`rh-${k}`,x:String(D+F/2),y:String(E+T/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=`${w}::${B}`,V=y.get(H),U=D+($+1)*F;A.push(o("rect",{key:`border-${k}-${$}`,x:String(U),y:String(E),width:String(F),height:String(T),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),A.push(o("text",{key:`cell-${k}-${$}`,x:String(U+F/2),y:String(E+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},V!==void 0?Nt(V):"-"))}if(d){let $=D+(f.length+1)*F,B=h.get(w)??0;A.push(o("rect",{key:`rt-bg-${k}`,x:String($),y:String(E),width:String(F),height:String(T),fill:"#eff6ff"})),A.push(o("text",{key:`rt-${k}`,x:String($+F/2),y:String(E+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Nt(B)))}}if(d){let k=W+(g.length+1)*T;A.push(o("rect",{key:"total-row-bg",x:String(D),y:String(k),width:String(P),height:String(T),fill:"#eff6ff"})),A.push(o("text",{key:"total-label",x:String(D+F/2),y:String(k+T/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 M=f[E],N=p.get(M)??0,$=D+(E+1)*F;A.push(o("text",{key:`ct-${E}`,x:String($+F/2),y:String(k+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Nt(N)))}let w=D+(f.length+1)*F;A.push(o("text",{key:"grand-total",x:String(w+F/2),y:String(k+T/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Nt(x)))}return A.push(o("rect",{key:"outer-border",x:String(D),y:String(W),width:String(P),height:String(L),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 Wt(e,t){return Math.PI*2*e/t-Math.PI/2}function Bt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function es(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,g=m?30:0,f=d&&n.length>0?30:0,y=60,h=Math.min((r-y*2)/2,(i-y*2-g-f)/2),p=r/2,x=y+g+h,S=X(()=>{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 E=0;for(let M of n){let N=M.values[k];N!==void 0&&N>E&&(E=N)}A.push(E>0?E:1)}return A},[t,n,c]),z=v(()=>{if(c<3)return[];let A=[];for(let k=1;k<=s;k++){let w=h*k/s,E=[];for(let M=0;M<c;M++){let N=Wt(M,c),$=Bt(p,x,w,N);E.push(`${$.x},${$.y}`)}A.push(o("polygon",{key:`ring-${k}`,points:E.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=Wt(k,c),E=Bt(p,x,h,w);A.push(o("line",{key:`spoke-${k}`,x1:String(p),y1:String(x),x2:String(E.x),y2:String(E.y),stroke:b,"stroke-width":"0.75"}))}return A},[c,s,h,p,x,b]),R=v(()=>{if(!a||c<3)return[];let A=[],k=16;for(let w=0;w<c;w++){let E=Wt(w,c),M=Bt(p,x,h+k,E),N="middle";M.x<p-5?N="end":M.x>p+5&&(N="start");let $=Math.abs(M.y-x)<5?"0.35em":M.y<x?"0em":"0.7em";A.push(o("text",{key:`label-${w}`,x:String(M.x),y:String(M.y),"text-anchor":N,dy:$,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return A},[a,c,t,h,p,x]),C=v(()=>{if(c<3||n.length===0)return[];let A=[];for(let k=0;k<n.length;k++){let w=n[k],E=[],M=[],N=[];for(let $=0;$<c;$++){let B=w.values[$]??0,H=S[$],V=Math.min(B/H,1),U=h*V,J=Wt($,c),ne=Bt(p,x,U,J);E.push(`${ne.x},${ne.y}`),u&&M.push(o("circle",{key:`dot-${k}-${$}`,cx:String(ne.x),cy:String(ne.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&N.push(o("text",{key:`val-${k}-${$}`,x:String(ne.x),y:String(ne.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:E.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),A.push(o("polygon",{key:`series-line-${k}`,points:E.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let $ of M)A.push($);for(let $ of N)A.push($)}return A},[c,n,S,h,p,x,u,l]),I=v(()=>{if(!d||n.length===0)return[];let A=[],k=x+h+40,w=100,E=n.length*w,M=p-E/2;for(let N=0;N<n.length;N++){let $=n[N],B=M+N*w;A.push(o("rect",{key:`legend-swatch-${N}`,x:String(B),y:String(k),width:"12",height:"12",rx:"2",fill:$.color})),A.push(o("text",{key:`legend-text-${N}`,x:String(B+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},$.label))}return A},[d,n,p,x,h]),F=v(()=>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 T=z(),P=R(),L=C(),D=I(),W=F();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,...T,...P,...L,...D)}var yd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Sd(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 vd(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(P=>P.value>0),m=e.map(P=>P.id),c=Sd(m,b),g=new Map,f=new Map;for(let P of m)g.set(P,0),f.set(P,0);for(let P of b)f.set(P.source,(f.get(P.source)??0)+P.value),g.set(P.target,(g.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,L]of c)h.get(L).push(P);let p=new Map,x=y>0?(d-i)/y:0;for(let P=0;P<=y;P++)p.set(P,a+P*x);let S=new Map;for(let P=0;P<e.length;P++)S.set(e[P].id,e[P]);let z=[],R=new Map;for(let P=0;P<=y;P++){let L=h.get(P);if(L.length===0)continue;let D=0;for(let w of L){let E=g.get(w)??0,M=f.get(w)??0;D+=Math.max(E,M,1)}let W=u-s*(L.length-1),A=D>0?W/D:1,k=a;for(let w=0;w<L.length;w++){let E=L[w],M=S.get(E),N=g.get(E)??0,$=f.get(E)??0,B=Math.max(N,$,1),H=Math.max(4,B*A),V=e.findIndex(J=>J.id===E),U={id:E,label:M.label,color:M.color??l[V%l.length],column:P,x:p.get(P),y:k,height:H,totalIn:N,totalOut:$,totalValue:B};z.push(U),R.set(E,U),k+=H+s}}let C=new Map,I=new Map;for(let P of m)C.set(P,0),I.set(P,0);let F=[...b].sort((P,L)=>L.value-P.value),T=[];for(let P of F){let L=R.get(P.source),D=R.get(P.target);if(!L||!D)continue;let W=L.totalOut||1,A=D.totalIn||1,k=P.value/W*L.height,w=P.value/A*D.height,E=Math.max(1,(k+w)/2),M=C.get(P.source),N=I.get(P.target),$=L.y+M+k/2,B=D.y+N+w/2;C.set(P.source,M+k),I.set(P.target,N+w);let H=S.get(P.source);T.push({source:P.source,target:P.target,value:P.value,color:P.color??H?.color??L.color,sourceY:$,targetY:B,width:E})}return{layoutNodes:z,layoutLinks:T}}function ts(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=yd,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 g=X(()=>vd(t,n,r,i,s,a,c,b),[t,n,r,i,s,a,c,b]),f=v(()=>{let z=[];for(let R=0;R<g.layoutLinks.length;R++){let C=g.layoutLinks[R],I=g.layoutNodes.find(W=>W.id===C.source),F=g.layoutNodes.find(W=>W.id===C.target);if(!I||!F)continue;let T=I.x+s,P=F.x,L=(T+P)/2,D=`M ${T} ${C.sourceY} C ${L} ${C.sourceY}, ${L} ${C.targetY}, ${P} ${C.targetY}`;z.push(o("path",{key:`link-${R}`,d:D,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&z.push(o("text",{key:`link-val-${R}`,x:String(L),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 z},[g,s,u,d]),y=v(()=>{let z=[];for(let R=0;R<g.layoutNodes.length;R++){let C=g.layoutNodes[R];if(z.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 I=g.layoutNodes.reduce((A,k)=>Math.max(A,k.column),0),F=C.column===I,T=F?C.x+s+6:C.x-6,P=F?"start":"end",L=C.column===0,D=L?C.x-6:T,W=L?"end":P;z.push(o("text",{key:`label-${C.id}`,x:String(D),y:String(C.y+C.height/2+4),"text-anchor":W,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},C.label))}}return z},[g,s,l]),h=v(()=>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=f(),x=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,...p,...x)}var wd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Nn=2*Math.PI;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 kd(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 Cd(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),g=t+r*Math.sin(u),f=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>=Nn-.001){let x=d+Math.PI,S=e+r*Math.cos(x),z=t+r*Math.sin(x),R=e+n*Math.cos(x),C=t+n*Math.sin(x);return[`M ${b} ${m}`,`A ${r} ${r} 0 1 1 ${S} ${z}`,`A ${r} ${r} 0 1 1 ${b} ${m}`,`L ${h} ${p}`,`A ${n} ${n} 0 1 0 ${R} ${C}`,`A ${n} ${n} 0 1 0 ${h} ${p}`,"Z"].join(" ")}return[`M ${b} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${g}`,`L ${f} ${y}`,`A ${n} ${n} 0 ${l} 0 ${h} ${p}`,"Z"].join(" ")}function Md(e,t,n,r){let i=[],s=gt(e);if(s<=0)return i;let a=kd(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=gt(m);if(c<=0)continue;let g=c/s*Nn;d.push({node:m,startAngle:u,endAngle:u+g,depth:0,colorIndex:b}),u+=g}}else return i.push({startAngle:0,endAngle:Nn,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:g,colorIndex:f}=u,y=gt(b);if(y<=0)continue;let h=t+g*l,p=h+l;if(i.push({startAngle:m,endAngle:c,innerR:h,outerR:p,label:b.label,value:y,color:b.color??r[f%r.length],depth:g}),b.children&&b.children.length>0){let x=m,S=c-m;for(let z=0;z<b.children.length;z++){let R=b.children[z],C=gt(R);if(C<=0)continue;let I=C/y*S;d.push({node:R,startAngle:x,endAngle:x+I,depth:g+1,colorIndex:f}),x+=I}}}return i}function ns(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=wd,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,b=n/2,m=r/2,c=u?20:0,g=Math.min(b,m-c)-10;if(X(()=>gt(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=X(()=>Md(t,i,g,a),[t,i,g,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 S=y[x],z=Cd(b,p,S.innerR,S.outerR,S.startAngle,S.endAngle);if(h.push(o("path",{key:`arc-${x}`,d:z,fill:S.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${S.label}: ${S.value}`})),s){let R=S.endAngle-S.startAngle,C=S.startAngle+R/2-Math.PI/2,I=(S.innerR+S.outerR)/2,F=S.outerR-S.innerR,T=R*I;if(T>20&&F>14){let P=b+I*Math.cos(C),L=p+I*Math.sin(C),D=Math.floor(Math.min(T,F)/7),W=S.label.length>D?S.label.substring(0,Math.max(1,D-1))+"..":S.label;h.push(o("text",{key:`label-${x}`,x:String(P),y:String(L+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":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...h)}var Ed=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ot(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 os(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 Pd(e,t,n,r,i,s){let a=[],l=[],d=Ot(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 g=u[c],f=Ot(g);f<=0||m.push({label:g.label,value:f,area:f/d*b,color:g.color??s[c%s.length],node:g})}for(m.sort((c,g)=>g.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:g,rect:f,depth:y}=c;if(g.length===0)continue;let h={...f},p=0;for(;p<g.length&&h.w>0&&h.h>0;){let x=h.w>=h.h,S=x?h.h:h.w,z=[],R=[];z.push(g[p]),R.push(g[p].area),p++;let C=os(R,S);for(;p<g.length;){let P=[...R,g[p].area],L=os(P,S);if(L>C)break;z.push(g[p]),R.push(g[p].area),C=L,p++}let I=0;for(let P of R)I+=P;let F=S>0?I/S:0,T=0;for(let P=0;P<z.length;P++){let L=z[P],D=F>0?L.area/F:0,W,A,k,w;if(x?(W=h.x,A=h.y+T,k=F,w=D):(W=h.x+T,A=h.y,k=D,w=F),a.push({x:W,y:A,w:k,h:w,label:L.label,value:L.value,color:L.color,depth:y}),L.node.children&&L.node.children.length>0){let M=W+2,N=A+2+14,$=k-4,B=w-4-14;if($>4&&B>4){let H=[],V=L.value,U=$*B;for(let J=0;J<L.node.children.length;J++){let ne=L.node.children[J],te=Ot(ne);te<=0||H.push({label:ne.label,value:te,area:te/V*U,color:ne.color??s[(J+y+1)%s.length],node:ne})}H.sort((J,ne)=>ne.area-J.area),l.push({nodes:H,rect:{x:M,y:N,w:$,h:B},depth:y+1})}}T+=D}x?h={x:h.x+F,y:h.y,w:h.w-F,h:h.h}:h={x:h.x,y:h.y+F,w:h.w,h:h.h-F}}}return a}function rs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Ed,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:b}=e,m=b?30:0,c=u,g=u+m,f=n-u*2,y=r-u*2-m;if(X(()=>Ot(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":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=X(()=>Pd(t,c,g,f,y,a),[t,c,g,f,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 S=0;S<p.length;S++){let z=p[S];if(x.push(o("rect",{key:`cell-${S}`,x:String(z.x),y:String(z.y),width:String(Math.max(0,z.w)),height:String(Math.max(0,z.h)),fill:z.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${z.label}: ${z.value}`})),i&&z.w>20&&z.h>14){let R=Math.floor(z.w/7),C=z.label.length>R?z.label.substring(0,Math.max(1,R-2))+"..":z.label;x.push(o("text",{key:`label-${S}`,x:String(z.x+4),y:String(z.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&z.w>30&&z.h>28&&x.push(o("text",{key:`value-${S}`,x:String(z.x+4),y:String(z.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(z.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function is(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 Rd(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=is(t[s]),u=is(t[a]);return Rd(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function Ht(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 $d(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 f=[];for(let x=0;x<b;x++)for(let S=0;S<b;S++)f.push({x:i+S*m,y:a+x*c});let h=n(f,{gridSize:b,xMin:i,xMax:s,yMin:a,yMax:l}),p=[];for(let x=0;x<f.length;x++){let S=f[x],z=h[x]??{dx:0,dy:0},R=Math.sqrt(z.dx*z.dx+z.dy*z.dy);p.push({x:S.x,y:S.y,dx:z.dx,dy:z.dy,magnitude:R})}return p}if(!t)return[];let g=[];for(let f=0;f<b;f++)for(let y=0;y<b;y++){let h=i+y*m,p=a+f*c,x=t(h,p),S=Math.sqrt(x.dx*x.dx+x.dy*x.dy);g.push({x:h,y:p,dx:x.dx,dy:x.dy,magnitude:S})}return g}function Id(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:b,yMax:m,xSpan:c,ySpan:g,showGrid:f,showAxes:y,colorByMagnitude:h,colorScale:p,arrowColor:x,arrowWidth:S,effectiveArrowScale:z,maxMagnitude:R,title:C,tickFontSize:I}=i,F=L=>s+(L-d)/c*a,T=L=>s+(m-L)/g*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()),f){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${I}px sans-serif`,e.fillStyle="#6b7280";let L=Ht(c,10),D=Math.ceil(d/L)*L;for(let k=D;k<=u;k+=L){let w=F(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 W=Ht(g,10),A=Math.ceil(b/W)*W;for(let k=A;k<=m;k+=W){let w=T(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=S,b<=0&&m>=0){let L=T(0);e.beginPath(),e.moveTo(s,L),e.lineTo(s+a,L),e.stroke()}if(d<=0&&u>=0){let L=F(0);e.beginPath(),e.moveTo(L,s),e.lineTo(L,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let P=4;for(let L=0;L<r.length;L++){let D=r[L],W=D.magnitude??Math.sqrt(D.dx*D.dx+D.dy*D.dy);if(W<1e-10)continue;let A=F(D.x),k=T(D.y),w=D.dx*z,E=-D.dy*z,M=A+w,N=k+E,$;if(h){let H=W/R;$=ss(H,p)}else $=x;e.save(),e.strokeStyle=$,e.lineWidth=S,e.lineCap="round",e.beginPath(),e.moveTo(A,k),e.lineTo(M,N),e.stroke();let B=Math.sqrt(w*w+E*E);if(B>2){let H=w/B,V=E/B,U=-V,J=H,ne=Math.min(P,B*.4),te=M-H*ne+U*ne*.5,G=N-V*ne+J*ne*.5,_=M-H*ne-U*ne*.5,O=N-V*ne-J*ne*.5;e.fillStyle=$,e.beginPath(),e.moveTo(M,N),e.lineTo(te,G),e.lineTo(_,O),e.closePath(),e.fill()}e.restore()}}function as(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:g=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:y=50,tickFontSize:h=10,arrowWidth:p=1.5,renderer:x="svg",useGPU:S=!1,computeWorker:z}=e,R=Math.max(2,Math.min(50,s)),C=r-y*2,I=i-y*2,F=a[0],T=a[1],P=l[0],L=l[1],D=T-F,W=L-P,A=X(()=>te=>y+(te-F)/D*C,[y,F,D,C]),k=X(()=>te=>y+(L-te)/W*I,[y,L,W,I]),w=X(()=>$d(t,n,z,R,F,T,P,L,D,W),[t,n,z,R,F,T,P,L,D,W]),E=X(()=>{let te=0;for(let G=0;G<w.length;G++){let _=w[G],O=_.magnitude??Math.sqrt(_.dx*_.dx+_.dy*_.dy);O>te&&(te=O)}return te>0?te:1},[w]),M=X(()=>Math.min(C,I)/Math.max(R,2)/(2*E)*d,[C,I,R,E,d]);if(x==="canvas"){let te=oe(null),G=oe(0);return ie(()=>{let _=te.current;if(!_)return;let O=_.getContext("2d");if(O)return G.current&&cancelAnimationFrame(G.current),G.current=requestAnimationFrame(()=>{Id(O,r,i,w,{padding:y,chartWidth:C,chartHeight:I,xMin:F,xMax:T,yMin:P,yMax:L,xSpan:D,ySpan:W,showGrid:b,showAxes:m,colorByMagnitude:c,colorScale:g,arrowColor:u,arrowWidth:p,effectiveArrowScale:M,maxMagnitude:E,title:f,tickFontSize:h})}),()=>{G.current&&cancelAnimationFrame(G.current)}},[w,r,i,y,C,I,F,T,P,L,D,W,b,m,c,g,u,p,M,E,f,h]),o("canvas",{ref:te,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let N=v(()=>{if(!b)return[];let te=[],G=Ht(D,10),_=Math.ceil(F/G)*G;for(let q=_;q<=T;q+=G){let Q=A(q);te.push(o("line",{key:`gridv-${q}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+I),stroke:"#e5e7eb","stroke-width":"0.5"})),te.push(o("text",{key:`xtick-${q}`,x:String(Q),y:String(y+I+16),"text-anchor":"middle","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(q*100)/100)))}let O=Ht(W,10),Y=Math.ceil(P/O)*O;for(let q=Y;q<=L;q+=O){let Q=k(q);te.push(o("line",{key:`gridh-${q}`,x1:String(y),y1:String(Q),x2:String(y+C),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),te.push(o("text",{key:`ytick-${q}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(q*100)/100)))}return te},[b,F,T,P,L,D,W,A,k,y,C,I]),$=v(()=>{if(!m)return[];let te=[];if(P<=0&&L>=0){let G=k(0);te.push(o("line",{key:"axis-x",x1:String(y),y1:String(G),x2:String(y+C),y2:String(G),stroke:"#374151","stroke-width":String(p)}))}if(F<=0&&T>=0){let G=A(0);te.push(o("line",{key:"axis-y",x1:String(G),y1:String(y),x2:String(G),y2:String(y+I),stroke:"#374151","stroke-width":String(p)}))}return te.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String(I),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),te},[m,F,T,P,L,A,k,y,C,I]),B=v(()=>{let te=[];for(let _=0;_<w.length;_++){let O=w[_],Y=O.magnitude??Math.sqrt(O.dx*O.dx+O.dy*O.dy);if(Y<1e-10)continue;let q=A(O.x),Q=k(O.y),re=O.dx*M,ee=-O.dy*M,se=q+re,ae=Q+ee,K;if(c){let le=Y/E;K=ss(le,g)}else K=u;te.push(o("line",{key:`arrow-line-${_}`,x1:String(q),y1:String(Q),x2:String(se),y2:String(ae),stroke:K,"stroke-width":String(p),"stroke-linecap":"round"}));let Z=Math.sqrt(re*re+ee*ee);if(Z>2){let le=re/Z,de=ee/Z,ce=-de,ue=le,fe=Math.min(4,Z*.4),ge=se-le*fe+ce*fe*.5,be=ae-de*fe+ue*fe*.5,ke=se-le*fe-ce*fe*.5,Me=ae-de*fe-ue*fe*.5;te.push(o("polygon",{key:`arrow-head-${_}`,points:`${se},${ae} ${ge},${be} ${ke},${Me}`,fill:K}))}}return te},[w,A,k,M,c,E,g,u]),H=v(()=>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]),V=N(),U=$(),J=B(),ne=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"}},...ne,...V,...U,...J)}function Dd(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 zd(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 ls(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,g=n-c*2,f=r-c*2,y=X(()=>Dd(t),[t]),{minVal:h,maxVal:p}=X(()=>{let E=0,M=0;for(let N=0;N<y.length;N++){let $=y[N];$.start<E&&(E=$.start),$.end<E&&(E=$.end),$.start>M&&(M=$.start),$.end>M&&(M=$.end)}return E===M&&(M=E+1),{minVal:E,maxVal:M}},[y]),x=p-h,S=v(E=>c+f-(E-h)/x*f,[c,f,h,x]),z=X(()=>y.length===0?0:g/y.length,[y.length,g]),R=6,C=Math.max(1,z-R),I=v(()=>{if(!u)return[];let E=zd(x),M=[],N=Math.ceil(h/E)*E;for(let $=N;$<=p;$+=E){let B=S($);M.push(o("line",{key:`grid-${$}`,x1:String(c),y1:String(B),x2:String(c+g),y2:String(B),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),M.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 M},[u,x,h,p,S,c,g]),F=v(()=>{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 M=h<=0&&p>=0?S(0):c+f;return E.push(o("line",{key:"axis-x",x1:String(c),y1:String(M),x2:String(c+g),y2:String(M),stroke:"#374151","stroke-width":"1.5"})),E},[c,g,f,h,p,S]),T=v(()=>{if(y.length===0)return[];let E=[];for(let M=0;M<y.length;M++){let N=y[M],$=c+M*z+R/2,B=Math.max(N.start,N.end),H=Math.min(N.start,N.end),V=S(B),U=S(H),J=Math.max(0,U-V),ne;if(N.type==="total"?ne=a:N.type==="decrease"?ne=s:ne=i,E.push(o("rect",{key:`bar-${M}`,x:String($),y:String(V),width:String(C),height:String(J),fill:ne,rx:"2",ry:"2"})),d){let te=N.type==="decrease"||N.value<0?U+14:V-4,G=N.type==="total"?String(N.value):(N.value>=0?"+":"")+String(N.value);E.push(o("text",{key:`val-${M}`,x:String($+C/2),y:String(te),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},G))}if(E.push(o("text",{key:`cat-${M}`,x:String($+C/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},N.label)),b&&M<y.length-1){let te=y[M+1],G=S(N.end),_=c+(M+1)*z+R/2;te.type!=="total"&&E.push(o("line",{key:`conn-${M}`,x1:String($+C),y1:String(G),x2:String(_),y2:String(G),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return E},[y,z,C,S,i,s,a,l,d,b,c,f]),P=v(()=>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]),L=v(()=>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=I(),W=F(),A=T(),k=P(),w=L();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,...D,...W,...A,...w)}var Td=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Ad=[0,-45,45,90];function Ld(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 Fd(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 Nd(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function Wd(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 cs(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=Td,rotations:d=Ad,padding:u=4,spiral:b="archimedean",title:m}=e,c=X(()=>{if(t.length===0)return[];let f=t.map((C,I)=>({...C,originalIndex:I})).filter(C=>C.text.length>0&&C.weight>0).sort((C,I)=>I.weight-C.weight);if(f.length===0)return[];let y=f[f.length-1].weight,p=f[0].weight-y;function x(C){if(p===0)return(i+s)/2;let I=(C-y)/p;return i+I*(s-i)}let S=[],z=n/2,R=r/2;for(let C=0;C<f.length;C++){let I=f[C],F=x(I.weight),T=d[Wd(I.text)%d.length],P=I.color??l[C%l.length],L=!1,D=500,W=b==="archimedean"?4:5;for(let A=0;A<D;A++){let k,w;if(b==="archimedean"){let H=A*.1,V=W*H;k=V*Math.cos(H),w=V*Math.sin(H)}else{let H=Math.floor(A/4)+1,V=A%4,U=(A%4===0?0:A)*W;switch(V){case 0:k=H*W*4,w=U;break;case 1:k=-U,w=H*W*4;break;case 2:k=-H*W*4,w=-U;break;default:k=U,w=-H*W*4;break}}let E=z+k,M=R+w,N=Ld(I.text,F,T,E,M),$={x:N.x-u,y:N.y-u,w:N.w+u*2,h:N.h+u*2};if(!Nd($,n,r))continue;let B=!1;for(let H of S)if(Fd($,H.bbox)){B=!0;break}if(!B){S.push({text:I.text,x:E,y:M,fontSize:F,rotation:T,color:P,bbox:$}),L=!0;break}}}return S},[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 g=[];m&&g.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})`;g.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}},...g)}var Bd={0:"#1e293b",1:"#3b82f6"},Od="#666";function ds(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:g,title:f}=e,y=n??Bd,h=t.length,p=X(()=>{let E=0;for(let M=0;M<t.length;M++){let N=t[M];N!==void 0&&N.length>E&&(E=N.length)}return E},[t]),x=u?20:0,S=f?24:0,z=X(()=>{let E=r-m*2-x,M=i-m*2-x-S;if(h===0||p===0)return{cellWidth:0,cellHeight:0};let N=Math.max(0,(E-s*(p-1))/p),$=Math.max(0,(M-s*(h-1))/h);return{cellWidth:N,cellHeight:$}},[r,i,m,h,p,s,x,S]),R=v(E=>{let M=y[E];return M!==void 0?M:Od},[y]),C=v(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b}),[r,i,b]),I=v(()=>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]),F=v(()=>{if(!l||h===0||p===0)return[];let{cellWidth:E,cellHeight:M}=z,N=m+x,$=m+x+S,B=p*E+(p-1)*s,H=h*M+(h-1)*s,V=[];for(let U=0;U<=p;U++){let J=N+U*(E+s)-s/2;V.push(o("line",{key:`vgrid-${U}`,x1:String(J),y1:String($-s/2),x2:String(J),y2:String($+H+s/2),stroke:d,"stroke-width":"0.5"}))}for(let U=0;U<=h;U++){let J=$+U*(M+s)-s/2;V.push(o("line",{key:`hgrid-${U}`,x1:String(N-s/2),y1:String(J),x2:String(N+B+s/2),y2:String(J),stroke:d,"stroke-width":"0.5"}))}return V},[l,h,p,z,m,x,S,s,d]),T=v(()=>{if(!u||h===0||p===0)return[];let{cellWidth:E,cellHeight:M}=z,N=m+x,$=m+x+S,B=[];for(let H=0;H<p;H++){let V=N+H*(E+s)+E/2,U=$-6;B.push(o("text",{key:`col-idx-${H}`,x:String(V),y:String(U),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}for(let H=0;H<h;H++){let V=N-6,U=$+H*(M+s)+M/2+3;B.push(o("text",{key:`row-idx-${H}`,x:String(V),y:String(U),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}return B},[u,h,p,z,m,x,S,s]),P=v(()=>{if(h===0||p===0)return[];let{cellWidth:E,cellHeight:M}=z,N=m+x,$=m+x+S,B=[];for(let H=0;H<h;H++){let V=t[H];if(V!==void 0)for(let U=0;U<p;U++){let J=U<V.length?V[U]:0,ne=N+U*(E+s),te=$+H*(M+s),G=R(J),_={key:`cell-${H}-${U}`,x:String(ne),y:String(te),width:String(E),height:String(M),fill:G,rx:String(a),ry:String(a)};if(c){let O=H,Y=U,q=J;_.onClick=()=>c(O,Y,q),_.role="button",_.tabIndex=0}if(g){let O=H,Y=U,q=J;_.onMouseEnter=()=>g(O,Y,q)}B.push(o("rect",_))}}return B},[h,p,t,z,m,x,S,s,a,R,c,g]),L=C(),D=I(),W=F(),A=T(),k=P(),w=f?`${f} \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},L,...D,...W,...A,...k)}