@asymmetric-effort/specifyjs 0.0.10 → 0.0.12
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.
- package/dist/specifyjs-components.cjs.js +1 -1
- package/dist/specifyjs-components.cjs.js.map +1 -1
- package/dist/specifyjs-components.esm.js +1 -1
- package/dist/specifyjs-components.esm.js.map +1 -1
- package/dist/specifyjs-dom.cjs.js.map +1 -1
- package/dist/specifyjs-dom.esm.js.map +1 -1
- package/dist/specifyjs-telemetry.cjs.js.map +1 -1
- package/dist/specifyjs-telemetry.esm.js.map +1 -1
- package/dist/specifyjs.cjs.js.map +1 -1
- package/dist/specifyjs.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=Symbol.for("spec.element"),t=Symbol.for("spec.provider"),n=Symbol.for("spec.consumer");function o(t,n,...o){let r=null,i=null;const l={};if(null!=n){void 0!==n.key&&(r=""+n.key),void 0!==n.ref&&(i=n.ref);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&"key"!==e&&"ref"!==e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(l[e]=n[e])}if(1===o.length?l.children=o[0]:o.length>1&&(l.children=o),"function"==typeof t&&t.defaultProps){const e=t.defaultProps;for(const t of Object.keys(e))"__proto__"!==t&&"constructor"!==t&&void 0===l[t]&&(l[t]=e[t])}return{$$typeof:e,type:t,props:l,key:r,ref:i}}function r(e){const o={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},r={$$typeof:t,_context:o},i={$$typeof:n,_context:o};return o.Provider=r,o.Consumer=i,o}function i(){throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.")}function l(e){return i().useState(e)}function a(e,t){return i().useEffect(e,t)}function s(e,t){return i().useCallback(e,t)}function d(e,t){return i().useMemo(e,t)}function c(e){return i().useRef(e)}function u(){return i().useId()}function p(){const e=("undefined"!=typeof window?window.location.hash:"").replace(/^#\/?/,"/");return""===e?"/":e}r({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""}),p();const f=new Set;function h(e){if(!e)return new Date;const t=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),n=e=>Number(t.find(t=>t.type===e)?.value??0);return new Date(n("year"),n("month")-1,n("day"),n("hour"),n("minute"),n("second"))}"undefined"!=typeof window&&window.addEventListener("hashchange",function(){p(),"undefined"!=typeof window&&window.location.hash;for(const e of f)e()}),r({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});const g="#334155",x="#1e293b",b="#374151";function m(e){const{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:d,className:c}=e,[u,p]=l(h(d));a(()=>{const e=setInterval(()=>{p(h(d))},1e3);return()=>clearInterval(e)},[d]);const f=u.getHours(),m=u.getMinutes(),y=u.getSeconds(),v="24h"===t?f%24*15+.25*m:f%12*30+.5*m,k=6*m+.1*y,S=6*y,w=n/2,$=n/2,C=n/2-10,z=C-4,M=C-22,I=[];I.push(o("circle",{cx:String(w),cy:String($),r:String(C),fill:"#f8fafc",stroke:g,"stroke-width":"3"}));const L="24h"===t?24:12;for(let e=0;e<L;e++){const r=(360*e/L-90)*Math.PI/180,i=z-("24h"===t?4:6);I.push(o("line",{x1:String(w+i*Math.cos(r)),y1:String($+i*Math.sin(r)),x2:String(w+z*Math.cos(r)),y2:String($+z*Math.sin(r)),stroke:g,"stroke-width":"2"}));const l=String("24h"===t?e:0===e?12:e),a="24h"===t?.055*n:.08*n;I.push(o("text",{x:String(w+M*Math.cos(r)),y:String($+M*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:b,"font-size":String(a),"font-family":"sans-serif"},l))}const R=(e,t,n,r)=>{const i=(e-90)*Math.PI/180;return o("line",{x1:String(w),y1:String($),x2:String(w+t*Math.cos(i)),y2:String($+t*Math.sin(i)),stroke:r,"stroke-width":n,"stroke-linecap":"round"})};I.push(R(v,.5*C,"4",x)),I.push(R(k,.75*C,"3",x)),s&&I.push(R(S,.85*C,"1.5","#ef4444")),I.push(o("circle",{cx:String(w),cy:String($),r:"4",fill:x}));const D=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...I)];return r&&D.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:b}},function(e,t){const n=e.getFullYear(),o=e.getMonth(),r=e.getDate();switch(t){case"short":return`${String(o+1).padStart(2,"0")}/${String(r).padStart(2,"0")}/${n}`;case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][o]} ${String(r).padStart(2,"0")}, ${n}`;case"iso":return`${n}-${String(o+1).padStart(2,"0")}-${String(r).padStart(2,"0")}`}}(u,i))),o("div",{className:c,style:{display:"inline-block"}},...D)}const y={xs:24,sm:32,md:40,lg:56,xl:80},v=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"],k={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function S(e,t){const 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};default:return{top:n,right:n}}}function w(e){const{src:t,alt:n,name:r,size:i,shape:a="circle",fallbackColor:s,status:d,statusPosition:c="bottom-right"}=e,[u,p]=l(!1),f=function(e){return null==e?y.md:"number"==typeof e?e:y[e]??y.md}(i),h="circle"===a?"50%":`${Math.round(.15*f)}px`,g=s??function(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return v[Math.abs(t)%v.length]}(r),x=`${Math.round(.4*f)}px`,b={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${f}px`,height:`${f}px`,borderRadius:h,overflow:"hidden",flexShrink:"0"};let m;if(t&&!u)m=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>p(!0)});else{const e=function(e){if(!e)return"?";const t=e.trim().split(/\s+/);return 1===t.length?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}(r);m=o("span",{style:{fontSize:x,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},e)}const w=o("div",{style:{...b,backgroundColor:t&&!u?"transparent":g},role:"img","aria-label":n??r??"avatar"},m);if(!d)return w;const $=Math.max(8,Math.round(.25*f));return o("div",{style:{position:"relative",display:"inline-flex",width:`${f}px`,height:`${f}px`,flexShrink:"0"}},w,o("span",{style:{position:"absolute",width:`${$}px`,height:`${$}px`,borderRadius:"50%",backgroundColor:k[d]??k.offline,border:"2px solid #fff",boxSizing:"border-box",...S(c,$)},"aria-label":d}))}const $={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"}},C={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function z(e){const{count:t,max:n,dot:r=!1,color:i="#ef4444",size:l="md",variant:a="solid",children:s}=e;let d=null;r||null==t||(d=null!=n&&t>n?`${n}+`:String(t));const c=r||null!=t&&t>0,u=r?{...C[l],borderRadius:"50%",..."solid"===a?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...$[l],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",..."solid"===a?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},p=c?o("span",{style:u,"aria-label":r?"notification":`count ${d}`},d):null;if(null==s)return p??o("span",null);const f={...u,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},s,c?o("span",{style:f,"aria-label":r?"notification":`count ${d}`},d):null)}const M={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},I={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},L={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},R={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},D={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},A={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},F={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},T={...F,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},E={...F,opacity:"0.5",cursor:"default"},W={cursor:"pointer",width:"16px",height:"16px"};function B(e,t,n){return e!==t?"↕":"asc"===n?"↑":"↓"}function H(e){const{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:a,sortBy:c,sortDir:u,onSort:p,selectable:f=!1,selectedRows:h,onSelectionChange:g,striped:x=!1,bordered:b=!1,compact:m=!1,stickyHeader:y=!1}=e,[v,k]=l(0),[S,w]=l(void 0),[$,C]=l("asc"),[z,H]=l([]),[N,P]=l({}),j=i??v,_=c??S,O=u??$,Y=h??z,q=d(()=>{const e=Object.entries(N).filter(([,e])=>e.length>0);return 0===e.length?n:n.filter(t=>e.every(([e,n])=>String(t[e]??"").toLowerCase().includes(n.toLowerCase())))},[n,N]),U=d(()=>{if(!_)return q;const e=[...q];return e.sort((e,t)=>{const n=e[_],o=t[_];if(null==n&&null==o)return 0;if(null==n)return 1;if(null==o)return-1;if("number"==typeof n&&"number"==typeof o)return"asc"===O?n-o:o-n;const r=String(n),i=String(o),l=r.localeCompare(i);return"asc"===O?l:-l}),e},[q,_,O]),X=U.length,G=r?Math.max(1,Math.ceil(X/r)):1,K=r?U.slice(j*r,(j+1)*r):U,V=s(e=>{a?a(e):k(e)},[a]),J=s(e=>{const t=_===e&&"asc"===O?"desc":"asc";p?p(e,t):(w(e),C(t))},[_,O,p]),Z=s(e=>{const t=Y.includes(e)?Y.filter(t=>t!==e):[...Y,e];g?g(t):H(t)},[Y,g]),Q=s(()=>{const e=K.map((e,t)=>r?j*r+t:t),t=e.every(e=>Y.includes(e))?Y.filter(t=>!e.includes(t)):[...new Set([...Y,...e])];g?g(t):H(t)},[K,Y,r,j,g]),ee=s((e,t)=>{P(n=>({...n,[e]:t})),V(0)},[V]),te=t.some(e=>e.filterable),ne=m?"6px 8px":L.padding,oe=[];if(f){const e=K.map((e,t)=>r?j*r+t:t),t=e.length>0&&e.every(e=>Y.includes(e));oe.push(o("th",{key:"__select_all",style:{...I,padding:ne,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:t,onChange:Q,style:W,"aria-label":"Select all rows"})))}for(const e of t){const t={...I,padding:ne,...e.width?{width:e.width}:{},...e.sortable?{cursor:"pointer"}:{},...b?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},n=[e.header];e.sortable&&n.push(o("span",{style:R},B(e.key,_,O))),oe.push(o("th",{key:e.key,style:t,onClick:e.sortable?()=>J(e.key):void 0,"aria-sort":_===e.key?"asc"===O?"ascending":"descending":void 0},...n))}let re=null;if(te){const e=[];f&&e.push(o("th",{key:"__filter_spacer",style:{padding:ne}}));for(const n of t)e.push(o("th",{key:`filter_${n.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},n.filterable?o("input",{type:"text",placeholder:`Filter ${n.header}...`,style:D,value:N[n.key]??"",onInput:e=>ee(n.key,e.target.value),"aria-label":`Filter by ${n.header}`}):null));re=o("tr",{key:"__filter_row"},...e)}const ie=[];for(let e=0;e<K.length;e++){const n=K[e],i=r?j*r+e:e,l=Y.includes(i),a={};x&&e%2==1&&(a.backgroundColor="#f9fafb"),l&&(a.backgroundColor="#eff6ff");const s=[];f&&s.push(o("td",{key:"__select",style:{padding:ne,textAlign:"center",...L,...b?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:l,onChange:()=>Z(i),style:W,"aria-label":`Select row ${i+1}`})));for(const e of t){const t=n[e.key],r=e.render?e.render(t,n):String(t??"");s.push(o("td",{key:e.key,style:{...L,padding:ne,...b?{border:"1px solid #e5e7eb"}:{}}},r))}ie.push(o("tr",{key:String(i),style:a},...s))}let le=null;if(r){const e=0===X?0:j*r+1,t=Math.min((j+1)*r,X),n=[];n.push(o("button",{key:"prev",style:0===j?E:F,onClick:j>0?()=>V(j-1):void 0,disabled:0===j,"aria-label":"Previous page"},"← Prev"));const i=7;let l=Math.max(0,j-Math.floor(i/2));const a=Math.min(G,l+i);a-l<i&&(l=Math.max(0,a-i)),l>0&&(n.push(o("button",{key:"p0",style:F,onClick:()=>V(0)},"1")),l>1&&n.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let e=l;e<a;e++)n.push(o("button",{key:`p${e}`,style:e===j?T:F,onClick:e!==j?()=>V(e):void 0,"aria-current":e===j?"page":void 0},String(e+1)));a<G&&(a<G-1&&n.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),n.push(o("button",{key:"p"+(G-1),style:F,onClick:()=>V(G-1)},String(G)))),n.push(o("button",{key:"next",style:j>=G-1?E:F,onClick:j<G-1?()=>V(j+1):void 0,disabled:j>=G-1,"aria-label":"Next page"},"Next →")),le=o("div",{style:A},o("span",null,`Showing ${e}–${t} of ${X}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...n))}const ae={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},se={...M,...b?{border:"1px solid #e5e7eb"}:{}},de=o("thead",null,o("tr",null,...oe),re),ce=o("tbody",null,...ie),ue=o("table",{style:se,role:"grid","aria-rowcount":String(X)},de,ce);return o("div",{style:ae},ue,le)}function N(e){return e<10?`0${e}`:String(e)}const P={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"},j={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},_={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},O={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function Y(e){const{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:d}=e,[c,u]=l(new Date);a(()=>{const e=setInterval(()=>{u(new Date)},1e3);return()=>clearInterval(e)},[]);const{hours:p,minutes:f,seconds:h}=function(e,t){if(t){const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),o=e=>Number(n.find(t=>t.type===e)?.value??0);return{hours:o("hour"),minutes:o("minute"),seconds:o("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}(c,s);let g,x=null;"12h"===t?(x=p>=12?"PM":"AM",g=p%12||12):g=p;let b=`${N(g)}:${N(f)}`;i&&(b+=`:${N(h)}`);const m=[b];null!=x&&m.push(o("span",{style:_},x));const y=[o("span",{style:j},...m)];return n&&y.push(o("span",{style:O},function(e,t,n){if(n){const o={timeZone:n};if("short"===t)return Object.assign(o,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);if("long"===t)return Object.assign(o,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);Object.assign(o,{year:"numeric",month:"2-digit",day:"2-digit"});const r=new Intl.DateTimeFormat("en-CA",o).formatToParts(e),i=e=>r.find(t=>t.type===e)?.value??"";return`${i("year")}-${i("month")}-${i("day")}`}return"short"===t?`${N(e.getMonth()+1)}/${N(e.getDate())}/${e.getFullYear()}`:"long"===t?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${N(e.getMonth()+1)}-${N(e.getDate())}`}(c,r,s))),o("div",{style:P,...d?{class:d}:{}},...y)}const q={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},U={padding:"10px 14px",color:"#1f2937"},X={borderBottom:"1px solid #e5e7eb"},G={cursor:"pointer",transition:"background-color 0.15s ease"},K={backgroundColor:"#eff6ff"},V={padding:"24px",textAlign:"center",color:"#9ca3af",fontSize:"14px"},J={padding:"10px 14px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",fontWeight:"600",fontSize:"13px",color:"#6b7280"};function Z(e){const{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:l=!1,selectedIndex:a,onSelect:s,emptyMessage:d="No items",header:c,footer:u}=e;if(0===t.length)return o("div",null,c?o("div",{style:J},c):null,o("div",{style:V},d),u?o("div",{style:{...J,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},u):null);const p=[];for(let e=0;e<t.length;e++){const d=t[e],c=r(d,e),u=a===e,f=e===t.length-1,h={...U,...l?G:{},...u?K:{},...i&&!f?X:{}};p.push(o("li",{key:c,style:h,onClick:s?()=>s(e):void 0,role:s?"option":void 0,"aria-selected":s?String(u):void 0},n(d,e)))}return o("div",null,c?o("div",{style:J},c):null,o("ul",{style:q,role:s?"listbox":"list"},...p),u?o("div",{style:{...J,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},u):null)}function Q(e,t){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec({red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e);return n?`rgba(${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)}, ${t})`:e}const ee={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}},te={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 ne(e){const{label:t,color:n,variant:r="subtle",size:i="md",removable:l=!1,onRemove:a,icon:s,onClick:d,disabled:c=!1}=e,u=function(e){return e??"#3b82f6"}(n),p=function(e,t,n,o,r){const i=ee[n],l={display:"inline-flex",alignItems:"center",gap:i.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:i.fontSize,fontWeight:"500",padding:i.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...o?{cursor:"pointer"}:{},...r?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...l,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...l,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...l,backgroundColor:Q(e,.12),color:e,border:"none"};default:return l}}(u,r,i,!!d,c),f=[];return s&&f.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},s)),f.push(o("span",{key:"label"},t)),l&&f.push(o("button",{key:"remove",type:"button",style:te,onClick:e=>{e.stopPropagation(),!c&&a&&a()},"aria-label":`Remove ${t}`,disabled:c},"×")),o("span",{style:p,role:d?"button":void 0,tabIndex:d&&!c?"0":void 0,onClick:!c&&d?d:void 0,"aria-disabled":c?"true":void 0},...f)}const oe={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function re(e){const{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:a}=e,[d,u]=l(0),p=c(null),f=t.length*r,h=parseInt(a,10)||400,g=Math.ceil(h/r),x=Math.max(0,Math.floor(d/r)-i),b=Math.min(t.length,Math.floor(d/r)+g+i),m=s(e=>{const t=e.target;u(t.scrollTop)},[]),y=[];for(let e=x;e<b;e++)y.push(o("div",{key:String(e),style:{position:"absolute",top:e*r+"px",left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[e],e)));return o("div",{ref:p,style:{...oe,height:a},onScroll:m},o("div",{style:{height:`${f}px`,position:"relative",width:"100%"}},...y))}const ie={info:{icon:"ℹ️",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"✅",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"⚠️",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"❌",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function le(e){const[t,n]=l(!0),r=e.type??"info",i=e.variant??"subtle",a=ie[r]??ie.info,s=e.icon??a.icon,c=e.message??e.children,u=d(()=>{const e={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return"filled"===i?(e.backgroundColor=a.filledBg,e.color=a.filledText):"outline"===i?(e.backgroundColor="transparent",e.border=`1px solid ${a.border}`,e.color=a.text):(e.backgroundColor=a.bg,e.color=a.text),e},[i,a]);return t?o("div",{role:"alert",style:u},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},s),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:c?"4px":"0"}},e.title):null,c?o("div",null,c):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:"filled"===i?"1px solid currentColor":`1px solid ${a.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"}},"×"):null):null}function ae(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 se(e){const 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",l=e.backgroundColor??"#e5e7eb",a=e.height??("string"==typeof e.size?e.size:"number"==typeof e.size?`${e.size}px`:"8px"),s=e.variant??"bar",c=u();if("circular"===s){const t="number"==typeof e.size?e.size:48,n=Math.max(2,Math.round(t/10)),a=(t-n)/2,s=2*Math.PI*a,d=e.indeterminate?.75*s:s-r/100*s,u=e.indeterminate?`@keyframes liq-spin-${c}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${c}{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",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},u?o("style",null,u):null,o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:e.indeterminate?{animation:`liq-spin-${c} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${c} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:l,"stroke-width":String(n)}),o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:i,"stroke-width":String(n),"stroke-dasharray":String(s),"stroke-dashoffset":String(d),"stroke-linecap":"round",transform:`rotate(-90 ${t/2} ${t/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}const p=e.animated||e.indeterminate?`@keyframes liq-shimmer-${c}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",f=e.indeterminate?`@keyframes liq-indeterminate-${c}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",h={width:"100%",height:a,backgroundColor:l,borderRadius:a,overflow:"hidden",position:"relative"},g=d(()=>{const t={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(t.position="absolute",t.animation=`liq-indeterminate-${c} 1.5s ease-in-out infinite`,t.backgroundColor=i):(t.width=`${r}%`,t.backgroundColor=i),e.animated&&!e.indeterminate&&(t.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${function(e){const t=e.replace("#","");if(6!==t.length)return e;const n=Math.min(255,parseInt(t.slice(0,2),16)+40),o=Math.min(255,parseInt(t.slice(2,4),16)+40),r=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}(i)} 50%, ${i} 100%)`,t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${c} 1.5s ease-in-out infinite`),t},[r,i,a,e.animated,e.indeterminate,c]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100",style:{width:"100%"}},p||f?o("style",null,p+f):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:h},o("div",{style:g})))}function de(e){const t=e.variant??"text",n=!1!==e.animated,r=u(),i=d(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),l="number"==typeof e.width?`${e.width}px`:e.width,a="number"==typeof e.height?`${e.height}px`:e.height;if("text"===t){const t=e.lines??1,s=[];for(let i=0;i<t;i++){const d=i===t-1&&t>1;s.push(o("div",{key:String(i),style:ce({width:d?"75%":l??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:i<t-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:l??"100%"}},i?o("style",null,i):null,...s)}if("circular"===t){const e=l??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:ce({width:e,height:e,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:ce({width:l??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function ce(e){const 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}const ue={sm:16,md:24,lg:40},pe={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function fe(e){const t="number"==typeof e.size?e.size:ue[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=pe[e.speed??"normal"]??pe.normal,l=e.label??"Loading",a=u(),s=(t-r)/2,c=2*Math.PI*s;return o("span",{role:"status","aria-label":l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,d(()=>`@keyframes liq-rotate-${a}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[a])),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${a} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(s),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${.7*c} ${.3*c}`,"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"}},l))}function he(e){const t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:"number"==typeof t.width?`${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"},l={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:l,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:l},e.helpText):null)}function ge(e,t){const 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??{}}}const xe={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function be(e){const{checked:t,onChange:n,label:r,indeterminate:i=!1,disabled:l=!1,error:d,size:u="md"}=e,p=c(null);a(()=>{p.current&&(p.current.indeterminate=i)},[i]);const f=s(()=>{l||n(!t)},[l,t,n]),h=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),g=xe[u],x=`${g.box}px`,b={width:x,height:x,minWidth:x,borderRadius:"4px",border:"2px solid "+(d?"#ef4444":t||i?"#3b82f6":"#d1d5db"),backgroundColor:t||i?"#3b82f6":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},m={color:"#ffffff",fontSize:`${g.icon}px`,lineHeight:"1",fontWeight:"700"},y=i?o("span",{style:m},"—"):t?o("span",{style:m},"✓"):null,v={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},k=o("input",{ref:p,type:"checkbox",checked:t,disabled:l,onChange:()=>n(!t),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),S=o("div",{style:b},y),w=r?o("span",{style:{fontSize:g.fontSize,color:"#374151"}},r):null;return o(he,{error:d},o("div",{style:v,onClick:f,onKeyDown:h,tabIndex:l?-1:0,role:"checkbox","aria-checked":i?"mixed":t?"true":"false","aria-disabled":l?"true":void 0},k,S,w))}const me=["#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 ye(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function ve(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 ke(e){const{value:t,onChange:n,presets:r=me,showInput:i=!0,showAlpha:d=!1,disabled:u=!1,label:p}=e,[f,h]=l(!1),[g,x]=l(t),b=c(null);a(()=>{x(t)},[t]),a(()=>{const e=e=>{b.current&&!b.current.contains(e.target)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const m=s(e=>{u||n(ve(e))},[u,n]),y=s(e=>{const t=e.target.value;x(t);const o=t.startsWith("#")?t:`#${t}`;ye(o)&&n(ve(o))},[n]),v=s(()=>{ye(g.startsWith("#")?g:`#${g}`)||x(t)},[g,t]),k={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:t,cursor:u?"not-allowed":"pointer",flexShrink:"0"},S={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:i?"8px":"0"},w=r.map(e=>{const n=ve(e)===ve(t);return o("div",{key:e,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:e,cursor:u?"not-allowed":"pointer",border:n?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>m(e),title:e})}),$=i?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:t,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:g,onInput:y,onBlur:v,disabled:u,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,C=f?o("div",{style:{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"}},o("div",{style:S},...w),$):null;return o(he,{label:p,disabled:u},o("div",{ref:b,style:{position:"relative"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:u?void 0:()=>h(!f)},o("div",{style:k}),i?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},t):null),C))}function Se(e){const{value:t="#000000",onChange:n,size:r=32,showLabel:i=!0,disabled:a=!1,label:d}=e,[u,p]=l(t),f=c(null),h=s((...e)=>{const t=e[0].target.value;p(t),n?.(t)},[n]),g={width:`${r}px`,height:`${r}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:a?"not-allowed":"pointer",position:"relative",overflow:"hidden"},x={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:a?"not-allowed":"pointer",border:"none",padding:"0"};return o("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"}},d?o("label",{style:{fontSize:"12px",color:"#64748b",fontWeight:"500"}},d):null,o("div",{style:g},o("input",{ref:f,type:"color",value:u,onInput:h,disabled:a,style:x})),i?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null)}const we=["January","February","March","April","May","June","July","August","September","October","November","December"],$e=["Su","Mo","Tu","We","Th","Fr","Sa"];function Ce(e){if(!e)return null;if(e instanceof Date)return e;const t=new Date(e);return isNaN(t.getTime())?null:t}function ze(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Me(e){const{value:t,onChange:n,format:r="YYYY-MM-DD",minDate:i,maxDate:u,disabled:p=!1,placeholder:f="Select date...",label:h,error:g}=e,x=d(()=>Ce(t),[t]),b=d(()=>Ce(i),[i]),m=d(()=>Ce(u),[u]),[y,v]=l(!1),[k,S]=l(()=>x?x.getFullYear():(new Date).getFullYear()),[w,$]=l(()=>x?x.getMonth():(new Date).getMonth()),C=c(null),z=d(()=>new Date,[]);a(()=>{const e=e=>{C.current&&!C.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const M=s(()=>{$(e=>0===e?(S(e=>e-1),11):e-1)},[]),I=s(()=>{$(e=>11===e?(S(e=>e+1),0):e+1)},[]),L=s(e=>{const t=new Date(k,w,e);b&&t<b||m&&t>m||(n(function(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t)),v(!1))},[k,w,n,b,m]),R=x?function(e,t){const n=e.getFullYear(),o=e.getMonth()+1,r=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(o).padStart(2,"0")).replace("DD",String(r).padStart(2,"0"))}(x,r):"",D=d(()=>{const e=new Date(k,w,1).getDay(),t=new Date(k,w+1,0).getDate(),n=[];let o=[];for(let t=0;t<e;t++)o.push(null);for(let e=1;e<=t;e++)o.push(e),7===o.length&&(n.push(o),o=[]);for(;o.length>0&&o.length<7;)o.push(null);return o.length&&n.push(o),n},[k,w]),A={...ge({},{focused:y,error:!!g}),cursor:p?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},F={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},T=$e.map(e=>o("div",{key:e,style:{padding:"4px"}},e)),E=D.map((e,t)=>{const n=e.map((e,n)=>{if(null===e)return o("div",{key:`empty-${t}-${n}`,style:{padding:"4px"}});const r=new Date(k,w,e),i=ze(r,z),l=!!x&&ze(r,x),a=b&&r<b||m&&r>m;return o("div",{key:`day-${e}`,style:{padding:"4px",textAlign:"center",cursor:a?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:i?"700":"400",backgroundColor:l?"#3b82f6":"transparent",color:l?"#ffffff":a?"#d1d5db":i?"#3b82f6":"#1f2937",border:i&&!l?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"},onClick:a?void 0:()=>L(e)},String(e))});return o("div",{key:`row-${t}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...n)}),W=y?o("div",{style:{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"}},o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"}},o("button",{type:"button",style:F,onClick:M},"◀"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${we[w]} ${k}`),o("button",{type:"button",style:F,onClick:I},"▶")),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"}},...T),...E):null;return o(he,{label:h,error:g,disabled:p},o("div",{ref:C,style:{position:"relative"}},o("div",{style:A,onClick:p?void 0:()=>v(!y),tabIndex:p?-1:0,role:"button","aria-label":"Pick a date"},o("span",{style:{color:R?"#1f2937":"#9ca3af"}},R||f),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"📅")),W))}function Ie(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${["B","KB","MB","GB"][t]}`}function Le(e){const{onChange:t,accept:n,multiple:r=!1,maxSize:i,disabled:a=!1,label:d,helpText:u}=e,[p,f]=l([]),[h,g]=l(!1),[x,b]=l(""),m=c(null),y=s(e=>{b("");const n=[];for(const t of e)i&&t.size>i?b(`File "${t.name}" exceeds maximum size of ${Ie(i)}`):n.push(t);const o=r?[...p,...n]:n.slice(0,1);f(o),t(o)},[p,r,i,t]),v=s(e=>{if(e.preventDefault(),e.stopPropagation(),g(!1),a)return;const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);y(n)},[a,y]),k=s(e=>{e.preventDefault(),e.stopPropagation(),a||g(!0)},[a]),S=s(e=>{e.preventDefault(),e.stopPropagation(),g(!1)},[]),w=s(e=>{const t=e.target;t.files&&(y(Array.from(t.files)),t.value="")},[y]),$=s(e=>{const n=p.filter((t,n)=>n!==e);f(n),t(n)},[p,t]),C=s(()=>{a||m.current&&m.current.click()},[a]),z={border:"2px dashed "+(h?"#3b82f6":x?"#ef4444":"#d1d5db"),borderRadius:"8px",padding:"24px",textAlign:"center",cursor:a?"not-allowed":"pointer",backgroundColor:h?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:a?"0.6":"1"},M={fontSize:"12px",color:"#9ca3af"},I=o("input",{ref:m,type:"file",accept:n,multiple:r,onChange:w,disabled:a,style:{display:"none"},tabIndex:-1}),L=o("div",{style:z,onClick:C,onDrop:v,onDragOver:k,onDragLeave:S,role:"button",tabIndex:a?-1:0,"aria-label":"Upload files"},o("div",{style:{fontSize:"28px",color:"#9ca3af",marginBottom:"8px"}},"↑"),o("div",{style:{fontSize:"14px",color:"#374151",marginBottom:"4px"}},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),n?o("div",{style:M},n):null,i?o("div",{style:M},`Max size: ${Ie(i)}`):null),R=p.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...p.map((e,t)=>o("div",{key:`file-${t}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},Ie(e.size))),o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"},onClick:e=>{e.stopPropagation(),$(t)},"aria-label":`Remove ${e.name}`},"✕")))):null;return o(he,{label:d,helpText:u,error:x||void 0,disabled:a},o("div",null,I,L,R))}function Re(e){const[t,n]=l(!1),[r,i]=l((e.value??e.defaultValue??"").length),a=e.id??`ml-${Math.random().toString(36).slice(2,8)}`,d={...ge(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}:{}},c=s(t=>{const n=t.target,o=n.value;i(o.length),e.onChange&&e.onChange(o),e.autoResize&&(n.style.height="auto",n.style.height=`${n.scrollHeight}px`)},[e.onChange,e.autoResize]),u=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:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:c}),p=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>.9*(e.maxLength??1/0)?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(he,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},u,p)}function De(e){const{value:t,onChange:n,min:r,max:i,step:a=1,disabled:d=!1,prefix:c,suffix:u,label:p,error:f}=e,[h,g]=l(!1),x=s(e=>{let t=e;return void 0!==r&&t<r&&(t=r),void 0!==i&&t>i&&(t=i),t},[r,i]),b=s(()=>{d||n(x(t+a))},[d,t,a,x,n]),m=s(()=>{d||n(x(t-a))},[d,t,a,x,n]),y=s(e=>{const t=e.target.value;if(""===t||"-"===t)return;const o=parseFloat(t);isNaN(o)||n(x(o))},[x,n]),v=s(e=>{d||("ArrowUp"===e.key?(e.preventDefault(),b()):"ArrowDown"===e.key&&(e.preventDefault(),m()))},[d,b,m]),k=void 0===i||t<i,S={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:"1px solid "+(f?"#ef4444":h?"#3b82f6":"#d1d5db"),transition:"border-color 0.15s",opacity:d?"0.6":"1",...h&&!f?{boxShadow:"0 0 0 3px #3b82f622"}:{}},w=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"#f9fafb",border:"none",cursor:d||!e?"not-allowed":"pointer",color:d||!e?"#d1d5db":"#374151",fontSize:"16px",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),$={display:"flex",alignItems:"center",fontSize:"13px",color:"#6b7280",padding:"0 4px",backgroundColor:"#f9fafb"},C=o("button",{type:"button",style:w(void 0===r||t>r),onClick:m,disabled:d,"aria-label":"Decrement",tabIndex:-1},"−"),z=c?o("span",{style:$},c):null,M=o("input",{type:"text",value:String(t),onInput:y,onKeyDown:v,onFocus:()=>g(!0),onBlur:()=>g(!1),disabled:d,style:{flex:"1",minWidth:"48px",textAlign:"center",border:"none",borderLeft:"1px solid #e5e7eb",borderRight:"1px solid #e5e7eb",outline:"none",fontSize:"14px",fontFamily:"inherit",backgroundColor:"#ffffff",color:"#1f2937",padding:"8px 4px"},"aria-label":p||"Number",role:"spinbutton","aria-valuenow":String(t),"aria-valuemin":void 0!==r?String(r):void 0,"aria-valuemax":void 0!==i?String(i):void 0}),I=u?o("span",{style:$},u):null,L=o("button",{type:"button",style:w(k),onClick:b,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),R=[C];return z&&R.push(z),R.push(M),I&&R.push(I),R.push(L),o(he,{label:p,error:f,disabled:d},o("div",{style:S},...R))}function Ae(e){const{options:t,value:n,onChange:r,name:i,direction:l="vertical",disabled:a=!1,error:d,label:c}=e,u=s(e=>{a||r(e)},[a,r]),p=s(e=>{if(a)return;const o=t.filter(e=>!e.disabled);if(0===o.length)return;const i=o.findIndex(e=>e.value===n);let l=i;if("ArrowDown"===e.key||"ArrowRight"===e.key)e.preventDefault(),l=i<o.length-1?i+1:0;else{if("ArrowUp"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault(),l=i>0?i-1:o.length-1}r(o[l].value)},[a,t,n,r]),f={display:"flex",flexDirection:"horizontal"===l?"row":"column",gap:"horizontal"===l?"16px":"8px"},h=t.map(e=>{const t=e.value===n,r=a||!!e.disabled,l={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:"2px solid "+(d?"#ef4444":t?"#3b82f6":"#d1d5db"),display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},s={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:t?"scale(1)":"scale(0)"},c={display:"inline-flex",alignItems:"center",gap:"8px",cursor:r?"not-allowed":"pointer",opacity:r?"0.5":"1",userSelect:"none"};return o("label",{key:e.value,style:c,onClick:r?void 0:t=>{t.preventDefault(),u(e.value)}},o("input",{type:"radio",name:i,value:e.value,checked:t,disabled:r,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:l},o("div",{style:s})),o("span",{style:{fontSize:"14px",color:"#374151"}},e.label))});return o(he,{label:c,error:d},o("div",{style:f,role:"radiogroup","aria-label":c,onKeyDown:p,tabIndex:a?-1:0},...h))}function Fe(e){const{options:t,value:n,onChange:r,placeholder:i="Select...",searchable:u=!1,multiple:p=!1,clearable:f=!1,disabled:h=!1,error:g,label:x,helpText:b}=e,[m,y]=l(!1),[v,k]=l(""),[S,w]=l(-1),$=c(null),C=d(()=>Array.isArray(n)?n:n?[n]:[],[n]),z=d(()=>{if(!u||!v)return t;const e=v.toLowerCase();return t.filter(t=>t.label.toLowerCase().includes(e))},[t,v,u]),M=d(()=>{const e={},t=[];for(const n of z)n.group?(e[n.group]||(e[n.group]=[]),e[n.group].push(n)):t.push(n);return{groups:e,ungrouped:t}},[z]),I=d(()=>0===C.length?"":C.map(e=>t.find(t=>t.value===e)).filter(Boolean).map(e=>e.label).join(", "),[C,t]);a(()=>{const e=e=>{const t=e.target;$.current&&!$.current.contains(t)&&(y(!1),k(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const L=s(e=>{if(p){const t=C.includes(e)?C.filter(t=>t!==e):[...C,e];r(t)}else r(e),y(!1),k("")},[p,C,r]),R=s(e=>{e.stopPropagation(),r(p?[]:"")},[p,r]),D=s(e=>{if(h)return;const t=e.key;if(!m&&("Enter"===t||" "===t||"ArrowDown"===t))return e.preventDefault(),y(!0),void w(0);if(m){if("Escape"===t)return y(!1),void k("");if("ArrowDown"===t)e.preventDefault(),w(e=>Math.min(e+1,z.length-1));else if("ArrowUp"===t)e.preventDefault(),w(e=>Math.max(e-1,0));else if("Enter"===t&&S>=0&&S<z.length){e.preventDefault();const t=z[S];t.disabled||L(t.value)}}},[h,m,S,z,L]),A={...ge({},{focused:m,error:!!g}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},F=(e,t)=>{const n=C.includes(e.value),r=t===S,i={padding:"8px 12px",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:r?"#f3f4f6":n?"#eff6ff":"transparent",color:e.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:e.value,style:i,onClick:e.disabled?void 0:()=>L(e.value),onMouseEnter:()=>w(t),role:"option","aria-selected":n?"true":"false","aria-disabled":e.disabled?"true":void 0},p&&n?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"✓"):null,e.label)},T=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:m?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"▼"),E=o("div",{style:A,onClick:h?void 0:()=>{y(!m),w(-1)},onKeyDown:D,tabIndex:h?-1:0,role:"combobox","aria-expanded":m?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:I?"#1f2937":"#9ca3af"}},I||i),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},f&&C.length>0?o("span",{onClick:R,style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button","aria-label":"Clear selection"},"✕"):null,T)),W=u&&m?o("input",{type:"text",value:v,onInput:e=>{k(e.target.value),w(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,B=m?o("div",{style:{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"},role:"listbox"},W,...(()=>{const e=[];let t=0;const{groups:n,ungrouped:r}=M;for(const n of r)e.push(F(n,t++));for(const r of Object.keys(n)){e.push(o("div",{key:`group-${r}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},r));for(const o of n[r])e.push(F(o,t++))}return 0===e.length&&e.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),e})()):null;return o(he,{label:x,error:g,helpText:b,disabled:h},o("div",{ref:$,style:{position:"relative"}},E,B))}function Te(e){const{value:t,onChange:n,min:r=0,max:i=100,step:u=1,showValue:p=!1,showTicks:f=!1,disabled:h=!1,marks:g,range:x=!1,label:b,error:m}=e,y=c(null),[v,k]=l(null),S=d(()=>{if(x&&Array.isArray(t))return t;const e="number"==typeof t?t:0;return[e,e]},[t,x]),w=e=>{const t=Math.round((e-r)/u)*u+r;return Math.max(r,Math.min(i,t))},$=e=>(e-r)/(i-r)*100,C=s(e=>{if(!y.current)return r;const t=y.current.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));return w(r+n*(i-r))},[r,i,u]),z=s(e=>t=>{h||(t.preventDefault(),k(e))},[h]),M=s(e=>{if(h)return;const t=C(e);if(x){const e=Math.abs(t-S[0]),o=Math.abs(t-S[1]);n(e<=o?[w(t),S[1]]:[S[0],w(t)])}else n(w(t))},[h,C,x,S,n,r,i,u]);a(()=>{if(!v)return;const e=e=>{const t=C(e);"single"===v?n(w(t)):"start"===v?n([Math.min(w(t),S[1]),S[1]]):"end"===v&&n([S[0],Math.max(S[0],w(t))])},t=()=>k(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[v,C,S,n,r,i,u]);const I=s(e=>{if(h)return;let o=0;if("ArrowRight"===e.key||"ArrowUp"===e.key)o=u;else{if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key)return;o=-u}e.preventDefault(),x||n(w(("number"==typeof t?t:0)+o))},[h,u,x,t,n,r,i]),L={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},R=x?$(S[0]):0,D={position:"absolute",top:"0",left:`${R}%`,width:$(x?S[1]:S[0])-R+"%",height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},A=(e,t,n)=>o("div",{style:{position:"absolute",top:"50%",left:`${e}%`,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"},onMouseDown:z(t),role:"slider","aria-valuenow":String(n),"aria-valuemin":String(r),"aria-valuemax":String(i),tabIndex:h?-1:0,onKeyDown:I},p?o("div",{style:{position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"}},String(n)):null),F=[];if(f)for(let e=r;e<=i;e+=u)F.push(o("div",{key:`tick-${e}`,style:{position:"absolute",top:"10px",left:`${$(e)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));const T=[];if(g)for(const e of g)T.push(o("div",{key:`mark-${e.value}`,style:{position:"absolute",top:"18px",left:`${$(e.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},e.label));const E={paddingTop:p?"28px":"8px",paddingBottom:g||f?"28px":"8px",opacity:h?"0.6":"1"},W=[];return x?(W.push(A($(S[0]),"start",S[0])),W.push(A($(S[1]),"end",S[1]))):W.push(A($(S[0]),"single",S[0])),o(he,{label:b,error:m},o("div",{style:E},o("div",{ref:y,style:L,onClick:M},o("div",{style:D}),...W,...F,...T)))}const Ee=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],We={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:"•",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"“",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"🔗",command:"createLink"},unlink:{label:"Remove link",icon:"⛔",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"―",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"✘",command:"removeFormat"},undo:{label:"Undo",icon:"↩",command:"undo"},redo:{label:"Redo",icon:"↪",command:"redo"}};function Be(e){const[t,n]=l(!1),r=c(null),i=e.id??`te-${Math.random().toString(36).slice(2,8)}`,d=e.toolbar??Ee,u=e.toolbarStyle??{},p=e.editorStyle??{};a(()=>{r.current&&void 0!==e.value&&(r.current.innerHTML=e.value)},[]);const f=s((t,n)=>{if(!e.disabled&&!e.readOnly){if("createLink"===t){const e=prompt("Enter URL:");if(!e)return;document.execCommand(t,!1,e)}else n&&"formatBlock"===t?document.execCommand(t,!1,`<${n}>`):document.execCommand(t,!1,n);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]),g=s(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),x=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:u.backgroundColor??"#f9fafb",borderBottom:u.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...d.map(t=>{const n=We[t];return n?o("button",{key:t,type:"button",title:n.label,onClick:()=>f(n.command,n.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:u.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:u.buttonSize??"13px",fontWeight:"bold"===t?"700":"italic"===t?"400":"500",fontStyle:"italic"===t?"italic":"normal",textDecoration:"underline"===t?"underline":"strikethrough"===t?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},n.icon):null})),b=o("div",{ref:r,id:i,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:p.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:p.backgroundColor??"#ffffff",color:p.color??"#1f2937",fontFamily:p.fontFamily??"inherit",fontSize:p.fontSize??"14px",lineHeight:p.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:g,onInput:h});return o(he,{label:e.label,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"}},x,b))}function He(e){const[t,n]=l(!1),r=e.id??`tf-${Math.random().toString(36).slice(2,8)}`,i=ge(e.inputStyle??{},{focused:t,error:!!e.error}),a=!(!e.prefix&&!e.suffix),s=o("input",{type:e.type??"text",id:r,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?{...i,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:i,onFocus:()=>n(!0),onBlur:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:t=>{const n=t.target.value;e.onInput&&e.onInput(n),e.onChange&&e.onChange(n)},onKeyDown:t=>{"Enter"===t.key&&e.onEnter&&e.onEnter(t.target.value)}}),d=a?o("div",{style:{...i,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,s,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):s;return o(he,{label:e.label,htmlFor:r,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}const Ne=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Pe(e){return String(e).padStart(2,"0")}function je(e){const{value:t,onChange:n,format:r="24h",minuteStep:i=1,disabled:a=!1,label:c,error:u,showSeconds:p=!1,timezone:f,showTimezone:h=!1,timezones:g=Ne,onTimezoneChange:x}=e,[b,m]=l(!1),y=d(()=>function(e){const t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}(t),[t]),v="12h"===r,k=y.hour>=12,S=v?y.hour%12||12:y.hour,w=s((e,t,o)=>{const r=Math.max(0,Math.min(23,e)),i=Math.max(0,Math.min(59,t)),l=Math.max(0,Math.min(59,o??0));n(p?`${Pe(r)}:${Pe(i)}:${Pe(l)}`:`${Pe(r)}:${Pe(i)}`)},[n,p]),$=s(e=>{let t=parseInt(e.target.value,10)||0;v&&(t%=12,k&&(t+=12)),w(t,y.minute,y.second)},[v,k,y.minute,y.second,w]),C=s(e=>{const t=parseInt(e.target.value,10)||0;w(y.hour,t,y.second)},[y.hour,y.second,w]),z=s(e=>{const t=parseInt(e.target.value,10)||0;w(y.hour,y.minute,t)},[y.hour,y.minute,w]),M=s(()=>{if(a)return;const e=k?y.hour-12:y.hour+12;w(e,y.minute,y.second)},[a,k,y.hour,y.minute,y.second,w]),I=s(e=>{a||w(y.hour+e,y.minute,y.second)},[a,y.hour,y.minute,y.second,w]),L=s(e=>{a||w(y.hour,y.minute+e*i,y.second)},[a,y.hour,y.minute,y.second,i,w]),R=s(e=>{a||w(y.hour,y.minute,y.second+e)},[a,y.hour,y.minute,y.second,w]),D=s(e=>{const t=e.target.value;x&&x(t)},[x]),A={display:"inline-flex",alignItems:"center",gap:"4px",...ge({},{focused:b,error:!!u})},F={display:"flex",flexDirection:"column",alignItems:"center"},T={background:"none",border:"none",cursor:a?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},E={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},W={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},B=o("div",{style:F},o("button",{type:"button",style:T,onClick:()=>I(1),disabled:a},"▲"),o("input",{type:"text",value:Pe(S),onChange:$,style:E,disabled:a,"aria-label":"Hour",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:T,onClick:()=>I(-1),disabled:a},"▼")),H=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),N=o("div",{style:F},o("button",{type:"button",style:T,onClick:()=>L(1),disabled:a},"▲"),o("input",{type:"text",value:Pe(y.minute),onChange:C,style:E,disabled:a,"aria-label":"Minute",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:T,onClick:()=>L(-1),disabled:a},"▼")),P=p?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,j=p?o("div",{style:F},o("button",{type:"button",style:T,onClick:()=>R(1),disabled:a},"▲"),o("input",{type:"text",value:Pe(y.second),onChange:z,style:E,disabled:a,"aria-label":"Second",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:T,onClick:()=>R(-1),disabled:a},"▼")):null,_=v?o("button",{type:"button",style:W,onClick:M,disabled:a,"aria-label":"Toggle AM/PM"},k?"PM":"AM"):null,O={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},Y=f&&!h?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},f):null,q=h?o("select",{style:O,value:f??g[0],onChange:D,disabled:a,"aria-label":"Timezone"},...g.map(e=>o("option",{key:e,value:e},e))):null,U=[B,H,N];return P&&U.push(P),j&&U.push(j),_&&U.push(_),Y&&U.push(Y),q&&U.push(q),o(he,{label:c,error:u,disabled:a},o("div",{style:A},...U))}const _e={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 Oe(e){const{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:l=!1,size:a="md",onColor:d="#3b82f6",offColor:c="#d1d5db"}=e,u=_e[a],p=s(()=>{l||n(!t)},[l,t,n]),f=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),h={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?d:c,position:"relative",cursor:l?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},g=t?u.trackW-u.thumbSize-u.offset:u.offset,x={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${g}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},b={display:"inline-flex",alignItems:"center",gap:"8px",opacity:l?"0.5":"1",userSelect:"none"},m=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,y=o("div",{style:h},o("div",{style:x}));return o("div",{style:b,onClick:p,onKeyDown:f,tabIndex:l?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},...("left"===i?[m,y]:[y,m]).filter(Boolean))}const Ye={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 qe(e){const t=!1!==e.bordered,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",l=d(()=>{const o={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=Ye[n]??Ye.sm,e.hoverable&&(o.cursor="pointer"),{...o,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},s={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},c={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:l},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:s},e.children),e.footer?o("div",{className:"card__footer",style:c},e.footer):null)}function Ue(e){const t=d(()=>{const t={display:e.inline?"inline-flex":"flex"};return e.direction&&(t.flexDirection=e.direction),e.wrap&&(t.flexWrap=e.wrap),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyContent&&(t.justifyContent=e.justifyContent),{...t,...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 Xe(e){const t=d(()=>{const t={};return e.flex&&(t.flex=e.flex),void 0!==e.grow&&(t.flexGrow=String(e.grow)),void 0!==e.shrink&&(t.flexShrink=String(e.shrink)),e.basis&&(t.flexBasis=e.basis),e.alignSelf&&(t.alignSelf=e.alignSelf),void 0!==e.order&&(t.order=String(e.order)),{...t,...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 Ge(e){const t=d(()=>{const t={display:"grid"};return e.minColWidth?t.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:void 0!==e.columns&&(t.gridTemplateColumns="number"==typeof e.columns?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(t.gridTemplateRows=e.rows),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyItems&&(t.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(t.gridTemplateAreas=e.areas.map(e=>`"${e}"`).join(" ")),{...t,...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 Ke(e){const t=d(()=>{const t={};return e.gridColumn&&(t.gridColumn=e.gridColumn),e.gridRow&&(t.gridRow=e.gridRow),e.gridArea&&(t.gridArea=e.gridArea),e.alignSelf&&(t.alignSelf=e.alignSelf),e.justifySelf&&(t.justifySelf=e.justifySelf),{...t,...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)}const Ve={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function Je(e){const t=!1!==e.bordered,n=e.shadow??"none",[r,i]=l(!!e.defaultCollapsed),u=c(null),[p,f]=l("auto");a(()=>{if(!e.collapsible)return;const t=u.current;t&&f(`${t.scrollHeight}px`)},[e.children,e.collapsible]);const h=s(()=>{e.collapsible&&i(e=>!e)},[e.collapsible]),g=d(()=>{const o={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=Ve[n]??Ve.none,{...o,...e.style??{}}},[t,n,e.style]),x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},b={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"},m={maxHeight:r?"0":p,overflow:"hidden",transition:"max-height 0.3s ease"};return o("div",{className:`panel ${e.className??""}`.trim(),style:g},o("div",{className:"panel__header",style:x,onClick:h,role:e.collapsible?"button":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:b}):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?m:{},ref:u},o("div",{className:"panel__body",style:{padding:"16px"}},e.children)))}function Ze(e,t){return"both"===e?"auto":"horizontal"===e?"x"===t?"auto":"hidden":"y"===t?"auto":"hidden"}function Qe(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":case"hover":return{scrollbarWidth:"thin"};default:return{scrollbarWidth:"auto"}}}function et(e){const t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=c(null),[u,p]=l(!0),[f,h]=l(!1),[g,x]=l(!0),[b,m]=l(!1),y=s(()=>{const e=i.current;e&&(p(e.scrollTop<=2),h(e.scrollTop+e.clientHeight>=e.scrollHeight-2),x(e.scrollLeft<=2),m(e.scrollLeft+e.clientWidth>=e.scrollWidth-2))},[]);a(()=>{y()},[y]);const v=s(()=>{r&&y()},[r,y]),k=d(()=>{const o={position:"relative",overflowX:Ze(t,"x"),overflowY:Ze(t,"y"),...Qe(n)};return e.maxHeight&&(o.maxHeight=e.maxHeight),e.maxWidth&&(o.maxWidth=e.maxWidth),e.padding&&(o.padding=e.padding),{...o,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),S=[];if(r){const e="vertical"===t||"both"===t,n="horizontal"===t||"both"===t;e&&!u&&S.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),e&&!f&&S.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),n&&!g&&S.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),n&&!b&&S.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}const w={...k};return S.length>0&&(w.boxShadow=S.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:w,ref:i,onScroll:v},e.children)}function tt(e){const t=e.direction??"horizontal",n="horizontal"===t,r=e.dividerSize??6,i=e.minSize??50,[u,p]=l(e.initialSplit??50),f=c(null),h=c(!1),g=s(e=>{e.preventDefault(),h.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);a(()=>{const t=t=>{if(!h.current||!f.current)return;const o=f.current.getBoundingClientRect(),r=n?o.width:o.height,l=n?t.clientX-o.left:t.clientY-o.top;if(r<=0)return;const a=i/r*100,s=e.maxSize?e.maxSize/r*100:100-a;let d=l/r*100;d=Math.max(a,Math.min(s,d)),p(d)},o=()=>{h.current&&(h.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",t),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o)}},[n,i,e.maxSize]);const x=d(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),b=n?{width:`calc(${u}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${u}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},m={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%"}},y=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:x,ref:f},o("div",{className:"splitter__pane splitter__pane--first",style:b},y[0]??null),o("div",{className:"splitter__divider",style:m,onMouseDown:g,role:"separator","aria-orientation":n?"vertical":"horizontal"}),o("div",{className:"splitter__pane splitter__pane--second",style:{flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"}},y[1]??null))}function nt(e){const t=e.position??"top",n=e.variant??"line",r=e.tabs.find(e=>!e.disabled)?.id??"",[i,a]=l(e.activeTab??r),u=e.activeTab??i,p=c(null),f=s(t=>{a(t),e.onChange&&e.onChange(t)},[e.onChange]),h=s(n=>{const o=e.tabs.filter(e=>!e.disabled),r=o.findIndex(e=>e.id===u);if(-1===r)return;const i="left"===t||"right"===t,l=i?"ArrowUp":"ArrowLeft",a=i?"ArrowDown":"ArrowRight";let s=-1;if(n.key===l?s=r>0?r-1:o.length-1:n.key===a?s=r<o.length-1?r+1:0:"Home"===n.key?s=0:"End"===n.key&&(s=o.length-1),s>=0){n.preventDefault(),f(o[s].id);const t=p.current;if(t){const n=t.querySelectorAll('[role="tab"]')[e.tabs.indexOf(o[s])];n&&n.focus()}}},[e.tabs,u,t,f]),g="left"===t||"right"===t,x="bottom"===t||"right"===t,b=d(()=>({display:"flex",flexDirection:g?x?"row-reverse":"row":x?"column-reverse":"column",width:"100%",...e.style??{}}),[g,x,e.style]),m={display:"flex",flexDirection:g?"column":"row",gap:"pill"===n?"4px":"0",..."line"!==n||g?{}:{borderBottom:"2px solid #e5e7eb"},..."line"===n&&g?{borderRight:"left"===t?"2px solid #e5e7eb":"none",borderLeft:"right"===t?"2px solid #e5e7eb":"none"}:{},..."card"===n?{backgroundColor:"#f9fafb"}:{},..."pill"===n?{padding:"4px"}:{},flexShrink:"0"},y=e.tabs.find(e=>e.id===u),v=e.tabs.map(e=>{const r=e.id===u,i={padding:"8px 16px",border:"none",background:"none",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?"0.5":"1",fontSize:"14px",fontWeight:r?"600":"400",color:r?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return"line"===n?g?"left"===t?(i.borderRight=r?"2px solid #3b82f6":"2px solid transparent",i.marginRight="-2px"):(i.borderLeft=r?"2px solid #3b82f6":"2px solid transparent",i.marginLeft="-2px"):(i.borderBottom=r?"2px solid #3b82f6":"2px solid transparent",i.marginBottom="-2px"):"card"===n?(i.backgroundColor=r?"#ffffff":"transparent",i.borderRadius="6px 6px 0 0",r&&(i.border="1px solid #e5e7eb",i.borderBottom="1px solid #ffffff")):"pill"===n&&(i.borderRadius="9999px",i.backgroundColor=r?"#3b82f6":"transparent",i.color=r?"#ffffff":"#6b7280"),o("button",{key:e.id,role:"tab","aria-selected":String(r),"aria-controls":`tabpanel-${e.id}`,"aria-disabled":e.disabled?"true":void 0,id:`tab-${e.id}`,tabIndex:r?"0":"-1",style:i,onClick:e.disabled?void 0:()=>f(e.id),onKeyDown:h},e.icon?o("span",{className:"tabs__tab-icon"},e.icon):null,e.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:b},o("div",{className:"tabs__list",role:"tablist","aria-orientation":g?"vertical":"horizontal",style:m,ref:p},...v),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${u}`,"aria-labelledby":`tab-${u}`,style:{flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},tabIndex:"0"},y?y.content:null))}function ot(e){const t=e.items??[],n=t.length,r=!1!==e.loop,i=!1!==e.showDots,p=!1!==e.showArrows,f=e.animation??"slide",h=e.interval??5e3,g=u(),[x,b]=l(0),m=c(null),y=c(null),v=s(t=>{let o=t;o=r?(t%n+n)%n:Math.max(0,Math.min(t,n-1)),b(o),e.onChange&&e.onChange(o)},[n,r,e.onChange]),k=s(()=>v(x+1),[x,v]),S=s(()=>v(x-1),[x,v]);a(()=>{if(!e.autoPlay||n<=1)return;const t=setInterval(k,h);return()=>clearInterval(t)},[e.autoPlay,h,k,n]),a(()=>{const e=e=>{"ArrowLeft"===e.key?S():"ArrowRight"===e.key&&k()},t=y.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[k,S]);const w="fade"===f?`@keyframes liq-fade-in-${g}{from{opacity:0}to{opacity:1}}`:"",$=d(()=>"fade"===f?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${100*x}%)`,width:"100%"},[x,f]),C={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},z=t.map((e,t)=>{const n="fade"===f?{position:t===x?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:t===x?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(t),style:n},e.content,e.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},e.caption):null)}),M=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((e,t)=>o("button",{key:String(t),"aria-label":`Go to slide ${t+1}`,onclick:()=>v(t),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:t===x?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:y,tabindex:"0",role:"region","aria-label":"Carousel",style:{position:"relative",overflow:"hidden",width:"100%",outline:"none"},onpointerdown:e=>{m.current=e.clientX},onpointerup:e=>{if(null==m.current)return;const t=e.clientX-m.current;t>50?S():t<-50&&k(),m.current=null}},w?o("style",null,w):null,o("div",{style:$},...z),p&&n>1?o("button",{"aria-label":"Previous slide",onclick:S,style:{...C,left:"8px"}},"‹"):null,p&&n>1?o("button",{"aria-label":"Next slide",onclick:k,style:{...C,right:"8px"}},"›"):null,M)}function rt(e){const[t,n]=l("loading"),r=c(null),i=u(),s=!1!==e.lazy,p="number"==typeof e.width?`${e.width}px`:e.width,f="number"==typeof e.height?`${e.height}px`:e.height;a(()=>{n("loading")},[e.src]);const h=d(()=>{const t={display:"inline-block",position:"relative",overflow:"hidden"};return p&&(t.width=p),f&&(t.height=f),e.borderRadius&&(t.borderRadius=e.borderRadius),t},[p,f,e.borderRadius]),g=d(()=>{const n={display:"block",width:"100%",height:"100%"};return e.objectFit&&(n.objectFit=e.objectFit),"loading"===t&&(n.opacity="0",n.position="absolute"),"error"===t&&(n.display="none"),n},[e.objectFit,t]);let x=null;"loading"===t&&("skeleton"===e.placeholder?x=o("div",null,o("style",null,`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`),o("div",{style:{width:p??"100%",height:f??"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`}})):"blur"===e.placeholder?x=o("div",{style:{width:p??"100%",height:f??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):null!=e.placeholder&&!1!==e.placeholder&&(x=e.placeholder));let b=null;"error"===t&&null!=e.fallback&&(b="string"==typeof e.fallback?o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):e.fallback);const m=o("div",{style:h},x,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:g,onload:()=>n("loaded"),onerror:()=>n("error")}),b);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},m,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):m}function it(e){return!isFinite(e)||e<0?"0:00":`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function lt(e){const t=!1!==e.controls,n=c(null);u();const[r,i]=l(!1),[d,p]=l(0),[f,h]=l(0),[g,x]=l(e.muted?0:1),[b,m]=l(!!e.muted),[y,v]=l(!0),k="number"==typeof e.width?`${e.width}px`:e.width??"100%",S="number"==typeof e.height?`${e.height}px`:e.height??"auto";a(()=>{const t=n.current;if(!t)return;const o=()=>{i(!0),e.onPlay&&e.onPlay()},r=()=>{i(!1),e.onPause&&e.onPause()},l=()=>{i(!1),e.onEnded&&e.onEnded()},a=()=>{p(t.currentTime),h(t.duration),e.onTimeUpdate&&e.onTimeUpdate(t.currentTime,t.duration)},s=()=>{h(t.duration)};return t.addEventListener("play",o),t.addEventListener("pause",r),t.addEventListener("ended",l),t.addEventListener("timeupdate",a),t.addEventListener("loadedmetadata",s),()=>{t.removeEventListener("play",o),t.removeEventListener("pause",r),t.removeEventListener("ended",l),t.removeEventListener("timeupdate",a),t.removeEventListener("loadedmetadata",s)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);const w=s(()=>{const e=n.current;e&&(e.paused?e.play():e.pause())},[]),$=s(e=>{const t=n.current;if(!t||!isFinite(t.duration))return;const o=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width));t.currentTime=r*t.duration},[]),C=s(e=>{const t=n.current,o=parseFloat(e.target.value);t&&(t.volume=o,t.muted=0===o,x(o),m(0===o))},[]),z=s(()=>{const e=n.current;e&&e.requestFullscreen&&e.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,style:{width:k,height:S,display:"block"}});const M=f>0?d/f*100:0,I={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:y?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":r?"Pause":"Play",onclick:w,style:I},r?"⏸":"▶"),o("div",{onclick:$,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${M}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${it(d)} / ${it(f)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(b?0:g),oninput:C,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:z,style:I},"⛶"));return o("div",{style:{position:"relative",width:k,height:S,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>v(!0),onmouseleave:()=>{r&&v(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,playsinline:!0,onclick:w,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function at(e){const t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},l=c(null),a={display:"flex",flexDirection:"horizontal"===t?"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:"number"==typeof i.width?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:"number"==typeof i.maxHeight?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},d=s(e=>{if(!r)return;const n=e,o=l.current;if(!o)return;const i=Array.from(o.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),a=i.indexOf(document.activeElement);if(a<0)return;const s="vertical"===t,d=s?"ArrowDown":"ArrowRight",c=s?"ArrowUp":"ArrowLeft";if(n.key===d){n.preventDefault();const e=i[a+1];e&&e.focus()}else if(n.key===c){n.preventDefault();const e=i[a-1];e&&e.focus()}else"Home"===n.key?(n.preventDefault(),i[0]?.focus()):"End"===n.key&&(n.preventDefault(),i[i.length-1]?.focus())},[r,t]);return o("nav",{ref:l,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:d},e.children)}function st(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 dt(){const[e,t]=l(!1);return{hover:e,onMouseEnter:s(()=>t(!0),[]),onMouseLeave:s(()=>t(!1),[])}}function ct(e){const{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:l,collapseIcon:a,iconPosition:d}=e,{hover:c,onMouseEnter:u,onMouseLeave:p}=dt(),f=!0===t.disabled,h={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:f?"#f9fafb":c?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:f?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:f?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};"left"===d&&(h.flexDirection="row");const g=s(e=>{const t=e;f||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r())},[f,r]),x=s(()=>{f||r()},[f,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:"right"===d?"auto":"0",marginRight:"left"===d?"8px":"0",paddingLeft:"right"===d?"8px":"0"}},n?a:l),m=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,y="left"===d?[b,m]:[m,b];return o("button",{role:"button","aria-expanded":String(n),"aria-disabled":f?"true":void 0,"data-section-id":t.id,tabIndex:f?-1:0,style:h,onClick:x,onKeyDown:g,onMouseEnter:u,onMouseLeave:p},...y)}function ut(e){const{section:t,expanded:n,contentStyle:r,animated:i}=e,l={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",{role:"region","aria-hidden":String(!n),"data-section-content":t.id,style:l},o("div",{style:a},t.content))}function pt(e){const{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:a={},wrapperStyle:c,expandIcon:u="+",collapseIcon:p="−",iconPosition:f="right",animated:h=!0,onChange:g}=e,[x,b]=l(()=>n??[]),m=s(e=>{b(t=>{let n;return n=t.includes(e)?t.filter(t=>t!==e):r?[...t,e]:[e],g&&g(n),n})},[r,g]),y=d(()=>t.map(e=>{const t=x.includes(e.id),n=o(ct,{key:`header-${e.id}`,section:e,expanded:t,onToggle:()=>m(e.id),headerStyle:i,expandIcon:u,collapseIcon:p,iconPosition:f}),r=o(ut,{key:`content-${e.id}`,section:e,expanded:t,contentStyle:a,animated:h});return o("div",{key:e.id,"data-accordion-section":e.id,style:{width:"100%"}},n,r)}),[t,x,i,a,u,p,f,h,m]);return o(at,{role:"region",ariaLabel:"Accordion",styling:c,keyboardNav:!0},...y)}const ft={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function ht(e){const{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[a,d]=l(!1),c=ft[i],u=s(()=>{d(!0)},[]);let p=t,f=!1;if(r&&r>1&&t.length>r&&!a){f=!0;const e=1,n=r-1;p=[...t.slice(0,e),{label:"..."},...t.slice(t.length-n)]}const h=p.map((e,t)=>((e,t,r)=>{const i=t===r.length-1,l=f&&"..."===e.label&&1===t,a=[];var s;return t>0&&a.push(o("span","string"==typeof(s=n)?{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}}:{"aria-hidden":"true",style:{margin:"0 8px"}},s)),l?a.push(o("button",{type:"button",onClick:u,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:c.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):i?a.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:c.fontSize}},e.label)):e.href?a.push(o("a",{href:e.href,onClick:e.onClick?t=>{t.preventDefault(),e.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:c.fontSize}},e.label)):e.onClick?a.push(o("button",{type:"button",onClick:e.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:c.fontSize,fontFamily:"inherit"}},e.label)):a.push(o("span",{style:{color:"#6b7280",fontSize:c.fontSize}},e.label)),o("li",{key:String(t),style:{display:"inline-flex",alignItems:"center"}},...a)})(e,t,p));return o(at,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:c.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...h))}function gt(e){const{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:a,onMouseEnter:d,onMouseLeave:c}=dt(),[u,p]=l(!1),f=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const h=!0===t.disabled,g={...st(n,{hover:!h&&a,active:!1}),position:"relative",justifyContent:"space-between",...h?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},x=s(()=>{h||(f?p(e=>!e):(t.onClick&&t.onClick(),r&&i()))},[h,f,t,r,i]),b=s(()=>{d(),f&&p(!0)},[f,d]),m=s(()=>{c(),f&&p(!1)},[f,c]),y=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)),v=f?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"›"):null,k=f&&u?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(at,{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(e=>o(gt,{key:e.id,item:e,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:b,onMouseLeave:m},o("button",{type:"button",role:"menuitem",style:g,onClick:x,disabled:h||void 0,tabIndex:h?-1:0,"aria-disabled":h?"true":void 0,"aria-haspopup":f||void 0,"aria-expanded":f?String(u):void 0},y,v),k)}function xt(e){const{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:d={},placement:u="bottom-start",closeOnSelect:p=!0,width:f="220px"}=e,[h,g]=l(!1),x=c(null),b=s(()=>{g(e=>!e)},[]),m=s(()=>{g(!1)},[]);a(()=>{if(!h)return;const e=e=>{const t=x.current;t&&!t.contains(e.target)&&g(!1)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[h]),a(()=>{if(!h)return;const e=e=>{"Escape"===e.key&&g(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[h]);const y=o("button",{type:"button",style:{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??{}},onClick:b,"aria-haspopup":"true","aria-expanded":String(h)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:h?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"▼")),v={position:"absolute",top:"100%",..."bottom-end"===u?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},k={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:"number"==typeof f?`${f}px`:f,backgroundColor:"#ffffff",...i??{}},S=h?o("div",{style:v},o(at,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:k},...n.map(e=>o(gt,{key:e.id,item:e,itemStyle:d,closeOnSelect:p,onClose:m})))):null;return o("div",{ref:x,style:{position:"relative",display:"inline-block"}},y,S)}function bt(e){const{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=dt(),[c,u]=l(!1),p=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const f=!0===t.disabled,h=s(()=>{f||(p?u(e=>!e):(t.onClick&&t.onClick(),n()))},[f,p,t,n]),g=s(()=>{a(),p&&u(!0)},[p,a]),x=s(()=>{d(),p&&u(!1)},[p,d]),b={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:f?"default":"pointer",backgroundColor:!f&&i?"#f3f4f6":"transparent",color:f?"#9ca3af":"#1f2937",opacity:f?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},m=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)),y=p?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"▶"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,v=p&&c?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((e,t)=>o(bt,{key:String(t),item:e,onClose:n,index:t})))):null;return o("div",{style:{position:"relative"},onMouseEnter:g,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:b,onClick:h,disabled:f||void 0,tabIndex:-1,"aria-disabled":f||void 0,"aria-haspopup":p||void 0,"aria-expanded":p?c:void 0},m,y),v)}function mt(e){const{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:l,onClose:a}=e,{hover:d,onMouseEnter:u,onMouseLeave:p}=dt(),f=c(null),h=s(()=>{r?a():l(n)},[r,n,l,a]),g=s(()=>{u(),i&&!r&&l(n)},[i,r,n,l,u]),x={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":d?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},b=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((e,t)=>o(bt,{key:String(t),item:e,onClose:a,index:t})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:g,onMouseLeave:p},o("button",{ref:f,type:"button",role:"menuitem",style:x,onClick:h,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),b)}function yt(e){const{menus:t}=e,[n,r]=l(null),i=c(null),d=s(e=>{r(e)},[]),u=s(()=>{r(null)},[]);a(()=>{if(null===n)return;const e=e=>{const t=i.current;t&&!t.contains(e.target)&&r(null)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[n]),a(()=>{const e=i.current;if(!e)return;const o=o=>{const i=o;if("Escape"!==i.key){if("ArrowRight"===i.key)return i.preventDefault(),void r(e=>null===e?0:(e+1)%t.length);if("ArrowLeft"===i.key)return i.preventDefault(),void r(e=>null===e?t.length-1:(e-1+t.length)%t.length);if("ArrowDown"===i.key&&null!==n){i.preventDefault();const t=e.querySelector('[role="menu"]');if(t){const e=t.querySelector('[role="menuitem"]');e&&e.focus()}return}"Enter"!==i.key&&i.key}else r(null)};return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}},[n,t.length]);const p=t.map((e,t)=>o(mt,{key:String(t),menu:e,index:t,isOpen:n===t,anyOpen:null!==n,onOpen:d,onClose:u}));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"}},...p)}function vt(e,t){const n=[];for(let o=e;o<=t;o++)n.push(o);return n}const kt={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"},St={...kt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},wt={...kt,color:"#9ca3af",cursor:"default",opacity:"0.5"},$t={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Ct(e){const{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:l=1,showFirstLast:a=!0,showPrevNext:d=!0,disabled:c=!1}=e,u=Math.max(1,Math.ceil(t/n)),p=Math.min(Math.max(1,r),u),f=s(e=>{!c&&e>=1&&e<=u&&e!==p&&i(e)},[c,u,p,i]),h=(e,t,n)=>{const r=c||t<1||t>u||t===p;return o("button",{type:"button",onClick:()=>f(t),disabled:r||void 0,"aria-label":n,style:r?wt:kt},e)},g=function(e,t,n){if(e<=2*n+5)return vt(1,e);const o=Math.max(t-n,1),r=Math.min(t+n,e),i=o>2,l=r<e-1;return!i&&l?[...vt(1,2*n+3),"ellipsis",e]:i&&!l?[1,"ellipsis",...vt(e-2*n-2,e)]:[1,"ellipsis",...vt(o,r),"ellipsis",e]}(u,p,l);let x=0;const b=[];a&&b.push(h("«",1,"Go to first page")),d&&b.push(h("‹",p-1,"Go to previous page"));for(const e of g)if("ellipsis"===e)b.push(o("span",{key:"ellipsis-"+x++,style:$t},"..."));else{const t=e===p;b.push(o("button",{key:String(e),type:"button",onClick:()=>f(e),disabled:c||void 0,"aria-label":`Page ${e}`,"aria-current":t?"page":void 0,style:c?wt:t?St:kt},String(e)))}return d&&b.push(h("›",p+1,"Go to next page")),a&&b.push(h("»",u,"Go to last page")),o(at,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...b)}function zt(e){const{item:t,collapsed:n,selectedId:r,onSelect:i,depth:a}=e,{hover:d,onMouseEnter:c,onMouseLeave:u}=dt(),[p,f]=l(!1),h=t.children&&t.children.length>0,g=t.id===r,x=s(()=>{h&&!n&&f(e=>!e),i&&i(t.id)},[h,n,i,t.id]),b={display:"flex",alignItems:"center",padding:n?"10px 0":"10px 12px 10px "+(n?"0":16+16*a+"px"),justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:g?"#eff6ff":d?"#f3f4f6":"transparent",color:g?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},m=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,y=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),v=!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,k=!n&&h?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:p?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"▶"):null,S=n&&d?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,w=o("button",{type:"button",style:b,onClick:x,onMouseEnter:c,onMouseLeave:u,"aria-selected":g?"true":"false",title:n?t.label:void 0},m,y,v,k,S),$=!n&&h&&p?t.children.map(e=>o(zt,{key:e.id,item:e,collapsed:n,selectedId:r,onSelect:i,depth:a+1})):null;return o("div",{key:t.id,style:{position:"relative"}},w,$?o("div",{role:"group"},...$):null)}function Mt(e){const{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:l,width:a="240px",collapsedWidth:s="56px"}=e,d=n?"number"==typeof s?`${s}px`:s:"number"==typeof a?`${a}px`:a,c=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?"▶":"◀"):null,u=t.map(e=>o(zt,{key:e.id,item:e,collapsed:n,selectedId:i,onSelect:l,depth:0}));return o(at,{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"}}},c,...u)}function It(e){const{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:l=!1,variant:a="circle"}=e,d="horizontal"===r,c="circle"===a?32:12,u="dot"===a?12:32,p=s(e=>{l&&i&&i(e)},[l,i]),f=[];return t.forEach((e,r)=>{f.push(((e,t)=>{const r=(e=>e<n?"completed":e===n?"active":"pending")(t),i="active"===r,s="completed"===r,f=((e,t,n)=>{const r="dot"===a?u:c,i={width:`${r}px`,height:`${r}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"circle"===a?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return"completed"===n?o("div",{style:{...i,backgroundColor:"#2563eb",color:"#ffffff",border:"2px solid #2563eb"}},"circle"===a?t.icon||"✓":null):"active"===n?o("div",{style:{...i,backgroundColor:"#ffffff",color:"#2563eb",border:"2px solid #2563eb",boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},"circle"===a?t.icon||String(e+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#2563eb"}})):o("div",{style:{...i,backgroundColor:"#ffffff",color:"#9ca3af",border:"2px solid #d1d5db"}},"circle"===a?t.icon||String(e+1):null)})(t,e,r),h={fontSize:"11px",color:"#6b7280",marginTop:"2px",textAlign:d?"center":"left"},g=o("div",{style:d?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:{fontSize:"13px",fontWeight:i?"600":"400",color:i||s?"#1f2937":"#9ca3af",marginTop:d?"8px":"0",marginLeft:d?"0":"12px",textAlign:d?"center":"left",transition:"color 0.2s"}},e.label),e.description?o("span",{style:h},e.description):null),x=o("div",d?{style:{display:"flex",flexDirection:"column",alignItems:"center"}}:{style:{display:"flex",flexDirection:"row",alignItems:"center"}},f,g);return o(l?"button":"div",{key:String(t),onClick:l?()=>p(t):void 0,style:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:l?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":i?"step":void 0},x)})(e,r));const i=(e=>{if(e>=t.length-1)return null;const r=e<n?"#2563eb":"#d1d5db";return o("div",d?{style:{flex:"1",height:"2px",backgroundColor:r,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}:{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:r,marginLeft:("dot"===a?u:c)/2-1+"px",transition:"background-color 0.2s"}})})(r);i&&f.push(i)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:d?"row":"column",alignItems:d?"flex-start":"stretch",width:"100%"}},...f)}const Lt={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 Rt(e){const{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:l,onMouseLeave:a}=dt(),d=Lt[n],c=!0===t.disabled,u=!0===t.active,p=s(()=>{!c&&t.onClick&&t.onClick()},[c,t]),f={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:d.height,padding:d.padding,fontSize:d.fontSize,fontFamily:"inherit",border:"raised"===r?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:u?"#e0e7ff":!c&&i?"#f3f4f6":"raised"===r?"#ffffff":"transparent",color:c?"#9ca3af":u?"#2563eb":"#374151",cursor:c?"default":"pointer",opacity:c?"0.5":"1",outline:"none",transition:"background-color 0.15s"},h=t.icon?o("span",{style:{fontSize:d.iconSize},"aria-hidden":"true"},t.icon):null,g=t.label?o("span",null,t.label):null,x="dropdown"===t.type?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"▼"):null;return o("button",{type:"button",style:f,onClick:p,onMouseEnter:l,onMouseLeave:a,disabled:c||void 0,"aria-pressed":u||void 0,"aria-label":t.label||t.id,title:t.label||t.id},h,g,x)}function Dt(e){const{items:t,size:n="md",variant:r="flat"}=e,i=Lt[n],l=t.map(e=>"separator"===e.type?o("div",{key:e.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):"spacer"===e.type?o("div",{key:e.id,style:{flex:"1"},"aria-hidden":"true"}):o(Rt,{key:e.id,item:e,size:n,variant:r}));return o(at,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:"raised"===r?"1px solid #e5e7eb":"none",borderRadius:"raised"===r?"8px":"0",padding:"4px",backgroundColor:"raised"===r?"#ffffff":"transparent",boxShadow:"raised"===r?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...l)}class At{constructor(e,t){this.id=e.id,this.label=e.label,this.expanded=e.expanded??!1,this.icon=e.icon??null,this.metadata=e.metadata??{},this.parent=t??null,this.depth=t?t.depth+1:0,this.children=(e.children??[]).map(e=>new At(e,this))}static fromData(e){return new At(e)}isLeaf(){return 0===this.children.length}isRoot(){return null===this.parent}walk(e){e(this,this.depth);for(const t of this.children)t.walk(e)}find(e){if(this.id===e)return this;for(const t of this.children){const n=t.find(e);if(n)return n}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(e){const t=new At(e,this);return this.children.push(t),t}removeChild(e){const t=this.children.findIndex(t=>t.id===e);return-1!==t&&(this.children.splice(t,1),!0)}}function Ft(e){e.expanded=!0;for(const t of e.children)Ft(t)}function Tt(e,t=[]){if(t.push(e),e.expanded)for(const n of e.children)Tt(n,t);return t}function Et(e){if(!e.parent)return!0;const t=e.parent.children;return t[t.length-1]===e}function Wt(e){const{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:l,iconExpanded:s,iconCollapsed:d,nodeStyle:u,renderNode:p,onToggle:f,onClick:h,focusedId:g}=e,x=dt(),b=c(null),m=g===t.id;a(()=>{m&&b.current&&b.current.focus()},[m]);const y=t.isLeaf(),v=t.depth,k=[];for(let e=0;e<v;e++){let n=t;for(let t=0;t<v-e;t++)n=n?n.parent:null;const a=!!n&&!Et(n);k.push(o("span",{key:`connector-${e}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...a?{borderLeft:`${l}px solid ${i}`}:{}}}))}const S=v>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${l}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,w=y?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",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:e=>{e.stopPropagation(),f(t)}},t.expanded?s:d),$=p?p(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=st(u,{hover:x.hover,active:n});return o("div",{ref:b,role:"treeitem","aria-expanded":y?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":v+1,tabIndex:m?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onClick:()=>h(t)},...k,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:u.padding??"6px 10px",minWidth:"0"}},w,$))}function Bt(e){const{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:a,expandAll:c=!1,lineColor:u="#000",lineWidth:p=1,indentPx:f=20,iconExpanded:h="−",iconCollapsed:g="+",nodeStyle:x={},wrapperStyle:b,renderNode:m}=e,[y,v]=l(()=>{const e=At.fromData(t);return c&&Ft(e),e}),[k,S]=l(t.id),w=d(()=>Tt(y),[y]),$=s(()=>{v(e=>{const t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t})},[]),C=s(e=>{e.toggle(),e.expanded?r?.(e):i?.(e),$()},[r,i,$]),z=s(e=>{S(e.id),n?.(e)},[n]),M=s(e=>{const t=e;if(!k)return;const n=w.findIndex(e=>e.id===k);if(-1===n)return;const o=w[n];switch(t.key){case"ArrowDown":{t.preventDefault();const e=w[n+1];e&&S(e.id);break}case"ArrowUp":{t.preventDefault();const e=w[n-1];e&&S(e.id);break}case"ArrowRight":t.preventDefault(),o.isLeaf()||(o.expanded?o.children.length>0&&S(o.children[0].id):C(o));break;case"ArrowLeft":t.preventDefault(),!o.isLeaf()&&o.expanded?C(o):o.parent&&S(o.parent.id);break;case"Enter":t.preventDefault(),z(o);break;case" ":t.preventDefault(),o.isLeaf()||C(o);break;case"Home":t.preventDefault(),w.length>0&&S(w[0].id);break;case"End":t.preventDefault(),w.length>0&&S(w[w.length-1].id)}},[k,w,C,z]),I=w.map(e=>o(Wt,{key:e.id,node:e,isSelected:e.id===a,indentPx:f,lineColor:u,lineWidth:p,iconExpanded:h,iconCollapsed:g,nodeStyle:x,renderNode:m,onToggle:C,onClick:z,focusedId:k}));return o(at,{role:"tree",ariaLabel:"Tree navigation",styling:b,keyboardNav:!1},o("div",{onKeyDown:M,style:{outline:"none"}},...I))}function Ht(e){const{items:t,position:n,onClose:r,depth:i}=e,[s,d]=l(-1),[u,p]=l(null),f=c(null);a(()=>{if(!f.current)return;f.current.focus();const e=e=>{const n=e,o=t.map((e,t)=>({item:e,i:t})).filter(({item:e})=>!e.divider);if("ArrowDown"===n.key)n.preventDefault(),d(e=>{const t=(o.findIndex(({i:t})=>t===e)+1)%o.length;return o[t].i});else if("ArrowUp"===n.key)n.preventDefault(),d(e=>{const t=o.findIndex(({i:t})=>t===e),n=t<=0?o.length-1:t-1;return o[n].i});else if("ArrowRight"===n.key)s>=0&&t[s]?.children&&p(s);else if("ArrowLeft"===n.key)i>0&&r();else if("Enter"===n.key){if(n.preventDefault(),s>=0){const e=t[s];e.children?p(s):!e.disabled&&e.onClick&&(e.onClick(),r())}}else"Escape"===n.key&&r()};f.current.addEventListener("keydown",e);const n=f.current;return()=>n.removeEventListener("keydown",e)},[t,s,i,r]);const h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},g=t.map((e,t)=>{if(e.divider)return o("div",{key:`divider-${t}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const l=s===t,a=!!e.disabled,c=!!(e.children&&e.children.length>0),f={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:a?"#9ca3af":"#1f2937",cursor:a?"default":"pointer",backgroundColor:l&&!a?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},h=[];e.icon&&h.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},e.icon)),h.push(o("span",{style:{flex:"1"}},e.label??"")),c&&h.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"▶"));const g=[o("div",{key:`item-${t}`,style:f,onMouseEnter:()=>{d(t),p(c?t:null)},onClick:()=>{a||(c?p(t):(e.onClick&&e.onClick(),r()))},role:"menuitem","aria-disabled":a?"true":void 0},...h)];return c&&u===t&&g.push(o(Ht,{key:`submenu-${t}`,items:e.children,position:{x:n.x+178,y:n.y+36*t},onClose:()=>p(null),depth:i+1})),o("div",{key:`wrap-${t}`,style:{position:"relative"}},...g)});return o("div",{ref:f,style:h,tabIndex:-1,role:"menu"},...g)}function Nt(e){const{items:t,children:n}=e,[r,i]=l(null),d=s(e=>{e.preventDefault();const t=e;i({x:t.clientX,y:t.clientY})},[]),c=s(()=>{i(null)},[]);a(()=>{if(!r)return;const e=e=>{c()},t=setTimeout(()=>{document.addEventListener("mousedown",e)},0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[r,c]),a(()=>{if(!r)return;const e=e=>{"Escape"===e.key&&c()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,c]);const u=[o("div",{onContextMenu:d,style:{display:"contents"}},n)];return r&&u.push(o(Ht,{items:t,position:r,onClose:c,depth:0})),o("div",null,...u)}function Pt(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 jt(e,t){const 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 _t(e){const{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:d=!0,closeOnOverlay:c=!0,closeOnEscape:u=!0,children:p}=e,[f,h]=l(!1),[g,x]=l(!1);if(a(()=>{if(!t){x(!1);const e=setTimeout(()=>h(!1),300);return()=>clearTimeout(e)}h(!0),requestAnimationFrame(()=>x(!0))},[t]),a(()=>{if(!t||!u)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,u,n]),a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),!f)return null;const b={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:g?"1":"0",transition:"opacity 0.3s ease"},m={...jt(r,i),transform:Pt(r,g),transition:"transform 0.3s ease"},y=[];s&&y.push(o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},o("h3",{style:{margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"}},s),o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},onClick:n,"aria-label":"Close drawer"},"×"))),y.push(o("div",{style:{padding:"20px",overflow:"auto",flex:"1"}},p));const v=[];return d&&v.push(o("div",{style:b,onClick:()=>{c&&n()}})),v.push(o("div",{style:m,role:"dialog","aria-modal":"true"},...y)),o("div",null,...v)}const Ot={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Yt(e){const{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:l=!0,closeOnEscape:s=!0,footer:d,showCloseButton:u=!0,children:p}=e,f=c(null);if(a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{if(!t||!s)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,s,n]),a(()=>{t&&f.current&&f.current.focus()},[t]),!t)return null;const h={backgroundColor:"#fff",borderRadius:"full"===i?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:"full"===i?"100vh":"90vh",width:Ot[i],maxWidth:"full"===i?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},g=[];r?g.push(o("h2",{style:{margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"}},r)):g.push(o("span",null)),u&&g.push(o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},onClick:n,"aria-label":"Close modal"},"×"));const x=[o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},...g),o("div",{style:{padding:"24px",overflow:"auto",flex:"1"}},p)];return d&&x.push(o("div",{style:{padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"}},d)),o("div",{style:{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"},onClick:e=>{l&&e.target===e.currentTarget&&n()},"aria-modal":"true",role:"dialog"},o("div",{ref:f,style:h,tabIndex:-1,role:"document"},...x))}function qt(e,t){const n=t+8;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 Ut(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="8px",o="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} #fff ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} #fff ${o} ${o}`}}}function Xt(e){const{trigger:t,content:n,open:r,placement:i="bottom",offset:d=4,arrow:u=!1,closeOnClickOutside:p=!0,onOpenChange:f}=e,h=void 0!==r,[g,x]=l(!1),b=h?r:g,m=c(null),y=s(()=>{h?f&&f(!r):x(e=>!e)},[h,r,f]);a(()=>{if(!b||!p)return;const e=e=>{m.current&&!m.current.contains(e.target)&&(h?f&&f(!1):x(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b,p,h,f]);const v={...qt(i,d),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"},k=[n];u&&k.push(o("div",{style:Ut(i)}));const S=[o("div",{onClick:y,style:{display:"inline-block"}},t)];return b&&S.push(o("div",{style:v},...k)),o("div",{ref:m,style:{position:"relative",display:"inline-block"}},...S)}let Gt=0;function Kt(e={}){const t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3};let n=[];const o=new Set;function r(){o.forEach(e=>e())}return{toast:function(e,o={}){const i=`toast-${++Gt}-${Date.now()}`,l={id:i,message:e,type:o.type??"info",duration:o.duration??t.defaultDuration,action:o.action,createdAt:Date.now()};return n=[l,...n].slice(0,t.maxToasts),r(),i},dismiss:function(e){n=n.filter(t=>t.id!==e),r()},dismissAll:function(){n=[],r()},subscribe:e=>(o.add(e),()=>{o.delete(e)}),getToasts:()=>n,config:t}}const Vt={info:{bg:"#eff6ff",border:"#3b82f6",icon:"ℹ️"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"✅"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"⚠️"},error:{bg:"#fef2f2",border:"#ef4444",icon:"❌"}};function Jt(e){const{item:t,onDismiss:n}=e,r=Vt[t.type];a(()=>{if(t.duration<=0)return;const e=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(e)},[t.id,t.duration,n]);const 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"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},s=[o("span",null,r.icon),o("span",{style:{flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"}},t.message)];return t.action&&s.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),s.push(o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"×")),o("div",{style:i,role:"alert"},...s)}function Zt(e){const{toaster:t}=e,[,n]=l(0);a(()=>t.subscribe(()=>n(e=>e+1)),[t]);const r=t.getToasts();if(0===r.length)return null;const i=function(e){const t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),o=e.startsWith("bottom"),r=e.endsWith("left"),i=e.endsWith("right"),l=e.endsWith("center");return n&&(t.top="0"),o&&(t.bottom="0",t.flexDirection="column-reverse"),r&&(t.left="0"),i&&(t.right="0"),l&&(t.left="50%",t.transform="translateX(-50%)"),t}(t.config.position);a(()=>{const e="specifyjs-toast-keyframes";if(document.getElementById(e))return;const t=document.createElement("style");return t.id=e,t.textContent="\n @keyframes specifyjs-toast-slide-in {\n from { opacity: 0; transform: translateY(-12px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(t),()=>{const t=document.getElementById(e);t&&t.remove()}},[]);const d=s(e=>t.dismiss(e),[t]),c=r.map(e=>o(Jt,{key:e.id,item:e,onDismiss:d}));return o("div",{style:i},...c)}function Qt(e={}){const t=c(null);t.current||(t.current=Kt(e));const n=t.current,r=s(()=>o(Zt,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}function en(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="6px",o="transparent",r="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${r} ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} ${r} ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} ${r}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} ${r} ${o} ${o}`}}}function tn(e){const{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:d}=e,[u,p]=l(!1),[f,h]=l(null),g=c(null),x=c(null),b=s(()=>{x.current=setTimeout(()=>{if(g.current){const e=g.current.getBoundingClientRect();h(function(e,t){switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:e.top-8+"px",transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+8}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:e.left-8+"px",top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+8}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}(e,n))}p(!0)},r)},[r,n]),m=s(()=>{x.current&&(clearTimeout(x.current),x.current=null),p(!1)},[]);a(()=>()=>{x.current&&clearTimeout(x.current)},[]);const y={...f??{},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"},v=[o("div",{ref:g,style:{display:"inline-block"},onMouseEnter:b,onMouseLeave:m,onFocus:b,onBlur:m},d)];return u&&f&&v.push(o("div",{style:y,role:"tooltip"},t,o("div",{style:en(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...v)}function nn(e,t,n,o,r){return d(()=>{const i=Math.max(1,(o-r*(e+1))/e);return{valueScale:e=>0===t?0:e/t*n,categoryScale:e=>r+e*(i+r),barThickness:i,maxValue:t,valueAxisLength:n,categoryAxisLength:o}},[e,t,n,o,r])}const on=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function rn(e,t){return t||on[e%on.length]}function ln(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:l="#3b82f6",barGap:a=8,barRadius:c=4,showValues:u=!0,showGrid:p=!0,gridColor:f="#e5e7eb",title:h,padding:g=50,animate:x=!1,stacked:b,grouped:m=!1}=e,y="vertical"===i,v=n-2*g,k=r-2*g,S=y?k:v,w=y?v:k,$=void 0!==b&&b.length>0,C=d(()=>$?function(e){const t=new Set;for(const n of e)for(const e of n.values)t.add(e.category);return Array.from(t)}(b):[],[$,b]),z=$?b.length:t.length,M=d(()=>function(e,t,n){if(t&&t.length>0){if(n){let e=0;for(const n of t)for(const t of n.values)t.value>e&&(e=t.value);return e}let e=0;for(const n of t){let t=0;for(const e of n.values)t+=e.value;t>e&&(e=t)}return e}let o=0;for(const t of e)t.value>o&&(o=t.value);return o}(t,b,m),[t,b,m]),I=M>0?M:1,L=nn(z,I,S,w,a),R=s(()=>{if(!p)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(I),t=[];for(let n=e;n<=I;n+=e){const e=L.valueScale(n);if(y){const r=g+k-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+v),y2:String(r),stroke:f,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-6),y:String(r+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}else{const r=g+e;t.push(o("line",{key:`grid-${n}`,x1:String(r),y1:String(g),x2:String(r),y2:String(g+k),stroke:f,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[p,I,L,y,g,v,k,f]),D=s(()=>{const e=[];return y?(e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+k),x2:String(g+v),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"}))):(e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+k),x2:String(g+v),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"}))),e},[y,g,v,k]),A=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=L.valueScale(r.value),a=L.categoryScale(n),s=r.color??l;let d,p,f=String(r.value);if(y){const e=g+a,t=g+k-i;d={x:String(e),y:String(t),width:String(L.barThickness),height:String(i),rx:String(c),ry:String(c),fill:s},p={x:String(e+L.barThickness/2),y:String(t-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{const e=g+a,t=g;d={x:String(t),y:String(e),width:String(i),height:String(L.barThickness),rx:String(c),ry:String(c),fill:s},p={x:String(t+i+6),y:String(e+L.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}x&&(d.style=`animation: barGrow 0.6s ease-out ${.05*n}s both`),e.push(o("rect",{key:`bar-${n}`,...d})),u&&e.push(o("text",{key:`val-${n}`,...p},f)),y?e.push(o("text",{key:`cat-${n}`,x:String(g+a+L.barThickness/2),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label)):e.push(o("text",{key:`cat-${n}`,x:String(g-6),y:String(g+a+L.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return e},[t,L,l,c,u,x,y,g,k]),F=s(()=>{if(!b)return[];const e=[];for(let t=0;t<b.length;t++){const n=b[t],r=L.categoryScale(t);let i=0;for(let l=0;l<n.values.length;l++){const a=n.values[l],s=L.valueScale(a.value),d=L.valueScale(i),p=rn(l,a.color);if(y){const i=g+r,f=g+k-d-s;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(f),width:String(L.barThickness),height:String(s),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:p,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),u&&s>14&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+L.barThickness/2),y:String(f+s/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}else{const i=g+d,f=g+r;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(f),width:String(s),height:String(L.barThickness),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:p,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),u&&s>20&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+s/2),y:String(f+L.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}i+=a.value}if(u){const n=L.valueScale(i);y?e.push(o("text",{key:`stotal-${t}`,x:String(g+r+L.barThickness/2),y:String(g+k-n-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i))):e.push(o("text",{key:`stotal-${t}`,x:String(g+n+6),y:String(g+r+L.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i)))}y?e.push(o("text",{key:`scat-${t}`,x:String(g+r+L.barThickness/2),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},n.label)):e.push(o("text",{key:`scat-${t}`,x:String(g-6),y:String(g+r+L.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},n.label))}return e},[b,L,c,u,x,y,g,k]),T=s(()=>{if(!b)return[];const e=C.length,t=[];for(let n=0;n<b.length;n++){const r=b[n],i=L.categoryScale(n),l=2,a=Math.max(1,(L.barThickness-l*(e-1))/e);for(let s=0;s<r.values.length;s++){const d=r.values[s],p=C.indexOf(d.category),f=p*(a+l),h=L.valueScale(d.value),b=rn(p>=0?p:s,d.color);if(y){const r=g+i+f,l=g+k-h;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(a),height:String(h),rx:String(c),ry:String(c),fill:b,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),u&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+a/2),y:String(l-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}else{const r=g,l=g+i+f;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(h),height:String(a),rx:String(c),ry:String(c),fill:b,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),u&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+h+4),y:String(l+a/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}}y?t.push(o("text",{key:`gcat-${n}`,x:String(g+i+L.barThickness/2),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label)):t.push(o("text",{key:`gcat-${n}`,x:String(g-6),y:String(g+i+L.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return t},[b,C,L,c,u,x,y,g,k]),E=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),W=s(()=>x?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},y?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[x,y]),B=R(),H=D(),N=E(),P=W();let j;return j=$&&m?T():$?F():A(),o("svg",{width:String(n),height:String(r),viewBox:`0 0 ${n} ${r}`,xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...P,...N,...B,...H,...j)}function an(e,t){const n=t-e;if(n<=0)return[e];const o=function(e){const t=e/8,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return(o<1.5?1:o<3?2:o<7?5:10)*n}(n),r=[];for(let n=Math.ceil(e/o)*o;n<=t+.001*o;n+=o)r.push(Math.round(1e10*n)/1e10);return r}function sn(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}const dn=40,cn=1e6;function un(e){const{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:a=200,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:p=!0,showAxes:f=!0,pointRadius:h=3,pointColor:g="#3b82f6",curveColor:x="#3b82f6",gridColor:b="#e2e8f0",axisColor:m="#94a3b8",onPointClick:y,onPointDoubleClick:v,onPointContextMenu:k,onPointHover:S}=e,[w,$]=l(d[0]),[C,z]=l(d[1]),[M,I]=l(u[0]),[L,R]=l(u[1]),D=c(!1),A=c(null),F=s(e=>dn+(e-w)/(C-w)*(t-80),[w,C,t]),T=s(e=>n-dn-(e-M)/(L-M)*(n-80),[M,L,n]),E=s(e=>w+(e-dn)/(t-80)*(C-w),[w,C,t]),W=s(e=>M+(n-dn-e)/(n-80)*(L-M),[M,L,n]),B=s(e=>{const t=e;D.current=!0,A.current={mx:t.clientX,my:t.clientY,x0:w,x1:C,y0:M,y1:L}},[w,C,M,L]),H=s(e=>{if(!D.current||!A.current)return;const o=e,r=A.current,i=o.clientX-r.mx,l=o.clientY-r.my,a=i/(t-80)*(r.x1-r.x0),s=l/(n-80)*(r.y1-r.y0);$(r.x0-a),z(r.x1-a),I(r.y0+s),R(r.y1+s)},[t,n]),N=s(()=>{D.current=!1,A.current=null},[]),P=s(e=>{const t=e;t.preventDefault();const n=t.currentTarget.getBoundingClientRect(),o=t.clientX-n.left,r=t.clientY-n.top,i=E(o),l=W(r),a=t.deltaY>0?1.1:1/1.1,s=(C-w)*a,d=(L-M)*a;if(s<.01||d<.01||s>cn||d>cn)return;const c=(i-w)/(C-w),u=(l-M)/(L-M);$(i-c*s),z(i+(1-c)*s),I(l-u*d),R(l+(1-u)*d)},[w,C,M,L,E,W]),j=[];if(j.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),p){const e=an(w,C),r=an(M,L);for(let t=0;t<e.length;t++){const r=F(e[t]);j.push(o("line",{x1:r,y1:dn,x2:r,y2:n-dn,stroke:b,"stroke-width":.5,key:`gx-${t}`})),j.push(o("text",{x:r,y:n-dn+14,"text-anchor":"middle","font-size":10,fill:m,key:`lx-${t}`},sn(e[t])))}for(let e=0;e<r.length;e++){const n=T(r[e]);j.push(o("line",{x1:dn,y1:n,x2:t-dn,y2:n,stroke:b,"stroke-width":.5,key:`gy-${e}`})),j.push(o("text",{x:34,y:n+3,"text-anchor":"end","font-size":10,fill:m,key:`ly-${e}`},sn(r[e])))}}if(f){const e=Math.max(dn,Math.min(t-dn,F(0))),r=Math.max(dn,Math.min(n-dn,T(0)));j.push(o("line",{x1:dn,y1:r,x2:t-dn,y2:r,stroke:m,"stroke-width":1,key:"x-axis"})),j.push(o("line",{x1:e,y1:dn,x2:e,y2:n-dn,stroke:m,"stroke-width":1,key:"y-axis"}))}if(i){const e=(C-w)/a,t=[];for(let n=0;n<=a;n++){const o=w+n*e,r=i(o);if(!isFinite(r))continue;const l=F(o),a=T(r);t.push(`${0===t.length?"M":"L"}${l},${a}`)}t.length>0&&j.push(o("path",{d:t.join(" "),fill:"none",stroke:x,"stroke-width":1.5,key:"curve"}))}const _=(e,t,n,o)=>{if(t)return e=>t({x:o.x,y:o.y,index:n,event:e})};for(let e=0;e<r.length;e++){const t=r[e],n={cx:F(t.x),cy:T(t.y),r:h,fill:g,cursor:"pointer",key:`pt-${e}`};y&&(n.onclick=_(0,y,e,t)),v&&(n.ondblclick=_(0,v,e,t)),k&&(n.oncontextmenu=_(0,k,e,t)),S&&(n.onmouseover=_(0,S,e,t)),j.push(o("circle",n))}const O=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:dn,y:dn,width:t-80,height:n-80})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:"user-select: none; touch-action: none;",onmousedown:B,onmousemove:H,onmouseup:N,onmouseleave:N,onwheel:P},O,...j)}function pn(e,t,n){let o=0,r=0;for(let i=0;i<n;i++){const n=o*o,l=r*r;if(n+l>4)return i;r=2*o*r+t,o=n-l+e}return n}function fn(e,t,n){if(e===t)return[0,0,0];const o=e/t;if("fire"===n)return[Math.floor(255*Math.min(1,3*o)),Math.floor(255*Math.max(0,3*o-1)),Math.floor(255*Math.max(0,3*o-2))];if("ocean"===n)return[Math.floor(255*o*.3),Math.floor(255*o*.6),Math.floor(255*(.4+.6*o))];const r=360*o%360,i=1*(1-Math.abs(0)),l=i*(1-Math.abs(r/60%2-1)),a=.5-i/2;let s=0,d=0,c=0;return r<60?(s=i,d=l):r<120?(s=l,d=i):r<180?(d=i,c=l):r<240?(d=l,c=i):r<300?(s=l,c=i):(s=i,c=l),[Math.floor(255*(s+a)),Math.floor(255*(d+a)),Math.floor(255*(c+a))]}function hn(e){const{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:d=100,colorScheme:u="classic",computeFunction:p=pn,onPointClick:f,onPointHover:h,onPointDoubleClick:g,onPointContextMenu:x}=e,[b,m]=l(r[0]),[y,v]=l(r[1]),[k,S]=l(i[0]),[w,$]=l(i[1]),C=c(null),z=c(!1),M=c(null),I=s((e,o)=>({re:b+e/t*(y-b),im:w-o/n*(w-k)}),[b,y,k,w,t,n]);a(()=>{const e=C.current;if(!e)return;const o=e.getContext("2d");if(!o)return;const r=o.createImageData(t,n),i=r.data;for(let e=0;e<n;e++)for(let n=0;n<t;n++){const{re:o,im:r}=I(n,e),l=p(o,r,d),[a,s,c]=fn(l,d,u),f=4*(e*t+n);i[f]=a,i[f+1]=s,i[f+2]=c,i[f+3]=255}o.putImageData(r,0,0)},[b,y,k,w,t,n,d,u,p,I]);const L=s(e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,{re:r,im:i}=I(n,o);return{re:r,im:i,iterations:p(r,i,d),event:e}},[I,p,d]),R=s(e=>{z.current=!0,M.current={x:e.clientX,y:e.clientY,rMin:b,rMax:y,iMin:k,iMax:w}},[b,y,k,w]),D=s(e=>{if(h&&h(L(e)),!z.current||!M.current)return;const o=M.current,r=e.clientX-o.x,i=e.clientY-o.y,l=(o.rMax-o.rMin)/t,a=(o.iMax-o.iMin)/n;m(o.rMin-r*l),v(o.rMax-r*l),S(o.iMin+i*a),$(o.iMax+i*a)},[t,n,h,L]),A=s(()=>{z.current=!1},[]),F=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15,n=e.target.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,{re:i,im:l}=I(o,r);m(i+(b-i)*t),v(i+(y-i)*t),S(l+(k-l)*t),$(l+(w-l)*t)},[I,b,y,k,w]),T=s(e=>{f&&f(L(e))},[f,L]),E=s(e=>{g&&g(L(e))},[g,L]),W=s(e=>{e.preventDefault(),x&&x(L(e))},[x,L]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onmousedown:R,onmousemove:D,onmouseup:A,onmouseleave:A,onwheel:F,onclick:T,ondblclick:E,oncontextmenu:W})}function gn(e,t,n){if(e===t)return[e];const o=(t-e)/(n-1),r=[];for(let t=0;t<n;t++){const n=e+o*t;r.push(Math.round(1e10*n)/1e10)}return r}function xn(e,t,n,o){return d(()=>function(e,t,n,o){if(0===e.length)return{xScale:()=>o,yScale:()=>n-o,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let r=1/0,i=-1/0,l=1/0,a=-1/0;for(const t of e)t.x<r&&(r=t.x),t.x>i&&(i=t.x),t.y<l&&(l=t.y),t.y>a&&(a=t.y);r===i&&(r-=1,i+=1),l===a&&(l-=1,a+=1);const s=t-2*o,d=n-2*o;return{xScale:e=>o+(e-r)/(i-r)*s,yScale:e=>n-o-(e-l)/(a-l)*d,xTicks:gn(r,i,6),yTicks:gn(l,a,6),xMin:r,xMax:i,yMin:l,yMax:a}}(e,t,n,o),[e,t,n,o])}function bn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function mn(e){const{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:l=2,pointRadius:a=4,pointColor:s="#3b82f6",showPoints:c=!0,showGrid:u=!0,showArea:p=!1,areaColor:f="rgba(59,130,246,0.15)",xLabel:h,yLabel:g,title:x,padding:b=50,animate:m=!1,multiLine:y}=e,v=xn(d(()=>{const e=[...t];if(y)for(const t of y)e.push(...t.data);return e},[t,y]),n,r,b),{xScale:k,yScale:S,xTicks:w,yTicks:$}=v,C=[];if(C.push(o("rect",{x:0,y:0,width:n,height:r,fill:"white",key:"bg"})),u){for(let e=0;e<w.length;e++){const t=k(w[e]);C.push(o("line",{x1:t,y1:b,x2:t,y2:r-b,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${e}`}))}for(let e=0;e<$.length;e++){const t=S($[e]);C.push(o("line",{x1:b,y1:t,x2:n-b,y2:t,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${e}`}))}}C.push(o("line",{x1:b,y1:r-b,x2:n-b,y2:r-b,stroke:"#374151","stroke-width":1,key:"x-axis"})),C.push(o("line",{x1:b,y1:b,x2:b,y2:r-b,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let e=0;e<w.length;e++){const t=k(w[e]);C.push(o("line",{x1:t,y1:r-b,x2:t,y2:r-b+5,stroke:"#374151",key:`xtick-${e}`})),C.push(o("text",{x:t,y:r-b+18,"text-anchor":"middle","font-size":11,fill:"#6b7280",key:`xlabel-${e}`},bn(w[e])))}for(let e=0;e<$.length;e++){const t=S($[e]);C.push(o("line",{x1:b-5,y1:t,x2:b,y2:t,stroke:"#374151",key:`ytick-${e}`})),C.push(o("text",{x:b-10,y:t+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${e}`},bn($[e])))}function z(e,t,n,r,i,l,a,s,d){if(0===e.length)return;const c=[...e].sort((e,t)=>e.x-t.x);if(r){const e=S(v.yMin),t=c.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),n=`${k(c[0].x)},${e} ${t} ${k(c[c.length-1].x)},${e}`;C.push(o("polygon",{points:n,fill:i,key:`${d}-area`}))}const u={points:c.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),fill:"none",stroke:t,"stroke-width":n,"stroke-linejoin":"round","stroke-linecap":"round",key:`${d}-line`};if(m?(u["stroke-dasharray"]="1000",u["stroke-dashoffset"]="1000",C.push(o("polyline",u,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):C.push(o("polyline",u)),l)for(let e=0;e<c.length;e++){const t={cx:k(c[e].x),cy:S(c[e].y),r:s,fill:a,key:`${d}-pt-${e}`};m?(t.opacity=0,C.push(o("circle",t,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))):C.push(o("circle",t))}}if(z(t,i,l,p,f,c,s,a,"primary"),y)for(let e=0;e<y.length;e++){const t=y[e];z(t.data,t.color,l,!1,"transparent",c,t.color,a,`series-${e}`)}if(y&&y.length>0){const e=[],t=[{color:i,label:"Primary"},...y.map((e,t)=>({color:e.color,label:e.label??`Series ${t+1}`}))];for(let n=0;n<t.length;n++){const r=b+10+120*n,i=b-30;e.push(o("rect",{x:r,y:i,width:14,height:14,fill:t[n].color,rx:2,key:`legend-rect-${n}`})),e.push(o("text",{x:r+20,y:i+12,"font-size":12,fill:"#374151",key:`legend-text-${n}`},t[n].label))}C.push(o("g",{key:"legend"},...e))}return h&&C.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},h)),g&&C.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},g)),x&&C.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},x)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:`0 0 ${n} ${r}`},...C)}function yn(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function vn(e,t,n,o,r,i){const l=r-Math.PI/2,a=i-Math.PI/2,s=yn(e,t,o,l),d=yn(e,t,o,a),c=i-r>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,"Z"].join(" ");const u=yn(e,t,n,a),p=yn(e,t,n,l);return[`M ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,`L ${u.x} ${u.y}`,`A ${n} ${n} 0 ${c} 0 ${p.x} ${p.y}`,"Z"].join(" ")}function kn(e,t){const n=t?.padAngle??0,o=function(e,t){const n=t??function(e){const t=[];for(let n=0;n<e;n++){const o=Math.round(360*n/e);t.push(`hsl(${o}, 70%, 55%)`)}return t}(e.length);return e.map((e,t)=>e.color??n[t%n.length])}(e,t?.colors),r=e.reduce((e,t)=>e+t.value,0);if(r<=0)return[];const i=n*e.length,l=2*Math.PI-i,a=[];let s=0;for(let t=0;t<e.length;t++){const i=e[t],d=s+n/2,c=d+i.value/r*l;a.push({label:i.label,value:i.value,startAngle:d,endAngle:c,percentage:i.value/r*100,color:o[t]}),s=c+n/2}return a}function Sn(e){const{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:l=.02,showLabels:a=!0,showValues:s=!0,showLegend:c=!0,legendPosition:u="right",title:p,centerLabel:f,colors:h,strokeColor:g="#fff",strokeWidth:x=2}=e,b=c&&"right"===u?140:0,m=p?30:0,y=c&&"bottom"===u?22*Math.ceil(t.length/2)+10:0,v=n-b,k=r-m-y,S=v/2,w=m+k/2,$=Math.min(v,k)/2-10,C=e.outerRadius??$,z=d(()=>kn(t,{padAngle:l,colors:h}),[t,l,h]),M=[];p&&M.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:"#333"},p));for(let e=0;e<z.length;e++){const t=z[e],n=vn(S,w,i,C,t.startAngle,t.endAngle);if(M.push(o("path",{key:`slice-${e}`,d:n,fill:t.color,stroke:g,strokeWidth:x})),a||s){const n=(t.startAngle+t.endAngle)/2,r=t.percentage<5,l=yn(S,w,r?C+14:i+.65*(C-i),n-Math.PI/2),d=r?"#333":"#fff",c=r?11:12,u=[];if(a&&u.push(t.label),s&&u.push(`${t.percentage.toFixed(1)}%`),r){const t=yn(S,w,C+2,n-Math.PI/2);M.push(o("line",{key:`connector-${e}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,stroke:"#999",strokeWidth:1}))}a&&M.push(o("text",{key:`label-${e}`,x:l.x,y:l.y-(s?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c,fill:d,pointerEvents:"none"},t.label)),s&&M.push(o("text",{key:`value-${e}`,x:l.x,y:l.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c-1,fill:d,pointerEvents:"none"},`${t.percentage.toFixed(1)}%`))}}if(f&&i>0&&M.push(o("text",{key:"center-label",x:S,y:w,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:"#333"},f)),c){const e=[];if("right"===u){const t=v+10,n=m+20;for(let r=0;r<z.length;r++){const i=z[r],l=n+22*r;e.push(o("circle",{key:`legend-dot-${r}`,cx:t+6,cy:l,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:t+18,y:l,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:"#333"},`${i.label} (${i.percentage.toFixed(1)}%)`))}}else{const t=r-y+10;for(let r=0;r<z.length;r++){const i=z[r],l=r%2*(n/2)+10,a=t+22*Math.floor(r/2);e.push(o("circle",{key:`legend-dot-${r}`,cx:l+6,cy:a,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:l+18,y:a,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:"#333"},`${i.label} (${i.percentage.toFixed(1)}%)`))}}M.push(...e)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:`0 0 ${n} ${r}`},...M)}function wn(e,t,n,o,r){return{x:n+e*Math.cos(t)*r,y:o-e*Math.sin(t)*r}}function $n(e){const{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:a=360,points:c=[],showGrid:u=!0,pointRadius:p=3,pointColor:f="#3b82f6",curveColor:h="#3b82f6",onPointClick:g,onPointDoubleClick:x,onPointContextMenu:b,onPointHover:m}=e,[y,v]=l(r[1]),[k,S]=l(0),[w,$]=l(0),[C,z]=l(null),M=t/2+k,I=n/2+w,L=Math.min(t,n)/2-30,R=L/y,D=d(()=>{const e=Math.max(1,Math.ceil(y)),t=[],n=y/e;for(let o=1;o<=e;o++)t.push(n*o);return t},[y]),A=d(()=>{const e=[];for(let t=0;t<360;t+=30)e.push(t*Math.PI/180);return e},[]),F=d(()=>{if(!i)return"";const e=[];for(let t=0;t<=a;t++){const n=t/a*2*Math.PI,o=i(n);if(o<0||!isFinite(o))continue;const{x:r,y:l}=wn(o,n,M,I,R);e.push(`${0===e.length?"M":"L"}${r.toFixed(2)},${l.toFixed(2)}`)}return e.join(" ")},[i,a,M,I,R]),T=s(e=>{z({x:e.clientX,y:e.clientY,px:k,py:w})},[k,w]),E=s(e=>{C&&(S(C.px+(e.clientX-C.x)),$(C.py+(e.clientY-C.y)))},[C]),W=s(()=>{z(null)},[]),B=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15;v(Math.max(.1,y*t))},[y]),H=s((e,t,n)=>{if(e)return o=>e({r:t.r,theta:t.theta,index:n,event:o})},[]),N=[];if(N.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let e=0;e<D.length;e++){const t=D[e]*R;N.push(o("circle",{cx:M,cy:I,r:t,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${e}`})),N.push(o("text",{x:M+t+2,y:I-4,"font-size":10,fill:"#9ca3af",key:`gl-${e}`},D[e].toFixed(1)))}for(let e=0;e<A.length;e++){const t=A[e],n=D[D.length-1]*R,r=M+n*Math.cos(t),i=I-n*Math.sin(t);N.push(o("line",{x1:M,y1:I,x2:r,y2:i,stroke:"#e5e7eb","stroke-width":1,key:`al-${e}`}));const l=Math.round(180*t/Math.PI),a=M+(n+14)*Math.cos(t),s=I-(n+14)*Math.sin(t);N.push(o("text",{x:a,y:s+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${e}`},`${l}°`))}}N.push(o("line",{x1:M-L,y1:I,x2:M+L,y2:I,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),N.push(o("line",{x1:M,y1:I-L,x2:M,y2:I+L,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),F&&N.push(o("path",{d:F,fill:"none",stroke:h,"stroke-width":2,key:"curve"}));for(let e=0;e<c.length;e++){const t=c[e],{x:n,y:r}=wn(t.r,t.theta,M,I,R);N.push(o("circle",{cx:n,cy:r,r:p,fill:f,key:`pt-${e}`,style:{cursor:"pointer"},onclick:H(g,t,e),ondblclick:H(x,t,e),oncontextmenu:H(b,t,e),onmouseenter:H(m,t,e)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:{cursor:C?"grabbing":"grab"},onmousedown:T,onmousemove:E,onmouseup:W,onmouseleave:W,onwheel:B},...N)}function Cn(e){const t=1<<e,n=[];for(let o=0;o<t;o++){const t=[];for(let n=0;n<e;n++)t.push(2*(o>>n&1)-1);n.push({coords:t})}return n}function zn(e){const t=1<<e,n=[];for(let o=0;o<t;o++)for(let t=0;t<e;t++){const e=o^1<<t;e>o&&n.push({source:o,target:e})}return n}function Mn(e,t){let n=In(e),o=0;for(let r=0;r<e;r++)for(let i=r+1;i<e;i++)o<t.length&&(n=Rn(n,Ln(e,r,i,t[o]))),o++;return n}function In(e){const t=[];for(let n=0;n<e;n++){const o=new Array(e).fill(0);o[n]=1,t.push(o)}return t}function Ln(e,t,n,o){const r=In(e),i=Math.cos(o),l=Math.sin(o);return r[t][t]=i,r[t][n]=-l,r[n][t]=l,r[n][n]=i,r}function Rn(e,t){const n=e.length,o=[];for(let r=0;r<n;r++){const i=new Array(n).fill(0);for(let o=0;o<n;o++)for(let l=0;l<n;l++)i[o]+=e[r][l]*t[l][o];o.push(i)}return o}function Dn(e,t){const n=e.length,o=new Array(n).fill(0);for(let r=0;r<n;r++)for(let i=0;i<n;i++)o[r]+=e[r][i]*t.coords[i];return o}function An(e,t=0){const n=e[0]??0,o=e[1]??0;let r=0;for(let t=2;t<e.length;t++)r+=e[t]??0;if(e.length>2&&(r/=e.length-2),t>0){const e=1/(1+t*(r+2));return{x:n*e,y:o*e,depth:r}}return{x:n,y:o,depth:r}}function Fn(e,t=[],n=.3,o=1){const r=Cn(e),i=zn(e),l=Mn(e,t);return{vertices:r.map((e,t)=>{const r=An(Dn(l,e),n);return{id:t,position:e,x:r.x*o,y:r.y*o,depth:r.depth}}),edges:i,dimension:e}}function Tn(e){return e*(e-1)/2}function En(e,t=70,n=55){const o=[];for(let r=0;r<e;r++){const i=Math.round(360*r/e);o.push(`hsl(${i}, ${t}%, ${n}%)`)}return o}function Wn(e){const t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,u=e.edgeWidth??3,p=e.edgeColor??"#111",f=e.perspective??.25,h=e.rotationSpeed??.008,g=e.showLabels??!1,x=e.backgroundColor??"transparent",b=e.scale??.3*Math.min(n,r),m=Tn(t),y=1<<t,v=d(()=>"auto"===e.vertexColors||void 0===e.vertexColors?En(y):e.vertexColors,[y,e.vertexColors]),[k,S]=l(()=>{const e=[];for(let t=0;t<m;t++)e.push(0);return e}),[w,$]=l(!1),C=c({x:0,y:0}),z=c([]),M=c(0);a(()=>{if(0===h)return;let e=!0;const t=()=>{e&&(S(e=>{const t=e.slice();for(let e=0;e<t.length;e++)t[e]=(t[e]??0)+h*(1+.3*e);return t}),M.current=requestAnimationFrame(t))};return M.current=requestAnimationFrame(t),()=>{e=!1,cancelAnimationFrame(M.current)}},[h]);const I=d(()=>Fn(t,k,f,b),[t,k,f,b]),L=n/2,R=r/2,D=d(()=>I.edges.map(e=>{const t=I.vertices[e.source],n=I.vertices[e.target],o=(t.depth+n.depth)/2;return{...e,avgDepth:o,sv:t,tv:n}}).sort((e,t)=>e.avgDepth-t.avgDepth),[I]),A=d(()=>I.vertices.slice().sort((e,t)=>e.depth-t.depth),[I]),F=s(e=>{const t=e;$(!0),C.current={x:t.clientX,y:t.clientY},z.current=k.slice()},[k]),T=s(e=>{if(!w)return;const t=e,n=.01*(t.clientX-C.current.x),o=.01*(t.clientY-C.current.y);S(()=>{const e=z.current.slice();return e.length>0&&(e[0]=(e[0]??0)+n),e.length>1&&(e[1]=(e[1]??0)+o),e})},[w]),E=s(()=>{$(!1)},[]),W=D.map((e,t)=>{const n=(e=>{const t=(e+2)/4;return.3+.7*Math.max(0,Math.min(1,t))})(e.avgDepth);return o("line",{key:`e-${e.source}-${e.target}`,x1:String(L+e.sv.x),y1:String(R+e.sv.y),x2:String(L+e.tv.x),y2:String(R+e.tv.y),stroke:p,"stroke-width":String(u),"stroke-opacity":String(n),"stroke-linecap":"round"})}),B=A.map(e=>{const n=i*(e=>{const t=(e+2)/4;return.6+.4*Math.max(0,Math.min(1,t))})(e.depth),r=v[e.id%v.length]??"#3b82f6",l=[o("circle",{key:`v-${e.id}-circle`,cx:String(L+e.x),cy:String(R+e.y),r:String(n),fill:r,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return g&&l.push(o("text",{key:`v-${e.id}-label`,x:String(L+e.x),y:String(R+e.y+n+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},e.id.toString(2).padStart(t,"0"))),l});return o("svg",{width:String(n),height:String(r),viewBox:`0 0 ${n} ${r}`,style:{backgroundColor:x,cursor:w?"grabbing":"grab",userSelect:"none"},onMouseDown:F,onMouseMove:T,onMouseUp:E,onMouseLeave:E},...W,...B.flat())}function Bn(e={}){const t=e.dimension??4,n=e.rotationSpeed??.008,o=e.perspective??.25,r=e.scale??200,i=Tn(t),[s,c]=l(()=>new Array(i).fill(0));return a(()=>{if(0===n)return;let e=!0,t=0;const o=()=>{e&&(c(e=>e.map((e,t)=>e+n*(1+.3*t))),t=requestAnimationFrame(o))};return t=requestAnimationFrame(o),()=>{e=!1,cancelAnimationFrame(t)}},[n]),{data:d(()=>Fn(t,s,o,r),[t,s,o,r]),angles:s,setAngles:c}}function Hn(e){const t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",l=e.gap??"12px",a=e.contain??"layout style paint",s={display:"flex",flexDirection:"column",gap:l,width:"number"==typeof e.width?`${e.width}px`:e.width??"auto",height:"number"==typeof e.height?`${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,c=e.legend&&e.legend.length>0?(u=e.legend,o("div",{className:"viz-legend",style:{display:"flex",flexDirection:(p={align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:"left"===n||"right"===n?"column":"row"}).direction,flexWrap:"wrap",gap:`${p.gap}px`,justifyContent:p.align,alignItems:"center",fontSize:p.fontSize,color:"#6b7280",flexShrink:"0"}},...u.map((e,t)=>o("div",{key:`legend-${t}`,style:{display:"flex",alignItems:"center",gap:"6px"}},function(e){const t=e.shape??"circle";return"line"===t?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??""})):o("div","square"===t?{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}:{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}(e),o("span",null,e.label))))):null;var u,p;const f=function(e,t,n,r,i){const l=[];if("top"===r&&e&&l.push(e),"left"===i||"right"===i){const a=[];"left"===i&&n&&a.push(n),"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),"right"===i&&n&&a.push(n),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if("left"===r||"right"===r){"top"===i&&n&&l.push(n);const a=[];"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),"bottom"===i&&n&&l.push(n)}else"top"===i&&n&&l.push(n),l.push(t),"bottom"===i&&n&&l.push(n);return"bottom"===r&&e&&l.push(e),l}(d,o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),c,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:s},...f)}export{pt as Accordion,le as Alert,m as AnalogClock,w as Avatar,z as Badge,ln as BarGraph,ht as Breadcrumb,qe as Card,ot as Carousel,un as CartesianGraph2D,be as Checkbox,ke as ColorPicker,Se as ColorWheel,hn as ComplexGraph2D,Nt as ContextMenu,H as DataGrid,Me as DatePicker,Y as DigitalClock,_t as Drawer,xt as Dropdown,ae as EmptyState,Le as FileUpload,Ue as FlexContainer,Xe as FlexItem,he as FormFieldWrapper,Ge as Grid,Ke as GridItem,Wn as HypercubeGraph,rt as Image,mn as LineGraph,Z as ListView,yt as Menubar,Yt as Modal,Re as MultilineField,at as NavWrapper,De as NumberSpinner,Ct as Pagination,Je as Panel,Sn as PieGraph,$n as PolarGraph2D,Xt as Popover,se as ProgressBar,Ae as RadioGroup,et as ScrollContainer,Fe as Select,Mt as Sidebar,de as Skeleton,Te as Slider,fe as Spinner,tt as Splitter,It as Stepper,nt as Tabs,ne as Tag,Be as TextEditor,He as TextField,je as TimePicker,Zt as ToastContainer,Oe as Toggle,Dt as Toolbar,tn as Tooltip,Bt as TreeNav,At as TreeNode,lt as VideoPlayer,re as VirtualScroll,Hn as VizWrapper,ge as buildInputStyle,st as buildNavItemStyle,Mn as buildRotationMatrix,kn as computeSlices,Kt as createToaster,vn as describeArc,zn as generateEdges,Fn as generateHypercube,En as generatePalette,Cn as generateVertices,Tn as numRotationAngles,An as projectTo2D,Dn as transformVec,nn as useBarGraphScales,dt as useHover,Bn as useHypercube,xn as useLineGraphScales,Qt as useToast};
|
|
1
|
+
const e=Symbol.for("spec.element"),t=Symbol.for("spec.provider"),n=Symbol.for("spec.consumer");function o(t,n,...o){let r=null,i=null;const l={};if(null!=n){void 0!==n.key&&(r=""+n.key),void 0!==n.ref&&(i=n.ref);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&"key"!==e&&"ref"!==e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(l[e]=n[e])}if(1===o.length?l.children=o[0]:o.length>1&&(l.children=o),"function"==typeof t&&t.defaultProps){const e=t.defaultProps;for(const t of Object.keys(e))"__proto__"!==t&&"constructor"!==t&&void 0===l[t]&&(l[t]=e[t])}return{$$typeof:e,type:t,props:l,key:r,ref:i}}function r(e){const o={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},r={$$typeof:t,_context:o},i={$$typeof:n,_context:o};return o.Provider=r,o.Consumer=i,o}function i(){throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.")}function l(e){return i().useState(e)}function a(e,t){return i().useEffect(e,t)}function s(e,t){return i().useCallback(e,t)}function d(e,t){return i().useMemo(e,t)}function c(e){return i().useRef(e)}function u(){return i().useId()}function p(){const e=("undefined"!=typeof window?window.location.hash:"").replace(/^#\/?/,"/");return""===e?"/":e}r({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""}),p();const f=new Set;function h(e){if(!e)return new Date;const t=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),n=e=>Number(t.find(t=>t.type===e)?.value??0);return new Date(n("year"),n("month")-1,n("day"),n("hour"),n("minute"),n("second"))}"undefined"!=typeof window&&window.addEventListener("hashchange",function(){p(),"undefined"!=typeof window&&window.location.hash;for(const e of f)e()}),r({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});const g="#334155",x="#1e293b",b="#374151";function m(e){const{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:d,className:c}=e,[u,p]=l(h(d));a(()=>{const e=setInterval(()=>{p(h(d))},1e3);return()=>clearInterval(e)},[d]);const f=u.getHours(),m=u.getMinutes(),y=u.getSeconds(),v="24h"===t?f%24*15+.25*m:f%12*30+.5*m,k=6*m+.1*y,S=6*y,w=n/2,$=n/2,C=n/2-10,z=C-4,M=C-22,I=[];I.push(o("circle",{cx:String(w),cy:String($),r:String(C),fill:"#f8fafc",stroke:g,"stroke-width":"3"}));const L="24h"===t?24:12;for(let e=0;e<L;e++){const r=(360*e/L-90)*Math.PI/180,i=z-("24h"===t?4:6);I.push(o("line",{x1:String(w+i*Math.cos(r)),y1:String($+i*Math.sin(r)),x2:String(w+z*Math.cos(r)),y2:String($+z*Math.sin(r)),stroke:g,"stroke-width":"2"}));const l=String("24h"===t?e:0===e?12:e),a="24h"===t?.055*n:.08*n;I.push(o("text",{x:String(w+M*Math.cos(r)),y:String($+M*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:b,"font-size":String(a),"font-family":"sans-serif"},l))}const R=(e,t,n,r)=>{const i=(e-90)*Math.PI/180;return o("line",{x1:String(w),y1:String($),x2:String(w+t*Math.cos(i)),y2:String($+t*Math.sin(i)),stroke:r,"stroke-width":n,"stroke-linecap":"round"})};I.push(R(v,.5*C,"4",x)),I.push(R(k,.75*C,"3",x)),s&&I.push(R(S,.85*C,"1.5","#ef4444")),I.push(o("circle",{cx:String(w),cy:String($),r:"4",fill:x}));const D=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...I)];return r&&D.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:b}},function(e,t){const n=e.getFullYear(),o=e.getMonth(),r=e.getDate();switch(t){case"short":return`${String(o+1).padStart(2,"0")}/${String(r).padStart(2,"0")}/${n}`;case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][o]} ${String(r).padStart(2,"0")}, ${n}`;case"iso":return`${n}-${String(o+1).padStart(2,"0")}-${String(r).padStart(2,"0")}`}}(u,i))),o("div",{className:c,style:{display:"inline-block"}},...D)}const y={xs:24,sm:32,md:40,lg:56,xl:80},v=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"],k={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function S(e,t){const 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};default:return{top:n,right:n}}}function w(e){const{src:t,alt:n,name:r,size:i,shape:a="circle",fallbackColor:s,status:d,statusPosition:c="bottom-right"}=e,[u,p]=l(!1),f=function(e){return null==e?y.md:"number"==typeof e?e:y[e]??y.md}(i),h="circle"===a?"50%":`${Math.round(.15*f)}px`,g=s??function(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return v[Math.abs(t)%v.length]}(r),x=`${Math.round(.4*f)}px`,b={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${f}px`,height:`${f}px`,borderRadius:h,overflow:"hidden",flexShrink:"0"};let m;if(t&&!u)m=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>p(!0)});else{const e=function(e){if(!e)return"?";const t=e.trim().split(/\s+/);return 1===t.length?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}(r);m=o("span",{style:{fontSize:x,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},e)}const w=o("div",{style:{...b,backgroundColor:t&&!u?"transparent":g},role:"img","aria-label":n??r??"avatar"},m);if(!d)return w;const $=Math.max(8,Math.round(.25*f));return o("div",{style:{position:"relative",display:"inline-flex",width:`${f}px`,height:`${f}px`,flexShrink:"0"}},w,o("span",{style:{position:"absolute",width:`${$}px`,height:`${$}px`,borderRadius:"50%",backgroundColor:k[d]??k.offline,border:"2px solid #fff",boxSizing:"border-box",...S(c,$)},"aria-label":d}))}const $={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"}},C={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function z(e){const{count:t,max:n,dot:r=!1,color:i="#ef4444",size:l="md",variant:a="solid",children:s}=e;let d=null;r||null==t||(d=null!=n&&t>n?`${n}+`:String(t));const c=r||null!=t&&t>0,u=r?{...C[l],borderRadius:"50%",..."solid"===a?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...$[l],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",..."solid"===a?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},p=c?o("span",{style:u,"aria-label":r?"notification":`count ${d}`},d):null;if(null==s)return p??o("span",null);const f={...u,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},s,c?o("span",{style:f,"aria-label":r?"notification":`count ${d}`},d):null)}const M={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},I={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},L={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},R={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},D={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},A={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},F={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},T={...F,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},E={...F,opacity:"0.5",cursor:"default"},W={cursor:"pointer",width:"16px",height:"16px"};function B(e,t,n){return e!==t?"↕":"asc"===n?"↑":"↓"}function H(e){const{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:a,sortBy:c,sortDir:u,onSort:p,selectable:f=!1,selectedRows:h,onSelectionChange:g,striped:x=!1,bordered:b=!1,compact:m=!1,stickyHeader:y=!1}=e,[v,k]=l(0),[S,w]=l(void 0),[$,C]=l("asc"),[z,H]=l([]),[N,P]=l({}),j=i??v,_=c??S,O=u??$,Y=h??z,q=d(()=>{const e=Object.entries(N).filter(([,e])=>e.length>0);return 0===e.length?n:n.filter(t=>e.every(([e,n])=>String(t[e]??"").toLowerCase().includes(n.toLowerCase())))},[n,N]),U=d(()=>{if(!_)return q;const e=[...q];return e.sort((e,t)=>{const n=e[_],o=t[_];if(null==n&&null==o)return 0;if(null==n)return 1;if(null==o)return-1;if("number"==typeof n&&"number"==typeof o)return"asc"===O?n-o:o-n;const r=String(n),i=String(o),l=r.localeCompare(i);return"asc"===O?l:-l}),e},[q,_,O]),X=U.length,G=r?Math.max(1,Math.ceil(X/r)):1,K=r?U.slice(j*r,(j+1)*r):U,V=s(e=>{a?a(e):k(e)},[a]),J=s(e=>{const t=_===e&&"asc"===O?"desc":"asc";p?p(e,t):(w(e),C(t))},[_,O,p]),Z=s(e=>{const t=Y.includes(e)?Y.filter(t=>t!==e):[...Y,e];g?g(t):H(t)},[Y,g]),Q=s(()=>{const e=K.map((e,t)=>r?j*r+t:t),t=e.every(e=>Y.includes(e))?Y.filter(t=>!e.includes(t)):[...new Set([...Y,...e])];g?g(t):H(t)},[K,Y,r,j,g]),ee=s((e,t)=>{P(n=>({...n,[e]:t})),V(0)},[V]),te=t.some(e=>e.filterable),ne=m?"6px 8px":L.padding,oe=[];if(f){const e=K.map((e,t)=>r?j*r+t:t),t=e.length>0&&e.every(e=>Y.includes(e));oe.push(o("th",{key:"__select_all",style:{...I,padding:ne,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:t,onChange:Q,style:W,"aria-label":"Select all rows"})))}for(const e of t){const t={...I,padding:ne,...e.width?{width:e.width}:{},...e.sortable?{cursor:"pointer"}:{},...b?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},n=[e.header];e.sortable&&n.push(o("span",{style:R},B(e.key,_,O))),oe.push(o("th",{key:e.key,style:t,onClick:e.sortable?()=>J(e.key):void 0,"aria-sort":_===e.key?"asc"===O?"ascending":"descending":void 0},...n))}let re=null;if(te){const e=[];f&&e.push(o("th",{key:"__filter_spacer",style:{padding:ne}}));for(const n of t)e.push(o("th",{key:`filter_${n.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},n.filterable?o("input",{type:"text",placeholder:`Filter ${n.header}...`,style:D,value:N[n.key]??"",onInput:e=>ee(n.key,e.target.value),"aria-label":`Filter by ${n.header}`}):null));re=o("tr",{key:"__filter_row"},...e)}const ie=[];for(let e=0;e<K.length;e++){const n=K[e],i=r?j*r+e:e,l=Y.includes(i),a={};x&&e%2==1&&(a.backgroundColor="#f9fafb"),l&&(a.backgroundColor="#eff6ff");const s=[];f&&s.push(o("td",{key:"__select",style:{padding:ne,textAlign:"center",...L,...b?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:l,onChange:()=>Z(i),style:W,"aria-label":`Select row ${i+1}`})));for(const e of t){const t=n[e.key],r=e.render?e.render(t,n):String(t??"");s.push(o("td",{key:e.key,style:{...L,padding:ne,...b?{border:"1px solid #e5e7eb"}:{}}},r))}ie.push(o("tr",{key:String(i),style:a},...s))}let le=null;if(r){const e=0===X?0:j*r+1,t=Math.min((j+1)*r,X),n=[];n.push(o("button",{key:"prev",style:0===j?E:F,onClick:j>0?()=>V(j-1):void 0,disabled:0===j,"aria-label":"Previous page"},"← Prev"));const i=7;let l=Math.max(0,j-Math.floor(i/2));const a=Math.min(G,l+i);a-l<i&&(l=Math.max(0,a-i)),l>0&&(n.push(o("button",{key:"p0",style:F,onClick:()=>V(0)},"1")),l>1&&n.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let e=l;e<a;e++)n.push(o("button",{key:`p${e}`,style:e===j?T:F,onClick:e!==j?()=>V(e):void 0,"aria-current":e===j?"page":void 0},String(e+1)));a<G&&(a<G-1&&n.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),n.push(o("button",{key:"p"+(G-1),style:F,onClick:()=>V(G-1)},String(G)))),n.push(o("button",{key:"next",style:j>=G-1?E:F,onClick:j<G-1?()=>V(j+1):void 0,disabled:j>=G-1,"aria-label":"Next page"},"Next →")),le=o("div",{style:A},o("span",null,`Showing ${e}–${t} of ${X}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...n))}const ae={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},se={...M,...b?{border:"1px solid #e5e7eb"}:{}},de=o("thead",null,o("tr",null,...oe),re),ce=o("tbody",null,...ie),ue=o("table",{style:se,role:"grid","aria-rowcount":String(X)},de,ce);return o("div",{style:ae},ue,le)}function N(e){return e<10?`0${e}`:String(e)}const P={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"},j={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},_={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},O={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function Y(e){const{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:d}=e,[c,u]=l(new Date);a(()=>{const e=setInterval(()=>{u(new Date)},1e3);return()=>clearInterval(e)},[]);const{hours:p,minutes:f,seconds:h}=function(e,t){if(t){const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),o=e=>Number(n.find(t=>t.type===e)?.value??0);return{hours:o("hour"),minutes:o("minute"),seconds:o("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}(c,s);let g,x=null;"12h"===t?(x=p>=12?"PM":"AM",g=p%12||12):g=p;let b=`${N(g)}:${N(f)}`;i&&(b+=`:${N(h)}`);const m=[b];null!=x&&m.push(o("span",{style:_},x));const y=[o("span",{style:j},...m)];return n&&y.push(o("span",{style:O},function(e,t,n){if(n){const o={timeZone:n};if("short"===t)return Object.assign(o,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);if("long"===t)return Object.assign(o,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);Object.assign(o,{year:"numeric",month:"2-digit",day:"2-digit"});const r=new Intl.DateTimeFormat("en-CA",o).formatToParts(e),i=e=>r.find(t=>t.type===e)?.value??"";return`${i("year")}-${i("month")}-${i("day")}`}return"short"===t?`${N(e.getMonth()+1)}/${N(e.getDate())}/${e.getFullYear()}`:"long"===t?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${N(e.getMonth()+1)}-${N(e.getDate())}`}(c,r,s))),o("div",{style:P,...d?{class:d}:{}},...y)}const q={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},U={padding:"10px 14px",color:"#1f2937"},X={borderBottom:"1px solid #e5e7eb"},G={cursor:"pointer",transition:"background-color 0.15s ease"},K={backgroundColor:"#eff6ff"},V={padding:"24px",textAlign:"center",color:"#9ca3af",fontSize:"14px"},J={padding:"10px 14px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",fontWeight:"600",fontSize:"13px",color:"#6b7280"};function Z(e){const{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:l=!1,selectedIndex:a,onSelect:s,emptyMessage:d="No items",header:c,footer:u}=e;if(0===t.length)return o("div",null,c?o("div",{style:J},c):null,o("div",{style:V},d),u?o("div",{style:{...J,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},u):null);const p=[];for(let e=0;e<t.length;e++){const d=t[e],c=r(d,e),u=a===e,f=e===t.length-1,h={...U,...l?G:{},...u?K:{},...i&&!f?X:{}};p.push(o("li",{key:c,style:h,onClick:s?()=>s(e):void 0,role:s?"option":void 0,"aria-selected":s?String(u):void 0},n(d,e)))}return o("div",null,c?o("div",{style:J},c):null,o("ul",{style:q,role:s?"listbox":"list"},...p),u?o("div",{style:{...J,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},u):null)}function Q(e,t){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec({red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e);return n?`rgba(${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)}, ${t})`:e}const ee={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}},te={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 ne(e){const{label:t,color:n,variant:r="subtle",size:i="md",removable:l=!1,onRemove:a,icon:s,onClick:d,disabled:c=!1}=e,u=function(e){return e??"#3b82f6"}(n),p=function(e,t,n,o,r){const i=ee[n],l={display:"inline-flex",alignItems:"center",gap:i.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:i.fontSize,fontWeight:"500",padding:i.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...o?{cursor:"pointer"}:{},...r?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...l,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...l,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...l,backgroundColor:Q(e,.12),color:e,border:"none"};default:return l}}(u,r,i,!!d,c),f=[];return s&&f.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},s)),f.push(o("span",{key:"label"},t)),l&&f.push(o("button",{key:"remove",type:"button",style:te,onClick:e=>{e.stopPropagation(),!c&&a&&a()},"aria-label":`Remove ${t}`,disabled:c},"×")),o("span",{style:p,role:d?"button":void 0,tabIndex:d&&!c?"0":void 0,onClick:!c&&d?d:void 0,"aria-disabled":c?"true":void 0},...f)}const oe={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function re(e){const{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:a}=e,[d,u]=l(0),p=c(null),f=t.length*r,h=parseInt(a,10)||400,g=Math.ceil(h/r),x=Math.max(0,Math.floor(d/r)-i),b=Math.min(t.length,Math.floor(d/r)+g+i),m=s(e=>{const t=e.target;u(t.scrollTop)},[]),y=[];for(let e=x;e<b;e++)y.push(o("div",{key:String(e),style:{position:"absolute",top:e*r+"px",left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[e],e)));return o("div",{ref:p,style:{...oe,height:a},onScroll:m},o("div",{style:{height:`${f}px`,position:"relative",width:"100%"}},...y))}const ie={info:{icon:"ℹ️",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"✅",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"⚠️",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"❌",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function le(e){const[t,n]=l(!0),r=e.type??"info",i=e.variant??"subtle",a=ie[r]??ie.info,s=e.icon??a.icon,c=e.message??e.children,u=d(()=>{const e={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return"filled"===i?(e.backgroundColor=a.filledBg,e.color=a.filledText):"outline"===i?(e.backgroundColor="transparent",e.border=`1px solid ${a.border}`,e.color=a.text):(e.backgroundColor=a.bg,e.color=a.text),e},[i,a]);return t?o("div",{role:"alert",style:u},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},s),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:c?"4px":"0"}},e.title):null,c?o("div",null,c):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:"filled"===i?"1px solid currentColor":`1px solid ${a.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"}},"×"):null):null}function ae(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 se(e){const 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",l=e.backgroundColor??"#e5e7eb",a=e.height??("string"==typeof e.size?e.size:"number"==typeof e.size?`${e.size}px`:"8px"),s=e.variant??"bar",c=u();if("circular"===s){const t="number"==typeof e.size?e.size:48,n=Math.max(2,Math.round(t/10)),a=(t-n)/2,s=2*Math.PI*a,d=e.indeterminate?.75*s:s-r/100*s,u=e.indeterminate?`@keyframes liq-spin-${c}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${c}{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"}},u?o("style",null,u):null,o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:e.indeterminate?{animation:`liq-spin-${c} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${c} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:l,"stroke-width":String(n)}),o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:i,"stroke-width":String(n),"stroke-dasharray":String(s),"stroke-dashoffset":String(d),"stroke-linecap":"round",transform:`rotate(-90 ${t/2} ${t/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}const p=e.animated||e.indeterminate?`@keyframes liq-shimmer-${c}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",f=e.indeterminate?`@keyframes liq-indeterminate-${c}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",h={width:"100%",height:a,backgroundColor:l,borderRadius:a,overflow:"hidden",position:"relative"},g=d(()=>{const t={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(t.position="absolute",t.animation=`liq-indeterminate-${c} 1.5s ease-in-out infinite`,t.backgroundColor=i):(t.width=`${r}%`,t.backgroundColor=i),e.animated&&!e.indeterminate&&(t.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${function(e){const t=e.replace("#","");if(6!==t.length)return e;const n=Math.min(255,parseInt(t.slice(0,2),16)+40),o=Math.min(255,parseInt(t.slice(2,4),16)+40),r=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}(i)} 50%, ${i} 100%)`,t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${c} 1.5s ease-in-out infinite`),t},[r,i,a,e.animated,e.indeterminate,c]);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%"}},p||f?o("style",null,p+f):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:h},o("div",{style:g})))}function de(e){const t=e.variant??"text",n=!1!==e.animated,r=u(),i=d(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),l="number"==typeof e.width?`${e.width}px`:e.width,a="number"==typeof e.height?`${e.height}px`:e.height;if("text"===t){const t=e.lines??1,s=[];for(let i=0;i<t;i++){const d=i===t-1&&t>1;s.push(o("div",{key:String(i),style:ce({width:d?"75%":l??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:i<t-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:l??"100%"}},i?o("style",null,i):null,...s)}if("circular"===t){const e=l??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:ce({width:e,height:e,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:ce({width:l??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function ce(e){const 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}const ue={sm:16,md:24,lg:40},pe={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function fe(e){const t="number"==typeof e.size?e.size:ue[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=pe[e.speed??"normal"]??pe.normal,l=e.label??"Loading",a=u(),s=(t-r)/2,c=2*Math.PI*s;return o("span",{role:"status","aria-label":l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,d(()=>`@keyframes liq-rotate-${a}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[a])),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${a} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(s),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${.7*c} ${.3*c}`,"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"}},l))}function he(e){const t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:"number"==typeof t.width?`${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"},l={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:l,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:l},e.helpText):null)}function ge(e,t){const 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??{}}}const xe={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function be(e){const{checked:t,onChange:n,label:r,indeterminate:i=!1,disabled:l=!1,error:d,size:u="md"}=e,p=c(null);a(()=>{p.current&&(p.current.indeterminate=i)},[i]);const f=s(()=>{l||n(!t)},[l,t,n]),h=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),g=xe[u],x=`${g.box}px`,b={width:x,height:x,minWidth:x,borderRadius:"4px",border:"2px solid "+(d?"#ef4444":t||i?"#3b82f6":"#d1d5db"),backgroundColor:t||i?"#3b82f6":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},m={color:"#ffffff",fontSize:`${g.icon}px`,lineHeight:"1",fontWeight:"700"},y=i?o("span",{style:m},"—"):t?o("span",{style:m},"✓"):null,v={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},k=o("input",{ref:p,type:"checkbox",checked:t,disabled:l,onChange:()=>n(!t),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),S=o("div",{style:b},y),w=r?o("span",{style:{fontSize:g.fontSize,color:"#374151"}},r):null;return o(he,{error:d},o("div",{style:v,onClick:f,onKeyDown:h,tabIndex:l?-1:0,role:"checkbox","aria-checked":i?"mixed":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},k,S,w))}const me=["#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 ye(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function ve(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 ke(e){const{value:t,onChange:n,presets:r=me,showInput:i=!0,showAlpha:d=!1,disabled:u=!1,label:p}=e,[f,h]=l(!1),[g,x]=l(t),b=c(null);a(()=>{x(t)},[t]),a(()=>{const e=e=>{b.current&&!b.current.contains(e.target)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const m=s(e=>{u||n(ve(e))},[u,n]),y=s(e=>{const t=e.target.value;x(t);const o=t.startsWith("#")?t:`#${t}`;ye(o)&&n(ve(o))},[n]),v=s(()=>{ye(g.startsWith("#")?g:`#${g}`)||x(t)},[g,t]),k={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:t,cursor:u?"not-allowed":"pointer",flexShrink:"0"},S={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:i?"8px":"0"},w=r.map(e=>{const n=ve(e)===ve(t);return o("div",{key:e,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:e,cursor:u?"not-allowed":"pointer",border:n?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>m(e),title:e})}),$=i?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:t,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:g,onInput:y,onBlur:v,disabled:u,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,C=f?o("div",{style:{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"}},o("div",{style:S},...w),$):null;return o(he,{label:p,disabled:u},o("div",{ref:b,style:{position:"relative"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:u?void 0:()=>h(!f)},o("div",{style:k}),i?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},t):null),C))}function Se(e){const{value:t="#000000",onChange:n,size:r=32,showLabel:i=!0,disabled:a=!1,label:d}=e,[u,p]=l(t),f=c(null),h=s((...e)=>{const t=e[0].target.value;p(t),n?.(t)},[n]),g={width:`${r}px`,height:`${r}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:a?"not-allowed":"pointer",position:"relative",overflow:"hidden"},x={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:a?"not-allowed":"pointer",border:"none",padding:"0"};return o("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"}},d?o("label",{style:{fontSize:"12px",color:"#64748b",fontWeight:"500"}},d):null,o("div",{style:g},o("input",{ref:f,type:"color",value:u,onInput:h,disabled:a,style:x})),i?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null)}const we=["January","February","March","April","May","June","July","August","September","October","November","December"],$e=["Su","Mo","Tu","We","Th","Fr","Sa"];function Ce(e){if(!e)return null;if(e instanceof Date)return e;const t=new Date(e);return isNaN(t.getTime())?null:t}function ze(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Me(e){const{value:t,onChange:n,format:r="YYYY-MM-DD",minDate:i,maxDate:u,disabled:p=!1,placeholder:f="Select date...",label:h,error:g}=e,x=d(()=>Ce(t),[t]),b=d(()=>Ce(i),[i]),m=d(()=>Ce(u),[u]),[y,v]=l(!1),[k,S]=l(()=>x?x.getFullYear():(new Date).getFullYear()),[w,$]=l(()=>x?x.getMonth():(new Date).getMonth()),C=c(null),z=d(()=>new Date,[]);a(()=>{const e=e=>{C.current&&!C.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const M=s(()=>{$(e=>0===e?(S(e=>e-1),11):e-1)},[]),I=s(()=>{$(e=>11===e?(S(e=>e+1),0):e+1)},[]),L=s(e=>{const t=new Date(k,w,e);b&&t<b||m&&t>m||(n(function(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t)),v(!1))},[k,w,n,b,m]),R=x?function(e,t){const n=e.getFullYear(),o=e.getMonth()+1,r=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(o).padStart(2,"0")).replace("DD",String(r).padStart(2,"0"))}(x,r):"",D=d(()=>{const e=new Date(k,w,1).getDay(),t=new Date(k,w+1,0).getDate(),n=[];let o=[];for(let t=0;t<e;t++)o.push(null);for(let e=1;e<=t;e++)o.push(e),7===o.length&&(n.push(o),o=[]);for(;o.length>0&&o.length<7;)o.push(null);return o.length&&n.push(o),n},[k,w]),A={...ge({},{focused:y,error:!!g}),cursor:p?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},F={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},T=$e.map(e=>o("div",{key:e,style:{padding:"4px"}},e)),E=D.map((e,t)=>{const n=e.map((e,n)=>{if(null===e)return o("div",{key:`empty-${t}-${n}`,style:{padding:"4px"}});const r=new Date(k,w,e),i=ze(r,z),l=!!x&&ze(r,x),a=b&&r<b||m&&r>m;return o("div",{key:`day-${e}`,style:{padding:"4px",textAlign:"center",cursor:a?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:i?"700":"400",backgroundColor:l?"#3b82f6":"transparent",color:l?"#ffffff":a?"#d1d5db":i?"#3b82f6":"#1f2937",border:i&&!l?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"},onClick:a?void 0:()=>L(e)},String(e))});return o("div",{key:`row-${t}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...n)}),W=y?o("div",{style:{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"}},o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"}},o("button",{type:"button",style:F,onClick:M},"◀"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${we[w]} ${k}`),o("button",{type:"button",style:F,onClick:I},"▶")),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"}},...T),...E):null;return o(he,{label:h,error:g,disabled:p},o("div",{ref:C,style:{position:"relative"}},o("div",{style:A,onClick:p?void 0:()=>v(!y),tabIndex:p?-1:0,role:"button","aria-label":"Pick a date"},o("span",{style:{color:R?"#1f2937":"#9ca3af"}},R||f),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"📅")),W))}function Ie(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${["B","KB","MB","GB"][t]}`}function Le(e){const{onChange:t,accept:n,multiple:r=!1,maxSize:i,disabled:a=!1,label:d,helpText:u}=e,[p,f]=l([]),[h,g]=l(!1),[x,b]=l(""),m=c(null),y=s(e=>{b("");const n=[];for(const t of e)i&&t.size>i?b(`File "${t.name}" exceeds maximum size of ${Ie(i)}`):n.push(t);const o=r?[...p,...n]:n.slice(0,1);f(o),t(o)},[p,r,i,t]),v=s(e=>{if(e.preventDefault(),e.stopPropagation(),g(!1),a)return;const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);y(n)},[a,y]),k=s(e=>{e.preventDefault(),e.stopPropagation(),a||g(!0)},[a]),S=s(e=>{e.preventDefault(),e.stopPropagation(),g(!1)},[]),w=s(e=>{const t=e.target;t.files&&(y(Array.from(t.files)),t.value="")},[y]),$=s(e=>{const n=p.filter((t,n)=>n!==e);f(n),t(n)},[p,t]),C=s(()=>{a||m.current&&m.current.click()},[a]),z={border:"2px dashed "+(h?"#3b82f6":x?"#ef4444":"#d1d5db"),borderRadius:"8px",padding:"24px",textAlign:"center",cursor:a?"not-allowed":"pointer",backgroundColor:h?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:a?"0.6":"1"},M={fontSize:"12px",color:"#9ca3af"},I=o("input",{ref:m,type:"file",accept:n,multiple:r,onChange:w,disabled:a,style:{display:"none"},tabIndex:-1}),L=o("div",{style:z,onClick:C,onDrop:v,onDragOver:k,onDragLeave:S,role:"button",tabIndex:a?-1:0,"aria-label":"Upload files"},o("div",{style:{fontSize:"28px",color:"#9ca3af",marginBottom:"8px"}},"↑"),o("div",{style:{fontSize:"14px",color:"#374151",marginBottom:"4px"}},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),n?o("div",{style:M},n):null,i?o("div",{style:M},`Max size: ${Ie(i)}`):null),R=p.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...p.map((e,t)=>o("div",{key:`file-${t}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},Ie(e.size))),o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"},onClick:e=>{e.stopPropagation(),$(t)},"aria-label":`Remove ${e.name}`},"✕")))):null;return o(he,{label:d,helpText:u,error:x||void 0,disabled:a},o("div",null,I,L,R))}function Re(e){const[t,n]=l(!1),[r,i]=l((e.value??e.defaultValue??"").length),a=e.id??`ml-${Math.random().toString(36).slice(2,8)}`,d={...ge(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}:{}},c=s(t=>{const n=t.target,o=n.value;i(o.length),e.onChange&&e.onChange(o),e.autoResize&&(n.style.height="auto",n.style.height=`${n.scrollHeight}px`)},[e.onChange,e.autoResize]),u=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:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:c}),p=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>.9*(e.maxLength??1/0)?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(he,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},u,p)}function De(e){const{value:t,onChange:n,min:r,max:i,step:a=1,disabled:d=!1,prefix:c,suffix:u,label:p,error:f}=e,[h,g]=l(!1),x=s(e=>{let t=e;return void 0!==r&&t<r&&(t=r),void 0!==i&&t>i&&(t=i),t},[r,i]),b=s(()=>{d||n(x(t+a))},[d,t,a,x,n]),m=s(()=>{d||n(x(t-a))},[d,t,a,x,n]),y=s(e=>{const t=e.target.value;if(""===t||"-"===t)return;const o=parseFloat(t);isNaN(o)||n(x(o))},[x,n]),v=s(e=>{d||("ArrowUp"===e.key?(e.preventDefault(),b()):"ArrowDown"===e.key&&(e.preventDefault(),m()))},[d,b,m]),k=void 0===i||t<i,S={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:"1px solid "+(f?"#ef4444":h?"#3b82f6":"#d1d5db"),transition:"border-color 0.15s",opacity:d?"0.6":"1",...h&&!f?{boxShadow:"0 0 0 3px #3b82f622"}:{}},w=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"#f9fafb",border:"none",cursor:d||!e?"not-allowed":"pointer",color:d||!e?"#d1d5db":"#374151",fontSize:"16px",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),$={display:"flex",alignItems:"center",fontSize:"13px",color:"#6b7280",padding:"0 4px",backgroundColor:"#f9fafb"},C=o("button",{type:"button",style:w(void 0===r||t>r),onClick:m,disabled:d,"aria-label":"Decrement",tabIndex:-1},"−"),z=c?o("span",{style:$},c):null,M=o("input",{type:"text",value:String(t),onInput:y,onKeyDown:v,onFocus:()=>g(!0),onBlur:()=>g(!1),disabled:d,style:{flex:"1",minWidth:"48px",textAlign:"center",border:"none",borderLeft:"1px solid #e5e7eb",borderRight:"1px solid #e5e7eb",outline:"none",fontSize:"14px",fontFamily:"inherit",backgroundColor:"#ffffff",color:"#1f2937",padding:"8px 4px"},"aria-label":p||"Number",role:"spinbutton","aria-valuenow":String(t),"aria-valuemin":void 0!==r?String(r):void 0,"aria-valuemax":void 0!==i?String(i):void 0}),I=u?o("span",{style:$},u):null,L=o("button",{type:"button",style:w(k),onClick:b,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),R=[C];return z&&R.push(z),R.push(M),I&&R.push(I),R.push(L),o(he,{label:p,error:f,disabled:d},o("div",{style:S},...R))}function Ae(e){const{options:t,value:n,onChange:r,name:i,direction:l="vertical",disabled:a=!1,error:d,label:c}=e,u=s(e=>{a||r(e)},[a,r]),p=s(e=>{if(a)return;const o=t.filter(e=>!e.disabled);if(0===o.length)return;const i=o.findIndex(e=>e.value===n);let l=i;if("ArrowDown"===e.key||"ArrowRight"===e.key)e.preventDefault(),l=i<o.length-1?i+1:0;else{if("ArrowUp"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault(),l=i>0?i-1:o.length-1}r(o[l].value)},[a,t,n,r]),f={display:"flex",flexDirection:"horizontal"===l?"row":"column",gap:"horizontal"===l?"16px":"8px"},h=t.map(e=>{const t=e.value===n,r=a||!!e.disabled,l={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:"2px solid "+(d?"#ef4444":t?"#3b82f6":"#d1d5db"),display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},s={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:t?"scale(1)":"scale(0)"},c={display:"inline-flex",alignItems:"center",gap:"8px",cursor:r?"not-allowed":"pointer",opacity:r?"0.5":"1",userSelect:"none"};return o("label",{key:e.value,style:c,onClick:r?void 0:t=>{t.preventDefault(),u(e.value)}},o("input",{type:"radio",name:i,value:e.value,checked:t,disabled:r,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:l},o("div",{style:s})),o("span",{style:{fontSize:"14px",color:"#374151"}},e.label))});return o(he,{label:c,error:d},o("div",{style:f,role:"radiogroup","aria-label":c,onKeyDown:p,tabIndex:a?-1:0},...h))}function Fe(e){const{options:t,value:n,onChange:r,placeholder:i="Select...",searchable:u=!1,multiple:p=!1,clearable:f=!1,disabled:h=!1,error:g,label:x,helpText:b}=e,[m,y]=l(!1),[v,k]=l(""),[S,w]=l(-1),$=c(null),C=d(()=>Array.isArray(n)?n:n?[n]:[],[n]),z=d(()=>{if(!u||!v)return t;const e=v.toLowerCase();return t.filter(t=>t.label.toLowerCase().includes(e))},[t,v,u]),M=d(()=>{const e={},t=[];for(const n of z)n.group?(e[n.group]||(e[n.group]=[]),e[n.group].push(n)):t.push(n);return{groups:e,ungrouped:t}},[z]),I=d(()=>0===C.length?"":C.map(e=>t.find(t=>t.value===e)).filter(Boolean).map(e=>e.label).join(", "),[C,t]);a(()=>{const e=e=>{const t=e.target;$.current&&!$.current.contains(t)&&(y(!1),k(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const L=s(e=>{if(p){const t=C.includes(e)?C.filter(t=>t!==e):[...C,e];r(t)}else r(e),y(!1),k("")},[p,C,r]),R=s(e=>{e.stopPropagation(),r(p?[]:"")},[p,r]),D=s(e=>{if(h)return;const t=e.key;if(!m&&("Enter"===t||" "===t||"ArrowDown"===t))return e.preventDefault(),y(!0),void w(0);if(m){if("Escape"===t)return y(!1),void k("");if("ArrowDown"===t)e.preventDefault(),w(e=>Math.min(e+1,z.length-1));else if("ArrowUp"===t)e.preventDefault(),w(e=>Math.max(e-1,0));else if("Enter"===t&&S>=0&&S<z.length){e.preventDefault();const t=z[S];t.disabled||L(t.value)}}},[h,m,S,z,L]),A={...ge({},{focused:m,error:!!g}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},F=(e,t)=>{const n=C.includes(e.value),r=t===S,i={padding:"8px 12px",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:r?"#f3f4f6":n?"#eff6ff":"transparent",color:e.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:e.value,style:i,onClick:e.disabled?void 0:()=>L(e.value),onMouseEnter:()=>w(t),role:"option","aria-selected":n?"true":"false","aria-disabled":e.disabled?"true":void 0},p&&n?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"✓"):null,e.label)},T=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:m?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"▼"),E=o("div",{style:A,onClick:h?void 0:()=>{y(!m),w(-1)},onKeyDown:D,tabIndex:h?-1:0,role:"combobox","aria-expanded":m?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:I?"#1f2937":"#9ca3af"}},I||i),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},f&&C.length>0?o("span",{onClick:R,style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button","aria-label":"Clear selection"},"✕"):null,T)),W=u&&m?o("input",{type:"text",value:v,onInput:e=>{k(e.target.value),w(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,B=m?o("div",{style:{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"},role:"listbox"},W,...(()=>{const e=[];let t=0;const{groups:n,ungrouped:r}=M;for(const n of r)e.push(F(n,t++));for(const r of Object.keys(n)){e.push(o("div",{key:`group-${r}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},r));for(const o of n[r])e.push(F(o,t++))}return 0===e.length&&e.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),e})()):null;return o(he,{label:x,error:g,helpText:b,disabled:h},o("div",{ref:$,style:{position:"relative"}},E,B))}function Te(e){const{value:t,onChange:n,min:r=0,max:i=100,step:u=1,showValue:p=!1,showTicks:f=!1,disabled:h=!1,marks:g,range:x=!1,label:b,error:m}=e,y=c(null),[v,k]=l(null),S=d(()=>{if(x&&Array.isArray(t))return t;const e="number"==typeof t?t:0;return[e,e]},[t,x]),w=e=>{const t=Math.round((e-r)/u)*u+r;return Math.max(r,Math.min(i,t))},$=e=>(e-r)/(i-r)*100,C=s(e=>{if(!y.current)return r;const t=y.current.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));return w(r+n*(i-r))},[r,i,u]),z=s(e=>t=>{h||(t.preventDefault(),k(e))},[h]),M=s(e=>{if(h)return;const t=C(e);if(x){const e=Math.abs(t-S[0]),o=Math.abs(t-S[1]);n(e<=o?[w(t),S[1]]:[S[0],w(t)])}else n(w(t))},[h,C,x,S,n,r,i,u]);a(()=>{if(!v)return;const e=e=>{const t=C(e);"single"===v?n(w(t)):"start"===v?n([Math.min(w(t),S[1]),S[1]]):"end"===v&&n([S[0],Math.max(S[0],w(t))])},t=()=>k(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[v,C,S,n,r,i,u]);const I=s(e=>{if(h)return;let o=0;if("ArrowRight"===e.key||"ArrowUp"===e.key)o=u;else{if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key)return;o=-u}e.preventDefault(),x||n(w(("number"==typeof t?t:0)+o))},[h,u,x,t,n,r,i]),L={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},R=x?$(S[0]):0,D={position:"absolute",top:"0",left:`${R}%`,width:$(x?S[1]:S[0])-R+"%",height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},A=e=>b?"start"===e?`${b} minimum`:"end"===e?`${b} maximum`:b:"start"===e?"Minimum value":"end"===e?"Maximum value":"Value",F=(e,t,n)=>o("div",{style:{position:"absolute",top:"50%",left:`${e}%`,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"},onMouseDown:z(t),role:"slider","aria-valuenow":String(n),"aria-valuemin":String(r),"aria-valuemax":String(i),"aria-label":A(t),tabIndex:h?-1:0,onKeyDown:I},p?o("div",{style:{position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"}},String(n)):null),T=[];if(f)for(let e=r;e<=i;e+=u)T.push(o("div",{key:`tick-${e}`,style:{position:"absolute",top:"10px",left:`${$(e)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));const E=[];if(g)for(const e of g)E.push(o("div",{key:`mark-${e.value}`,style:{position:"absolute",top:"18px",left:`${$(e.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},e.label));const W={paddingTop:p?"28px":"8px",paddingBottom:g||f?"28px":"8px",opacity:h?"0.6":"1"},B=[];return x?(B.push(F($(S[0]),"start",S[0])),B.push(F($(S[1]),"end",S[1]))):B.push(F($(S[0]),"single",S[0])),o(he,{label:b,error:m},o("div",{style:W},o("div",{ref:y,style:L,onClick:M},o("div",{style:D}),...B,...T,...E)))}const Ee=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],We={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:"•",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"“",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"🔗",command:"createLink"},unlink:{label:"Remove link",icon:"⛔",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"―",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"✘",command:"removeFormat"},undo:{label:"Undo",icon:"↩",command:"undo"},redo:{label:"Redo",icon:"↪",command:"redo"}};function Be(e){const[t,n]=l(!1),r=c(null),i=e.id??`te-${Math.random().toString(36).slice(2,8)}`,d=e.toolbar??Ee,u=e.toolbarStyle??{},p=e.editorStyle??{};a(()=>{r.current&&void 0!==e.value&&(r.current.innerHTML=e.value)},[]);const f=s((t,n)=>{if(!e.disabled&&!e.readOnly){if("createLink"===t){const e=prompt("Enter URL:");if(!e)return;document.execCommand(t,!1,e)}else n&&"formatBlock"===t?document.execCommand(t,!1,`<${n}>`):document.execCommand(t,!1,n);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]),g=s(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),x=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:u.backgroundColor??"#f9fafb",borderBottom:u.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...d.map(t=>{const n=We[t];return n?o("button",{key:t,type:"button",title:n.label,onClick:()=>f(n.command,n.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:u.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:u.buttonSize??"13px",fontWeight:"bold"===t?"700":"italic"===t?"400":"500",fontStyle:"italic"===t?"italic":"normal",textDecoration:"underline"===t?"underline":"strikethrough"===t?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},n.icon):null})),b=o("div",{ref:r,id:i,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:p.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:p.backgroundColor??"#ffffff",color:p.color??"#1f2937",fontFamily:p.fontFamily??"inherit",fontSize:p.fontSize??"14px",lineHeight:p.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:g,onInput:h});return o(he,{label:e.label,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"}},x,b))}function He(e){const[t,n]=l(!1),r=e.id??`tf-${Math.random().toString(36).slice(2,8)}`,i=ge(e.inputStyle??{},{focused:t,error:!!e.error}),a=!(!e.prefix&&!e.suffix),s=o("input",{type:e.type??"text",id:r,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?{...i,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:i,onFocus:()=>n(!0),onBlur:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:t=>{const n=t.target.value;e.onInput&&e.onInput(n),e.onChange&&e.onChange(n)},onKeyDown:t=>{"Enter"===t.key&&e.onEnter&&e.onEnter(t.target.value)}}),d=a?o("div",{style:{...i,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,s,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):s;return o(he,{label:e.label,htmlFor:r,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}const Ne=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Pe(e){return String(e).padStart(2,"0")}function je(e){const{value:t,onChange:n,format:r="24h",minuteStep:i=1,disabled:a=!1,label:c,error:u,showSeconds:p=!1,timezone:f,showTimezone:h=!1,timezones:g=Ne,onTimezoneChange:x}=e,[b,m]=l(!1),y=d(()=>function(e){const t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}(t),[t]),v="12h"===r,k=y.hour>=12,S=v?y.hour%12||12:y.hour,w=s((e,t,o)=>{const r=Math.max(0,Math.min(23,e)),i=Math.max(0,Math.min(59,t)),l=Math.max(0,Math.min(59,o??0));n(p?`${Pe(r)}:${Pe(i)}:${Pe(l)}`:`${Pe(r)}:${Pe(i)}`)},[n,p]),$=s(e=>{let t=parseInt(e.target.value,10)||0;v&&(t%=12,k&&(t+=12)),w(t,y.minute,y.second)},[v,k,y.minute,y.second,w]),C=s(e=>{const t=parseInt(e.target.value,10)||0;w(y.hour,t,y.second)},[y.hour,y.second,w]),z=s(e=>{const t=parseInt(e.target.value,10)||0;w(y.hour,y.minute,t)},[y.hour,y.minute,w]),M=s(()=>{if(a)return;const e=k?y.hour-12:y.hour+12;w(e,y.minute,y.second)},[a,k,y.hour,y.minute,y.second,w]),I=s(e=>{a||w(y.hour+e,y.minute,y.second)},[a,y.hour,y.minute,y.second,w]),L=s(e=>{a||w(y.hour,y.minute+e*i,y.second)},[a,y.hour,y.minute,y.second,i,w]),R=s(e=>{a||w(y.hour,y.minute,y.second+e)},[a,y.hour,y.minute,y.second,w]),D=s(e=>{const t=e.target.value;x&&x(t)},[x]),A={display:"inline-flex",alignItems:"center",gap:"4px",...ge({},{focused:b,error:!!u})},F={display:"flex",flexDirection:"column",alignItems:"center"},T={background:"none",border:"none",cursor:a?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},E={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},W={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},B=o("div",{style:F},o("button",{type:"button",style:T,onClick:()=>I(1),disabled:a},"▲"),o("input",{type:"text",value:Pe(S),onChange:$,style:E,disabled:a,"aria-label":"Hour",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:T,onClick:()=>I(-1),disabled:a},"▼")),H=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),N=o("div",{style:F},o("button",{type:"button",style:T,onClick:()=>L(1),disabled:a},"▲"),o("input",{type:"text",value:Pe(y.minute),onChange:C,style:E,disabled:a,"aria-label":"Minute",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:T,onClick:()=>L(-1),disabled:a},"▼")),P=p?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,j=p?o("div",{style:F},o("button",{type:"button",style:T,onClick:()=>R(1),disabled:a},"▲"),o("input",{type:"text",value:Pe(y.second),onChange:z,style:E,disabled:a,"aria-label":"Second",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:T,onClick:()=>R(-1),disabled:a},"▼")):null,_=v?o("button",{type:"button",style:W,onClick:M,disabled:a,"aria-label":"Toggle AM/PM"},k?"PM":"AM"):null,O={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},Y=f&&!h?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},f):null,q=h?o("select",{style:O,value:f??g[0],onChange:D,disabled:a,"aria-label":"Timezone"},...g.map(e=>o("option",{key:e,value:e},e))):null,U=[B,H,N];return P&&U.push(P),j&&U.push(j),_&&U.push(_),Y&&U.push(Y),q&&U.push(q),o(he,{label:c,error:u,disabled:a},o("div",{style:A},...U))}const _e={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 Oe(e){const{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:l=!1,size:a="md",onColor:d="#3b82f6",offColor:c="#d1d5db"}=e,u=_e[a],p=s(()=>{l||n(!t)},[l,t,n]),f=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),h={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?d:c,position:"relative",cursor:l?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},g=t?u.trackW-u.thumbSize-u.offset:u.offset,x={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${g}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},b={display:"inline-flex",alignItems:"center",gap:"8px",opacity:l?"0.5":"1",userSelect:"none"},m=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,y=o("div",{style:h},o("div",{style:x}));return o("div",{style:b,onClick:p,onKeyDown:f,tabIndex:l?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},...("left"===i?[m,y]:[y,m]).filter(Boolean))}const Ye={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 qe(e){const t=!1!==e.bordered,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",l=d(()=>{const o={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=Ye[n]??Ye.sm,e.hoverable&&(o.cursor="pointer"),{...o,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},s={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},c={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:l},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:s},e.children),e.footer?o("div",{className:"card__footer",style:c},e.footer):null)}function Ue(e){const t=d(()=>{const t={display:e.inline?"inline-flex":"flex"};return e.direction&&(t.flexDirection=e.direction),e.wrap&&(t.flexWrap=e.wrap),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyContent&&(t.justifyContent=e.justifyContent),{...t,...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 Xe(e){const t=d(()=>{const t={};return e.flex&&(t.flex=e.flex),void 0!==e.grow&&(t.flexGrow=String(e.grow)),void 0!==e.shrink&&(t.flexShrink=String(e.shrink)),e.basis&&(t.flexBasis=e.basis),e.alignSelf&&(t.alignSelf=e.alignSelf),void 0!==e.order&&(t.order=String(e.order)),{...t,...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 Ge(e){const t=d(()=>{const t={display:"grid"};return e.minColWidth?t.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:void 0!==e.columns&&(t.gridTemplateColumns="number"==typeof e.columns?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(t.gridTemplateRows=e.rows),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyItems&&(t.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(t.gridTemplateAreas=e.areas.map(e=>`"${e}"`).join(" ")),{...t,...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 Ke(e){const t=d(()=>{const t={};return e.gridColumn&&(t.gridColumn=e.gridColumn),e.gridRow&&(t.gridRow=e.gridRow),e.gridArea&&(t.gridArea=e.gridArea),e.alignSelf&&(t.alignSelf=e.alignSelf),e.justifySelf&&(t.justifySelf=e.justifySelf),{...t,...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)}const Ve={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function Je(e){const t=!1!==e.bordered,n=e.shadow??"none",[r,i]=l(!!e.defaultCollapsed),u=c(null),[p,f]=l("auto");a(()=>{if(!e.collapsible)return;const t=u.current;t&&f(`${t.scrollHeight}px`)},[e.children,e.collapsible]);const h=s(()=>{e.collapsible&&i(e=>!e)},[e.collapsible]),g=d(()=>{const o={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=Ve[n]??Ve.none,{...o,...e.style??{}}},[t,n,e.style]),x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},b={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"},m={maxHeight:r?"0":p,overflow:"hidden",transition:"max-height 0.3s ease"};return o("div",{className:`panel ${e.className??""}`.trim(),style:g},o("div",{className:"panel__header",style:x,onClick:h,role:e.collapsible?"button":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:b}):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?m:{},ref:u},o("div",{className:"panel__body",style:{padding:"16px"}},e.children)))}function Ze(e,t){return"both"===e?"auto":"horizontal"===e?"x"===t?"auto":"hidden":"y"===t?"auto":"hidden"}function Qe(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":case"hover":return{scrollbarWidth:"thin"};default:return{scrollbarWidth:"auto"}}}function et(e){const t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=c(null),[u,p]=l(!0),[f,h]=l(!1),[g,x]=l(!0),[b,m]=l(!1),y=s(()=>{const e=i.current;e&&(p(e.scrollTop<=2),h(e.scrollTop+e.clientHeight>=e.scrollHeight-2),x(e.scrollLeft<=2),m(e.scrollLeft+e.clientWidth>=e.scrollWidth-2))},[]);a(()=>{y()},[y]);const v=s(()=>{r&&y()},[r,y]),k=d(()=>{const o={position:"relative",overflowX:Ze(t,"x"),overflowY:Ze(t,"y"),...Qe(n)};return e.maxHeight&&(o.maxHeight=e.maxHeight),e.maxWidth&&(o.maxWidth=e.maxWidth),e.padding&&(o.padding=e.padding),{...o,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),S=[];if(r){const e="vertical"===t||"both"===t,n="horizontal"===t||"both"===t;e&&!u&&S.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),e&&!f&&S.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),n&&!g&&S.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),n&&!b&&S.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}const w={...k};return S.length>0&&(w.boxShadow=S.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:w,ref:i,onScroll:v},e.children)}function tt(e){const t=e.direction??"horizontal",n="horizontal"===t,r=e.dividerSize??6,i=e.minSize??50,[u,p]=l(e.initialSplit??50),f=c(null),h=c(!1),g=s(e=>{e.preventDefault(),h.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);a(()=>{const t=t=>{if(!h.current||!f.current)return;const o=f.current.getBoundingClientRect(),r=n?o.width:o.height,l=n?t.clientX-o.left:t.clientY-o.top;if(r<=0)return;const a=i/r*100,s=e.maxSize?e.maxSize/r*100:100-a;let d=l/r*100;d=Math.max(a,Math.min(s,d)),p(d)},o=()=>{h.current&&(h.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",t),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o)}},[n,i,e.maxSize]);const x=d(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),b=n?{width:`calc(${u}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${u}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},m={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%"}},y=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:x,ref:f},o("div",{className:"splitter__pane splitter__pane--first",style:b},y[0]??null),o("div",{className:"splitter__divider",style:m,onMouseDown:g,role:"separator","aria-orientation":n?"vertical":"horizontal"}),o("div",{className:"splitter__pane splitter__pane--second",style:{flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"}},y[1]??null))}function nt(e){const t=e.position??"top",n=e.variant??"line",r=e.tabs.find(e=>!e.disabled)?.id??"",[i,a]=l(e.activeTab??r),u=e.activeTab??i,p=c(null),f=s(t=>{a(t),e.onChange&&e.onChange(t)},[e.onChange]),h=s(n=>{const o=e.tabs.filter(e=>!e.disabled),r=o.findIndex(e=>e.id===u);if(-1===r)return;const i="left"===t||"right"===t,l=i?"ArrowUp":"ArrowLeft",a=i?"ArrowDown":"ArrowRight";let s=-1;if(n.key===l?s=r>0?r-1:o.length-1:n.key===a?s=r<o.length-1?r+1:0:"Home"===n.key?s=0:"End"===n.key&&(s=o.length-1),s>=0){n.preventDefault(),f(o[s].id);const t=p.current;if(t){const n=t.querySelectorAll('[role="tab"]')[e.tabs.indexOf(o[s])];n&&n.focus()}}},[e.tabs,u,t,f]),g="left"===t||"right"===t,x="bottom"===t||"right"===t,b=d(()=>({display:"flex",flexDirection:g?x?"row-reverse":"row":x?"column-reverse":"column",width:"100%",...e.style??{}}),[g,x,e.style]),m={display:"flex",flexDirection:g?"column":"row",gap:"pill"===n?"4px":"0",..."line"!==n||g?{}:{borderBottom:"2px solid #e5e7eb"},..."line"===n&&g?{borderRight:"left"===t?"2px solid #e5e7eb":"none",borderLeft:"right"===t?"2px solid #e5e7eb":"none"}:{},..."card"===n?{backgroundColor:"#f9fafb"}:{},..."pill"===n?{padding:"4px"}:{},flexShrink:"0"},y=e.tabs.find(e=>e.id===u),v=e.tabs.map(e=>{const r=e.id===u,i={padding:"8px 16px",border:"none",background:"none",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?"0.5":"1",fontSize:"14px",fontWeight:r?"600":"400",color:r?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return"line"===n?g?"left"===t?(i.borderRight=r?"2px solid #3b82f6":"2px solid transparent",i.marginRight="-2px"):(i.borderLeft=r?"2px solid #3b82f6":"2px solid transparent",i.marginLeft="-2px"):(i.borderBottom=r?"2px solid #3b82f6":"2px solid transparent",i.marginBottom="-2px"):"card"===n?(i.backgroundColor=r?"#ffffff":"transparent",i.borderRadius="6px 6px 0 0",r&&(i.border="1px solid #e5e7eb",i.borderBottom="1px solid #ffffff")):"pill"===n&&(i.borderRadius="9999px",i.backgroundColor=r?"#3b82f6":"transparent",i.color=r?"#ffffff":"#6b7280"),o("button",{key:e.id,role:"tab","aria-selected":String(r),"aria-controls":`tabpanel-${e.id}`,"aria-disabled":e.disabled?"true":void 0,id:`tab-${e.id}`,tabIndex:r?"0":"-1",style:i,onClick:e.disabled?void 0:()=>f(e.id),onKeyDown:h},e.icon?o("span",{className:"tabs__tab-icon"},e.icon):null,e.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:b},o("div",{className:"tabs__list",role:"tablist","aria-orientation":g?"vertical":"horizontal",style:m,ref:p},...v),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${u}`,"aria-labelledby":`tab-${u}`,style:{flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},tabIndex:"0"},y?y.content:null))}function ot(e){const t=e.items??[],n=t.length,r=!1!==e.loop,i=!1!==e.showDots,p=!1!==e.showArrows,f=e.animation??"slide",h=e.interval??5e3,g=u(),[x,b]=l(0),m=c(null),y=c(null),v=s(t=>{let o=t;o=r?(t%n+n)%n:Math.max(0,Math.min(t,n-1)),b(o),e.onChange&&e.onChange(o)},[n,r,e.onChange]),k=s(()=>v(x+1),[x,v]),S=s(()=>v(x-1),[x,v]);a(()=>{if(!e.autoPlay||n<=1)return;const t=setInterval(k,h);return()=>clearInterval(t)},[e.autoPlay,h,k,n]),a(()=>{const e=e=>{"ArrowLeft"===e.key?S():"ArrowRight"===e.key&&k()},t=y.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[k,S]);const w="fade"===f?`@keyframes liq-fade-in-${g}{from{opacity:0}to{opacity:1}}`:"",$=d(()=>"fade"===f?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${100*x}%)`,width:"100%"},[x,f]),C={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},z=t.map((e,t)=>{const n="fade"===f?{position:t===x?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:t===x?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(t),style:n},e.content,e.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},e.caption):null)}),M=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((e,t)=>o("button",{key:String(t),"aria-label":`Go to slide ${t+1}`,onclick:()=>v(t),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:t===x?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:y,tabindex:"0",role:"region","aria-label":"Carousel",style:{position:"relative",overflow:"hidden",width:"100%",outline:"none"},onpointerdown:e=>{m.current=e.clientX},onpointerup:e=>{if(null==m.current)return;const t=e.clientX-m.current;t>50?S():t<-50&&k(),m.current=null}},w?o("style",null,w):null,o("div",{style:$},...z),p&&n>1?o("button",{"aria-label":"Previous slide",onclick:S,style:{...C,left:"8px"}},"‹"):null,p&&n>1?o("button",{"aria-label":"Next slide",onclick:k,style:{...C,right:"8px"}},"›"):null,M)}function rt(e){const[t,n]=l("loading"),r=c(null),i=u(),s=!1!==e.lazy,p="number"==typeof e.width?`${e.width}px`:e.width,f="number"==typeof e.height?`${e.height}px`:e.height;a(()=>{n("loading")},[e.src]);const h=d(()=>{const t={display:"inline-block",position:"relative",overflow:"hidden"};return p&&(t.width=p),f&&(t.height=f),e.borderRadius&&(t.borderRadius=e.borderRadius),t},[p,f,e.borderRadius]),g=d(()=>{const n={display:"block",width:"100%",height:"100%"};return e.objectFit&&(n.objectFit=e.objectFit),"loading"===t&&(n.opacity="0",n.position="absolute"),"error"===t&&(n.display="none"),n},[e.objectFit,t]);let x=null;"loading"===t&&("skeleton"===e.placeholder?x=o("div",null,o("style",null,`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`),o("div",{style:{width:p??"100%",height:f??"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`}})):"blur"===e.placeholder?x=o("div",{style:{width:p??"100%",height:f??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):null!=e.placeholder&&!1!==e.placeholder&&(x=e.placeholder));let b=null;"error"===t&&null!=e.fallback&&(b="string"==typeof e.fallback?o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):e.fallback);const m=o("div",{style:h},x,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:g,onload:()=>n("loaded"),onerror:()=>n("error")}),b);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},m,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):m}function it(e){return!isFinite(e)||e<0?"0:00":`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function lt(e){const t=!1!==e.controls,n=c(null);u();const[r,i]=l(!1),[d,p]=l(0),[f,h]=l(0),[g,x]=l(e.muted?0:1),[b,m]=l(!!e.muted),[y,v]=l(!0),k="number"==typeof e.width?`${e.width}px`:e.width??"100%",S="number"==typeof e.height?`${e.height}px`:e.height??"auto";a(()=>{const t=n.current;if(!t)return;const o=()=>{i(!0),e.onPlay&&e.onPlay()},r=()=>{i(!1),e.onPause&&e.onPause()},l=()=>{i(!1),e.onEnded&&e.onEnded()},a=()=>{p(t.currentTime),h(t.duration),e.onTimeUpdate&&e.onTimeUpdate(t.currentTime,t.duration)},s=()=>{h(t.duration)};return t.addEventListener("play",o),t.addEventListener("pause",r),t.addEventListener("ended",l),t.addEventListener("timeupdate",a),t.addEventListener("loadedmetadata",s),()=>{t.removeEventListener("play",o),t.removeEventListener("pause",r),t.removeEventListener("ended",l),t.removeEventListener("timeupdate",a),t.removeEventListener("loadedmetadata",s)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);const w=s(()=>{const e=n.current;e&&(e.paused?e.play():e.pause())},[]),$=s(e=>{const t=n.current;if(!t||!isFinite(t.duration))return;const o=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width));t.currentTime=r*t.duration},[]),C=s(e=>{const t=n.current,o=parseFloat(e.target.value);t&&(t.volume=o,t.muted=0===o,x(o),m(0===o))},[]),z=s(()=>{const e=n.current;e&&e.requestFullscreen&&e.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,style:{width:k,height:S,display:"block"}});const M=f>0?d/f*100:0,I={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:y?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":r?"Pause":"Play",onclick:w,style:I},r?"⏸":"▶"),o("div",{onclick:$,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${M}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${it(d)} / ${it(f)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(b?0:g),oninput:C,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:z,style:I},"⛶"));return o("div",{style:{position:"relative",width:k,height:S,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>v(!0),onmouseleave:()=>{r&&v(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,playsinline:!0,onclick:w,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function at(e){const t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},l=c(null),a={display:"flex",flexDirection:"horizontal"===t?"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:"number"==typeof i.width?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:"number"==typeof i.maxHeight?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},d=s(e=>{if(!r)return;const n=e,o=l.current;if(!o)return;const i=Array.from(o.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),a=i.indexOf(document.activeElement);if(a<0)return;const s="vertical"===t,d=s?"ArrowDown":"ArrowRight",c=s?"ArrowUp":"ArrowLeft";if(n.key===d){n.preventDefault();const e=i[a+1];e&&e.focus()}else if(n.key===c){n.preventDefault();const e=i[a-1];e&&e.focus()}else"Home"===n.key?(n.preventDefault(),i[0]?.focus()):"End"===n.key&&(n.preventDefault(),i[i.length-1]?.focus())},[r,t]);return o("nav",{ref:l,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:d},e.children)}function st(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 dt(){const[e,t]=l(!1);return{hover:e,onMouseEnter:s(()=>t(!0),[]),onMouseLeave:s(()=>t(!1),[])}}function ct(e){const{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:l,collapseIcon:a,iconPosition:d}=e,{hover:c,onMouseEnter:u,onMouseLeave:p}=dt(),f=!0===t.disabled,h={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:f?"#f9fafb":c?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:f?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:f?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};"left"===d&&(h.flexDirection="row");const g=s(e=>{const t=e;f||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r())},[f,r]),x=s(()=>{f||r()},[f,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:"right"===d?"auto":"0",marginRight:"left"===d?"8px":"0",paddingLeft:"right"===d?"8px":"0"}},n?a:l),m=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,y="left"===d?[b,m]:[m,b];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":f?"true":void 0,"data-section-id":t.id,tabIndex:f?-1:0,style:h,onClick:x,onKeyDown:g,onMouseEnter:u,onMouseLeave:p},...y)}function ut(e){const{section:t,expanded:n,contentStyle:r,animated:i}=e,l={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:l},o("div",{style:a},t.content))}function pt(e){const{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:a={},wrapperStyle:c,expandIcon:u="+",collapseIcon:p="−",iconPosition:f="right",animated:h=!0,onChange:g}=e,[x,b]=l(()=>n??[]),m=s(e=>{b(t=>{let n;return n=t.includes(e)?t.filter(t=>t!==e):r?[...t,e]:[e],g&&g(n),n})},[r,g]),y=d(()=>t.map(e=>{const t=x.includes(e.id),n=o(ct,{key:`header-${e.id}`,section:e,expanded:t,onToggle:()=>m(e.id),headerStyle:i,expandIcon:u,collapseIcon:p,iconPosition:f}),r=o(ut,{key:`content-${e.id}`,section:e,expanded:t,contentStyle:a,animated:h});return o("div",{key:e.id,"data-accordion-section":e.id,style:{width:"100%"}},n,r)}),[t,x,i,a,u,p,f,h,m]);return o(at,{role:"region",ariaLabel:"Accordion",styling:c,keyboardNav:!0},...y)}const ft={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function ht(e){const{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[a,d]=l(!1),c=ft[i],u=s(()=>{d(!0)},[]);let p=t,f=!1;if(r&&r>1&&t.length>r&&!a){f=!0;const e=1,n=r-1;p=[...t.slice(0,e),{label:"..."},...t.slice(t.length-n)]}const h=p.map((e,t)=>((e,t,r)=>{const i=t===r.length-1,l=f&&"..."===e.label&&1===t,a=[];var s;return t>0&&a.push(o("span","string"==typeof(s=n)?{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}}:{"aria-hidden":"true",style:{margin:"0 8px"}},s)),l?a.push(o("button",{type:"button",onClick:u,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:c.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):i?a.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:c.fontSize}},e.label)):e.href?a.push(o("a",{href:e.href,onClick:e.onClick?t=>{t.preventDefault(),e.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:c.fontSize}},e.label)):e.onClick?a.push(o("button",{type:"button",onClick:e.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:c.fontSize,fontFamily:"inherit"}},e.label)):a.push(o("span",{style:{color:"#6b7280",fontSize:c.fontSize}},e.label)),o("li",{key:String(t),style:{display:"inline-flex",alignItems:"center"}},...a)})(e,t,p));return o(at,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:c.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...h))}function gt(e){const{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:a,onMouseEnter:d,onMouseLeave:c}=dt(),[u,p]=l(!1),f=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const h=!0===t.disabled,g={...st(n,{hover:!h&&a,active:!1}),position:"relative",justifyContent:"space-between",...h?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},x=s(()=>{h||(f?p(e=>!e):(t.onClick&&t.onClick(),r&&i()))},[h,f,t,r,i]),b=s(()=>{d(),f&&p(!0)},[f,d]),m=s(()=>{c(),f&&p(!1)},[f,c]),y=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)),v=f?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"›"):null,k=f&&u?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(at,{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(e=>o(gt,{key:e.id,item:e,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:b,onMouseLeave:m},o("button",{type:"button",role:"menuitem",style:g,onClick:x,disabled:h||void 0,tabIndex:h?-1:0,"aria-disabled":h?"true":void 0,"aria-haspopup":f||void 0,"aria-expanded":f?String(u):void 0},y,v),k)}function xt(e){const{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:d={},placement:u="bottom-start",closeOnSelect:p=!0,width:f="220px"}=e,[h,g]=l(!1),x=c(null),b=s(()=>{g(e=>!e)},[]),m=s(()=>{g(!1)},[]);a(()=>{if(!h)return;const e=e=>{const t=x.current;t&&!t.contains(e.target)&&g(!1)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[h]),a(()=>{if(!h)return;const e=e=>{"Escape"===e.key&&g(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[h]);const y=o("button",{type:"button",style:{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??{}},onClick:b,"aria-haspopup":"true","aria-expanded":String(h)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:h?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"▼")),v={position:"absolute",top:"100%",..."bottom-end"===u?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},k={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:"number"==typeof f?`${f}px`:f,backgroundColor:"#ffffff",...i??{}},S=h?o("div",{style:v},o(at,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:k},...n.map(e=>o(gt,{key:e.id,item:e,itemStyle:d,closeOnSelect:p,onClose:m})))):null;return o("div",{ref:x,style:{position:"relative",display:"inline-block"}},y,S)}function bt(e){const{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=dt(),[c,u]=l(!1),p=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const f=!0===t.disabled,h=s(()=>{f||(p?u(e=>!e):(t.onClick&&t.onClick(),n()))},[f,p,t,n]),g=s(()=>{a(),p&&u(!0)},[p,a]),x=s(()=>{d(),p&&u(!1)},[p,d]),b={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:f?"default":"pointer",backgroundColor:!f&&i?"#f3f4f6":"transparent",color:f?"#9ca3af":"#1f2937",opacity:f?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},m=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)),y=p?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"▶"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,v=p&&c?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((e,t)=>o(bt,{key:String(t),item:e,onClose:n,index:t})))):null;return o("div",{style:{position:"relative"},onMouseEnter:g,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:b,onClick:h,disabled:f||void 0,tabIndex:-1,"aria-disabled":f||void 0,"aria-haspopup":p||void 0,"aria-expanded":p?c:void 0},m,y),v)}function mt(e){const{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:l,onClose:a}=e,{hover:d,onMouseEnter:u,onMouseLeave:p}=dt(),f=c(null),h=s(()=>{r?a():l(n)},[r,n,l,a]),g=s(()=>{u(),i&&!r&&l(n)},[i,r,n,l,u]),x={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":d?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},b=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((e,t)=>o(bt,{key:String(t),item:e,onClose:a,index:t})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:g,onMouseLeave:p},o("button",{ref:f,type:"button",role:"menuitem",style:x,onClick:h,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),b)}function yt(e){const{menus:t}=e,[n,r]=l(null),i=c(null),d=s(e=>{r(e)},[]),u=s(()=>{r(null)},[]);a(()=>{if(null===n)return;const e=e=>{const t=i.current;t&&!t.contains(e.target)&&r(null)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[n]),a(()=>{const e=i.current;if(!e)return;const o=o=>{const i=o;if("Escape"!==i.key){if("ArrowRight"===i.key)return i.preventDefault(),void r(e=>null===e?0:(e+1)%t.length);if("ArrowLeft"===i.key)return i.preventDefault(),void r(e=>null===e?t.length-1:(e-1+t.length)%t.length);if("ArrowDown"===i.key&&null!==n){i.preventDefault();const t=e.querySelector('[role="menu"]');if(t){const e=t.querySelector('[role="menuitem"]');e&&e.focus()}return}"Enter"!==i.key&&i.key}else r(null)};return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}},[n,t.length]);const p=t.map((e,t)=>o(mt,{key:String(t),menu:e,index:t,isOpen:n===t,anyOpen:null!==n,onOpen:d,onClose:u}));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"}},...p)}function vt(e,t){const n=[];for(let o=e;o<=t;o++)n.push(o);return n}const kt={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"},St={...kt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},wt={...kt,color:"#9ca3af",cursor:"default",opacity:"0.5"},$t={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Ct(e){const{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:l=1,showFirstLast:a=!0,showPrevNext:d=!0,disabled:c=!1}=e,u=Math.max(1,Math.ceil(t/n)),p=Math.min(Math.max(1,r),u),f=s(e=>{!c&&e>=1&&e<=u&&e!==p&&i(e)},[c,u,p,i]),h=(e,t,n)=>{const r=c||t<1||t>u||t===p;return o("button",{type:"button",onClick:()=>f(t),disabled:r||void 0,"aria-label":n,style:r?wt:kt},e)},g=function(e,t,n){if(e<=2*n+5)return vt(1,e);const o=Math.max(t-n,1),r=Math.min(t+n,e),i=o>2,l=r<e-1;return!i&&l?[...vt(1,2*n+3),"ellipsis",e]:i&&!l?[1,"ellipsis",...vt(e-2*n-2,e)]:[1,"ellipsis",...vt(o,r),"ellipsis",e]}(u,p,l);let x=0;const b=[];a&&b.push(h("«",1,"Go to first page")),d&&b.push(h("‹",p-1,"Go to previous page"));for(const e of g)if("ellipsis"===e)b.push(o("span",{key:"ellipsis-"+x++,style:$t},"..."));else{const t=e===p;b.push(o("button",{key:String(e),type:"button",onClick:()=>f(e),disabled:c||void 0,"aria-label":`Page ${e}`,"aria-current":t?"page":void 0,style:c?wt:t?St:kt},String(e)))}return d&&b.push(h("›",p+1,"Go to next page")),a&&b.push(h("»",u,"Go to last page")),o(at,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...b)}function zt(e){const{item:t,collapsed:n,selectedId:r,onSelect:i,depth:a}=e,{hover:d,onMouseEnter:c,onMouseLeave:u}=dt(),[p,f]=l(!1),h=t.children&&t.children.length>0,g=t.id===r,x=s(()=>{h&&!n&&f(e=>!e),i&&i(t.id)},[h,n,i,t.id]),b={display:"flex",alignItems:"center",padding:n?"10px 0":"10px 12px 10px "+(n?"0":16+16*a+"px"),justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:g?"#eff6ff":d?"#f3f4f6":"transparent",color:g?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},m=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,y=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),v=!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,k=!n&&h?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:p?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"▶"):null,S=n&&d?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,w=o("button",{type:"button",style:b,onClick:x,onMouseEnter:c,onMouseLeave:u,"aria-selected":g?"true":"false",title:n?t.label:void 0},m,y,v,k,S),$=!n&&h&&p?t.children.map(e=>o(zt,{key:e.id,item:e,collapsed:n,selectedId:r,onSelect:i,depth:a+1})):null;return o("div",{key:t.id,style:{position:"relative"}},w,$?o("div",{role:"group"},...$):null)}function Mt(e){const{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:l,width:a="240px",collapsedWidth:s="56px"}=e,d=n?"number"==typeof s?`${s}px`:s:"number"==typeof a?`${a}px`:a,c=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?"▶":"◀"):null,u=t.map(e=>o(zt,{key:e.id,item:e,collapsed:n,selectedId:i,onSelect:l,depth:0}));return o(at,{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"}}},c,...u)}function It(e){const{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:l=!1,variant:a="circle"}=e,d="horizontal"===r,c="circle"===a?32:12,u="dot"===a?12:32,p=s(e=>{l&&i&&i(e)},[l,i]),f=[];return t.forEach((e,r)=>{f.push(((e,t)=>{const r=(e=>e<n?"completed":e===n?"active":"pending")(t),i="active"===r,s="completed"===r,f=((e,t,n)=>{const r="dot"===a?u:c,i={width:`${r}px`,height:`${r}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"circle"===a?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return"completed"===n?o("div",{style:{...i,backgroundColor:"#2563eb",color:"#ffffff",border:"2px solid #2563eb"}},"circle"===a?t.icon||"✓":null):"active"===n?o("div",{style:{...i,backgroundColor:"#ffffff",color:"#2563eb",border:"2px solid #2563eb",boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},"circle"===a?t.icon||String(e+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#2563eb"}})):o("div",{style:{...i,backgroundColor:"#ffffff",color:"#9ca3af",border:"2px solid #d1d5db"}},"circle"===a?t.icon||String(e+1):null)})(t,e,r),h={fontSize:"11px",color:"#6b7280",marginTop:"2px",textAlign:d?"center":"left"},g=o("div",{style:d?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:{fontSize:"13px",fontWeight:i?"600":"400",color:i||s?"#1f2937":"#9ca3af",marginTop:d?"8px":"0",marginLeft:d?"0":"12px",textAlign:d?"center":"left",transition:"color 0.2s"}},e.label),e.description?o("span",{style:h},e.description):null),x=o("div",d?{style:{display:"flex",flexDirection:"column",alignItems:"center"}}:{style:{display:"flex",flexDirection:"row",alignItems:"center"}},f,g);return o(l?"button":"div",{key:String(t),onClick:l?()=>p(t):void 0,style:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:l?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":i?"step":void 0},x)})(e,r));const i=(e=>{if(e>=t.length-1)return null;const r=e<n?"#2563eb":"#d1d5db";return o("div",d?{style:{flex:"1",height:"2px",backgroundColor:r,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}:{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:r,marginLeft:("dot"===a?u:c)/2-1+"px",transition:"background-color 0.2s"}})})(r);i&&f.push(i)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:d?"row":"column",alignItems:d?"flex-start":"stretch",width:"100%"}},...f)}const Lt={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 Rt(e){const{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:l,onMouseLeave:a}=dt(),d=Lt[n],c=!0===t.disabled,u=!0===t.active,p=s(()=>{!c&&t.onClick&&t.onClick()},[c,t]),f={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:d.height,padding:d.padding,fontSize:d.fontSize,fontFamily:"inherit",border:"raised"===r?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:u?"#e0e7ff":!c&&i?"#f3f4f6":"raised"===r?"#ffffff":"transparent",color:c?"#9ca3af":u?"#2563eb":"#374151",cursor:c?"default":"pointer",opacity:c?"0.5":"1",outline:"none",transition:"background-color 0.15s"},h=t.icon?o("span",{style:{fontSize:d.iconSize},"aria-hidden":"true"},t.icon):null,g=t.label?o("span",null,t.label):null,x="dropdown"===t.type?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"▼"):null;return o("button",{type:"button",style:f,onClick:p,onMouseEnter:l,onMouseLeave:a,disabled:c||void 0,"aria-pressed":u||void 0,"aria-label":t.label||t.id,title:t.label||t.id},h,g,x)}function Dt(e){const{items:t,size:n="md",variant:r="flat"}=e,i=Lt[n],l=t.map(e=>"separator"===e.type?o("div",{key:e.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):"spacer"===e.type?o("div",{key:e.id,style:{flex:"1"},"aria-hidden":"true"}):o(Rt,{key:e.id,item:e,size:n,variant:r}));return o(at,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:"raised"===r?"1px solid #e5e7eb":"none",borderRadius:"raised"===r?"8px":"0",padding:"4px",backgroundColor:"raised"===r?"#ffffff":"transparent",boxShadow:"raised"===r?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...l)}class At{constructor(e,t){this.id=e.id,this.label=e.label,this.expanded=e.expanded??!1,this.icon=e.icon??null,this.metadata=e.metadata??{},this.parent=t??null,this.depth=t?t.depth+1:0,this.children=(e.children??[]).map(e=>new At(e,this))}static fromData(e){return new At(e)}isLeaf(){return 0===this.children.length}isRoot(){return null===this.parent}walk(e){e(this,this.depth);for(const t of this.children)t.walk(e)}find(e){if(this.id===e)return this;for(const t of this.children){const n=t.find(e);if(n)return n}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(e){const t=new At(e,this);return this.children.push(t),t}removeChild(e){const t=this.children.findIndex(t=>t.id===e);return-1!==t&&(this.children.splice(t,1),!0)}}function Ft(e){e.expanded=!0;for(const t of e.children)Ft(t)}function Tt(e,t=[]){if(t.push(e),e.expanded)for(const n of e.children)Tt(n,t);return t}function Et(e){if(!e.parent)return!0;const t=e.parent.children;return t[t.length-1]===e}function Wt(e){const{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:l,iconExpanded:s,iconCollapsed:d,nodeStyle:u,renderNode:p,onToggle:f,onClick:h,focusedId:g}=e,x=dt(),b=c(null),m=g===t.id;a(()=>{m&&b.current&&b.current.focus()},[m]);const y=t.isLeaf(),v=t.depth,k=[];for(let e=0;e<v;e++){let n=t;for(let t=0;t<v-e;t++)n=n?n.parent:null;const a=!!n&&!Et(n);k.push(o("span",{key:`connector-${e}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...a?{borderLeft:`${l}px solid ${i}`}:{}}}))}const S=v>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${l}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,w=y?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",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:e=>{e.stopPropagation(),f(t)}},t.expanded?s:d),$=p?p(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=st(u,{hover:x.hover,active:n});return o("div",{ref:b,role:"treeitem","aria-expanded":y?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":v+1,tabIndex:m?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onClick:()=>h(t)},...k,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:u.padding??"6px 10px",minWidth:"0"}},w,$))}function Bt(e){const{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:a,expandAll:c=!1,lineColor:u="#000",lineWidth:p=1,indentPx:f=20,iconExpanded:h="−",iconCollapsed:g="+",nodeStyle:x={},wrapperStyle:b,renderNode:m}=e,[y,v]=l(()=>{const e=At.fromData(t);return c&&Ft(e),e}),[k,S]=l(t.id),w=d(()=>Tt(y),[y]),$=s(()=>{v(e=>{const t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t})},[]),C=s(e=>{e.toggle(),e.expanded?r?.(e):i?.(e),$()},[r,i,$]),z=s(e=>{S(e.id),n?.(e)},[n]),M=s(e=>{const t=e;if(!k)return;const n=w.findIndex(e=>e.id===k);if(-1===n)return;const o=w[n];switch(t.key){case"ArrowDown":{t.preventDefault();const e=w[n+1];e&&S(e.id);break}case"ArrowUp":{t.preventDefault();const e=w[n-1];e&&S(e.id);break}case"ArrowRight":t.preventDefault(),o.isLeaf()||(o.expanded?o.children.length>0&&S(o.children[0].id):C(o));break;case"ArrowLeft":t.preventDefault(),!o.isLeaf()&&o.expanded?C(o):o.parent&&S(o.parent.id);break;case"Enter":t.preventDefault(),z(o);break;case" ":t.preventDefault(),o.isLeaf()||C(o);break;case"Home":t.preventDefault(),w.length>0&&S(w[0].id);break;case"End":t.preventDefault(),w.length>0&&S(w[w.length-1].id)}},[k,w,C,z]),I=w.map(e=>o(Wt,{key:e.id,node:e,isSelected:e.id===a,indentPx:f,lineColor:u,lineWidth:p,iconExpanded:h,iconCollapsed:g,nodeStyle:x,renderNode:m,onToggle:C,onClick:z,focusedId:k}));return o(at,{role:"tree",ariaLabel:"Tree navigation",styling:b,keyboardNav:!1},o("div",{onKeyDown:M,style:{outline:"none"}},...I))}function Ht(e){const{items:t,position:n,onClose:r,depth:i}=e,[s,d]=l(-1),[u,p]=l(null),f=c(null);a(()=>{if(!f.current)return;f.current.focus();const e=e=>{const n=e,o=t.map((e,t)=>({item:e,i:t})).filter(({item:e})=>!e.divider);if("ArrowDown"===n.key)n.preventDefault(),d(e=>{const t=(o.findIndex(({i:t})=>t===e)+1)%o.length;return o[t].i});else if("ArrowUp"===n.key)n.preventDefault(),d(e=>{const t=o.findIndex(({i:t})=>t===e),n=t<=0?o.length-1:t-1;return o[n].i});else if("ArrowRight"===n.key)s>=0&&t[s]?.children&&p(s);else if("ArrowLeft"===n.key)i>0&&r();else if("Enter"===n.key){if(n.preventDefault(),s>=0){const e=t[s];e.children?p(s):!e.disabled&&e.onClick&&(e.onClick(),r())}}else"Escape"===n.key&&r()};f.current.addEventListener("keydown",e);const n=f.current;return()=>n.removeEventListener("keydown",e)},[t,s,i,r]);const h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},g=t.map((e,t)=>{if(e.divider)return o("div",{key:`divider-${t}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const l=s===t,a=!!e.disabled,c=!!(e.children&&e.children.length>0),f={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:a?"#9ca3af":"#1f2937",cursor:a?"default":"pointer",backgroundColor:l&&!a?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},h=[];e.icon&&h.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},e.icon)),h.push(o("span",{style:{flex:"1"}},e.label??"")),c&&h.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"▶"));const g=[o("div",{key:`item-${t}`,style:f,onMouseEnter:()=>{d(t),p(c?t:null)},onClick:()=>{a||(c?p(t):(e.onClick&&e.onClick(),r()))},role:"menuitem","aria-disabled":a?"true":void 0},...h)];return c&&u===t&&g.push(o(Ht,{key:`submenu-${t}`,items:e.children,position:{x:n.x+178,y:n.y+36*t},onClose:()=>p(null),depth:i+1})),o("div",{key:`wrap-${t}`,style:{position:"relative"}},...g)});return o("div",{ref:f,style:h,tabIndex:-1,role:"menu"},...g)}function Nt(e){const{items:t,children:n}=e,[r,i]=l(null),d=s(e=>{e.preventDefault();const t=e;i({x:t.clientX,y:t.clientY})},[]),c=s(()=>{i(null)},[]);a(()=>{if(!r)return;const e=e=>{c()},t=setTimeout(()=>{document.addEventListener("mousedown",e)},0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[r,c]),a(()=>{if(!r)return;const e=e=>{"Escape"===e.key&&c()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,c]);const u=[o("div",{onContextMenu:d,style:{display:"contents"}},n)];return r&&u.push(o(Ht,{items:t,position:r,onClose:c,depth:0})),o("div",null,...u)}function Pt(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 jt(e,t){const 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 _t(e){const{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:d=!0,closeOnOverlay:u=!0,closeOnEscape:p=!0,children:f}=e,[h,g]=l(!1),[x,b]=l(!1),m=c(null),y=s?"drawer-title":void 0;if(a(()=>{if(!t){b(!1);const e=setTimeout(()=>g(!1),300);return()=>clearTimeout(e)}g(!0),requestAnimationFrame(()=>b(!0))},[t]),a(()=>{if(!t||!p)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,p,n]),a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{t&&m.current&&m.current.focus()},[t]),!h)return null;const v={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:x?"1":"0",transition:"opacity 0.3s ease"},k={...jt(r,i),transform:Pt(r,x),transition:"transform 0.3s ease"},S=[];s&&S.push(o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},o("h3",{id:y,style:{margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"}},s),o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},onClick:n,"aria-label":"Close drawer"},"×"))),S.push(o("div",{style:{padding:"20px",overflow:"auto",flex:"1"}},f));const w=[];return d&&w.push(o("div",{style:v,onClick:()=>{u&&n()}})),w.push(o("div",{ref:m,style:k,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...S)),o("div",null,...w)}const Ot={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Yt(e){const{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:l=!0,closeOnEscape:s=!0,footer:d,showCloseButton:u=!0,children:p}=e,f=c(null);if(a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{if(!t||!s)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,s,n]),a(()=>{t&&f.current&&f.current.focus()},[t]),!t)return null;const h={backgroundColor:"#fff",borderRadius:"full"===i?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:"full"===i?"100vh":"90vh",width:Ot[i],maxWidth:"full"===i?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},g=[],x=r?"modal-title":void 0;r?g.push(o("h2",{id:x,style:{margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"}},r)):g.push(o("span",null)),u&&g.push(o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},onClick:n,"aria-label":"Close modal"},"×"));const b=[o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},...g),o("div",{style:{padding:"24px",overflow:"auto",flex:"1"}},p)];return d&&b.push(o("div",{style:{padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"}},d)),o("div",{style:{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"},onClick:e=>{l&&e.target===e.currentTarget&&n()},"aria-modal":"true",role:"dialog","aria-labelledby":x},o("div",{ref:f,style:h,tabIndex:-1,role:"document"},...b))}function qt(e,t){const n=t+8;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 Ut(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="8px",o="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} #fff ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} #fff ${o} ${o}`}}}function Xt(e){const{trigger:t,content:n,open:r,placement:i="bottom",offset:d=4,arrow:u=!1,closeOnClickOutside:p=!0,onOpenChange:f}=e,h=void 0!==r,[g,x]=l(!1),b=h?r:g,m=c(null),y=s(()=>{h?f&&f(!r):x(e=>!e)},[h,r,f]);a(()=>{if(!b||!p)return;const e=e=>{m.current&&!m.current.contains(e.target)&&(h?f&&f(!1):x(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b,p,h,f]);const v={...qt(i,d),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"},k=[n];u&&k.push(o("div",{style:Ut(i)}));const S=[o("div",{onClick:y,style:{display:"inline-block"}},t)];return b&&S.push(o("div",{style:v},...k)),o("div",{ref:m,style:{position:"relative",display:"inline-block"}},...S)}let Gt=0;function Kt(e={}){const t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3};let n=[];const o=new Set;function r(){o.forEach(e=>e())}return{toast:function(e,o={}){const i=`toast-${++Gt}-${Date.now()}`,l={id:i,message:e,type:o.type??"info",duration:o.duration??t.defaultDuration,action:o.action,createdAt:Date.now()};return n=[l,...n].slice(0,t.maxToasts),r(),i},dismiss:function(e){n=n.filter(t=>t.id!==e),r()},dismissAll:function(){n=[],r()},subscribe:e=>(o.add(e),()=>{o.delete(e)}),getToasts:()=>n,config:t}}const Vt={info:{bg:"#eff6ff",border:"#3b82f6",icon:"ℹ️"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"✅"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"⚠️"},error:{bg:"#fef2f2",border:"#ef4444",icon:"❌"}};function Jt(e){const{item:t,onDismiss:n}=e,r=Vt[t.type];a(()=>{if(t.duration<=0)return;const e=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(e)},[t.id,t.duration,n]);const 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"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},s=[o("span",null,r.icon),o("span",{style:{flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"}},t.message)];return t.action&&s.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),s.push(o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"×")),o("div",{style:i,role:"alert"},...s)}function Zt(e){const{toaster:t}=e,[,n]=l(0);a(()=>t.subscribe(()=>n(e=>e+1)),[t]);const r=t.getToasts();if(0===r.length)return null;const i=function(e){const t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),o=e.startsWith("bottom"),r=e.endsWith("left"),i=e.endsWith("right"),l=e.endsWith("center");return n&&(t.top="0"),o&&(t.bottom="0",t.flexDirection="column-reverse"),r&&(t.left="0"),i&&(t.right="0"),l&&(t.left="50%",t.transform="translateX(-50%)"),t}(t.config.position);a(()=>{const e="specifyjs-toast-keyframes";if(document.getElementById(e))return;const t=document.createElement("style");return t.id=e,t.textContent="\n @keyframes specifyjs-toast-slide-in {\n from { opacity: 0; transform: translateY(-12px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(t),()=>{const t=document.getElementById(e);t&&t.remove()}},[]);const d=s(e=>t.dismiss(e),[t]),c=r.map(e=>o(Jt,{key:e.id,item:e,onDismiss:d}));return o("div",{style:i},...c)}function Qt(e={}){const t=c(null);t.current||(t.current=Kt(e));const n=t.current,r=s(()=>o(Zt,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}function en(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="6px",o="transparent",r="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${r} ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} ${r} ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} ${r}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} ${r} ${o} ${o}`}}}function tn(e){const{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:d}=e,[u,p]=l(!1),[f,h]=l(null),g=c(null),x=c(null),b=`tooltip-${Math.random().toString(36).slice(2,9)}`,m=s(()=>{x.current=setTimeout(()=>{if(g.current){const e=g.current.getBoundingClientRect();h(function(e,t){switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:e.top-8+"px",transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+8}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:e.left-8+"px",top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+8}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}(e,n))}p(!0)},r)},[r,n]),y=s(()=>{x.current&&(clearTimeout(x.current),x.current=null),p(!1)},[]);a(()=>()=>{x.current&&clearTimeout(x.current)},[]);const v={...f??{},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"},k=[o("div",{ref:g,style:{display:"inline-block"},onMouseEnter:m,onMouseLeave:y,onFocus:m,onBlur:y,"aria-describedby":u?b:void 0},d)];return u&&f&&k.push(o("div",{id:b,style:v,role:"tooltip"},t,o("div",{style:en(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...k)}function nn(e,t,n,o,r){return d(()=>{const i=Math.max(1,(o-r*(e+1))/e);return{valueScale:e=>0===t?0:e/t*n,categoryScale:e=>r+e*(i+r),barThickness:i,maxValue:t,valueAxisLength:n,categoryAxisLength:o}},[e,t,n,o,r])}const on=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function rn(e,t){return t||on[e%on.length]}function ln(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:l="#3b82f6",barGap:a=8,barRadius:c=4,showValues:u=!0,showGrid:p=!0,gridColor:f="#e5e7eb",title:h,padding:g=50,animate:x=!1,stacked:b,grouped:m=!1}=e,y="vertical"===i,v=n-2*g,k=r-2*g,S=y?k:v,w=y?v:k,$=void 0!==b&&b.length>0,C=d(()=>$?function(e){const t=new Set;for(const n of e)for(const e of n.values)t.add(e.category);return Array.from(t)}(b):[],[$,b]),z=$?b.length:t.length,M=d(()=>function(e,t,n){if(t&&t.length>0){if(n){let e=0;for(const n of t)for(const t of n.values)t.value>e&&(e=t.value);return e}let e=0;for(const n of t){let t=0;for(const e of n.values)t+=e.value;t>e&&(e=t)}return e}let o=0;for(const t of e)t.value>o&&(o=t.value);return o}(t,b,m),[t,b,m]),I=M>0?M:1,L=nn(z,I,S,w,a),R=s(()=>{if(!p)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(I),t=[];for(let n=e;n<=I;n+=e){const e=L.valueScale(n);if(y){const r=g+k-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+v),y2:String(r),stroke:f,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-6),y:String(r+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}else{const r=g+e;t.push(o("line",{key:`grid-${n}`,x1:String(r),y1:String(g),x2:String(r),y2:String(g+k),stroke:f,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[p,I,L,y,g,v,k,f]),D=s(()=>{const e=[];return y?(e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+k),x2:String(g+v),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"}))):(e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+k),x2:String(g+v),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"}))),e},[y,g,v,k]),A=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=L.valueScale(r.value),a=L.categoryScale(n),s=r.color??l;let d,p,f=String(r.value);if(y){const e=g+a,t=g+k-i;d={x:String(e),y:String(t),width:String(L.barThickness),height:String(i),rx:String(c),ry:String(c),fill:s},p={x:String(e+L.barThickness/2),y:String(t-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{const e=g+a,t=g;d={x:String(t),y:String(e),width:String(i),height:String(L.barThickness),rx:String(c),ry:String(c),fill:s},p={x:String(t+i+6),y:String(e+L.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}x&&(d.style=`animation: barGrow 0.6s ease-out ${.05*n}s both`),e.push(o("rect",{key:`bar-${n}`,...d})),u&&e.push(o("text",{key:`val-${n}`,...p},f)),y?e.push(o("text",{key:`cat-${n}`,x:String(g+a+L.barThickness/2),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label)):e.push(o("text",{key:`cat-${n}`,x:String(g-6),y:String(g+a+L.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return e},[t,L,l,c,u,x,y,g,k]),F=s(()=>{if(!b)return[];const e=[];for(let t=0;t<b.length;t++){const n=b[t],r=L.categoryScale(t);let i=0;for(let l=0;l<n.values.length;l++){const a=n.values[l],s=L.valueScale(a.value),d=L.valueScale(i),p=rn(l,a.color);if(y){const i=g+r,f=g+k-d-s;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(f),width:String(L.barThickness),height:String(s),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:p,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),u&&s>14&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+L.barThickness/2),y:String(f+s/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}else{const i=g+d,f=g+r;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(f),width:String(s),height:String(L.barThickness),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:p,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),u&&s>20&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+s/2),y:String(f+L.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}i+=a.value}if(u){const n=L.valueScale(i);y?e.push(o("text",{key:`stotal-${t}`,x:String(g+r+L.barThickness/2),y:String(g+k-n-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i))):e.push(o("text",{key:`stotal-${t}`,x:String(g+n+6),y:String(g+r+L.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i)))}y?e.push(o("text",{key:`scat-${t}`,x:String(g+r+L.barThickness/2),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},n.label)):e.push(o("text",{key:`scat-${t}`,x:String(g-6),y:String(g+r+L.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},n.label))}return e},[b,L,c,u,x,y,g,k]),T=s(()=>{if(!b)return[];const e=C.length,t=[];for(let n=0;n<b.length;n++){const r=b[n],i=L.categoryScale(n),l=2,a=Math.max(1,(L.barThickness-l*(e-1))/e);for(let s=0;s<r.values.length;s++){const d=r.values[s],p=C.indexOf(d.category),f=p*(a+l),h=L.valueScale(d.value),b=rn(p>=0?p:s,d.color);if(y){const r=g+i+f,l=g+k-h;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(a),height:String(h),rx:String(c),ry:String(c),fill:b,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),u&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+a/2),y:String(l-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}else{const r=g,l=g+i+f;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(h),height:String(a),rx:String(c),ry:String(c),fill:b,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),u&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+h+4),y:String(l+a/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}}y?t.push(o("text",{key:`gcat-${n}`,x:String(g+i+L.barThickness/2),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label)):t.push(o("text",{key:`gcat-${n}`,x:String(g-6),y:String(g+i+L.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return t},[b,C,L,c,u,x,y,g,k]),E=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),W=s(()=>x?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},y?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[x,y]),B=R(),H=D(),N=E(),P=W();let j;return j=$&&m?T():$?F():A(),o("svg",{width:String(n),height:String(r),viewBox:`0 0 ${n} ${r}`,xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...P,...N,...B,...H,...j)}function an(e,t){const n=t-e;if(n<=0)return[e];const o=function(e){const t=e/8,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return(o<1.5?1:o<3?2:o<7?5:10)*n}(n),r=[];for(let n=Math.ceil(e/o)*o;n<=t+.001*o;n+=o)r.push(Math.round(1e10*n)/1e10);return r}function sn(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}const dn=40,cn=1e6;function un(e){const{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:a=200,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:p=!0,showAxes:f=!0,pointRadius:h=3,pointColor:g="#3b82f6",curveColor:x="#3b82f6",gridColor:b="#e2e8f0",axisColor:m="#94a3b8",onPointClick:y,onPointDoubleClick:v,onPointContextMenu:k,onPointHover:S}=e,[w,$]=l(d[0]),[C,z]=l(d[1]),[M,I]=l(u[0]),[L,R]=l(u[1]),D=c(!1),A=c(null),F=s(e=>dn+(e-w)/(C-w)*(t-80),[w,C,t]),T=s(e=>n-dn-(e-M)/(L-M)*(n-80),[M,L,n]),E=s(e=>w+(e-dn)/(t-80)*(C-w),[w,C,t]),W=s(e=>M+(n-dn-e)/(n-80)*(L-M),[M,L,n]),B=s(e=>{const t=e;D.current=!0,A.current={mx:t.clientX,my:t.clientY,x0:w,x1:C,y0:M,y1:L}},[w,C,M,L]),H=s(e=>{if(!D.current||!A.current)return;const o=e,r=A.current,i=o.clientX-r.mx,l=o.clientY-r.my,a=i/(t-80)*(r.x1-r.x0),s=l/(n-80)*(r.y1-r.y0);$(r.x0-a),z(r.x1-a),I(r.y0+s),R(r.y1+s)},[t,n]),N=s(()=>{D.current=!1,A.current=null},[]),P=s(e=>{const t=e;t.preventDefault();const n=t.currentTarget.getBoundingClientRect(),o=t.clientX-n.left,r=t.clientY-n.top,i=E(o),l=W(r),a=t.deltaY>0?1.1:1/1.1,s=(C-w)*a,d=(L-M)*a;if(s<.01||d<.01||s>cn||d>cn)return;const c=(i-w)/(C-w),u=(l-M)/(L-M);$(i-c*s),z(i+(1-c)*s),I(l-u*d),R(l+(1-u)*d)},[w,C,M,L,E,W]),j=[];if(j.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),p){const e=an(w,C),r=an(M,L);for(let t=0;t<e.length;t++){const r=F(e[t]);j.push(o("line",{x1:r,y1:dn,x2:r,y2:n-dn,stroke:b,"stroke-width":.5,key:`gx-${t}`})),j.push(o("text",{x:r,y:n-dn+14,"text-anchor":"middle","font-size":10,fill:m,key:`lx-${t}`},sn(e[t])))}for(let e=0;e<r.length;e++){const n=T(r[e]);j.push(o("line",{x1:dn,y1:n,x2:t-dn,y2:n,stroke:b,"stroke-width":.5,key:`gy-${e}`})),j.push(o("text",{x:34,y:n+3,"text-anchor":"end","font-size":10,fill:m,key:`ly-${e}`},sn(r[e])))}}if(f){const e=Math.max(dn,Math.min(t-dn,F(0))),r=Math.max(dn,Math.min(n-dn,T(0)));j.push(o("line",{x1:dn,y1:r,x2:t-dn,y2:r,stroke:m,"stroke-width":1,key:"x-axis"})),j.push(o("line",{x1:e,y1:dn,x2:e,y2:n-dn,stroke:m,"stroke-width":1,key:"y-axis"}))}if(i){const e=(C-w)/a,t=[];for(let n=0;n<=a;n++){const o=w+n*e,r=i(o);if(!isFinite(r))continue;const l=F(o),a=T(r);t.push(`${0===t.length?"M":"L"}${l},${a}`)}t.length>0&&j.push(o("path",{d:t.join(" "),fill:"none",stroke:x,"stroke-width":1.5,key:"curve"}))}const _=(e,t,n,o)=>{if(t)return e=>t({x:o.x,y:o.y,index:n,event:e})};for(let e=0;e<r.length;e++){const t=r[e],n={cx:F(t.x),cy:T(t.y),r:h,fill:g,cursor:"pointer",key:`pt-${e}`};y&&(n.onclick=_(0,y,e,t)),v&&(n.ondblclick=_(0,v,e,t)),k&&(n.oncontextmenu=_(0,k,e,t)),S&&(n.onmouseover=_(0,S,e,t)),j.push(o("circle",n))}const O=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:dn,y:dn,width:t-80,height:n-80})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:"user-select: none; touch-action: none;",onmousedown:B,onmousemove:H,onmouseup:N,onmouseleave:N,onwheel:P},O,...j)}function pn(e,t,n){let o=0,r=0;for(let i=0;i<n;i++){const n=o*o,l=r*r;if(n+l>4)return i;r=2*o*r+t,o=n-l+e}return n}function fn(e,t,n){if(e===t)return[0,0,0];const o=e/t;if("fire"===n)return[Math.floor(255*Math.min(1,3*o)),Math.floor(255*Math.max(0,3*o-1)),Math.floor(255*Math.max(0,3*o-2))];if("ocean"===n)return[Math.floor(255*o*.3),Math.floor(255*o*.6),Math.floor(255*(.4+.6*o))];const r=360*o%360,i=1*(1-Math.abs(0)),l=i*(1-Math.abs(r/60%2-1)),a=.5-i/2;let s=0,d=0,c=0;return r<60?(s=i,d=l):r<120?(s=l,d=i):r<180?(d=i,c=l):r<240?(d=l,c=i):r<300?(s=l,c=i):(s=i,c=l),[Math.floor(255*(s+a)),Math.floor(255*(d+a)),Math.floor(255*(c+a))]}function hn(e){const{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:d=100,colorScheme:u="classic",computeFunction:p=pn,onPointClick:f,onPointHover:h,onPointDoubleClick:g,onPointContextMenu:x}=e,[b,m]=l(r[0]),[y,v]=l(r[1]),[k,S]=l(i[0]),[w,$]=l(i[1]),C=c(null),z=c(!1),M=c(null),I=s((e,o)=>({re:b+e/t*(y-b),im:w-o/n*(w-k)}),[b,y,k,w,t,n]);a(()=>{const e=C.current;if(!e)return;const o=e.getContext("2d");if(!o)return;const r=o.createImageData(t,n),i=r.data;for(let e=0;e<n;e++)for(let n=0;n<t;n++){const{re:o,im:r}=I(n,e),l=p(o,r,d),[a,s,c]=fn(l,d,u),f=4*(e*t+n);i[f]=a,i[f+1]=s,i[f+2]=c,i[f+3]=255}o.putImageData(r,0,0)},[b,y,k,w,t,n,d,u,p,I]);const L=s(e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,{re:r,im:i}=I(n,o);return{re:r,im:i,iterations:p(r,i,d),event:e}},[I,p,d]),R=s(e=>{z.current=!0,M.current={x:e.clientX,y:e.clientY,rMin:b,rMax:y,iMin:k,iMax:w}},[b,y,k,w]),D=s(e=>{if(h&&h(L(e)),!z.current||!M.current)return;const o=M.current,r=e.clientX-o.x,i=e.clientY-o.y,l=(o.rMax-o.rMin)/t,a=(o.iMax-o.iMin)/n;m(o.rMin-r*l),v(o.rMax-r*l),S(o.iMin+i*a),$(o.iMax+i*a)},[t,n,h,L]),A=s(()=>{z.current=!1},[]),F=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15,n=e.target.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,{re:i,im:l}=I(o,r);m(i+(b-i)*t),v(i+(y-i)*t),S(l+(k-l)*t),$(l+(w-l)*t)},[I,b,y,k,w]),T=s(e=>{f&&f(L(e))},[f,L]),E=s(e=>{g&&g(L(e))},[g,L]),W=s(e=>{e.preventDefault(),x&&x(L(e))},[x,L]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onmousedown:R,onmousemove:D,onmouseup:A,onmouseleave:A,onwheel:F,onclick:T,ondblclick:E,oncontextmenu:W})}function gn(e,t,n){if(e===t)return[e];const o=(t-e)/(n-1),r=[];for(let t=0;t<n;t++){const n=e+o*t;r.push(Math.round(1e10*n)/1e10)}return r}function xn(e,t,n,o){return d(()=>function(e,t,n,o){if(0===e.length)return{xScale:()=>o,yScale:()=>n-o,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let r=1/0,i=-1/0,l=1/0,a=-1/0;for(const t of e)t.x<r&&(r=t.x),t.x>i&&(i=t.x),t.y<l&&(l=t.y),t.y>a&&(a=t.y);r===i&&(r-=1,i+=1),l===a&&(l-=1,a+=1);const s=t-2*o,d=n-2*o;return{xScale:e=>o+(e-r)/(i-r)*s,yScale:e=>n-o-(e-l)/(a-l)*d,xTicks:gn(r,i,6),yTicks:gn(l,a,6),xMin:r,xMax:i,yMin:l,yMax:a}}(e,t,n,o),[e,t,n,o])}function bn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function mn(e){const{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:l=2,pointRadius:a=4,pointColor:s="#3b82f6",showPoints:c=!0,showGrid:u=!0,showArea:p=!1,areaColor:f="rgba(59,130,246,0.15)",xLabel:h,yLabel:g,title:x,padding:b=50,animate:m=!1,multiLine:y}=e,v=xn(d(()=>{const e=[...t];if(y)for(const t of y)e.push(...t.data);return e},[t,y]),n,r,b),{xScale:k,yScale:S,xTicks:w,yTicks:$}=v,C=[];if(C.push(o("rect",{x:0,y:0,width:n,height:r,fill:"white",key:"bg"})),u){for(let e=0;e<w.length;e++){const t=k(w[e]);C.push(o("line",{x1:t,y1:b,x2:t,y2:r-b,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${e}`}))}for(let e=0;e<$.length;e++){const t=S($[e]);C.push(o("line",{x1:b,y1:t,x2:n-b,y2:t,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${e}`}))}}C.push(o("line",{x1:b,y1:r-b,x2:n-b,y2:r-b,stroke:"#374151","stroke-width":1,key:"x-axis"})),C.push(o("line",{x1:b,y1:b,x2:b,y2:r-b,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let e=0;e<w.length;e++){const t=k(w[e]);C.push(o("line",{x1:t,y1:r-b,x2:t,y2:r-b+5,stroke:"#374151",key:`xtick-${e}`})),C.push(o("text",{x:t,y:r-b+18,"text-anchor":"middle","font-size":11,fill:"#6b7280",key:`xlabel-${e}`},bn(w[e])))}for(let e=0;e<$.length;e++){const t=S($[e]);C.push(o("line",{x1:b-5,y1:t,x2:b,y2:t,stroke:"#374151",key:`ytick-${e}`})),C.push(o("text",{x:b-10,y:t+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${e}`},bn($[e])))}function z(e,t,n,r,i,l,a,s,d){if(0===e.length)return;const c=[...e].sort((e,t)=>e.x-t.x);if(r){const e=S(v.yMin),t=c.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),n=`${k(c[0].x)},${e} ${t} ${k(c[c.length-1].x)},${e}`;C.push(o("polygon",{points:n,fill:i,key:`${d}-area`}))}const u={points:c.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),fill:"none",stroke:t,"stroke-width":n,"stroke-linejoin":"round","stroke-linecap":"round",key:`${d}-line`};if(m?(u["stroke-dasharray"]="1000",u["stroke-dashoffset"]="1000",C.push(o("polyline",u,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):C.push(o("polyline",u)),l)for(let e=0;e<c.length;e++){const t={cx:k(c[e].x),cy:S(c[e].y),r:s,fill:a,key:`${d}-pt-${e}`};m?(t.opacity=0,C.push(o("circle",t,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))):C.push(o("circle",t))}}if(z(t,i,l,p,f,c,s,a,"primary"),y)for(let e=0;e<y.length;e++){const t=y[e];z(t.data,t.color,l,!1,"transparent",c,t.color,a,`series-${e}`)}if(y&&y.length>0){const e=[],t=[{color:i,label:"Primary"},...y.map((e,t)=>({color:e.color,label:e.label??`Series ${t+1}`}))];for(let n=0;n<t.length;n++){const r=b+10+120*n,i=b-30;e.push(o("rect",{x:r,y:i,width:14,height:14,fill:t[n].color,rx:2,key:`legend-rect-${n}`})),e.push(o("text",{x:r+20,y:i+12,"font-size":12,fill:"#374151",key:`legend-text-${n}`},t[n].label))}C.push(o("g",{key:"legend"},...e))}return h&&C.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},h)),g&&C.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},g)),x&&C.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},x)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:`0 0 ${n} ${r}`},...C)}function yn(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function vn(e,t,n,o,r,i){const l=r-Math.PI/2,a=i-Math.PI/2,s=yn(e,t,o,l),d=yn(e,t,o,a),c=i-r>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,"Z"].join(" ");const u=yn(e,t,n,a),p=yn(e,t,n,l);return[`M ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,`L ${u.x} ${u.y}`,`A ${n} ${n} 0 ${c} 0 ${p.x} ${p.y}`,"Z"].join(" ")}function kn(e,t){const n=t?.padAngle??0,o=function(e,t){const n=t??function(e){const t=[];for(let n=0;n<e;n++){const o=Math.round(360*n/e);t.push(`hsl(${o}, 70%, 55%)`)}return t}(e.length);return e.map((e,t)=>e.color??n[t%n.length])}(e,t?.colors),r=e.reduce((e,t)=>e+t.value,0);if(r<=0)return[];const i=n*e.length,l=2*Math.PI-i,a=[];let s=0;for(let t=0;t<e.length;t++){const i=e[t],d=s+n/2,c=d+i.value/r*l;a.push({label:i.label,value:i.value,startAngle:d,endAngle:c,percentage:i.value/r*100,color:o[t]}),s=c+n/2}return a}function Sn(e){const{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:l=.02,showLabels:a=!0,showValues:s=!0,showLegend:c=!0,legendPosition:u="right",title:p,centerLabel:f,colors:h,strokeColor:g="#fff",strokeWidth:x=2}=e,b=c&&"right"===u?140:0,m=p?30:0,y=c&&"bottom"===u?22*Math.ceil(t.length/2)+10:0,v=n-b,k=r-m-y,S=v/2,w=m+k/2,$=Math.min(v,k)/2-10,C=e.outerRadius??$,z=d(()=>kn(t,{padAngle:l,colors:h}),[t,l,h]),M=[];p&&M.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:"#333"},p));for(let e=0;e<z.length;e++){const t=z[e],n=vn(S,w,i,C,t.startAngle,t.endAngle);if(M.push(o("path",{key:`slice-${e}`,d:n,fill:t.color,stroke:g,strokeWidth:x})),a||s){const n=(t.startAngle+t.endAngle)/2,r=t.percentage<5,l=yn(S,w,r?C+14:i+.65*(C-i),n-Math.PI/2),d=r?"#333":"#fff",c=r?11:12,u=[];if(a&&u.push(t.label),s&&u.push(`${t.percentage.toFixed(1)}%`),r){const t=yn(S,w,C+2,n-Math.PI/2);M.push(o("line",{key:`connector-${e}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,stroke:"#999",strokeWidth:1}))}a&&M.push(o("text",{key:`label-${e}`,x:l.x,y:l.y-(s?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c,fill:d,pointerEvents:"none"},t.label)),s&&M.push(o("text",{key:`value-${e}`,x:l.x,y:l.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c-1,fill:d,pointerEvents:"none"},`${t.percentage.toFixed(1)}%`))}}if(f&&i>0&&M.push(o("text",{key:"center-label",x:S,y:w,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:"#333"},f)),c){const e=[];if("right"===u){const t=v+10,n=m+20;for(let r=0;r<z.length;r++){const i=z[r],l=n+22*r;e.push(o("circle",{key:`legend-dot-${r}`,cx:t+6,cy:l,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:t+18,y:l,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:"#333"},`${i.label} (${i.percentage.toFixed(1)}%)`))}}else{const t=r-y+10;for(let r=0;r<z.length;r++){const i=z[r],l=r%2*(n/2)+10,a=t+22*Math.floor(r/2);e.push(o("circle",{key:`legend-dot-${r}`,cx:l+6,cy:a,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:l+18,y:a,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:"#333"},`${i.label} (${i.percentage.toFixed(1)}%)`))}}M.push(...e)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:`0 0 ${n} ${r}`},...M)}function wn(e,t,n,o,r){return{x:n+e*Math.cos(t)*r,y:o-e*Math.sin(t)*r}}function $n(e){const{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:a=360,points:c=[],showGrid:u=!0,pointRadius:p=3,pointColor:f="#3b82f6",curveColor:h="#3b82f6",onPointClick:g,onPointDoubleClick:x,onPointContextMenu:b,onPointHover:m}=e,[y,v]=l(r[1]),[k,S]=l(0),[w,$]=l(0),[C,z]=l(null),M=t/2+k,I=n/2+w,L=Math.min(t,n)/2-30,R=L/y,D=d(()=>{const e=Math.max(1,Math.ceil(y)),t=[],n=y/e;for(let o=1;o<=e;o++)t.push(n*o);return t},[y]),A=d(()=>{const e=[];for(let t=0;t<360;t+=30)e.push(t*Math.PI/180);return e},[]),F=d(()=>{if(!i)return"";const e=[];for(let t=0;t<=a;t++){const n=t/a*2*Math.PI,o=i(n);if(o<0||!isFinite(o))continue;const{x:r,y:l}=wn(o,n,M,I,R);e.push(`${0===e.length?"M":"L"}${r.toFixed(2)},${l.toFixed(2)}`)}return e.join(" ")},[i,a,M,I,R]),T=s(e=>{z({x:e.clientX,y:e.clientY,px:k,py:w})},[k,w]),E=s(e=>{C&&(S(C.px+(e.clientX-C.x)),$(C.py+(e.clientY-C.y)))},[C]),W=s(()=>{z(null)},[]),B=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15;v(Math.max(.1,y*t))},[y]),H=s((e,t,n)=>{if(e)return o=>e({r:t.r,theta:t.theta,index:n,event:o})},[]),N=[];if(N.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let e=0;e<D.length;e++){const t=D[e]*R;N.push(o("circle",{cx:M,cy:I,r:t,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${e}`})),N.push(o("text",{x:M+t+2,y:I-4,"font-size":10,fill:"#9ca3af",key:`gl-${e}`},D[e].toFixed(1)))}for(let e=0;e<A.length;e++){const t=A[e],n=D[D.length-1]*R,r=M+n*Math.cos(t),i=I-n*Math.sin(t);N.push(o("line",{x1:M,y1:I,x2:r,y2:i,stroke:"#e5e7eb","stroke-width":1,key:`al-${e}`}));const l=Math.round(180*t/Math.PI),a=M+(n+14)*Math.cos(t),s=I-(n+14)*Math.sin(t);N.push(o("text",{x:a,y:s+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${e}`},`${l}°`))}}N.push(o("line",{x1:M-L,y1:I,x2:M+L,y2:I,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),N.push(o("line",{x1:M,y1:I-L,x2:M,y2:I+L,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),F&&N.push(o("path",{d:F,fill:"none",stroke:h,"stroke-width":2,key:"curve"}));for(let e=0;e<c.length;e++){const t=c[e],{x:n,y:r}=wn(t.r,t.theta,M,I,R);N.push(o("circle",{cx:n,cy:r,r:p,fill:f,key:`pt-${e}`,style:{cursor:"pointer"},onclick:H(g,t,e),ondblclick:H(x,t,e),oncontextmenu:H(b,t,e),onmouseenter:H(m,t,e)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:{cursor:C?"grabbing":"grab"},onmousedown:T,onmousemove:E,onmouseup:W,onmouseleave:W,onwheel:B},...N)}function Cn(e){const t=1<<e,n=[];for(let o=0;o<t;o++){const t=[];for(let n=0;n<e;n++)t.push(2*(o>>n&1)-1);n.push({coords:t})}return n}function zn(e){const t=1<<e,n=[];for(let o=0;o<t;o++)for(let t=0;t<e;t++){const e=o^1<<t;e>o&&n.push({source:o,target:e})}return n}function Mn(e,t){let n=In(e),o=0;for(let r=0;r<e;r++)for(let i=r+1;i<e;i++)o<t.length&&(n=Rn(n,Ln(e,r,i,t[o]))),o++;return n}function In(e){const t=[];for(let n=0;n<e;n++){const o=new Array(e).fill(0);o[n]=1,t.push(o)}return t}function Ln(e,t,n,o){const r=In(e),i=Math.cos(o),l=Math.sin(o);return r[t][t]=i,r[t][n]=-l,r[n][t]=l,r[n][n]=i,r}function Rn(e,t){const n=e.length,o=[];for(let r=0;r<n;r++){const i=new Array(n).fill(0);for(let o=0;o<n;o++)for(let l=0;l<n;l++)i[o]+=e[r][l]*t[l][o];o.push(i)}return o}function Dn(e,t){const n=e.length,o=new Array(n).fill(0);for(let r=0;r<n;r++)for(let i=0;i<n;i++)o[r]+=e[r][i]*t.coords[i];return o}function An(e,t=0){const n=e[0]??0,o=e[1]??0;let r=0;for(let t=2;t<e.length;t++)r+=e[t]??0;if(e.length>2&&(r/=e.length-2),t>0){const e=1/(1+t*(r+2));return{x:n*e,y:o*e,depth:r}}return{x:n,y:o,depth:r}}function Fn(e,t=[],n=.3,o=1){const r=Cn(e),i=zn(e),l=Mn(e,t);return{vertices:r.map((e,t)=>{const r=An(Dn(l,e),n);return{id:t,position:e,x:r.x*o,y:r.y*o,depth:r.depth}}),edges:i,dimension:e}}function Tn(e){return e*(e-1)/2}function En(e,t=70,n=55){const o=[];for(let r=0;r<e;r++){const i=Math.round(360*r/e);o.push(`hsl(${i}, ${t}%, ${n}%)`)}return o}function Wn(e){const t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,u=e.edgeWidth??3,p=e.edgeColor??"#111",f=e.perspective??.25,h=e.rotationSpeed??.008,g=e.showLabels??!1,x=e.backgroundColor??"transparent",b=e.scale??.3*Math.min(n,r),m=Tn(t),y=1<<t,v=d(()=>"auto"===e.vertexColors||void 0===e.vertexColors?En(y):e.vertexColors,[y,e.vertexColors]),[k,S]=l(()=>{const e=[];for(let t=0;t<m;t++)e.push(0);return e}),[w,$]=l(!1),C=c({x:0,y:0}),z=c([]),M=c(0);a(()=>{if(0===h)return;let e=!0;const t=()=>{e&&(S(e=>{const t=e.slice();for(let e=0;e<t.length;e++)t[e]=(t[e]??0)+h*(1+.3*e);return t}),M.current=requestAnimationFrame(t))};return M.current=requestAnimationFrame(t),()=>{e=!1,cancelAnimationFrame(M.current)}},[h]);const I=d(()=>Fn(t,k,f,b),[t,k,f,b]),L=n/2,R=r/2,D=d(()=>I.edges.map(e=>{const t=I.vertices[e.source],n=I.vertices[e.target],o=(t.depth+n.depth)/2;return{...e,avgDepth:o,sv:t,tv:n}}).sort((e,t)=>e.avgDepth-t.avgDepth),[I]),A=d(()=>I.vertices.slice().sort((e,t)=>e.depth-t.depth),[I]),F=s(e=>{const t=e;$(!0),C.current={x:t.clientX,y:t.clientY},z.current=k.slice()},[k]),T=s(e=>{if(!w)return;const t=e,n=.01*(t.clientX-C.current.x),o=.01*(t.clientY-C.current.y);S(()=>{const e=z.current.slice();return e.length>0&&(e[0]=(e[0]??0)+n),e.length>1&&(e[1]=(e[1]??0)+o),e})},[w]),E=s(()=>{$(!1)},[]),W=D.map((e,t)=>{const n=(e=>{const t=(e+2)/4;return.3+.7*Math.max(0,Math.min(1,t))})(e.avgDepth);return o("line",{key:`e-${e.source}-${e.target}`,x1:String(L+e.sv.x),y1:String(R+e.sv.y),x2:String(L+e.tv.x),y2:String(R+e.tv.y),stroke:p,"stroke-width":String(u),"stroke-opacity":String(n),"stroke-linecap":"round"})}),B=A.map(e=>{const n=i*(e=>{const t=(e+2)/4;return.6+.4*Math.max(0,Math.min(1,t))})(e.depth),r=v[e.id%v.length]??"#3b82f6",l=[o("circle",{key:`v-${e.id}-circle`,cx:String(L+e.x),cy:String(R+e.y),r:String(n),fill:r,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return g&&l.push(o("text",{key:`v-${e.id}-label`,x:String(L+e.x),y:String(R+e.y+n+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},e.id.toString(2).padStart(t,"0"))),l});return o("svg",{width:String(n),height:String(r),viewBox:`0 0 ${n} ${r}`,style:{backgroundColor:x,cursor:w?"grabbing":"grab",userSelect:"none"},onMouseDown:F,onMouseMove:T,onMouseUp:E,onMouseLeave:E},...W,...B.flat())}function Bn(e={}){const t=e.dimension??4,n=e.rotationSpeed??.008,o=e.perspective??.25,r=e.scale??200,i=Tn(t),[s,c]=l(()=>new Array(i).fill(0));return a(()=>{if(0===n)return;let e=!0,t=0;const o=()=>{e&&(c(e=>e.map((e,t)=>e+n*(1+.3*t))),t=requestAnimationFrame(o))};return t=requestAnimationFrame(o),()=>{e=!1,cancelAnimationFrame(t)}},[n]),{data:d(()=>Fn(t,s,o,r),[t,s,o,r]),angles:s,setAngles:c}}function Hn(e){const t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",l=e.gap??"12px",a=e.contain??"layout style paint",s={display:"flex",flexDirection:"column",gap:l,width:"number"==typeof e.width?`${e.width}px`:e.width??"auto",height:"number"==typeof e.height?`${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,c=e.legend&&e.legend.length>0?(u=e.legend,o("div",{className:"viz-legend",style:{display:"flex",flexDirection:(p={align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:"left"===n||"right"===n?"column":"row"}).direction,flexWrap:"wrap",gap:`${p.gap}px`,justifyContent:p.align,alignItems:"center",fontSize:p.fontSize,color:"#6b7280",flexShrink:"0"}},...u.map((e,t)=>o("div",{key:`legend-${t}`,style:{display:"flex",alignItems:"center",gap:"6px"}},function(e){const t=e.shape??"circle";return"line"===t?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??""})):o("div","square"===t?{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}:{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}(e),o("span",null,e.label))))):null;var u,p;const f=function(e,t,n,r,i){const l=[];if("top"===r&&e&&l.push(e),"left"===i||"right"===i){const a=[];"left"===i&&n&&a.push(n),"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),"right"===i&&n&&a.push(n),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if("left"===r||"right"===r){"top"===i&&n&&l.push(n);const a=[];"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),"bottom"===i&&n&&l.push(n)}else"top"===i&&n&&l.push(n),l.push(t),"bottom"===i&&n&&l.push(n);return"bottom"===r&&e&&l.push(e),l}(d,o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),c,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:s},...f)}export{pt as Accordion,le as Alert,m as AnalogClock,w as Avatar,z as Badge,ln as BarGraph,ht as Breadcrumb,qe as Card,ot as Carousel,un as CartesianGraph2D,be as Checkbox,ke as ColorPicker,Se as ColorWheel,hn as ComplexGraph2D,Nt as ContextMenu,H as DataGrid,Me as DatePicker,Y as DigitalClock,_t as Drawer,xt as Dropdown,ae as EmptyState,Le as FileUpload,Ue as FlexContainer,Xe as FlexItem,he as FormFieldWrapper,Ge as Grid,Ke as GridItem,Wn as HypercubeGraph,rt as Image,mn as LineGraph,Z as ListView,yt as Menubar,Yt as Modal,Re as MultilineField,at as NavWrapper,De as NumberSpinner,Ct as Pagination,Je as Panel,Sn as PieGraph,$n as PolarGraph2D,Xt as Popover,se as ProgressBar,Ae as RadioGroup,et as ScrollContainer,Fe as Select,Mt as Sidebar,de as Skeleton,Te as Slider,fe as Spinner,tt as Splitter,It as Stepper,nt as Tabs,ne as Tag,Be as TextEditor,He as TextField,je as TimePicker,Zt as ToastContainer,Oe as Toggle,Dt as Toolbar,tn as Tooltip,Bt as TreeNav,At as TreeNode,lt as VideoPlayer,re as VirtualScroll,Hn as VizWrapper,ge as buildInputStyle,st as buildNavItemStyle,Mn as buildRotationMatrix,kn as computeSlices,Kt as createToaster,vn as describeArc,zn as generateEdges,Fn as generateHypercube,En as generatePalette,Cn as generateVertices,Tn as numRotationAngles,An as projectTo2D,Dn as transformVec,nn as useBarGraphScales,dt as useHover,Bn as useHypercube,xn as useLineGraphScales,Qt as useToast};
|
|
2
2
|
//# sourceMappingURL=specifyjs-components.esm.js.map
|