@asymmetric-effort/specifyjs 0.2.145 → 0.2.150

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
- "use strict";var 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=`
2
+ "use strict";var Pt=Object.defineProperty;var zs=Object.getOwnPropertyDescriptor;var As=Object.getOwnPropertyNames;var Ls=Object.prototype.hasOwnProperty;var Fs=(e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ns=(e,t)=>{for(var n in t)Pt(e,n,{get:t[n],enumerable:!0})},Ws=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of As(t))!Ls.call(e,i)&&i!==n&&Pt(e,i,{get:()=>t[i],enumerable:!(r=zs(t,i))||r.enumerable});return e};var Bs=e=>Ws(Pt({},"__esModule",{value:!0}),e);var Ve=(e,t,n)=>Fs(e,typeof t!="symbol"?t+"":t,n);var au={};Ns(au,{Accordion:()=>tr,Alert:()=>ho,AnalogClock:()=>to,AppContextProvider:()=>Xe,Avatar:()=>ro,Badge:()=>io,BarGraph:()=>Er,BigNumber:()=>Bi,BlochSphere:()=>Oi,BoxPlot:()=>Hi,Breadcrumb:()=>nr,BubbleChart:()=>Yi,Button:()=>Li,CalendarHeatMap:()=>ji,Card:()=>Oo,Carousel:()=>Zo,CartesianGraph2D:()=>zr,Checkbox:()=>wo,ChordDiagram:()=>Gi,ColorPicker:()=>Co,ColorWheel:()=>Mo,ComplexGraph2D:()=>Nr,ContextMenu:()=>Lt,DataGrid:()=>co,DatePicker:()=>Po,DecompositionTree:()=>Xi,DigitalClock:()=>uo,DiscreteCartesian2D:()=>Cs,DragDropProvider:()=>St,Drawer:()=>xr,Dropdown:()=>rr,EmptyState:()=>bo,FileUpload:()=>Io,FlexContainer:()=>Ho,FlexItem:()=>_o,Footer:()=>Kr,ForceGraph:()=>Ji,FormFieldWrapper:()=>we,FunnelChart:()=>es,GanttChart:()=>os,Gauge:()=>is,GoogleAnalytics:()=>qr,Grid:()=>Yo,GridItem:()=>Vo,HeatMap:()=>as,Histogram:()=>ls,HypercubeGraph:()=>jr,IDE:()=>Ot,Image:()=>Jo,LineGraph:()=>Hr,ListView:()=>po,LollipopChart:()=>cs,Matrix:()=>ds,Menubar:()=>sr,MessageBusProvider:()=>xt,Modal:()=>yr,MultilineField:()=>$o,NavWrapper:()=>Pe,NumberSpinner:()=>Do,Pagination:()=>lr,Panel:()=>jo,Partition:()=>us,PieGraph:()=>_r,PivotTable:()=>fs,PolarGraph2D:()=>Vr,Popover:()=>vr,ProgressBar:()=>xo,RadarChart:()=>gs,RadioGroup:()=>To,SankeyDiagram:()=>ms,ScrollContainer:()=>Xo,Select:()=>zo,Sidebar:()=>dr,Skeleton:()=>yo,Slider:()=>Ao,Spinner:()=>vo,Splitter:()=>qo,Stepper:()=>ur,Sunburst:()=>hs,Tabs:()=>Ko,Tag:()=>fo,TextEditor:()=>Lo,TextField:()=>Fo,ThreeDLayers:()=>Wi,TimePicker:()=>No,ToastContainer:()=>cn,Toggle:()=>Wo,Toolbar:()=>fr,Tooltip:()=>kr,TradingDashboard:()=>Yt,TreeMap:()=>xs,TreeNav:()=>hr,TreeNode:()=>rt,USStateMap:()=>ss,US_STATE_PATHS:()=>Et,UnityApp:()=>Ti,UnityDesktop:()=>Di,VectorField:()=>vs,VideoPlayer:()=>er,VirtualScroll:()=>go,VizWrapper:()=>Xr,WaterfallChart:()=>ws,WordCloud:()=>ks,WordProcessor:()=>Bt,applyGate:()=>Bn,blochToCartesian:()=>gt,buildInputStyle:()=>Be,buildNavItemStyle:()=>ot,buildRotationMatrix:()=>hn,cartesianToBloch:()=>jt,computeBoxStats:()=>Hn,computeMandelbrotGrid:()=>Fr,computeSlices:()=>fn,createToaster:()=>ln,describeArc:()=>pn,generateEdges:()=>mn,generateHypercube:()=>mt,generatePalette:()=>Wt,generateVertices:()=>gn,numRotationAngles:()=>ht,projectTo2D:()=>xn,transformVec:()=>bn,useAppId:()=>at,useBarGraphScales:()=>dn,useChannel:()=>yt,useDragDrop:()=>Qe,useDraggable:()=>vt,useDropZone:()=>wt,useHover:()=>Ce,useHypercube:()=>Gr,useLineGraphScales:()=>un,useMessageBus:()=>qe,useToast:()=>wr});module.exports=Bs(au);var It=Symbol.for("spec.element"),Os=Symbol.for("spec.fragment"),cu=Symbol.for("spec.portal"),Xn=Symbol.for("spec.provider"),qn=Symbol.for("spec.consumer"),Hs=Symbol.for("spec.forward_ref"),_s=Symbol.for("spec.memo"),Ys=Symbol.for("spec.lazy"),Vs=Symbol.for("spec.suspense"),Us=Symbol.for("spec.strict_mode"),js=Symbol.for("spec.profiler");function o(e,t,...n){let r=null,i=null,s={};if(t!=null){t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(i=t.ref);for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&a!=="key"&&a!=="ref"&&a!=="__proto__"&&a!=="constructor"&&a!=="prototype"&&(s[a]=t[a])}if(n.length===1?s.children=n[0]:n.length>1&&(s.children=n),typeof e=="function"&&e.defaultProps){let a=e.defaultProps;for(let l of Object.keys(a))l!=="__proto__"&&l!=="constructor"&&s[l]===void 0&&(s[l]=a[l])}return{$$typeof:It,type:e,props:s,key:r,ref:i}}function We(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Xn,_context:t},r={$$typeof:qn,_context:t};return t.Provider=n,t.Consumer=r,t}var tt=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};tt.prototype.isSpecComponent=!0;var $t=class extends tt{shouldComponentUpdate(t,n){return!Zn(this.props,t)||!Zn(this.state,n)}};$t.prototype.isPureSpecComponent=!0;function Zn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let a of n)if(!Object.prototype.hasOwnProperty.call(s,a)||!Object.is(i[a],s[a]))return!1;return!0}var Jn=null;function je(){if(Jn===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Jn}function G(e){return je().useState(e)}function re(e,t){return je().useEffect(e,t)}function Ae(e){return je().useContext(e)}function en(e,t,n){return je().useReducer(e,t,n)}function S(e,t){return je().useCallback(e,t)}function q(e,t){return je().useMemo(e,t)}function te(e){return je().useRef(e)}function xe(){return je().useId()}var nt=We({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Qn(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Xs={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""},qs=new Set;function Ks(){Xs={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""};for(let e of qs)e()}typeof window<"u"&&window.addEventListener("hashchange",Ks);var Up=We({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function eo(e){if(!e)return new Date;let n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),r=i=>Number(n.find(s=>s.type===i)?.value??0);return new Date(r("year"),r("month")-1,r("day"),r("hour"),r("minute"),r("second"))}function aa(e,t){let n=e.getFullYear(),r=e.getMonth(),i=e.getDate();switch(t){case"short":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${s}/${a}/${n}`}case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][r]} ${String(i).padStart(2,"0")}, ${n}`;case"iso":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${n}-${s}-${a}`}}}var He={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function to(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=G(eo(a));re(()=>{let I=setInterval(()=>{u(eo(a))},1e3);return()=>clearInterval(I)},[a]);let b=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),f=b%12*30+m*.5,g=m*6+c*.1,y=c*6,h=n/2,p=n/2,x=n/2-10,v=x-4,T=x-22,D=[];D.push(o("circle",{cx:String(h),cy:String(p),r:String(x),fill:He.face,stroke:He.border,"stroke-width":"3"}));for(let I=0;I<12;I++){let F=(I*30-90)*Math.PI/180,R=v-6;D.push(o("line",{x1:String(h+R*Math.cos(F)),y1:String(p+R*Math.sin(F)),x2:String(h+v*Math.cos(F)),y2:String(p+v*Math.sin(F)),stroke:He.border,"stroke-width":"2"}));let N=String(I===0?12:I);if(D.push(o("text",{x:String(h+T*Math.cos(F)),y:String(p+T*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:He.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},N)),t==="24h"){let A=x-38,k=String(I===0?0:I+12);D.push(o("text",{x:String(h+A*Math.cos(F)),y:String(p+A*Math.sin(F)),"text-anchor":"middle","dominant-baseline":"central",fill:He.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(I,M,F,R)=>{let N=(I-90)*Math.PI/180;return o("line",{x1:String(h),y1:String(p),x2:String(h+M*Math.cos(N)),y2:String(p+M*Math.sin(N)),stroke:R,"stroke-width":F,"stroke-linecap":"round"})};D.push(C(f,x*.5,"4",He.hand)),D.push(C(g,x*.75,"3",He.hand)),s&&D.push(C(y,x*.85,"1.5",He.second)),D.push(o("circle",{cx:String(h),cy:String(p),r:"4",fill:He.hand}));let L=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...D)];return r&&L.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:He.numbers}},aa(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var nn={xs:24,sm:32,md:40,lg:56,xl:80};function la(e){return e==null?nn.md:typeof e=="number"?e:nn[e]??nn.md}function ca(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var no=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function da(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return no[Math.abs(t)%no.length]}var oo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function ua(e,t){let n=`${-t/4}px`;switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};case"top-right":default:return{top:n,right:n}}}function ro(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,b]=G(!1),m=la(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,f=a??da(r),g=`${Math.round(m*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${m}px`,height:`${m}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},h;if(t&&!u)h=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>b(!0)});else{let T=ca(r);h=o("span",{style:{fontSize:g,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},T)}let p=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":f},role:"img","aria-label":n??r??"avatar"},h);if(!l)return p;let x=Math.max(8,Math.round(m*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:oo[l]??oo.offline,border:"2px solid #fff",boxSizing:"border-box",...ua(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},p,o("span",{style:v,"aria-label":l}))}var pa={sm:{minWidth:"16px",height:"16px",fontSize:"10px",padding:"0 4px"},md:{minWidth:"20px",height:"20px",fontSize:"12px",padding:"0 6px"},lg:{minWidth:"24px",height:"24px",fontSize:"14px",padding:"0 8px"}},fa={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function io(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,b=r?{...fa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...pa[s],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",...a==="solid"?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},m=u?o("span",{style:b,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return m??o("span",null);let c={...b,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var ga={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},so={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},on={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},ma="6px 8px",ha={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},ba={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},xa={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},Ze={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},ya={...Ze,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},ao={...Ze,opacity:"0.5",cursor:"default"},lo={cursor:"pointer",width:"16px",height:"16px"};function Sa(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function co(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:b,onSelectionChange:m,striped:c=!1,bordered:f=!1,compact:g=!1,stickyHeader:y=!1}=e,[h,p]=G(0),[x,v]=G(void 0),[T,D]=G("asc"),[C,P]=G([]),[L,I]=G({}),M=i??h,F=a??x,R=l??T,N=b??C,A=q(()=>{let J=Object.entries(L).filter(([,ae])=>ae.length>0);return J.length===0?n:n.filter(ae=>J.every(([de,le])=>String(ae[de]??"").toLowerCase().includes(le.toLowerCase())))},[n,L]),k=q(()=>{if(!F)return A;let J=[...A];return J.sort((ae,de)=>{let le=ae[F],ne=de[F];if(le==null&&ne==null)return 0;if(le==null)return 1;if(ne==null)return-1;if(typeof le=="number"&&typeof ne=="number")return R==="asc"?le-ne:ne-le;let fe=String(le),oe=String(ne),ie=fe.localeCompare(oe);return R==="asc"?ie:-ie}),J},[A,F,R]),w=k.length,$=r?Math.max(1,Math.ceil(w/r)):1,E=r?k.slice(M*r,(M+1)*r):k,W=S(J=>{s?s(J):p(J)},[s]),z=S(J=>{let ae=F===J&&R==="asc"?"desc":"asc";d?d(J,ae):(v(J),D(ae))},[F,R,d]),B=S(J=>{let ae=N.includes(J)?N.filter(de=>de!==J):[...N,J];m?m(ae):P(ae)},[N,m]),O=S(()=>{let J=E.map((le,ne)=>r?M*r+ne:ne),de=J.every(le=>N.includes(le))?N.filter(le=>!J.includes(le)):[...new Set([...N,...J])];m?m(de):P(de)},[E,N,r,M,m]),_=S((J,ae)=>{I(de=>({...de,[J]:ae})),W(0)},[W]),U=t.some(J=>J.filterable),X=g?ma:on.padding,ee=[];if(u){let J=E.map((de,le)=>r?M*r+le:le),ae=J.length>0&&J.every(de=>N.includes(de));ee.push(o("th",{key:"__select_all",style:{...so,padding:X,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:ae,onChange:O,style:lo,"aria-label":"Select all rows"})))}for(let J of t){let ae={...so,padding:X,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...f?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},de=[J.header];J.sortable&&de.push(o("span",{style:ha},Sa(J.key,F,R))),ee.push(o("th",{key:J.key,style:ae,onClick:J.sortable?()=>z(J.key):void 0,onKeyDown:J.sortable?le=>{let ne=le.key;(ne==="Enter"||ne===" ")&&(le.preventDefault(),z(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":F===J.key?R==="asc"?"ascending":"descending":void 0},...de))}let Z=null;if(U){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:X}}));for(let ae of t)J.push(o("th",{key:`filter_${ae.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},ae.filterable?o("input",{type:"text",placeholder:`Filter ${ae.header}...`,style:ba,value:L[ae.key]??"",onInput:de=>_(ae.key,de.target.value),"aria-label":`Filter by ${ae.header}`}):null));Z=o("tr",{key:"__filter_row"},...J)}let V=[];for(let J=0;J<E.length;J++){let ae=E[J],de=r?M*r+J:J,le=N.includes(de),ne={};c&&J%2===1&&(ne.backgroundColor="#f9fafb"),le&&(ne.backgroundColor="#eff6ff");let fe=[];u&&fe.push(o("td",{key:"__select",style:{padding:X,textAlign:"center",...on,...f?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:le,onChange:()=>B(de),style:lo,"aria-label":`Select row ${de+1}`})));for(let oe of t){let ie=ae[oe.key],ue=oe.render?oe.render(ie,ae):String(ie??"");fe.push(o("td",{key:oe.key,style:{...on,padding:X,...f?{border:"1px solid #e5e7eb"}:{}}},ue))}V.push(o("tr",{key:String(de),style:ne},...fe))}let j=null;if(r){let J=w===0?0:M*r+1,ae=Math.min((M+1)*r,w),de=[];de.push(o("button",{key:"prev",style:M===0?ao:Ze,onClick:M>0?()=>W(M-1):void 0,disabled:M===0,"aria-label":"Previous page"},"\u2190 Prev"));let le=7,ne=Math.max(0,M-Math.floor(le/2)),fe=Math.min($,ne+le);fe-ne<le&&(ne=Math.max(0,fe-le)),ne>0&&(de.push(o("button",{key:"p0",style:Ze,onClick:()=>W(0)},"1")),ne>1&&de.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let oe=ne;oe<fe;oe++)de.push(o("button",{key:`p${oe}`,style:oe===M?ya:Ze,onClick:oe!==M?()=>W(oe):void 0,"aria-current":oe===M?"page":void 0},String(oe+1)));fe<$&&(fe<$-1&&de.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),de.push(o("button",{key:`p${$-1}`,style:Ze,onClick:()=>W($-1)},String($)))),de.push(o("button",{key:"next",style:M>=$-1?ao:Ze,onClick:M<$-1?()=>W(M+1):void 0,disabled:M>=$-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:xa},o("span",null,`Showing ${J}\u2013${ae} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...de))}let H={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},Y={...ga,...f?{border:"1px solid #e5e7eb"}:{}},K=o("thead",null,o("tr",null,...ee),Z),Q=o("tbody",null,...V),se=o("table",{style:Y,role:"grid","aria-rowcount":String(w)},K,Q);return o("div",{style:H},se,j)}function Je(e){return e<10?`0${e}`:String(e)}function va(e,t){if(t){let r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),i=s=>Number(r.find(a=>a.type===s)?.value??0);return{hours:i("hour"),minutes:i("minute"),seconds:i("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function wa(e,t,n){if(n){let r={timeZone:n};if(t==="short")return Object.assign(r,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);if(t==="long")return Object.assign(r,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);Object.assign(r,{year:"numeric",month:"2-digit",day:"2-digit"});let i=new Intl.DateTimeFormat("en-CA",r).formatToParts(e),s=a=>i.find(l=>l.type===a)?.value??"";return`${s("year")}-${s("month")}-${s("day")}`}return t==="short"?`${Je(e.getMonth()+1)}/${Je(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Je(e.getMonth()+1)}-${Je(e.getDate())}`}var ka={fontFamily:'"SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace',backgroundColor:"#1e293b",color:"#e2e8f0",padding:"16px 24px",borderRadius:"8px",display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},Ca={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ma={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Ea={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function uo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=G(new Date);re(()=>{let p=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(p)},[]);let{hours:u,minutes:b,seconds:m}=va(l,s),c,f=null;t==="12h"?(f=u>=12?"PM":"AM",c=u%12||12):c=u;let g=`${Je(c)}:${Je(b)}`;i&&(g+=`:${Je(m)}`);let y=[g];f!=null&&y.push(o("span",{style:Ma},f));let h=[o("span",{style:Ca},...y)];return n&&h.push(o("span",{style:Ea},wa(l,r,s))),o("div",{style:ka,...a?{class:a}:{}},...h)}var Ra={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Pa={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Ia={borderBottom:"1px solid var(--color-border, #e5e7eb)"},$a={cursor:"pointer",transition:"background-color 0.15s ease"},Da={backgroundColor:"var(--color-bg-muted, #eff6ff)"},Ta={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Dt={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function po(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:b}=e;if(t.length===0)return o("div",null,u?o("div",{style:Dt},u):null,o("div",{style:Ta},d),b?o("div",{style:{...Dt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null);let m=[];for(let c=0;c<t.length;c++){let f=t[c],g=r(f,c),y=a===c,h=c===t.length-1,p={...Pa,...s?$a:{},...y?Da:{},...i&&!h?Ia:{}};m.push(o("li",{key:g,style:p,onClick:l?()=>l(c):void 0,onKeyDown:l?x=>{let v=x.key;(v==="Enter"||v===" ")&&(x.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(f,c)))}return o("div",null,u?o("div",{style:Dt},u):null,o("ul",{style:Ra,role:l?"listbox":"list"},...m),b?o("div",{style:{...Dt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null)}function za(e){return e??"#3b82f6"}function Aa(e,t){let r={red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return i?`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${t})`:e}var La={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}};function Fa(e,t,n,r,i){let s=La[n],a={display:"inline-flex",alignItems:"center",gap:s.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:s.fontSize,fontWeight:"500",padding:s.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...r?{cursor:"pointer"}:{},...i?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...a,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...a,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...a,backgroundColor:Aa(e,.12),color:e,border:"none"};default:return a}}var Na={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"};function fo(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,b=za(n),m=Fa(b,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:Na,onClick:f=>{f.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:m,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?f=>{let g=f.key;(g==="Enter"||g===" ")&&(f.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var Wa={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function go(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=G(0),d=te(null),u=t.length*r,b=parseInt(s,10)||400,m=Math.ceil(b/r),c=Math.max(0,Math.floor(a/r)-i),f=Math.min(t.length,Math.floor(a/r)+m+i),g=S(h=>{let p=h.target;l(p.scrollTop)},[]),y=[];for(let h=c;h<f;h++)y.push(o("div",{key:String(h),style:{position:"absolute",top:`${h*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[h],h)));return o("div",{ref:d,style:{...Wa,height:s},onScroll:g},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var mo={info:{icon:"\u2139\uFE0F",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"\u2705",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"\u26A0\uFE0F",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"\u274C",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function ho(e){let[t,n]=G(!0),r=e.type??"info",i=e.variant??"subtle",s=mo[r]??mo.info,a=e.icon??s.icon,l=e.message??e.children,d=q(()=>{let u={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(u.backgroundColor=s.filledBg,u.color=s.filledText):i==="outline"?(u.backgroundColor="transparent",u.border=`1px solid ${s.border}`,u.color=s.text):(u.backgroundColor=s.bg,u.color=s.text),u},[i,s]);return t?o("div",{role:"alert",style:d},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},a),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:l?"4px":"0"}},e.title):null,l?o("div",null,l):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:i==="filled"?"1px solid currentColor":`1px solid ${s.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"\xD7"):null):null}function bo(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)}function xo(e){let t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",s=e.backgroundColor??"#e5e7eb",a=e.height??(typeof e.size=="string"?e.size:typeof e.size=="number"?`${e.size}px`:"8px"),l=e.variant??"bar",d=xe().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let f=typeof e.size=="number"?e.size:48,g=Math.max(2,Math.round(f/10)),y=(f-g)/2,h=2*Math.PI*y,p=e.indeterminate?h*.75:h-r/100*h,x=e.indeterminate?`@keyframes liq-spin-${d}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${d}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},x?o("style",null,x):null,o("svg",{width:String(f),height:String(f),viewBox:`0 0 ${f} ${f}`,style:e.indeterminate?{animation:`liq-spin-${d} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${d} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(g)}),o("circle",{cx:String(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(g),"stroke-dasharray":String(h),"stroke-dashoffset":String(p),"stroke-linecap":"round",transform:`rotate(-90 ${f/2} ${f/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",b=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",m={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=q(()=>{let f={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(f.position="absolute",f.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,f.backgroundColor=i):(f.width=`${r}%`,f.backgroundColor=i),e.animated&&!e.indeterminate&&(f.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${Ba(i)} 50%, ${i} 100%)`,f.backgroundSize="200% 100%",f.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),f},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||b?o("style",null,u+b):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:m},o("div",{style:c})))}function Ba(e){let t=e.replace("#","");if(t.length!==6)return e;let n=Math.min(255,parseInt(t.slice(0,2),16)+40),r=Math.min(255,parseInt(t.slice(2,4),16)+40),i=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function yo(e){let t=e.variant??"text",n=e.animated!==!1,r=xe().replace(/[^a-zA-Z0-9_-]/g,""),i=q(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),s=typeof e.width=="number"?`${e.width}px`:e.width,a=typeof e.height=="number"?`${e.height}px`:e.height;if(t==="text"){let l=e.lines??1,d=[];for(let u=0;u<l;u++){let b=u===l-1&&l>1;d.push(o("div",{key:String(u),style:rn({width:b?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:rn({width:l,height:l,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:rn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function rn(e){let t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}var Oa={sm:16,md:24,lg:40},So={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function vo(e){let t=typeof e.size=="number"?e.size:Oa[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=So[e.speed??"normal"]??So.normal,s=e.label??"Loading",l=xe().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,b=q(()=>`@keyframes liq-rotate-${l}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[l]);return o("span",{role:"status","aria-label":s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,b),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function we(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function Be(e,t){let n=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:n?`1px solid ${n}`:e.border??"1px solid #d1d5db",borderRadius:e.borderRadius??"6px",fontSize:e.fontSize??"14px",fontFamily:e.fontFamily??"inherit",backgroundColor:e.backgroundColor??"#ffffff",color:e.color??"#1f2937",outline:"none",transition:e.transition??"border-color 0.15s",width:"100%",boxSizing:"border-box",...t.focused&&n?{boxShadow:`0 0 0 3px ${n}22`}:{},...e.custom??{}}}var Ha={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function wo(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,b=te(null);re(()=>{b.current&&(b.current.indeterminate=a)},[a]);let m=S(()=>{l||i(!r)},[l,r,i]),c=S(L=>{l||(L.key===" "||L.key==="Enter")&&(L.preventDefault(),i(!r))},[l,r,i]),f=Ha[u],g=`${f.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",h=r||a?"#3b82f6":"#ffffff",p={width:g,height:g,minWidth:g,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:h,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${f.icon}px`,lineHeight:"1",fontWeight:"700"},v=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,T={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},D=o("input",{ref:b,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),C=o("div",{style:p},v),P=s?o("span",{style:{fontSize:f.fontSize,color:"#374151"}},s):null;return o(we,{error:d,htmlFor:n},o("div",{style:T,onClick:m,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},D,C,P))}var _a=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function ko(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function Tt(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}function Co(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=_a,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[b,m]=G(!1),[c,f]=G(r),g=te(null);re(()=>{f(r)},[r]),re(()=>{let I=M=>{g.current&&!g.current.contains(M.target)&&m(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let y=S(I=>{d||i(Tt(I))},[d,i]),h=S(I=>{let M=I.target.value;f(M);let F=M.startsWith("#")?M:`#${M}`;ko(F)&&i(Tt(F))},[i]),p=S(()=>{ko(c.startsWith("#")?c:`#${c}`)||f(r)},[c,r]),x={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},v={display:"flex",alignItems:"center",gap:"8px"},T={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"},D={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(I=>{let M=Tt(I)===Tt(r);return o("div",{key:I,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:I,cursor:d?"not-allowed":"pointer",border:M?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(I),onKeyDown:R=>{let N=R.key;(N==="Enter"||N===" ")&&(R.preventDefault(),y(I))},role:"button",tabIndex:d?-1:0,title:I,"aria-label":`Select color ${I}`})}),P=a?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput:h,onBlur:p,disabled:d,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,L=b?o("div",{style:T},o("div",{style:D},...C),P):null;return o(we,{label:u,disabled:d,htmlFor:n},o("div",{ref:g,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>m(!b),onKeyDown:d?void 0:I=>{let M=I.key;(M==="Enter"||M===" ")&&(I.preventDefault(),m(!b))},role:"button",tabIndex:d?-1:0,"aria-expanded":b?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:x}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),L))}function Mo(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,b]=G(r),m=te(null),c=S(((...h)=>{let x=h[0].target.value;b(x),i?.(x)}),[i]),f={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},g={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(we,{label:d,htmlFor:n},o("div",{style:f},o("div",{style:g},o("input",{id:n,ref:m,type:"color",value:u,onInput:c,disabled:l,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:l?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":d||"Color"})),a?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null))}var Eo=["January","February","March","April","May","June","July","August","September","October","November","December"],Ya=["Su","Mo","Tu","We","Th","Fr","Sa"];function sn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function Va(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(r).padStart(2,"0")).replace("DD",String(i).padStart(2,"0"))}function Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ua(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Po(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:b,error:m}=e,c=q(()=>sn(r),[r]),f=q(()=>sn(a),[a]),g=q(()=>sn(l),[l]),[y,h]=G(!1),[p,x]=G(()=>c?c.getFullYear():new Date().getFullYear()),[v,T]=G(()=>c?c.getMonth():new Date().getMonth()),D=te(null),C=q(()=>new Date,[]);re(()=>{let z=B=>{D.current&&!D.current.contains(B.target)&&h(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let P=S(()=>{T(z=>z===0?(x(B=>B-1),11):z-1)},[]),L=S(()=>{T(z=>z===11?(x(B=>B+1),0):z+1)},[]),I=S(z=>{let B=new Date(p,v,z);f&&B<f||g&&B>g||(i(Ua(B)),h(!1))},[p,v,i,f,g]),M=c?Va(c,s):"",F=q(()=>{let z=new Date(p,v,1).getDay(),B=new Date(p,v+1,0).getDate(),O=[],_=[];for(let U=0;U<z;U++)_.push(null);for(let U=1;U<=B;U++)_.push(U),_.length===7&&(O.push(_),_=[]);for(;_.length>0&&_.length<7;)_.push(null);return _.length&&O.push(_),O},[p,v]),R={...Be({},{focused:y,error:!!m}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"280px"},A={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},k={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},w={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},$=Ya.map(z=>o("div",{key:z,style:{padding:"4px"}},z)),E=F.map((z,B)=>{let O=z.map((_,U)=>{if(_===null)return o("div",{key:`empty-${B}-${U}`,style:{padding:"4px"}});let X=new Date(p,v,_),ee=Ro(X,C),Z=c?Ro(X,c):!1,V=f&&X<f||g&&X>g,j={padding:"4px",textAlign:"center",cursor:V?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:ee?"700":"400",backgroundColor:Z?"#3b82f6":"transparent",color:Z?"#ffffff":V?"#d1d5db":ee?"#3b82f6":"#1f2937",border:ee&&!Z?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${_}`,style:j,onClick:V?void 0:()=>I(_),onKeyDown:V?void 0:H=>{let Y=H.key;(Y==="Enter"||Y===" ")&&(H.preventDefault(),I(_))},role:V?void 0:"button",tabIndex:V?void 0:0,"aria-label":`${Eo[v]} ${_}, ${p}`,"aria-disabled":V?"true":void 0},String(_))});return o("div",{key:`row-${B}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...O)}),W=y?o("div",{style:N},o("div",{style:A},o("button",{type:"button",style:k,onClick:P},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Eo[v]} ${p}`),o("button",{type:"button",style:k,onClick:L},"\u25B6")),o("div",{style:w},...$),...E):null;return o(we,{label:b,error:m,disabled:d,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},o("div",{id:n,style:R,onClick:d?void 0:()=>h(!y),onKeyDown:d?void 0:z=>{let B=z.key;(B==="Enter"||B===" ")&&(z.preventDefault(),h(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:M?"#1f2937":"#9ca3af"}},M||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),W))}function an(e){if(e===0)return"0 B";let t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(n===0?0:1)} ${t[n]}`}function Io(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[b,m]=G([]),[c,f]=G(!1),[g,y]=G(""),h=te(null),p=S(k=>{y("");let w=[];for(let E of k){if(a&&E.size>a){y(`File "${E.name}" exceeds maximum size of ${an(a)}`);continue}w.push(E)}let $=s?[...b,...w]:w.slice(0,1);m($),r($)},[b,s,a,r]),x=S(k=>{if(k.preventDefault(),k.stopPropagation(),f(!1),l)return;let w=k.dataTransfer;if(!w)return;let $=Array.from(w.files);p($)},[l,p]),v=S(k=>{k.preventDefault(),k.stopPropagation(),l||f(!0)},[l]),T=S(k=>{k.preventDefault(),k.stopPropagation(),f(!1)},[]),D=S(k=>{let w=k.target;w.files&&(p(Array.from(w.files)),w.value="")},[p]),C=S(k=>{let w=b.filter(($,E)=>E!==k);m(w),r(w)},[b,r]),P=S(()=>{l||h.current&&h.current.click()},[l]),L={border:`2px dashed ${c?"#3b82f6":g?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:l?"0.6":"1"},I={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},M={fontSize:"14px",color:"#374151",marginBottom:"4px"},F={fontSize:"12px",color:"#9ca3af"},R=o("input",{id:n,ref:h,type:"file",accept:i,multiple:s,onChange:D,disabled:l,style:{display:"none"},tabIndex:-1}),N=o("div",{style:L,onClick:P,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),P())},onDrop:x,onDragOver:v,onDragLeave:T,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:I},"\u2191"),o("div",{style:M},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:F},i):null,a?o("div",{style:F},`Max size: ${an(a)}`):null),A=b.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...b.map((k,w)=>{let $={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},E={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${w}`,style:$},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},k.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},an(k.size))),o("button",{type:"button",style:E,onClick:W=>{W.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(we,{label:d,helpText:u,error:g||void 0,disabled:l,htmlFor:n},o("div",null,R,N,A))}function $o(e){let[t,n]=G(!1),[r,i]=G((e.value??e.defaultValue??"").length),s=xe().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...Be(e.inputStyle??{},{focused:t,error:!!e.error}),resize:e.autoResize?"none":"vertical",lineHeight:"1.5",...e.minHeight?{minHeight:e.minHeight}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},u=S(c=>{let f=c.target,g=f.value;i(g.length),e.onChange&&e.onChange(g),e.autoResize&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)},[e.onChange,e.autoResize]),b=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),m=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>(e.maxLength??1/0)*.9?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(we,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},b,m)}function Do(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:b,label:m,error:c}=e,[f,g]=G(!1),y=S(w=>{let $=w;return s!==void 0&&$<s&&($=s),a!==void 0&&$>a&&($=a),$},[s,a]),h=S(()=>{d||i(y(r+l))},[d,r,l,y,i]),p=S(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=S(w=>{let $=w.target.value;if($===""||$==="-")return;let E=parseFloat($);isNaN(E)||i(y(E))},[y,i]),v=S(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),h()):w.key==="ArrowDown"&&(w.preventDefault(),p()))},[d,h,p]),T=s===void 0||r>s,D=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":f?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...f&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},P=w=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:d||!w?"not-allowed":"pointer",color:d||!w?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),L={flex:"1",minWidth:"32px",textAlign:"center",border:"none",borderLeft:"1px solid var(--color-border, #e5e7eb)",borderRight:"1px solid var(--color-border, #e5e7eb)",outline:"none",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text, #1f2937)",padding:"4px 2px"},I={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},M=o("button",{type:"button",style:P(T),onClick:p,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),F=u?o("span",{style:I},u):null,R=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:v,onFocus:()=>g(!0),onBlur:()=>g(!1),disabled:d,style:L,"aria-label":m||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":s!==void 0?String(s):void 0,"aria-valuemax":a!==void 0?String(a):void 0}),N=b?o("span",{style:I},b):null,A=o("button",{type:"button",style:P(D),onClick:h,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[M];return F&&k.push(F),k.push(R),N&&k.push(N),k.push(A),o(we,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function To(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:b}=e,m=S(y=>{d||s(y)},[d,s]),c=S(y=>{if(d)return;let h=r.filter(v=>!v.disabled);if(h.length===0)return;let p=h.findIndex(v=>v.value===i),x=p;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),x=p<h.length-1?p+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),x=p>0?p-1:h.length-1;else return;s(h[x].value)},[d,r,i,s]),f={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},g=r.map((y,h)=>{let p=y.value===i,x=d||!!y.disabled,v=`${n}-opt-${h}`,T={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":p?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},D={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:p?"scale(1)":"scale(0)"},C={display:"inline-flex",alignItems:"center",gap:"8px",cursor:x?"not-allowed":"pointer",opacity:x?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:v,style:C,onClick:x?void 0:P=>{P.preventDefault(),m(y.value)}},o("input",{type:"radio",id:v,name:a,value:y.value,checked:p,disabled:x,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:T},o("div",{style:D})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(we,{label:b,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:f,role:"radiogroup","aria-label":b,onKeyDown:c,tabIndex:d?-1:0},...g))}function zo(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:b=!1,error:m,label:c,helpText:f}=e,[g,y]=G(!1),[h,p]=G(""),[x,v]=G(-1),T=te(null),D=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=q(()=>{if(!l||!h)return r;let z=h.toLowerCase();return r.filter(B=>B.label.toLowerCase().includes(z))},[r,h,l]),P=q(()=>{let z={},B=[];for(let O of C)O.group?(z[O.group]||(z[O.group]=[]),z[O.group].push(O)):B.push(O);return{groups:z,ungrouped:B}},[C]),L=q(()=>D.length===0?"":D.map(B=>r.find(O=>O.value===B)).filter(Boolean).map(B=>B.label).join(", "),[D,r]);re(()=>{let z=B=>{let O=B.target;T.current&&!T.current.contains(O)&&(y(!1),p(""))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let I=S(z=>{if(d){let B=D.includes(z)?D.filter(O=>O!==z):[...D,z];s(B)}else s(z),y(!1),p("")},[d,D,s]),M=S(z=>{z.stopPropagation(),s(d?[]:"")},[d,s]),F=S(z=>{if(b)return;let B=z.key;if(!g&&(B==="Enter"||B===" "||B==="ArrowDown")){z.preventDefault(),y(!0),v(0);return}if(g){if(B==="Escape"){y(!1),p("");return}if(B==="ArrowDown")z.preventDefault(),v(O=>Math.min(O+1,C.length-1));else if(B==="ArrowUp")z.preventDefault(),v(O=>Math.max(O-1,0));else if(B==="Enter"&&x>=0&&x<C.length){z.preventDefault();let O=C[x];O.disabled||I(O.value)}}},[b,g,x,C,I]),R={...Be({},{focused:g,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:b?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",maxHeight:"240px",overflowY:"auto"},A=(z,B)=>{let O=D.includes(z.value),_=B===x,U={padding:"8px 12px",cursor:z.disabled?"not-allowed":"pointer",backgroundColor:_?"#f3f4f6":O?"#eff6ff":"transparent",color:z.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:z.value,style:U,onClick:z.disabled?void 0:()=>I(z.value),onMouseEnter:()=>v(B),role:"option","aria-selected":O?"true":"false","aria-disabled":z.disabled?"true":void 0},d&&O?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,z.label)},k=()=>{let z=[],B=0,{groups:O,ungrouped:_}=P;for(let U of _)z.push(A(U,B++));for(let U of Object.keys(O)){z.push(o("div",{key:`group-${U}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},U));for(let X of O[U])z.push(A(X,B++))}return z.length===0&&z.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),z},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:g?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),$=o("div",{style:R,id:n,onClick:b?void 0:()=>{y(!g),v(-1)},onKeyDown:F,tabIndex:b?-1:0,role:"combobox","aria-expanded":g?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:L?"#1f2937":"#9ca3af"}},L||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&D.length>0?o("span",{onClick:M,onKeyDown:z=>{let B=z.key;(B==="Enter"||B===" ")&&(z.preventDefault(),z.stopPropagation(),M(z))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,w)),E=l&&g?o("input",{type:"text",value:h,onInput:z=>{p(z.target.value),v(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,W=g?o("div",{style:N,role:"listbox"},E,...k()):null;return o(we,{label:c,error:m,helpText:f,disabled:b,htmlFor:n},o("div",{ref:T,style:{position:"relative"}},$,W))}function Ao(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:b=!1,marks:m,range:c=!1,label:f,error:g}=e,y=te(null),h=te(i);h.current=i;let[p,x]=G(null),v=q(()=>{if(c&&Array.isArray(r))return r;let B=typeof r=="number"?r:0;return[B,B]},[r,c]),T=te(v);T.current=v;let D=B=>{let O=Math.round((B-s)/l)*l+s;return Math.max(s,Math.min(a,O))},C=B=>(B-s)/(a-s)*100,P=S(B=>{if(!y.current)return s;let O=y.current.getBoundingClientRect(),_=Math.max(0,Math.min(1,(B.clientX-O.left)/O.width));return D(s+_*(a-s))},[s,a,l]),L=S(B=>O=>{b||(O.preventDefault(),x(B))},[b]),I=S(B=>{if(b)return;let O=P(B);if(c){let _=Math.abs(O-v[0]),U=Math.abs(O-v[1]);_<=U?i([D(O),v[1]]):i([v[0],D(O)])}else i(D(O))},[b,P,c,v,i,s,a,l]);re(()=>{if(!p)return;let B=_=>{let U=P(_),X=T.current,ee=h.current;p==="single"?ee(D(U)):p==="start"?ee([Math.min(D(U),X[1]),X[1]]):p==="end"&&ee([X[0],Math.max(X[0],D(U))])},O=()=>x(null);return document.addEventListener("mousemove",B),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",O)}},[p,P,s,a,l]);let M=S(B=>{if(b)return;let O=0;if(B.key==="ArrowRight"||B.key==="ArrowUp")O=l;else if(B.key==="ArrowLeft"||B.key==="ArrowDown")O=-l;else return;B.preventDefault(),c||i(D((typeof r=="number"?r:0)+O))},[b,l,c,r,i,s,a]),F={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:b?"not-allowed":"pointer"},R=c?C(v[0]):0,N=C(c?v[1]:v[0]),A={position:"absolute",top:"0",left:`${R}%`,width:`${N-R}%`,height:"100%",backgroundColor:b?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=B=>f?B==="start"?`${f} minimum`:B==="end"?`${f} maximum`:f:B==="start"?"Minimum value":B==="end"?"Maximum value":"Value",w=(B,O,_)=>{let U={position:"absolute",top:"50%",left:`${B}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${b?"#9ca3af":"#3b82f6"}`,cursor:b?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},X={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:O==="single"||O==="start"?n:void 0,style:U,onMouseDown:L(O),role:"slider","aria-valuenow":String(_),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(O),tabIndex:b?-1:0,onKeyDown:M},d?o("div",{style:X},String(_)):null)},$=[];if(u)for(let B=s;B<=a;B+=l)$.push(o("div",{key:`tick-${B}`,style:{position:"absolute",top:"10px",left:`${C(B)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let E=[];if(m)for(let B of m)E.push(o("div",{key:`mark-${B.value}`,style:{position:"absolute",top:"18px",left:`${C(B.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},B.label));let W={paddingTop:d?"28px":"8px",paddingBottom:m||u?"28px":"8px",opacity:b?"0.6":"1"},z=[];return c?(z.push(w(C(v[0]),"start",v[0])),z.push(w(C(v[1]),"end",v[1]))):z.push(w(C(v[0]),"single",v[0])),o(we,{label:f,error:g,htmlFor:n},o("div",{style:W},o("div",{ref:y,style:F,role:"presentation",onClick:I},o("div",{style:A}),...z,...$,...E)))}var ja=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Ga={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"\u2022",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"\u201C",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"\u{1F517}",command:"createLink"},unlink:{label:"Remove link",icon:"\u26D4",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"\u2015",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"\u2718",command:"removeFormat"},undo:{label:"Undo",icon:"\u21A9",command:"undo"},redo:{label:"Redo",icon:"\u21AA",command:"redo"}};function Lo(e){let[t,n]=G(!1),r=te(null),i=xe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??ja,l=e.toolbarStyle??{},d=e.editorStyle??{};re(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=S((g,y)=>{if(!(e.disabled||e.readOnly)){if(g==="createLink"){let h=prompt("Enter URL:");if(!h)return;document.execCommand(g,!1,h)}else y&&g==="formatBlock"?document.execCommand(g,!1,`<${y}>`):document.execCommand(g,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),b=S(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=S(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),c=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:l.backgroundColor??"#f9fafb",borderBottom:l.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...a.map(g=>{let y=Ga[g];return y?o("button",{key:g,type:"button",title:y.label,onClick:()=>u(y.command,y.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:l.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:l.buttonSize??"13px",fontWeight:g==="bold"?"700":g==="italic"?"400":"500",fontStyle:g==="italic"?"italic":"normal",textDecoration:g==="underline"?"underline":g==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),f=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:d.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:d.backgroundColor??"#ffffff",color:d.color??"#1f2937",fontFamily:d.fontFamily??"inherit",fontSize:d.fontSize??"14px",lineHeight:d.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:m,onInput:b});return o(we,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,f))}function Fo(e){let[t,n]=G(!1),r=xe().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Be(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let b=u.target.value;e.onInput&&e.onInput(b),e.onChange&&e.onChange(b)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(we,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Xa=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Ge(e){return String(e).padStart(2,"0")}function qa(e){let t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}function No(e){let t=xe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:b=!1,timezone:m,showTimezone:c=!1,timezones:f=Xa,onTimezoneChange:g}=e,[y,h]=G(!1),p=q(()=>qa(r),[r]),x=s==="12h",v=p.hour>=12,T=x?p.hour%12||12:p.hour,D=S((j,H,Y)=>{let K=Math.max(0,Math.min(23,j)),Q=Math.max(0,Math.min(59,H)),se=Math.max(0,Math.min(59,Y??0));i(b?`${Ge(K)}:${Ge(Q)}:${Ge(se)}`:`${Ge(K)}:${Ge(Q)}`)},[i,b]),C=S(j=>{let H=parseInt(j.target.value,10)||0;x&&(H=H%12,v&&(H+=12)),D(H,p.minute,p.second)},[x,v,p.minute,p.second,D]),P=S(j=>{let H=parseInt(j.target.value,10)||0;D(p.hour,H,p.second)},[p.hour,p.second,D]),L=S(j=>{let H=parseInt(j.target.value,10)||0;D(p.hour,p.minute,H)},[p.hour,p.minute,D]),I=S(()=>{if(l)return;let j=v?p.hour-12:p.hour+12;D(j,p.minute,p.second)},[l,v,p.hour,p.minute,p.second,D]),M=S(j=>{l||D(p.hour+j,p.minute,p.second)},[l,p.hour,p.minute,p.second,D]),F=S(j=>{l||D(p.hour,p.minute+j*a,p.second)},[l,p.hour,p.minute,p.second,a,D]),R=S(j=>{l||D(p.hour,p.minute,p.second+j)},[l,p.hour,p.minute,p.second,D]),N=S(j=>{let H=j.target.value;g&&g(H)},[g]),A={display:"inline-flex",alignItems:"center",gap:"4px",...Be({},{focused:y,error:!!u})},k={display:"flex",flexDirection:"column",alignItems:"center"},w={background:"none",border:"none",cursor:l?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},$={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},E={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},W=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>M(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ge(T),onChange:C,style:$,disabled:l,"aria-label":"Hour",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>M(-1),disabled:l},"\u25BC")),z=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),B=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>F(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ge(p.minute),onChange:P,style:$,disabled:l,"aria-label":"Minute",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>F(-1),disabled:l},"\u25BC")),O=b?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,_=b?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>R(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Ge(p.second),onChange:L,style:$,disabled:l,"aria-label":"Second",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>R(-1),disabled:l},"\u25BC")):null,U=x?o("button",{type:"button",style:E,onClick:I,disabled:l,"aria-label":"Toggle AM/PM"},v?"PM":"AM"):null,X={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},ee=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,Z=c?o("select",{style:X,value:m??f[0],onChange:N,disabled:l,"aria-label":"Timezone"},...f.map(j=>o("option",{key:j,value:j},j))):null,V=[W,z,B];return O&&V.push(O),_&&V.push(_),U&&V.push(U),ee&&V.push(ee),Z&&V.push(Z),o(we,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:A},...V))}var Ka={sm:{trackW:32,trackH:18,thumbSize:14,offset:2},md:{trackW:44,trackH:24,thumbSize:20,offset:2},lg:{trackW:56,trackH:30,thumbSize:26,offset:2}};function Wo(e){let{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:s=!1,size:a="md",onColor:l="#3b82f6",offColor:d="#d1d5db"}=e,u=Ka[a],b=S(()=>{s||n(!t)},[s,t,n]),m=S(v=>{s||(v.key===" "||v.key==="Enter")&&(v.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?l:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},f=t?u.trackW-u.thumbSize-u.offset:u.offset,g={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${f}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},h=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,p=o("div",{style:c},o("div",{style:g}));return o("div",{style:y,onClick:b,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[h,p]:[p,h]).filter(Boolean))}var Bo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06)",md:"0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06)",lg:"0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)"};function Oo(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=q(()=>{let b={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(b.border="1px solid #e5e7eb"),b.boxShadow=Bo[n]??Bo.sm,e.hoverable&&(b.cursor="pointer"),{...b,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function Ho(e){let t=q(()=>{let n={display:e.inline?"inline-flex":"flex"};return e.direction&&(n.flexDirection=e.direction),e.wrap&&(n.flexWrap=e.wrap),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyContent&&(n.justifyContent=e.justifyContent),{...n,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)}function _o(e){let t=q(()=>{let n={};return e.flex&&(n.flex=e.flex),e.grow!==void 0&&(n.flexGrow=String(e.grow)),e.shrink!==void 0&&(n.flexShrink=String(e.shrink)),e.basis&&(n.flexBasis=e.basis),e.alignSelf&&(n.alignSelf=e.alignSelf),e.order!==void 0&&(n.order=String(e.order)),{...n,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)}function Yo(e){let t=q(()=>{let n={display:"grid"};return e.minColWidth?n.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:e.columns!==void 0&&(n.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(n.gridTemplateRows=e.rows),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyItems&&(n.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(n.gridTemplateAreas=e.areas.map(r=>`"${r}"`).join(" ")),{...n,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)}function Vo(e){let t=q(()=>{let n={};return e.gridColumn&&(n.gridColumn=e.gridColumn),e.gridRow&&(n.gridRow=e.gridRow),e.gridArea&&(n.gridArea=e.gridArea),e.alignSelf&&(n.alignSelf=e.alignSelf),e.justifySelf&&(n.justifySelf=e.justifySelf),{...n,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)}var Uo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function jo(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=G(!!e.defaultCollapsed),s=te(null),[a,l]=G("auto");re(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=S(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=S(y=>{if(!e.collapsible)return;let h=y.key;(h==="Enter"||h===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),b=q(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Uo[n]??Uo.none,{...y,...e.style??{}}},[t,n,e.style]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},f={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},g={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:b},o("div",{className:"panel__header",style:m,onClick:d,onKeyDown:u,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:c}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?f:{},ref:s},o("div",{className:"panel__body",style:g},e.children)))}function Go(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function Za(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":return{scrollbarWidth:"thin"};case"hover":return{scrollbarWidth:"thin"};case"auto":default:return{scrollbarWidth:"auto"}}}function Xo(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=te(null),[s,a]=G(!0),[l,d]=G(!1),[u,b]=G(!0),[m,c]=G(!1),f=S(()=>{let x=i.current;if(!x)return;let v=2;a(x.scrollTop<=v),d(x.scrollTop+x.clientHeight>=x.scrollHeight-v),b(x.scrollLeft<=v),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-v)},[]);re(()=>{f()},[f]);let g=S(()=>{r&&f()},[r,f]),y=q(()=>{let x={position:"relative",overflowX:Go(t,"x"),overflowY:Go(t,"y"),...Za(n)};return e.maxHeight&&(x.maxHeight=e.maxHeight),e.maxWidth&&(x.maxWidth=e.maxWidth),e.padding&&(x.padding=e.padding),{...x,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),h=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&h.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&h.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&h.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!m&&h.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let p={...y};return h.length>0&&(p.boxShadow=h.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:p,ref:i,onScroll:g},e.children)}function qo(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=G(e.initialSplit??50),l=te(null),d=te(!1),u=S(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);re(()=>{let y=p=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,T=n?p.clientX-x.left:p.clientY-x.top;if(v<=0)return;let D=i/v*100,C=e.maxSize?e.maxSize/v*100:100-D,P=T/v*100;P=Math.max(D,Math.min(C,P)),a(P)},h=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",h),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",h)}},[n,i,e.maxSize]);let b=q(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},f={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},g=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:b,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},g[0]??null),o("div",{className:"splitter__divider",style:f,onMouseDown:u,onKeyDown:y=>{let h=y.key,p=2;n&&(h==="ArrowLeft"||h==="ArrowRight")?(y.preventDefault(),a(x=>{let v=h==="ArrowRight"?p:-p;return Math.max(5,Math.min(95,x+v))})):!n&&(h==="ArrowUp"||h==="ArrowDown")&&(y.preventDefault(),a(x=>{let v=h==="ArrowDown"?p:-p;return Math.max(5,Math.min(95,x+v))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(s)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:c},g[1]??null))}function Ko(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(p=>!p.disabled)?.id??"",[i,s]=G(e.activeTab??r),a=e.activeTab??i,l=te(null),d=S(p=>{s(p),e.onChange&&e.onChange(p)},[e.onChange]),u=S(p=>{let x=e.tabs.filter(L=>!L.disabled),v=x.findIndex(L=>L.id===a);if(v===-1)return;let T=t==="left"||t==="right",D=T?"ArrowUp":"ArrowLeft",C=T?"ArrowDown":"ArrowRight",P=-1;if(p.key===D?P=v>0?v-1:x.length-1:p.key===C?P=v<x.length-1?v+1:0:p.key==="Home"?P=0:p.key==="End"&&(P=x.length-1),P>=0){p.preventDefault(),d(x[P].id);let L=l.current;if(L){let M=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[P])];M&&M.focus()}}},[e.tabs,a,t,d]),b=t==="left"||t==="right",m=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:b?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[b,m,e.style]),f={display:"flex",flexDirection:b?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!b?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&b?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},g={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(p=>p.id===a),h=e.tabs.map(p=>{let x=p.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:p.disabled?"not-allowed":"pointer",opacity:p.disabled?"0.5":"1",fontSize:"14px",fontWeight:x?"600":"400",color:x?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?b?t==="left"?(v.borderRight=x?"2px solid #3b82f6":"2px solid transparent",v.marginRight="-2px"):(v.borderLeft=x?"2px solid #3b82f6":"2px solid transparent",v.marginLeft="-2px"):(v.borderBottom=x?"2px solid #3b82f6":"2px solid transparent",v.marginBottom="-2px"):n==="card"?(v.backgroundColor=x?"#ffffff":"transparent",v.borderRadius="6px 6px 0 0",x&&(v.border="1px solid #e5e7eb",v.borderBottom="1px solid #ffffff")):n==="pill"&&(v.borderRadius="9999px",v.backgroundColor=x?"#3b82f6":"transparent",v.color=x?"#ffffff":"#6b7280"),o("button",{key:p.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${p.id}`,"aria-disabled":p.disabled?"true":void 0,id:`tab-${p.id}`,tabIndex:x?"0":"-1",style:v,onClick:p.disabled?void 0:()=>d(p.id),onKeyDown:u},p.icon?o("span",{className:"tabs__tab-icon"},p.icon):null,p.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":b?"vertical":"horizontal",style:f,ref:l},...h),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:g,tabIndex:"0"},y?y.content:null))}function Zo(e){let t=e.items??[],n=t.length,r=e.loop!==!1,i=e.showDots!==!1,s=e.showArrows!==!1,a=e.animation??"slide",l=e.interval??5e3,d=xe().replace(/[^a-zA-Z0-9_-]/g,""),[u,b]=G(0),m=te(null),c=te(null),f=S(C=>{let P=C;r?P=(C%n+n)%n:P=Math.max(0,Math.min(C,n-1)),b(P),e.onChange&&e.onChange(P)},[n,r,e.onChange]),g=S(()=>f(u+1),[u,f]),y=S(()=>f(u-1),[u,f]);re(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(g,l);return()=>clearInterval(C)},[e.autoPlay,l,g,n]),re(()=>{let C=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&g()},P=c.current;if(P)return P.addEventListener("keydown",C),()=>P.removeEventListener("keydown",C)},[g,y]);let h=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",p={position:"relative",overflow:"hidden",width:"100%",outline:"none"},x=q(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),v={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},T=t.map((C,P)=>{let L=a==="fade"?{position:P===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:P===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(P),style:L},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),D=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,P)=>o("button",{key:String(P),"aria-label":`Go to slide ${P+1}`,onclick:()=>f(P),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:P===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:p,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let P=C.clientX-m.current;P>50?y():P<-50&&g(),m.current=null}},h?o("style",null,h):null,o("div",{style:x},...T),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...v,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:g,style:{...v,right:"8px"}},"\u203A"):null,D)}function Jo(e){let[t,n]=G("loading"),r=te(null),i=xe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.lazy!==!1,a=typeof e.width=="number"?`${e.width}px`:e.width,l=typeof e.height=="number"?`${e.height}px`:e.height;re(()=>{n("loading")},[e.src]);let d=q(()=>{let f={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(f.width=a),l&&(f.height=l),e.borderRadius&&(f.borderRadius=e.borderRadius),f},[a,l,e.borderRadius]),u=q(()=>{let f={display:"block",width:"100%",height:"100%"};return e.objectFit&&(f.objectFit=e.objectFit),t==="loading"&&(f.opacity="0",f.position="absolute"),t==="error"&&(f.display="none"),f},[e.objectFit,t]),b=null;if(t==="loading")if(e.placeholder==="skeleton"){let f=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;b=o("div",null,o("style",null,f),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?b=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(b=e.placeholder);let m=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?m=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):m=e.fallback);let c=o("div",{style:d},b,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),m);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},c,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):c}function Qo(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function er(e){let t=e.controls!==!1,n=te(null),r=xe().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=G(!1),[a,l]=G(0),[d,u]=G(0),[b,m]=G(e.muted?0:1),[c,f]=G(!!e.muted),[g,y]=G(!0),h=typeof e.width=="number"?`${e.width}px`:e.width??"100%",p=typeof e.height=="number"?`${e.height}px`:e.height??"auto";re(()=>{let I=n.current;if(!I)return;let M=()=>{s(!0),e.onPlay&&e.onPlay()},F=()=>{s(!1),e.onPause&&e.onPause()},R=()=>{s(!1),e.onEnded&&e.onEnded()},N=()=>{l(I.currentTime),u(I.duration),e.onTimeUpdate&&e.onTimeUpdate(I.currentTime,I.duration)},A=()=>{u(I.duration)};return I.addEventListener("play",M),I.addEventListener("pause",F),I.addEventListener("ended",R),I.addEventListener("timeupdate",N),I.addEventListener("loadedmetadata",A),()=>{I.removeEventListener("play",M),I.removeEventListener("pause",F),I.removeEventListener("ended",R),I.removeEventListener("timeupdate",N),I.removeEventListener("loadedmetadata",A)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let x=S(()=>{let I=n.current;I&&(I.paused?I.play():I.pause())},[]),v=S(I=>{let M=n.current;if(!M||!isFinite(M.duration))return;let F=I.currentTarget.getBoundingClientRect(),R=Math.max(0,Math.min(1,(I.clientX-F.left)/F.width));M.currentTime=R*M.duration},[]),T=S(I=>{let M=n.current,F=parseFloat(I.target.value);M&&(M.volume=F,M.muted=F===0,m(F),f(F===0))},[]),D=S(()=>{let I=n.current;I&&I.requestFullscreen&&I.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,style:{width:h,height:p,display:"block"}});let C=d>0?a/d*100:0,P={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},L=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:g?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:x,style:P},i?"\u23F8":"\u25B6"),o("div",{onclick:v,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${Qo(a)} / ${Qo(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:b),oninput:T,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:D,style:P},"\u26F6"));return o("div",{style:{position:"relative",width:h,height:p,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:x,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function Pe(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=te(null),a={display:"flex",flexDirection:t==="horizontal"?"row":"column",backgroundColor:i.backgroundColor??"#ffffff",color:i.color??"#1f2937",fontFamily:i.fontFamily??"inherit",fontSize:i.fontSize??"14px",border:i.border??"1px solid #e5e7eb",borderRadius:i.borderRadius??"8px",padding:i.padding??"0",width:typeof i.width=="number"?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:typeof i.maxHeight=="number"?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},l=S(d=>{if(!r)return;let u=d,b=s.current;if(!b)return;let m=Array.from(b.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let f=t==="vertical",g=f?"ArrowDown":"ArrowRight",y=f?"ArrowUp":"ArrowLeft";if(u.key===g){u.preventDefault();let h=m[c+1];h&&h.focus()}else if(u.key===y){u.preventDefault();let h=m[c-1];h&&h.focus()}else u.key==="Home"?(u.preventDefault(),m[0]?.focus()):u.key==="End"&&(u.preventDefault(),m[m.length-1]?.focus())},[r,t]);return o("nav",{ref:s,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:l},e.children)}function ot(e,t){return{display:"flex",alignItems:"center",padding:e.padding??"10px 16px",cursor:e.cursor??"pointer",transition:e.transition??"background-color 0.15s",backgroundColor:t.active?e.activeBackground??"#eff6ff":t.hover?e.hoverBackground??"#f3f4f6":"transparent",color:t.active?e.activeColor??"#2563eb":"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",...e.separator?{borderBottom:e.separator}:{}}}function Ce(){let[e,t]=G(!1);return{hover:e,onMouseEnter:S(()=>t(!0),[]),onMouseLeave:S(()=>t(!1),[])}}function Ja(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:b}=Ce(),m=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:m?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:m?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:m?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let f=S(v=>{let T=v;m||(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),r())},[m,r]),g=S(()=>{m||r()},[m,r]),h=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),p=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,x=l==="left"?[h,p]:[p,h];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":m?"true":void 0,"data-section-id":t.id,tabIndex:m?-1:0,style:c,onClick:g,onKeyDown:f,onMouseEnter:u,onMouseLeave:b},...x)}function Qa(e){let{section:t,expanded:n,contentStyle:r,animated:i}=e,s={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:s},o("div",{style:a},t.content))}function tr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:b=!0,onChange:m}=e,[c,f]=G(()=>n??[]),g=S(h=>{f(p=>{let x=p.includes(h),v;return x?v=p.filter(T=>T!==h):r?v=[...p,h]:v=[h],m&&m(v),v})},[r,m]),y=q(()=>t.map(h=>{let p=c.includes(h.id),x=o(Ja,{key:`header-${h.id}`,section:h,expanded:p,onToggle:()=>g(h.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(Qa,{key:`content-${h.id}`,section:h,expanded:p,contentStyle:s,animated:b});return o("div",{key:h.id,"data-accordion-section":h.id,style:{width:"100%"}},x,v)}),[t,c,i,s,l,d,u,b,g]);return o(Pe,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var el={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function nr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=G(!1),l=el[i],d=S(()=>{a(!0)},[]),u=t,b=!1;if(r&&r>1&&t.length>r&&!s){b=!0;let g=1,y=r-1;u=[...t.slice(0,g),{label:"..."},...t.slice(t.length-y)]}let m=g=>typeof g=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},g):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},g),c=(g,y,h)=>{let p=y===h.length-1,x=b&&g.label==="..."&&y===1,v=[];return y>0&&v.push(m(n)),x?v.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):p?v.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},g.label)):g.href?v.push(o("a",{href:g.href,onClick:g.onClick?T=>{T.preventDefault(),g.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},g.label)):g.onClick?v.push(o("button",{type:"button",onClick:g.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},g.label)):v.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},g.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...v)},f=u.map((g,y)=>c(g,y,u));return o(Pe,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...f))}function or(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Ce(),[d,u]=G(!1),b=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let m=t.disabled===!0,f={...ot(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},g=S(()=>{if(!m){if(b){u(T=>!T);return}t.onClick&&t.onClick(),r&&i()}},[m,b,t,r,i]),y=S(()=>{a(),b&&u(!0)},[b,a]),h=S(()=>{l(),b&&u(!1)},[b,l]),p=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),x=b?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,v=b&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(Pe,{orientation:"vertical",role:"menu",styling:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",width:"200px",backgroundColor:"#ffffff"}},...t.children.map(T=>o(or,{key:T.id,item:T,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:h},o("button",{type:"button",role:"menuitem",style:f,onClick:g,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":b||void 0,"aria-expanded":b?String(d):void 0},p,x),v)}function rr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,b]=G(!1),m=te(null),c=S(()=>{b(T=>!T)},[]),f=S(()=>{b(!1)},[]);re(()=>{if(!u)return;let T=D=>{let C=m.current;C&&!C.contains(D.target)&&b(!1)};return document.addEventListener("click",T,!0),()=>{document.removeEventListener("click",T,!0)}},[u]),re(()=>{if(!u)return;let T=D=>{D.key==="Escape"&&b(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[u]);let g={display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 16px",fontSize:"14px",fontFamily:"inherit",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#1f2937",cursor:"pointer",outline:"none",...r??{}},y=o("button",{type:"button",style:g,onClick:c,"aria-haspopup":"true","aria-expanded":String(u)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),h=typeof d=="number"?`${d}px`:d,p={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},x={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:h,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:p},o(Pe,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(T=>o(or,{key:T.id,item:T,itemStyle:s,closeOnSelect:l,onClose:f})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,v)}function ir(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ce(),[l,d]=G(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let b=t.disabled===!0,m=S(()=>{if(!b){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[b,u,t,n]),c=S(()=>{s(),u&&d(!0)},[u,s]),f=S(()=>{a(),u&&d(!1)},[u,a]),g={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:b?"default":"pointer",backgroundColor:!b&&i?"#f3f4f6":"transparent",color:b?"#9ca3af":"#1f2937",opacity:b?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),h=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"\u25B6"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,p=u&&l?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((x,v)=>o(ir,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:f},o("button",{type:"button",role:"menuitem",style:g,onClick:m,disabled:b||void 0,tabIndex:-1,"aria-disabled":b||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,h),p)}function tl(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Ce(),b=te(null),m=S(()=>{r?a():s(n)},[r,n,s,a]),c=S(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),f={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},g=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,h)=>o(ir,{key:String(h),item:y,onClose:a,index:h})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:b,type:"button",role:"menuitem",style:f,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),g)}function sr(e){let{menus:t}=e,[n,r]=G(null),i=te(null),s=S(d=>{r(d)},[]),a=S(()=>{r(null)},[]);re(()=>{if(n===null)return;let d=u=>{let b=i.current;b&&!b.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),re(()=>{let d=i.current;if(!d)return;let u=b=>{let m=b;if(m.key==="Escape"){r(null);return}if(m.key==="ArrowRight"){m.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(m.key==="ArrowLeft"){m.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(m.key==="ArrowDown"&&n!==null){m.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let f=c.querySelector('[role="menuitem"]');f&&f.focus()}return}m.key==="Enter"||m.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(tl,{key:String(u),menu:d,index:u,isOpen:n===u,anyOpen:n!==null,onOpen:s,onClose:a}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...l)}function zt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function nl(e,t,n){let r=n*2+5;if(e<=r)return zt(1,e);let i=Math.max(t-n,1),s=Math.min(t+n,e),a=i>2,l=s<e-1;return!a&&l?[...zt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...zt(e-n*2-2,e)]:[1,"ellipsis",...zt(i,s),"ellipsis",e]}var At={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#374151",fontSize:"14px",fontFamily:"inherit",cursor:"pointer",transition:"background-color 0.15s, color 0.15s",outline:"none",userSelect:"none"},ol={...At,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},ar={...At,color:"#9ca3af",cursor:"default",opacity:"0.5"},rl={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function lr(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),b=Math.min(Math.max(1,r),u),m=S(h=>{!d&&h>=1&&h<=u&&h!==b&&i(h)},[d,u,b,i]),c=(h,p,x)=>{let v=d||p<1||p>u||p===b;return o("button",{type:"button",onClick:()=>m(p),disabled:v||void 0,"aria-label":x,style:v?ar:At},h)},f=nl(u,b,s),g=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",b-1,"Go to previous page"));for(let h of f)if(h==="ellipsis")y.push(o("span",{key:`ellipsis-${g++}`,style:rl},"..."));else{let p=h===b;y.push(o("button",{key:String(h),type:"button",onClick:()=>m(h),disabled:d||void 0,"aria-label":`Page ${h}`,"aria-current":p?"page":void 0,style:d?ar:p?ol:At},String(h)))}return l&&y.push(c("\u203A",b+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(Pe,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function cr(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Ce(),[u,b]=G(!1),m=t.children&&t.children.length>0,c=t.id===r,f=S(()=>{m&&!n&&b(P=>!P),i&&i(t.id)},[m,n,i,t.id]),g=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${g}`,justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:c?"#eff6ff":a?"#f3f4f6":"transparent",color:c?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},h=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,p=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),x=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,v=!n&&m?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,T=n&&a?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,D=o("button",{type:"button",style:y,onClick:f,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},h,p,x,v,T),C=!n&&m&&u?t.children.map(P=>o(cr,{key:P.id,item:P,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},D,C?o("div",{role:"group"},...C):null)}function dr(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,b=t.map(m=>o(cr,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(Pe,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...b)}var Le={completed:"#2563eb",completedBg:"#2563eb",completedText:"#ffffff",active:"#2563eb",activeBorder:"#2563eb",activeText:"#2563eb",pending:"#d1d5db",pendingText:"#9ca3af",line:"#d1d5db",lineCompleted:"#2563eb",labelActive:"#1f2937",labelPending:"#9ca3af",descriptionColor:"#6b7280"};function ur(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,b=S(h=>{s&&i&&i(h)},[s,i]),m=h=>h<n?"completed":h===n?"active":"pending",c=(h,p,x)=>{let v=a==="dot"?u:d,T={width:`${v}px`,height:`${v}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return x==="completed"?o("div",{style:{...T,backgroundColor:Le.completedBg,color:Le.completedText,border:`2px solid ${Le.completed}`}},a==="circle"?p.icon||"\u2713":null):x==="active"?o("div",{style:{...T,backgroundColor:"#ffffff",color:Le.activeText,border:`2px solid ${Le.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?p.icon||String(h+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Le.active}})):o("div",{style:{...T,backgroundColor:"#ffffff",color:Le.pendingText,border:`2px solid ${Le.pending}`}},a==="circle"?p.icon||String(h+1):null)},f=h=>{if(h>=t.length-1)return null;let x=h<n?Le.lineCompleted:Le.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:x,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:x,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},g=(h,p)=>{let x=m(p),v=x==="active",T=x==="completed",D=c(p,h,x),C={fontSize:"13px",fontWeight:v?"600":"400",color:v||T?Le.labelActive:Le.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},P={fontSize:"11px",color:Le.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},L=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:C},h.label),h.description?o("span",{style:P},h.description):null),I=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},D,L):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},D,L);return o(s?"button":"div",{key:String(p),onClick:s?()=>b(p):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":v?"step":void 0},I)},y=[];return t.forEach((h,p)=>{y.push(g(h,p));let x=f(p);x&&y.push(x)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var pr={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function il(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ce(),l=pr[n],d=t.disabled===!0,u=t.type==="toggle",[b,m]=G(!1),c=u?t.active===!0:b,f=S(()=>{!d&&t.onClick&&t.onClick()},[d,t]),g=S(()=>{!d&&!u&&m(!0)},[d,u]),y=S(()=>{u||m(!1)},[u]),h=S(()=>{a(),u||m(!1)},[u,a]),p={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!d&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:d?"#9ca3af":c?"#2563eb":"#374151",cursor:d?"default":"pointer",opacity:d?"0.5":"1",outline:"none",transition:"background-color 0.15s"},x=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,v=t.label?o("span",null,t.label):null,T=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:p,onClick:f,onMouseDown:g,onMouseUp:y,onMouseEnter:s,onMouseLeave:h,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},x,v,T)}function fr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=pr[n],s=t.map(a=>a.type==="separator"?o("div",{key:a.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):a.type==="spacer"?o("div",{key:a.id,style:{flex:"1"},"aria-hidden":"true"}):o(il,{key:a.id,item:a,size:n,variant:r}));return o(Pe,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:r==="raised"?"1px solid #e5e7eb":"none",borderRadius:r==="raised"?"8px":"0",padding:"4px",backgroundColor:r==="raised"?"#ffffff":"transparent",boxShadow:r==="raised"?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...s)}var rt=class e{constructor(t,n){Ve(this,"id");Ve(this,"label");Ve(this,"children");Ve(this,"expanded");Ve(this,"icon");Ve(this,"metadata");Ve(this,"parent");Ve(this,"depth");this.id=t.id,this.label=t.label,this.expanded=t.expanded??!1,this.icon=t.icon??null,this.metadata=t.metadata??{},this.parent=n??null,this.depth=n?n.depth+1:0,this.children=(t.children??[]).map(r=>new e(r,this))}static fromData(t){return new e(t)}isLeaf(){return this.children.length===0}isRoot(){return this.parent===null}walk(t){t(this,this.depth);for(let n of this.children)n.walk(t)}find(t){if(this.id===t)return this;for(let n of this.children){let r=n.find(t);if(r)return r}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(t){let n=new e(t,this);return this.children.push(n),n}removeChild(t){let n=this.children.findIndex(r=>r.id===t);return n===-1?!1:(this.children.splice(n,1),!0)}};function gr(e){e.expanded=!0;for(let t of e.children)gr(t)}function mr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)mr(n,t);return t}function sl(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function al(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:b,onClick:m,focusedId:c}=e,f=Ce(),g=te(null),y=c===t.id;re(()=>{y&&g.current&&g.current.focus()},[y]);let h=t.isLeaf(),p=t.depth,x=[];for(let P=0;P<p;P++){let L=t;for(let M=0;M<p-P;M++)L=L?L.parent:null;let I=L?!sl(L):!1;x.push(o("span",{key:`connector-${P}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...I?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=p>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,T=h?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:P=>{P.stopPropagation(),b(t)}},t.expanded?a:l),D=u?u(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),C=ot(d,{hover:f.hover,active:n});return o("div",{ref:g,role:"treeitem","aria-expanded":h?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":p+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:f.onMouseEnter,onMouseLeave:f.onMouseLeave,onClick:()=>m(t)},...x,v,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},T,D))}function hr(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:b="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:f,renderNode:g}=e,[y,h]=G(()=>{let I=rt.fromData(t);return a&&gr(I),I}),[p,x]=G(t.id),v=q(()=>mr(y),[y]),T=S(()=>{h(I=>{let M=Object.create(Object.getPrototypeOf(I));return Object.assign(M,I),M})},[]),D=S(I=>{I.toggle(),I.expanded?r?.(I):i?.(I),T()},[r,i,T]),C=S(I=>{x(I.id),n?.(I)},[n]),P=S(I=>{let M=I;if(!p)return;let F=v.findIndex(N=>N.id===p);if(F===-1)return;let R=v[F];switch(M.key){case"ArrowDown":{M.preventDefault();let N=v[F+1];N&&x(N.id);break}case"ArrowUp":{M.preventDefault();let N=v[F-1];N&&x(N.id);break}case"ArrowRight":{M.preventDefault(),R.isLeaf()||(R.expanded?R.children.length>0&&x(R.children[0].id):D(R));break}case"ArrowLeft":{M.preventDefault(),!R.isLeaf()&&R.expanded?D(R):R.parent&&x(R.parent.id);break}case"Enter":{M.preventDefault(),C(R);break}case" ":{M.preventDefault(),R.isLeaf()||D(R);break}case"Home":{M.preventDefault(),v.length>0&&x(v[0].id);break}case"End":{M.preventDefault(),v.length>0&&x(v[v.length-1].id);break}}},[p,v,D,C]),L=v.map(I=>o(al,{key:I.id,node:I,isSelected:I.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:b,iconCollapsed:m,nodeStyle:c,renderNode:g,onToggle:D,onClick:C,focusedId:p}));return o(Pe,{role:"tree",ariaLabel:"Tree navigation",styling:f,keyboardNav:!1},o("div",{onKeyDown:P,style:{outline:"none"}},...L))}function br(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=G(-1),[l,d]=G(null),u=te(null);re(()=>{if(!u.current)return;u.current.focus();let c=g=>{let y=g,h=t.map((p,x)=>({item:p,i:x})).filter(({item:p})=>!p.divider);if(y.key==="ArrowDown")y.preventDefault(),a(p=>{let v=(h.findIndex(({i:T})=>T===p)+1)%h.length;return h[v].i});else if(y.key==="ArrowUp")y.preventDefault(),a(p=>{let x=h.findIndex(({i:T})=>T===p),v=x<=0?h.length-1:x-1;return h[v].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let p=t[s];p.children?d(s):!p.disabled&&p.onClick&&(p.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let f=u.current;return()=>f.removeEventListener("keydown",c)},[t,s,i,r]);let b={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},m=t.map((c,f)=>{if(c.divider)return o("div",{key:`divider-${f}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let g=s===f,y=!!c.disabled,h=!!(c.children&&c.children.length>0),p={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:g&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(f),d(h?f:null)},v=()=>{if(!y){if(h){d(f);return}c.onClick&&c.onClick(),r()}},T=[];c.icon&&T.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),T.push(o("span",{style:{flex:"1"}},c.label??"")),h&&T.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let D=[o("div",{key:`item-${f}`,style:p,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":y?"true":void 0},...T)];return h&&l===f&&D.push(o(br,{key:`submenu-${f}`,items:c.children,position:{x:n.x+178,y:n.y+f*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${f}`,style:{position:"relative"}},...D)});return o("div",{ref:u,style:b,tabIndex:-1,role:"menu"},...m)}function Lt(e){let{items:t,children:n}=e,[r,i]=G(null),s=S(u=>{u.preventDefault();let b=u;i({x:b.clientX,y:b.clientY})},[]),a=S(()=>{i(null)},[]);re(()=>{if(!r)return;let u=m=>{a()},b=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(b),document.removeEventListener("mousedown",u)}},[r,a]),re(()=>{if(!r)return;let u=b=>{b.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(br,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function ll(e,t){if(t)return"translate3d(0, 0, 0)";switch(e){case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"top":return"translate3d(0, -100%, 0)";case"bottom":return"translate3d(0, 100%, 0)"}}function cl(e,t){let n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}function xr(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[b,m]=G(!1),[c,f]=G(!1),g=te(null),y=s?"drawer-title":void 0;if(re(()=>{if(t)m(!0),requestAnimationFrame(()=>f(!0));else{f(!1);let I=setTimeout(()=>m(!1),300);return()=>clearTimeout(I)}},[t]),re(()=>{if(!t||!d)return;let I=M=>{M.key==="Escape"&&n()};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,d,n]),re(()=>{if(!t)return;let I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[t]),re(()=>{t&&g.current&&g.current.focus()},[t]),!b)return null;let h={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},p={...cl(r,i),transform:ll(r,c),transition:"transform 0.3s ease"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},v={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},T={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},D={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},P=[];s&&P.push(o("div",{style:x},o("h3",{id:y,style:v},s),o("button",{type:"button",style:T,onClick:n,"aria-label":"Close drawer"},"\xD7"))),P.push(o("div",{style:D},u));let L=[];return a&&L.push(o("div",{style:h,onClick:C})),L.push(o("div",{ref:g,style:p,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...P)),o("div",null,...L)}var dl={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function yr(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,b=te(null);if(re(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),re(()=>{if(!t||!a)return;let C=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),re(()=>{t&&b.current&&b.current.focus()},[t]),!t)return null;let m={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},c={backgroundColor:"#fff",borderRadius:i==="full"?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:i==="full"?"100vh":"90vh",width:dl[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},f={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},g={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},h={padding:"24px",overflow:"auto",flex:"1"},p={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=C=>{s&&C.target===C.currentTarget&&n()},v=[],T=r?"modal-title":void 0;r?v.push(o("h2",{id:T,style:g},r)):v.push(o("span",null)),d&&v.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let D=[o("div",{style:f},...v),o("div",{style:h},u)];return l&&D.push(o("div",{style:p},l)),o("div",{style:m,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":T},o("div",{ref:b,style:c,tabIndex:-1,role:"document"},...D))}var Sr=8;function ul(e,t){let n=t+Sr;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function pl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Sr}px`,r="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} #fff ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} #fff ${r} ${r}`}}}function vr(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[b,m]=G(!1),c=u?r:b,f=te(null),g=S(()=>{u?d&&d(!r):m(T=>!T)},[u,r,d]);re(()=>{if(!c||!l)return;let T=D=>{f.current&&!f.current.contains(D.target)&&(u?d&&d(!1):m(!1))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},h={...ul(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},p=[n];a&&p.push(o("div",{style:pl(i)}));let x=S(T=>{let D=T.key;(D==="Enter"||D===" ")&&(T.preventDefault(),g())},[g]),v=[o("div",{onClick:g,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&v.push(o("div",{style:h},...p)),o("div",{ref:f,style:y},...v)}var fl=0;function gl(){return`toast-${++fl}-${Date.now()}`}function ln(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let b=gl();return n=[{id:b,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),b}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var ml={info:{bg:"#eff6ff",border:"#3b82f6",icon:"\u2139\uFE0F"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"\u2705"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"\u26A0\uFE0F"},error:{bg:"#fef2f2",border:"#ef4444",icon:"\u274C"}};function hl(e){let t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),r=e.startsWith("bottom"),i=e.endsWith("left"),s=e.endsWith("right"),a=e.endsWith("center");return n&&(t.top="0"),r&&(t.bottom="0",t.flexDirection="column-reverse"),i&&(t.left="0"),s&&(t.right="0"),a&&(t.left="50%",t.transform="translateX(-50%)"),t}function bl(e){let{item:t,onDismiss:n}=e,r=ml[t.type];re(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},a={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function cn(e){let{toaster:t}=e,[,n]=G(0);re(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=hl(t.config.position);re(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let d=document.createElement("style");return d.id=l,d.textContent=`
3
3
  @keyframes specifyjs-toast-slide-in {
4
4
  from { opacity: 0; transform: translateY(-12px); }
5
5
  to { opacity: 1; transform: translateY(0); }
6
6
  }
7
- `,document.head.appendChild(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,-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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.3 -1.8,-.3 v -1.7 l 2.8,-5.8 5.9,-3.9 -.4,-13 .9,.4 .6,-.5 .1,-1.1 .9,-.6 1.4,1.2 .7,-.1 h 2.6 l 6.8,-2.6 .3,-1 h 1.2 l .7,-1.2 .4,.8 1.8,-.9 1.8,-1.7 .3,.5 1,-1 2.2,1.6 -.8,1.6 -1.2,1.4 .5,1.5 -1.4,1.6 .4,.9 2.3,-1.1 v -1.4 l 3.3,1.9 1.9,.7 1.9,.7 3,3.8 17,3.8 1.4,1 4,.8 .7,.5 2.8,-.2 4.9,.8 1.4,1.5 -1,1 .8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3 z m -49.5,-37.3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function 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)}
7
+ `,document.head.appendChild(d),()=>{let u=document.getElementById(l);u&&u.remove()}},[]);let s=S(l=>t.dismiss(l),[t]),a=r.map(l=>o(bl,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function wr(e={}){let t=te(null);t.current||(t.current=ln(e));let n=t.current,r=S(()=>o(cn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var xl=6,yl=8;function Sl(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=yl;switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.top-i}px`,transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+i}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:`${e.left-i}px`,top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+i}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}function vl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${xl}px`,r="transparent",i="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${i} ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} ${i} ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} ${i}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} ${i} ${r} ${r}`}}}function kr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=G(!1),[d,u]=G(null),b=te(null),m=te(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,f=S(()=>{m.current=setTimeout(()=>{if(b.current){let x=b.current.getBoundingClientRect();u(Sl(x,n))}l(!0)},r)},[r,n]),g=S(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);re(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},h={...d??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},p=[o("div",{ref:b,style:y,onMouseEnter:f,onMouseLeave:g,onFocus:f,onBlur:g,"aria-describedby":a?c:void 0},s)];return a&&d&&p.push(o("div",{id:c,style:h,role:"tooltip"},t,o("div",{style:vl(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...p)}function dn(e,t,n,r,i){return q(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:d=>t===0?0:d/t*n,categoryScale:d=>i+d*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function wl(e,t,n){if(t&&t.length>0){if(n){let s=0;for(let a of t)for(let l of a.values)l.value>s&&(s=l.value);return s}let i=0;for(let s of t){let a=0;for(let l of s.values)a+=l.value;a>i&&(i=a)}return i}let r=0;for(let i of e)i.value>r&&(r=i.value);return r}function kl(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Cl(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var Cr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Mr(e,t){return t||Cr[e%Cr.length]}function Er(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:b="#e5e7eb",title:m,padding:c=50,animate:f=!1,stacked:g,grouped:y=!1}=e,h=i==="vertical",p=n-c*2,x=r-c*2,v=h?x:p,T=h?p:x,D=g!==void 0&&g.length>0,C=q(()=>D?Cl(g):[],[D,g]),P=D?g.length:t.length,L=q(()=>wl(t,g,y),[t,g,y]),I=L>0?L:1,M=dn(P,I,v,T,a),F=S(()=>{if(!u)return[];let _=kl(I),U=[];for(let X=_;X<=I;X+=_){let ee=M.valueScale(X);if(h){let Z=c+x-ee;U.push(o("line",{key:`grid-${X}`,x1:String(c),y1:String(Z),x2:String(c+p),y2:String(Z),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${X}`,x:String(c-6),y:String(Z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}else{let Z=c+ee;U.push(o("line",{key:`grid-${X}`,x1:String(Z),y1:String(c),x2:String(Z),y2:String(c+x),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${X}`,x:String(Z),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}}return U},[u,I,M,h,c,p,x,b]),R=S(()=>{let _=[];return h?(_.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),_.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+p),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(_.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+p),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),_.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))),_},[h,c,p,x]),N=S(()=>{let _=[];for(let U=0;U<t.length;U++){let X=t[U],ee=M.valueScale(X.value),Z=M.categoryScale(U),V=X.color??s,j,H,Y=String(X.value);if(h){let K=c+Z,Q=c+x-ee;j={x:String(K),y:String(Q),width:String(M.barThickness),height:String(ee),rx:String(l),ry:String(l),fill:V},H={x:String(K+M.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let K=c+Z,Q=c;j={x:String(Q),y:String(K),width:String(ee),height:String(M.barThickness),rx:String(l),ry:String(l),fill:V},H={x:String(Q+ee+6),y:String(K+M.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(f&&(j.style=h?`animation: barGrow 0.6s ease-out ${U*.05}s both`:`animation: barGrow 0.6s ease-out ${U*.05}s both`),_.push(o("rect",{key:`bar-${U}`,...j})),d&&_.push(o("text",{key:`val-${U}`,...H},Y)),h){let K=c+Z+M.barThickness/2,Q=c+x+16;_.push(o("text",{key:`cat-${U}`,x:String(K),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${K}, ${Q})`},X.label))}else _.push(o("text",{key:`cat-${U}`,x:String(c-6),y:String(c+Z+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return _},[t,M,s,l,d,f,h,c,x]),A=S(()=>{if(!g)return[];let _=[];for(let U=0;U<g.length;U++){let X=g[U],ee=M.categoryScale(U),Z=0;for(let V=0;V<X.values.length;V++){let j=X.values[V],H=M.valueScale(j.value),Y=M.valueScale(Z),K=Mr(V,j.color);if(h){let Q=c+ee,se=c+x-Y-H;_.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(se),width:String(M.barThickness),height:String(H),rx:V===X.values.length-1?String(l):"0",ry:V===X.values.length-1?String(l):"0",fill:K,...f?{style:`animation: barGrow 0.6s ease-out ${(U*X.values.length+V)*.03}s both`}:{}})),d&&H>14&&_.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+M.barThickness/2),y:String(se+H/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let Q=c+Y,se=c+ee;_.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(se),width:String(H),height:String(M.barThickness),rx:V===X.values.length-1?String(l):"0",ry:V===X.values.length-1?String(l):"0",fill:K,...f?{style:`animation: barGrow 0.6s ease-out ${(U*X.values.length+V)*.03}s both`}:{}})),d&&H>20&&_.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+H/2),y:String(se+M.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}Z+=j.value}if(d){let V=M.valueScale(Z);h?_.push(o("text",{key:`stotal-${U}`,x:String(c+ee+M.barThickness/2),y:String(c+x-V-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z))):_.push(o("text",{key:`stotal-${U}`,x:String(c+V+6),y:String(c+ee+M.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z)))}if(h){let V=c+ee+M.barThickness/2,j=c+x+16;_.push(o("text",{key:`scat-${U}`,x:String(V),y:String(j),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${V}, ${j})`},X.label))}else _.push(o("text",{key:`scat-${U}`,x:String(c-6),y:String(c+ee+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return _},[g,M,l,d,f,h,c,x]),k=S(()=>{if(!g)return[];let _=C.length,U=[];for(let X=0;X<g.length;X++){let ee=g[X],Z=M.categoryScale(X),V=2,j=Math.max(1,(M.barThickness-V*(_-1))/_);for(let H=0;H<ee.values.length;H++){let Y=ee.values[H],K=C.indexOf(Y.category),Q=K*(j+V),se=M.valueScale(Y.value),J=Mr(K>=0?K:H,Y.color);if(h){let ae=c+Z+Q,de=c+x-se;U.push(o("rect",{key:`gbar-${X}-${H}`,x:String(ae),y:String(de),width:String(j),height:String(se),rx:String(l),ry:String(l),fill:J,...f?{style:`animation: barGrow 0.6s ease-out ${(X*_+H)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${X}-${H}`,x:String(ae+j/2),y:String(de-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}else{let ae=c,de=c+Z+Q;U.push(o("rect",{key:`gbar-${X}-${H}`,x:String(ae),y:String(de),width:String(se),height:String(j),rx:String(l),ry:String(l),fill:J,...f?{style:`animation: barGrow 0.6s ease-out ${(X*_+H)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${X}-${H}`,x:String(ae+se+4),y:String(de+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}}if(h){let H=c+Z+M.barThickness/2,Y=c+x+16;U.push(o("text",{key:`gcat-${X}`,x:String(H),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${H}, ${Y})`},ee.label))}else U.push(o("text",{key:`gcat-${X}`,x:String(c-6),y:String(c+Z+M.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},ee.label))}return U},[g,C,M,l,d,f,h,c,x]),w=S(()=>m?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n,c]),$=S(()=>f?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},h?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[f,h]),E=F(),W=R(),z=w(),B=$(),O;return D&&y?O=k():D?O=A():O=N(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...B,...z,...E,...W,...O)}function it(e){let{start:t,end:n,step:r}=e;if(r<=0||!isFinite(r))return[];let i=Math.ceil((n-t)/r)+1;if(i>1e6)return[];let s=[];for(let a=0;a<i;a++){let l=t+a*r;if(l>n+r*.001)break;s.push(l)}return s}function Ft(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e(i);isFinite(s)&&n.push({input:i,output:s})}return n}function Nt(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let b=t[u],m=e(b);isFinite(m)&&a.push({input:b,output:m})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),Rr(l)};return Rr(l),()=>{i=!0}}function Rr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Ml(e,t){let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return(i<1.5?1:i<3?2:i<7?5:10)*r}function Pr(e,t){let n=t-e;if(n<=0)return[e];let r=Ml(n,8),i=Math.ceil(e/r)*r,s=[];for(let a=i;a<=t+r*.001;a+=r)s.push(Math.round(a*1e10)/1e10);return s}function Ir(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var Se=40,$r=1.1,Dr=.01,Tr=1e6;function zr(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:b=!0,showAxes:m=!0,pointRadius:c=3,pointColor:f="#3b82f6",curveColor:g="#3b82f6",gridColor:y="#e2e8f0",axisColor:h="#94a3b8",onPointClick:p,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:T}=e,[D,C]=G(d[0]),[P,L]=G(d[1]),[I,M]=G(u[0]),[F,R]=G(u[1]),N=te(!1),A=te(null),k=S(Y=>Se+(Y-D)/(P-D)*(t-2*Se),[D,P,t]),w=S(Y=>n-Se-(Y-I)/(F-I)*(n-2*Se),[I,F,n]),$=S(Y=>D+(Y-Se)/(t-2*Se)*(P-D),[D,P,t]),E=S(Y=>I+(n-Se-Y)/(n-2*Se)*(F-I),[I,F,n]),W=S(Y=>{let K=Y;N.current=!0,A.current={mx:K.clientX,my:K.clientY,x0:D,x1:P,y0:I,y1:F}},[D,P,I,F]),z=S(Y=>{if(!N.current||!A.current)return;let K=Y,Q=A.current,se=K.clientX-Q.mx,J=K.clientY-Q.my,ae=se/(t-2*Se)*(Q.x1-Q.x0),de=J/(n-2*Se)*(Q.y1-Q.y0);C(Q.x0-ae),L(Q.x1-ae),M(Q.y0+de),R(Q.y1+de)},[t,n]),B=S(()=>{N.current=!1,A.current=null},[]),O=S(Y=>{let K=Y;K.preventDefault();let Q=K.currentTarget.getBoundingClientRect(),se=K.clientX-Q.left,J=K.clientY-Q.top,ae=$(se),de=E(J),le=K.deltaY>0?$r:1/$r,ne=(P-D)*le,fe=(F-I)*le;if(ne<Dr||fe<Dr||ne>Tr||fe>Tr)return;let oe=(ae-D)/(P-D),ie=(de-I)/(F-I);C(ae-oe*ne),L(ae+(1-oe)*ne),M(de-ie*fe),R(de+(1-ie)*fe)},[D,P,I,F,$,E]),_=[];if(_.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),b){let Y=Pr(D,P),K=Pr(I,F);for(let Q=0;Q<Y.length;Q++){let se=k(Y[Q]);_.push(o("line",{x1:se,y1:Se,x2:se,y2:n-Se,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),_.push(o("text",{x:se,y:n-Se+14,"text-anchor":"end","font-size":10,fill:h,transform:`rotate(-45, ${se}, ${n-Se+14})`,key:`lx-${Q}`},Ir(Y[Q])))}for(let Q=0;Q<K.length;Q++){let se=w(K[Q]);_.push(o("line",{x1:Se,y1:se,x2:t-Se,y2:se,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),_.push(o("text",{x:Se-6,y:se+3,"text-anchor":"end","font-size":10,fill:h,key:`ly-${Q}`},Ir(K[Q])))}}if(m){let Y=Math.max(Se,Math.min(t-Se,k(0))),K=Math.max(Se,Math.min(n-Se,w(0)));_.push(o("line",{x1:Se,y1:K,x2:t-Se,y2:K,stroke:h,"stroke-width":1,key:"x-axis"})),_.push(o("line",{x1:Y,y1:Se,x2:Y,y2:n-Se,stroke:h,"stroke-width":1,key:"y-axis"}))}let U=q(()=>{if(!i||!l)return[];let Y=a??(P-D)/s,K=it({start:D,end:P,step:Y});return Ft(i,K)},[i,D,P,a,s,l]),[X,ee]=G([]),Z=te(null);re(()=>{if(!i||l){ee([]);return}let Y=a??(P-D)/s,K=it({start:D,end:P,step:Y});return Z.current&&Z.current(),Z.current=Nt(i,K,200,Q=>{ee([...Q])}),()=>{Z.current&&Z.current()}},[i,D,P,a,s,l]);let V=l?U:X;if(V.length>0){let Y=[];for(let K=0;K<V.length;K++){let Q=V[K],se=k(Q.input),J=w(Q.output);Y.push(`${Y.length===0?"M":"L"}${se},${J}`)}_.push(o("path",{d:Y.join(" "),fill:"none",stroke:g,"stroke-width":1.5,key:"curve"}))}let j=(Y,K,Q,se)=>{if(K)return J=>K({x:se.x,y:se.y,index:Q,event:J})};for(let Y=0;Y<r.length;Y++){let K=r[Y],Q=k(K.x),se=w(K.y),J={cx:Q,cy:se,r:c,fill:f,cursor:"pointer",key:`pt-${Y}`};p&&(J.onClick=j("click",p,Y,K)),x&&(J.onDblClick=j("dblclick",x,Y,K)),v&&(J.onContextMenu=j("contextmenu",v,Y,K)),T&&(J.onMouseOver=j("mouseover",T,Y,K)),_.push(o("circle",J))}let H=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:Se,y:Se,width:t-2*Se,height:n-2*Se})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:W,onMouseMove:z,onMouseUp:B,onMouseLeave:B,onWheel:O},H,..._)}function Lr(e,t,n){let r=0,i=0;for(let s=0;s<n;s++){let a=r*r,l=i*i;if(a+l>4)return s;i=2*r*i+t,r=a-l+e}return n}function Ar(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,b=0,m=0,c=0;return i<60?(b=l,m=d):i<120?(b=d,m=l):i<180?(m=l,c=d):i<240?(m=d,c=l):i<300?(b=d,c=l):(b=l,c=d),[Math.floor((b+u)*255),Math.floor((m+u)*255),Math.floor((c+u)*255)]}function Fr(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Lr){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let b=0;b<e;b++){let m=n[0]+b/e*(n[1]-n[0]);d.push(s(m,u,i))}a.push(d)}return a}function Nr(e){let{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:s=100,colorScheme:a="classic",computeFunction:l=Lr,data:d,resolution:u=2,onPointClick:b,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:f}=e;if(d){let E=d.length,W=E>0?d[0].length:0,z=W>0?t/W:1,B=E>0?n/E:1,O=[];for(let _=0;_<E;_++){let U=d[_];for(let X=0;X<W;X++){let ee=U[X]??0,[Z,V,j]=Ar(ee,s,a);O.push(o("rect",{key:`${_}-${X}`,x:String(X*z),y:String(_*B),width:String(Math.ceil(z)),height:String(Math.ceil(B)),fill:`rgb(${Z},${V},${j})`}))}}return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},...O)}let[g,y]=G(r[0]),[h,p]=G(r[1]),[x,v]=G(i[0]),[T,D]=G(i[1]),C=te(null),P=te(!1),L=te(null),I=S((E,W)=>{let z=g+E/t*(h-g),B=T-W/n*(T-x);return{re:z,im:B}},[g,h,x,T,t,n]);re(()=>{let E=C.current;if(!E)return;let W=E.getContext("2d");if(!W)return;let z=W.createImageData(t,n),B=z.data;for(let O=0;O<n;O++)for(let _=0;_<t;_++){let{re:U,im:X}=I(_,O),ee=l(U,X,s),[Z,V,j]=Ar(ee,s,a),H=(O*t+_)*4;B[H]=Z,B[H+1]=V,B[H+2]=j,B[H+3]=255}W.putImageData(z,0,0)},[g,h,x,T,t,n,s,a,l,I]);let M=S(E=>{let W=E.target.getBoundingClientRect(),z=E.clientX-W.left,B=E.clientY-W.top,{re:O,im:_}=I(z,B),U=l(O,_,s);return{re:O,im:_,iterations:U,event:E}},[I,l,s]),F=S(E=>{P.current=!0,L.current={x:E.clientX,y:E.clientY,rMin:g,rMax:h,iMin:x,iMax:T}},[g,h,x,T]),R=S(E=>{if(m&&m(M(E)),!P.current||!L.current)return;let W=L.current,z=E.clientX-W.x,B=E.clientY-W.y,O=(W.rMax-W.rMin)/t,_=(W.iMax-W.iMin)/n;y(W.rMin-z*O),p(W.rMax-z*O),v(W.iMin+B*_),D(W.iMax+B*_)},[t,n,m,M]),N=S(()=>{P.current=!1},[]),A=S(E=>{E.preventDefault();let W=E.deltaY>0?1.15:1/1.15,z=E.target.getBoundingClientRect(),B=E.clientX-z.left,O=E.clientY-z.top,{re:_,im:U}=I(B,O);y(_+(g-_)*W),p(_+(h-_)*W),v(U+(x-U)*W),D(U+(T-U)*W)},[I,g,h,x,T]),k=S(E=>{b&&b(M(E))},[b,M]),w=S(E=>{c&&c(M(E))},[c,M]),$=S(E=>{E.preventDefault(),f&&f(M(E))},[f,M]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:F,onMouseMove:R,onMouseUp:N,onMouseLeave:N,onWheel:A,onClick:k,onDblClick:w,onContextMenu:$})}function Wr(e,t,n){if(e===t)return[e];let r=(t-e)/(n-1),i=[];for(let s=0;s<n;s++){let a=e+r*s;i.push(Math.round(a*1e10)/1e10)}return i}function El(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,b=y=>r+(y-i)/(s-i)*d,m=y=>n-r-(y-a)/(l-a)*u,c=6,f=Wr(i,s,c),g=Wr(a,l,c);return{xScale:b,yScale:m,xTicks:f,yTicks:g,xMin:i,xMax:s,yMin:a,yMax:l}}function un(e,t,n,r){return q(()=>El(e,t,n,r),[e,t,n,r])}function Br(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Or(e,t,n,r,i,s,a){let l={fill:i,key:s,...a};switch(e){case"square":return o("rect",{...l,x:t-r,y:n-r,width:r*2,height:r*2});case"diamond":{let d=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...l,points:d})}case"triangle":{let d=r*1.15,u=`${t},${n-d} ${t+r},${n+r*.6} ${t-r},${n+r*.6}`;return o("polygon",{...l,points:u})}case"triangle-down":{let d=r*1.15,u=`${t-r},${n-r*.6} ${t+r},${n-r*.6} ${t},${n+d}`;return o("polygon",{...l,points:u})}case"cross":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t-r},${n-r}L${t+r},${n+r}M${t+r},${n-r}L${t-r},${n+r}`})}case"plus":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}case"circle":default:return o("circle",{...l,cx:t,cy:n,r})}}function Hr(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:b=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:f,yLabel:g,title:y,padding:h=50,animate:p=!1,multiLine:x}=e,v=q(()=>{let F=[...t];if(x)for(let R of x)F.push(...R.data);return F},[t,x]),T=un(v,n,r,h),{xScale:D,yScale:C,xTicks:P,yTicks:L}=T,I=[];if(I.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),b){for(let F=0;F<P.length;F++){let R=D(P[F]);I.push(o("line",{x1:R,y1:h,x2:R,y2:r-h,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${F}`}))}for(let F=0;F<L.length;F++){let R=C(L[F]);I.push(o("line",{x1:h,y1:R,x2:n-h,y2:R,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${F}`}))}}I.push(o("line",{x1:h,y1:r-h,x2:n-h,y2:r-h,stroke:"#374151","stroke-width":1,key:"x-axis"})),I.push(o("line",{x1:h,y1:h,x2:h,y2:r-h,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let F=0;F<P.length;F++){let R=D(P[F]);I.push(o("line",{x1:R,y1:r-h,x2:R,y2:r-h+5,stroke:"#374151",key:`xtick-${F}`})),I.push(o("text",{x:R,y:r-h+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${R}, ${r-h+18})`,key:`xlabel-${F}`},Br(P[F])))}for(let F=0;F<L.length;F++){let R=C(L[F]);I.push(o("line",{x1:h-5,y1:R,x2:h,y2:R,stroke:"#374151",key:`ytick-${F}`})),I.push(o("text",{x:h-10,y:R+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${F}`},Br(L[F])))}function M(F,R,N,A,k,w,$,E,W,z){if(F.length===0)return;let B=[...F].sort((U,X)=>U.x-X.x);if(A){let U=C(T.yMin),X=B.map(j=>`${D(j.x)},${C(j.y)}`).join(" "),ee=D(B[0].x),Z=D(B[B.length-1].x),V=`${ee},${U} ${X} ${Z},${U}`;I.push(o("polygon",{points:V,fill:k,key:`${z}-area`}))}let _={points:B.map(U=>`${D(U.x)},${C(U.y)}`).join(" "),fill:"none",stroke:R,"stroke-width":N,"stroke-linejoin":"round","stroke-linecap":"round",key:`${z}-line`};if(p?(_["stroke-dasharray"]="1000",_["stroke-dashoffset"]="1000",I.push(o("polyline",_,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):I.push(o("polyline",_)),w)for(let U=0;U<B.length;U++){let X=D(B[U].x),ee=C(B[U].y),Z=B[U].shape??W,V=B[U].radius??E,j=`${z}-pt-${U}`;if(p){let H=Or(Z,X,ee,V,$,j,{opacity:0});I.push(o("g",{key:`${j}-g`},H,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else I.push(Or(Z,X,ee,V,$,j))}}if(M(t,i,s,m,c,u,l,a,d,"primary"),x)for(let F=0;F<x.length;F++){let R=x[F];M(R.data,R.color,s,!1,"transparent",u,R.color,R.pointRadius??a,R.pointShape??d,`series-${F}`)}if(x&&x.length>0){let F=[],R=[{color:i,label:"Primary"},...x.map((O,_)=>({color:O.color,label:O.label??`Series ${_+1}`}))],N=h+10,A=16,k=22,w=7.2,$=14,E=6,W=n-h*2-20,z=0,B=0;for(let O=0;O<R.length;O++){let _=R[O].label.length*w,U=$+E+_;z>0&&z+U>W&&(z=0,B+=k);let X=N+z,ee=h-30-B;F.push(o("rect",{x:X,y:ee,width:$,height:14,fill:R[O].color,rx:2,key:`legend-rect-${O}`})),F.push(o("text",{x:X+$+E,y:ee+12,"font-size":12,fill:"#374151",key:`legend-text-${O}`},R[O].label)),z+=U+A}I.push(o("g",{key:"legend"},...F))}return f&&I.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},f)),g&&I.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},g)),y&&I.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...I)}function Rl(e){let t=[];for(let n=0;n<e;n++){let r=Math.round(360*n/e);t.push(`hsl(${r}, 70%, 55%)`)}return t}function Pl(e,t){let n=t??Rl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function st(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function pn(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=st(e,t,r,a),u=st(e,t,r,l),b=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${b} 1 ${u.x} ${u.y}`,"Z"].join(" ");let m=st(e,t,n,l),c=st(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${b} 1 ${u.x} ${u.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${b} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function fn(e,t){let n=t?.padAngle??0,r=Pl(e,t?.colors),i=e.reduce((u,b)=>u+b.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let b=e[u],m=b.value/i*a,c=d+n/2,f=c+m;l.push({label:b.label,value:b.value,startAngle:c,endAngle:f,percentage:b.value/i*100,color:r[u]}),d=f+n/2}return l}function _r(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:b,centerLabel:m,colors:c,strokeColor:f="#fff",strokeWidth:g=2,textColor:y="currentColor"}=e,h=d&&u==="right"?140:0,p=b?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-h,T=r-p-x,D=v/2,C=p+T/2,P=Math.min(v,T)/2-10,L=e.outerRadius??P,I=q(()=>fn(t,{padAngle:s,colors:c}),[t,s,c]),M=[];b&&M.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},b));for(let F=0;F<I.length;F++){let R=I[F],N=pn(D,C,i,L,R.startAngle,R.endAngle);if(M.push(o("path",{key:`slice-${F}`,d:N,fill:R.color,stroke:f,strokeWidth:g})),a||l){let A=(R.startAngle+R.endAngle)/2,k=R.percentage<5,w=k?L+14:i+(L-i)*.65,$=st(D,C,w,A-Math.PI/2),E=k?y:"#fff",W=k?11:12,z=[];if(a&&z.push(R.label),l&&z.push(`${R.percentage.toFixed(1)}%`),k){let B=st(D,C,L+2,A-Math.PI/2);M.push(o("line",{key:`connector-${F}`,x1:B.x,y1:B.y,x2:$.x,y2:$.y,stroke:"#999",strokeWidth:1}))}a&&M.push(o("text",{key:`label-${F}`,x:$.x,y:$.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:W,fill:E,pointerEvents:"none"},R.label)),l&&M.push(o("text",{key:`value-${F}`,x:$.x,y:$.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:W-1,fill:E,pointerEvents:"none"},`${R.percentage.toFixed(1)}%`))}}if(m&&i>0&&M.push(o("text",{key:"center-label",x:D,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},m)),d){let F=[];if(u==="right"){let R=v+10,N=p+20;for(let A=0;A<I.length;A++){let k=I[A],w=N+A*22;F.push(o("circle",{key:`legend-dot-${A}`,cx:R+6,cy:w,r:6,fill:k.color})),F.push(o("text",{key:`legend-text-${A}`,x:R+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let R=r-x+10;for(let N=0;N<I.length;N++){let A=I[N],k=N%2,w=Math.floor(N/2),$=k*(n/2)+10,E=R+w*22;F.push(o("circle",{key:`legend-dot-${N}`,cx:$+6,cy:E,r:6,fill:A.color})),F.push(o("text",{key:`legend-text-${N}`,x:$+18,y:E,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${A.label} (${A.percentage.toFixed(1)}%)`))}}M.push(...F)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...M)}function Yr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Vr(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:b=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:f,onPointDoubleClick:g,onPointContextMenu:y,onPointHover:h}=e,[p,x]=G(r[1]),[v,T]=G(0),[D,C]=G(0),[P,L]=G(null),I=t/2+v,M=n/2+D,R=Math.min(t,n)/2-30,N=R/p,A=q(()=>{let V=Math.max(1,Math.ceil(p)),j=[],H=p/V;for(let Y=1;Y<=V;Y++)j.push(H*Y);return j},[p]),k=q(()=>{let V=[];for(let j=0;j<360;j+=30)V.push(j*Math.PI/180);return V},[]),w=q(()=>{if(!i||!l)return[];let V=a??2*Math.PI/s,j=it({start:0,end:2*Math.PI,step:V});return Ft(i,j)},[i,s,a,l]),[$,E]=G([]),W=te(null);re(()=>{if(!i||l){E([]);return}let V=a??2*Math.PI/s,j=it({start:0,end:2*Math.PI,step:V});return W.current&&W.current(),W.current=Nt(i,j,200,H=>{E([...H])}),()=>{W.current&&W.current()}},[i,s,a,l]);let z=l?w:$,B=q(()=>{if(z.length===0)return"";let V=[];for(let j=0;j<z.length;j++){let H=z[j],Y=H.output;if(Y<0||!isFinite(Y))continue;let{x:K,y:Q}=Yr(Y,H.input,I,M,N);V.push(`${V.length===0?"M":"L"}${K.toFixed(2)},${Q.toFixed(2)}`)}return V.join(" ")},[z,I,M,N]),O=S(V=>{L({x:V.clientX,y:V.clientY,px:v,py:D})},[v,D]),_=S(V=>{P&&(T(P.px+(V.clientX-P.x)),C(P.py+(V.clientY-P.y)))},[P]),U=S(()=>{L(null)},[]),X=S(V=>{V.preventDefault();let j=V.deltaY>0?1.15:1/1.15;x(Math.max(.1,p*j))},[p]),ee=S((V,j,H)=>{if(V)return Y=>V({r:j.r,theta:j.theta,index:H,event:Y})},[]),Z=[];if(Z.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let V=0;V<A.length;V++){let j=A[V]*N;Z.push(o("circle",{cx:I,cy:M,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${V}`})),Z.push(o("text",{x:I+j+2,y:M-4,"font-size":10,fill:"#9ca3af",key:`gl-${V}`},A[V].toFixed(1)))}for(let V=0;V<k.length;V++){let j=k[V],H=A[A.length-1]*N,Y=I+H*Math.cos(j),K=M-H*Math.sin(j);Z.push(o("line",{x1:I,y1:M,x2:Y,y2:K,stroke:"#e5e7eb","stroke-width":1,key:`al-${V}`}));let Q=Math.round(j*180/Math.PI),se=I+(H+14)*Math.cos(j),J=M-(H+14)*Math.sin(j);Z.push(o("text",{x:se,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${V}`},`${Q}\xB0`))}}Z.push(o("line",{x1:I-R,y1:M,x2:I+R,y2:M,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),Z.push(o("line",{x1:I,y1:M-R,x2:I,y2:M+R,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),B&&Z.push(o("path",{d:B,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let V=0;V<d.length;V++){let j=d[V],{x:H,y:Y}=Yr(j.r,j.theta,I,M,N);Z.push(o("circle",{cx:H,cy:Y,r:b,fill:m,key:`pt-${V}`,style:{cursor:"pointer"},onClick:ee(f,j,V),onDblClick:ee(g,j,V),onContextMenu:ee(y,j,V),onMouseEnter:ee(h,j,V)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:P?"grabbing":"grab"},onMouseDown:O,onMouseMove:_,onMouseUp:U,onMouseLeave:U,onWheel:X},...Z)}function gn(e){let t=1<<e,n=[];for(let r=0;r<t;r++){let i=[];for(let s=0;s<e;s++)i.push((r>>s&1)*2-1);n.push({coords:i})}return n}function mn(e){let t=1<<e,n=[];for(let r=0;r<t;r++)for(let i=0;i<e;i++){let s=r^1<<i;s>r&&n.push({source:r,target:s})}return n}function hn(e,t){let n=Ur(e),r=0;for(let i=0;i<e;i++)for(let s=i+1;s<e;s++){if(r<t.length){let a=t[r];n=$l(n,Il(e,i,s,a))}r++}return n}function Ur(e){let t=[];for(let n=0;n<e;n++){let r=new Array(e).fill(0);r[n]=1,t.push(r)}return t}function Il(e,t,n,r){let i=Ur(e),s=Math.cos(r),a=Math.sin(r);return i[t][t]=s,i[t][n]=-a,i[n][t]=a,i[n][n]=s,i}function $l(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let s=new Array(n).fill(0);for(let a=0;a<n;a++)for(let l=0;l<n;l++)s[a]+=e[i][l]*t[l][a];r.push(s)}return r}function bn(e,t){let n=e.length,r=new Array(n).fill(0);for(let i=0;i<n;i++)for(let s=0;s<n;s++)r[i]+=e[i][s]*t.coords[s];return r}function xn(e,t=0){let n=e[0]??0,r=e[1]??0,i=0;for(let s=2;s<e.length;s++)i+=e[s]??0;if(e.length>2&&(i/=e.length-2),t>0){let s=1/(1+t*(i+2));return{x:n*s,y:r*s,depth:i}}return{x:n,y:r,depth:i}}function mt(e,t=[],n=.3,r=1){let i=gn(e),s=mn(e),a=hn(e,t);return{vertices:i.map((d,u)=>{let b=bn(a,d),m=xn(b,n);return{id:u,position:d,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function ht(e){return e*(e-1)/2}function Wt(e,t=70,n=55){let r=[];for(let i=0;i<e;i++){let s=Math.round(360*i/e);r.push(`hsl(${s}, ${t}%, ${n}%)`)}return r}function jr(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,b=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=ht(t),f=1<<t,g=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Wt(f):e.vertexColors,[f,e.vertexColors]),[y,h]=G(()=>{let E=[];for(let W=0;W<c;W++)E.push(0);return E}),[p,x]=G(!1),v=te({x:0,y:0}),T=te([]),D=te(0);re(()=>{if(d===0)return;let E=!0,W=()=>{E&&(h(z=>{let B=z.slice();for(let O=0;O<B.length;O++)B[O]=(B[O]??0)+d*(1+O*.3);return B}),D.current=requestAnimationFrame(W))};return D.current=requestAnimationFrame(W),()=>{E=!1,cancelAnimationFrame(D.current)}},[d]);let C=q(()=>mt(t,y,l,m),[t,y,l,m]),P=n/2,L=r/2,I=q(()=>C.edges.map(E=>{let W=C.vertices[E.source],z=C.vertices[E.target],B=(W.depth+z.depth)/2;return{...E,avgDepth:B,sv:W,tv:z}}).sort((E,W)=>E.avgDepth-W.avgDepth),[C]),M=q(()=>C.vertices.slice().sort((E,W)=>E.depth-W.depth),[C]),F=S(E=>{let W=E;x(!0),v.current={x:W.clientX,y:W.clientY},T.current=y.slice()},[y]),R=S(E=>{if(!p)return;let W=E,z=(W.clientX-v.current.x)*.01,B=(W.clientY-v.current.y)*.01;h(()=>{let O=T.current.slice();return O.length>0&&(O[0]=(O[0]??0)+z),O.length>1&&(O[1]=(O[1]??0)+B),O})},[p]),N=S(()=>{x(!1)},[]),A=E=>{let W=(E+2)/4;return .3+.7*Math.max(0,Math.min(1,W))},k=E=>{let W=(E+2)/4;return .6+.4*Math.max(0,Math.min(1,W))},w=I.map((E,W)=>{let z=A(E.avgDepth);return o("line",{key:`e-${E.source}-${E.target}`,x1:String(P+E.sv.x),y1:String(L+E.sv.y),x2:String(P+E.tv.x),y2:String(L+E.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(z),"stroke-linecap":"round"})}),$=M.map(E=>{let W=i*k(E.depth),z=g[E.id%g.length]??"#3b82f6",B=[o("circle",{key:`v-${E.id}-circle`,cx:String(P+E.x),cy:String(L+E.y),r:String(W),fill:z,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&B.push(o("text",{key:`v-${E.id}-label`,x:String(P+E.x),y:String(L+E.y+W+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},E.id.toString(2).padStart(t,"0"))),B});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:b,cursor:p?"grabbing":"grab",userSelect:"none"},onMouseDown:F,onMouseMove:R,onMouseUp:N,onMouseLeave:N},...w,...$.flat())}function Gr(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=ht(t),[a,l]=G(()=>new Array(s).fill(0));return re(()=>{if(n===0)return;let u=!0,b=0,m=()=>{u&&(l(c=>c.map((f,g)=>f+n*(1+g*.3))),b=requestAnimationFrame(m))};return b=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(b)}},[n]),{data:q(()=>mt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Xr(e){let t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",s=e.gap??"12px",a=e.contain??"layout style paint",l={display:"flex",flexDirection:Dl(t,n),gap:s,width:typeof e.width=="number"?`${e.width}px`:e.width??"auto",height:typeof e.height=="number"?`${e.height}px`:e.height??"auto",backgroundColor:e.backgroundColor??"#ffffff",border:e.border??"1px solid #e5e7eb",borderRadius:e.borderRadius??"8px",padding:e.padding??"16px",fontFamily:e.fontFamily??"inherit",contain:a,overflow:"hidden",position:"relative",boxSizing:"border-box",...e.boxShadow?{boxShadow:e.boxShadow}:{},...e.style??{}},d=e.title?o("div",{className:"viz-title",style:{fontSize:e.titleFontSize??"16px",fontWeight:e.titleFontWeight??"600",color:e.titleColor??"#1f2937",textAlign:r,flexShrink:"0"}},e.title):null,u=e.legend&&e.legend.length>0?zl(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,b=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=Tl(d,b,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function Dl(e,t){return"column"}function Tl(e,t,n,r,i){let s=[];if(r==="top"&&e&&s.push(e),i==="left"||i==="right"){let a=[];i==="left"&&n&&a.push(n),r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),i==="right"&&n&&a.push(n),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if(r==="left"||r==="right"){i==="top"&&n&&s.push(n);let a=[];r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),i==="bottom"&&n&&s.push(n)}else i==="top"&&n&&s.push(n),s.push(t),i==="bottom"&&n&&s.push(n);return r==="bottom"&&e&&s.push(e),s}function zl(e,t){return o("div",{className:"viz-legend",style:{display:"flex",flexDirection:t.direction,flexWrap:"wrap",gap:`${t.gap}px`,justifyContent:t.align,alignItems:"center",fontSize:t.fontSize,color:"#6b7280",flexShrink:"0"}},...e.map((n,r)=>o("div",{key:`legend-${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},Al(n),o("span",null,n.label))))}function Al(e){let t=e.shape??"circle";return t==="line"?o("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},o("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):t==="square"?o("div",{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}):o("div",{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}function Ll(e){if(typeof document>"u")return;let t="specifyjs-gtag";if(document.getElementById(t))return;let n=document.createElement("script");n.id=t,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(n)}function Fl(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function qr(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return re(()=>{if(n||typeof window>"u")return;Ll(t),Fl();let a={...s};return i&&(a.anonymize_ip=!0),r&&(a.debug_mode=!0),window.gtag&&window.gtag("config",t,a),()=>{let l=document.getElementById("specifyjs-gtag");l&&l.remove()}},[t,n,r,i]),null}function Kr(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:b,ariaLabel:m="Site footer"}=e;return o("footer",{className:b,role:"contentinfo","aria-label":m,style:{borderTop:i,background:s,color:a,fontSize:l,padding:d,marginTop:"48px"}},o("div",{className:"footer-inner",style:{maxWidth:u,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{className:"footer-section",style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}var Qr=We({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),Nl={width:600,height:400},Wl={x:30,y:30},Bl={top:0,left:0,width:1920,height:1080},yn=1e3;function Zr(e,t,n,r){let i=n.left+e*t.x,s=n.top+e*t.y,a=n.left+n.width-r.width,l=n.top+n.height-r.height;return a>n.left&&i>a&&(i=n.left+(i-n.left)%Math.max(1,a-n.left)),l>n.top&&s>l&&(s=n.top+(s-n.top)%Math.max(1,l-n.top)),{x:i,y:s}}function Sn(e){let t=[...e].sort((r,i)=>r.zIndex-i.zIndex),n=[];for(let r=0;r<t.length;r++)n.push({...t[r],zIndex:r+1});return n}function Jr(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r];i.id!==t&&i.windowState!=="minimized"&&(n===null||i.zIndex>n.zIndex)&&(n=i)}return n}function vn(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function wn(e){let t=e.workspaceBounds??Bl,n=e.defaultWindowSize??Nl,r=e.cascadeOffset??Wl,[i,s]=G([]),a=S(((...F)=>{let R=F[0];s(N=>{if(N.find(B=>B.id===R.id)){let O=vn(N)+1,_=N.map(U=>U.id===R.id?{...U,focused:!0,zIndex:O,windowState:U.windowState==="minimized"?"normal":U.windowState}:{...U,focused:!1});return O>yn&&(_=Sn(_)),_}let k=R.size??n,w=R.position??Zr(N.length,r,t,k),E=vn(N)+1,W={id:R.id,title:R.title,icon:R.icon,position:w,size:k,windowState:"normal",zIndex:E,focused:!0,appProps:R.appProps},z=N.map(B=>({...B,focused:!1}));return z.push(W),E>yn&&(z=Sn(z)),e.onWindowOpen&&e.onWindowOpen(R.id),e.onFocusChange&&e.onFocusChange(R.id),z})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=S(((...F)=>{let R=F[0];v(N=>{if(N[R]){let A={...N};return delete A[R],A}return N}),D(N=>{if(N.has(R)){let A=new Map(N);return A.delete(R),A}return N}),s(N=>{let A=N.find(w=>w.id===R);if(!A)return N;let k=N.filter(w=>w.id!==R);if(A.focused&&k.length>0){let w=Jr(k,R);if(w){let $=k.map(E=>({...E,focused:E.id===w.id}));return e.onWindowClose&&e.onWindowClose(R),e.onFocusChange&&e.onFocusChange(w.id),$}}return e.onWindowClose&&e.onWindowClose(R),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=S(((...F)=>{let R=F[0];s(N=>{if(!N.find(E=>E.id===R))return N;let w=vn(N)+1,$=N.map(E=>E.id===R?{...E,focused:!0,zIndex:w}:{...E,focused:!1});return w>yn&&($=Sn($)),e.onFocusChange&&e.onFocusChange(R),$})}),[e.onFocusChange]),u=S(((...F)=>{let R=F[0];s(N=>{let A=N.find(w=>w.id===R);if(!A)return N;let k=N.map(w=>w.id===R?{...w,windowState:"minimized",focused:!1}:w);if(A.focused){let w=Jr(k,R);w?(k=k.map($=>({...$,focused:$.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),b=S(((...F)=>{let R=F[0];s(N=>N.map(A=>A.id===R?{...A,windowState:"maximized"}:A))}),[]),m=S(((...F)=>{let R=F[0];s(N=>N.map(A=>A.id===R?{...A,windowState:"normal"}:A))}),[]),c=S(((...F)=>{let R=F[0],N=F[1];s(A=>A.map(k=>k.id===R?{...k,position:N}:k))}),[]),f=S(((...F)=>{let R=F[0],N=F[1];s(A=>A.map(k=>k.id===R?{...k,size:N}:k))}),[]),g=S(((...F)=>{s(R=>{let N=R.filter(w=>w.windowState!=="minimized");if(N.length===0)return R;let A=N.length,k=new Map;if(A===1)k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(A===2){let w=Math.floor(t.width/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:t.height}})}else if(A===3){let w=Math.floor(t.width/2),$=Math.floor(t.height/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:$}}),k.set(N[2].id,{position:{x:t.left+w,y:t.top+$},size:{width:t.width-w,height:t.height-$}})}else{let w=Math.ceil(Math.sqrt(A)),$=Math.ceil(A/w),E=Math.floor(t.width/w),W=Math.floor(t.height/$);for(let z=0;z<N.length;z++){let B=Math.floor(z/w),O=z%w;k.set(N[z].id,{position:{x:t.left+O*E,y:t.top+B*W},size:{width:E,height:W}})}}return R.map(w=>{let $=k.get(w.id);return $?{...w,position:$.position,size:$.size,windowState:"normal"}:w})})}),[t]),y=S(((...F)=>{s(R=>{let N=R.filter(w=>w.windowState!=="minimized");if(N.length===0)return R;let A=[...N].sort((w,$)=>w.zIndex-$.zIndex),k=new Map;for(let w=0;w<A.length;w++){let $=Zr(w,r,t,A[w].size);k.set(A[w].id,{position:$,zIndex:w+1})}return R.map(w=>{let $=k.get(w.id);return $?{...w,position:$.position,zIndex:$.zIndex,windowState:"normal"}:w})})}),[r,t]),h=S(((...F)=>{s(R=>{let N=R.map(A=>({...A,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),N})}),[e.onFocusChange]),p=q(()=>{let F=i.find(R=>R.focused);return F?F.id:null},[i]),[x,v]=G({}),[T,D]=G(new Map),C=S(((...F)=>{let R=F[0],N=F[1];v(A=>({...A,[R]:N}))}),[]),P=S(((...F)=>{let R=F[0];v(N=>{let A={...N};return delete A[R],A})}),[]),L=q(()=>p&&x[p]?x[p]:null,[p,x]),I=S(((...F)=>{let R=F[0],N=F[1];D(A=>{let k=new Map(A),w=k.get(R);return k.set(R,{...w,...N}),k})}),[]),M=q(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:b,restoreWindow:m,moveWindow:c,resizeWindow:f,tileWindows:g,cascadeWindows:y,minimizeAll:h,focusedWindowId:p,setMenuBar:C,clearMenuBar:P,activeMenuBar:L,signalDock:I,dockSignals:T}),[i,a,l,d,u,b,m,c,f,g,y,h,p,C,P,L,I,T]);return o(Qr.Provider,{value:M},e.children)}function bt(){return Ae(Qr)}var ei=We({appId:""});function Xe(e){let t=q(()=>({appId:e.appId}),[e.appId]);return o(ei.Provider,{value:t},e.children)}function at(){return Ae(ei).appId}var ti=We({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function xt(e){let t=te([]),n=te([]),r=S(((...l)=>{let d=l[0],u=l[1],b=l[2],m=l[3]||"",c={channel:d,from:m,to:b||null,payload:u,timestamp:Date.now()},f=t.current;for(let y=0;y<f.length;y++){let h=f[y];h.channel===d&&(c.to&&h.appId!==c.to||!c.to&&h.appId===m||h.handler(c))}let g=n.current;for(let y=0;y<g.length;y++)g[y].handler(c)}),[]),i=S(((...l)=>{let d=l[0],u=l[1],b=l[2]||"",m={channel:d,handler:u,appId:b};return t.current=[...t.current,m],()=>{t.current=t.current.filter(c=>c!==m)}}),[]),s=S(((...l)=>{let u={handler:l[0]};return n.current=[...n.current,u],()=>{n.current=n.current.filter(b=>b!==u)}}),[]),a=q(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(ti.Provider,{value:a},e.children)}function qe(){let e=Ae(ti),t=at(),n=S(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=S(((...i)=>{let s=i[0],a=i[1];return e.subscribe(s,a,t)}),[e.subscribe,t]);return q(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function yt(e,t){let n=qe(),r=te(t);r.current=t,re(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var ni=We({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function St(e){let[t,n]=G(null),[r,i]=G({x:0,y:0}),s=te(new Map),a=te(null),l=t!==null,d=S(((...f)=>{let g=f[0];n(g)}),[]),u=S(((...f)=>{if(a.current){let g=s.current.get(a.current);g&&g.onDragLeave&&g.onDragLeave(),a.current=null}n(null)}),[]),b=S(((...f)=>{let g=f[0],y=f[1];return s.current=new Map(s.current),s.current.set(g,y),()=>{s.current=new Map(s.current),s.current.delete(g),a.current===g&&(a.current=null)}}),[]);re(()=>{if(!l)return;let f=h=>{let p=h;i({x:p.clientX,y:p.clientY});let x=document.elementFromPoint(p.clientX,p.clientY);if(!x)return;let v=null,T=s.current;T.forEach((C,P)=>{let L=document.querySelector(`[data-dropzone-id="${P}"]`);L&&L.contains(x)&&(v=P)});let D=a.current;if(v!==D){if(D){let C=T.get(D);C&&C.onDragLeave&&C.onDragLeave()}if(v){let C=T.get(v);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=v}},g=h=>{let p=a.current;if(p&&t){let x=s.current.get(p);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},y=h=>{h.key==="Escape"&&u()};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",g),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",g),document.removeEventListener("keydown",y)}},[l,t,u]);let m=q(()=>({startDrag:d,cancelDrag:u,registerDropZone:b,currentDrag:t,isDragging:l}),[d,u,b,t,l]),c=l?o("div",{className:"drag-drop-preview",style:{position:"fixed",left:`${r.x+12}px`,top:`${r.y+12}px`,pointerEvents:"none",zIndex:"10000",opacity:"0.8",padding:"6px 10px",backgroundColor:"rgba(50, 50, 50, 0.9)",color:"#ffffff",borderRadius:"4px",fontSize:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",whiteSpace:"nowrap"}},t&&t.preview?String(t.preview):`Dragging ${t?t.type:""}`):null;return o(ni.Provider,{value:m},e.children,c)}function Qe(){return Ae(ni)}function vt(e,t){let n=Qe(),r=at(),i=te(t);i.current=t;let s=S(l=>{l.preventDefault(),n.startDrag({type:e,data:i.current,sourceAppId:r||""})},[n,e,r]),a=n.isDragging&&n.currentDrag!==null&&n.currentDrag.type===e;return q(()=>({onMouseDown:s,isDragging:a}),[s,a])}function wt(e){let t=Qe(),[n,r]=G(!1),i=te(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=te(e);s.current=e,re(()=>t.registerDropZone(i.current,{acceptTypes:s.current.acceptTypes,onDragEnter:d=>{r(!0),s.current.onDragEnter&&s.current.onDragEnter(d)},onDragLeave:()=>{r(!1),s.current.onDragLeave&&s.current.onDragLeave()},onDrop:d=>{r(!1),s.current.onDrop(d)}}),[t]);let a=t.isDragging&&t.currentDrag!==null&&e.acceptTypes.indexOf(t.currentDrag.type)!==-1;return q(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var Ol=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Hl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kn(e){return e<10?"0"+String(e):String(e)}function _l(e,t,n){let r=e.getHours(),i=kn(e.getMinutes()),s=kn(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=kn(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function Yl(e){let t=Ol[e.getDay()],n=Hl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Vl(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ce(),a=S(()=>{n()},[n]),l=S(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n())},[n]);return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",padding:"0 12px",height:"100%",border:"none",outline:"none",backgroundColor:r?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"700",cursor:"pointer",transition:"background-color 0.15s"}},t)}function Ul(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=G(new Date);re(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=q(()=>_l(i,t,n),[i,t,n]),l=q(()=>Yl(i),[i]),d=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},l):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"6px",lineHeight:"1",padding:"0 8px"}},d,o("span",{style:{fontSize:"13px",fontWeight:"500"}},a))}function jl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ce(),s=S(()=>{t.onClick&&t.onClick()},[t]),a=S(l=>{let d=l;(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:s,onKeyDown:a,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 4px",height:"100%",border:"none",outline:"none",backgroundColor:n?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:t.onClick?"pointer":"default",transition:"background-color 0.15s"}},o("span",{"aria-hidden":"true"},t.icon),t.label?o("span",null,t.label):null)}function Gl(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ce();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=S(()=>{t.onClick(),n()},[t,n]),l=S(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t.onClick(),n())},[t,n]);return o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:r?"var(--panel-hover, rgba(255,255,255,0.15))":"transparent",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.1s"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label))}function Xl(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ce(),[a,l]=G(!1),d=te(null),u=S(()=>{l(h=>!h)},[]),b=S(()=>{l(!1)},[]),m=S(h=>{let p=h;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),l(x=>!x)),p.key==="Escape"&&l(!1)},[]);re(()=>{if(!a)return;let h=p=>{let x=d.current;x&&!x.contains(p.target)&&l(!1)};return document.addEventListener("click",h,!0),()=>{document.removeEventListener("click",h,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},f=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),g=o("span",{style:c,"aria-hidden":"true"},f),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((h,p)=>o(Gl,{key:String(p),item:h,onClose:b}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown:m,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||a?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},g,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function ql(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ce(),[s,a]=G(!1),l=te(null),d=S(()=>{a(c=>!c)},[]),u=S(()=>{a(!1)},[]),b=S(c=>{let f=c;(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),a(g=>!g)),f.key==="Escape"&&a(!1)},[]);re(()=>{if(!s)return;let c=f=>{let g=l.current;g&&!g.contains(f.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let m=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...t.items.map((c,f)=>c.divider?o("div",{key:"div-"+String(f),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(f),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),u()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:"transparent",color:c.disabled?"rgba(255,255,255,0.4)":"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:c.disabled?"default":"pointer",boxSizing:"border-box"}},o("span",null,c.checked?"\u2713 ":"",c.label||""),c.shortcut?o("span",{style:{fontSize:"11px",opacity:"0.6",marginLeft:"16px"}},c.shortcut):null))):null;return o("div",{ref:l,className:"system-tray__app-menu",style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(s),tabIndex:0,onClick:d,onKeyDown:b,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",padding:"0 10px",height:"100%",border:"none",outline:"none",backgroundColor:n||s?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"500",cursor:"pointer",transition:"background-color 0.15s"}},t.label),m)}function Cn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:b=28,children:m}=e,c=String(b)+"px",f=[];if(n&&f.push(o(Vl,{key:"activities",label:n.label,onClick:n.onClick})),t&&f.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let v=0;v<r.menus.length;v++)f.push(o(ql,{key:"appmenu-"+String(v),menu:r.menus[v]}));let g=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...f),y=[];y.push(o(Ul,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let h=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),p=[];if(l&&l.length>0){let v=l.map(T=>o(jl,{key:T.id,indicator:T}));p.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&p.push(o(Xl,{key:"user",user:d,menuItems:u}));let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...p);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},g,h,x)}function Kl(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var oi=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function Zl(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return oi[Math.abs(t)%oi.length]}function Jl(e){return e>99?"99+":String(e)}function Ql(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function ec(e){switch(e){case"left":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};case"right":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"top":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"bottom":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};default:return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"}}}function tc(e,t){return t==="vertical"?e==="right"?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:e==="bottom"?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function nc(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=G(!1),u=t.disabled??!1,b=S(()=>{u||d(!0)},[u]),m=S(()=>{d(!1)},[]),c=S(()=>{!u&&s&&s(t.id)},[u,s,t.id]),f=S(D=>{if(!u&&a){let C=D;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),g=`${n}px`,y=Kl(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:g,height:g,objectFit:"contain",display:"block"}}):o("span",{style:{width:g,height:g,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:Zl(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),h=t.badge!=null&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},Jl(t.badge)):null,p=t.active?o("span",{style:{...tc(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,x=t.progress!=null&&t.progress>0?o("div",{style:{position:"absolute",bottom:"2px",left:"6px",right:"6px",height:"3px",backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"2px",overflow:"hidden",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},o("div",{style:{width:`${Math.min(1,Math.max(0,t.progress))*100}%`,height:"100%",backgroundColor:"var(--dock-progress-color, #3b82f6)",borderRadius:"2px",transition:"width 200ms ease"}})):null,v=l?o("div",{role:"tooltip",style:{position:"absolute",...ec(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,T={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:u?"default":"pointer",opacity:u?"0.4":"1",pointerEvents:u?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...l&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{},...t.urgent&&!u?{animation:"dock-urgent-pulse 0.6s ease-in-out infinite alternate"}:{}};return o("button",{type:"button",role:"button",style:T,"aria-label":Ql(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:f,onMouseEnter:b,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,h,p,x,v)}function Mn(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[b,m]=G(!s),c=te(null),f=S(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),m(!0))},[s]),g=S(()=>{s&&(c.current=setTimeout(()=>{m(!1)},300))},[s]),y=S(T=>{let D=T,C=D.target,P=C.closest('[role="toolbar"]');if(!P)return;let L=Array.from(P.querySelectorAll("button[data-dock-item-id]")),I=L.indexOf(C);if(I<0)return;let M=n==="vertical",F=M?"ArrowDown":"ArrowRight",R=M?"ArrowUp":"ArrowLeft";if(D.key===F){D.preventDefault();let N=L[I+1];N&&N.focus()}else if(D.key===R){D.preventDefault();let N=L[I-1];N&&N.focus()}else D.key==="Home"?(D.preventDefault(),L[0]?.focus()):D.key==="End"?(D.preventDefault(),L[L.length-1]?.focus()):(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),C.click())},[n]),h=n==="vertical",p={display:"flex",flexDirection:h?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!b&&(r==="left"?(p.transform="translateX(-100%)",p.opacity="0"):r==="right"?(p.transform="translateX(100%)",p.opacity="0"):r==="top"?(p.transform="translateY(-100%)",p.opacity="0"):r==="bottom"&&(p.transform="translateY(100%)",p.opacity="0"));let x=[];for(let T=0;T<t.length;T++){if(a&&T===t.length-1&&t.length>1){let D=h?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};x.push(o("div",{key:`sep-${T}`,style:D,"aria-hidden":"true",role:"separator"}))}x.push(o(nc,{key:t[T].id,item:t[T],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let v=s&&!b?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:p,onMouseEnter:f,onMouseLeave:g,onKeyDown:y},v,...x,u??null)}var oc="#2c001e";function En(e){let{backgroundColor:t=oc,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,b=S(p=>{let x=p;x.target===x.currentTarget&&a&&a()},[a]),m=S(p=>{let x=p;x.target===x.currentTarget&&l&&l()},[l]),c=q(()=>{let p={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return p.backgroundColor=t,n&&(p.background=n),r&&i>=1&&(p.backgroundImage=`url(${r})`,p.backgroundSize="cover",p.backgroundPosition="center"),p},[t,n,r,i]),f=q(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),g={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];f&&y.push(o("div",{className:"desktop-background__image-overlay",style:f,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:g},u));let h=o("div",{className:"desktop-background",style:c,onClick:b,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(Lt,{items:s},h):h}var rc={width:200,height:150},ic={x:50,y:50},sc={width:400,height:300},Me=8,Rn=20,ac={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};function kt(e){let{id:t,title:n,icon:r,defaultPosition:i=ic,defaultSize:s=sc,minSize:a=rc,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:b="normal",focused:m=!0,zIndex:c,onClose:f,onMinimize:g,onMaximize:y,onFocus:h,onMove:p,onResize:x,children:v}=e,[T,D]=G(i.x),[C,P]=G(i.y),[L,I]=G(s.width),[M,F]=G(s.height),[R,N]=G(!1),[A,k]=G(!1),[w,$]=G(null),E=te(null),W=te(null),z=te(null),B=S((ne,fe)=>{let oe=Math.max(ne,a.width),ie=Math.max(fe,a.height);return l&&(oe=Math.min(oe,l.width),ie=Math.min(ie,l.height)),{width:oe,height:ie}},[a,l]),O=S(()=>{let ne=z.current;return ne&&ne.parentElement?{width:ne.parentElement.clientWidth,height:ne.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),_=S((ne,fe,oe,ie)=>{let ue=O(),he=Math.max(0,Math.min(ne,ue.width-oe)),be=Math.max(0,Math.min(fe,ue.height-ie));return{x:he,y:be}},[O]),U=S(ne=>{if(!u||b==="maximized")return;let fe=ne;fe.target.closest("button")||(fe.preventDefault(),E.current={startMouseX:fe.clientX,startMouseY:fe.clientY,startPosX:T,startPosY:C},N(!0))},[u,b,T,C]),X=S(ne=>{ne.target.closest("button")||y&&y()},[y]);re(()=>{if(!R)return;let ne=oe=>{let ie=oe,ue=E.current;if(!ue)return;let he=ie.clientX-ue.startMouseX,be=ie.clientY-ue.startMouseY,pe=ue.startPosX+he,ge=ue.startPosY+be,ye=O();pe=Math.max(0,Math.min(pe,ye.width-L)),ge=Math.max(0,Math.min(ge,ye.height-M)),D(pe),P(ge),ie.clientX<=Rn?$("left"):ie.clientX>=ye.width-Rn?$("right"):ie.clientY<=Rn?$("top"):$(null)},fe=oe=>{let ie=oe;N(!1);let ue=O();if(w==="left"){D(0),P(0),I(Math.floor(ue.width/2)),F(ue.height),$(null),p&&p({x:0,y:0}),x&&x({width:Math.floor(ue.width/2),height:ue.height});return}if(w==="right"){let be=Math.floor(ue.width/2);D(be),P(0),I(be),F(ue.height),$(null),p&&p({x:be,y:0}),x&&x({width:be,height:ue.height});return}if(w==="top"){$(null),y&&y();return}$(null);let he=E.current;if(he&&p){let be=ie.clientX-he.startMouseX,pe=ie.clientY-he.startMouseY,ge=he.startPosX+be,ye=he.startPosY+pe;ge=Math.max(0,Math.min(ge,ue.width-L)),ye=Math.max(0,Math.min(ye,ue.height-M)),p({x:ge,y:ye})}E.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",fe)}},[R,w,L,M,O,p,x,y]);let ee=S(ne=>fe=>{if(!d||b!=="normal")return;let oe=fe;oe.preventDefault(),oe.stopPropagation(),W.current={direction:ne,startMouseX:oe.clientX,startMouseY:oe.clientY,startPosX:T,startPosY:C,startWidth:L,startHeight:M},k(!0)},[d,b,T,C,L,M]);re(()=>{if(!A)return;let ne=oe=>{let ie=oe,ue=W.current;if(!ue)return;let he=ie.clientX-ue.startMouseX,be=ie.clientY-ue.startMouseY,pe=ue.direction,ge=ue.startWidth,ye=ue.startHeight,ve=ue.startPosX,De=ue.startPosY;pe.includes("e")&&(ge=ue.startWidth+he),pe.includes("w")&&(ge=ue.startWidth-he,ve=ue.startPosX+he),pe.includes("s")&&(ye=ue.startHeight+be),pe.includes("n")&&(ye=ue.startHeight-be,De=ue.startPosY+be);let ce=B(ge,ye);pe.includes("w")&&(ve=ue.startPosX+(ue.startWidth-ce.width)),pe.includes("n")&&(De=ue.startPosY+(ue.startHeight-ce.height)),I(ce.width),F(ce.height),D(ve),P(De)},fe=()=>{k(!1),x&&x({width:L,height:M}),W.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",fe)}},[A,L,M,B,x]),re(()=>{if(!m||!f)return;let ne=fe=>{fe.key==="Escape"&&f()};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[m,f]);let Z=S(ne=>{h&&h()},[h]);if(b==="minimized")return null;let V=b==="maximized",j=q(()=>{let ne={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:V?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:m?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:V?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return V?(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"):(ne.top=`${C}px`,ne.left=`${T}px`,ne.width=`${L}px`,ne.height=`${M}px`),c!==void 0&&(ne.zIndex=String(c)),R&&(ne.cursor="grabbing",ne.userSelect="none"),ne},[V,T,C,L,M,c,m,R]),H=q(()=>{let ne={display:"flex",alignItems:"center",padding:"0 8px",height:"32px",backgroundColor:"var(--window-title-bg, #2c2c2c)",color:"var(--window-title-text, #ffffff)",userSelect:"none",flexShrink:"0",cursor:u&&!V?"grab":"default",opacity:m?"1":"0.6"};return R&&(ne.cursor="grabbing"),ne},[m,u,V,R]),Y={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},K={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let se=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...K,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:ne=>{ne.stopPropagation(),g&&g()}}),o("button",{type:"button","aria-label":V?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...K,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:ne=>{ne.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...K,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:ne=>{ne.stopPropagation(),f&&f()}}));Q.push(se);let J=[];if(d&&!V){let ne=["n","s","e","w","ne","nw","se","sw"];for(let fe=0;fe<ne.length;fe++){let oe=ne[fe],ie={position:"absolute",zIndex:"1"};oe==="n"?(ie.top="0",ie.left=`${Me}px`,ie.right=`${Me}px`,ie.height=`${Me}px`):oe==="s"?(ie.bottom="0",ie.left=`${Me}px`,ie.right=`${Me}px`,ie.height=`${Me}px`):oe==="e"?(ie.top=`${Me}px`,ie.right="0",ie.bottom=`${Me}px`,ie.width=`${Me}px`):oe==="w"?(ie.top=`${Me}px`,ie.left="0",ie.bottom=`${Me}px`,ie.width=`${Me}px`):oe==="ne"?(ie.top="0",ie.right="0",ie.width=`${Me}px`,ie.height=`${Me}px`):oe==="nw"?(ie.top="0",ie.left="0",ie.width=`${Me}px`,ie.height=`${Me}px`):oe==="se"?(ie.bottom="0",ie.right="0",ie.width=`${Me}px`,ie.height=`${Me}px`):oe==="sw"&&(ie.bottom="0",ie.left="0",ie.width=`${Me}px`,ie.height=`${Me}px`),ie.cursor=ac[oe],J.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${oe}`,style:ie,onMouseDown:ee(oe)}))}}let ae=null;if(w){let ne={position:"fixed",backgroundColor:"rgba(66, 133, 244, 0.2)",border:"2px solid rgba(66, 133, 244, 0.5)",borderRadius:"4px",zIndex:"999999",pointerEvents:"none",transition:"all 150ms ease"};w==="left"?(ne.top="0",ne.left="0",ne.width="50%",ne.height="100%"):w==="right"?(ne.top="0",ne.right="0",ne.width="50%",ne.height="100%"):w==="top"&&(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"),ae=o("div",{className:"draggable-window__snap-preview",style:ne})}let de=[];for(let ne=0;ne<J.length;ne++)de.push(J[ne]);de.push(o("div",{className:"draggable-window__title-bar",style:H,onMouseDown:U,onDblClick:X,role:"toolbar","aria-label":`${n} window controls`},...Q)),de.push(o("div",{className:"draggable-window__body",style:Y},v));let le=[o("div",{ref:z,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${b}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:Z},...de)];return ae&&le.push(ae),le.length===1?le[0]:o("div",{style:{display:"contents"}},...le)}var lc=["File","Edit","View","Insert","Format","Tools","Help"],ri={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},cc=[{id:"bold",label:"Bold",text:"B",shortcut:"Ctrl+B",style:{fontWeight:"700"}},{id:"italic",label:"Italic",text:"I",shortcut:"Ctrl+I",style:{fontStyle:"italic"}},{id:"underline",label:"Underline",text:"U",shortcut:"Ctrl+U",style:{textDecoration:"underline"}}],dc=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],uc=["1","2","3","4","5","6","7"],pc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function fc(){let e=[];for(let t=0;t<=20;t++){let n=t%2===0;e.push(o("div",{key:String(t),style:{position:"absolute",left:`${t/20*100}%`,bottom:"0",width:"1px",height:n?"10px":"5px",backgroundColor:"#999"}})),n&&e.push(o("span",{key:`l${t}`,style:{position:"absolute",left:`${t/20*100}%`,top:"1px",fontSize:"8px",color:"#666",transform:"translateX(-50%)"}},String(t/2)))}return e}function ii(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function Bt(e){let[t,n]=G(!1),[r,i]=G(!1),[s,a]=G(!1),[l,d]=G(-1),[u,b]=G(""),[m,c]=G(-1),[f,g]=G(0),[y,h]=G("3"),p=te(null),x=S(()=>{document.execCommand("bold",!1),n(Y=>!Y),p.current&&p.current.focus()},[]),v=S(()=>{document.execCommand("italic",!1),i(Y=>!Y),p.current&&p.current.focus()},[]),T=S(()=>{document.execCommand("underline",!1),a(Y=>!Y),p.current&&p.current.focus()},[]),D={bold:x,italic:v,underline:T},C={bold:t,italic:r,underline:s},P=S(Y=>{document.execCommand(Y,!1),p.current&&p.current.focus()},[]),L=S(Y=>{document.execCommand("fontSize",!1,Y),h(Y),p.current&&p.current.focus()},[]),I=S(Y=>{c(K=>K===Y?-1:Y)},[]),M=S(Y=>{switch(Y){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":typeof window<"u"&&window.print&&window.print();break;case"new":p.current&&(p.current.innerHTML="",g(0));break;default:break}c(-1),p.current&&p.current.focus()},[]),F=S(()=>{if(p.current){let Y=p.current.textContent??"";g(ii(Y))}},[]),R=S(()=>{c(-1)},[]),N=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),A={display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},k={display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},w={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},$={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},E={width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},W={height:"24px",backgroundColor:"var(--color-bg-subtle, #f0f0f0)",borderTop:"1px solid var(--color-border, #ccc)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"11px",color:"#666",flexShrink:"0"},z=q(()=>fc(),[]),B=e.content??"Start typing...",O=ii(B),_=f>0?f:O;function U(Y){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:m===Y?"rgba(0,0,0,0.12)":l===Y?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let X={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},ee={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function Z(Y,K){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[Y]??!1?"rgba(0,0,0,0.12)":u===Y?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...K??{}}}let V={display:"flex",alignItems:"center",padding:"2px 8px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"default",height:"24px",gap:"4px"},j={padding:"2px 4px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"pointer",height:"24px",outline:"none"},H=lc.map((Y,K)=>{let Q=[Y];return m===K&&ri[Y]&&Q.push(o("div",{key:"dropdown",style:X,className:"word-processor__menu-dropdown"},...ri[Y].map((se,J)=>o("button",{key:String(J),style:ee,onClick:ae=>{ae.stopPropagation(),M(se.action)},role:"menuitem"},se.label)))),o("button",{key:String(K),style:U(K),role:"menuitem","aria-label":Y,onClick:()=>I(K),onMouseEnter:()=>{d(K)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:N},o("div",{className:"word-processor__menu-bar",style:A,role:"menubar"},...H),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:V,"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"\u25BC")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...cc.map(Y=>o("button",{key:Y.id,style:Z(Y.id,Y.style),title:Y.shortcut?`${Y.label} (${Y.shortcut})`:Y.label,"aria-label":Y.label,"aria-pressed":String(C[Y.id]??!1),onClick:D[Y.id],onMouseEnter:()=>b(Y.id),onMouseLeave:()=>b("")},Y.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:j,"aria-label":"Font size",value:y,onChange:Y=>{let K=Y.target;L(K.value)}},...uc.map(Y=>o("option",{key:Y,value:Y},pc[Y])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...dc.map((Y,K)=>o("button",{key:String(K),style:Z(`align-${K}`),title:Y.label,"aria-label":Y.label,onClick:()=>P(Y.command),onMouseEnter:()=>b(`align-${K}`),onMouseLeave:()=>b("")},Y.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...z),o("main",{className:"word-processor__document-area",style:$,onClick:R},o("div",{className:"word-processor__page",style:E,contentEditable:"true",ref:p,onInput:F,suppressContentEditableWarning:!0},B)),o("div",{className:"word-processor__status-bar",style:W},o("span",null,"Page 1 of 1"),o("span",null,`${_} words`),o("span",null,"100%")))}var gc=["File","Edit","Selection","View","Go","Run","Terminal","Help"],si={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},ai=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],In={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},li=In["App.ts"],mc=new Set(["import","export","from","const","let","var","function","return","if","else","for","while","class","new","throw","try","catch","finally","typeof","instanceof","in","of","default","switch","case","break","continue","do","void","delete","yield","async","await"]),hc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),ci="#569cd6",bc="#ce9178",xc="#4ec9b0",yc="#6a9955",Sc="#dcdcaa",Pn="#d4d4d4",vc="#d4d4d4",wc="#b5cea8";function kc(e){if(!e.trim())return[{text:"\xA0",color:Pn}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:yc});break}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let r=e[n],i=n+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;i=Math.min(i+1,e.length),t.push({text:e.slice(n,i),color:bc}),n=i;continue}if(/[0-9]/.test(e[n])&&(n===0||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let r=n;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({text:e.slice(n,r),color:wc}),n=r;continue}if(/[a-zA-Z_$]/.test(e[n])){let r=n;for(;r<e.length&&/[a-zA-Z0-9_$]/.test(e[r]);)r++;let i=e.slice(n,r),s=r;for(;s<e.length&&e[s]===" ";)s++;let a=s<e.length&&e[s]==="(",l=Pn;mc.has(i)?l=ci:hc.has(i)?l=xc:a?l=Sc:(i==="true"||i==="false")&&(l=ci),t.push({text:i,color:l}),n=r;continue}if(e[n]===" "||e[n]===" "){let r=n;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r++;t.push({text:e.slice(n,r),color:Pn}),n=r;continue}t.push({text:e[n],color:vc}),n++}return t}function Ot(e){let[t,n]=G("App.ts"),[r,i]=G({src:!0,components:!0,hooks:!0}),[s,a]=G(-1),[l,d]=G(li.length),u=te(null),b=S(H=>{n(H);let Y=In[H];Y&&d(Y.length)},[]),m=S(H=>{i(Y=>{let K={},Q=Object.keys(Y);for(let se=0;se<Q.length;se++)K[Q[se]]=Y[Q[se]];return K[H]=!Y[H],K})},[]),c=S(H=>{a(Y=>Y===H?-1:H)},[]),f=S(H=>{switch(H){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":u.current&&(u.current.textContent="",d(1));break;default:break}a(-1),u.current&&u.current.focus()},[]),g=S(()=>{if(u.current){let Y=(u.current.textContent??"").split(`
8
+ `);d(Math.max(Y.length,1))}},[]),y=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),h={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},p={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},x={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},v={...x,backgroundColor:"rgba(255,255,255,0.1)"},T={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},D={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},C={flex:"1",display:"flex",overflow:"hidden"},P={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},L={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},I={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},M=(H,Y,K)=>({padding:"3px 8px",paddingLeft:`${12+H*16}px`,fontSize:"13px",cursor:"pointer",color:Y?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:K?"rgba(255,255,255,0.08)":"transparent"}),F={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},R={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},N={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},A={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},k={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},w={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},$={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},E={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},W={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},z=8,B=30,O=In[t]??li,_=O.map((H,Y)=>{let K=kc(H),Q=[],se=0;for(let J of K)Q.push(o("span",{key:String(se++),style:{color:J.color}},J.text));return o("div",{key:String(Y),style:{minHeight:"20px"}},...Q)}),U=Math.max(l,O.length),X=[];for(let H=0;H<U;H++)X.push(o("div",{key:String(H)},String(H+1)));let ee=H=>{if(!H.parent)return!0;if(!r[H.parent])return!1;let Y=ai.find(K=>K.name===H.parent&&K.isFolder);return Y?ee(Y):!0},Z=gc.map((H,Y)=>{let K=[H],Q=s===Y;return Q&&si[H]&&K.push(o("div",{key:"dropdown",style:T,className:"ide__menu-dropdown"},...si[H].map((se,J)=>o("button",{key:String(J),style:D,onClick:ae=>{ae.stopPropagation(),f(se.action)},role:"menuitem"},se.label)))),o("button",{key:String(Y),style:Q?v:x,role:"menuitem","aria-label":H,onClick:()=>c(Y)},...K)}),j=ai.map((H,Y)=>{if(!ee(H))return null;let K=!H.isFolder&&H.name===t,Q=H.isFolder?r[H.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(Y),style:M(H.indent,H.isFolder,K),onClick:H.isFolder?()=>m(H.name):()=>b(H.name)},Q,H.name)}).filter(H=>H!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:h},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:p,role:"menubar"},...Z),o("div",{style:C},o("nav",{className:"ide__sidebar",style:P,"aria-label":"File explorer"},o("div",{style:I},"Explorer"),...j),o("div",{style:L}),o("div",{style:F},o("div",{style:R},o("button",{style:N,"aria-label":t},t)),o("div",{style:A},o("div",{style:k,"aria-hidden":"true"},...X),o("code",{style:w,contentEditable:"true",ref:u,onInput:g,suppressContentEditableWarning:!0},..._))),o("div",{className:"ide__minimap",style:$,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${z}px`,left:"0",right:"0",height:`${B}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...O.map((H,Y)=>o("div",{key:String(Y),style:{height:"2px",backgroundColor:H.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,H.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:E},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:W},"\u2387 main"),o("span",{style:W},"0 errors"),o("span",{style:W},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:W},"Ln 1, Col 1"),o("span",{style:W},"UTF-8"),o("span",{style:W},"TypeScript"))))}var Cc=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],di=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],ui=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],pi=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],Mc=[{time:"14:32:01",symbol:"AAPL",side:"BUY",qty:50,price:189.42},{time:"14:31:45",symbol:"MSFT",side:"SELL",qty:25,price:378.95},{time:"14:30:22",symbol:"TSLA",side:"BUY",qty:100,price:247.8},{time:"14:29:58",symbol:"NVDA",side:"BUY",qty:10,price:874.5},{time:"14:28:33",symbol:"GOOGL",side:"SELL",qty:75,price:142.1}],Ec=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],fi=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],gi=[{price:189.45,volume:900},{price:189.5,volume:2600},{price:189.55,volume:1800},{price:189.6,volume:4400},{price:189.65,volume:3100}],mi=["09:30","10:00","10:30","11:00","11:30","12:00"];function Rc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Ct(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Oe(e){return e.toFixed(2)}var lt={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},ct={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Ht={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Ie={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},$e={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},_t={cursor:"default",transition:"background-color 0.1s"};function Pc(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,b)=>{let m=b/(e.length-1)*40,c=14-(u-i)/a*14;return`${m.toFixed(1)},${c.toFixed(1)}`}).join(" ");return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:l,fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function Ic(e,t){let u=Math.min(...e),b=Math.max(...e),m=b-u||1,c=310/(e.length-1),f=e.map((C,P)=>{let L=40+P*c,I=15+(1-(C-u)/m)*120;return{x:L,y:I}}),g=f.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+f.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${f[f.length-1].x.toFixed(1)},135 Z`,h=[];for(let C=1;C<e.length;C++){let P=e[C]>=e[C-1]?"#00c853":"#ff1744";h.push(o("line",{key:String(C),x1:String(f[C-1].x.toFixed(1)),y1:String(f[C-1].y.toFixed(1)),x2:String(f[C].x.toFixed(1)),y2:String(f[C].y.toFixed(1)),stroke:P,strokeWidth:"2",strokeLinecap:"round"}))}let p=[];for(let C=0;C<5;C++){let P=15+C/4*120,L=b-C/4*m;p.push(o("line",{key:`g${C}`,x1:String(40),y1:String(P.toFixed(1)),x2:String(350),y2:String(P.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),p.push(o("text",{key:`yl${C}`,x:String(36),y:String((P+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Oe(L)))}let x=[],v=Math.min(mi.length,e.length),T=(e.length-1)/(v-1);for(let C=0;C<v;C++){let L=40+Math.round(C*T)*c;x.push(o("text",{key:`tl${C}`,x:String(L.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},mi[C]))}let D="chartGrad";return o("div",{style:lt},o("div",{style:ct},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Oe(t)}`),o("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),o("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},o("defs",null,o("linearGradient",{id:D,x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),o("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),o("path",{d:y,fill:`url(#${D})`}),...p,...x,...h,o("line",{x1:String(40),y1:String((15+(1-(t-u)/m)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/m)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function $c(){let e=Math.max(...di.map(t=>t.qty),...ui.map(t=>t.qty));return o("div",{style:lt},o("div",{style:ct},"Order Book"),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Bid Price"),o("th",{style:Ie},"Qty"),o("th",{style:Ie},"Ask Price"),o("th",{style:Ie},"Qty"))),o("tbody",null,...di.map((t,n)=>{let r=ui[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:_t},o("td",{style:{...$e,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Oe(t.price)),o("td",{style:{...$e,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Ct(t.qty)),o("td",{style:{...$e,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Oe(r.price):""),o("td",{style:{...$e,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Ct(r.qty):""))}))))}function Dc(e){return o("div",{style:lt},o("div",{style:ct},"Watchlist"),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Symbol"),o("th",{style:Ie},"Price"),o("th",{style:Ie},"Chg%"),o("th",{style:Ie},"Volume"))),o("tbody",null,...Cc.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:_t},o("td",{style:{...$e,fontWeight:"600",color:"#ffffff"}},t.symbol,Pc(t.spark,i)),o("td",{style:{...$e,fontFamily:"monospace"}},Oe(r)),o("td",{style:{...$e,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Oe(t.change)}%`),o("td",{style:{...$e,fontFamily:"monospace",color:"#8888aa"}},Rc(t.volume)))}))))}function Tc(){let e=pi.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:lt},o("div",{style:ct},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Oe(e)}`)),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Symbol"),o("th",{style:Ie},"Qty"),o("th",{style:Ie},"Avg"),o("th",{style:Ie},"P&L"))),o("tbody",null,...pi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{..._t,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...$e,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...$e,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...$e,fontFamily:"monospace"}},Oe(n.avgPrice)),o("td",{style:{...$e,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Oe(n.pnl)}`))}))))}function zc(){return o("div",{style:lt},o("div",{style:ct},"Recent Trades"),o("table",{style:Ht},o("thead",null,o("tr",null,o("th",{style:Ie},"Time"),o("th",{style:Ie},"Sym"),o("th",{style:Ie},"Side"),o("th",{style:Ie},"Qty"),o("th",{style:Ie},"Price"))),o("tbody",null,...Mc.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:_t},o("td",{style:{...$e,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...$e,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...$e,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...$e,fontFamily:"monospace"}},Ct(e.qty)),o("td",{style:{...$e,fontFamily:"monospace"}},Oe(e.price)))}))))}function Ac(){let e=Math.max(...fi.map(n=>n.volume),...gi.map(n=>n.volume)),t="16px";return o("div",{style:lt},o("div",{style:ct},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...fi.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},Oe(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Ct(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...gi.map((n,r)=>o("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},Oe(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Ct(n.volume))))))}function Yt(e){let[t,n]=G(0),[r,i]=G("--:--:--"),[s,a]=G(!0);re(()=>{let f=setInterval(()=>{n(g=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(f)},[]),re(()=>{let f=()=>{let y=new Date,h=String(y.getHours()).padStart(2,"0"),p=String(y.getMinutes()).padStart(2,"0"),x=String(y.getSeconds()).padStart(2,"0");i(`${h}:${p}:${x}`)};f();let g=setInterval(f,1e3);return()=>clearInterval(g)},[]),re(()=>{let f=setInterval(()=>{a(g=>!g)},800);return()=>clearInterval(f)},[]);let l=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},b={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},m=189.42+t,c={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:l},o("header",{className:"trading-dashboard__header",style:d},o("span",{style:u},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:c}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:b},Ic(Ec,m),$c(),Dc(t),Tc(),zc(),Ac()))}var dt=["transparent","#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function $n(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:b,onGridToggle:m,onSearch:c}=e,[f,g]=G(""),y=S(P=>{let L=P.target.value;g(L),c(L)},[c]),h={display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.95)",borderBottom:"1px solid #e2e8f0",fontSize:"12px",flexShrink:"0",flexWrap:"wrap"},p={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},x={...p,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},v={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},T={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},D={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=dt.map(P=>{let L=P===r,I=P===i,M=()=>{L&&b?b(I?null:P):u(P)},F="1px solid rgba(0,0,0,0.15)";I?F="3px solid #ef4444":L&&(F="2px solid #3b82f6");let R=P==="transparent";return o("button",{key:P,title:R?"Transparent":P,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:R?"#ffffff":P,backgroundImage:R?"linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%)":"none",backgroundSize:R?"6px 6px":"auto",backgroundPosition:R?"0 0, 3px 3px":"0 0",border:F,cursor:"pointer",padding:"0",flexShrink:"0",opacity:I?"1":i?"0.5":"1"},onClick:M,"aria-label":I?`Clear color filter ${P}`:`Select color ${P}`,"data-testid":`color-swatch-${P}`})});return o("div",{className:"board-toolbar",style:h,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:p,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:T}),o("button",{style:p,onClick:l,"data-testid":"btn-zoom-out","aria-label":"Zoom out"},"-"),o("span",{style:v,onClick:d,"data-testid":"zoom-level",role:"status","aria-label":`Zoom ${Math.round(t*100)}%`},`${Math.round(t*100)}%`),o("button",{style:p,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:T}),...C,o("div",{style:T}),o("button",{style:n?x:p,onClick:m,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:T}),o("input",{type:"text",placeholder:"Search cards...",value:f,onInput:y,style:D,"data-testid":"search-input","aria-label":"Search cards"}))}var Dn={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},hi=dt,bi=[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"},{label:"Critical",value:"critical"}];function Tn(e){let{card:t,selected:n,onSelect:r,onMove:i,onResize:s,onDelete:a,onDoubleClick:l,onUpdate:d,onDragStart:u,onDuplicate:b,onChangeColor:m,onChangePriority:c,onAnchorDragStart:f,onCardContextMenu:g}=e,[y,h]=G(!1),[p,x]=G(!1),[v,T]=G(!1),[D,C]=G(t.title||""),[P,L]=G(t.description||""),I=te(null),M=te(null),F=te(null),R=te(null),N=te(null),A=t.priority?Dn[t.priority]||"#94a3b8":"transparent",{onMouseDown:k,isDragging:w}=vt("application/project-card",{id:t.id,title:t.title,description:t.description,color:t.color}),$=S(pe=>{let ge=pe;ge.preventDefault(),ge.stopPropagation(),g&&g(t.id,{x:ge.clientX,y:ge.clientY})},[t.id,g]);re(()=>{if(p&&R.current){let pe=R.current;pe.focus();let ge=pe.value.length;pe.setSelectionRange(ge,ge)}},[p]),re(()=>{if(v&&N.current){let pe=N.current;pe.focus();let ge=pe.value.length;pe.setSelectionRange(ge,ge)}},[v]);let E=S(pe=>{pe.preventDefault(),pe.stopPropagation(),C(t.title||""),x(!0)},[t.title]),W=S(pe=>{C(pe.target.value)},[]),z=S(()=>{let pe=D.trim();pe&&pe!==t.title&&d&&d(t.id,{title:pe}),x(!1)},[D,t.id,t.title,d]),B=S(pe=>{let ge=pe;ge.key==="Enter"?(ge.preventDefault(),z()):ge.key==="Escape"&&(ge.preventDefault(),x(!1))},[z]),O=S(()=>{z()},[z]),_=S(pe=>{pe.stopPropagation(),L(t.description||""),T(!0)},[t.description]),U=S(pe=>{L(pe.target.value)},[]),X=S(()=>{P!==t.description&&d&&d(t.id,{description:P}),T(!1)},[P,t.id,t.description,d]),ee=S(pe=>{let ge=pe;ge.key==="Escape"&&(ge.preventDefault(),X())},[X]),Z=S(()=>{X()},[X]),V=S((pe,ge)=>{let ye=ge;if(ye.preventDefault(),ye.stopPropagation(),f){let ve=t.position.x+t.size.width/2,De=t.position.y+t.size.height/2,ce=ve,me=De;pe==="top"?(ce=ve,me=t.position.y):pe==="bottom"?(ce=ve,me=t.position.y+t.size.height):pe==="left"?(ce=t.position.x,me=De):pe==="right"&&(ce=t.position.x+t.size.width,me=De),f(t.id,pe,ce,me)}},[t.id,t.position,t.size,f]),j=S(pe=>{let ge=pe,ye=ge.target;if(ye.dataset&&(ye.dataset.role==="delete"||ye.dataset.role==="resize"||ye.dataset.role==="anchor"||ye.dataset.role==="drag-handle"||ye.dataset.role==="inline-edit"))return;ge.preventDefault(),ge.stopPropagation(),r(t.id),I.current={x:ge.clientX,y:ge.clientY,cardX:t.position.x,cardY:t.position.y};let ve=ce=>{let me=ce;if(!I.current)return;let ke=me.clientX-I.current.x,Ee=me.clientY-I.current.y;i(t.id,{x:I.current.cardX+ke,y:I.current.cardY+Ee})},De=()=>{I.current=null,document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",De)};document.addEventListener("mousemove",ve),document.addEventListener("mouseup",De),u&&u(t.id,pe)},[t.id,t.position.x,t.position.y,r,i,u]),H=S(pe=>{let ge=pe;ge.preventDefault(),ge.stopPropagation(),M.current={x:ge.clientX,y:ge.clientY,w:t.size.width,h:t.size.height};let ye=De=>{let ce=De;if(!M.current)return;let me=ce.clientX-M.current.x,ke=ce.clientY-M.current.y,Ee=Math.max(120,M.current.w+me),ze=Math.max(80,M.current.h+ke);s(t.id,{width:Ee,height:ze})},ve=()=>{M.current=null,document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",ve)};document.addEventListener("mousemove",ye),document.addEventListener("mouseup",ve)},[t.id,t.size.width,t.size.height,s]),Y=S(pe=>{pe.preventDefault(),pe.stopPropagation()},[]),K=S(pe=>{pe.preventDefault(),pe.stopPropagation(),a(t.id)},[t.id,a]),Q={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:t.color||"#fef9c3",borderRadius:"6px",borderLeft:`4px solid ${A}`,boxShadow:n?"0 0 0 2px #3b82f6, 0 4px 12px rgba(0,0,0,0.15)":"0 2px 8px rgba(0,0,0,0.1)",cursor:"grab",userSelect:"none",overflow:"hidden",display:"flex",flexDirection:"column",padding:"8px 10px",boxSizing:"border-box",transition:"box-shadow 150ms ease"},se={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},J={fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},ae={position:"absolute",top:"4px",right:"4px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.15)",color:"#333",fontSize:"12px",lineHeight:"18px",textAlign:"center",cursor:"pointer",display:y?"block":"none",border:"none",padding:"0"},de={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},le=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((pe,ge)=>o("span",{key:String(ge),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},pe))):null,ne=t.assignee?o("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",fontSize:"10px",color:"#555"},"data-testid":`card-assignee-${t.id}`},o("span",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"#3b82f6",color:"#fff",fontSize:"9px",fontWeight:"700",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0"}},t.assignee.charAt(0).toUpperCase()),o("span",{},t.assignee)):null,fe={position:"absolute",top:"4px",right:"24px",width:"18px",height:"18px",borderRadius:"3px",backgroundColor:w?"rgba(59,130,246,0.4)":"rgba(0,0,0,0.1)",color:"#333",fontSize:"10px",lineHeight:"18px",textAlign:"center",cursor:"grab",display:y?"block":"none",border:"none",padding:"0"},oe={position:"absolute",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #ffffff",cursor:"crosshair",display:y?"block":"none",zIndex:"10",boxSizing:"border-box"},ie={...oe,top:"-5px",left:"50%",transform:"translateX(-50%)"},ue={...oe,top:"50%",right:"-5px",transform:"translateY(-50%)"},he={...oe,bottom:"-5px",left:"50%",transform:"translateX(-50%)"},be={...oe,top:"50%",left:"-5px",transform:"translateY(-50%)"};return o("div",{ref:F,className:"board-card",style:Q,onMouseDown:j,onDblClick:Y,onContextMenu:$,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),"data-card-id":t.id,"data-testid":`card-${t.id}`,role:"button","aria-label":`Card: ${t.title}`,tabIndex:0},p?o("input",{ref:R,type:"text",value:D,onInput:W,style:{...se,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",padding:"0",margin:"0",fontFamily:"inherit",boxSizing:"border-box"},"data-role":"inline-edit","data-testid":`card-title-input-${t.id}`,onKeyDown:B,onBlur:O,onMouseDown:pe=>pe.stopPropagation()}):o("div",{style:se,onDblClick:E,"data-testid":`card-title-${t.id}`},t.title||"Untitled"),v?o("textarea",{ref:N,value:P,onInput:U,style:{...J,width:"100%",border:"none",outline:"none",backgroundColor:"transparent",padding:"0",margin:"0",fontFamily:"inherit",resize:"none",boxSizing:"border-box"},"data-role":"inline-edit","data-testid":`card-desc-input-${t.id}`,onKeyDown:ee,onBlur:Z,onMouseDown:pe=>pe.stopPropagation()}):o("div",{style:J,onClick:_,"data-testid":`card-desc-${t.id}`},t.description||""),le,ne,o("div",{style:fe,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.id}`,onMouseDown:pe=>{pe.stopPropagation(),k(pe)},"aria-label":`Export drag handle for ${t.title}`,title:"Drag to export card"},"\u2630"),o("button",{style:ae,"data-role":"delete","data-testid":`card-delete-${t.id}`,onClick:K,"aria-label":`Delete ${t.title}`,tabIndex:-1},"\xD7"),o("div",{style:de,"data-role":"resize",onMouseDown:H,"aria-label":"Resize card"}),o("div",{style:ie,"data-role":"anchor","data-anchor":"top","data-testid":`anchor-top-${t.id}`,onMouseDown:pe=>V("top",pe),"aria-label":"Connection anchor top"}),o("div",{style:ue,"data-role":"anchor","data-anchor":"right","data-testid":`anchor-right-${t.id}`,onMouseDown:pe=>V("right",pe),"aria-label":"Connection anchor right"}),o("div",{style:he,"data-role":"anchor","data-anchor":"bottom","data-testid":`anchor-bottom-${t.id}`,onMouseDown:pe=>V("bottom",pe),"aria-label":"Connection anchor bottom"}),o("div",{style:be,"data-role":"anchor","data-anchor":"left","data-testid":`anchor-left-${t.id}`,onMouseDown:pe=>V("left",pe),"aria-label":"Connection anchor left"}))}function zn(e){let{card:t,onSave:n,onClose:r}=e,[i,s]=G(t.title),[a,l]=G(t.description),d=te(null),u=te(null);re(()=>{d.current&&(d.current.focus(),d.current.select())},[]);let b=S(()=>{n(t.id,{title:i,description:a}),r()},[t.id,i,a,n,r]),m=S(D=>{D.key==="Escape"&&b()},[b]),c=S(D=>{D.target===u.current&&b()},[b]),f=S(D=>{s(D.target.value)},[]),g=S(D=>{l(D.target.value)},[]),y=S(D=>{let C=D;if(C.key==="Tab"){C.preventDefault();let P=C.target.parentElement?.querySelector("textarea");P&&P.focus()}C.key==="Escape"&&b()},[b]),h={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"},p={backgroundColor:t.color||"#fef9c3",borderRadius:"8px",padding:"16px",width:`${Math.max(t.size.width,200)}px`,boxShadow:"0 8px 24px rgba(0,0,0,0.2)",display:"flex",flexDirection:"column",gap:"8px"},x={border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",padding:"6px 8px",fontSize:"14px",fontWeight:"600",backgroundColor:"rgba(255,255,255,0.7)",color:"#1a1a1a",outline:"none",width:"100%",boxSizing:"border-box"},v={border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",padding:"6px 8px",fontSize:"12px",backgroundColor:"rgba(255,255,255,0.7)",color:"#333",outline:"none",resize:"vertical",minHeight:"60px",width:"100%",boxSizing:"border-box",fontFamily:"inherit"},T={padding:"6px 14px",border:"none",borderRadius:"4px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"12px",fontWeight:"600",alignSelf:"flex-end"};return o("div",{ref:u,className:"card-editor-overlay",style:h,onClick:c,onKeyDown:m,"data-testid":"card-editor-overlay"},o("div",{style:p,"data-testid":"card-editor",role:"dialog","aria-label":`Edit card: ${t.title}`},o("input",{ref:d,type:"text",value:i,onInput:f,onKeyDown:y,style:x,placeholder:"Card title","data-testid":"card-editor-title","aria-label":"Card title"}),o("textarea",{value:a,onInput:g,onKeyDown:m,style:v,placeholder:"Description...","data-testid":"card-editor-description","aria-label":"Card description"}),o("button",{style:T,onClick:b,"data-testid":"card-editor-save"},"Done")))}function xi(e){return{x:e.position.x+e.size.width/2,y:e.position.y+e.size.height/2}}function Lc(e){switch(e){case"dashed":return"8,4";case"dotted":return"2,4";default:return"none"}}function An(e){let{connections:t,cards:n,selectedConnectionId:r,onSelectConnection:i,canvasWidth:s,canvasHeight:a}=e,l=new Map;for(let m=0;m<n.length;m++)l.set(n[m].id,n[m]);let d=S(m=>{i(m)},[i]),u=[];for(let m=0;m<t.length;m++){let c=t[m],f=l.get(c.fromCardId),g=l.get(c.toCardId);if(!f||!g)continue;let y=xi(f),h=xi(g),p=c.id===r,x=p?"#3b82f6":"#94a3b8",v=Lc(c.style),T=h.x-y.x,D=h.y-y.y,C=Math.sqrt(T*T+D*D),P=Math.min(40,C*.15),L=C>0?-D/C:0,I=C>0?T/C:0,M=(y.x+h.x)/2,F=(y.y+h.y)/2,R=M+L*P,N=F+I*P,A=`M ${y.x} ${y.y} Q ${R} ${N} ${h.x} ${h.y}`;u.push(o("path",{key:`hit-${c.id}`,d:A,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer"},onClick:()=>d(c.id),"data-testid":`connection-hit-${c.id}`})),u.push(o("path",{key:c.id,d:A,fill:"none",stroke:x,"stroke-width":p?"3":"2","stroke-dasharray":v,"pointer-events":"none","data-testid":`connection-${c.id}`})),c.label&&u.push(o("text",{key:`label-${c.id}`,x:String(R),y:String(N-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none"},c.label))}return o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(s),height:String(a),className:"connections-overlay","data-testid":"connections-overlay",role:"img","aria-label":"Card connections"},o("g",{style:{pointerEvents:"auto"}},...u))}var ut=20,pt=5e3;function Si(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Ln(e,t,n,r){let i=r??40;if(e.length===0)return{panX:0,panY:0,zoom:1};let s=1/0,a=1/0,l=-1/0,d=-1/0;for(let h=0;h<e.length;h++){let p=e[h];p.position.x<s&&(s=p.position.x),p.position.y<a&&(a=p.position.y);let x=p.position.x+p.size.width,v=p.position.y+p.size.height;x>l&&(l=x),v>d&&(d=v)}let u=l-s+i*2,b=d-a+i*2,m=t/u,c=n/b,f=Math.max(.25,Math.min(4,Math.min(m,c))),g=-s*f+(t-(l-s)*f)/2,y=-a*f+(n-(d-a)*f)/2;return{panX:g,panY:y,zoom:f}}var yi=0;function Fc(){return yi++,`conn-${Date.now()}-${yi}`}function Fn(e){let{state:t,dispatch:n,searchQuery:r,gridEnabled:i,selectedCardId:s,onSelectCard:a,colorFilter:l,showConnections:d}=e,u=d!==!1,{cards:b,connections:m,viewport:c}=t,[f,g]=G(null),[y,h]=G(null),[p,x]=G(null),[v,T]=G(!1),[D,C]=G(!1),P=te(null),L=te(!1),I=te(null),[M,F]=G(null),R=te(M);R.current=M;let N=S(ce=>{let me=ce;if(me.target.closest(".board-card"))return;let Ee=me.button===1,ze=me.button===0&&me.shiftKey;Ee||ze?(me.preventDefault(),L.current=!0,I.current={x:me.clientX,y:me.clientY,panX:c.panX,panY:c.panY}):me.button===0&&(a(null),h(null))},[c.panX,c.panY,a]);re(()=>{let ce=ke=>{if(!L.current||!I.current)return;let Ee=ke,ze=Ee.clientX-I.current.x,Fe=Ee.clientY-I.current.y;n({type:"PAN",panX:I.current.panX+ze,panY:I.current.panY+Fe})},me=()=>{L.current=!1,I.current=null};return document.addEventListener("mousemove",ce),document.addEventListener("mouseup",me),()=>{document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",me)}},[n]);let A=S(ce=>{let me=ce;if(!me.ctrlKey)return;me.preventDefault();let ke=me.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+ke})},[c.zoom,n]),k=te(null);re(()=>{let ce=P.current;if(!ce)return;let me=Ne=>{let Te=[];for(let Re=0;Re<Ne.touches.length;Re++)Te.push({x:Ne.touches[Re].clientX,y:Ne.touches[Re].clientY});return Te},ke=(Ne,Te)=>Math.sqrt((Ne.x-Te.x)**2+(Ne.y-Te.y)**2),Ee=Ne=>{let Te=Ne;if(Te.touches.length===2){Te.preventDefault();let Re=me(Te);k.current={touches:Re,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:ke(Re[0],Re[1])}}},ze=Ne=>{let Te=Ne;if(Te.touches.length!==2||!k.current)return;Te.preventDefault();let Re=me(Te),Ye=k.current,Ms=(Ye.touches[0].x+Ye.touches[1].x)/2,Es=(Ye.touches[0].y+Ye.touches[1].y)/2,Rs=(Re[0].x+Re[1].x)/2,Ps=(Re[0].y+Re[1].y)/2,Is=Rs-Ms,$s=Ps-Es;n({type:"PAN",panX:Ye.panX+Is,panY:Ye.panY+$s});let Ds=ke(Re[0],Re[1]);if(Ye.dist>0){let Ts=Ds/Ye.dist;n({type:"ZOOM",zoom:Ye.zoom*Ts})}},Fe=()=>{k.current=null};return ce.addEventListener("touchstart",Ee,{passive:!1}),ce.addEventListener("touchmove",ze,{passive:!1}),ce.addEventListener("touchend",Fe),()=>{ce.removeEventListener("touchstart",Ee),ce.removeEventListener("touchmove",ze),ce.removeEventListener("touchend",Fe)}},[c.panX,c.panY,c.zoom,n]),re(()=>{let ce=me=>{let ke=me;(ke.key==="Delete"||ke.key==="Backspace")&&(y?(n({type:"REMOVE_CONNECTION",connectionId:y}),h(null)):s&&(n({type:"REMOVE_CARD",cardId:s}),a(null)))};return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[y,s,n,a]);let w=S(ce=>{a(ce),h(null)},[a]),$=S((ce,me)=>{let ke=me;i&&(ke={x:Math.round(me.x/ut)*ut,y:Math.round(me.y/ut)*ut}),n({type:"MOVE_CARD",cardId:ce,position:ke})},[n,i]),E=S((ce,me)=>{n({type:"RESIZE_CARD",cardId:ce,size:me})},[n]),W=S(ce=>{n({type:"REMOVE_CARD",cardId:ce}),s===ce&&a(null)},[n,s,a]),z=S(ce=>{},[]),B=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:me})},[n]),O=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:me})},[n]),_=S(()=>{g(null)},[]),U=S(ce=>{h(ce),a(null)},[a]),X=S(ce=>{n({type:"REMOVE_CONNECTION",connectionId:ce}),h(null)},[n]),ee=S(ce=>{let me=`card-${Date.now()}-dup`;n({type:"DUPLICATE_CARD",cardId:ce,newId:me})},[n]),Z=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:{color:me}})},[n]),V=S((ce,me)=>{n({type:"UPDATE_CARD",cardId:ce,updates:{priority:me}})},[n]),j=S((ce,me)=>{x({cardId:ce,x:me.x,y:me.y}),T(!1),C(!1)},[]),H=S(()=>{x(null),T(!1),C(!1)},[]);re(()=>{if(!p)return;let ce=()=>{H()},me=setTimeout(()=>{document.addEventListener("click",ce),document.addEventListener("contextmenu",ce)},0);return()=>{clearTimeout(me),document.removeEventListener("click",ce),document.removeEventListener("contextmenu",ce)}},[p,H]);let Y=S(ce=>{if(ce.stopPropagation(),p){let me=`card-${Date.now()}-dup`;n({type:"DUPLICATE_CARD",cardId:p.cardId,newId:me})}H()},[p,n,H]),K=S(ce=>{ce.stopPropagation(),p&&(n({type:"REMOVE_CARD",cardId:p.cardId}),s===p.cardId&&a(null)),H()},[p,n,s,a,H]),Q=S(()=>{T(!0),C(!1)},[]),se=S(()=>{C(!0),T(!1)},[]),J=S(ce=>{p&&n({type:"UPDATE_CARD",cardId:p.cardId,updates:{color:ce}}),H()},[p,n,H]),ae=S(ce=>{p&&n({type:"UPDATE_CARD",cardId:p.cardId,updates:{priority:ce}}),H()},[p,n,H]),de=S((ce,me,ke,Ee)=>{F({fromCardId:ce,fromAnchor:me,fromX:ke,fromY:Ee,toX:ke,toY:Ee})},[]);re(()=>{if(!R.current)return;let ce=ke=>{let Ee=ke;if(!R.current)return;let ze=Si(Ee.clientX,Ee.clientY,c);F(Fe=>Fe?{...Fe,toX:ze.x,toY:ze.y}:null)},me=ke=>{let Ee=ke;if(!R.current)return;let ze=R.current,Fe=Ee.target,Ne=Fe.closest?Fe.closest("[data-anchor]"):null,Te=Fe.closest?Fe.closest("[data-card-id]"):null;if(Ne&&Te){let Re=Te.getAttribute("data-card-id");Re&&Re!==ze.fromCardId&&n({type:"ADD_CONNECTION",connection:{id:Fc(),fromCardId:ze.fromCardId,toCardId:Re}})}F(null)};return document.addEventListener("mousemove",ce),document.addEventListener("mouseup",me),()=>{document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",me)}},[M,c,n]);let le=r.toLowerCase(),ne=le?b.filter(ce=>ce.title.toLowerCase().includes(le)):b,fe=new Set;if(le)for(let ce=0;ce<b.length;ce++)b[ce].title.toLowerCase().includes(le)||fe.add(b[ce].id);if(l)for(let ce=0;ce<b.length;ce++)b[ce].color!==l&&fe.add(b[ce].id);let oe={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:L.current?"grabbing":"default",backgroundImage:"radial-gradient(circle, #d1d5db 1px, transparent 1px)",backgroundSize:`${ut}px ${ut}px`},ie={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${pt}px`,height:`${pt}px`},ue=b.map(ce=>{let me=fe.has(ce.id),ke=o(Tn,{key:ce.id,card:ce,selected:ce.id===s,onSelect:w,onMove:$,onResize:E,onDelete:W,onDoubleClick:z,onUpdate:B,onDuplicate:ee,onChangeColor:Z,onChangePriority:V,onAnchorDragStart:de,onCardContextMenu:j});return me?o("div",{key:`dim-${ce.id}`,style:{opacity:"0.3"}},ke):ke}),he=f?b.find(ce=>ce.id===f):null,be=he?o(zn,{card:he,onSave:O,onClose:_}):null,pe=M?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"5"},width:String(pt),height:String(pt),"data-testid":"connection-drag-line"},o("line",{x1:String(M.fromX),y1:String(M.fromY),x2:String(M.toX),y2:String(M.toY),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6,4","pointer-events":"none"})):null,ge={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},ye={position:"absolute",left:"100%",top:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"120px"},ve=p?b.find(ce=>ce.id===p.cardId):null,De=p?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${p.x}px`,top:`${p.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10000",minWidth:"160px",fontSize:"13px",color:"#1a1a1a"},"data-testid":`context-menu-${p.cardId}`,role:"menu","aria-label":"Card context menu"},o("div",{style:ge,onClick:Y,role:"menuitem","data-testid":`context-menu-duplicate-${p.cardId}`},"Duplicate"),o("div",{style:ge,onClick:K,role:"menuitem","data-testid":`context-menu-delete-${p.cardId}`},"Delete"),o("div",{style:{...ge,position:"relative"},onMouseEnter:Q,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-color-${p.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),v?o("div",{style:ye,role:"menu","data-testid":`context-submenu-color-${p.cardId}`},...hi.map(ce=>o("div",{key:ce,style:{...ge,gap:"8px"},onClick:me=>{me.stopPropagation(),J(ce)},role:"menuitem","data-testid":`context-color-${ce}`},o("span",{style:{width:"14px",height:"14px",borderRadius:"50%",backgroundColor:ce,border:"1px solid rgba(0,0,0,0.15)",display:"inline-block",flexShrink:"0"}}),ve&&ce===ve.color?"\u2713":""))):null),o("div",{style:{...ge,position:"relative"},onMouseEnter:se,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-priority-${p.cardId}`},"Set Priority",o("span",{style:{marginLeft:"8px"}},"\u25B6"),D?o("div",{style:ye,role:"menu","data-testid":`context-submenu-priority-${p.cardId}`},...bi.map(ce=>o("div",{key:ce.value,style:{...ge,gap:"8px"},onClick:me=>{me.stopPropagation(),ae(ce.value)},role:"menuitem","data-testid":`context-priority-${ce.value}`},o("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:Dn[ce.value]||"#94a3b8",display:"inline-block",flexShrink:"0"}}),ce.label,ve&&ce.value===ve.priority?" \u2713":""))):null)):null;return o("div",{ref:P,className:"board-canvas",style:oe,onMouseDown:N,onWheel:A,"data-testid":"board-canvas",role:"application","aria-label":"Project board canvas",tabIndex:0},o("div",{className:"board-canvas__inner",style:ie,"data-testid":"board-canvas-inner"},u?o(An,{connections:m,cards:b,selectedConnectionId:y,onSelectConnection:U,onDeleteConnection:X,canvasWidth:pt,canvasHeight:pt}):null,pe,...ue),be,De)}var vi=50,Vt={id:crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:"Untitled",cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}};function wi(e,t){switch(t.type){case"ADD_CARD":return{...e,cards:[...e.cards,t.card]};case"REMOVE_CARD":return{...e,cards:e.cards.filter(n=>n.id!==t.cardId),connections:e.connections.filter(n=>n.fromCardId!==t.cardId&&n.toCardId!==t.cardId)};case"MOVE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,position:t.position,updatedAt:Date.now()}:n)};case"RESIZE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,size:t.size,updatedAt:Date.now()}:n)};case"UPDATE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,...t.updates,updatedAt:Date.now()}:n)};case"DUPLICATE_CARD":{let n=e.cards.find(s=>s.id===t.cardId);if(!n)return e;let r=t.offset||{x:20,y:20},i={...n,id:t.newId,position:{x:n.position.x+r.x,y:n.position.y+r.y},createdAt:Date.now(),updatedAt:Date.now()};return{...e,cards:[...e.cards,i]}}case"ADD_CONNECTION":return{...e,connections:[...e.connections,t.connection]};case"REMOVE_CONNECTION":return{...e,connections:e.connections.filter(n=>n.id!==t.connectionId)};case"PAN":return{...e,viewport:{...e.viewport,panX:t.panX,panY:t.panY}};case"ZOOM":{let n=Math.max(.25,Math.min(4,t.zoom));return{...e,viewport:{...e.viewport,zoom:n}}}case"SET_BOARD":return t.state;default:return e}}function Nc(e){return e.type==="PAN"||e.type==="ZOOM"}function ki(e,t){switch(t.type){case"UNDO":{if(e.past.length===0)return e;let n=e.past[e.past.length-1];return{past:e.past.slice(0,e.past.length-1),present:n,future:[e.present,...e.future]}}case"REDO":{if(e.future.length===0)return e;let n=e.future[0],r=e.future.slice(1);return{past:[...e.past,e.present],present:n,future:r}}case"BOARD_ACTION":{let n=wi(e.present,t.action);if(n===e.present)return e;if(Nc(t.action))return{...e,present:n};if(t.action.type==="SET_BOARD")return{past:[],present:n,future:[]};let r=[...e.past,e.present];return r.length>vi&&r.splice(0,r.length-vi),{past:r,present:n,future:[]}}default:return e}}function Nn(e,t){let n={past:[],present:Vt,future:[]},[r,i]=en(ki,n),s=S(m=>{i({type:"BOARD_ACTION",action:m})},[i]),a=S(()=>{i({type:"UNDO"})},[i]),l=S(()=>{i({type:"REDO"})},[i]),d=te(!1);re(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{s({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,s]);let u=te(null),b=te(r.present);return b.current=r.present,re(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,b.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,r.present]),{state:r.present,dispatch:s,undo:a,redo:l,canUndo:r.past.length>0,canRedo:r.future.length>0}}var Ci={cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}},Mt=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):Ci}catch{return Ci}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Wn(e){let{cards:t,onCardDropped:n,children:r}=e,i=qe(),s=te([]);re(()=>{let u=s.current,b=new Set(u.map(c=>c.id)),m=new Set(t.map(c=>c.id));for(let c of t)b.has(c.id)||i.publish("project-board",{event:"card-created",card:c});for(let c of u)m.has(c.id)||i.publish("project-board",{event:"card-deleted",cardId:c.id});for(let c of t)if(b.has(c.id)){let f=u.find(g=>g.id===c.id);f&&f.updatedAt!==c.updatedAt&&i.publish("project-board",{event:"card-updated",card:c})}s.current=t},[t,i]);let a=S(u=>{if(u.type==="text/plain"&&typeof u.data=="string")n(u.data,"");else if(u.type==="application/json"){let b=u.data;n(String(b.title||"Dropped Item"),String(b.description||""))}},[n]),{isOver:l}=wt({acceptTypes:["text/plain","application/json","application/project-card"],onDrop:a}),d={width:"100%",height:"100%",...l?{outline:"2px dashed #3b82f6",outlineOffset:"-2px"}:{}};return o("div",{style:d,"data-dropzone-id":"project-board-dropzone"},r)}var Mi=0;function Ei(){return Mi++,`card-${Date.now()}-${Mi}`}var Wc=new Mt,Bc=[{id:"sample-1",title:"Auth API",description:"Design the auth flow",color:"#3b82f6",position:{x:50,y:50},size:{width:180,height:120},priority:"high",assignee:"Alice",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-2",title:"Dashboard",description:"Build the main dashboard",color:"#22c55e",position:{x:300,y:80},size:{width:180,height:120},priority:"medium",assignee:"Bob",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-3",title:"Deploy",description:"Set up CI pipeline",color:"#f59e0b",position:{x:150,y:250},size:{width:180,height:120},priority:"low",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-4",title:"Docs",description:"Write API reference",color:"#a855f7",position:{x:400,y:280},size:{width:180,height:120},priority:"medium",assignee:"Carol",createdAt:Date.now(),updatedAt:Date.now()}],Oc={id:"sample-board-001",name:"Sample Project",cards:Bc,connections:[{id:"sample-conn-1",fromCardId:"sample-1",toCardId:"sample-2"}],viewport:{panX:0,panY:0,zoom:1}};function Hc(e){return e.cards.length===0&&e.connections.length===0}function Ri(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Nn(Wc,t),[d,u]=G(dt[0]),[b,m]=G(!1),[c,f]=G(""),[g,y]=G(null),[h,p]=G(null),[x,v]=G(!0),[T,D]=G(n.name||"Untitled"),[C,P]=G(!1),[L,I]=G(""),M=te(!1);re(()=>{!M.current&&Hc(n)?(M.current=!0,r({type:"SET_BOARD",state:Oc})):n.cards.length>0&&(M.current=!0)},[n,r]);let F=S(()=>{let le=(-n.viewport.panX+300)/n.viewport.zoom,ne=(-n.viewport.panY+200)/n.viewport.zoom,fe=(Math.random()-.5)*300,oe=(Math.random()-.5)*200,ie={id:Ei(),title:"New Card",description:"",color:d,position:{x:Math.round(le+fe),y:Math.round(ne+oe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:ie})},[n.viewport,d,r]),R=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),N=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),A=S(()=>{r({type:"ZOOM",zoom:1})},[r]),k=S(()=>{m(le=>!le)},[]),w=S(le=>{f(le)},[]),$=S(le=>{y(le)},[]),E=S(le=>{p(le)},[]),W=S(()=>{r({type:"SET_BOARD",state:Vt}),y(null)},[r]),z=S(()=>{let le=JSON.stringify(n,null,2),ne=new Blob([le],{type:"application/json"}),fe=URL.createObjectURL(ne),oe=document.createElement("a");oe.href=fe,oe.download=`board-${t}.json`,oe.style.display="none",document.body.appendChild(oe),oe.click(),document.body.removeChild(oe),URL.revokeObjectURL(fe)},[n,t]),B=S(()=>{let le=document.createElement("input");le.type="file",le.accept=".json,application/json",le.style.display="none",le.addEventListener("change",()=>{let ne=le.files&&le.files[0];if(!ne)return;let fe=new FileReader;fe.onload=()=>{try{let oe=JSON.parse(fe.result);oe&&oe.cards&&oe.viewport&&r({type:"SET_BOARD",state:oe})}catch{}},fe.readAsText(ne)}),document.body.appendChild(le),le.click(),document.body.removeChild(le)},[r]),O=S(()=>{window.print()},[]),_=S(()=>{n.cards.length>0&&y(n.cards[0].id)},[n.cards]),U=S(()=>{v(le=>!le)},[]),X=S(()=>{g&&(r({type:"REMOVE_CARD",cardId:g}),y(null))},[g,r]),ee=S(()=>{if(n.cards.length===0)return;let fe=Ln(n.cards,800,600);r({type:"PAN",panX:fe.panX,panY:fe.panY}),r({type:"ZOOM",zoom:fe.zoom})},[n.cards,r]),Z=S(()=>{I(T),P(!0)},[T]),V=S(()=>{let le=L.trim();le&&D(le),P(!1)},[L]),j=S(()=>{P(!1)},[]),H=S(le=>{I(le.target.value)},[]),Y=S(le=>{let ne=le;ne.key==="Enter"&&(ne.preventDefault(),V()),ne.key==="Escape"&&(ne.preventDefault(),j())},[V,j]);re(()=>{let le={menus:[{label:"File",items:[{label:"New Board",onClick:W},{label:"Export JSON",onClick:z},{label:"Import JSON",onClick:B},{divider:!0},{label:"Print",onClick:O}]},{label:"Edit",items:[{label:"Undo",shortcut:"Ctrl+Z",onClick:i,disabled:!a},{label:"Redo",shortcut:"Ctrl+Y",onClick:s,disabled:!l},{divider:!0},{label:"Select All",shortcut:"Ctrl+A",onClick:_},{label:"Delete Selected",onClick:X}]},{label:"View",items:[{label:"Zoom In",onClick:R},{label:"Zoom Out",onClick:N},{label:"Fit All",onClick:ee},{divider:!0},{label:"Toggle Grid",onClick:k},{label:x?"Hide Connections":"Show Connections",onClick:U}]}]}},[W,z,B,O,i,s,a,l,_,X,R,N,ee,k,U,x]),re(()=>{let le=ne=>{let fe=ne;fe.ctrlKey&&fe.key==="z"?(fe.preventDefault(),i()):fe.ctrlKey&&fe.key==="y"&&(fe.preventDefault(),s())};return document.addEventListener("keydown",le),()=>document.removeEventListener("keydown",le)},[i,s]);let K={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},Q=S((le,ne)=>{let fe=(-n.viewport.panX+300)/n.viewport.zoom,oe=(-n.viewport.panY+200)/n.viewport.zoom,ie=(Math.random()-.5)*300,ue=(Math.random()-.5)*200,he={id:Ei(),title:le,description:ne,color:d,position:{x:Math.round(fe+ie),y:Math.round(oe+ue)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:he})},[n.viewport,d,r]),se={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},J={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},ae=o("div",{style:se,"data-testid":"app-menu-bar"},o("button",{style:J,onClick:Z,title:"Project menu"},"Project"),o("button",{style:J,title:"Settings"},"Settings"),o("button",{style:J,title:"Help"},"Help"),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${T}`)),de=C?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:j},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:le=>le.stopPropagation(),role:"dialog","aria-label":"Rename project"},o("div",{style:{fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"}},"Rename Project"),o("input",{type:"text",value:L,onInput:H,onKeyDown:Y,autoFocus:!0,style:{width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},"data-testid":"rename-input"}),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{onClick:j,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:V,style:{padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},"data-testid":"rename-confirm"},"Rename")))):null;return o("div",{className:"project-manager-app",style:K,"data-testid":"project-manager-app"},ae,o($n,{zoom:n.viewport.zoom,gridEnabled:b,selectedColor:d,colorFilter:h,onNewCard:F,onZoomIn:R,onZoomOut:N,onZoomReset:A,onColorSelect:u,onColorFilter:E,onGridToggle:k,onSearch:w}),o(Wn,{cards:n.cards,onCardDropped:Q},o(Fn,{state:n,dispatch:r,searchQuery:c,gridEnabled:b,selectedCardId:g,onSelectCard:$,colorFilter:h,showConnections:x})),de)}var _c=28,Yc=5e3;var Pi=0;function Ii(e){return Pi++,`${e}-${Pi}`}function $i(e){return e.replace(/\s*\(\d+\)$/,"")}function Vc(e){let{toasts:t,onDismiss:n}=e;if(t.length===0)return null;let r={position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},i=t.map(s=>{let a="rgba(50, 50, 50, 0.95)",l="#555";return s.severity==="warning"?(a="rgba(60, 40, 10, 0.95)",l="#f39c12"):s.severity==="error"&&(a="rgba(60, 10, 10, 0.95)",l="#e74c3c"),o("div",{key:String(s.id),className:`unity-desktop__toast unity-desktop__toast--${s.severity}`,style:{backgroundColor:a,border:`1px solid ${l}`,borderRadius:"6px",padding:"10px 14px",color:"#ffffff",fontSize:"13px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",cursor:"pointer",transition:"opacity 200ms ease"},onClick:()=>n(s.id),role:"alert","aria-live":"polite"},s.message)});return o("div",{className:"unity-desktop__toast-container",style:r,"aria-label":"Notifications"},...i)}function Uc(){let e=qe(),t=te(!1);return re(()=>{t.current||(t.current=!0,e.publish("terminal-output",{text:"Terminal session started",pid:1}))},[e]),o("div",{style:{padding:"16px",fontSize:"12px",color:"#00ff41",height:"100%",overflow:"auto",backgroundColor:"#1a1a2e",fontFamily:"monospace"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",{style:{opacity:"0.6",marginTop:"8px",fontSize:"10px"}},"[Published terminal-output message]"),o("div",null,"$ _"))}function jc(){let[e,t]=G([]),n=Qe();yt("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=S(s=>{s.preventDefault(),n.startDrag({type:"application/file",data:{name:"readme.txt",size:1024},sourceAppId:"files",preview:"readme.txt"})},[n]);return o("div",{style:{padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"}},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["\u{1F4C1} Documents","\u{1F4C1} Downloads","\u{1F4C1} Music","\u{1F4C1} Pictures","\u{1F4C1} Videos"].map(s=>o("span",{style:{cursor:"pointer"}},s)),o("span",{style:{cursor:"grab",padding:"4px 8px",border:"1px dashed #94a3b8",borderRadius:"4px",backgroundColor:"rgba(148, 163, 184, 0.1)"},onMouseDown:r,"aria-label":"Drag readme.txt"},"\u{1F4C4} readme.txt (drag me)")),e.length>0?o("div",{style:{marginTop:"12px",padding:"8px",backgroundColor:"rgba(0,0,0,0.05)",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace"}},o("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Messages received:"),...e.map((s,a)=>o("div",{key:String(a),style:{color:"#64748b"}},s))):null)}function Gc(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch($i(e)){case"Files":return o(Xe,{appId:"files"},o(jc,null));case"Terminal":return o(Xe,{appId:"terminal"},o(Uc,null));case"Browser":return o("div",{style:t},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(r=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},r)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(r=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},r)));case"Word Processor":return o(Bt,null);case"IDE":return o(Ot,null);case"Trading":return o(Yt,null);case"Project Board":return o(Ri,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function Xc(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=bt(),d=l.activeMenuBar,u=l.dockSignals,b=te(l);b.current=l;let[m,c]=G([]),[f,g]=G([]),[y,h]=G(!1),[p,x]=G(!1),[v,T]=G(null),[D,C]=G({x:0,y:0}),[P,L]=G(null),I=S(()=>{h(oe=>!oe)},[]),M=S(oe=>{g(ie=>ie.filter(ue=>ue.id!==oe))},[]);re(()=>{if(f.length===0)return;let oe=f[0],ie=Date.now()-oe.timestamp,ue=Math.max(0,Yc-ie),he=setTimeout(()=>{g(be=>be.filter(pe=>pe.id!==oe.id))},ue);return()=>clearTimeout(he)},[f]);let F=te(t);F.current=t;let R=te(r);R.current=r;let N=S(oe=>{let ue=F.current.find(he=>he.id===oe);ue&&(c(he=>{let pe=he.filter(ce=>ce.appId===oe).length+1,ge=pe===1?ue.label:`${ue.label} (${pe})`,ye=Ii(oe),ve=he.length>0?Math.max(...he.map(ce=>ce.zIndex))+1:1,De={id:ye,appId:ue.id,title:ge,icon:ue.icon,x:60+he.length*30,y:40+he.length*30,width:600,height:400,zIndex:ve,focused:!0,windowState:"normal"};return[...he.map(ce=>({...ce,focused:!1})),De]}),oe==="files"&&b.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),oe==="terminal"&&b.current.signalDock("terminal",{badge:3}),R.current&&R.current(oe))},[]),A=S(oe=>{c(ie=>{if(!ie.find(be=>be.id===oe))return ie;let he=Math.max(...ie.map(be=>be.zIndex))+1;return ie.map(be=>be.id===oe?{...be,focused:!0,zIndex:he,windowState:be.windowState==="minimized"?"normal":be.windowState}:{...be,focused:!1})})},[]),k=S(oe=>{c(ie=>{let ue=ie.filter(ge=>ge.appId===oe);if(ue.length===0)return ie;let be=[...ue].sort((ge,ye)=>ye.zIndex-ge.zIndex)[0],pe=Math.max(...ie.map(ge=>ge.zIndex))+1;return ie.map(ge=>ge.id===be.id?{...ge,focused:!0,zIndex:pe,windowState:ge.windowState==="minimized"?"normal":ge.windowState}:{...ge,focused:!1})}),c(ie=>{if(ie.filter(he=>he.appId===oe).length===0){let be=F.current.find(ve=>ve.id===oe);if(!be)return ie;let pe=Ii(oe),ge=ie.length>0?Math.max(...ie.map(ve=>ve.zIndex))+1:1,ye={id:pe,appId:be.id,title:be.label,icon:be.icon,x:60+ie.length*30,y:40+ie.length*30,width:600,height:400,zIndex:ge,focused:!0,windowState:"normal"};return oe==="files"&&b.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),oe==="terminal"&&b.current.signalDock("terminal",{badge:3}),R.current&&R.current(oe),[...ie.map(ve=>({...ve,focused:!1})),ye]}return ie})},[]),w=t.map(oe=>{let ie=m.some(be=>be.appId===oe.id),ue=u.get(oe.id),he={id:oe.id,icon:oe.icon,label:ue?.tooltip||oe.label,active:ie};return ue&&(ue.badge!=null&&(he.badge=ue.badge>0?ue.badge:void 0),ue.progress!=null&&(he.progress=ue.progress>0?ue.progress:void 0),ue.urgent&&(he.urgent=!0)),he}),$=m.find(oe=>oe.focused),E=$?$.title:void 0,W=S(()=>{x(!0)},[]),z=S(()=>{x(!1)},[]),B=S((oe,ie)=>{T(oe),C(ie)},[]),O=S(()=>{T(null)},[]),_=S(()=>{},[]),U=S(()=>{i&&i()},[i]),X=[];n&&(X.push({label:n.name,icon:void 0,onClick:_,divider:!1}),X.push({label:"",icon:void 0,onClick:_,divider:!0})),X.push({label:"Lock",icon:void 0,onClick:W,divider:!1}),X.push({label:"Logout",icon:void 0,onClick:U,divider:!1});let ee=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:s==="dark"?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[s]),Z={display:"flex",flex:"1",overflow:"hidden"},V={display:"flex",flexDirection:"column",height:"100%",backgroundColor:s==="dark"?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:s==="dark"?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},j={width:"100%",height:"100%",position:"relative"},H=o(Cn,{activeAppName:E,activitiesButton:{label:"Activities",onClick:I},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:X.length>0?X:void 0,height:_c}),Y=o(Mn,{items:w,orientation:"vertical",position:"left",iconSize:36,onItemClick:k,onItemContextMenu:B}),K=o(Vc,{toasts:f,onDismiss:M}),Q=m.filter(oe=>oe.windowState!=="minimized").map(oe=>o(kt,{key:oe.id,id:oe.id,title:oe.title,icon:oe.icon,defaultPosition:{x:oe.x,y:oe.y},defaultSize:{width:oe.width,height:oe.height},zIndex:oe.zIndex,focused:oe.focused,windowState:oe.windowState,onClose:()=>{c(ie=>ie.filter(ue=>ue.id!==oe.id))},onFocus:()=>{c(ie=>{let ue=Math.max(...ie.map(he=>he.zIndex))+1;return ie.map(he=>he.id===oe.id?{...he,focused:!0,zIndex:ue}:{...he,focused:!1})})},onMinimize:()=>{c(ie=>ie.map(ue=>ue.id===oe.id?{...ue,windowState:"minimized"}:ue))},onMaximize:()=>{c(ie=>ie.map(ue=>ue.id===oe.id?{...ue,windowState:ue.windowState==="maximized"?"normal":"maximized"}:ue))}},Gc(oe.title))),se=[];a&&se.push(a),se.push(...Q),se.push(K);let J=o(En,{backgroundColor:s==="dark"?"#2c001e":"#e8e0e4",backgroundGradient:s==="dark"?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:j},...se)),ae=y?o("div",{style:{position:"absolute",inset:"0",zIndex:"100",backgroundColor:"rgba(0, 0, 0, 0.85)",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:"24px",padding:"48px",alignContent:"start",overflowY:"auto"},onClick:I},...t.map(oe=>o("button",{key:oe.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:ie=>{ie.stopPropagation(),h(!1),k(oe.id)}},o("span",{style:{fontSize:"32px",display:"block"}},oe.icon),o("span",null,oe.label)))):null,de=p?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:z},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"\u{1F512}"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,le=(()=>{if(!v)return null;let oe=t.find(ge=>ge.id===v),ie=m.filter(ge=>ge.appId===v),ue={padding:"6px 14px",cursor:"pointer"},he={onMouseEnter:ge=>{ge.currentTarget.style.backgroundColor="#444"},onMouseLeave:ge=>{ge.currentTarget.style.backgroundColor="transparent"}},be={borderBottom:"1px solid #444",margin:"4px 0"},pe=[];return pe.push(o("div",{key:"new",style:ue,...he,onClick:()=>{N(v),T(null)},role:"menuitem"},"\u25CF New")),ie.length>0&&(pe.push(o("div",{key:"sep-1",style:be})),ie.forEach((ge,ye)=>{let ve=ie.length===1?oe?.label||ge.title:`${oe?.label||$i(ge.title)} (${ye+1})`;pe.push(o("div",{key:`inst-${ge.id}`,style:ue,...he,onClick:()=>{A(ge.id),T(null)},role:"menuitem"},ve))})),pe.push(o("div",{key:"sep-2",style:be})),pe.push(o("div",{key:"about",style:ue,...he,onClick:()=>{L(v),T(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:O},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${D.y}px`,left:`${D.x}px`,backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"6px",padding:"4px 0",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:"9001",color:"#ffffff",fontSize:"13px"},onClick:ge=>ge.stopPropagation()},...pe))})(),ne=P?t.find(oe=>oe.id===P):null,fe=ne?o("div",{className:"unity-desktop__about-backdrop",style:{position:"absolute",inset:"0",zIndex:"9500",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>L(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:oe=>oe.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},ne.label),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"SpecifyJS Demo App"),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"MIT License"),o("div",{style:{fontSize:"13px",color:"#aaa"}},"v0.2.47"),o("button",{style:{marginTop:"16px",padding:"6px 16px",border:"1px solid #555",borderRadius:"4px",backgroundColor:"#444",color:"#fff",cursor:"pointer"},onClick:()=>L(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:ee,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},H),o("div",{style:Z},o("div",{className:"unity-desktop__dock",style:V},Y),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},J,ae)),le,fe,de)}function Di(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(wn,{onWindowOpen:r},o(xt,null,o(St,null,o(Xc,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function Ti(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:b,onDeactivate:m,children:c}=e,f=bt(),g=q(()=>f.windows.find(P=>P.id===t),[f.windows,t]);re(()=>(u?f.setMenuBar(t,u):f.clearMenuBar(t),()=>{f.clearMenuBar(t)}),[u,t,f]);let y=te(!1),h=g?g.focused:!1;re(()=>{let P=y.current;y.current=h,h&&!P?b&&b():!h&&P&&m&&m()},[h,b,m]);let p=S(()=>{f.closeWindow(t),d&&d()},[f,t,d]),x=S(()=>{f.focusWindow(t)},[f,t]),v=S(P=>{f.moveWindow(t,P)},[f,t]),T=S(P=>{f.resizeWindow(t,P)},[f,t]),D=S(()=>{f.minimizeWindow(t)},[f,t]),C=S(()=>{g&&g.windowState==="maximized"?f.restoreWindow(t):f.maximizeWindow(t)},[f,t,g]);return g?o(Xe,{appId:t},o(kt,{id:t,title:n,icon:r,defaultPosition:g.position,defaultSize:g.size,minSize:a,resizable:l,windowState:g.windowState,focused:g.focused,zIndex:g.zIndex,onClose:p,onFocus:x,onMove:v,onResize:T,onMinimize:D,onMaximize:C,children:c})):(f.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var zi={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},Ai={primary:{bg:"#3b82f6",color:"white",border:"#3b82f6"},secondary:{bg:"#f8fafc",color:"#0f172a",border:"#d1d5db"},outline:{bg:"transparent",color:"#0f172a",border:"#d1d5db"},ghost:{bg:"transparent",color:"#0f172a",border:"transparent"},danger:{bg:"#ef4444",color:"white",border:"#ef4444"}};function Li(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:b,active:m=!1}=e,c=q(()=>{let f=zi[i]??zi.md,g=Ai[r]??Ai.secondary,y={padding:f.padding,fontSize:f.fontSize,borderRadius:f.borderRadius,border:`1px solid ${g.border}`,backgroundColor:m?"#3b82f6":g.bg,color:m?"white":g.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),u&&Object.assign(y,u),y},[r,i,s,a,m,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":b,"aria-pressed":m?"true":void 0},t)}var qc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],ft=Math.PI/180;function Kc(e,t,n,r,i,s,a,l,d,u){let b=Math.cos(r*ft),m=Math.sin(r*ft),c=Math.cos(i*ft),f=Math.sin(i*ft),g=Math.cos(s*ft),y=Math.sin(s*ft),h=e*g-t*y,p=e*y+t*g,x=h*c-p*f,v=h*f+p*c,T=n,D=x,C=v*b-T*m,P=v*m+T*b,L=1+a*.001*P,I=l+D*u*L,M=d-C*u*L;return{sx:I,sy:M,depth:P}}function Fi(e,t){let n=e.replace("#",""),r,i,s;return n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,`rgba(${r},${i},${s},${t})`}function Ni(e,t){let n=e.replace("#",""),r,i,s;n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s;let a=d=>Math.max(0,Math.min(255,Math.round(d*t))),l=d=>a(d).toString(16).padStart(2,"0");return"#"+l(r)+l(i)+l(s)}function Wi(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:b=2,colorScale:m=qc,gridColor:c="#94a3b8",title:f}=e,g=q(()=>{let A=0,k=0,w=0;for(let $=0;$<t.length;$++){let E=t[$],W=E.data.length;W>A&&(A=W);for(let z=0;z<W;z++){let B=E.data[z].length;B>k&&(k=B);for(let O=0;O<B;O++){let _=Math.abs(E.data[z][O]??0);_>w&&(w=_)}}}return{maxRows:Math.max(A,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),y=q(()=>{let A=g.maxHeight+(t.length-1)*b+g.maxHeight,k=Math.sqrt(g.maxCols*g.maxCols+g.maxRows*g.maxRows+A*A),w=Math.min(n,r)*.75;return k>0?w/k:1},[g,t.length,b,n,r]),h=n/2,p=r/2,x=S((A,k,w)=>Kc(A,k,w,s,a,l,i,h,p,y),[s,a,l,i,h,p,y]),v=S(()=>{if(!u)return[];let A=[],k=Math.max(g.maxCols,g.maxRows),w=g.maxCols/2,$=g.maxRows/2,E=x(-w,-$,0),W=x(w,-$,0);A.push(o("line",{key:"axis-x",x1:String(E.sx),y1:String(E.sy),x2:String(W.sx),y2:String(W.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-x-label",x:String(W.sx+8),y:String(W.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let z=x(-w,$,0);A.push(o("line",{key:"axis-y",x1:String(E.sx),y1:String(E.sy),x2:String(z.sx),y2:String(z.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-y-label",x:String(z.sx-12),y:String(z.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let B=g.maxHeight+(t.length-1)*b,O=x(-w,-$,B);return A.push(o("line",{key:"axis-z",x1:String(E.sx),y1:String(E.sy),x2:String(O.sx),y2:String(O.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-z-label",x:String(O.sx-4),y:String(O.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),A},[u,g,t.length,b,x]),T=S(()=>{let A=[],k=g.maxCols/2,w=g.maxRows/2,$=[];for(let E=0;E<t.length;E++){let W=t[E],z=W.color??m[E%m.length],B=W.opacity??.7,O=E*b,_=W.data.length;for(let U=0;U<_-1;U++){let X=W.data[U],ee=W.data[U+1],Z=Math.min(X.length,ee.length);for(let V=0;V<Z-1;V++){let j=V-k,H=V+1-k,Y=U-w,K=U+1-w,Q=(X[V]??0)+O,se=(X[V+1]??0)+O,J=(ee[V]??0)+O,ae=(ee[V+1]??0)+O,de=x(j,Y,Q),le=x(H,Y,se),ne=x(j,K,J),fe=x(H,K,ae),oe=(de.depth+le.depth+ne.depth+fe.depth)/4,ie=`${de.sx},${de.sy} ${le.sx},${le.sy} ${fe.sx},${fe.sy} ${ne.sx},${ne.sy}`;$.push({points:ie,fill:Fi(z,B),stroke:Ni(z,.7),strokeWidth:"0.5",depth:oe,key:`quad-${E}-${U}-${V}`})}}if(_===1||_>0&&W.data[0].length===1)for(let U=0;U<_;U++){let X=W.data[U];for(let ee=0;ee<X.length;ee++){let Z=ee-k,V=U-w,j=(X[ee]??0)+O,H=x(Z,V,j),Y=3,K=`${H.sx},${H.sy-Y} ${H.sx+Y},${H.sy} ${H.sx},${H.sy+Y} ${H.sx-Y},${H.sy}`;$.push({points:K,fill:Fi(z,B),stroke:Ni(z,.7),strokeWidth:"0.5",depth:H.depth,key:`point-${E}-${U}-${ee}`})}}}$.sort((E,W)=>E.depth-W.depth);for(let E=0;E<$.length;E++){let W=$[E];A.push(o("polygon",{key:W.key,points:W.points,fill:W.fill,stroke:W.stroke,"stroke-width":W.strokeWidth,"stroke-linejoin":"round"}))}return A},[t,g,b,m,x]),D=S(()=>{let A=[],k=g.maxCols/2,w=g.maxRows/2;for(let $=0;$<=g.maxRows;$++){let E=$-w,W=x(-k,E,0),z=x(k,E,0);A.push(o("line",{key:`base-h-${$}`,x1:String(W.sx),y1:String(W.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let $=0;$<=g.maxCols;$++){let E=$-k,W=x(E,-w,0),z=x(E,w,0);A.push(o("line",{key:`base-v-${$}`,x1:String(W.sx),y1:String(W.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return A},[g,c,x]),C=S(()=>{if(!d)return[];let A=[],k=g.maxCols/2,w=g.maxRows/2;for(let $=0;$<t.length;$++){let E=t[$],W=$*b,z=0,B=0;for(let X=0;X<E.data.length;X++){let ee=E.data[X];for(let Z=0;Z<ee.length;Z++)z+=ee[Z]??0,B++}let O=B>0?z/B:0,_=x(k+1,0,O+W),U=E.color??m[$%m.length];A.push(o("text",{key:`layer-label-${$}`,x:String(_.sx+8),y:String(_.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:U},E.label))}return A},[d,t,g,b,m,x]),L=S(()=>f?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,n])(),I=D(),M=v(),F=T(),R=C(),N=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...N,...I,...M,...F,...R)}function Zc(e){if(typeof e=="string")return e;if(!isFinite(e)||isNaN(e))return"--";let t=e.toString().split("."),n=t[0],r=t.length>1?"."+t[1]:"",i=n.startsWith("-"),s=i?n.slice(1):n,a="";for(let l=0;l<s.length;l++)l>0&&(s.length-l)%3===0&&(a+=","),a+=s[l];return(i?"-":"")+a+r}function Jc(e){if(!isFinite(e)||isNaN(e))return"--";let t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}function Bi(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:b="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:f="#ffffff"}=e,g=q(()=>Zc(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),h=l!=null&&l.length>1,p=n!=null&&n.length>0,x=y&&s>=0?m:c,v=20,T=p?u*.38:u*.45,D=Math.min(d*.15,48),C=D*.55,P=T+D*.4+8,L=p?P+22:T+D*.4+22,I=h?Math.min(u*.22,36):0,M=u-v-I,F=d-v*2,R=S(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:f,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,f]),N=S(()=>{let _=[],U=r+g+i;return _.push(o("text",{key:"value",x:String(d/2),y:String(T),"text-anchor":"middle","dominant-baseline":"central","font-size":String(D),"font-weight":"bold","font-family":"sans-serif",fill:b,"aria-label":`Value: ${U}`},r?o("tspan",{key:"prefix","font-size":String(C),"font-weight":"normal"},r):null,g,i?o("tspan",{key:"suffix","font-size":String(C),"font-weight":"normal"},i):null)),_},[d,T,D,C,g,r,i,b]),A=S(()=>p?[o("text",{key:"label",x:String(d/2),y:String(P),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[p,d,P,n]),k=S(()=>{if(!y)return[];let _=[],U=s,X=U>=0,ee=8,Z=Jc(U),V=(X?"+":"-")+Z+(a?" "+a:""),j=d/2-40,H=L;if(X){let Y=`${j},${H} ${j-ee/2},${H+ee} ${j+ee/2},${H+ee}`;_.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}else{let Y=`${j},${H+ee} ${j-ee/2},${H} ${j+ee/2},${H}`;_.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}return _.push(o("text",{key:"trend-text",x:String(j+ee+4),y:String(H+ee*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${V}`},V)),_},[y,s,a,x,d,L]),w=S(()=>{if(!h)return[];let _=[],U=l,X=[];for(let Q of U)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&X.push(Q);if(X.length<2)return[];let ee=1/0,Z=-1/0;for(let Q of X)Q<ee&&(ee=Q),Q>Z&&(Z=Q);ee===Z&&(ee-=1,Z+=1);let V=Z-ee,j=F/(X.length-1),H="";for(let Q=0;Q<X.length;Q++){let se=v+Q*j,J=M+I-(X[Q]-ee)/V*I;Q===0?H+=`M ${se} ${J}`:H+=` L ${se} ${J}`}let Y=v+(X.length-1)*j,K=H+` L ${Y} ${M+I} L ${v} ${M+I} Z`;return _.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),_.push(o("path",{key:"spark-fill",d:K,fill:"url(#sparkGrad)"})),_.push(o("path",{key:"spark-line",d:H,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),_},[h,l,F,M,I,v]),$=R(),E=N(),W=A(),z=k(),B=w(),O=`${r}${g}${i}${p?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${d} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":O,style:{fontFamily:"sans-serif"}},...$,...B,...E,...W,...z)}var Ut=Math.PI/180;function Qc(e,t,n,r,i,s,a,l){let d=Math.cos(r*Ut),u=Math.sin(r*Ut),b=Math.cos(i*Ut),m=Math.sin(i*Ut),c=e*b+n*m,f=-e*m+n*b,g=t*d-f*u,y=t*u+f*d;return{sx:s+c*l,sy:a-g*l,depth:y}}function gt(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function jt(e,t,n){let r=Math.sqrt(e*e+t*t+n*n);if(r<1e-10)return{theta:0,phi:0};let i=e/r,s=t/r,a=n/r,l=Math.acos(Math.max(-1,Math.min(1,a))),d=Math.atan2(s,i);return{theta:l,phi:d<0?d+2*Math.PI:d}}function Ke(e,t,n){let{x:r,y:i,z:s}=gt(e),a=Math.cos(n),l=Math.sin(n),d,u,b;return t==="x"?(d=r,u=i*a-s*l,b=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,b=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,b=s),jt(d,u,b)}function Bn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return Ke(e,"x",Math.PI);case"Y":return Ke(e,"y",Math.PI);case"Z":return Ke(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=gt(e);return jt(s,-i,r)}case"S":return Ke(e,"z",Math.PI/2);case"T":return Ke(e,"z",Math.PI/4);case"Rx":return Ke(e,"x",n);case"Ry":return Ke(e,"y",n);case"Rz":return Ke(e,"z",n)}}function Oi(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:b=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:f=!0,trailMaxPoints:g=200,trailColor:y="#ef4444",wireframeColor:h="#cbd5e1",vectorColor:p="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:T,onStateChange:D}=e,[C,P]=G(t??{theta:0,phi:0}),[L,I]=G(s),[M,F]=G(a),[R,N]=G(l),A=te([]),k=te(!1),w=te(null),$=te(null);re(()=>{t&&P(t)},[t?.theta,t?.phi]);let E=te(0);re(()=>{if(!n||n.length===0)return;E.current=0;let j=0,H=()=>{E.current>=n.length||(P(Y=>{let K=Bn(Y,n[E.current]);return E.current++,D&&D(K),K}),j=requestAnimationFrame(H))};return j=requestAnimationFrame(H),()=>cancelAnimationFrame(j)},[n]),re(()=>{let j=gt(C);A.current.push(j),A.current.length>g&&A.current.splice(0,A.current.length-g)},[C.theta,C.phi]);let W=v*R,z=r/2,B=i/2,O=S((j,H,Y)=>Qc(j,H,Y,M,L,z,B,W),[M,L,z,B,W]),_=S(j=>{if(!d)return;let H=j;k.current=!0,w.current={mx:H.clientX,my:H.clientY,rx:M,ry:L}},[d,M,L]),U=S(j=>{if(!k.current||!w.current)return;let H=j,Y=w.current;I(Y.ry+(H.clientX-Y.mx)*.5),F(Y.rx-(H.clientY-Y.my)*.5)},[]),X=S(()=>{k.current=!1},[]),ee=S(j=>{if(!u)return;let H=j;H.preventDefault(),N(Y=>Math.max(.5,Math.min(3,Y*(H.deltaY>0?.95:1.05))))},[u]),Z=[];if(x&&Z.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),T&&Z.push(o("text",{key:"title",x:String(z),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},T)),c){let H=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,J=O(Math.cos(se),Math.sin(se),0);H.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"eq",d:H.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.5"}));let Y=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,J=O(Math.cos(se),0,Math.sin(se));Y.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"xz",d:Y.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}));let K=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,J=O(0,Math.cos(se),Math.sin(se));K.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"yz",d:K.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}))}let V=[{id:"x",dir:[1,0,0],color:"#ef4444"},{id:"y",dir:[0,1,0],color:"#22c55e"},{id:"z",dir:[0,0,1],color:"#3b82f6"}];for(let j of V){let H=O(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),Y=O(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),K=O(0,0,0);Z.push(o("line",{key:`axis-${j.id}`,x1:String(Y.sx),y1:String(Y.sy),x2:String(H.sx),y2:String(H.sy),stroke:j.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(m){let j=[{text:"|0\u27E9",pos:[0,0,1.3]},{text:"|1\u27E9",pos:[0,0,-1.3]},{text:"|+\u27E9",pos:[1.3,0,0]},{text:"|-\u27E9",pos:[-1.3,0,0]},{text:"|+i\u27E9",pos:[0,1.3,0]},{text:"|-i\u27E9",pos:[0,-1.3,0]}];for(let H of j){let Y=O(H.pos[0],H.pos[1],H.pos[2]);Z.push(o("text",{key:`lbl-${H.text}`,x:String(Y.sx),y:String(Y.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},H.text))}}if(f&&A.current.length>1){let j=A.current,H=[];for(let Y=0;Y<j.length;Y++){let K=j[Y],Q=O(K.x,K.y,K.z);H.push(`${Y===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}Z.push(o("path",{key:"trail",d:H.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(b){let j=gt(C),H=O(0,0,0),Y=O(j.x,j.y,j.z);Z.push(o("line",{key:"vec-line",x1:String(H.sx),y1:String(H.sy),x2:String(Y.sx),y2:String(Y.sy),stroke:p,"stroke-width":"2.5","stroke-linecap":"round"})),Z.push(o("circle",{key:"vec-point",cx:String(Y.sx),cy:String(Y.sy),r:"5",fill:p,stroke:"#fff","stroke-width":"1.5"}));let K=(C.theta*180/Math.PI).toFixed(0),Q=(C.phi*180/Math.PI).toFixed(0);Z.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`\u03B8=${K}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:$,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":T??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?_:void 0,onMouseMove:d?U:void 0,onMouseUp:d?X:void 0,onMouseLeave:d?X:void 0,onWheel:u?ee:void 0},...Z)}function ed(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];typeof r=="number"&&isFinite(r)&&!isNaN(r)&&t.push(r)}return t.sort((n,r)=>n-r),t}function On(e,t){if(e.length===0)return 0;if(e.length===1)return e[0];let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);if(r===i)return e[r];let s=n-r;return e[r]+s*(e[i]-e[r])}function Hn(e){let t=ed(e);if(t.length===0)return null;let n=On(t,25),r=On(t,50),i=On(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let f of t)if(f>=a){d=f;break}let u=t[t.length-1];for(let f=t.length-1;f>=0;f--)if(t[f]<=l){u=t[f];break}let b=0;for(let f of t)b+=f;let m=b/t.length,c=[];for(let f of t)(f<a||f>l)&&c.push(f);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:m,outliers:c,min:t[0],max:t[t.length-1]}}function td(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Hi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:b,padding:m=60}=e,c=i==="vertical",f=n-m*2,g=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],h=q(()=>{let w=[];for(let $ of t)w.push(Hn($.values));return w},[t]),p=q(()=>{let w=1/0,$=-1/0;for(let z of h){if(z===null)continue;let B=s&&z.outliers.length>0?Math.min(z.whiskerLow,z.outliers[0]):z.whiskerLow,O=s&&z.outliers.length>0?Math.max(z.whiskerHigh,z.outliers[z.outliers.length-1]):z.whiskerHigh;B<w&&(w=B),O>$&&($=O)}isFinite(w)||(w=0,$=1);let E=$-w,W=E>0?E*.05:.5;return{min:w-W,max:$+W}},[h,s]),x=c?g:f,v=c?f:g,T=t.length>0?t.length:1,D=v/T,C=D*Math.min(Math.max(d,.1),.95),P=S(w=>{let $=p.max-p.min;return $===0?x/2:(w-p.min)/$*x},[p,x]),L=S(()=>{if(!u)return[];let w=[],$=p.max-p.min,E=td($),W=Math.ceil(p.min/E)*E;for(let z=W;z<=p.max;z+=E){let B=P(z),O=String(Math.round(z*1e3)/1e3);if(c){let _=m+g-B;w.push(o("line",{key:`grid-${z}`,x1:String(m),y1:String(_),x2:String(m+f),y2:String(_),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(m-6),y:String(_+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},O))}else{let _=m+B;w.push(o("line",{key:`grid-${z}`,x1:String(_),y1:String(m),x2:String(_),y2:String(m+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(_),y:String(m+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},O))}}return w},[u,p,P,c,m,f,g]),I=S(()=>{let w=[];return w.push(o("line",{key:"axis-value",x1:String(m),y1:String(c?m:m+g),x2:String(m),y2:String(m+g),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-category",x1:String(m),y1:String(m+g),x2:String(m+f),y2:String(m+g),stroke:"#374151","stroke-width":"1.5"})),w},[m,f,g,c]),M=S(()=>{let w=[];for(let $=0;$<t.length;$++){let E=h[$];if(E===null)continue;let W=t[$],z=W.color??y[$%y.length],B=D*$+D/2,O=C/2;if(c){let _=m+g-P(E.q1),U=m+g-P(E.q3),X=m+g-P(E.median),ee=m+g-P(E.whiskerLow),Z=m+g-P(E.whiskerHigh),V=m+B;w.push(o("line",{key:`wl-${$}`,x1:String(V),y1:String(_),x2:String(V),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${$}`,x1:String(V-O*.4),y1:String(ee),x2:String(V+O*.4),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${$}`,x1:String(V),y1:String(U),x2:String(V),y2:String(Z),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${$}`,x1:String(V-O*.4),y1:String(Z),x2:String(V+O*.4),y2:String(Z),stroke:l,"stroke-width":"1.5"}));let j=Math.min(_,U),H=Math.abs(_-U);if(w.push(o("rect",{key:`box-${$}`,x:String(V-O),y:String(j),width:String(C),height:String(Math.max(H,1)),fill:z,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${W.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${$}`,x1:String(V-O),y1:String(X),x2:String(V+O),y2:String(X),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+g-P(E.mean);w.push(o("circle",{key:`mean-${$}`,cx:String(V),cy:String(Y),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<E.outliers.length;Y++){let K=m+g-P(E.outliers[Y]);w.push(o("circle",{key:`out-${$}-${Y}`,cx:String(V),cy:String(K),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}w.push(o("text",{key:`cat-${$}`,x:String(V),y:String(m+g+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},W.label))}else{let _=m+P(E.q1),U=m+P(E.q3),X=m+P(E.median),ee=m+P(E.whiskerLow),Z=m+P(E.whiskerHigh),V=m+B;w.push(o("line",{key:`wl-${$}`,x1:String(_),y1:String(V),x2:String(ee),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${$}`,x1:String(ee),y1:String(V-O*.4),x2:String(ee),y2:String(V+O*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${$}`,x1:String(U),y1:String(V),x2:String(Z),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${$}`,x1:String(Z),y1:String(V-O*.4),x2:String(Z),y2:String(V+O*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(_,U),H=Math.abs(U-_);if(w.push(o("rect",{key:`box-${$}`,x:String(j),y:String(V-O),width:String(Math.max(H,1)),height:String(C),fill:z,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${W.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${$}`,x1:String(X),y1:String(V-O),x2:String(X),y2:String(V+O),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+P(E.mean);w.push(o("circle",{key:`mean-${$}`,cx:String(Y),cy:String(V),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<E.outliers.length;Y++){let K=m+P(E.outliers[Y]);w.push(o("circle",{key:`out-${$}-${Y}`,cx:String(K),cy:String(V),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}w.push(o("text",{key:`cat-${$}`,x:String(m-6),y:String(V+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},W.label))}}return w},[t,h,P,c,m,f,g,D,C,l,s,a,y]),F=S(()=>b?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,n,m]),R=L(),N=I(),A=M(),k=F();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Box plot",style:{fontFamily:"sans-serif"}},...k,...R,...N,...A)}function _i(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function nd(e,t,n){return e<t?t:e>n?n:e}function _n(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function Yi(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:b=4,defaultColor:m="#3b82f6",opacity:c=.7,title:f,padding:g=60}=e,y=q(()=>{let A=[];for(let k=0;k<t.length;k++){let w=t[k];_n(w.x)&&_n(w.y)&&_n(w.r)&&A.push(w)}return A},[t]),h=n-g*2,p=r-g*2,x=q(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let A=1/0,k=-1/0,w=1/0,$=-1/0,E=1/0,W=-1/0;for(let z of y)z.x<A&&(A=z.x),z.x>k&&(k=z.x),z.y<w&&(w=z.y),z.y>$&&($=z.y),z.r<E&&(E=z.r),z.r>W&&(W=z.r);return A===k&&(A-=1,k+=1),w===$&&(w-=1,$+=1),E===W&&(E=0,W=W>0?W:1),{xMin:A,xMax:k,yMin:w,yMax:$,rMin:E,rMax:W}},[y]),v=S(A=>{let k=x.xMax-x.xMin;return g+(A-x.xMin)/k*h},[x,g,h]),T=S(A=>{let k=x.yMax-x.yMin;return g+p-(A-x.yMin)/k*p},[x,g,p]),D=S(A=>{let k=x.rMax-x.rMin;if(k===0)return(b+u)/2;let w=(A-x.rMin)/k;return b+w*(u-b)},[x,b,u]),C=S(()=>{if(!a)return[];let A=[],k=_i(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let W=w;W<=x.xMax;W+=k){let z=v(W);A.push(o("line",{key:`grid-x-${W}`,x1:String(z),y1:String(g),x2:String(z),y2:String(g+p),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-xlabel-${W}`,x:String(z),y:String(g+p+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(W*1e3)/1e3)))}let $=_i(x.yMax-x.yMin),E=Math.ceil(x.yMin/$)*$;for(let W=E;W<=x.yMax;W+=$){let z=T(W);A.push(o("line",{key:`grid-y-${W}`,x1:String(g),y1:String(z),x2:String(g+h),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-ylabel-${W}`,x:String(g-6),y:String(z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(W*1e3)/1e3)))}return A},[a,x,v,T,g,h,p]),P=S(()=>{if(!l)return[];let A=[];return A.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+p),stroke:"#374151","stroke-width":"1.5"})),A.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+p),x2:String(g+h),y2:String(g+p),stroke:"#374151","stroke-width":"1.5"})),i&&A.push(o("text",{key:"x-label",x:String(g+h/2),y:String(g+p+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&A.push(o("text",{key:"y-label",x:String(g-40),y:String(g+p/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${g-40}, ${g+p/2})`},s)),A},[l,g,h,p,i,s]),L=S(()=>{let A=[];for(let k=0;k<y.length;k++){let w=y[k],$=v(w.x),E=T(w.y),W=nd(D(w.r),b,u),z=w.color??m;A.push(o("circle",{key:`bubble-${k}`,cx:String($),cy:String(E),r:String(W),fill:z,opacity:String(c),stroke:z,"stroke-width":"1","stroke-opacity":"0.8","aria-label":w.label??`Bubble at (${w.x}, ${w.y}) size ${w.r}`,role:"img"})),d&&w.label&&A.push(o("text",{key:`label-${k}`,x:String($),y:String(E-W-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return A},[y,v,T,D,m,c,d,b,u]),I=S(()=>f?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,n,g]),M=C(),F=P(),R=L(),N=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Bubble chart",style:{fontFamily:"sans-serif"}},...N,...M,...F,...R)}var od=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function id(e){let t=e.split("-");return t.length!==3?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function Vi(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function Ui(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function sd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function ad(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Ui(t[i]),l=Ui(t[i+1]);return sd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var ld=["#9be9a8","#40c463","#30a14e","#216e39"];function ji(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=ld,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:b}=e,{dateMap:m,startDate:c,endDate:f,maxVal:g}=q(()=>{let R=new Map,N=0,A=null,k=null;for(let E of t){let W=id(E.date);if(isNaN(W.getTime()))continue;let z=Vi(W);R.set(z,(R.get(z)??0)+E.value);let B=R.get(z);B>N&&(N=B),(A===null||W<A)&&(A=W),(k===null||W>k)&&(k=W)}if(A===null||k===null){let E=new Date;A=new Date(E.getFullYear(),0,1),k=new Date(E.getFullYear(),11,31)}let w=new Date(A);w.setDate(w.getDate()-w.getDay());let $=new Date(k);return $.setDate($.getDate()+(6-$.getDay())),{dateMap:R,startDate:w,endDate:$,maxVal:N>0?N:1}},[t]),y=d?30:0,h=l?16:0,p=b?28:0,x=y+10,v=p+h+4,T=S(()=>{let R=[],N=new Date(c),A=0;for(;N<=f;){let k=N.getDay();k===0&&N>c&&A++;let w=Vi(N),$=m.get(w),E=$!==void 0&&$>0?ad($/g,i):u,W=x+A*(s+a),z=v+k*(s+a);R.push(o("rect",{key:`day-${w}`,x:String(W),y:String(z),width:String(s),height:String(s),rx:"2",ry:"2",fill:E,"aria-label":`${w}: ${$??0}`})),N.setDate(N.getDate()+1)}return R},[c,f,m,g,i,u,s,a,x,v]),D=S(()=>{if(!l)return[];let R=[],N=new Date(c),A=0,k=-1;for(;N<=f;){let w=N.getDay();w===0&&N>c&&A++;let $=N.getMonth();if($!==k&&w===0){k=$;let E=x+A*(s+a);R.push(o("text",{key:`month-${A}`,x:String(E),y:String(p+h-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},od[$]))}N.setDate(N.getDate()+1)}return R},[l,c,f,s,a,x,p,h]),C=S(()=>{if(!d)return[];let R=[],N=[1,3,5];for(let A of N){let k=v+A*(s+a)+s/2;R.push(o("text",{key:`day-label-${A}`,x:String(y),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},rd[A]))}return R},[d,s,a,v,y]),P=S(()=>b?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},b)]:[],[b,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let L=P(),I=D(),M=C(),F=T();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...I,...M,...F)}var cd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ue(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function dd(e,t,n,r,i,s){let a=Ue(e,t,n,i),l=Ue(e,t,n,s),d=Ue(e,t,r,i),u=Ue(e,t,r,s),m=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${m} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${m} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function ud(e,t,n,r,i,s,a){let l=Ue(e,t,n,r),d=Ue(e,t,n,i),u=Ue(e,t,n,s),b=Ue(e,t,n,a),m=i-r,c=a-s,f=m>Math.PI?1:0,g=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${f} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${g} 1 ${b.x} ${b.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function pd(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let f=0;for(let g=0;g<i;g++){let y=e[c]?.[g]??0;f+=Math.max(0,y)}s.push(f),a+=f}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),f=[],g=0;for(let y=0;y<i;y++)f.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:g,endAngle:g+c,value:0}),g+=c+r;return{groups:f,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let f=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+f,value:s[c]}),u+=f+r}let b=[];for(let c=0;c<i;c++)b.push(d[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let f=c;f<i;f++){let g=Math.max(0,e[c]?.[f]??0),y=c===f?0:Math.max(0,e[f]?.[c]??0);if(g===0&&y===0)continue;let h=g+y,p=s[c]>0?g/a*l:0,x=b[c],v=x+p;b[c]=v;let T=s[f]>0?g/a*l:0,D=b[f],C=D+T;if(b[f]=C,c===f){g>0&&m.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:D,targetEndAngle:C,value:g,color:d[c].color});continue}let P=s[f]>0?y/a*l:0,I=b[f]+P;b[f]=I;let M=s[c]>0?y/a*l:0,R=b[c]+M;b[c]=R,(g>0||y>0)&&m.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:D,targetEndAngle:Math.max(C,D+.001),value:h,color:d[c].color})}return{groups:d,chords:m}}function Gi(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=cd,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:b=.9,title:m}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,f=i/2,g=Math.min(r,i)/2-40,y=g*Math.max(.5,Math.min(.99,b)),h=g+16,p=q(()=>pd(t,n,s,a),[t,n,s,a]),x=S(()=>{let L=[];for(let I=0;I<p.groups.length;I++){let M=p.groups[I];if(M.endAngle-M.startAngle<.001)continue;let R=dd(c,f,g,y,M.startAngle,M.endAngle);if(L.push(o("path",{key:`arc-${I}`,d:R,fill:M.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${M.label}: ${M.value}`})),l){let N=(M.startAngle+M.endAngle)/2,A=Ue(c,f,h,N),$=((N-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,E=$?"start":"end",W=N*180/Math.PI-90;$||(W+=180);let z=d?`${M.label} (${M.value})`:M.label;L.push(o("text",{key:`label-${I}`,x:String(A.x),y:String(A.y),"text-anchor":E,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${W}, ${A.x}, ${A.y})`,"dominant-baseline":"central","pointer-events":"none"},z))}}return L},[p,c,f,g,y,h,l,d]),v=S(()=>{let L=[];for(let I=0;I<p.chords.length;I++){let M=p.chords[I],F=ud(c,f,y,M.sourceStartAngle,M.sourceEndAngle,M.targetStartAngle,M.targetEndAngle);L.push(o("path",{key:`ribbon-${I}`,d:F,fill:M.color,"fill-opacity":String(u),stroke:M.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[p,c,f,y,u]),T=S(()=>m?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,r]),D=v(),C=x(),P=T();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Chord diagram",style:{fontFamily:"sans-serif"}},...P,...D,...C)}var fd=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function gd(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],b=[];for(let m=0;m<u.length;m++)b.push(n+r.length+m);t.push({id:d,node:s,depth:a,parentId:l,childIndices:b});for(let m=0;m<u.length;m++)r.push([u[m],a+1,d])}return{flatNodes:t,maxDepth:i}}function md(e){let t=e.length,n=new Array(t).fill(0);for(let r=t-1;r>=0;r--){let i=e[r];if(i.childIndices.length===0)n[r]=1;else{let s=0;for(let a of i.childIndices)a<t&&(s+=n[a]);n[r]=Math.max(s,1)}}return n}function hd(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=gd(e);if(d.length===0)return[];let b=md(d),m=t-s*2,c=n-s*2,f=a==="horizontal",g=u+1,y=f?g>1?(m-r)/u:0:g>1?(c-i)/u:0,h=new Array(d.length),p=b[0],x=f?c:m,v=p>0?x/p:x,T=new Array(d.length);T[0]=[0,p];let D=[0],C=0;for(;C<D.length;){let P=D[C];C++;let L=d[P],[I,M]=T[P],F=(I+M)/2,R=s+L.depth*y,N=s+(F-.5)*v,A=f?R:N,k=f?N:R,w=L.node.color??l[L.depth%l.length];h[P]={id:L.id,label:L.node.label,value:L.node.value!==void 0?String(L.node.value):"",color:w,depth:L.depth,x:A,y:k,parentId:L.parentId,childCount:L.childIndices.length,subtreeLeafCount:b[P]};let $=I;for(let E of L.childIndices)if(E<d.length){let W=b[E],z=$+W;T[E]=[$,z],$=z,D.push(E)}}return h}function Xi(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:b=fd,title:m,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let f=i==="horizontal",g=q(()=>hd(t,n,r,s,a,c,i,b),[t,n,r,s,a,c,i,b]),y=q(()=>{let C=new Map;for(let P=0;P<g.length;P++){let L=g[P];C.set(L.id,L)}return C},[g]),h=S(()=>{if(!d)return[];let C=[];for(let P=0;P<g.length;P++){let L=g[P];if(L.parentId===null)continue;let I=y.get(L.parentId);if(!I)continue;let M,F,R,N;f?(M=I.x+s,F=I.y+a/2,R=L.x,N=L.y+a/2):(M=I.x+s/2,F=I.y+a,R=L.x+s/2,N=L.y);let A=(M+R)/2,k=(F+N)/2,w;f?w=`M ${M} ${F} C ${A} ${F}, ${A} ${N}, ${R} ${N}`:w=`M ${M} ${F} C ${M} ${k}, ${R} ${k}, ${R} ${N}`,C.push(o("path",{key:`conn-${P}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[g,y,f,s,a,d,u]),p=S(()=>{let C=[];for(let P=0;P<g.length;P++){let L=g[P];C.push(o("rect",{key:`node-rect-${L.id}`,x:String(L.x),y:String(L.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:L.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":L.value?`${L.label}: ${L.value}`:L.label}));let I=l&&L.value?L.y+a/2-2:L.y+a/2+4;C.push(o("text",{key:`node-label-${L.id}`,x:String(L.x+s/2),y:String(I),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},L.label)),l&&L.value&&C.push(o("text",{key:`node-value-${L.id}`,x:String(L.x+s/2),y:String(L.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},L.value))}return C},[g,s,a,l]),x=S(()=>m?[o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n]),v=h(),T=p(),D=x();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Decomposition tree",style:{fontFamily:"sans-serif"}},...D,...v,...T)}var qi=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function bd(e){return qi[e%qi.length]}function Ki(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],b=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??bd(d),x:u.x??r+s*Math.cos(b),y:u.y??i+s*Math.sin(b),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function Zi(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let b=Math.sqrt(u),m=l/b,c=d/b,f=n-b;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*f,a.y+=c*f):a.fixed?(i.x-=m*f,i.y-=c*f):(i.x-=m*f*.5,i.y-=c*f*.5,a.x+=m*f*.5,a.y+=c*f*.5);let g=i.vx-a.vx,y=i.vy-a.vy,h=g*m+y*c;h<=0||(i.fixed?(a.vx+=h*m,a.vy+=h*c):a.fixed?(i.vx-=h*m,i.vy-=h*c):(i.vx-=h*m,i.vy-=h*c,a.vx+=h*m,a.vy+=h*c))}}}function xd(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let b=new Map;for(let x=0;x<u;x++)b.set(e[x].id,x);let m=new Float64Array(u),c=new Float64Array(u);for(let x=0;x<u;x++){let v=e[x];for(let T=x+1;T<u;T++){let D=e[T],C=v.x-D.x,P=v.y-D.y,L=C*C+P*P;L<1&&(L=1);let I=Math.sqrt(L),M=i/L,F=C/I*M,R=P/I*M;m[x]+=F,c[x]+=R,m[T]-=F,c[T]-=R}}for(let x=0;x<t.length;x++){let v=t[x],T=b.get(v.source),D=b.get(v.target);if(T===void 0||D===void 0)continue;let C=e[T],P=e[D],L=P.x-C.x,I=P.y-C.y,M=Math.sqrt(L*L+I*I);if(M<.1)continue;let F=v.weight??1,R=M-l,N=s*R*F,A=L/M*N,k=I/M*N;m[T]+=A,c[T]+=k,m[D]-=A,c[D]-=k}let f=n/2,g=r/2,y=.001;for(let x=0;x<u;x++){let v=e[x];m[x]+=(f-v.x)*y,c[x]+=(g-v.y)*y}let h=20,p=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){p.push({...v,vx:0,vy:0});continue}let T=(v.vx+m[x])*a,D=(v.vy+c[x])*a,C=Math.sqrt(T*T+D*D),P=10;C>P&&(T=T/C*P,D=D/C*P);let L=v.x+T,I=v.y+D;L=Math.max(h,Math.min(n-h,L)),I=Math.max(h,Math.min(r-h,I)),p.push({...v,x:L,y:I,vx:T,vy:D})}return Zi(p,d),p}function yd(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.vx*r.vx+r.vy*r.vy}return t}function Ji(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:b=300,attractionForce:m=.01,damping:c=.9,edgeLength:f=100,edgeColor:g="#94a3b8",edgeWidth:y=1.5,title:h,customForce:p,trails:x}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty force-directed graph"},h?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let v=te(Ki(t,r,i)),[T,D]=G(0),C=te(!0),P=te(!1),L=te(n);L.current=n;let I=te(p);I.current=p;let M=te(null),F=te({repulsionForce:b,attractionForce:m,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l});F.current={repulsionForce:b,attractionForce:m,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l};let R=te(new Map);re(()=>{v.current=Ki(t,r,i),P.current=!1,C.current=!0,R.current=new Map,D(se=>se+1)},[t.length]),re(()=>{let se=0,J=()=>{if(!C.current)return;let ae=F.current,de=I.current,le;if(de?(le=de(v.current,L.current,ae.width,ae.height,M.current),ae.solidNodes&&Zi(le,ae.nodeRadius)):le=xd(v.current,L.current,ae.width,ae.height,ae.repulsionForce,ae.attractionForce,ae.damping,ae.edgeLength,ae.nodeRadius),v.current=le,x)for(let ne=0;ne<x.length;ne++){let fe=x[ne],oe=le.find(he=>he.id===fe.nodeId);if(!oe)continue;let ie=R.current.get(fe.nodeId);ie||(ie=[],R.current.set(fe.nodeId,ie)),ie.push({x:oe.x,y:oe.y});let ue=fe.maxPoints??200;ie.length>ue&&ie.splice(0,ie.length-ue)}if(!de&&yd(le)<.01){P.current=!0,D(ne=>ne+1);return}D(ne=>ne+1),se=requestAnimationFrame(J)};return se=requestAnimationFrame(J),()=>{C.current=!1,cancelAnimationFrame(se)}},[]);let N=v.current,A=S(se=>{v.current=v.current.map(J=>J.id===se?{...J,fixed:!J.fixed,vx:0,vy:0}:J),P.current&&(P.current=!1,C.current=!0,D(J=>J+1))},[]),k=te(null),w=te(null),$=S(se=>{let J=se,ae=w.current;if(!ae)return{x:J.clientX,y:J.clientY};let de=ae.getBoundingClientRect(),le=r/de.width,ne=i/de.height;return{x:(J.clientX-de.left)*le,y:(J.clientY-de.top)*ne}},[r,i]),E=te(!1),W=S((se,J)=>{J.stopPropagation(),k.current=se;let ae=v.current.find(de=>de.id===se);E.current=ae?.fixed??!1,v.current=v.current.map(de=>de.id===se?{...de,fixed:!0,vx:0,vy:0}:de)},[]),z=S(se=>{let J=$(se);if(M.current={x:J.x,y:J.y},!k.current)return;let ae=k.current,de=20;v.current=v.current.map(le=>le.id===ae?{...le,x:Math.max(de,Math.min(r-de,J.x)),y:Math.max(de,Math.min(i-de,J.y))}:le),P.current&&(P.current=!1,C.current=!0),D(le=>le+1)},[r,i,$]),B=S(()=>{let se=k.current;se&&(v.current=v.current.map(J=>J.id===se?{...J,fixed:E.current}:J)),k.current=null},[]),O=S(()=>{k.current=null,M.current=null},[]),_=q(()=>{let se=new Map;for(let J=0;J<N.length;J++)se.set(N[J].id,N[J]);return se},[T]),U=S(()=>u?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+s),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:g})))]:[],[u,s,g]),X=S(()=>{let se=[];for(let J=0;J<n.length;J++){let ae=n[J],de=_.get(ae.source),le=_.get(ae.target);if(!de||!le||ae.weight!==void 0&&ae.weight<=0)continue;let ne=ae.weight?Math.max(.5,Math.min(6,y*ae.weight)):y,fe={key:`edge-${J}`,x1:String(de.x),y1:String(de.y),x2:String(le.x),y2:String(le.y),stroke:ae.color??g,"stroke-width":String(ne),"stroke-opacity":"0.6"};u&&(fe["marker-end"]="url(#arrowhead)"),se.push(o("line",fe))}return se},[T,g,y,u]),ee=S(()=>{let se=[];for(let J=0;J<N.length;J++){let ae=N[J];se.push(o("circle",{key:`node-${ae.id}`,cx:String(ae.x),cy:String(ae.y),r:String(s),fill:ae.color,stroke:ae.fixed?"#0f172a":"#fff","stroke-width":ae.fixed?"3":String(a),style:{cursor:k.current===ae.id?"grabbing":"grab"},onMouseDown:de=>W(ae.id,de),onDblClick:()=>A(ae.id),role:"button",tabIndex:0,"aria-label":`Node: ${ae.label}${ae.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&se.push(o("text",{key:`label-${ae.id}`,x:String(ae.x),y:String(ae.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},ae.label))}return se},[T,s,d,A]),Z=S(()=>h?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r]),V=S(()=>{if(!x||x.length===0)return[];let se=[];for(let J=0;J<x.length;J++){let ae=x[J],de=R.current.get(ae.nodeId);if(!de||de.length<2)continue;let le=[];for(let ne=0;ne<de.length;ne++){let fe=de[ne];le.push(`${ne===0?"M":"L"}${fe.x.toFixed(1)},${fe.y.toFixed(1)}`)}se.push(o("path",{key:`trail-${ae.nodeId}`,d:le.join(" "),fill:"none",stroke:ae.color??"#3b82f6","stroke-width":String(ae.width??1),opacity:String(ae.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return se},[T,x]),j=U(),H=V(),Y=X(),K=ee(),Q=Z();return o("svg",{ref:w,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:z,onMouseUp:B,onMouseLeave:O},...j,...Q,...H,...Y,...K)}var Qi=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function es(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:s=!0,showValues:a=!0,showPercentage:l=!0,gapSize:d=2,colors:u=Qi,title:b}=e,m=i==="vertical",c=b?30:0,f=120,g=q(()=>{let L=0;for(let I=0;I<t.length;I++)t[I].value>L&&(L=t[I].value);return L>0?L:1},[t]),y=S(L=>g===0?0:Math.max(.05,L/g),[g]),h=S((L,I)=>I||(u[L%u.length]??Qi[0]),[u]),p=S(()=>{if(t.length===0)return[];let L=[],I=40,M=n-I*2-f,F=r-c-I*2,R=d*(t.length-1),N=Math.max(1,(F-R)/t.length),A=I+M/2;for(let k=0;k<t.length;k++){let w=t[k],$=k<t.length-1?t[k+1]:null,E=h(k,w.color),W=y(w.value),z=$!==null?y($.value):W*.6,B=M/2*W,O=M/2*z,_=c+I+k*(N+d),U=A-B,X=A+B,ee=A+O,Z=A-O,V=`${U},${_} ${X},${_} ${ee},${_+N} ${Z},${_+N}`;L.push(o("polygon",{key:`section-${k}`,points:V,fill:E,stroke:"#fff","stroke-width":"1"}));let j=I+M+12,H=_+N/2;if(s&&L.push(o("text",{key:`label-${k}`,x:String(j),y:String(H-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let Y="";if(a&&(Y=String(w.value)),l&&t.length>0){let K=t[0].value,Q=K>0?Math.round(w.value/K*100):0;Y+=a?` (${Q}%)`:`${Q}%`}L.push(o("text",{key:`value-${k}`,x:String(j),y:String(H+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},Y))}}return L},[t,n,r,c,d,s,a,l,h,y,f]),x=S(()=>{if(t.length===0)return[];let L=[],I=40,M=n-I*2,R=r-c-I*2-40,N=d*(t.length-1),A=Math.max(1,(M-N)/t.length),k=c+I+R/2;for(let w=0;w<t.length;w++){let $=t[w],E=w<t.length-1?t[w+1]:null,W=h(w,$.color),z=y($.value),B=E!==null?y(E.value):z*.6,O=R/2*z,_=R/2*B,U=I+w*(A+d),X=k-O,ee=k-_,Z=k+_,V=k+O,j=`${U},${X} ${U+A},${ee} ${U+A},${Z} ${U},${V}`;L.push(o("polygon",{key:`section-${w}`,points:j,fill:W,stroke:"#fff","stroke-width":"1"}));let H=U+A/2,Y=c+I+R+14;if(s&&L.push(o("text",{key:`label-${w}`,x:String(H),y:String(Y),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},$.label)),a||l){let K="";if(a&&(K=String($.value)),l&&t.length>0){let Q=t[0].value,se=Q>0?Math.round($.value/Q*100):0;K+=a?` (${se}%)`:`${se}%`}L.push(o("text",{key:`value-${w}`,x:String(H),y:String(Y+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},K))}}return L},[t,n,r,c,d,s,a,l,h,y]),v=S(()=>b?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,n]),T=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),D=v(),C=m?p():x(),P=T();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Funnel chart",style:{fontFamily:"sans-serif"}},...D,...C,...P)}var ts=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ns(e){if(e<=0)return 1;let t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Sd(e,t){return t||ts[e%ts.length]}function os(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:b,padding:m=50}=e;if(t.length===0)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,f=q(()=>{let F=1/0,R=-1/0;for(let N of t){N.start<F&&(F=N.start);let A=N.start+N.duration;A>R&&(R=A)}return F===1/0&&(F=0,R=1),{min:F,max:R,range:R-F}},[t]),g=q(()=>{let F=t.slice();return F.sort((R,N)=>R.group!==N.group?(R.group??"").localeCompare(N.group??""):R.start-N.start),F},[t]),y=r??m*2+g.length*(i+s)+s+20,h=n-m-c-m,p=m+(b?20:0),x=S(F=>f.range===0?c+m:c+m+(F-f.min)/f.range*h,[f,h,c,m]),v=S(()=>{if(!a)return[];let F=[],R=ns(f.range),N=Math.ceil(f.min/R)*R,A=p+g.length*(i+s)+s;for(let k=N;k<=f.max;k+=R){let w=x(k);F.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(p),x2:String(w),y2:String(A),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return F},[a,f,p,g.length,i,s,x]),T=S(()=>{let F=[],R=ns(f.range),N=Math.ceil(f.min/R)*R,A=p-8;for(let k=N;k<=f.max;k+=R){let w=x(k);F.push(o("text",{key:`taxis-${k}`,x:String(w),y:String(A),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(k)))}return F.push(o("text",{key:"time-unit",x:String(n-m),y:String(A),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),F},[f,p,x,u,n,m]),D=S(()=>{let F=[],R="";for(let N=0;N<g.length;N++){let A=g[N],k=p+N*(i+s)+s,w=x(A.start),$=Math.max(2,x(A.start+A.duration)-w),E=Sd(N,A.color);A.group&&A.group!==R&&(R=A.group,l&&F.push(o("text",{key:`group-${N}`,x:String(m),y:String(k+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},A.group))),F.push(o("rect",{key:`bar-${A.id}`,x:String(w),y:String(k),width:String($),height:String(i),rx:"4",ry:"4",fill:E,role:"graphics-symbol","aria-label":`${A.label}: start ${A.start}, duration ${A.duration}`})),l&&F.push(o("text",{key:`label-${A.id}`,x:String(c+m-8),y:String(k+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},A.label.length>16?A.label.substring(0,14)+"..":A.label)),d&&$>30&&F.push(o("text",{key:`prog-${A.id}`,x:String(w+$/2),y:String(k+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${A.start}-${A.start+A.duration}`))}return F},[g,p,i,s,x,l,d,c,m]),C=S(()=>b?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},b)]:[],[b,n,m]),P=v(),L=T(),I=D(),M=C();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Gantt chart",style:{fontFamily:"sans-serif"}},...M,...P,...L,...I)}var vd=Math.PI/180;function wd(e){return e*vd}function _e(e,t,n,r){let i=wd(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function rs(e,t,n,r,i){let s=_e(e,t,n,i),a=_e(e,t,n,r),l=i-r,d=Math.abs(l)>180?1:0,u=l>0?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} ${u===1?0:1} ${a.x} ${a.y}`}function kd(e,t,n){return e<t?t:e>n?n:e}function et(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function is(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:b=!0,showTicks:m=!0,tickCount:c=10,label:f,unit:g,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:h="#374151",backgroundColor:p="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,T=isFinite(t)&&!isNaN(t)?kd(t,x,v):x,D=(u?24:0)+(f?18:0),C=i/2,P=(s-D)*.6,L=Math.min(i/2,(s-D)*.55)-d/2-10,I=L-d,M=L-d/2,F=l-a,R=S(V=>{let j=v-x;if(j===0)return a;let H=(V-x)/j;return a+H*F},[x,v,a,F]),N=S(()=>{let V=rs(C,P,M,a,l);return[o("path",{key:"bg-arc",d:V,fill:"none",stroke:p,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,P,M,a,l,p,d]),A=S(()=>{if(y.length===0)return[];let V=[],j=F/y.length;for(let H=0;H<y.length;H++){let Y=a+H*j,K=Y+j,Q=rs(C,P,M,Y,K);V.push(o("path",{key:`seg-${H}`,d:Q,fill:"none",stroke:y[H],"stroke-width":String(d),"stroke-linecap":H===0||H===y.length-1?"round":"butt",opacity:"0.85"}))}return V},[y,F,a,C,P,M,d]),k=S(()=>{if(!m||c<=0)return[];let V=[],j=Math.max(1,Math.min(c,100));for(let H=0;H<=j;H++){let Y=H/j,K=a+Y*F,Q=H%2===0,se=Q?10:6,J=_e(C,P,L+4,K),ae=_e(C,P,L+4+se,K);if(V.push(o("line",{key:`tick-${H}`,x1:String(J.x),y1:String(J.y),x2:String(ae.x),y2:String(ae.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let de=x+Y*(v-x),le=_e(C,P,L+4+se+12,K);V.push(o("text",{key:`tick-label-${H}`,x:String(le.x),y:String(le.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},et(de)))}}return V},[m,c,a,F,C,P,L,x,v]),w=S(()=>{let V=[],j=R(T),H=I-8,Y=_e(C,P,H,j),K=6,Q=j+90,se=j-90,J=_e(C,P,K,Q),ae=_e(C,P,K,se);return V.push(o("polygon",{key:"needle",points:`${Y.x},${Y.y} ${J.x},${J.y} ${ae.x},${ae.y}`,fill:h,stroke:"none"})),V.push(o("circle",{key:"needle-cap",cx:String(C),cy:String(P),r:"8",fill:h,stroke:"#fff","stroke-width":"2"})),V},[T,R,C,P,I,h]),$=S(()=>{if(!u)return[];let V=[],j=et(T),H=j+(g?" "+g:""),Y=P+M+20;return V.push(o("text",{key:"value-text",x:String(C),y:String(Y),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${H}`},j,g?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+g):null)),V},[u,T,g,C,P,M]),E=S(()=>{if(!f)return[];let V=P+M+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(V),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},f)]},[f,C,P,M,u]),W=S(()=>{if(!b)return[];let V=[],j=_e(C,P,M,a),H=_e(C,P,M,l);return V.push(o("text",{key:"min-label",x:String(j.x-4),y:String(j.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},et(x))),V.push(o("text",{key:"max-label",x:String(H.x+4),y:String(H.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},et(v))),V},[b,C,P,M,a,l,x,v]),z=N(),B=A(),O=k(),_=w(),U=$(),X=E(),ee=W(),Z=`Gauge: ${et(T)}${g?" "+g:""}, range ${et(x)} to ${et(v)}${f?", "+f:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(T),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":Z,style:{fontFamily:"sans-serif"}},...z,...B,...O,..._,...U,...X,...ee)}var Et={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.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 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 -.8,1.6 -1.2,1.4 .5,1.5 -1.4,1.6 .4,.9 2.3,-1.1 v -1.4 l 3.3,1.9 1.9,.7 1.9,.7 3,3.8 17,3.8 1.4,1 4,.8 .7,.5 2.8,-.2 4.9,.8 1.4,1.5 -1,1 .8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3 z m -49.5,-37.3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function ss(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=q(()=>Object.keys(Et),[]),c=S(p=>{l&&l(p)},[l]),f=S((p,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(p)},[d,u]),g=S((p,x)=>{let v=x.currentTarget;if(v){let T=r[p]??i;v.setAttribute("fill",T)}d&&d(null)},[d,r,i]),y=q(()=>{let p=[];for(let x=0;x<m.length;x++){let v=m[x],T=Et[v],D=r[v]??i,C={key:`state-${v}`,d:T.path,fill:D,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":v,role:"img","aria-label":T.name,style:{cursor:l?"pointer":"default"}};if(l){let L=v;C.onClick=()=>c(L),C.onKeyDown=I=>{(I.key==="Enter"||I.key===" ")&&c(L)},C.tabindex=0,C.role="button",C["aria-label"]=T.name}let P=v;C.onMouseOver=L=>f(P,L),C.onMouseOut=L=>g(P,L),p.push(o("path",C))}return p},[m,r,i,s,a,l,c,f,g]),h=o("title",{key:"map-title"},b);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b,style:{fontFamily:"sans-serif"}},h,...y)}function Yn(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Cd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Md(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Yn(t[i]),l=Yn(t[i+1]);return Cd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Ed(e){let{r:t,g:n,b:r}=Yn(e);return(.299*t+.587*n+.114*r)/255}var Rd=["#3b82f6","#fbbf24","#ef4444"];function as(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Rd,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:b="#fff",cellBorderWidth:m=1,title:c,padding:f=60}=e,g=t.length,y=q(()=>{let k=0;for(let w of t)w.length>k&&(k=w.length);return k},[t]),{minVal:h,maxVal:p}=q(()=>{let k=l??1/0,w=d??-1/0;for(let $ of t)for(let E of $)l===void 0&&E<k&&(k=E),d===void 0&&E>w&&(w=E);return k===1/0&&(k=0),w===-1/0&&(w=1),k===w&&(w=k+1),{minVal:k,maxVal:w}},[t,l,d]),x=c?30:0,v=n?f:20,T=r?f:20,D=i-v-20,C=s-x-T-20,P=y>0?D/y:0,L=g>0?C/g:0,I=S(()=>{let k=[];for(let w=0;w<g;w++){let $=t[w];for(let E=0;E<y;E++){let W=E<$.length?$[E]:0,z=(W-h)/(p-h),B=Md(z,a),O=v+E*P,_=x+20+w*L;if(k.push(o("rect",{key:`cell-${w}-${E}`,x:String(O),y:String(_),width:String(P),height:String(L),fill:B,stroke:b,"stroke-width":String(m)})),u){let U=Ed(B)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${E}`,x:String(O+P/2),y:String(_+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,P*.3,L*.4)),"font-family":"sans-serif",fill:U},String(Math.round(W*100)/100)))}}}return k},[t,g,y,h,p,a,P,L,v,x,u,b,m]),M=S(()=>{let k=[];if(n)for(let w=0;w<g;w++){let $=w<n.length?n[w]:"",E=x+20+w*L+L/2;k.push(o("text",{key:`row-label-${w}`,x:String(v-8),y:String(E),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},$))}if(r)for(let w=0;w<y;w++){let $=w<r.length?r[w]:"",E=v+w*P+P/2,W=x+20+g*L+16;k.push(o("text",{key:`col-label-${w}`,x:String(E),y:String(W),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},$))}return k},[n,r,g,y,P,L,v,x]),F=S(()=>c?[o("text",{key:"title",x:String(i/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},c)]:[],[c,i]);if(g===0||y===0)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map \u2014 no data"},o("text",{x:String(i/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let R=F(),N=I(),A=M();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map",style:{fontFamily:"sans-serif"}},...R,...N,...A)}function Pd(e,t){if(e.length===0)return[];let n=e[0],r=e[0];for(let a=1;a<e.length;a++){let l=e[a];l<n&&(n=l),l>r&&(r=l)}if(n===r)return[{min:n,max:r+1,count:e.length}];let i=(r-n)/t,s=[];for(let a=0;a<t;a++)s.push({min:n+a*i,max:n+(a+1)*i,count:0});for(let a=0;a<e.length;a++){let l=e[a],d=Math.floor((l-n)/i);d>=t&&(d=t-1),s[d].count++}return s}function Id(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Vn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ls(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:b,yLabel:m,padding:c=60}=e,f=Math.max(1,Math.round(n)),g=q(()=>Pd(t,f),[t,f]),y=q(()=>{let R=0;for(let N=0;N<g.length;N++)g[N].count>R&&(R=g[N].count);return R>0?R:1},[g]),h=r-c*2,p=i-c*2,x=S(()=>{if(!l)return[];let R=Id(y),N=[];for(let A=R;A<=y;A+=R){let k=c+p-A/y*p;N.push(o("line",{key:`grid-${A}`,x1:String(c),y1:String(k),x2:String(c+h),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),N.push(o("text",{key:`grid-label-${A}`,x:String(c-8),y:String(k+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(A)))}return N},[l,y,c,h,p]),v=S(()=>{let R=[];return R.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"})),R.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+p),x2:String(c+h),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"})),R},[c,h,p]),T=S(()=>{if(g.length===0)return[];let R=[],N=a*(g.length-1),A=Math.max(1,(h-N)/g.length);for(let k=0;k<g.length;k++){let w=g[k],$=w.count/y*p,E=c+k*(A+a),W=c+p-$;if(R.push(o("rect",{key:`bar-${k}`,x:String(E),y:String(W),width:String(A),height:String($),fill:s})),d&&w.count>0&&R.push(o("text",{key:`val-${k}`,x:String(E+A/2),y:String(W-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(w.count))),g.length<=15||k%2===0||k===g.length-1){let B=(g.length===1,Vn(w.min));R.push(o("text",{key:`xlabel-${k}`,x:String(E+A/2),y:String(c+p+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},B))}}if(g.length>0){let k=g[g.length-1],w=c+h;R.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+p+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Vn(k.max)))}return R},[g,y,a,s,d,c,h,p]),D=S(()=>{let R=[];return u&&R.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),b&&R.push(o("text",{key:"x-label",x:String(c+h/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},b)),m&&R.push(o("text",{key:"y-label",x:String(14),y:String(c+p/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+p/2})`},m)),R},[u,b,m,r,i,c,h,p]),C=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),P=x(),L=v(),I=T(),M=D(),F=C();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Histogram",style:{fontFamily:"sans-serif"}},...M,...P,...L,...I,...F)}function $d(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function cs(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:b=!0,title:m,padding:c=60}=e,f=i==="vertical",g=f?30:0,y=n-c*2,h=r-c*2-g,p=f?h:y,x=f?y:h,v=q(()=>{let k=0;for(let w=0;w<t.length;w++)t[w].value>k&&(k=t[w].value);return k>0?k:1},[t]),T=q(()=>t.length===0?0:x/t.length,[t.length,x]),D=S(()=>{if(!u)return[];let k=$d(v),w=[];for(let $=k;$<=v;$+=k){let E=$/v*p;if(f){let W=c+h-E;w.push(o("line",{key:`grid-${$}`,x1:String(c),y1:String(W),x2:String(c+y),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${$}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}else{let W=c+E;w.push(o("line",{key:`grid-${$}`,x1:String(W),y1:String(c),x2:String(W),y2:String(c+h),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${$}`,x:String(W),y:String(c+h+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}}return w},[u,v,f,c,y,h,p]),C=S(()=>{let k=[];return f?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})):k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+h),x2:String(c+y),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),k},[f,c,y,h]),P=S(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let $=t[w],E=$.value/v*p,W=T*w+T/2,z=$.color??d;if(f){let B=c+W,O=c+h,_=c+h-E;k.push(o("line",{key:`stem-${w}`,x1:String(B),y1:String(O),x2:String(B),y2:String(_),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(B),cy:String(_),r:String(l),fill:z})),b&&k.push(o("text",{key:`val-${w}`,x:String(B),y:String(_-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String($.value)));let U=B,X=c+h+16;k.push(o("text",{key:`cat-${w}`,x:String(U),y:String(X),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${X})`},$.label))}else{let B=c+W,O=c,_=c+E;k.push(o("line",{key:`stem-${w}`,x1:String(O),y1:String(B),x2:String(_),y2:String(B),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(_),cy:String(B),r:String(l),fill:z})),b&&k.push(o("text",{key:`val-${w}`,x:String(_+l+4),y:String(B+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String($.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},$.label))}}return k},[t,v,T,d,l,s,a,b,f,c,y,h,p]),L=S(()=>m?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n,c]),I=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),M=D(),F=C(),R=P(),N=L(),A=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Lollipop chart",style:{fontFamily:"sans-serif"}},...N,...M,...F,...R,...A)}function Un(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Dd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Td(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Un(t[i]),l=Un(t[i+1]);return Dd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function zd(e){let{r:t,g:n,b:r}=Un(e);return(.299*t+.587*n+.114*r)/255}var Ad=["#f0f9ff","#3b82f6","#1e3a8a"];function ds(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Ad,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:b="#e5e7eb",title:m,padding:c=70,symmetric:f=!1}=e,g=r??n,y=i??n,h=t.length,p=q(()=>{let z=0;for(let B of t)B.length>z&&(z=B.length);return z},[t]),x=q(()=>{if(!f||h===0)return t;let z=[],B=Math.max(h,p);for(let O=0;O<B;O++){let _=[];for(let U=0;U<B;U++){let X=t[O],ee=X&&U<X.length?X[U]:0,Z=t[U],V=Z&&O<Z.length?Z[O]:0;ee!==0?_.push(ee):_.push(V)}z.push(_)}return z},[t,f,h,p]),v=x.length,T=q(()=>{let z=0;for(let B of x)B.length>z&&(z=B.length);return z},[x]),{minVal:D,maxVal:C}=q(()=>{let z=1/0,B=-1/0;for(let O of x)for(let _ of O)_<z&&(z=_),_>B&&(B=_);return z===1/0&&(z=0),B===-1/0&&(B=1),z===B&&(B=z+1),{minVal:z,maxVal:B}},[x]),P=m?30:0,L=g?c:20,I=y?c:20,M=s-L-20,F=a-P-I-20,R=T>0?M/T:0,N=v>0?F/v:0,A=S(()=>{let z=[];for(let B=0;B<v;B++){let O=x[B];for(let _=0;_<T;_++){let U=_<O.length?O[_]:0,X=(U-D)/(C-D),ee=Td(X,l),Z=L+_*R,V=P+20+B*N,j=B===_,H=j&&u?"currentColor":b,Y=j&&u?"2":"1";if(z.push(o("rect",{key:`cell-${B}-${_}`,x:String(Z),y:String(V),width:String(R),height:String(N),fill:ee,stroke:H,"stroke-width":Y})),d){let K=zd(ee)>.5?"#111827":"#ffffff",Q=Math.min(12,R*.3,N*.35);z.push(o("text",{key:`val-${B}-${_}`,x:String(Z+R/2),y:String(V+N/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":j&&u?"bold":"normal","font-family":"sans-serif",fill:K},String(Math.round(U*100)/100)))}}}return z},[x,v,T,D,C,l,R,N,L,P,d,u,b]),k=S(()=>{let z=[];if(g)for(let B=0;B<v;B++){let O=B<g.length?g[B]:"",_=P+20+B*N+N/2;z.push(o("text",{key:`row-label-${B}`,x:String(L-8),y:String(_),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O))}if(y)for(let B=0;B<T;B++){let O=B<y.length?y[B]:"",_=L+B*R+R/2,U=P+20+v*N+12;z.push(o("text",{key:`col-label-${B}`,x:String(_),y:String(U),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O))}return z},[g,y,v,T,R,N,L,P]),w=S(()=>m?[o("text",{key:"title",x:String(s/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},m)]:[],[m,s]);if(v===0||T===0)return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Matrix \u2014 no data"},o("text",{x:String(s/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let $=w(),E=A(),W=k();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Matrix visualization",style:{fontFamily:"sans-serif"}},...$,...E,...W)}var Ld=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Gt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Fd(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Nd(e,t,n,r,i,s,a){let l=[];if(Gt(e)<=0)return l;let b=Fd(e)+1,m=s==="horizontal",c=m?i/b:r/b,f=[];for(f.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});f.length>0;){let g=f.shift(),{node:y,depth:h,spanStart:p,spanEnd:x,colorIndex:v}=g,T=Gt(y);if(T<=0)continue;let D=x-p,C,P,L,I;if(m?(C=p,P=n+h*c,L=D,I=c):(C=t+h*c,P=p,L=c,I=D),l.push({x:C,y:P,w:L,h:I,label:y.label,value:T,color:y.color??a[v%a.length],depth:h}),y.children&&y.children.length>0){let M=p;for(let F=0;F<y.children.length;F++){let R=y.children[F],N=Gt(R);if(N<=0)continue;let A=N/T*D;f.push({node:R,depth:h+1,spanStart:M,spanEnd:M+A,colorIndex:h===0?F:v}),M+=A}}}return l}function us(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Ld,borderColor:d="#ffffff",borderWidth:u=1,title:b,padding:m=10}=e,c=b?30:0,f=m,g=m+c,y=n-m*2,h=r-m*2-c;if(q(()=>Gt(t),[t])<=0||y<=0||h<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let x=q(()=>Nd(t,f,g,y,h,i,l),[t,f,g,y,h,i,l]),v=[];b&&v.push(o("text",{key:"title",x:String(n/2),y:String(m+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b));for(let T=0;T<x.length;T++){let D=x[T];if(v.push(o("rect",{key:`cell-${T}`,x:String(D.x),y:String(D.y),width:String(Math.max(0,D.w)),height:String(Math.max(0,D.h)),fill:D.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${D.label}: ${D.value}`})),s&&D.w>20&&D.h>14){let C=Math.floor(D.w/7),P=D.label.length>C?D.label.substring(0,Math.max(1,C-2))+"..":D.label;v.push(o("text",{key:`label-${T}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},P))}a&&D.w>30&&D.h>28&&v.push(o("text",{key:`value-${T}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(D.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function jn(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function ps(e,t){let n=new Set;for(let i of e)n.add(jn(i,t));let r=Array.from(n);return r.sort(),r}function Xt(e,t){if(e.length===0)return 0;switch(t){case"count":return e.length;case"sum":{let n=0;for(let r of e)n+=r;return n}case"avg":{let n=0;for(let r of e)n+=r;return n/e.length}case"min":{let n=e[0];for(let r=1;r<e.length;r++)e[r]<n&&(n=e[r]);return n}case"max":{let n=e[0];for(let r=1;r<e.length;r++)e[r]>n&&(n=e[r]);return n}}}function qt(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Wd(e,t,n,r,i){let s=ps(e,t),a=ps(e,n),l=new Map;for(let f of e){let g=jn(f,t),y=jn(f,n),h=`${g}::${y}`;l.has(h)||l.set(h,[]);let p=l.get(h),x=0;for(let v of r){let T=f[v];if(typeof T=="number")x+=T;else if(typeof T=="string"){let D=parseFloat(T);isNaN(D)||(x+=D)}}p.push(x)}let d=new Map;for(let[f,g]of l)d.set(f,Xt(g,i));let u=new Map;for(let f of s){let g=[];for(let y of a){let h=d.get(`${f}::${y}`);h!==void 0&&g.push(h)}u.set(f,Xt(g,i==="count"?"sum":i))}let b=new Map;for(let f of a){let g=[];for(let y of s){let h=d.get(`${y}::${f}`);h!==void 0&&g.push(h)}b.set(f,Xt(g,i==="count"?"sum":i))}let m=[];for(let f of u.values())m.push(f);let c=Xt(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:b,grandTotal:c}}function fs(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:b="#3b82f6",cellPadding:m=8}=e;if(t.length===0||n.length===0&&r.length===0||i.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(a/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));let c=q(()=>Wd(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:f,colKeys:g,cells:y,rowTotals:h,colTotals:p,grandTotal:x}=c,v=u?30:0,T=g.length+(d?1:0),D=f.length+(d?1:0),C=1+T,P=1+D,L=Math.max(40,(a-m*2)/C),I=Math.max(20,Math.min(36,(l-v-m*2)/P)),M=L*C,F=I*P,R=Math.max(0,(a-M)/2),N=v+Math.max(0,(l-v-F)/2),A=[];u&&A.push(o("text",{key:"title",x:String(a/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),A.push(o("rect",{key:"header-row-bg",x:String(R),y:String(N),width:String(M),height:String(I),fill:b})),A.push(o("rect",{key:"header-col-bg",x:String(R),y:String(N+I),width:String(L),height:String(I*D),fill:b,opacity:"0.85"})),A.push(o("text",{key:"corner",x:String(R+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let k=0;k<g.length;k++){let w=R+(k+1)*L,$=Math.floor(L/7),E=g[k],W=E.length>$?E.substring(0,Math.max(1,$-2))+"..":E;A.push(o("text",{key:`ch-${k}`,x:String(w+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},W))}d&&A.push(o("text",{key:"ch-total",x:String(R+(g.length+1)*L+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<f.length;k++){let w=f[k],$=N+(k+1)*I;k%2===0&&A.push(o("rect",{key:`row-bg-${k}`,x:String(R+L),y:String($),width:String(L*T),height:String(I),fill:"#f9fafb"}));let E=Math.floor(L/7),W=w.length>E?w.substring(0,Math.max(1,E-2))+"..":w;A.push(o("text",{key:`rh-${k}`,x:String(R+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},W));for(let z=0;z<g.length;z++){let B=g[z],O=`${w}::${B}`,_=y.get(O),U=R+(z+1)*L;A.push(o("rect",{key:`border-${k}-${z}`,x:String(U),y:String($),width:String(L),height:String(I),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),A.push(o("text",{key:`cell-${k}-${z}`,x:String(U+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_!==void 0?qt(_):"-"))}if(d){let z=R+(g.length+1)*L,B=h.get(w)??0;A.push(o("rect",{key:`rt-bg-${k}`,x:String(z),y:String($),width:String(L),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:`rt-${k}`,x:String(z+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},qt(B)))}}if(d){let k=N+(f.length+1)*I;A.push(o("rect",{key:"total-row-bg",x:String(R),y:String(k),width:String(M),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:"total-label",x:String(R+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let $=0;$<g.length;$++){let E=g[$],W=p.get(E)??0,z=R+($+1)*L;A.push(o("text",{key:`ct-${$}`,x:String(z+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},qt(W)))}let w=R+(g.length+1)*L;A.push(o("text",{key:"grand-total",x:String(w+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},qt(x)))}return A.push(o("rect",{key:"outer-border",x:String(R),y:String(N),width:String(M),height:String(F),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...A)}function Kt(e,t){return Math.PI*2*e/t-Math.PI/2}function Zt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function gs(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:b="#d1d5db",title:m}=e,c=t.length,f=m?30:0,g=d&&n.length>0?30:0,y=60,h=Math.min((r-y*2)/2,(i-y*2-f-g)/2),p=r/2,x=y+f+h,v=q(()=>{let A=[];for(let k=0;k<c;k++){let w=t[k]?.max;if(w!==void 0&&w>0){A.push(w);continue}let $=0;for(let E of n){let W=E.values[k];W!==void 0&&W>$&&($=W)}A.push($>0?$:1)}return A},[t,n,c]),T=S(()=>{if(c<3)return[];let A=[];for(let k=1;k<=s;k++){let w=h*k/s,$=[];for(let E=0;E<c;E++){let W=Kt(E,c),z=Zt(p,x,w,W);$.push(`${z.x},${z.y}`)}A.push(o("polygon",{key:`ring-${k}`,points:$.join(" "),fill:"none",stroke:b,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=Kt(k,c),$=Zt(p,x,h,w);A.push(o("line",{key:`spoke-${k}`,x1:String(p),y1:String(x),x2:String($.x),y2:String($.y),stroke:b,"stroke-width":"0.75"}))}return A},[c,s,h,p,x,b]),D=S(()=>{if(!a||c<3)return[];let A=[],k=16;for(let w=0;w<c;w++){let $=Kt(w,c),E=Zt(p,x,h+k,$),W="middle";E.x<p-5?W="end":E.x>p+5&&(W="start");let z=Math.abs(E.y-x)<5?"0.35em":E.y<x?"0em":"0.7em";A.push(o("text",{key:`label-${w}`,x:String(E.x),y:String(E.y),"text-anchor":W,dy:z,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return A},[a,c,t,h,p,x]),C=S(()=>{if(c<3||n.length===0)return[];let A=[];for(let k=0;k<n.length;k++){let w=n[k],$=[],E=[],W=[];for(let z=0;z<c;z++){let B=w.values[z]??0,O=v[z],_=Math.min(B/O,1),U=h*_,X=Kt(z,c),ee=Zt(p,x,U,X);$.push(`${ee.x},${ee.y}`),u&&E.push(o("circle",{key:`dot-${k}-${z}`,cx:String(ee.x),cy:String(ee.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&W.push(o("text",{key:`val-${k}-${z}`,x:String(ee.x),y:String(ee.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(B*100)/100)))}A.push(o("polygon",{key:`series-fill-${k}`,points:$.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),A.push(o("polygon",{key:`series-line-${k}`,points:$.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let z of E)A.push(z);for(let z of W)A.push(z)}return A},[c,n,v,h,p,x,u,l]),P=S(()=>{if(!d||n.length===0)return[];let A=[],k=x+h+40,w=100,$=n.length*w,E=p-$/2;for(let W=0;W<n.length;W++){let z=n[W],B=E+W*w;A.push(o("rect",{key:`legend-swatch-${W}`,x:String(B),y:String(k),width:"12",height:"12",rx:"2",fill:z.color})),A.push(o("text",{key:`legend-text-${W}`,x:String(B+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},z.label))}return A},[d,n,p,x,h]),L=S(()=>m?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},m)]:[],[m,r]);if(c<3)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Radar chart \u2014 insufficient axes"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"Radar chart requires at least 3 axes."));let I=T(),M=D(),F=C(),R=P(),N=L();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Radar chart",style:{fontFamily:"sans-serif"}},...N,...I,...M,...F,...R)}var Bd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Od(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let b of u){let m=n.get(b),c=d+1;(m===void 0||c>m)&&n.set(b,c),s.includes(b)||s.push(b)}}for(let l of e)n.has(l)||n.set(l,0);return n}function Hd(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,b=t.filter(M=>M.value>0),m=e.map(M=>M.id),c=Od(m,b),f=new Map,g=new Map;for(let M of m)f.set(M,0),g.set(M,0);for(let M of b)g.set(M.source,(g.get(M.source)??0)+M.value),f.set(M.target,(f.get(M.target)??0)+M.value);let y=0;for(let M of c.values())M>y&&(y=M);let h=new Map;for(let M=0;M<=y;M++)h.set(M,[]);for(let[M,F]of c)h.get(F).push(M);let p=new Map,x=y>0?(d-i)/y:0;for(let M=0;M<=y;M++)p.set(M,a+M*x);let v=new Map;for(let M=0;M<e.length;M++)v.set(e[M].id,e[M]);let T=[],D=new Map;for(let M=0;M<=y;M++){let F=h.get(M);if(F.length===0)continue;let R=0;for(let w of F){let $=f.get(w)??0,E=g.get(w)??0;R+=Math.max($,E,1)}let N=u-s*(F.length-1),A=R>0?N/R:1,k=a;for(let w=0;w<F.length;w++){let $=F[w],E=v.get($),W=f.get($)??0,z=g.get($)??0,B=Math.max(W,z,1),O=Math.max(4,B*A),_=e.findIndex(X=>X.id===$),U={id:$,label:E.label,color:E.color??l[_%l.length],column:M,x:p.get(M),y:k,height:O,totalIn:W,totalOut:z,totalValue:B};T.push(U),D.set($,U),k+=O+s}}let C=new Map,P=new Map;for(let M of m)C.set(M,0),P.set(M,0);let L=[...b].sort((M,F)=>F.value-M.value),I=[];for(let M of L){let F=D.get(M.source),R=D.get(M.target);if(!F||!R)continue;let N=F.totalOut||1,A=R.totalIn||1,k=M.value/N*F.height,w=M.value/A*R.height,$=Math.max(1,(k+w)/2),E=C.get(M.source),W=P.get(M.target),z=F.y+E+k/2,B=R.y+W+w/2;C.set(M.source,E+k),P.set(M.target,W+w);let O=v.get(M.source);I.push({source:M.source,target:M.target,value:M.value,color:M.color??O?.color??F.color,sourceY:z,targetY:B,width:$})}return{layoutNodes:T,layoutLinks:I}}function ms(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:b=Bd,title:m,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let f=q(()=>Hd(t,n,r,i,s,a,c,b),[t,n,r,i,s,a,c,b]),g=S(()=>{let T=[];for(let D=0;D<f.layoutLinks.length;D++){let C=f.layoutLinks[D],P=f.layoutNodes.find(N=>N.id===C.source),L=f.layoutNodes.find(N=>N.id===C.target);if(!P||!L)continue;let I=P.x+s,M=L.x,F=(I+M)/2,R=`M ${I} ${C.sourceY} C ${F} ${C.sourceY}, ${F} ${C.targetY}, ${M} ${C.targetY}`;T.push(o("path",{key:`link-${D}`,d:R,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&T.push(o("text",{key:`link-val-${D}`,x:String(F),y:String((C.sourceY+C.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(C.value)))}return T},[f,s,u,d]),y=S(()=>{let T=[];for(let D=0;D<f.layoutNodes.length;D++){let C=f.layoutNodes[D];if(T.push(o("rect",{key:`node-${C.id}`,x:String(C.x),y:String(C.y),width:String(s),height:String(C.height),fill:C.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${C.label}: ${C.totalValue}`})),l){let P=f.layoutNodes.reduce((A,k)=>Math.max(A,k.column),0),L=C.column===P,I=L?C.x+s+6:C.x-6,M=L?"start":"end",F=C.column===0,R=F?C.x-6:I,N=F?"end":M;T.push(o("text",{key:`label-${C.id}`,x:String(R),y:String(C.y+C.height/2+4),"text-anchor":N,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},C.label))}}return T},[f,s,l]),h=S(()=>m?[o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,r,c]),p=g(),x=y(),v=h();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...p,...x)}var _d=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Gn=2*Math.PI;function Rt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Yd(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Vd(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,b=e+r*Math.cos(d),m=t+r*Math.sin(d),c=e+r*Math.cos(u),f=t+r*Math.sin(u),g=e+n*Math.cos(u),y=t+n*Math.sin(u),h=e+n*Math.cos(d),p=t+n*Math.sin(d);if(a>=Gn-.001){let x=d+Math.PI,v=e+r*Math.cos(x),T=t+r*Math.sin(x),D=e+n*Math.cos(x),C=t+n*Math.sin(x);return[`M ${b} ${m}`,`A ${r} ${r} 0 1 1 ${v} ${T}`,`A ${r} ${r} 0 1 1 ${b} ${m}`,`L ${h} ${p}`,`A ${n} ${n} 0 1 0 ${D} ${C}`,`A ${n} ${n} 0 1 0 ${h} ${p}`,"Z"].join(" ")}return[`M ${b} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${f}`,`L ${g} ${y}`,`A ${n} ${n} 0 ${l} 0 ${h} ${p}`,"Z"].join(" ")}function Ud(e,t,n,r){let i=[],s=Rt(e);if(s<=0)return i;let a=Yd(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let b=0;b<e.children.length;b++){let m=e.children[b],c=Rt(m);if(c<=0)continue;let f=c/s*Gn;d.push({node:m,startAngle:u,endAngle:u+f,depth:0,colorIndex:b}),u+=f}}else return i.push({startAngle:0,endAngle:Gn,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:b,startAngle:m,endAngle:c,depth:f,colorIndex:g}=u,y=Rt(b);if(y<=0)continue;let h=t+f*l,p=h+l;if(i.push({startAngle:m,endAngle:c,innerR:h,outerR:p,label:b.label,value:y,color:b.color??r[g%r.length],depth:f}),b.children&&b.children.length>0){let x=m,v=c-m;for(let T=0;T<b.children.length;T++){let D=b.children[T],C=Rt(D);if(C<=0)continue;let P=C/y*v;d.push({node:D,startAngle:x,endAngle:x+P,depth:f+1,colorIndex:g}),x+=P}}}return i}function hs(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=_d,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,b=n/2,m=r/2,c=u?20:0,f=Math.min(b,m-c)-10;if(q(()=>Rt(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(b),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=q(()=>Ud(t,i,f,a),[t,i,f,a]),h=[];u&&h.push(o("text",{key:"title",x:String(b),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let p=m+c/2;for(let x=0;x<y.length;x++){let v=y[x],T=Vd(b,p,v.innerR,v.outerR,v.startAngle,v.endAngle);if(h.push(o("path",{key:`arc-${x}`,d:T,fill:v.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${v.label}: ${v.value}`})),s){let D=v.endAngle-v.startAngle,C=v.startAngle+D/2-Math.PI/2,P=(v.innerR+v.outerR)/2,L=v.outerR-v.innerR,I=D*P;if(I>20&&L>14){let M=b+P*Math.cos(C),F=p+P*Math.sin(C),R=Math.floor(Math.min(I,L)/7),N=v.label.length>R?v.label.substring(0,Math.max(1,R-1))+"..":v.label;h.push(o("text",{key:`label-${x}`,x:String(M),y:String(F+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},N))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...h)}var jd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Jt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function bs(e,t){if(e.length===0||t<=0)return 1/0;let n=0;for(let s of e)n+=s;if(n<=0)return 1/0;let r=n/t,i=0;for(let s of e){if(s<=0)continue;let a=s/r,l=Math.max(a/r,r/a);l>i&&(i=l)}return i}function Gd(e,t,n,r,i,s){let a=[],l=[],d=Jt(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],b=r*i,m=[];for(let c=0;c<u.length;c++){let f=u[c],g=Jt(f);g<=0||m.push({label:f.label,value:g,area:g/d*b,color:f.color??s[c%s.length],node:f})}for(m.sort((c,f)=>f.area-c.area),l.push({nodes:m,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:f,rect:g,depth:y}=c;if(f.length===0)continue;let h={...g},p=0;for(;p<f.length&&h.w>0&&h.h>0;){let x=h.w>=h.h,v=x?h.h:h.w,T=[],D=[];T.push(f[p]),D.push(f[p].area),p++;let C=bs(D,v);for(;p<f.length;){let M=[...D,f[p].area],F=bs(M,v);if(F>C)break;T.push(f[p]),D.push(f[p].area),C=F,p++}let P=0;for(let M of D)P+=M;let L=v>0?P/v:0,I=0;for(let M=0;M<T.length;M++){let F=T[M],R=L>0?F.area/L:0,N,A,k,w;if(x?(N=h.x,A=h.y+I,k=L,w=R):(N=h.x+I,A=h.y,k=R,w=L),a.push({x:N,y:A,w:k,h:w,label:F.label,value:F.value,color:F.color,depth:y}),F.node.children&&F.node.children.length>0){let E=N+2,W=A+2+14,z=k-4,B=w-4-14;if(z>4&&B>4){let O=[],_=F.value,U=z*B;for(let X=0;X<F.node.children.length;X++){let ee=F.node.children[X],Z=Jt(ee);Z<=0||O.push({label:ee.label,value:Z,area:Z/_*U,color:ee.color??s[(X+y+1)%s.length],node:ee})}O.sort((X,ee)=>ee.area-X.area),l.push({nodes:O,rect:{x:E,y:W,w:z,h:B},depth:y+1})}}I+=R}x?h={x:h.x+L,y:h.y,w:h.w-L,h:h.h}:h={x:h.x,y:h.y+L,w:h.w,h:h.h-L}}}return a}function xs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=jd,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:b}=e,m=b?30:0,c=u,f=u+m,g=n-u*2,y=r-u*2-m;if(q(()=>Jt(t),[t])<=0||g<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let p=q(()=>Gd(t,c,f,g,y,a),[t,c,f,g,y,a]),x=[];b&&x.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b));for(let v=0;v<p.length;v++){let T=p[v];if(x.push(o("rect",{key:`cell-${v}`,x:String(T.x),y:String(T.y),width:String(Math.max(0,T.w)),height:String(Math.max(0,T.h)),fill:T.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${T.label}: ${T.value}`})),i&&T.w>20&&T.h>14){let D=Math.floor(T.w/7),C=T.label.length>D?T.label.substring(0,Math.max(1,D-2))+"..":T.label;x.push(o("text",{key:`label-${v}`,x:String(T.x+4),y:String(T.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&T.w>30&&T.h>28&&x.push(o("text",{key:`value-${v}`,x:String(T.x+4),y:String(T.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(T.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function ys(e){let t=e.replace("#",""),n,r,i;return t.length===3?(n=parseInt(t[0]+t[0],16),r=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(i)?0:i}}function Xd(e,t,n){let r=s=>Math.max(0,Math.min(255,Math.round(s))),i=s=>r(s).toString(16).padStart(2,"0");return"#"+i(e)+i(t)+i(n)}function Ss(e,t){if(t.length===0)return"#3b82f6";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=n*r,s=Math.floor(i),a=Math.min(s+1,r),l=i-s,d=ys(t[s]),u=ys(t[a]);return Xd(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function Qt(e,t){if(e<=0)return 1;let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return i<=1.5?r:i<=3.5?2*r:i<=7.5?5*r:10*r}function qd(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let b=Math.max(2,Math.min(50,r)),m=d/(b-1),c=u/(b-1);if(n){let g=[];for(let x=0;x<b;x++)for(let v=0;v<b;v++)g.push({x:i+v*m,y:a+x*c});let h=n(g,{gridSize:b,xMin:i,xMax:s,yMin:a,yMax:l}),p=[];for(let x=0;x<g.length;x++){let v=g[x],T=h[x]??{dx:0,dy:0},D=Math.sqrt(T.dx*T.dx+T.dy*T.dy);p.push({x:v.x,y:v.y,dx:T.dx,dy:T.dy,magnitude:D})}return p}if(!t)return[];let f=[];for(let g=0;g<b;g++)for(let y=0;y<b;y++){let h=i+y*m,p=a+g*c,x=t(h,p),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);f.push({x:h,y:p,dx:x.dx,dy:x.dy,magnitude:v})}return f}function Kd(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:b,yMax:m,xSpan:c,ySpan:f,showGrid:g,showAxes:y,colorByMagnitude:h,colorScale:p,arrowColor:x,arrowWidth:v,effectiveArrowScale:T,maxMagnitude:D,title:C,tickFontSize:P}=i,L=F=>s+(F-d)/c*a,I=F=>s+(m-F)/f*l;if(e.clearRect(0,0,t,n),C&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(C,t/2,s/2+4),e.restore()),g){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${P}px sans-serif`,e.fillStyle="#6b7280";let F=Qt(c,10),R=Math.ceil(d/F)*F;for(let k=R;k<=u;k+=F){let w=L(k);e.beginPath(),e.moveTo(w,s),e.lineTo(w,s+l),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(k*100)/100),w,s+l+4)}let N=Qt(f,10),A=Math.ceil(b/N)*N;for(let k=A;k<=m;k+=N){let w=I(k);e.beginPath(),e.moveTo(s,w),e.lineTo(s+a,w),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(k*100)/100),s-6,w)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=v,b<=0&&m>=0){let F=I(0);e.beginPath(),e.moveTo(s,F),e.lineTo(s+a,F),e.stroke()}if(d<=0&&u>=0){let F=L(0);e.beginPath(),e.moveTo(F,s),e.lineTo(F,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let M=4;for(let F=0;F<r.length;F++){let R=r[F],N=R.magnitude??Math.sqrt(R.dx*R.dx+R.dy*R.dy);if(N<1e-10)continue;let A=L(R.x),k=I(R.y),w=R.dx*T,$=-R.dy*T,E=A+w,W=k+$,z;if(h){let O=N/D;z=Ss(O,p)}else z=x;e.save(),e.strokeStyle=z,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(A,k),e.lineTo(E,W),e.stroke();let B=Math.sqrt(w*w+$*$);if(B>2){let O=w/B,_=$/B,U=-_,X=O,ee=Math.min(M,B*.4),Z=E-O*ee+U*ee*.5,V=W-_*ee+X*ee*.5,j=E-O*ee-U*ee*.5,H=W-_*ee-X*ee*.5;e.fillStyle=z,e.beginPath(),e.moveTo(E,W),e.lineTo(Z,V),e.lineTo(j,H),e.closePath(),e.fill()}e.restore()}}function vs(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:a=[-5,5],yRange:l=[-5,5],arrowScale:d=1,arrowColor:u="#3b82f6",showGrid:b=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:f=["#3b82f6","#8b5cf6","#ef4444"],title:g,padding:y=50,tickFontSize:h=10,arrowWidth:p=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:T}=e,D=Math.max(2,Math.min(50,s)),C=r-y*2,P=i-y*2,L=a[0],I=a[1],M=l[0],F=l[1],R=I-L,N=F-M,A=q(()=>Z=>y+(Z-L)/R*C,[y,L,R,C]),k=q(()=>Z=>y+(F-Z)/N*P,[y,F,N,P]),w=q(()=>qd(t,n,T,D,L,I,M,F,R,N),[t,n,T,D,L,I,M,F,R,N]),$=q(()=>{let Z=0;for(let V=0;V<w.length;V++){let j=w[V],H=j.magnitude??Math.sqrt(j.dx*j.dx+j.dy*j.dy);H>Z&&(Z=H)}return Z>0?Z:1},[w]),E=q(()=>Math.min(C,P)/Math.max(D,2)/(2*$)*d,[C,P,D,$,d]);if(x==="canvas"){let Z=te(null),V=te(0);return re(()=>{let j=Z.current;if(!j)return;let H=j.getContext("2d");if(H)return V.current&&cancelAnimationFrame(V.current),V.current=requestAnimationFrame(()=>{Kd(H,r,i,w,{padding:y,chartWidth:C,chartHeight:P,xMin:L,xMax:I,yMin:M,yMax:F,xSpan:R,ySpan:N,showGrid:b,showAxes:m,colorByMagnitude:c,colorScale:f,arrowColor:u,arrowWidth:p,effectiveArrowScale:E,maxMagnitude:$,title:g,tickFontSize:h})}),()=>{V.current&&cancelAnimationFrame(V.current)}},[w,r,i,y,C,P,L,I,M,F,R,N,b,m,c,f,u,p,E,$,g,h]),o("canvas",{ref:Z,width:r,height:i,role:"img","aria-label":g??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let W=S(()=>{if(!b)return[];let Z=[],V=Qt(R,10),j=Math.ceil(L/V)*V;for(let K=j;K<=I;K+=V){let Q=A(K);Z.push(o("line",{key:`gridv-${K}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+P),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`xtick-${K}`,x:String(Q),y:String(y+P+16),"text-anchor":"middle","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}let H=Qt(N,10),Y=Math.ceil(M/H)*H;for(let K=Y;K<=F;K+=H){let Q=k(K);Z.push(o("line",{key:`gridh-${K}`,x1:String(y),y1:String(Q),x2:String(y+C),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`ytick-${K}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}return Z},[b,L,I,M,F,R,N,A,k,y,C,P]),z=S(()=>{if(!m)return[];let Z=[];if(M<=0&&F>=0){let V=k(0);Z.push(o("line",{key:"axis-x",x1:String(y),y1:String(V),x2:String(y+C),y2:String(V),stroke:"#374151","stroke-width":String(p)}))}if(L<=0&&I>=0){let V=A(0);Z.push(o("line",{key:"axis-y",x1:String(V),y1:String(y),x2:String(V),y2:String(y+P),stroke:"#374151","stroke-width":String(p)}))}return Z.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String(P),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),Z},[m,L,I,M,F,A,k,y,C,P]),B=S(()=>{let Z=[];for(let j=0;j<w.length;j++){let H=w[j],Y=H.magnitude??Math.sqrt(H.dx*H.dx+H.dy*H.dy);if(Y<1e-10)continue;let K=A(H.x),Q=k(H.y),se=H.dx*E,J=-H.dy*E,ae=K+se,de=Q+J,le;if(c){let fe=Y/$;le=Ss(fe,f)}else le=u;Z.push(o("line",{key:`arrow-line-${j}`,x1:String(K),y1:String(Q),x2:String(ae),y2:String(de),stroke:le,"stroke-width":String(p),"stroke-linecap":"round"}));let ne=Math.sqrt(se*se+J*J);if(ne>2){let fe=se/ne,oe=J/ne,ie=-oe,ue=fe,he=Math.min(4,ne*.4),be=ae-fe*he+ie*he*.5,pe=de-oe*he+ue*he*.5,ge=ae-fe*he-ie*he*.5,ye=de-oe*he-ue*he*.5;Z.push(o("polygon",{key:`arrow-head-${j}`,points:`${ae},${de} ${be},${pe} ${ge},${ye}`,fill:le}))}}return Z},[w,A,k,E,c,$,f,u]),O=S(()=>g?[o("text",{key:"title",x:String(r/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,r,y]),_=W(),U=z(),X=B(),ee=O();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Vector field plot",style:{fontFamily:"sans-serif"}},...ee,..._,...U,...X)}function Zd(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r],s=i.type??(i.value>=0?"increase":"decrease");if(s==="total")t.push({label:i.label,value:n,type:"total",start:0,end:n});else{let a=n;n+=i.value,t.push({label:i.label,value:i.value,type:s,start:a,end:n})}}return t}function Jd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ws(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:a="#3b82f6",connectorColor:l="#94a3b8",showValues:d=!0,showGrid:u=!0,showConnectors:b=!0,title:m,padding:c=60}=e,f=n-c*2,g=r-c*2,y=q(()=>Zd(t),[t]),{minVal:h,maxVal:p}=q(()=>{let $=0,E=0;for(let W=0;W<y.length;W++){let z=y[W];z.start<$&&($=z.start),z.end<$&&($=z.end),z.start>E&&(E=z.start),z.end>E&&(E=z.end)}return $===E&&(E=$+1),{minVal:$,maxVal:E}},[y]),x=p-h,v=S($=>c+g-($-h)/x*g,[c,g,h,x]),T=q(()=>y.length===0?0:f/y.length,[y.length,f]),D=6,C=Math.max(1,T-D),P=S(()=>{if(!u)return[];let $=Jd(x),E=[],W=Math.ceil(h/$)*$;for(let z=W;z<=p;z+=$){let B=v(z);E.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(B),x2:String(c+f),y2:String(B),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),E.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return E},[u,x,h,p,v,c,f]),L=S(()=>{let $=[];$.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"}));let E=h<=0&&p>=0?v(0):c+g;return $.push(o("line",{key:"axis-x",x1:String(c),y1:String(E),x2:String(c+f),y2:String(E),stroke:"#374151","stroke-width":"1.5"})),$},[c,f,g,h,p,v]),I=S(()=>{if(y.length===0)return[];let $=[];for(let E=0;E<y.length;E++){let W=y[E],z=c+E*T+D/2,B=Math.max(W.start,W.end),O=Math.min(W.start,W.end),_=v(B),U=v(O),X=Math.max(0,U-_),ee;if(W.type==="total"?ee=a:W.type==="decrease"?ee=s:ee=i,$.push(o("rect",{key:`bar-${E}`,x:String(z),y:String(_),width:String(C),height:String(X),fill:ee,rx:"2",ry:"2"})),d){let Z=W.type==="decrease"||W.value<0?U+14:_-4,V=W.type==="total"?String(W.value):(W.value>=0?"+":"")+String(W.value);$.push(o("text",{key:`val-${E}`,x:String(z+C/2),y:String(Z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},V))}if($.push(o("text",{key:`cat-${E}`,x:String(z+C/2),y:String(c+g+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},W.label)),b&&E<y.length-1){let Z=y[E+1],V=v(W.end),j=c+(E+1)*T+D/2;Z.type!=="total"&&$.push(o("line",{key:`conn-${E}`,x1:String(z+C),y1:String(V),x2:String(j),y2:String(V),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return $},[y,T,C,v,i,s,a,l,d,b,c,g]),M=S(()=>m?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n,c]),F=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),R=P(),N=L(),A=I(),k=M(),w=F();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...R,...N,...A,...w)}var Qd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],eu=[0,-45,45,90];function tu(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),b=Math.abs(Math.sin(d)),m=a*u+l*b,c=a*b+l*u;return{x:r-m/2,y:i-c/2,w:m,h:c}}function nu(e,t){return!(e.x+e.w<t.x||t.x+t.w<e.x||e.y+e.h<t.y||t.y+t.h<e.y)}function ou(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function ru(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}function ks(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=Qd,rotations:d=eu,padding:u=4,spiral:b="archimedean",title:m}=e,c=q(()=>{if(t.length===0)return[];let g=t.map((C,P)=>({...C,originalIndex:P})).filter(C=>C.text.length>0&&C.weight>0).sort((C,P)=>P.weight-C.weight);if(g.length===0)return[];let y=g[g.length-1].weight,p=g[0].weight-y;function x(C){if(p===0)return(i+s)/2;let P=(C-y)/p;return i+P*(s-i)}let v=[],T=n/2,D=r/2;for(let C=0;C<g.length;C++){let P=g[C],L=x(P.weight),I=d[ru(P.text)%d.length],M=P.color??l[C%l.length],F=!1,R=500,N=b==="archimedean"?4:5;for(let A=0;A<R;A++){let k,w;if(b==="archimedean"){let O=A*.1,_=N*O;k=_*Math.cos(O),w=_*Math.sin(O)}else{let O=Math.floor(A/4)+1,_=A%4,U=(A%4===0?0:A)*N;switch(_){case 0:k=O*N*4,w=U;break;case 1:k=-U,w=O*N*4;break;case 2:k=-O*N*4,w=-U;break;default:k=U,w=-O*N*4;break}}let $=T+k,E=D+w,W=tu(P.text,L,I,$,E),z={x:W.x-u,y:W.y-u,w:W.w+u*2,h:W.h+u*2};if(!ou(z,n,r))continue;let B=!1;for(let O of v)if(nu(z,O.bbox)){B=!0;break}if(!B){v.push({text:P.text,x:$,y:E,fontSize:L,rotation:I,color:M,bbox:z}),F=!0;break}}}return v},[t,n,r,i,s,l,d,u,b]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let f=[];m&&f.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},m));for(let g=0;g<c.length;g++){let y=c[g],h=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;f.push(o("text",{key:`word-${g}`,transform:h,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud",style:{fontFamily:a}},...f)}var iu={0:"#1e293b",1:"#3b82f6"},su="#666";function Cs(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:b="#0f172a",padding:m=10,onCellClick:c,onCellHover:f,title:g}=e,y=n??iu,h=t.length,p=q(()=>{let $=0;for(let E=0;E<t.length;E++){let W=t[E];W!==void 0&&W.length>$&&($=W.length)}return $},[t]),x=u?20:0,v=g?24:0,T=q(()=>{let $=r-m*2-x,E=i-m*2-x-v;if(h===0||p===0)return{cellWidth:0,cellHeight:0};let W=Math.max(0,($-s*(p-1))/p),z=Math.max(0,(E-s*(h-1))/h);return{cellWidth:W,cellHeight:z}},[r,i,m,h,p,s,x,v]),D=S($=>{let E=y[$];return E!==void 0?E:su},[y]),C=S(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b}),[r,i,b]),P=S(()=>g?[o("text",{key:"title",x:String(r/2),y:String(m+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},g)]:[],[g,r,m]),L=S(()=>{if(!l||h===0||p===0)return[];let{cellWidth:$,cellHeight:E}=T,W=m+x,z=m+x+v,B=p*$+(p-1)*s,O=h*E+(h-1)*s,_=[];for(let U=0;U<=p;U++){let X=W+U*($+s)-s/2;_.push(o("line",{key:`vgrid-${U}`,x1:String(X),y1:String(z-s/2),x2:String(X),y2:String(z+O+s/2),stroke:d,"stroke-width":"0.5"}))}for(let U=0;U<=h;U++){let X=z+U*(E+s)-s/2;_.push(o("line",{key:`hgrid-${U}`,x1:String(W-s/2),y1:String(X),x2:String(W+B+s/2),y2:String(X),stroke:d,"stroke-width":"0.5"}))}return _},[l,h,p,T,m,x,v,s,d]),I=S(()=>{if(!u||h===0||p===0)return[];let{cellWidth:$,cellHeight:E}=T,W=m+x,z=m+x+v,B=[];for(let O=0;O<p;O++){let _=W+O*($+s)+$/2,U=z-6;B.push(o("text",{key:`col-idx-${O}`,x:String(_),y:String(U),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(O)))}for(let O=0;O<h;O++){let _=W-6,U=z+O*(E+s)+E/2+3;B.push(o("text",{key:`row-idx-${O}`,x:String(_),y:String(U),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(O)))}return B},[u,h,p,T,m,x,v,s]),M=S(()=>{if(h===0||p===0)return[];let{cellWidth:$,cellHeight:E}=T,W=m+x,z=m+x+v,B=[];for(let O=0;O<h;O++){let _=t[O];if(_!==void 0)for(let U=0;U<p;U++){let X=U<_.length?_[U]:0,ee=W+U*($+s),Z=z+O*(E+s),V=D(X),j={key:`cell-${O}-${U}`,x:String(ee),y:String(Z),width:String($),height:String(E),fill:V,rx:String(a),ry:String(a)};if(c){let H=O,Y=U,K=X;j.onClick=()=>c(H,Y,K),j.role="button",j.tabIndex=0}if(f){let H=O,Y=U,K=X;j.onMouseEnter=()=>f(H,Y,K)}B.push(o("rect",j))}}return B},[h,p,t,T,m,x,v,s,a,D,c,f]),F=C(),R=P(),N=L(),A=I(),k=M(),w=g?`${g} \u2014 ${h}x${p} discrete grid`:`${h}x${p} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":w},F,...R,...N,...A,...k)}