@kingsimba/nc-ui 0.1.39 → 0.1.41
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/README.md +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +840 -819
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/yaml.cjs +147 -47
- package/dist/yaml.cjs.map +1 -1
- package/dist/yaml.d.ts +8 -1
- package/dist/yaml.js +5221 -2053
- package/dist/yaml.js.map +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
A high-performance, lightweight React UI component library and extensible application framework.
|
|
4
4
|
|
|
5
5
|
- 🤖 **AI-Optimized**: Comprehensive [AI reference guide](AI_REFERENCE_GUIDE.md) included
|
|
6
|
-
- 🚀 **Small Footprint**:
|
|
6
|
+
- 🚀 **Small Footprint**: ~33KB gzipped core bundle; YAML editor is a separate entry point (~77KB)
|
|
7
7
|
- 🏗️ **[Application Framework](docs/APP_FRAMEWORK.md)**: Features a flexible, extensible framework for building windowed apps, with [app-specific i18n](./nc-ui-ai-reference/translation-guide.md)
|
|
8
8
|
- 📱 **Cross-Platform**: Optimized for both desktop and mobile experiences.
|
|
9
9
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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 te=(e,t,r)=>ft(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),q=require("./GeneratedIcons-CGjL38ny.cjs"),l=require("react"),ve=require("react-dom"),ee=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 X({variant:e="default",block:t,size:r="default",appearance:s="default",className:o,disabled:i,textSelectable:c,loading:a,onClick:d,children:p,...h}){const b=["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(" "),u=x=>{if(!a){if(c){const S=window.getSelection();if(S&&S.toString().length>0)return}d==null||d(x)}};return n.jsxs("button",{className:b,disabled:i||a,onClick:u,...h,children:[a&&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:c,className:a="",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} ${a}`.trim(),style:d,children:[n.jsxs("div",{className:"nc-alert-main",children:[n.jsx("div",{className:`nc-alert-message nc-${r}`,children:p}),c&&n.jsx("button",{type:"button",className:"nc-alert-close","aria-label":"Close alert",onClick:c,children:n.jsx(q.CloseIcon,{size:16})})]}),s&&n.jsx("span",{className:"nc-alert-action",children:n.jsx(X,{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 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,p=14,h=2,b=0,u=12,x=0,S=0,v=0,w=d,k=p,m=k-x*2,f=w-x*2,g=Math.max(1,Math.min(4,k/4)),j=o===0?0:.05+o*.95,y=d+h+u,C=20,$=.65,A=Math.max(p,C*$),R=d+h+1,N=(p-C*$)/2;return n.jsxs("svg",{className:"nc-battery",width:y,height:A,viewBox:`0 0 ${y} ${A}`,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:f*j,height:m,fill:"white"})})}),n.jsx("rect",{x:S,y:v,rx:g,ry:g,width:w,height:k,fill:a}),n.jsx("rect",{x:S+x,y:v+x,width:f,height:m,fill:c,rx:g,ry:g,mask:`url(#nc-battery-fill-mask-${o})`}),n.jsx("text",{x:S+w/2,y:p-3,fontSize:11,fontWeight:"bold",fill:"var(--nc-battery-text-contrast)",textAnchor:"middle",children:i}),n.jsx("rect",{x:d+b,y:p*.26,width:h,height:p*.48,rx:.8,ry:.8,fill:o===1?c:a}),t==="charging"?n.jsx("g",{transform:`translate(${R}, ${N}) scale(${$})`,fill:c,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":""}`,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 wt({size:e}){return n.jsx("svg",{className:`nc-checkbox-icon ${e==="small"?"nc-small":""}`,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:c,className:a=""}){const d=o==="small";return n.jsxs("label",{className:`nc-checkbox-label ${d?"nc-small":""} ${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":""} ${e?"nc-checked":""}`,onKeyDown:p=>{r||(p.key==="Enter"||p.key===" ")&&(p.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:c}){const a=l.useRef(null),{t:d}=ee.useTranslation(),p=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":""} ${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,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 kt({isOpen:e,options:t,onSelect:r,selectedValue:s,placement:o="bottom",anchorRef:i,small:c,highlightedIndex:a=-1,renderOption:d}){const[p,h]=l.useState({top:0,left:0,width:0}),[b,u]=l.useState(o),{t:x}=ee.useTranslation();if(l.useEffect(()=>{if(e&&i.current){const v=i.current.getBoundingClientRect();let w=o;if(o==="bottom"){const k=window.innerHeight-v.bottom,m=v.top;k<320&&m>k&&(w="top")}u(w),h({top:w==="top"?v.top-4:v.bottom+4,left:v.left,width:v.width})}},[e,i,o]),!e)return null;const S=n.jsx("div",{className:"nc-combo-dropdown",onMouseDown:v=>v.stopPropagation(),style:{position:"fixed",top:b==="top"?void 0:p.top,bottom:b==="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 ${c?"nc-small":""}`,children:x("common.noResults")}):t.map((v,w)=>n.jsx(jt,{option:v,onChange:r,selected:v.value===s,highlighted:w===a,small:c,renderOption:d,index:w},v.value))});return ve.createPortal(S,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:c,selectedOption:a,disabled:d,label:p,clearable:h=!0,allowTyping:b=!1,placement:u="bottom",size:x="default",appearance:S="default",textAlign:v="left",style:w,className:k}){const[m,f]=l.useState(!1),[g,j]=l.useState(""),[y,C]=l.useState(-1),$=l.useRef(null),A=l.useRef(null),R=l.useRef(null),N=x==="small",{t:M}=ee.useTranslation(),T=!!o,z=b||T,[se,K]=l.useState([]),[F,O]=l.useState(()=>{if(s&&e){const E=s.find(B=>B.value===e);return E?E.label:""}return o&&e?e:""});l.useEffect(()=>{if(!e){O("");return}if(s){const E=s.find(B=>B.value===e);E&&O(E.label)}else o&&O(e)},[e,s,o]);const G=(E,B=!1)=>{if(!o)return;R.current&&clearTimeout(R.current);const L=async()=>{try{const V=await o(E);K(V),C(-1)}catch{K([])}};B?L():R.current=setTimeout(L,200)},H=l.useMemo(()=>{if(T)return se;const E=g.toLowerCase();return z?(s||[]).filter(B=>B.label.toLowerCase().includes(E)):s||[]},[s,g,z,T,se]);l.useEffect(()=>{m&&C(-1)},[m,H]),l.useEffect(()=>{if(!h&&!e&&s&&s.length>0&&t){const E=s.find(B=>B.default)||s[0];t(E.value)}},[h,e,s,t]),l.useEffect(()=>{function E(B){var L;B.target instanceof Node&&$.current&&((L=$.current.parentElement)!=null&&L.contains(B.target)||f(!1))}return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);const P=a??(s?s.find(E=>E.value===e):e?{label:F,value:e}:void 0),Y=P&&h,oe=!d&&!Y,de=`nc-align-${v}`,fe=!(m&&z)&&!!P,ie=(E,B,L=!1)=>{var V;O(B),t==null||t(E),f(!1),j(""),L&&((V=$.current)==null||V.blur())},he=()=>{t==null||t(void 0),j(""),f(!1)},me=E=>{if(!m){(E.key==="ArrowDown"||E.key==="ArrowUp")&&(f(!0),E.preventDefault());return}const B=(L,V)=>{if(V===1){for(let D=L;D<H.length;D++)if(!H[D].disabled)return D;for(let D=0;D<L;D++)if(!H[D].disabled)return D}else{for(let D=L;D>=0;D--)if(!H[D].disabled)return D;for(let D=H.length-1;D>L;D--)if(!H[D].disabled)return D}return L};switch(E.key){case"ArrowDown":E.preventDefault(),C(L=>{const V=L+1,D=V>=H.length?0:V;return B(D,1)});break;case"ArrowUp":E.preventDefault(),C(L=>{const V=L-1,D=V<0?H.length-1:V;return B(D,-1)});break;case"Enter":E.preventDefault(),y>=0&&y<H.length&&!H[y].disabled&&ie(H[y].value,H[y].label,!0);break;case"Escape":E.preventDefault(),f(!1),j("");break}};return n.jsxs("div",{className:`nc-combo-container ${S==="transparent"?"nc-transparent":""} ${S==="plain"?"nc-plain":""} ${m?"nc-open":""} ${de} ${k||""}`.trim(),style:{position:"relative",...w},children:[p&&n.jsx("span",{className:`nc-label ${N?"nc-small":""}`,children:p}),n.jsxs("div",{ref:A,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:E=>{if(d||z&&E.target===$.current)return;const B=!m;if(f(L=>(!L&&z&&P&&j(P.label),!L)),T&&B){const L=z&&P?P.label:"";K([]),setTimeout(()=>G(L,!0),0)}z&&!m&&setTimeout(()=>{var L,V;(L=$.current)==null||L.focus(),(V=$.current)==null||V.select()},0)},children:[n.jsx("input",{ref:$,className:`nc-input ${N?"nc-small":""}`,placeholder:r,onFocus:()=>{if(!d&&z){f(!0);const E=P?P.label:"";P&&(j(E),setTimeout(()=>{var B;return(B=$.current)==null?void 0:B.select()},0)),T&&(K([]),G(E,!0))}},onChange:E=>{const B=E.target.value;z&&(j(B),T&&G(B))},onKeyDown:me,value:m&&z?g:(P==null?void 0:P.label)||"",readOnly:d||!z,style:{width:"100%",paddingRight:oe||Y?N?32:44:12,caretColor:b?void 0:"transparent",cursor:b?void 0:"pointer",userSelect:b?void 0:"none",color:fe?"transparent":"var(--nc-text)"}}),fe&&n.jsx("div",{"aria-hidden":!0,className:`nc-combo-overlay ${de}`,style:{position:"absolute",left:N?8:12,right:oe||Y?N?12:24:N?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",display:"flex",alignItems:"center",gap:6},children:c&&P?c(P):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`nc-combo-overlay-text ${N?"nc-small":""}`,children:P==null?void 0:P.label}),(P==null?void 0:P.default)&&n.jsxs("span",{className:`nc-combo-overlay-default ${N?"nc-small":""}`,children:["(",M("common.default"),")"]})]})}),Y&&n.jsx(Nt,{onClick:he,small:N}),oe&&n.jsx(St,{open:m,small:N})]}),n.jsx(kt,{isOpen:m,options:H,onSelect:ie,selectedValue:e,placement:u,anchorRef:A,small:N,highlightedIndex:y,renderOption:i})]})}function Ct({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(q.RefreshIcon,{size:c,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(q.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(q.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(q.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 Et({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}),p=o||(s==null?void 0:s.current);if(l.useEffect(()=>{if(!e||!p||!c.current)return;const u=p.getBoundingClientRect(),x=c.current.getBoundingClientRect(),S=window.innerHeight,v=window.innerWidth,w=u.bottom+8,k=w+x.height<=S-8;let m=i;(!k&&i==="down"||i==="up"&&k)&&(m="up");let f;m==="down"?f=w:f=u.top-x.height-8;let g=u.left;g+x.width>v-8&&(g=u.right-x.width),d({top:Math.max(8,f),left:Math.max(8,g)})},[e,p,i]),l.useEffect(()=>{if(!e)return;const u=S=>{c.current&&!c.current.contains(S.target)&&p&&!p.contains(S.target)&&t()},x=S=>{S.key==="Escape"&&t()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",x)}},[e,t,p]),!e)return null;const h=u=>{u.type!=="separator"&&!u.disabled&&u.onClick&&(u.onClick(),t())},b=r.some(u=>u.icon);return ve.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(u=>{if(u.type==="separator")return n.jsx("div",{className:"nc-context-menu-separator",role:"separator"},u.id);const x=["nc-context-menu-item",u.variant&&u.variant!=="default"?`nc-${u.variant}`:"",u.disabled?"nc-disabled":"",b&&!u.icon?"nc-indented":""].filter(Boolean).join(" ");return n.jsxs("button",{className:x,onClick:()=>h(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}=ee.useTranslation(),i=c=>{t==null||t(c),s()};return n.jsx(X,{onClick:i,...r,children:e??o("common.close")})}function $t({open:e,onClose:t,title:r,children:s,style:o,footerType:i="ok-cancel",footer:c,onOk:a,onSave:d,onDelete:p,onCancel:h,onConnect:b,closeOnOverlay:u=!0,primaryDisabled:x=!1,fullScreen:S=!1,hideTitleBar:v=!1,className:w="",onContentHeightChange:k}){const m=l.useRef(null),f=l.useRef(null),{t:g}=ee.useTranslation(),j={close:t},y=A=>{u&&A.target===A.currentTarget&&t()};if(l.useEffect(()=>{e&&m.current&&m.current.focus()},[e]),l.useEffect(()=>{if(!k||!f.current)return;const A=new ResizeObserver(R=>{for(const N of R){const M=N.contentRect.height;k(M)}});return A.observe(f.current),()=>{A.disconnect()}},[k]),!e)return null;const C=()=>{switch(i){case"ok":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(X,{variant:"primary",onClick:a??t,disabled:x,children:g("common.ok")})});case"ok-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:h,children:g("common.cancel")}),n.jsx(X,{variant:"primary",onClick:a??t,disabled:x,children:g("common.ok")})]});case"save-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:h,children:g("common.cancel")}),n.jsx(X,{variant:"primary",onClick:d,disabled:x,children:g("common.save")})]});case"delete-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:h,children:g("common.cancel")}),n.jsx(X,{variant:"danger",onClick:p,disabled:x,children:g("common.delete")})]});case"connect":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:h,children:g("common.cancel")}),n.jsx(X,{variant:"primary",onClick:b,disabled:x,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:c});case"none":return null;default:return null}},$=n.jsx(Ue.Provider,{value:j,children:n.jsx("div",{className:`nc-dialog-overlay${S?" nc-fullscreen":""}`,onClick:y,children:n.jsxs("div",{ref:m,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(Re,{onClick:t,"aria-label":"Close dialog"})]}),n.jsx("div",{ref:f,className:"nc-dialog-content",children:s}),C()]})})});return S?ve.createPortal($,document.body):$}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(q.EyeHiddenIcon,{size:o}):n.jsx(q.ViewIcon,{size:o})})}function Lt({value:e,defaultValue:t="",onChange:r,onChangeConfirmed:s,onEnter:o,onClear:i,placeholder:c,disabled:a,label:d,clearable:p=!0,type:h="text",className:b="",size:u="default",appearance:x="default",style:S,leadingIcon:v,showPasswordToggle:w=!1,multiline:k=!1,rows:m=3,validator:f,showErrorMessage:g=!0}){const j=l.useRef(null),y=l.useRef(null),C=l.useRef(!1),[$,A]=l.useState(!1),[R,N]=l.useState(!1),[M,T]=l.useState(!1),z=e!==void 0,[se,K]=l.useState(t),F=z?e:se,[O,G]=l.useState(F),H=f?f(F):null,P=!!H,Y=!k&&x==="plain",oe=Y&&R,de=oe?O:F;l.useEffect(()=>{oe||G(F)},[F,oe]);const fe=h==="password",ie=fe&&w&&!a&&!k,he=p&&de&&!a&&(R||M),me=u==="small"?32:44;let E=12;he&&ie?E=me*2:(he||ie)&&(E=me);const L=v?u==="small"?28:34:void 0,V=()=>{if(!Y)return F;const _=O!==F;return z||K(O),_&&(r==null||r(O),s==null||s(O)),O},D=()=>{G(F)},ut=()=>{var _,Q,He;if(Y){G(""),i==null||i(),(_=j.current)==null||_.focus();return}z||K(""),r==null||r(""),i==null||i(),k?(Q=y.current)==null||Q.focus():(He=j.current)==null||He.focus()},Le=_=>{if(Y&&_.key==="Escape"){_.preventDefault(),C.current=!0,D(),_.currentTarget.blur();return}if(_.key==="Enter"&&!k){const Q=Y?V():F;Y&&(_.preventDefault(),C.current=!0,_.currentTarget.blur()),o==null||o(Q)}},Be=_=>{const Q=_.target.value;if(Y){G(Q),r==null||r(Q);return}z||K(Q),r==null||r(Q)},ze=()=>{N(!0),Y&&G(F)},De=()=>{if(Y&&C.current){C.current=!1,N(!1);return}Y&&V(),N(!1)},We=`nc-input ${u==="small"?"nc-small ":""}${!k&&x==="plain"?"nc-plain ":""}${P?"nc-error ":""}${b}`;return n.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...S},onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:[d&&n.jsx("span",{className:"nc-label",children:d}),n.jsxs("div",{style:{position:"relative",display:"flex",alignItems:k?"flex-start":"center"},children:[v&&n.jsx("span",{className:"nc-input-leading-icon",style:{height:k?void 0:"100%",top:k?10:void 0},children:v}),k?n.jsx("textarea",{ref:y,className:We,placeholder:c,value:de,onChange:Be,onKeyDown:Le,onFocus:ze,onBlur:De,readOnly:a,"aria-disabled":a,tabIndex:a?-1:void 0,rows:m,style:{width:"100%",paddingRight:E,...L!==void 0?{paddingLeft:L}:{}}}):n.jsx("input",{ref:j,type:fe&&$?"text":h,className:We,placeholder:c,value:de,onChange:Be,onKeyDown:Le,onFocus:ze,onBlur:De,readOnly:a,"aria-disabled":a,tabIndex:a?-1:void 0,style:{width:"100%",paddingRight:E,...L!==void 0?{paddingLeft:L}:{}}}),he&&n.jsx(Tt,{onClick:ut,size:u,rightOffset:ie?me+4:4}),ie&&n.jsx(Pt,{visible:$,onClick:()=>A(!$),size:u})]}),P&&g&&n.jsx("span",{className:"nc-error-message",children:H})]})}function Bt({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 p=window.getSelection();if(p&&p.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},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,c]=l.useState(!1),[a,d]=l.useState(""),p=l.useRef(null),h=l.useMemo(()=>r.filter(u=>u.label.toLowerCase().includes(a.toLowerCase())),[r,a]);l.useEffect(()=>{function u(x){!(x.target instanceof Node)||!p.current||p.current.contains(x.target)||c(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const b=u=>{e.includes(u)?t(e.filter(x=>x!==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 x=r.find(S=>S.value===u);return x?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:[x.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:()=>b(u),"aria-label":`Remove ${x.label}`,children:"✕"})]},u):null}),n.jsx("input",{className:"nc-input",value:a,onChange:u=>d(u.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:[h.map(u=>{const x=e.includes(u.value);return n.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>b(u.value),children:[n.jsx("span",{children:u.label}),n.jsx("span",{children:x?"✔️":""})]},u.value)}),h.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 Ve(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:c="default"}){const[a,d]=l.useState(!1),[p,h]=l.useState(""),[b,u]=l.useState(""),[x,S]=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 N=v.current.getBoundingClientRect(),T=Math.max(N.width,400);window.innerWidth-N.left<T&&N.right>=T?S({top:N.bottom+4,left:0,right:window.innerWidth-N.right,width:T}):S({top:N.bottom+4,left:N.left,right:void 0,width:T})}},[a]),l.useEffect(()=>{if(!a)return;const N=M=>{v.current&&!v.current.contains(M.target)&&w.current&&!w.current.contains(M.target)&&d(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[a]);const k=()=>{h(e||Fe()),u(t||Fe()),d(!0)},m=()=>{d(!1)},f=()=>{const N=we(p),M=we(b);if(N||M)return;const T=xe(p),z=xe(b);T&&z&&(r==null||r(T,z)),d(!1)},g=e&&t?`${Ve(e)} - ${Ve(t)}`:"Select month range",j=we(p),y=we(b),C=xe(p),$=xe(b),A=C&&$&&C>$,R=a?ve.createPortal(n.jsx("div",{ref:w,className:"nc-month-range-picker-popup",style:{position:"fixed",top:x.top,...x.right!==void 0?{right:x.right}:{left:x.left},width:x.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 ${j?"nc-error":""}`,value:p,onChange:N=>h(N.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),j&&n.jsx("div",{className:"nc-month-error-text",children:j})]}),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 ${y?"nc-error":""}`,value:b,onChange:N=>u(N.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),y&&n.jsx("div",{className:"nc-month-error-text",children:y})]})]}),A&&!j&&!y&&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(X,{variant:"primary",onClick:f,disabled:!p||!b||!!j||!!y||!!A,children:"Apply"}),n.jsx(X,{variant:"ghost",onClick:m,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:k,disabled:i,children:g}),R]})}const Ht=5,Vt=3;function Ft({value:e,onChange:t,min:r,max:s,step:o=1,label:i,disabled:c,className:a="",style:d,size:p="default"}){const h=p==="small",b=l.useRef(null),u=l.useRef(!1),[x,S]=l.useState(!1),v=()=>{const y=e-o;r!==void 0&&y<r||t(parseFloat(y.toFixed(10)))},w=()=>{const y=e+o;s!==void 0&&y>s||t(parseFloat(y.toFixed(10)))},k=y=>{const C=parseFloat(y.target.value);isNaN(C)||r!==void 0&&C<r||s!==void 0&&C>s||t(C)},m=y=>{c||y.button!==0||(u.current=!1,b.current={startY:y.clientY,startValue:e,pointerId:y.pointerId,hasMoved:!1,lastValue:e},y.currentTarget.setPointerCapture(y.pointerId))},f=y=>{const C=b.current;if(!C||C.pointerId!==y.pointerId)return;const $=C.startY-y.clientY;if(Math.abs($)>=Vt&&(C.hasMoved=!0,u.current=!0,S(!0)),!C.hasMoved)return;const A=Math.trunc($/Ht);let R=C.startValue+A*o;r!==void 0&&(R=Math.max(r,R)),s!==void 0&&(R=Math.min(s,R)),R=parseFloat(R.toFixed(10)),R!==C.lastValue&&(C.lastValue=R,t(R))},g=y=>{const C=b.current;!C||C.pointerId!==y.pointerId||(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),b.current=null,S(!1))},j=y=>C=>{if(u.current){u.current=!1,C.preventDefault();return}y()};return n.jsxs("div",{className:`nc-col nc-number-input-col ${h?"nc-small":""}`,children:[i&&n.jsx("span",{className:`nc-label ${h?"nc-small":""}`,children:i}),n.jsxs("div",{className:`nc-number-input-container ${h?"nc-small":""} ${a}`,style:d,children:[n.jsx("input",{className:`nc-input nc-number-input ${h?"nc-small":""}`,type:"number",value:e,onChange:k,min:r,max:s,step:o,disabled:c}),n.jsxs("div",{className:`nc-number-input-spinners ${h?"nc-small":""} ${c?"nc-disabled":""} ${x?"nc-dragging":""}`,children:[n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-up ${h?"nc-small":""}`,onClick:j(w),onPointerDown:m,onPointerMove:f,onPointerUp:g,onPointerCancel:g,disabled:c||s!==void 0&&e>=s,tabIndex:-1,children:"▲"}),n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-down ${h?"nc-small":""}`,onClick:j(v),onPointerDown:m,onPointerMove:f,onPointerUp:g,onPointerCancel:g,disabled:c||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:c,showValue:a=!0,formatValue:d=h=>h.toString(),width:p=200}){const h=u=>{const x=parseFloat(u.target.value);t(x)},b=(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:h,min:r,max:s,step:o,disabled:c,style:{width:p,"--nc-slider-percentage":`${b}%`}}),a&&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(a=>l.isValidElement(a)&&(a.type===Xe||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 Kt({tabs:e,active:t,onChange:r,onClose:s,permanentTabs:o,className:i,toolbar:c,multiline:a,orientation:d="horizontal",style:p}){const h=l.useRef(null),[b,u]=l.useState(!1),[x,S]=l.useState(!1),v=d==="verticalLeft"||d==="verticalRight",w=l.useRef(!1),k=l.useRef(0),m=l.useRef(0),f=l.useRef(!1);l.useEffect(()=>{const A=()=>{if(h.current)if(v){const{scrollTop:N,scrollHeight:M,clientHeight:T}=h.current;u(N>1),S(N<M-T-1)}else{const{scrollLeft:N,scrollWidth:M,clientWidth:T}=h.current;u(N>1),S(N<M-T-1)}},R=h.current;if(R)return A(),R.addEventListener("scroll",A),window.addEventListener("resize",A),()=>{R.removeEventListener("scroll",A),window.removeEventListener("resize",A)}},[e,v]);const g=A=>{h.current&&(w.current=!0,f.current=!1,k.current=v?A.clientY:A.clientX,m.current=v?h.current.scrollTop:h.current.scrollLeft,h.current.style.cursor="grabbing",h.current.style.userSelect="none")},j=A=>{if(!w.current||!h.current)return;const R=v?A.clientY:A.clientX,N=k.current-R;Math.abs(N)>3&&(f.current=!0),v?h.current.scrollTop=m.current+N:h.current.scrollLeft=m.current+N},y=()=>{h.current&&(w.current=!1,h.current.style.cursor="",h.current.style.userSelect="")},C=()=>{y()};l.useEffect(()=>{const A=h.current;if(!A||v)return;const R=N=>{N.deltaY!==0&&(N.preventDefault(),A.scrollLeft+=N.deltaY*.3)};return A.addEventListener("wheel",R,{passive:!1}),()=>{A.removeEventListener("wheel",R)}},[v]);const $=A=>{f.current||r(A)};return n.jsxs("div",{className:`nc-tab-container ${v?`nc-vertical nc-${d}`:""} ${i||""}`,style:p,children:[n.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[b&&n.jsx("div",{className:`nc-tab-scroll-indicator ${v?"nc-top":"nc-left"}`,children:v?n.jsx(Gt,{size:16}):n.jsx(q.ChevronLeftIcon,{size:16})}),n.jsx("div",{ref:h,className:`nc-tab-scroll ${a?"nc-multiline":""}`,onMouseDown:g,onMouseMove:j,onMouseUp:y,onMouseLeave:C,style:{cursor:"grab"},children:e.map(A=>{const R=typeof A=="string"?A:A.id,N=typeof A=="string"?A:A.label,M=s&&!(o!=null&&o.includes(R));return n.jsxs("div",{className:`nc-tab-item ${t===R?"nc-active":""} ${M?"nc-closable":""}`,onClick:()=>$(R),role:"button",tabIndex:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&r(R)},children:[n.jsx("span",{className:"nc-tab-label",children:v?N:typeof N=="string"?N.toUpperCase():N}),M&&n.jsx("span",{className:"nc-tab-close",role:"button",tabIndex:0,"aria-label":`Close ${typeof N=="string"?N:R}`,onClick:T=>{T.stopPropagation(),s(R)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.stopPropagation(),s(R))},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"})]})})]},R)})}),x&&n.jsx("div",{className:`nc-tab-scroll-indicator ${v?"nc-bottom":"nc-right"}`,children:v?n.jsx(q.ChevronDownIcon,{size:16}):n.jsx(q.ChevronRightIcon,{size:16})})]}),c&&n.jsx("div",{className:"nc-tab-toolbar",children:c})]})}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,
|
|
3
|
-
`),i=Math.max(1,Math.min(t,o.length));let
|
|
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:
|
|
5
|
-
`).length,[t]),
|
|
6
|
-
`).map((g,
|
|
7
|
-
`]},j)}):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:b,children:n.jsx("pre",{className:"nc-csv-textarea-highlights",children:k(t)})}),n.jsx("textarea",{ref:h,className:"nc-csv-textarea-input",value:t,onChange:m=>{r(m.target.value),requestAnimationFrame(x)},onScroll:S,onSelect:x,onKeyUp:x,onClick:x,placeholder:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off"})]})]})});let ce={notifications:[]};const Ne=new Set,Ge=new Map;function Se(){const e=ce.notifications.slice();for(const t of Array.from(Ne))try{t(e)}catch{}}function Qt(e){Ne.add(e);try{e(ce.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 ce.notifications=[i,...ce.notifications],Se(),i.duration&&i.duration>0&&setTimeout(()=>{Je(t)},i.duration),t}function Je(e){const t=ce.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,Se();const r=window.setTimeout(()=>{ce.notifications=ce.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}=ee.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(q.CloseIcon,{size:16})})]})})}function tn(){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(()=>Qt(p=>{const h=new Set(a.current.map(u=>u.id)),b=p.filter(u=>!h.has(u.id)).map(u=>u.id);b.length>0?(t(p),i(new Set(b)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(p),a.current=p}),[]),l.useEffect(()=>{if(!c.current)return;const d=new Map;let p=0;const h=c.current.children;e.forEach((b,u)=>{if(d.set(b.id,p),h[u]){const x=h[u].offsetHeight;b.isRemoving||(p+=x+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 p=o.has(d.id),h=d.isRemoving,b=r.get(d.id)||0;return n.jsx("div",{style:{position:"absolute",top:0,left:0,transform:p?`translate3d(-40px, ${b}px, 0)`:`translate3d(0, ${b}px, 0)`,transition:h?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:h?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 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 sn{constructor(){te(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 le=new sn,Ye="nc-ui-app-state";class on{constructor(){te(this,"state");te(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 J=new on;class an{constructor(){te(this,"apps",[]);te(this,"activeAppId",null);te(this,"listeners",new Set);te(this,"refReadyResolvers",new Map)}async launchApp(t,r){const{launchInBackground:s=!1}=r||{};if(!le.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),J._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,J._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,J._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(),J._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?le.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 U=new an,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 cn({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(cn,{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}=ee.useTranslation(),o=le.get(e),[i,c]=l.useState(""),[a,d]=l.useState(null),[p,h]=l.useState(null),[b,u]=l.useState(!1),[x,S]=l.useState(!1);l.useEffect(()=>{o!=null&&o.titleKey&&c(s(o.titleKey))},[o,s]);const v=l.useCallback(A=>{c(A)},[]),w=l.useCallback(A=>{d(()=>A)},[]),k=l.useCallback(()=>{d(null)},[]),m=l.useCallback(A=>{h(A)},[]),f=l.useCallback(()=>{h(null)},[]),g=l.useCallback(A=>{u(A)},[]),j=l.useCallback(A=>{S(A)},[]),y=l.useMemo(()=>({setTitle:v,setBackHandler:w,clearBackHandler:k,setToolbar:m,clearToolbar:f,setHideBackButton:g,setHideTitleBar:j,close:r}),[v,w,k,m,f,g,j,r]);if(!o)return null;const C=o.component,$=!o.hideTitleBar&&!x;return n.jsxs("div",{className:`nc-app-container${t?"":" nc-hidden"}`,children:[$&&n.jsx(tt,{title:i,onClose:r,onBack:a??void 0,toolbar:p,hideBackButton:b}),n.jsx("div",{className:"nc-app-content-wrapper",style:{padding:o.padding,overflowY:$?"auto":void 0},children:n.jsx(Me.Provider,{value:y,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(C,{})})})})})]})}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 Ee(){return l.useContext(rt)}const $e="-",un=e=>{const t=fn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const a=c.split($e);return a[0]===""&&a.length!==1&&a.shift(),st(a,t)||pn(c)},getConflictingClassGroupIds:(c,a)=>{const d=r[c]||[];return a&&s[c]?[...d,...s[c]]:d}}},st=(e,t)=>{var c;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($e);return(c=t.validators.find(({validator:a})=>a(i)))==null?void 0:c.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,c])=>{Ae(c,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,c])=>{Ae(c,_e(t,i),r,s)})})},_e=(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},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(([c,a])=>[t+c,a])):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,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)}}},ot="!",bn=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,o=t[0],i=t.length,c=a=>{const d=[];let p=0,h=0,b;for(let w=0;w<a.length;w++){let k=a[w];if(p===0){if(k===o&&(s||a.slice(w,w+i)===t)){d.push(a.slice(h,w)),h=w+i;continue}if(k==="/"){b=w;continue}}k==="["?p++:k==="]"&&p--}const u=d.length===0?a:a.substring(h),x=u.startsWith(ot),S=x?u.substring(1):u,v=b&&b>h?b-h:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}};return r?a=>r({className:a,parseClassName:c}):c},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=[],c=e.trim().split(wn);let a="";for(let d=c.length-1;d>=0;d-=1){const p=c[d],{modifiers:h,hasImportantModifier:b,baseClassName:u,maybePostfixModifierPosition:x}=r(p);let S=!!x,v=s(S?u.substring(0,x):u);if(!v){if(!S){a=p+(a.length>0?" "+a:a);continue}if(v=s(u),!v){a=p+(a.length>0?" "+a:a);continue}S=!1}const w=xn(h).join(":"),k=b?w+ot:w,m=k+v;if(i.includes(m))continue;i.push(m);const f=o(v,S);for(let g=0;g<f.length;++g){const j=f[g];i.push(k+j)}a=p+(a.length>0?" "+a:a)}return a};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=c;function c(d){const p=t.reduce((h,b)=>b(h),e());return r=vn(p),s=r.cache.get,o=r.cache.set,i=a,a(d)}function a(d){const p=s(d);if(p)return p;const h=yn(d,r);return o(d,h),h}return function(){return i(jn.apply(null,arguments))}}const W=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},at=/^\[(?:([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)\(.+\)$/,Z=e=>ue(e)||Sn.has(e)||Nn.test(e),ne=e=>pe(e,"length",Dn),ue=e=>!!e&&!Number.isNaN(Number(e)),ke=e=>pe(e,"number",ue),ge=e=>!!e&&Number.isInteger(Number(e)),En=e=>e.endsWith("%")&&ue(e.slice(0,-1)),I=e=>at.test(e),re=e=>An.test(e),$n=new Set(["length","size","percentage"]),Tn=e=>pe(e,$n,ct),Pn=e=>pe(e,"position",ct),Ln=new Set(["image","url"]),Bn=e=>pe(e,Ln,Hn),zn=e=>pe(e,"",Wn),be=()=>!0,pe=(e,t,r)=>{const s=at.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),ct=()=>!1,Wn=e=>Mn.test(e),Hn=e=>In.test(e),Vn=()=>{const e=W("colors"),t=W("spacing"),r=W("blur"),s=W("brightness"),o=W("borderColor"),i=W("borderRadius"),c=W("borderSpacing"),a=W("borderWidth"),d=W("contrast"),p=W("grayscale"),h=W("hueRotate"),b=W("invert"),u=W("gap"),x=W("gradientColorStops"),S=W("gradientColorStopPositions"),v=W("inset"),w=W("margin"),k=W("opacity"),m=W("padding"),f=W("saturate"),g=W("scale"),j=W("sepia"),y=W("skew"),C=W("space"),$=W("translate"),A=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",I,t],M=()=>[I,t],T=()=>["",Z,ne],z=()=>["auto",ue,I],se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",I],H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[ue,I];return{cacheSize:500,separator:":",theme:{colors:[be],spacing:[Z,ne],blur:["none","",re,I],brightness:P(),borderColor:[e],borderRadius:["none","","full",re,I],borderSpacing:M(),borderWidth:T(),contrast:P(),grayscale:G(),hueRotate:P(),invert:G(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[En,ne],inset:N(),margin:N(),opacity:P(),padding:M(),saturate:P(),scale:P(),sepia:G(),skew:P(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",I]}],container:["container"],columns:[{columns:[re]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"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:[...se(),I]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],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",ge,I]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",I]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",ge,I]}],"grid-cols":[{"grid-cols":[be]}],"col-start-end":[{col:["auto",{span:["full",ge,I]},I]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[be]}],"row-start-end":[{row:["auto",{span:[ge,I]},I]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",I]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",I]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"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:[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":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",I,t]}],"min-w":[{"min-w":[I,t,"min","max","fit"]}],"max-w":[{"max-w":[I,t,"none","full","min","max","fit","prose",{screen:[re]},re]}],h:[{h:[I,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[I,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[I,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[I,t,"auto","min","max","fit"]}],"font-size":[{text:["base",re,ne]}],"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",I]}],"line-clamp":[{"line-clamp":["none",ue,ke]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Z,I]}],"list-image":[{"list-image":["none",I]}],"list-style-type":[{list:["none","disc","decimal",I]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Z,ne]}],"underline-offset":[{"underline-offset":["auto",Z,I]}],"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:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",I]}],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",I]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...se(),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:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],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":[k]}],"border-style":[{border:[...K(),"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":[k]}],"divide-style":[{divide:K()}],"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:["",...K()]}],"outline-offset":[{"outline-offset":[Z,I]}],"outline-w":[{outline:[Z,ne]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Z,ne]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",re,zn]}],"shadow-color":[{shadow:[be]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",re,I]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[b]}],saturate:[{saturate:[f]}],sepia:[{sepia:[j]}],"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":[h]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[f]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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",I]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",I]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",I]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[g]}],"scale-x":[{"scale-x":[g]}],"scale-y":[{"scale-y":[g]}],rotate:[{rotate:[ge,I]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[y]}],"skew-y":[{"skew-y":[y]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",I]}],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",I]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",I]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Z,ne,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(Vn);function lt(...e){return Fn(mt.clsx(e))}function On({autoWidth:e=!0,className:t,style:r}){const[s,o]=l.useState(()=>J.getActiveAppId()),[i,c]=l.useState(()=>U.getRunningApps()),{isMobile:a}=Ee();l.useEffect(()=>{const w=J.subscribe("activeAppId",k=>{o(k)});return()=>{w()}},[]),l.useEffect(()=>U.subscribe(()=>{c(U.getRunningApps())}),[]),l.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const m=J.getActiveAppId();m&&!U.isRunning(m)&&U.launchApp(m)}},[]);const d=w=>{U.closeApp(w)},p=s?le.get(s):null,b=(p==null?void 0:p.width)??400,u=s!==null,v={...{overflow:"hidden",display:u?"flex":"none",flexDirection:"column",flexShrink:0,...e&&u?{width:a?"100%":b}:{}},...r};return n.jsx("div",{className:lt("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 Gn({pinnedAppIds:e,className:t="",showIndicators:r=!0,side:s="left",getBadge:o}){const{t:i}=ee.useTranslation(),{isMobile:c}=Ee(),[a,d]=l.useState(()=>J.getActiveAppId()),[p,h]=l.useState(()=>U.getRunningApps());l.useEffect(()=>{const f=J.subscribe("activeAppId",g=>{d(g)});return()=>{f()}},[]),l.useEffect(()=>U.subscribe(()=>{h(U.getRunningApps())}),[]);const b=f=>{a===f?U.setActiveApp(null):U.launchApp(f)},u=e.map(f=>le.get(f)).filter(f=>!!f),x=p.filter(f=>!e.includes(f.appId)).map(f=>({running:f,def:le.get(f.appId)})).filter(f=>!!f.def),S=f=>p.some(g=>g.appId===f),v=f=>f.titleKey?String(i(f.titleKey)):f.id,w=f=>typeof f=="number"&&f>99?"99+":f,k=(f,g)=>{const j=o==null?void 0:o(f,g);return j?n.jsx("span",{className:`nc-app-taskbar-badge nc-${j.tone??"default"}`,"aria-label":j.ariaLabel,children:w(j.content)}):null},m=c?24:28;return n.jsxs("div",{className:`nc-app-taskbar ${c?"nc-mobile":"nc-desktop"} nc-${s} ${t}`,children:[u.map(f=>{const g=f.icon,j=a===f.id,y=S(f.id),C={isActive:j,isRunning:y,isPinned:!0};return n.jsxs("button",{className:`nc-app-taskbar-button ${j?"nc-active":""} ${y?"nc-running":""}`,onClick:()=>b(f.id),title:v(f),children:[n.jsx(g,{size:m}),k(f,C),r&&y&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},f.id)}),x.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),x.map(({running:f,def:g})=>{const j=g.icon,y=a===f.appId,C={isActive:y,isRunning:!0,isPinned:!1};return n.jsxs("button",{className:`nc-app-taskbar-button ${y?"nc-active":""} nc-running`,onClick:()=>b(f.appId),title:v(g),children:[n.jsx(j,{size:m}),k(g,C),r&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},f.appId)})]})}function Yn({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 ve.createPortal(a,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}=ee.useTranslation(),s=et(),[o,i]=l.useState([e]),[c,a]=l.useState([null]),d=l.useCallback((g,j)=>{a(y=>{const C=[...y];return C[g]=j,C})},[]),p=l.useCallback(g=>{a(j=>{const y=[...j];return y[g]=null,y})},[]),h=l.useCallback(g=>{i(j=>[...j,g]),a(j=>[...j,null])},[]),b=l.useCallback(()=>{i(g=>g.length<=1?g:g.slice(0,-1)),a(g=>g.slice(0,-1))},[]),u=l.useCallback(()=>{i([e]),a([null])},[e]),x=o.length,S=x>1,v=o.length-1,w=o[o.length-1],k=w!=null&&w.titleKey?r(w.titleKey):(w==null?void 0:w.title)??"";l.useEffect(()=>{s.setTitle(k)},[k,s]),l.useEffect(()=>{S?s.setBackHandler(b):s.clearBackHandler()},[S,b,s]),l.useEffect(()=>{const g=c[c.length-1];g?s.setToolbar(g):s.clearToolbar()},[c,s]);const m={push:h,pop:b,reset:u,depth:x,canGoBack:S,currentTitle:k},f={stack:o,toolbarStack:c,updateToolbar:d,clearToolbarAt:p,topIndex:v};return n.jsx(Te.Provider,{value:m,children:n.jsx(Pe.Provider,{value:f,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,c=l.useCallback(p=>{e===i&&s(e,p)},[e,i,s]),a=l.useCallback(()=>{e===i&&o(e)},[e,i,o]),d={setToolbar:c,clearToolbar:a};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=X;exports.ButtonGroup=vt;exports.Checkbox=yt;exports.CloseButton=Re;exports.ComboBox=At;exports.ContextMenu=Et;exports.CsvTextArea=Jt;exports.Dialog=$t;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=le;exports.appStateStore=J;exports.cn=lt;exports.createAppI18nFactory=rn;exports.notificationManager=nn;exports.runningAppsStore=U;exports.showNotification=Ze;exports.useApp=et;exports.useDialog=qe;exports.useNavStack=Kn;exports.useNavView=_n;exports.useViewport=Ee;
|
|
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-CGjL38ny.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,...h}){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,...h,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,h=2,w=0,u=12,b=0,k=0,x=0,v=d,y=p,m=y-b*2,f=v-b*2,g=Math.max(1,Math.min(4,y/4)),N=o===0?0:.05+o*.95,A=d+h+u,$=20,L=.65,S=Math.max(p,$*L),T=d+h+1,j=(p-$*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:f*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:f,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:h,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":""}`,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":""}`,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";return n.jsxs("label",{className:`nc-checkbox-label ${d?"nc-small":""} ${r?"nc-disabled":""} ${c}`.trim(),style:a,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":""} ${e?"nc-checked":""}`,onKeyDown:p=>{r||(p.key==="Enter"||p.key===" ")&&(p.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,h]=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),h({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:h=!0,allowTyping:w=!1,placement:u="bottom",size:b="default",appearance:k="default",textAlign:x="left",style:v,className:y}){const[m,f]=l.useState(!1),[g,N]=l.useState(""),[A,$]=l.useState(-1),L=l.useRef(null),S=l.useRef(null),T=l.useRef(null),j=b==="small",{t:C}=te.useTranslation(),P=!!o,V=w||P,[M,E]=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 W=(I,H=!1)=>{if(!o)return;T.current&&clearTimeout(T.current);const z=async()=>{try{const Y=await o(I);E(Y),$(-1)}catch{E([])}};H?z():T.current=setTimeout(z,200)},G=l.useMemo(()=>{if(P)return M;const I=g.toLowerCase();return V?(s||[]).filter(H=>H.label.toLowerCase().includes(I)):s||[]},[s,g,V,P,M]);l.useEffect(()=>{m&&$(-1)},[m,G]),l.useEffect(()=>{if(!h&&!e&&s&&s.length>0&&t){const I=s.find(H=>H.default)||s[0];t(I.value)}},[h,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)||f(!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&&h,oe=!d&&!_,de=`nc-align-${x}`,fe=!(m&&V)&&!!B,ie=(I,H,z=!1)=>{var Y;K(H),t==null||t(I),f(!1),N(""),z&&((Y=L.current)==null||Y.blur())},he=()=>{t==null||t(void 0),N(""),f(!1)},me=I=>{if(!m){(I.key==="ArrowDown"||I.key==="ArrowUp")&&(f(!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(),$(z=>{const Y=z+1,F=Y>=G.length?0:Y;return H(F,1)});break;case"ArrowUp":I.preventDefault(),$(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&&ie(G[A].value,G[A].label,!0);break;case"Escape":I.preventDefault(),f(!1),N("");break}};return n.jsxs("div",{className:`nc-combo-container ${k==="transparent"?"nc-transparent":""} ${k==="plain"?"nc-plain":""} ${m?"nc-open":""} ${de} ${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||V&&I.target===L.current)return;const H=!m;if(f(z=>(!z&&V&&B&&N(B.label),!z)),P&&H){const z=V&&B?B.label:"";E([]),setTimeout(()=>W(z,!0),0)}V&&!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":""}`,placeholder:r,onFocus:()=>{if(!d&&V){f(!0);const I=B?B.label:"";B&&(N(I),setTimeout(()=>{var H;return(H=L.current)==null?void 0:H.select()},0)),P&&(E([]),W(I,!0))}},onChange:I=>{const H=I.target.value;V&&(N(H),P&&W(H))},onKeyDown:me,value:m&&V?g:(B==null?void 0:B.label)||"",readOnly:d||!V,style:{width:"100%",paddingRight:oe||_?j?32:44:12,caretColor:w?void 0:"transparent",cursor:w?void 0:"pointer",userSelect:w?void 0:"none",color:fe?"transparent":"var(--nc-text)"}}),fe&&n.jsx("div",{"aria-hidden":!0,className:`nc-combo-overlay ${de}`,style:{position:"absolute",left:j?8:12,right:oe||_?j?12:24:j?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",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:ie,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 Et({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 f;m==="down"?f=v:f=u.top-b.height-8;let g=u.left;g+b.width>x-8&&(g=u.right-b.width),d({top:Math.max(8,f),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 h=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:()=>h(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 ce({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 $t({open:e,onClose:t,title:r,children:s,style:o,footerType:i="ok-cancel",footer:a,onOk:c,onSave:d,onDelete:p,onCancel:h,onConnect:w,closeOnOverlay:u=!0,primaryDisabled:b=!1,fullScreen:k=!1,hideTitleBar:x=!1,className:v="",onContentHeightChange:y}){const m=l.useRef(null),f=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||!f.current)return;const S=new ResizeObserver(T=>{for(const j of T){const C=j.contentRect.height;y(C)}});return S.observe(f.current),()=>{S.disconnect()}},[y]),!e)return null;const $=()=>{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(ce,{onClick:h,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(ce,{onClick:h,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(ce,{onClick:h,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(ce,{onClick:h,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(ce,{variant:"primary"})});case"gotit":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(ce,{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:f,className:"nc-dialog-content",children:s}),$()]})})});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:h="text",className:w="",size:u="default",appearance:b="default",style:k,leadingIcon:x,showPasswordToggle:v=!1,multiline:y=!1,rows:m=3,validator:f,showErrorMessage:g=!0}){const N=l.useRef(null),A=l.useRef(null),$=l.useRef(!1),[L,S]=l.useState(!1),[T,j]=l.useState(!1),[C,P]=l.useState(!1),V=e!==void 0,[M,E]=l.useState(t),D=V?e:M,[K,W]=l.useState(D),G=f?f(D):null,B=!!G,_=!y&&b==="plain",oe=_&&T,de=oe?K:D;l.useEffect(()=>{oe||W(D)},[D,oe]);const fe=h==="password",ie=fe&&v&&!c&&!y,he=p&&de&&!c&&(T||C),me=u==="small"?32:44;let I=12;he&&ie?I=me*2:(he||ie)&&(I=me);const z=x?u==="small"?28:34:void 0,Y=()=>{if(!_)return D;const U=K!==D;return V||E(K),U&&(r==null||r(K),s==null||s(K)),K},F=()=>{W(D)},ut=()=>{var U,Z,We;if(_){W(""),i==null||i(),(U=N.current)==null||U.focus();return}V||E(""),r==null||r(""),i==null||i(),y?(Z=A.current)==null||Z.focus():(We=N.current)==null||We.focus()},Le=U=>{if(_&&U.key==="Escape"){U.preventDefault(),$.current=!0,F(),U.currentTarget.blur();return}if(U.key==="Enter"&&!y){const Z=_?Y():D;_&&(U.preventDefault(),$.current=!0,U.currentTarget.blur()),o==null||o(Z)}},Be=U=>{const Z=U.target.value;if(_){W(Z),r==null||r(Z);return}V||E(Z),r==null||r(Z)},ze=()=>{j(!0),_&&W(D)},De=()=>{if(_&&$.current){$.current=!1,j(!1);return}_&&Y(),j(!1)},Ve=`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:Ve,placeholder:a,value:de,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:fe&&L?"text":h,className:Ve,placeholder:a,value:de,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:ie?me+4:4}),ie&&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},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),h=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:[h.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)}),h.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 Vt({startMonth:e,endMonth:t,onChange:r,label:s,className:o="",disabled:i=!1,size:a="default"}){const[c,d]=l.useState(!1),[p,h]=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=()=>{h(e||Fe()),u(t||Fe()),d(!0)},m=()=>{d(!1)},f=()=>{const j=we(p),C=we(w);if(j||C)return;const P=xe(p),V=xe(w);P&&V&&(r==null||r(P,V)),d(!1)},g=e&&t?`${He(e)} - ${He(t)}`:"Select month range",N=we(p),A=we(w),$=xe(p),L=xe(w),S=$&&L&&$>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=>h(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:f,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 Wt=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 h=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)),f=M=>parseFloat(M.toFixed(w)),g=M=>{const E=f(M);m(String(E)),t(E)},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)))},$=M=>{const E=M.target.value;if(m(E),E==="")return;const D=parseFloat(E);isNaN(D)||t(D)},L=()=>{const M=y;if(M===""){g(r!==void 0?r:0);return}const E=parseFloat(M);if(isNaN(E)){g(r!==void 0?r:0);return}let D=f(E);r!==void 0&&(D=Math.max(r,D)),s!==void 0&&(D=Math.min(s,D)),D!==E?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 E=u.current;if(!E||E.pointerId!==M.pointerId)return;const D=E.startY-M.clientY;if(Math.abs(D)>=Ht&&(E.hasMoved=!0,b.current=!0,k.current&&(clearTimeout(k.current),k.current=null),v(!0)),!E.hasMoved)return;const K=Math.trunc(D/Wt);let W=E.startValue+K*o;r!==void 0&&(W=Math.max(r,W)),s!==void 0&&(W=Math.min(s,W)),W=f(W),W!==E.lastValue&&(E.lastValue=W,m(String(W)),t(W))},j=M=>{const E=u.current;!E||E.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=>E=>{if(b.current){b.current=!1,E.preventDefault();return}M()},P=y===""?NaN:parseFloat(y),V=y===""||isNaN(P)||r!==void 0&&P<r||s!==void 0&&P>s;return n.jsxs("div",{className:`nc-col nc-number-input-col ${h?"nc-small":""}`,children:[i&&n.jsx("span",{className:`nc-label ${h?"nc-small":""}`,children:i}),n.jsxs("div",{className:`nc-number-input-container ${h?"nc-small":""} ${c}`,style:d,children:[n.jsx("input",{className:`nc-input nc-number-input ${h?"nc-small":""} ${V?"nc-error":""}`,type:"number",value:y,onChange:$,onBlur:L,min:r,max:s,step:o,disabled:a}),n.jsxs("div",{className:`nc-number-input-spinners ${h?"nc-small":""} ${a?"nc-disabled":""} ${x?"nc-dragging":""}`,children:[n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-up ${h?"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 ${h?"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=h=>h.toString(),width:p=200}){const h=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:h,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 h=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),f=l.useRef(!1);l.useEffect(()=>{const S=()=>{if(h.current)if(x){const{scrollTop:j,scrollHeight:C,clientHeight:P}=h.current;u(j>1),k(j<C-P-1)}else{const{scrollLeft:j,scrollWidth:C,clientWidth:P}=h.current;u(j>1),k(j<C-P-1)}},T=h.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=>{h.current&&(v.current=!0,f.current=!1,y.current=x?S.clientY:S.clientX,m.current=x?h.current.scrollTop:h.current.scrollLeft,h.current.style.cursor="grabbing",h.current.style.userSelect="none")},N=S=>{if(!v.current||!h.current)return;const T=x?S.clientY:S.clientX,j=y.current-T;Math.abs(j)>3&&(f.current=!0),x?h.current.scrollTop=m.current+j:h.current.scrollLeft=m.current+j},A=()=>{h.current&&(v.current=!1,h.current.style.cursor="",h.current.style.userSelect="")},$=()=>{A()};l.useEffect(()=>{const S=h.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=>{f.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:h,className:`nc-tab-scroll ${c?"nc-multiline":""}`,onMouseDown:g,onMouseMove:N,onMouseUp:A,onMouseLeave:$,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 h=Math.max(1,Math.min(s,d[p-1].length+1));return a+=h-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 h=l.useRef(null),w=l.useRef(null),u=l.useRef(null);l.useImperativeHandle(p,()=>({goToLine(m){const f=h.current;if(!f)return;const g=Xt(t,m);f.focus(),f.setSelectionRange(g,g);const N=parseFloat(getComputedStyle(f).lineHeight)||18;f.scrollTop=(Math.max(1,m)-1)*N,k(),b()},goToPosition(m,f,g){const N=h.current;if(!N)return;const A=qt(t,m,f,g);N.focus(),N.setSelectionRange(A,A);const $=parseFloat(getComputedStyle(N).lineHeight)||18;N.scrollTop=(Math.max(1,m)-1)*$,k(),b()}}),[t]);const b=l.useCallback(()=>{if(!c||!h.current)return;const m=Ut(t,h.current.selectionStart);c(m)},[c,t]),k=l.useCallback(()=>{const m=h.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=h.current;if(!m)return;const f=parseFloat(getComputedStyle(m).lineHeight)||18,g=(d-1)*f,N=g+f;(g<m.scrollTop||N>m.scrollTop+m.clientHeight)&&(m.scrollTop=g-m.clientHeight/2+f/2),k()},[d]);const x=l.useMemo(()=>t.split(`
|
|
5
|
+
`).length,[t]),v=()=>{const m=[];for(let f=1;f<=x;f++)m.push(n.jsx("div",{className:`nc-csv-line-number ${d===f?"nc-csv-highlight":""}`,children:f},f));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(($,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:$})]},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:h,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 ae={notifications:[]};const Ne=new Set,Ge=new Map;function Se(){const e=ae.notifications.slice();for(const t of Array.from(Ne))try{t(e)}catch{}}function Qt(e){Ne.add(e);try{e(ae.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 ae.notifications=[i,...ae.notifications],Se(),i.duration&&i.duration>0&&setTimeout(()=>{Je(t)},i.duration),t}function Je(e){const t=ae.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,Se();const r=window.setTimeout(()=>{ae.notifications=ae.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 h=new Set(c.current.map(u=>u.id)),w=p.filter(u=>!h.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 h=a.current.children;e.forEach((w,u)=>{if(d.set(w.id,p),h[u]){const b=h[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),h=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:h?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:h?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 le=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(!le.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?le.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=le.get(e),[i,a]=l.useState(""),[c,d]=l.useState(null),[p,h]=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=>{h(S)},[]),f=l.useCallback(()=>{h(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:f,setHideBackButton:g,setHideTitleBar:N,close:r}),[x,v,y,m,f,g,N,r]);if(!o)return null;const $=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($,{})})})})})]})}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 Ee(){return l.useContext(rt)}const $e="-",un=e=>{const t=fn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:a=>{const c=a.split($e);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($e);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($e).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,h=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(h,v)),h=v+i;continue}if(y==="/"){w=v;continue}}y==="["?p++:y==="]"&&p--}const u=d.length===0?c:c.substring(h),b=u.startsWith(ot),k=b?u.substring(1):u,x=w&&w>h?w-h: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:h,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(h).join(":"),y=w?v+ot:v,m=y+x;if(i.includes(m))continue;i.push(m);const f=o(x,k);for(let g=0;g<f.length;++g){const N=f[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((h,w)=>w(h),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 h=yn(d,r);return o(d,h),h}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=>ue(e)||Sn.has(e)||Nn.test(e),re=e=>pe(e,"length",Dn),ue=e=>!!e&&!Number.isNaN(Number(e)),ke=e=>pe(e,"number",ue),ge=e=>!!e&&Number.isInteger(Number(e)),En=e=>e.endsWith("%")&&ue(e.slice(0,-1)),R=e=>ct.test(e),se=e=>An.test(e),$n=new Set(["length","size","percentage"]),Tn=e=>pe(e,$n,at),Pn=e=>pe(e,"position",at),Ln=new Set(["image","url"]),Bn=e=>pe(e,Ln,Wn),zn=e=>pe(e,"",Vn),be=()=>!0,pe=(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,Vn=e=>Mn.test(e),Wn=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"),h=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"),f=O("saturate"),g=O("scale"),N=O("sepia"),A=O("skew"),$=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],V=()=>["auto",ue,R],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],E=()=>["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"],W=()=>["","0",R],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[ue,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:W(),hueRotate:B(),invert:W(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[En,re],inset:j(),margin:j(),opacity:B(),padding:C(),saturate:B(),scale:B(),sepia:W(),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:W()}],shrink:[{shrink:W()}],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":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[be]}],"row-start-end":[{row:["auto",{span:[ge,R]},R]}],"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",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":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"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",ue,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:[...E(),"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:[...E(),"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:E()}],"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:["",...E()]}],"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":[h]}],invert:[{invert:[w]}],saturate:[{saturate:[f]}],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":[h]}],"backdrop-invert":[{"backdrop-invert":[w]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[f]}],"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}=Ee();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?le.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}=Ee(),[c,d]=l.useState(()=>Q.getActiveAppId()),[p,h]=l.useState(()=>q.getRunningApps());l.useEffect(()=>{const f=Q.subscribe("activeAppId",g=>{d(g)});return()=>{f()}},[]),l.useEffect(()=>q.subscribe(()=>{h(q.getRunningApps())}),[]);const w=f=>{c===f?q.setActiveApp(null):q.launchApp(f)},u=e.map(f=>le.get(f)).filter(f=>!!f),b=p.filter(f=>!e.includes(f.appId)).map(f=>({running:f,def:le.get(f.appId)})).filter(f=>!!f.def),k=f=>p.some(g=>g.appId===f),x=f=>f.titleKey?String(i(f.titleKey)):f.id,v=f=>typeof f=="number"&&f>99?"99+":f,y=(f,g)=>{const N=o==null?void 0:o(f,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(f=>{const g=f.icon,N=c===f.id,A=k(f.id),$={isActive:N,isRunning:A,isPinned:!0};return n.jsxs("button",{className:`nc-app-taskbar-button ${N?"nc-active":""} ${A?"nc-running":""}`,onClick:()=>w(f.id),title:x(f),children:[n.jsx(g,{size:m}),y(f,$),r&&A&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},f.id)}),b.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),b.map(({running:f,def:g})=>{const N=g.icon,A=c===f.appId,$={isActive:A,isRunning:!0,isPinned:!1};return n.jsxs("button",{className:`nc-app-taskbar-button ${A?"nc-active":""} nc-running`,onClick:()=>w(f.appId),title:x(g),children:[n.jsx(N,{size:m}),y(g,$),r&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},f.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 $=[...A];return $[g]=N,$})},[]),p=l.useCallback(g=>{c(N=>{const A=[...N];return A[g]=null,A})},[]),h=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:h,pop:w,reset:u,depth:b,canGoBack:k,currentTitle:y},f={stack:o,toolbarStack:a,updateToolbar:d,clearToolbarAt:p,topIndex:x};return n.jsx(Te.Provider,{value:m,children:n.jsx(Pe.Provider,{value:f,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=Et;exports.CsvTextArea=Jt;exports.Dialog=$t;exports.DialogClose=ce;exports.EditButton=Rt;exports.Hyperlink=It;exports.Input=Lt;exports.ListGroup=zt;exports.ListGroupItem=Bt;exports.MonthRangePicker=Vt;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=le;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=Ee;
|
|
8
8
|
//# sourceMappingURL=index.cjs.map
|