@asymmetric-effort/specifyjs 0.2.155 → 0.2.156
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 Nt=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var Ws=Object.getOwnPropertyNames;var _s=Object.prototype.hasOwnProperty;var Os=(e,t,n)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Hs=(e,t)=>{for(var n in t)Nt(e,n,{get:t[n],enumerable:!0})},Ys=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ws(t))!_s.call(e,i)&&i!==n&&Nt(e,i,{get:()=>t[i],enumerable:!(r=Ns(t,i))||r.enumerable});return e};var Vs=e=>Ys(Nt({},"__esModule",{value:!0}),e);var Xe=(e,t,n)=>Os(e,typeof t!="symbol"?t+"":t,n);var ku={};Hs(ku,{Accordion:()=>cr,Alert:()=>Co,AnalogClock:()=>co,AppContextProvider:()=>Qe,Avatar:()=>fo,Badge:()=>go,BarGraph:()=>Ar,BigNumber:()=>Ji,BlochSphere:()=>Qi,BoxPlot:()=>es,Breadcrumb:()=>dr,BubbleChart:()=>ns,Button:()=>Xi,CalendarHeatMap:()=>is,Card:()=>Xo,Carousel:()=>ir,CartesianGraph2D:()=>Or,Checkbox:()=>$o,ChordDiagram:()=>ss,ColorPicker:()=>zo,ColorWheel:()=>Do,ComplexGraph2D:()=>Ur,ContextMenu:()=>Ut,DataGrid:()=>xo,DatePicker:()=>Bo,DecompositionTree:()=>as,DigitalClock:()=>yo,DiscreteCartesian2D:()=>Fs,DragDropProvider:()=>Tt,Drawer:()=>Er,Dropdown:()=>pr,EmptyState:()=>Mo,FileUpload:()=>Fo,FlexContainer:()=>qo,FlexItem:()=>Ko,Footer:()=>ri,ForceGraph:()=>us,FormFieldWrapper:()=>Pe,FunnelChart:()=>fs,GanttChart:()=>hs,Gauge:()=>xs,GoogleAnalytics:()=>oi,Grid:()=>Zo,GridItem:()=>Jo,HeatMap:()=>Ss,Histogram:()=>vs,HypercubeGraph:()=>ei,IDE:()=>Kt,Image:()=>sr,LineGraph:()=>qr,ListView:()=>So,LollipopChart:()=>ws,Matrix:()=>ks,Menubar:()=>gr,MessageBusProvider:()=>Pt,Modal:()=>Ir,MultilineField:()=>No,NavWrapper:()=>Be,NumberSpinner:()=>Wo,Pagination:()=>hr,Panel:()=>er,Partition:()=>Cs,PieGraph:()=>Kr,PivotTable:()=>Es,PolarGraph2D:()=>Jr,Popover:()=>Pr,ProgressBar:()=>Eo,RadarChart:()=>Is,RadioGroup:()=>_o,SankeyDiagram:()=>Rs,ScrollContainer:()=>nr,Select:()=>Oo,Sidebar:()=>xr,Skeleton:()=>Io,Slider:()=>Ho,Spinner:()=>Po,Splitter:()=>or,Stepper:()=>yr,Sunburst:()=>Ps,Tabs:()=>rr,Tag:()=>vo,TextEditor:()=>Yo,TextField:()=>Vo,ThreeDLayers:()=>Zi,TimePicker:()=>Uo,ToastContainer:()=>Sn,Toggle:()=>jo,Toolbar:()=>vr,Tooltip:()=>Tr,TradingDashboard:()=>Qt,TreeMap:()=>Ts,TreeNav:()=>Cr,TreeNode:()=>mt,USStateMap:()=>ys,US_STATE_PATHS:()=>Lt,UnityApp:()=>Ui,UnityDesktop:()=>Vi,VectorField:()=>As,VideoPlayer:()=>lr,VirtualScroll:()=>wo,VizWrapper:()=>ni,WaterfallChart:()=>Ls,WordCloud:()=>Bs,WordProcessor:()=>qt,applyGate:()=>Gn,blochToCartesian:()=>kt,buildInputStyle:()=>He,buildNavItemStyle:()=>gt,buildRotationMatrix:()=>In,cartesianToBloch:()=>on,computeBoxStats:()=>qn,computeMandelbrotGrid:()=>Vr,computeSlices:()=>Cn,createToaster:()=>yn,describeArc:()=>kn,generateEdges:()=>En,generateHypercube:()=>Et,generatePalette:()=>Xt,generateVertices:()=>Mn,numRotationAngles:()=>It,projectTo2D:()=>Pn,transformVec:()=>Rn,useAppId:()=>xt,useBarGraphScales:()=>vn,useChannel:()=>$t,useDragDrop:()=>at,useDraggable:()=>An,useDropZone:()=>zt,useHover:()=>De,useHypercube:()=>ti,useLineGraphScales:()=>wn,useMessageBus:()=>et,useToast:()=>$r});module.exports=Vs(ku);var Wt=Symbol.for("spec.element"),Us=Symbol.for("spec.fragment"),Mu=Symbol.for("spec.portal"),no=Symbol.for("spec.provider"),oo=Symbol.for("spec.consumer"),js=Symbol.for("spec.forward_ref"),Gs=Symbol.for("spec.memo"),Xs=Symbol.for("spec.lazy"),qs=Symbol.for("spec.suspense"),Ks=Symbol.for("spec.strict_mode"),Zs=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:Wt,type:e,props:s,key:r,ref:i}}function Oe(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:no,_context:t},r={$$typeof:oo,_context:t};return t.Provider=n,t.Consumer=r,t}var pt=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){}};pt.prototype.isSpecComponent=!0;var _t=class extends pt{shouldComponentUpdate(t,n){return!io(this.props,t)||!io(this.state,n)}};_t.prototype.isPureSpecComponent=!0;function io(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 so=null;function Ze(){if(so===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return so}function G(e){return Ze().useState(e)}function ae(e,t){return Ze().useEffect(e,t)}function We(e){return Ze().useContext(e)}function pn(e,t,n){return Ze().useReducer(e,t,n)}function S(e,t){return Ze().useCallback(e,t)}function X(e,t){return Ze().useMemo(e,t)}function oe(e){return Ze().useRef(e)}function ve(){return Ze().useId()}var ft=Oe({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function ao(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Qs={pathname:ao(),hash:typeof window<"u"?window.location.hash:""},ea=new Set;function ta(){Qs={pathname:ao(),hash:typeof window<"u"?window.location.hash:""};for(let e of ea)e()}typeof window<"u"&&window.addEventListener("hashchange",ta);var lf=Oe({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function lo(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 pa(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 Ue={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function co(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(lo(a));ae(()=>{let I=setInterval(()=>{u(lo(a))},1e3);return()=>clearInterval(I)},[a]);let h=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),p=h%12*30+m*.5,f=m*6+c*.1,y=c*6,b=n/2,g=n/2,x=n/2-10,v=x-4,T=x-22,D=[];D.push(o("circle",{cx:String(b),cy:String(g),r:String(x),fill:Ue.face,stroke:Ue.border,"stroke-width":"3"}));for(let I=0;I<12;I++){let B=(I*30-90)*Math.PI/180,E=v-6;D.push(o("line",{x1:String(b+E*Math.cos(B)),y1:String(g+E*Math.sin(B)),x2:String(b+v*Math.cos(B)),y2:String(g+v*Math.sin(B)),stroke:Ue.border,"stroke-width":"2"}));let F=String(I===0?12:I);if(D.push(o("text",{x:String(b+T*Math.cos(B)),y:String(g+T*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ue.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},F)),t==="24h"){let A=x-38,k=String(I===0?0:I+12);D.push(o("text",{x:String(b+A*Math.cos(B)),y:String(g+A*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ue.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(I,P,B,E)=>{let F=(I-90)*Math.PI/180;return o("line",{x1:String(b),y1:String(g),x2:String(b+P*Math.cos(F)),y2:String(g+P*Math.sin(F)),stroke:E,"stroke-width":B,"stroke-linecap":"round"})};D.push(C(p,x*.5,"4",Ue.hand)),D.push(C(f,x*.75,"3",Ue.hand)),s&&D.push(C(y,x*.85,"1.5",Ue.second)),D.push(o("circle",{cx:String(b),cy:String(g),r:"4",fill:Ue.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:Ue.numbers}},pa(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var gn={xs:24,sm:32,md:40,lg:56,xl:80};function fa(e){return e==null?gn.md:typeof e=="number"?e:gn[e]??gn.md}function ga(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 uo=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function ma(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return uo[Math.abs(t)%uo.length]}var po={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function ha(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 fo(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,h]=G(!1),m=fa(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,p=a??ma(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"},b;if(t&&!u)b=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let T=ga(r);b=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"},T)}let g=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":p},role:"img","aria-label":n??r??"avatar"},b);if(!l)return g;let x=Math.max(8,Math.round(m*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:po[l]??po.offline,border:"2px solid #fff",boxSizing:"border-box",...ha(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},g,o("span",{style:v,"aria-label":l}))}var ba={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"}},xa={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function go(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,h=r?{...xa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...ba[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:h,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return m??o("span",null);let c={...h,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var ya={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},mo={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},mn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},Sa="6px 8px",va={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},wa={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},ka={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},it={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Ca={...it,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},ho={...it,opacity:"0.5",cursor:"default"},bo={cursor:"pointer",width:"16px",height:"16px"};function Ma(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function xo(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:m,striped:c=!1,bordered:p=!1,compact:f=!1,stickyHeader:y=!1}=e,[b,g]=G(0),[x,v]=G(void 0),[T,D]=G("asc"),[C,$]=G([]),[L,I]=G({}),P=i??b,B=a??x,E=l??T,F=h??C,A=X(()=>{let ee=Object.entries(L).filter(([,le])=>le.length>0);return ee.length===0?n:n.filter(le=>ee.every(([ce,pe])=>String(le[ce]??"").toLowerCase().includes(pe.toLowerCase())))},[n,L]),k=X(()=>{if(!B)return A;let ee=[...A];return ee.sort((le,ce)=>{let pe=le[B],re=ce[B];if(pe==null&&re==null)return 0;if(pe==null)return 1;if(re==null)return-1;if(typeof pe=="number"&&typeof re=="number")return E==="asc"?pe-re:re-pe;let he=String(pe),me=String(re),ne=he.localeCompare(me);return E==="asc"?ne:-ne}),ee},[A,B,E]),w=k.length,R=r?Math.max(1,Math.ceil(w/r)):1,M=r?k.slice(P*r,(P+1)*r):k,N=S(ee=>{s?s(ee):g(ee)},[s]),z=S(ee=>{let le=B===ee&&E==="asc"?"desc":"asc";d?d(ee,le):(v(ee),D(le))},[B,E,d]),W=S(ee=>{let le=F.includes(ee)?F.filter(ce=>ce!==ee):[...F,ee];m?m(le):$(le)},[F,m]),_=S(()=>{let ee=M.map((pe,re)=>r?P*r+re:re),ce=ee.every(pe=>F.includes(pe))?F.filter(pe=>!ee.includes(pe)):[...new Set([...F,...ee])];m?m(ce):$(ce)},[M,F,r,P,m]),H=S((ee,le)=>{I(ce=>({...ce,[ee]:le})),N(0)},[N]),U=t.some(ee=>ee.filterable),q=f?Sa:mn.padding,te=[];if(u){let ee=M.map((ce,pe)=>r?P*r+pe:pe),le=ee.length>0&&ee.every(ce=>F.includes(ce));te.push(o("th",{key:"__select_all",style:{...mo,padding:q,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:le,onChange:_,style:bo,"aria-label":"Select all rows"})))}for(let ee of t){let le={...mo,padding:q,...ee.width?{width:ee.width}:{},...ee.sortable?{cursor:"pointer"}:{},...p?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},ce=[ee.header];ee.sortable&&ce.push(o("span",{style:va},Ma(ee.key,B,E))),te.push(o("th",{key:ee.key,style:le,onClick:ee.sortable?()=>z(ee.key):void 0,onKeyDown:ee.sortable?pe=>{let re=pe.key;(re==="Enter"||re===" ")&&(pe.preventDefault(),z(ee.key))}:void 0,tabIndex:ee.sortable?0:void 0,role:ee.sortable?"columnheader":void 0,"aria-sort":B===ee.key?E==="asc"?"ascending":"descending":void 0},...ce))}let J=null;if(U){let ee=[];u&&ee.push(o("th",{key:"__filter_spacer",style:{padding:q}}));for(let le of t)ee.push(o("th",{key:`filter_${le.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},le.filterable?o("input",{type:"text",placeholder:`Filter ${le.header}...`,style:wa,value:L[le.key]??"",onInput:ce=>H(le.key,ce.target.value),"aria-label":`Filter by ${le.header}`}):null));J=o("tr",{key:"__filter_row"},...ee)}let V=[];for(let ee=0;ee<M.length;ee++){let le=M[ee],ce=r?P*r+ee:ee,pe=F.includes(ce),re={};c&&ee%2===1&&(re.backgroundColor="#f9fafb"),pe&&(re.backgroundColor="#eff6ff");let he=[];u&&he.push(o("td",{key:"__select",style:{padding:q,textAlign:"center",...mn,...p?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:pe,onChange:()=>W(ce),style:bo,"aria-label":`Select row ${ce+1}`})));for(let me of t){let ne=le[me.key],de=me.render?me.render(ne,le):String(ne??"");he.push(o("td",{key:me.key,style:{...mn,padding:q,...p?{border:"1px solid #e5e7eb"}:{}}},de))}V.push(o("tr",{key:String(ce),style:re},...he))}let j=null;if(r){let ee=w===0?0:P*r+1,le=Math.min((P+1)*r,w),ce=[];ce.push(o("button",{key:"prev",style:P===0?ho:it,onClick:P>0?()=>N(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let pe=7,re=Math.max(0,P-Math.floor(pe/2)),he=Math.min(R,re+pe);he-re<pe&&(re=Math.max(0,he-pe)),re>0&&(ce.push(o("button",{key:"p0",style:it,onClick:()=>N(0)},"1")),re>1&&ce.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let me=re;me<he;me++)ce.push(o("button",{key:`p${me}`,style:me===P?Ca:it,onClick:me!==P?()=>N(me):void 0,"aria-current":me===P?"page":void 0},String(me+1)));he<R&&(he<R-1&&ce.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),ce.push(o("button",{key:`p${R-1}`,style:it,onClick:()=>N(R-1)},String(R)))),ce.push(o("button",{key:"next",style:P>=R-1?ho:it,onClick:P<R-1?()=>N(P+1):void 0,disabled:P>=R-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:ka},o("span",null,`Showing ${ee}\u2013${le} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...ce))}let O={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},Y={...ya,...p?{border:"1px solid #e5e7eb"}:{}},K=o("thead",null,o("tr",null,...te),J),Q=o("tbody",null,...V),se=o("table",{style:Y,role:"grid","aria-rowcount":String(w)},K,Q);return o("div",{style:O},se,j)}function st(e){return e<10?`0${e}`:String(e)}function Ea(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 Ia(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"?`${st(e.getMonth()+1)}/${st(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${st(e.getMonth()+1)}-${st(e.getDate())}`}var Ra={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"},Pa={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},$a={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Ta={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function yo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=G(new Date);ae(()=>{let g=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(g)},[]);let{hours:u,minutes:h,seconds:m}=Ea(l,s),c,p=null;t==="12h"?(p=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${st(c)}:${st(h)}`;i&&(f+=`:${st(m)}`);let y=[f];p!=null&&y.push(o("span",{style:$a},p));let b=[o("span",{style:Pa},...y)];return n&&b.push(o("span",{style:Ta},Ia(l,r,s))),o("div",{style:Ra,...a?{class:a}:{}},...b)}var za={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Da={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"},Ba={backgroundColor:"var(--color-bg-muted, #eff6ff)"},Fa={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Ot={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 So(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:h}=e;if(t.length===0)return o("div",null,u?o("div",{style:Ot},u):null,o("div",{style:Fa},d),h?o("div",{style:{...Ot,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let m=[];for(let c=0;c<t.length;c++){let p=t[c],f=r(p,c),y=a===c,b=c===t.length-1,g={...Da,...s?La:{},...y?Ba:{},...i&&!b?Aa:{}};m.push(o("li",{key:f,style:g,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(p,c)))}return o("div",null,u?o("div",{style:Ot},u):null,o("ul",{style:za,role:l?"listbox":"list"},...m),h?o("div",{style:{...Ot,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function Na(e){return e??"#3b82f6"}function Wa(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 _a={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 Oa(e,t,n,r,i){let s=_a[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:Wa(e,.12),color:e,border:"none"};default:return a}}var Ha={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 vo(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,h=Na(n),m=Oa(h,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:Ha,onClick:p=>{p.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?p=>{let f=p.key;(f==="Enter"||f===" ")&&(p.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var Ya={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function wo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=G(0),d=oe(null),u=t.length*r,h=parseInt(s,10)||400,m=Math.ceil(h/r),c=Math.max(0,Math.floor(a/r)-i),p=Math.min(t.length,Math.floor(a/r)+m+i),f=S(b=>{let g=b.target;l(g.scrollTop)},[]),y=[];for(let b=c;b<p;b++)y.push(o("div",{key:String(b),style:{position:"absolute",top:`${b*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[b],b)));return o("div",{ref:d,style:{...Ya,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var ko={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 Co(e){let[t,n]=G(!0),r=e.type??"info",i=e.variant??"subtle",s=ko[r]??ko.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 Mo(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 Eo(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=ve().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let p=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(p/10)),y=(p-f)/2,b=2*Math.PI*y,g=e.indeterminate?b*.75:b-r/100*b,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(p),height:String(p),viewBox:`0 0 ${p} ${p}`,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(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(b),"stroke-dashoffset":String(g),"stroke-linecap":"round",transform:`rotate(-90 ${p/2} ${p/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",h=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",m={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=X(()=>{let p={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(p.position="absolute",p.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,p.backgroundColor=i):(p.width=`${r}%`,p.backgroundColor=i),e.animated&&!e.indeterminate&&(p.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${Va(i)} 50%, ${i} 100%)`,p.backgroundSize="200% 100%",p.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),p},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||h?o("style",null,u+h):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:m},o("div",{style:c})))}function Va(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 Io(e){let t=e.variant??"text",n=e.animated!==!1,r=ve().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 h=u===l-1&&l>1;d.push(o("div",{key:String(u),style:hn({width:h?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:hn({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:hn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function hn(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 Ua={sm:16,md:24,lg:40},Ro={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Po(e){let t=typeof e.size=="number"?e.size:Ua[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=Ro[e.speed??"normal"]??Ro.normal,s=e.label??"Loading",l=ve().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,h=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,h),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function Pe(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function He(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 ja={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function $o(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,h=oe(null);ae(()=>{h.current&&(h.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]),p=ja[u],f=`${p.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",b=r||a?"#3b82f6":"#ffffff",g={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:b,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${p.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:h,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),C=o("div",{style:g},v),$=s?o("span",{style:{fontSize:p.fontSize,color:"#374151"}},s):null;return o(Pe,{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,$))}var Ga=["#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 To(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function Ht(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 zo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=Ga,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[h,m]=G(!1),[c,p]=G(r),f=oe(null);ae(()=>{p(r)},[r]),ae(()=>{let I=P=>{f.current&&!f.current.contains(P.target)&&m(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let y=S(I=>{d||i(Ht(I))},[d,i]),b=S(I=>{let P=I.target.value;p(P);let B=P.startsWith("#")?P:`#${P}`;To(B)&&i(Ht(B))},[i]),g=S(()=>{To(c.startsWith("#")?c:`#${c}`)||p(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 P=Ht(I)===Ht(r);return o("div",{key:I,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:I,cursor:d?"not-allowed":"pointer",border:P?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(I),onKeyDown:E=>{let F=E.key;(F==="Enter"||F===" ")&&(E.preventDefault(),y(I))},role:"button",tabIndex:d?-1:0,title:I,"aria-label":`Select color ${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:b,onBlur:g,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=h?o("div",{style:T},o("div",{style:D},...C),$):null;return o(Pe,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>m(!h),onKeyDown:d?void 0:I=>{let P=I.key;(P==="Enter"||P===" ")&&(I.preventDefault(),m(!h))},role:"button",tabIndex:d?-1:0,"aria-expanded":h?"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 Do(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,h]=G(r),m=oe(null),c=S(((...b)=>{let x=b[0].target.value;h(x),i?.(x)}),[i]),p={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},f={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(Pe,{label:d,htmlFor:n},o("div",{style:p},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 Ao=["January","February","March","April","May","June","July","August","September","October","November","December"],Xa=["Su","Mo","Tu","We","Th","Fr","Sa"];function bn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function qa(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 Lo(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 Bo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:h,error:m}=e,c=X(()=>bn(r),[r]),p=X(()=>bn(a),[a]),f=X(()=>bn(l),[l]),[y,b]=G(!1),[g,x]=G(()=>c?c.getFullYear():new Date().getFullYear()),[v,T]=G(()=>c?c.getMonth():new Date().getMonth()),D=oe(null),C=X(()=>new Date,[]);ae(()=>{let z=W=>{D.current&&!D.current.contains(W.target)&&b(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let $=S(()=>{T(z=>z===0?(x(W=>W-1),11):z-1)},[]),L=S(()=>{T(z=>z===11?(x(W=>W+1),0):z+1)},[]),I=S(z=>{let W=new Date(g,v,z);p&&W<p||f&&W>f||(i(Ka(W)),b(!1))},[g,v,i,p,f]),P=c?qa(c,s):"",B=X(()=>{let z=new Date(g,v,1).getDay(),W=new Date(g,v+1,0).getDate(),_=[],H=[];for(let U=0;U<z;U++)H.push(null);for(let U=1;U<=W;U++)H.push(U),H.length===7&&(_.push(H),H=[]);for(;H.length>0&&H.length<7;)H.push(null);return H.length&&_.push(H),_},[g,v]),E={...He({},{focused:y,error:!!m}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},F={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"},R=Xa.map(z=>o("div",{key:z,style:{padding:"4px"}},z)),M=B.map((z,W)=>{let _=z.map((H,U)=>{if(H===null)return o("div",{key:`empty-${W}-${U}`,style:{padding:"4px"}});let q=new Date(g,v,H),te=Lo(q,C),J=c?Lo(q,c):!1,V=p&&q<p||f&&q>f,j={padding:"4px",textAlign:"center",cursor:V?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:te?"700":"400",backgroundColor:J?"#3b82f6":"transparent",color:J?"#ffffff":V?"#d1d5db":te?"#3b82f6":"#1f2937",border:te&&!J?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${H}`,style:j,onClick:V?void 0:()=>I(H),onKeyDown:V?void 0:O=>{let Y=O.key;(Y==="Enter"||Y===" ")&&(O.preventDefault(),I(H))},role:V?void 0:"button",tabIndex:V?void 0:0,"aria-label":`${Ao[v]} ${H}, ${g}`,"aria-disabled":V?"true":void 0},String(H))});return o("div",{key:`row-${W}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},..._)}),N=y?o("div",{style:F},o("div",{style:A},o("button",{type:"button",style:k,onClick:$},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Ao[v]} ${g}`),o("button",{type:"button",style:k,onClick:L},"\u25B6")),o("div",{style:w},...R),...M):null;return o(Pe,{label:h,error:m,disabled:d,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},o("div",{id:n,style:E,onClick:d?void 0:()=>b(!y),onKeyDown:d?void 0:z=>{let W=z.key;(W==="Enter"||W===" ")&&(z.preventDefault(),b(!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 xn(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 Fo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[h,m]=G([]),[c,p]=G(!1),[f,y]=G(""),b=oe(null),g=S(k=>{y("");let w=[];for(let M of k){if(a&&M.size>a){y(`File "${M.name}" exceeds maximum size of ${xn(a)}`);continue}w.push(M)}let R=s?[...h,...w]:w.slice(0,1);m(R),r(R)},[h,s,a,r]),x=S(k=>{if(k.preventDefault(),k.stopPropagation(),p(!1),l)return;let w=k.dataTransfer;if(!w)return;let R=Array.from(w.files);g(R)},[l,g]),v=S(k=>{k.preventDefault(),k.stopPropagation(),l||p(!0)},[l]),T=S(k=>{k.preventDefault(),k.stopPropagation(),p(!1)},[]),D=S(k=>{let w=k.target;w.files&&(g(Array.from(w.files)),w.value="")},[g]),C=S(k=>{let w=h.filter((R,M)=>M!==k);m(w),r(w)},[h,r]),$=S(()=>{l||b.current&&b.current.click()},[l]),L={border:`2px dashed ${c?"#3b82f6":f?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:l?"0.6":"1"},I={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},P={fontSize:"14px",color:"#374151",marginBottom:"4px"},B={fontSize:"12px",color:"#9ca3af"},E=o("input",{id:n,ref:b,type:"file",accept:i,multiple:s,onChange:D,disabled:l,style:{display:"none"},tabIndex:-1}),F=o("div",{style:L,onClick:$,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),$())},onDrop:x,onDragOver:v,onDragLeave:T,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:I},"\u2191"),o("div",{style:P},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:B},i):null,a?o("div",{style:B},`Max size: ${xn(a)}`):null),A=h.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...h.map((k,w)=>{let R={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:R},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"}},xn(k.size))),o("button",{type:"button",style:M,onClick:N=>{N.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(Pe,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,E,F,A))}function No(e){let[t,n]=G(!1),[r,i]=G((e.value??e.defaultValue??"").length),s=ve().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...He(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 p=c.target,f=p.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(p.style.height="auto",p.style.height=`${p.scrollHeight}px`)},[e.onChange,e.autoResize]),h=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),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(Pe,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,m)}function Wo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:h,label:m,error:c}=e,[p,f]=G(!1),y=S(w=>{let R=w;return s!==void 0&&R<s&&(R=s),a!==void 0&&R>a&&(R=a),R},[s,a]),b=S(()=>{d||i(y(r+l))},[d,r,l,y,i]),g=S(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=S(w=>{let R=w.target.value;if(R===""||R==="-")return;let M=parseFloat(R);isNaN(M)||i(y(M))},[y,i]),v=S(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),b()):w.key==="ArrowDown"&&(w.preventDefault(),g()))},[d,b,g]),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":p?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...p&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},$=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)"},P=o("button",{type:"button",style:$(T),onClick:g,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),B=u?o("span",{style:I},u):null,E=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:v,onFocus:()=>f(!0),onBlur:()=>f(!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}),F=h?o("span",{style:I},h):null,A=o("button",{type:"button",style:$(D),onClick:b,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[P];return B&&k.push(B),k.push(E),F&&k.push(F),k.push(A),o(Pe,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function _o(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:h}=e,m=S(y=>{d||s(y)},[d,s]),c=S(y=>{if(d)return;let b=r.filter(v=>!v.disabled);if(b.length===0)return;let g=b.findIndex(v=>v.value===i),x=g;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),x=g<b.length-1?g+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),x=g>0?g-1:b.length-1;else return;s(b[x].value)},[d,r,i,s]),p={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((y,b)=>{let g=y.value===i,x=d||!!y.disabled,v=`${n}-opt-${b}`,T={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":g?"#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:g?"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:$=>{$.preventDefault(),m(y.value)}},o("input",{type:"radio",id:v,name:a,value:y.value,checked:g,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(Pe,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:p,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...f))}function Oo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:h=!1,error:m,label:c,helpText:p}=e,[f,y]=G(!1),[b,g]=G(""),[x,v]=G(-1),T=oe(null),D=X(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=X(()=>{if(!l||!b)return r;let z=b.toLowerCase();return r.filter(W=>W.label.toLowerCase().includes(z))},[r,b,l]),$=X(()=>{let z={},W=[];for(let _ of C)_.group?(z[_.group]||(z[_.group]=[]),z[_.group].push(_)):W.push(_);return{groups:z,ungrouped:W}},[C]),L=X(()=>D.length===0?"":D.map(W=>r.find(_=>_.value===W)).filter(Boolean).map(W=>W.label).join(", "),[D,r]);ae(()=>{let z=W=>{let _=W.target;T.current&&!T.current.contains(_)&&(y(!1),g(""))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let I=S(z=>{if(d){let W=D.includes(z)?D.filter(_=>_!==z):[...D,z];s(W)}else s(z),y(!1),g("")},[d,D,s]),P=S(z=>{z.stopPropagation(),s(d?[]:"")},[d,s]),B=S(z=>{if(h)return;let W=z.key;if(!f&&(W==="Enter"||W===" "||W==="ArrowDown")){z.preventDefault(),y(!0),v(0);return}if(f){if(W==="Escape"){y(!1),g("");return}if(W==="ArrowDown")z.preventDefault(),v(_=>Math.min(_+1,C.length-1));else if(W==="ArrowUp")z.preventDefault(),v(_=>Math.max(_-1,0));else if(W==="Enter"&&x>=0&&x<C.length){z.preventDefault();let _=C[x];_.disabled||I(_.value)}}},[h,f,x,C,I]),E={...He({},{focused:f,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},F={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,W)=>{let _=D.includes(z.value),H=W===x,U={padding:"8px 12px",cursor:z.disabled?"not-allowed":"pointer",backgroundColor:H?"#f3f4f6":_?"#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(W),role:"option","aria-selected":_?"true":"false","aria-disabled":z.disabled?"true":void 0},d&&_?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,z.label)},k=()=>{let z=[],W=0,{groups:_,ungrouped:H}=$;for(let U of H)z.push(A(U,W++));for(let U of Object.keys(_)){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 q of _[U])z.push(A(q,W++))}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:f?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),R=o("div",{style:E,id:n,onClick:h?void 0:()=>{y(!f),v(-1)},onKeyDown:B,tabIndex:h?-1:0,role:"combobox","aria-expanded":f?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:L?"#1f2937":"#9ca3af"}},L||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&D.length>0?o("span",{onClick:P,onKeyDown:z=>{let W=z.key;(W==="Enter"||W===" ")&&(z.preventDefault(),z.stopPropagation(),P(z))},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:b,onInput:z=>{g(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,N=f?o("div",{style:F,role:"listbox"},M,...k()):null;return o(Pe,{label:c,error:m,helpText:p,disabled:h,htmlFor:n},o("div",{ref:T,style:{position:"relative"}},R,N))}function Ho(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:h=!1,marks:m,range:c=!1,label:p,error:f}=e,y=oe(null),b=oe(i);b.current=i;let[g,x]=G(null),v=X(()=>{if(c&&Array.isArray(r))return r;let W=typeof r=="number"?r:0;return[W,W]},[r,c]),T=oe(v);T.current=v;let D=W=>{let _=Math.round((W-s)/l)*l+s;return Math.max(s,Math.min(a,_))},C=W=>(W-s)/(a-s)*100,$=S(W=>{if(!y.current)return s;let _=y.current.getBoundingClientRect(),H=Math.max(0,Math.min(1,(W.clientX-_.left)/_.width));return D(s+H*(a-s))},[s,a,l]),L=S(W=>_=>{h||(_.preventDefault(),x(W))},[h]),I=S(W=>{if(h)return;let _=$(W);if(c){let H=Math.abs(_-v[0]),U=Math.abs(_-v[1]);H<=U?i([D(_),v[1]]):i([v[0],D(_)])}else i(D(_))},[h,$,c,v,i,s,a,l]);ae(()=>{if(!g)return;let W=H=>{let U=$(H),q=T.current,te=b.current;g==="single"?te(D(U)):g==="start"?te([Math.min(D(U),q[1]),q[1]]):g==="end"&&te([q[0],Math.max(q[0],D(U))])},_=()=>x(null);return document.addEventListener("mousemove",W),document.addEventListener("mouseup",_),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",_)}},[g,$,s,a,l]);let P=S(W=>{if(h)return;let _=0;if(W.key==="ArrowRight"||W.key==="ArrowUp")_=l;else if(W.key==="ArrowLeft"||W.key==="ArrowDown")_=-l;else return;W.preventDefault(),c||i(D((typeof r=="number"?r:0)+_))},[h,l,c,r,i,s,a]),B={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},E=c?C(v[0]):0,F=C(c?v[1]:v[0]),A={position:"absolute",top:"0",left:`${E}%`,width:`${F-E}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=W=>p?W==="start"?`${p} minimum`:W==="end"?`${p} maximum`:p:W==="start"?"Minimum value":W==="end"?"Maximum value":"Value",w=(W,_,H)=>{let U={position:"absolute",top:"50%",left:`${W}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${h?"#9ca3af":"#3b82f6"}`,cursor:h?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},q={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:_==="single"||_==="start"?n:void 0,style:U,onMouseDown:L(_),role:"slider","aria-valuenow":String(H),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(_),tabIndex:h?-1:0,onKeyDown:P},d?o("div",{style:q},String(H)):null)},R=[];if(u)for(let W=s;W<=a;W+=l)R.push(o("div",{key:`tick-${W}`,style:{position:"absolute",top:"10px",left:`${C(W)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let M=[];if(m)for(let W of m)M.push(o("div",{key:`mark-${W.value}`,style:{position:"absolute",top:"18px",left:`${C(W.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},W.label));let N={paddingTop:d?"28px":"8px",paddingBottom:m||u?"28px":"8px",opacity:h?"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(Pe,{label:p,error:f,htmlFor:n},o("div",{style:N},o("div",{ref:y,style:B,role:"presentation",onClick:I},o("div",{style:A}),...z,...R,...M)))}var Za=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Ja={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 Yo(e){let[t,n]=G(!1),r=oe(null),i=ve().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??Za,l=e.toolbarStyle??{},d=e.editorStyle??{};ae(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=S((f,y)=>{if(!(e.disabled||e.readOnly)){if(f==="createLink"){let b=prompt("Enter URL:");if(!b)return;document.execCommand(f,!1,b)}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]),h=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(f=>{let y=Ja[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})),p=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding: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:h});return o(Pe,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,p))}function Vo(e){let[t,n]=G(!1),r=ve().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=He(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let h=u.target.value;e.onInput&&e.onInput(h),e.onChange&&e.onChange(h)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(Pe,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Qa=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Je(e){return String(e).padStart(2,"0")}function el(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 Uo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:h=!1,timezone:m,showTimezone:c=!1,timezones:p=Qa,onTimezoneChange:f}=e,[y,b]=G(!1),g=X(()=>el(r),[r]),x=s==="12h",v=g.hour>=12,T=x?g.hour%12||12:g.hour,D=S((j,O,Y)=>{let K=Math.max(0,Math.min(23,j)),Q=Math.max(0,Math.min(59,O)),se=Math.max(0,Math.min(59,Y??0));i(h?`${Je(K)}:${Je(Q)}:${Je(se)}`:`${Je(K)}:${Je(Q)}`)},[i,h]),C=S(j=>{let O=parseInt(j.target.value,10)||0;x&&(O=O%12,v&&(O+=12)),D(O,g.minute,g.second)},[x,v,g.minute,g.second,D]),$=S(j=>{let O=parseInt(j.target.value,10)||0;D(g.hour,O,g.second)},[g.hour,g.second,D]),L=S(j=>{let O=parseInt(j.target.value,10)||0;D(g.hour,g.minute,O)},[g.hour,g.minute,D]),I=S(()=>{if(l)return;let j=v?g.hour-12:g.hour+12;D(j,g.minute,g.second)},[l,v,g.hour,g.minute,g.second,D]),P=S(j=>{l||D(g.hour+j,g.minute,g.second)},[l,g.hour,g.minute,g.second,D]),B=S(j=>{l||D(g.hour,g.minute+j*a,g.second)},[l,g.hour,g.minute,g.second,a,D]),E=S(j=>{l||D(g.hour,g.minute,g.second+j)},[l,g.hour,g.minute,g.second,D]),F=S(j=>{let O=j.target.value;f&&f(O)},[f]),A={display:"inline-flex",alignItems:"center",gap:"4px",...He({},{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"},R={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:Je(T),onChange:C,style:R,disabled:l,"aria-label":"Hour",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:w,onClick:()=>P(-1),disabled:l},"\u25BC")),z=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),W=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>B(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Je(g.minute),onChange:$,style:R,disabled:l,"aria-label":"Minute",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:w,onClick:()=>B(-1),disabled:l},"\u25BC")),_=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,H=h?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>E(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Je(g.second),onChange:L,style:R,disabled:l,"aria-label":"Second",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:w,onClick:()=>E(-1),disabled:l},"\u25BC")):null,U=x?o("button",{type:"button",style:M,onClick:I,disabled:l,"aria-label":"Toggle AM/PM"},v?"PM":"AM"):null,q={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},te=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,J=c?o("select",{style:q,value:m??p[0],onChange:F,disabled:l,"aria-label":"Timezone"},...p.map(j=>o("option",{key:j,value:j},j))):null,V=[N,z,W];return _&&V.push(_),H&&V.push(H),U&&V.push(U),te&&V.push(te),J&&V.push(J),o(Pe,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:A},...V))}var tl={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 jo(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=tl[a],h=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"},p=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:`${p}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},b=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,g=o("div",{style:c},o("div",{style:f}));return o("div",{style:y,onClick:h,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[b,g]:[g,b]).filter(Boolean))}var Go={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 Xo(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=X(()=>{let h={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(h.border="1px solid #e5e7eb"),h.boxShadow=Go[n]??Go.sm,e.hoverable&&(h.cursor="pointer"),{...h,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function qo(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 Ko(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 Zo(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 Jo(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 Qo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function er(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=G(!!e.defaultCollapsed),s=oe(null),[a,l]=G("auto");ae(()=>{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 b=y.key;(b==="Enter"||b===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),h=X(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Qo[n]??Qo.none,{...y,...e.style??{}}},[t,n,e.style]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},p={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},f={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:h},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?p:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function tr(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function nl(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 nr(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=oe(null),[s,a]=G(!0),[l,d]=G(!1),[u,h]=G(!0),[m,c]=G(!1),p=S(()=>{let x=i.current;if(!x)return;let v=2;a(x.scrollTop<=v),d(x.scrollTop+x.clientHeight>=x.scrollHeight-v),h(x.scrollLeft<=v),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-v)},[]);ae(()=>{p()},[p]);let f=S(()=>{r&&p()},[r,p]),y=X(()=>{let x={position:"relative",overflowX:tr(t,"x"),overflowY:tr(t,"y"),...nl(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]),b=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&b.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&b.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&b.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!m&&b.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let g={...y};return b.length>0&&(g.boxShadow=b.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:g,ref:i,onScroll:f},e.children)}function or(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=G(e.initialSplit??50),l=oe(null),d=oe(!1),u=S(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);ae(()=>{let y=g=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,T=n?g.clientX-x.left:g.clientY-x.top;if(v<=0)return;let D=i/v*100,C=e.maxSize?e.maxSize/v*100:100-D,$=T/v*100;$=Math.max(D,Math.min(C,$)),a($)},b=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",b)}},[n,i,e.maxSize]);let h=X(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},p={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},f=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:h,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},f[0]??null),o("div",{className:"splitter__divider",style:p,onMouseDown:u,onKeyDown:y=>{let b=y.key,g=2;n&&(b==="ArrowLeft"||b==="ArrowRight")?(y.preventDefault(),a(x=>{let v=b==="ArrowRight"?g:-g;return Math.max(5,Math.min(95,x+v))})):!n&&(b==="ArrowUp"||b==="ArrowDown")&&(y.preventDefault(),a(x=>{let v=b==="ArrowDown"?g:-g;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},f[1]??null))}function rr(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(g=>!g.disabled)?.id??"",[i,s]=G(e.activeTab??r),a=e.activeTab??i,l=oe(null),d=S(g=>{s(g),e.onChange&&e.onChange(g)},[e.onChange]),u=S(g=>{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",$=-1;if(g.key===D?$=v>0?v-1:x.length-1:g.key===C?$=v<x.length-1?v+1:0:g.key==="Home"?$=0:g.key==="End"&&($=x.length-1),$>=0){g.preventDefault(),d(x[$].id);let L=l.current;if(L){let P=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[$])];P&&P.focus()}}},[e.tabs,a,t,d]),h=t==="left"||t==="right",m=t==="bottom"||t==="right",c=X(()=>({display:"flex",flexDirection:h?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[h,m,e.style]),p={display:"flex",flexDirection:h?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!h?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&h?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},f={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(g=>g.id===a),b=e.tabs.map(g=>{let x=g.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:g.disabled?"not-allowed":"pointer",opacity:g.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"?h?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:g.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${g.id}`,"aria-disabled":g.disabled?"true":void 0,id:`tab-${g.id}`,tabIndex:x?"0":"-1",style:v,onClick:g.disabled?void 0:()=>d(g.id),onKeyDown:u},g.icon?o("span",{className:"tabs__tab-icon"},g.icon):null,g.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":h?"vertical":"horizontal",style:p,ref:l},...b),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},y?y.content:null))}function ir(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=ve().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=G(0),m=oe(null),c=oe(null),p=S(C=>{let $=C;r?$=(C%n+n)%n:$=Math.max(0,Math.min(C,n-1)),h($),e.onChange&&e.onChange($)},[n,r,e.onChange]),f=S(()=>p(u+1),[u,p]),y=S(()=>p(u-1),[u,p]);ae(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(f,l);return()=>clearInterval(C)},[e.autoPlay,l,f,n]),ae(()=>{let C=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&f()},$=c.current;if($)return $.addEventListener("keydown",C),()=>$.removeEventListener("keydown",C)},[f,y]);let b=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",g={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]),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,$)=>{let L=a==="fade"?{position:$===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:$===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String($),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,$)=>o("button",{key:String($),"aria-label":`Go to slide ${$+1}`,onclick:()=>p($),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:$===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:g,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let $=C.clientX-m.current;$>50?y():$<-50&&f(),m.current=null}},b?o("style",null,b):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:f,style:{...v,right:"8px"}},"\u203A"):null,D)}function sr(e){let[t,n]=G("loading"),r=oe(null),i=ve().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;ae(()=>{n("loading")},[e.src]);let d=X(()=>{let p={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(p.width=a),l&&(p.height=l),e.borderRadius&&(p.borderRadius=e.borderRadius),p},[a,l,e.borderRadius]),u=X(()=>{let p={display:"block",width:"100%",height:"100%"};return e.objectFit&&(p.objectFit=e.objectFit),t==="loading"&&(p.opacity="0",p.position="absolute"),t==="error"&&(p.display="none"),p},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let p=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,p),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?h=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(h=e.placeholder);let 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},h,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 ar(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 lr(e){let t=e.controls!==!1,n=oe(null),r=ve().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=G(!1),[a,l]=G(0),[d,u]=G(0),[h,m]=G(e.muted?0:1),[c,p]=G(!!e.muted),[f,y]=G(!0),b=typeof e.width=="number"?`${e.width}px`:e.width??"100%",g=typeof e.height=="number"?`${e.height}px`:e.height??"auto";ae(()=>{let I=n.current;if(!I)return;let P=()=>{s(!0),e.onPlay&&e.onPlay()},B=()=>{s(!1),e.onPause&&e.onPause()},E=()=>{s(!1),e.onEnded&&e.onEnded()},F=()=>{l(I.currentTime),u(I.duration),e.onTimeUpdate&&e.onTimeUpdate(I.currentTime,I.duration)},A=()=>{u(I.duration)};return I.addEventListener("play",P),I.addEventListener("pause",B),I.addEventListener("ended",E),I.addEventListener("timeupdate",F),I.addEventListener("loadedmetadata",A),()=>{I.removeEventListener("play",P),I.removeEventListener("pause",B),I.removeEventListener("ended",E),I.removeEventListener("timeupdate",F),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 P=n.current;if(!P||!isFinite(P.duration))return;let B=I.currentTarget.getBoundingClientRect(),E=Math.max(0,Math.min(1,(I.clientX-B.left)/B.width));P.currentTime=E*P.duration},[]),T=S(I=>{let P=n.current,B=parseFloat(I.target.value);P&&(P.volume=B,P.muted=B===0,m(B),p(B===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:b,height:g,display:"block"}});let C=d>0?a/d*100:0,$={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},L=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:f?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:x,style:$},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"}},`${ar(a)} / ${ar(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:T,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:D,style:$},"\u26F6"));return o("div",{style:{position:"relative",width:b,height:g,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:x,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function Be(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=S(d=>{if(!r)return;let u=d,h=s.current;if(!h)return;let m=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let p=t==="vertical",f=p?"ArrowDown":"ArrowRight",y=p?"ArrowUp":"ArrowLeft";if(u.key===f){u.preventDefault();let b=m[c+1];b&&b.focus()}else if(u.key===y){u.preventDefault();let b=m[c-1];b&&b.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 gt(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 De(){let[e,t]=G(!1);return{hover:e,onMouseEnter:S(()=>t(!0),[]),onMouseLeave:S(()=>t(!1),[])}}function ol(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:h}=De(),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 p=S(v=>{let T=v;m||(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),r())},[m,r]),f=S(()=>{m||r()},[m,r]),b=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),g=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,x=l==="left"?[b,g]:[g,b];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":m?"true":void 0,"data-section-id":t.id,tabIndex:m?-1:0,style:c,onClick:f,onKeyDown:p,onMouseEnter:u,onMouseLeave:h},...x)}function rl(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 cr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:h=!0,onChange:m}=e,[c,p]=G(()=>n??[]),f=S(b=>{p(g=>{let x=g.includes(b),v;return x?v=g.filter(T=>T!==b):r?v=[...g,b]:v=[b],m&&m(v),v})},[r,m]),y=X(()=>t.map(b=>{let g=c.includes(b.id),x=o(ol,{key:`header-${b.id}`,section:b,expanded:g,onToggle:()=>f(b.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(rl,{key:`content-${b.id}`,section:b,expanded:g,contentStyle:s,animated:h});return o("div",{key:b.id,"data-accordion-section":b.id,style:{width:"100%"}},x,v)}),[t,c,i,s,l,d,u,h,f]);return o(Be,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var il={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function dr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=G(!1),l=il[i],d=S(()=>{a(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!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,b)=>{let g=y===b.length-1,x=h&&f.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"},"...")):g?v.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},f.label)):f.href?v.push(o("a",{href:f.href,onClick:f.onClick?T=>{T.preventDefault(),f.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},f.label)):f.onClick?v.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)):v.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},f.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...v)},p=u.map((f,y)=>c(f,y,u));return o(Be,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...p))}function ur(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=De(),[d,u]=G(!1),h=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let m=t.disabled===!0,p={...gt(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=S(()=>{if(!m){if(h){u(T=>!T);return}t.onClick&&t.onClick(),r&&i()}},[m,h,t,r,i]),y=S(()=>{a(),h&&u(!0)},[h,a]),b=S(()=>{l(),h&&u(!1)},[h,l]),g=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),x=h?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,v=h&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(Be,{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(ur,{key:T.id,item:T,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:b},o("button",{type:"button",role:"menuitem",style:p,onClick:f,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},g,x),v)}function pr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,h]=G(!1),m=oe(null),c=S(()=>{h(T=>!T)},[]),p=S(()=>{h(!1)},[]);ae(()=>{if(!u)return;let T=D=>{let C=m.current;C&&!C.contains(D.target)&&h(!1)};return document.addEventListener("click",T,!0),()=>{document.removeEventListener("click",T,!0)}},[u]),ae(()=>{if(!u)return;let T=D=>{D.key==="Escape"&&h(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[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")),b=typeof d=="number"?`${d}px`:d,g={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:b,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:g},o(Be,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(T=>o(ur,{key:T.id,item:T,itemStyle:s,closeOnSelect:l,onClose:p})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,v)}function fr(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=De(),[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 h=t.disabled===!0,m=S(()=>{if(!h){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[h,u,t,n]),c=S(()=>{s(),u&&d(!0)},[u,s]),p=S(()=>{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:h?"default":"pointer",backgroundColor:!h&&i?"#f3f4f6":"transparent",color:h?"#9ca3af":"#1f2937",opacity:h?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),b=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,g=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(fr,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:p},o("button",{type:"button",role:"menuitem",style:f,onClick:m,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,b),g)}function sl(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=De(),h=oe(null),m=S(()=>{r?a():s(n)},[r,n,s,a]),c=S(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),p={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},f=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,b)=>o(fr,{key:String(b),item:y,onClose:a,index:b})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:p,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function gr(e){let{menus:t}=e,[n,r]=G(null),i=oe(null),s=S(d=>{r(d)},[]),a=S(()=>{r(null)},[]);ae(()=>{if(n===null)return;let d=u=>{let h=i.current;h&&!h.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),ae(()=>{let d=i.current;if(!d)return;let u=h=>{let m=h;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 p=c.querySelector('[role="menuitem"]');p&&p.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(sl,{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 Yt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function al(e,t,n){let r=n*2+5;if(e<=r)return Yt(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?[...Yt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...Yt(e-n*2-2,e)]:[1,"ellipsis",...Yt(i,s),"ellipsis",e]}var Vt={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"},ll={...Vt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},mr={...Vt,color:"#9ca3af",cursor:"default",opacity:"0.5"},cl={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function hr(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),h=Math.min(Math.max(1,r),u),m=S(b=>{!d&&b>=1&&b<=u&&b!==h&&i(b)},[d,u,h,i]),c=(b,g,x)=>{let v=d||g<1||g>u||g===h;return o("button",{type:"button",onClick:()=>m(g),disabled:v||void 0,"aria-label":x,style:v?mr:Vt},b)},p=al(u,h,s),f=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",h-1,"Go to previous page"));for(let b of p)if(b==="ellipsis")y.push(o("span",{key:`ellipsis-${f++}`,style:cl},"..."));else{let g=b===h;y.push(o("button",{key:String(b),type:"button",onClick:()=>m(b),disabled:d||void 0,"aria-label":`Page ${b}`,"aria-current":g?"page":void 0,style:d?mr:g?ll:Vt},String(b)))}return l&&y.push(c("\u203A",h+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(Be,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function br(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=De(),[u,h]=G(!1),m=t.children&&t.children.length>0,c=t.id===r,p=S(()=>{m&&!n&&h($=>!$),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"},b=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,g=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),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:p,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},b,g,x,v,T),C=!n&&m&&u?t.children.map($=>o(br,{key:$.id,item:$,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 xr(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,h=t.map(m=>o(br,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(Be,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...h)}var _e={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 yr(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,h=S(b=>{s&&i&&i(b)},[s,i]),m=b=>b<n?"completed":b===n?"active":"pending",c=(b,g,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:_e.completedBg,color:_e.completedText,border:`2px solid ${_e.completed}`}},a==="circle"?g.icon||"\u2713":null):x==="active"?o("div",{style:{...T,backgroundColor:"#ffffff",color:_e.activeText,border:`2px solid ${_e.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?g.icon||String(b+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:_e.active}})):o("div",{style:{...T,backgroundColor:"#ffffff",color:_e.pendingText,border:`2px solid ${_e.pending}`}},a==="circle"?g.icon||String(b+1):null)},p=b=>{if(b>=t.length-1)return null;let x=b<n?_e.lineCompleted:_e.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=(b,g)=>{let x=m(g),v=x==="active",T=x==="completed",D=c(g,b,x),C={fontSize:"13px",fontWeight:v?"600":"400",color:v||T?_e.labelActive:_e.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},$={fontSize:"11px",color:_e.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},b.label),b.description?o("span",{style:$},b.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(g),onClick:s?()=>h(g):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":v?"step":void 0},I)},y=[];return t.forEach((b,g)=>{y.push(f(b,g));let x=p(g);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 Sr={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 dl(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=De(),l=Sr[n],d=t.disabled===!0,u=t.type==="toggle",[h,m]=G(!1),c=u?t.active===!0:h,p=S(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=S(()=>{!d&&!u&&m(!0)},[d,u]),y=S(()=>{u||m(!1)},[u]),b=S(()=>{a(),u||m(!1)},[u,a]),g={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!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:g,onClick:p,onMouseDown:f,onMouseUp:y,onMouseEnter:s,onMouseLeave:b,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 vr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Sr[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(dl,{key:a.id,item:a,size:n,variant:r}));return o(Be,{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 mt=class e{constructor(t,n){Xe(this,"id");Xe(this,"label");Xe(this,"children");Xe(this,"expanded");Xe(this,"icon");Xe(this,"metadata");Xe(this,"parent");Xe(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 wr(e){e.expanded=!0;for(let t of e.children)wr(t)}function kr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)kr(n,t);return t}function ul(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function pl(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:h,onClick:m,focusedId:c}=e,p=De(),f=oe(null),y=c===t.id;ae(()=>{y&&f.current&&f.current.focus()},[y]);let b=t.isLeaf(),g=t.depth,x=[];for(let $=0;$<g;$++){let L=t;for(let P=0;P<g-$;P++)L=L?L.parent:null;let I=L?!ul(L):!1;x.push(o("span",{key:`connector-${$}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...I?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=g>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,T=b?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:$=>{$.stopPropagation(),h(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=gt(d,{hover:p.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":b?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":g+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:p.onMouseEnter,onMouseLeave:p.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 Cr(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:h="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:p,renderNode:f}=e,[y,b]=G(()=>{let I=mt.fromData(t);return a&&wr(I),I}),[g,x]=G(t.id),v=X(()=>kr(y),[y]),T=S(()=>{b(I=>{let P=Object.create(Object.getPrototypeOf(I));return Object.assign(P,I),P})},[]),D=S(I=>{I.toggle(),I.expanded?r?.(I):i?.(I),T()},[r,i,T]),C=S(I=>{x(I.id),n?.(I)},[n]),$=S(I=>{let P=I;if(!g)return;let B=v.findIndex(F=>F.id===g);if(B===-1)return;let E=v[B];switch(P.key){case"ArrowDown":{P.preventDefault();let F=v[B+1];F&&x(F.id);break}case"ArrowUp":{P.preventDefault();let F=v[B-1];F&&x(F.id);break}case"ArrowRight":{P.preventDefault(),E.isLeaf()||(E.expanded?E.children.length>0&&x(E.children[0].id):D(E));break}case"ArrowLeft":{P.preventDefault(),!E.isLeaf()&&E.expanded?D(E):E.parent&&x(E.parent.id);break}case"Enter":{P.preventDefault(),C(E);break}case" ":{P.preventDefault(),E.isLeaf()||D(E);break}case"Home":{P.preventDefault(),v.length>0&&x(v[0].id);break}case"End":{P.preventDefault(),v.length>0&&x(v[v.length-1].id);break}}},[g,v,D,C]),L=v.map(I=>o(pl,{key:I.id,node:I,isSelected:I.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:h,iconCollapsed:m,nodeStyle:c,renderNode:f,onToggle:D,onClick:C,focusedId:g}));return o(Be,{role:"tree",ariaLabel:"Tree navigation",styling:p,keyboardNav:!1},o("div",{onKeyDown:$,style:{outline:"none"}},...L))}function Mr(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=G(-1),[l,d]=G(null),u=oe(null);ae(()=>{if(!u.current)return;u.current.focus();let c=f=>{let y=f,b=t.map((g,x)=>({item:g,i:x})).filter(({item:g})=>!g.divider);if(y.key==="ArrowDown")y.preventDefault(),a(g=>{let v=(b.findIndex(({i:T})=>T===g)+1)%b.length;return b[v].i});else if(y.key==="ArrowUp")y.preventDefault(),a(g=>{let x=b.findIndex(({i:T})=>T===g),v=x<=0?b.length-1:x-1;return b[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 g=t[s];g.children?d(s):!g.disabled&&g.onClick&&(g.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let p=u.current;return()=>p.removeEventListener("keydown",c)},[t,s,i,r]);let h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},m=t.map((c,p)=>{if(c.divider)return o("div",{key:`divider-${p}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===p,y=!!c.disabled,b=!!(c.children&&c.children.length>0),g={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:f&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(p),d(b?p:null)},v=()=>{if(!y){if(b){d(p);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??"")),b&&T.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let D=[o("div",{key:`item-${p}`,style:g,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":y?"true":void 0},...T)];return b&&l===p&&D.push(o(Mr,{key:`submenu-${p}`,items:c.children,position:{x:n.x+178,y:n.y+p*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${p}`,style:{position:"relative"}},...D)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...m)}function Ut(e){let{items:t,children:n}=e,[r,i]=G(null),s=S(u=>{u.preventDefault();let h=u;i({x:h.clientX,y:h.clientY})},[]),a=S(()=>{i(null)},[]);ae(()=>{if(!r)return;let u=m=>{a()},h=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(h),document.removeEventListener("mousedown",u)}},[r,a]),ae(()=>{if(!r)return;let u=h=>{h.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(Mr,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function fl(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 gl(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 Er(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[h,m]=G(!1),[c,p]=G(!1),f=oe(null),y=s?"drawer-title":void 0;if(ae(()=>{if(t)m(!0),requestAnimationFrame(()=>p(!0));else{p(!1);let I=setTimeout(()=>m(!1),300);return()=>clearTimeout(I)}},[t]),ae(()=>{if(!t||!d)return;let I=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,d,n]),ae(()=>{if(!t)return;let I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[t]),ae(()=>{t&&f.current&&f.current.focus()},[t]),!h)return null;let b={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},g={...gl(r,i),transform:fl(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()},$=[];s&&$.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"))),$.push(o("div",{style:D},u));let L=[];return a&&L.push(o("div",{style:b,onClick:C})),L.push(o("div",{ref:f,style:g,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...$)),o("div",null,...L)}var ml={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Ir(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,h=oe(null);if(ae(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),ae(()=>{if(!t||!a)return;let C=$=>{$.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),ae(()=>{t&&h.current&&h.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:ml[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},p={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},f={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},b={padding:"24px",overflow:"auto",flex:"1"},g={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:f},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:p},...v),o("div",{style:b},u)];return l&&D.push(o("div",{style:g},l)),o("div",{style:m,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":T},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...D))}var Rr=8;function hl(e,t){let n=t+Rr;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 bl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Rr}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 Pr(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[h,m]=G(!1),c=u?r:h,p=oe(null),f=S(()=>{u?d&&d(!r):m(T=>!T)},[u,r,d]);ae(()=>{if(!c||!l)return;let T=D=>{p.current&&!p.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"},b={...hl(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},g=[n];a&&g.push(o("div",{style:bl(i)}));let x=S(T=>{let D=T.key;(D==="Enter"||D===" ")&&(T.preventDefault(),f())},[f]),v=[o("div",{onClick:f,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&v.push(o("div",{style:b},...g)),o("div",{ref:p,style:y},...v)}var xl=0;function yl(){return`toast-${++xl}-${Date.now()}`}function yn(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let h=yl();return n=[{id:h,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),h}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var Sl={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 vl(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 wl(e){let{item:t,onDismiss:n}=e,r=Sl[t.type];ae(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},a={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function Sn(e){let{toaster:t}=e,[,n]=G(0);ae(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=vl(t.config.position);ae(()=>{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 Nt=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var Ws=Object.getOwnPropertyNames;var _s=Object.prototype.hasOwnProperty;var Os=(e,t,n)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Hs=(e,t)=>{for(var n in t)Nt(e,n,{get:t[n],enumerable:!0})},Ys=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ws(t))!_s.call(e,i)&&i!==n&&Nt(e,i,{get:()=>t[i],enumerable:!(r=Ns(t,i))||r.enumerable});return e};var Vs=e=>Ys(Nt({},"__esModule",{value:!0}),e);var Ke=(e,t,n)=>Os(e,typeof t!="symbol"?t+"":t,n);var ku={};Hs(ku,{Accordion:()=>cr,Alert:()=>Co,AnalogClock:()=>co,AppContextProvider:()=>tt,Avatar:()=>fo,Badge:()=>go,BarGraph:()=>Ar,BigNumber:()=>Ji,BlochSphere:()=>Qi,BoxPlot:()=>es,Breadcrumb:()=>dr,BubbleChart:()=>ns,Button:()=>Xi,CalendarHeatMap:()=>is,Card:()=>Xo,Carousel:()=>ir,CartesianGraph2D:()=>Or,Checkbox:()=>$o,ChordDiagram:()=>ss,ColorPicker:()=>zo,ColorWheel:()=>Do,ComplexGraph2D:()=>Ur,ContextMenu:()=>Ut,DataGrid:()=>xo,DatePicker:()=>Bo,DecompositionTree:()=>as,DigitalClock:()=>yo,DiscreteCartesian2D:()=>Fs,DragDropProvider:()=>zt,Drawer:()=>Er,Dropdown:()=>pr,EmptyState:()=>Mo,FileUpload:()=>Fo,FlexContainer:()=>qo,FlexItem:()=>Ko,Footer:()=>ri,ForceGraph:()=>us,FormFieldWrapper:()=>Pe,FunnelChart:()=>fs,GanttChart:()=>hs,Gauge:()=>xs,GoogleAnalytics:()=>oi,Grid:()=>Zo,GridItem:()=>Jo,HeatMap:()=>Ss,Histogram:()=>vs,HypercubeGraph:()=>ei,IDE:()=>Kt,Image:()=>sr,LineGraph:()=>qr,ListView:()=>So,LollipopChart:()=>ws,Matrix:()=>ks,Menubar:()=>gr,MessageBusProvider:()=>$t,Modal:()=>Ir,MultilineField:()=>No,NavWrapper:()=>Be,NumberSpinner:()=>Wo,Pagination:()=>hr,Panel:()=>er,Partition:()=>Cs,PieGraph:()=>Kr,PivotTable:()=>Es,PolarGraph2D:()=>Jr,Popover:()=>Pr,ProgressBar:()=>Eo,RadarChart:()=>Is,RadioGroup:()=>_o,SankeyDiagram:()=>Rs,ScrollContainer:()=>nr,Select:()=>Oo,Sidebar:()=>xr,Skeleton:()=>Io,Slider:()=>Ho,Spinner:()=>Po,Splitter:()=>or,Stepper:()=>yr,Sunburst:()=>Ps,Tabs:()=>rr,Tag:()=>vo,TextEditor:()=>Yo,TextField:()=>Vo,ThreeDLayers:()=>Zi,TimePicker:()=>Uo,ToastContainer:()=>Sn,Toggle:()=>jo,Toolbar:()=>vr,Tooltip:()=>Tr,TradingDashboard:()=>Qt,TreeMap:()=>Ts,TreeNav:()=>Cr,TreeNode:()=>bt,USStateMap:()=>ys,US_STATE_PATHS:()=>Bt,UnityApp:()=>Ui,UnityDesktop:()=>Vi,VectorField:()=>As,VideoPlayer:()=>lr,VirtualScroll:()=>wo,VizWrapper:()=>ni,WaterfallChart:()=>Ls,WordCloud:()=>Bs,WordProcessor:()=>qt,applyGate:()=>Gn,blochToCartesian:()=>Mt,buildInputStyle:()=>Ve,buildNavItemStyle:()=>ht,buildRotationMatrix:()=>In,cartesianToBloch:()=>on,computeBoxStats:()=>qn,computeMandelbrotGrid:()=>Vr,computeSlices:()=>Cn,createToaster:()=>yn,describeArc:()=>kn,generateEdges:()=>En,generateHypercube:()=>It,generatePalette:()=>Xt,generateVertices:()=>Mn,numRotationAngles:()=>Rt,projectTo2D:()=>Pn,transformVec:()=>Rn,useAppId:()=>St,useBarGraphScales:()=>vn,useChannel:()=>Tt,useDragDrop:()=>ct,useDraggable:()=>An,useDropZone:()=>Dt,useHover:()=>De,useHypercube:()=>ti,useLineGraphScales:()=>wn,useMessageBus:()=>nt,useToast:()=>$r});module.exports=Vs(ku);var Wt=Symbol.for("spec.element"),Us=Symbol.for("spec.fragment"),Mu=Symbol.for("spec.portal"),no=Symbol.for("spec.provider"),oo=Symbol.for("spec.consumer"),js=Symbol.for("spec.forward_ref"),Gs=Symbol.for("spec.memo"),Xs=Symbol.for("spec.lazy"),qs=Symbol.for("spec.suspense"),Ks=Symbol.for("spec.strict_mode"),Zs=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:Wt,type:e,props:s,key:r,ref:i}}function Ye(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:no,_context:t},r={$$typeof:oo,_context:t};return t.Provider=n,t.Consumer=r,t}var gt=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){}};gt.prototype.isSpecComponent=!0;var _t=class extends gt{shouldComponentUpdate(t,n){return!io(this.props,t)||!io(this.state,n)}};_t.prototype.isPureSpecComponent=!0;function io(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 so=null;function Qe(){if(so===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return so}function G(e){return Qe().useState(e)}function se(e,t){return Qe().useEffect(e,t)}function _e(e){return Qe().useContext(e)}function pn(e,t,n){return Qe().useReducer(e,t,n)}function S(e,t){return Qe().useCallback(e,t)}function X(e,t){return Qe().useMemo(e,t)}function oe(e){return Qe().useRef(e)}function ve(){return Qe().useId()}var mt=Ye({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function ao(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Qs={pathname:ao(),hash:typeof window<"u"?window.location.hash:""},ea=new Set;function ta(){Qs={pathname:ao(),hash:typeof window<"u"?window.location.hash:""};for(let e of ea)e()}typeof window<"u"&&window.addEventListener("hashchange",ta);var lf=Ye({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function lo(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 pa(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 je={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function co(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(lo(a));se(()=>{let I=setInterval(()=>{u(lo(a))},1e3);return()=>clearInterval(I)},[a]);let h=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),p=h%12*30+m*.5,f=m*6+c*.1,y=c*6,b=n/2,g=n/2,x=n/2-10,v=x-4,T=x-22,D=[];D.push(o("circle",{cx:String(b),cy:String(g),r:String(x),fill:je.face,stroke:je.border,"stroke-width":"3"}));for(let I=0;I<12;I++){let B=(I*30-90)*Math.PI/180,E=v-6;D.push(o("line",{x1:String(b+E*Math.cos(B)),y1:String(g+E*Math.sin(B)),x2:String(b+v*Math.cos(B)),y2:String(g+v*Math.sin(B)),stroke:je.border,"stroke-width":"2"}));let F=String(I===0?12:I);if(D.push(o("text",{x:String(b+T*Math.cos(B)),y:String(g+T*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:je.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},F)),t==="24h"){let A=x-38,k=String(I===0?0:I+12);D.push(o("text",{x:String(b+A*Math.cos(B)),y:String(g+A*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:je.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(I,P,B,E)=>{let F=(I-90)*Math.PI/180;return o("line",{x1:String(b),y1:String(g),x2:String(b+P*Math.cos(F)),y2:String(g+P*Math.sin(F)),stroke:E,"stroke-width":B,"stroke-linecap":"round"})};D.push(C(p,x*.5,"4",je.hand)),D.push(C(f,x*.75,"3",je.hand)),s&&D.push(C(y,x*.85,"1.5",je.second)),D.push(o("circle",{cx:String(b),cy:String(g),r:"4",fill:je.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:je.numbers}},pa(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var gn={xs:24,sm:32,md:40,lg:56,xl:80};function fa(e){return e==null?gn.md:typeof e=="number"?e:gn[e]??gn.md}function ga(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 uo=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function ma(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return uo[Math.abs(t)%uo.length]}var po={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function ha(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 fo(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,h]=G(!1),m=fa(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,p=a??ma(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"},b;if(t&&!u)b=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let T=ga(r);b=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"},T)}let g=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":p},role:"img","aria-label":n??r??"avatar"},b);if(!l)return g;let x=Math.max(8,Math.round(m*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:po[l]??po.offline,border:"2px solid #fff",boxSizing:"border-box",...ha(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},g,o("span",{style:v,"aria-label":l}))}var ba={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"}},xa={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function go(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,h=r?{...xa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...ba[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:h,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return m??o("span",null);let c={...h,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var ya={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},mo={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},mn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},Sa="6px 8px",va={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},wa={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},ka={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},at={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Ca={...at,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},ho={...at,opacity:"0.5",cursor:"default"},bo={cursor:"pointer",width:"16px",height:"16px"};function Ma(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function xo(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:m,striped:c=!1,bordered:p=!1,compact:f=!1,stickyHeader:y=!1}=e,[b,g]=G(0),[x,v]=G(void 0),[T,D]=G("asc"),[C,$]=G([]),[L,I]=G({}),P=i??b,B=a??x,E=l??T,F=h??C,A=X(()=>{let J=Object.entries(L).filter(([,ae])=>ae.length>0);return J.length===0?n:n.filter(ae=>J.every(([le,pe])=>String(ae[le]??"").toLowerCase().includes(pe.toLowerCase())))},[n,L]),k=X(()=>{if(!B)return A;let J=[...A];return J.sort((ae,le)=>{let pe=ae[B],re=le[B];if(pe==null&&re==null)return 0;if(pe==null)return 1;if(re==null)return-1;if(typeof pe=="number"&&typeof re=="number")return E==="asc"?pe-re:re-pe;let he=String(pe),be=String(re),te=he.localeCompare(be);return E==="asc"?te:-te}),J},[A,B,E]),w=k.length,R=r?Math.max(1,Math.ceil(w/r)):1,M=r?k.slice(P*r,(P+1)*r):k,N=S(J=>{s?s(J):g(J)},[s]),z=S(J=>{let ae=B===J&&E==="asc"?"desc":"asc";d?d(J,ae):(v(J),D(ae))},[B,E,d]),W=S(J=>{let ae=F.includes(J)?F.filter(le=>le!==J):[...F,J];m?m(ae):$(ae)},[F,m]),_=S(()=>{let J=M.map((pe,re)=>r?P*r+re:re),le=J.every(pe=>F.includes(pe))?F.filter(pe=>!J.includes(pe)):[...new Set([...F,...J])];m?m(le):$(le)},[M,F,r,P,m]),O=S((J,ae)=>{I(le=>({...le,[J]:ae})),N(0)},[N]),U=t.some(J=>J.filterable),q=f?Sa:mn.padding,ee=[];if(u){let J=M.map((le,pe)=>r?P*r+pe:pe),ae=J.length>0&&J.every(le=>F.includes(le));ee.push(o("th",{key:"__select_all",style:{...mo,padding:q,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:ae,onChange:_,style:bo,"aria-label":"Select all rows"})))}for(let J of t){let ae={...mo,padding:q,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...p?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},le=[J.header];J.sortable&&le.push(o("span",{style:va},Ma(J.key,B,E))),ee.push(o("th",{key:J.key,style:ae,onClick:J.sortable?()=>z(J.key):void 0,onKeyDown:J.sortable?pe=>{let re=pe.key;(re==="Enter"||re===" ")&&(pe.preventDefault(),z(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":B===J.key?E==="asc"?"ascending":"descending":void 0},...le))}let Z=null;if(U){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:q}}));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:wa,value:L[ae.key]??"",onInput:le=>O(ae.key,le.target.value),"aria-label":`Filter by ${ae.header}`}):null));Z=o("tr",{key:"__filter_row"},...J)}let V=[];for(let J=0;J<M.length;J++){let ae=M[J],le=r?P*r+J:J,pe=F.includes(le),re={};c&&J%2===1&&(re.backgroundColor="#f9fafb"),pe&&(re.backgroundColor="#eff6ff");let he=[];u&&he.push(o("td",{key:"__select",style:{padding:q,textAlign:"center",...mn,...p?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:pe,onChange:()=>W(le),style:bo,"aria-label":`Select row ${le+1}`})));for(let be of t){let te=ae[be.key],ce=be.render?be.render(te,ae):String(te??"");he.push(o("td",{key:be.key,style:{...mn,padding:q,...p?{border:"1px solid #e5e7eb"}:{}}},ce))}V.push(o("tr",{key:String(le),style:re},...he))}let j=null;if(r){let J=w===0?0:P*r+1,ae=Math.min((P+1)*r,w),le=[];le.push(o("button",{key:"prev",style:P===0?ho:at,onClick:P>0?()=>N(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let pe=7,re=Math.max(0,P-Math.floor(pe/2)),he=Math.min(R,re+pe);he-re<pe&&(re=Math.max(0,he-pe)),re>0&&(le.push(o("button",{key:"p0",style:at,onClick:()=>N(0)},"1")),re>1&&le.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let be=re;be<he;be++)le.push(o("button",{key:`p${be}`,style:be===P?Ca:at,onClick:be!==P?()=>N(be):void 0,"aria-current":be===P?"page":void 0},String(be+1)));he<R&&(he<R-1&&le.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),le.push(o("button",{key:`p${R-1}`,style:at,onClick:()=>N(R-1)},String(R)))),le.push(o("button",{key:"next",style:P>=R-1?ho:at,onClick:P<R-1?()=>N(P+1):void 0,disabled:P>=R-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:ka},o("span",null,`Showing ${J}\u2013${ae} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...le))}let H={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},Y={...ya,...p?{border:"1px solid #e5e7eb"}:{}},K=o("thead",null,o("tr",null,...ee),Z),Q=o("tbody",null,...V),ie=o("table",{style:Y,role:"grid","aria-rowcount":String(w)},K,Q);return o("div",{style:H},ie,j)}function lt(e){return e<10?`0${e}`:String(e)}function Ea(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 Ia(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"?`${lt(e.getMonth()+1)}/${lt(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${lt(e.getMonth()+1)}-${lt(e.getDate())}`}var Ra={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"},Pa={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},$a={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Ta={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function yo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=G(new Date);se(()=>{let g=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(g)},[]);let{hours:u,minutes:h,seconds:m}=Ea(l,s),c,p=null;t==="12h"?(p=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${lt(c)}:${lt(h)}`;i&&(f+=`:${lt(m)}`);let y=[f];p!=null&&y.push(o("span",{style:$a},p));let b=[o("span",{style:Pa},...y)];return n&&b.push(o("span",{style:Ta},Ia(l,r,s))),o("div",{style:Ra,...a?{class:a}:{}},...b)}var za={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Da={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"},Ba={backgroundColor:"var(--color-bg-muted, #eff6ff)"},Fa={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Ot={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 So(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:h}=e;if(t.length===0)return o("div",null,u?o("div",{style:Ot},u):null,o("div",{style:Fa},d),h?o("div",{style:{...Ot,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let m=[];for(let c=0;c<t.length;c++){let p=t[c],f=r(p,c),y=a===c,b=c===t.length-1,g={...Da,...s?La:{},...y?Ba:{},...i&&!b?Aa:{}};m.push(o("li",{key:f,style:g,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(p,c)))}return o("div",null,u?o("div",{style:Ot},u):null,o("ul",{style:za,role:l?"listbox":"list"},...m),h?o("div",{style:{...Ot,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function Na(e){return e??"#3b82f6"}function Wa(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 _a={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 Oa(e,t,n,r,i){let s=_a[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:Wa(e,.12),color:e,border:"none"};default:return a}}var Ha={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 vo(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,h=Na(n),m=Oa(h,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:Ha,onClick:p=>{p.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?p=>{let f=p.key;(f==="Enter"||f===" ")&&(p.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var Ya={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function wo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=G(0),d=oe(null),u=t.length*r,h=parseInt(s,10)||400,m=Math.ceil(h/r),c=Math.max(0,Math.floor(a/r)-i),p=Math.min(t.length,Math.floor(a/r)+m+i),f=S(b=>{let g=b.target;l(g.scrollTop)},[]),y=[];for(let b=c;b<p;b++)y.push(o("div",{key:String(b),style:{position:"absolute",top:`${b*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[b],b)));return o("div",{ref:d,style:{...Ya,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var ko={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 Co(e){let[t,n]=G(!0),r=e.type??"info",i=e.variant??"subtle",s=ko[r]??ko.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 Mo(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 Eo(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=ve().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let p=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(p/10)),y=(p-f)/2,b=2*Math.PI*y,g=e.indeterminate?b*.75:b-r/100*b,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(p),height:String(p),viewBox:`0 0 ${p} ${p}`,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(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(b),"stroke-dashoffset":String(g),"stroke-linecap":"round",transform:`rotate(-90 ${p/2} ${p/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",h=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",m={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=X(()=>{let p={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(p.position="absolute",p.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,p.backgroundColor=i):(p.width=`${r}%`,p.backgroundColor=i),e.animated&&!e.indeterminate&&(p.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${Va(i)} 50%, ${i} 100%)`,p.backgroundSize="200% 100%",p.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),p},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||h?o("style",null,u+h):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:m},o("div",{style:c})))}function Va(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 Io(e){let t=e.variant??"text",n=e.animated!==!1,r=ve().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 h=u===l-1&&l>1;d.push(o("div",{key:String(u),style:hn({width:h?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:hn({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:hn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function hn(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 Ua={sm:16,md:24,lg:40},Ro={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Po(e){let t=typeof e.size=="number"?e.size:Ua[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=Ro[e.speed??"normal"]??Ro.normal,s=e.label??"Loading",l=ve().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,h=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,h),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function Pe(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function Ve(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 ja={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function $o(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,h=oe(null);se(()=>{h.current&&(h.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]),p=ja[u],f=`${p.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",b=r||a?"#3b82f6":"#ffffff",g={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:b,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${p.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:h,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),C=o("div",{style:g},v),$=s?o("span",{style:{fontSize:p.fontSize,color:"#374151"}},s):null;return o(Pe,{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,$))}var Ga=["#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 To(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function Ht(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 zo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=Ga,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[h,m]=G(!1),[c,p]=G(r),f=oe(null);se(()=>{p(r)},[r]),se(()=>{let I=P=>{f.current&&!f.current.contains(P.target)&&m(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let y=S(I=>{d||i(Ht(I))},[d,i]),b=S(I=>{let P=I.target.value;p(P);let B=P.startsWith("#")?P:`#${P}`;To(B)&&i(Ht(B))},[i]),g=S(()=>{To(c.startsWith("#")?c:`#${c}`)||p(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 P=Ht(I)===Ht(r);return o("div",{key:I,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:I,cursor:d?"not-allowed":"pointer",border:P?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(I),onKeyDown:E=>{let F=E.key;(F==="Enter"||F===" ")&&(E.preventDefault(),y(I))},role:"button",tabIndex:d?-1:0,title:I,"aria-label":`Select color ${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:b,onBlur:g,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=h?o("div",{style:T},o("div",{style:D},...C),$):null;return o(Pe,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>m(!h),onKeyDown:d?void 0:I=>{let P=I.key;(P==="Enter"||P===" ")&&(I.preventDefault(),m(!h))},role:"button",tabIndex:d?-1:0,"aria-expanded":h?"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 Do(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,h]=G(r),m=oe(null),c=S(((...b)=>{let x=b[0].target.value;h(x),i?.(x)}),[i]),p={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},f={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(Pe,{label:d,htmlFor:n},o("div",{style:p},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 Ao=["January","February","March","April","May","June","July","August","September","October","November","December"],Xa=["Su","Mo","Tu","We","Th","Fr","Sa"];function bn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function qa(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 Lo(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 Bo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:h,error:m}=e,c=X(()=>bn(r),[r]),p=X(()=>bn(a),[a]),f=X(()=>bn(l),[l]),[y,b]=G(!1),[g,x]=G(()=>c?c.getFullYear():new Date().getFullYear()),[v,T]=G(()=>c?c.getMonth():new Date().getMonth()),D=oe(null),C=X(()=>new Date,[]);se(()=>{let z=W=>{D.current&&!D.current.contains(W.target)&&b(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let $=S(()=>{T(z=>z===0?(x(W=>W-1),11):z-1)},[]),L=S(()=>{T(z=>z===11?(x(W=>W+1),0):z+1)},[]),I=S(z=>{let W=new Date(g,v,z);p&&W<p||f&&W>f||(i(Ka(W)),b(!1))},[g,v,i,p,f]),P=c?qa(c,s):"",B=X(()=>{let z=new Date(g,v,1).getDay(),W=new Date(g,v+1,0).getDate(),_=[],O=[];for(let U=0;U<z;U++)O.push(null);for(let U=1;U<=W;U++)O.push(U),O.length===7&&(_.push(O),O=[]);for(;O.length>0&&O.length<7;)O.push(null);return O.length&&_.push(O),_},[g,v]),E={...Ve({},{focused:y,error:!!m}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},F={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"},R=Xa.map(z=>o("div",{key:z,style:{padding:"4px"}},z)),M=B.map((z,W)=>{let _=z.map((O,U)=>{if(O===null)return o("div",{key:`empty-${W}-${U}`,style:{padding:"4px"}});let q=new Date(g,v,O),ee=Lo(q,C),Z=c?Lo(q,c):!1,V=p&&q<p||f&&q>f,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-${O}`,style:j,onClick:V?void 0:()=>I(O),onKeyDown:V?void 0:H=>{let Y=H.key;(Y==="Enter"||Y===" ")&&(H.preventDefault(),I(O))},role:V?void 0:"button",tabIndex:V?void 0:0,"aria-label":`${Ao[v]} ${O}, ${g}`,"aria-disabled":V?"true":void 0},String(O))});return o("div",{key:`row-${W}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},..._)}),N=y?o("div",{style:F},o("div",{style:A},o("button",{type:"button",style:k,onClick:$},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Ao[v]} ${g}`),o("button",{type:"button",style:k,onClick:L},"\u25B6")),o("div",{style:w},...R),...M):null;return o(Pe,{label:h,error:m,disabled:d,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},o("div",{id:n,style:E,onClick:d?void 0:()=>b(!y),onKeyDown:d?void 0:z=>{let W=z.key;(W==="Enter"||W===" ")&&(z.preventDefault(),b(!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 xn(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 Fo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[h,m]=G([]),[c,p]=G(!1),[f,y]=G(""),b=oe(null),g=S(k=>{y("");let w=[];for(let M of k){if(a&&M.size>a){y(`File "${M.name}" exceeds maximum size of ${xn(a)}`);continue}w.push(M)}let R=s?[...h,...w]:w.slice(0,1);m(R),r(R)},[h,s,a,r]),x=S(k=>{if(k.preventDefault(),k.stopPropagation(),p(!1),l)return;let w=k.dataTransfer;if(!w)return;let R=Array.from(w.files);g(R)},[l,g]),v=S(k=>{k.preventDefault(),k.stopPropagation(),l||p(!0)},[l]),T=S(k=>{k.preventDefault(),k.stopPropagation(),p(!1)},[]),D=S(k=>{let w=k.target;w.files&&(g(Array.from(w.files)),w.value="")},[g]),C=S(k=>{let w=h.filter((R,M)=>M!==k);m(w),r(w)},[h,r]),$=S(()=>{l||b.current&&b.current.click()},[l]),L={border:`2px dashed ${c?"#3b82f6":f?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:l?"0.6":"1"},I={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},P={fontSize:"14px",color:"#374151",marginBottom:"4px"},B={fontSize:"12px",color:"#9ca3af"},E=o("input",{id:n,ref:b,type:"file",accept:i,multiple:s,onChange:D,disabled:l,style:{display:"none"},tabIndex:-1}),F=o("div",{style:L,onClick:$,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),$())},onDrop:x,onDragOver:v,onDragLeave:T,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:I},"\u2191"),o("div",{style:P},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:B},i):null,a?o("div",{style:B},`Max size: ${xn(a)}`):null),A=h.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...h.map((k,w)=>{let R={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:R},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"}},xn(k.size))),o("button",{type:"button",style:M,onClick:N=>{N.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(Pe,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,E,F,A))}function No(e){let[t,n]=G(!1),[r,i]=G((e.value??e.defaultValue??"").length),s=ve().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...Ve(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 p=c.target,f=p.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(p.style.height="auto",p.style.height=`${p.scrollHeight}px`)},[e.onChange,e.autoResize]),h=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),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(Pe,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,m)}function Wo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:h,label:m,error:c}=e,[p,f]=G(!1),y=S(w=>{let R=w;return s!==void 0&&R<s&&(R=s),a!==void 0&&R>a&&(R=a),R},[s,a]),b=S(()=>{d||i(y(r+l))},[d,r,l,y,i]),g=S(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=S(w=>{let R=w.target.value;if(R===""||R==="-")return;let M=parseFloat(R);isNaN(M)||i(y(M))},[y,i]),v=S(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),b()):w.key==="ArrowDown"&&(w.preventDefault(),g()))},[d,b,g]),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":p?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...p&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},$=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)"},P=o("button",{type:"button",style:$(T),onClick:g,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),B=u?o("span",{style:I},u):null,E=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:v,onFocus:()=>f(!0),onBlur:()=>f(!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}),F=h?o("span",{style:I},h):null,A=o("button",{type:"button",style:$(D),onClick:b,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[P];return B&&k.push(B),k.push(E),F&&k.push(F),k.push(A),o(Pe,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function _o(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:h}=e,m=S(y=>{d||s(y)},[d,s]),c=S(y=>{if(d)return;let b=r.filter(v=>!v.disabled);if(b.length===0)return;let g=b.findIndex(v=>v.value===i),x=g;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),x=g<b.length-1?g+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),x=g>0?g-1:b.length-1;else return;s(b[x].value)},[d,r,i,s]),p={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((y,b)=>{let g=y.value===i,x=d||!!y.disabled,v=`${n}-opt-${b}`,T={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":g?"#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:g?"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:$=>{$.preventDefault(),m(y.value)}},o("input",{type:"radio",id:v,name:a,value:y.value,checked:g,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(Pe,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:p,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...f))}function Oo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:h=!1,error:m,label:c,helpText:p}=e,[f,y]=G(!1),[b,g]=G(""),[x,v]=G(-1),T=oe(null),D=X(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=X(()=>{if(!l||!b)return r;let z=b.toLowerCase();return r.filter(W=>W.label.toLowerCase().includes(z))},[r,b,l]),$=X(()=>{let z={},W=[];for(let _ of C)_.group?(z[_.group]||(z[_.group]=[]),z[_.group].push(_)):W.push(_);return{groups:z,ungrouped:W}},[C]),L=X(()=>D.length===0?"":D.map(W=>r.find(_=>_.value===W)).filter(Boolean).map(W=>W.label).join(", "),[D,r]);se(()=>{let z=W=>{let _=W.target;T.current&&!T.current.contains(_)&&(y(!1),g(""))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let I=S(z=>{if(d){let W=D.includes(z)?D.filter(_=>_!==z):[...D,z];s(W)}else s(z),y(!1),g("")},[d,D,s]),P=S(z=>{z.stopPropagation(),s(d?[]:"")},[d,s]),B=S(z=>{if(h)return;let W=z.key;if(!f&&(W==="Enter"||W===" "||W==="ArrowDown")){z.preventDefault(),y(!0),v(0);return}if(f){if(W==="Escape"){y(!1),g("");return}if(W==="ArrowDown")z.preventDefault(),v(_=>Math.min(_+1,C.length-1));else if(W==="ArrowUp")z.preventDefault(),v(_=>Math.max(_-1,0));else if(W==="Enter"&&x>=0&&x<C.length){z.preventDefault();let _=C[x];_.disabled||I(_.value)}}},[h,f,x,C,I]),E={...Ve({},{focused:f,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},F={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,W)=>{let _=D.includes(z.value),O=W===x,U={padding:"8px 12px",cursor:z.disabled?"not-allowed":"pointer",backgroundColor:O?"#f3f4f6":_?"#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(W),role:"option","aria-selected":_?"true":"false","aria-disabled":z.disabled?"true":void 0},d&&_?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,z.label)},k=()=>{let z=[],W=0,{groups:_,ungrouped:O}=$;for(let U of O)z.push(A(U,W++));for(let U of Object.keys(_)){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 q of _[U])z.push(A(q,W++))}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:f?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),R=o("div",{style:E,id:n,onClick:h?void 0:()=>{y(!f),v(-1)},onKeyDown:B,tabIndex:h?-1:0,role:"combobox","aria-expanded":f?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:L?"#1f2937":"#9ca3af"}},L||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&D.length>0?o("span",{onClick:P,onKeyDown:z=>{let W=z.key;(W==="Enter"||W===" ")&&(z.preventDefault(),z.stopPropagation(),P(z))},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:b,onInput:z=>{g(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,N=f?o("div",{style:F,role:"listbox"},M,...k()):null;return o(Pe,{label:c,error:m,helpText:p,disabled:h,htmlFor:n},o("div",{ref:T,style:{position:"relative"}},R,N))}function Ho(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:h=!1,marks:m,range:c=!1,label:p,error:f}=e,y=oe(null),b=oe(i);b.current=i;let[g,x]=G(null),v=X(()=>{if(c&&Array.isArray(r))return r;let W=typeof r=="number"?r:0;return[W,W]},[r,c]),T=oe(v);T.current=v;let D=W=>{let _=Math.round((W-s)/l)*l+s;return Math.max(s,Math.min(a,_))},C=W=>(W-s)/(a-s)*100,$=S(W=>{if(!y.current)return s;let _=y.current.getBoundingClientRect(),O=Math.max(0,Math.min(1,(W.clientX-_.left)/_.width));return D(s+O*(a-s))},[s,a,l]),L=S(W=>_=>{h||(_.preventDefault(),x(W))},[h]),I=S(W=>{if(h)return;let _=$(W);if(c){let O=Math.abs(_-v[0]),U=Math.abs(_-v[1]);O<=U?i([D(_),v[1]]):i([v[0],D(_)])}else i(D(_))},[h,$,c,v,i,s,a,l]);se(()=>{if(!g)return;let W=O=>{let U=$(O),q=T.current,ee=b.current;g==="single"?ee(D(U)):g==="start"?ee([Math.min(D(U),q[1]),q[1]]):g==="end"&&ee([q[0],Math.max(q[0],D(U))])},_=()=>x(null);return document.addEventListener("mousemove",W),document.addEventListener("mouseup",_),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",_)}},[g,$,s,a,l]);let P=S(W=>{if(h)return;let _=0;if(W.key==="ArrowRight"||W.key==="ArrowUp")_=l;else if(W.key==="ArrowLeft"||W.key==="ArrowDown")_=-l;else return;W.preventDefault(),c||i(D((typeof r=="number"?r:0)+_))},[h,l,c,r,i,s,a]),B={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},E=c?C(v[0]):0,F=C(c?v[1]:v[0]),A={position:"absolute",top:"0",left:`${E}%`,width:`${F-E}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=W=>p?W==="start"?`${p} minimum`:W==="end"?`${p} maximum`:p:W==="start"?"Minimum value":W==="end"?"Maximum value":"Value",w=(W,_,O)=>{let U={position:"absolute",top:"50%",left:`${W}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${h?"#9ca3af":"#3b82f6"}`,cursor:h?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},q={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:_==="single"||_==="start"?n:void 0,style:U,onMouseDown:L(_),role:"slider","aria-valuenow":String(O),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(_),tabIndex:h?-1:0,onKeyDown:P},d?o("div",{style:q},String(O)):null)},R=[];if(u)for(let W=s;W<=a;W+=l)R.push(o("div",{key:`tick-${W}`,style:{position:"absolute",top:"10px",left:`${C(W)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let M=[];if(m)for(let W of m)M.push(o("div",{key:`mark-${W.value}`,style:{position:"absolute",top:"18px",left:`${C(W.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},W.label));let N={paddingTop:d?"28px":"8px",paddingBottom:m||u?"28px":"8px",opacity:h?"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(Pe,{label:p,error:f,htmlFor:n},o("div",{style:N},o("div",{ref:y,style:B,role:"presentation",onClick:I},o("div",{style:A}),...z,...R,...M)))}var Za=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Ja={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 Yo(e){let[t,n]=G(!1),r=oe(null),i=ve().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??Za,l=e.toolbarStyle??{},d=e.editorStyle??{};se(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=S((f,y)=>{if(!(e.disabled||e.readOnly)){if(f==="createLink"){let b=prompt("Enter URL:");if(!b)return;document.execCommand(f,!1,b)}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]),h=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(f=>{let y=Ja[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})),p=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding: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:h});return o(Pe,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,p))}function Vo(e){let[t,n]=G(!1),r=ve().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Ve(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let h=u.target.value;e.onInput&&e.onInput(h),e.onChange&&e.onChange(h)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(Pe,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Qa=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function et(e){return String(e).padStart(2,"0")}function el(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 Uo(e){let t=ve().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:h=!1,timezone:m,showTimezone:c=!1,timezones:p=Qa,onTimezoneChange:f}=e,[y,b]=G(!1),g=X(()=>el(r),[r]),x=s==="12h",v=g.hour>=12,T=x?g.hour%12||12:g.hour,D=S((j,H,Y)=>{let K=Math.max(0,Math.min(23,j)),Q=Math.max(0,Math.min(59,H)),ie=Math.max(0,Math.min(59,Y??0));i(h?`${et(K)}:${et(Q)}:${et(ie)}`:`${et(K)}:${et(Q)}`)},[i,h]),C=S(j=>{let H=parseInt(j.target.value,10)||0;x&&(H=H%12,v&&(H+=12)),D(H,g.minute,g.second)},[x,v,g.minute,g.second,D]),$=S(j=>{let H=parseInt(j.target.value,10)||0;D(g.hour,H,g.second)},[g.hour,g.second,D]),L=S(j=>{let H=parseInt(j.target.value,10)||0;D(g.hour,g.minute,H)},[g.hour,g.minute,D]),I=S(()=>{if(l)return;let j=v?g.hour-12:g.hour+12;D(j,g.minute,g.second)},[l,v,g.hour,g.minute,g.second,D]),P=S(j=>{l||D(g.hour+j,g.minute,g.second)},[l,g.hour,g.minute,g.second,D]),B=S(j=>{l||D(g.hour,g.minute+j*a,g.second)},[l,g.hour,g.minute,g.second,a,D]),E=S(j=>{l||D(g.hour,g.minute,g.second+j)},[l,g.hour,g.minute,g.second,D]),F=S(j=>{let H=j.target.value;f&&f(H)},[f]),A={display:"inline-flex",alignItems:"center",gap:"4px",...Ve({},{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"},R={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:et(T),onChange:C,style:R,disabled:l,"aria-label":"Hour",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:w,onClick:()=>P(-1),disabled:l},"\u25BC")),z=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),W=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>B(1),disabled:l},"\u25B2"),o("input",{type:"text",value:et(g.minute),onChange:$,style:R,disabled:l,"aria-label":"Minute",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:w,onClick:()=>B(-1),disabled:l},"\u25BC")),_=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,O=h?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>E(1),disabled:l},"\u25B2"),o("input",{type:"text",value:et(g.second),onChange:L,style:R,disabled:l,"aria-label":"Second",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:w,onClick:()=>E(-1),disabled:l},"\u25BC")):null,U=x?o("button",{type:"button",style:M,onClick:I,disabled:l,"aria-label":"Toggle AM/PM"},v?"PM":"AM"):null,q={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},ee=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,Z=c?o("select",{style:q,value:m??p[0],onChange:F,disabled:l,"aria-label":"Timezone"},...p.map(j=>o("option",{key:j,value:j},j))):null,V=[N,z,W];return _&&V.push(_),O&&V.push(O),U&&V.push(U),ee&&V.push(ee),Z&&V.push(Z),o(Pe,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:A},...V))}var tl={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 jo(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=tl[a],h=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"},p=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:`${p}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},b=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,g=o("div",{style:c},o("div",{style:f}));return o("div",{style:y,onClick:h,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[b,g]:[g,b]).filter(Boolean))}var Go={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 Xo(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=X(()=>{let h={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(h.border="1px solid #e5e7eb"),h.boxShadow=Go[n]??Go.sm,e.hoverable&&(h.cursor="pointer"),{...h,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function qo(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 Ko(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 Zo(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 Jo(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 Qo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function er(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=G(!!e.defaultCollapsed),s=oe(null),[a,l]=G("auto");se(()=>{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 b=y.key;(b==="Enter"||b===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),h=X(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Qo[n]??Qo.none,{...y,...e.style??{}}},[t,n,e.style]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},p={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},f={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:h},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?p:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function tr(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function nl(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 nr(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=oe(null),[s,a]=G(!0),[l,d]=G(!1),[u,h]=G(!0),[m,c]=G(!1),p=S(()=>{let x=i.current;if(!x)return;let v=2;a(x.scrollTop<=v),d(x.scrollTop+x.clientHeight>=x.scrollHeight-v),h(x.scrollLeft<=v),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-v)},[]);se(()=>{p()},[p]);let f=S(()=>{r&&p()},[r,p]),y=X(()=>{let x={position:"relative",overflowX:tr(t,"x"),overflowY:tr(t,"y"),...nl(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]),b=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&b.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&b.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&b.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!m&&b.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let g={...y};return b.length>0&&(g.boxShadow=b.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:g,ref:i,onScroll:f},e.children)}function or(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=G(e.initialSplit??50),l=oe(null),d=oe(!1),u=S(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);se(()=>{let y=g=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,T=n?g.clientX-x.left:g.clientY-x.top;if(v<=0)return;let D=i/v*100,C=e.maxSize?e.maxSize/v*100:100-D,$=T/v*100;$=Math.max(D,Math.min(C,$)),a($)},b=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",b)}},[n,i,e.maxSize]);let h=X(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},p={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},f=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:h,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},f[0]??null),o("div",{className:"splitter__divider",style:p,onMouseDown:u,onKeyDown:y=>{let b=y.key,g=2;n&&(b==="ArrowLeft"||b==="ArrowRight")?(y.preventDefault(),a(x=>{let v=b==="ArrowRight"?g:-g;return Math.max(5,Math.min(95,x+v))})):!n&&(b==="ArrowUp"||b==="ArrowDown")&&(y.preventDefault(),a(x=>{let v=b==="ArrowDown"?g:-g;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},f[1]??null))}function rr(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(g=>!g.disabled)?.id??"",[i,s]=G(e.activeTab??r),a=e.activeTab??i,l=oe(null),d=S(g=>{s(g),e.onChange&&e.onChange(g)},[e.onChange]),u=S(g=>{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",$=-1;if(g.key===D?$=v>0?v-1:x.length-1:g.key===C?$=v<x.length-1?v+1:0:g.key==="Home"?$=0:g.key==="End"&&($=x.length-1),$>=0){g.preventDefault(),d(x[$].id);let L=l.current;if(L){let P=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[$])];P&&P.focus()}}},[e.tabs,a,t,d]),h=t==="left"||t==="right",m=t==="bottom"||t==="right",c=X(()=>({display:"flex",flexDirection:h?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[h,m,e.style]),p={display:"flex",flexDirection:h?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!h?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&h?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},f={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(g=>g.id===a),b=e.tabs.map(g=>{let x=g.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:g.disabled?"not-allowed":"pointer",opacity:g.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"?h?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:g.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${g.id}`,"aria-disabled":g.disabled?"true":void 0,id:`tab-${g.id}`,tabIndex:x?"0":"-1",style:v,onClick:g.disabled?void 0:()=>d(g.id),onKeyDown:u},g.icon?o("span",{className:"tabs__tab-icon"},g.icon):null,g.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":h?"vertical":"horizontal",style:p,ref:l},...b),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},y?y.content:null))}function ir(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=ve().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=G(0),m=oe(null),c=oe(null),p=S(C=>{let $=C;r?$=(C%n+n)%n:$=Math.max(0,Math.min(C,n-1)),h($),e.onChange&&e.onChange($)},[n,r,e.onChange]),f=S(()=>p(u+1),[u,p]),y=S(()=>p(u-1),[u,p]);se(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(f,l);return()=>clearInterval(C)},[e.autoPlay,l,f,n]),se(()=>{let C=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&f()},$=c.current;if($)return $.addEventListener("keydown",C),()=>$.removeEventListener("keydown",C)},[f,y]);let b=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",g={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]),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,$)=>{let L=a==="fade"?{position:$===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:$===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String($),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,$)=>o("button",{key:String($),"aria-label":`Go to slide ${$+1}`,onclick:()=>p($),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:$===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:g,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let $=C.clientX-m.current;$>50?y():$<-50&&f(),m.current=null}},b?o("style",null,b):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:f,style:{...v,right:"8px"}},"\u203A"):null,D)}function sr(e){let[t,n]=G("loading"),r=oe(null),i=ve().replace(/[^a-zA-Z0-9_-]/g,""),s=e.lazy!==!1,a=typeof e.width=="number"?`${e.width}px`:e.width,l=typeof e.height=="number"?`${e.height}px`:e.height;se(()=>{n("loading")},[e.src]);let d=X(()=>{let p={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(p.width=a),l&&(p.height=l),e.borderRadius&&(p.borderRadius=e.borderRadius),p},[a,l,e.borderRadius]),u=X(()=>{let p={display:"block",width:"100%",height:"100%"};return e.objectFit&&(p.objectFit=e.objectFit),t==="loading"&&(p.opacity="0",p.position="absolute"),t==="error"&&(p.display="none"),p},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let p=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,p),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?h=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(h=e.placeholder);let 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},h,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 ar(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 lr(e){let t=e.controls!==!1,n=oe(null),r=ve().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=G(!1),[a,l]=G(0),[d,u]=G(0),[h,m]=G(e.muted?0:1),[c,p]=G(!!e.muted),[f,y]=G(!0),b=typeof e.width=="number"?`${e.width}px`:e.width??"100%",g=typeof e.height=="number"?`${e.height}px`:e.height??"auto";se(()=>{let I=n.current;if(!I)return;let P=()=>{s(!0),e.onPlay&&e.onPlay()},B=()=>{s(!1),e.onPause&&e.onPause()},E=()=>{s(!1),e.onEnded&&e.onEnded()},F=()=>{l(I.currentTime),u(I.duration),e.onTimeUpdate&&e.onTimeUpdate(I.currentTime,I.duration)},A=()=>{u(I.duration)};return I.addEventListener("play",P),I.addEventListener("pause",B),I.addEventListener("ended",E),I.addEventListener("timeupdate",F),I.addEventListener("loadedmetadata",A),()=>{I.removeEventListener("play",P),I.removeEventListener("pause",B),I.removeEventListener("ended",E),I.removeEventListener("timeupdate",F),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 P=n.current;if(!P||!isFinite(P.duration))return;let B=I.currentTarget.getBoundingClientRect(),E=Math.max(0,Math.min(1,(I.clientX-B.left)/B.width));P.currentTime=E*P.duration},[]),T=S(I=>{let P=n.current,B=parseFloat(I.target.value);P&&(P.volume=B,P.muted=B===0,m(B),p(B===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:b,height:g,display:"block"}});let C=d>0?a/d*100:0,$={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},L=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:f?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:x,style:$},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"}},`${ar(a)} / ${ar(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:T,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:D,style:$},"\u26F6"));return o("div",{style:{position:"relative",width:b,height:g,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:x,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function Be(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=S(d=>{if(!r)return;let u=d,h=s.current;if(!h)return;let m=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let p=t==="vertical",f=p?"ArrowDown":"ArrowRight",y=p?"ArrowUp":"ArrowLeft";if(u.key===f){u.preventDefault();let b=m[c+1];b&&b.focus()}else if(u.key===y){u.preventDefault();let b=m[c-1];b&&b.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 ht(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 De(){let[e,t]=G(!1);return{hover:e,onMouseEnter:S(()=>t(!0),[]),onMouseLeave:S(()=>t(!1),[])}}function ol(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:h}=De(),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 p=S(v=>{let T=v;m||(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),r())},[m,r]),f=S(()=>{m||r()},[m,r]),b=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),g=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,x=l==="left"?[b,g]:[g,b];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":m?"true":void 0,"data-section-id":t.id,tabIndex:m?-1:0,style:c,onClick:f,onKeyDown:p,onMouseEnter:u,onMouseLeave:h},...x)}function rl(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 cr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:h=!0,onChange:m}=e,[c,p]=G(()=>n??[]),f=S(b=>{p(g=>{let x=g.includes(b),v;return x?v=g.filter(T=>T!==b):r?v=[...g,b]:v=[b],m&&m(v),v})},[r,m]),y=X(()=>t.map(b=>{let g=c.includes(b.id),x=o(ol,{key:`header-${b.id}`,section:b,expanded:g,onToggle:()=>f(b.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(rl,{key:`content-${b.id}`,section:b,expanded:g,contentStyle:s,animated:h});return o("div",{key:b.id,"data-accordion-section":b.id,style:{width:"100%"}},x,v)}),[t,c,i,s,l,d,u,h,f]);return o(Be,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var il={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function dr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=G(!1),l=il[i],d=S(()=>{a(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!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,b)=>{let g=y===b.length-1,x=h&&f.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"},"...")):g?v.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},f.label)):f.href?v.push(o("a",{href:f.href,onClick:f.onClick?T=>{T.preventDefault(),f.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},f.label)):f.onClick?v.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)):v.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},f.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...v)},p=u.map((f,y)=>c(f,y,u));return o(Be,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...p))}function ur(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=De(),[d,u]=G(!1),h=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let m=t.disabled===!0,p={...ht(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=S(()=>{if(!m){if(h){u(T=>!T);return}t.onClick&&t.onClick(),r&&i()}},[m,h,t,r,i]),y=S(()=>{a(),h&&u(!0)},[h,a]),b=S(()=>{l(),h&&u(!1)},[h,l]),g=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),x=h?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,v=h&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(Be,{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(ur,{key:T.id,item:T,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:b},o("button",{type:"button",role:"menuitem",style:p,onClick:f,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},g,x),v)}function pr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,h]=G(!1),m=oe(null),c=S(()=>{h(T=>!T)},[]),p=S(()=>{h(!1)},[]);se(()=>{if(!u)return;let T=D=>{let C=m.current;C&&!C.contains(D.target)&&h(!1)};return document.addEventListener("click",T,!0),()=>{document.removeEventListener("click",T,!0)}},[u]),se(()=>{if(!u)return;let T=D=>{D.key==="Escape"&&h(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[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")),b=typeof d=="number"?`${d}px`:d,g={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:b,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:g},o(Be,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(T=>o(ur,{key:T.id,item:T,itemStyle:s,closeOnSelect:l,onClose:p})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,v)}function fr(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=De(),[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 h=t.disabled===!0,m=S(()=>{if(!h){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[h,u,t,n]),c=S(()=>{s(),u&&d(!0)},[u,s]),p=S(()=>{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:h?"default":"pointer",backgroundColor:!h&&i?"#f3f4f6":"transparent",color:h?"#9ca3af":"#1f2937",opacity:h?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),b=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,g=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(fr,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:p},o("button",{type:"button",role:"menuitem",style:f,onClick:m,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,b),g)}function sl(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=De(),h=oe(null),m=S(()=>{r?a():s(n)},[r,n,s,a]),c=S(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),p={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},f=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,b)=>o(fr,{key:String(b),item:y,onClose:a,index:b})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:p,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function gr(e){let{menus:t}=e,[n,r]=G(null),i=oe(null),s=S(d=>{r(d)},[]),a=S(()=>{r(null)},[]);se(()=>{if(n===null)return;let d=u=>{let h=i.current;h&&!h.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),se(()=>{let d=i.current;if(!d)return;let u=h=>{let m=h;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 p=c.querySelector('[role="menuitem"]');p&&p.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(sl,{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 Yt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function al(e,t,n){let r=n*2+5;if(e<=r)return Yt(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?[...Yt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...Yt(e-n*2-2,e)]:[1,"ellipsis",...Yt(i,s),"ellipsis",e]}var Vt={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"},ll={...Vt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},mr={...Vt,color:"#9ca3af",cursor:"default",opacity:"0.5"},cl={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function hr(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),h=Math.min(Math.max(1,r),u),m=S(b=>{!d&&b>=1&&b<=u&&b!==h&&i(b)},[d,u,h,i]),c=(b,g,x)=>{let v=d||g<1||g>u||g===h;return o("button",{type:"button",onClick:()=>m(g),disabled:v||void 0,"aria-label":x,style:v?mr:Vt},b)},p=al(u,h,s),f=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",h-1,"Go to previous page"));for(let b of p)if(b==="ellipsis")y.push(o("span",{key:`ellipsis-${f++}`,style:cl},"..."));else{let g=b===h;y.push(o("button",{key:String(b),type:"button",onClick:()=>m(b),disabled:d||void 0,"aria-label":`Page ${b}`,"aria-current":g?"page":void 0,style:d?mr:g?ll:Vt},String(b)))}return l&&y.push(c("\u203A",h+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(Be,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function br(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=De(),[u,h]=G(!1),m=t.children&&t.children.length>0,c=t.id===r,p=S(()=>{m&&!n&&h($=>!$),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"},b=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,g=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),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:p,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},b,g,x,v,T),C=!n&&m&&u?t.children.map($=>o(br,{key:$.id,item:$,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 xr(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,h=t.map(m=>o(br,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(Be,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...h)}var Oe={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 yr(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,h=S(b=>{s&&i&&i(b)},[s,i]),m=b=>b<n?"completed":b===n?"active":"pending",c=(b,g,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:Oe.completedBg,color:Oe.completedText,border:`2px solid ${Oe.completed}`}},a==="circle"?g.icon||"\u2713":null):x==="active"?o("div",{style:{...T,backgroundColor:"#ffffff",color:Oe.activeText,border:`2px solid ${Oe.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?g.icon||String(b+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Oe.active}})):o("div",{style:{...T,backgroundColor:"#ffffff",color:Oe.pendingText,border:`2px solid ${Oe.pending}`}},a==="circle"?g.icon||String(b+1):null)},p=b=>{if(b>=t.length-1)return null;let x=b<n?Oe.lineCompleted:Oe.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=(b,g)=>{let x=m(g),v=x==="active",T=x==="completed",D=c(g,b,x),C={fontSize:"13px",fontWeight:v?"600":"400",color:v||T?Oe.labelActive:Oe.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},$={fontSize:"11px",color:Oe.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},b.label),b.description?o("span",{style:$},b.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(g),onClick:s?()=>h(g):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":v?"step":void 0},I)},y=[];return t.forEach((b,g)=>{y.push(f(b,g));let x=p(g);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 Sr={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 dl(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=De(),l=Sr[n],d=t.disabled===!0,u=t.type==="toggle",[h,m]=G(!1),c=u?t.active===!0:h,p=S(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=S(()=>{!d&&!u&&m(!0)},[d,u]),y=S(()=>{u||m(!1)},[u]),b=S(()=>{a(),u||m(!1)},[u,a]),g={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!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:g,onClick:p,onMouseDown:f,onMouseUp:y,onMouseEnter:s,onMouseLeave:b,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 vr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Sr[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(dl,{key:a.id,item:a,size:n,variant:r}));return o(Be,{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 bt=class e{constructor(t,n){Ke(this,"id");Ke(this,"label");Ke(this,"children");Ke(this,"expanded");Ke(this,"icon");Ke(this,"metadata");Ke(this,"parent");Ke(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 wr(e){e.expanded=!0;for(let t of e.children)wr(t)}function kr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)kr(n,t);return t}function ul(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function pl(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:h,onClick:m,focusedId:c}=e,p=De(),f=oe(null),y=c===t.id;se(()=>{y&&f.current&&f.current.focus()},[y]);let b=t.isLeaf(),g=t.depth,x=[];for(let $=0;$<g;$++){let L=t;for(let P=0;P<g-$;P++)L=L?L.parent:null;let I=L?!ul(L):!1;x.push(o("span",{key:`connector-${$}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...I?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=g>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,T=b?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:$=>{$.stopPropagation(),h(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=ht(d,{hover:p.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":b?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":g+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:p.onMouseEnter,onMouseLeave:p.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 Cr(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:h="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:p,renderNode:f}=e,[y,b]=G(()=>{let I=bt.fromData(t);return a&&wr(I),I}),[g,x]=G(t.id),v=X(()=>kr(y),[y]),T=S(()=>{b(I=>{let P=Object.create(Object.getPrototypeOf(I));return Object.assign(P,I),P})},[]),D=S(I=>{I.toggle(),I.expanded?r?.(I):i?.(I),T()},[r,i,T]),C=S(I=>{x(I.id),n?.(I)},[n]),$=S(I=>{let P=I;if(!g)return;let B=v.findIndex(F=>F.id===g);if(B===-1)return;let E=v[B];switch(P.key){case"ArrowDown":{P.preventDefault();let F=v[B+1];F&&x(F.id);break}case"ArrowUp":{P.preventDefault();let F=v[B-1];F&&x(F.id);break}case"ArrowRight":{P.preventDefault(),E.isLeaf()||(E.expanded?E.children.length>0&&x(E.children[0].id):D(E));break}case"ArrowLeft":{P.preventDefault(),!E.isLeaf()&&E.expanded?D(E):E.parent&&x(E.parent.id);break}case"Enter":{P.preventDefault(),C(E);break}case" ":{P.preventDefault(),E.isLeaf()||D(E);break}case"Home":{P.preventDefault(),v.length>0&&x(v[0].id);break}case"End":{P.preventDefault(),v.length>0&&x(v[v.length-1].id);break}}},[g,v,D,C]),L=v.map(I=>o(pl,{key:I.id,node:I,isSelected:I.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:h,iconCollapsed:m,nodeStyle:c,renderNode:f,onToggle:D,onClick:C,focusedId:g}));return o(Be,{role:"tree",ariaLabel:"Tree navigation",styling:p,keyboardNav:!1},o("div",{onKeyDown:$,style:{outline:"none"}},...L))}function Mr(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=G(-1),[l,d]=G(null),u=oe(null);se(()=>{if(!u.current)return;u.current.focus();let c=f=>{let y=f,b=t.map((g,x)=>({item:g,i:x})).filter(({item:g})=>!g.divider);if(y.key==="ArrowDown")y.preventDefault(),a(g=>{let v=(b.findIndex(({i:T})=>T===g)+1)%b.length;return b[v].i});else if(y.key==="ArrowUp")y.preventDefault(),a(g=>{let x=b.findIndex(({i:T})=>T===g),v=x<=0?b.length-1:x-1;return b[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 g=t[s];g.children?d(s):!g.disabled&&g.onClick&&(g.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let p=u.current;return()=>p.removeEventListener("keydown",c)},[t,s,i,r]);let h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},m=t.map((c,p)=>{if(c.divider)return o("div",{key:`divider-${p}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===p,y=!!c.disabled,b=!!(c.children&&c.children.length>0),g={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:f&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(p),d(b?p:null)},v=()=>{if(!y){if(b){d(p);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??"")),b&&T.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let D=[o("div",{key:`item-${p}`,style:g,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":y?"true":void 0},...T)];return b&&l===p&&D.push(o(Mr,{key:`submenu-${p}`,items:c.children,position:{x:n.x+178,y:n.y+p*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${p}`,style:{position:"relative"}},...D)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...m)}function Ut(e){let{items:t,children:n}=e,[r,i]=G(null),s=S(u=>{u.preventDefault();let h=u;i({x:h.clientX,y:h.clientY})},[]),a=S(()=>{i(null)},[]);se(()=>{if(!r)return;let u=m=>{a()},h=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(h),document.removeEventListener("mousedown",u)}},[r,a]),se(()=>{if(!r)return;let u=h=>{h.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(Mr,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function fl(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 gl(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 Er(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[h,m]=G(!1),[c,p]=G(!1),f=oe(null),y=s?"drawer-title":void 0;if(se(()=>{if(t)m(!0),requestAnimationFrame(()=>p(!0));else{p(!1);let I=setTimeout(()=>m(!1),300);return()=>clearTimeout(I)}},[t]),se(()=>{if(!t||!d)return;let I=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,d,n]),se(()=>{if(!t)return;let I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[t]),se(()=>{t&&f.current&&f.current.focus()},[t]),!h)return null;let b={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},g={...gl(r,i),transform:fl(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()},$=[];s&&$.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"))),$.push(o("div",{style:D},u));let L=[];return a&&L.push(o("div",{style:b,onClick:C})),L.push(o("div",{ref:f,style:g,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...$)),o("div",null,...L)}var ml={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Ir(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,h=oe(null);if(se(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),se(()=>{if(!t||!a)return;let C=$=>{$.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),se(()=>{t&&h.current&&h.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:ml[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},p={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},f={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},b={padding:"24px",overflow:"auto",flex:"1"},g={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:f},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:p},...v),o("div",{style:b},u)];return l&&D.push(o("div",{style:g},l)),o("div",{style:m,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":T},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...D))}var Rr=8;function hl(e,t){let n=t+Rr;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 bl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Rr}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 Pr(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[h,m]=G(!1),c=u?r:h,p=oe(null),f=S(()=>{u?d&&d(!r):m(T=>!T)},[u,r,d]);se(()=>{if(!c||!l)return;let T=D=>{p.current&&!p.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"},b={...hl(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},g=[n];a&&g.push(o("div",{style:bl(i)}));let x=S(T=>{let D=T.key;(D==="Enter"||D===" ")&&(T.preventDefault(),f())},[f]),v=[o("div",{onClick:f,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&v.push(o("div",{style:b},...g)),o("div",{ref:p,style:y},...v)}var xl=0;function yl(){return`toast-${++xl}-${Date.now()}`}function yn(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let h=yl();return n=[{id:h,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),h}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var Sl={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 vl(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 wl(e){let{item:t,onDismiss:n}=e,r=Sl[t.type];se(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},a={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function Sn(e){let{toaster:t}=e,[,n]=G(0);se(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=vl(t.config.position);se(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let d=document.createElement("style");return d.id=l,d.textContent=`
|
|
3
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=S(l=>t.dismiss(l),[t]),a=r.map(l=>o(wl,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function $r(e={}){let t=oe(null);t.current||(t.current=yn(e));let n=t.current,r=S(()=>o(Sn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var kl=6,Cl=8;function Ml(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Cl;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 El(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${kl}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 Tr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=G(!1),[d,u]=G(null),h=oe(null),m=oe(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,p=S(()=>{m.current=setTimeout(()=>{if(h.current){let x=h.current.getBoundingClientRect();u(Ml(x,n))}l(!0)},r)},[r,n]),f=S(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);ae(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},b={...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"},g=[o("div",{ref:h,style:y,onMouseEnter:p,onMouseLeave:f,onFocus:p,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&g.push(o("div",{id:c,style:b,role:"tooltip"},t,o("div",{style:El(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...g)}function vn(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 Il(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 Rl(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Pl(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var zr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Dr(e,t){return t||zr[e%zr.length]}function Ar(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:h="#e5e7eb",title:m,padding:c=50,animate:p=!1,stacked:f,grouped:y=!1}=e,b=i==="vertical",g=n-c*2,x=r-c*2,v=b?x:g,T=b?g:x,D=f!==void 0&&f.length>0,C=X(()=>D?Pl(f):[],[D,f]),$=D?f.length:t.length,L=X(()=>Il(t,f,y),[t,f,y]),I=L>0?L:1,P=vn($,I,v,T,a),B=S(()=>{if(!u)return[];let H=Rl(I),U=[];for(let q=H;q<=I;q+=H){let te=P.valueScale(q);if(b){let J=c+x-te;U.push(o("line",{key:`grid-${q}`,x1:String(c),y1:String(J),x2:String(c+g),y2:String(J),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${q}`,x:String(c-6),y:String(J+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(q)))}else{let J=c+te;U.push(o("line",{key:`grid-${q}`,x1:String(J),y1:String(c),x2:String(J),y2:String(c+x),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${q}`,x:String(J),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(q)))}}return U},[u,I,P,b,c,g,x,h]),E=S(()=>{let H=[];return b?(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"})),H.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+g),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(H.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+g),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),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"}))),H},[b,c,g,x]),F=S(()=>{let H=[];for(let U=0;U<t.length;U++){let q=t[U],te=P.valueScale(q.value),J=P.categoryScale(U),V=q.color??s,j,O,Y=String(q.value);if(b){let K=c+J,Q=c+x-te;j={x:String(K),y:String(Q),width:String(P.barThickness),height:String(te),rx:String(l),ry:String(l),fill:V},O={x:String(K+P.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let K=c+J,Q=c;j={x:String(Q),y:String(K),width:String(te),height:String(P.barThickness),rx:String(l),ry:String(l),fill:V},O={x:String(Q+te+6),y:String(K+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(p&&(j.style=b?`animation: barGrow 0.6s ease-out ${U*.05}s both`:`animation: barGrow 0.6s ease-out ${U*.05}s both`),H.push(o("rect",{key:`bar-${U}`,...j})),d&&H.push(o("text",{key:`val-${U}`,...O},Y)),b){let K=c+J+P.barThickness/2,Q=c+x+16;H.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})`},q.label))}else H.push(o("text",{key:`cat-${U}`,x:String(c-6),y:String(c+J+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},q.label))}return H},[t,P,s,l,d,p,b,c,x]),A=S(()=>{if(!f)return[];let H=[];for(let U=0;U<f.length;U++){let q=f[U],te=P.categoryScale(U),J=0;for(let V=0;V<q.values.length;V++){let j=q.values[V],O=P.valueScale(j.value),Y=P.valueScale(J),K=Dr(V,j.color);if(b){let Q=c+te,se=c+x-Y-O;H.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(se),width:String(P.barThickness),height:String(O),rx:V===q.values.length-1?String(l):"0",ry:V===q.values.length-1?String(l):"0",fill:K,...p?{style:`animation: barGrow 0.6s ease-out ${(U*q.values.length+V)*.03}s both`}:{}})),d&&O>14&&H.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+P.barThickness/2),y:String(se+O/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let Q=c+Y,se=c+te;H.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(se),width:String(O),height:String(P.barThickness),rx:V===q.values.length-1?String(l):"0",ry:V===q.values.length-1?String(l):"0",fill:K,...p?{style:`animation: barGrow 0.6s ease-out ${(U*q.values.length+V)*.03}s both`}:{}})),d&&O>20&&H.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+O/2),y:String(se+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}J+=j.value}if(d){let V=P.valueScale(J);b?H.push(o("text",{key:`stotal-${U}`,x:String(c+te+P.barThickness/2),y:String(c+x-V-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(J))):H.push(o("text",{key:`stotal-${U}`,x:String(c+V+6),y:String(c+te+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(J)))}if(b){let V=c+te+P.barThickness/2,j=c+x+16;H.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})`},q.label))}else H.push(o("text",{key:`scat-${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"},q.label))}return H},[f,P,l,d,p,b,c,x]),k=S(()=>{if(!f)return[];let H=C.length,U=[];for(let q=0;q<f.length;q++){let te=f[q],J=P.categoryScale(q),V=2,j=Math.max(1,(P.barThickness-V*(H-1))/H);for(let O=0;O<te.values.length;O++){let Y=te.values[O],K=C.indexOf(Y.category),Q=K*(j+V),se=P.valueScale(Y.value),ee=Dr(K>=0?K:O,Y.color);if(b){let le=c+J+Q,ce=c+x-se;U.push(o("rect",{key:`gbar-${q}-${O}`,x:String(le),y:String(ce),width:String(j),height:String(se),rx:String(l),ry:String(l),fill:ee,...p?{style:`animation: barGrow 0.6s ease-out ${(q*H+O)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${q}-${O}`,x:String(le+j/2),y:String(ce-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}else{let le=c,ce=c+J+Q;U.push(o("rect",{key:`gbar-${q}-${O}`,x:String(le),y:String(ce),width:String(se),height:String(j),rx:String(l),ry:String(l),fill:ee,...p?{style:`animation: barGrow 0.6s ease-out ${(q*H+O)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${q}-${O}`,x:String(le+se+4),y:String(ce+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}}if(b){let O=c+J+P.barThickness/2,Y=c+x+16;U.push(o("text",{key:`gcat-${q}`,x:String(O),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${O}, ${Y})`},te.label))}else U.push(o("text",{key:`gcat-${q}`,x:String(c-6),y:String(c+J+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},te.label))}return U},[f,C,P,l,d,p,b,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]),R=S(()=>p?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},b?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[p,b]),M=B(),N=E(),z=w(),W=R(),_;return D&&y?_=k():D?_=A():_=F(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...W,...z,...M,...N,..._)}function ht(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 jt(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 Gt(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let h=t[u],m=e(h);isFinite(m)&&a.push({input:h,output:m})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),Lr(l)};return Lr(l),()=>{i=!0}}function Lr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function $l(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 Br(e,t){let n=t-e;if(n<=0)return[e];let r=$l(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 Fr(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var Re=40,Nr=1.1,Wr=.01,_r=1e6;function Or(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:h=!0,showAxes:m=!0,pointRadius:c=3,pointColor:p="#3b82f6",curveColor:f="#3b82f6",gridColor:y="#e2e8f0",axisColor:b="#94a3b8",onPointClick:g,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:T}=e,[D,C]=G(d[0]),[$,L]=G(d[1]),[I,P]=G(u[0]),[B,E]=G(u[1]),F=oe(!1),A=oe(null),k=S(Y=>Re+(Y-D)/($-D)*(t-2*Re),[D,$,t]),w=S(Y=>n-Re-(Y-I)/(B-I)*(n-2*Re),[I,B,n]),R=S(Y=>D+(Y-Re)/(t-2*Re)*($-D),[D,$,t]),M=S(Y=>I+(n-Re-Y)/(n-2*Re)*(B-I),[I,B,n]),N=S(Y=>{let K=Y;F.current=!0,A.current={mx:K.clientX,my:K.clientY,x0:D,x1:$,y0:I,y1:B}},[D,$,I,B]),z=S(Y=>{if(!F.current||!A.current)return;let K=Y,Q=A.current,se=K.clientX-Q.mx,ee=K.clientY-Q.my,le=se/(t-2*Re)*(Q.x1-Q.x0),ce=ee/(n-2*Re)*(Q.y1-Q.y0);C(Q.x0-le),L(Q.x1-le),P(Q.y0+ce),E(Q.y1+ce)},[t,n]),W=S(()=>{F.current=!1,A.current=null},[]),_=S(Y=>{let K=Y;K.preventDefault();let Q=K.currentTarget.getBoundingClientRect(),se=K.clientX-Q.left,ee=K.clientY-Q.top,le=R(se),ce=M(ee),pe=K.deltaY>0?Nr:1/Nr,re=($-D)*pe,he=(B-I)*pe;if(re<Wr||he<Wr||re>_r||he>_r)return;let me=(le-D)/($-D),ne=(ce-I)/(B-I);C(le-me*re),L(le+(1-me)*re),P(ce-ne*he),E(ce+(1-ne)*he)},[D,$,I,B,R,M]),H=[];if(H.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let Y=Br(D,$),K=Br(I,B);for(let Q=0;Q<Y.length;Q++){let se=k(Y[Q]);H.push(o("line",{x1:se,y1:Re,x2:se,y2:n-Re,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),H.push(o("text",{x:se,y:n-Re+14,"text-anchor":"end","font-size":10,fill:b,transform:`rotate(-45, ${se}, ${n-Re+14})`,key:`lx-${Q}`},Fr(Y[Q])))}for(let Q=0;Q<K.length;Q++){let se=w(K[Q]);H.push(o("line",{x1:Re,y1:se,x2:t-Re,y2:se,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),H.push(o("text",{x:Re-6,y:se+3,"text-anchor":"end","font-size":10,fill:b,key:`ly-${Q}`},Fr(K[Q])))}}if(m){let Y=Math.max(Re,Math.min(t-Re,k(0))),K=Math.max(Re,Math.min(n-Re,w(0)));H.push(o("line",{x1:Re,y1:K,x2:t-Re,y2:K,stroke:b,"stroke-width":1,key:"x-axis"})),H.push(o("line",{x1:Y,y1:Re,x2:Y,y2:n-Re,stroke:b,"stroke-width":1,key:"y-axis"}))}let U=X(()=>{if(!i||!l)return[];let Y=a??($-D)/s,K=ht({start:D,end:$,step:Y});return jt(i,K)},[i,D,$,a,s,l]),[q,te]=G([]),J=oe(null);ae(()=>{if(!i||l){te([]);return}let Y=a??($-D)/s,K=ht({start:D,end:$,step:Y});return J.current&&J.current(),J.current=Gt(i,K,200,Q=>{te([...Q])}),()=>{J.current&&J.current()}},[i,D,$,a,s,l]);let V=l?U:q;if(V.length>0){let Y=[];for(let K=0;K<V.length;K++){let Q=V[K],se=k(Q.input),ee=w(Q.output);Y.push(`${Y.length===0?"M":"L"}${se},${ee}`)}H.push(o("path",{d:Y.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let j=(Y,K,Q,se)=>{if(K)return ee=>K({x:se.x,y:se.y,index:Q,event:ee})};for(let Y=0;Y<r.length;Y++){let K=r[Y],Q=k(K.x),se=w(K.y),ee={cx:Q,cy:se,r:c,fill:p,cursor:"pointer",key:`pt-${Y}`};g&&(ee.onClick=j("click",g,Y,K)),x&&(ee.onDblClick=j("dblclick",x,Y,K)),v&&(ee.onContextMenu=j("contextmenu",v,Y,K)),T&&(ee.onMouseOver=j("mouseover",T,Y,K)),H.push(o("circle",ee))}let O=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:Re,y:Re,width:t-2*Re,height:n-2*Re})));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:z,onMouseUp:W,onMouseLeave:W,onWheel:_},O,...H)}function Yr(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 Hr(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,h=0,m=0,c=0;return i<60?(h=l,m=d):i<120?(h=d,m=l):i<180?(m=l,c=d):i<240?(m=d,c=l):i<300?(h=d,c=l):(h=l,c=d),[Math.floor((h+u)*255),Math.floor((m+u)*255),Math.floor((c+u)*255)]}function Vr(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Yr){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let h=0;h<e;h++){let m=n[0]+h/e*(n[1]-n[0]);d.push(s(m,u,i))}a.push(d)}return a}function Ur(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=Yr,data:d,resolution:u=2,onPointClick:h,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:p}=e;if(d){let M=d.length,N=M>0?d[0].length:0,z=N>0?t/N:1,W=M>0?n/M:1,_=[];for(let H=0;H<M;H++){let U=d[H];for(let q=0;q<N;q++){let te=U[q]??0,[J,V,j]=Hr(te,s,a);_.push(o("rect",{key:`${H}-${q}`,x:String(q*z),y:String(H*W),width:String(Math.ceil(z)),height:String(Math.ceil(W)),fill:`rgb(${J},${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%"}},..._)}let[f,y]=G(r[0]),[b,g]=G(r[1]),[x,v]=G(i[0]),[T,D]=G(i[1]),C=oe(null),$=oe(!1),L=oe(null),I=S((M,N)=>{let z=f+M/t*(b-f),W=T-N/n*(T-x);return{re:z,im:W}},[f,b,x,T,t,n]);ae(()=>{let M=C.current;if(!M)return;let N=M.getContext("2d");if(!N)return;let z=N.createImageData(t,n),W=z.data;for(let _=0;_<n;_++)for(let H=0;H<t;H++){let{re:U,im:q}=I(H,_),te=l(U,q,s),[J,V,j]=Hr(te,s,a),O=(_*t+H)*4;W[O]=J,W[O+1]=V,W[O+2]=j,W[O+3]=255}N.putImageData(z,0,0)},[f,b,x,T,t,n,s,a,l,I]);let P=S(M=>{let N=M.target.getBoundingClientRect(),z=M.clientX-N.left,W=M.clientY-N.top,{re:_,im:H}=I(z,W),U=l(_,H,s);return{re:_,im:H,iterations:U,event:M}},[I,l,s]),B=S(M=>{$.current=!0,L.current={x:M.clientX,y:M.clientY,rMin:f,rMax:b,iMin:x,iMax:T}},[f,b,x,T]),E=S(M=>{if(m&&m(P(M)),!$.current||!L.current)return;let N=L.current,z=M.clientX-N.x,W=M.clientY-N.y,_=(N.rMax-N.rMin)/t,H=(N.iMax-N.iMin)/n;y(N.rMin-z*_),g(N.rMax-z*_),v(N.iMin+W*H),D(N.iMax+W*H)},[t,n,m,P]),F=S(()=>{$.current=!1},[]),A=S(M=>{M.preventDefault();let N=M.deltaY>0?1.15:1/1.15,z=M.target.getBoundingClientRect(),W=M.clientX-z.left,_=M.clientY-z.top,{re:H,im:U}=I(W,_);y(H+(f-H)*N),g(H+(b-H)*N),v(U+(x-U)*N),D(U+(T-U)*N)},[I,f,b,x,T]),k=S(M=>{h&&h(P(M))},[h,P]),w=S(M=>{c&&c(P(M))},[c,P]),R=S(M=>{M.preventDefault(),p&&p(P(M))},[p,P]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:B,onMouseMove:E,onMouseUp:F,onMouseLeave:F,onWheel:A,onClick:k,onDblClick:w,onContextMenu:R})}function jr(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 Tl(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,h=y=>r+(y-i)/(s-i)*d,m=y=>n-r-(y-a)/(l-a)*u,c=6,p=jr(i,s,c),f=jr(a,l,c);return{xScale:h,yScale:m,xTicks:p,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function wn(e,t,n,r){return X(()=>Tl(e,t,n,r),[e,t,n,r])}function Gr(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Xr(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 qr(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:h=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:p,yLabel:f,title:y,padding:b=50,animate:g=!1,multiLine:x}=e,v=X(()=>{let B=[...t];if(x)for(let E of x)B.push(...E.data);return B},[t,x]),T=wn(v,n,r,b),{xScale:D,yScale:C,xTicks:$,yTicks:L}=T,I=[];if(I.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let B=0;B<$.length;B++){let E=D($[B]);I.push(o("line",{x1:E,y1:b,x2:E,y2:r-b,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${B}`}))}for(let B=0;B<L.length;B++){let E=C(L[B]);I.push(o("line",{x1:b,y1:E,x2:n-b,y2:E,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${B}`}))}}I.push(o("line",{x1:b,y1:r-b,x2:n-b,y2:r-b,stroke:"#374151","stroke-width":1,key:"x-axis"})),I.push(o("line",{x1:b,y1:b,x2:b,y2:r-b,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let B=0;B<$.length;B++){let E=D($[B]);I.push(o("line",{x1:E,y1:r-b,x2:E,y2:r-b+5,stroke:"#374151",key:`xtick-${B}`})),I.push(o("text",{x:E,y:r-b+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${E}, ${r-b+18})`,key:`xlabel-${B}`},Gr($[B])))}for(let B=0;B<L.length;B++){let E=C(L[B]);I.push(o("line",{x1:b-5,y1:E,x2:b,y2:E,stroke:"#374151",key:`ytick-${B}`})),I.push(o("text",{x:b-10,y:E+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${B}`},Gr(L[B])))}function P(B,E,F,A,k,w,R,M,N,z){if(B.length===0)return;let W=[...B].sort((U,q)=>U.x-q.x);if(A){let U=C(T.yMin),q=W.map(j=>`${D(j.x)},${C(j.y)}`).join(" "),te=D(W[0].x),J=D(W[W.length-1].x),V=`${te},${U} ${q} ${J},${U}`;I.push(o("polygon",{points:V,fill:k,key:`${z}-area`}))}let H={points:W.map(U=>`${D(U.x)},${C(U.y)}`).join(" "),fill:"none",stroke:E,"stroke-width":F,"stroke-linejoin":"round","stroke-linecap":"round",key:`${z}-line`};if(g?(H["stroke-dasharray"]="1000",H["stroke-dashoffset"]="1000",I.push(o("polyline",H,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):I.push(o("polyline",H)),w)for(let U=0;U<W.length;U++){let q=D(W[U].x),te=C(W[U].y),J=W[U].shape??N,V=W[U].radius??M,j=`${z}-pt-${U}`;if(g){let O=Xr(J,q,te,V,R,j,{opacity:0});I.push(o("g",{key:`${j}-g`},O,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else I.push(Xr(J,q,te,V,R,j))}}if(P(t,i,s,m,c,u,l,a,d,"primary"),x)for(let B=0;B<x.length;B++){let E=x[B];P(E.data,E.color,s,!1,"transparent",u,E.color,E.pointRadius??a,E.pointShape??d,`series-${B}`)}if(x&&x.length>0){let B=[],E=[{color:i,label:"Primary"},...x.map((_,H)=>({color:_.color,label:_.label??`Series ${H+1}`}))],F=b+10,A=16,k=22,w=7.2,R=14,M=6,N=n-b*2-20,z=0,W=0;for(let _=0;_<E.length;_++){let H=E[_].label.length*w,U=R+M+H;z>0&&z+U>N&&(z=0,W+=k);let q=F+z,te=b-30-W;B.push(o("rect",{x:q,y:te,width:R,height:14,fill:E[_].color,rx:2,key:`legend-rect-${_}`})),B.push(o("text",{x:q+R+M,y:te+12,"font-size":12,fill:"#374151",key:`legend-text-${_}`},E[_].label)),z+=U+A}I.push(o("g",{key:"legend"},...B))}return p&&I.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},p)),f&&I.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},f)),y&&I.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...I)}function zl(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 Dl(e,t){let n=t??zl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function bt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function kn(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=bt(e,t,r,a),u=bt(e,t,r,l),h=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,"Z"].join(" ");let m=bt(e,t,n,l),c=bt(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function Cn(e,t){let n=t?.padAngle??0,r=Dl(e,t?.colors),i=e.reduce((u,h)=>u+h.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let h=e[u],m=h.value/i*a,c=d+n/2,p=c+m;l.push({label:h.label,value:h.value,startAngle:c,endAngle:p,percentage:h.value/i*100,color:r[u]}),d=p+n/2}return l}function Kr(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:h,centerLabel:m,colors:c,strokeColor:p="#fff",strokeWidth:f=2,textColor:y="currentColor"}=e,b=d&&u==="right"?140:0,g=h?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-b,T=r-g-x,D=v/2,C=g+T/2,$=Math.min(v,T)/2-10,L=e.outerRadius??$,I=X(()=>Cn(t,{padAngle:s,colors:c}),[t,s,c]),P=[];h&&P.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},h));for(let B=0;B<I.length;B++){let E=I[B],F=kn(D,C,i,L,E.startAngle,E.endAngle);if(P.push(o("path",{key:`slice-${B}`,d:F,fill:E.color,stroke:p,strokeWidth:f})),a||l){let A=(E.startAngle+E.endAngle)/2,k=E.percentage<5,w=k?L+14:i+(L-i)*.65,R=bt(D,C,w,A-Math.PI/2),M=k?y:"#fff",N=k?11:12,z=[];if(a&&z.push(E.label),l&&z.push(`${E.percentage.toFixed(1)}%`),k){let W=bt(D,C,L+2,A-Math.PI/2);P.push(o("line",{key:`connector-${B}`,x1:W.x,y1:W.y,x2:R.x,y2:R.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${B}`,x:R.x,y:R.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N,fill:M,pointerEvents:"none"},E.label)),l&&P.push(o("text",{key:`value-${B}`,x:R.x,y:R.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N-1,fill:M,pointerEvents:"none"},`${E.percentage.toFixed(1)}%`))}}if(m&&i>0&&P.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 B=[];if(u==="right"){let E=v+10,F=g+20;for(let A=0;A<I.length;A++){let k=I[A],w=F+A*22;B.push(o("circle",{key:`legend-dot-${A}`,cx:E+6,cy:w,r:6,fill:k.color})),B.push(o("text",{key:`legend-text-${A}`,x:E+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let E=r-x+10;for(let F=0;F<I.length;F++){let A=I[F],k=F%2,w=Math.floor(F/2),R=k*(n/2)+10,M=E+w*22;B.push(o("circle",{key:`legend-dot-${F}`,cx:R+6,cy:M,r:6,fill:A.color})),B.push(o("text",{key:`legend-text-${F}`,x:R+18,y:M,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${A.label} (${A.percentage.toFixed(1)}%)`))}}P.push(...B)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function Zr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Jr(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:h=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:p,onPointDoubleClick:f,onPointContextMenu:y,onPointHover:b}=e,[g,x]=G(r[1]),[v,T]=G(0),[D,C]=G(0),[$,L]=G(null),I=t/2+v,P=n/2+D,E=Math.min(t,n)/2-30,F=E/g,A=X(()=>{let V=Math.max(1,Math.ceil(g)),j=[],O=g/V;for(let Y=1;Y<=V;Y++)j.push(O*Y);return j},[g]),k=X(()=>{let V=[];for(let j=0;j<360;j+=30)V.push(j*Math.PI/180);return V},[]),w=X(()=>{if(!i||!l)return[];let V=a??2*Math.PI/s,j=ht({start:0,end:2*Math.PI,step:V});return jt(i,j)},[i,s,a,l]),[R,M]=G([]),N=oe(null);ae(()=>{if(!i||l){M([]);return}let V=a??2*Math.PI/s,j=ht({start:0,end:2*Math.PI,step:V});return N.current&&N.current(),N.current=Gt(i,j,200,O=>{M([...O])}),()=>{N.current&&N.current()}},[i,s,a,l]);let z=l?w:R,W=X(()=>{if(z.length===0)return"";let V=[];for(let j=0;j<z.length;j++){let O=z[j],Y=O.output;if(Y<0||!isFinite(Y))continue;let{x:K,y:Q}=Zr(Y,O.input,I,P,F);V.push(`${V.length===0?"M":"L"}${K.toFixed(2)},${Q.toFixed(2)}`)}return V.join(" ")},[z,I,P,F]),_=S(V=>{L({x:V.clientX,y:V.clientY,px:v,py:D})},[v,D]),H=S(V=>{$&&(T($.px+(V.clientX-$.x)),C($.py+(V.clientY-$.y)))},[$]),U=S(()=>{L(null)},[]),q=S(V=>{V.preventDefault();let j=V.deltaY>0?1.15:1/1.15;x(Math.max(.1,g*j))},[g]),te=S((V,j,O)=>{if(V)return Y=>V({r:j.r,theta:j.theta,index:O,event:Y})},[]),J=[];if(J.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]*F;J.push(o("circle",{cx:I,cy:P,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${V}`})),J.push(o("text",{x:I+j+2,y:P-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],O=A[A.length-1]*F,Y=I+O*Math.cos(j),K=P-O*Math.sin(j);J.push(o("line",{x1:I,y1:P,x2:Y,y2:K,stroke:"#e5e7eb","stroke-width":1,key:`al-${V}`}));let Q=Math.round(j*180/Math.PI),se=I+(O+14)*Math.cos(j),ee=P-(O+14)*Math.sin(j);J.push(o("text",{x:se,y:ee+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${V}`},`${Q}\xB0`))}}J.push(o("line",{x1:I-E,y1:P,x2:I+E,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),J.push(o("line",{x1:I,y1:P-E,x2:I,y2:P+E,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),W&&J.push(o("path",{d:W,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let V=0;V<d.length;V++){let j=d[V],{x:O,y:Y}=Zr(j.r,j.theta,I,P,F);J.push(o("circle",{cx:O,cy:Y,r:h,fill:m,key:`pt-${V}`,style:{cursor:"pointer"},onClick:te(p,j,V),onDblClick:te(f,j,V),onContextMenu:te(y,j,V),onMouseEnter:te(b,j,V)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:$?"grabbing":"grab"},onMouseDown:_,onMouseMove:H,onMouseUp:U,onMouseLeave:U,onWheel:q},...J)}function Mn(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 En(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 In(e,t){let n=Qr(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 Qr(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=Qr(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 Rn(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 Pn(e,t=0){let n=e[0]??0,r=e[1]??0,i=0;for(let s=2;s<e.length;s++)i+=e[s]??0;if(e.length>2&&(i/=e.length-2),t>0){let s=1/(1+t*(i+2));return{x:n*s,y:r*s,depth:i}}return{x:n,y:r,depth:i}}function Et(e,t=[],n=.3,r=1){let i=Mn(e),s=En(e),a=In(e,t);return{vertices:i.map((d,u)=>{let h=Rn(a,d),m=Pn(h,n);return{id:u,position:d,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function It(e){return e*(e-1)/2}function Xt(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 ei(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,h=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=It(t),p=1<<t,f=X(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Xt(p):e.vertexColors,[p,e.vertexColors]),[y,b]=G(()=>{let M=[];for(let N=0;N<c;N++)M.push(0);return M}),[g,x]=G(!1),v=oe({x:0,y:0}),T=oe([]),D=oe(0);ae(()=>{if(d===0)return;let M=!0,N=()=>{M&&(b(z=>{let W=z.slice();for(let _=0;_<W.length;_++)W[_]=(W[_]??0)+d*(1+_*.3);return W}),D.current=requestAnimationFrame(N))};return D.current=requestAnimationFrame(N),()=>{M=!1,cancelAnimationFrame(D.current)}},[d]);let C=X(()=>Et(t,y,l,m),[t,y,l,m]),$=n/2,L=r/2,I=X(()=>C.edges.map(M=>{let N=C.vertices[M.source],z=C.vertices[M.target],W=(N.depth+z.depth)/2;return{...M,avgDepth:W,sv:N,tv:z}}).sort((M,N)=>M.avgDepth-N.avgDepth),[C]),P=X(()=>C.vertices.slice().sort((M,N)=>M.depth-N.depth),[C]),B=S(M=>{let N=M;x(!0),v.current={x:N.clientX,y:N.clientY},T.current=y.slice()},[y]),E=S(M=>{if(!g)return;let N=M,z=(N.clientX-v.current.x)*.01,W=(N.clientY-v.current.y)*.01;b(()=>{let _=T.current.slice();return _.length>0&&(_[0]=(_[0]??0)+z),_.length>1&&(_[1]=(_[1]??0)+W),_})},[g]),F=S(()=>{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=I.map((M,N)=>{let z=A(M.avgDepth);return o("line",{key:`e-${M.source}-${M.target}`,x1:String($+M.sv.x),y1:String(L+M.sv.y),x2:String($+M.tv.x),y2:String(L+M.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(z),"stroke-linecap":"round"})}),R=P.map(M=>{let N=i*k(M.depth),z=f[M.id%f.length]??"#3b82f6",W=[o("circle",{key:`v-${M.id}-circle`,cx:String($+M.x),cy:String(L+M.y),r:String(N),fill:z,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&W.push(o("text",{key:`v-${M.id}-label`,x:String($+M.x),y:String(L+M.y+N+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},M.id.toString(2).padStart(t,"0"))),W});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:g?"grabbing":"grab",userSelect:"none"},onMouseDown:B,onMouseMove:E,onMouseUp:F,onMouseLeave:F},...w,...R.flat())}function ti(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=It(t),[a,l]=G(()=>new Array(s).fill(0));return ae(()=>{if(n===0)return;let u=!0,h=0,m=()=>{u&&(l(c=>c.map((p,f)=>p+n*(1+f*.3))),h=requestAnimationFrame(m))};return h=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:X(()=>Et(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function ni(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:Bl(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?Nl(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,h=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=Fl(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function Bl(e,t){return"column"}function Fl(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 Nl(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"}},Wl(n),o("span",null,n.label))))}function Wl(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 _l(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 Ol(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function oi(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return ae(()=>{if(n||typeof window>"u")return;_l(t),Ol();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 ri(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:h,ariaLabel:m="Site footer"}=e;return o("footer",{className:h,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 ai=Oe({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),Hl={width:600,height:400},Yl={x:30,y:30},Vl={top:0,left:0,width:1920,height:1080},$n=1e3;function ii(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 Tn(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 si(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 zn(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function Dn(e){let t=e.workspaceBounds??Vl,n=e.defaultWindowSize??Hl,r=e.cascadeOffset??Yl,[i,s]=G([]),a=S(((...B)=>{let E=B[0];s(F=>{if(F.find(W=>W.id===E.id)){let _=zn(F)+1,H=F.map(U=>U.id===E.id?{...U,focused:!0,zIndex:_,windowState:U.windowState==="minimized"?"normal":U.windowState}:{...U,focused:!1});return _>$n&&(H=Tn(H)),H}let k=E.size??n,w=E.position??ii(F.length,r,t,k),M=zn(F)+1,N={id:E.id,title:E.title,icon:E.icon,position:w,size:k,windowState:"normal",zIndex:M,focused:!0,appProps:E.appProps},z=F.map(W=>({...W,focused:!1}));return z.push(N),M>$n&&(z=Tn(z)),e.onWindowOpen&&e.onWindowOpen(E.id),e.onFocusChange&&e.onFocusChange(E.id),z})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=S(((...B)=>{let E=B[0];v(F=>{if(F[E]){let A={...F};return delete A[E],A}return F}),D(F=>{if(F.has(E)){let A=new Map(F);return A.delete(E),A}return F}),s(F=>{let A=F.find(w=>w.id===E);if(!A)return F;let k=F.filter(w=>w.id!==E);if(A.focused&&k.length>0){let w=si(k,E);if(w){let R=k.map(M=>({...M,focused:M.id===w.id}));return e.onWindowClose&&e.onWindowClose(E),e.onFocusChange&&e.onFocusChange(w.id),R}}return e.onWindowClose&&e.onWindowClose(E),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=S(((...B)=>{let E=B[0];s(F=>{if(!F.find(M=>M.id===E))return F;let w=zn(F)+1,R=F.map(M=>M.id===E?{...M,focused:!0,zIndex:w}:{...M,focused:!1});return w>$n&&(R=Tn(R)),e.onFocusChange&&e.onFocusChange(E),R})}),[e.onFocusChange]),u=S(((...B)=>{let E=B[0];s(F=>{let A=F.find(w=>w.id===E);if(!A)return F;let k=F.map(w=>w.id===E?{...w,windowState:"minimized",focused:!1}:w);if(A.focused){let w=si(k,E);w?(k=k.map(R=>({...R,focused:R.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),h=S(((...B)=>{let E=B[0];s(F=>F.map(A=>A.id===E?{...A,windowState:"maximized"}:A))}),[]),m=S(((...B)=>{let E=B[0];s(F=>F.map(A=>A.id===E?{...A,windowState:"normal"}:A))}),[]),c=S(((...B)=>{let E=B[0],F=B[1];s(A=>A.map(k=>k.id===E?{...k,position:F}:k))}),[]),p=S(((...B)=>{let E=B[0],F=B[1];s(A=>A.map(k=>k.id===E?{...k,size:F}:k))}),[]),f=S(((...B)=>{s(E=>{let F=E.filter(w=>w.windowState!=="minimized");if(F.length===0)return E;let A=F.length,k=new Map;if(A===1)k.set(F[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(F[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(F[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),R=Math.floor(t.height/2);k.set(F[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(F[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:R}}),k.set(F[2].id,{position:{x:t.left+w,y:t.top+R},size:{width:t.width-w,height:t.height-R}})}else{let w=Math.ceil(Math.sqrt(A)),R=Math.ceil(A/w),M=Math.floor(t.width/w),N=Math.floor(t.height/R);for(let z=0;z<F.length;z++){let W=Math.floor(z/w),_=z%w;k.set(F[z].id,{position:{x:t.left+_*M,y:t.top+W*N},size:{width:M,height:N}})}}return E.map(w=>{let R=k.get(w.id);return R?{...w,position:R.position,size:R.size,windowState:"normal"}:w})})}),[t]),y=S(((...B)=>{s(E=>{let F=E.filter(w=>w.windowState!=="minimized");if(F.length===0)return E;let A=[...F].sort((w,R)=>w.zIndex-R.zIndex),k=new Map;for(let w=0;w<A.length;w++){let R=ii(w,r,t,A[w].size);k.set(A[w].id,{position:R,zIndex:w+1})}return E.map(w=>{let R=k.get(w.id);return R?{...w,position:R.position,zIndex:R.zIndex,windowState:"normal"}:w})})}),[r,t]),b=S(((...B)=>{s(E=>{let F=E.map(A=>({...A,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),F})}),[e.onFocusChange]),g=X(()=>{let B=i.find(E=>E.focused);return B?B.id:null},[i]),[x,v]=G({}),[T,D]=G(new Map),C=S(((...B)=>{let E=B[0],F=B[1];v(A=>({...A,[E]:F}))}),[]),$=S(((...B)=>{let E=B[0];v(F=>{let A={...F};return delete A[E],A})}),[]),L=X(()=>g&&x[g]?x[g]:null,[g,x]),I=S(((...B)=>{let E=B[0],F=B[1];D(A=>{let k=new Map(A),w=k.get(E);return k.set(E,{...w,...F}),k})}),[]),P=X(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:m,moveWindow:c,resizeWindow:p,tileWindows:f,cascadeWindows:y,minimizeAll:b,focusedWindowId:g,setMenuBar:C,clearMenuBar:$,activeMenuBar:L,signalDock:I,dockSignals:T}),[i,a,l,d,u,h,m,c,p,f,y,b,g,C,$,L,I,T]);return o(ai.Provider,{value:P},e.children)}function Rt(){return We(ai)}var li=Oe({appId:""});function Qe(e){let t=X(()=>({appId:e.appId}),[e.appId]);return o(li.Provider,{value:t},e.children)}function xt(){return We(li).appId}var ci=Oe({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function Pt(e){let t=oe([]),n=oe([]),r=S(((...l)=>{let d=l[0],u=l[1],h=l[2],m=l[3]||"",c={channel:d,from:m,to:h||null,payload:u,timestamp:Date.now()},p=t.current;for(let y=0;y<p.length;y++){let b=p[y];b.channel===d&&(c.to&&b.appId!==c.to||!c.to&&b.appId===m||b.handler(c))}let f=n.current;for(let y=0;y<f.length;y++)f[y].handler(c)}),[]),i=S(((...l)=>{let d=l[0],u=l[1],h=l[2]||"",m={channel:d,handler:u,appId:h};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(h=>h!==u)}}),[]),a=X(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(ci.Provider,{value:a},e.children)}function et(){let e=We(ci),t=xt(),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 X(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function $t(e,t){let n=et(),r=oe(t);r.current=t,ae(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var di=Oe({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function Tt(e){let[t,n]=G(null),[r,i]=G({x:0,y:0}),s=oe(new Map),a=oe(null),l=t!==null,d=S(((...p)=>{let f=p[0];n(f)}),[]),u=S(((...p)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),h=S(((...p)=>{let f=p[0],y=p[1];return s.current=new Map(s.current),s.current.set(f,y),()=>{s.current=new Map(s.current),s.current.delete(f),a.current===f&&(a.current=null)}}),[]);ae(()=>{if(!l)return;let p=b=>{let g=b;i({x:g.clientX,y:g.clientY});let x=document.elementFromPoint(g.clientX,g.clientY);if(!x)return;let v=null,T=s.current;T.forEach((C,$)=>{let L=document.querySelector(`[data-dropzone-id="${$}"]`);L&&L.contains(x)&&(v=$)});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}},f=b=>{let g=a.current;if(g&&t){let x=s.current.get(g);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},y=b=>{b.key==="Escape"&&u()};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",y)}},[l,t,u]);let m=X(()=>({startDrag:d,cancelDrag:u,registerDropZone:h,currentDrag:t,isDragging:l}),[d,u,h,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(di.Provider,{value:m},e.children,c)}function at(){return We(di)}function An(e,t){let n=at(),r=xt(),i=oe(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 X(()=>({onMouseDown:s,isDragging:a}),[s,a])}function zt(e){let t=at(),[n,r]=G(!1),i=oe(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=oe(e);s.current=e,ae(()=>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 Ul=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],jl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ln(e){return e<10?"0"+String(e):String(e)}function Gl(e,t,n){let r=e.getHours(),i=Ln(e.getMinutes()),s=Ln(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=Ln(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function Xl(e){let t=Ul[e.getDay()],n=jl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function ql(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=De(),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 Kl(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=G(new Date);ae(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=X(()=>Gl(i,t,n),[i,t,n]),l=X(()=>Xl(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 Zl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=De(),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 Jl(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=De();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 Ql(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=De(),[a,l]=G(!1),d=oe(null),u=S(()=>{l(b=>!b)},[]),h=S(()=>{l(!1)},[]),m=S(b=>{let g=b;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l(x=>!x)),g.key==="Escape"&&l(!1)},[]);ae(()=>{if(!a)return;let b=g=>{let x=d.current;x&&!x.contains(g.target)&&l(!1)};return document.addEventListener("click",b,!0),()=>{document.removeEventListener("click",b,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},p=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),f=o("span",{style:c,"aria-hidden":"true"},p),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((b,g)=>o(Jl,{key:String(g),item:b,onClose:h}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown: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 ec(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=De(),[s,a]=G(!1),l=oe(null),d=S(()=>{a(c=>!c)},[]),u=S(()=>{a(!1)},[]),h=S(c=>{let p=c;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a(f=>!f)),p.key==="Escape"&&a(!1)},[]);ae(()=>{if(!s)return;let c=p=>{let f=l.current;f&&!f.contains(p.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let m=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...t.items.map((c,p)=>c.divider?o("div",{key:"div-"+String(p),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(p),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),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:h,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 Bn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:h=28,children:m}=e,c=String(h)+"px",p=[];if(n&&p.push(o(ql,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let v=0;v<r.menus.length;v++)p.push(o(ec,{key:"appmenu-"+String(v),menu:r.menus[v]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),y=[];y.push(o(Kl,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let b=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),g=[];if(l&&l.length>0){let v=l.map(T=>o(Zl,{key:T.id,indicator:T}));g.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&g.push(o(Ql,{key:"user",user:d,menuItems:u}));let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...g);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},f,b,x)}function tc(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var ui=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function nc(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return ui[Math.abs(t)%ui.length]}function oc(e){return e>99?"99+":String(e)}function rc(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function ic(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 sc(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 ac(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=G(!1),u=t.disabled??!1,h=S(()=>{u||d(!0)},[u]),m=S(()=>{d(!1)},[]),c=S(()=>{!u&&s&&s(t.id)},[u,s,t.id]),p=S(D=>{if(!u&&a){let C=D;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),f=`${n}px`,y=tc(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:nc(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),b=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"},oc(t.badge)):null,g=t.active?o("span",{style:{...sc(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",...ic(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":rc(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:p,onMouseEnter:h,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,b,g,x,v)}function Fn(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[h,m]=G(!s),c=oe(null),p=S(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),m(!0))},[s]),f=S(()=>{s&&(c.current=setTimeout(()=>{m(!1)},300))},[s]),y=S(T=>{let D=T,C=D.target,$=C.closest('[role="toolbar"]');if(!$)return;let L=Array.from($.querySelectorAll("button[data-dock-item-id]")),I=L.indexOf(C);if(I<0)return;let P=n==="vertical",B=P?"ArrowDown":"ArrowRight",E=P?"ArrowUp":"ArrowLeft";if(D.key===B){D.preventDefault();let F=L[I+1];F&&F.focus()}else if(D.key===E){D.preventDefault();let F=L[I-1];F&&F.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]),b=n==="vertical",g={display:"flex",flexDirection:b?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!h&&(r==="left"?(g.transform="translateX(-100%)",g.opacity="0"):r==="right"?(g.transform="translateX(100%)",g.opacity="0"):r==="top"?(g.transform="translateY(-100%)",g.opacity="0"):r==="bottom"&&(g.transform="translateY(100%)",g.opacity="0"));let x=[];for(let T=0;T<t.length;T++){if(a&&T===t.length-1&&t.length>1){let D=b?{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(ac,{key:t[T].id,item:t[T],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let v=s&&!h?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:g,onMouseEnter:p,onMouseLeave:f,onKeyDown:y},v,...x,u??null)}var lc="#2c001e";function Nn(e){let{backgroundColor:t=lc,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,h=S(g=>{let x=g;x.target===x.currentTarget&&a&&a()},[a]),m=S(g=>{let x=g;x.target===x.currentTarget&&l&&l()},[l]),c=X(()=>{let g={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return g.backgroundColor=t,n&&(g.background=n),r&&i>=1&&(g.backgroundImage=`url(${r})`,g.backgroundSize="cover",g.backgroundPosition="center"),g},[t,n,r,i]),p=X(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),f={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];p&&y.push(o("div",{className:"desktop-background__image-overlay",style:p,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:f},u));let b=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(Ut,{items:s},b):b}var cc={width:200,height:150},dc={x:50,y:50},uc={width:400,height:300},Ae=8,Wn=20,pc={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=dc,defaultSize:s=uc,minSize:a=cc,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:m=!0,zIndex:c,onClose:p,onMinimize:f,onMaximize:y,onFocus:b,onMove:g,onResize:x,children:v}=e,[T,D]=G(i.x),[C,$]=G(i.y),[L,I]=G(s.width),[P,B]=G(s.height),[E,F]=G(!1),[A,k]=G(!1),[w,R]=G(null),M=oe(null),N=oe(null),z=oe(null),W=S((re,he)=>{let me=Math.max(re,a.width),ne=Math.max(he,a.height);return l&&(me=Math.min(me,l.width),ne=Math.min(ne,l.height)),{width:me,height:ne}},[a,l]),_=S(()=>{let re=z.current;return re&&re.parentElement?{width:re.parentElement.clientWidth,height:re.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),H=S((re,he,me,ne)=>{let de=_(),ge=Math.max(0,Math.min(re,de.width-me)),xe=Math.max(0,Math.min(he,de.height-ne));return{x:ge,y:xe}},[_]),U=S(re=>{if(!u||h==="maximized")return;let he=re;he.target.closest("button")||(he.preventDefault(),M.current={startMouseX:he.clientX,startMouseY:he.clientY,startPosX:T,startPosY:C},F(!0))},[u,h,T,C]),q=S(re=>{re.target.closest("button")||y&&y()},[y]);ae(()=>{if(!E)return;let re=me=>{let ne=me,de=M.current;if(!de)return;let ge=ne.clientX-de.startMouseX,xe=ne.clientY-de.startMouseY,ue=de.startPosX+ge,Z=de.startPosY+xe,ie=_();ue=Math.max(0,Math.min(ue,ie.width-L)),Z=Math.max(0,Math.min(Z,ie.height-P)),D(ue),$(Z),ne.clientX<=Wn?R("left"):ne.clientX>=ie.width-Wn?R("right"):ne.clientY<=Wn?R("top"):R(null)},he=me=>{let ne=me;F(!1);let de=_();if(w==="left"){D(0),$(0),I(Math.floor(de.width/2)),B(de.height),R(null),g&&g({x:0,y:0}),x&&x({width:Math.floor(de.width/2),height:de.height});return}if(w==="right"){let xe=Math.floor(de.width/2);D(xe),$(0),I(xe),B(de.height),R(null),g&&g({x:xe,y:0}),x&&x({width:xe,height:de.height});return}if(w==="top"){R(null),y&&y();return}R(null);let ge=M.current;if(ge&&g){let xe=ne.clientX-ge.startMouseX,ue=ne.clientY-ge.startMouseY,Z=ge.startPosX+xe,ie=ge.startPosY+ue;Z=Math.max(0,Math.min(Z,de.width-L)),ie=Math.max(0,Math.min(ie,de.height-P)),g({x:Z,y:ie})}M.current=null};return document.addEventListener("mousemove",re),document.addEventListener("mouseup",he),()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",he)}},[E,w,L,P,_,g,x,y]);let te=S(re=>he=>{if(!d||h!=="normal")return;let me=he;me.preventDefault(),me.stopPropagation(),N.current={direction:re,startMouseX:me.clientX,startMouseY:me.clientY,startPosX:T,startPosY:C,startWidth:L,startHeight:P},k(!0)},[d,h,T,C,L,P]);ae(()=>{if(!A)return;let re=me=>{let ne=me,de=N.current;if(!de)return;let ge=ne.clientX-de.startMouseX,xe=ne.clientY-de.startMouseY,ue=de.direction,Z=de.startWidth,ie=de.startHeight,ye=de.startPosX,be=de.startPosY;ue.includes("e")&&(Z=de.startWidth+ge),ue.includes("w")&&(Z=de.startWidth-ge,ye=de.startPosX+ge),ue.includes("s")&&(ie=de.startHeight+xe),ue.includes("n")&&(ie=de.startHeight-xe,be=de.startPosY+xe);let Se=W(Z,ie);ue.includes("w")&&(ye=de.startPosX+(de.startWidth-Se.width)),ue.includes("n")&&(be=de.startPosY+(de.startHeight-Se.height)),I(Se.width),B(Se.height),D(ye),$(be)},he=()=>{k(!1),x&&x({width:L,height:P}),N.current=null};return document.addEventListener("mousemove",re),document.addEventListener("mouseup",he),()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",he)}},[A,L,P,W,x]),ae(()=>{if(!m||!p)return;let re=he=>{he.key==="Escape"&&p()};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[m,p]);let J=S(re=>{b&&b()},[b]);if(h==="minimized")return null;let V=h==="maximized",j=X(()=>{let re={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?(re.top="0",re.left="0",re.width="100%",re.height="100%"):(re.top=`${C}px`,re.left=`${T}px`,re.width=`${L}px`,re.height=`${P}px`),c!==void 0&&(re.zIndex=String(c)),E&&(re.cursor="grabbing",re.userSelect="none"),re},[V,T,C,L,P,c,m,E]),O=X(()=>{let re={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 E&&(re.cursor="grabbing"),re},[m,u,V,E]),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:re=>{re.stopPropagation(),f&&f()}}),o("button",{type:"button","aria-label":V?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...K,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:re=>{re.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...K,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:re=>{re.stopPropagation(),p&&p()}}));Q.push(se);let ee=[];if(d&&!V){let re=["n","s","e","w","ne","nw","se","sw"];for(let he=0;he<re.length;he++){let me=re[he],ne={position:"absolute",zIndex:"1"};me==="n"?(ne.top="0",ne.left=`${Ae}px`,ne.right=`${Ae}px`,ne.height=`${Ae}px`):me==="s"?(ne.bottom="0",ne.left=`${Ae}px`,ne.right=`${Ae}px`,ne.height=`${Ae}px`):me==="e"?(ne.top=`${Ae}px`,ne.right="0",ne.bottom=`${Ae}px`,ne.width=`${Ae}px`):me==="w"?(ne.top=`${Ae}px`,ne.left="0",ne.bottom=`${Ae}px`,ne.width=`${Ae}px`):me==="ne"?(ne.top="0",ne.right="0",ne.width=`${Ae}px`,ne.height=`${Ae}px`):me==="nw"?(ne.top="0",ne.left="0",ne.width=`${Ae}px`,ne.height=`${Ae}px`):me==="se"?(ne.bottom="0",ne.right="0",ne.width=`${Ae}px`,ne.height=`${Ae}px`):me==="sw"&&(ne.bottom="0",ne.left="0",ne.width=`${Ae}px`,ne.height=`${Ae}px`),ne.cursor=pc[me],ee.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${me}`,style:ne,onMouseDown:te(me)}))}}let le=null;if(w){let re={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"?(re.top="0",re.left="0",re.width="50%",re.height="100%"):w==="right"?(re.top="0",re.right="0",re.width="50%",re.height="100%"):w==="top"&&(re.top="0",re.left="0",re.width="100%",re.height="100%"),le=o("div",{className:"draggable-window__snap-preview",style:re})}let ce=[];for(let re=0;re<ee.length;re++)ce.push(ee[re]);ce.push(o("div",{className:"draggable-window__title-bar",style:O,onMouseDown:U,onDblClick:q,role:"toolbar","aria-label":`${n} window controls`},...Q)),ce.push(o("div",{className:"draggable-window__body",style:Y},v));let pe=[o("div",{ref:z,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:J},...ce)];return le&&pe.push(le),pe.length===1?pe[0]:o("div",{style:{display:"contents"}},...pe)}var fc=["File","Edit","View","Insert","Format","Tools","Help"],pi={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"}]},gc=[{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"}}],mc=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],hc=["1","2","3","4","5","6","7"],bc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function xc(){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 fi(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function qt(e){let[t,n]=G(!1),[r,i]=G(!1),[s,a]=G(!1),[l,d]=G(-1),[u,h]=G(""),[m,c]=G(-1),[p,f]=G(0),[y,b]=G("3"),g=oe(null),x=S(()=>{document.execCommand("bold",!1),n(Y=>!Y),g.current&&g.current.focus()},[]),v=S(()=>{document.execCommand("italic",!1),i(Y=>!Y),g.current&&g.current.focus()},[]),T=S(()=>{document.execCommand("underline",!1),a(Y=>!Y),g.current&&g.current.focus()},[]),D={bold:x,italic:v,underline:T},C={bold:t,italic:r,underline:s},$=S(Y=>{document.execCommand(Y,!1),g.current&&g.current.focus()},[]),L=S(Y=>{document.execCommand("fontSize",!1,Y),b(Y),g.current&&g.current.focus()},[]),I=S(Y=>{c(K=>K===Y?-1:Y)},[]),P=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":g.current&&(g.current.innerHTML="",f(0));break;default:break}c(-1),g.current&&g.current.focus()},[]),B=S(()=>{if(g.current){let Y=g.current.textContent??"";f(fi(Y))}},[]),E=S(()=>{c(-1)},[]),F=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"},R={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"},z=X(()=>xc(),[]),W=e.content??"Start typing...",_=fi(W),H=p>0?p:_;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 q={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},te={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function J(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"},O=fc.map((Y,K)=>{let Q=[Y];return m===K&&pi[Y]&&Q.push(o("div",{key:"dropdown",style:q,className:"word-processor__menu-dropdown"},...pi[Y].map((se,ee)=>o("button",{key:String(ee),style:te,onClick:le=>{le.stopPropagation(),P(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:F},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: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"}},...gc.map(Y=>o("button",{key:Y.id,style:J(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:()=>h(Y.id),onMouseLeave:()=>h("")},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)}},...hc.map(Y=>o("option",{key:Y,value:Y},bc[Y])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...mc.map((Y,K)=>o("button",{key:String(K),style:J(`align-${K}`),title:Y.label,"aria-label":Y.label,onClick:()=>$(Y.command),onMouseEnter:()=>h(`align-${K}`),onMouseLeave:()=>h("")},Y.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...z),o("main",{className:"word-processor__document-area",style:R,onClick:E},o("div",{className:"word-processor__page",style:M,contentEditable:"true",ref:g,onInput:B,suppressContentEditableWarning:!0},W)),o("div",{className:"word-processor__status-bar",style:N},o("span",null,"Page 1 of 1"),o("span",null,`${H} words`),o("span",null,"100%")))}var yc=["File","Edit","Selection","View","Go","Run","Terminal","Help"],gi={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"}]},mi=[{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}],On={"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"]',"}"]},hi=On["App.ts"],Sc=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"]),vc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),bi="#569cd6",wc="#ce9178",kc="#4ec9b0",Cc="#6a9955",Mc="#dcdcaa",_n="#d4d4d4",Ec="#d4d4d4",Ic="#b5cea8";function Rc(e){if(!e.trim())return[{text:"\xA0",color:_n}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:Cc});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:wc}),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:Ic}),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=_n;Sc.has(i)?l=bi:vc.has(i)?l=kc:a?l=Mc:(i==="true"||i==="false")&&(l=bi),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:_n}),n=r;continue}t.push({text:e[n],color:Ec}),n++}return t}function Kt(e){let[t,n]=G("App.ts"),[r,i]=G({src:!0,components:!0,hooks:!0}),[s,a]=G(-1),[l,d]=G(hi.length),u=oe(null),h=S(O=>{n(O);let Y=On[O];Y&&d(Y.length)},[]),m=S(O=>{i(Y=>{let K={},Q=Object.keys(Y);for(let se=0;se<Q.length;se++)K[Q[se]]=Y[Q[se]];return K[O]=!Y[O],K})},[]),c=S(O=>{a(Y=>Y===O?-1:O)},[]),p=S(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=S(()=>{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"}),[]),b={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},g={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},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"},$={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},L={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},I={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},P=(O,Y,K)=>({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:K?"rgba(255,255,255,0.08)":"transparent"}),B={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},E={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},F={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"},R={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"},z=8,W=30,_=On[t]??hi,H=_.map((O,Y)=>{let K=Rc(O),Q=[],se=0;for(let ee of K)Q.push(o("span",{key:String(se++),style:{color:ee.color}},ee.text));return o("div",{key:String(Y),style:{minHeight:"20px"}},...Q)}),U=Math.max(l,_.length),q=[];for(let O=0;O<U;O++)q.push(o("div",{key:String(O)},String(O+1)));let te=O=>{if(!O.parent)return!0;if(!r[O.parent])return!1;let Y=mi.find(K=>K.name===O.parent&&K.isFolder);return Y?te(Y):!0},J=yc.map((O,Y)=>{let K=[O],Q=s===Y;return Q&&gi[O]&&K.push(o("div",{key:"dropdown",style:T,className:"ide__menu-dropdown"},...gi[O].map((se,ee)=>o("button",{key:String(ee),style:D,onClick:le=>{le.stopPropagation(),p(se.action)},role:"menuitem"},se.label)))),o("button",{key:String(Y),style:Q?v:x,role:"menuitem","aria-label":O,onClick:()=>c(Y)},...K)}),j=mi.map((O,Y)=>{if(!te(O))return null;let K=!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,K),onClick:O.isFolder?()=>m(O.name):()=>h(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:b},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:g,role:"menubar"},...J),o("div",{style:C},o("nav",{className:"ide__sidebar",style:$,"aria-label":"File explorer"},o("div",{style:I},"Explorer"),...j),o("div",{style:L}),o("div",{style:B},o("div",{style:E},o("button",{style:F,"aria-label":t},t)),o("div",{style:A},o("div",{style:k,"aria-hidden":"true"},...q),o("code",{style:w,contentEditable:"true",ref:u,onInput:f,suppressContentEditableWarning:!0},...H))),o("div",{className:"ide__minimap",style:R,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${z}px`,left:"0",right:"0",height:`${W}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),..._.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 Pc=[{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]}],xi=[{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}],yi=[{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}],Si=[{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}],$c=[{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}],Tc=[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],vi=[{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}],wi=[{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}],ki=["09:30","10:00","10:30","11:00","11:30","12:00"];function zc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function At(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Ye(e){return e.toFixed(2)}var yt={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},St={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Zt={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Fe={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},Ne={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},Jt={cursor:"default",transition:"background-color 0.1s"};function Dc(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,h)=>{let m=h/(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),h=Math.max(...e),m=h-u||1,c=310/(e.length-1),p=e.map((C,$)=>{let L=40+$*c,I=15+(1-(C-u)/m)*120;return{x:L,y:I}}),f=p.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+p.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${p[p.length-1].x.toFixed(1)},135 Z`,b=[];for(let C=1;C<e.length;C++){let $=e[C]>=e[C-1]?"#00c853":"#ff1744";b.push(o("line",{key:String(C),x1:String(p[C-1].x.toFixed(1)),y1:String(p[C-1].y.toFixed(1)),x2:String(p[C].x.toFixed(1)),y2:String(p[C].y.toFixed(1)),stroke:$,strokeWidth:"2",strokeLinecap:"round"}))}let g=[];for(let C=0;C<5;C++){let $=15+C/4*120,L=h-C/4*m;g.push(o("line",{key:`g${C}`,x1:String(40),y1:String($.toFixed(1)),x2:String(350),y2:String($.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),g.push(o("text",{key:`yl${C}`,x:String(36),y:String(($+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Ye(L)))}let x=[],v=Math.min(ki.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"},ki[C]))}let D="chartGrad";return o("div",{style:yt},o("div",{style:St},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Ye(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})`}),...g,...x,...b,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(...xi.map(t=>t.qty),...yi.map(t=>t.qty));return o("div",{style:yt},o("div",{style:St},"Order Book"),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Fe},"Bid Price"),o("th",{style:Fe},"Qty"),o("th",{style:Fe},"Ask Price"),o("th",{style:Fe},"Qty"))),o("tbody",null,...xi.map((t,n)=>{let r=yi[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:Jt},o("td",{style:{...Ne,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Ye(t.price)),o("td",{style:{...Ne,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},At(t.qty)),o("td",{style:{...Ne,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Ye(r.price):""),o("td",{style:{...Ne,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?At(r.qty):""))}))))}function Bc(e){return o("div",{style:yt},o("div",{style:St},"Watchlist"),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Fe},"Symbol"),o("th",{style:Fe},"Price"),o("th",{style:Fe},"Chg%"),o("th",{style:Fe},"Volume"))),o("tbody",null,...Pc.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:Jt},o("td",{style:{...Ne,fontWeight:"600",color:"#ffffff"}},t.symbol,Dc(t.spark,i)),o("td",{style:{...Ne,fontFamily:"monospace"}},Ye(r)),o("td",{style:{...Ne,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Ye(t.change)}%`),o("td",{style:{...Ne,fontFamily:"monospace",color:"#8888aa"}},zc(t.volume)))}))))}function Fc(){let e=Si.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:yt},o("div",{style:St},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Ye(e)}`)),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Fe},"Symbol"),o("th",{style:Fe},"Qty"),o("th",{style:Fe},"Avg"),o("th",{style:Fe},"P&L"))),o("tbody",null,...Si.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...Jt,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...Ne,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...Ne,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...Ne,fontFamily:"monospace"}},Ye(n.avgPrice)),o("td",{style:{...Ne,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Ye(n.pnl)}`))}))))}function Nc(){return o("div",{style:yt},o("div",{style:St},"Recent Trades"),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Fe},"Time"),o("th",{style:Fe},"Sym"),o("th",{style:Fe},"Side"),o("th",{style:Fe},"Qty"),o("th",{style:Fe},"Price"))),o("tbody",null,...$c.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:Jt},o("td",{style:{...Ne,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...Ne,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...Ne,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...Ne,fontFamily:"monospace"}},At(e.qty)),o("td",{style:{...Ne,fontFamily:"monospace"}},Ye(e.price)))}))))}function Wc(){let e=Math.max(...vi.map(n=>n.volume),...wi.map(n=>n.volume)),t="16px";return o("div",{style:yt},o("div",{style:St},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...vi.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"}},Ye(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},At(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...wi.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"}},Ye(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},At(n.volume))))))}function Qt(e){let[t,n]=G(0),[r,i]=G("--:--:--"),[s,a]=G(!0);ae(()=>{let p=setInterval(()=>{n(f=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(p)},[]),ae(()=>{let p=()=>{let y=new Date,b=String(y.getHours()).padStart(2,"0"),g=String(y.getMinutes()).padStart(2,"0"),x=String(y.getSeconds()).padStart(2,"0");i(`${b}:${g}:${x}`)};p();let f=setInterval(p,1e3);return()=>clearInterval(f)},[]),ae(()=>{let p=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(p)},[]);let l=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},h={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},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:h},Ac(Tc,m),Lc(),Bc(t),Fc(),Nc(),Wc()))}function Te(e){return e.type==="card"}function Le(e){return e.type==="container"}function qe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function tt(e){return Te(e)?e.card_id:e.container_id}var _c={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},Hn=[{label:"Text",value:"text"},{label:"JSON",value:"json"},{label:"Task",value:"task"},{label:"Project",value:"project"}];function Oc(e){let t=e.content;return o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},"data-testid":`card-text-content-${e.card_id}`},t.text||"")}function Hc(e){let t=e.content,r=Object.entries(t).map(([i,s],a)=>o("div",{key:String(a),style:{display:"flex",gap:"4px",fontSize:"11px",lineHeight:"1.6",borderBottom:"1px solid rgba(0,0,0,0.05)",padding:"2px 0"}},o("span",{style:{fontWeight:"600",color:"#374151",minWidth:"60px"}},`${i}:`),o("span",{style:{color:"#555555"}},String(s??""))));return o("div",{style:{flex:"1",overflow:"auto"},"data-testid":`card-json-content-${e.card_id}`},...r)}function Yc(e){return o("div",{style:{fontSize:"12px",color:"#9ca3af",fontStyle:"italic",flex:"1",display:"flex",alignItems:"center",justifyContent:"center"},"data-testid":`card-task-content-${e.card_id}`},"Task card (coming soon)")}function Vc(e,t){let n=e.content;return o("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"4px 16px",borderRadius:"999px",backgroundColor:e.color||"#e0e7ff",fontSize:"13px",fontWeight:"600",color:"#1e3a5f",cursor:"pointer",flex:"1"},onDblClick:r=>{r.preventDefault(),r.stopPropagation(),t&&n.project_id&&t(n.project_id)},"data-testid":`card-project-content-${e.card_id}`},n.project_name||"Untitled Project")}function Ci(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d,onCardContextMenu:u,onUpdate:h,onDragStart:m,onDragEnd:c,onAnchorDragStart:p}=e,[f,y]=G(!1),[b,g]=G(null),[x,v]=G(!1),[T,D]=G(!1),[C,$]=G(!1),[L,I]=G(t.card_title||""),[P,B]=G(""),E=oe(null),F=oe(null),A=t.priority?_c[t.priority]||"#94a3b8":"transparent",k=S(ue=>{let Z=ue;Z.preventDefault(),Z.stopPropagation(),g({x:Z.clientX,y:Z.clientY}),v(!1),u&&u(t.card_id,{x:Z.clientX,y:Z.clientY})},[u,t.card_id]),w=S(()=>{g(null),v(!1)},[]),R=S(ue=>{let Z=ue,ie=Z.target;if(ie.dataset&&(ie.dataset.role==="delete"||ie.dataset.role==="resize"||ie.dataset.role==="drag-handle"||ie.dataset.role==="inline-edit"||ie.dataset.role==="anchor"))return;Z.preventDefault(),Z.stopPropagation(),r&&r(t.card_id),E.current={x:Z.clientX,y:Z.clientY,cardX:t.position.x,cardY:t.position.y},m&&m(t.card_id);let ye=Se=>{let we=Se;if(!E.current)return;let Ee=we.clientX-E.current.x,ke=we.clientY-E.current.y;i&&i(t.card_id,{x:E.current.cardX+Ee,y:E.current.cardY+ke})},be=()=>{E.current=null,c&&c(t.card_id),document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",be)};document.addEventListener("mousemove",ye),document.addEventListener("mouseup",be)},[t.card_id,t.position.x,t.position.y,r,i,m,c]),M=S(ue=>{let Z=ue;Z.preventDefault(),Z.stopPropagation(),F.current={x:Z.clientX,y:Z.clientY,w:t.size.width,h:t.size.height};let ie=be=>{let Se=be;if(!F.current)return;let we=Se.clientX-F.current.x,Ee=Se.clientY-F.current.y,ke=Math.max(120,F.current.w+we),Ie=Math.max(80,F.current.h+Ee);s&&s(t.card_id,{width:ke,height:Ie})},ye=()=>{F.current=null,document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",ye)};document.addEventListener("mousemove",ie),document.addEventListener("mouseup",ye)},[t.card_id,t.size.width,t.size.height,s]),N=S(ue=>{ue.preventDefault(),ue.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),z=S(ue=>{let Z=ue;Z.preventDefault(),Z.stopPropagation();let ye=Z.target.dataset.anchor;if(!ye||!p)return;let be=t.position.x,Se=t.position.y,we=t.size.width,Ee=t.size.height,ke=be+we/2,Ie=Se+Ee/2;ye==="top"?(ke=be+we/2,Ie=Se):ye==="right"?(ke=be+we,Ie=Se+Ee/2):ye==="bottom"?(ke=be+we/2,Ie=Se+Ee):ye==="left"&&(ke=be,Ie=Se+Ee/2),p(t.card_id,ye,{x:ke,y:Ie})},[t.card_id,t.position.x,t.position.y,t.size.width,t.size.height,p]),W=S(ue=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:ue}),w()},[t.card_id,l,w]),_=S(ue=>{ue.preventDefault(),ue.stopPropagation(),I(t.card_title||""),D(!0)},[t.card_title]),H=S(()=>{D(!1),h&&L!==t.card_title&&h(t.card_id,{card_title:L})},[h,t.card_id,t.card_title,L]),U=S(ue=>{let Z=ue;Z.key==="Enter"?(Z.preventDefault(),H()):Z.key==="Escape"&&(Z.preventDefault(),D(!1),I(t.card_title||""))},[H,t.card_title]),q=S(ue=>{let Z=ue.target;I(Z.value)},[]),te=S(ue=>{ue.stopPropagation();let Z=t.content;B(Z.text||""),$(!0)},[t.content]),J=S(()=>{$(!1),h&&h(t.card_id,{content:{text:P}})},[h,t.card_id,P]),V=S(ue=>{let Z=ue;if(Z.key==="Escape"){Z.preventDefault(),$(!1);let ie=t.content;B(ie.text||"")}},[t.content]),j=S(ue=>{let Z=ue.target;B(Z.value)},[]),O;switch(t.card_type){case"text":C?O=o("textarea",{"data-role":"inline-edit","data-testid":`card-desc-edit-${t.card_id}`,value:P,onInput:j,onBlur:J,onKeyDown:V,onFocus:ue=>{let Z=ue.target;Z.setSelectionRange(Z.value.length,Z.value.length)},style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",flex:"1",border:"1px solid #3b82f6",borderRadius:"3px",padding:"2px 4px",resize:"none",outline:"none",fontFamily:"inherit",backgroundColor:"#fff",width:"100%",boxSizing:"border-box"}}):O=o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1",cursor:"text"},"data-testid":`card-text-content-${t.card_id}`,onClick:te},t.content.text||"");break;case"json":O=Hc(t);break;case"task":O=Yc(t);break;case"project":O=Vc(t,d);break;default:O=Oc(t)}let Y=t.card_type==="project",K={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:Y?"999px":"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",zIndex:"1"},Q={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},se={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:f?"block":"none",border:"none",padding:"0"},ee={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={position:"absolute",top:"4px",right:"24px",width:"18px",height:"18px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.1)",color:"#333",fontSize:"10px",lineHeight:"18px",textAlign:"center",cursor:"grab",display:f?"block":"none",border:"none",padding:"0"},ce=8,pe={position:"absolute",width:`${ce}px`,height:`${ce}px`,borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #fff",boxSizing:"border-box",cursor:"crosshair",display:f?"block":"none",zIndex:"10"},he=[{anchor:"top",style:{...pe,top:`${-ce/2}px`,left:"50%",marginLeft:`${-ce/2}px`}},{anchor:"right",style:{...pe,top:"50%",right:`${-ce/2}px`,marginTop:`${-ce/2}px`}},{anchor:"bottom",style:{...pe,bottom:`${-ce/2}px`,left:"50%",marginLeft:`${-ce/2}px`}},{anchor:"left",style:{...pe,top:"50%",left:`${-ce/2}px`,marginTop:`${-ce/2}px`}}].map((ue,Z)=>o("div",{key:`anchor-${ue.anchor}`,style:ue.style,"data-role":"anchor","data-anchor":ue.anchor,"data-testid":`card-anchor-${ue.anchor}-${t.card_id}`,onMouseDown:z})),me=t.assignee?o("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",fontSize:"10px",color:"#555"},"data-testid":`card-assignee-${t.card_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,ne=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((ue,Z)=>o("span",{key:String(Z),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},ue))):null,de={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},ge={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"},xe=b?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${b.x}px`,top:`${b.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":`card-context-menu-${t.card_id}`,role:"menu","aria-label":"Card context menu",onClick:ue=>ue.stopPropagation()},o("div",{style:de,onClick:ue=>{ue.stopPropagation(),a&&a(t.card_id),w()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...de,position:"relative"},onMouseEnter:()=>v(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),x?o("div",{style:ge,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...Hn.map(ue=>o("div",{key:ue.value,style:{...de,fontWeight:t.card_type===ue.value?"700":"400"},onClick:Z=>{Z.stopPropagation(),W(ue.value)},role:"menuitem","data-testid":`ctx-type-${ue.value}-${t.card_id}`},ue.label,t.card_type===ue.value?" \u2713":""))):null)):null;return Y?o("div",{className:"board-card board-card--project",style:K,onMouseDown:R,onContextMenu:k,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),w()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Project card: ${t.card_title}`,tabIndex:0},O,o("div",{style:le,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),...he,xe):o("div",{className:"board-card",style:K,onMouseDown:R,onContextMenu:k,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),w()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Card: ${t.card_title}`,tabIndex:0},T?o("input",{"data-role":"inline-edit","data-testid":`card-title-edit-${t.card_id}`,value:L,onInput:q,onBlur:H,onKeyDown:U,onFocus:ue=>{let Z=ue.target;Z.setSelectionRange(Z.value.length,Z.value.length)},style:{...Q,border:"1px solid #3b82f6",borderRadius:"3px",padding:"1px 4px",outline:"none",width:"100%",boxSizing:"border-box",backgroundColor:"#fff"}}):o("div",{style:Q,"data-testid":`card-title-${t.card_id}`,onDblClick:_},t.card_title||"Untitled"),O,ne,me,o("div",{style:le,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":`Export drag handle for ${t.card_title}`,title:"Drag to export card"},"\u2630"),o("button",{style:se,"data-role":"delete","data-testid":`card-delete-${t.card_id}`,onClick:N,"aria-label":`Delete ${t.card_title}`,tabIndex:-1},"\xD7"),o("div",{style:ee,"data-role":"resize",onMouseDown:M,"aria-label":"Resize card"}),...he,xe)}function Mi(e){let{container:t,selected:n=!1,highlighted:r=!1,onSelect:i,onMove:s,onResize:a,onDelete:l,onDrop:d,children:u}=e,[h,m]=G(!1),[c,p]=G(!1),f=oe(null),y=oe(null),b=S(E=>{E.stopPropagation(),l&&l(t.container_id)},[t.container_id,l]),g=S(E=>{E.stopPropagation(),p(F=>!F)},[]),x=S(E=>{let F=E;F.preventDefault(),F.stopPropagation(),i&&i(t.container_id),f.current={x:F.clientX,y:F.clientY,posX:t.position.x,posY:t.position.y};let A=w=>{let R=w;if(!f.current)return;let M=R.clientX-f.current.x,N=R.clientY-f.current.y;s&&s(t.container_id,{x:f.current.posX+M,y:f.current.posY+N})},k=()=>{f.current=null,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",k)},[t.container_id,t.position.x,t.position.y,i,s]),v=S(E=>{let F=E;F.preventDefault(),F.stopPropagation(),y.current={x:F.clientX,y:F.clientY,w:t.size.width,h:t.size.height};let A=w=>{let R=w;if(!y.current)return;let M=R.clientX-y.current.x,N=R.clientY-y.current.y,z=Math.max(160,y.current.w+M),W=Math.max(120,y.current.h+N);a&&a(t.container_id,{width:z,height:W})},k=()=>{y.current=null,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",k)},[t.container_id,t.size.width,t.size.height,a]),T=S(E=>{E.preventDefault(),m(!0)},[]),D=S(()=>{m(!1)},[]),C=S(E=>{let F=E;if(F.preventDefault(),m(!1),d&&F.dataTransfer){let A=F.dataTransfer.getData("text/plain");A&&d(A,t.container_id)}},[t.container_id,d]),$=r||h,L={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:r?"#eff6ff":"#ffffff",border:r?"2px dashed #3b82f6":n?"2px solid #3b82f6":"2px solid #d1d5db",borderRadius:"8px",boxShadow:$?"0 0 0 3px rgba(59,130,246,0.3), 0 4px 16px rgba(0,0,0,0.1)":"0 2px 8px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:"0",boxSizing:"border-box",transition:"border 150ms ease, background-color 150ms ease, box-shadow 150ms ease"},I={padding:"6px 12px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",cursor:"grab",userSelect:"none",textAlign:"center",fontWeight:"700",fontSize:"15px",color:"#1f2937",flexShrink:"0"},P={flex:"1",overflow:"auto",position:"relative",padding:"4px"},B={position:"absolute",bottom:"0",right:"0",width:"14px",height:"14px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"};return o("div",{className:"board-container",style:L,"data-container-id":t.container_id,"data-testid":`container-${t.container_id}`,role:"group","aria-label":`Container: ${t.name}`,onDragOver:T,onDragLeave:D,onDrop:C},o("div",{className:"board-container__title",style:{...I,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseDown:x,"data-testid":`container-title-${t.container_id}`},o("span",null,t.name),o("span",{style:{display:"flex",gap:"4px"}},o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"12px",padding:"0 2px",lineHeight:"1"},onClick:g,"aria-label":c?"Expand container":"Minimize container",title:c?"Expand":"Minimize"},c?"\u25B2":"\u2014"),o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"14px",padding:"0 2px",lineHeight:"1"},onClick:b,"aria-label":"Delete container",title:"Delete"},"\xD7"))),c?null:o("div",{className:"board-container__contents",style:P,"data-testid":`container-contents-${t.container_id}`},u),c?null:o("div",{style:B,"data-role":"resize",onMouseDown:v,"aria-label":"Resize container"}))}function Ei(e){let t=e.position.x+e.size.width/2,n=e.position.y+e.size.height/2;return{top:{x:t,y:e.position.y},right:{x:e.position.x+e.size.width,y:n},bottom:{x:t,y:e.position.y+e.size.height},left:{x:e.position.x,y:n}}}function Uc(e,t){let n=Ei(e),r=Ei(t),i=[n.top,n.right,n.bottom,n.left],s=[r.top,r.right,r.bottom,r.left],a=1/0,l=n.right,d=r.left;for(let u=0;u<i.length;u++)for(let h=0;h<s.length;h++){let m=s[h].x-i[u].x,c=s[h].y-i[u].y,p=m*m+c*c;p<a&&(a=p,l=i[u],d=s[h])}return{from:l,to:d}}var Ii="board-card-link-arrowhead";function Ri(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,onLinkContextMenu:s,canvasWidth:a,canvasHeight:l}=e,d=new Map;for(let p=0;p<n.length;p++)d.set(n[p].card_id,n[p]);let u=S(p=>{i(p)},[i]),h=[];for(let p=0;p<t.length;p++){let{source:f,link:y}=t[p],b=d.get(y.target_card_id);if(!b)continue;let{from:g,to:x}=Uc(f,b),v=y.link_id===r,T=v?"#3b82f6":y.color||"#94a3b8",D=x.x-g.x,C=x.y-g.y,$=Math.sqrt(D*D+C*C),L=Math.min(40,$*.15),I=$>0?-C/$:0,P=$>0?D/$:0,B=(g.x+x.x)/2,E=(g.y+x.y)/2,F=B+I*L,A=E+P*L,k=`M ${g.x} ${g.y} Q ${F} ${A} ${x.x} ${x.y}`,w=f.card_id;h.push(o("path",{key:`hit-${y.link_id}`,d:k,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer",pointerEvents:"stroke"},onClick:()=>u(y.link_id),onContextMenu:R=>{let M=R;M.preventDefault(),M.stopPropagation(),s&&s(y.link_id,w,{x:M.clientX,y:M.clientY})},"data-testid":`link-hit-${y.link_id}`})),h.push(o("path",{key:y.link_id,d:k,fill:"none",stroke:T,"stroke-width":v?"3":"2","pointer-events":"none","marker-end":`url(#${Ii})`,"data-testid":`link-${y.link_id}`})),y.link_name&&h.push(o("text",{key:`label-${y.link_id}`,x:String(F),y:String(A-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${y.link_id}`},y.link_name))}let m={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"9999"},c=o("defs",{},o("marker",{id:Ii,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse"},o("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#94a3b8"})));return o("svg",{style:m,width:String(a),height:String(l),className:"card-link-overlay","data-testid":"card-link-overlay",role:"img","aria-label":"Card links"},c,o("g",{style:{pointerEvents:"auto"}},...h))}var jc=[{value:"#fef9c3",label:"Yellow"},{value:"#fecaca",label:"Red"},{value:"#fed7aa",label:"Orange"},{value:"#bbf7d0",label:"Green"},{value:"#bfdbfe",label:"Blue"},{value:"#ddd6fe",label:"Purple"},{value:"#fbcfe8",label:"Pink"},{value:"#e5e7eb",label:"Gray"}],Yn=20,vt=5e3;function Gc(e,t,n,r){for(let i=0;i<e.length;i++){let s=e[i];if(Le(s)&&s.container_id!==r&&t>=s.position.x&&t<=s.position.x+s.size.width&&n>=s.position.y&&n<=s.position.y+s.size.height)return s.container_id}return null}function Pi(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function $i(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Xc(e){let t=[],n=[],r=[];for(let i=e.length-1;i>=0;i--)r.push([e[i],0,0]);for(;r.length>0;){let[i,s,a]=r.pop();if(Te(i)){let l={...i,position:{x:i.position.x+s,y:i.position.y+a}};t.push(l);for(let d=0;d<i.card_link.length;d++)n.push({source:l,link:i.card_link[d]})}else if(Le(i)){let l=s+i.position.x,d=a+i.position.y+30;for(let u=i.contents.length-1;u>=0;u--)r.push([i.contents[u],l,d])}}return{cards:t,links:n}}function Vn(e){let{state:t,dispatch:n,selectedId:r=null,onSelectItem:i,gridEnabled:s=!1,searchQuery:a="",colorFilter:l=null,onOpenProject:d,onCardContextMenu:u,onUpdateItem:h}=e,{collection:m,viewport:c}=t,p=oe(null),f=oe(!1),y=oe(null),[b,g]=G(null),[x,v]=G(null),[T,D]=G(null),[C,$]=G(null),[L,I]=G(!1),[P,B]=G(!1),[E,F]=G(null),A=S(Z=>{let ie=Z,ye=ie.target;if(ye.closest(".board-card")||ye.closest(".board-container"))return;let be=ie.button===1,Se=ie.button===0&&ie.shiftKey;be||Se?(ie.preventDefault(),f.current=!0,y.current={x:ie.clientX,y:ie.clientY,panX:c.panX,panY:c.panY}):ie.button===0&&i&&i(null)},[c.panX,c.panY,i]);ae(()=>{let Z=ye=>{if(!f.current||!y.current)return;let be=ye,Se=be.clientX-y.current.x,we=be.clientY-y.current.y;n({type:"PAN",panX:y.current.panX+Se,panY:y.current.panY+we})},ie=()=>{f.current=!1,y.current=null};return document.addEventListener("mousemove",Z),document.addEventListener("mouseup",ie),()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",ie)}},[n]);let k=S(Z=>{let ie=Z;if(!ie.ctrlKey)return;ie.preventDefault();let ye=ie.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+ye})},[c.zoom,n]),w=oe(null);ae(()=>{let Z=p.current;if(!Z)return;let ie=Ee=>{let ke=[];for(let Ie=0;Ie<Ee.touches.length;Ie++)ke.push({x:Ee.touches[Ie].clientX,y:Ee.touches[Ie].clientY});return ke},ye=(Ee,ke)=>Math.sqrt((Ee.x-ke.x)**2+(Ee.y-ke.y)**2),be=Ee=>{let ke=Ee;if(ke.touches.length===2){ke.preventDefault();let Ie=ie(ke);w.current={touches:Ie,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:ye(Ie[0],Ie[1])}}},Se=Ee=>{let ke=Ee;if(ke.touches.length!==2||!w.current)return;ke.preventDefault();let Ie=ie(ke),ze=w.current,Ve=(ze.touches[0].x+ze.touches[1].x)/2,Ft=(ze.touches[0].y+ze.touches[1].y)/2,Ct=(Ie[0].x+Ie[1].x)/2,ut=(Ie[0].y+Ie[1].y)/2;n({type:"PAN",panX:ze.panX+(Ct-Ve),panY:ze.panY+(ut-Ft)});let fe=ye(Ie[0],Ie[1]);ze.dist>0&&n({type:"ZOOM",zoom:ze.zoom*(fe/ze.dist)})},we=()=>{w.current=null};return Z.addEventListener("touchstart",be,{passive:!1}),Z.addEventListener("touchmove",Se,{passive:!1}),Z.addEventListener("touchend",we),()=>{Z.removeEventListener("touchstart",be),Z.removeEventListener("touchmove",Se),Z.removeEventListener("touchend",we)}},[c.panX,c.panY,c.zoom,n]);let R=S((Z,ie)=>{$({cardId:Z,x:ie.x,y:ie.y}),I(!1),B(!1),u&&u(Z,ie)},[u]),M=S(()=>{$(null),I(!1),B(!1)},[]);ae(()=>{if(!C)return;let Z=()=>{M()};return document.addEventListener("click",Z),()=>{document.removeEventListener("click",Z)}},[C,M]);let N=S((Z,ie,ye)=>{F({linkId:Z,cardId:ie,x:ye.x,y:ye.y}),M()},[M]),z=S(()=>{F(null)},[]);ae(()=>{if(!E)return;let Z=()=>z();return document.addEventListener("click",Z),()=>document.removeEventListener("click",Z)},[E,z]);let W=S(Z=>{i&&i(Z)},[i]),_=S((Z,ie)=>{let ye=ie;if(s&&(ye=Pi(ie,Yn)),n({type:"MOVE_ITEM",itemId:Z,position:ye}),x===Z){let be=0,Se=0,we=[...m];for(;we.length>0;){let ze=we.pop();if(Te(ze)&&ze.card_id===Z){be=ze.size.width,Se=ze.size.height;break}if(Le(ze))for(let Ve=0;Ve<ze.contents.length;Ve++)we.push(ze.contents[Ve])}let Ee=ye.x+be/2,ke=ye.y+Se/2,Ie=Gc(m,Ee,ke,Z);g(Ie)}},[n,s,x,m]),H=S((Z,ie)=>{n({type:"RESIZE_ITEM",itemId:Z,size:ie})},[n]),U=S(Z=>{n({type:"REMOVE_ITEM",itemId:Z}),i&&r===Z&&i(null)},[n,r,i]),q=S((Z,ie)=>{n({type:"NEST_ITEM",itemId:Z,containerId:ie})},[n]),te=S(Z=>{v(Z),g(null)},[]),J=oe(null);J.current=b;let V=S(Z=>{let ie=J.current;ie&&n({type:"NEST_ITEM",itemId:Z,containerId:ie}),v(null),g(null)},[n]),j=S((Z,ie,ye)=>{D({fromCardId:Z,fromAnchor:ie,fromPos:ye,currentPos:ye})},[]),O=oe(null);O.current=T,ae(()=>{if(!T)return;let Z=ye=>{let be=ye,Se=0,we=0;if(p.current){let ke=p.current.getBoundingClientRect();Se=ke.left,we=ke.top}let Ee=$i(be.clientX-Se,be.clientY-we,c);D(ke=>ke?{...ke,currentPos:Ee}:null)},ie=ye=>{let be=ye,Se=O.current;if(!Se){D(null);return}let we=document.elementFromPoint(be.clientX,be.clientY);if(we&&we.dataset&&we.dataset.role==="anchor"&&we.dataset.anchor){let Ee=we.closest("[data-card-id]");if(Ee&&Ee.dataset.cardId&&Ee.dataset.cardId!==Se.fromCardId){let ke=Ee.dataset.cardId;n({type:"ADD_LINK",cardId:Se.fromCardId,link:{link_id:qe(),link_name:"relates to",target_card_id:ke,color:"#94a3b8",attributes:{}}})}}D(null)};return document.addEventListener("mousemove",Z),document.addEventListener("mouseup",ie),()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",ie)}},[T!==null,c.panX,c.panY,c.zoom,n]);let Y=a.toLowerCase(),K=new Set,Q=[],se=[...m];for(;se.length>0;){let Z=se.pop();if(Q.push(Z),Le(Z))for(let ie=0;ie<Z.contents.length;ie++)se.push(Z.contents[ie])}if(Y)for(let Z=0;Z<Q.length;Z++){let ie=Q[Z];(Te(ie)?ie.card_title:ie.name).toLowerCase().includes(Y)||K.add(tt(ie))}if(l)for(let Z=0;Z<Q.length;Z++){let ie=Q[Z];Te(ie)&&ie.color!==l&&K.add(ie.card_id)}let{cards:ee,links:le}=Xc(m);function ce(Z){let ie=tt(Z),ye=K.has(ie),be;if(Te(Z))be=o(Ci,{key:ie,card:Z,selected:ie===r,onSelect:W,onMove:_,onResize:H,onDelete:U,dispatch:n,onOpenProject:d,onCardContextMenu:R,onUpdate:h,onDragStart:te,onDragEnd:V,onAnchorDragStart:j});else{let Se=Z.contents.map(we=>ce(we));be=o(Mi,{key:ie,container:Z,selected:ie===r,highlighted:b===Z.container_id,onSelect:W,onMove:_,onResize:H,onDelete:U,onDrop:q},...Se)}return ye?o("div",{key:`dim-${ie}`,style:{opacity:"0.3"}},be):be}let pe=m.map(Z=>ce(Z)),re={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${Yn}px ${Yn}px`},he={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${vt}px`,height:`${vt}px`},me={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap",fontSize:"13px",color:"#1a1a1a"},ne={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"},de={height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"},ge=C?o("div",{className:"board-context-menu",style:{position:"fixed",left:`${C.x}px`,top:`${C.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":`board-context-menu-${C.cardId}`,role:"menu","aria-label":"Card context menu",onClick:Z=>Z.stopPropagation()},o("div",{style:{...me,position:"relative"},onMouseEnter:()=>{I(!0),B(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-color-${C.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),L?o("div",{style:ne,role:"menu","data-testid":`board-ctx-color-submenu-${C.cardId}`},...jc.map(Z=>o("div",{key:Z.value,style:{...me,gap:"8px"},onClick:ie=>{ie.stopPropagation(),n({type:"UPDATE_CARD",cardId:C.cardId,updates:{color:Z.value}}),M()},role:"menuitem","data-testid":`board-ctx-color-${Z.label.toLowerCase()}-${C.cardId}`},o("span",{style:{display:"inline-block",width:"14px",height:"14px",borderRadius:"3px",backgroundColor:Z.value,border:"1px solid #d1d5db",flexShrink:"0"}}),Z.label))):null),o("div",{style:{...me,position:"relative"},onMouseEnter:()=>{B(!0),I(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-type-${C.cardId}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),P?o("div",{style:ne,role:"menu","data-testid":`board-ctx-type-submenu-${C.cardId}`},...Hn.map(Z=>o("div",{key:Z.value,style:me,onClick:ie=>{ie.stopPropagation(),n({type:"CHANGE_CARD_TYPE",cardId:C.cardId,newType:Z.value}),M()},role:"menuitem","data-testid":`board-ctx-type-${Z.value}-${C.cardId}`},Z.label))):null),o("div",{style:de,role:"separator"}),o("div",{style:{...me,color:"#dc2626"},onClick:Z=>{Z.stopPropagation(),n({type:"REMOVE_ITEM",itemId:C.cardId}),i&&r===C.cardId&&i(null),M()},role:"menuitem","data-testid":`board-ctx-delete-${C.cardId}`},"Delete")):null,xe=["relates to","depends on","blocks","is blocked by","implements","is implemented by","extends","includes","references","duplicates","parent of","child of"],ue=E?o("div",{className:"board-link-context-menu",style:{position:"fixed",left:`${E.x}px`,top:`${E.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",maxHeight:"240px",overflowY:"auto",zIndex:"10001",fontSize:"13px"},onClick:Z=>Z.stopPropagation()},o("div",{style:{padding:"4px 14px",fontSize:"11px",color:"#94a3b8",fontWeight:"600"}},"Edge Type"),...xe.map(Z=>o("button",{key:Z,style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},onClick:()=>{n({type:"UPDATE_CARD",cardId:E.cardId,updates:{card_link:(()=>{let ie=null,ye=[...m];for(;ye.length>0;){let be=ye.pop();if(Te(be)&&be.card_id===E.cardId){ie=be;break}if(Le(be))for(let Se of be.contents)ye.push(Se)}return ie?ie.card_link.map(be=>be.link_id===E.linkId?{...be,link_name:Z}:be):[]})()}}),z()},role:"menuitem"},Z)),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#ef4444",fontFamily:"inherit"},onClick:()=>{n({type:"REMOVE_LINK",cardId:E.cardId,linkId:E.linkId}),z()},role:"menuitem"},"Delete Link")):null;return o("div",{ref:p,className:"board-canvas",style:re,onMouseDown:A,onWheel:k,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:he,"data-testid":"board-canvas-inner"},o(Ri,{links:le,cards:ee,selectedLinkId:null,onSelectLink:()=>{},onLinkContextMenu:N,canvasWidth:vt,canvasHeight:vt}),T?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(vt),height:String(vt),className:"link-drag-overlay","data-testid":"link-drag-overlay"},o("line",{x1:String(T.fromPos.x),y1:String(T.fromPos.y),x2:String(T.currentPos.x),y2:String(T.currentPos.y),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6 4","pointer-events":"none","data-testid":"link-drag-line"})):null,...pe),ge,ue)}function qc(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Te(r))t.push(r);else if(Le(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function Ti(e,t,n,r){let i=r??40,s=qc(e);if(s.length===0)return{panX:0,panY:0,zoom:1};let a=1/0,l=1/0,d=-1/0,u=-1/0;for(let g=0;g<s.length;g++){let x=s[g];x.position.x<a&&(a=x.position.x),x.position.y<l&&(l=x.position.y);let v=x.position.x+x.size.width,T=x.position.y+x.size.height;v>d&&(d=v),T>u&&(u=T)}let h=d-a+i*2,m=u-l+i*2,c=t/h,p=n/m,f=Math.max(.25,Math.min(4,Math.min(c,p))),y=-a*f+(t-(d-a)*f)/2,b=-l*f+(n-(u-l)*f)/2;return{panX:y,panY:b,zoom:f}}var Un=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function zi(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:h,onGridToggle:m,onSearch:c}=e,[p,f]=G(""),y=S($=>{let L=$.target.value;f(L),c(L)},[c]),b={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"},g={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},x={...g,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=Un.map($=>{let L=$===r,I=$===i,P=()=>{L&&h?h(I?null:$):u($)},B="1px solid rgba(0,0,0,0.15)";return I?B="3px solid #ef4444":L&&(B="2px solid #3b82f6"),o("button",{key:$,title:$,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:$,border:B,cursor:"pointer",padding:"0",flexShrink:"0",opacity:I?"1":i?"0.5":"1"},onClick:P,"aria-label":I?`Clear color filter ${$}`:`Select color ${$}`,"data-testid":`color-swatch-${$}`})});return o("div",{className:"board-toolbar",style:b,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:g,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:T}),o("button",{style:g,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:g,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:g,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:p,onInput:y,style:D,"data-testid":"search-input","aria-label":"Search cards"}))}var Di=50,ct={id:qe(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function Ai(e,t){let n=null;function r(s){let a=[];for(let l=0;l<s.length;l++){let d=s[l];if(tt(d)===t){n=d;continue}if(Le(d)){let h=r(d.contents);a.push({...d,contents:h})}else a.push(d)}return a}return[r(e),n]}function lt(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];tt(s)===t?r.push(n(s)):Le(s)?r.push({...s,contents:lt(s.contents,t,n)}):r.push(s)}return r}function en(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];Le(s)&&s.container_id===t?r.push({...s,contents:[...s.contents,n]}):Le(s)?r.push({...s,contents:en(s.contents,t,n)}):r.push(s)}return r}function Li(e,t){let n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r)){if(r.container_id===t)return r;for(let i=0;i<r.contents.length;i++)n.push(r.contents[i])}}return null}function Kc(e,t,n){let r=null;function i(a){let l=[];for(let d=0;d<a.length;d++){let u=a[d];if(Le(u)&&u.container_id===t){let h=[];for(let m=0;m<u.contents.length;m++){let c=u.contents[m];tt(c)===n?r=c:h.push(c)}l.push({...u,contents:h})}else Le(u)?l.push({...u,contents:i(u.contents)}):l.push(u)}return l}return[i(e),r]}function Zc(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function Bi(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:en(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=Ai(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:lt(e.collection,t.itemId,n=>({...n,position:t.position,...Te(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:lt(e.collection,t.itemId,n=>({...n,size:t.size,...Te(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:lt(e.collection,t.cardId,n=>Te(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:lt(e.collection,t.cardId,n=>Te(n)?{...n,card_type:t.newType,content:Zc(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:en(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let n=Li(e.collection,t.containerId);if(!n)return e;let[r,i]=Ai(e.collection,t.itemId);if(!i)return e;let s={...i,position:{x:i.position.x-n.position.x,y:i.position.y-n.position.y-30}};return{...e,collection:en(r,t.containerId,s)}}case"UNNEST_ITEM":{let n=Li(e.collection,t.containerId),[r,i]=Kc(e.collection,t.containerId,t.itemId);if(!i)return e;let s=n?{...i,position:{x:i.position.x+n.position.x,y:i.position.y+n.position.y+30}}:i;return{...e,collection:[...r,s]}}case"ADD_LINK":return{...e,collection:lt(e.collection,t.cardId,n=>Te(n)?{...n,card_link:[...n.card_link,t.link],updatedAt:Date.now()}:n)};case"REMOVE_LINK":return{...e,collection:lt(e.collection,t.cardId,n=>Te(n)?{...n,card_link:n.card_link.filter(r=>r.link_id!==t.linkId),updatedAt:Date.now()}:n)};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;case"RENAME_BOARD":return{...e,name:t.name};default:return e}}function Jc(e){return e.type==="PAN"||e.type==="ZOOM"}function Fi(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=Bi(e.present,t.action);if(n===e.present)return e;if(Jc(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 jn(e){let t={past:[],present:e||ct,future:[]},[n,r]=pn(Fi,t),i=S(l=>{r({type:"BOARD_ACTION",action:l})},[r]),s=S(()=>{r({type:"UNDO"})},[r]),a=S(()=>{r({type:"REDO"})},[r]);return{state:n.present,dispatch:i,undo:s,redo:a,canUndo:n.past.length>0,canRedo:n.future.length>0}}function Ni(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=jn(),d=oe(!1);ae(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{r({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,r]);let u=oe(null),h=oe(n);return h.current=n,ae(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,h.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,n]),{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}}var tn=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):{...ct}}catch{return{...ct}}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Qc(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Te(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function Wi(e){let{collection:t,onCardDropped:n,children:r}=e,i=et(),s=oe([]);ae(()=>{let u=Qc(t),h=s.current,m=new Set(h.map(p=>p.card_id)),c=new Set(u.map(p=>p.card_id));for(let p of u)m.has(p.card_id)||i.publish("project-board",{event:"card-created",card:p});for(let p of h)c.has(p.card_id)||i.publish("project-board",{event:"card-deleted",cardId:p.card_id});for(let p of u)if(m.has(p.card_id)){let f=h.find(y=>y.card_id===p.card_id);f&&f.updatedAt!==p.updatedAt&&i.publish("project-board",{event:"card-updated",card:p})}s.current=u},[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 h=u.data;n(String(h.title||"Dropped Item"),String(h.description||""))}},[n]),{isOver:l}=zt({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 ed=new tn;function _i(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Te(r))t.push(r);else if(Le(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}var nt=Date.now(),td={id:"sample-board-001",name:"Sample Project",collection:[{type:"card",card_id:"sample-1",card_type:"text",card_title:"Auth API",card_link:[{link_id:"link-1",link_name:"blocks",target_card_id:"sample-2",color:"#94a3b8",attributes:{}}],content:{text:"Design the auth flow"},position:{x:50,y:50},size:{width:180,height:120},color:"#3b82f6",priority:"high",assignee:"Alice",createdAt:nt,updatedAt:nt},{type:"card",card_id:"sample-2",card_type:"text",card_title:"Dashboard",card_link:[],content:{text:"Build the main dashboard"},position:{x:300,y:80},size:{width:180,height:120},color:"#22c55e",priority:"medium",assignee:"Bob",createdAt:nt,updatedAt:nt},{type:"card",card_id:"sample-3",card_type:"text",card_title:"Deploy",card_link:[],content:{text:"Set up CI pipeline"},position:{x:150,y:250},size:{width:180,height:120},color:"#f59e0b",priority:"low",createdAt:nt,updatedAt:nt},{type:"card",card_id:"sample-4",card_type:"text",card_title:"Docs",card_link:[],content:{text:"Write API reference"},position:{x:400,y:280},size:{width:180,height:120},color:"#a855f7",priority:"medium",assignee:"Carol",createdAt:nt,updatedAt:nt}],viewport:{panX:0,panY:0,zoom:1}};function nd(e){return e.collection.length===0}function Oi(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Ni(ed,t),[d,u]=G(Un[0]),[h,m]=G(!1),[c,p]=G(""),[f,y]=G(null),[b,g]=G(null),[x,v]=G(n.name||"Untitled"),[T,D]=G(!1),[C,$]=G(""),[L,I]=G(null),[P,B]=G(!0),[E,F]=G([{name:"relates to",weight:1},{name:"depends on",weight:2},{name:"blocks",weight:3},{name:"is blocked by",weight:3},{name:"implements",weight:2},{name:"references",weight:1}]),[A,k]=G(null),[w,R]=G(""),[M,N]=G("1"),[z,W]=G([]),_=oe(!1);ae(()=>{!_.current&&nd(n)?(_.current=!0,r({type:"SET_BOARD",state:td})):n.collection.length>0&&(_.current=!0)},[n,r]);let H=S(()=>{let fe=(-n.viewport.panX+300)/n.viewport.zoom,Ce=(-n.viewport.panY+200)/n.viewport.zoom,Me=(Math.random()-.5)*300,$e=(Math.random()-.5)*200,Ge={type:"card",card_id:qe(),card_type:"text",card_title:"New Card",card_link:[],content:{text:""},color:d,position:{x:Math.round(fe+Me),y:Math.round(Ce+$e)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:Ge})},[n.viewport,d,r]),U=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),q=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),te=S(()=>{r({type:"ZOOM",zoom:1})},[r]),J=S(()=>{m(fe=>!fe)},[]),V=S(fe=>{p(fe)},[]),j=S(fe=>{y(fe)},[]),O=S(fe=>{g(fe)},[]),Y=S(()=>{B(fe=>!fe)},[]),K=S(()=>{r({type:"SET_BOARD",state:ct}),y(null)},[r]),Q=S(()=>{let fe=JSON.stringify(n,null,2),Ce=new Blob([fe],{type:"application/json"}),Me=URL.createObjectURL(Ce),$e=document.createElement("a");$e.href=Me,$e.download=`board-${t}.json`,$e.style.display="none",document.body.appendChild($e),$e.click(),document.body.removeChild($e),URL.revokeObjectURL(Me)},[n,t]),se=S(()=>{let fe=document.createElement("input");fe.type="file",fe.accept=".json,application/json",fe.style.display="none",fe.addEventListener("change",()=>{let Ce=fe.files&&fe.files[0];if(!Ce)return;let Me=new FileReader;Me.onload=()=>{try{let $e=JSON.parse(Me.result);$e&&$e.collection&&$e.viewport&&r({type:"SET_BOARD",state:$e})}catch{}},Me.readAsText(Ce)}),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe)},[r]),ee=S(()=>{window.print()},[]),le=_i(n.collection),ce=S(()=>{let fe=_i(n.collection);fe.length>0&&y(fe[0].card_id)},[n.collection]),pe=S(()=>{f&&(r({type:"REMOVE_ITEM",itemId:f}),y(null))},[f,r]),re=S(()=>{if(n.collection.length===0)return;let Me=Ti(n.collection,800,600);r({type:"PAN",panX:Me.panX,panY:Me.panY}),r({type:"ZOOM",zoom:Me.zoom})},[n.collection,r]);ae(()=>{let fe={menus:[{label:"File",items:[{label:"New Board",onClick:K},{label:"Export JSON",onClick:Q},{label:"Import JSON",onClick:se},{divider:!0},{label:"Print",onClick:ee}]},{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:ce},{label:"Delete Selected",onClick:pe}]},{label:"View",items:[{label:"Zoom In",onClick:U},{label:"Zoom Out",onClick:q},{label:"Fit All",onClick:re},{divider:!0},{label:"Toggle Grid",onClick:J}]}]}},[K,Q,se,ee,i,s,a,l,ce,pe,U,q,re,J]),ae(()=>{let fe=Ce=>{let Me=Ce;Me.ctrlKey&&Me.key==="z"?(Me.preventDefault(),i()):Me.ctrlKey&&Me.key==="y"&&(Me.preventDefault(),s())};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[i,s]),ae(()=>{if(!L)return;let fe=()=>I(null),Ce=setTimeout(()=>document.addEventListener("click",fe),0);return()=>{clearTimeout(Ce),document.removeEventListener("click",fe)}},[L]);let he=S(()=>{$(x),D(!0)},[x]),me=S(()=>{let fe=C.trim();fe&&(v(fe),r({type:"RENAME_BOARD",name:fe}),e.onTitleChange&&e.onTitleChange(`Project Board: ${fe}`)),D(!1)},[C,r,e.onTitleChange]),ne=S(()=>{D(!1)},[]),de=S(fe=>{$(fe.target.value)},[]),ge=S(fe=>{let Ce=fe;Ce.key==="Enter"&&(Ce.preventDefault(),me()),Ce.key==="Escape"&&(Ce.preventDefault(),ne())},[me,ne]),xe={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},ue=S((fe,Ce)=>{let Me=(-n.viewport.panX+300)/n.viewport.zoom,$e=(-n.viewport.panY+200)/n.viewport.zoom,Ge=(Math.random()-.5)*300,rt=(Math.random()-.5)*200,Mt={type:"card",card_id:qe(),card_type:"text",card_title:fe,card_link:[],content:{text:Ce},color:d,position:{x:Math.round(Me+Ge),y:Math.round($e+rt)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:Mt})},[n.viewport,d,r]),Z={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},ie={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},ye=S(()=>{let fe=(-n.viewport.panX+300)/n.viewport.zoom,Ce=(-n.viewport.panY+200)/n.viewport.zoom,Me=(Math.random()-.5)*300,$e=(Math.random()-.5)*200;r({type:"ADD_CONTAINER",container:{type:"container",container_id:qe(),name:"New Container",position:{x:Math.round(fe+Me),y:Math.round(Ce+$e)},size:{width:300,height:250},contents:[]}}),I(null)},[n.viewport,r]),be={position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",zIndex:"1000"},Se={display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},we=o("div",{style:Z,"data-testid":"app-menu-bar"},o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ie,onClick:()=>I(L==="project"?null:"project")},"Project"),L==="project"?o("div",{style:be},o("button",{style:Se,onClick:()=>{he(),I(null)}},"Rename Project..."),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:Se,onClick:()=>{ye()}},"New Container"),o("button",{style:Se,onClick:()=>{H(),I(null)}},"New Card")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ie,onClick:()=>I(L==="graphs"?null:"graphs")},"Graphs"),L==="graphs"?o("div",{style:be},o("button",{style:Se,onClick:()=>{R(""),N("1"),k("add"),I(null)}},"Add Attribute..."),o("button",{style:Se,onClick:()=>{k("delete"),I(null)}},"Delete Attribute..."),o("button",{style:Se,onClick:()=>{W(E.map(fe=>({...fe}))),k("edit"),I(null)}},"Edit Attributes...")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ie,onClick:()=>I(L==="settings"?null:"settings")},"Settings"),L==="settings"?o("div",{style:be},o("button",{style:Se,onClick:()=>{J(),I(null)}},h?"Disable Grid Snap":"Enable Grid Snap"),o("button",{style:Se,onClick:()=>{Y(),I(null)}},P?"Hide Links":"Show Links")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ie,onClick:()=>I(L==="help"?null:"help")},"Help"),L==="help"?o("div",{style:be},o("button",{style:Se,onClick:()=>I(null)},"About Project Board"),o("button",{style:Se,onClick:()=>I(null)},"Keyboard Shortcuts")):null),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${x}`)),Ee=T?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:ne},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:fe=>fe.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:C,onInput:de,onKeyDown:ge,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:ne,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:me,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,ke={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},Ie={backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"320px",maxHeight:"400px",overflow:"auto"},ze={fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"},Ve={width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},Ft={padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},Ct={padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"},ut=null;return A==="add"&&(ut=o("div",{style:ke,onClick:()=>k(null)},o("div",{style:Ie,onClick:fe=>fe.stopPropagation(),role:"dialog","aria-label":"Add edge attribute"},o("div",{style:ze},"Add Edge Attribute"),o("div",{style:{marginBottom:"8px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Name"),o("input",{type:"text",value:w,style:Ve,placeholder:"e.g. depends on",onInput:fe=>R(fe.target.value)})),o("div",{style:{marginBottom:"12px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Weight"),o("input",{type:"number",value:M,style:Ve,min:"0",step:"1",onInput:fe=>N(fe.target.value)})),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},o("button",{style:Ct,onClick:()=>k(null)},"Cancel"),o("button",{style:Ft,onClick:()=>{let fe=w.trim(),Ce=parseFloat(M)||1;fe&&F(Me=>[...Me,{name:fe,weight:Ce}]),k(null)}},"Add"))))),A==="delete"&&(ut=o("div",{style:ke,onClick:()=>k(null)},o("div",{style:Ie,onClick:fe=>fe.stopPropagation(),role:"dialog","aria-label":"Delete edge attribute"},o("div",{style:ze},"Delete Edge Attribute"),E.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},...E.map((fe,Ce)=>o("div",{key:String(Ce),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 8px",borderRadius:"4px",border:"1px solid #e5e7eb"}},o("span",{style:{fontSize:"13px"}},`${fe.name} (weight: ${fe.weight})`),o("button",{style:{border:"none",backgroundColor:"transparent",color:"#ef4444",cursor:"pointer",fontSize:"16px"},onClick:()=>F(Me=>Me.filter(($e,Ge)=>Ge!==Ce))},"\xD7")))),o("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"12px"}},o("button",{style:Ct,onClick:()=>k(null)},"Done"))))),A==="edit"&&(ut=o("div",{style:ke,onClick:()=>k(null)},o("div",{style:{...Ie,minWidth:"400px"},onClick:fe=>fe.stopPropagation(),role:"dialog","aria-label":"Edit edge attributes"},o("div",{style:ze},"Edit Edge Attributes"),z.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...z.map((fe,Ce)=>o("div",{key:String(Ce),style:{display:"flex",alignItems:"center",gap:"8px"}},o("input",{type:"text",value:fe.name,style:{...Ve,flex:"1"},onInput:Me=>{let $e=Me.target.value;W(Ge=>Ge.map((rt,Mt)=>Mt===Ce?{...rt,name:$e}:rt))}}),o("input",{type:"number",value:String(fe.weight),min:"0",step:"1",style:{...Ve,width:"80px"},onInput:Me=>{let $e=parseFloat(Me.target.value)||0;W(Ge=>Ge.map((rt,Mt)=>Mt===Ce?{...rt,weight:$e}:rt))}})))),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{style:Ct,onClick:()=>k(null)},"Cancel"),o("button",{style:Ft,onClick:()=>{F(z.filter(fe=>fe.name.trim())),k(null)}},"Save"))))),o("div",{className:"project-manager-app",style:xe,"data-testid":"project-manager-app"},we,o(zi,{zoom:n.viewport.zoom,gridEnabled:h,selectedColor:d,colorFilter:b,onNewCard:H,onZoomIn:U,onZoomOut:q,onZoomReset:te,onColorSelect:u,onColorFilter:O,onGridToggle:J,onSearch:V}),o(Wi,{collection:n.collection,onCardDropped:ue},o(Vn,{state:n,dispatch:r,searchQuery:c,gridEnabled:h,selectedId:f,onSelectItem:j,colorFilter:b,onUpdateItem:(fe,Ce)=>{r({type:"UPDATE_CARD",cardId:fe,updates:Ce})},onCardContextMenu:(fe,Ce)=>{}})),Ee,ut)}var od=28,rd=5e3;var Hi=0;function Yi(e){return Hi++,`${e}-${Hi}`}function id(e){return e.replace(/\s*\(\d+\)$/,"")}function sd(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 ad(){let e=et(),t=oe(!1);return ae(()=>{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 ld(){let[e,t]=G([]),n=at();$t("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 cd(e,t,n){let r={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(id(e)){case"Files":return o(Qe,{appId:"files"},o(ld,null));case"Terminal":return o(Qe,{appId:"terminal"},o(ad,null));case"Browser":return o("div",{style:r},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:r},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(s=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},s)));case"Settings":return o("div",{style:r},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(s=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},s)));case"Word Processor":return o(qt,null);case"IDE":return o(Kt,null);case"Trading":return o(Qt,null);case"Project Board":return o(Oi,{boardId:t||"default",onTitleChange:n||void 0});default:return o("div",{style:r},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function dd(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=Rt(),d=l.activeMenuBar,u=l.dockSignals,h=oe(l);h.current=l;let[m,c]=G([]),[p,f]=G([]),[y,b]=G(!1),[g,x]=G(!1),[v,T]=G(null),[D,C]=G({x:0,y:0}),[$,L]=G(null),I=S(()=>{b(ne=>!ne)},[]),P=S(ne=>{f(de=>de.filter(ge=>ge.id!==ne))},[]);ae(()=>{if(p.length===0)return;let ne=p[0],de=Date.now()-ne.timestamp,ge=Math.max(0,rd-de),xe=setTimeout(()=>{f(ue=>ue.filter(Z=>Z.id!==ne.id))},ge);return()=>clearTimeout(xe)},[p]);let B=oe(t);B.current=t;let E=oe(r);E.current=r;let F=oe({});for(let ne of m)if(!F.current[ne.id]){let de=ne.id;F.current[de]=ge=>{c(xe=>xe.map(ue=>ue.id===de?{...ue,title:ge}:ue))}}let A=S(ne=>{let ge=B.current.find(xe=>xe.id===ne);ge&&(c(xe=>{let Z=xe.filter(we=>we.appId===ne).length+1,ie=Z===1?ge.label:`${ge.label} (${Z})`,ye=Yi(ne),be=xe.length>0?Math.max(...xe.map(we=>we.zIndex))+1:1,Se={id:ye,appId:ge.id,title:ie,icon:ge.icon,x:60+xe.length*30,y:40+xe.length*30,width:600,height:400,zIndex:be,focused:!0,windowState:"normal"};return[...xe.map(we=>({...we,focused:!1})),Se]}),ne==="files"&&h.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:()=>{}}]}]}),ne==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ne))},[]),k=S(ne=>{c(de=>{if(!de.find(ue=>ue.id===ne))return de;let xe=Math.max(...de.map(ue=>ue.zIndex))+1;return de.map(ue=>ue.id===ne?{...ue,focused:!0,zIndex:xe,windowState:ue.windowState==="minimized"?"normal":ue.windowState}:{...ue,focused:!1})})},[]),w=S(ne=>{c(de=>{let ge=de.filter(ie=>ie.appId===ne);if(ge.length===0)return de;let ue=[...ge].sort((ie,ye)=>ye.zIndex-ie.zIndex)[0],Z=Math.max(...de.map(ie=>ie.zIndex))+1;return de.map(ie=>ie.id===ue.id?{...ie,focused:!0,zIndex:Z,windowState:ie.windowState==="minimized"?"normal":ie.windowState}:{...ie,focused:!1})}),c(de=>{if(de.filter(xe=>xe.appId===ne).length===0){let ue=B.current.find(be=>be.id===ne);if(!ue)return de;let Z=Yi(ne),ie=de.length>0?Math.max(...de.map(be=>be.zIndex))+1:1,ye={id:Z,appId:ue.id,title:ue.label,icon:ue.icon,x:60+de.length*30,y:40+de.length*30,width:600,height:400,zIndex:ie,focused:!0,windowState:"normal"};return ne==="files"&&h.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:()=>{}}]}]}),ne==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ne),[...de.map(be=>({...be,focused:!1})),ye]}return de})},[]),R=t.map(ne=>{let de=m.some(ue=>ue.appId===ne.id),ge=u.get(ne.id),xe={id:ne.id,icon:ne.icon,label:ge?.tooltip||ne.label,active:de};return ge&&(ge.badge!=null&&(xe.badge=ge.badge>0?ge.badge:void 0),ge.progress!=null&&(xe.progress=ge.progress>0?ge.progress:void 0),ge.urgent&&(xe.urgent=!0)),xe}),M=m.find(ne=>ne.focused),N=M?M.title:void 0,z=S(()=>{x(!0)},[]),W=S(()=>{x(!1)},[]),_=S((ne,de)=>{T(ne),C(de)},[]),H=S(()=>{T(null)},[]),U=S(()=>{},[]),q=S(()=>{i&&i()},[i]),te=[];n&&(te.push({label:n.name,icon:void 0,onClick:U,divider:!1}),te.push({label:"",icon:void 0,onClick:U,divider:!0})),te.push({label:"Lock",icon:void 0,onClick:z,divider:!1}),te.push({label:"Logout",icon:void 0,onClick:q,divider:!1});let J=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]),V={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"},O={width:"100%",height:"100%",position:"relative"},Y=o(Bn,{activeAppName:N,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:te.length>0?te:void 0,height:od}),K=o(Fn,{items:R,orientation:"vertical",position:"left",iconSize:36,onItemClick:w,onItemContextMenu:_}),Q=o(sd,{toasts:p,onDismiss:P}),se=m.filter(ne=>ne.windowState!=="minimized").map(ne=>o(Dt,{key:ne.id,id:ne.id,title:ne.title,icon:ne.icon,defaultPosition:{x:ne.x,y:ne.y},defaultSize:{width:ne.width,height:ne.height},zIndex:ne.zIndex,focused:ne.focused,windowState:ne.windowState,onClose:()=>{c(de=>de.filter(ge=>ge.id!==ne.id))},onFocus:()=>{c(de=>{let ge=Math.max(...de.map(xe=>xe.zIndex))+1;return de.map(xe=>xe.id===ne.id?{...xe,focused:!0,zIndex:ge}:{...xe,focused:!1})})},onMinimize:()=>{c(de=>de.map(ge=>ge.id===ne.id?{...ge,windowState:"minimized"}:ge))},onMaximize:()=>{c(de=>de.map(ge=>ge.id===ne.id?{...ge,windowState:ge.windowState==="maximized"?"normal":"maximized"}:ge))}},cd(t.find(de=>de.id===ne.appId)?.label||ne.title,ne.id,F.current[ne.id]))),ee=[];a&&ee.push(a),ee.push(...se),ee.push(Q);let le=o(Nn,{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:O},...ee)),ce=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(ne=>o("button",{key:ne.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:de=>{de.stopPropagation(),b(!1),w(ne.id)}},o("span",{style:{fontSize:"32px",display:"block"}},ne.icon),o("span",null,ne.label)))):null,pe=g?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:W},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,re=(()=>{if(!v)return null;let ne=t.find(ie=>ie.id===v),de=m.filter(ie=>ie.appId===v),ge={padding:"6px 14px",cursor:"pointer"},xe={onMouseEnter:ie=>{ie.currentTarget.style.backgroundColor="#444"},onMouseLeave:ie=>{ie.currentTarget.style.backgroundColor="transparent"}},ue={borderBottom:"1px solid #444",margin:"4px 0"},Z=[];return Z.push(o("div",{key:"new",style:ge,...xe,onClick:()=>{A(v),T(null)},role:"menuitem"},"\u25CF New")),de.length>0&&(Z.push(o("div",{key:"sep-1",style:ue})),de.forEach((ie,ye)=>{let be=ie.title;Z.push(o("div",{key:`inst-${ie.id}`,style:ge,...xe,onClick:()=>{k(ie.id),T(null)},role:"menuitem"},be))})),Z.push(o("div",{key:"sep-2",style:ue})),Z.push(o("div",{key:"about",style:ge,...xe,onClick:()=>{L(v),T(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:H},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:ie=>ie.stopPropagation()},...Z))})(),he=$?t.find(ne=>ne.id===$):null,me=he?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:ne=>ne.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},he.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:J,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},Y),o("div",{style:V},o("div",{className:"unity-desktop__dock",style:j},K),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden",minHeight:"0"}},le,ce)),re,me,pe)}function Vi(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(Dn,{onWindowOpen:r},o(Pt,null,o(Tt,null,o(dd,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function Ui(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:h,onDeactivate:m,children:c}=e,p=Rt(),f=X(()=>p.windows.find($=>$.id===t),[p.windows,t]);ae(()=>(u?p.setMenuBar(t,u):p.clearMenuBar(t),()=>{p.clearMenuBar(t)}),[u,t,p]);let y=oe(!1),b=f?f.focused:!1;ae(()=>{let $=y.current;y.current=b,b&&!$?h&&h():!b&&$&&m&&m()},[b,h,m]);let g=S(()=>{p.closeWindow(t),d&&d()},[p,t,d]),x=S(()=>{p.focusWindow(t)},[p,t]),v=S($=>{p.moveWindow(t,$)},[p,t]),T=S($=>{p.resizeWindow(t,$)},[p,t]),D=S(()=>{p.minimizeWindow(t)},[p,t]),C=S(()=>{f&&f.windowState==="maximized"?p.restoreWindow(t):p.maximizeWindow(t)},[p,t,f]);return f?o(Qe,{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:g,onFocus:x,onMove:v,onResize:T,onMinimize:D,onMaximize:C,children:c})):(p.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var ji={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},Gi={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 Xi(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:h,active:m=!1}=e,c=X(()=>{let p=ji[i]??ji.md,f=Gi[r]??Gi.secondary,y={padding:p.padding,fontSize:p.fontSize,borderRadius:p.borderRadius,border:`1px solid ${f.border}`,backgroundColor:m?"#3b82f6":f.bg,color:m?"white":f.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),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":h,"aria-pressed":m?"true":void 0},t)}var ud=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],wt=Math.PI/180;function pd(e,t,n,r,i,s,a,l,d,u){let h=Math.cos(r*wt),m=Math.sin(r*wt),c=Math.cos(i*wt),p=Math.sin(i*wt),f=Math.cos(s*wt),y=Math.sin(s*wt),b=e*f-t*y,g=e*y+t*f,x=b*c-g*p,v=b*p+g*c,T=n,D=x,C=v*h-T*m,$=v*m+T*h,L=1+a*.001*$,I=l+D*u*L,P=d-C*u*L;return{sx:I,sy:P,depth:$}}function qi(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 Zi(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:h=2,colorScale:m=ud,gridColor:c="#94a3b8",title:p}=e,f=X(()=>{let A=0,k=0,w=0;for(let R=0;R<t.length;R++){let M=t[R],N=M.data.length;N>A&&(A=N);for(let z=0;z<N;z++){let W=M.data[z].length;W>k&&(k=W);for(let _=0;_<W;_++){let H=Math.abs(M.data[z][_]??0);H>w&&(w=H)}}}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)*h+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,h,n,r]),b=n/2,g=r/2,x=S((A,k,w)=>pd(A,k,w,s,a,l,i,b,g,y),[s,a,l,i,b,g,y]),v=S(()=>{if(!u)return[];let A=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,R=f.maxRows/2,M=x(-w,-R,0),N=x(w,-R,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 z=x(-w,R,0);A.push(o("line",{key:"axis-y",x1:String(M.sx),y1:String(M.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 W=f.maxHeight+(t.length-1)*h,_=x(-w,-R,W);return A.push(o("line",{key:"axis-z",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-z-label",x:String(_.sx-4),y:String(_.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),A},[u,f,t.length,h,x]),T=S(()=>{let A=[],k=f.maxCols/2,w=f.maxRows/2,R=[];for(let M=0;M<t.length;M++){let N=t[M],z=N.color??m[M%m.length],W=N.opacity??.7,_=M*h,H=N.data.length;for(let U=0;U<H-1;U++){let q=N.data[U],te=N.data[U+1],J=Math.min(q.length,te.length);for(let V=0;V<J-1;V++){let j=V-k,O=V+1-k,Y=U-w,K=U+1-w,Q=(q[V]??0)+_,se=(q[V+1]??0)+_,ee=(te[V]??0)+_,le=(te[V+1]??0)+_,ce=x(j,Y,Q),pe=x(O,Y,se),re=x(j,K,ee),he=x(O,K,le),me=(ce.depth+pe.depth+re.depth+he.depth)/4,ne=`${ce.sx},${ce.sy} ${pe.sx},${pe.sy} ${he.sx},${he.sy} ${re.sx},${re.sy}`;R.push({points:ne,fill:qi(z,W),stroke:Ki(z,.7),strokeWidth:"0.5",depth:me,key:`quad-${M}-${U}-${V}`})}}if(H===1||H>0&&N.data[0].length===1)for(let U=0;U<H;U++){let q=N.data[U];for(let te=0;te<q.length;te++){let J=te-k,V=U-w,j=(q[te]??0)+_,O=x(J,V,j),Y=3,K=`${O.sx},${O.sy-Y} ${O.sx+Y},${O.sy} ${O.sx},${O.sy+Y} ${O.sx-Y},${O.sy}`;R.push({points:K,fill:qi(z,W),stroke:Ki(z,.7),strokeWidth:"0.5",depth:O.depth,key:`point-${M}-${U}-${te}`})}}}R.sort((M,N)=>M.depth-N.depth);for(let M=0;M<R.length;M++){let N=R[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,h,m,x]),D=S(()=>{let A=[],k=f.maxCols/2,w=f.maxRows/2;for(let R=0;R<=f.maxRows;R++){let M=R-w,N=x(-k,M,0),z=x(k,M,0);A.push(o("line",{key:`base-h-${R}`,x1:String(N.sx),y1:String(N.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let R=0;R<=f.maxCols;R++){let M=R-k,N=x(M,-w,0),z=x(M,w,0);A.push(o("line",{key:`base-v-${R}`,x1:String(N.sx),y1:String(N.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return A},[f,c,x]),C=S(()=>{if(!d)return[];let A=[],k=f.maxCols/2,w=f.maxRows/2;for(let R=0;R<t.length;R++){let M=t[R],N=R*h,z=0,W=0;for(let q=0;q<M.data.length;q++){let te=M.data[q];for(let J=0;J<te.length;J++)z+=te[J]??0,W++}let _=W>0?z/W:0,H=x(k+1,0,_+N),U=M.color??m[R%m.length];A.push(o("text",{key:`layer-label-${R}`,x:String(H.sx+8),y:String(H.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:U},M.label))}return A},[d,t,f,h,m,x]),L=S(()=>p?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n])(),I=D(),P=v(),B=T(),E=C(),F=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...F,...I,...P,...B,...E)}function fd(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 gd(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 Ji(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:h="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:p="#ffffff"}=e,f=X(()=>fd(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),b=l!=null&&l.length>1,g=n!=null&&n.length>0,x=y&&s>=0?m:c,v=20,T=g?u*.38:u*.45,D=Math.min(d*.15,48),C=D*.55,$=T+D*.4+8,L=g?$+22:T+D*.4+22,I=b?Math.min(u*.22,36):0,P=u-v-I,B=d-v*2,E=S(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:p,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,p]),F=S(()=>{let H=[],U=r+f+i;return H.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:h,"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)),H},[d,T,D,C,f,r,i,h]),A=S(()=>g?[o("text",{key:"label",x:String(d/2),y:String($),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[g,d,$,n]),k=S(()=>{if(!y)return[];let H=[],U=s,q=U>=0,te=8,J=gd(U),V=(q?"+":"-")+J+(a?" "+a:""),j=d/2-40,O=L;if(q){let Y=`${j},${O} ${j-te/2},${O+te} ${j+te/2},${O+te}`;H.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}else{let Y=`${j},${O+te} ${j-te/2},${O} ${j+te/2},${O}`;H.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}return H.push(o("text",{key:"trend-text",x:String(j+te+4),y:String(O+te*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${V}`},V)),H},[y,s,a,x,d,L]),w=S(()=>{if(!b)return[];let H=[],U=l,q=[];for(let Q of U)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&q.push(Q);if(q.length<2)return[];let te=1/0,J=-1/0;for(let Q of q)Q<te&&(te=Q),Q>J&&(J=Q);te===J&&(te-=1,J+=1);let V=J-te,j=B/(q.length-1),O="";for(let Q=0;Q<q.length;Q++){let se=v+Q*j,ee=P+I-(q[Q]-te)/V*I;Q===0?O+=`M ${se} ${ee}`:O+=` L ${se} ${ee}`}let Y=v+(q.length-1)*j,K=O+` L ${Y} ${P+I} L ${v} ${P+I} Z`;return H.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"})))),H.push(o("path",{key:"spark-fill",d:K,fill:"url(#sparkGrad)"})),H.push(o("path",{key:"spark-line",d:O,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),H},[b,l,B,P,I,v]),R=E(),M=F(),N=A(),z=k(),W=w(),_=`${r}${f}${i}${g?`, ${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":_,style:{fontFamily:"sans-serif"}},...R,...W,...M,...N,...z)}var nn=Math.PI/180;function md(e,t,n,r,i,s,a,l){let d=Math.cos(r*nn),u=Math.sin(r*nn),h=Math.cos(i*nn),m=Math.sin(i*nn),c=e*h+n*m,p=-e*m+n*h,f=t*d-p*u,y=t*u+p*d;return{sx:s+c*l,sy:a-f*l,depth:y}}function kt(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 on(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 ot(e,t,n){let{x:r,y:i,z:s}=kt(e),a=Math.cos(n),l=Math.sin(n),d,u,h;return t==="x"?(d=r,u=i*a-s*l,h=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,h=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,h=s),on(d,u,h)}function Gn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return ot(e,"x",Math.PI);case"Y":return ot(e,"y",Math.PI);case"Z":return ot(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=kt(e);return on(s,-i,r)}case"S":return ot(e,"z",Math.PI/2);case"T":return ot(e,"z",Math.PI/4);case"Rx":return ot(e,"x",n);case"Ry":return ot(e,"y",n);case"Rz":return ot(e,"z",n)}}function Qi(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:h=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:p=!0,trailMaxPoints:f=200,trailColor:y="#ef4444",wireframeColor:b="#cbd5e1",vectorColor:g="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:T,onStateChange:D}=e,[C,$]=G(t??{theta:0,phi:0}),[L,I]=G(s),[P,B]=G(a),[E,F]=G(l),A=oe([]),k=oe(!1),w=oe(null),R=oe(null);ae(()=>{t&&$(t)},[t?.theta,t?.phi]);let M=oe(0);ae(()=>{if(!n||n.length===0)return;M.current=0;let j=0,O=()=>{M.current>=n.length||($(Y=>{let K=Gn(Y,n[M.current]);return M.current++,D&&D(K),K}),j=requestAnimationFrame(O))};return j=requestAnimationFrame(O),()=>cancelAnimationFrame(j)},[n]),ae(()=>{let j=kt(C);A.current.push(j),A.current.length>f&&A.current.splice(0,A.current.length-f)},[C.theta,C.phi]);let N=v*E,z=r/2,W=i/2,_=S((j,O,Y)=>md(j,O,Y,P,L,z,W,N),[P,L,z,W,N]),H=S(j=>{if(!d)return;let O=j;k.current=!0,w.current={mx:O.clientX,my:O.clientY,rx:P,ry:L}},[d,P,L]),U=S(j=>{if(!k.current||!w.current)return;let O=j,Y=w.current;I(Y.ry+(O.clientX-Y.mx)*.5),B(Y.rx-(O.clientY-Y.my)*.5)},[]),q=S(()=>{k.current=!1},[]),te=S(j=>{if(!u)return;let O=j;O.preventDefault(),F(Y=>Math.max(.5,Math.min(3,Y*(O.deltaY>0?.95:1.05))))},[u]),J=[];if(x&&J.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),T&&J.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 O=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,ee=_(Math.cos(se),Math.sin(se),0);O.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}J.push(o("path",{key:"eq",d:O.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.5"}));let Y=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,ee=_(Math.cos(se),0,Math.sin(se));Y.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}J.push(o("path",{key:"xz",d:Y.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.4"}));let K=[];for(let Q=0;Q<=60;Q++){let se=Q/60*2*Math.PI,ee=_(0,Math.cos(se),Math.sin(se));K.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}J.push(o("path",{key:"yz",d:K.join(" "),fill:"none",stroke:b,"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 O=_(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),Y=_(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),K=_(0,0,0);J.push(o("line",{key:`axis-${j.id}`,x1:String(Y.sx),y1:String(Y.sy),x2:String(O.sx),y2:String(O.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 O of j){let Y=_(O.pos[0],O.pos[1],O.pos[2]);J.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(p&&A.current.length>1){let j=A.current,O=[];for(let Y=0;Y<j.length;Y++){let K=j[Y],Q=_(K.x,K.y,K.z);O.push(`${Y===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}J.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(h){let j=kt(C),O=_(0,0,0),Y=_(j.x,j.y,j.z);J.push(o("line",{key:"vec-line",x1:String(O.sx),y1:String(O.sy),x2:String(Y.sx),y2:String(Y.sy),stroke:g,"stroke-width":"2.5","stroke-linecap":"round"})),J.push(o("circle",{key:"vec-point",cx:String(Y.sx),cy:String(Y.sy),r:"5",fill:g,stroke:"#fff","stroke-width":"1.5"}));let K=(C.theta*180/Math.PI).toFixed(0),Q=(C.phi*180/Math.PI).toFixed(0);J.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`\u03B8=${K}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:R,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?H:void 0,onMouseMove:d?U:void 0,onMouseUp:d?q:void 0,onMouseLeave:d?q:void 0,onWheel:u?te:void 0},...J)}function hd(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 Xn(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 qn(e){let t=hd(e);if(t.length===0)return null;let n=Xn(t,25),r=Xn(t,50),i=Xn(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let p of t)if(p>=a){d=p;break}let u=t[t.length-1];for(let p=t.length-1;p>=0;p--)if(t[p]<=l){u=t[p];break}let h=0;for(let p of t)h+=p;let m=h/t.length,c=[];for(let p of t)(p<a||p>l)&&c.push(p);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:m,outliers:c,min:t[0],max:t[t.length-1]}}function bd(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 es(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:h,padding:m=60}=e,c=i==="vertical",p=n-m*2,f=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],b=X(()=>{let w=[];for(let R of t)w.push(qn(R.values));return w},[t]),g=X(()=>{let w=1/0,R=-1/0;for(let z of b){if(z===null)continue;let W=s&&z.outliers.length>0?Math.min(z.whiskerLow,z.outliers[0]):z.whiskerLow,_=s&&z.outliers.length>0?Math.max(z.whiskerHigh,z.outliers[z.outliers.length-1]):z.whiskerHigh;W<w&&(w=W),_>R&&(R=_)}isFinite(w)||(w=0,R=1);let M=R-w,N=M>0?M*.05:.5;return{min:w-N,max:R+N}},[b,s]),x=c?f:p,v=c?p:f,T=t.length>0?t.length:1,D=v/T,C=D*Math.min(Math.max(d,.1),.95),$=S(w=>{let R=g.max-g.min;return R===0?x/2:(w-g.min)/R*x},[g,x]),L=S(()=>{if(!u)return[];let w=[],R=g.max-g.min,M=bd(R),N=Math.ceil(g.min/M)*M;for(let z=N;z<=g.max;z+=M){let W=$(z),_=String(Math.round(z*1e3)/1e3);if(c){let H=m+f-W;w.push(o("line",{key:`grid-${z}`,x1:String(m),y1:String(H),x2:String(m+p),y2:String(H),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(m-6),y:String(H+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}else{let H=m+W;w.push(o("line",{key:`grid-${z}`,x1:String(H),y1:String(m),x2:String(H),y2:String(m+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(H),y:String(m+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return w},[u,g,$,c,m,p,f]),I=S(()=>{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+p),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),w},[m,p,f,c]),P=S(()=>{let w=[];for(let R=0;R<t.length;R++){let M=b[R];if(M===null)continue;let N=t[R],z=N.color??y[R%y.length],W=D*R+D/2,_=C/2;if(c){let H=m+f-$(M.q1),U=m+f-$(M.q3),q=m+f-$(M.median),te=m+f-$(M.whiskerLow),J=m+f-$(M.whiskerHigh),V=m+W;w.push(o("line",{key:`wl-${R}`,x1:String(V),y1:String(H),x2:String(V),y2:String(te),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${R}`,x1:String(V-_*.4),y1:String(te),x2:String(V+_*.4),y2:String(te),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${R}`,x1:String(V),y1:String(U),x2:String(V),y2:String(J),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${R}`,x1:String(V-_*.4),y1:String(J),x2:String(V+_*.4),y2:String(J),stroke:l,"stroke-width":"1.5"}));let j=Math.min(H,U),O=Math.abs(H-U);if(w.push(o("rect",{key:`box-${R}`,x:String(V-_),y:String(j),width:String(C),height:String(Math.max(O,1)),fill:z,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-${R}`,x1:String(V-_),y1:String(q),x2:String(V+_),y2:String(q),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+f-$(M.mean);w.push(o("circle",{key:`mean-${R}`,cx:String(V),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 K=m+f-$(M.outliers[Y]);w.push(o("circle",{key:`out-${R}-${Y}`,cx:String(V),cy:String(K),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[Y]}`}))}w.push(o("text",{key:`cat-${R}`,x:String(V),y:String(m+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}else{let H=m+$(M.q1),U=m+$(M.q3),q=m+$(M.median),te=m+$(M.whiskerLow),J=m+$(M.whiskerHigh),V=m+W;w.push(o("line",{key:`wl-${R}`,x1:String(H),y1:String(V),x2:String(te),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${R}`,x1:String(te),y1:String(V-_*.4),x2:String(te),y2:String(V+_*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${R}`,x1:String(U),y1:String(V),x2:String(J),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${R}`,x1:String(J),y1:String(V-_*.4),x2:String(J),y2:String(V+_*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(H,U),O=Math.abs(U-H);if(w.push(o("rect",{key:`box-${R}`,x:String(j),y:String(V-_),width:String(Math.max(O,1)),height:String(C),fill:z,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-${R}`,x1:String(q),y1:String(V-_),x2:String(q),y2:String(V+_),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+$(M.mean);w.push(o("circle",{key:`mean-${R}`,cx:String(Y),cy:String(V),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 K=m+$(M.outliers[Y]);w.push(o("circle",{key:`out-${R}-${Y}`,cx:String(K),cy:String(V),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[Y]}`}))}w.push(o("text",{key:`cat-${R}`,x:String(m-6),y:String(V+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}}return w},[t,b,$,c,m,p,f,D,C,l,s,a,y]),B=S(()=>h?[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"},h)]:[],[h,n,m]),E=L(),F=I(),A=P(),k=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Box plot",style:{fontFamily:"sans-serif"}},...k,...E,...F,...A)}function ts(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 xd(e,t,n){return e<t?t:e>n?n:e}function Kn(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function ns(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:h=4,defaultColor:m="#3b82f6",opacity:c=.7,title:p,padding:f=60}=e,y=X(()=>{let A=[];for(let k=0;k<t.length;k++){let w=t[k];Kn(w.x)&&Kn(w.y)&&Kn(w.r)&&A.push(w)}return A},[t]),b=n-f*2,g=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,R=-1/0,M=1/0,N=-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>R&&(R=z.y),z.r<M&&(M=z.r),z.r>N&&(N=z.r);return A===k&&(A-=1,k+=1),w===R&&(w-=1,R+=1),M===N&&(M=0,N=N>0?N:1),{xMin:A,xMax:k,yMin:w,yMax:R,rMin:M,rMax:N}},[y]),v=S(A=>{let k=x.xMax-x.xMin;return f+(A-x.xMin)/k*b},[x,f,b]),T=S(A=>{let k=x.yMax-x.yMin;return f+g-(A-x.yMin)/k*g},[x,f,g]),D=S(A=>{let k=x.rMax-x.rMin;if(k===0)return(h+u)/2;let w=(A-x.rMin)/k;return h+w*(u-h)},[x,h,u]),C=S(()=>{if(!a)return[];let A=[],k=ts(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let N=w;N<=x.xMax;N+=k){let z=v(N);A.push(o("line",{key:`grid-x-${N}`,x1:String(z),y1:String(f),x2:String(z),y2:String(f+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-xlabel-${N}`,x:String(z),y:String(f+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}let R=ts(x.yMax-x.yMin),M=Math.ceil(x.yMin/R)*R;for(let N=M;N<=x.yMax;N+=R){let z=T(N);A.push(o("line",{key:`grid-y-${N}`,x1:String(f),y1:String(z),x2:String(f+b),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-ylabel-${N}`,x:String(f-6),y:String(z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}return A},[a,x,v,T,f,b,g]),$=S(()=>{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+g),stroke:"#374151","stroke-width":"1.5"})),A.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+g),x2:String(f+b),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),i&&A.push(o("text",{key:"x-label",x:String(f+b/2),y:String(f+g+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+g/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${f-40}, ${f+g/2})`},s)),A},[l,f,b,g,i,s]),L=S(()=>{let A=[];for(let k=0;k<y.length;k++){let w=y[k],R=v(w.x),M=T(w.y),N=xd(D(w.r),h,u),z=w.color??m;A.push(o("circle",{key:`bubble-${k}`,cx:String(R),cy:String(M),r:String(N),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(R),y:String(M-N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return A},[y,v,T,D,m,c,d,h,u]),I=S(()=>p?[o("text",{key:"title",x:String(n/2),y:String(f/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,f]),P=C(),B=$(),E=L(),F=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Bubble chart",style:{fontFamily:"sans-serif"}},...F,...P,...B,...E)}var yd=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Sd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function vd(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 os(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 rs(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 wd(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 kd(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=rs(t[i]),l=rs(t[i+1]);return wd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var Cd=["#9be9a8","#40c463","#30a14e","#216e39"];function is(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=Cd,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:m,startDate:c,endDate:p,maxVal:f}=X(()=>{let E=new Map,F=0,A=null,k=null;for(let M of t){let N=vd(M.date);if(isNaN(N.getTime()))continue;let z=os(N);E.set(z,(E.get(z)??0)+M.value);let W=E.get(z);W>F&&(F=W),(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 R=new Date(k);return R.setDate(R.getDate()+(6-R.getDay())),{dateMap:E,startDate:w,endDate:R,maxVal:F>0?F:1}},[t]),y=d?30:0,b=l?16:0,g=h?28:0,x=y+10,v=g+b+4,T=S(()=>{let E=[],F=new Date(c),A=0;for(;F<=p;){let k=F.getDay();k===0&&F>c&&A++;let w=os(F),R=m.get(w),M=R!==void 0&&R>0?kd(R/f,i):u,N=x+A*(s+a),z=v+k*(s+a);E.push(o("rect",{key:`day-${w}`,x:String(N),y:String(z),width:String(s),height:String(s),rx:"2",ry:"2",fill:M,"aria-label":`${w}: ${R??0}`})),F.setDate(F.getDate()+1)}return E},[c,p,m,f,i,u,s,a,x,v]),D=S(()=>{if(!l)return[];let E=[],F=new Date(c),A=0,k=-1;for(;F<=p;){let w=F.getDay();w===0&&F>c&&A++;let R=F.getMonth();if(R!==k&&w===0){k=R;let M=x+A*(s+a);E.push(o("text",{key:`month-${A}`,x:String(M),y:String(g+b-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},yd[R]))}F.setDate(F.getDate()+1)}return E},[l,c,p,s,a,x,g,b]),C=S(()=>{if(!d)return[];let E=[],F=[1,3,5];for(let A of F){let k=v+A*(s+a)+s/2;E.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"},Sd[A]))}return E},[d,s,a,v,y]),$=S(()=>h?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let L=$(),I=D(),P=C(),B=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":h??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...I,...P,...B)}var Md=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ke(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Ed(e,t,n,r,i,s){let a=Ke(e,t,n,i),l=Ke(e,t,n,s),d=Ke(e,t,r,i),u=Ke(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 Id(e,t,n,r,i,s,a){let l=Ke(e,t,n,r),d=Ke(e,t,n,i),u=Ke(e,t,n,s),h=Ke(e,t,n,a),m=i-r,c=a-s,p=m>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${p} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${f} 1 ${h.x} ${h.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function Rd(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let p=0;for(let f=0;f<i;f++){let y=e[c]?.[f]??0;p+=Math.max(0,y)}s.push(p),a+=p}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),p=[],f=0;for(let y=0;y<i;y++)p.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:f,endAngle:f+c,value:0}),f+=c+r;return{groups:p,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let p=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+p,value:s[c]}),u+=p+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let p=c;p<i;p++){let f=Math.max(0,e[c]?.[p]??0),y=c===p?0:Math.max(0,e[p]?.[c]??0);if(f===0&&y===0)continue;let b=f+y,g=s[c]>0?f/a*l:0,x=h[c],v=x+g;h[c]=v;let T=s[p]>0?f/a*l:0,D=h[p],C=D+T;if(h[p]=C,c===p){f>0&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:D,targetEndAngle:C,value:f,color:d[c].color});continue}let $=s[p]>0?y/a*l:0,I=h[p]+$;h[p]=I;let P=s[c]>0?y/a*l:0,E=h[c]+P;h[c]=E,(f>0||y>0)&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:D,targetEndAngle:Math.max(C,D+.001),value:b,color:d[c].color})}return{groups:d,chords:m}}function ss(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=Md,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.9,title:m}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,p=i/2,f=Math.min(r,i)/2-40,y=f*Math.max(.5,Math.min(.99,h)),b=f+16,g=X(()=>Rd(t,n,s,a),[t,n,s,a]),x=S(()=>{let L=[];for(let I=0;I<g.groups.length;I++){let P=g.groups[I];if(P.endAngle-P.startAngle<.001)continue;let E=Ed(c,p,f,y,P.startAngle,P.endAngle);if(L.push(o("path",{key:`arc-${I}`,d:E,fill:P.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${P.label}: ${P.value}`})),l){let F=(P.startAngle+P.endAngle)/2,A=Ke(c,p,b,F),R=((F-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,M=R?"start":"end",N=F*180/Math.PI-90;R||(N+=180);let z=d?`${P.label} (${P.value})`:P.label;L.push(o("text",{key:`label-${I}`,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"},z))}}return L},[g,c,p,f,y,b,l,d]),v=S(()=>{let L=[];for(let I=0;I<g.chords.length;I++){let P=g.chords[I],B=Id(c,p,y,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);L.push(o("path",{key:`ribbon-${I}`,d:B,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[g,c,p,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(),$=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"}},...$,...D,...C)}var Pd=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function $d(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],h=[];for(let m=0;m<u.length;m++)h.push(n+r.length+m);t.push({id:d,node:s,depth:a,parentId:l,childIndices:h});for(let m=0;m<u.length;m++)r.push([u[m],a+1,d])}return{flatNodes:t,maxDepth:i}}function Td(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 zd(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=$d(e);if(d.length===0)return[];let h=Td(d),m=t-s*2,c=n-s*2,p=a==="horizontal",f=u+1,y=p?f>1?(m-r)/u:0:f>1?(c-i)/u:0,b=new Array(d.length),g=h[0],x=p?c:m,v=g>0?x/g:x,T=new Array(d.length);T[0]=[0,g];let D=[0],C=0;for(;C<D.length;){let $=D[C];C++;let L=d[$],[I,P]=T[$],B=(I+P)/2,E=s+L.depth*y,F=s+(B-.5)*v,A=p?E:F,k=p?F:E,w=L.node.color??l[L.depth%l.length];b[$]={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:h[$]};let R=I;for(let M of L.childIndices)if(M<d.length){let N=h[M],z=R+N;T[M]=[R,z],R=z,D.push(M)}}return b}function as(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:h=Pd,title:m,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let p=i==="horizontal",f=X(()=>zd(t,n,r,s,a,c,i,h),[t,n,r,s,a,c,i,h]),y=X(()=>{let C=new Map;for(let $=0;$<f.length;$++){let L=f[$];C.set(L.id,L)}return C},[f]),b=S(()=>{if(!d)return[];let C=[];for(let $=0;$<f.length;$++){let L=f[$];if(L.parentId===null)continue;let I=y.get(L.parentId);if(!I)continue;let P,B,E,F;p?(P=I.x+s,B=I.y+a/2,E=L.x,F=L.y+a/2):(P=I.x+s/2,B=I.y+a,E=L.x+s/2,F=L.y);let A=(P+E)/2,k=(B+F)/2,w;p?w=`M ${P} ${B} C ${A} ${B}, ${A} ${F}, ${E} ${F}`:w=`M ${P} ${B} C ${P} ${k}, ${E} ${k}, ${E} ${F}`,C.push(o("path",{key:`conn-${$}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[f,y,p,s,a,d,u]),g=S(()=>{let C=[];for(let $=0;$<f.length;$++){let L=f[$];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},[f,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=b(),T=g(),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 ls=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Dd(e){return ls[e%ls.length]}function cs(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],h=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??Dd(d),x:u.x??r+s*Math.cos(h),y:u.y??i+s*Math.sin(h),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function ds(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let h=Math.sqrt(u),m=l/h,c=d/h,p=n-h;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*p,a.y+=c*p):a.fixed?(i.x-=m*p,i.y-=c*p):(i.x-=m*p*.5,i.y-=c*p*.5,a.x+=m*p*.5,a.y+=c*p*.5);let f=i.vx-a.vx,y=i.vy-a.vy,b=f*m+y*c;b<=0||(i.fixed?(a.vx+=b*m,a.vy+=b*c):a.fixed?(i.vx-=b*m,i.vy-=b*c):(i.vx-=b*m,i.vy-=b*c,a.vx+=b*m,a.vy+=b*c))}}}function Ad(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let h=new Map;for(let x=0;x<u;x++)h.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,$=v.y-D.y,L=C*C+$*$;L<1&&(L=1);let I=Math.sqrt(L),P=i/L,B=C/I*P,E=$/I*P;m[x]+=B,c[x]+=E,m[T]-=B,c[T]-=E}}for(let x=0;x<t.length;x++){let v=t[x],T=h.get(v.source),D=h.get(v.target);if(T===void 0||D===void 0)continue;let C=e[T],$=e[D],L=$.x-C.x,I=$.y-C.y,P=Math.sqrt(L*L+I*I);if(P<.1)continue;let B=v.weight??1,E=P-l,F=s*E*B,A=L/P*F,k=I/P*F;m[T]+=A,c[T]+=k,m[D]-=A,c[D]-=k}let p=n/2,f=r/2,y=.001;for(let x=0;x<u;x++){let v=e[x];m[x]+=(p-v.x)*y,c[x]+=(f-v.y)*y}let b=20,g=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){g.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),$=10;C>$&&(T=T/C*$,D=D/C*$);let L=v.x+T,I=v.y+D;L=Math.max(b,Math.min(n-b,L)),I=Math.max(b,Math.min(r-b,I)),g.push({...v,x:L,y:I,vx:T,vy:D})}return ds(g,d),g}function Ld(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 us(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:h=300,attractionForce:m=.01,damping:c=.9,edgeLength:p=100,edgeColor:f="#94a3b8",edgeWidth:y=1.5,title:b,customForce:g,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":b??"Empty force-directed graph"},b?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"},b):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=oe(cs(t,r,i)),[T,D]=G(0),C=oe(!0),$=oe(!1),L=oe(n);L.current=n;let I=oe(g);I.current=g;let P=oe(null),B=oe({repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l});B.current={repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l};let E=oe(new Map);ae(()=>{v.current=cs(t,r,i),$.current=!1,C.current=!0,E.current=new Map,D(se=>se+1)},[t.length]),ae(()=>{let se=0,ee=()=>{if(!C.current)return;let le=B.current,ce=I.current,pe;if(ce?(pe=ce(v.current,L.current,le.width,le.height,P.current),le.solidNodes&&ds(pe,le.nodeRadius)):pe=Ad(v.current,L.current,le.width,le.height,le.repulsionForce,le.attractionForce,le.damping,le.edgeLength,le.nodeRadius),v.current=pe,x)for(let re=0;re<x.length;re++){let he=x[re],me=pe.find(ge=>ge.id===he.nodeId);if(!me)continue;let ne=E.current.get(he.nodeId);ne||(ne=[],E.current.set(he.nodeId,ne)),ne.push({x:me.x,y:me.y});let de=he.maxPoints??200;ne.length>de&&ne.splice(0,ne.length-de)}if(!ce&&Ld(pe)<.01){$.current=!0,D(re=>re+1);return}D(re=>re+1),se=requestAnimationFrame(ee)};return se=requestAnimationFrame(ee),()=>{C.current=!1,cancelAnimationFrame(se)}},[]);let F=v.current,A=S(se=>{v.current=v.current.map(ee=>ee.id===se?{...ee,fixed:!ee.fixed,vx:0,vy:0}:ee),$.current&&($.current=!1,C.current=!0,D(ee=>ee+1))},[]),k=oe(null),w=oe(null),R=S(se=>{let ee=se,le=w.current;if(!le)return{x:ee.clientX,y:ee.clientY};let ce=le.getBoundingClientRect(),pe=r/ce.width,re=i/ce.height;return{x:(ee.clientX-ce.left)*pe,y:(ee.clientY-ce.top)*re}},[r,i]),M=oe(!1),N=S((se,ee)=>{ee.stopPropagation(),k.current=se;let le=v.current.find(ce=>ce.id===se);M.current=le?.fixed??!1,v.current=v.current.map(ce=>ce.id===se?{...ce,fixed:!0,vx:0,vy:0}:ce)},[]),z=S(se=>{let ee=R(se);if(P.current={x:ee.x,y:ee.y},!k.current)return;let le=k.current,ce=20;v.current=v.current.map(pe=>pe.id===le?{...pe,x:Math.max(ce,Math.min(r-ce,ee.x)),y:Math.max(ce,Math.min(i-ce,ee.y))}:pe),$.current&&($.current=!1,C.current=!0),D(pe=>pe+1)},[r,i,R]),W=S(()=>{let se=k.current;se&&(v.current=v.current.map(ee=>ee.id===se?{...ee,fixed:M.current}:ee)),k.current=null},[]),_=S(()=>{k.current=null,P.current=null},[]),H=X(()=>{let se=new Map;for(let ee=0;ee<F.length;ee++)se.set(F[ee].id,F[ee]);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:f})))]:[],[u,s,f]),q=S(()=>{let se=[];for(let ee=0;ee<n.length;ee++){let le=n[ee],ce=H.get(le.source),pe=H.get(le.target);if(!ce||!pe||le.weight!==void 0&&le.weight<=0)continue;let re=le.weight?Math.max(.5,Math.min(6,y*le.weight)):y,he={key:`edge-${ee}`,x1:String(ce.x),y1:String(ce.y),x2:String(pe.x),y2:String(pe.y),stroke:le.color??f,"stroke-width":String(re),"stroke-opacity":"0.6"};u&&(he["marker-end"]="url(#arrowhead)"),se.push(o("line",he))}return se},[T,f,y,u]),te=S(()=>{let se=[];for(let ee=0;ee<F.length;ee++){let le=F[ee];se.push(o("circle",{key:`node-${le.id}`,cx:String(le.x),cy:String(le.y),r:String(s),fill:le.color,stroke:le.fixed?"#0f172a":"#fff","stroke-width":le.fixed?"3":String(a),style:{cursor:k.current===le.id?"grabbing":"grab"},onMouseDown:ce=>N(le.id,ce),onDblClick:()=>A(le.id),role:"button",tabIndex:0,"aria-label":`Node: ${le.label}${le.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&se.push(o("text",{key:`label-${le.id}`,x:String(le.x),y:String(le.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},le.label))}return se},[T,s,d,A]),J=S(()=>b?[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"},b)]:[],[b,r]),V=S(()=>{if(!x||x.length===0)return[];let se=[];for(let ee=0;ee<x.length;ee++){let le=x[ee],ce=E.current.get(le.nodeId);if(!ce||ce.length<2)continue;let pe=[];for(let re=0;re<ce.length;re++){let he=ce[re];pe.push(`${re===0?"M":"L"}${he.x.toFixed(1)},${he.y.toFixed(1)}`)}se.push(o("path",{key:`trail-${le.nodeId}`,d:pe.join(" "),fill:"none",stroke:le.color??"#3b82f6","stroke-width":String(le.width??1),opacity:String(le.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return se},[T,x]),j=U(),O=V(),Y=q(),K=te(),Q=J();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":b??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:z,onMouseUp:W,onMouseLeave:_},...j,...Q,...O,...Y,...K)}var ps=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function fs(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=ps,title:h}=e,m=i==="vertical",c=h?30:0,p=120,f=X(()=>{let L=0;for(let I=0;I<t.length;I++)t[I].value>L&&(L=t[I].value);return L>0?L:1},[t]),y=S(L=>f===0?0:Math.max(.05,L/f),[f]),b=S((L,I)=>I||(u[L%u.length]??ps[0]),[u]),g=S(()=>{if(t.length===0)return[];let L=[],I=40,P=n-I*2-p,B=r-c-I*2,E=d*(t.length-1),F=Math.max(1,(B-E)/t.length),A=I+P/2;for(let k=0;k<t.length;k++){let w=t[k],R=k<t.length-1?t[k+1]:null,M=b(k,w.color),N=y(w.value),z=R!==null?y(R.value):N*.6,W=P/2*N,_=P/2*z,H=c+I+k*(F+d),U=A-W,q=A+W,te=A+_,J=A-_,V=`${U},${H} ${q},${H} ${te},${H+F} ${J},${H+F}`;L.push(o("polygon",{key:`section-${k}`,points:V,fill:M,stroke:"#fff","stroke-width":"1"}));let j=I+P+12,O=H+F/2;if(s&&L.push(o("text",{key:`label-${k}`,x:String(j),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 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(O+(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,b,y,p]),x=S(()=>{if(t.length===0)return[];let L=[],I=40,P=n-I*2,E=r-c-I*2-40,F=d*(t.length-1),A=Math.max(1,(P-F)/t.length),k=c+I+E/2;for(let w=0;w<t.length;w++){let R=t[w],M=w<t.length-1?t[w+1]:null,N=b(w,R.color),z=y(R.value),W=M!==null?y(M.value):z*.6,_=E/2*z,H=E/2*W,U=I+w*(A+d),q=k-_,te=k-H,J=k+H,V=k+_,j=`${U},${q} ${U+A},${te} ${U+A},${J} ${U},${V}`;L.push(o("polygon",{key:`section-${w}`,points:j,fill:N,stroke:"#fff","stroke-width":"1"}));let O=U+A/2,Y=c+I+E+14;if(s&&L.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"},R.label)),a||l){let K="";if(a&&(K=String(R.value)),l&&t.length>0){let Q=t[0].value,se=Q>0?Math.round(R.value/Q*100):0;K+=a?` (${se}%)`:`${se}%`}L.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"},K))}}return L},[t,n,r,c,d,s,a,l,b,y]),v=S(()=>h?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n]),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?g():x(),$=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":h??"Funnel chart",style:{fontFamily:"sans-serif"}},...D,...C,...$)}var gs=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ms(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 Bd(e,t){return t||gs[e%gs.length]}function hs(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:h,padding: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":h??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,p=X(()=>{let B=1/0,E=-1/0;for(let F of t){F.start<B&&(B=F.start);let A=F.start+F.duration;A>E&&(E=A)}return B===1/0&&(B=0,E=1),{min:B,max:E,range:E-B}},[t]),f=X(()=>{let B=t.slice();return B.sort((E,F)=>E.group!==F.group?(E.group??"").localeCompare(F.group??""):E.start-F.start),B},[t]),y=r??m*2+f.length*(i+s)+s+20,b=n-m-c-m,g=m+(h?20:0),x=S(B=>p.range===0?c+m:c+m+(B-p.min)/p.range*b,[p,b,c,m]),v=S(()=>{if(!a)return[];let B=[],E=ms(p.range),F=Math.ceil(p.min/E)*E,A=g+f.length*(i+s)+s;for(let k=F;k<=p.max;k+=E){let w=x(k);B.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(g),x2:String(w),y2:String(A),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return B},[a,p,g,f.length,i,s,x]),T=S(()=>{let B=[],E=ms(p.range),F=Math.ceil(p.min/E)*E,A=g-8;for(let k=F;k<=p.max;k+=E){let w=x(k);B.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 B.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)),B},[p,g,x,u,n,m]),D=S(()=>{let B=[],E="";for(let F=0;F<f.length;F++){let A=f[F],k=g+F*(i+s)+s,w=x(A.start),R=Math.max(2,x(A.start+A.duration)-w),M=Bd(F,A.color);A.group&&A.group!==E&&(E=A.group,l&&B.push(o("text",{key:`group-${F}`,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))),B.push(o("rect",{key:`bar-${A.id}`,x:String(w),y:String(k),width:String(R),height:String(i),rx:"4",ry:"4",fill:M,role:"graphics-symbol","aria-label":`${A.label}: start ${A.start}, duration ${A.duration}`})),l&&B.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&&R>30&&B.push(o("text",{key:`prog-${A.id}`,x:String(w+R/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 B},[f,g,i,s,x,l,d,c,m]),C=S(()=>h?[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"},h)]:[],[h,n,m]),$=v(),L=T(),I=D(),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":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...$,...L,...I)}var Fd=Math.PI/180;function Nd(e){return e*Fd}function je(e,t,n,r){let i=Nd(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function bs(e,t,n,r,i){let s=je(e,t,n,i),a=je(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 Wd(e,t,n){return e<t?t:e>n?n:e}function dt(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function xs(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:h=!0,showTicks:m=!0,tickCount:c=10,label:p,unit:f,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:b="#374151",backgroundColor:g="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,T=isFinite(t)&&!isNaN(t)?Wd(t,x,v):x,D=(u?24:0)+(p?18:0),C=i/2,$=(s-D)*.6,L=Math.min(i/2,(s-D)*.55)-d/2-10,I=L-d,P=L-d/2,B=l-a,E=S(V=>{let j=v-x;if(j===0)return a;let O=(V-x)/j;return a+O*B},[x,v,a,B]),F=S(()=>{let V=bs(C,$,P,a,l);return[o("path",{key:"bg-arc",d:V,fill:"none",stroke:g,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,$,P,a,l,g,d]),A=S(()=>{if(y.length===0)return[];let V=[],j=B/y.length;for(let O=0;O<y.length;O++){let Y=a+O*j,K=Y+j,Q=bs(C,$,P,Y,K);V.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 V},[y,B,a,C,$,P,d]),k=S(()=>{if(!m||c<=0)return[];let V=[],j=Math.max(1,Math.min(c,100));for(let O=0;O<=j;O++){let Y=O/j,K=a+Y*B,Q=O%2===0,se=Q?10:6,ee=je(C,$,L+4,K),le=je(C,$,L+4+se,K);if(V.push(o("line",{key:`tick-${O}`,x1:String(ee.x),y1:String(ee.y),x2:String(le.x),y2:String(le.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let ce=x+Y*(v-x),pe=je(C,$,L+4+se+12,K);V.push(o("text",{key:`tick-label-${O}`,x:String(pe.x),y:String(pe.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},dt(ce)))}}return V},[m,c,a,B,C,$,L,x,v]),w=S(()=>{let V=[],j=E(T),O=I-8,Y=je(C,$,O,j),K=6,Q=j+90,se=j-90,ee=je(C,$,K,Q),le=je(C,$,K,se);return V.push(o("polygon",{key:"needle",points:`${Y.x},${Y.y} ${ee.x},${ee.y} ${le.x},${le.y}`,fill:b,stroke:"none"})),V.push(o("circle",{key:"needle-cap",cx:String(C),cy:String($),r:"8",fill:b,stroke:"#fff","stroke-width":"2"})),V},[T,E,C,$,I,b]),R=S(()=>{if(!u)return[];let V=[],j=dt(T),O=j+(f?" "+f:""),Y=$+P+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: ${O}`},j,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),V},[u,T,f,C,$,P]),M=S(()=>{if(!p)return[];let V=$+P+(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"},p)]},[p,C,$,P,u]),N=S(()=>{if(!h)return[];let V=[],j=je(C,$,P,a),O=je(C,$,P,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"},dt(x))),V.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"},dt(v))),V},[h,C,$,P,a,l,x,v]),z=F(),W=A(),_=k(),H=w(),U=R(),q=M(),te=N(),J=`Gauge: ${dt(T)}${f?" "+f:""}, range ${dt(x)} to ${dt(v)}${p?", "+p:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(T),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":J,style:{fontFamily:"sans-serif"}},...z,...W,..._,...H,...U,...q,...te)}var Lt={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-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(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:h="Map of the United States"}=e,m=X(()=>Object.keys(Lt),[]),c=S(g=>{l&&l(g)},[l]),p=S((g,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(g)},[d,u]),f=S((g,x)=>{let v=x.currentTarget;if(v){let T=r[g]??i;v.setAttribute("fill",T)}d&&d(null)},[d,r,i]),y=X(()=>{let g=[];for(let x=0;x<m.length;x++){let v=m[x],T=Lt[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 $=v;C.onMouseOver=L=>p($,L),C.onMouseOut=L=>f($,L),g.push(o("path",C))}return g},[m,r,i,s,a,l,c,p,f]),b=o("title",{key:"map-title"},h);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h,style:{fontFamily:"sans-serif"}},b,...y)}function Zn(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 _d(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 Od(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=Zn(t[i]),l=Zn(t[i+1]);return _d(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Hd(e){let{r:t,g:n,b:r}=Zn(e);return(.299*t+.587*n+.114*r)/255}var Yd=["#3b82f6","#fbbf24","#ef4444"];function Ss(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Yd,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:m=1,title:c,padding:p=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:b,maxVal:g}=X(()=>{let k=l??1/0,w=d??-1/0;for(let R of t)for(let M of R)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,v=n?p:20,T=r?p:20,D=i-v-20,C=s-x-T-20,$=y>0?D/y:0,L=f>0?C/f:0,I=S(()=>{let k=[];for(let w=0;w<f;w++){let R=t[w];for(let M=0;M<y;M++){let N=M<R.length?R[M]:0,z=(N-b)/(g-b),W=Od(z,a),_=v+M*$,H=x+20+w*L;if(k.push(o("rect",{key:`cell-${w}-${M}`,x:String(_),y:String(H),width:String($),height:String(L),fill:W,stroke:h,"stroke-width":String(m)})),u){let U=Hd(W)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${M}`,x:String(_+$/2),y:String(H+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,$*.3,L*.4)),"font-family":"sans-serif",fill:U},String(Math.round(N*100)/100)))}}}return k},[t,f,y,b,g,a,$,L,v,x,u,h,m]),P=S(()=>{let k=[];if(n)for(let w=0;w<f;w++){let R=w<n.length?n[w]:"",M=x+20+w*L+L/2;k.push(o("text",{key:`row-label-${w}`,x:String(v-8),y:String(M),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},R))}if(r)for(let w=0;w<y;w++){let R=w<r.length?r[w]:"",M=v+w*$+$/2,N=x+20+f*L+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"},R))}return k},[n,r,f,y,$,L,v,x]),B=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(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 E=B(),F=I(),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"}},...E,...F,...A)}function Vd(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 Ud(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 Jn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function vs(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:h,yLabel:m,padding:c=60}=e,p=Math.max(1,Math.round(n)),f=X(()=>Vd(t,p),[t,p]),y=X(()=>{let E=0;for(let F=0;F<f.length;F++)f[F].count>E&&(E=f[F].count);return E>0?E:1},[f]),b=r-c*2,g=i-c*2,x=S(()=>{if(!l)return[];let E=Ud(y),F=[];for(let A=E;A<=y;A+=E){let k=c+g-A/y*g;F.push(o("line",{key:`grid-${A}`,x1:String(c),y1:String(k),x2:String(c+b),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),F.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 F},[l,y,c,b,g]),v=S(()=>{let E=[];return E.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"})),E.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+g),x2:String(c+b),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E},[c,b,g]),T=S(()=>{if(f.length===0)return[];let E=[],F=a*(f.length-1),A=Math.max(1,(b-F)/f.length);for(let k=0;k<f.length;k++){let w=f[k],R=w.count/y*g,M=c+k*(A+a),N=c+g-R;if(E.push(o("rect",{key:`bar-${k}`,x:String(M),y:String(N),width:String(A),height:String(R),fill:s})),d&&w.count>0&&E.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 W=(f.length===1,Jn(w.min));E.push(o("text",{key:`xlabel-${k}`,x:String(M+A/2),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},W))}}if(f.length>0){let k=f[f.length-1],w=c+b;E.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Jn(k.max)))}return E},[f,y,a,s,d,c,b,g]),D=S(()=>{let E=[];return u&&E.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),h&&E.push(o("text",{key:"x-label",x:String(c+b/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),m&&E.push(o("text",{key:"y-label",x:String(14),y:String(c+g/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+g/2})`},m)),E},[u,h,m,r,i,c,b,g]),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]),$=x(),L=v(),I=T(),P=D(),B=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,...$,...L,...I,...B)}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,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:h=!0,title:m,padding:c=60}=e,p=i==="vertical",f=p?30:0,y=n-c*2,b=r-c*2-f,g=p?b:y,x=p?y:b,v=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]),T=X(()=>t.length===0?0:x/t.length,[t.length,x]),D=S(()=>{if(!u)return[];let k=jd(v),w=[];for(let R=k;R<=v;R+=k){let M=R/v*g;if(p){let N=c+b-M;w.push(o("line",{key:`grid-${R}`,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-${R}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(R)))}else{let N=c+M;w.push(o("line",{key:`grid-${R}`,x1:String(N),y1:String(c),x2:String(N),y2:String(c+b),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${R}`,x:String(N),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(R)))}}return w},[u,v,p,c,y,b,g]),C=S(()=>{let k=[];return p?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})):k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+y),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),k},[p,c,y,b]),$=S(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let R=t[w],M=R.value/v*g,N=T*w+T/2,z=R.color??d;if(p){let W=c+N,_=c+b,H=c+b-M;k.push(o("line",{key:`stem-${w}`,x1:String(W),y1:String(_),x2:String(W),y2:String(H),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(W),cy:String(H),r:String(l),fill:z})),h&&k.push(o("text",{key:`val-${w}`,x:String(W),y:String(H-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(R.value)));let U=W,q=c+b+16;k.push(o("text",{key:`cat-${w}`,x:String(U),y:String(q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${q})`},R.label))}else{let W=c+N,_=c,H=c+M;k.push(o("line",{key:`stem-${w}`,x1:String(_),y1:String(W),x2:String(H),y2:String(W),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(H),cy:String(W),r:String(l),fill:z})),h&&k.push(o("text",{key:`val-${w}`,x:String(H+l+4),y:String(W+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(R.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},R.label))}}return k},[t,v,T,d,l,s,a,h,p,c,y,b,g]),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]),P=D(),B=C(),E=$(),F=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"}},...F,...P,...B,...E,...A)}function Qn(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 Gd(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 Xd(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=Qn(t[i]),l=Qn(t[i+1]);return Gd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function qd(e){let{r:t,g:n,b:r}=Qn(e);return(.299*t+.587*n+.114*r)/255}var Kd=["#f0f9ff","#3b82f6","#1e3a8a"];function ks(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Kd,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:m,padding:c=70,symmetric:p=!1}=e,f=r??n,y=i??n,b=t.length,g=X(()=>{let z=0;for(let W of t)W.length>z&&(z=W.length);return z},[t]),x=X(()=>{if(!p||b===0)return t;let z=[],W=Math.max(b,g);for(let _=0;_<W;_++){let H=[];for(let U=0;U<W;U++){let q=t[_],te=q&&U<q.length?q[U]:0,J=t[U],V=J&&_<J.length?J[_]:0;te!==0?H.push(te):H.push(V)}z.push(H)}return z},[t,p,b,g]),v=x.length,T=X(()=>{let z=0;for(let W of x)W.length>z&&(z=W.length);return z},[x]),{minVal:D,maxVal:C}=X(()=>{let z=1/0,W=-1/0;for(let _ of x)for(let H of _)H<z&&(z=H),H>W&&(W=H);return z===1/0&&(z=0),W===-1/0&&(W=1),z===W&&(W=z+1),{minVal:z,maxVal:W}},[x]),$=m?30:0,L=f?c:20,I=y?c:20,P=s-L-20,B=a-$-I-20,E=T>0?P/T:0,F=v>0?B/v:0,A=S(()=>{let z=[];for(let W=0;W<v;W++){let _=x[W];for(let H=0;H<T;H++){let U=H<_.length?_[H]:0,q=(U-D)/(C-D),te=Xd(q,l),J=L+H*E,V=$+20+W*F,j=W===H,O=j&&u?"currentColor":h,Y=j&&u?"2":"1";if(z.push(o("rect",{key:`cell-${W}-${H}`,x:String(J),y:String(V),width:String(E),height:String(F),fill:te,stroke:O,"stroke-width":Y})),d){let K=qd(te)>.5?"#111827":"#ffffff",Q=Math.min(12,E*.3,F*.35);z.push(o("text",{key:`val-${W}-${H}`,x:String(J+E/2),y:String(V+F/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,E,F,L,$,d,u,h]),k=S(()=>{let z=[];if(f)for(let W=0;W<v;W++){let _=W<f.length?f[W]:"",H=$+20+W*F+F/2;z.push(o("text",{key:`row-label-${W}`,x:String(L-8),y:String(H),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}if(y)for(let W=0;W<T;W++){let _=W<y.length?y[W]:"",H=L+W*E+E/2,U=$+20+v*F+12;z.push(o("text",{key:`col-label-${W}`,x:String(H),y:String(U),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}return z},[f,y,v,T,E,F,L,$]),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 R=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"}},...R,...M,...N)}var Zd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function rn(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 Jd(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 Qd(e,t,n,r,i,s,a){let l=[];if(rn(e)<=0)return l;let h=Jd(e)+1,m=s==="horizontal",c=m?i/h:r/h,p=[];for(p.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});p.length>0;){let f=p.shift(),{node:y,depth:b,spanStart:g,spanEnd:x,colorIndex:v}=f,T=rn(y);if(T<=0)continue;let D=x-g,C,$,L,I;if(m?(C=g,$=n+b*c,L=D,I=c):(C=t+b*c,$=g,L=c,I=D),l.push({x:C,y:$,w:L,h:I,label:y.label,value:T,color:y.color??a[v%a.length],depth:b}),y.children&&y.children.length>0){let P=g;for(let B=0;B<y.children.length;B++){let E=y.children[B],F=rn(E);if(F<=0)continue;let A=F/T*D;p.push({node:E,depth:b+1,spanStart:P,spanEnd:P+A,colorIndex:b===0?B:v}),P+=A}}}return l}function Cs(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Zd,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:m=10}=e,c=h?30:0,p=m,f=m+c,y=n-m*2,b=r-m*2-c;if(X(()=>rn(t),[t])<=0||y<=0||b<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let x=X(()=>Qd(t,p,f,y,b,i,l),[t,p,f,y,b,i,l]),v=[];h&&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"},h));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),$=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"},$))}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":h??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function eo(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Ms(e,t){let n=new Set;for(let i of e)n.add(eo(i,t));let r=Array.from(n);return r.sort(),r}function sn(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 an(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function eu(e,t,n,r,i){let s=Ms(e,t),a=Ms(e,n),l=new Map;for(let p of e){let f=eo(p,t),y=eo(p,n),b=`${f}::${y}`;l.has(b)||l.set(b,[]);let g=l.get(b),x=0;for(let v of r){let T=p[v];if(typeof T=="number")x+=T;else if(typeof T=="string"){let D=parseFloat(T);isNaN(D)||(x+=D)}}g.push(x)}let d=new Map;for(let[p,f]of l)d.set(p,sn(f,i));let u=new Map;for(let p of s){let f=[];for(let y of a){let b=d.get(`${p}::${y}`);b!==void 0&&f.push(b)}u.set(p,sn(f,i==="count"?"sum":i))}let h=new Map;for(let p of a){let f=[];for(let y of s){let b=d.get(`${y}::${p}`);b!==void 0&&f.push(b)}h.set(p,sn(f,i==="count"?"sum":i))}let m=[];for(let p of u.values())m.push(p);let c=sn(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:h,grandTotal:c}}function Es(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:h="#3b82f6",cellPadding: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(()=>eu(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:p,colKeys:f,cells:y,rowTotals:b,colTotals:g,grandTotal:x}=c,v=u?30:0,T=f.length+(d?1:0),D=p.length+(d?1:0),C=1+T,$=1+D,L=Math.max(40,(a-m*2)/C),I=Math.max(20,Math.min(36,(l-v-m*2)/$)),P=L*C,B=I*$,E=Math.max(0,(a-P)/2),F=v+Math.max(0,(l-v-B)/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(E),y:String(F),width:String(P),height:String(I),fill:h})),A.push(o("rect",{key:"header-col-bg",x:String(E),y:String(F+I),width:String(L),height:String(I*D),fill:h,opacity:"0.85"})),A.push(o("text",{key:"corner",x:String(E+L/2),y:String(F+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<f.length;k++){let w=E+(k+1)*L,R=Math.floor(L/7),M=f[k],N=M.length>R?M.substring(0,Math.max(1,R-2))+"..":M;A.push(o("text",{key:`ch-${k}`,x:String(w+L/2),y:String(F+I/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(E+(f.length+1)*L+L/2),y:String(F+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<p.length;k++){let w=p[k],R=F+(k+1)*I;k%2===0&&A.push(o("rect",{key:`row-bg-${k}`,x:String(E+L),y:String(R),width:String(L*T),height:String(I),fill:"#f9fafb"}));let M=Math.floor(L/7),N=w.length>M?w.substring(0,Math.max(1,M-2))+"..":w;A.push(o("text",{key:`rh-${k}`,x:String(E+L/2),y:String(R+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N));for(let z=0;z<f.length;z++){let W=f[z],_=`${w}::${W}`,H=y.get(_),U=E+(z+1)*L;A.push(o("rect",{key:`border-${k}-${z}`,x:String(U),y:String(R),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(R+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H!==void 0?an(H):"-"))}if(d){let z=E+(f.length+1)*L,W=b.get(w)??0;A.push(o("rect",{key:`rt-bg-${k}`,x:String(z),y:String(R),width:String(L),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:`rt-${k}`,x:String(z+L/2),y:String(R+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},an(W)))}}if(d){let k=F+(p.length+1)*I;A.push(o("rect",{key:"total-row-bg",x:String(E),y:String(k),width:String(P),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:"total-label",x:String(E+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 R=0;R<f.length;R++){let M=f[R],N=g.get(M)??0,z=E+(R+1)*L;A.push(o("text",{key:`ct-${R}`,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"},an(N)))}let w=E+(f.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"},an(x)))}return A.push(o("rect",{key:"outer-border",x:String(E),y:String(F),width:String(P),height:String(B),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 ln(e,t){return Math.PI*2*e/t-Math.PI/2}function cn(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Is(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:h="#d1d5db",title:m}=e,c=t.length,p=m?30:0,f=d&&n.length>0?30:0,y=60,b=Math.min((r-y*2)/2,(i-y*2-p-f)/2),g=r/2,x=y+p+b,v=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 R=0;for(let M of n){let N=M.values[k];N!==void 0&&N>R&&(R=N)}A.push(R>0?R:1)}return A},[t,n,c]),T=S(()=>{if(c<3)return[];let A=[];for(let k=1;k<=s;k++){let w=b*k/s,R=[];for(let M=0;M<c;M++){let N=ln(M,c),z=cn(g,x,w,N);R.push(`${z.x},${z.y}`)}A.push(o("polygon",{key:`ring-${k}`,points:R.join(" "),fill:"none",stroke:h,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=ln(k,c),R=cn(g,x,b,w);A.push(o("line",{key:`spoke-${k}`,x1:String(g),y1:String(x),x2:String(R.x),y2:String(R.y),stroke:h,"stroke-width":"0.75"}))}return A},[c,s,b,g,x,h]),D=S(()=>{if(!a||c<3)return[];let A=[],k=16;for(let w=0;w<c;w++){let R=ln(w,c),M=cn(g,x,b+k,R),N="middle";M.x<g-5?N="end":M.x>g+5&&(N="start");let z=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:z,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return A},[a,c,t,b,g,x]),C=S(()=>{if(c<3||n.length===0)return[];let A=[];for(let k=0;k<n.length;k++){let w=n[k],R=[],M=[],N=[];for(let z=0;z<c;z++){let W=w.values[z]??0,_=v[z],H=Math.min(W/_,1),U=b*H,q=ln(z,c),te=cn(g,x,U,q);R.push(`${te.x},${te.y}`),u&&M.push(o("circle",{key:`dot-${k}-${z}`,cx:String(te.x),cy:String(te.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&N.push(o("text",{key:`val-${k}-${z}`,x:String(te.x),y:String(te.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(W*100)/100)))}A.push(o("polygon",{key:`series-fill-${k}`,points:R.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),A.push(o("polygon",{key:`series-line-${k}`,points:R.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let z of M)A.push(z);for(let z of N)A.push(z)}return A},[c,n,v,b,g,x,u,l]),$=S(()=>{if(!d||n.length===0)return[];let A=[],k=x+b+40,w=100,R=n.length*w,M=g-R/2;for(let N=0;N<n.length;N++){let z=n[N],W=M+N*w;A.push(o("rect",{key:`legend-swatch-${N}`,x:String(W),y:String(k),width:"12",height:"12",rx:"2",fill:z.color})),A.push(o("text",{key:`legend-text-${N}`,x:String(W+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},z.label))}return A},[d,n,g,x,b]),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(),P=D(),B=C(),E=$(),F=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"}},...F,...I,...P,...B,...E)}var tu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function nu(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let h of u){let m=n.get(h),c=d+1;(m===void 0||c>m)&&n.set(h,c),s.includes(h)||s.push(h)}}for(let l of e)n.has(l)||n.set(l,0);return n}function ou(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,h=t.filter(P=>P.value>0),m=e.map(P=>P.id),c=nu(m,h),p=new Map,f=new Map;for(let P of m)p.set(P,0),f.set(P,0);for(let P of h)f.set(P.source,(f.get(P.source)??0)+P.value),p.set(P.target,(p.get(P.target)??0)+P.value);let y=0;for(let P of c.values())P>y&&(y=P);let b=new Map;for(let P=0;P<=y;P++)b.set(P,[]);for(let[P,B]of c)b.get(B).push(P);let g=new Map,x=y>0?(d-i)/y:0;for(let P=0;P<=y;P++)g.set(P,a+P*x);let v=new Map;for(let P=0;P<e.length;P++)v.set(e[P].id,e[P]);let T=[],D=new Map;for(let P=0;P<=y;P++){let B=b.get(P);if(B.length===0)continue;let E=0;for(let w of B){let R=p.get(w)??0,M=f.get(w)??0;E+=Math.max(R,M,1)}let F=u-s*(B.length-1),A=E>0?F/E:1,k=a;for(let w=0;w<B.length;w++){let R=B[w],M=v.get(R),N=p.get(R)??0,z=f.get(R)??0,W=Math.max(N,z,1),_=Math.max(4,W*A),H=e.findIndex(q=>q.id===R),U={id:R,label:M.label,color:M.color??l[H%l.length],column:P,x:g.get(P),y:k,height:_,totalIn:N,totalOut:z,totalValue:W};T.push(U),D.set(R,U),k+=_+s}}let C=new Map,$=new Map;for(let P of m)C.set(P,0),$.set(P,0);let L=[...h].sort((P,B)=>B.value-P.value),I=[];for(let P of L){let B=D.get(P.source),E=D.get(P.target);if(!B||!E)continue;let F=B.totalOut||1,A=E.totalIn||1,k=P.value/F*B.height,w=P.value/A*E.height,R=Math.max(1,(k+w)/2),M=C.get(P.source),N=$.get(P.target),z=B.y+M+k/2,W=E.y+N+w/2;C.set(P.source,M+k),$.set(P.target,N+w);let _=v.get(P.source);I.push({source:P.source,target:P.target,value:P.value,color:P.color??_?.color??B.color,sourceY:z,targetY:W,width:R})}return{layoutNodes:T,layoutLinks:I}}function Rs(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:h=tu,title:m,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let p=X(()=>ou(t,n,r,i,s,a,c,h),[t,n,r,i,s,a,c,h]),f=S(()=>{let T=[];for(let D=0;D<p.layoutLinks.length;D++){let C=p.layoutLinks[D],$=p.layoutNodes.find(F=>F.id===C.source),L=p.layoutNodes.find(F=>F.id===C.target);if(!$||!L)continue;let I=$.x+s,P=L.x,B=(I+P)/2,E=`M ${I} ${C.sourceY} C ${B} ${C.sourceY}, ${B} ${C.targetY}, ${P} ${C.targetY}`;T.push(o("path",{key:`link-${D}`,d:E,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(B),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},[p,s,u,d]),y=S(()=>{let T=[];for(let D=0;D<p.layoutNodes.length;D++){let C=p.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.layoutNodes.reduce((A,k)=>Math.max(A,k.column),0),L=C.column===$,I=L?C.x+s+6:C.x-6,P=L?"start":"end",B=C.column===0,E=B?C.x-6:I,F=B?"end":P;T.push(o("text",{key:`label-${C.id}`,x:String(E),y:String(C.y+C.height/2+4),"text-anchor":F,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},C.label))}}return T},[p,s,l]),b=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]),g=f(),x=y(),v=b();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...g,...x)}var ru=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],to=2*Math.PI;function Bt(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 iu(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 su(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,h=e+r*Math.cos(d),m=t+r*Math.sin(d),c=e+r*Math.cos(u),p=t+r*Math.sin(u),f=e+n*Math.cos(u),y=t+n*Math.sin(u),b=e+n*Math.cos(d),g=t+n*Math.sin(d);if(a>=to-.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 ${h} ${m}`,`A ${r} ${r} 0 1 1 ${v} ${T}`,`A ${r} ${r} 0 1 1 ${h} ${m}`,`L ${b} ${g}`,`A ${n} ${n} 0 1 0 ${D} ${C}`,`A ${n} ${n} 0 1 0 ${b} ${g}`,"Z"].join(" ")}return[`M ${h} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${p}`,`L ${f} ${y}`,`A ${n} ${n} 0 ${l} 0 ${b} ${g}`,"Z"].join(" ")}function au(e,t,n,r){let i=[],s=Bt(e);if(s<=0)return i;let a=iu(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let h=0;h<e.children.length;h++){let m=e.children[h],c=Bt(m);if(c<=0)continue;let p=c/s*to;d.push({node:m,startAngle:u,endAngle:u+p,depth:0,colorIndex:h}),u+=p}}else return i.push({startAngle:0,endAngle:to,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:h,startAngle:m,endAngle:c,depth:p,colorIndex:f}=u,y=Bt(h);if(y<=0)continue;let b=t+p*l,g=b+l;if(i.push({startAngle:m,endAngle:c,innerR:b,outerR:g,label:h.label,value:y,color:h.color??r[f%r.length],depth:p}),h.children&&h.children.length>0){let x=m,v=c-m;for(let T=0;T<h.children.length;T++){let D=h.children[T],C=Bt(D);if(C<=0)continue;let $=C/y*v;d.push({node:D,startAngle:x,endAngle:x+$,depth:p+1,colorIndex:f}),x+=$}}}return i}function Ps(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=ru,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,m=r/2,c=u?20:0,p=Math.min(h,m-c)-10;if(X(()=>Bt(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(h),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=X(()=>au(t,i,p,a),[t,i,p,a]),b=[];u&&b.push(o("text",{key:"title",x:String(h),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let g=m+c/2;for(let x=0;x<y.length;x++){let v=y[x],T=su(h,g,v.innerR,v.outerR,v.startAngle,v.endAngle);if(b.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,$=(v.innerR+v.outerR)/2,L=v.outerR-v.innerR,I=D*$;if(I>20&&L>14){let P=h+$*Math.cos(C),B=g+$*Math.sin(C),E=Math.floor(Math.min(I,L)/7),F=v.label.length>E?v.label.substring(0,Math.max(1,E-1))+"..":v.label;b.push(o("text",{key:`label-${x}`,x:String(P),y:String(B+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},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":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...b)}var lu=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function dn(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 $s(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 cu(e,t,n,r,i,s){let a=[],l=[],d=dn(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],h=r*i,m=[];for(let c=0;c<u.length;c++){let p=u[c],f=dn(p);f<=0||m.push({label:p.label,value:f,area:f/d*h,color:p.color??s[c%s.length],node:p})}for(m.sort((c,p)=>p.area-c.area),l.push({nodes:m,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:p,rect:f,depth:y}=c;if(p.length===0)continue;let b={...f},g=0;for(;g<p.length&&b.w>0&&b.h>0;){let x=b.w>=b.h,v=x?b.h:b.w,T=[],D=[];T.push(p[g]),D.push(p[g].area),g++;let C=$s(D,v);for(;g<p.length;){let P=[...D,p[g].area],B=$s(P,v);if(B>C)break;T.push(p[g]),D.push(p[g].area),C=B,g++}let $=0;for(let P of D)$+=P;let L=v>0?$/v:0,I=0;for(let P=0;P<T.length;P++){let B=T[P],E=L>0?B.area/L:0,F,A,k,w;if(x?(F=b.x,A=b.y+I,k=L,w=E):(F=b.x+I,A=b.y,k=E,w=L),a.push({x:F,y:A,w:k,h:w,label:B.label,value:B.value,color:B.color,depth:y}),B.node.children&&B.node.children.length>0){let M=F+2,N=A+2+14,z=k-4,W=w-4-14;if(z>4&&W>4){let _=[],H=B.value,U=z*W;for(let q=0;q<B.node.children.length;q++){let te=B.node.children[q],J=dn(te);J<=0||_.push({label:te.label,value:J,area:J/H*U,color:te.color??s[(q+y+1)%s.length],node:te})}_.sort((q,te)=>te.area-q.area),l.push({nodes:_,rect:{x:M,y:N,w:z,h:W},depth:y+1})}}I+=E}x?b={x:b.x+L,y:b.y,w:b.w-L,h:b.h}:b={x:b.x,y:b.y+L,w:b.w,h:b.h-L}}}return a}function Ts(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=lu,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,m=h?30:0,c=u,p=u+m,f=n-u*2,y=r-u*2-m;if(X(()=>dn(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":h??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let g=X(()=>cu(t,c,p,f,y,a),[t,c,p,f,y,a]),x=[];h&&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"},h));for(let v=0;v<g.length;v++){let T=g[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":h??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function zs(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 du(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 Ds(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=zs(t[s]),u=zs(t[a]);return du(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function un(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 uu(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let h=Math.max(2,Math.min(50,r)),m=d/(h-1),c=u/(h-1);if(n){let f=[];for(let x=0;x<h;x++)for(let v=0;v<h;v++)f.push({x:i+v*m,y:a+x*c});let b=n(f,{gridSize:h,xMin:i,xMax:s,yMin:a,yMax:l}),g=[];for(let x=0;x<f.length;x++){let v=f[x],T=b[x]??{dx:0,dy:0},D=Math.sqrt(T.dx*T.dx+T.dy*T.dy);g.push({x:v.x,y:v.y,dx:T.dx,dy:T.dy,magnitude:D})}return g}if(!t)return[];let p=[];for(let f=0;f<h;f++)for(let y=0;y<h;y++){let b=i+y*m,g=a+f*c,x=t(b,g),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);p.push({x:b,y:g,dx:x.dx,dy:x.dy,magnitude:v})}return p}function pu(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:h,yMax:m,xSpan:c,ySpan:p,showGrid:f,showAxes:y,colorByMagnitude:b,colorScale:g,arrowColor:x,arrowWidth:v,effectiveArrowScale:T,maxMagnitude:D,title:C,tickFontSize:$}=i,L=B=>s+(B-d)/c*a,I=B=>s+(m-B)/p*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=`${$}px sans-serif`,e.fillStyle="#6b7280";let B=un(c,10),E=Math.ceil(d/B)*B;for(let k=E;k<=u;k+=B){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 F=un(p,10),A=Math.ceil(h/F)*F;for(let k=A;k<=m;k+=F){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,h<=0&&m>=0){let B=I(0);e.beginPath(),e.moveTo(s,B),e.lineTo(s+a,B),e.stroke()}if(d<=0&&u>=0){let B=L(0);e.beginPath(),e.moveTo(B,s),e.lineTo(B,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let P=4;for(let B=0;B<r.length;B++){let E=r[B],F=E.magnitude??Math.sqrt(E.dx*E.dx+E.dy*E.dy);if(F<1e-10)continue;let A=L(E.x),k=I(E.y),w=E.dx*T,R=-E.dy*T,M=A+w,N=k+R,z;if(b){let _=F/D;z=Ds(_,g)}else z=x;e.save(),e.strokeStyle=z,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(A,k),e.lineTo(M,N),e.stroke();let W=Math.sqrt(w*w+R*R);if(W>2){let _=w/W,H=R/W,U=-H,q=_,te=Math.min(P,W*.4),J=M-_*te+U*te*.5,V=N-H*te+q*te*.5,j=M-_*te-U*te*.5,O=N-H*te-q*te*.5;e.fillStyle=z,e.beginPath(),e.moveTo(M,N),e.lineTo(J,V),e.lineTo(j,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:h=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:p=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:y=50,tickFontSize:b=10,arrowWidth:g=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:T}=e,D=Math.max(2,Math.min(50,s)),C=r-y*2,$=i-y*2,L=a[0],I=a[1],P=l[0],B=l[1],E=I-L,F=B-P,A=X(()=>J=>y+(J-L)/E*C,[y,L,E,C]),k=X(()=>J=>y+(B-J)/F*$,[y,B,F,$]),w=X(()=>uu(t,n,T,D,L,I,P,B,E,F),[t,n,T,D,L,I,P,B,E,F]),R=X(()=>{let J=0;for(let V=0;V<w.length;V++){let j=w[V],O=j.magnitude??Math.sqrt(j.dx*j.dx+j.dy*j.dy);O>J&&(J=O)}return J>0?J:1},[w]),M=X(()=>Math.min(C,$)/Math.max(D,2)/(2*R)*d,[C,$,D,R,d]);if(x==="canvas"){let J=oe(null),V=oe(0);return ae(()=>{let j=J.current;if(!j)return;let O=j.getContext("2d");if(O)return V.current&&cancelAnimationFrame(V.current),V.current=requestAnimationFrame(()=>{pu(O,r,i,w,{padding:y,chartWidth:C,chartHeight:$,xMin:L,xMax:I,yMin:P,yMax:B,xSpan:E,ySpan:F,showGrid:h,showAxes:m,colorByMagnitude:c,colorScale:p,arrowColor:u,arrowWidth:g,effectiveArrowScale:M,maxMagnitude:R,title:f,tickFontSize:b})}),()=>{V.current&&cancelAnimationFrame(V.current)}},[w,r,i,y,C,$,L,I,P,B,E,F,h,m,c,p,u,g,M,R,f,b]),o("canvas",{ref:J,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let N=S(()=>{if(!h)return[];let J=[],V=un(E,10),j=Math.ceil(L/V)*V;for(let K=j;K<=I;K+=V){let Q=A(K);J.push(o("line",{key:`gridv-${K}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+$),stroke:"#e5e7eb","stroke-width":"0.5"})),J.push(o("text",{key:`xtick-${K}`,x:String(Q),y:String(y+$+16),"text-anchor":"middle","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}let O=un(F,10),Y=Math.ceil(P/O)*O;for(let K=Y;K<=B;K+=O){let Q=k(K);J.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"})),J.push(o("text",{key:`ytick-${K}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}return J},[h,L,I,P,B,E,F,A,k,y,C,$]),z=S(()=>{if(!m)return[];let J=[];if(P<=0&&B>=0){let V=k(0);J.push(o("line",{key:"axis-x",x1:String(y),y1:String(V),x2:String(y+C),y2:String(V),stroke:"#374151","stroke-width":String(g)}))}if(L<=0&&I>=0){let V=A(0);J.push(o("line",{key:"axis-y",x1:String(V),y1:String(y),x2:String(V),y2:String(y+$),stroke:"#374151","stroke-width":String(g)}))}return J.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String($),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),J},[m,L,I,P,B,A,k,y,C,$]),W=S(()=>{let J=[];for(let j=0;j<w.length;j++){let O=w[j],Y=O.magnitude??Math.sqrt(O.dx*O.dx+O.dy*O.dy);if(Y<1e-10)continue;let K=A(O.x),Q=k(O.y),se=O.dx*M,ee=-O.dy*M,le=K+se,ce=Q+ee,pe;if(c){let he=Y/R;pe=Ds(he,p)}else pe=u;J.push(o("line",{key:`arrow-line-${j}`,x1:String(K),y1:String(Q),x2:String(le),y2:String(ce),stroke:pe,"stroke-width":String(g),"stroke-linecap":"round"}));let re=Math.sqrt(se*se+ee*ee);if(re>2){let he=se/re,me=ee/re,ne=-me,de=he,ge=Math.min(4,re*.4),xe=le-he*ge+ne*ge*.5,ue=ce-me*ge+de*ge*.5,Z=le-he*ge-ne*ge*.5,ie=ce-me*ge-de*ge*.5;J.push(o("polygon",{key:`arrow-head-${j}`,points:`${le},${ce} ${xe},${ue} ${Z},${ie}`,fill:pe}))}}return J},[w,A,k,M,c,R,p,u]),_=S(()=>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]),H=N(),U=z(),q=W(),te=_();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif"}},...te,...H,...U,...q)}function fu(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 gu(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:h=!0,title:m,padding:c=60}=e,p=n-c*2,f=r-c*2,y=X(()=>fu(t),[t]),{minVal:b,maxVal:g}=X(()=>{let R=0,M=0;for(let N=0;N<y.length;N++){let z=y[N];z.start<R&&(R=z.start),z.end<R&&(R=z.end),z.start>M&&(M=z.start),z.end>M&&(M=z.end)}return R===M&&(M=R+1),{minVal:R,maxVal:M}},[y]),x=g-b,v=S(R=>c+f-(R-b)/x*f,[c,f,b,x]),T=X(()=>y.length===0?0:p/y.length,[y.length,p]),D=6,C=Math.max(1,T-D),$=S(()=>{if(!u)return[];let R=gu(x),M=[],N=Math.ceil(b/R)*R;for(let z=N;z<=g;z+=R){let W=v(z);M.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(W),x2:String(c+p),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),M.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return M},[u,x,b,g,v,c,p]),L=S(()=>{let R=[];R.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=b<=0&&g>=0?v(0):c+f;return R.push(o("line",{key:"axis-x",x1:String(c),y1:String(M),x2:String(c+p),y2:String(M),stroke:"#374151","stroke-width":"1.5"})),R},[c,p,f,b,g,v]),I=S(()=>{if(y.length===0)return[];let R=[];for(let M=0;M<y.length;M++){let N=y[M],z=c+M*T+D/2,W=Math.max(N.start,N.end),_=Math.min(N.start,N.end),H=v(W),U=v(_),q=Math.max(0,U-H),te;if(N.type==="total"?te=a:N.type==="decrease"?te=s:te=i,R.push(o("rect",{key:`bar-${M}`,x:String(z),y:String(H),width:String(C),height:String(q),fill:te,rx:"2",ry:"2"})),d){let J=N.type==="decrease"||N.value<0?U+14:H-4,V=N.type==="total"?String(N.value):(N.value>=0?"+":"")+String(N.value);R.push(o("text",{key:`val-${M}`,x:String(z+C/2),y:String(J),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},V))}if(R.push(o("text",{key:`cat-${M}`,x:String(z+C/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},N.label)),h&&M<y.length-1){let J=y[M+1],V=v(N.end),j=c+(M+1)*T+D/2;J.type!=="total"&&R.push(o("line",{key:`conn-${M}`,x1:String(z+C),y1:String(V),x2:String(j),y2:String(V),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return R},[y,T,C,v,i,s,a,l,d,h,c,f]),P=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]),B=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]),E=$(),F=L(),A=I(),k=P(),w=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...E,...F,...A,...w)}var mu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],hu=[0,-45,45,90];function bu(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),h=Math.abs(Math.sin(d)),m=a*u+l*h,c=a*h+l*u;return{x:r-m/2,y:i-c/2,w:m,h:c}}function xu(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 yu(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function Su(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 Bs(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=mu,rotations:d=hu,padding:u=4,spiral:h="archimedean",title:m}=e,c=X(()=>{if(t.length===0)return[];let f=t.map((C,$)=>({...C,originalIndex:$})).filter(C=>C.text.length>0&&C.weight>0).sort((C,$)=>$.weight-C.weight);if(f.length===0)return[];let y=f[f.length-1].weight,g=f[0].weight-y;function x(C){if(g===0)return(i+s)/2;let $=(C-y)/g;return i+$*(s-i)}let v=[],T=n/2,D=r/2;for(let C=0;C<f.length;C++){let $=f[C],L=x($.weight),I=d[Su($.text)%d.length],P=$.color??l[C%l.length],B=!1,E=500,F=h==="archimedean"?4:5;for(let A=0;A<E;A++){let k,w;if(h==="archimedean"){let _=A*.1,H=F*_;k=H*Math.cos(_),w=H*Math.sin(_)}else{let _=Math.floor(A/4)+1,H=A%4,U=(A%4===0?0:A)*F;switch(H){case 0:k=_*F*4,w=U;break;case 1:k=-U,w=_*F*4;break;case 2:k=-_*F*4,w=-U;break;default:k=U,w=-_*F*4;break}}let R=T+k,M=D+w,N=bu($.text,L,I,R,M),z={x:N.x-u,y:N.y-u,w:N.w+u*2,h:N.h+u*2};if(!yu(z,n,r))continue;let W=!1;for(let _ of v)if(xu(z,_.bbox)){W=!0;break}if(!W){v.push({text:$.text,x:R,y:M,fontSize:L,rotation:I,color:P,bbox:z}),B=!0;break}}}return v},[t,n,r,i,s,l,d,u,h]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let p=[];m&&p.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},m));for(let f=0;f<c.length;f++){let y=c[f],b=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;p.push(o("text",{key:`word-${f}`,transform:b,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud",style:{fontFamily:a}},...p)}var vu={0:"#1e293b",1:"#3b82f6"},wu="#666";function Fs(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:h="#0f172a",padding:m=10,onCellClick:c,onCellHover:p,title:f}=e,y=n??vu,b=t.length,g=X(()=>{let R=0;for(let M=0;M<t.length;M++){let N=t[M];N!==void 0&&N.length>R&&(R=N.length)}return R},[t]),x=u?20:0,v=f?24:0,T=X(()=>{let R=r-m*2-x,M=i-m*2-x-v;if(b===0||g===0)return{cellWidth:0,cellHeight:0};let N=Math.max(0,(R-s*(g-1))/g),z=Math.max(0,(M-s*(b-1))/b);return{cellWidth:N,cellHeight:z}},[r,i,m,b,g,s,x,v]),D=S(R=>{let M=y[R];return M!==void 0?M:wu},[y]),C=S(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),$=S(()=>f?[o("text",{key:"title",x:String(r/2),y:String(m+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},f)]:[],[f,r,m]),L=S(()=>{if(!l||b===0||g===0)return[];let{cellWidth:R,cellHeight:M}=T,N=m+x,z=m+x+v,W=g*R+(g-1)*s,_=b*M+(b-1)*s,H=[];for(let U=0;U<=g;U++){let q=N+U*(R+s)-s/2;H.push(o("line",{key:`vgrid-${U}`,x1:String(q),y1:String(z-s/2),x2:String(q),y2:String(z+_+s/2),stroke:d,"stroke-width":"0.5"}))}for(let U=0;U<=b;U++){let q=z+U*(M+s)-s/2;H.push(o("line",{key:`hgrid-${U}`,x1:String(N-s/2),y1:String(q),x2:String(N+W+s/2),y2:String(q),stroke:d,"stroke-width":"0.5"}))}return H},[l,b,g,T,m,x,v,s,d]),I=S(()=>{if(!u||b===0||g===0)return[];let{cellWidth:R,cellHeight:M}=T,N=m+x,z=m+x+v,W=[];for(let _=0;_<g;_++){let H=N+_*(R+s)+R/2,U=z-6;W.push(o("text",{key:`col-idx-${_}`,x:String(H),y:String(U),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}for(let _=0;_<b;_++){let H=N-6,U=z+_*(M+s)+M/2+3;W.push(o("text",{key:`row-idx-${_}`,x:String(H),y:String(U),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}return W},[u,b,g,T,m,x,v,s]),P=S(()=>{if(b===0||g===0)return[];let{cellWidth:R,cellHeight:M}=T,N=m+x,z=m+x+v,W=[];for(let _=0;_<b;_++){let H=t[_];if(H!==void 0)for(let U=0;U<g;U++){let q=U<H.length?H[U]:0,te=N+U*(R+s),J=z+_*(M+s),V=D(q),j={key:`cell-${_}-${U}`,x:String(te),y:String(J),width:String(R),height:String(M),fill:V,rx:String(a),ry:String(a)};if(c){let O=_,Y=U,K=q;j.onClick=()=>c(O,Y,K),j.role="button",j.tabIndex=0}if(p){let O=_,Y=U,K=q;j.onMouseEnter=()=>p(O,Y,K)}W.push(o("rect",j))}}return W},[b,g,t,T,m,x,v,s,a,D,c,p]),B=C(),E=$(),F=L(),A=I(),k=P(),w=f?`${f} \u2014 ${b}x${g} discrete grid`:`${b}x${g} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":w},B,...E,...F,...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(wl,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function $r(e={}){let t=oe(null);t.current||(t.current=yn(e));let n=t.current,r=S(()=>o(Sn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var kl=6,Cl=8;function Ml(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Cl;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 El(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${kl}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 Tr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=G(!1),[d,u]=G(null),h=oe(null),m=oe(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,p=S(()=>{m.current=setTimeout(()=>{if(h.current){let x=h.current.getBoundingClientRect();u(Ml(x,n))}l(!0)},r)},[r,n]),f=S(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);se(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},b={...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"},g=[o("div",{ref:h,style:y,onMouseEnter:p,onMouseLeave:f,onFocus:p,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&g.push(o("div",{id:c,style:b,role:"tooltip"},t,o("div",{style:El(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...g)}function vn(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 Il(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 Rl(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Pl(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var zr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Dr(e,t){return t||zr[e%zr.length]}function Ar(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:h="#e5e7eb",title:m,padding:c=50,animate:p=!1,stacked:f,grouped:y=!1}=e,b=i==="vertical",g=n-c*2,x=r-c*2,v=b?x:g,T=b?g:x,D=f!==void 0&&f.length>0,C=X(()=>D?Pl(f):[],[D,f]),$=D?f.length:t.length,L=X(()=>Il(t,f,y),[t,f,y]),I=L>0?L:1,P=vn($,I,v,T,a),B=S(()=>{if(!u)return[];let O=Rl(I),U=[];for(let q=O;q<=I;q+=O){let ee=P.valueScale(q);if(b){let Z=c+x-ee;U.push(o("line",{key:`grid-${q}`,x1:String(c),y1:String(Z),x2:String(c+g),y2:String(Z),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${q}`,x:String(c-6),y:String(Z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(q)))}else{let Z=c+ee;U.push(o("line",{key:`grid-${q}`,x1:String(Z),y1:String(c),x2:String(Z),y2:String(c+x),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${q}`,x:String(Z),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(q)))}}return U},[u,I,P,b,c,g,x,h]),E=S(()=>{let O=[];return b?(O.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"})),O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+g),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+g),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),O.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))),O},[b,c,g,x]),F=S(()=>{let O=[];for(let U=0;U<t.length;U++){let q=t[U],ee=P.valueScale(q.value),Z=P.categoryScale(U),V=q.color??s,j,H,Y=String(q.value);if(b){let K=c+Z,Q=c+x-ee;j={x:String(K),y:String(Q),width:String(P.barThickness),height:String(ee),rx:String(l),ry:String(l),fill:V},H={x:String(K+P.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let K=c+Z,Q=c;j={x:String(Q),y:String(K),width:String(ee),height:String(P.barThickness),rx:String(l),ry:String(l),fill:V},H={x:String(Q+ee+6),y:String(K+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(p&&(j.style=b?`animation: barGrow 0.6s ease-out ${U*.05}s both`:`animation: barGrow 0.6s ease-out ${U*.05}s both`),O.push(o("rect",{key:`bar-${U}`,...j})),d&&O.push(o("text",{key:`val-${U}`,...H},Y)),b){let K=c+Z+P.barThickness/2,Q=c+x+16;O.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})`},q.label))}else O.push(o("text",{key:`cat-${U}`,x:String(c-6),y:String(c+Z+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},q.label))}return O},[t,P,s,l,d,p,b,c,x]),A=S(()=>{if(!f)return[];let O=[];for(let U=0;U<f.length;U++){let q=f[U],ee=P.categoryScale(U),Z=0;for(let V=0;V<q.values.length;V++){let j=q.values[V],H=P.valueScale(j.value),Y=P.valueScale(Z),K=Dr(V,j.color);if(b){let Q=c+ee,ie=c+x-Y-H;O.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(ie),width:String(P.barThickness),height:String(H),rx:V===q.values.length-1?String(l):"0",ry:V===q.values.length-1?String(l):"0",fill:K,...p?{style:`animation: barGrow 0.6s ease-out ${(U*q.values.length+V)*.03}s both`}:{}})),d&&H>14&&O.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+P.barThickness/2),y:String(ie+H/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let Q=c+Y,ie=c+ee;O.push(o("rect",{key:`sbar-${U}-${V}`,x:String(Q),y:String(ie),width:String(H),height:String(P.barThickness),rx:V===q.values.length-1?String(l):"0",ry:V===q.values.length-1?String(l):"0",fill:K,...p?{style:`animation: barGrow 0.6s ease-out ${(U*q.values.length+V)*.03}s both`}:{}})),d&&H>20&&O.push(o("text",{key:`sval-${U}-${V}`,x:String(Q+H/2),y:String(ie+P.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=P.valueScale(Z);b?O.push(o("text",{key:`stotal-${U}`,x:String(c+ee+P.barThickness/2),y:String(c+x-V-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z))):O.push(o("text",{key:`stotal-${U}`,x:String(c+V+6),y:String(c+ee+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z)))}if(b){let V=c+ee+P.barThickness/2,j=c+x+16;O.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})`},q.label))}else O.push(o("text",{key:`scat-${U}`,x:String(c-6),y:String(c+ee+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},q.label))}return O},[f,P,l,d,p,b,c,x]),k=S(()=>{if(!f)return[];let O=C.length,U=[];for(let q=0;q<f.length;q++){let ee=f[q],Z=P.categoryScale(q),V=2,j=Math.max(1,(P.barThickness-V*(O-1))/O);for(let H=0;H<ee.values.length;H++){let Y=ee.values[H],K=C.indexOf(Y.category),Q=K*(j+V),ie=P.valueScale(Y.value),J=Dr(K>=0?K:H,Y.color);if(b){let ae=c+Z+Q,le=c+x-ie;U.push(o("rect",{key:`gbar-${q}-${H}`,x:String(ae),y:String(le),width:String(j),height:String(ie),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(q*O+H)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${q}-${H}`,x:String(ae+j/2),y:String(le-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}else{let ae=c,le=c+Z+Q;U.push(o("rect",{key:`gbar-${q}-${H}`,x:String(ae),y:String(le),width:String(ie),height:String(j),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(q*O+H)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${q}-${H}`,x:String(ae+ie+4),y:String(le+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}}if(b){let H=c+Z+P.barThickness/2,Y=c+x+16;U.push(o("text",{key:`gcat-${q}`,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-${q}`,x:String(c-6),y:String(c+Z+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},ee.label))}return U},[f,C,P,l,d,p,b,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]),R=S(()=>p?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},b?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[p,b]),M=B(),N=E(),z=w(),W=R(),_;return D&&y?_=k():D?_=A():_=F(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...W,...z,...M,...N,..._)}function xt(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 jt(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 Gt(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let h=t[u],m=e(h);isFinite(m)&&a.push({input:h,output:m})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),Lr(l)};return Lr(l),()=>{i=!0}}function Lr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function $l(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 Br(e,t){let n=t-e;if(n<=0)return[e];let r=$l(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 Fr(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var Re=40,Nr=1.1,Wr=.01,_r=1e6;function Or(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:h=!0,showAxes:m=!0,pointRadius:c=3,pointColor:p="#3b82f6",curveColor:f="#3b82f6",gridColor:y="#e2e8f0",axisColor:b="#94a3b8",onPointClick:g,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:T}=e,[D,C]=G(d[0]),[$,L]=G(d[1]),[I,P]=G(u[0]),[B,E]=G(u[1]),F=oe(!1),A=oe(null),k=S(Y=>Re+(Y-D)/($-D)*(t-2*Re),[D,$,t]),w=S(Y=>n-Re-(Y-I)/(B-I)*(n-2*Re),[I,B,n]),R=S(Y=>D+(Y-Re)/(t-2*Re)*($-D),[D,$,t]),M=S(Y=>I+(n-Re-Y)/(n-2*Re)*(B-I),[I,B,n]),N=S(Y=>{let K=Y;F.current=!0,A.current={mx:K.clientX,my:K.clientY,x0:D,x1:$,y0:I,y1:B}},[D,$,I,B]),z=S(Y=>{if(!F.current||!A.current)return;let K=Y,Q=A.current,ie=K.clientX-Q.mx,J=K.clientY-Q.my,ae=ie/(t-2*Re)*(Q.x1-Q.x0),le=J/(n-2*Re)*(Q.y1-Q.y0);C(Q.x0-ae),L(Q.x1-ae),P(Q.y0+le),E(Q.y1+le)},[t,n]),W=S(()=>{F.current=!1,A.current=null},[]),_=S(Y=>{let K=Y;K.preventDefault();let Q=K.currentTarget.getBoundingClientRect(),ie=K.clientX-Q.left,J=K.clientY-Q.top,ae=R(ie),le=M(J),pe=K.deltaY>0?Nr:1/Nr,re=($-D)*pe,he=(B-I)*pe;if(re<Wr||he<Wr||re>_r||he>_r)return;let be=(ae-D)/($-D),te=(le-I)/(B-I);C(ae-be*re),L(ae+(1-be)*re),P(le-te*he),E(le+(1-te)*he)},[D,$,I,B,R,M]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let Y=Br(D,$),K=Br(I,B);for(let Q=0;Q<Y.length;Q++){let ie=k(Y[Q]);O.push(o("line",{x1:ie,y1:Re,x2:ie,y2:n-Re,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),O.push(o("text",{x:ie,y:n-Re+14,"text-anchor":"end","font-size":10,fill:b,transform:`rotate(-45, ${ie}, ${n-Re+14})`,key:`lx-${Q}`},Fr(Y[Q])))}for(let Q=0;Q<K.length;Q++){let ie=w(K[Q]);O.push(o("line",{x1:Re,y1:ie,x2:t-Re,y2:ie,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),O.push(o("text",{x:Re-6,y:ie+3,"text-anchor":"end","font-size":10,fill:b,key:`ly-${Q}`},Fr(K[Q])))}}if(m){let Y=Math.max(Re,Math.min(t-Re,k(0))),K=Math.max(Re,Math.min(n-Re,w(0)));O.push(o("line",{x1:Re,y1:K,x2:t-Re,y2:K,stroke:b,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:Y,y1:Re,x2:Y,y2:n-Re,stroke:b,"stroke-width":1,key:"y-axis"}))}let U=X(()=>{if(!i||!l)return[];let Y=a??($-D)/s,K=xt({start:D,end:$,step:Y});return jt(i,K)},[i,D,$,a,s,l]),[q,ee]=G([]),Z=oe(null);se(()=>{if(!i||l){ee([]);return}let Y=a??($-D)/s,K=xt({start:D,end:$,step:Y});return Z.current&&Z.current(),Z.current=Gt(i,K,200,Q=>{ee([...Q])}),()=>{Z.current&&Z.current()}},[i,D,$,a,s,l]);let V=l?U:q;if(V.length>0){let Y=[];for(let K=0;K<V.length;K++){let Q=V[K],ie=k(Q.input),J=w(Q.output);Y.push(`${Y.length===0?"M":"L"}${ie},${J}`)}O.push(o("path",{d:Y.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let j=(Y,K,Q,ie)=>{if(K)return J=>K({x:ie.x,y:ie.y,index:Q,event:J})};for(let Y=0;Y<r.length;Y++){let K=r[Y],Q=k(K.x),ie=w(K.y),J={cx:Q,cy:ie,r:c,fill:p,cursor:"pointer",key:`pt-${Y}`};g&&(J.onClick=j("click",g,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)),O.push(o("circle",J))}let H=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:Re,y:Re,width:t-2*Re,height:n-2*Re})));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:z,onMouseUp:W,onMouseLeave:W,onWheel:_},H,...O)}function Yr(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 Hr(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,h=0,m=0,c=0;return i<60?(h=l,m=d):i<120?(h=d,m=l):i<180?(m=l,c=d):i<240?(m=d,c=l):i<300?(h=d,c=l):(h=l,c=d),[Math.floor((h+u)*255),Math.floor((m+u)*255),Math.floor((c+u)*255)]}function Vr(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Yr){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let h=0;h<e;h++){let m=n[0]+h/e*(n[1]-n[0]);d.push(s(m,u,i))}a.push(d)}return a}function Ur(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=Yr,data:d,resolution:u=2,onPointClick:h,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:p}=e;if(d){let M=d.length,N=M>0?d[0].length:0,z=N>0?t/N:1,W=M>0?n/M:1,_=[];for(let O=0;O<M;O++){let U=d[O];for(let q=0;q<N;q++){let ee=U[q]??0,[Z,V,j]=Hr(ee,s,a);_.push(o("rect",{key:`${O}-${q}`,x:String(q*z),y:String(O*W),width:String(Math.ceil(z)),height:String(Math.ceil(W)),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%"}},..._)}let[f,y]=G(r[0]),[b,g]=G(r[1]),[x,v]=G(i[0]),[T,D]=G(i[1]),C=oe(null),$=oe(!1),L=oe(null),I=S((M,N)=>{let z=f+M/t*(b-f),W=T-N/n*(T-x);return{re:z,im:W}},[f,b,x,T,t,n]);se(()=>{let M=C.current;if(!M)return;let N=M.getContext("2d");if(!N)return;let z=N.createImageData(t,n),W=z.data;for(let _=0;_<n;_++)for(let O=0;O<t;O++){let{re:U,im:q}=I(O,_),ee=l(U,q,s),[Z,V,j]=Hr(ee,s,a),H=(_*t+O)*4;W[H]=Z,W[H+1]=V,W[H+2]=j,W[H+3]=255}N.putImageData(z,0,0)},[f,b,x,T,t,n,s,a,l,I]);let P=S(M=>{let N=M.target.getBoundingClientRect(),z=M.clientX-N.left,W=M.clientY-N.top,{re:_,im:O}=I(z,W),U=l(_,O,s);return{re:_,im:O,iterations:U,event:M}},[I,l,s]),B=S(M=>{$.current=!0,L.current={x:M.clientX,y:M.clientY,rMin:f,rMax:b,iMin:x,iMax:T}},[f,b,x,T]),E=S(M=>{if(m&&m(P(M)),!$.current||!L.current)return;let N=L.current,z=M.clientX-N.x,W=M.clientY-N.y,_=(N.rMax-N.rMin)/t,O=(N.iMax-N.iMin)/n;y(N.rMin-z*_),g(N.rMax-z*_),v(N.iMin+W*O),D(N.iMax+W*O)},[t,n,m,P]),F=S(()=>{$.current=!1},[]),A=S(M=>{M.preventDefault();let N=M.deltaY>0?1.15:1/1.15,z=M.target.getBoundingClientRect(),W=M.clientX-z.left,_=M.clientY-z.top,{re:O,im:U}=I(W,_);y(O+(f-O)*N),g(O+(b-O)*N),v(U+(x-U)*N),D(U+(T-U)*N)},[I,f,b,x,T]),k=S(M=>{h&&h(P(M))},[h,P]),w=S(M=>{c&&c(P(M))},[c,P]),R=S(M=>{M.preventDefault(),p&&p(P(M))},[p,P]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:B,onMouseMove:E,onMouseUp:F,onMouseLeave:F,onWheel:A,onClick:k,onDblClick:w,onContextMenu:R})}function jr(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 Tl(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,h=y=>r+(y-i)/(s-i)*d,m=y=>n-r-(y-a)/(l-a)*u,c=6,p=jr(i,s,c),f=jr(a,l,c);return{xScale:h,yScale:m,xTicks:p,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function wn(e,t,n,r){return X(()=>Tl(e,t,n,r),[e,t,n,r])}function Gr(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Xr(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 qr(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:h=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:p,yLabel:f,title:y,padding:b=50,animate:g=!1,multiLine:x}=e,v=X(()=>{let B=[...t];if(x)for(let E of x)B.push(...E.data);return B},[t,x]),T=wn(v,n,r,b),{xScale:D,yScale:C,xTicks:$,yTicks:L}=T,I=[];if(I.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let B=0;B<$.length;B++){let E=D($[B]);I.push(o("line",{x1:E,y1:b,x2:E,y2:r-b,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${B}`}))}for(let B=0;B<L.length;B++){let E=C(L[B]);I.push(o("line",{x1:b,y1:E,x2:n-b,y2:E,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${B}`}))}}I.push(o("line",{x1:b,y1:r-b,x2:n-b,y2:r-b,stroke:"#374151","stroke-width":1,key:"x-axis"})),I.push(o("line",{x1:b,y1:b,x2:b,y2:r-b,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let B=0;B<$.length;B++){let E=D($[B]);I.push(o("line",{x1:E,y1:r-b,x2:E,y2:r-b+5,stroke:"#374151",key:`xtick-${B}`})),I.push(o("text",{x:E,y:r-b+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${E}, ${r-b+18})`,key:`xlabel-${B}`},Gr($[B])))}for(let B=0;B<L.length;B++){let E=C(L[B]);I.push(o("line",{x1:b-5,y1:E,x2:b,y2:E,stroke:"#374151",key:`ytick-${B}`})),I.push(o("text",{x:b-10,y:E+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${B}`},Gr(L[B])))}function P(B,E,F,A,k,w,R,M,N,z){if(B.length===0)return;let W=[...B].sort((U,q)=>U.x-q.x);if(A){let U=C(T.yMin),q=W.map(j=>`${D(j.x)},${C(j.y)}`).join(" "),ee=D(W[0].x),Z=D(W[W.length-1].x),V=`${ee},${U} ${q} ${Z},${U}`;I.push(o("polygon",{points:V,fill:k,key:`${z}-area`}))}let O={points:W.map(U=>`${D(U.x)},${C(U.y)}`).join(" "),fill:"none",stroke:E,"stroke-width":F,"stroke-linejoin":"round","stroke-linecap":"round",key:`${z}-line`};if(g?(O["stroke-dasharray"]="1000",O["stroke-dashoffset"]="1000",I.push(o("polyline",O,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):I.push(o("polyline",O)),w)for(let U=0;U<W.length;U++){let q=D(W[U].x),ee=C(W[U].y),Z=W[U].shape??N,V=W[U].radius??M,j=`${z}-pt-${U}`;if(g){let H=Xr(Z,q,ee,V,R,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(Xr(Z,q,ee,V,R,j))}}if(P(t,i,s,m,c,u,l,a,d,"primary"),x)for(let B=0;B<x.length;B++){let E=x[B];P(E.data,E.color,s,!1,"transparent",u,E.color,E.pointRadius??a,E.pointShape??d,`series-${B}`)}if(x&&x.length>0){let B=[],E=[{color:i,label:"Primary"},...x.map((_,O)=>({color:_.color,label:_.label??`Series ${O+1}`}))],F=b+10,A=16,k=22,w=7.2,R=14,M=6,N=n-b*2-20,z=0,W=0;for(let _=0;_<E.length;_++){let O=E[_].label.length*w,U=R+M+O;z>0&&z+U>N&&(z=0,W+=k);let q=F+z,ee=b-30-W;B.push(o("rect",{x:q,y:ee,width:R,height:14,fill:E[_].color,rx:2,key:`legend-rect-${_}`})),B.push(o("text",{x:q+R+M,y:ee+12,"font-size":12,fill:"#374151",key:`legend-text-${_}`},E[_].label)),z+=U+A}I.push(o("g",{key:"legend"},...B))}return p&&I.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},p)),f&&I.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},f)),y&&I.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...I)}function zl(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 Dl(e,t){let n=t??zl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function yt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function kn(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=yt(e,t,r,a),u=yt(e,t,r,l),h=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,"Z"].join(" ");let m=yt(e,t,n,l),c=yt(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function Cn(e,t){let n=t?.padAngle??0,r=Dl(e,t?.colors),i=e.reduce((u,h)=>u+h.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let h=e[u],m=h.value/i*a,c=d+n/2,p=c+m;l.push({label:h.label,value:h.value,startAngle:c,endAngle:p,percentage:h.value/i*100,color:r[u]}),d=p+n/2}return l}function Kr(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:h,centerLabel:m,colors:c,strokeColor:p="#fff",strokeWidth:f=2,textColor:y="currentColor"}=e,b=d&&u==="right"?140:0,g=h?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-b,T=r-g-x,D=v/2,C=g+T/2,$=Math.min(v,T)/2-10,L=e.outerRadius??$,I=X(()=>Cn(t,{padAngle:s,colors:c}),[t,s,c]),P=[];h&&P.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},h));for(let B=0;B<I.length;B++){let E=I[B],F=kn(D,C,i,L,E.startAngle,E.endAngle);if(P.push(o("path",{key:`slice-${B}`,d:F,fill:E.color,stroke:p,strokeWidth:f})),a||l){let A=(E.startAngle+E.endAngle)/2,k=E.percentage<5,w=k?L+14:i+(L-i)*.65,R=yt(D,C,w,A-Math.PI/2),M=k?y:"#fff",N=k?11:12,z=[];if(a&&z.push(E.label),l&&z.push(`${E.percentage.toFixed(1)}%`),k){let W=yt(D,C,L+2,A-Math.PI/2);P.push(o("line",{key:`connector-${B}`,x1:W.x,y1:W.y,x2:R.x,y2:R.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${B}`,x:R.x,y:R.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N,fill:M,pointerEvents:"none"},E.label)),l&&P.push(o("text",{key:`value-${B}`,x:R.x,y:R.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N-1,fill:M,pointerEvents:"none"},`${E.percentage.toFixed(1)}%`))}}if(m&&i>0&&P.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 B=[];if(u==="right"){let E=v+10,F=g+20;for(let A=0;A<I.length;A++){let k=I[A],w=F+A*22;B.push(o("circle",{key:`legend-dot-${A}`,cx:E+6,cy:w,r:6,fill:k.color})),B.push(o("text",{key:`legend-text-${A}`,x:E+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let E=r-x+10;for(let F=0;F<I.length;F++){let A=I[F],k=F%2,w=Math.floor(F/2),R=k*(n/2)+10,M=E+w*22;B.push(o("circle",{key:`legend-dot-${F}`,cx:R+6,cy:M,r:6,fill:A.color})),B.push(o("text",{key:`legend-text-${F}`,x:R+18,y:M,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${A.label} (${A.percentage.toFixed(1)}%)`))}}P.push(...B)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function Zr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Jr(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:h=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:p,onPointDoubleClick:f,onPointContextMenu:y,onPointHover:b}=e,[g,x]=G(r[1]),[v,T]=G(0),[D,C]=G(0),[$,L]=G(null),I=t/2+v,P=n/2+D,E=Math.min(t,n)/2-30,F=E/g,A=X(()=>{let V=Math.max(1,Math.ceil(g)),j=[],H=g/V;for(let Y=1;Y<=V;Y++)j.push(H*Y);return j},[g]),k=X(()=>{let V=[];for(let j=0;j<360;j+=30)V.push(j*Math.PI/180);return V},[]),w=X(()=>{if(!i||!l)return[];let V=a??2*Math.PI/s,j=xt({start:0,end:2*Math.PI,step:V});return jt(i,j)},[i,s,a,l]),[R,M]=G([]),N=oe(null);se(()=>{if(!i||l){M([]);return}let V=a??2*Math.PI/s,j=xt({start:0,end:2*Math.PI,step:V});return N.current&&N.current(),N.current=Gt(i,j,200,H=>{M([...H])}),()=>{N.current&&N.current()}},[i,s,a,l]);let z=l?w:R,W=X(()=>{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}=Zr(Y,H.input,I,P,F);V.push(`${V.length===0?"M":"L"}${K.toFixed(2)},${Q.toFixed(2)}`)}return V.join(" ")},[z,I,P,F]),_=S(V=>{L({x:V.clientX,y:V.clientY,px:v,py:D})},[v,D]),O=S(V=>{$&&(T($.px+(V.clientX-$.x)),C($.py+(V.clientY-$.y)))},[$]),U=S(()=>{L(null)},[]),q=S(V=>{V.preventDefault();let j=V.deltaY>0?1.15:1/1.15;x(Math.max(.1,g*j))},[g]),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]*F;Z.push(o("circle",{cx:I,cy:P,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${V}`})),Z.push(o("text",{x:I+j+2,y:P-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]*F,Y=I+H*Math.cos(j),K=P-H*Math.sin(j);Z.push(o("line",{x1:I,y1:P,x2:Y,y2:K,stroke:"#e5e7eb","stroke-width":1,key:`al-${V}`}));let Q=Math.round(j*180/Math.PI),ie=I+(H+14)*Math.cos(j),J=P-(H+14)*Math.sin(j);Z.push(o("text",{x:ie,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${V}`},`${Q}\xB0`))}}Z.push(o("line",{x1:I-E,y1:P,x2:I+E,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),Z.push(o("line",{x1:I,y1:P-E,x2:I,y2:P+E,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),W&&Z.push(o("path",{d:W,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}=Zr(j.r,j.theta,I,P,F);Z.push(o("circle",{cx:H,cy:Y,r:h,fill:m,key:`pt-${V}`,style:{cursor:"pointer"},onClick:ee(p,j,V),onDblClick:ee(f,j,V),onContextMenu:ee(y,j,V),onMouseEnter:ee(b,j,V)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:$?"grabbing":"grab"},onMouseDown:_,onMouseMove:O,onMouseUp:U,onMouseLeave:U,onWheel:q},...Z)}function Mn(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 En(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 In(e,t){let n=Qr(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 Qr(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=Qr(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 Rn(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 Pn(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 It(e,t=[],n=.3,r=1){let i=Mn(e),s=En(e),a=In(e,t);return{vertices:i.map((d,u)=>{let h=Rn(a,d),m=Pn(h,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 Xt(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 ei(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,h=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=Rt(t),p=1<<t,f=X(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Xt(p):e.vertexColors,[p,e.vertexColors]),[y,b]=G(()=>{let M=[];for(let N=0;N<c;N++)M.push(0);return M}),[g,x]=G(!1),v=oe({x:0,y:0}),T=oe([]),D=oe(0);se(()=>{if(d===0)return;let M=!0,N=()=>{M&&(b(z=>{let W=z.slice();for(let _=0;_<W.length;_++)W[_]=(W[_]??0)+d*(1+_*.3);return W}),D.current=requestAnimationFrame(N))};return D.current=requestAnimationFrame(N),()=>{M=!1,cancelAnimationFrame(D.current)}},[d]);let C=X(()=>It(t,y,l,m),[t,y,l,m]),$=n/2,L=r/2,I=X(()=>C.edges.map(M=>{let N=C.vertices[M.source],z=C.vertices[M.target],W=(N.depth+z.depth)/2;return{...M,avgDepth:W,sv:N,tv:z}}).sort((M,N)=>M.avgDepth-N.avgDepth),[C]),P=X(()=>C.vertices.slice().sort((M,N)=>M.depth-N.depth),[C]),B=S(M=>{let N=M;x(!0),v.current={x:N.clientX,y:N.clientY},T.current=y.slice()},[y]),E=S(M=>{if(!g)return;let N=M,z=(N.clientX-v.current.x)*.01,W=(N.clientY-v.current.y)*.01;b(()=>{let _=T.current.slice();return _.length>0&&(_[0]=(_[0]??0)+z),_.length>1&&(_[1]=(_[1]??0)+W),_})},[g]),F=S(()=>{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=I.map((M,N)=>{let z=A(M.avgDepth);return o("line",{key:`e-${M.source}-${M.target}`,x1:String($+M.sv.x),y1:String(L+M.sv.y),x2:String($+M.tv.x),y2:String(L+M.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(z),"stroke-linecap":"round"})}),R=P.map(M=>{let N=i*k(M.depth),z=f[M.id%f.length]??"#3b82f6",W=[o("circle",{key:`v-${M.id}-circle`,cx:String($+M.x),cy:String(L+M.y),r:String(N),fill:z,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&W.push(o("text",{key:`v-${M.id}-label`,x:String($+M.x),y:String(L+M.y+N+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},M.id.toString(2).padStart(t,"0"))),W});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:g?"grabbing":"grab",userSelect:"none"},onMouseDown:B,onMouseMove:E,onMouseUp:F,onMouseLeave:F},...w,...R.flat())}function ti(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=Rt(t),[a,l]=G(()=>new Array(s).fill(0));return se(()=>{if(n===0)return;let u=!0,h=0,m=()=>{u&&(l(c=>c.map((p,f)=>p+n*(1+f*.3))),h=requestAnimationFrame(m))};return h=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:X(()=>It(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function ni(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:Bl(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?Nl(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,h=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=Fl(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function Bl(e,t){return"column"}function Fl(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 Nl(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"}},Wl(n),o("span",null,n.label))))}function Wl(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 _l(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 Ol(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function oi(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return se(()=>{if(n||typeof window>"u")return;_l(t),Ol();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 ri(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:h,ariaLabel:m="Site footer"}=e;return o("footer",{className:h,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 ai=Ye({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),Hl={width:600,height:400},Yl={x:30,y:30},Vl={top:0,left:0,width:1920,height:1080},$n=1e3;function ii(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 Tn(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 si(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 zn(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function Dn(e){let t=e.workspaceBounds??Vl,n=e.defaultWindowSize??Hl,r=e.cascadeOffset??Yl,[i,s]=G([]),a=S(((...B)=>{let E=B[0];s(F=>{if(F.find(W=>W.id===E.id)){let _=zn(F)+1,O=F.map(U=>U.id===E.id?{...U,focused:!0,zIndex:_,windowState:U.windowState==="minimized"?"normal":U.windowState}:{...U,focused:!1});return _>$n&&(O=Tn(O)),O}let k=E.size??n,w=E.position??ii(F.length,r,t,k),M=zn(F)+1,N={id:E.id,title:E.title,icon:E.icon,position:w,size:k,windowState:"normal",zIndex:M,focused:!0,appProps:E.appProps},z=F.map(W=>({...W,focused:!1}));return z.push(N),M>$n&&(z=Tn(z)),e.onWindowOpen&&e.onWindowOpen(E.id),e.onFocusChange&&e.onFocusChange(E.id),z})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=S(((...B)=>{let E=B[0];v(F=>{if(F[E]){let A={...F};return delete A[E],A}return F}),D(F=>{if(F.has(E)){let A=new Map(F);return A.delete(E),A}return F}),s(F=>{let A=F.find(w=>w.id===E);if(!A)return F;let k=F.filter(w=>w.id!==E);if(A.focused&&k.length>0){let w=si(k,E);if(w){let R=k.map(M=>({...M,focused:M.id===w.id}));return e.onWindowClose&&e.onWindowClose(E),e.onFocusChange&&e.onFocusChange(w.id),R}}return e.onWindowClose&&e.onWindowClose(E),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=S(((...B)=>{let E=B[0];s(F=>{if(!F.find(M=>M.id===E))return F;let w=zn(F)+1,R=F.map(M=>M.id===E?{...M,focused:!0,zIndex:w}:{...M,focused:!1});return w>$n&&(R=Tn(R)),e.onFocusChange&&e.onFocusChange(E),R})}),[e.onFocusChange]),u=S(((...B)=>{let E=B[0];s(F=>{let A=F.find(w=>w.id===E);if(!A)return F;let k=F.map(w=>w.id===E?{...w,windowState:"minimized",focused:!1}:w);if(A.focused){let w=si(k,E);w?(k=k.map(R=>({...R,focused:R.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),h=S(((...B)=>{let E=B[0];s(F=>F.map(A=>A.id===E?{...A,windowState:"maximized"}:A))}),[]),m=S(((...B)=>{let E=B[0];s(F=>F.map(A=>A.id===E?{...A,windowState:"normal"}:A))}),[]),c=S(((...B)=>{let E=B[0],F=B[1];s(A=>A.map(k=>k.id===E?{...k,position:F}:k))}),[]),p=S(((...B)=>{let E=B[0],F=B[1];s(A=>A.map(k=>k.id===E?{...k,size:F}:k))}),[]),f=S(((...B)=>{s(E=>{let F=E.filter(w=>w.windowState!=="minimized");if(F.length===0)return E;let A=F.length,k=new Map;if(A===1)k.set(F[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(F[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(F[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),R=Math.floor(t.height/2);k.set(F[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(F[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:R}}),k.set(F[2].id,{position:{x:t.left+w,y:t.top+R},size:{width:t.width-w,height:t.height-R}})}else{let w=Math.ceil(Math.sqrt(A)),R=Math.ceil(A/w),M=Math.floor(t.width/w),N=Math.floor(t.height/R);for(let z=0;z<F.length;z++){let W=Math.floor(z/w),_=z%w;k.set(F[z].id,{position:{x:t.left+_*M,y:t.top+W*N},size:{width:M,height:N}})}}return E.map(w=>{let R=k.get(w.id);return R?{...w,position:R.position,size:R.size,windowState:"normal"}:w})})}),[t]),y=S(((...B)=>{s(E=>{let F=E.filter(w=>w.windowState!=="minimized");if(F.length===0)return E;let A=[...F].sort((w,R)=>w.zIndex-R.zIndex),k=new Map;for(let w=0;w<A.length;w++){let R=ii(w,r,t,A[w].size);k.set(A[w].id,{position:R,zIndex:w+1})}return E.map(w=>{let R=k.get(w.id);return R?{...w,position:R.position,zIndex:R.zIndex,windowState:"normal"}:w})})}),[r,t]),b=S(((...B)=>{s(E=>{let F=E.map(A=>({...A,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),F})}),[e.onFocusChange]),g=X(()=>{let B=i.find(E=>E.focused);return B?B.id:null},[i]),[x,v]=G({}),[T,D]=G(new Map),C=S(((...B)=>{let E=B[0],F=B[1];v(A=>({...A,[E]:F}))}),[]),$=S(((...B)=>{let E=B[0];v(F=>{let A={...F};return delete A[E],A})}),[]),L=X(()=>g&&x[g]?x[g]:null,[g,x]),I=S(((...B)=>{let E=B[0],F=B[1];D(A=>{let k=new Map(A),w=k.get(E);return k.set(E,{...w,...F}),k})}),[]),P=X(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:m,moveWindow:c,resizeWindow:p,tileWindows:f,cascadeWindows:y,minimizeAll:b,focusedWindowId:g,setMenuBar:C,clearMenuBar:$,activeMenuBar:L,signalDock:I,dockSignals:T}),[i,a,l,d,u,h,m,c,p,f,y,b,g,C,$,L,I,T]);return o(ai.Provider,{value:P},e.children)}function Pt(){return _e(ai)}var li=Ye({appId:""});function tt(e){let t=X(()=>({appId:e.appId}),[e.appId]);return o(li.Provider,{value:t},e.children)}function St(){return _e(li).appId}var ci=Ye({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function $t(e){let t=oe([]),n=oe([]),r=S(((...l)=>{let d=l[0],u=l[1],h=l[2],m=l[3]||"",c={channel:d,from:m,to:h||null,payload:u,timestamp:Date.now()},p=t.current;for(let y=0;y<p.length;y++){let b=p[y];b.channel===d&&(c.to&&b.appId!==c.to||!c.to&&b.appId===m||b.handler(c))}let f=n.current;for(let y=0;y<f.length;y++)f[y].handler(c)}),[]),i=S(((...l)=>{let d=l[0],u=l[1],h=l[2]||"",m={channel:d,handler:u,appId:h};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(h=>h!==u)}}),[]),a=X(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(ci.Provider,{value:a},e.children)}function nt(){let e=_e(ci),t=St(),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 X(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function Tt(e,t){let n=nt(),r=oe(t);r.current=t,se(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var di=Ye({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function zt(e){let[t,n]=G(null),[r,i]=G({x:0,y:0}),s=oe(new Map),a=oe(null),l=t!==null,d=S(((...p)=>{let f=p[0];n(f)}),[]),u=S(((...p)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),h=S(((...p)=>{let f=p[0],y=p[1];return s.current=new Map(s.current),s.current.set(f,y),()=>{s.current=new Map(s.current),s.current.delete(f),a.current===f&&(a.current=null)}}),[]);se(()=>{if(!l)return;let p=b=>{let g=b;i({x:g.clientX,y:g.clientY});let x=document.elementFromPoint(g.clientX,g.clientY);if(!x)return;let v=null,T=s.current;T.forEach((C,$)=>{let L=document.querySelector(`[data-dropzone-id="${$}"]`);L&&L.contains(x)&&(v=$)});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}},f=b=>{let g=a.current;if(g&&t){let x=s.current.get(g);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},y=b=>{b.key==="Escape"&&u()};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",y)}},[l,t,u]);let m=X(()=>({startDrag:d,cancelDrag:u,registerDropZone:h,currentDrag:t,isDragging:l}),[d,u,h,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(di.Provider,{value:m},e.children,c)}function ct(){return _e(di)}function An(e,t){let n=ct(),r=St(),i=oe(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 X(()=>({onMouseDown:s,isDragging:a}),[s,a])}function Dt(e){let t=ct(),[n,r]=G(!1),i=oe(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=oe(e);s.current=e,se(()=>t.registerDropZone(i.current,{acceptTypes:s.current.acceptTypes,onDragEnter: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 Ul=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],jl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ln(e){return e<10?"0"+String(e):String(e)}function Gl(e,t,n){let r=e.getHours(),i=Ln(e.getMinutes()),s=Ln(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=Ln(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function Xl(e){let t=Ul[e.getDay()],n=jl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function ql(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=De(),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 Kl(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=G(new Date);se(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=X(()=>Gl(i,t,n),[i,t,n]),l=X(()=>Xl(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 Zl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=De(),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 Jl(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=De();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 Ql(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=De(),[a,l]=G(!1),d=oe(null),u=S(()=>{l(b=>!b)},[]),h=S(()=>{l(!1)},[]),m=S(b=>{let g=b;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l(x=>!x)),g.key==="Escape"&&l(!1)},[]);se(()=>{if(!a)return;let b=g=>{let x=d.current;x&&!x.contains(g.target)&&l(!1)};return document.addEventListener("click",b,!0),()=>{document.removeEventListener("click",b,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},p=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),f=o("span",{style:c,"aria-hidden":"true"},p),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((b,g)=>o(Jl,{key:String(g),item:b,onClose:h}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown: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 ec(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=De(),[s,a]=G(!1),l=oe(null),d=S(()=>{a(c=>!c)},[]),u=S(()=>{a(!1)},[]),h=S(c=>{let p=c;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a(f=>!f)),p.key==="Escape"&&a(!1)},[]);se(()=>{if(!s)return;let c=p=>{let f=l.current;f&&!f.contains(p.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let m=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...t.items.map((c,p)=>c.divider?o("div",{key:"div-"+String(p),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(p),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),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:h,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 Bn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:h=28,children:m}=e,c=String(h)+"px",p=[];if(n&&p.push(o(ql,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let v=0;v<r.menus.length;v++)p.push(o(ec,{key:"appmenu-"+String(v),menu:r.menus[v]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),y=[];y.push(o(Kl,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let b=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),g=[];if(l&&l.length>0){let v=l.map(T=>o(Zl,{key:T.id,indicator:T}));g.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&g.push(o(Ql,{key:"user",user:d,menuItems:u}));let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...g);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},f,b,x)}function tc(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var ui=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function nc(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return ui[Math.abs(t)%ui.length]}function oc(e){return e>99?"99+":String(e)}function rc(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function ic(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 sc(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 ac(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=G(!1),u=t.disabled??!1,h=S(()=>{u||d(!0)},[u]),m=S(()=>{d(!1)},[]),c=S(()=>{!u&&s&&s(t.id)},[u,s,t.id]),p=S(D=>{if(!u&&a){let C=D;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),f=`${n}px`,y=tc(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:nc(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),b=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"},oc(t.badge)):null,g=t.active?o("span",{style:{...sc(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",...ic(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":rc(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:p,onMouseEnter:h,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,b,g,x,v)}function Fn(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[h,m]=G(!s),c=oe(null),p=S(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),m(!0))},[s]),f=S(()=>{s&&(c.current=setTimeout(()=>{m(!1)},300))},[s]),y=S(T=>{let D=T,C=D.target,$=C.closest('[role="toolbar"]');if(!$)return;let L=Array.from($.querySelectorAll("button[data-dock-item-id]")),I=L.indexOf(C);if(I<0)return;let P=n==="vertical",B=P?"ArrowDown":"ArrowRight",E=P?"ArrowUp":"ArrowLeft";if(D.key===B){D.preventDefault();let F=L[I+1];F&&F.focus()}else if(D.key===E){D.preventDefault();let F=L[I-1];F&&F.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]),b=n==="vertical",g={display:"flex",flexDirection:b?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!h&&(r==="left"?(g.transform="translateX(-100%)",g.opacity="0"):r==="right"?(g.transform="translateX(100%)",g.opacity="0"):r==="top"?(g.transform="translateY(-100%)",g.opacity="0"):r==="bottom"&&(g.transform="translateY(100%)",g.opacity="0"));let x=[];for(let T=0;T<t.length;T++){if(a&&T===t.length-1&&t.length>1){let D=b?{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(ac,{key:t[T].id,item:t[T],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let v=s&&!h?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:g,onMouseEnter:p,onMouseLeave:f,onKeyDown:y},v,...x,u??null)}var lc="#2c001e";function Nn(e){let{backgroundColor:t=lc,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,h=S(g=>{let x=g;x.target===x.currentTarget&&a&&a()},[a]),m=S(g=>{let x=g;x.target===x.currentTarget&&l&&l()},[l]),c=X(()=>{let g={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return g.backgroundColor=t,n&&(g.background=n),r&&i>=1&&(g.backgroundImage=`url(${r})`,g.backgroundSize="cover",g.backgroundPosition="center"),g},[t,n,r,i]),p=X(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),f={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];p&&y.push(o("div",{className:"desktop-background__image-overlay",style:p,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:f},u));let b=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(Ut,{items:s},b):b}var cc={width:200,height:150},dc={x:50,y:50},uc={width:400,height:300},Ae=8,Wn=20,pc={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 At(e){let{id:t,title:n,icon:r,defaultPosition:i=dc,defaultSize:s=uc,minSize:a=cc,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:m=!0,zIndex:c,onClose:p,onMinimize:f,onMaximize:y,onFocus:b,onMove:g,onResize:x,children:v}=e,[T,D]=G(i.x),[C,$]=G(i.y),[L,I]=G(s.width),[P,B]=G(s.height),[E,F]=G(!1),[A,k]=G(!1),[w,R]=G(null),M=oe(null),N=oe(null),z=oe(null),W=S((re,he)=>{let be=Math.max(re,a.width),te=Math.max(he,a.height);return l&&(be=Math.min(be,l.width),te=Math.min(te,l.height)),{width:be,height:te}},[a,l]),_=S(()=>{let re=z.current;return re&&re.parentElement?{width:re.parentElement.clientWidth,height:re.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),O=S((re,he,be,te)=>{let ce=_(),me=Math.max(0,Math.min(re,ce.width-be)),Se=Math.max(0,Math.min(he,ce.height-te));return{x:me,y:Se}},[_]),U=S(re=>{if(!u||h==="maximized")return;let he=re;he.target.closest("button")||(he.preventDefault(),M.current={startMouseX:he.clientX,startMouseY:he.clientY,startPosX:T,startPosY:C},F(!0))},[u,h,T,C]),q=S(re=>{re.target.closest("button")||y&&y()},[y]);se(()=>{if(!E)return;let re=be=>{let te=be,ce=M.current;if(!ce)return;let me=te.clientX-ce.startMouseX,Se=te.clientY-ce.startMouseY,de=ce.startPosX+me,fe=ce.startPosY+Se,ne=_();de=Math.max(0,Math.min(de,ne.width-L)),fe=Math.max(0,Math.min(fe,ne.height-P)),D(de),$(fe),te.clientX<=Wn?R("left"):te.clientX>=ne.width-Wn?R("right"):te.clientY<=Wn?R("top"):R(null)},he=be=>{let te=be;F(!1);let ce=_();if(w==="left"){D(0),$(0),I(Math.floor(ce.width/2)),B(ce.height),R(null),g&&g({x:0,y:0}),x&&x({width:Math.floor(ce.width/2),height:ce.height});return}if(w==="right"){let Se=Math.floor(ce.width/2);D(Se),$(0),I(Se),B(ce.height),R(null),g&&g({x:Se,y:0}),x&&x({width:Se,height:ce.height});return}if(w==="top"){R(null),y&&y();return}R(null);let me=M.current;if(me&&g){let Se=te.clientX-me.startMouseX,de=te.clientY-me.startMouseY,fe=me.startPosX+Se,ne=me.startPosY+de;fe=Math.max(0,Math.min(fe,ce.width-L)),ne=Math.max(0,Math.min(ne,ce.height-P)),g({x:fe,y:ne})}M.current=null};return document.addEventListener("mousemove",re),document.addEventListener("mouseup",he),()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",he)}},[E,w,L,P,_,g,x,y]);let ee=S(re=>he=>{if(!d||h!=="normal")return;let be=he;be.preventDefault(),be.stopPropagation(),N.current={direction:re,startMouseX:be.clientX,startMouseY:be.clientY,startPosX:T,startPosY:C,startWidth:L,startHeight:P},k(!0)},[d,h,T,C,L,P]);se(()=>{if(!A)return;let re=be=>{let te=be,ce=N.current;if(!ce)return;let me=te.clientX-ce.startMouseX,Se=te.clientY-ce.startMouseY,de=ce.direction,fe=ce.startWidth,ne=ce.startHeight,ue=ce.startPosX,xe=ce.startPosY;de.includes("e")&&(fe=ce.startWidth+me),de.includes("w")&&(fe=ce.startWidth-me,ue=ce.startPosX+me),de.includes("s")&&(ne=ce.startHeight+Se),de.includes("n")&&(ne=ce.startHeight-Se,xe=ce.startPosY+Se);let ye=W(fe,ne);de.includes("w")&&(ue=ce.startPosX+(ce.startWidth-ye.width)),de.includes("n")&&(xe=ce.startPosY+(ce.startHeight-ye.height)),I(ye.width),B(ye.height),D(ue),$(xe)},he=()=>{k(!1),x&&x({width:L,height:P}),N.current=null};return document.addEventListener("mousemove",re),document.addEventListener("mouseup",he),()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",he)}},[A,L,P,W,x]),se(()=>{if(!m||!p)return;let re=he=>{he.key==="Escape"&&p()};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[m,p]);let Z=S(re=>{b&&b()},[b]);if(h==="minimized")return null;let V=h==="maximized",j=X(()=>{let re={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?(re.top="0",re.left="0",re.width="100%",re.height="100%"):(re.top=`${C}px`,re.left=`${T}px`,re.width=`${L}px`,re.height=`${P}px`),c!==void 0&&(re.zIndex=String(c)),E&&(re.cursor="grabbing",re.userSelect="none"),re},[V,T,C,L,P,c,m,E]),H=X(()=>{let re={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 E&&(re.cursor="grabbing"),re},[m,u,V,E]),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 ie=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...K,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:re=>{re.stopPropagation(),f&&f()}}),o("button",{type:"button","aria-label":V?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...K,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:re=>{re.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...K,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:re=>{re.stopPropagation(),p&&p()}}));Q.push(ie);let J=[];if(d&&!V){let re=["n","s","e","w","ne","nw","se","sw"];for(let he=0;he<re.length;he++){let be=re[he],te={position:"absolute",zIndex:"1"};be==="n"?(te.top="0",te.left=`${Ae}px`,te.right=`${Ae}px`,te.height=`${Ae}px`):be==="s"?(te.bottom="0",te.left=`${Ae}px`,te.right=`${Ae}px`,te.height=`${Ae}px`):be==="e"?(te.top=`${Ae}px`,te.right="0",te.bottom=`${Ae}px`,te.width=`${Ae}px`):be==="w"?(te.top=`${Ae}px`,te.left="0",te.bottom=`${Ae}px`,te.width=`${Ae}px`):be==="ne"?(te.top="0",te.right="0",te.width=`${Ae}px`,te.height=`${Ae}px`):be==="nw"?(te.top="0",te.left="0",te.width=`${Ae}px`,te.height=`${Ae}px`):be==="se"?(te.bottom="0",te.right="0",te.width=`${Ae}px`,te.height=`${Ae}px`):be==="sw"&&(te.bottom="0",te.left="0",te.width=`${Ae}px`,te.height=`${Ae}px`),te.cursor=pc[be],J.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${be}`,style:te,onMouseDown:ee(be)}))}}let ae=null;if(w){let re={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"?(re.top="0",re.left="0",re.width="50%",re.height="100%"):w==="right"?(re.top="0",re.right="0",re.width="50%",re.height="100%"):w==="top"&&(re.top="0",re.left="0",re.width="100%",re.height="100%"),ae=o("div",{className:"draggable-window__snap-preview",style:re})}let le=[];for(let re=0;re<J.length;re++)le.push(J[re]);le.push(o("div",{className:"draggable-window__title-bar",style:H,onMouseDown:U,onDblClick:q,role:"toolbar","aria-label":`${n} window controls`},...Q)),le.push(o("div",{className:"draggable-window__body",style:Y},v));let pe=[o("div",{ref:z,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:Z},...le)];return ae&&pe.push(ae),pe.length===1?pe[0]:o("div",{style:{display:"contents"}},...pe)}var fc=["File","Edit","View","Insert","Format","Tools","Help"],pi={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"}]},gc=[{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"}}],mc=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],hc=["1","2","3","4","5","6","7"],bc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function xc(){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 fi(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function qt(e){let[t,n]=G(!1),[r,i]=G(!1),[s,a]=G(!1),[l,d]=G(-1),[u,h]=G(""),[m,c]=G(-1),[p,f]=G(0),[y,b]=G("3"),g=oe(null),x=S(()=>{document.execCommand("bold",!1),n(Y=>!Y),g.current&&g.current.focus()},[]),v=S(()=>{document.execCommand("italic",!1),i(Y=>!Y),g.current&&g.current.focus()},[]),T=S(()=>{document.execCommand("underline",!1),a(Y=>!Y),g.current&&g.current.focus()},[]),D={bold:x,italic:v,underline:T},C={bold:t,italic:r,underline:s},$=S(Y=>{document.execCommand(Y,!1),g.current&&g.current.focus()},[]),L=S(Y=>{document.execCommand("fontSize",!1,Y),b(Y),g.current&&g.current.focus()},[]),I=S(Y=>{c(K=>K===Y?-1:Y)},[]),P=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":g.current&&(g.current.innerHTML="",f(0));break;default:break}c(-1),g.current&&g.current.focus()},[]),B=S(()=>{if(g.current){let Y=g.current.textContent??"";f(fi(Y))}},[]),E=S(()=>{c(-1)},[]),F=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"},R={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"},z=X(()=>xc(),[]),W=e.content??"Start typing...",_=fi(W),O=p>0?p:_;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 q={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},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=fc.map((Y,K)=>{let Q=[Y];return m===K&&pi[Y]&&Q.push(o("div",{key:"dropdown",style:q,className:"word-processor__menu-dropdown"},...pi[Y].map((ie,J)=>o("button",{key:String(J),style:ee,onClick:ae=>{ae.stopPropagation(),P(ie.action)},role:"menuitem"},ie.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:F},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"}},...gc.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:()=>h(Y.id),onMouseLeave:()=>h("")},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)}},...hc.map(Y=>o("option",{key:Y,value:Y},bc[Y])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...mc.map((Y,K)=>o("button",{key:String(K),style:Z(`align-${K}`),title:Y.label,"aria-label":Y.label,onClick:()=>$(Y.command),onMouseEnter:()=>h(`align-${K}`),onMouseLeave:()=>h("")},Y.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...z),o("main",{className:"word-processor__document-area",style:R,onClick:E},o("div",{className:"word-processor__page",style:M,contentEditable:"true",ref:g,onInput:B,suppressContentEditableWarning:!0},W)),o("div",{className:"word-processor__status-bar",style:N},o("span",null,"Page 1 of 1"),o("span",null,`${O} words`),o("span",null,"100%")))}var yc=["File","Edit","Selection","View","Go","Run","Terminal","Help"],gi={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"}]},mi=[{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}],On={"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"]',"}"]},hi=On["App.ts"],Sc=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"]),vc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),bi="#569cd6",wc="#ce9178",kc="#4ec9b0",Cc="#6a9955",Mc="#dcdcaa",_n="#d4d4d4",Ec="#d4d4d4",Ic="#b5cea8";function Rc(e){if(!e.trim())return[{text:"\xA0",color:_n}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:Cc});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:wc}),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:Ic}),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=_n;Sc.has(i)?l=bi:vc.has(i)?l=kc:a?l=Mc:(i==="true"||i==="false")&&(l=bi),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:_n}),n=r;continue}t.push({text:e[n],color:Ec}),n++}return t}function Kt(e){let[t,n]=G("App.ts"),[r,i]=G({src:!0,components:!0,hooks:!0}),[s,a]=G(-1),[l,d]=G(hi.length),u=oe(null),h=S(H=>{n(H);let Y=On[H];Y&&d(Y.length)},[]),m=S(H=>{i(Y=>{let K={},Q=Object.keys(Y);for(let ie=0;ie<Q.length;ie++)K[Q[ie]]=Y[Q[ie]];return K[H]=!Y[H],K})},[]),c=S(H=>{a(Y=>Y===H?-1:H)},[]),p=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()},[]),f=S(()=>{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"}),[]),b={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},g={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},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"},$={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},L={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},I={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},P=(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"}),B={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},E={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},F={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"},R={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"},z=8,W=30,_=On[t]??hi,O=_.map((H,Y)=>{let K=Rc(H),Q=[],ie=0;for(let J of K)Q.push(o("span",{key:String(ie++),style:{color:J.color}},J.text));return o("div",{key:String(Y),style:{minHeight:"20px"}},...Q)}),U=Math.max(l,_.length),q=[];for(let H=0;H<U;H++)q.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=mi.find(K=>K.name===H.parent&&K.isFolder);return Y?ee(Y):!0},Z=yc.map((H,Y)=>{let K=[H],Q=s===Y;return Q&&gi[H]&&K.push(o("div",{key:"dropdown",style:T,className:"ide__menu-dropdown"},...gi[H].map((ie,J)=>o("button",{key:String(J),style:D,onClick:ae=>{ae.stopPropagation(),p(ie.action)},role:"menuitem"},ie.label)))),o("button",{key:String(Y),style:Q?v:x,role:"menuitem","aria-label":H,onClick:()=>c(Y)},...K)}),j=mi.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:P(H.indent,H.isFolder,K),onClick:H.isFolder?()=>m(H.name):()=>h(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:b},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:g,role:"menubar"},...Z),o("div",{style:C},o("nav",{className:"ide__sidebar",style:$,"aria-label":"File explorer"},o("div",{style:I},"Explorer"),...j),o("div",{style:L}),o("div",{style:B},o("div",{style:E},o("button",{style:F,"aria-label":t},t)),o("div",{style:A},o("div",{style:k,"aria-hidden":"true"},...q),o("code",{style:w,contentEditable:"true",ref:u,onInput:f,suppressContentEditableWarning:!0},...O))),o("div",{className:"ide__minimap",style:R,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${z}px`,left:"0",right:"0",height:`${W}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),..._.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: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 Pc=[{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]}],xi=[{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}],yi=[{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}],Si=[{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}],$c=[{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}],Tc=[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],vi=[{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}],wi=[{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}],ki=["09:30","10:00","10:30","11:00","11:30","12:00"];function zc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Lt(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Ue(e){return e.toFixed(2)}var vt={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},wt={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Zt={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Fe={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},Ne={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},Jt={cursor:"default",transition:"background-color 0.1s"};function Dc(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,h)=>{let m=h/(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),h=Math.max(...e),m=h-u||1,c=310/(e.length-1),p=e.map((C,$)=>{let L=40+$*c,I=15+(1-(C-u)/m)*120;return{x:L,y:I}}),f=p.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+p.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${p[p.length-1].x.toFixed(1)},135 Z`,b=[];for(let C=1;C<e.length;C++){let $=e[C]>=e[C-1]?"#00c853":"#ff1744";b.push(o("line",{key:String(C),x1:String(p[C-1].x.toFixed(1)),y1:String(p[C-1].y.toFixed(1)),x2:String(p[C].x.toFixed(1)),y2:String(p[C].y.toFixed(1)),stroke:$,strokeWidth:"2",strokeLinecap:"round"}))}let g=[];for(let C=0;C<5;C++){let $=15+C/4*120,L=h-C/4*m;g.push(o("line",{key:`g${C}`,x1:String(40),y1:String($.toFixed(1)),x2:String(350),y2:String($.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),g.push(o("text",{key:`yl${C}`,x:String(36),y:String(($+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Ue(L)))}let x=[],v=Math.min(ki.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"},ki[C]))}let D="chartGrad";return o("div",{style:vt},o("div",{style:wt},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Ue(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})`}),...g,...x,...b,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(...xi.map(t=>t.qty),...yi.map(t=>t.qty));return o("div",{style:vt},o("div",{style:wt},"Order Book"),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Fe},"Bid Price"),o("th",{style:Fe},"Qty"),o("th",{style:Fe},"Ask Price"),o("th",{style:Fe},"Qty"))),o("tbody",null,...xi.map((t,n)=>{let r=yi[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:Jt},o("td",{style:{...Ne,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Ue(t.price)),o("td",{style:{...Ne,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Lt(t.qty)),o("td",{style:{...Ne,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Ue(r.price):""),o("td",{style:{...Ne,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Lt(r.qty):""))}))))}function Bc(e){return o("div",{style:vt},o("div",{style:wt},"Watchlist"),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Fe},"Symbol"),o("th",{style:Fe},"Price"),o("th",{style:Fe},"Chg%"),o("th",{style:Fe},"Volume"))),o("tbody",null,...Pc.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:Jt},o("td",{style:{...Ne,fontWeight:"600",color:"#ffffff"}},t.symbol,Dc(t.spark,i)),o("td",{style:{...Ne,fontFamily:"monospace"}},Ue(r)),o("td",{style:{...Ne,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Ue(t.change)}%`),o("td",{style:{...Ne,fontFamily:"monospace",color:"#8888aa"}},zc(t.volume)))}))))}function Fc(){let e=Si.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:vt},o("div",{style:wt},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Ue(e)}`)),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Fe},"Symbol"),o("th",{style:Fe},"Qty"),o("th",{style:Fe},"Avg"),o("th",{style:Fe},"P&L"))),o("tbody",null,...Si.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...Jt,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...Ne,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...Ne,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...Ne,fontFamily:"monospace"}},Ue(n.avgPrice)),o("td",{style:{...Ne,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Ue(n.pnl)}`))}))))}function Nc(){return o("div",{style:vt},o("div",{style:wt},"Recent Trades"),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Fe},"Time"),o("th",{style:Fe},"Sym"),o("th",{style:Fe},"Side"),o("th",{style:Fe},"Qty"),o("th",{style:Fe},"Price"))),o("tbody",null,...$c.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:Jt},o("td",{style:{...Ne,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...Ne,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...Ne,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...Ne,fontFamily:"monospace"}},Lt(e.qty)),o("td",{style:{...Ne,fontFamily:"monospace"}},Ue(e.price)))}))))}function Wc(){let e=Math.max(...vi.map(n=>n.volume),...wi.map(n=>n.volume)),t="16px";return o("div",{style:vt},o("div",{style:wt},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...vi.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"}},Ue(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"}},Lt(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...wi.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"}},Ue(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"}},Lt(n.volume))))))}function Qt(e){let[t,n]=G(0),[r,i]=G("--:--:--"),[s,a]=G(!0);se(()=>{let p=setInterval(()=>{n(f=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(p)},[]),se(()=>{let p=()=>{let y=new Date,b=String(y.getHours()).padStart(2,"0"),g=String(y.getMinutes()).padStart(2,"0"),x=String(y.getSeconds()).padStart(2,"0");i(`${b}:${g}:${x}`)};p();let f=setInterval(p,1e3);return()=>clearInterval(f)},[]),se(()=>{let p=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(p)},[]);let l=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},h={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},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:h},Ac(Tc,m),Lc(),Bc(t),Fc(),Nc(),Wc()))}function Te(e){return e.type==="card"}function Le(e){return e.type==="container"}function Ze(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function ot(e){return Te(e)?e.card_id:e.container_id}var _c={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},Hn=[{label:"Text",value:"text"},{label:"JSON",value:"json"},{label:"Task",value:"task"},{label:"Project",value:"project"}];function Oc(e){let t=e.content;return o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},"data-testid":`card-text-content-${e.card_id}`},t.text||"")}function Hc(e){let t=e.content,r=Object.entries(t).map(([i,s],a)=>o("div",{key:String(a),style:{display:"flex",gap:"4px",fontSize:"11px",lineHeight:"1.6",borderBottom:"1px solid rgba(0,0,0,0.05)",padding:"2px 0"}},o("span",{style:{fontWeight:"600",color:"#374151",minWidth:"60px"}},`${i}:`),o("span",{style:{color:"#555555"}},String(s??""))));return o("div",{style:{flex:"1",overflow:"auto"},"data-testid":`card-json-content-${e.card_id}`},...r)}function Yc(e){return o("div",{style:{fontSize:"12px",color:"#9ca3af",fontStyle:"italic",flex:"1",display:"flex",alignItems:"center",justifyContent:"center"},"data-testid":`card-task-content-${e.card_id}`},"Task card (coming soon)")}function Vc(e,t){let n=e.content;return o("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"4px 16px",borderRadius:"999px",backgroundColor:e.color||"#e0e7ff",fontSize:"13px",fontWeight:"600",color:"#1e3a5f",cursor:"pointer",flex:"1"},onDblClick:r=>{r.preventDefault(),r.stopPropagation(),t&&n.project_id&&t(n.project_id)},"data-testid":`card-project-content-${e.card_id}`},n.project_name||"Untitled Project")}function Ci(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d,onCardContextMenu:u,onUpdate:h,onDragStart:m,onDragEnd:c,onAnchorDragStart:p}=e,[f,y]=G(!1),[b,g]=G(null),[x,v]=G(!1),[T,D]=G(!1),[C,$]=G(!1),[L,I]=G(t.card_title||""),[P,B]=G(""),E=oe(null),F=oe(null),A=t.priority?_c[t.priority]||"#94a3b8":"transparent",k=S(de=>{let fe=de;fe.preventDefault(),fe.stopPropagation(),g({x:fe.clientX,y:fe.clientY}),v(!1),u&&u(t.card_id,{x:fe.clientX,y:fe.clientY})},[u,t.card_id]),w=S(()=>{g(null),v(!1)},[]),R=S(de=>{let fe=de,ne=fe.target;if(ne.dataset&&(ne.dataset.role==="delete"||ne.dataset.role==="resize"||ne.dataset.role==="drag-handle"||ne.dataset.role==="inline-edit"||ne.dataset.role==="anchor"))return;fe.preventDefault(),fe.stopPropagation(),r&&r(t.card_id),E.current={x:fe.clientX,y:fe.clientY,cardX:t.position.x,cardY:t.position.y},m&&m(t.card_id);let ue=ye=>{let we=ye;if(!E.current)return;let Ie=we.clientX-E.current.x,ke=we.clientY-E.current.y;i&&i(t.card_id,{x:E.current.cardX+Ie,y:E.current.cardY+ke})},xe=()=>{E.current=null,c&&c(t.card_id),document.removeEventListener("mousemove",ue),document.removeEventListener("mouseup",xe)};document.addEventListener("mousemove",ue),document.addEventListener("mouseup",xe)},[t.card_id,t.position.x,t.position.y,r,i,m,c]),M=S(de=>{let fe=de;fe.preventDefault(),fe.stopPropagation(),F.current={x:fe.clientX,y:fe.clientY,w:t.size.width,h:t.size.height};let ne=xe=>{let ye=xe;if(!F.current)return;let we=ye.clientX-F.current.x,Ie=ye.clientY-F.current.y,ke=Math.max(120,F.current.w+we),Ce=Math.max(80,F.current.h+Ie);s&&s(t.card_id,{width:ke,height:Ce})},ue=()=>{F.current=null,document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",ue)};document.addEventListener("mousemove",ne),document.addEventListener("mouseup",ue)},[t.card_id,t.size.width,t.size.height,s]),N=S(de=>{de.preventDefault(),de.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),z=S(de=>{let fe=de;fe.preventDefault(),fe.stopPropagation();let ue=fe.target.dataset.anchor;if(!ue||!p)return;let xe=t.position.x,ye=t.position.y,we=t.size.width,Ie=t.size.height,ke=xe+we/2,Ce=ye+Ie/2;ue==="top"?(ke=xe+we/2,Ce=ye):ue==="right"?(ke=xe+we,Ce=ye+Ie/2):ue==="bottom"?(ke=xe+we/2,Ce=ye+Ie):ue==="left"&&(ke=xe,Ce=ye+Ie/2),p(t.card_id,ue,{x:ke,y:Ce})},[t.card_id,t.position.x,t.position.y,t.size.width,t.size.height,p]),W=S(de=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:de}),w()},[t.card_id,l,w]),_=S(de=>{de.preventDefault(),de.stopPropagation(),I(t.card_title||""),D(!0)},[t.card_title]),O=S(()=>{D(!1),h&&L!==t.card_title&&h(t.card_id,{card_title:L})},[h,t.card_id,t.card_title,L]),U=S(de=>{let fe=de;fe.key==="Enter"?(fe.preventDefault(),O()):fe.key==="Escape"&&(fe.preventDefault(),D(!1),I(t.card_title||""))},[O,t.card_title]),q=S(de=>{let fe=de.target;I(fe.value)},[]),ee=S(de=>{de.stopPropagation();let fe=t.content;B(fe.text||""),$(!0)},[t.content]),Z=S(()=>{$(!1),h&&h(t.card_id,{content:{text:P}})},[h,t.card_id,P]),V=S(de=>{let fe=de;if(fe.key==="Escape"){fe.preventDefault(),$(!1);let ne=t.content;B(ne.text||"")}},[t.content]),j=S(de=>{let fe=de.target;B(fe.value)},[]),H;switch(t.card_type){case"text":C?H=o("textarea",{"data-role":"inline-edit","data-testid":`card-desc-edit-${t.card_id}`,value:P,onInput:j,onBlur:Z,onKeyDown:V,onFocus:de=>{let fe=de.target;fe.setSelectionRange(fe.value.length,fe.value.length)},style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",flex:"1",border:"1px solid #3b82f6",borderRadius:"3px",padding:"2px 4px",resize:"none",outline:"none",fontFamily:"inherit",backgroundColor:"#fff",width:"100%",boxSizing:"border-box"}}):H=o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1",cursor:"text"},"data-testid":`card-text-content-${t.card_id}`,onClick:ee},t.content.text||"");break;case"json":H=Hc(t);break;case"task":H=Yc(t);break;case"project":H=Vc(t,d);break;default:H=Oc(t)}let Y=t.card_type==="project",K={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:Y?"999px":"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",zIndex:"1"},Q={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ie={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:f?"block":"none",border:"none",padding:"0"},J={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},ae={position:"absolute",top:"4px",right:"24px",width:"18px",height:"18px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.1)",color:"#333",fontSize:"10px",lineHeight:"18px",textAlign:"center",cursor:"grab",display:f?"block":"none",border:"none",padding:"0"},le=8,pe={position:"absolute",width:`${le}px`,height:`${le}px`,borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #fff",boxSizing:"border-box",cursor:"crosshair",display:f?"block":"none",zIndex:"10"},he=[{anchor:"top",style:{...pe,top:`${-le/2}px`,left:"50%",marginLeft:`${-le/2}px`}},{anchor:"right",style:{...pe,top:"50%",right:`${-le/2}px`,marginTop:`${-le/2}px`}},{anchor:"bottom",style:{...pe,bottom:`${-le/2}px`,left:"50%",marginLeft:`${-le/2}px`}},{anchor:"left",style:{...pe,top:"50%",left:`${-le/2}px`,marginTop:`${-le/2}px`}}].map((de,fe)=>o("div",{key:`anchor-${de.anchor}`,style:de.style,"data-role":"anchor","data-anchor":de.anchor,"data-testid":`card-anchor-${de.anchor}-${t.card_id}`,onMouseDown:z})),be=t.assignee?o("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",fontSize:"10px",color:"#555"},"data-testid":`card-assignee-${t.card_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,te=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((de,fe)=>o("span",{key:String(fe),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},de))):null,ce={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},me={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"},Se=b?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${b.x}px`,top:`${b.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":`card-context-menu-${t.card_id}`,role:"menu","aria-label":"Card context menu",onClick:de=>de.stopPropagation()},o("div",{style:ce,onClick:de=>{de.stopPropagation(),a&&a(t.card_id),w()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...ce,position:"relative"},onMouseEnter:()=>v(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),x?o("div",{style:me,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...Hn.map(de=>o("div",{key:de.value,style:{...ce,fontWeight:t.card_type===de.value?"700":"400"},onClick:fe=>{fe.stopPropagation(),W(de.value)},role:"menuitem","data-testid":`ctx-type-${de.value}-${t.card_id}`},de.label,t.card_type===de.value?" \u2713":""))):null)):null;return Y?o("div",{className:"board-card board-card--project",style:K,onMouseDown:R,onContextMenu:k,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),w()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Project card: ${t.card_title}`,tabIndex:0},H,o("div",{style:ae,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),...he,Se):o("div",{className:"board-card",style:K,onMouseDown:R,onContextMenu:k,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),w()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Card: ${t.card_title}`,tabIndex:0},T?o("input",{"data-role":"inline-edit","data-testid":`card-title-edit-${t.card_id}`,value:L,onInput:q,onBlur:O,onKeyDown:U,onFocus:de=>{let fe=de.target;fe.setSelectionRange(fe.value.length,fe.value.length)},style:{...Q,border:"1px solid #3b82f6",borderRadius:"3px",padding:"1px 4px",outline:"none",width:"100%",boxSizing:"border-box",backgroundColor:"#fff"}}):o("div",{style:Q,"data-testid":`card-title-${t.card_id}`,onDblClick:_},t.card_title||"Untitled"),H,te,be,o("div",{style:ae,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":`Export drag handle for ${t.card_title}`,title:"Drag to export card"},"\u2630"),o("button",{style:ie,"data-role":"delete","data-testid":`card-delete-${t.card_id}`,onClick:N,"aria-label":`Delete ${t.card_title}`,tabIndex:-1},"\xD7"),o("div",{style:J,"data-role":"resize",onMouseDown:M,"aria-label":"Resize card"}),...he,Se)}function Mi(e){let{container:t,selected:n=!1,highlighted:r=!1,onSelect:i,onMove:s,onResize:a,onDelete:l,onDrop:d,children:u}=e,[h,m]=G(!1),[c,p]=G(!1),f=oe(null),y=oe(null),b=S(E=>{E.stopPropagation(),l&&l(t.container_id)},[t.container_id,l]),g=S(E=>{E.stopPropagation(),p(F=>!F)},[]),x=S(E=>{let F=E;F.preventDefault(),F.stopPropagation(),i&&i(t.container_id),f.current={x:F.clientX,y:F.clientY,posX:t.position.x,posY:t.position.y};let A=w=>{let R=w;if(!f.current)return;let M=R.clientX-f.current.x,N=R.clientY-f.current.y;s&&s(t.container_id,{x:f.current.posX+M,y:f.current.posY+N})},k=()=>{f.current=null,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",k)},[t.container_id,t.position.x,t.position.y,i,s]),v=S(E=>{let F=E;F.preventDefault(),F.stopPropagation(),y.current={x:F.clientX,y:F.clientY,w:t.size.width,h:t.size.height};let A=w=>{let R=w;if(!y.current)return;let M=R.clientX-y.current.x,N=R.clientY-y.current.y,z=Math.max(160,y.current.w+M),W=Math.max(120,y.current.h+N);a&&a(t.container_id,{width:z,height:W})},k=()=>{y.current=null,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",k)},[t.container_id,t.size.width,t.size.height,a]),T=S(E=>{E.preventDefault(),m(!0)},[]),D=S(()=>{m(!1)},[]),C=S(E=>{let F=E;if(F.preventDefault(),m(!1),d&&F.dataTransfer){let A=F.dataTransfer.getData("text/plain");A&&d(A,t.container_id)}},[t.container_id,d]),$=r||h,L={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:r?"#eff6ff":"#ffffff",border:r?"2px dashed #3b82f6":n?"2px solid #3b82f6":"2px solid #d1d5db",borderRadius:"8px",boxShadow:$?"0 0 0 3px rgba(59,130,246,0.3), 0 4px 16px rgba(0,0,0,0.1)":"0 2px 8px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:"0",boxSizing:"border-box",transition:"border 150ms ease, background-color 150ms ease, box-shadow 150ms ease"},I={padding:"6px 12px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",cursor:"grab",userSelect:"none",textAlign:"center",fontWeight:"700",fontSize:"15px",color:"#1f2937",flexShrink:"0"},P={flex:"1",overflow:"auto",position:"relative",padding:"4px"},B={position:"absolute",bottom:"0",right:"0",width:"14px",height:"14px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"};return o("div",{className:"board-container",style:L,"data-container-id":t.container_id,"data-testid":`container-${t.container_id}`,role:"group","aria-label":`Container: ${t.name}`,onDragOver:T,onDragLeave:D,onDrop:C},o("div",{className:"board-container__title",style:{...I,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseDown:x,"data-testid":`container-title-${t.container_id}`},o("span",null,t.name),o("span",{style:{display:"flex",gap:"4px"}},o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"12px",padding:"0 2px",lineHeight:"1"},onClick:g,"aria-label":c?"Expand container":"Minimize container",title:c?"Expand":"Minimize"},c?"\u25B2":"\u2014"),o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"14px",padding:"0 2px",lineHeight:"1"},onClick:b,"aria-label":"Delete container",title:"Delete"},"\xD7"))),c?null:o("div",{className:"board-container__contents",style:P,"data-testid":`container-contents-${t.container_id}`},u),c?null:o("div",{style:B,"data-role":"resize",onMouseDown:v,"aria-label":"Resize container"}))}function Ei(e){let t=e.position.x+e.size.width/2,n=e.position.y+e.size.height/2;return{top:{x:t,y:e.position.y},right:{x:e.position.x+e.size.width,y:n},bottom:{x:t,y:e.position.y+e.size.height},left:{x:e.position.x,y:n}}}function Uc(e,t){let n=Ei(e),r=Ei(t),i=[n.top,n.right,n.bottom,n.left],s=[r.top,r.right,r.bottom,r.left],a=1/0,l=n.right,d=r.left;for(let u=0;u<i.length;u++)for(let h=0;h<s.length;h++){let m=s[h].x-i[u].x,c=s[h].y-i[u].y,p=m*m+c*c;p<a&&(a=p,l=i[u],d=s[h])}return{from:l,to:d}}var Ii="board-card-link-arrowhead";function Ri(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,onLinkContextMenu:s,canvasWidth:a,canvasHeight:l}=e,d=new Map;for(let p=0;p<n.length;p++)d.set(n[p].card_id,n[p]);let u=S(p=>{i(p)},[i]),h=[];for(let p=0;p<t.length;p++){let{source:f,link:y}=t[p],b=d.get(y.target_card_id);if(!b)continue;let{from:g,to:x}=Uc(f,b),v=y.link_id===r,T=v?"#3b82f6":y.color||"#94a3b8",D=x.x-g.x,C=x.y-g.y,$=Math.sqrt(D*D+C*C),L=Math.min(40,$*.15),I=$>0?-C/$:0,P=$>0?D/$:0,B=(g.x+x.x)/2,E=(g.y+x.y)/2,F=B+I*L,A=E+P*L,k=`M ${g.x} ${g.y} Q ${F} ${A} ${x.x} ${x.y}`,w=f.card_id;h.push(o("path",{key:`hit-${y.link_id}`,d:k,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer",pointerEvents:"stroke"},onClick:()=>u(y.link_id),onContextMenu:R=>{let M=R;M.preventDefault(),M.stopPropagation(),s&&s(y.link_id,w,{x:M.clientX,y:M.clientY})},"data-testid":`link-hit-${y.link_id}`})),h.push(o("path",{key:y.link_id,d:k,fill:"none",stroke:T,"stroke-width":v?"3":"2","pointer-events":"none","marker-end":`url(#${Ii})`,"data-testid":`link-${y.link_id}`})),y.link_name&&h.push(o("text",{key:`label-${y.link_id}`,x:String(F),y:String(A-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${y.link_id}`},y.link_name))}let m={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"9999"},c=o("defs",{},o("marker",{id:Ii,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse"},o("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#94a3b8"})));return o("svg",{style:m,width:String(a),height:String(l),className:"card-link-overlay","data-testid":"card-link-overlay",role:"img","aria-label":"Card links"},c,o("g",{style:{pointerEvents:"auto"}},...h))}var jc=[{value:"#fef9c3",label:"Yellow"},{value:"#fecaca",label:"Red"},{value:"#fed7aa",label:"Orange"},{value:"#bbf7d0",label:"Green"},{value:"#bfdbfe",label:"Blue"},{value:"#ddd6fe",label:"Purple"},{value:"#fbcfe8",label:"Pink"},{value:"#e5e7eb",label:"Gray"}],Yn=20,kt=5e3;function Gc(e,t,n,r){for(let i=0;i<e.length;i++){let s=e[i];if(Le(s)&&s.container_id!==r&&t>=s.position.x&&t<=s.position.x+s.size.width&&n>=s.position.y&&n<=s.position.y+s.size.height)return s.container_id}return null}function Pi(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function $i(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Xc(e){let t=[],n=[],r=[];for(let i=e.length-1;i>=0;i--)r.push([e[i],0,0]);for(;r.length>0;){let[i,s,a]=r.pop();if(Te(i)){let l={...i,position:{x:i.position.x+s,y:i.position.y+a}};t.push(l);for(let d=0;d<i.card_link.length;d++)n.push({source:l,link:i.card_link[d]})}else if(Le(i)){let l=s+i.position.x,d=a+i.position.y+30;for(let u=i.contents.length-1;u>=0;u--)r.push([i.contents[u],l,d])}}return{cards:t,links:n}}function Vn(e){let{state:t,dispatch:n,selectedId:r=null,onSelectItem:i,gridEnabled:s=!1,searchQuery:a="",colorFilter:l=null,onOpenProject:d,onCardContextMenu:u,onUpdateItem:h}=e,{collection:m,viewport:c}=t,p=oe(null),f=oe(!1),y=oe(null),[b,g]=G(null),[x,v]=G(null),[T,D]=G(null),[C,$]=G(null),[L,I]=G(!1),[P,B]=G(!1),[E,F]=G(null),A=S(ne=>{let ue=ne,xe=ue.target;if(xe.closest(".board-card")||xe.closest(".board-container"))return;let ye=ue.button===1,we=ue.button===0&&ue.shiftKey;ye||we?(ue.preventDefault(),f.current=!0,y.current={x:ue.clientX,y:ue.clientY,panX:c.panX,panY:c.panY}):ue.button===0&&i&&i(null)},[c.panX,c.panY,i]);se(()=>{let ne=xe=>{if(!f.current||!y.current)return;let ye=xe,we=ye.clientX-y.current.x,Ie=ye.clientY-y.current.y;n({type:"PAN",panX:y.current.panX+we,panY:y.current.panY+Ie})},ue=()=>{f.current=!1,y.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",ue),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",ue)}},[n]);let k=S(ne=>{let ue=ne;if(!ue.ctrlKey)return;ue.preventDefault();let xe=ue.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+xe})},[c.zoom,n]),w=oe(null);se(()=>{let ne=p.current;if(!ne)return;let ue=ke=>{let Ce=[];for(let ze=0;ze<ke.touches.length;ze++)Ce.push({x:ke.touches[ze].clientX,y:ke.touches[ze].clientY});return Ce},xe=(ke,Ce)=>Math.sqrt((ke.x-Ce.x)**2+(ke.y-Ce.y)**2),ye=ke=>{let Ce=ke;if(Ce.touches.length===2){Ce.preventDefault();let ze=ue(Ce);w.current={touches:ze,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:xe(ze[0],ze[1])}}},we=ke=>{let Ce=ke;if(Ce.touches.length!==2||!w.current)return;Ce.preventDefault();let ze=ue(Ce),We=w.current,He=(We.touches[0].x+We.touches[1].x)/2,Xe=(We.touches[0].y+We.touches[1].y)/2,ft=(ze[0].x+ze[1].x)/2,ge=(ze[0].y+ze[1].y)/2;n({type:"PAN",panX:We.panX+(ft-He),panY:We.panY+(ge-Xe)});let Me=xe(ze[0],ze[1]);We.dist>0&&n({type:"ZOOM",zoom:We.zoom*(Me/We.dist)})},Ie=()=>{w.current=null};return ne.addEventListener("touchstart",ye,{passive:!1}),ne.addEventListener("touchmove",we,{passive:!1}),ne.addEventListener("touchend",Ie),()=>{ne.removeEventListener("touchstart",ye),ne.removeEventListener("touchmove",we),ne.removeEventListener("touchend",Ie)}},[c.panX,c.panY,c.zoom,n]);let R=S((ne,ue)=>{$({cardId:ne,x:ue.x,y:ue.y}),I(!1),B(!1),u&&u(ne,ue)},[u]),M=S(()=>{$(null),I(!1),B(!1)},[]);se(()=>{if(!C)return;let ne=()=>{M()};return document.addEventListener("click",ne),()=>{document.removeEventListener("click",ne)}},[C,M]);let N=S((ne,ue,xe)=>{F({linkId:ne,cardId:ue,x:xe.x,y:xe.y}),M()},[M]),z=S(()=>{F(null)},[]);se(()=>{if(!E)return;let ne=()=>z();return document.addEventListener("click",ne),()=>document.removeEventListener("click",ne)},[E,z]);let W=S(ne=>{i&&i(ne)},[i]),_=S((ne,ue)=>{let xe=ue;if(s&&(xe=Pi(ue,Yn)),n({type:"MOVE_ITEM",itemId:ne,position:xe}),Z.current===ne){let we=0,Ie=0,ke=[...m];for(;ke.length>0;){let He=ke.pop();if(Te(He)&&He.card_id===ne){we=He.size.width,Ie=He.size.height;break}if(Le(He))for(let Xe=0;Xe<He.contents.length;Xe++)ke.push(He.contents[Xe])}let Ce=xe.x+we/2,ze=xe.y+Ie/2,We=Gc(m,Ce,ze,ne);g(We)}},[n,s,m]),O=S((ne,ue)=>{n({type:"RESIZE_ITEM",itemId:ne,size:ue})},[n]),U=S(ne=>{n({type:"REMOVE_ITEM",itemId:ne}),i&&r===ne&&i(null)},[n,r,i]),q=S((ne,ue)=>{n({type:"NEST_ITEM",itemId:ne,containerId:ue})},[n]),ee=S(ne=>{v(ne),Z.current=ne,g(null)},[]),Z=oe(null);Z.current=x;let V=oe(null);V.current=b;let j=S(ne=>{let ue=V.current;ue&&n({type:"NEST_ITEM",itemId:ne,containerId:ue}),v(null),Z.current=null,g(null)},[n]),H=S((ne,ue,xe)=>{D({fromCardId:ne,fromAnchor:ue,fromPos:xe,currentPos:xe})},[]),Y=oe(null);Y.current=T,se(()=>{if(!T)return;let ne=xe=>{let ye=xe,we=0,Ie=0;if(p.current){let Ce=p.current.getBoundingClientRect();we=Ce.left,Ie=Ce.top}let ke=$i(ye.clientX-we,ye.clientY-Ie,c);D(Ce=>Ce?{...Ce,currentPos:ke}:null)},ue=xe=>{let ye=xe,we=Y.current;if(!we){D(null);return}let Ie=document.elementFromPoint(ye.clientX,ye.clientY);if(Ie&&Ie.dataset&&Ie.dataset.role==="anchor"&&Ie.dataset.anchor){let ke=Ie.closest("[data-card-id]");if(ke&&ke.dataset.cardId&&ke.dataset.cardId!==we.fromCardId){let Ce=ke.dataset.cardId;n({type:"ADD_LINK",cardId:we.fromCardId,link:{link_id:Ze(),link_name:"relates to",target_card_id:Ce,color:"#94a3b8",attributes:{}}})}}D(null)};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",ue),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",ue)}},[T!==null,c.panX,c.panY,c.zoom,n]);let K=a.toLowerCase(),Q=new Set,ie=[],J=[...m];for(;J.length>0;){let ne=J.pop();if(ie.push(ne),Le(ne))for(let ue=0;ue<ne.contents.length;ue++)J.push(ne.contents[ue])}if(K)for(let ne=0;ne<ie.length;ne++){let ue=ie[ne];(Te(ue)?ue.card_title:ue.name).toLowerCase().includes(K)||Q.add(ot(ue))}if(l)for(let ne=0;ne<ie.length;ne++){let ue=ie[ne];Te(ue)&&ue.color!==l&&Q.add(ue.card_id)}let{cards:ae,links:le}=Xc(m);function pe(ne){let ue=ot(ne),xe=Q.has(ue),ye;if(Te(ne))ye=o(Ci,{key:ue,card:ne,selected:ue===r,onSelect:W,onMove:_,onResize:O,onDelete:U,dispatch:n,onOpenProject:d,onCardContextMenu:R,onUpdate:h,onDragStart:ee,onDragEnd:j,onAnchorDragStart:H});else{let we=ne.contents.map(Ie=>pe(Ie));ye=o(Mi,{key:ue,container:ne,selected:ue===r,highlighted:b===ne.container_id,onSelect:W,onMove:_,onResize:O,onDelete:U,onDrop:q},...we)}return xe?o("div",{key:`dim-${ue}`,style:{opacity:"0.3"}},ye):ye}let re=m.map(ne=>pe(ne)),he={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${Yn}px ${Yn}px`},be={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${kt}px`,height:`${kt}px`},te={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap",fontSize:"13px",color:"#1a1a1a"},ce={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"},me={height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"},Se=C?o("div",{className:"board-context-menu",style:{position:"fixed",left:`${C.x}px`,top:`${C.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":`board-context-menu-${C.cardId}`,role:"menu","aria-label":"Card context menu",onClick:ne=>ne.stopPropagation()},o("div",{style:{...te,position:"relative"},onMouseEnter:()=>{I(!0),B(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-color-${C.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),L?o("div",{style:ce,role:"menu","data-testid":`board-ctx-color-submenu-${C.cardId}`},...jc.map(ne=>o("div",{key:ne.value,style:{...te,gap:"8px"},onClick:ue=>{ue.stopPropagation(),n({type:"UPDATE_CARD",cardId:C.cardId,updates:{color:ne.value}}),M()},role:"menuitem","data-testid":`board-ctx-color-${ne.label.toLowerCase()}-${C.cardId}`},o("span",{style:{display:"inline-block",width:"14px",height:"14px",borderRadius:"3px",backgroundColor:ne.value,border:"1px solid #d1d5db",flexShrink:"0"}}),ne.label))):null),o("div",{style:{...te,position:"relative"},onMouseEnter:()=>{B(!0),I(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-type-${C.cardId}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),P?o("div",{style:ce,role:"menu","data-testid":`board-ctx-type-submenu-${C.cardId}`},...Hn.map(ne=>o("div",{key:ne.value,style:te,onClick:ue=>{ue.stopPropagation(),n({type:"CHANGE_CARD_TYPE",cardId:C.cardId,newType:ne.value}),M()},role:"menuitem","data-testid":`board-ctx-type-${ne.value}-${C.cardId}`},ne.label))):null),o("div",{style:me,role:"separator"}),o("div",{style:{...te,color:"#dc2626"},onClick:ne=>{ne.stopPropagation(),n({type:"REMOVE_ITEM",itemId:C.cardId}),i&&r===C.cardId&&i(null),M()},role:"menuitem","data-testid":`board-ctx-delete-${C.cardId}`},"Delete")):null,de=["relates to","depends on","blocks","is blocked by","implements","is implemented by","extends","includes","references","duplicates","parent of","child of"],fe=E?o("div",{className:"board-link-context-menu",style:{position:"fixed",left:`${E.x}px`,top:`${E.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",maxHeight:"240px",overflowY:"auto",zIndex:"10001",fontSize:"13px"},onClick:ne=>ne.stopPropagation()},o("div",{style:{padding:"4px 14px",fontSize:"11px",color:"#94a3b8",fontWeight:"600"}},"Edge Type"),...de.map(ne=>o("button",{key:ne,style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},onClick:()=>{n({type:"UPDATE_CARD",cardId:E.cardId,updates:{card_link:(()=>{let ue=null,xe=[...m];for(;xe.length>0;){let ye=xe.pop();if(Te(ye)&&ye.card_id===E.cardId){ue=ye;break}if(Le(ye))for(let we of ye.contents)xe.push(we)}return ue?ue.card_link.map(ye=>ye.link_id===E.linkId?{...ye,link_name:ne}:ye):[]})()}}),z()},role:"menuitem"},ne)),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#ef4444",fontFamily:"inherit"},onClick:()=>{n({type:"REMOVE_LINK",cardId:E.cardId,linkId:E.linkId}),z()},role:"menuitem"},"Delete Link")):null;return o("div",{ref:p,className:"board-canvas",style:he,onMouseDown:A,onWheel:k,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:be,"data-testid":"board-canvas-inner"},o(Ri,{links:le,cards:ae,selectedLinkId:null,onSelectLink:()=>{},onLinkContextMenu:N,canvasWidth:kt,canvasHeight:kt}),T?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(kt),height:String(kt),className:"link-drag-overlay","data-testid":"link-drag-overlay"},o("line",{x1:String(T.fromPos.x),y1:String(T.fromPos.y),x2:String(T.currentPos.x),y2:String(T.currentPos.y),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6 4","pointer-events":"none","data-testid":"link-drag-line"})):null,...re),Se,fe)}function qc(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Te(r))t.push(r);else if(Le(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function Ti(e,t,n,r){let i=r??40,s=qc(e);if(s.length===0)return{panX:0,panY:0,zoom:1};let a=1/0,l=1/0,d=-1/0,u=-1/0;for(let g=0;g<s.length;g++){let x=s[g];x.position.x<a&&(a=x.position.x),x.position.y<l&&(l=x.position.y);let v=x.position.x+x.size.width,T=x.position.y+x.size.height;v>d&&(d=v),T>u&&(u=T)}let h=d-a+i*2,m=u-l+i*2,c=t/h,p=n/m,f=Math.max(.25,Math.min(4,Math.min(c,p))),y=-a*f+(t-(d-a)*f)/2,b=-l*f+(n-(u-l)*f)/2;return{panX:y,panY:b,zoom:f}}var Un=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function zi(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:h,onGridToggle:m,onSearch:c}=e,[p,f]=G(""),y=S($=>{let L=$.target.value;f(L),c(L)},[c]),b={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"},g={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},x={...g,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=Un.map($=>{let L=$===r,I=$===i,P=()=>{L&&h?h(I?null:$):u($)},B="1px solid rgba(0,0,0,0.15)";return I?B="3px solid #ef4444":L&&(B="2px solid #3b82f6"),o("button",{key:$,title:$,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:$,border:B,cursor:"pointer",padding:"0",flexShrink:"0",opacity:I?"1":i?"0.5":"1"},onClick:P,"aria-label":I?`Clear color filter ${$}`:`Select color ${$}`,"data-testid":`color-swatch-${$}`})});return o("div",{className:"board-toolbar",style:b,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:g,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:T}),o("button",{style:g,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:g,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:g,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:p,onInput:y,style:D,"data-testid":"search-input","aria-label":"Search cards"}))}var Di=50,ut={id:Ze(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function Ai(e,t){let n=null;function r(s){let a=[];for(let l=0;l<s.length;l++){let d=s[l];if(ot(d)===t){n=d;continue}if(Le(d)){let h=r(d.contents);a.push({...d,contents:h})}else a.push(d)}return a}return[r(e),n]}function dt(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];ot(s)===t?r.push(n(s)):Le(s)?r.push({...s,contents:dt(s.contents,t,n)}):r.push(s)}return r}function en(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];Le(s)&&s.container_id===t?r.push({...s,contents:[...s.contents,n]}):Le(s)?r.push({...s,contents:en(s.contents,t,n)}):r.push(s)}return r}function Li(e,t){let n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r)){if(r.container_id===t)return r;for(let i=0;i<r.contents.length;i++)n.push(r.contents[i])}}return null}function Kc(e,t,n){let r=null;function i(a){let l=[];for(let d=0;d<a.length;d++){let u=a[d];if(Le(u)&&u.container_id===t){let h=[];for(let m=0;m<u.contents.length;m++){let c=u.contents[m];ot(c)===n?r=c:h.push(c)}l.push({...u,contents:h})}else Le(u)?l.push({...u,contents:i(u.contents)}):l.push(u)}return l}return[i(e),r]}function Zc(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function Bi(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:en(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=Ai(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:dt(e.collection,t.itemId,n=>({...n,position:t.position,...Te(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:dt(e.collection,t.itemId,n=>({...n,size:t.size,...Te(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:dt(e.collection,t.cardId,n=>Te(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:dt(e.collection,t.cardId,n=>Te(n)?{...n,card_type:t.newType,content:Zc(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:en(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let n=Li(e.collection,t.containerId);if(!n)return e;let[r,i]=Ai(e.collection,t.itemId);if(!i)return e;let s={...i,position:{x:i.position.x-n.position.x,y:i.position.y-n.position.y-30}};return{...e,collection:en(r,t.containerId,s)}}case"UNNEST_ITEM":{let n=Li(e.collection,t.containerId),[r,i]=Kc(e.collection,t.containerId,t.itemId);if(!i)return e;let s=n?{...i,position:{x:i.position.x+n.position.x,y:i.position.y+n.position.y+30}}:i;return{...e,collection:[...r,s]}}case"ADD_LINK":return{...e,collection:dt(e.collection,t.cardId,n=>Te(n)?{...n,card_link:[...n.card_link,t.link],updatedAt:Date.now()}:n)};case"REMOVE_LINK":return{...e,collection:dt(e.collection,t.cardId,n=>Te(n)?{...n,card_link:n.card_link.filter(r=>r.link_id!==t.linkId),updatedAt:Date.now()}:n)};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;case"RENAME_BOARD":return{...e,name:t.name};default:return e}}function Jc(e){return e.type==="PAN"||e.type==="ZOOM"}function Fi(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=Bi(e.present,t.action);if(n===e.present)return e;if(Jc(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 jn(e){let t={past:[],present:e||ut,future:[]},[n,r]=pn(Fi,t),i=S(l=>{r({type:"BOARD_ACTION",action:l})},[r]),s=S(()=>{r({type:"UNDO"})},[r]),a=S(()=>{r({type:"REDO"})},[r]);return{state:n.present,dispatch:i,undo:s,redo:a,canUndo:n.past.length>0,canRedo:n.future.length>0}}function Ni(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=jn(),d=oe(!1);se(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{r({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,r]);let u=oe(null),h=oe(n);return h.current=n,se(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,h.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,n]),{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}}var tn=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):{...ut}}catch{return{...ut}}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Qc(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Te(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function Wi(e){let{collection:t,onCardDropped:n,children:r}=e,i=nt(),s=oe([]);se(()=>{let u=Qc(t),h=s.current,m=new Set(h.map(p=>p.card_id)),c=new Set(u.map(p=>p.card_id));for(let p of u)m.has(p.card_id)||i.publish("project-board",{event:"card-created",card:p});for(let p of h)c.has(p.card_id)||i.publish("project-board",{event:"card-deleted",cardId:p.card_id});for(let p of u)if(m.has(p.card_id)){let f=h.find(y=>y.card_id===p.card_id);f&&f.updatedAt!==p.updatedAt&&i.publish("project-board",{event:"card-updated",card:p})}s.current=u},[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 h=u.data;n(String(h.title||"Dropped Item"),String(h.description||""))}},[n]),{isOver:l}=Dt({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 ed=new tn;function _i(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Te(r))t.push(r);else if(Le(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}var rt=Date.now(),td={id:"sample-board-001",name:"Sample Project",collection:[{type:"card",card_id:"sample-1",card_type:"text",card_title:"Auth API",card_link:[{link_id:"link-1",link_name:"blocks",target_card_id:"sample-2",color:"#94a3b8",attributes:{}}],content:{text:"Design the auth flow"},position:{x:50,y:50},size:{width:180,height:120},color:"#3b82f6",priority:"high",assignee:"Alice",createdAt:rt,updatedAt:rt},{type:"card",card_id:"sample-2",card_type:"text",card_title:"Dashboard",card_link:[],content:{text:"Build the main dashboard"},position:{x:300,y:80},size:{width:180,height:120},color:"#22c55e",priority:"medium",assignee:"Bob",createdAt:rt,updatedAt:rt},{type:"card",card_id:"sample-3",card_type:"text",card_title:"Deploy",card_link:[],content:{text:"Set up CI pipeline"},position:{x:150,y:250},size:{width:180,height:120},color:"#f59e0b",priority:"low",createdAt:rt,updatedAt:rt},{type:"card",card_id:"sample-4",card_type:"text",card_title:"Docs",card_link:[],content:{text:"Write API reference"},position:{x:400,y:280},size:{width:180,height:120},color:"#a855f7",priority:"medium",assignee:"Carol",createdAt:rt,updatedAt:rt}],viewport:{panX:0,panY:0,zoom:1}};function nd(e){return e.collection.length===0}function Oi(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Ni(ed,t),[d,u]=G(Un[0]),[h,m]=G(!1),[c,p]=G(""),[f,y]=G(null),[b,g]=G(null),[x,v]=G(n.name||"Untitled"),[T,D]=G(!1),[C,$]=G(""),[L,I]=G(null),[P,B]=G(!0),[E,F]=G([{name:"relates to",weight:1},{name:"depends on",weight:2},{name:"blocks",weight:3},{name:"is blocked by",weight:3},{name:"implements",weight:2},{name:"references",weight:1}]),[A,k]=G(null),[w,R]=G(""),[M,N]=G("1"),[z,W]=G([]),_=oe(!1);se(()=>{!_.current&&nd(n)?(_.current=!0,r({type:"SET_BOARD",state:td})):n.collection.length>0&&(_.current=!0)},[n,r]);let O=S(()=>{let ge=(-n.viewport.panX+300)/n.viewport.zoom,Me=(-n.viewport.panY+200)/n.viewport.zoom,Ee=(Math.random()-.5)*300,$e=(Math.random()-.5)*200,qe={type:"card",card_id:Ze(),card_type:"text",card_title:"New Card",card_link:[],content:{text:""},color:d,position:{x:Math.round(ge+Ee),y:Math.round(Me+$e)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:qe})},[n.viewport,d,r]),U=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),q=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),ee=S(()=>{r({type:"ZOOM",zoom:1})},[r]),Z=S(()=>{m(ge=>!ge)},[]),V=S(ge=>{p(ge)},[]),j=S(ge=>{y(ge)},[]),H=S(ge=>{g(ge)},[]),Y=S(()=>{B(ge=>!ge)},[]),K=S(()=>{r({type:"SET_BOARD",state:ut}),y(null)},[r]),Q=S(()=>{let ge=JSON.stringify(n,null,2),Me=new Blob([ge],{type:"application/json"}),Ee=URL.createObjectURL(Me),$e=document.createElement("a");$e.href=Ee,$e.download=`board-${t}.json`,$e.style.display="none",document.body.appendChild($e),$e.click(),document.body.removeChild($e),URL.revokeObjectURL(Ee)},[n,t]),ie=S(()=>{let ge=document.createElement("input");ge.type="file",ge.accept=".json,application/json",ge.style.display="none",ge.addEventListener("change",()=>{let Me=ge.files&&ge.files[0];if(!Me)return;let Ee=new FileReader;Ee.onload=()=>{try{let $e=JSON.parse(Ee.result);$e&&$e.collection&&$e.viewport&&r({type:"SET_BOARD",state:$e})}catch{}},Ee.readAsText(Me)}),document.body.appendChild(ge),ge.click(),document.body.removeChild(ge)},[r]),J=S(()=>{window.print()},[]),ae=_i(n.collection),le=S(()=>{let ge=_i(n.collection);ge.length>0&&y(ge[0].card_id)},[n.collection]),pe=S(()=>{f&&(r({type:"REMOVE_ITEM",itemId:f}),y(null))},[f,r]),re=S(()=>{if(n.collection.length===0)return;let Ee=Ti(n.collection,800,600);r({type:"PAN",panX:Ee.panX,panY:Ee.panY}),r({type:"ZOOM",zoom:Ee.zoom})},[n.collection,r]);se(()=>{let ge={menus:[{label:"File",items:[{label:"New Board",onClick:K},{label:"Export JSON",onClick:Q},{label:"Import JSON",onClick:ie},{divider:!0},{label:"Print",onClick:J}]},{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:le},{label:"Delete Selected",onClick:pe}]},{label:"View",items:[{label:"Zoom In",onClick:U},{label:"Zoom Out",onClick:q},{label:"Fit All",onClick:re},{divider:!0},{label:"Toggle Grid",onClick:Z}]}]}},[K,Q,ie,J,i,s,a,l,le,pe,U,q,re,Z]),se(()=>{let ge=Me=>{let Ee=Me;Ee.ctrlKey&&Ee.key==="z"?(Ee.preventDefault(),i()):Ee.ctrlKey&&Ee.key==="y"&&(Ee.preventDefault(),s())};return document.addEventListener("keydown",ge),()=>document.removeEventListener("keydown",ge)},[i,s]),se(()=>{if(!L)return;let ge=()=>I(null),Me=setTimeout(()=>document.addEventListener("click",ge),0);return()=>{clearTimeout(Me),document.removeEventListener("click",ge)}},[L]);let he=S(()=>{$(x),D(!0)},[x]),be=S(()=>{let ge=C.trim();ge&&(v(ge),r({type:"RENAME_BOARD",name:ge}),e.onTitleChange&&e.onTitleChange(`Project Board: ${ge}`)),D(!1)},[C,r,e.onTitleChange]),te=S(()=>{D(!1)},[]),ce=S(ge=>{$(ge.target.value)},[]),me=S(ge=>{let Me=ge;Me.key==="Enter"&&(Me.preventDefault(),be()),Me.key==="Escape"&&(Me.preventDefault(),te())},[be,te]),Se={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},de=S((ge,Me)=>{let Ee=(-n.viewport.panX+300)/n.viewport.zoom,$e=(-n.viewport.panY+200)/n.viewport.zoom,qe=(Math.random()-.5)*300,st=(Math.random()-.5)*200,Et={type:"card",card_id:Ze(),card_type:"text",card_title:ge,card_link:[],content:{text:Me},color:d,position:{x:Math.round(Ee+qe),y:Math.round($e+st)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:Et})},[n.viewport,d,r]),fe={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},ne={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},ue=S(()=>{let ge=(-n.viewport.panX+300)/n.viewport.zoom,Me=(-n.viewport.panY+200)/n.viewport.zoom,Ee=(Math.random()-.5)*300,$e=(Math.random()-.5)*200;r({type:"ADD_CONTAINER",container:{type:"container",container_id:Ze(),name:"New Container",position:{x:Math.round(ge+Ee),y:Math.round(Me+$e)},size:{width:300,height:250},contents:[]}}),I(null)},[n.viewport,r]),xe={position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",zIndex:"1000"},ye={display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},we=o("div",{style:fe,"data-testid":"app-menu-bar"},o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ne,onClick:()=>I(L==="project"?null:"project")},"Project"),L==="project"?o("div",{style:xe},o("button",{style:ye,onClick:()=>{he(),I(null)}},"Rename Project..."),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:ye,onClick:()=>{ue()}},"New Container"),o("button",{style:ye,onClick:()=>{O(),I(null)}},"New Card")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ne,onClick:()=>I(L==="graphs"?null:"graphs")},"Graphs"),L==="graphs"?o("div",{style:xe},o("button",{style:ye,onClick:()=>{R(""),N("1"),k("add"),I(null)}},"Add Attribute..."),o("button",{style:ye,onClick:()=>{k("delete"),I(null)}},"Delete Attribute..."),o("button",{style:ye,onClick:()=>{W(E.map(ge=>({...ge}))),k("edit"),I(null)}},"Edit Attributes...")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ne,onClick:()=>I(L==="settings"?null:"settings")},"Settings"),L==="settings"?o("div",{style:xe},o("button",{style:ye,onClick:()=>{Z(),I(null)}},h?"Disable Grid Snap":"Enable Grid Snap"),o("button",{style:ye,onClick:()=>{Y(),I(null)}},P?"Hide Links":"Show Links")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ne,onClick:()=>I(L==="help"?null:"help")},"Help"),L==="help"?o("div",{style:xe},o("button",{style:ye,onClick:()=>I(null)},"About Project Board"),o("button",{style:ye,onClick:()=>I(null)},"Keyboard Shortcuts")):null),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${x}`)),Ie=T?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:te},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:ge=>ge.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:C,onInput:ce,onKeyDown:me,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:te,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:be,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,ke={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},Ce={backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"320px",maxHeight:"400px",overflow:"auto"},ze={fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"},We={width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},He={padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},Xe={padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"},ft=null;return A==="add"&&(ft=o("div",{style:ke,onClick:()=>k(null)},o("div",{style:Ce,onClick:ge=>ge.stopPropagation(),role:"dialog","aria-label":"Add edge attribute"},o("div",{style:ze},"Add Edge Attribute"),o("div",{style:{marginBottom:"8px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Name"),o("input",{type:"text",value:w,style:We,placeholder:"e.g. depends on",onInput:ge=>R(ge.target.value)})),o("div",{style:{marginBottom:"12px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Weight"),o("input",{type:"number",value:M,style:We,min:"0",step:"1",onInput:ge=>N(ge.target.value)})),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},o("button",{style:Xe,onClick:()=>k(null)},"Cancel"),o("button",{style:He,onClick:()=>{let ge=w.trim(),Me=parseFloat(M)||1;ge&&F(Ee=>[...Ee,{name:ge,weight:Me}]),k(null)}},"Add"))))),A==="delete"&&(ft=o("div",{style:ke,onClick:()=>k(null)},o("div",{style:Ce,onClick:ge=>ge.stopPropagation(),role:"dialog","aria-label":"Delete edge attribute"},o("div",{style:ze},"Delete Edge Attribute"),E.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},...E.map((ge,Me)=>o("div",{key:String(Me),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 8px",borderRadius:"4px",border:"1px solid #e5e7eb"}},o("span",{style:{fontSize:"13px"}},`${ge.name} (weight: ${ge.weight})`),o("button",{style:{border:"none",backgroundColor:"transparent",color:"#ef4444",cursor:"pointer",fontSize:"16px"},onClick:()=>F(Ee=>Ee.filter(($e,qe)=>qe!==Me))},"\xD7")))),o("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"12px"}},o("button",{style:Xe,onClick:()=>k(null)},"Done"))))),A==="edit"&&(ft=o("div",{style:ke,onClick:()=>k(null)},o("div",{style:{...Ce,minWidth:"400px"},onClick:ge=>ge.stopPropagation(),role:"dialog","aria-label":"Edit edge attributes"},o("div",{style:ze},"Edit Edge Attributes"),z.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...z.map((ge,Me)=>o("div",{key:String(Me),style:{display:"flex",alignItems:"center",gap:"8px"}},o("input",{type:"text",value:ge.name,style:{...We,flex:"1"},onInput:Ee=>{let $e=Ee.target.value;W(qe=>qe.map((st,Et)=>Et===Me?{...st,name:$e}:st))}}),o("input",{type:"number",value:String(ge.weight),min:"0",step:"1",style:{...We,width:"80px"},onInput:Ee=>{let $e=parseFloat(Ee.target.value)||0;W(qe=>qe.map((st,Et)=>Et===Me?{...st,weight:$e}:st))}})))),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{style:Xe,onClick:()=>k(null)},"Cancel"),o("button",{style:He,onClick:()=>{F(z.filter(ge=>ge.name.trim())),k(null)}},"Save"))))),o("div",{className:"project-manager-app",style:Se,"data-testid":"project-manager-app"},we,o(zi,{zoom:n.viewport.zoom,gridEnabled:h,selectedColor:d,colorFilter:b,onNewCard:O,onZoomIn:U,onZoomOut:q,onZoomReset:ee,onColorSelect:u,onColorFilter:H,onGridToggle:Z,onSearch:V}),o(Wi,{collection:n.collection,onCardDropped:de},o(Vn,{state:n,dispatch:r,searchQuery:c,gridEnabled:h,selectedId:f,onSelectItem:j,colorFilter:b,onUpdateItem:(ge,Me)=>{r({type:"UPDATE_CARD",cardId:ge,updates:Me})},onCardContextMenu:(ge,Me)=>{}})),Ie,ft)}var od=28,rd=5e3;var Hi=0;function Yi(e){return Hi++,`${e}-${Hi}`}function id(e){return e.replace(/\s*\(\d+\)$/,"")}function sd(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 ad(){let e=nt(),t=oe(!1);return se(()=>{t.current||(t.current=!0,e.publish("terminal-output",{text:"Terminal session started",pid:1}))},[e]),o("div",{style:{padding:"16px",fontSize:"12px",color:"#00ff41",height:"100%",overflow:"auto",backgroundColor:"#1a1a2e",fontFamily:"monospace"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",{style:{opacity:"0.6",marginTop:"8px",fontSize:"10px"}},"[Published terminal-output message]"),o("div",null,"$ _"))}function ld(){let[e,t]=G([]),n=ct();Tt("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 cd(e,t,n){let r={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(id(e)){case"Files":return o(tt,{appId:"files"},o(ld,null));case"Terminal":return o(tt,{appId:"terminal"},o(ad,null));case"Browser":return o("div",{style:r},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:r},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(s=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},s)));case"Settings":return o("div",{style:r},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(s=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},s)));case"Word Processor":return o(qt,null);case"IDE":return o(Kt,null);case"Trading":return o(Qt,null);case"Project Board":return o(Oi,{boardId:t||"default",onTitleChange:n||void 0});default:return o("div",{style:r},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function dd(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=Pt(),d=l.activeMenuBar,u=l.dockSignals,h=oe(l);h.current=l;let[m,c]=G([]),[p,f]=G([]),[y,b]=G(!1),[g,x]=G(!1),[v,T]=G(null),[D,C]=G({x:0,y:0}),[$,L]=G(null),I=S(()=>{b(te=>!te)},[]),P=S(te=>{f(ce=>ce.filter(me=>me.id!==te))},[]);se(()=>{if(p.length===0)return;let te=p[0],ce=Date.now()-te.timestamp,me=Math.max(0,rd-ce),Se=setTimeout(()=>{f(de=>de.filter(fe=>fe.id!==te.id))},me);return()=>clearTimeout(Se)},[p]);let B=oe(t);B.current=t;let E=oe(r);E.current=r;let F=oe({});for(let te of m)if(!F.current[te.id]){let ce=te.id;F.current[ce]=me=>{c(Se=>Se.map(de=>de.id===ce?{...de,title:me}:de))}}let A=S(te=>{let me=B.current.find(Se=>Se.id===te);me&&(c(Se=>{let fe=Se.filter(we=>we.appId===te).length+1,ne=fe===1?me.label:`${me.label} (${fe})`,ue=Yi(te),xe=Se.length>0?Math.max(...Se.map(we=>we.zIndex))+1:1,ye={id:ue,appId:me.id,title:ne,icon:me.icon,x:60+Se.length*30,y:40+Se.length*30,width:600,height:400,zIndex:xe,focused:!0,windowState:"normal"};return[...Se.map(we=>({...we,focused:!1})),ye]}),te==="files"&&h.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:()=>{}}]}]}),te==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(te))},[]),k=S(te=>{c(ce=>{if(!ce.find(de=>de.id===te))return ce;let Se=Math.max(...ce.map(de=>de.zIndex))+1;return ce.map(de=>de.id===te?{...de,focused:!0,zIndex:Se,windowState:de.windowState==="minimized"?"normal":de.windowState}:{...de,focused:!1})})},[]),w=S(te=>{c(ce=>{let me=ce.filter(ne=>ne.appId===te);if(me.length===0)return ce;let de=[...me].sort((ne,ue)=>ue.zIndex-ne.zIndex)[0],fe=Math.max(...ce.map(ne=>ne.zIndex))+1;return ce.map(ne=>ne.id===de.id?{...ne,focused:!0,zIndex:fe,windowState:ne.windowState==="minimized"?"normal":ne.windowState}:{...ne,focused:!1})}),c(ce=>{if(ce.filter(Se=>Se.appId===te).length===0){let de=B.current.find(xe=>xe.id===te);if(!de)return ce;let fe=Yi(te),ne=ce.length>0?Math.max(...ce.map(xe=>xe.zIndex))+1:1,ue={id:fe,appId:de.id,title:de.label,icon:de.icon,x:60+ce.length*30,y:40+ce.length*30,width:600,height:400,zIndex:ne,focused:!0,windowState:"normal"};return te==="files"&&h.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:()=>{}}]}]}),te==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(te),[...ce.map(xe=>({...xe,focused:!1})),ue]}return ce})},[]),R=t.map(te=>{let ce=m.some(de=>de.appId===te.id),me=u.get(te.id),Se={id:te.id,icon:te.icon,label:me?.tooltip||te.label,active:ce};return me&&(me.badge!=null&&(Se.badge=me.badge>0?me.badge:void 0),me.progress!=null&&(Se.progress=me.progress>0?me.progress:void 0),me.urgent&&(Se.urgent=!0)),Se}),M=m.find(te=>te.focused),N=M?M.title:void 0,z=S(()=>{x(!0)},[]),W=S(()=>{x(!1)},[]),_=S((te,ce)=>{T(te),C(ce)},[]),O=S(()=>{T(null)},[]),U=S(()=>{},[]),q=S(()=>{i&&i()},[i]),ee=[];n&&(ee.push({label:n.name,icon:void 0,onClick:U,divider:!1}),ee.push({label:"",icon:void 0,onClick:U,divider:!0})),ee.push({label:"Lock",icon:void 0,onClick:z,divider:!1}),ee.push({label:"Logout",icon:void 0,onClick:q,divider:!1});let Z=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]),V={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"},H={width:"100%",height:"100%",position:"relative"},Y=o(Bn,{activeAppName:N,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:ee.length>0?ee:void 0,height:od}),K=o(Fn,{items:R,orientation:"vertical",position:"left",iconSize:36,onItemClick:w,onItemContextMenu:_}),Q=o(sd,{toasts:p,onDismiss:P}),ie=m.filter(te=>te.windowState!=="minimized").map(te=>o(At,{key:te.id,id:te.id,title:te.title,icon:te.icon,defaultPosition:{x:te.x,y:te.y},defaultSize:{width:te.width,height:te.height},zIndex:te.zIndex,focused:te.focused,windowState:te.windowState,onClose:()=>{c(ce=>ce.filter(me=>me.id!==te.id))},onFocus:()=>{c(ce=>{let me=Math.max(...ce.map(Se=>Se.zIndex))+1;return ce.map(Se=>Se.id===te.id?{...Se,focused:!0,zIndex:me}:{...Se,focused:!1})})},onMinimize:()=>{c(ce=>ce.map(me=>me.id===te.id?{...me,windowState:"minimized"}:me))},onMaximize:()=>{c(ce=>ce.map(me=>me.id===te.id?{...me,windowState:me.windowState==="maximized"?"normal":"maximized"}:me))}},cd(t.find(ce=>ce.id===te.appId)?.label||te.title,te.id,F.current[te.id]))),J=[];a&&J.push(a),J.push(...ie),J.push(Q);let ae=o(Nn,{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:H},...J)),le=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(te=>o("button",{key:te.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:ce=>{ce.stopPropagation(),b(!1),w(te.id)}},o("span",{style:{fontSize:"32px",display:"block"}},te.icon),o("span",null,te.label)))):null,pe=g?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:W},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,re=(()=>{if(!v)return null;let te=t.find(ne=>ne.id===v),ce=m.filter(ne=>ne.appId===v),me={padding:"6px 14px",cursor:"pointer"},Se={onMouseEnter:ne=>{ne.currentTarget.style.backgroundColor="#444"},onMouseLeave:ne=>{ne.currentTarget.style.backgroundColor="transparent"}},de={borderBottom:"1px solid #444",margin:"4px 0"},fe=[];return fe.push(o("div",{key:"new",style:me,...Se,onClick:()=>{A(v),T(null)},role:"menuitem"},"\u25CF New")),ce.length>0&&(fe.push(o("div",{key:"sep-1",style:de})),ce.forEach((ne,ue)=>{let xe=ne.title;fe.push(o("div",{key:`inst-${ne.id}`,style:me,...Se,onClick:()=>{k(ne.id),T(null)},role:"menuitem"},xe))})),fe.push(o("div",{key:"sep-2",style:de})),fe.push(o("div",{key:"about",style:me,...Se,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:ne=>ne.stopPropagation()},...fe))})(),he=$?t.find(te=>te.id===$):null,be=he?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:te=>te.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},he.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:Z,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},Y),o("div",{style:V},o("div",{className:"unity-desktop__dock",style:j},K),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden",minHeight:"0"}},ae,le)),re,be,pe)}function Vi(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(Dn,{onWindowOpen:r},o($t,null,o(zt,null,o(dd,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function Ui(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:h,onDeactivate:m,children:c}=e,p=Pt(),f=X(()=>p.windows.find($=>$.id===t),[p.windows,t]);se(()=>(u?p.setMenuBar(t,u):p.clearMenuBar(t),()=>{p.clearMenuBar(t)}),[u,t,p]);let y=oe(!1),b=f?f.focused:!1;se(()=>{let $=y.current;y.current=b,b&&!$?h&&h():!b&&$&&m&&m()},[b,h,m]);let g=S(()=>{p.closeWindow(t),d&&d()},[p,t,d]),x=S(()=>{p.focusWindow(t)},[p,t]),v=S($=>{p.moveWindow(t,$)},[p,t]),T=S($=>{p.resizeWindow(t,$)},[p,t]),D=S(()=>{p.minimizeWindow(t)},[p,t]),C=S(()=>{f&&f.windowState==="maximized"?p.restoreWindow(t):p.maximizeWindow(t)},[p,t,f]);return f?o(tt,{appId:t},o(At,{id:t,title:n,icon:r,defaultPosition:f.position,defaultSize:f.size,minSize:a,resizable:l,windowState:f.windowState,focused:f.focused,zIndex:f.zIndex,onClose:g,onFocus:x,onMove:v,onResize:T,onMinimize:D,onMaximize:C,children:c})):(p.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var ji={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},Gi={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 Xi(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:h,active:m=!1}=e,c=X(()=>{let p=ji[i]??ji.md,f=Gi[r]??Gi.secondary,y={padding:p.padding,fontSize:p.fontSize,borderRadius:p.borderRadius,border:`1px solid ${f.border}`,backgroundColor:m?"#3b82f6":f.bg,color:m?"white":f.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),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":h,"aria-pressed":m?"true":void 0},t)}var ud=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Ct=Math.PI/180;function pd(e,t,n,r,i,s,a,l,d,u){let h=Math.cos(r*Ct),m=Math.sin(r*Ct),c=Math.cos(i*Ct),p=Math.sin(i*Ct),f=Math.cos(s*Ct),y=Math.sin(s*Ct),b=e*f-t*y,g=e*y+t*f,x=b*c-g*p,v=b*p+g*c,T=n,D=x,C=v*h-T*m,$=v*m+T*h,L=1+a*.001*$,I=l+D*u*L,P=d-C*u*L;return{sx:I,sy:P,depth:$}}function qi(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 Zi(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:h=2,colorScale:m=ud,gridColor:c="#94a3b8",title:p}=e,f=X(()=>{let A=0,k=0,w=0;for(let R=0;R<t.length;R++){let M=t[R],N=M.data.length;N>A&&(A=N);for(let z=0;z<N;z++){let W=M.data[z].length;W>k&&(k=W);for(let _=0;_<W;_++){let O=Math.abs(M.data[z][_]??0);O>w&&(w=O)}}}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)*h+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,h,n,r]),b=n/2,g=r/2,x=S((A,k,w)=>pd(A,k,w,s,a,l,i,b,g,y),[s,a,l,i,b,g,y]),v=S(()=>{if(!u)return[];let A=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,R=f.maxRows/2,M=x(-w,-R,0),N=x(w,-R,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 z=x(-w,R,0);A.push(o("line",{key:"axis-y",x1:String(M.sx),y1:String(M.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 W=f.maxHeight+(t.length-1)*h,_=x(-w,-R,W);return A.push(o("line",{key:"axis-z",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-z-label",x:String(_.sx-4),y:String(_.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),A},[u,f,t.length,h,x]),T=S(()=>{let A=[],k=f.maxCols/2,w=f.maxRows/2,R=[];for(let M=0;M<t.length;M++){let N=t[M],z=N.color??m[M%m.length],W=N.opacity??.7,_=M*h,O=N.data.length;for(let U=0;U<O-1;U++){let q=N.data[U],ee=N.data[U+1],Z=Math.min(q.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=(q[V]??0)+_,ie=(q[V+1]??0)+_,J=(ee[V]??0)+_,ae=(ee[V+1]??0)+_,le=x(j,Y,Q),pe=x(H,Y,ie),re=x(j,K,J),he=x(H,K,ae),be=(le.depth+pe.depth+re.depth+he.depth)/4,te=`${le.sx},${le.sy} ${pe.sx},${pe.sy} ${he.sx},${he.sy} ${re.sx},${re.sy}`;R.push({points:te,fill:qi(z,W),stroke:Ki(z,.7),strokeWidth:"0.5",depth:be,key:`quad-${M}-${U}-${V}`})}}if(O===1||O>0&&N.data[0].length===1)for(let U=0;U<O;U++){let q=N.data[U];for(let ee=0;ee<q.length;ee++){let Z=ee-k,V=U-w,j=(q[ee]??0)+_,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}`;R.push({points:K,fill:qi(z,W),stroke:Ki(z,.7),strokeWidth:"0.5",depth:H.depth,key:`point-${M}-${U}-${ee}`})}}}R.sort((M,N)=>M.depth-N.depth);for(let M=0;M<R.length;M++){let N=R[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,h,m,x]),D=S(()=>{let A=[],k=f.maxCols/2,w=f.maxRows/2;for(let R=0;R<=f.maxRows;R++){let M=R-w,N=x(-k,M,0),z=x(k,M,0);A.push(o("line",{key:`base-h-${R}`,x1:String(N.sx),y1:String(N.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let R=0;R<=f.maxCols;R++){let M=R-k,N=x(M,-w,0),z=x(M,w,0);A.push(o("line",{key:`base-v-${R}`,x1:String(N.sx),y1:String(N.sy),x2:String(z.sx),y2:String(z.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return A},[f,c,x]),C=S(()=>{if(!d)return[];let A=[],k=f.maxCols/2,w=f.maxRows/2;for(let R=0;R<t.length;R++){let M=t[R],N=R*h,z=0,W=0;for(let q=0;q<M.data.length;q++){let ee=M.data[q];for(let Z=0;Z<ee.length;Z++)z+=ee[Z]??0,W++}let _=W>0?z/W:0,O=x(k+1,0,_+N),U=M.color??m[R%m.length];A.push(o("text",{key:`layer-label-${R}`,x:String(O.sx+8),y:String(O.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:U},M.label))}return A},[d,t,f,h,m,x]),L=S(()=>p?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n])(),I=D(),P=v(),B=T(),E=C(),F=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...F,...I,...P,...B,...E)}function fd(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 gd(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 Ji(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:h="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:p="#ffffff"}=e,f=X(()=>fd(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),b=l!=null&&l.length>1,g=n!=null&&n.length>0,x=y&&s>=0?m:c,v=20,T=g?u*.38:u*.45,D=Math.min(d*.15,48),C=D*.55,$=T+D*.4+8,L=g?$+22:T+D*.4+22,I=b?Math.min(u*.22,36):0,P=u-v-I,B=d-v*2,E=S(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:p,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,p]),F=S(()=>{let O=[],U=r+f+i;return O.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:h,"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)),O},[d,T,D,C,f,r,i,h]),A=S(()=>g?[o("text",{key:"label",x:String(d/2),y:String($),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[g,d,$,n]),k=S(()=>{if(!y)return[];let O=[],U=s,q=U>=0,ee=8,Z=gd(U),V=(q?"+":"-")+Z+(a?" "+a:""),j=d/2-40,H=L;if(q){let Y=`${j},${H} ${j-ee/2},${H+ee} ${j+ee/2},${H+ee}`;O.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}else{let Y=`${j},${H+ee} ${j-ee/2},${H} ${j+ee/2},${H}`;O.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}return O.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)),O},[y,s,a,x,d,L]),w=S(()=>{if(!b)return[];let O=[],U=l,q=[];for(let Q of U)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&q.push(Q);if(q.length<2)return[];let ee=1/0,Z=-1/0;for(let Q of q)Q<ee&&(ee=Q),Q>Z&&(Z=Q);ee===Z&&(ee-=1,Z+=1);let V=Z-ee,j=B/(q.length-1),H="";for(let Q=0;Q<q.length;Q++){let ie=v+Q*j,J=P+I-(q[Q]-ee)/V*I;Q===0?H+=`M ${ie} ${J}`:H+=` L ${ie} ${J}`}let Y=v+(q.length-1)*j,K=H+` L ${Y} ${P+I} L ${v} ${P+I} Z`;return O.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),O.push(o("path",{key:"spark-fill",d:K,fill:"url(#sparkGrad)"})),O.push(o("path",{key:"spark-line",d:H,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),O},[b,l,B,P,I,v]),R=E(),M=F(),N=A(),z=k(),W=w(),_=`${r}${f}${i}${g?`, ${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":_,style:{fontFamily:"sans-serif"}},...R,...W,...M,...N,...z)}var nn=Math.PI/180;function md(e,t,n,r,i,s,a,l){let d=Math.cos(r*nn),u=Math.sin(r*nn),h=Math.cos(i*nn),m=Math.sin(i*nn),c=e*h+n*m,p=-e*m+n*h,f=t*d-p*u,y=t*u+p*d;return{sx:s+c*l,sy:a-f*l,depth:y}}function Mt(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 on(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 it(e,t,n){let{x:r,y:i,z:s}=Mt(e),a=Math.cos(n),l=Math.sin(n),d,u,h;return t==="x"?(d=r,u=i*a-s*l,h=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,h=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,h=s),on(d,u,h)}function Gn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return it(e,"x",Math.PI);case"Y":return it(e,"y",Math.PI);case"Z":return it(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=Mt(e);return on(s,-i,r)}case"S":return it(e,"z",Math.PI/2);case"T":return it(e,"z",Math.PI/4);case"Rx":return it(e,"x",n);case"Ry":return it(e,"y",n);case"Rz":return it(e,"z",n)}}function Qi(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:h=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:p=!0,trailMaxPoints:f=200,trailColor:y="#ef4444",wireframeColor:b="#cbd5e1",vectorColor:g="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:T,onStateChange:D}=e,[C,$]=G(t??{theta:0,phi:0}),[L,I]=G(s),[P,B]=G(a),[E,F]=G(l),A=oe([]),k=oe(!1),w=oe(null),R=oe(null);se(()=>{t&&$(t)},[t?.theta,t?.phi]);let M=oe(0);se(()=>{if(!n||n.length===0)return;M.current=0;let j=0,H=()=>{M.current>=n.length||($(Y=>{let K=Gn(Y,n[M.current]);return M.current++,D&&D(K),K}),j=requestAnimationFrame(H))};return j=requestAnimationFrame(H),()=>cancelAnimationFrame(j)},[n]),se(()=>{let j=Mt(C);A.current.push(j),A.current.length>f&&A.current.splice(0,A.current.length-f)},[C.theta,C.phi]);let N=v*E,z=r/2,W=i/2,_=S((j,H,Y)=>md(j,H,Y,P,L,z,W,N),[P,L,z,W,N]),O=S(j=>{if(!d)return;let H=j;k.current=!0,w.current={mx:H.clientX,my:H.clientY,rx:P,ry:L}},[d,P,L]),U=S(j=>{if(!k.current||!w.current)return;let H=j,Y=w.current;I(Y.ry+(H.clientX-Y.mx)*.5),B(Y.rx-(H.clientY-Y.my)*.5)},[]),q=S(()=>{k.current=!1},[]),ee=S(j=>{if(!u)return;let H=j;H.preventDefault(),F(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 ie=Q/60*2*Math.PI,J=_(Math.cos(ie),Math.sin(ie),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:b,"stroke-width":"0.8",opacity:"0.5"}));let Y=[];for(let Q=0;Q<=60;Q++){let ie=Q/60*2*Math.PI,J=_(Math.cos(ie),0,Math.sin(ie));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:b,"stroke-width":"0.8",opacity:"0.4"}));let K=[];for(let Q=0;Q<=60;Q++){let ie=Q/60*2*Math.PI,J=_(0,Math.cos(ie),Math.sin(ie));K.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"yz",d:K.join(" "),fill:"none",stroke:b,"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=_(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),Y=_(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),K=_(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=_(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(p&&A.current.length>1){let j=A.current,H=[];for(let Y=0;Y<j.length;Y++){let K=j[Y],Q=_(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(h){let j=Mt(C),H=_(0,0,0),Y=_(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:g,"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:g,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:R,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?O:void 0,onMouseMove:d?U:void 0,onMouseUp:d?q:void 0,onMouseLeave:d?q:void 0,onWheel:u?ee:void 0},...Z)}function hd(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 Xn(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 qn(e){let t=hd(e);if(t.length===0)return null;let n=Xn(t,25),r=Xn(t,50),i=Xn(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let p of t)if(p>=a){d=p;break}let u=t[t.length-1];for(let p=t.length-1;p>=0;p--)if(t[p]<=l){u=t[p];break}let h=0;for(let p of t)h+=p;let m=h/t.length,c=[];for(let p of t)(p<a||p>l)&&c.push(p);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:m,outliers:c,min:t[0],max:t[t.length-1]}}function bd(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 es(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:h,padding:m=60}=e,c=i==="vertical",p=n-m*2,f=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],b=X(()=>{let w=[];for(let R of t)w.push(qn(R.values));return w},[t]),g=X(()=>{let w=1/0,R=-1/0;for(let z of b){if(z===null)continue;let W=s&&z.outliers.length>0?Math.min(z.whiskerLow,z.outliers[0]):z.whiskerLow,_=s&&z.outliers.length>0?Math.max(z.whiskerHigh,z.outliers[z.outliers.length-1]):z.whiskerHigh;W<w&&(w=W),_>R&&(R=_)}isFinite(w)||(w=0,R=1);let M=R-w,N=M>0?M*.05:.5;return{min:w-N,max:R+N}},[b,s]),x=c?f:p,v=c?p:f,T=t.length>0?t.length:1,D=v/T,C=D*Math.min(Math.max(d,.1),.95),$=S(w=>{let R=g.max-g.min;return R===0?x/2:(w-g.min)/R*x},[g,x]),L=S(()=>{if(!u)return[];let w=[],R=g.max-g.min,M=bd(R),N=Math.ceil(g.min/M)*M;for(let z=N;z<=g.max;z+=M){let W=$(z),_=String(Math.round(z*1e3)/1e3);if(c){let O=m+f-W;w.push(o("line",{key:`grid-${z}`,x1:String(m),y1:String(O),x2:String(m+p),y2:String(O),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(m-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}else{let O=m+W;w.push(o("line",{key:`grid-${z}`,x1:String(O),y1:String(m),x2:String(O),y2:String(m+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${z}`,x:String(O),y:String(m+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return w},[u,g,$,c,m,p,f]),I=S(()=>{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+p),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),w},[m,p,f,c]),P=S(()=>{let w=[];for(let R=0;R<t.length;R++){let M=b[R];if(M===null)continue;let N=t[R],z=N.color??y[R%y.length],W=D*R+D/2,_=C/2;if(c){let O=m+f-$(M.q1),U=m+f-$(M.q3),q=m+f-$(M.median),ee=m+f-$(M.whiskerLow),Z=m+f-$(M.whiskerHigh),V=m+W;w.push(o("line",{key:`wl-${R}`,x1:String(V),y1:String(O),x2:String(V),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${R}`,x1:String(V-_*.4),y1:String(ee),x2:String(V+_*.4),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${R}`,x1:String(V),y1:String(U),x2:String(V),y2:String(Z),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${R}`,x1:String(V-_*.4),y1:String(Z),x2:String(V+_*.4),y2:String(Z),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,U),H=Math.abs(O-U);if(w.push(o("rect",{key:`box-${R}`,x:String(V-_),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":`${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-${R}`,x1:String(V-_),y1:String(q),x2:String(V+_),y2:String(q),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+f-$(M.mean);w.push(o("circle",{key:`mean-${R}`,cx:String(V),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 K=m+f-$(M.outliers[Y]);w.push(o("circle",{key:`out-${R}-${Y}`,cx:String(V),cy:String(K),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[Y]}`}))}w.push(o("text",{key:`cat-${R}`,x:String(V),y:String(m+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}else{let O=m+$(M.q1),U=m+$(M.q3),q=m+$(M.median),ee=m+$(M.whiskerLow),Z=m+$(M.whiskerHigh),V=m+W;w.push(o("line",{key:`wl-${R}`,x1:String(O),y1:String(V),x2:String(ee),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${R}`,x1:String(ee),y1:String(V-_*.4),x2:String(ee),y2:String(V+_*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${R}`,x1:String(U),y1:String(V),x2:String(Z),y2:String(V),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${R}`,x1:String(Z),y1:String(V-_*.4),x2:String(Z),y2:String(V+_*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,U),H=Math.abs(U-O);if(w.push(o("rect",{key:`box-${R}`,x:String(j),y:String(V-_),width:String(Math.max(H,1)),height:String(C),fill:z,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-${R}`,x1:String(q),y1:String(V-_),x2:String(q),y2:String(V+_),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+$(M.mean);w.push(o("circle",{key:`mean-${R}`,cx:String(Y),cy:String(V),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 K=m+$(M.outliers[Y]);w.push(o("circle",{key:`out-${R}-${Y}`,cx:String(K),cy:String(V),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[Y]}`}))}w.push(o("text",{key:`cat-${R}`,x:String(m-6),y:String(V+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}}return w},[t,b,$,c,m,p,f,D,C,l,s,a,y]),B=S(()=>h?[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"},h)]:[],[h,n,m]),E=L(),F=I(),A=P(),k=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Box plot",style:{fontFamily:"sans-serif"}},...k,...E,...F,...A)}function ts(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 xd(e,t,n){return e<t?t:e>n?n:e}function Kn(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function ns(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:h=4,defaultColor:m="#3b82f6",opacity:c=.7,title:p,padding:f=60}=e,y=X(()=>{let A=[];for(let k=0;k<t.length;k++){let w=t[k];Kn(w.x)&&Kn(w.y)&&Kn(w.r)&&A.push(w)}return A},[t]),b=n-f*2,g=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,R=-1/0,M=1/0,N=-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>R&&(R=z.y),z.r<M&&(M=z.r),z.r>N&&(N=z.r);return A===k&&(A-=1,k+=1),w===R&&(w-=1,R+=1),M===N&&(M=0,N=N>0?N:1),{xMin:A,xMax:k,yMin:w,yMax:R,rMin:M,rMax:N}},[y]),v=S(A=>{let k=x.xMax-x.xMin;return f+(A-x.xMin)/k*b},[x,f,b]),T=S(A=>{let k=x.yMax-x.yMin;return f+g-(A-x.yMin)/k*g},[x,f,g]),D=S(A=>{let k=x.rMax-x.rMin;if(k===0)return(h+u)/2;let w=(A-x.rMin)/k;return h+w*(u-h)},[x,h,u]),C=S(()=>{if(!a)return[];let A=[],k=ts(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let N=w;N<=x.xMax;N+=k){let z=v(N);A.push(o("line",{key:`grid-x-${N}`,x1:String(z),y1:String(f),x2:String(z),y2:String(f+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-xlabel-${N}`,x:String(z),y:String(f+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}let R=ts(x.yMax-x.yMin),M=Math.ceil(x.yMin/R)*R;for(let N=M;N<=x.yMax;N+=R){let z=T(N);A.push(o("line",{key:`grid-y-${N}`,x1:String(f),y1:String(z),x2:String(f+b),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-ylabel-${N}`,x:String(f-6),y:String(z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}return A},[a,x,v,T,f,b,g]),$=S(()=>{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+g),stroke:"#374151","stroke-width":"1.5"})),A.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+g),x2:String(f+b),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),i&&A.push(o("text",{key:"x-label",x:String(f+b/2),y:String(f+g+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+g/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${f-40}, ${f+g/2})`},s)),A},[l,f,b,g,i,s]),L=S(()=>{let A=[];for(let k=0;k<y.length;k++){let w=y[k],R=v(w.x),M=T(w.y),N=xd(D(w.r),h,u),z=w.color??m;A.push(o("circle",{key:`bubble-${k}`,cx:String(R),cy:String(M),r:String(N),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(R),y:String(M-N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return A},[y,v,T,D,m,c,d,h,u]),I=S(()=>p?[o("text",{key:"title",x:String(n/2),y:String(f/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,f]),P=C(),B=$(),E=L(),F=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Bubble chart",style:{fontFamily:"sans-serif"}},...F,...P,...B,...E)}var yd=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Sd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function vd(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 os(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 rs(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 wd(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 kd(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=rs(t[i]),l=rs(t[i+1]);return wd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var Cd=["#9be9a8","#40c463","#30a14e","#216e39"];function is(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=Cd,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:m,startDate:c,endDate:p,maxVal:f}=X(()=>{let E=new Map,F=0,A=null,k=null;for(let M of t){let N=vd(M.date);if(isNaN(N.getTime()))continue;let z=os(N);E.set(z,(E.get(z)??0)+M.value);let W=E.get(z);W>F&&(F=W),(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 R=new Date(k);return R.setDate(R.getDate()+(6-R.getDay())),{dateMap:E,startDate:w,endDate:R,maxVal:F>0?F:1}},[t]),y=d?30:0,b=l?16:0,g=h?28:0,x=y+10,v=g+b+4,T=S(()=>{let E=[],F=new Date(c),A=0;for(;F<=p;){let k=F.getDay();k===0&&F>c&&A++;let w=os(F),R=m.get(w),M=R!==void 0&&R>0?kd(R/f,i):u,N=x+A*(s+a),z=v+k*(s+a);E.push(o("rect",{key:`day-${w}`,x:String(N),y:String(z),width:String(s),height:String(s),rx:"2",ry:"2",fill:M,"aria-label":`${w}: ${R??0}`})),F.setDate(F.getDate()+1)}return E},[c,p,m,f,i,u,s,a,x,v]),D=S(()=>{if(!l)return[];let E=[],F=new Date(c),A=0,k=-1;for(;F<=p;){let w=F.getDay();w===0&&F>c&&A++;let R=F.getMonth();if(R!==k&&w===0){k=R;let M=x+A*(s+a);E.push(o("text",{key:`month-${A}`,x:String(M),y:String(g+b-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},yd[R]))}F.setDate(F.getDate()+1)}return E},[l,c,p,s,a,x,g,b]),C=S(()=>{if(!d)return[];let E=[],F=[1,3,5];for(let A of F){let k=v+A*(s+a)+s/2;E.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"},Sd[A]))}return E},[d,s,a,v,y]),$=S(()=>h?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let L=$(),I=D(),P=C(),B=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":h??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...I,...P,...B)}var Md=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Je(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Ed(e,t,n,r,i,s){let a=Je(e,t,n,i),l=Je(e,t,n,s),d=Je(e,t,r,i),u=Je(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 Id(e,t,n,r,i,s,a){let l=Je(e,t,n,r),d=Je(e,t,n,i),u=Je(e,t,n,s),h=Je(e,t,n,a),m=i-r,c=a-s,p=m>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${p} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${f} 1 ${h.x} ${h.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function Rd(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let p=0;for(let f=0;f<i;f++){let y=e[c]?.[f]??0;p+=Math.max(0,y)}s.push(p),a+=p}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),p=[],f=0;for(let y=0;y<i;y++)p.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:f,endAngle:f+c,value:0}),f+=c+r;return{groups:p,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let p=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+p,value:s[c]}),u+=p+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let p=c;p<i;p++){let f=Math.max(0,e[c]?.[p]??0),y=c===p?0:Math.max(0,e[p]?.[c]??0);if(f===0&&y===0)continue;let b=f+y,g=s[c]>0?f/a*l:0,x=h[c],v=x+g;h[c]=v;let T=s[p]>0?f/a*l:0,D=h[p],C=D+T;if(h[p]=C,c===p){f>0&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:D,targetEndAngle:C,value:f,color:d[c].color});continue}let $=s[p]>0?y/a*l:0,I=h[p]+$;h[p]=I;let P=s[c]>0?y/a*l:0,E=h[c]+P;h[c]=E,(f>0||y>0)&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:D,targetEndAngle:Math.max(C,D+.001),value:b,color:d[c].color})}return{groups:d,chords:m}}function ss(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=Md,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.9,title:m}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,p=i/2,f=Math.min(r,i)/2-40,y=f*Math.max(.5,Math.min(.99,h)),b=f+16,g=X(()=>Rd(t,n,s,a),[t,n,s,a]),x=S(()=>{let L=[];for(let I=0;I<g.groups.length;I++){let P=g.groups[I];if(P.endAngle-P.startAngle<.001)continue;let E=Ed(c,p,f,y,P.startAngle,P.endAngle);if(L.push(o("path",{key:`arc-${I}`,d:E,fill:P.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${P.label}: ${P.value}`})),l){let F=(P.startAngle+P.endAngle)/2,A=Je(c,p,b,F),R=((F-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,M=R?"start":"end",N=F*180/Math.PI-90;R||(N+=180);let z=d?`${P.label} (${P.value})`:P.label;L.push(o("text",{key:`label-${I}`,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"},z))}}return L},[g,c,p,f,y,b,l,d]),v=S(()=>{let L=[];for(let I=0;I<g.chords.length;I++){let P=g.chords[I],B=Id(c,p,y,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);L.push(o("path",{key:`ribbon-${I}`,d:B,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[g,c,p,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(),$=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"}},...$,...D,...C)}var Pd=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function $d(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],h=[];for(let m=0;m<u.length;m++)h.push(n+r.length+m);t.push({id:d,node:s,depth:a,parentId:l,childIndices:h});for(let m=0;m<u.length;m++)r.push([u[m],a+1,d])}return{flatNodes:t,maxDepth:i}}function Td(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 zd(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=$d(e);if(d.length===0)return[];let h=Td(d),m=t-s*2,c=n-s*2,p=a==="horizontal",f=u+1,y=p?f>1?(m-r)/u:0:f>1?(c-i)/u:0,b=new Array(d.length),g=h[0],x=p?c:m,v=g>0?x/g:x,T=new Array(d.length);T[0]=[0,g];let D=[0],C=0;for(;C<D.length;){let $=D[C];C++;let L=d[$],[I,P]=T[$],B=(I+P)/2,E=s+L.depth*y,F=s+(B-.5)*v,A=p?E:F,k=p?F:E,w=L.node.color??l[L.depth%l.length];b[$]={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:h[$]};let R=I;for(let M of L.childIndices)if(M<d.length){let N=h[M],z=R+N;T[M]=[R,z],R=z,D.push(M)}}return b}function as(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:h=Pd,title:m,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let p=i==="horizontal",f=X(()=>zd(t,n,r,s,a,c,i,h),[t,n,r,s,a,c,i,h]),y=X(()=>{let C=new Map;for(let $=0;$<f.length;$++){let L=f[$];C.set(L.id,L)}return C},[f]),b=S(()=>{if(!d)return[];let C=[];for(let $=0;$<f.length;$++){let L=f[$];if(L.parentId===null)continue;let I=y.get(L.parentId);if(!I)continue;let P,B,E,F;p?(P=I.x+s,B=I.y+a/2,E=L.x,F=L.y+a/2):(P=I.x+s/2,B=I.y+a,E=L.x+s/2,F=L.y);let A=(P+E)/2,k=(B+F)/2,w;p?w=`M ${P} ${B} C ${A} ${B}, ${A} ${F}, ${E} ${F}`:w=`M ${P} ${B} C ${P} ${k}, ${E} ${k}, ${E} ${F}`,C.push(o("path",{key:`conn-${$}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[f,y,p,s,a,d,u]),g=S(()=>{let C=[];for(let $=0;$<f.length;$++){let L=f[$];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},[f,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=b(),T=g(),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 ls=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Dd(e){return ls[e%ls.length]}function cs(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],h=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??Dd(d),x:u.x??r+s*Math.cos(h),y:u.y??i+s*Math.sin(h),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function ds(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let h=Math.sqrt(u),m=l/h,c=d/h,p=n-h;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*p,a.y+=c*p):a.fixed?(i.x-=m*p,i.y-=c*p):(i.x-=m*p*.5,i.y-=c*p*.5,a.x+=m*p*.5,a.y+=c*p*.5);let f=i.vx-a.vx,y=i.vy-a.vy,b=f*m+y*c;b<=0||(i.fixed?(a.vx+=b*m,a.vy+=b*c):a.fixed?(i.vx-=b*m,i.vy-=b*c):(i.vx-=b*m,i.vy-=b*c,a.vx+=b*m,a.vy+=b*c))}}}function Ad(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let h=new Map;for(let x=0;x<u;x++)h.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,$=v.y-D.y,L=C*C+$*$;L<1&&(L=1);let I=Math.sqrt(L),P=i/L,B=C/I*P,E=$/I*P;m[x]+=B,c[x]+=E,m[T]-=B,c[T]-=E}}for(let x=0;x<t.length;x++){let v=t[x],T=h.get(v.source),D=h.get(v.target);if(T===void 0||D===void 0)continue;let C=e[T],$=e[D],L=$.x-C.x,I=$.y-C.y,P=Math.sqrt(L*L+I*I);if(P<.1)continue;let B=v.weight??1,E=P-l,F=s*E*B,A=L/P*F,k=I/P*F;m[T]+=A,c[T]+=k,m[D]-=A,c[D]-=k}let p=n/2,f=r/2,y=.001;for(let x=0;x<u;x++){let v=e[x];m[x]+=(p-v.x)*y,c[x]+=(f-v.y)*y}let b=20,g=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){g.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),$=10;C>$&&(T=T/C*$,D=D/C*$);let L=v.x+T,I=v.y+D;L=Math.max(b,Math.min(n-b,L)),I=Math.max(b,Math.min(r-b,I)),g.push({...v,x:L,y:I,vx:T,vy:D})}return ds(g,d),g}function Ld(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 us(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:h=300,attractionForce:m=.01,damping:c=.9,edgeLength:p=100,edgeColor:f="#94a3b8",edgeWidth:y=1.5,title:b,customForce:g,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":b??"Empty force-directed graph"},b?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"},b):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=oe(cs(t,r,i)),[T,D]=G(0),C=oe(!0),$=oe(!1),L=oe(n);L.current=n;let I=oe(g);I.current=g;let P=oe(null),B=oe({repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l});B.current={repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l};let E=oe(new Map);se(()=>{v.current=cs(t,r,i),$.current=!1,C.current=!0,E.current=new Map,D(ie=>ie+1)},[t.length]),se(()=>{let ie=0,J=()=>{if(!C.current)return;let ae=B.current,le=I.current,pe;if(le?(pe=le(v.current,L.current,ae.width,ae.height,P.current),ae.solidNodes&&ds(pe,ae.nodeRadius)):pe=Ad(v.current,L.current,ae.width,ae.height,ae.repulsionForce,ae.attractionForce,ae.damping,ae.edgeLength,ae.nodeRadius),v.current=pe,x)for(let re=0;re<x.length;re++){let he=x[re],be=pe.find(me=>me.id===he.nodeId);if(!be)continue;let te=E.current.get(he.nodeId);te||(te=[],E.current.set(he.nodeId,te)),te.push({x:be.x,y:be.y});let ce=he.maxPoints??200;te.length>ce&&te.splice(0,te.length-ce)}if(!le&&Ld(pe)<.01){$.current=!0,D(re=>re+1);return}D(re=>re+1),ie=requestAnimationFrame(J)};return ie=requestAnimationFrame(J),()=>{C.current=!1,cancelAnimationFrame(ie)}},[]);let F=v.current,A=S(ie=>{v.current=v.current.map(J=>J.id===ie?{...J,fixed:!J.fixed,vx:0,vy:0}:J),$.current&&($.current=!1,C.current=!0,D(J=>J+1))},[]),k=oe(null),w=oe(null),R=S(ie=>{let J=ie,ae=w.current;if(!ae)return{x:J.clientX,y:J.clientY};let le=ae.getBoundingClientRect(),pe=r/le.width,re=i/le.height;return{x:(J.clientX-le.left)*pe,y:(J.clientY-le.top)*re}},[r,i]),M=oe(!1),N=S((ie,J)=>{J.stopPropagation(),k.current=ie;let ae=v.current.find(le=>le.id===ie);M.current=ae?.fixed??!1,v.current=v.current.map(le=>le.id===ie?{...le,fixed:!0,vx:0,vy:0}:le)},[]),z=S(ie=>{let J=R(ie);if(P.current={x:J.x,y:J.y},!k.current)return;let ae=k.current,le=20;v.current=v.current.map(pe=>pe.id===ae?{...pe,x:Math.max(le,Math.min(r-le,J.x)),y:Math.max(le,Math.min(i-le,J.y))}:pe),$.current&&($.current=!1,C.current=!0),D(pe=>pe+1)},[r,i,R]),W=S(()=>{let ie=k.current;ie&&(v.current=v.current.map(J=>J.id===ie?{...J,fixed:M.current}:J)),k.current=null},[]),_=S(()=>{k.current=null,P.current=null},[]),O=X(()=>{let ie=new Map;for(let J=0;J<F.length;J++)ie.set(F[J].id,F[J]);return ie},[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:f})))]:[],[u,s,f]),q=S(()=>{let ie=[];for(let J=0;J<n.length;J++){let ae=n[J],le=O.get(ae.source),pe=O.get(ae.target);if(!le||!pe||ae.weight!==void 0&&ae.weight<=0)continue;let re=ae.weight?Math.max(.5,Math.min(6,y*ae.weight)):y,he={key:`edge-${J}`,x1:String(le.x),y1:String(le.y),x2:String(pe.x),y2:String(pe.y),stroke:ae.color??f,"stroke-width":String(re),"stroke-opacity":"0.6"};u&&(he["marker-end"]="url(#arrowhead)"),ie.push(o("line",he))}return ie},[T,f,y,u]),ee=S(()=>{let ie=[];for(let J=0;J<F.length;J++){let ae=F[J];ie.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:le=>N(ae.id,le),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&&ie.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 ie},[T,s,d,A]),Z=S(()=>b?[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"},b)]:[],[b,r]),V=S(()=>{if(!x||x.length===0)return[];let ie=[];for(let J=0;J<x.length;J++){let ae=x[J],le=E.current.get(ae.nodeId);if(!le||le.length<2)continue;let pe=[];for(let re=0;re<le.length;re++){let he=le[re];pe.push(`${re===0?"M":"L"}${he.x.toFixed(1)},${he.y.toFixed(1)}`)}ie.push(o("path",{key:`trail-${ae.nodeId}`,d:pe.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 ie},[T,x]),j=U(),H=V(),Y=q(),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":b??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:z,onMouseUp:W,onMouseLeave:_},...j,...Q,...H,...Y,...K)}var ps=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function fs(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=ps,title:h}=e,m=i==="vertical",c=h?30:0,p=120,f=X(()=>{let L=0;for(let I=0;I<t.length;I++)t[I].value>L&&(L=t[I].value);return L>0?L:1},[t]),y=S(L=>f===0?0:Math.max(.05,L/f),[f]),b=S((L,I)=>I||(u[L%u.length]??ps[0]),[u]),g=S(()=>{if(t.length===0)return[];let L=[],I=40,P=n-I*2-p,B=r-c-I*2,E=d*(t.length-1),F=Math.max(1,(B-E)/t.length),A=I+P/2;for(let k=0;k<t.length;k++){let w=t[k],R=k<t.length-1?t[k+1]:null,M=b(k,w.color),N=y(w.value),z=R!==null?y(R.value):N*.6,W=P/2*N,_=P/2*z,O=c+I+k*(F+d),U=A-W,q=A+W,ee=A+_,Z=A-_,V=`${U},${O} ${q},${O} ${ee},${O+F} ${Z},${O+F}`;L.push(o("polygon",{key:`section-${k}`,points:V,fill:M,stroke:"#fff","stroke-width":"1"}));let j=I+P+12,H=O+F/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,b,y,p]),x=S(()=>{if(t.length===0)return[];let L=[],I=40,P=n-I*2,E=r-c-I*2-40,F=d*(t.length-1),A=Math.max(1,(P-F)/t.length),k=c+I+E/2;for(let w=0;w<t.length;w++){let R=t[w],M=w<t.length-1?t[w+1]:null,N=b(w,R.color),z=y(R.value),W=M!==null?y(M.value):z*.6,_=E/2*z,O=E/2*W,U=I+w*(A+d),q=k-_,ee=k-O,Z=k+O,V=k+_,j=`${U},${q} ${U+A},${ee} ${U+A},${Z} ${U},${V}`;L.push(o("polygon",{key:`section-${w}`,points:j,fill:N,stroke:"#fff","stroke-width":"1"}));let H=U+A/2,Y=c+I+E+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"},R.label)),a||l){let K="";if(a&&(K=String(R.value)),l&&t.length>0){let Q=t[0].value,ie=Q>0?Math.round(R.value/Q*100):0;K+=a?` (${ie}%)`:`${ie}%`}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,b,y]),v=S(()=>h?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n]),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?g():x(),$=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":h??"Funnel chart",style:{fontFamily:"sans-serif"}},...D,...C,...$)}var gs=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ms(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 Bd(e,t){return t||gs[e%gs.length]}function hs(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:h,padding: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":h??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,p=X(()=>{let B=1/0,E=-1/0;for(let F of t){F.start<B&&(B=F.start);let A=F.start+F.duration;A>E&&(E=A)}return B===1/0&&(B=0,E=1),{min:B,max:E,range:E-B}},[t]),f=X(()=>{let B=t.slice();return B.sort((E,F)=>E.group!==F.group?(E.group??"").localeCompare(F.group??""):E.start-F.start),B},[t]),y=r??m*2+f.length*(i+s)+s+20,b=n-m-c-m,g=m+(h?20:0),x=S(B=>p.range===0?c+m:c+m+(B-p.min)/p.range*b,[p,b,c,m]),v=S(()=>{if(!a)return[];let B=[],E=ms(p.range),F=Math.ceil(p.min/E)*E,A=g+f.length*(i+s)+s;for(let k=F;k<=p.max;k+=E){let w=x(k);B.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(g),x2:String(w),y2:String(A),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return B},[a,p,g,f.length,i,s,x]),T=S(()=>{let B=[],E=ms(p.range),F=Math.ceil(p.min/E)*E,A=g-8;for(let k=F;k<=p.max;k+=E){let w=x(k);B.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 B.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)),B},[p,g,x,u,n,m]),D=S(()=>{let B=[],E="";for(let F=0;F<f.length;F++){let A=f[F],k=g+F*(i+s)+s,w=x(A.start),R=Math.max(2,x(A.start+A.duration)-w),M=Bd(F,A.color);A.group&&A.group!==E&&(E=A.group,l&&B.push(o("text",{key:`group-${F}`,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))),B.push(o("rect",{key:`bar-${A.id}`,x:String(w),y:String(k),width:String(R),height:String(i),rx:"4",ry:"4",fill:M,role:"graphics-symbol","aria-label":`${A.label}: start ${A.start}, duration ${A.duration}`})),l&&B.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&&R>30&&B.push(o("text",{key:`prog-${A.id}`,x:String(w+R/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 B},[f,g,i,s,x,l,d,c,m]),C=S(()=>h?[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"},h)]:[],[h,n,m]),$=v(),L=T(),I=D(),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":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...$,...L,...I)}var Fd=Math.PI/180;function Nd(e){return e*Fd}function Ge(e,t,n,r){let i=Nd(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function bs(e,t,n,r,i){let s=Ge(e,t,n,i),a=Ge(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 Wd(e,t,n){return e<t?t:e>n?n:e}function pt(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function xs(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:h=!0,showTicks:m=!0,tickCount:c=10,label:p,unit:f,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:b="#374151",backgroundColor:g="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,T=isFinite(t)&&!isNaN(t)?Wd(t,x,v):x,D=(u?24:0)+(p?18:0),C=i/2,$=(s-D)*.6,L=Math.min(i/2,(s-D)*.55)-d/2-10,I=L-d,P=L-d/2,B=l-a,E=S(V=>{let j=v-x;if(j===0)return a;let H=(V-x)/j;return a+H*B},[x,v,a,B]),F=S(()=>{let V=bs(C,$,P,a,l);return[o("path",{key:"bg-arc",d:V,fill:"none",stroke:g,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,$,P,a,l,g,d]),A=S(()=>{if(y.length===0)return[];let V=[],j=B/y.length;for(let H=0;H<y.length;H++){let Y=a+H*j,K=Y+j,Q=bs(C,$,P,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,B,a,C,$,P,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*B,Q=H%2===0,ie=Q?10:6,J=Ge(C,$,L+4,K),ae=Ge(C,$,L+4+ie,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 le=x+Y*(v-x),pe=Ge(C,$,L+4+ie+12,K);V.push(o("text",{key:`tick-label-${H}`,x:String(pe.x),y:String(pe.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},pt(le)))}}return V},[m,c,a,B,C,$,L,x,v]),w=S(()=>{let V=[],j=E(T),H=I-8,Y=Ge(C,$,H,j),K=6,Q=j+90,ie=j-90,J=Ge(C,$,K,Q),ae=Ge(C,$,K,ie);return V.push(o("polygon",{key:"needle",points:`${Y.x},${Y.y} ${J.x},${J.y} ${ae.x},${ae.y}`,fill:b,stroke:"none"})),V.push(o("circle",{key:"needle-cap",cx:String(C),cy:String($),r:"8",fill:b,stroke:"#fff","stroke-width":"2"})),V},[T,E,C,$,I,b]),R=S(()=>{if(!u)return[];let V=[],j=pt(T),H=j+(f?" "+f:""),Y=$+P+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,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),V},[u,T,f,C,$,P]),M=S(()=>{if(!p)return[];let V=$+P+(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"},p)]},[p,C,$,P,u]),N=S(()=>{if(!h)return[];let V=[],j=Ge(C,$,P,a),H=Ge(C,$,P,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"},pt(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"},pt(v))),V},[h,C,$,P,a,l,x,v]),z=F(),W=A(),_=k(),O=w(),U=R(),q=M(),ee=N(),Z=`Gauge: ${pt(T)}${f?" "+f:""}, range ${pt(x)} to ${pt(v)}${p?", "+p:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(T),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":Z,style:{fontFamily:"sans-serif"}},...z,...W,..._,...O,...U,...q,...ee)}var Bt={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 -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-1.1 -2.1,-1.6 -.2,-2.6 -1.1,-4.5 -.2,-3 -2.2,-3 -2.8,-.7 -5.2,-3.6 -.6,-3.3 -6.3,-3.1 -.2,-1.3 h -3.3 l -2.2,-2.6 -2,-1.3 .7,-5.1 -.9,-1.6 .5,-5.4 1,-1.8 -.3,-2.7 -1.2,-1.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 ys(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:h="Map of the United States"}=e,m=X(()=>Object.keys(Bt),[]),c=S(g=>{l&&l(g)},[l]),p=S((g,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(g)},[d,u]),f=S((g,x)=>{let v=x.currentTarget;if(v){let T=r[g]??i;v.setAttribute("fill",T)}d&&d(null)},[d,r,i]),y=X(()=>{let g=[];for(let x=0;x<m.length;x++){let v=m[x],T=Bt[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 $=v;C.onMouseOver=L=>p($,L),C.onMouseOut=L=>f($,L),g.push(o("path",C))}return g},[m,r,i,s,a,l,c,p,f]),b=o("title",{key:"map-title"},h);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h,style:{fontFamily:"sans-serif"}},b,...y)}function Zn(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 _d(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 Od(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=Zn(t[i]),l=Zn(t[i+1]);return _d(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Hd(e){let{r:t,g:n,b:r}=Zn(e);return(.299*t+.587*n+.114*r)/255}var Yd=["#3b82f6","#fbbf24","#ef4444"];function Ss(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Yd,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:m=1,title:c,padding:p=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:b,maxVal:g}=X(()=>{let k=l??1/0,w=d??-1/0;for(let R of t)for(let M of R)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,v=n?p:20,T=r?p:20,D=i-v-20,C=s-x-T-20,$=y>0?D/y:0,L=f>0?C/f:0,I=S(()=>{let k=[];for(let w=0;w<f;w++){let R=t[w];for(let M=0;M<y;M++){let N=M<R.length?R[M]:0,z=(N-b)/(g-b),W=Od(z,a),_=v+M*$,O=x+20+w*L;if(k.push(o("rect",{key:`cell-${w}-${M}`,x:String(_),y:String(O),width:String($),height:String(L),fill:W,stroke:h,"stroke-width":String(m)})),u){let U=Hd(W)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${M}`,x:String(_+$/2),y:String(O+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,$*.3,L*.4)),"font-family":"sans-serif",fill:U},String(Math.round(N*100)/100)))}}}return k},[t,f,y,b,g,a,$,L,v,x,u,h,m]),P=S(()=>{let k=[];if(n)for(let w=0;w<f;w++){let R=w<n.length?n[w]:"",M=x+20+w*L+L/2;k.push(o("text",{key:`row-label-${w}`,x:String(v-8),y:String(M),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},R))}if(r)for(let w=0;w<y;w++){let R=w<r.length?r[w]:"",M=v+w*$+$/2,N=x+20+f*L+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"},R))}return k},[n,r,f,y,$,L,v,x]),B=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(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 E=B(),F=I(),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"}},...E,...F,...A)}function Vd(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 Ud(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 Jn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function vs(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:h,yLabel:m,padding:c=60}=e,p=Math.max(1,Math.round(n)),f=X(()=>Vd(t,p),[t,p]),y=X(()=>{let E=0;for(let F=0;F<f.length;F++)f[F].count>E&&(E=f[F].count);return E>0?E:1},[f]),b=r-c*2,g=i-c*2,x=S(()=>{if(!l)return[];let E=Ud(y),F=[];for(let A=E;A<=y;A+=E){let k=c+g-A/y*g;F.push(o("line",{key:`grid-${A}`,x1:String(c),y1:String(k),x2:String(c+b),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),F.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 F},[l,y,c,b,g]),v=S(()=>{let E=[];return E.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"})),E.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+g),x2:String(c+b),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E},[c,b,g]),T=S(()=>{if(f.length===0)return[];let E=[],F=a*(f.length-1),A=Math.max(1,(b-F)/f.length);for(let k=0;k<f.length;k++){let w=f[k],R=w.count/y*g,M=c+k*(A+a),N=c+g-R;if(E.push(o("rect",{key:`bar-${k}`,x:String(M),y:String(N),width:String(A),height:String(R),fill:s})),d&&w.count>0&&E.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 W=(f.length===1,Jn(w.min));E.push(o("text",{key:`xlabel-${k}`,x:String(M+A/2),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},W))}}if(f.length>0){let k=f[f.length-1],w=c+b;E.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Jn(k.max)))}return E},[f,y,a,s,d,c,b,g]),D=S(()=>{let E=[];return u&&E.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),h&&E.push(o("text",{key:"x-label",x:String(c+b/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),m&&E.push(o("text",{key:"y-label",x:String(14),y:String(c+g/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+g/2})`},m)),E},[u,h,m,r,i,c,b,g]),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]),$=x(),L=v(),I=T(),P=D(),B=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,...$,...L,...I,...B)}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,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:h=!0,title:m,padding:c=60}=e,p=i==="vertical",f=p?30:0,y=n-c*2,b=r-c*2-f,g=p?b:y,x=p?y:b,v=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]),T=X(()=>t.length===0?0:x/t.length,[t.length,x]),D=S(()=>{if(!u)return[];let k=jd(v),w=[];for(let R=k;R<=v;R+=k){let M=R/v*g;if(p){let N=c+b-M;w.push(o("line",{key:`grid-${R}`,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-${R}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(R)))}else{let N=c+M;w.push(o("line",{key:`grid-${R}`,x1:String(N),y1:String(c),x2:String(N),y2:String(c+b),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${R}`,x:String(N),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(R)))}}return w},[u,v,p,c,y,b,g]),C=S(()=>{let k=[];return p?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})):k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+y),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),k},[p,c,y,b]),$=S(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let R=t[w],M=R.value/v*g,N=T*w+T/2,z=R.color??d;if(p){let W=c+N,_=c+b,O=c+b-M;k.push(o("line",{key:`stem-${w}`,x1:String(W),y1:String(_),x2:String(W),y2:String(O),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(W),cy:String(O),r:String(l),fill:z})),h&&k.push(o("text",{key:`val-${w}`,x:String(W),y:String(O-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(R.value)));let U=W,q=c+b+16;k.push(o("text",{key:`cat-${w}`,x:String(U),y:String(q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${q})`},R.label))}else{let W=c+N,_=c,O=c+M;k.push(o("line",{key:`stem-${w}`,x1:String(_),y1:String(W),x2:String(O),y2:String(W),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(O),cy:String(W),r:String(l),fill:z})),h&&k.push(o("text",{key:`val-${w}`,x:String(O+l+4),y:String(W+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(R.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},R.label))}}return k},[t,v,T,d,l,s,a,h,p,c,y,b,g]),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]),P=D(),B=C(),E=$(),F=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"}},...F,...P,...B,...E,...A)}function Qn(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 Gd(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 Xd(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=Qn(t[i]),l=Qn(t[i+1]);return Gd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function qd(e){let{r:t,g:n,b:r}=Qn(e);return(.299*t+.587*n+.114*r)/255}var Kd=["#f0f9ff","#3b82f6","#1e3a8a"];function ks(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Kd,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:m,padding:c=70,symmetric:p=!1}=e,f=r??n,y=i??n,b=t.length,g=X(()=>{let z=0;for(let W of t)W.length>z&&(z=W.length);return z},[t]),x=X(()=>{if(!p||b===0)return t;let z=[],W=Math.max(b,g);for(let _=0;_<W;_++){let O=[];for(let U=0;U<W;U++){let q=t[_],ee=q&&U<q.length?q[U]:0,Z=t[U],V=Z&&_<Z.length?Z[_]:0;ee!==0?O.push(ee):O.push(V)}z.push(O)}return z},[t,p,b,g]),v=x.length,T=X(()=>{let z=0;for(let W of x)W.length>z&&(z=W.length);return z},[x]),{minVal:D,maxVal:C}=X(()=>{let z=1/0,W=-1/0;for(let _ of x)for(let O of _)O<z&&(z=O),O>W&&(W=O);return z===1/0&&(z=0),W===-1/0&&(W=1),z===W&&(W=z+1),{minVal:z,maxVal:W}},[x]),$=m?30:0,L=f?c:20,I=y?c:20,P=s-L-20,B=a-$-I-20,E=T>0?P/T:0,F=v>0?B/v:0,A=S(()=>{let z=[];for(let W=0;W<v;W++){let _=x[W];for(let O=0;O<T;O++){let U=O<_.length?_[O]:0,q=(U-D)/(C-D),ee=Xd(q,l),Z=L+O*E,V=$+20+W*F,j=W===O,H=j&&u?"currentColor":h,Y=j&&u?"2":"1";if(z.push(o("rect",{key:`cell-${W}-${O}`,x:String(Z),y:String(V),width:String(E),height:String(F),fill:ee,stroke:H,"stroke-width":Y})),d){let K=qd(ee)>.5?"#111827":"#ffffff",Q=Math.min(12,E*.3,F*.35);z.push(o("text",{key:`val-${W}-${O}`,x:String(Z+E/2),y:String(V+F/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,E,F,L,$,d,u,h]),k=S(()=>{let z=[];if(f)for(let W=0;W<v;W++){let _=W<f.length?f[W]:"",O=$+20+W*F+F/2;z.push(o("text",{key:`row-label-${W}`,x:String(L-8),y:String(O),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}if(y)for(let W=0;W<T;W++){let _=W<y.length?y[W]:"",O=L+W*E+E/2,U=$+20+v*F+12;z.push(o("text",{key:`col-label-${W}`,x:String(O),y:String(U),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}return z},[f,y,v,T,E,F,L,$]),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 R=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"}},...R,...M,...N)}var Zd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function rn(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 Jd(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 Qd(e,t,n,r,i,s,a){let l=[];if(rn(e)<=0)return l;let h=Jd(e)+1,m=s==="horizontal",c=m?i/h:r/h,p=[];for(p.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});p.length>0;){let f=p.shift(),{node:y,depth:b,spanStart:g,spanEnd:x,colorIndex:v}=f,T=rn(y);if(T<=0)continue;let D=x-g,C,$,L,I;if(m?(C=g,$=n+b*c,L=D,I=c):(C=t+b*c,$=g,L=c,I=D),l.push({x:C,y:$,w:L,h:I,label:y.label,value:T,color:y.color??a[v%a.length],depth:b}),y.children&&y.children.length>0){let P=g;for(let B=0;B<y.children.length;B++){let E=y.children[B],F=rn(E);if(F<=0)continue;let A=F/T*D;p.push({node:E,depth:b+1,spanStart:P,spanEnd:P+A,colorIndex:b===0?B:v}),P+=A}}}return l}function Cs(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Zd,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:m=10}=e,c=h?30:0,p=m,f=m+c,y=n-m*2,b=r-m*2-c;if(X(()=>rn(t),[t])<=0||y<=0||b<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let x=X(()=>Qd(t,p,f,y,b,i,l),[t,p,f,y,b,i,l]),v=[];h&&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"},h));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),$=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"},$))}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":h??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function eo(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Ms(e,t){let n=new Set;for(let i of e)n.add(eo(i,t));let r=Array.from(n);return r.sort(),r}function sn(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 an(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function eu(e,t,n,r,i){let s=Ms(e,t),a=Ms(e,n),l=new Map;for(let p of e){let f=eo(p,t),y=eo(p,n),b=`${f}::${y}`;l.has(b)||l.set(b,[]);let g=l.get(b),x=0;for(let v of r){let T=p[v];if(typeof T=="number")x+=T;else if(typeof T=="string"){let D=parseFloat(T);isNaN(D)||(x+=D)}}g.push(x)}let d=new Map;for(let[p,f]of l)d.set(p,sn(f,i));let u=new Map;for(let p of s){let f=[];for(let y of a){let b=d.get(`${p}::${y}`);b!==void 0&&f.push(b)}u.set(p,sn(f,i==="count"?"sum":i))}let h=new Map;for(let p of a){let f=[];for(let y of s){let b=d.get(`${y}::${p}`);b!==void 0&&f.push(b)}h.set(p,sn(f,i==="count"?"sum":i))}let m=[];for(let p of u.values())m.push(p);let c=sn(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:h,grandTotal:c}}function Es(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:h="#3b82f6",cellPadding: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(()=>eu(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:p,colKeys:f,cells:y,rowTotals:b,colTotals:g,grandTotal:x}=c,v=u?30:0,T=f.length+(d?1:0),D=p.length+(d?1:0),C=1+T,$=1+D,L=Math.max(40,(a-m*2)/C),I=Math.max(20,Math.min(36,(l-v-m*2)/$)),P=L*C,B=I*$,E=Math.max(0,(a-P)/2),F=v+Math.max(0,(l-v-B)/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(E),y:String(F),width:String(P),height:String(I),fill:h})),A.push(o("rect",{key:"header-col-bg",x:String(E),y:String(F+I),width:String(L),height:String(I*D),fill:h,opacity:"0.85"})),A.push(o("text",{key:"corner",x:String(E+L/2),y:String(F+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<f.length;k++){let w=E+(k+1)*L,R=Math.floor(L/7),M=f[k],N=M.length>R?M.substring(0,Math.max(1,R-2))+"..":M;A.push(o("text",{key:`ch-${k}`,x:String(w+L/2),y:String(F+I/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(E+(f.length+1)*L+L/2),y:String(F+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<p.length;k++){let w=p[k],R=F+(k+1)*I;k%2===0&&A.push(o("rect",{key:`row-bg-${k}`,x:String(E+L),y:String(R),width:String(L*T),height:String(I),fill:"#f9fafb"}));let M=Math.floor(L/7),N=w.length>M?w.substring(0,Math.max(1,M-2))+"..":w;A.push(o("text",{key:`rh-${k}`,x:String(E+L/2),y:String(R+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N));for(let z=0;z<f.length;z++){let W=f[z],_=`${w}::${W}`,O=y.get(_),U=E+(z+1)*L;A.push(o("rect",{key:`border-${k}-${z}`,x:String(U),y:String(R),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(R+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O!==void 0?an(O):"-"))}if(d){let z=E+(f.length+1)*L,W=b.get(w)??0;A.push(o("rect",{key:`rt-bg-${k}`,x:String(z),y:String(R),width:String(L),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:`rt-${k}`,x:String(z+L/2),y:String(R+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},an(W)))}}if(d){let k=F+(p.length+1)*I;A.push(o("rect",{key:"total-row-bg",x:String(E),y:String(k),width:String(P),height:String(I),fill:"#eff6ff"})),A.push(o("text",{key:"total-label",x:String(E+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 R=0;R<f.length;R++){let M=f[R],N=g.get(M)??0,z=E+(R+1)*L;A.push(o("text",{key:`ct-${R}`,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"},an(N)))}let w=E+(f.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"},an(x)))}return A.push(o("rect",{key:"outer-border",x:String(E),y:String(F),width:String(P),height:String(B),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 ln(e,t){return Math.PI*2*e/t-Math.PI/2}function cn(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Is(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:h="#d1d5db",title:m}=e,c=t.length,p=m?30:0,f=d&&n.length>0?30:0,y=60,b=Math.min((r-y*2)/2,(i-y*2-p-f)/2),g=r/2,x=y+p+b,v=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 R=0;for(let M of n){let N=M.values[k];N!==void 0&&N>R&&(R=N)}A.push(R>0?R:1)}return A},[t,n,c]),T=S(()=>{if(c<3)return[];let A=[];for(let k=1;k<=s;k++){let w=b*k/s,R=[];for(let M=0;M<c;M++){let N=ln(M,c),z=cn(g,x,w,N);R.push(`${z.x},${z.y}`)}A.push(o("polygon",{key:`ring-${k}`,points:R.join(" "),fill:"none",stroke:h,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=ln(k,c),R=cn(g,x,b,w);A.push(o("line",{key:`spoke-${k}`,x1:String(g),y1:String(x),x2:String(R.x),y2:String(R.y),stroke:h,"stroke-width":"0.75"}))}return A},[c,s,b,g,x,h]),D=S(()=>{if(!a||c<3)return[];let A=[],k=16;for(let w=0;w<c;w++){let R=ln(w,c),M=cn(g,x,b+k,R),N="middle";M.x<g-5?N="end":M.x>g+5&&(N="start");let z=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:z,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return A},[a,c,t,b,g,x]),C=S(()=>{if(c<3||n.length===0)return[];let A=[];for(let k=0;k<n.length;k++){let w=n[k],R=[],M=[],N=[];for(let z=0;z<c;z++){let W=w.values[z]??0,_=v[z],O=Math.min(W/_,1),U=b*O,q=ln(z,c),ee=cn(g,x,U,q);R.push(`${ee.x},${ee.y}`),u&&M.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&&N.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(W*100)/100)))}A.push(o("polygon",{key:`series-fill-${k}`,points:R.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),A.push(o("polygon",{key:`series-line-${k}`,points:R.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let z of M)A.push(z);for(let z of N)A.push(z)}return A},[c,n,v,b,g,x,u,l]),$=S(()=>{if(!d||n.length===0)return[];let A=[],k=x+b+40,w=100,R=n.length*w,M=g-R/2;for(let N=0;N<n.length;N++){let z=n[N],W=M+N*w;A.push(o("rect",{key:`legend-swatch-${N}`,x:String(W),y:String(k),width:"12",height:"12",rx:"2",fill:z.color})),A.push(o("text",{key:`legend-text-${N}`,x:String(W+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},z.label))}return A},[d,n,g,x,b]),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(),P=D(),B=C(),E=$(),F=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"}},...F,...I,...P,...B,...E)}var tu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function nu(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let h of u){let m=n.get(h),c=d+1;(m===void 0||c>m)&&n.set(h,c),s.includes(h)||s.push(h)}}for(let l of e)n.has(l)||n.set(l,0);return n}function ou(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,h=t.filter(P=>P.value>0),m=e.map(P=>P.id),c=nu(m,h),p=new Map,f=new Map;for(let P of m)p.set(P,0),f.set(P,0);for(let P of h)f.set(P.source,(f.get(P.source)??0)+P.value),p.set(P.target,(p.get(P.target)??0)+P.value);let y=0;for(let P of c.values())P>y&&(y=P);let b=new Map;for(let P=0;P<=y;P++)b.set(P,[]);for(let[P,B]of c)b.get(B).push(P);let g=new Map,x=y>0?(d-i)/y:0;for(let P=0;P<=y;P++)g.set(P,a+P*x);let v=new Map;for(let P=0;P<e.length;P++)v.set(e[P].id,e[P]);let T=[],D=new Map;for(let P=0;P<=y;P++){let B=b.get(P);if(B.length===0)continue;let E=0;for(let w of B){let R=p.get(w)??0,M=f.get(w)??0;E+=Math.max(R,M,1)}let F=u-s*(B.length-1),A=E>0?F/E:1,k=a;for(let w=0;w<B.length;w++){let R=B[w],M=v.get(R),N=p.get(R)??0,z=f.get(R)??0,W=Math.max(N,z,1),_=Math.max(4,W*A),O=e.findIndex(q=>q.id===R),U={id:R,label:M.label,color:M.color??l[O%l.length],column:P,x:g.get(P),y:k,height:_,totalIn:N,totalOut:z,totalValue:W};T.push(U),D.set(R,U),k+=_+s}}let C=new Map,$=new Map;for(let P of m)C.set(P,0),$.set(P,0);let L=[...h].sort((P,B)=>B.value-P.value),I=[];for(let P of L){let B=D.get(P.source),E=D.get(P.target);if(!B||!E)continue;let F=B.totalOut||1,A=E.totalIn||1,k=P.value/F*B.height,w=P.value/A*E.height,R=Math.max(1,(k+w)/2),M=C.get(P.source),N=$.get(P.target),z=B.y+M+k/2,W=E.y+N+w/2;C.set(P.source,M+k),$.set(P.target,N+w);let _=v.get(P.source);I.push({source:P.source,target:P.target,value:P.value,color:P.color??_?.color??B.color,sourceY:z,targetY:W,width:R})}return{layoutNodes:T,layoutLinks:I}}function Rs(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:h=tu,title:m,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let p=X(()=>ou(t,n,r,i,s,a,c,h),[t,n,r,i,s,a,c,h]),f=S(()=>{let T=[];for(let D=0;D<p.layoutLinks.length;D++){let C=p.layoutLinks[D],$=p.layoutNodes.find(F=>F.id===C.source),L=p.layoutNodes.find(F=>F.id===C.target);if(!$||!L)continue;let I=$.x+s,P=L.x,B=(I+P)/2,E=`M ${I} ${C.sourceY} C ${B} ${C.sourceY}, ${B} ${C.targetY}, ${P} ${C.targetY}`;T.push(o("path",{key:`link-${D}`,d:E,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(B),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},[p,s,u,d]),y=S(()=>{let T=[];for(let D=0;D<p.layoutNodes.length;D++){let C=p.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.layoutNodes.reduce((A,k)=>Math.max(A,k.column),0),L=C.column===$,I=L?C.x+s+6:C.x-6,P=L?"start":"end",B=C.column===0,E=B?C.x-6:I,F=B?"end":P;T.push(o("text",{key:`label-${C.id}`,x:String(E),y:String(C.y+C.height/2+4),"text-anchor":F,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},C.label))}}return T},[p,s,l]),b=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]),g=f(),x=y(),v=b();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...g,...x)}var ru=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],to=2*Math.PI;function Ft(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 iu(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 su(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,h=e+r*Math.cos(d),m=t+r*Math.sin(d),c=e+r*Math.cos(u),p=t+r*Math.sin(u),f=e+n*Math.cos(u),y=t+n*Math.sin(u),b=e+n*Math.cos(d),g=t+n*Math.sin(d);if(a>=to-.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 ${h} ${m}`,`A ${r} ${r} 0 1 1 ${v} ${T}`,`A ${r} ${r} 0 1 1 ${h} ${m}`,`L ${b} ${g}`,`A ${n} ${n} 0 1 0 ${D} ${C}`,`A ${n} ${n} 0 1 0 ${b} ${g}`,"Z"].join(" ")}return[`M ${h} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${p}`,`L ${f} ${y}`,`A ${n} ${n} 0 ${l} 0 ${b} ${g}`,"Z"].join(" ")}function au(e,t,n,r){let i=[],s=Ft(e);if(s<=0)return i;let a=iu(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let h=0;h<e.children.length;h++){let m=e.children[h],c=Ft(m);if(c<=0)continue;let p=c/s*to;d.push({node:m,startAngle:u,endAngle:u+p,depth:0,colorIndex:h}),u+=p}}else return i.push({startAngle:0,endAngle:to,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:h,startAngle:m,endAngle:c,depth:p,colorIndex:f}=u,y=Ft(h);if(y<=0)continue;let b=t+p*l,g=b+l;if(i.push({startAngle:m,endAngle:c,innerR:b,outerR:g,label:h.label,value:y,color:h.color??r[f%r.length],depth:p}),h.children&&h.children.length>0){let x=m,v=c-m;for(let T=0;T<h.children.length;T++){let D=h.children[T],C=Ft(D);if(C<=0)continue;let $=C/y*v;d.push({node:D,startAngle:x,endAngle:x+$,depth:p+1,colorIndex:f}),x+=$}}}return i}function Ps(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=ru,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,m=r/2,c=u?20:0,p=Math.min(h,m-c)-10;if(X(()=>Ft(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(h),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=X(()=>au(t,i,p,a),[t,i,p,a]),b=[];u&&b.push(o("text",{key:"title",x:String(h),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let g=m+c/2;for(let x=0;x<y.length;x++){let v=y[x],T=su(h,g,v.innerR,v.outerR,v.startAngle,v.endAngle);if(b.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,$=(v.innerR+v.outerR)/2,L=v.outerR-v.innerR,I=D*$;if(I>20&&L>14){let P=h+$*Math.cos(C),B=g+$*Math.sin(C),E=Math.floor(Math.min(I,L)/7),F=v.label.length>E?v.label.substring(0,Math.max(1,E-1))+"..":v.label;b.push(o("text",{key:`label-${x}`,x:String(P),y:String(B+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},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":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...b)}var lu=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function dn(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 $s(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 cu(e,t,n,r,i,s){let a=[],l=[],d=dn(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],h=r*i,m=[];for(let c=0;c<u.length;c++){let p=u[c],f=dn(p);f<=0||m.push({label:p.label,value:f,area:f/d*h,color:p.color??s[c%s.length],node:p})}for(m.sort((c,p)=>p.area-c.area),l.push({nodes:m,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:p,rect:f,depth:y}=c;if(p.length===0)continue;let b={...f},g=0;for(;g<p.length&&b.w>0&&b.h>0;){let x=b.w>=b.h,v=x?b.h:b.w,T=[],D=[];T.push(p[g]),D.push(p[g].area),g++;let C=$s(D,v);for(;g<p.length;){let P=[...D,p[g].area],B=$s(P,v);if(B>C)break;T.push(p[g]),D.push(p[g].area),C=B,g++}let $=0;for(let P of D)$+=P;let L=v>0?$/v:0,I=0;for(let P=0;P<T.length;P++){let B=T[P],E=L>0?B.area/L:0,F,A,k,w;if(x?(F=b.x,A=b.y+I,k=L,w=E):(F=b.x+I,A=b.y,k=E,w=L),a.push({x:F,y:A,w:k,h:w,label:B.label,value:B.value,color:B.color,depth:y}),B.node.children&&B.node.children.length>0){let M=F+2,N=A+2+14,z=k-4,W=w-4-14;if(z>4&&W>4){let _=[],O=B.value,U=z*W;for(let q=0;q<B.node.children.length;q++){let ee=B.node.children[q],Z=dn(ee);Z<=0||_.push({label:ee.label,value:Z,area:Z/O*U,color:ee.color??s[(q+y+1)%s.length],node:ee})}_.sort((q,ee)=>ee.area-q.area),l.push({nodes:_,rect:{x:M,y:N,w:z,h:W},depth:y+1})}}I+=E}x?b={x:b.x+L,y:b.y,w:b.w-L,h:b.h}:b={x:b.x,y:b.y+L,w:b.w,h:b.h-L}}}return a}function Ts(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=lu,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,m=h?30:0,c=u,p=u+m,f=n-u*2,y=r-u*2-m;if(X(()=>dn(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":h??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let g=X(()=>cu(t,c,p,f,y,a),[t,c,p,f,y,a]),x=[];h&&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"},h));for(let v=0;v<g.length;v++){let T=g[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":h??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function zs(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 du(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 Ds(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=zs(t[s]),u=zs(t[a]);return du(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function un(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 uu(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let h=Math.max(2,Math.min(50,r)),m=d/(h-1),c=u/(h-1);if(n){let f=[];for(let x=0;x<h;x++)for(let v=0;v<h;v++)f.push({x:i+v*m,y:a+x*c});let b=n(f,{gridSize:h,xMin:i,xMax:s,yMin:a,yMax:l}),g=[];for(let x=0;x<f.length;x++){let v=f[x],T=b[x]??{dx:0,dy:0},D=Math.sqrt(T.dx*T.dx+T.dy*T.dy);g.push({x:v.x,y:v.y,dx:T.dx,dy:T.dy,magnitude:D})}return g}if(!t)return[];let p=[];for(let f=0;f<h;f++)for(let y=0;y<h;y++){let b=i+y*m,g=a+f*c,x=t(b,g),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);p.push({x:b,y:g,dx:x.dx,dy:x.dy,magnitude:v})}return p}function pu(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:h,yMax:m,xSpan:c,ySpan:p,showGrid:f,showAxes:y,colorByMagnitude:b,colorScale:g,arrowColor:x,arrowWidth:v,effectiveArrowScale:T,maxMagnitude:D,title:C,tickFontSize:$}=i,L=B=>s+(B-d)/c*a,I=B=>s+(m-B)/p*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=`${$}px sans-serif`,e.fillStyle="#6b7280";let B=un(c,10),E=Math.ceil(d/B)*B;for(let k=E;k<=u;k+=B){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 F=un(p,10),A=Math.ceil(h/F)*F;for(let k=A;k<=m;k+=F){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,h<=0&&m>=0){let B=I(0);e.beginPath(),e.moveTo(s,B),e.lineTo(s+a,B),e.stroke()}if(d<=0&&u>=0){let B=L(0);e.beginPath(),e.moveTo(B,s),e.lineTo(B,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let P=4;for(let B=0;B<r.length;B++){let E=r[B],F=E.magnitude??Math.sqrt(E.dx*E.dx+E.dy*E.dy);if(F<1e-10)continue;let A=L(E.x),k=I(E.y),w=E.dx*T,R=-E.dy*T,M=A+w,N=k+R,z;if(b){let _=F/D;z=Ds(_,g)}else z=x;e.save(),e.strokeStyle=z,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(A,k),e.lineTo(M,N),e.stroke();let W=Math.sqrt(w*w+R*R);if(W>2){let _=w/W,O=R/W,U=-O,q=_,ee=Math.min(P,W*.4),Z=M-_*ee+U*ee*.5,V=N-O*ee+q*ee*.5,j=M-_*ee-U*ee*.5,H=N-O*ee-q*ee*.5;e.fillStyle=z,e.beginPath(),e.moveTo(M,N),e.lineTo(Z,V),e.lineTo(j,H),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:h=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:p=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:y=50,tickFontSize:b=10,arrowWidth:g=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:T}=e,D=Math.max(2,Math.min(50,s)),C=r-y*2,$=i-y*2,L=a[0],I=a[1],P=l[0],B=l[1],E=I-L,F=B-P,A=X(()=>Z=>y+(Z-L)/E*C,[y,L,E,C]),k=X(()=>Z=>y+(B-Z)/F*$,[y,B,F,$]),w=X(()=>uu(t,n,T,D,L,I,P,B,E,F),[t,n,T,D,L,I,P,B,E,F]),R=X(()=>{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]),M=X(()=>Math.min(C,$)/Math.max(D,2)/(2*R)*d,[C,$,D,R,d]);if(x==="canvas"){let Z=oe(null),V=oe(0);return se(()=>{let j=Z.current;if(!j)return;let H=j.getContext("2d");if(H)return V.current&&cancelAnimationFrame(V.current),V.current=requestAnimationFrame(()=>{pu(H,r,i,w,{padding:y,chartWidth:C,chartHeight:$,xMin:L,xMax:I,yMin:P,yMax:B,xSpan:E,ySpan:F,showGrid:h,showAxes:m,colorByMagnitude:c,colorScale:p,arrowColor:u,arrowWidth:g,effectiveArrowScale:M,maxMagnitude:R,title:f,tickFontSize:b})}),()=>{V.current&&cancelAnimationFrame(V.current)}},[w,r,i,y,C,$,L,I,P,B,E,F,h,m,c,p,u,g,M,R,f,b]),o("canvas",{ref:Z,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let N=S(()=>{if(!h)return[];let Z=[],V=un(E,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+$),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`xtick-${K}`,x:String(Q),y:String(y+$+16),"text-anchor":"middle","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}let H=un(F,10),Y=Math.ceil(P/H)*H;for(let K=Y;K<=B;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(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}return Z},[h,L,I,P,B,E,F,A,k,y,C,$]),z=S(()=>{if(!m)return[];let Z=[];if(P<=0&&B>=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(g)}))}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+$),stroke:"#374151","stroke-width":String(g)}))}return Z.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String($),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),Z},[m,L,I,P,B,A,k,y,C,$]),W=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),ie=H.dx*M,J=-H.dy*M,ae=K+ie,le=Q+J,pe;if(c){let he=Y/R;pe=Ds(he,p)}else pe=u;Z.push(o("line",{key:`arrow-line-${j}`,x1:String(K),y1:String(Q),x2:String(ae),y2:String(le),stroke:pe,"stroke-width":String(g),"stroke-linecap":"round"}));let re=Math.sqrt(ie*ie+J*J);if(re>2){let he=ie/re,be=J/re,te=-be,ce=he,me=Math.min(4,re*.4),Se=ae-he*me+te*me*.5,de=le-be*me+ce*me*.5,fe=ae-he*me-te*me*.5,ne=le-be*me-ce*me*.5;Z.push(o("polygon",{key:`arrow-head-${j}`,points:`${ae},${le} ${Se},${de} ${fe},${ne}`,fill:pe}))}}return Z},[w,A,k,M,c,R,p,u]),_=S(()=>f?[o("text",{key:"title",x:String(r/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,r,y]),O=N(),U=z(),q=W(),ee=_();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"}},...ee,...O,...U,...q)}function fu(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 gu(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:h=!0,title:m,padding:c=60}=e,p=n-c*2,f=r-c*2,y=X(()=>fu(t),[t]),{minVal:b,maxVal:g}=X(()=>{let R=0,M=0;for(let N=0;N<y.length;N++){let z=y[N];z.start<R&&(R=z.start),z.end<R&&(R=z.end),z.start>M&&(M=z.start),z.end>M&&(M=z.end)}return R===M&&(M=R+1),{minVal:R,maxVal:M}},[y]),x=g-b,v=S(R=>c+f-(R-b)/x*f,[c,f,b,x]),T=X(()=>y.length===0?0:p/y.length,[y.length,p]),D=6,C=Math.max(1,T-D),$=S(()=>{if(!u)return[];let R=gu(x),M=[],N=Math.ceil(b/R)*R;for(let z=N;z<=g;z+=R){let W=v(z);M.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(W),x2:String(c+p),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),M.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return M},[u,x,b,g,v,c,p]),L=S(()=>{let R=[];R.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=b<=0&&g>=0?v(0):c+f;return R.push(o("line",{key:"axis-x",x1:String(c),y1:String(M),x2:String(c+p),y2:String(M),stroke:"#374151","stroke-width":"1.5"})),R},[c,p,f,b,g,v]),I=S(()=>{if(y.length===0)return[];let R=[];for(let M=0;M<y.length;M++){let N=y[M],z=c+M*T+D/2,W=Math.max(N.start,N.end),_=Math.min(N.start,N.end),O=v(W),U=v(_),q=Math.max(0,U-O),ee;if(N.type==="total"?ee=a:N.type==="decrease"?ee=s:ee=i,R.push(o("rect",{key:`bar-${M}`,x:String(z),y:String(O),width:String(C),height:String(q),fill:ee,rx:"2",ry:"2"})),d){let Z=N.type==="decrease"||N.value<0?U+14:O-4,V=N.type==="total"?String(N.value):(N.value>=0?"+":"")+String(N.value);R.push(o("text",{key:`val-${M}`,x:String(z+C/2),y:String(Z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},V))}if(R.push(o("text",{key:`cat-${M}`,x:String(z+C/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},N.label)),h&&M<y.length-1){let Z=y[M+1],V=v(N.end),j=c+(M+1)*T+D/2;Z.type!=="total"&&R.push(o("line",{key:`conn-${M}`,x1:String(z+C),y1:String(V),x2:String(j),y2:String(V),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return R},[y,T,C,v,i,s,a,l,d,h,c,f]),P=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]),B=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]),E=$(),F=L(),A=I(),k=P(),w=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...E,...F,...A,...w)}var mu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],hu=[0,-45,45,90];function bu(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),h=Math.abs(Math.sin(d)),m=a*u+l*h,c=a*h+l*u;return{x:r-m/2,y:i-c/2,w:m,h:c}}function xu(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 yu(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function Su(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 Bs(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=mu,rotations:d=hu,padding:u=4,spiral:h="archimedean",title:m}=e,c=X(()=>{if(t.length===0)return[];let f=t.map((C,$)=>({...C,originalIndex:$})).filter(C=>C.text.length>0&&C.weight>0).sort((C,$)=>$.weight-C.weight);if(f.length===0)return[];let y=f[f.length-1].weight,g=f[0].weight-y;function x(C){if(g===0)return(i+s)/2;let $=(C-y)/g;return i+$*(s-i)}let v=[],T=n/2,D=r/2;for(let C=0;C<f.length;C++){let $=f[C],L=x($.weight),I=d[Su($.text)%d.length],P=$.color??l[C%l.length],B=!1,E=500,F=h==="archimedean"?4:5;for(let A=0;A<E;A++){let k,w;if(h==="archimedean"){let _=A*.1,O=F*_;k=O*Math.cos(_),w=O*Math.sin(_)}else{let _=Math.floor(A/4)+1,O=A%4,U=(A%4===0?0:A)*F;switch(O){case 0:k=_*F*4,w=U;break;case 1:k=-U,w=_*F*4;break;case 2:k=-_*F*4,w=-U;break;default:k=U,w=-_*F*4;break}}let R=T+k,M=D+w,N=bu($.text,L,I,R,M),z={x:N.x-u,y:N.y-u,w:N.w+u*2,h:N.h+u*2};if(!yu(z,n,r))continue;let W=!1;for(let _ of v)if(xu(z,_.bbox)){W=!0;break}if(!W){v.push({text:$.text,x:R,y:M,fontSize:L,rotation:I,color:P,bbox:z}),B=!0;break}}}return v},[t,n,r,i,s,l,d,u,h]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let p=[];m&&p.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},m));for(let f=0;f<c.length;f++){let y=c[f],b=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;p.push(o("text",{key:`word-${f}`,transform:b,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud",style:{fontFamily:a}},...p)}var vu={0:"#1e293b",1:"#3b82f6"},wu="#666";function Fs(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:h="#0f172a",padding:m=10,onCellClick:c,onCellHover:p,title:f}=e,y=n??vu,b=t.length,g=X(()=>{let R=0;for(let M=0;M<t.length;M++){let N=t[M];N!==void 0&&N.length>R&&(R=N.length)}return R},[t]),x=u?20:0,v=f?24:0,T=X(()=>{let R=r-m*2-x,M=i-m*2-x-v;if(b===0||g===0)return{cellWidth:0,cellHeight:0};let N=Math.max(0,(R-s*(g-1))/g),z=Math.max(0,(M-s*(b-1))/b);return{cellWidth:N,cellHeight:z}},[r,i,m,b,g,s,x,v]),D=S(R=>{let M=y[R];return M!==void 0?M:wu},[y]),C=S(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),$=S(()=>f?[o("text",{key:"title",x:String(r/2),y:String(m+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},f)]:[],[f,r,m]),L=S(()=>{if(!l||b===0||g===0)return[];let{cellWidth:R,cellHeight:M}=T,N=m+x,z=m+x+v,W=g*R+(g-1)*s,_=b*M+(b-1)*s,O=[];for(let U=0;U<=g;U++){let q=N+U*(R+s)-s/2;O.push(o("line",{key:`vgrid-${U}`,x1:String(q),y1:String(z-s/2),x2:String(q),y2:String(z+_+s/2),stroke:d,"stroke-width":"0.5"}))}for(let U=0;U<=b;U++){let q=z+U*(M+s)-s/2;O.push(o("line",{key:`hgrid-${U}`,x1:String(N-s/2),y1:String(q),x2:String(N+W+s/2),y2:String(q),stroke:d,"stroke-width":"0.5"}))}return O},[l,b,g,T,m,x,v,s,d]),I=S(()=>{if(!u||b===0||g===0)return[];let{cellWidth:R,cellHeight:M}=T,N=m+x,z=m+x+v,W=[];for(let _=0;_<g;_++){let O=N+_*(R+s)+R/2,U=z-6;W.push(o("text",{key:`col-idx-${_}`,x:String(O),y:String(U),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}for(let _=0;_<b;_++){let O=N-6,U=z+_*(M+s)+M/2+3;W.push(o("text",{key:`row-idx-${_}`,x:String(O),y:String(U),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}return W},[u,b,g,T,m,x,v,s]),P=S(()=>{if(b===0||g===0)return[];let{cellWidth:R,cellHeight:M}=T,N=m+x,z=m+x+v,W=[];for(let _=0;_<b;_++){let O=t[_];if(O!==void 0)for(let U=0;U<g;U++){let q=U<O.length?O[U]:0,ee=N+U*(R+s),Z=z+_*(M+s),V=D(q),j={key:`cell-${_}-${U}`,x:String(ee),y:String(Z),width:String(R),height:String(M),fill:V,rx:String(a),ry:String(a)};if(c){let H=_,Y=U,K=q;j.onClick=()=>c(H,Y,K),j.role="button",j.tabIndex=0}if(p){let H=_,Y=U,K=q;j.onMouseEnter=()=>p(H,Y,K)}W.push(o("rect",j))}}return W},[b,g,t,T,m,x,v,s,a,D,c,p]),B=C(),E=$(),F=L(),A=I(),k=P(),w=f?`${f} \u2014 ${b}x${g} discrete grid`:`${b}x${g} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":w},B,...E,...F,...A,...k)}
|