@kingsimba/nc-ui 0.1.49 → 0.1.50

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/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";var pt=Object.defineProperty;var ft=(e,t,r)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ne=(e,t,r)=>ft(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),X=require("./GeneratedIcons-BW9T3BzJ.cjs"),l=require("react"),ve=require("react-dom"),te=require("react-i18next"),ht=require("i18next"),mt=require("./clsx-C11secjj.cjs");function Ce({size:e="default",color:t,overlay:r=!1,className:s=""}){const o=n.jsx("svg",{className:`nc-activity-indicator nc-${e} ${s}`,viewBox:"0 0 50 50",style:t?{color:t}:void 0,children:n.jsx("circle",{className:"nc-activity-indicator-circle",cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round"})});return r?n.jsx("div",{className:"nc-activity-indicator-overlay",children:o}):o}function J({variant:e="default",block:t,size:r="default",appearance:s="default",className:o,disabled:i,textSelectable:a,loading:c,onClick:d,children:p,...f}){const w=["nc-button",e!=="default"?`nc-${e}`:"",t?"nc-block":"",r==="small"?"nc-small":"",r==="large"?"nc-large":"",s==="transparent"?"nc-transparent":"",i||c?"nc-disabled":"",a?"nc-text-selectable":"",c?"nc-loading":"",o??""].filter(Boolean).join(" "),u=b=>{if(!c){if(a){const k=window.getSelection();if(k&&k.toString().length>0)return}d==null||d(b)}};return n.jsxs("button",{className:w,disabled:i||c,onClick:u,...f,children:[c&&n.jsx(Ce,{size:"small",className:"nc-button-spinner",color:s==="transparent"||e!=="default"&&e!=="ghost"?"white":void 0}),p]})}const gt={info:"primary",success:"success",warning:"warning",error:"danger",danger:"danger"};function bt({code:e,text:t,type:r,button:s,onAction:o,children:i,onClose:a,className:c="",style:d}){const p=i??n.jsxs(n.Fragment,{children:[e!==void 0&&n.jsx("span",{className:"nc-alert-code",children:e}),t]});return n.jsxs("div",{className:`nc-alert nc-${r} ${c}`.trim(),style:d,children:[n.jsxs("div",{className:"nc-alert-main",children:[n.jsx("div",{className:`nc-alert-message nc-${r}`,children:p}),a&&n.jsx("button",{type:"button",className:"nc-alert-close","aria-label":"Close alert",onClick:a,children:n.jsx(X.CloseIcon,{size:16})})]}),s&&n.jsx("span",{className:"nc-alert-action",children:n.jsx(J,{size:"small",variant:s.variant??gt[r],onClick:o,children:s.text})})]})}function xt({percentage:e=.5,status:t="discharging",darkMode:r=!1,colored:s=!1}){const o=Math.max(0,Math.min(1,Number(e)||0)),i=o===0?"-":String(Math.round(o*100));let a;s?o<.1?a="var(--nc-danger)":o<.2?a="var(--nc-warning)":a="var(--nc-success)":a=r?"rgba(255,255,255,0.35)":"#000000";const c="var(--nc-battery-shell-bg)",d=24,p=14,f=2,w=0,u=12,b=0,k=0,x=0,v=d,y=p,m=y-b*2,h=v-b*2,g=Math.max(1,Math.min(4,y/4)),N=o===0?0:.05+o*.95,A=d+f+u,E=20,L=.65,S=Math.max(p,E*L),T=d+f+1,j=(p-E*L)/2;return n.jsxs("svg",{className:"nc-battery",width:A,height:S,viewBox:`0 0 ${A} ${S}`,role:"img","aria-label":`Battery ${i==="-"?"-":`${i}%`} ${t}`,children:[n.jsx("defs",{children:n.jsx("mask",{id:`nc-battery-fill-mask-${o}`,children:n.jsx("rect",{x:"0",y:"0",width:h*N,height:m,fill:"white"})})}),n.jsx("rect",{x:k,y:x,rx:g,ry:g,width:v,height:y,fill:c}),n.jsx("rect",{x:k+b,y:x+b,width:h,height:m,fill:a,rx:g,ry:g,mask:`url(#nc-battery-fill-mask-${o})`}),n.jsx("text",{x:k+v/2,y:p-3,fontSize:11,fontWeight:"bold",fill:"var(--nc-battery-text-contrast)",textAnchor:"middle",children:i}),n.jsx("rect",{x:d+w,y:p*.26,width:f,height:p*.48,rx:.8,ry:.8,fill:o===1?a:c}),t==="charging"?n.jsx("g",{transform:`translate(${T}, ${j}) scale(${L})`,fill:a,children:n.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})}function vt({value:e,onChange:t,options:r,disabled:s,size:o="default"}){return n.jsx("div",{className:`nc-button-group ${o==="small"?"nc-small":o==="tiny"?"nc-tiny":""}`,children:r.map(i=>{const a=s||!!i.disabled;return n.jsx("button",{type:"button",className:`nc-button-group-item ${e===i.key?"nc-active":""}`,onClick:()=>!a&&t(i.key),disabled:a,children:i.label},i.key)})})}function wt({size:e}){return n.jsx("svg",{className:`nc-checkbox-icon ${e==="small"?"nc-small":e==="tiny"?"nc-tiny":""}`,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M2 6L5 9L10 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function yt({checked:e,onChange:t,disabled:r,label:s,size:o="default",labelColor:i,style:a,className:c=""}){const d=o==="small",p=o==="tiny";return n.jsxs("label",{className:`nc-checkbox-label ${d?"nc-small":""} ${p?"nc-tiny":""} ${r?"nc-disabled":""} ${c}`.trim(),style:a,onClick:f=>{r||(f.preventDefault(),t(!e))},children:[n.jsx("span",{role:"checkbox","aria-checked":e,tabIndex:0,className:`nc-checkbox-box ${d?"nc-small":""} ${p?"nc-tiny":""} ${e?"nc-checked":""}`,onKeyDown:f=>{r||(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),t(!e))},children:e&&n.jsx(wt,{size:o})}),s&&n.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function jt({option:e,onChange:t,selected:r,highlighted:s,small:o,renderOption:i,index:a}){const c=l.useRef(null),{t:d}=te.useTranslation(),p=e.disabled===!0;return l.useEffect(()=>{s&&c.current&&c.current.scrollIntoView({block:"nearest"})},[s]),n.jsx("div",{ref:c,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${s?"nc-highlighted":""} ${p?"nc-disabled":""}`,role:"option",onClick:()=>{p||t(e.value,e.label)},"aria-selected":r,"aria-disabled":p,style:{cursor:p?"default":"pointer",opacity:p?.4:void 0,background:s&&!p?"rgba(59,130,246,0.18)":r&&!p?"rgba(59,130,246,0.12)":void 0},children:i?i(e,a,!!s):n.jsxs(n.Fragment,{children:[e.label,e.default&&n.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",d("common.default"),")"]})]})})}function kt({isOpen:e,options:t,onSelect:r,selectedValue:s,placement:o="bottom",anchorRef:i,small:a,highlightedIndex:c=-1,renderOption:d}){const[p,f]=l.useState({top:0,left:0,width:0}),[w,u]=l.useState(o),{t:b}=te.useTranslation();if(l.useEffect(()=>{if(e&&i.current){const x=i.current.getBoundingClientRect();let v=o;if(o==="bottom"){const y=window.innerHeight-x.bottom,m=x.top;y<320&&m>y&&(v="top")}u(v),f({top:v==="top"?x.top-4:x.bottom+4,left:x.left,width:x.width})}},[e,i,o]),!e)return null;const k=n.jsx("div",{className:"nc-combo-dropdown",onMouseDown:x=>x.stopPropagation(),style:{position:"fixed",top:w==="top"?void 0:p.top,bottom:w==="top"?window.innerHeight-p.top:void 0,left:p.left,width:p.width,zIndex:1e3,maxHeight:300,overflowY:"auto"},children:t.length===0?n.jsx("div",{className:`nc-combo-dropdown-option nc-no-results ${a?"nc-small":""}`,children:b("common.noResults")}):t.map((x,v)=>n.jsx(jt,{option:x,onChange:r,selected:x.value===s,highlighted:v===c,small:a,renderOption:d,index:v},x.value))});return ve.createPortal(k,document.body)}function Nt({onClick:e,small:t}){return n.jsx("span",{role:"button",tabIndex:0,className:`nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:r=>{r.stopPropagation(),e()},onMouseDown:r=>r.stopPropagation(),onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),e())},"aria-label":"Clear selection",children:"✕"})}function St({open:e,small:t}){return n.jsx("span",{"aria-hidden":!0,className:`nc-combo-button nc-combo-toggle ${t?"nc-small":""} ${e?"nc-open":""}`,children:"▾"})}function At({value:e,onChange:t,placeholder:r="Select…",options:s,candidates:o,renderOption:i,renderSelected:a,selectedOption:c,disabled:d,label:p,clearable:f=!0,allowTyping:w=!1,placement:u="bottom",size:b="default",appearance:k="default",textAlign:x="left",style:v,className:y}){const[m,h]=l.useState(!1),[g,N]=l.useState(""),[A,E]=l.useState(-1),L=l.useRef(null),S=l.useRef(null),T=l.useRef(null),j=b==="small",{t:C}=te.useTranslation(),P=!!o,W=w||P,[M,$]=l.useState([]),[D,K]=l.useState(()=>{if(s&&e){const I=s.find(H=>H.value===e);return I?I.label:""}return o&&e?e:""});l.useEffect(()=>{if(!e){K("");return}if(s){const I=s.find(H=>H.value===e);I&&K(I.label)}else o&&K(e)},[e,s,o]);const V=(I,H=!1)=>{if(!o)return;T.current&&clearTimeout(T.current);const z=async()=>{try{const Y=await o(I);$(Y),E(-1)}catch{$([])}};H?z():T.current=setTimeout(z,200)},G=l.useMemo(()=>{if(P)return M;const I=g.toLowerCase();return W?(s||[]).filter(H=>H.label.toLowerCase().includes(I)):s||[]},[s,g,W,P,M]);l.useEffect(()=>{m&&E(-1)},[m,G]),l.useEffect(()=>{if(!f&&!e&&s&&s.length>0&&t){const I=s.find(H=>H.default)||s[0];t(I.value)}},[f,e,s,t]),l.useEffect(()=>{function I(H){var z;H.target instanceof Node&&L.current&&((z=L.current.parentElement)!=null&&z.contains(H.target)||h(!1))}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);const B=c??(s?s.find(I=>I.value===e):e?{label:D,value:e}:void 0),_=B&&f,oe=!d&&!_,ue=`nc-align-${x}`,ie=!(m&&W)&&!!B,ce=(I,H,z=!1)=>{var Y;K(H),t==null||t(I),h(!1),N(""),z&&((Y=L.current)==null||Y.blur())},he=()=>{t==null||t(void 0),N(""),h(!1)},me=I=>{if(!m){(I.key==="ArrowDown"||I.key==="ArrowUp")&&(h(!0),I.preventDefault());return}const H=(z,Y)=>{if(Y===1){for(let F=z;F<G.length;F++)if(!G[F].disabled)return F;for(let F=0;F<z;F++)if(!G[F].disabled)return F}else{for(let F=z;F>=0;F--)if(!G[F].disabled)return F;for(let F=G.length-1;F>z;F--)if(!G[F].disabled)return F}return z};switch(I.key){case"ArrowDown":I.preventDefault(),E(z=>{const Y=z+1,F=Y>=G.length?0:Y;return H(F,1)});break;case"ArrowUp":I.preventDefault(),E(z=>{const Y=z-1,F=Y<0?G.length-1:Y;return H(F,-1)});break;case"Enter":I.preventDefault(),A>=0&&A<G.length&&!G[A].disabled&&ce(G[A].value,G[A].label,!0);break;case"Escape":I.preventDefault(),h(!1),N("");break}};return n.jsxs("div",{className:`nc-combo-container ${k==="transparent"?"nc-transparent":""} ${k==="plain"?"nc-plain":""} ${m?"nc-open":""} ${ue} ${y||""}`.trim(),style:{position:"relative",...v},children:[p&&n.jsx("span",{className:`nc-label ${j?"nc-small":""}`,children:p}),n.jsxs("div",{ref:S,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:I=>{if(d||W&&I.target===L.current)return;const H=!m;if(h(z=>(!z&&W&&B&&N(B.label),!z)),P&&H){const z=W&&B?B.label:"";$([]),setTimeout(()=>V(z,!0),0)}W&&!m&&setTimeout(()=>{var z,Y;(z=L.current)==null||z.focus(),(Y=L.current)==null||Y.select()},0)},children:[n.jsx("input",{ref:L,className:`nc-input ${j?"nc-small":""} ${ie?"nc-value-under-overlay":""}`.trim(),placeholder:r,onFocus:()=>{if(!d&&W){h(!0);const I=B?B.label:"";B&&(N(I),setTimeout(()=>{var H;return(H=L.current)==null?void 0:H.select()},0)),P&&($([]),V(I,!0))}},onChange:I=>{const H=I.target.value;W&&(N(H),P&&V(H))},onKeyDown:me,value:m&&W?g:(B==null?void 0:B.label)||"",readOnly:d||!W,style:{width:"100%",paddingRight:oe||_?j?32:44:12,caretColor:w?void 0:"transparent",cursor:w?void 0:"pointer",userSelect:ie?"none":void 0,color:ie?"transparent":"var(--nc-text)"}}),ie&&n.jsx("div",{"aria-hidden":!0,className:`nc-combo-overlay ${ue}`,style:{position:"absolute",left:j?8:12,right:oe||_?j?12:24:j?8:12,top:"50%",transform:"translateY(-50%)",userSelect:"text",cursor:w?void 0:"pointer",display:"flex",alignItems:"center",gap:6},children:a&&B?a(B):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`nc-combo-overlay-text ${j?"nc-small":""}`,children:B==null?void 0:B.label}),(B==null?void 0:B.default)&&n.jsxs("span",{className:`nc-combo-overlay-default ${j?"nc-small":""}`,children:["(",C("common.default"),")"]})]})}),_&&n.jsx(Nt,{onClick:he,small:j}),oe&&n.jsx(St,{open:m,small:j})]}),n.jsx(kt,{isOpen:m,options:G,onSelect:ce,selectedValue:e,placement:u,anchorRef:S,small:j,highlightedIndex:A,renderOption:i})]})}function Ct({onClick:e,loading:t=!1,disabled:r=!1,size:s="default",title:o,"aria-label":i}){const a=s==="small"?14:s==="large"?20:18,c=t?"Refreshing...":"Refresh",d=t?"Refreshing":"Refresh";return n.jsx("button",{className:"nc-icon-button",onClick:e,disabled:r||t,title:o??c,"aria-label":i??d,"data-size":s,children:n.jsx(X.RefreshIcon,{size:a,className:t?"nc-spinning":""})})}function Re({onClick:e,disabled:t=!1,size:r="default",title:s="Close","aria-label":o="Close"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-close",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(X.CloseIcon,{size:i})})}function Rt({onClick:e,disabled:t=!1,size:r="default",title:s="Edit","aria-label":o="Edit"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-edit",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(X.EditIcon,{size:i})})}function Mt({onClick:e,disabled:t=!1,size:r="default",title:s="Delete","aria-label":o="Delete"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-trash",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(X.TrashIcon,{size:i})})}function It({onClick:e,disabled:t=!1,children:r,title:s,"aria-label":o,size:i="default"}){return n.jsx("button",{className:"nc-hyperlink",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":i,children:r})}function $t({open:e,onClose:t,options:r,anchorRef:s,anchor:o,preferredDirection:i="down"}){const a=l.useRef(null),[c,d]=l.useState({top:0,left:0}),p=o||(s==null?void 0:s.current);if(l.useEffect(()=>{if(!e||!p||!a.current)return;const u=p.getBoundingClientRect(),b=a.current.getBoundingClientRect(),k=window.innerHeight,x=window.innerWidth,v=u.bottom+8,y=v+b.height<=k-8;let m=i;(!y&&i==="down"||i==="up"&&y)&&(m="up");let h;m==="down"?h=v:h=u.top-b.height-8;let g=u.left;g+b.width>x-8&&(g=u.right-b.width),d({top:Math.max(8,h),left:Math.max(8,g)})},[e,p,i]),l.useEffect(()=>{if(!e)return;const u=k=>{a.current&&!a.current.contains(k.target)&&p&&!p.contains(k.target)&&t()},b=k=>{k.key==="Escape"&&t()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",b)}},[e,t,p]),!e)return null;const f=u=>{u.type!=="separator"&&!u.disabled&&u.onClick&&(u.onClick(),t())},w=r.some(u=>u.icon);return ve.createPortal(n.jsx("div",{ref:a,className:"nc-context-menu",style:{position:"fixed",top:`${c.top}px`,left:`${c.left}px`,zIndex:1e4},role:"menu",children:r.map(u=>{if(u.type==="separator")return n.jsx("div",{className:"nc-context-menu-separator",role:"separator"},u.id);const b=["nc-context-menu-item",u.variant&&u.variant!=="default"?`nc-${u.variant}`:"",u.disabled?"nc-disabled":"",w&&!u.icon?"nc-indented":""].filter(Boolean).join(" ");return n.jsxs("button",{className:b,onClick:()=>f(u),disabled:u.disabled,role:"menuitem",children:[u.icon&&n.jsx("span",{className:"nc-context-menu-icon",children:u.icon}),n.jsx("span",{className:"nc-context-menu-label",children:u.label})]},u.id)})}),document.body)}const Ue=l.createContext(null);function qe(){const e=l.useContext(Ue);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function ae({children:e,onClick:t,...r}){const{close:s}=qe(),{t:o}=te.useTranslation(),i=a=>{t==null||t(a),s()};return n.jsx(J,{onClick:i,...r,children:e??o("common.close")})}function Et({open:e,onClose:t,title:r,children:s,style:o,footerType:i="ok-cancel",footer:a,onOk:c,onSave:d,onDelete:p,onCancel:f,onConnect:w,closeOnOverlay:u=!0,primaryDisabled:b=!1,fullScreen:k=!1,hideTitleBar:x=!1,className:v="",onContentHeightChange:y}){const m=l.useRef(null),h=l.useRef(null),{t:g}=te.useTranslation(),N={close:t},A=S=>{u&&S.target===S.currentTarget&&t()};if(l.useEffect(()=>{e&&m.current&&m.current.focus()},[e]),l.useEffect(()=>{if(!y||!h.current)return;const S=new ResizeObserver(T=>{for(const j of T){const C=j.contentRect.height;y(C)}});return S.observe(h.current),()=>{S.disconnect()}},[y]),!e)return null;const E=()=>{switch(i){case"ok":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(J,{variant:"primary",onClick:c??t,disabled:b,children:g("common.ok")})});case"ok-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:f,children:g("common.cancel")}),n.jsx(J,{variant:"primary",onClick:c??t,disabled:b,children:g("common.ok")})]});case"save-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:f,children:g("common.cancel")}),n.jsx(J,{variant:"primary",onClick:d,disabled:b,children:g("common.save")})]});case"delete-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:f,children:g("common.cancel")}),n.jsx(J,{variant:"danger",onClick:p,disabled:b,children:g("common.delete")})]});case"connect":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:f,children:g("common.cancel")}),n.jsx(J,{variant:"primary",onClick:w,disabled:b,children:g("common.connect")})]});case"close":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(ae,{variant:"primary"})});case"gotit":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(ae,{variant:"primary",children:g("common.gotit")})});case"custom":return n.jsx("div",{className:"nc-dialog-footer",children:a});case"none":return null;default:return null}},L=n.jsx(Ue.Provider,{value:N,children:n.jsx("div",{className:`nc-dialog-overlay${k?" nc-fullscreen":""}`,onClick:A,children:n.jsxs("div",{ref:m,className:`nc-dialog-container ${v}`,style:o,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":x?void 0:"nc-dialog-title",children:[!x&&n.jsxs("div",{className:"nc-dialog-header",children:[n.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:r}),n.jsx(Re,{onClick:t,"aria-label":"Close dialog"})]}),n.jsx("div",{ref:h,className:"nc-dialog-content",children:s}),E()]})})});return k?ve.createPortal(L,document.body):L}function Tt({onClick:e,size:t="default",rightOffset:r=4}){const s=t==="small"?28:34;return n.jsx("button",{className:"nc-button nc-ghost",onClick:e,onMouseDown:o=>{o.preventDefault(),o.stopPropagation()},tabIndex:-1,"aria-label":"Clear input",style:{position:"absolute",right:r,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:t==="small"?"12px":"14px"},children:"✕"})}function Pt({visible:e,onClick:t,size:r="default"}){const s=r==="small"?28:34,o=r==="small"?16:18;return n.jsx("button",{className:"nc-button nc-ghost",onClick:t,onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},tabIndex:-1,"aria-label":e?"Hide password":"Show password",style:{position:"absolute",right:4,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:e?n.jsx(X.EyeHiddenIcon,{size:o}):n.jsx(X.ViewIcon,{size:o})})}function Lt({value:e,defaultValue:t="",onChange:r,onChangeConfirmed:s,onEnter:o,onClear:i,placeholder:a,disabled:c,label:d,clearable:p=!0,type:f="text",className:w="",size:u="default",appearance:b="default",style:k,leadingIcon:x,showPasswordToggle:v=!1,multiline:y=!1,rows:m=3,validator:h,showErrorMessage:g=!0}){const N=l.useRef(null),A=l.useRef(null),E=l.useRef(!1),[L,S]=l.useState(!1),[T,j]=l.useState(!1),[C,P]=l.useState(!1),W=e!==void 0,[M,$]=l.useState(t),D=W?e:M,[K,V]=l.useState(D),G=h?h(D):null,B=!!G,_=!y&&b==="plain",oe=_&&T,ue=oe?K:D;l.useEffect(()=>{oe||V(D)},[D,oe]);const ie=f==="password",ce=ie&&v&&!c&&!y,he=p&&ue&&!c&&(T||C),me=u==="small"?32:44;let I=12;he&&ce?I=me*2:(he||ce)&&(I=me);const z=x?u==="small"?28:34:void 0,Y=()=>{if(!_)return D;const U=K!==D;return W||$(K),U&&(r==null||r(K),s==null||s(K)),K},F=()=>{V(D)},ut=()=>{var U,Z,Ve;if(_){V(""),i==null||i(),(U=N.current)==null||U.focus();return}W||$(""),r==null||r(""),i==null||i(),y?(Z=A.current)==null||Z.focus():(Ve=N.current)==null||Ve.focus()},Le=U=>{if(_&&U.key==="Escape"){U.preventDefault(),E.current=!0,F(),U.currentTarget.blur();return}if(U.key==="Enter"&&!y){const Z=_?Y():D;_&&(U.preventDefault(),E.current=!0,U.currentTarget.blur()),o==null||o(Z)}},Be=U=>{const Z=U.target.value;if(_){V(Z),r==null||r(Z);return}W||$(Z),r==null||r(Z)},ze=()=>{j(!0),_&&V(D)},De=()=>{if(_&&E.current){E.current=!1,j(!1);return}_&&Y(),j(!1)},We=`nc-input ${u==="small"?"nc-small ":""}${!y&&b==="plain"?"nc-plain ":""}${B?"nc-error ":""}${w}`;return n.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...k},onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:[d&&n.jsx("span",{className:"nc-label",children:d}),n.jsxs("div",{style:{position:"relative",display:"flex",alignItems:y?"flex-start":"center"},children:[x&&n.jsx("span",{className:"nc-input-leading-icon",style:{height:y?void 0:"100%",top:y?10:void 0},children:x}),y?n.jsx("textarea",{ref:A,className:We,placeholder:a,value:ue,onChange:Be,onKeyDown:Le,onFocus:ze,onBlur:De,readOnly:c,"aria-disabled":c,tabIndex:c?-1:void 0,rows:m,style:{width:"100%",paddingRight:I,...z!==void 0?{paddingLeft:z}:{}}}):n.jsx("input",{ref:N,type:ie&&L?"text":f,className:We,placeholder:a,value:ue,onChange:Be,onKeyDown:Le,onFocus:ze,onBlur:De,readOnly:c,"aria-disabled":c,tabIndex:c?-1:void 0,style:{width:"100%",paddingRight:I,...z!==void 0?{paddingLeft:z}:{}}}),he&&n.jsx(Tt,{onClick:ut,size:u,rightOffset:ce?me+4:4}),ce&&n.jsx(Pt,{visible:L,onClick:()=>S(!L),size:u})]}),B&&g&&n.jsx("span",{className:"nc-error-message",children:G})]})}function Bt({children:e,onClick:t,showBorder:r=!0,selectable:s=!1,style:o}){const[i,a]=l.useState(!1),c=d=>{if(t){if(s){const p=window.getSelection();if(p&&p.toString().length>0)return}t(d)}};return n.jsx("div",{onClick:c,onMouseDown:()=>t&&a(!0),onMouseUp:()=>a(!1),onMouseLeave:()=>a(!1),style:{cursor:t?"pointer":"default",userSelect:s?"text":void 0,borderBottom:r?void 0:"none",...o},className:`nc-list-group-item ${t?"nc-list-group-item-clickable":""} ${i?"nc-list-group-item-active":""}`,children:n.jsx("div",{style:{flex:1,minWidth:0},children:e})})}function zt({title:e,titleTools:t,children:r,style:s}){return n.jsxs("div",{className:"nc-list-group",style:s,children:[(e||t)&&n.jsxs("div",{className:"nc-list-group-title",children:[n.jsx("div",{children:e}),t&&n.jsx("div",{className:"nc-list-group-title-tools",children:t})]}),n.jsx("div",{className:"nc-list-group-content",children:r})]})}function Dt({values:e,onChange:t,options:r,placeholder:s="Select…",label:o}){const[i,a]=l.useState(!1),[c,d]=l.useState(""),p=l.useRef(null),f=l.useMemo(()=>r.filter(u=>u.label.toLowerCase().includes(c.toLowerCase())),[r,c]);l.useEffect(()=>{function u(b){!(b.target instanceof Node)||!p.current||p.current.contains(b.target)||a(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const w=u=>{e.includes(u)?t(e.filter(b=>b!==u)):t([...e,u])};return n.jsxs("div",{ref:p,className:"nc-col",style:{position:"relative"},children:[o&&n.jsx("span",{className:"nc-label",children:o}),n.jsxs("div",{className:"nc-row",style:{flexWrap:"wrap",gap:6,minHeight:42,alignItems:"center",border:"1px solid var(--nc-button-border)",borderRadius:8,background:"var(--nc-button-bg)",padding:"4px 8px"},children:[e.length===0&&n.jsx("span",{className:"nc-label",children:s}),e.map(u=>{const b=r.find(k=>k.value===u);return b?n.jsxs("span",{style:{padding:"4px 8px",borderRadius:6,display:"inline-flex",alignItems:"center",gap:4,background:"var(--nc-button-bg)",border:"1px solid var(--nc-button-border)"},children:[b.label,n.jsx("button",{className:"nc-button nc-ghost",style:{padding:0,minHeight:0,height:20,width:20,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none"},onClick:()=>w(u),"aria-label":`Remove ${b.label}`,children:"✕"})]},u):null}),n.jsx("input",{className:"nc-input",value:c,onChange:u=>d(u.target.value),onFocus:()=>a(!0),style:{minWidth:50,border:"none",background:"transparent",padding:4,minHeight:32,flex:1}})]}),i&&n.jsxs("div",{className:"nc-combo-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:10,marginTop:4,boxShadow:"0 4px 12px var(--nc-shadow)"},children:[f.map(u=>{const b=e.includes(u.value);return n.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>w(u.value),children:[n.jsx("span",{children:u.label}),n.jsx("span",{children:b?"✔️":""})]},u.value)}),f.length===0&&n.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}function we(e){if(!e)return null;const t=/^\d{2}-\d{1,2}$/,r=/^\d{4}-\d{1,2}$/;if(!t.test(e)&&!r.test(e))return"Format must be YY-M(M) or YYYY-M(M)";const s=e.split("-"),o=parseInt(s[1],10);return o<1||o>12?"Month must be between 1 and 12":null}function xe(e){if(!e)return"";const t=e.split("-");if(t.length!==2)return e;let r=t[0];const s=t[1].padStart(2,"0");if(r.length===2){const o=parseInt(r,10);r=String(o<50?2e3+o:1900+o)}return`${r}-${s}`}function He(e){if(!e)return"";const t=xe(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[r,s]=t.split("-");return`${r}/${s}`}function Fe(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0");return`${t}-${r}`}function Wt({startMonth:e,endMonth:t,onChange:r,label:s,className:o="",disabled:i=!1,size:a="default"}){const[c,d]=l.useState(!1),[p,f]=l.useState(""),[w,u]=l.useState(""),[b,k]=l.useState({top:0,left:0,width:0,right:void 0}),x=l.useRef(null),v=l.useRef(null);l.useEffect(()=>{if(c&&x.current){const j=x.current.getBoundingClientRect(),P=Math.max(j.width,400);window.innerWidth-j.left<P&&j.right>=P?k({top:j.bottom+4,left:0,right:window.innerWidth-j.right,width:P}):k({top:j.bottom+4,left:j.left,right:void 0,width:P})}},[c]),l.useEffect(()=>{if(!c)return;const j=C=>{x.current&&!x.current.contains(C.target)&&v.current&&!v.current.contains(C.target)&&d(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[c]);const y=()=>{f(e||Fe()),u(t||Fe()),d(!0)},m=()=>{d(!1)},h=()=>{const j=we(p),C=we(w);if(j||C)return;const P=xe(p),W=xe(w);P&&W&&(r==null||r(P,W)),d(!1)},g=e&&t?`${He(e)} - ${He(t)}`:"Select month range",N=we(p),A=we(w),E=xe(p),L=xe(w),S=E&&L&&E>L,T=c?ve.createPortal(n.jsx("div",{ref:v,className:"nc-month-range-picker-popup",style:{position:"fixed",top:b.top,...b.right!==void 0?{right:b.right}:{left:b.left},width:b.width,zIndex:1e3},children:n.jsxs("div",{className:"nc-month-range-picker-content",children:[n.jsxs("div",{className:"nc-month-range-picker-row",children:[n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"Start Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${N?"nc-error":""}`,value:p,onChange:j=>f(j.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),N&&n.jsx("div",{className:"nc-month-error-text",children:N})]}),n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"End Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${A?"nc-error":""}`,value:w,onChange:j=>u(j.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),A&&n.jsx("div",{className:"nc-month-error-text",children:A})]})]}),S&&!N&&!A&&n.jsx("div",{className:"nc-month-range-error",children:"End month must be after or equal to start month"}),n.jsxs("div",{className:"nc-month-range-picker-footer",children:[n.jsx(J,{variant:"primary",onClick:h,disabled:!p||!w||!!N||!!A||!!S,children:"Apply"}),n.jsx(J,{variant:"ghost",onClick:m,children:"Cancel"})]})]})}),document.body):null;return n.jsxs("div",{className:`nc-month-range-picker ${a==="small"?"nc-small ":""}${o}`,children:[s&&n.jsx("label",{className:`nc-label${a==="small"?" nc-small":""}`,children:s}),n.jsx("button",{ref:x,className:`nc-month-range-picker-input${a==="small"?" nc-small":""}`,onClick:y,disabled:i,children:g}),T]})}const Vt=5,Ht=3;function Ft({value:e,onChange:t,min:r,max:s,step:o=1,label:i,disabled:a,className:c="",style:d,size:p="default"}){const f=p==="small",w=(String(o).split(".")[1]||"").length,u=l.useRef(null),b=l.useRef(!1),k=l.useRef(null),[x,v]=l.useState(!1),[y,m]=l.useState(()=>String(e)),h=M=>parseFloat(M.toFixed(w)),g=M=>{const $=h(M);m(String($)),t($)},N=()=>{const M=e-o;r!==void 0&&M<r||g(parseFloat(M.toFixed(10)))},A=()=>{const M=e+o;s!==void 0&&M>s||g(parseFloat(M.toFixed(10)))},E=M=>{const $=M.target.value;if(m($),$==="")return;const D=parseFloat($);isNaN(D)||t(D)},L=()=>{const M=y;if(M===""){g(r!==void 0?r:0);return}const $=parseFloat(M);if(isNaN($)){g(r!==void 0?r:0);return}let D=h($);r!==void 0&&(D=Math.max(r,D)),s!==void 0&&(D=Math.min(s,D)),D!==$?g(D):m(String(D))},S=M=>{a||M.button!==0||(b.current=!1,u.current={startY:M.clientY,startValue:e,pointerId:M.pointerId,hasMoved:!1,lastValue:e},k.current=setTimeout(()=>{b.current=!0,v(!0)},200),M.currentTarget.setPointerCapture(M.pointerId))},T=M=>{const $=u.current;if(!$||$.pointerId!==M.pointerId)return;const D=$.startY-M.clientY;if(Math.abs(D)>=Ht&&($.hasMoved=!0,b.current=!0,k.current&&(clearTimeout(k.current),k.current=null),v(!0)),!$.hasMoved)return;const K=Math.trunc(D/Vt);let V=$.startValue+K*o;r!==void 0&&(V=Math.max(r,V)),s!==void 0&&(V=Math.min(s,V)),V=h(V),V!==$.lastValue&&($.lastValue=V,m(String(V)),t(V))},j=M=>{const $=u.current;!$||$.pointerId!==M.pointerId||(k.current&&(clearTimeout(k.current),k.current=null),M.currentTarget.hasPointerCapture(M.pointerId)&&M.currentTarget.releasePointerCapture(M.pointerId),u.current=null,v(!1))},C=M=>$=>{if(b.current){b.current=!1,$.preventDefault();return}M()},P=y===""?NaN:parseFloat(y),W=y===""||isNaN(P)||r!==void 0&&P<r||s!==void 0&&P>s;return n.jsxs("div",{className:`nc-col nc-number-input-col ${f?"nc-small":""}`,children:[i&&n.jsx("span",{className:`nc-label ${f?"nc-small":""}`,children:i}),n.jsxs("div",{className:`nc-number-input-container ${f?"nc-small":""} ${c}`,style:d,children:[n.jsx("input",{className:`nc-input nc-number-input ${f?"nc-small":""} ${W?"nc-error":""}`,type:"number",value:y,onChange:E,onBlur:L,min:r,max:s,step:o,disabled:a}),n.jsxs("div",{className:`nc-number-input-spinners ${f?"nc-small":""} ${a?"nc-disabled":""} ${x?"nc-dragging":""}`,children:[n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-up ${f?"nc-small":""}`,onClick:C(A),onPointerDown:S,onPointerMove:T,onPointerUp:j,onPointerCancel:j,disabled:a||s!==void 0&&e>=s,tabIndex:-1,children:"▲"}),n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-down ${f?"nc-small":""}`,onClick:C(N),onPointerDown:S,onPointerMove:T,onPointerUp:j,onPointerCancel:j,disabled:a||r!==void 0&&e<=r,tabIndex:-1,children:"▼"})]})]})]})}function Ot({value:e,onChange:t,min:r=0,max:s=100,step:o=1,label:i,disabled:a,showValue:c=!0,formatValue:d=f=>f.toString(),width:p=200}){const f=u=>{const b=parseFloat(u.target.value);t(b)},w=(e-r)/(s-r)*100;return n.jsxs("div",{className:"nc-col",style:{gap:6},children:[i&&n.jsx("span",{className:"nc-label",children:i}),n.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[n.jsx("input",{type:"range",className:"nc-slider",value:e,onChange:f,min:r,max:s,step:o,disabled:a,style:{width:p,"--nc-slider-percentage":`${w}%`}}),c&&n.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:d(e)})]})]})}const Gt=({size:e=24,className:t,style:r})=>n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,style:r,children:n.jsx("polyline",{points:"18 15 12 9 6 15"})});function Xe({children:e,className:t="",style:r}){return n.jsx("div",{className:`nc-tab-panel ${t}`,style:r,children:e})}function Yt({active:e,children:t,keepMounted:r=!1,className:s="",style:o}){const i=l.Children.toArray(t).filter(c=>l.isValidElement(c)&&(c.type===Xe||c.type.displayName==="TabPanel"));if(r)return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:i.map(c=>{const d=c.props.tab===e;return n.jsx("div",{className:`nc-tab-panel-wrapper ${d?"nc-active":""}`,style:{display:d?void 0:"none"},"aria-hidden":!d,children:c},c.props.tab)})});const a=i.find(c=>c.props.tab===e);return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:a})}function Kt({tabs:e,active:t,onChange:r,onClose:s,permanentTabs:o,className:i,toolbar:a,multiline:c,orientation:d="horizontal",style:p}){const f=l.useRef(null),[w,u]=l.useState(!1),[b,k]=l.useState(!1),x=d==="verticalLeft"||d==="verticalRight",v=l.useRef(!1),y=l.useRef(0),m=l.useRef(0),h=l.useRef(!1);l.useEffect(()=>{const S=()=>{if(f.current)if(x){const{scrollTop:j,scrollHeight:C,clientHeight:P}=f.current;u(j>1),k(j<C-P-1)}else{const{scrollLeft:j,scrollWidth:C,clientWidth:P}=f.current;u(j>1),k(j<C-P-1)}},T=f.current;if(T)return S(),T.addEventListener("scroll",S),window.addEventListener("resize",S),()=>{T.removeEventListener("scroll",S),window.removeEventListener("resize",S)}},[e,x]);const g=S=>{f.current&&(v.current=!0,h.current=!1,y.current=x?S.clientY:S.clientX,m.current=x?f.current.scrollTop:f.current.scrollLeft,f.current.style.cursor="grabbing",f.current.style.userSelect="none")},N=S=>{if(!v.current||!f.current)return;const T=x?S.clientY:S.clientX,j=y.current-T;Math.abs(j)>3&&(h.current=!0),x?f.current.scrollTop=m.current+j:f.current.scrollLeft=m.current+j},A=()=>{f.current&&(v.current=!1,f.current.style.cursor="",f.current.style.userSelect="")},E=()=>{A()};l.useEffect(()=>{const S=f.current;if(!S||x)return;const T=j=>{j.deltaY!==0&&(j.preventDefault(),S.scrollLeft+=j.deltaY*.3)};return S.addEventListener("wheel",T,{passive:!1}),()=>{S.removeEventListener("wheel",T)}},[x]);const L=S=>{h.current||r(S)};return n.jsxs("div",{className:`nc-tab-container ${x?`nc-vertical nc-${d}`:""} ${i||""}`,style:p,children:[n.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[w&&n.jsx("div",{className:`nc-tab-scroll-indicator ${x?"nc-top":"nc-left"}`,children:x?n.jsx(Gt,{size:16}):n.jsx(X.ChevronLeftIcon,{size:16})}),n.jsx("div",{ref:f,className:`nc-tab-scroll ${c?"nc-multiline":""}`,onMouseDown:g,onMouseMove:N,onMouseUp:A,onMouseLeave:E,style:{cursor:"grab"},children:e.map(S=>{const T=typeof S=="string"?S:S.id,j=typeof S=="string"?S:S.label,C=s&&!(o!=null&&o.includes(T));return n.jsxs("div",{className:`nc-tab-item ${t===T?"nc-active":""} ${C?"nc-closable":""}`,onClick:()=>L(T),role:"button",tabIndex:0,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&r(T)},children:[n.jsx("span",{className:"nc-tab-label",children:x?j:typeof j=="string"?j.toUpperCase():j}),C&&n.jsx("span",{className:"nc-tab-close",role:"button",tabIndex:0,"aria-label":`Close ${typeof j=="string"?j:T}`,onClick:P=>{P.stopPropagation(),s(T)},onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.stopPropagation(),s(T))},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},T)})}),b&&n.jsx("div",{className:`nc-tab-scroll-indicator ${x?"nc-bottom":"nc-right"}`,children:x?n.jsx(X.ChevronDownIcon,{size:16}):n.jsx(X.ChevronRightIcon,{size:16})})]}),a&&n.jsx("div",{className:"nc-tab-toolbar",children:a})]})}function _t({checked:e,onChange:t,disabled:r,label:s}){return n.jsxs("label",{className:"nc-row",style:{gap:10,alignItems:"center",cursor:r?"not-allowed":"pointer"},children:[s&&n.jsx("span",{className:"nc-label",children:s}),n.jsx("span",{role:"switch","aria-checked":e,tabIndex:0,onKeyDown:o=>{r||(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(!e))},onClick:()=>!r&&t(!e),style:{position:"relative",width:56,height:30,borderRadius:18,padding:4,display:"inline-flex",alignItems:"center",justifyContent:"flex-start",border:`2px solid ${e?"var(--nc-primary)":"var(--nc-button-border)"}`,background:e?"rgba(99,102,241,0.08)":"transparent",transition:"border-color 160ms, background 160ms"},children:n.jsx("span",{style:{width:22,height:22,borderRadius:12,background:e?"var(--nc-text)":"var(--nc-muted)",transform:`translateX(${e?24:0}px)`,transition:"transform 160ms, background 160ms",boxShadow:e?"0 2px 6px rgba(99,102,241,0.28)":"0 1px 2px rgba(0,0,0,0.08)",border:"none"}})})]})}const Oe=["var(--nc-csv-col-0)","var(--nc-csv-col-1)","var(--nc-csv-col-2)","var(--nc-csv-col-3)","var(--nc-csv-col-4)","var(--nc-csv-col-5)","var(--nc-csv-col-6)","var(--nc-csv-col-7)","var(--nc-csv-col-8)","var(--nc-csv-col-9)"];function Ut(e,t){const s=e.slice(0,t).split(`
2
- `),o=s.length,a=s[o-1].split(" "),c=a.length,d=a[c-1].length+1;return{line:o,column:c,character:d,offset:t}}function qt(e,t,r,s){const o=e.split(`
3
- `),i=Math.max(1,Math.min(t,o.length));let a=0;for(let w=0;w<i-1;w++)a+=o[w].length+1;const d=o[i-1].split(" "),p=Math.max(1,Math.min(r,d.length));for(let w=0;w<p-1;w++)a+=d[w].length+1;const f=Math.max(1,Math.min(s,d[p-1].length+1));return a+=f-1,a}function Xt(e,t){const r=e.split(`
4
- `),s=Math.max(1,Math.min(t,r.length));let o=0;for(let i=0;i<s-1;i++)o+=r[i].length+1;return o}const Jt=l.forwardRef(function({value:t,onChange:r,placeholder:s,className:o,style:i,showLineNumbers:a=!1,onCursorChange:c,highlightLine:d},p){const f=l.useRef(null),w=l.useRef(null),u=l.useRef(null);l.useImperativeHandle(p,()=>({goToLine(m){const h=f.current;if(!h)return;const g=Xt(t,m);h.focus(),h.setSelectionRange(g,g);const N=parseFloat(getComputedStyle(h).lineHeight)||18;h.scrollTop=(Math.max(1,m)-1)*N,k(),b()},goToPosition(m,h,g){const N=f.current;if(!N)return;const A=qt(t,m,h,g);N.focus(),N.setSelectionRange(A,A);const E=parseFloat(getComputedStyle(N).lineHeight)||18;N.scrollTop=(Math.max(1,m)-1)*E,k(),b()}}),[t]);const b=l.useCallback(()=>{if(!c||!f.current)return;const m=Ut(t,f.current.selectionStart);c(m)},[c,t]),k=l.useCallback(()=>{const m=f.current;m&&(w.current&&(w.current.scrollTop=m.scrollTop,w.current.scrollLeft=m.scrollLeft),u.current&&(u.current.scrollTop=m.scrollTop))},[]);l.useEffect(()=>{if(d==null||d<1)return;const m=f.current;if(!m)return;const h=parseFloat(getComputedStyle(m).lineHeight)||18,g=(d-1)*h,N=g+h;(g<m.scrollTop||N>m.scrollTop+m.clientHeight)&&(m.scrollTop=g-m.clientHeight/2+h/2),k()},[d]);const x=l.useMemo(()=>t.split(`
5
- `).length,[t]),v=()=>{const m=[];for(let h=1;h<=x;h++)m.push(n.jsx("div",{className:`nc-csv-line-number ${d===h?"nc-csv-highlight":""}`,children:h},h));return n.jsx("div",{className:"nc-csv-gutter",ref:u,children:m})},y=m=>m?m.split(`
6
- `).map((g,N)=>{const A=g.split(" ");return n.jsxs("div",{className:`nc-csv-line ${d===N+1?"nc-csv-highlight":""}`,children:[A.map((E,L)=>n.jsxs("span",{children:[L>0&&n.jsx("span",{className:"nc-csv-tab-char",children:" "}),n.jsx("span",{style:{color:Oe[L%Oe.length]},children:E})]},L)),g===""&&`
7
- `]},N)}):null;return n.jsxs("div",{className:`nc-csv-textarea-container ${a?"nc-csv-with-gutter":""} ${o??""}`,style:i,children:[a&&v(),n.jsxs("div",{className:"nc-csv-textarea-editor",children:[n.jsx("div",{className:"nc-csv-textarea-backdrop",ref:w,children:n.jsx("pre",{className:"nc-csv-textarea-highlights",children:y(t)})}),n.jsx("textarea",{ref:f,className:"nc-csv-textarea-input",value:t,onChange:m=>{r(m.target.value),requestAnimationFrame(b)},onScroll:k,onSelect:b,onKeyUp:b,onClick:b,placeholder:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off"})]})]})});let le={notifications:[]};const Ne=new Set,Ge=new Map;function Se(){const e=le.notifications.slice();for(const t of Array.from(Ne))try{t(e)}catch{}}function Qt(e){Ne.add(e);try{e(le.notifications.slice())}catch{}return()=>{Ne.delete(e)}}function Zt(e){const t=`notification-${Date.now()}-${Math.random()}`,{duration:r,type:s,...o}=e,i={id:t,dismissible:!0,...o,type:s==="error"?"danger":s??"info",duration:r??5e3};return le.notifications=[i,...le.notifications],Se(),i.duration&&i.duration>0&&setTimeout(()=>{Je(t)},i.duration),t}function Je(e){const t=le.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,Se();const r=window.setTimeout(()=>{le.notifications=le.notifications.filter(s=>s.id!==e),Se(),Ge.delete(e)},300);Ge.set(e,r)}function en({type:e}){switch(e){case"success":return n.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:n.jsx("path",{d:"M5 10.5l3.1 3.1L15 6.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});case"danger":return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"10",cy:"10",r:"7",stroke:"currentColor",strokeWidth:"2"}),n.jsx("path",{d:"M10 6.5v4.25",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"13.75",r:"1",fill:"currentColor"})]});case"warning":return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M10 3.5 16 15H4L10 3.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),n.jsx("path",{d:"M10 7.5v3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"13.25",r:"1",fill:"currentColor"})]});default:return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"10",cy:"10",r:"7",stroke:"currentColor",strokeWidth:"2"}),n.jsx("path",{d:"M10 9v4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"6.5",r:"1",fill:"currentColor"})]})}}function Qe({notification:e}){const{t}=te.useTranslation(),r=e.type||"info",s=()=>{if(e.title)return e.title;switch(r){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},o=()=>{Je(e.id)};return n.jsx("div",{className:`nc-notification nc-notification-${r}`,children:n.jsxs("div",{className:"nc-notification-content",children:[n.jsx("div",{className:`nc-notification-icon nc-notification-icon-${r}`,children:n.jsx(en,{type:r})}),n.jsxs("div",{className:"nc-notification-body",children:[n.jsx("div",{className:"nc-notification-title",children:s()}),n.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&n.jsx("button",{className:"nc-notification-dismiss",onClick:o,"aria-label":t("common.close"),children:n.jsx(X.CloseIcon,{size:16})})]})})}function tn(){const[e,t]=l.useState([]),[r,s]=l.useState(new Map),[o,i]=l.useState(new Set),a=l.useRef(null),c=l.useRef([]);return l.useEffect(()=>Qt(p=>{const f=new Set(c.current.map(u=>u.id)),w=p.filter(u=>!f.has(u.id)).map(u=>u.id);w.length>0?(t(p),i(new Set(w)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(p),c.current=p}),[]),l.useEffect(()=>{if(!a.current)return;const d=new Map;let p=0;const f=a.current.children;e.forEach((w,u)=>{if(d.set(w.id,p),f[u]){const b=f[u].offsetHeight;w.isRemoving||(p+=b+12)}}),s(d)},[e]),n.jsx("div",{style:{position:"fixed",top:"24px",left:"24px",zIndex:9999,pointerEvents:"none",width:"min(340px, calc(100vw - 32px))"},children:n.jsx("div",{ref:a,style:{pointerEvents:"auto",position:"relative",width:"100%"},children:e.map(d=>{const p=o.has(d.id),f=d.isRemoving,w=r.get(d.id)||0;return n.jsx("div",{style:{position:"absolute",top:0,left:0,transform:p?`translate3d(-40px, ${w}px, 0)`:`translate3d(0, ${w}px, 0)`,transition:f?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:f?0:1,width:"100%"},children:n.jsx(Qe,{notification:d})},d.id)})})})}function Ze(e){return Zt(e)}const nn={show:e=>Ze(e)};function rn(e){const t=ht.createInstance(),r={};for(const o in e)r[o]={translation:e[o]};const s=typeof document<"u"&&document.documentElement.lang||"en";return t.init({resources:r,lng:s,fallbackLng:"en",interpolation:{escapeValue:!1}}),typeof MutationObserver<"u"&&typeof document<"u"&&new MutationObserver(i=>{for(const a of i)if(a.type==="attributes"&&a.attributeName==="lang"){const c=document.documentElement.lang||"en";t.changeLanguage(c)}}).observe(document.documentElement,{attributes:!0}),t}class sn{constructor(){ne(this,"apps",new Map)}register(t){this.apps.has(t.id)&&console.warn(`App "${t.id}" is already registered. Overwriting.`),this.apps.set(t.id,{...t,width:t.width??400,padding:t.padding??0})}unregister(t){this.apps.delete(t)}get(t){return this.apps.get(t)}list(){return Array.from(this.apps.values())}has(t){return this.apps.has(t)}}const de=new sn,Ye="nc-ui-app-state";class on{constructor(){ne(this,"state");ne(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem(Ye);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem(Ye,JSON.stringify(this.state))}catch{}}getActiveAppId(){return this.state.activeAppId}_setActiveAppId(t){this.state.activeAppId!==t&&(this.state.activeAppId=t,this.saveState(),this.notify("activeAppId",t))}subscribe(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{var s;(s=this.listeners.get(t))==null||s.delete(r)}}notify(t,r){var s;(s=this.listeners.get(t))==null||s.forEach(o=>o(r))}}const Q=new on;class cn{constructor(){ne(this,"apps",[]);ne(this,"activeAppId",null);ne(this,"listeners",new Set);ne(this,"refReadyResolvers",new Map)}async launchApp(t,r){const{launchInBackground:s=!1}=r||{};if(!de.has(t))return console.error(`Cannot launch app "${t}": not registered`),null;const o=this.apps.find(a=>a.appId===t);if(o)return s||(this.setActiveApp(t),Q._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,Q._setActiveAppId(t)),this.notify(),this.waitForRef(t)}waitForRef(t){return new Promise(r=>{const s=this.refReadyResolvers.get(t)||[];s.push(r),this.refReadyResolvers.set(t,s)})}setAppRef(t,r){const s=this.apps.find(i=>i.appId===t);if(!s){console.warn(`Cannot set ref for app "${t}": not running`);return}s.ref=r;const o=this.refReadyResolvers.get(t);o&&(o.forEach(i=>i(s)),this.refReadyResolvers.delete(t))}getApp(t){return this.apps.find(r=>r.appId===t)}closeApp(t){const r=this.apps.findIndex(o=>o.appId===t);if(r===-1)return;const s=this.apps[r];if(s.ref&&(s.ref=void 0),this.apps.splice(r,1),this.activeAppId===t){const o=window.innerWidth>=768;this.activeAppId=o&&this.apps.length>0?this.apps[this.apps.length-1].appId:null,Q._setActiveAppId(this.activeAppId)}this.notify()}setActiveApp(t){if(t!==null&&!this.apps.find(r=>r.appId===t)){console.warn(`Cannot activate app "${t}": not running`);return}this.activeAppId!==t&&(this.activeAppId=t,this.notify(),Q._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?de.get(this.activeAppId)??null:null}getRunningApps(){return[...this.apps]}isRunning(t){return this.apps.some(r=>r.appId===t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){this.listeners.forEach(t=>t())}}const q=new cn,Me=l.createContext(null);function et(){const e=l.useContext(Me);if(!e)throw new Error("useApp must be used inside an App");return e}function an({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M19 12H5"}),n.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function tt({title:e,onClose:t,onBack:r,toolbar:s,hideBackButton:o}){const i=r&&!o;return n.jsxs("div",{className:"nc-app-title-bar",children:[n.jsxs("div",{className:"nc-app-title-bar-left",children:[i&&n.jsx("button",{className:"nc-app-title-bar-back",onClick:r,title:"Back","aria-label":"Go back",children:n.jsx(an,{size:16})}),n.jsx("span",{className:"nc-app-title-bar-title",children:e})]}),n.jsxs("div",{className:"nc-app-title-bar-right",children:[s&&n.jsx("div",{className:"nc-app-title-bar-toolbar",children:s}),n.jsx(Re,{onClick:t,"aria-label":"Close application"})]})]})}class ln extends l.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error(`Error loading app ${this.props.appId}:`,t,r)}render(){return this.state.hasError?n.jsxs("div",{className:"nc-app-error",children:[n.jsx("div",{children:"Failed to load app"}),this.state.error&&n.jsx("div",{style:{fontSize:"12px",opacity:.7},children:this.state.error.message})]}):this.props.children}}function Ie({appId:e,isActive:t,onClose:r}){const{t:s}=te.useTranslation(),o=de.get(e),[i,a]=l.useState(""),[c,d]=l.useState(null),[p,f]=l.useState(null),[w,u]=l.useState(!1),[b,k]=l.useState(!1);l.useEffect(()=>{o!=null&&o.titleKey&&a(s(o.titleKey))},[o,s]);const x=l.useCallback(S=>{a(S)},[]),v=l.useCallback(S=>{d(()=>S)},[]),y=l.useCallback(()=>{d(null)},[]),m=l.useCallback(S=>{f(S)},[]),h=l.useCallback(()=>{f(null)},[]),g=l.useCallback(S=>{u(S)},[]),N=l.useCallback(S=>{k(S)},[]),A=l.useMemo(()=>({setTitle:x,setBackHandler:v,clearBackHandler:y,setToolbar:m,clearToolbar:h,setHideBackButton:g,setHideTitleBar:N,close:r}),[x,v,y,m,h,g,N,r]);if(!o)return null;const E=o.component,L=!o.hideTitleBar&&!b;return n.jsxs("div",{className:`nc-app-container${t?"":" nc-hidden"}`,children:[L&&n.jsx(tt,{title:i,onClose:r,onBack:c??void 0,toolbar:p,hideBackButton:w}),n.jsx("div",{className:"nc-app-content-wrapper",style:{padding:o.padding,overflowY:L?"auto":void 0},children:n.jsx(Me.Provider,{value:A,children:n.jsx(ln,{appId:e,children:n.jsx(l.Suspense,{fallback:n.jsx("div",{className:"nc-app-loading",children:n.jsx(Ce,{})}),children:n.jsx(E,{})})})})})]})}const ye=768,je=1024,nt={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},rt=l.createContext(nt);function dn({children:e}){const[t,r]=l.useState(()=>{if(typeof window>"u")return nt;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ye,isTablet:s>=ye&&s<je,isDesktop:s>=je,width:s,height:o}});return l.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;r({isMobile:o<ye,isTablet:o>=ye&&o<je,isDesktop:o>=je,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),n.jsx(rt.Provider,{value:t,children:e})}function $e(){return l.useContext(rt)}const Ee="-",un=e=>{const t=fn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:a=>{const c=a.split(Ee);return c[0]===""&&c.length!==1&&c.shift(),st(c,t)||pn(a)},getConflictingClassGroupIds:(a,c)=>{const d=r[a]||[];return c&&s[a]?[...d,...s[a]]:d}}},st=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),o=s?st(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Ee);return(a=t.validators.find(({validator:c})=>c(i)))==null?void 0:a.classGroupId},Ke=/^\[(.+)\]$/,pn=e=>{if(Ke.test(e)){const t=Ke.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},fn=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return mn(Object.entries(e.classGroups),r).forEach(([i,a])=>{Ae(a,s,i,t)}),s},Ae=(e,t,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:_e(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(hn(o)){Ae(o(s),t,r,s);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{Ae(a,_e(t,i),r,s)})})},_e=(e,t)=>{let r=e;return t.split(Ee).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},hn=e=>e.isThemeGetter,mn=(e,t)=>t?e.map(([r,s])=>{const o=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,c])=>[t+a,c])):i);return[r,o]}):e,gn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,s=new Map;const o=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,s=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=s.get(i))!==void 0)return o(i,a),a},set(i,a){r.has(i)?r.set(i,a):o(i,a)}}},ot="!",bn=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,o=t[0],i=t.length,a=c=>{const d=[];let p=0,f=0,w;for(let v=0;v<c.length;v++){let y=c[v];if(p===0){if(y===o&&(s||c.slice(v,v+i)===t)){d.push(c.slice(f,v)),f=v+i;continue}if(y==="/"){w=v;continue}}y==="["?p++:y==="]"&&p--}const u=d.length===0?c:c.substring(f),b=u.startsWith(ot),k=b?u.substring(1):u,x=w&&w>f?w-f:void 0;return{modifiers:d,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:x}};return r?c=>r({className:c,parseClassName:a}):a},xn=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(s=>{s[0]==="["?(t.push(...r.sort(),s),r=[]):r.push(s)}),t.push(...r.sort()),t},vn=e=>({cache:gn(e.cacheSize),parseClassName:bn(e),...un(e)}),wn=/\s+/,yn=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(wn);let c="";for(let d=a.length-1;d>=0;d-=1){const p=a[d],{modifiers:f,hasImportantModifier:w,baseClassName:u,maybePostfixModifierPosition:b}=r(p);let k=!!b,x=s(k?u.substring(0,b):u);if(!x){if(!k){c=p+(c.length>0?" "+c:c);continue}if(x=s(u),!x){c=p+(c.length>0?" "+c:c);continue}k=!1}const v=xn(f).join(":"),y=w?v+ot:v,m=y+x;if(i.includes(m))continue;i.push(m);const h=o(x,k);for(let g=0;g<h.length;++g){const N=h[g];i.push(y+N)}c=p+(c.length>0?" "+c:c)}return c};function jn(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=it(t))&&(s&&(s+=" "),s+=r);return s}const it=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=it(e[s]))&&(r&&(r+=" "),r+=t);return r};function kn(e,...t){let r,s,o,i=a;function a(d){const p=t.reduce((f,w)=>w(f),e());return r=vn(p),s=r.cache.get,o=r.cache.set,i=c,c(d)}function c(d){const p=s(d);if(p)return p;const f=yn(d,r);return o(d,f),f}return function(){return i(jn.apply(null,arguments))}}const O=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},ct=/^\[(?:([a-z-]+):)?(.+)\]$/i,Nn=/^\d+\/\d+$/,Sn=new Set(["px","full","screen"]),An=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Rn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,In=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ee=e=>pe(e)||Sn.has(e)||Nn.test(e),re=e=>fe(e,"length",Dn),pe=e=>!!e&&!Number.isNaN(Number(e)),ke=e=>fe(e,"number",pe),ge=e=>!!e&&Number.isInteger(Number(e)),$n=e=>e.endsWith("%")&&pe(e.slice(0,-1)),R=e=>ct.test(e),se=e=>An.test(e),En=new Set(["length","size","percentage"]),Tn=e=>fe(e,En,at),Pn=e=>fe(e,"position",at),Ln=new Set(["image","url"]),Bn=e=>fe(e,Ln,Vn),zn=e=>fe(e,"",Wn),be=()=>!0,fe=(e,t,r)=>{const s=ct.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},Dn=e=>Cn.test(e)&&!Rn.test(e),at=()=>!1,Wn=e=>Mn.test(e),Vn=e=>In.test(e),Hn=()=>{const e=O("colors"),t=O("spacing"),r=O("blur"),s=O("brightness"),o=O("borderColor"),i=O("borderRadius"),a=O("borderSpacing"),c=O("borderWidth"),d=O("contrast"),p=O("grayscale"),f=O("hueRotate"),w=O("invert"),u=O("gap"),b=O("gradientColorStops"),k=O("gradientColorStopPositions"),x=O("inset"),v=O("margin"),y=O("opacity"),m=O("padding"),h=O("saturate"),g=O("scale"),N=O("sepia"),A=O("skew"),E=O("space"),L=O("translate"),S=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",R,t],C=()=>[R,t],P=()=>["",ee,re],W=()=>["auto",pe,R],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",R],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[pe,R];return{cacheSize:500,separator:":",theme:{colors:[be],spacing:[ee,re],blur:["none","",se,R],brightness:B(),borderColor:[e],borderRadius:["none","","full",se,R],borderSpacing:C(),borderWidth:P(),contrast:B(),grayscale:V(),hueRotate:B(),invert:V(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[$n,re],inset:j(),margin:j(),opacity:B(),padding:C(),saturate:B(),scale:B(),sepia:V(),skew:B(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",R]}],container:["container"],columns:[{columns:[se]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),R]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ge,R]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",R]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",ge,R]}],"grid-cols":[{"grid-cols":[be]}],"col-start-end":[{col:["auto",{span:["full",ge,R]},R]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[be]}],"row-start-end":[{row:["auto",{span:[ge,R]},R]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",R]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",R]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",R,t]}],"min-w":[{"min-w":[R,t,"min","max","fit"]}],"max-w":[{"max-w":[R,t,"none","full","min","max","fit","prose",{screen:[se]},se]}],h:[{h:[R,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[R,t,"auto","min","max","fit"]}],"font-size":[{text:["base",se,re]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ke]}],"font-family":[{font:[be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",R]}],"line-clamp":[{"line-clamp":["none",pe,ke]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ee,R]}],"list-image":[{"list-image":["none",R]}],"list-style-type":[{list:["none","disc","decimal",R]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ee,re]}],"underline-offset":[{"underline-offset":["auto",ee,R]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",R]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),Pn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Tn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Bn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[ee,R]}],"outline-w":[{outline:[ee,re]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ee,re]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",se,zn]}],"shadow-color":[{shadow:[be]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",se,R]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[w]}],saturate:[{saturate:[h]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[w]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[h]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",R]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",R]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",R]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[g]}],"scale-x":[{"scale-x":[g]}],"scale-y":[{"scale-y":[g]}],rotate:[{rotate:[ge,R]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",R]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",R]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",R]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ee,re,ke]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Fn=kn(Hn);function lt(...e){return Fn(mt.clsx(e))}function On({autoWidth:e=!0,className:t,style:r}){const[s,o]=l.useState(()=>Q.getActiveAppId()),[i,a]=l.useState(()=>q.getRunningApps()),{isMobile:c}=$e();l.useEffect(()=>{const v=Q.subscribe("activeAppId",y=>{o(y)});return()=>{v()}},[]),l.useEffect(()=>q.subscribe(()=>{a(q.getRunningApps())}),[]),l.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const m=Q.getActiveAppId();m&&!q.isRunning(m)&&q.launchApp(m)}},[]);const d=v=>{q.closeApp(v)},p=s?de.get(s):null,w=(p==null?void 0:p.width)??400,u=s!==null,x={...{overflow:"hidden",display:u?"flex":"none",flexDirection:"column",flexShrink:0,...e&&u?{width:c?"100%":w}:{}},...r};return n.jsx("div",{className:lt("nc-app-panel",t),style:x,children:i.map(v=>n.jsx(Ie,{appId:v.appId,isActive:s===v.appId,onClose:()=>d(v.appId)},v.appId))})}function Gn({pinnedAppIds:e,className:t="",showIndicators:r=!0,side:s="left",getBadge:o}){const{t:i}=te.useTranslation(),{isMobile:a}=$e(),[c,d]=l.useState(()=>Q.getActiveAppId()),[p,f]=l.useState(()=>q.getRunningApps());l.useEffect(()=>{const h=Q.subscribe("activeAppId",g=>{d(g)});return()=>{h()}},[]),l.useEffect(()=>q.subscribe(()=>{f(q.getRunningApps())}),[]);const w=h=>{c===h?q.setActiveApp(null):q.launchApp(h)},u=e.map(h=>de.get(h)).filter(h=>!!h),b=p.filter(h=>!e.includes(h.appId)).map(h=>({running:h,def:de.get(h.appId)})).filter(h=>!!h.def),k=h=>p.some(g=>g.appId===h),x=h=>h.titleKey?String(i(h.titleKey)):h.id,v=h=>typeof h=="number"&&h>99?"99+":h,y=(h,g)=>{const N=o==null?void 0:o(h,g);return N?n.jsx("span",{className:`nc-app-taskbar-badge nc-${N.tone??"default"}`,"aria-label":N.ariaLabel,children:v(N.content)}):null},m=a?24:28;return n.jsxs("div",{className:`nc-app-taskbar ${a?"nc-mobile":"nc-desktop"} nc-${s} ${t}`,children:[u.map(h=>{const g=h.icon,N=c===h.id,A=k(h.id),E={isActive:N,isRunning:A,isPinned:!0};return n.jsxs("button",{className:`nc-app-taskbar-button ${N?"nc-active":""} ${A?"nc-running":""}`,onClick:()=>w(h.id),title:x(h),children:[n.jsx(g,{size:m}),y(h,E),r&&A&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},h.id)}),b.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),b.map(({running:h,def:g})=>{const N=g.icon,A=c===h.appId,E={isActive:A,isRunning:!0,isPinned:!1};return n.jsxs("button",{className:`nc-app-taskbar-button ${A?"nc-active":""} nc-running`,onClick:()=>w(h.appId),title:x(g),children:[n.jsx(N,{size:m}),y(g,E),r&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},h.appId)})]})}function Yn({appId:e,open:t,onClose:r,closeOnBackdrop:s=!1,className:o="",style:i}){const a=d=>{s&&d.target===d.currentTarget&&r()};if(!t)return null;const c=n.jsx("div",{className:"nc-dialog-overlay nc-fullscreen",onClick:a,children:n.jsx("div",{className:`nc-app-dialog-container ${o}`,style:i,onClick:d=>d.stopPropagation(),children:n.jsx(Ie,{appId:e,isActive:!0,onClose:r})})});return ve.createPortal(c,document.body)}const Te=l.createContext(null),dt=l.createContext(null);function Kn(){const e=l.useContext(Te);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function _n(){const e=l.useContext(dt);if(!e)throw new Error("useNavView must be used within NavStack");return e}const Pe=l.createContext(null);function Un({rootView:e,children:t}){const{t:r}=te.useTranslation(),s=et(),[o,i]=l.useState([e]),[a,c]=l.useState([null]),d=l.useCallback((g,N)=>{c(A=>{const E=[...A];return E[g]=N,E})},[]),p=l.useCallback(g=>{c(N=>{const A=[...N];return A[g]=null,A})},[]),f=l.useCallback(g=>{i(N=>[...N,g]),c(N=>[...N,null])},[]),w=l.useCallback(()=>{i(g=>g.length<=1?g:g.slice(0,-1)),c(g=>g.slice(0,-1))},[]),u=l.useCallback(()=>{i([e]),c([null])},[e]),b=o.length,k=b>1,x=o.length-1,v=o[o.length-1],y=v!=null&&v.titleKey?r(v.titleKey):(v==null?void 0:v.title)??"";l.useEffect(()=>{s.setTitle(y)},[y,s]),l.useEffect(()=>{k?s.setBackHandler(w):s.clearBackHandler()},[k,w,s]),l.useEffect(()=>{const g=a[a.length-1];g?s.setToolbar(g):s.clearToolbar()},[a,s]);const m={push:f,pop:w,reset:u,depth:b,canGoBack:k,currentTitle:y},h={stack:o,toolbarStack:a,updateToolbar:d,clearToolbarAt:p,topIndex:x};return n.jsx(Te.Provider,{value:m,children:n.jsx(Pe.Provider,{value:h,children:t})})}function qn({index:e,children:t}){const r=l.useContext(Pe);if(!r)throw new Error("NavViewProvider must be used within NavStackProvider");const{updateToolbar:s,clearToolbarAt:o,topIndex:i}=r,a=l.useCallback(p=>{e===i&&s(e,p)},[e,i,s]),c=l.useCallback(()=>{e===i&&o(e)},[e,i,o]),d={setToolbar:a,clearToolbar:c};return n.jsx(dt.Provider,{value:d,children:t})}function Xn(){const e=l.useContext(Te),t=l.useContext(Pe);if(!e||!t)throw new Error("NavStackContainer must be used within a NavStackProvider");const{stack:r}=t;return n.jsx("div",{className:"nav-stack-container",children:n.jsx("div",{className:"nav-stack-content",children:r.map((s,o)=>{const i=o===r.length-1;return n.jsx(qn,{index:o,children:n.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.ActivityIndicator=Ce;exports.Alert=bt;exports.AppContainer=Ie;exports.AppContext=Me;exports.AppDialog=Yn;exports.AppPanel=On;exports.AppTaskbar=Gn;exports.AppTitleBar=tt;exports.Battery=xt;exports.Button=J;exports.ButtonGroup=vt;exports.Checkbox=yt;exports.CloseButton=Re;exports.ComboBox=At;exports.ContextMenu=$t;exports.CsvTextArea=Jt;exports.Dialog=Et;exports.DialogClose=ae;exports.EditButton=Rt;exports.Hyperlink=It;exports.Input=Lt;exports.ListGroup=zt;exports.ListGroupItem=Bt;exports.MonthRangePicker=Wt;exports.MultiSelect=Dt;exports.NavStackContainer=Xn;exports.NavStackProvider=Un;exports.Notification=Qe;exports.NotificationContainer=tn;exports.NumberInput=Ft;exports.RefreshButton=Ct;exports.Slider=Ot;exports.TabPanel=Xe;exports.TabPanels=Yt;exports.Tabs=Kt;exports.Toggle=_t;exports.TrashButton=Mt;exports.ViewportProvider=dn;exports.appRegistry=de;exports.appStateStore=Q;exports.cn=lt;exports.createAppI18nFactory=rn;exports.notificationManager=nn;exports.runningAppsStore=q;exports.showNotification=Ze;exports.useApp=et;exports.useDialog=qe;exports.useNavStack=Kn;exports.useNavView=_n;exports.useViewport=$e;
1
+ "use strict";var bt=Object.defineProperty;var vt=(e,t,r)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var re=(e,t,r)=>vt(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),U=require("./GeneratedIcons-LGFRi6GT.cjs"),l=require("react"),fe=require("react-dom"),J=require("react-i18next"),xt=require("i18next"),wt=require("./clsx-C11secjj.cjs");function Re({size:e="default",color:t,overlay:r=!1,className:s=""}){const o=n.jsx("svg",{className:`nc-activity-indicator nc-${e} ${s}`,viewBox:"0 0 50 50",style:t?{color:t}:void 0,children:n.jsx("circle",{className:"nc-activity-indicator-circle",cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round"})});return r?n.jsx("div",{className:"nc-activity-indicator-overlay",children:o}):o}function q({variant:e="default",block:t,size:r="default",appearance:s="default",className:o,disabled:i,textSelectable:c,loading:a,onClick:d,children:u,...p}){const x=["nc-button",e!=="default"?`nc-${e}`:"",t?"nc-block":"",r==="small"?"nc-small":"",r==="large"?"nc-large":"",s==="transparent"?"nc-transparent":"",i||a?"nc-disabled":"",c?"nc-text-selectable":"",a?"nc-loading":"",o??""].filter(Boolean).join(" "),f=m=>{if(!a){if(c){const N=window.getSelection();if(N&&N.toString().length>0)return}d==null||d(m)}};return n.jsxs("button",{className:x,disabled:i||a,onClick:f,...p,children:[a&&n.jsx(Re,{size:"small",className:"nc-button-spinner",color:s==="transparent"||e!=="default"&&e!=="ghost"?"white":void 0}),u]})}const yt={info:"primary",success:"success",warning:"warning",error:"danger",danger:"danger"};function kt({code:e,text:t,type:r,button:s,onAction:o,children:i,onClose:c,className:a="",style:d}){const u=i??n.jsxs(n.Fragment,{children:[e!==void 0&&n.jsx("span",{className:"nc-alert-code",children:e}),t]});return n.jsxs("div",{className:`nc-alert nc-${r} ${a}`.trim(),style:d,children:[n.jsxs("div",{className:"nc-alert-main",children:[n.jsx("div",{className:`nc-alert-message nc-${r}`,children:u}),c&&n.jsx("button",{type:"button",className:"nc-alert-close","aria-label":"Close alert",onClick:c,children:n.jsx(U.CloseIcon,{size:16})})]}),s&&n.jsx("span",{className:"nc-alert-action",children:n.jsx(q,{size:"small",variant:s.variant??yt[r],onClick:o,children:s.text})})]})}function jt({percentage:e=.5,status:t="discharging",darkMode:r=!1,colored:s=!1}){const o=Math.max(0,Math.min(1,Number(e)||0)),i=o===0?"-":String(Math.round(o*100));let c;s?o<.1?c="var(--nc-danger)":o<.2?c="var(--nc-warning)":c="var(--nc-success)":c=r?"rgba(255,255,255,0.35)":"#000000";const a="var(--nc-battery-shell-bg)",d=24,u=14,p=2,x=0,f=12,m=0,N=0,v=0,w=d,y=u,g=y-m*2,h=w-m*2,b=Math.max(1,Math.min(4,y/4)),S=o===0?0:.05+o*.95,R=d+p+f,L=20,D=.65,j=Math.max(u,L*D),M=d+p+1,k=(u-L*D)/2;return n.jsxs("svg",{className:"nc-battery",width:R,height:j,viewBox:`0 0 ${R} ${j}`,role:"img","aria-label":`Battery ${i==="-"?"-":`${i}%`} ${t}`,children:[n.jsx("defs",{children:n.jsx("mask",{id:`nc-battery-fill-mask-${o}`,children:n.jsx("rect",{x:"0",y:"0",width:h*S,height:g,fill:"white"})})}),n.jsx("rect",{x:N,y:v,rx:b,ry:b,width:w,height:y,fill:a}),n.jsx("rect",{x:N+m,y:v+m,width:h,height:g,fill:c,rx:b,ry:b,mask:`url(#nc-battery-fill-mask-${o})`}),n.jsx("text",{x:N+w/2,y:u-3,fontSize:11,fontWeight:"bold",fill:"var(--nc-battery-text-contrast)",textAnchor:"middle",children:i}),n.jsx("rect",{x:d+x,y:u*.26,width:p,height:u*.48,rx:.8,ry:.8,fill:o===1?c:a}),t==="charging"?n.jsx("g",{transform:`translate(${M}, ${k}) scale(${D})`,fill:c,children:n.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})}function Nt({value:e,onChange:t,options:r,disabled:s,size:o="default"}){return n.jsx("div",{className:`nc-button-group ${o==="small"?"nc-small":o==="tiny"?"nc-tiny":""}`,children:r.map(i=>{const c=s||!!i.disabled;return n.jsx("button",{type:"button",className:`nc-button-group-item ${e===i.key?"nc-active":""}`,onClick:()=>!c&&t(i.key),disabled:c,children:i.label},i.key)})})}function St({size:e}){return n.jsx("svg",{className:`nc-checkbox-icon ${e==="small"?"nc-small":e==="tiny"?"nc-tiny":""}`,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M2 6L5 9L10 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ct({checked:e,onChange:t,disabled:r,label:s,size:o="default",labelColor:i,style:c,className:a=""}){const d=o==="small",u=o==="tiny";return n.jsxs("label",{className:`nc-checkbox-label ${d?"nc-small":""} ${u?"nc-tiny":""} ${r?"nc-disabled":""} ${a}`.trim(),style:c,onClick:p=>{r||(p.preventDefault(),t(!e))},children:[n.jsx("span",{role:"checkbox","aria-checked":e,tabIndex:0,className:`nc-checkbox-box ${d?"nc-small":""} ${u?"nc-tiny":""} ${e?"nc-checked":""}`,onKeyDown:p=>{r||(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),t(!e))},children:e&&n.jsx(St,{size:o})}),s&&n.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function At({option:e,onChange:t,selected:r,highlighted:s,small:o,renderOption:i,index:c}){const a=l.useRef(null),{t:d}=J.useTranslation(),u=e.disabled===!0;return l.useEffect(()=>{s&&a.current&&a.current.scrollIntoView({block:"nearest"})},[s]),n.jsx("div",{ref:a,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${s?"nc-highlighted":""} ${u?"nc-disabled":""}`,role:"option",onClick:()=>{u||t(e.value,e.label)},"aria-selected":r,"aria-disabled":u,style:{cursor:u?"default":"pointer",opacity:u?.4:void 0,background:s&&!u?"rgba(59,130,246,0.18)":r&&!u?"rgba(59,130,246,0.12)":void 0},children:i?i(e,c,!!s):n.jsxs(n.Fragment,{children:[e.label,e.default&&n.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",d("common.default"),")"]})]})})}function Rt({isOpen:e,options:t,onSelect:r,selectedValue:s,placement:o="bottom",anchorRef:i,small:c,highlightedIndex:a=-1,renderOption:d}){const[u,p]=l.useState({top:0,left:0,width:0}),[x,f]=l.useState(o),{t:m}=J.useTranslation();if(l.useEffect(()=>{if(e&&i.current){const v=i.current.getBoundingClientRect();let w=o;if(o==="bottom"){const y=window.innerHeight-v.bottom,g=v.top;y<320&&g>y&&(w="top")}f(w),p({top:w==="top"?v.top-4:v.bottom+4,left:v.left,width:v.width})}},[e,i,o]),!e)return null;const N=n.jsx("div",{className:"nc-combo-dropdown",onMouseDown:v=>v.stopPropagation(),style:{position:"fixed",top:x==="top"?void 0:u.top,bottom:x==="top"?window.innerHeight-u.top:void 0,left:u.left,width:u.width,zIndex:1e3,maxHeight:300,overflowY:"auto"},children:t.length===0?n.jsx("div",{className:`nc-combo-dropdown-option nc-no-results ${c?"nc-small":""}`,children:m("common.noResults")}):t.map((v,w)=>n.jsx(At,{option:v,onChange:r,selected:v.value===s,highlighted:w===a,small:c,renderOption:d,index:w},v.value))});return fe.createPortal(N,document.body)}function Et({onClick:e,small:t}){return n.jsx("span",{role:"button",tabIndex:0,className:`nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:r=>{r.stopPropagation(),e()},onMouseDown:r=>r.stopPropagation(),onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),e())},"aria-label":"Clear selection",children:"✕"})}function Mt({open:e,small:t}){return n.jsx("span",{"aria-hidden":!0,className:`nc-combo-button nc-combo-toggle ${t?"nc-small":""} ${e?"nc-open":""}`,children:"▾"})}function It({value:e,onChange:t,placeholder:r="Select…",options:s,candidates:o,renderOption:i,renderSelected:c,selectedOption:a,disabled:d,label:u,clearable:p=!0,allowTyping:x=!1,placement:f="bottom",size:m="default",appearance:N="default",textAlign:v="left",style:w,className:y}){const[g,h]=l.useState(!1),[b,S]=l.useState(""),[R,L]=l.useState(-1),D=l.useRef(null),j=l.useRef(null),M=l.useRef(null),k=m==="small",{t:A}=J.useTranslation(),$=!!o,V=x||$,[I,T]=l.useState([]),[H,C]=l.useState(()=>{if(s&&e){const B=s.find(O=>O.value===e);return B?B.label:""}return o&&e?e:""});l.useEffect(()=>{if(!e){C("");return}if(s){const B=s.find(O=>O.value===e);B&&C(B.label)}else o&&C(e)},[e,s,o]);const E=(B,O=!1)=>{if(!o)return;M.current&&clearTimeout(M.current);const F=async()=>{try{const K=await o(B);T(K),L(-1)}catch{T([])}};O?F():M.current=setTimeout(F,200)},W=l.useMemo(()=>{if($)return I;const B=b.toLowerCase();return V?(s||[]).filter(O=>O.label.toLowerCase().includes(B)):s||[]},[s,b,V,$,I]);l.useEffect(()=>{g&&L(-1)},[g,W]),l.useEffect(()=>{if(!p&&!e&&s&&s.length>0&&t){const B=s.find(O=>O.default)||s[0];t(B.value)}},[p,e,s,t]),l.useEffect(()=>{function B(O){var F;O.target instanceof Node&&D.current&&((F=D.current.parentElement)!=null&&F.contains(O.target)||h(!1))}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const z=a??(s?s.find(B=>B.value===e):e?{label:H,value:e}:void 0),_=z&&p,ee=!d&&!_,ue=`nc-align-${v}`,ie=!(g&&V)&&!!z,ce=(B,O,F=!1)=>{var K;C(O),t==null||t(B),h(!1),S(""),F&&((K=D.current)==null||K.blur())},me=()=>{t==null||t(void 0),S(""),h(!1)},ge=B=>{if(!g){(B.key==="ArrowDown"||B.key==="ArrowUp")&&(h(!0),B.preventDefault());return}const O=(F,K)=>{if(K===1){for(let G=F;G<W.length;G++)if(!W[G].disabled)return G;for(let G=0;G<F;G++)if(!W[G].disabled)return G}else{for(let G=F;G>=0;G--)if(!W[G].disabled)return G;for(let G=W.length-1;G>F;G--)if(!W[G].disabled)return G}return F};switch(B.key){case"ArrowDown":B.preventDefault(),L(F=>{const K=F+1,G=K>=W.length?0:K;return O(G,1)});break;case"ArrowUp":B.preventDefault(),L(F=>{const K=F-1,G=K<0?W.length-1:K;return O(G,-1)});break;case"Enter":B.preventDefault(),R>=0&&R<W.length&&!W[R].disabled&&ce(W[R].value,W[R].label,!0);break;case"Escape":B.preventDefault(),h(!1),S("");break}};return n.jsxs("div",{className:`nc-combo-container ${N==="transparent"?"nc-transparent":""} ${N==="plain"?"nc-plain":""} ${g?"nc-open":""} ${ue} ${y||""}`.trim(),style:{position:"relative",...w},children:[u&&n.jsx("span",{className:`nc-label ${k?"nc-small":""}`,children:u}),n.jsxs("div",{ref:j,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:B=>{if(d||V&&B.target===D.current)return;const O=!g;if(h(F=>(!F&&V&&z&&S(z.label),!F)),$&&O){const F=V&&z?z.label:"";T([]),setTimeout(()=>E(F,!0),0)}V&&!g&&setTimeout(()=>{var F,K;(F=D.current)==null||F.focus(),(K=D.current)==null||K.select()},0)},children:[n.jsx("input",{ref:D,className:`nc-input ${k?"nc-small":""} ${ie?"nc-value-under-overlay":""}`.trim(),placeholder:r,onFocus:()=>{if(!d&&V){h(!0);const B=z?z.label:"";z&&(S(B),setTimeout(()=>{var O;return(O=D.current)==null?void 0:O.select()},0)),$&&(T([]),E(B,!0))}},onChange:B=>{const O=B.target.value;V&&(S(O),$&&E(O))},onKeyDown:ge,value:g&&V?b:(z==null?void 0:z.label)||"",readOnly:d||!V,style:{width:"100%",paddingRight:ee||_?k?32:44:12,caretColor:x?void 0:"transparent",cursor:x?void 0:"pointer",userSelect:ie?"none":void 0,color:ie?"transparent":"var(--nc-text)"}}),ie&&n.jsx("div",{"aria-hidden":!0,className:`nc-combo-overlay ${ue}`,style:{position:"absolute",left:k?8:12,right:ee||_?k?12:24:k?8:12,top:"50%",transform:"translateY(-50%)",userSelect:"text",cursor:x?void 0:"pointer",display:"flex",alignItems:"center",gap:6},children:c&&z?c(z):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`nc-combo-overlay-text ${k?"nc-small":""}`,children:z==null?void 0:z.label}),(z==null?void 0:z.default)&&n.jsxs("span",{className:`nc-combo-overlay-default ${k?"nc-small":""}`,children:["(",A("common.default"),")"]})]})}),_&&n.jsx(Et,{onClick:me,small:k}),ee&&n.jsx(Mt,{open:g,small:k})]}),n.jsx(Rt,{isOpen:g,options:W,onSelect:ce,selectedValue:e,placement:f,anchorRef:j,small:k,highlightedIndex:R,renderOption:i})]})}function Pt({onClick:e,loading:t=!1,disabled:r=!1,size:s="default",title:o,"aria-label":i}){const c=s==="small"?14:s==="large"?20:18,a=t?"Refreshing...":"Refresh",d=t?"Refreshing":"Refresh";return n.jsx("button",{className:"nc-icon-button",onClick:e,disabled:r||t,title:o??a,"aria-label":i??d,"data-size":s,children:n.jsx(U.RefreshIcon,{size:c,className:t?"nc-spinning":""})})}function Ee({onClick:e,disabled:t=!1,size:r="default",title:s="Close","aria-label":o="Close"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-close",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(U.CloseIcon,{size:i})})}function $t({onClick:e,disabled:t=!1,size:r="default",title:s="Edit","aria-label":o="Edit"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-edit",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(U.EditIcon,{size:i})})}function Tt({onClick:e,disabled:t=!1,size:r="default",title:s="Delete","aria-label":o="Delete"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-trash",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(U.TrashIcon,{size:i})})}function Lt({onClick:e,disabled:t=!1,children:r,title:s,"aria-label":o,size:i="default"}){return n.jsx("button",{className:"nc-hyperlink",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":i,children:r})}function zt({open:e,onClose:t,options:r,anchorRef:s,anchor:o,preferredDirection:i="down"}){const c=l.useRef(null),[a,d]=l.useState({top:0,left:0}),u=o||(s==null?void 0:s.current);if(l.useEffect(()=>{if(!e||!u||!c.current)return;const f=u.getBoundingClientRect(),m=c.current.getBoundingClientRect(),N=window.innerHeight,v=window.innerWidth,w=f.bottom+8,y=w+m.height<=N-8;let g=i;(!y&&i==="down"||i==="up"&&y)&&(g="up");let h;g==="down"?h=w:h=f.top-m.height-8;let b=f.left;b+m.width>v-8&&(b=f.right-m.width),d({top:Math.max(8,h),left:Math.max(8,b)})},[e,u,i]),l.useEffect(()=>{if(!e)return;const f=N=>{c.current&&!c.current.contains(N.target)&&u&&!u.contains(N.target)&&t()},m=N=>{N.key==="Escape"&&t()};return document.addEventListener("mousedown",f),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",m)}},[e,t,u]),!e)return null;const p=f=>{f.type!=="separator"&&!f.disabled&&f.onClick&&(f.onClick(),t())},x=r.some(f=>f.icon);return fe.createPortal(n.jsx("div",{ref:c,className:"nc-context-menu",style:{position:"fixed",top:`${a.top}px`,left:`${a.left}px`,zIndex:1e4},role:"menu",children:r.map(f=>{if(f.type==="separator")return n.jsx("div",{className:"nc-context-menu-separator",role:"separator"},f.id);const m=["nc-context-menu-item",f.variant&&f.variant!=="default"?`nc-${f.variant}`:"",f.disabled?"nc-disabled":"",x&&!f.icon?"nc-indented":""].filter(Boolean).join(" ");return n.jsxs("button",{className:m,onClick:()=>p(f),disabled:f.disabled,role:"menuitem",children:[f.icon&&n.jsx("span",{className:"nc-context-menu-icon",children:f.icon}),n.jsx("span",{className:"nc-context-menu-label",children:f.label})]},f.id)})}),document.body)}const Qe=l.createContext(null);function Ze(){const e=l.useContext(Qe);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function ae({children:e,onClick:t,...r}){const{close:s}=Ze(),{t:o}=J.useTranslation(),i=c=>{t==null||t(c),s()};return n.jsx(q,{onClick:i,...r,children:e??o("common.close")})}function Bt({open:e,onClose:t,title:r,children:s,style:o,footerType:i="ok-cancel",footer:c,onOk:a,onSave:d,onDelete:u,onCancel:p,onConnect:x,closeOnOverlay:f=!0,primaryDisabled:m=!1,fullScreen:N=!1,hideTitleBar:v=!1,className:w="",onContentHeightChange:y}){const g=l.useRef(null),h=l.useRef(null),{t:b}=J.useTranslation(),S={close:t},R=j=>{f&&j.target===j.currentTarget&&t()};if(l.useEffect(()=>{e&&g.current&&g.current.focus()},[e]),l.useEffect(()=>{if(!y||!h.current)return;const j=new ResizeObserver(M=>{for(const k of M){const A=k.contentRect.height;y(A)}});return j.observe(h.current),()=>{j.disconnect()}},[y]),!e)return null;const L=()=>{switch(i){case"ok":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(q,{variant:"primary",onClick:a??t,disabled:m,children:b("common.ok")})});case"ok-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:p,children:b("common.cancel")}),n.jsx(q,{variant:"primary",onClick:a??t,disabled:m,children:b("common.ok")})]});case"save-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:p,children:b("common.cancel")}),n.jsx(q,{variant:"primary",onClick:d,disabled:m,children:b("common.save")})]});case"delete-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:p,children:b("common.cancel")}),n.jsx(q,{variant:"danger",onClick:u,disabled:m,children:b("common.delete")})]});case"connect":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:p,children:b("common.cancel")}),n.jsx(q,{variant:"primary",onClick:x,disabled:m,children:b("common.connect")})]});case"close":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(ae,{variant:"primary"})});case"gotit":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(ae,{variant:"primary",children:b("common.gotit")})});case"custom":return n.jsx("div",{className:"nc-dialog-footer",children:c});case"none":return null;default:return null}},D=n.jsx(Qe.Provider,{value:S,children:n.jsx("div",{className:`nc-dialog-overlay${N?" nc-fullscreen":""}`,onClick:R,children:n.jsxs("div",{ref:g,className:`nc-dialog-container ${w}`,style:o,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":v?void 0:"nc-dialog-title",children:[!v&&n.jsxs("div",{className:"nc-dialog-header",children:[n.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:r}),n.jsx(Ee,{onClick:t,"aria-label":"Close dialog"})]}),n.jsx("div",{ref:h,className:"nc-dialog-content",children:s}),L()]})})});return N?fe.createPortal(D,document.body):D}function Dt({onClick:e,size:t="default",rightOffset:r=4}){const s=t==="small"?28:34;return n.jsx("button",{className:"nc-button nc-ghost",onClick:e,onMouseDown:o=>{o.preventDefault(),o.stopPropagation()},tabIndex:-1,"aria-label":"Clear input",style:{position:"absolute",right:r,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:t==="small"?"12px":"14px"},children:"✕"})}function Vt({visible:e,onClick:t,size:r="default"}){const s=r==="small"?28:34,o=r==="small"?16:18;return n.jsx("button",{className:"nc-button nc-ghost",onClick:t,onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},tabIndex:-1,"aria-label":e?"Hide password":"Show password",style:{position:"absolute",right:4,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:e?n.jsx(U.EyeHiddenIcon,{size:o}):n.jsx(U.ViewIcon,{size:o})})}function Je({value:e,defaultValue:t="",onChange:r,onChangeConfirmed:s,onEnter:o,onClear:i,placeholder:c,disabled:a,label:d,clearable:u=!0,type:p="text",className:x="",size:f="default",appearance:m="default",style:N,leadingIcon:v,showPasswordToggle:w=!1,multiline:y=!1,rows:g=3,validator:h,showErrorMessage:b=!0}){const S=l.useRef(null),R=l.useRef(null),L=l.useRef(!1),[D,j]=l.useState(!1),[M,k]=l.useState(!1),[A,$]=l.useState(!1),V=e!==void 0,[I,T]=l.useState(t),H=V?e:I,[C,E]=l.useState(H),W=h?h(H):null,z=!!W,_=!y&&m==="plain",ee=_&&M,ue=ee?C:H;l.useEffect(()=>{ee||E(H)},[H,ee]);const ie=p==="password",ce=ie&&w&&!a&&!y,me=u&&ue&&!a&&(M||A),ge=f==="small"?32:44;let B=12;me&&ce?B=ge*2:(me||ce)&&(B=ge);const F=v?f==="small"?28:34:void 0,K=()=>{if(!_)return H;const X=C!==H;return V||T(C),X&&(r==null||r(C),s==null||s(C)),C},G=()=>{E(H)},gt=()=>{var X,te,We;if(_){E(""),i==null||i(),(X=S.current)==null||X.focus();return}V||T(""),r==null||r(""),i==null||i(),y?(te=R.current)==null||te.focus():(We=S.current)==null||We.focus()},ze=X=>{if(_&&X.key==="Escape"){X.preventDefault(),L.current=!0,G(),X.currentTarget.blur();return}if(X.key==="Enter"&&!y){const te=_?K():H;_&&(X.preventDefault(),L.current=!0,X.currentTarget.blur()),o==null||o(te)}},Be=X=>{const te=X.target.value;if(_){E(te),r==null||r(te);return}V||T(te),r==null||r(te)},De=()=>{k(!0),_&&E(H)},Ve=()=>{if(_&&L.current){L.current=!1,k(!1);return}_&&K(),k(!1)},He=`nc-input ${f==="small"?"nc-small ":""}${!y&&m==="plain"?"nc-plain ":""}${z?"nc-error ":""}${x}`;return n.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...N},onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:[d&&n.jsx("span",{className:"nc-label",children:d}),n.jsxs("div",{style:{position:"relative",display:"flex",alignItems:y?"flex-start":"center"},children:[v&&n.jsx("span",{className:"nc-input-leading-icon",style:{height:y?void 0:"100%",top:y?10:void 0},children:v}),y?n.jsx("textarea",{ref:R,className:He,placeholder:c,value:ue,onChange:Be,onKeyDown:ze,onFocus:De,onBlur:Ve,readOnly:a,"aria-disabled":a,tabIndex:a?-1:void 0,rows:g,style:{width:"100%",paddingRight:B,...F!==void 0?{paddingLeft:F}:{}}}):n.jsx("input",{ref:S,type:ie&&D?"text":p,className:He,placeholder:c,value:ue,onChange:Be,onKeyDown:ze,onFocus:De,onBlur:Ve,readOnly:a,"aria-disabled":a,tabIndex:a?-1:void 0,style:{width:"100%",paddingRight:B,...F!==void 0?{paddingLeft:F}:{}}}),me&&n.jsx(Dt,{onClick:gt,size:f,rightOffset:ce?ge+4:4}),ce&&n.jsx(Vt,{visible:D,onClick:()=>j(!D),size:f})]}),z&&b&&n.jsx("span",{className:"nc-error-message",children:W})]})}function Ht({children:e,onClick:t,showBorder:r=!0,selectable:s=!1,style:o}){const[i,c]=l.useState(!1),a=d=>{if(t){if(s){const u=window.getSelection();if(u&&u.toString().length>0)return}t(d)}};return n.jsx("div",{onClick:a,onMouseDown:()=>t&&c(!0),onMouseUp:()=>c(!1),onMouseLeave:()=>c(!1),style:{cursor:t?"pointer":"default",userSelect:s?"text":void 0,borderBottom:r?void 0:"none",...o},className:`nc-list-group-item ${t?"nc-list-group-item-clickable":""} ${i?"nc-list-group-item-active":""}`,children:n.jsx("div",{style:{flex:1,minWidth:0},children:e})})}function Wt({title:e,titleTools:t,children:r,style:s}){return n.jsxs("div",{className:"nc-list-group",style:s,children:[(e||t)&&n.jsxs("div",{className:"nc-list-group-title",children:[n.jsx("div",{children:e}),t&&n.jsx("div",{className:"nc-list-group-title-tools",children:t})]}),n.jsx("div",{className:"nc-list-group-content",children:r})]})}function Ft({values:e,onChange:t,options:r,placeholder:s="Select…",label:o}){const[i,c]=l.useState(!1),[a,d]=l.useState(""),u=l.useRef(null),p=l.useMemo(()=>r.filter(f=>f.label.toLowerCase().includes(a.toLowerCase())),[r,a]);l.useEffect(()=>{function f(m){!(m.target instanceof Node)||!u.current||u.current.contains(m.target)||c(!1)}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[]);const x=f=>{e.includes(f)?t(e.filter(m=>m!==f)):t([...e,f])};return n.jsxs("div",{ref:u,className:"nc-col",style:{position:"relative"},children:[o&&n.jsx("span",{className:"nc-label",children:o}),n.jsxs("div",{className:"nc-row",style:{flexWrap:"wrap",gap:6,minHeight:42,alignItems:"center",border:"1px solid var(--nc-button-border)",borderRadius:8,background:"var(--nc-button-bg)",padding:"4px 8px"},children:[e.length===0&&n.jsx("span",{className:"nc-label",children:s}),e.map(f=>{const m=r.find(N=>N.value===f);return m?n.jsxs("span",{style:{padding:"4px 8px",borderRadius:6,display:"inline-flex",alignItems:"center",gap:4,background:"var(--nc-button-bg)",border:"1px solid var(--nc-button-border)"},children:[m.label,n.jsx("button",{className:"nc-button nc-ghost",style:{padding:0,minHeight:0,height:20,width:20,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none"},onClick:()=>x(f),"aria-label":`Remove ${m.label}`,children:"✕"})]},f):null}),n.jsx("input",{className:"nc-input",value:a,onChange:f=>d(f.target.value),onFocus:()=>c(!0),style:{minWidth:50,border:"none",background:"transparent",padding:4,minHeight:32,flex:1}})]}),i&&n.jsxs("div",{className:"nc-combo-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:10,marginTop:4,boxShadow:"0 4px 12px var(--nc-shadow)"},children:[p.map(f=>{const m=e.includes(f.value);return n.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>x(f.value),children:[n.jsx("span",{children:f.label}),n.jsx("span",{children:m?"✔️":""})]},f.value)}),p.length===0&&n.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}function we(e){if(!e)return null;const t=/^\d{2}-\d{1,2}$/,r=/^\d{4}-\d{1,2}$/;if(!t.test(e)&&!r.test(e))return"Format must be YY-M(M) or YYYY-M(M)";const s=e.split("-"),o=parseInt(s[1],10);return o<1||o>12?"Month must be between 1 and 12":null}function xe(e){if(!e)return"";const t=e.split("-");if(t.length!==2)return e;let r=t[0];const s=t[1].padStart(2,"0");if(r.length===2){const o=parseInt(r,10);r=String(o<50?2e3+o:1900+o)}return`${r}-${s}`}function Fe(e){if(!e)return"";const t=xe(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[r,s]=t.split("-");return`${r}/${s}`}function Oe(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0");return`${t}-${r}`}function Ot({startMonth:e,endMonth:t,onChange:r,label:s,className:o="",disabled:i=!1,size:c="default"}){const[a,d]=l.useState(!1),[u,p]=l.useState(""),[x,f]=l.useState(""),[m,N]=l.useState({top:0,left:0,width:0,right:void 0}),v=l.useRef(null),w=l.useRef(null);l.useEffect(()=>{if(a&&v.current){const k=v.current.getBoundingClientRect(),$=Math.max(k.width,400);window.innerWidth-k.left<$&&k.right>=$?N({top:k.bottom+4,left:0,right:window.innerWidth-k.right,width:$}):N({top:k.bottom+4,left:k.left,right:void 0,width:$})}},[a]),l.useEffect(()=>{if(!a)return;const k=A=>{v.current&&!v.current.contains(A.target)&&w.current&&!w.current.contains(A.target)&&d(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[a]);const y=()=>{p(e||Oe()),f(t||Oe()),d(!0)},g=()=>{d(!1)},h=()=>{const k=we(u),A=we(x);if(k||A)return;const $=xe(u),V=xe(x);$&&V&&(r==null||r($,V)),d(!1)},b=e&&t?`${Fe(e)} - ${Fe(t)}`:"Select month range",S=we(u),R=we(x),L=xe(u),D=xe(x),j=L&&D&&L>D,M=a?fe.createPortal(n.jsx("div",{ref:w,className:"nc-month-range-picker-popup",style:{position:"fixed",top:m.top,...m.right!==void 0?{right:m.right}:{left:m.left},width:m.width,zIndex:1e3},children:n.jsxs("div",{className:"nc-month-range-picker-content",children:[n.jsxs("div",{className:"nc-month-range-picker-row",children:[n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"Start Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${S?"nc-error":""}`,value:u,onChange:k=>p(k.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),S&&n.jsx("div",{className:"nc-month-error-text",children:S})]}),n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"End Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${R?"nc-error":""}`,value:x,onChange:k=>f(k.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),R&&n.jsx("div",{className:"nc-month-error-text",children:R})]})]}),j&&!S&&!R&&n.jsx("div",{className:"nc-month-range-error",children:"End month must be after or equal to start month"}),n.jsxs("div",{className:"nc-month-range-picker-footer",children:[n.jsx(q,{variant:"primary",onClick:h,disabled:!u||!x||!!S||!!R||!!j,children:"Apply"}),n.jsx(q,{variant:"ghost",onClick:g,children:"Cancel"})]})]})}),document.body):null;return n.jsxs("div",{className:`nc-month-range-picker ${c==="small"?"nc-small ":""}${o}`,children:[s&&n.jsx("label",{className:`nc-label${c==="small"?" nc-small":""}`,children:s}),n.jsx("button",{ref:v,className:`nc-month-range-picker-input${c==="small"?" nc-small":""}`,onClick:y,disabled:i,children:b}),M]})}const Gt=5,Yt=3;function _t({value:e,onChange:t,min:r,max:s,step:o=1,label:i,disabled:c,className:a="",style:d,size:u="default"}){const p=u==="small",x=(String(o).split(".")[1]||"").length,f=l.useRef(null),m=l.useRef(!1),N=l.useRef(null),[v,w]=l.useState(!1),[y,g]=l.useState(()=>String(e)),h=I=>parseFloat(I.toFixed(x)),b=I=>{const T=h(I);g(String(T)),t(T)},S=()=>{const I=e-o;r!==void 0&&I<r||b(parseFloat(I.toFixed(10)))},R=()=>{const I=e+o;s!==void 0&&I>s||b(parseFloat(I.toFixed(10)))},L=I=>{const T=I.target.value;if(g(T),T==="")return;const H=parseFloat(T);isNaN(H)||t(H)},D=()=>{const I=y;if(I===""){b(r!==void 0?r:0);return}const T=parseFloat(I);if(isNaN(T)){b(r!==void 0?r:0);return}let H=h(T);r!==void 0&&(H=Math.max(r,H)),s!==void 0&&(H=Math.min(s,H)),H!==T?b(H):g(String(H))},j=I=>{c||I.button!==0||(m.current=!1,f.current={startY:I.clientY,startValue:e,pointerId:I.pointerId,hasMoved:!1,lastValue:e},N.current=setTimeout(()=>{m.current=!0,w(!0)},200),I.currentTarget.setPointerCapture(I.pointerId))},M=I=>{const T=f.current;if(!T||T.pointerId!==I.pointerId)return;const H=T.startY-I.clientY;if(Math.abs(H)>=Yt&&(T.hasMoved=!0,m.current=!0,N.current&&(clearTimeout(N.current),N.current=null),w(!0)),!T.hasMoved)return;const C=Math.trunc(H/Gt);let E=T.startValue+C*o;r!==void 0&&(E=Math.max(r,E)),s!==void 0&&(E=Math.min(s,E)),E=h(E),E!==T.lastValue&&(T.lastValue=E,g(String(E)),t(E))},k=I=>{const T=f.current;!T||T.pointerId!==I.pointerId||(N.current&&(clearTimeout(N.current),N.current=null),I.currentTarget.hasPointerCapture(I.pointerId)&&I.currentTarget.releasePointerCapture(I.pointerId),f.current=null,w(!1))},A=I=>T=>{if(m.current){m.current=!1,T.preventDefault();return}I()},$=y===""?NaN:parseFloat(y),V=y===""||isNaN($)||r!==void 0&&$<r||s!==void 0&&$>s;return n.jsxs("div",{className:`nc-col nc-number-input-col ${p?"nc-small":""}`,children:[i&&n.jsx("span",{className:`nc-label ${p?"nc-small":""}`,children:i}),n.jsxs("div",{className:`nc-number-input-container ${p?"nc-small":""} ${a}`,style:d,children:[n.jsx("input",{className:`nc-input nc-number-input ${p?"nc-small":""} ${V?"nc-error":""}`,type:"number",value:y,onChange:L,onBlur:D,min:r,max:s,step:o,disabled:c}),n.jsxs("div",{className:`nc-number-input-spinners ${p?"nc-small":""} ${c?"nc-disabled":""} ${v?"nc-dragging":""}`,children:[n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-up ${p?"nc-small":""}`,onClick:A(R),onPointerDown:j,onPointerMove:M,onPointerUp:k,onPointerCancel:k,disabled:c||s!==void 0&&e>=s,tabIndex:-1,children:"▲"}),n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-down ${p?"nc-small":""}`,onClick:A(S),onPointerDown:j,onPointerMove:M,onPointerUp:k,onPointerCancel:k,disabled:c||r!==void 0&&e<=r,tabIndex:-1,children:"▼"})]})]})]})}function Kt({value:e,onChange:t,min:r=0,max:s=100,step:o=1,label:i,disabled:c,showValue:a=!0,formatValue:d=p=>p.toString(),width:u=200}){const p=f=>{const m=parseFloat(f.target.value);t(m)},x=(e-r)/(s-r)*100;return n.jsxs("div",{className:"nc-col",style:{gap:6},children:[i&&n.jsx("span",{className:"nc-label",children:i}),n.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[n.jsx("input",{type:"range",className:"nc-slider",value:e,onChange:p,min:r,max:s,step:o,disabled:c,style:{width:u,"--nc-slider-percentage":`${x}%`}}),a&&n.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:d(e)})]})]})}const Ut=({size:e=24,className:t,style:r})=>n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,style:r,children:n.jsx("polyline",{points:"18 15 12 9 6 15"})});function et({children:e,className:t="",style:r}){return n.jsx("div",{className:`nc-tab-panel ${t}`,style:r,children:e})}function qt({active:e,children:t,keepMounted:r=!1,className:s="",style:o}){const i=l.Children.toArray(t).filter(a=>l.isValidElement(a)&&(a.type===et||a.type.displayName==="TabPanel"));if(r)return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:i.map(a=>{const d=a.props.tab===e;return n.jsx("div",{className:`nc-tab-panel-wrapper ${d?"nc-active":""}`,style:{display:d?void 0:"none"},"aria-hidden":!d,children:a},a.props.tab)})});const c=i.find(a=>a.props.tab===e);return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:c})}function Xt({tabs:e,active:t,onChange:r,onClose:s,permanentTabs:o,className:i,toolbar:c,multiline:a,orientation:d="horizontal",style:u}){const p=l.useRef(null),[x,f]=l.useState(!1),[m,N]=l.useState(!1),v=d==="verticalLeft"||d==="verticalRight",w=l.useRef(!1),y=l.useRef(0),g=l.useRef(0),h=l.useRef(!1);l.useEffect(()=>{const j=()=>{if(p.current)if(v){const{scrollTop:k,scrollHeight:A,clientHeight:$}=p.current;f(k>1),N(k<A-$-1)}else{const{scrollLeft:k,scrollWidth:A,clientWidth:$}=p.current;f(k>1),N(k<A-$-1)}},M=p.current;if(M)return j(),M.addEventListener("scroll",j),window.addEventListener("resize",j),()=>{M.removeEventListener("scroll",j),window.removeEventListener("resize",j)}},[e,v]);const b=j=>{p.current&&(w.current=!0,h.current=!1,y.current=v?j.clientY:j.clientX,g.current=v?p.current.scrollTop:p.current.scrollLeft,p.current.style.cursor="grabbing",p.current.style.userSelect="none")},S=j=>{if(!w.current||!p.current)return;const M=v?j.clientY:j.clientX,k=y.current-M;Math.abs(k)>3&&(h.current=!0),v?p.current.scrollTop=g.current+k:p.current.scrollLeft=g.current+k},R=()=>{p.current&&(w.current=!1,p.current.style.cursor="",p.current.style.userSelect="")},L=()=>{R()};l.useEffect(()=>{const j=p.current;if(!j||v)return;const M=k=>{k.deltaY!==0&&(k.preventDefault(),j.scrollLeft+=k.deltaY*.3)};return j.addEventListener("wheel",M,{passive:!1}),()=>{j.removeEventListener("wheel",M)}},[v]);const D=j=>{h.current||r(j)};return n.jsxs("div",{className:`nc-tab-container ${v?`nc-vertical nc-${d}`:""} ${i||""}`,style:u,children:[n.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[x&&n.jsx("div",{className:`nc-tab-scroll-indicator ${v?"nc-top":"nc-left"}`,children:v?n.jsx(Ut,{size:16}):n.jsx(U.ChevronLeftIcon,{size:16})}),n.jsx("div",{ref:p,className:`nc-tab-scroll ${a?"nc-multiline":""}`,onMouseDown:b,onMouseMove:S,onMouseUp:R,onMouseLeave:L,style:{cursor:"grab"},children:e.map(j=>{const M=typeof j=="string"?j:j.id,k=typeof j=="string"?j:j.label,A=s&&!(o!=null&&o.includes(M));return n.jsxs("div",{className:`nc-tab-item ${t===M?"nc-active":""} ${A?"nc-closable":""}`,onClick:()=>D(M),role:"button",tabIndex:0,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&r(M)},children:[n.jsx("span",{className:"nc-tab-label",children:v?k:typeof k=="string"?k.toUpperCase():k}),A&&n.jsx("span",{className:"nc-tab-close",role:"button",tabIndex:0,"aria-label":`Close ${typeof k=="string"?k:M}`,onClick:$=>{$.stopPropagation(),s(M)},onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.stopPropagation(),s(M))},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},M)})}),m&&n.jsx("div",{className:`nc-tab-scroll-indicator ${v?"nc-bottom":"nc-right"}`,children:v?n.jsx(U.ChevronDownIcon,{size:16}):n.jsx(U.ChevronRightIcon,{size:16})})]}),c&&n.jsx("div",{className:"nc-tab-toolbar",children:c})]})}function Qt({checked:e,onChange:t,disabled:r,label:s}){return n.jsxs("label",{className:"nc-row",style:{gap:10,alignItems:"center",cursor:r?"not-allowed":"pointer"},children:[s&&n.jsx("span",{className:"nc-label",children:s}),n.jsx("span",{role:"switch","aria-checked":e,tabIndex:0,onKeyDown:o=>{r||(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(!e))},onClick:()=>!r&&t(!e),style:{position:"relative",width:56,height:30,borderRadius:18,padding:4,display:"inline-flex",alignItems:"center",justifyContent:"flex-start",border:`2px solid ${e?"var(--nc-primary)":"var(--nc-button-border)"}`,background:e?"rgba(99,102,241,0.08)":"transparent",transition:"border-color 160ms, background 160ms"},children:n.jsx("span",{style:{width:22,height:22,borderRadius:12,background:e?"var(--nc-text)":"var(--nc-muted)",transform:`translateX(${e?24:0}px)`,transition:"transform 160ms, background 160ms",boxShadow:e?"0 2px 6px rgba(99,102,241,0.28)":"0 1px 2px rgba(0,0,0,0.08)",border:"none"}})})]})}const Ge=["var(--nc-csv-col-0)","var(--nc-csv-col-1)","var(--nc-csv-col-2)","var(--nc-csv-col-3)","var(--nc-csv-col-4)","var(--nc-csv-col-5)","var(--nc-csv-col-6)","var(--nc-csv-col-7)","var(--nc-csv-col-8)","var(--nc-csv-col-9)"];function Zt(e,t){const s=e.slice(0,t).split(`
2
+ `),o=s.length,c=s[o-1].split(" "),a=c.length,d=c[a-1].length+1;return{line:o,column:a,character:d,offset:t}}function Jt(e,t,r,s){const o=e.split(`
3
+ `),i=Math.max(1,Math.min(t,o.length));let c=0;for(let x=0;x<i-1;x++)c+=o[x].length+1;const d=o[i-1].split(" "),u=Math.max(1,Math.min(r,d.length));for(let x=0;x<u-1;x++)c+=d[x].length+1;const p=Math.max(1,Math.min(s,d[u-1].length+1));return c+=p-1,c}function en(e,t){const r=e.split(`
4
+ `),s=Math.max(1,Math.min(t,r.length));let o=0;for(let i=0;i<s-1;i++)o+=r[i].length+1;return o}const tn=l.forwardRef(function({value:t,onChange:r,placeholder:s,className:o,style:i,showLineNumbers:c=!1,onCursorChange:a,highlightLine:d},u){const p=l.useRef(null),x=l.useRef(null),f=l.useRef(null);l.useImperativeHandle(u,()=>({goToLine(g){const h=p.current;if(!h)return;const b=en(t,g);h.focus(),h.setSelectionRange(b,b);const S=parseFloat(getComputedStyle(h).lineHeight)||18;h.scrollTop=(Math.max(1,g)-1)*S,N(),m()},goToPosition(g,h,b){const S=p.current;if(!S)return;const R=Jt(t,g,h,b);S.focus(),S.setSelectionRange(R,R);const L=parseFloat(getComputedStyle(S).lineHeight)||18;S.scrollTop=(Math.max(1,g)-1)*L,N(),m()}}),[t]);const m=l.useCallback(()=>{if(!a||!p.current)return;const g=Zt(t,p.current.selectionStart);a(g)},[a,t]),N=l.useCallback(()=>{const g=p.current;g&&(x.current&&(x.current.scrollTop=g.scrollTop,x.current.scrollLeft=g.scrollLeft),f.current&&(f.current.scrollTop=g.scrollTop))},[]);l.useEffect(()=>{if(d==null||d<1)return;const g=p.current;if(!g)return;const h=parseFloat(getComputedStyle(g).lineHeight)||18,b=(d-1)*h,S=b+h;(b<g.scrollTop||S>g.scrollTop+g.clientHeight)&&(g.scrollTop=b-g.clientHeight/2+h/2),N()},[d]);const v=l.useMemo(()=>t.split(`
5
+ `).length,[t]),w=()=>{const g=[];for(let h=1;h<=v;h++)g.push(n.jsx("div",{className:`nc-csv-line-number ${d===h?"nc-csv-highlight":""}`,children:h},h));return n.jsx("div",{className:"nc-csv-gutter",ref:f,children:g})},y=g=>g?g.split(`
6
+ `).map((b,S)=>{const R=b.split(" ");return n.jsxs("div",{className:`nc-csv-line ${d===S+1?"nc-csv-highlight":""}`,children:[R.map((L,D)=>n.jsxs("span",{children:[D>0&&n.jsx("span",{className:"nc-csv-tab-char",children:" "}),n.jsx("span",{style:{color:Ge[D%Ge.length]},children:L})]},D)),b===""&&`
7
+ `]},S)}):null;return n.jsxs("div",{className:`nc-csv-textarea-container ${c?"nc-csv-with-gutter":""} ${o??""}`,style:i,children:[c&&w(),n.jsxs("div",{className:"nc-csv-textarea-editor",children:[n.jsx("div",{className:"nc-csv-textarea-backdrop",ref:x,children:n.jsx("pre",{className:"nc-csv-textarea-highlights",children:y(t)})}),n.jsx("textarea",{ref:p,className:"nc-csv-textarea-input",value:t,onChange:g=>{r(g.target.value),requestAnimationFrame(m)},onScroll:N,onSelect:m,onKeyUp:m,onClick:m,placeholder:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off"})]})]})}),Ne=/^[vV]?(\d+)\.(\d+)\.(\d+|x)(?:[-._]([0-9A-Za-z._-]+))?$/,nn=/^-+$/,tt="__branches__",rn="__unreleased__";function Ye(e){const t=e.trim().match(Ne);return t?`${t[1]}.${t[2]}`:null}function sn(e,t){const[r,s]=e.split(".").map(Number),[o,i]=t.split(".").map(Number);return o-r||i-s}function on(e,t){return e===void 0?t===void 0?0:1:t===void 0?-1:e.localeCompare(t,"en",{numeric:!0})}function _e(e){return e.toLowerCase()==="x"?Number.POSITIVE_INFINITY:Number(e)}function cn(e,t){const r=e.trim().match(Ne),s=t.trim().match(Ne);if(!r||!s)return 0;const o=_e(r[3]),i=_e(s[3]),c=o===i?0:o<i?-1:1;return Number(r[1])-Number(s[1])||Number(r[2])-Number(s[2])||c||on(r[4],s[4])}function an(e,t){const r=[],s=new Map,o={key:tt,label:t.branches,items:[]},i={key:rn,label:t.unreleased,items:[]};for(const c of e){const a=c.value.trim();if(!a||nn.test(a))continue;if(c.kind==="branch"){o.items.push(c);continue}const d=Ye(a)??Ye(c.label);if(!d){i.items.push(c);continue}let u=s.get(d);u||(u={key:d,label:d,items:[]},s.set(d,u),r.push(u)),u.items.push(c)}o.items.sort((c,a)=>c.value===a.value?0:c.value==="master"?-1:a.value==="master"?1:a.value.localeCompare(c.value,"en",{numeric:!0})),r.sort((c,a)=>sn(c.key,a.key));for(const c of r)c.items.sort((a,d)=>-cn(a.value,d.value));return[...o.items.length?[o]:[],...i.items.length?[i]:[],...r]}function ln(e,t){var r;return e.label.toLowerCase().includes(t)||e.value.toLowerCase().includes(t)||(((r=e.description)==null?void 0:r.toLowerCase().includes(t))??!1)}function dn({options:e,value:t,onChange:r,disabled:s=!1,size:o="small",placeholder:i="Select version",className:c="",appearance:a="default",loading:d=!1,error:u,truncated:p,onRefresh:x,mode:f}){const{t:m}=J.useTranslation(),N=f??(x?"refs":"versions"),v=l.useRef(null),w=l.useRef(null),[y,g]=l.useState(!1),[h,b]=l.useState(""),[S,R]=l.useState(""),[L,D]=l.useState({}),j=l.useMemo(()=>an(e,{branches:m("versionPicker.branches"),unreleased:m("versionPicker.unreleased")}),[e,m]),M=h.trim().toLowerCase(),k=l.useMemo(()=>e.find(C=>C.value===t),[e,t]),A=l.useMemo(()=>j.find(C=>C.key===S)??j[0],[j,S]),$=l.useMemo(()=>M?j.map(C=>({group:C,items:C.items.filter(E=>ln(E,M))})).filter(C=>C.items.length>0):[],[j,M]);l.useEffect(()=>{if(j.length===0){R("");return}R(C=>j.some(E=>E.key===C)?C:j[0].key)},[j]),l.useEffect(()=>{if(!y)return;const C=W=>{var z,_;!((z=v.current)!=null&&z.contains(W.target))&&!((_=w.current)!=null&&_.contains(W.target))&&g(!1)},E=W=>{W.key==="Escape"&&g(!1)};return document.addEventListener("mousedown",C),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",E)}},[y]),l.useEffect(()=>{if(!y)return;const C=()=>{if(!v.current)return;const E=v.current.getBoundingClientRect(),W=Math.min(340,window.innerWidth-24),z=Math.max(12,Math.min(E.left,window.innerWidth-W-12)),_=window.innerHeight-E.bottom,ee=_<260&&E.top>_;D(ee?{bottom:window.innerHeight-E.top+6,left:z,width:W}:{top:E.bottom+6,left:z,width:W})};return C(),window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[y]),l.useEffect(()=>{if(!y||!t)return;const C=j.find(E=>E.items.some(W=>W.value===t));C&&R(C.key)},[j,y,t]);const V=(k==null?void 0:k.label)??t,I=k!=null&&k.description?`${V} — ${k.description}`:V,T=C=>{s||d||u||(r(C.value),b(""),g(!1))},H=C=>n.jsx(q,{className:`nc-version-picker-option ${C.value===t?"nc-version-picker-option-selected":""}`,variant:"ghost",size:"small",disabled:s||d||!!u,onClick:()=>T(C),children:n.jsxs("span",{className:"nc-version-picker-option-body",children:[n.jsx("span",{className:"nc-version-picker-option-label",children:C.label}),C.description&&n.jsx("span",{className:"nc-version-picker-option-description",children:C.description})]})},C.value);return n.jsxs("div",{className:`nc-version-picker ${a==="plain"?"nc-plain":""} ${c}`,ref:v,children:[n.jsxs(q,{className:`nc-version-picker-trigger ${o==="small"?"nc-version-picker-trigger-small":"nc-version-picker-trigger-default"} ${y?"nc-version-picker-trigger-open":""}`,variant:a==="plain"?"ghost":"default",size:o,disabled:s,title:u||I||i,"aria-haspopup":"listbox","aria-expanded":y,onClick:()=>g(C=>!C),children:[n.jsx("span",{className:`nc-version-picker-trigger-label ${V?"":"nc-version-picker-trigger-placeholder"}`,children:d?m("versionPicker.loading"):V||i}),u&&n.jsx(U.WarningIcon,{size:14}),n.jsx(U.ChevronDownIcon,{size:14})]}),y&&fe.createPortal(n.jsxs("div",{ref:w,className:"nc-version-picker-popover",style:L,children:[u&&n.jsx("div",{className:"nc-version-picker-error",role:"alert",children:u}),x&&n.jsxs("div",{className:"nc-version-picker-ref-header",children:[n.jsx("span",{children:m(N==="refs"?"versionPicker.refsHeader":"versionPicker.versionsHeader")}),n.jsx(q,{variant:"ghost",size:"small",title:m("versionPicker.refresh"),"aria-label":m("versionPicker.refresh"),disabled:d,onClick:x,children:n.jsx(U.RefreshIcon,{size:15})})]}),(p==null?void 0:p.branches)&&n.jsx("div",{className:"nc-version-picker-notice",children:m("versionPicker.branchesIncomplete")}),(p==null?void 0:p.tags)&&n.jsx("div",{className:"nc-version-picker-notice",children:m("versionPicker.tagsIncomplete")}),n.jsxs("div",{className:"nc-version-picker-search",children:[n.jsx(U.SearchIcon,{size:15}),n.jsx(Je,{value:h,onChange:b,placeholder:m(N==="refs"?"versionPicker.searchRefs":"versionPicker.searchVersions"),size:"small",clearable:!0})]}),n.jsx("div",{className:"nc-version-picker-body",children:d||u||j.length===0?n.jsx("div",{className:"nc-version-picker-empty",children:m(d?"versionPicker.loading":u?"versionPicker.unavailable":N==="refs"?"versionPicker.noRefs":"versionPicker.noVersions")}):M?n.jsx("div",{className:"nc-version-picker-results",children:$.length===0?n.jsx("div",{className:"nc-version-picker-empty",children:m("versionPicker.noMatches")}):$.map(({group:C,items:E})=>n.jsxs("div",{className:"nc-version-picker-result-group",children:[n.jsx("div",{className:"nc-version-picker-result-group-label",children:C.label}),n.jsx("div",{className:"nc-version-picker-option-list",children:E.map(H)})]},C.key))}):n.jsxs("div",{className:"nc-version-picker-browser",children:[n.jsx("div",{className:"nc-version-picker-group-list",children:j.map(C=>n.jsxs(q,{className:`nc-version-picker-group-button ${C.key===(A==null?void 0:A.key)?"nc-version-picker-group-button-active":""}`,variant:"ghost",size:"small",onClick:()=>R(C.key),children:[n.jsxs("span",{children:[C.label,(C.key===tt?p!=null&&p.branches:p!=null&&p.tags)?` (${m("versionPicker.incomplete")})`:""]}),n.jsx(U.ChevronRightIcon,{size:13})]},C.key))}),n.jsx("div",{className:"nc-version-picker-item-list",children:A&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"nc-version-picker-item-list-header",children:A.label}),n.jsx("div",{className:"nc-version-picker-option-list",children:A.items.map(H)})]})})]})})]}),document.body)]})}let le={notifications:[]};const Se=new Set,Ke=new Map;function Ce(){const e=le.notifications.slice();for(const t of Array.from(Se))try{t(e)}catch{}}function un(e){Se.add(e);try{e(le.notifications.slice())}catch{}return()=>{Se.delete(e)}}function pn(e){const t=`notification-${Date.now()}-${Math.random()}`,{duration:r,type:s,...o}=e,i={id:t,dismissible:!0,...o,type:s==="error"?"danger":s??"info",duration:r??5e3};return le.notifications=[i,...le.notifications],Ce(),i.duration&&i.duration>0&&setTimeout(()=>{nt(t)},i.duration),t}function nt(e){const t=le.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,Ce();const r=window.setTimeout(()=>{le.notifications=le.notifications.filter(s=>s.id!==e),Ce(),Ke.delete(e)},300);Ke.set(e,r)}function fn({type:e}){switch(e){case"success":return n.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:n.jsx("path",{d:"M5 10.5l3.1 3.1L15 6.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});case"danger":return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"10",cy:"10",r:"7",stroke:"currentColor",strokeWidth:"2"}),n.jsx("path",{d:"M10 6.5v4.25",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"13.75",r:"1",fill:"currentColor"})]});case"warning":return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M10 3.5 16 15H4L10 3.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),n.jsx("path",{d:"M10 7.5v3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"13.25",r:"1",fill:"currentColor"})]});default:return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"10",cy:"10",r:"7",stroke:"currentColor",strokeWidth:"2"}),n.jsx("path",{d:"M10 9v4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"6.5",r:"1",fill:"currentColor"})]})}}function rt({notification:e}){const{t}=J.useTranslation(),r=e.type||"info",s=()=>{if(e.title)return e.title;switch(r){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},o=()=>{nt(e.id)};return n.jsx("div",{className:`nc-notification nc-notification-${r}`,children:n.jsxs("div",{className:"nc-notification-content",children:[n.jsx("div",{className:`nc-notification-icon nc-notification-icon-${r}`,children:n.jsx(fn,{type:r})}),n.jsxs("div",{className:"nc-notification-body",children:[n.jsx("div",{className:"nc-notification-title",children:s()}),n.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&n.jsx("button",{className:"nc-notification-dismiss",onClick:o,"aria-label":t("common.close"),children:n.jsx(U.CloseIcon,{size:16})})]})})}function hn(){const[e,t]=l.useState([]),[r,s]=l.useState(new Map),[o,i]=l.useState(new Set),c=l.useRef(null),a=l.useRef([]);return l.useEffect(()=>un(u=>{const p=new Set(a.current.map(f=>f.id)),x=u.filter(f=>!p.has(f.id)).map(f=>f.id);x.length>0?(t(u),i(new Set(x)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(u),a.current=u}),[]),l.useEffect(()=>{if(!c.current)return;const d=new Map;let u=0;const p=c.current.children;e.forEach((x,f)=>{if(d.set(x.id,u),p[f]){const m=p[f].offsetHeight;x.isRemoving||(u+=m+12)}}),s(d)},[e]),n.jsx("div",{style:{position:"fixed",top:"24px",left:"24px",zIndex:9999,pointerEvents:"none",width:"min(340px, calc(100vw - 32px))"},children:n.jsx("div",{ref:c,style:{pointerEvents:"auto",position:"relative",width:"100%"},children:e.map(d=>{const u=o.has(d.id),p=d.isRemoving,x=r.get(d.id)||0;return n.jsx("div",{style:{position:"absolute",top:0,left:0,transform:u?`translate3d(-40px, ${x}px, 0)`:`translate3d(0, ${x}px, 0)`,transition:p?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:p?0:1,width:"100%"},children:n.jsx(rt,{notification:d})},d.id)})})})}function st(e){return pn(e)}const mn={show:e=>st(e)};function gn(e){const t=xt.createInstance(),r={};for(const o in e)r[o]={translation:e[o]};const s=typeof document<"u"&&document.documentElement.lang||"en";return t.init({resources:r,lng:s,fallbackLng:"en",interpolation:{escapeValue:!1}}),typeof MutationObserver<"u"&&typeof document<"u"&&new MutationObserver(i=>{for(const c of i)if(c.type==="attributes"&&c.attributeName==="lang"){const a=document.documentElement.lang||"en";t.changeLanguage(a)}}).observe(document.documentElement,{attributes:!0}),t}class bn{constructor(){re(this,"apps",new Map)}register(t){this.apps.has(t.id)&&console.warn(`App "${t.id}" is already registered. Overwriting.`),this.apps.set(t.id,{...t,width:t.width??400,padding:t.padding??0})}unregister(t){this.apps.delete(t)}get(t){return this.apps.get(t)}list(){return Array.from(this.apps.values())}has(t){return this.apps.has(t)}}const de=new bn,Ue="nc-ui-app-state";class vn{constructor(){re(this,"state");re(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem(Ue);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem(Ue,JSON.stringify(this.state))}catch{}}getActiveAppId(){return this.state.activeAppId}_setActiveAppId(t){this.state.activeAppId!==t&&(this.state.activeAppId=t,this.saveState(),this.notify("activeAppId",t))}subscribe(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{var s;(s=this.listeners.get(t))==null||s.delete(r)}}notify(t,r){var s;(s=this.listeners.get(t))==null||s.forEach(o=>o(r))}}const Z=new vn;class xn{constructor(){re(this,"apps",[]);re(this,"activeAppId",null);re(this,"listeners",new Set);re(this,"refReadyResolvers",new Map)}async launchApp(t,r){const{launchInBackground:s=!1}=r||{};if(!de.has(t))return console.error(`Cannot launch app "${t}": not registered`),null;const o=this.apps.find(c=>c.appId===t);if(o)return s||(this.setActiveApp(t),Z._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,Z._setActiveAppId(t)),this.notify(),this.waitForRef(t)}waitForRef(t){return new Promise(r=>{const s=this.refReadyResolvers.get(t)||[];s.push(r),this.refReadyResolvers.set(t,s)})}setAppRef(t,r){const s=this.apps.find(i=>i.appId===t);if(!s){console.warn(`Cannot set ref for app "${t}": not running`);return}s.ref=r;const o=this.refReadyResolvers.get(t);o&&(o.forEach(i=>i(s)),this.refReadyResolvers.delete(t))}getApp(t){return this.apps.find(r=>r.appId===t)}closeApp(t){const r=this.apps.findIndex(o=>o.appId===t);if(r===-1)return;const s=this.apps[r];if(s.ref&&(s.ref=void 0),this.apps.splice(r,1),this.activeAppId===t){const o=window.innerWidth>=768;this.activeAppId=o&&this.apps.length>0?this.apps[this.apps.length-1].appId:null,Z._setActiveAppId(this.activeAppId)}this.notify()}setActiveApp(t){if(t!==null&&!this.apps.find(r=>r.appId===t)){console.warn(`Cannot activate app "${t}": not running`);return}this.activeAppId!==t&&(this.activeAppId=t,this.notify(),Z._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?de.get(this.activeAppId)??null:null}getRunningApps(){return[...this.apps]}isRunning(t){return this.apps.some(r=>r.appId===t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){this.listeners.forEach(t=>t())}}const Q=new xn,Me=l.createContext(null);function ot(){const e=l.useContext(Me);if(!e)throw new Error("useApp must be used inside an App");return e}function wn({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M19 12H5"}),n.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function it({title:e,onClose:t,onBack:r,toolbar:s,hideBackButton:o}){const i=r&&!o;return n.jsxs("div",{className:"nc-app-title-bar",children:[n.jsxs("div",{className:"nc-app-title-bar-left",children:[i&&n.jsx("button",{className:"nc-app-title-bar-back",onClick:r,title:"Back","aria-label":"Go back",children:n.jsx(wn,{size:16})}),n.jsx("span",{className:"nc-app-title-bar-title",children:e})]}),n.jsxs("div",{className:"nc-app-title-bar-right",children:[s&&n.jsx("div",{className:"nc-app-title-bar-toolbar",children:s}),n.jsx(Ee,{onClick:t,"aria-label":"Close application"})]})]})}class yn extends l.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error(`Error loading app ${this.props.appId}:`,t,r)}render(){return this.state.hasError?n.jsxs("div",{className:"nc-app-error",children:[n.jsx("div",{children:"Failed to load app"}),this.state.error&&n.jsx("div",{style:{fontSize:"12px",opacity:.7},children:this.state.error.message})]}):this.props.children}}function Ie({appId:e,isActive:t,onClose:r}){const{t:s}=J.useTranslation(),o=de.get(e),[i,c]=l.useState(""),[a,d]=l.useState(null),[u,p]=l.useState(null),[x,f]=l.useState(!1),[m,N]=l.useState(!1);l.useEffect(()=>{o!=null&&o.titleKey&&c(s(o.titleKey))},[o,s]);const v=l.useCallback(j=>{c(j)},[]),w=l.useCallback(j=>{d(()=>j)},[]),y=l.useCallback(()=>{d(null)},[]),g=l.useCallback(j=>{p(j)},[]),h=l.useCallback(()=>{p(null)},[]),b=l.useCallback(j=>{f(j)},[]),S=l.useCallback(j=>{N(j)},[]),R=l.useMemo(()=>({setTitle:v,setBackHandler:w,clearBackHandler:y,setToolbar:g,clearToolbar:h,setHideBackButton:b,setHideTitleBar:S,close:r}),[v,w,y,g,h,b,S,r]);if(!o)return null;const L=o.component,D=!o.hideTitleBar&&!m;return n.jsxs("div",{className:`nc-app-container${t?"":" nc-hidden"}`,children:[D&&n.jsx(it,{title:i,onClose:r,onBack:a??void 0,toolbar:u,hideBackButton:x}),n.jsx("div",{className:"nc-app-content-wrapper",style:{padding:o.padding,overflowY:D?"auto":void 0},children:n.jsx(Me.Provider,{value:R,children:n.jsx(yn,{appId:e,children:n.jsx(l.Suspense,{fallback:n.jsx("div",{className:"nc-app-loading",children:n.jsx(Re,{})}),children:n.jsx(L,{})})})})})]})}const ye=768,ke=1024,ct={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},at=l.createContext(ct);function kn({children:e}){const[t,r]=l.useState(()=>{if(typeof window>"u")return ct;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ye,isTablet:s>=ye&&s<ke,isDesktop:s>=ke,width:s,height:o}});return l.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;r({isMobile:o<ye,isTablet:o>=ye&&o<ke,isDesktop:o>=ke,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),n.jsx(at.Provider,{value:t,children:e})}function Pe(){return l.useContext(at)}const $e="-",jn=e=>{const t=Sn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const a=c.split($e);return a[0]===""&&a.length!==1&&a.shift(),lt(a,t)||Nn(c)},getConflictingClassGroupIds:(c,a)=>{const d=r[c]||[];return a&&s[c]?[...d,...s[c]]:d}}},lt=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),o=s?lt(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join($e);return(c=t.validators.find(({validator:a})=>a(i)))==null?void 0:c.classGroupId},qe=/^\[(.+)\]$/,Nn=e=>{if(qe.test(e)){const t=qe.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Sn=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return An(Object.entries(e.classGroups),r).forEach(([i,c])=>{Ae(c,s,i,t)}),s},Ae=(e,t,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Xe(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(Cn(o)){Ae(o(s),t,r,s);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,c])=>{Ae(c,Xe(t,i),r,s)})})},Xe=(e,t)=>{let r=e;return t.split($e).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},Cn=e=>e.isThemeGetter,An=(e,t)=>t?e.map(([r,s])=>{const o=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([c,a])=>[t+c,a])):i);return[r,o]}):e,Rn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,s=new Map;const o=(i,c)=>{r.set(i,c),t++,t>e&&(t=0,s=r,r=new Map)};return{get(i){let c=r.get(i);if(c!==void 0)return c;if((c=s.get(i))!==void 0)return o(i,c),c},set(i,c){r.has(i)?r.set(i,c):o(i,c)}}},dt="!",En=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,o=t[0],i=t.length,c=a=>{const d=[];let u=0,p=0,x;for(let w=0;w<a.length;w++){let y=a[w];if(u===0){if(y===o&&(s||a.slice(w,w+i)===t)){d.push(a.slice(p,w)),p=w+i;continue}if(y==="/"){x=w;continue}}y==="["?u++:y==="]"&&u--}const f=d.length===0?a:a.substring(p),m=f.startsWith(dt),N=m?f.substring(1):f,v=x&&x>p?x-p:void 0;return{modifiers:d,hasImportantModifier:m,baseClassName:N,maybePostfixModifierPosition:v}};return r?a=>r({className:a,parseClassName:c}):c},Mn=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(s=>{s[0]==="["?(t.push(...r.sort(),s),r=[]):r.push(s)}),t.push(...r.sort()),t},In=e=>({cache:Rn(e.cacheSize),parseClassName:En(e),...jn(e)}),Pn=/\s+/,$n=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],c=e.trim().split(Pn);let a="";for(let d=c.length-1;d>=0;d-=1){const u=c[d],{modifiers:p,hasImportantModifier:x,baseClassName:f,maybePostfixModifierPosition:m}=r(u);let N=!!m,v=s(N?f.substring(0,m):f);if(!v){if(!N){a=u+(a.length>0?" "+a:a);continue}if(v=s(f),!v){a=u+(a.length>0?" "+a:a);continue}N=!1}const w=Mn(p).join(":"),y=x?w+dt:w,g=y+v;if(i.includes(g))continue;i.push(g);const h=o(v,N);for(let b=0;b<h.length;++b){const S=h[b];i.push(y+S)}a=u+(a.length>0?" "+a:a)}return a};function Tn(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=ut(t))&&(s&&(s+=" "),s+=r);return s}const ut=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=ut(e[s]))&&(r&&(r+=" "),r+=t);return r};function Ln(e,...t){let r,s,o,i=c;function c(d){const u=t.reduce((p,x)=>x(p),e());return r=In(u),s=r.cache.get,o=r.cache.set,i=a,a(d)}function a(d){const u=s(d);if(u)return u;const p=$n(d,r);return o(d,p),p}return function(){return i(Tn.apply(null,arguments))}}const Y=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},pt=/^\[(?:([a-z-]+):)?(.+)\]$/i,zn=/^\d+\/\d+$/,Bn=new Set(["px","full","screen"]),Dn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Wn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ne=e=>pe(e)||Bn.has(e)||zn.test(e),se=e=>he(e,"length",Xn),pe=e=>!!e&&!Number.isNaN(Number(e)),je=e=>he(e,"number",pe),be=e=>!!e&&Number.isInteger(Number(e)),On=e=>e.endsWith("%")&&pe(e.slice(0,-1)),P=e=>pt.test(e),oe=e=>Dn.test(e),Gn=new Set(["length","size","percentage"]),Yn=e=>he(e,Gn,ft),_n=e=>he(e,"position",ft),Kn=new Set(["image","url"]),Un=e=>he(e,Kn,Zn),qn=e=>he(e,"",Qn),ve=()=>!0,he=(e,t,r)=>{const s=pt.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},Xn=e=>Vn.test(e)&&!Hn.test(e),ft=()=>!1,Qn=e=>Wn.test(e),Zn=e=>Fn.test(e),Jn=()=>{const e=Y("colors"),t=Y("spacing"),r=Y("blur"),s=Y("brightness"),o=Y("borderColor"),i=Y("borderRadius"),c=Y("borderSpacing"),a=Y("borderWidth"),d=Y("contrast"),u=Y("grayscale"),p=Y("hueRotate"),x=Y("invert"),f=Y("gap"),m=Y("gradientColorStops"),N=Y("gradientColorStopPositions"),v=Y("inset"),w=Y("margin"),y=Y("opacity"),g=Y("padding"),h=Y("saturate"),b=Y("scale"),S=Y("sepia"),R=Y("skew"),L=Y("space"),D=Y("translate"),j=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto",P,t],A=()=>[P,t],$=()=>["",ne,se],V=()=>["auto",pe,P],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],T=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],E=()=>["","0",P],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[pe,P];return{cacheSize:500,separator:":",theme:{colors:[ve],spacing:[ne,se],blur:["none","",oe,P],brightness:z(),borderColor:[e],borderRadius:["none","","full",oe,P],borderSpacing:A(),borderWidth:$(),contrast:z(),grayscale:E(),hueRotate:z(),invert:E(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[On,se],inset:k(),margin:k(),opacity:z(),padding:A(),saturate:z(),scale:z(),sepia:E(),skew:z(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",P]}],container:["container"],columns:[{columns:[oe]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...I(),P]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",be,P]}],basis:[{basis:k()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",P]}],grow:[{grow:E()}],shrink:[{shrink:E()}],order:[{order:["first","last","none",be,P]}],"grid-cols":[{"grid-cols":[ve]}],"col-start-end":[{col:["auto",{span:["full",be,P]},P]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[ve]}],"row-start-end":[{row:["auto",{span:[be,P]},P]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",P]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",P]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",P,t]}],"min-w":[{"min-w":[P,t,"min","max","fit"]}],"max-w":[{"max-w":[P,t,"none","full","min","max","fit","prose",{screen:[oe]},oe]}],h:[{h:[P,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[P,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[P,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[P,t,"auto","min","max","fit"]}],"font-size":[{text:["base",oe,se]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",je]}],"font-family":[{font:[ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",P]}],"line-clamp":[{"line-clamp":["none",pe,je]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ne,P]}],"list-image":[{"list-image":["none",P]}],"list-style-type":[{list:["none","disc","decimal",P]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...T(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ne,se]}],"underline-offset":[{"underline-offset":["auto",ne,P]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",P]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",P]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),_n]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Yn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Un]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...T(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:T()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...T()]}],"outline-offset":[{"outline-offset":[ne,P]}],"outline-w":[{outline:[ne,se]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ne,se]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",oe,qn]}],"shadow-color":[{shadow:[ve]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",oe,P]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[x]}],saturate:[{saturate:[h]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[h]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",P]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",P]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",P]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[be,P]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",P]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",P]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",P]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ne,se,je]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},er=Ln(Jn);function ht(...e){return er(wt.clsx(e))}function tr({autoWidth:e=!0,className:t,style:r}){const[s,o]=l.useState(()=>Z.getActiveAppId()),[i,c]=l.useState(()=>Q.getRunningApps()),{isMobile:a}=Pe();l.useEffect(()=>{const w=Z.subscribe("activeAppId",y=>{o(y)});return()=>{w()}},[]),l.useEffect(()=>Q.subscribe(()=>{c(Q.getRunningApps())}),[]),l.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const g=Z.getActiveAppId();g&&!Q.isRunning(g)&&Q.launchApp(g)}},[]);const d=w=>{Q.closeApp(w)},u=s?de.get(s):null,x=(u==null?void 0:u.width)??400,f=s!==null,v={...{overflow:"hidden",display:f?"flex":"none",flexDirection:"column",flexShrink:0,...e&&f?{width:a?"100%":x}:{}},...r};return n.jsx("div",{className:ht("nc-app-panel",t),style:v,children:i.map(w=>n.jsx(Ie,{appId:w.appId,isActive:s===w.appId,onClose:()=>d(w.appId)},w.appId))})}function nr({pinnedAppIds:e,className:t="",showIndicators:r=!0,side:s="left",getBadge:o}){const{t:i}=J.useTranslation(),{isMobile:c}=Pe(),[a,d]=l.useState(()=>Z.getActiveAppId()),[u,p]=l.useState(()=>Q.getRunningApps());l.useEffect(()=>{const h=Z.subscribe("activeAppId",b=>{d(b)});return()=>{h()}},[]),l.useEffect(()=>Q.subscribe(()=>{p(Q.getRunningApps())}),[]);const x=h=>{a===h?Q.setActiveApp(null):Q.launchApp(h)},f=e.map(h=>de.get(h)).filter(h=>!!h),m=u.filter(h=>!e.includes(h.appId)).map(h=>({running:h,def:de.get(h.appId)})).filter(h=>!!h.def),N=h=>u.some(b=>b.appId===h),v=h=>h.titleKey?String(i(h.titleKey)):h.id,w=h=>typeof h=="number"&&h>99?"99+":h,y=(h,b)=>{const S=o==null?void 0:o(h,b);return S?n.jsx("span",{className:`nc-app-taskbar-badge nc-${S.tone??"default"}`,"aria-label":S.ariaLabel,children:w(S.content)}):null},g=c?24:28;return n.jsxs("div",{className:`nc-app-taskbar ${c?"nc-mobile":"nc-desktop"} nc-${s} ${t}`,children:[f.map(h=>{const b=h.icon,S=a===h.id,R=N(h.id),L={isActive:S,isRunning:R,isPinned:!0};return n.jsxs("button",{className:`nc-app-taskbar-button ${S?"nc-active":""} ${R?"nc-running":""}`,onClick:()=>x(h.id),title:v(h),children:[n.jsx(b,{size:g}),y(h,L),r&&R&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},h.id)}),m.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),m.map(({running:h,def:b})=>{const S=b.icon,R=a===h.appId,L={isActive:R,isRunning:!0,isPinned:!1};return n.jsxs("button",{className:`nc-app-taskbar-button ${R?"nc-active":""} nc-running`,onClick:()=>x(h.appId),title:v(b),children:[n.jsx(S,{size:g}),y(b,L),r&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},h.appId)})]})}function rr({appId:e,open:t,onClose:r,closeOnBackdrop:s=!1,className:o="",style:i}){const c=d=>{s&&d.target===d.currentTarget&&r()};if(!t)return null;const a=n.jsx("div",{className:"nc-dialog-overlay nc-fullscreen",onClick:c,children:n.jsx("div",{className:`nc-app-dialog-container ${o}`,style:i,onClick:d=>d.stopPropagation(),children:n.jsx(Ie,{appId:e,isActive:!0,onClose:r})})});return fe.createPortal(a,document.body)}const Te=l.createContext(null),mt=l.createContext(null);function sr(){const e=l.useContext(Te);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function or(){const e=l.useContext(mt);if(!e)throw new Error("useNavView must be used within NavStack");return e}const Le=l.createContext(null);function ir({rootView:e,children:t}){const{t:r}=J.useTranslation(),s=ot(),[o,i]=l.useState([e]),[c,a]=l.useState([null]),d=l.useCallback((b,S)=>{a(R=>{const L=[...R];return L[b]=S,L})},[]),u=l.useCallback(b=>{a(S=>{const R=[...S];return R[b]=null,R})},[]),p=l.useCallback(b=>{i(S=>[...S,b]),a(S=>[...S,null])},[]),x=l.useCallback(()=>{i(b=>b.length<=1?b:b.slice(0,-1)),a(b=>b.slice(0,-1))},[]),f=l.useCallback(()=>{i([e]),a([null])},[e]),m=o.length,N=m>1,v=o.length-1,w=o[o.length-1],y=w!=null&&w.titleKey?r(w.titleKey):(w==null?void 0:w.title)??"";l.useEffect(()=>{s.setTitle(y)},[y,s]),l.useEffect(()=>{N?s.setBackHandler(x):s.clearBackHandler()},[N,x,s]),l.useEffect(()=>{const b=c[c.length-1];b?s.setToolbar(b):s.clearToolbar()},[c,s]);const g={push:p,pop:x,reset:f,depth:m,canGoBack:N,currentTitle:y},h={stack:o,toolbarStack:c,updateToolbar:d,clearToolbarAt:u,topIndex:v};return n.jsx(Te.Provider,{value:g,children:n.jsx(Le.Provider,{value:h,children:t})})}function cr({index:e,children:t}){const r=l.useContext(Le);if(!r)throw new Error("NavViewProvider must be used within NavStackProvider");const{updateToolbar:s,clearToolbarAt:o,topIndex:i}=r,c=l.useCallback(u=>{e===i&&s(e,u)},[e,i,s]),a=l.useCallback(()=>{e===i&&o(e)},[e,i,o]),d={setToolbar:c,clearToolbar:a};return n.jsx(mt.Provider,{value:d,children:t})}function ar(){const e=l.useContext(Te),t=l.useContext(Le);if(!e||!t)throw new Error("NavStackContainer must be used within a NavStackProvider");const{stack:r}=t;return n.jsx("div",{className:"nav-stack-container",children:n.jsx("div",{className:"nav-stack-content",children:r.map((s,o)=>{const i=o===r.length-1;return n.jsx(cr,{index:o,children:n.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.ActivityIndicator=Re;exports.Alert=kt;exports.AppContainer=Ie;exports.AppContext=Me;exports.AppDialog=rr;exports.AppPanel=tr;exports.AppTaskbar=nr;exports.AppTitleBar=it;exports.Battery=jt;exports.Button=q;exports.ButtonGroup=Nt;exports.Checkbox=Ct;exports.CloseButton=Ee;exports.ComboBox=It;exports.ContextMenu=zt;exports.CsvTextArea=tn;exports.Dialog=Bt;exports.DialogClose=ae;exports.EditButton=$t;exports.Hyperlink=Lt;exports.Input=Je;exports.ListGroup=Wt;exports.ListGroupItem=Ht;exports.MonthRangePicker=Ot;exports.MultiSelect=Ft;exports.NavStackContainer=ar;exports.NavStackProvider=ir;exports.Notification=rt;exports.NotificationContainer=hn;exports.NumberInput=_t;exports.RefreshButton=Pt;exports.Slider=Kt;exports.TabPanel=et;exports.TabPanels=qt;exports.Tabs=Xt;exports.Toggle=Qt;exports.TrashButton=Tt;exports.VersionPicker=dn;exports.ViewportProvider=kn;exports.appRegistry=de;exports.appStateStore=Z;exports.cn=ht;exports.createAppI18nFactory=gn;exports.notificationManager=mn;exports.runningAppsStore=Q;exports.showNotification=st;exports.useApp=ot;exports.useDialog=Ze;exports.useNavStack=sr;exports.useNavView=or;exports.useViewport=Pe;
package/dist/index.d.ts CHANGED
@@ -1154,6 +1154,58 @@ export declare function useNavView(): NavViewContextValue;
1154
1154
  */
1155
1155
  export declare function useViewport(): ViewportContextValue;
1156
1156
 
1157
+ export declare function VersionPicker({ options, value, onChange, disabled, size, placeholder, className, appearance, loading, error, truncated, onRefresh, mode, }: VersionPickerProps): JSX_2.Element;
1158
+
1159
+ export declare interface VersionPickerOption {
1160
+ /** Value passed to `onChange` when the option is picked */
1161
+ value: string;
1162
+ /** Primary text shown in the option row and on the trigger */
1163
+ label: string;
1164
+ /** Secondary line shown under the label and appended to the trigger tooltip */
1165
+ description?: string;
1166
+ /**
1167
+ * `branch` puts the option into the Branches group. Every other kind is
1168
+ * grouped by the release series taken from `value`, falling back to `label`.
1169
+ */
1170
+ kind?: 'branch' | 'version';
1171
+ }
1172
+
1173
+ export declare interface VersionPickerProps {
1174
+ /** Full option list; the component groups and sorts it by release series */
1175
+ options: VersionPickerOption[];
1176
+ /** Currently selected value */
1177
+ value: string;
1178
+ /** Called with the picked option value */
1179
+ onChange: (value: string) => void;
1180
+ /** Whether the picker is disabled */
1181
+ disabled?: boolean;
1182
+ /** Size variant of the trigger */
1183
+ size?: 'default' | 'small';
1184
+ /** Text shown on the trigger while no value is selected */
1185
+ placeholder?: string;
1186
+ /** Additional CSS class names for the trigger wrapper */
1187
+ className?: string;
1188
+ /**
1189
+ * `default` draws the trigger as a bordered field. `plain` drops the frame
1190
+ * until hover and turns it into a field only while the list is open, for use
1191
+ * inline in a toolbar or list row.
1192
+ */
1193
+ appearance?: 'default' | 'plain';
1194
+ /** Renders the trigger as busy and the popover as loading */
1195
+ loading?: boolean;
1196
+ /** Message shown in the popover; while set, options cannot be picked */
1197
+ error?: string;
1198
+ /** Marks a group whose source list was cut short; its header then reads as incomplete */
1199
+ truncated?: {
1200
+ branches?: boolean;
1201
+ tags?: boolean;
1202
+ };
1203
+ /** Shows a refresh action in the popover header */
1204
+ onRefresh?: () => void;
1205
+ /** `refs` labels the list as GitLab branches/tags; `versions` is for other sources. Defaults to `refs` when `onRefresh` is given. */
1206
+ mode?: 'refs' | 'versions';
1207
+ }
1208
+
1157
1209
  /**
1158
1210
  * Viewport context value providing responsive breakpoint information.
1159
1211
  */