@kingsimba/nc-ui 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Fe=Object.defineProperty;var Ue=(e,t,n)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var O=(e,t,n)=>Ue(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("react"),se=require("react-dom"),U=require("react-i18next"),W=require("./GeneratedIcons-HAHchVYC.cjs"),Ke=require("i18next"),qe=require("./clsx-C11secjj.cjs");function he({size:e="default",color:t,overlay:n=!1,className:r=""}){const o=s.jsx("svg",{className:`nc-activity-indicator nc-${e} ${r}`,viewBox:"0 0 50 50",style:t?{color:t}:void 0,children:s.jsx("circle",{className:"nc-activity-indicator-circle",cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round"})});return n?s.jsx("div",{className:"nc-activity-indicator-overlay",children:o}):o}function D({variant:e="default",block:t,size:n="default",className:r,disabled:o,textSelectable:i,loading:c,onClick:a,children:d,...f}){const m=["nc-button",e!=="default"?`nc-${e}`:"",t?"nc-block":"",n==="small"?"nc-small":"",n==="large"?"nc-large":"",o||c?"nc-disabled":"",i?"nc-text-selectable":"",c?"nc-loading":"",r??""].filter(Boolean).join(" "),h=l=>{if(!c){if(i){const p=window.getSelection();if(p&&p.toString().length>0)return}a==null||a(l)}};return s.jsxs("button",{className:m,disabled:o||c,onClick:h,...f,children:[c&&s.jsx(he,{size:"small",className:"nc-button-spinner",color:e!=="default"&&e!=="ghost"?"white":void 0}),d]})}function _e({code:e,text:t,type:n,button:r,onAction:o}){return s.jsxs("div",{className:`nc-alert nc-${n}`,children:[s.jsxs("span",{className:`nc-alert-message nc-${n}`,children:[s.jsx("span",{className:"nc-alert-code",children:e}),t]}),r&&s.jsx("span",{className:"nc-alert-action",children:s.jsx(D,{size:"small",variant:r.variant??(n==="error"?"danger":"warning"),onClick:o,children:r.text})})]})}function Je({percentage:e=.5,status:t="discharging",darkMode:n=!1,colored:r=!1}){const o=Math.max(0,Math.min(1,Number(e)||0));let i;r?o<.1?i="var(--nc-danger)":o<.2?i="var(--nc-warning)":i="var(--nc-success)":i=n?"#ffffff":"#000000";const c=n?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.2)",a=24,d=14,f=2,m=0,h=12,l=0,p=0,g=0,b=a,x=d,y=x-l*2,j=b-l*2,R=Math.max(1,Math.min(4,x/4)),w=o===0?0:.05+o*.95,A=a+f+h,S=20,v=.65,C=Math.max(d,S*v),k=a+f+1,E=(d-S*v)/2;return s.jsxs("svg",{className:"nc-battery",width:A,height:C,viewBox:`0 0 ${A} ${C}`,role:"img","aria-label":`Battery ${o===0?"-":Math.round(o*100)+"%"} ${t}`,children:[s.jsxs("defs",{children:[s.jsx("mask",{id:`nc-battery-fill-mask-${o}`,children:s.jsx("rect",{x:"0",y:"0",width:j*w,height:y,fill:"white"})}),s.jsxs("mask",{id:`nc-battery-text-mask-${o}`,children:[s.jsx("rect",{x:"0",y:"0",width:A,height:C,fill:"white"}),s.jsx("text",{x:p+b/2,y:d-3,fontSize:11,fontWeight:"bold",fill:"black",textAnchor:"middle",children:o===0?"-":Math.round(o*100)})]})]}),s.jsxs("g",{mask:`url(#nc-battery-text-mask-${o})`,children:[s.jsx("rect",{x:p,y:g,rx:R,ry:R,width:b,height:x,fill:c}),s.jsx("rect",{x:p+l,y:g+l,width:j,height:y,fill:i,rx:R,ry:R,mask:`url(#nc-battery-fill-mask-${o})`}),s.jsx("rect",{x:a+m,y:d*.26,width:f,height:d*.48,rx:.8,ry:.8,fill:o===1?i:c}),t==="charging"?s.jsx("g",{transform:`translate(${k}, ${E}) scale(${v})`,fill:i,children:s.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})]})}function Xe({value:e,onChange:t,options:n,disabled:r,labels:o,size:i="default"}){return s.jsx("div",{className:`nc-button-group ${i==="small"?"nc-small":""}`,children:n.map((c,a)=>s.jsx("button",{className:`nc-button-group-item ${e===c?"nc-active":""} ${a<n.length-1?"nc-has-border":""}`,onClick:()=>!r&&t(c),disabled:r,children:o&&o[c]?o[c]:c},c))})}function Qe({size:e}){return s.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:s.jsx("path",{d:"M2 6L5 9L10 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ze({checked:e,onChange:t,disabled:n,label:r,size:o="default",labelColor:i,style:c,className:a=""}){const d=o==="small";return s.jsxs("label",{className:`nc-checkbox-label ${d?"nc-small":""} ${n?"nc-disabled":""} ${a}`.trim(),style:c,onClick:f=>{n||(f.preventDefault(),t(!e))},children:[s.jsx("span",{role:"checkbox","aria-checked":e,tabIndex:0,className:`nc-checkbox-box ${d?"nc-small":""} ${e?"nc-checked":""}`,onKeyDown:f=>{n||(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),t(!e))},children:e&&s.jsx(Qe,{size:o})}),r&&s.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:r})]})}function et({option:e,onChange:t,selected:n,highlighted:r,small:o}){const i=u.useRef(null),{t:c}=U.useTranslation();return u.useEffect(()=>{r&&i.current&&i.current.scrollIntoView({block:"nearest"})},[r]),s.jsxs("div",{ref:i,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${r?"nc-highlighted":""}`,role:"option",onMouseDown:()=>t(e.value),"aria-selected":n,style:{cursor:"pointer",background:r?"rgba(59,130,246,0.18)":n?"rgba(59,130,246,0.12)":void 0},children:[e.label,e.default&&s.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",c("common.default"),")"]})]})}function tt({isOpen:e,options:t,onSelect:n,selectedValue:r,placement:o="bottom",anchorRef:i,small:c,highlightedIndex:a=-1}){const[d,f]=u.useState({top:0,left:0,width:0}),[m,h]=u.useState(o),{t:l}=U.useTranslation();if(u.useEffect(()=>{if(e&&i.current){const g=i.current.getBoundingClientRect();let b=o;if(o==="bottom"){const x=window.innerHeight-g.bottom,y=g.top;x<320&&y>x&&(b="top")}h(b),f({top:b==="top"?g.top-4:g.bottom+4,left:g.left,width:g.width})}},[e,i,o]),!e)return null;const p=s.jsx("div",{className:"nc-combo-dropdown",style:{position:"fixed",top:m==="top"?void 0:d.top,bottom:m==="top"?window.innerHeight-d.top:void 0,left:d.left,width:d.width,zIndex:1e3,maxHeight:300,overflowY:"auto"},children:t.length===0?s.jsx("div",{className:`nc-combo-dropdown-option nc-no-results ${c?"nc-small":""}`,children:l("common.noResults")}):t.map((g,b)=>s.jsx(et,{option:g,onChange:n,selected:g.value===r,highlighted:b===a,small:c},g.value))});return se.createPortal(p,document.body)}function nt({onClick:e,small:t}){return s.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:e,onMouseDown:n=>n.stopPropagation(),"aria-label":"Clear selection",children:"✕"})}function rt({open:e,onClick:t,small:n}){return s.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-toggle ${n?"nc-small":""} ${e?"nc-open":""}`,onClick:t,onMouseDown:r=>r.stopPropagation(),"aria-label":e?"Close":"Open",children:"▾"})}function st({value:e,onChange:t,placeholder:n="Select…",options:r,disabled:o,label:i,clearable:c=!0,allowTyping:a=!1,placement:d="bottom",size:f="default",style:m,className:h}){const[l,p]=u.useState(!1),[g,b]=u.useState(""),[x,y]=u.useState(-1),j=u.useRef(null),R=u.useRef(null),w=f==="small",{t:A}=U.useTranslation(),S=u.useMemo(()=>{const I=g.toLowerCase();return a?r.filter($=>$.label.toLowerCase().includes(I)):r},[r,g,a]);u.useEffect(()=>{l&&y(-1)},[l,S]),u.useEffect(()=>{if(!c&&!e&&r.length>0&&t){const I=r.find($=>$.default)||r[0];t(I.value)}},[c,e,r,t]),u.useEffect(()=>{function I($){var P;$.target instanceof Node&&j.current&&((P=j.current.parentElement)!=null&&P.contains($.target)||p(!1))}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);const v=r.find(I=>I.value===e),C=v&&c,k=!o&&!C,E=!(l&&a)&&!!v,T=(I,$=!1)=>{var P;t==null||t(I),p(!1),b(""),$&&((P=j.current)==null||P.blur())},M=()=>{t==null||t(void 0),b(""),p(!1)},B=I=>{if(!l){(I.key==="ArrowDown"||I.key==="ArrowUp")&&(p(!0),I.preventDefault());return}switch(I.key){case"ArrowDown":I.preventDefault(),y($=>{const P=$+1;return P>=S.length?0:P});break;case"ArrowUp":I.preventDefault(),y($=>{const P=$-1;return P<0?S.length-1:P});break;case"Enter":I.preventDefault(),x>=0&&x<S.length&&T(S[x].value,!0);break;case"Escape":I.preventDefault(),p(!1),b("");break}};return s.jsxs("div",{className:`nc-combo-container ${h||""}`.trim(),style:{position:"relative",...m},children:[i&&s.jsx("span",{className:`nc-label ${w?"nc-small":""}`,children:i}),s.jsxs("div",{ref:R,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:I=>{o||a&&I.target===j.current||(p($=>(!$&&a&&v&&b(v.label),!$)),a&&!l&&setTimeout(()=>{var $,P;($=j.current)==null||$.focus(),(P=j.current)==null||P.select()},0))},children:[s.jsx("input",{ref:j,className:`nc-input ${w?"nc-small":""}`,placeholder:n,onFocus:()=>{var I;!o&&a&&(p(!0),v&&(b(v.label),setTimeout(()=>{var $;return($=j.current)==null?void 0:$.select()},0))),a||(I=j.current)==null||I.blur()},onChange:I=>a&&b(I.target.value),onKeyDown:B,value:l&&a?g:(v==null?void 0:v.label)||"",readOnly:o||!a,style:{width:"100%",paddingRight:k||C?w?32:44:12,caretColor:a?void 0:"transparent",cursor:a?void 0:"pointer",userSelect:a?void 0:"none",color:E?"transparent":"var(--nc-text)"}}),E&&s.jsxs("div",{"aria-hidden":!0,style:{position:"absolute",left:w?8:12,right:k||C?w?12:24:w?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",display:"flex",alignItems:"center",gap:6,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[s.jsx("span",{className:`nc-combo-overlay-text ${w?"nc-small":""}`,children:v==null?void 0:v.label}),(v==null?void 0:v.default)&&s.jsxs("span",{className:`nc-combo-overlay-default ${w?"nc-small":""}`,children:["(",A("common.default"),")"]})]}),C&&s.jsx(nt,{onClick:M,small:w}),k&&s.jsx(rt,{open:l,onClick:()=>p(I=>!I),small:w})]}),s.jsx(tt,{isOpen:l,options:S,onSelect:T,selectedValue:e,placement:d,anchorRef:R,small:w,highlightedIndex:x})]})}function ot({onClick:e,loading:t=!1,disabled:n=!1,size:r="default",title:o,"aria-label":i}){const c=r==="small"?14:r==="large"?20:18,a=t?"Refreshing...":"Refresh",d=t?"Refreshing":"Refresh";return s.jsx("button",{className:"nc-icon-button",onClick:e,disabled:n||t,title:o??a,"aria-label":i??d,"data-size":r,children:s.jsx(W.RefreshIcon,{size:c,className:t?"nc-spinning":""})})}function me({onClick:e,disabled:t=!1,size:n="default",title:r="Close","aria-label":o="Close"}){const i=n==="small"?14:n==="large"?20:18;return s.jsx("button",{className:"nc-icon-button nc-icon-button-close",onClick:e,disabled:t,title:r,"aria-label":o,"data-size":n,children:s.jsx(W.CloseIcon,{size:i})})}function it({onClick:e,disabled:t=!1,size:n="default",title:r="Edit","aria-label":o="Edit"}){const i=n==="small"?14:n==="large"?20:18;return s.jsx("button",{className:"nc-icon-button nc-icon-button-edit",onClick:e,disabled:t,title:r,"aria-label":o,"data-size":n,children:s.jsx(W.EditIcon,{size:i})})}function at({onClick:e,disabled:t=!1,size:n="default",title:r="Delete","aria-label":o="Delete"}){const i=n==="small"?14:n==="large"?20:18;return s.jsx("button",{className:"nc-icon-button nc-icon-button-trash",onClick:e,disabled:t,title:r,"aria-label":o,"data-size":n,children:s.jsx(W.TrashIcon,{size:i})})}function ct({onClick:e,disabled:t=!1,children:n,title:r,"aria-label":o,size:i="default"}){return s.jsx("button",{className:"nc-hyperlink",onClick:e,disabled:t,title:r,"aria-label":o,"data-size":i,children:n})}function lt({open:e,onClose:t,options:n,anchorRef:r,anchor:o,preferredDirection:i="down"}){const c=u.useRef(null),[a,d]=u.useState({top:0,left:0}),f=o||(r==null?void 0:r.current);if(u.useEffect(()=>{if(!e||!f||!c.current)return;const h=f.getBoundingClientRect(),l=c.current.getBoundingClientRect(),p=window.innerHeight,g=window.innerWidth,b=h.bottom+8,x=b+l.height<=p-8;let y=i;(!x&&i==="down"||i==="up"&&x)&&(y="up");let j;y==="down"?j=b:j=h.top-l.height-8;let R=h.left;R+l.width>g-8&&(R=h.right-l.width),d({top:Math.max(8,j),left:Math.max(8,R)})},[e,f,i]),u.useEffect(()=>{if(!e)return;const h=p=>{c.current&&!c.current.contains(p.target)&&f&&!f.contains(p.target)&&t()},l=p=>{p.key==="Escape"&&t()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",l)}},[e,t,f]),!e)return null;const m=h=>{h.disabled||(h.onClick(),t())};return se.createPortal(s.jsx("div",{ref:c,className:"nc-context-menu",style:{position:"fixed",top:`${a.top}px`,left:`${a.left}px`,zIndex:1e4},role:"menu",children:n.map(h=>s.jsxs("button",{className:`nc-context-menu-item ${h.variant==="danger"?"nc-danger":""} ${h.disabled?"nc-disabled":""}`,onClick:()=>m(h),disabled:h.disabled,role:"menuitem",children:[h.icon&&s.jsx("span",{className:"nc-context-menu-icon",children:h.icon}),s.jsx("span",{className:"nc-context-menu-label",children:h.label})]},h.id))}),document.body)}const Re=u.createContext(null);function Ee(){const e=u.useContext(Re);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function K({children:e,onClick:t,...n}){const{close:r}=Ee(),{t:o}=U.useTranslation(),i=c=>{t==null||t(c),r()};return s.jsx(D,{onClick:i,...n,children:e??o("common.close")})}function J(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function dt({open:e,onClose:t,title:n,children:r,width:o=360,height:i,minWidth:c,minHeight:a,maxWidth:d="95vw",maxHeight:f="95vh",footerType:m="ok-cancel",footer:h,onOk:l,onSave:p,onDelete:g,onCancel:b,onConnect:x,closeOnOverlay:y=!0,primaryDisabled:j=!1,fullScreen:R=!1,hideTitleBar:w=!1}){const A=u.useRef(null),{t:S}=U.useTranslation(),v={close:t},C=T=>{y&&T.target===T.currentTarget&&t()};if(u.useEffect(()=>{e&&A.current&&A.current.focus()},[e]),!e)return null;const k=()=>{switch(m){case"ok":return s.jsx("div",{className:"nc-dialog-footer",children:s.jsx(D,{variant:"primary",onClick:l??t,disabled:j,children:S("common.ok")})});case"ok-cancel":return s.jsxs("div",{className:"nc-dialog-footer",children:[s.jsx(D,{variant:"primary",onClick:l??t,disabled:j,children:S("common.ok")}),s.jsx(K,{variant:"ghost",onClick:b,children:S("common.cancel")})]});case"save-cancel":return s.jsxs("div",{className:"nc-dialog-footer",children:[s.jsx(D,{variant:"primary",onClick:p,disabled:j,children:S("common.save")}),s.jsx(K,{variant:"ghost",onClick:b,children:S("common.cancel")})]});case"delete-cancel":return s.jsxs("div",{className:"nc-dialog-footer",children:[s.jsx(D,{variant:"danger",onClick:g,disabled:j,children:S("common.delete")}),s.jsx(K,{variant:"ghost",onClick:b,children:S("common.cancel")})]});case"connect":return s.jsxs("div",{className:"nc-dialog-footer",children:[s.jsx(D,{variant:"primary",onClick:x,disabled:j,children:S("common.connect")}),s.jsx(K,{variant:"ghost",onClick:b,children:S("common.cancel")})]});case"close":return s.jsx("div",{className:"nc-dialog-footer",children:s.jsx(K,{variant:"primary"})});case"gotit":return s.jsx("div",{className:"nc-dialog-footer",children:s.jsx(K,{variant:"primary",children:S("common.gotit")})});case"custom":return s.jsx("div",{className:"nc-dialog-footer",children:h});case"none":return null;default:return null}},E=s.jsx(Re.Provider,{value:v,children:s.jsx("div",{className:`nc-dialog-overlay${R?" nc-fullscreen":""}`,onClick:C,children:s.jsxs("div",{ref:A,className:"nc-dialog-container",style:{width:J(o),height:J(i),minWidth:J(c),minHeight:J(a),maxWidth:J(d),maxHeight:J(f)},tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":w?void 0:"nc-dialog-title",children:[!w&&s.jsxs("div",{className:"nc-dialog-header",children:[s.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:n}),s.jsx(me,{onClick:t,"aria-label":"Close dialog"})]}),s.jsx("div",{className:"nc-dialog-content",children:r}),k()]})})});return R?se.createPortal(E,document.body):E}function ut({onClick:e,size:t="default",rightOffset:n=4}){const r=t==="small"?28:34;return s.jsx("button",{className:"nc-button nc-ghost",onClick:e,onMouseDown:o=>o.stopPropagation(),tabIndex:-1,"aria-label":"Clear input",style:{position:"absolute",right:n,padding:0,minHeight:0,height:r,width:r,border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:t==="small"?"12px":"14px"},children:"✕"})}function pt({visible:e,onClick:t,size:n="default"}){const r=n==="small"?28:34,o=n==="small"?16:18;return s.jsx("button",{className:"nc-button nc-ghost",onClick:t,onMouseDown:i=>i.stopPropagation(),tabIndex:-1,"aria-label":e?"Hide password":"Show password",style:{position:"absolute",right:4,padding:0,minHeight:0,height:r,width:r,border:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:e?s.jsx(W.EyeHiddenIcon,{size:o}):s.jsx(W.ViewIcon,{size:o})})}function ft({value:e="",onChange:t,onEnter:n,onClear:r,placeholder:o,disabled:i,label:c,clearable:a=!0,type:d="text",className:f="",size:m="default",style:h,showPasswordToggle:l=!1,multiline:p=!1,rows:g=3,validator:b,showErrorMessage:x=!0}){const y=u.useRef(null),j=u.useRef(null),[R,w]=u.useState(!1),A=b?b(e):null,S=!!A,v=d==="password",C=v&&l&&!i&&!p,k=a&&e&&!i,E=m==="small"?32:44;let T=12;k&&C?T=E*2:(k||C)&&(T=E);const M=()=>{var P,Z;t==null||t(""),r==null||r(),p?(P=j.current)==null||P.focus():(Z=y.current)==null||Z.focus()},B=P=>{P.key==="Enter"&&!p&&(n==null||n())},I=P=>{t==null||t(P.target.value)},$=`nc-input ${m==="small"?"nc-small ":""} ${S?"nc-error ":""}${f}`;return s.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...h},children:[c&&s.jsx("span",{className:"nc-label",children:c}),s.jsxs("div",{style:{position:"relative",display:"flex",alignItems:p?"flex-start":"center"},children:[p?s.jsx("textarea",{ref:j,className:$,placeholder:o,value:e,onChange:I,onKeyDown:B,disabled:i,rows:g,style:{width:"100%",paddingRight:T,resize:"vertical"}}):s.jsx("input",{ref:y,type:v&&R?"text":d,className:$,placeholder:o,value:e,onChange:I,onKeyDown:B,disabled:i,style:{width:"100%",paddingRight:T}}),k&&s.jsx(ut,{onClick:M,size:m,rightOffset:C?E+4:4}),C&&s.jsx(pt,{visible:R,onClick:()=>w(!R),size:m})]}),S&&x&&s.jsx("span",{className:"nc-error-message",children:A})]})}function ht({children:e,onClick:t,showBorder:n=!0,selectable:r=!1,style:o}){const[i,c]=u.useState(!1),a=d=>{if(t){if(r){const f=window.getSelection();if(f&&f.toString().length>0)return}t(d)}};return s.jsx("div",{onClick:a,onMouseDown:()=>t&&c(!0),onMouseUp:()=>c(!1),onMouseLeave:()=>c(!1),style:{cursor:t?"pointer":"default",userSelect:r?"text":void 0,borderBottom:n?void 0:"none",...o},className:`nc-list-group-item ${t?"nc-list-group-item-clickable":""} ${i?"nc-list-group-item-active":""}`,children:s.jsx("div",{style:{flex:1},children:e})})}function mt({title:e,titleTools:t,children:n,style:r}){return s.jsxs("div",{className:"nc-list-group",style:r,children:[(e||t)&&s.jsxs("div",{className:"nc-list-group-title",children:[s.jsx("div",{children:e}),t&&s.jsx("div",{className:"nc-list-group-title-tools",children:t})]}),s.jsx("div",{className:"nc-list-group-content",children:n})]})}function gt({values:e,onChange:t,options:n,placeholder:r="Select…",label:o}){const[i,c]=u.useState(!1),[a,d]=u.useState(""),f=u.useRef(null),m=u.useMemo(()=>n.filter(l=>l.label.toLowerCase().includes(a.toLowerCase())),[n,a]);u.useEffect(()=>{function l(p){!(p.target instanceof Node)||!f.current||f.current.contains(p.target)||c(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]);const h=l=>{e.includes(l)?t(e.filter(p=>p!==l)):t([...e,l])};return s.jsxs("div",{ref:f,className:"nc-col",style:{position:"relative"},children:[o&&s.jsx("span",{className:"nc-label",children:o}),s.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&&s.jsx("span",{className:"nc-label",children:r}),e.map(l=>{const p=n.find(g=>g.value===l);return p?s.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:[p.label,s.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:()=>h(l),"aria-label":`Remove ${p.label}`,children:"✕"})]},l):null}),s.jsx("input",{className:"nc-input",value:a,onChange:l=>d(l.target.value),onFocus:()=>c(!0),style:{minWidth:50,border:"none",background:"transparent",padding:4,minHeight:32,flex:1}})]}),i&&s.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:[m.map(l=>{const p=e.includes(l.value);return s.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>h(l.value),children:[s.jsx("span",{children:l.label}),s.jsx("span",{children:p?"✔️":""})]},l.value)}),m.length===0&&s.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}const bt=["January","February","March","April","May","June","July","August","September","October","November","December"];function oe(e){if(!e)return null;const t=/^\d{2}-\d{1,2}$/,n=/^\d{4}-\d{1,2}$/;if(!t.test(e)&&!n.test(e))return"Format must be YY-M(M) or YYYY-M(M)";const r=e.split("-"),o=parseInt(r[1],10);return o<1||o>12?"Month must be between 1 and 12":null}function re(e){if(!e)return"";const t=e.split("-");if(t.length!==2)return e;let n=t[0];const r=t[1].padStart(2,"0");if(n.length===2){const o=parseInt(n,10);n=String(o<50?2e3+o:1900+o)}return`${n}-${r}`}function ke(e){if(!e)return"";const t=re(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[n,r]=t.split("-"),o=parseInt(r,10)-1;return`${bt[o]} ${n}`}function Ne(){const e=new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0");return`${t}-${n}`}function xt({startMonth:e,endMonth:t,onChange:n,label:r,className:o="",disabled:i=!1}){const[c,a]=u.useState(!1),[d,f]=u.useState(""),[m,h]=u.useState(""),[l,p]=u.useState({top:0,left:0,width:0}),g=u.useRef(null),b=u.useRef(null);u.useEffect(()=>{if(c&&g.current){const E=g.current.getBoundingClientRect();p({top:E.bottom+4,left:E.left,width:E.width})}},[c]),u.useEffect(()=>{if(!c)return;const E=T=>{g.current&&!g.current.contains(T.target)&&b.current&&!b.current.contains(T.target)&&a(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[c]);const x=()=>{f(e||Ne()),h(t||Ne()),a(!0)},y=()=>{a(!1)},j=()=>{const E=oe(d),T=oe(m);if(E||T)return;const M=re(d),B=re(m);M&&B&&(n==null||n(M,B)),a(!1)},R=e&&t?`${ke(e)} - ${ke(t)}`:"Select month range",w=oe(d),A=oe(m),S=re(d),v=re(m),C=S&&v&&S>v,k=c?se.createPortal(s.jsx("div",{ref:b,className:"nc-month-range-picker-popup",style:{position:"fixed",top:l.top,left:l.left,width:Math.max(l.width,400),zIndex:1e3},children:s.jsxs("div",{className:"nc-month-range-picker-content",children:[s.jsxs("div",{className:"nc-month-range-picker-row",children:[s.jsxs("div",{className:"nc-month-range-picker-column",children:[s.jsx("label",{className:"nc-label",children:"Start Month"}),s.jsx("input",{type:"text",className:`nc-month-input ${w?"nc-error":""}`,value:d,onChange:E=>f(E.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),w&&s.jsx("div",{className:"nc-month-error-text",children:w})]}),s.jsxs("div",{className:"nc-month-range-picker-column",children:[s.jsx("label",{className:"nc-label",children:"End Month"}),s.jsx("input",{type:"text",className:`nc-month-input ${A?"nc-error":""}`,value:m,onChange:E=>h(E.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),A&&s.jsx("div",{className:"nc-month-error-text",children:A})]})]}),C&&!w&&!A&&s.jsx("div",{className:"nc-month-range-error",children:"End month must be after or equal to start month"}),s.jsxs("div",{className:"nc-month-range-picker-footer",children:[s.jsx(D,{variant:"primary",onClick:j,disabled:!d||!m||!!w||!!A||!!C,children:"Apply"}),s.jsx(D,{variant:"ghost",onClick:y,children:"Cancel"})]})]})}),document.body):null;return s.jsxs("div",{className:`nc-month-range-picker ${o}`,children:[r&&s.jsx("label",{className:"nc-label",children:r}),s.jsx("button",{ref:g,className:"nc-month-range-picker-input",onClick:x,disabled:i,children:R}),k]})}function vt({value:e,onChange:t,min:n,max:r,step:o=1,label:i,disabled:c,size:a="default"}){const d=a==="small",f=()=>{const l=e-o;n!==void 0&&l<n||t(parseFloat(l.toFixed(10)))},m=()=>{const l=e+o;r!==void 0&&l>r||t(parseFloat(l.toFixed(10)))},h=l=>{const p=parseFloat(l.target.value);isNaN(p)||n!==void 0&&p<n||r!==void 0&&p>r||t(p)};return s.jsxs("div",{className:`nc-col nc-number-input-col ${d?"nc-small":""}`,children:[i&&s.jsx("span",{className:`nc-label ${d?"nc-small":""}`,children:i}),s.jsxs("div",{className:`nc-number-input-container ${d?"nc-small":""}`,children:[s.jsx("input",{className:`nc-input nc-number-input ${d?"nc-small":""}`,type:"number",value:e,onChange:h,min:n,max:r,step:o,disabled:c}),s.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${d?"nc-small":""}`,onClick:f,disabled:c||n!==void 0&&e<=n,children:"−"}),s.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${d?"nc-small":""}`,onClick:m,disabled:c||r!==void 0&&e>=r,children:"+"})]})]})}function wt({value:e,onChange:t,min:n=0,max:r=100,step:o=1,label:i,disabled:c,showValue:a=!0,formatValue:d=m=>m.toString(),width:f=200}){const m=l=>{const p=parseFloat(l.target.value);t(p)},h=(e-n)/(r-n)*100;return s.jsxs("div",{className:"nc-col",style:{gap:6},children:[i&&s.jsx("span",{className:"nc-label",children:i}),s.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[s.jsx("input",{type:"range",className:"nc-slider",value:e,onChange:m,min:n,max:r,step:o,disabled:c,style:{width:f,"--nc-slider-percentage":`${h}%`}}),a&&s.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:d(e)})]})]})}const yt=({size:e=24,className:t,style:n})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,style:n,children:s.jsx("polyline",{points:"18 15 12 9 6 15"})});function jt({tabs:e,active:t,onChange:n,className:r,toolbar:o,multiline:i,orientation:c="horizontal",style:a}){const d=u.useRef(null),[f,m]=u.useState(!1),[h,l]=u.useState(!1),p=c==="verticalLeft"||c==="verticalRight",g=u.useRef(!1),b=u.useRef(0),x=u.useRef(0),y=u.useRef(!1);u.useEffect(()=>{const v=()=>{if(d.current)if(p){const{scrollTop:k,scrollHeight:E,clientHeight:T}=d.current;m(k>1),l(k<E-T-1)}else{const{scrollLeft:k,scrollWidth:E,clientWidth:T}=d.current;m(k>1),l(k<E-T-1)}},C=d.current;if(C)return v(),C.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{C.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e,p]);const j=v=>{d.current&&(g.current=!0,y.current=!1,b.current=p?v.clientY:v.clientX,x.current=p?d.current.scrollTop:d.current.scrollLeft,d.current.style.cursor="grabbing",d.current.style.userSelect="none")},R=v=>{if(!g.current||!d.current)return;const C=p?v.clientY:v.clientX,k=b.current-C;Math.abs(k)>3&&(y.current=!0),p?d.current.scrollTop=x.current+k:d.current.scrollLeft=x.current+k},w=()=>{d.current&&(g.current=!1,d.current.style.cursor="",d.current.style.userSelect="")},A=()=>{w()};u.useEffect(()=>{const v=d.current;if(!v||p)return;const C=k=>{k.deltaY!==0&&(k.preventDefault(),v.scrollLeft+=k.deltaY*.3)};return v.addEventListener("wheel",C,{passive:!1}),()=>{v.removeEventListener("wheel",C)}},[p]);const S=v=>{y.current||n(v)};return s.jsxs("div",{className:`nc-tab-container ${p?`nc-vertical nc-${c}`:""} ${r||""}`,style:a,children:[s.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[f&&s.jsx("div",{className:`nc-tab-scroll-indicator ${p?"nc-top":"nc-left"}`,children:p?s.jsx(yt,{size:16}):s.jsx(W.ChevronLeftIcon,{size:16})}),s.jsx("div",{ref:d,className:`nc-tab-scroll ${i?"nc-multiline":""}`,onMouseDown:j,onMouseMove:R,onMouseUp:w,onMouseLeave:A,style:{cursor:"grab"},children:e.map(v=>s.jsx("div",{className:`nc-tab-item ${t===v?"nc-active":""}`,onClick:()=>S(v),role:"button",tabIndex:0,onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&n(v)},children:p?v:v.toUpperCase()},v))}),h&&s.jsx("div",{className:`nc-tab-scroll-indicator ${p?"nc-bottom":"nc-right"}`,children:p?s.jsx(W.ChevronDownIcon,{size:16}):s.jsx(W.ChevronRightIcon,{size:16})})]}),o&&s.jsx("div",{className:"nc-tab-toolbar",children:o})]})}function kt({checked:e,onChange:t,disabled:n,label:r}){return s.jsxs("label",{className:"nc-row",style:{gap:10,alignItems:"center",cursor:n?"not-allowed":"pointer"},children:[r&&s.jsx("span",{className:"nc-label",children:r}),s.jsx("span",{role:"switch","aria-checked":e,tabIndex:0,onKeyDown:o=>{n||(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(!e))},onClick:()=>!n&&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:s.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"}})})]})}let q={notifications:[]};const de=new Set,Se=new Map;function ue(){const e=q.notifications.slice();for(const t of Array.from(de))try{t(e)}catch{}}function Nt(e){de.add(e);try{e(q.notifications.slice())}catch{}return()=>{de.delete(e)}}function St(e){const t=`notification-${Date.now()}-${Math.random()}`,n={id:t,dismissible:!0,lastingTime:5e3,...e};return q.notifications=[n,...q.notifications],ue(),n.lastingTime&&n.lastingTime>0&&setTimeout(()=>{Me(t)},n.lastingTime),t}function Me(e){const t=q.notifications.find(r=>r.id===e);if(!t)return;t.isRemoving=!0,ue();const n=window.setTimeout(()=>{q.notifications=q.notifications.filter(r=>r.id!==e),ue(),Se.delete(e)},300);Se.set(e,n)}function $e({notification:e}){const{t}=U.useTranslation(),n=()=>{if(e.title)return e.title;switch(e.type){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},r=()=>{Me(e.id)};return s.jsx("div",{className:`nc-notification nc-notification-${e.type||"info"}`,children:s.jsxs("div",{className:"nc-notification-content",children:[s.jsxs("div",{className:"nc-notification-body",style:{paddingRight:e.dismissible?"8px":"0"},children:[s.jsx("div",{className:"nc-notification-title",children:n()}),s.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&s.jsx("button",{className:"nc-notification-dismiss",onClick:r,children:s.jsx(W.CloseIcon,{size:16})})]})})}function At(){const[e,t]=u.useState([]),[n,r]=u.useState(new Map),[o,i]=u.useState(new Set),c=u.useRef(null),a=u.useRef([]);return u.useEffect(()=>Nt(f=>{const m=new Set(a.current.map(l=>l.id)),h=f.filter(l=>!m.has(l.id)).map(l=>l.id);h.length>0?(t(f),i(new Set(h)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(f),a.current=f}),[]),u.useEffect(()=>{if(!c.current)return;const d=new Map;let f=0;const m=c.current.children;e.forEach((h,l)=>{if(d.set(h.id,f),m[l]){const p=m[l].offsetHeight;h.isRemoving||(f+=p+12)}}),r(d)},[e]),s.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none"},children:s.jsx("div",{ref:c,style:{pointerEvents:"auto",position:"relative"},children:e.map(d=>{const f=o.has(d.id),m=d.isRemoving,h=n.get(d.id)||0;return s.jsx("div",{style:{position:"absolute",top:0,left:0,transform:f?"translateY(-120px)":`translateY(${h}px)`,transition:m?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:m?0:1,width:"100%"},children:s.jsx($e,{notification:d})},d.id)})})})}const Ct={show:e=>St(e)};function It(e){const t=Ke.createInstance(),n={};for(const o in e)n[o]={translation:e[o]};const r=typeof document<"u"&&document.documentElement.lang||"en";return t.init({resources:n,lng:r,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 Rt{constructor(){O(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 _=new Rt,Ae="nc-ui-app-state";class Et{constructor(){O(this,"state");O(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem(Ae);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem(Ae,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,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),()=>{var r;(r=this.listeners.get(t))==null||r.delete(n)}}notify(t,n){var r;(r=this.listeners.get(t))==null||r.forEach(o=>o(n))}}const H=new Et;class Mt{constructor(){O(this,"handlers",[])}register(t,n,r){return this.handlers=this.handlers.filter(o=>o.id!==t),this.handlers.push({id:t,priority:n,handler:r}),this.handlers.sort((o,i)=>i.priority-o.priority),()=>{this.handlers=this.handlers.filter(o=>o.id!==t)}}handleBack(){for(const{handler:t}of this.handlers)if(t())return!0;return!1}unregister(t){this.handlers=this.handlers.filter(n=>n.id!==t)}}const ge=new Mt;function pe(e){if(typeof window<"u"&&window.history){const t=new URL(window.location.href);t.searchParams.set("app",e),window.history.pushState({app:e},"",t.toString())}}function Pe(){if(typeof window<"u"&&window.history){const e=new URL(window.location.href);e.searchParams.delete("app"),window.history.replaceState({},"",e.toString())}}class $t{constructor(){O(this,"apps",[]);O(this,"activeAppId",null);O(this,"listeners",new Set);O(this,"refReadyResolvers",new Map)}async launchApp(t,n){const{launchInBackground:r=!1}=n||{};if(!_.has(t))return console.error(`Cannot launch app "${t}": not registered`),null;const o=this.apps.find(c=>c.appId===t);if(o)return r||(this.setActiveApp(t),H._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),r||(this.activeAppId=t,H._setActiveAppId(t),pe(t)),this.notify(),this.waitForRef(t)}waitForRef(t){return new Promise(n=>{const r=this.refReadyResolvers.get(t)||[];r.push(n),this.refReadyResolvers.set(t,r)})}setAppRef(t,n){const r=this.apps.find(i=>i.appId===t);if(!r){console.warn(`Cannot set ref for app "${t}": not running`);return}r.ref=n;const o=this.refReadyResolvers.get(t);o&&(o.forEach(i=>i(r)),this.refReadyResolvers.delete(t))}getApp(t){return this.apps.find(n=>n.appId===t)}closeApp(t){const n=this.apps.findIndex(o=>o.appId===t);if(n===-1)return;const r=this.apps[n];if(r.ref&&(r.ref=void 0),this.apps.splice(n,1),this.activeAppId===t){const o=window.innerWidth>=768;this.activeAppId=o&&this.apps.length>0?this.apps[this.apps.length-1].appId:null,H._setActiveAppId(this.activeAppId),this.activeAppId?pe(this.activeAppId):Pe()}this.notify()}setActiveApp(t){if(t!==null&&!this.apps.find(n=>n.appId===t)){console.warn(`Cannot activate app "${t}": not running`);return}this.activeAppId!==t&&(this.activeAppId=t,this.notify(),H._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?_.get(this.activeAppId)??null:null}getRunningApps(){return[...this.apps]}isRunning(t){return this.apps.some(n=>n.appId===t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){this.listeners.forEach(t=>t())}}const L=new $t,be=u.createContext(null);function ze(){const e=u.useContext(be);if(!e)throw new Error("useApp must be used inside an App");return e}function Pt({size:e=16}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M19 12H5"}),s.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function Te({title:e,onClose:t,onBack:n,toolbar:r,hideBackButton:o}){const i=n&&!o;return s.jsxs("div",{className:"nc-app-title-bar",children:[s.jsxs("div",{className:"nc-app-title-bar-left",children:[i&&s.jsx("button",{className:"nc-app-title-bar-back",onClick:n,title:"Back","aria-label":"Go back",children:s.jsx(Pt,{size:16})}),s.jsx("span",{className:"nc-app-title-bar-title",children:e})]}),s.jsxs("div",{className:"nc-app-title-bar-right",children:[r&&s.jsx("div",{className:"nc-app-title-bar-toolbar",children:r}),s.jsx(me,{onClick:t,"aria-label":"Close application"})]})]})}class zt extends u.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error(`Error loading app ${this.props.appId}:`,t,n)}render(){return this.state.hasError?s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,flexDirection:"column",gap:"16px",padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:[s.jsx("div",{children:"Failed to load app"}),this.state.error&&s.jsx("div",{style:{fontSize:"12px",opacity:.7},children:this.state.error.message})]}):this.props.children}}function xe({appId:e,isActive:t,onClose:n}){const{t:r}=U.useTranslation(),o=_.get(e),[i,c]=u.useState(""),[a,d]=u.useState(null),[f,m]=u.useState(null),[h,l]=u.useState(!1),[p,g]=u.useState(!1);u.useEffect(()=>{o!=null&&o.titleKey&&c(r(o.titleKey))},[o,r]),u.useEffect(()=>{if(t)return ge.register(`app-${e}`,50,()=>a?(a(),!0):(n(),!0))},[t,a,n,e]);const b=u.useCallback(k=>{c(k)},[]),x=u.useCallback(k=>{d(()=>k)},[]),y=u.useCallback(()=>{d(null)},[]),j=u.useCallback(k=>{m(k)},[]),R=u.useCallback(()=>{m(null)},[]),w=u.useCallback(k=>{l(k)},[]),A=u.useCallback(k=>{g(k)},[]),S=u.useMemo(()=>({setTitle:b,setBackHandler:x,clearBackHandler:y,setToolbar:j,clearToolbar:R,setHideBackButton:w,setHideTitleBar:A,close:n}),[b,x,y,j,R,w,A,n]);if(!o)return null;const v=o.component,C=!o.hideTitleBar&&!p;return s.jsxs("div",{style:{display:t?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:[C&&s.jsx(Te,{title:i,onClose:n,onBack:a??void 0,toolbar:f,hideBackButton:h}),s.jsx("div",{className:C?"nc-app-content-wrapper":"",style:{padding:o.padding,flex:1,minHeight:0,display:"flex",flexDirection:"column",backgroundColor:"var(--nc-bg-secondary)",position:"relative"},children:s.jsx(be.Provider,{value:S,children:s.jsx(zt,{appId:e,children:s.jsx(u.Suspense,{fallback:s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:s.jsx(he,{})}),children:s.jsx(v,{})})})})})]})}function Tt({autoWidth:e=!0,className:t,style:n}){const[r,o]=u.useState(()=>H.getActiveAppId()),[i,c]=u.useState(()=>L.getRunningApps());u.useEffect(()=>{const g=H.subscribe("activeAppId",b=>{o(b)});return()=>{g()}},[]),u.useEffect(()=>L.subscribe(()=>{c(L.getRunningApps())}),[]),u.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const x=H.getActiveAppId();x&&!L.isRunning(x)&&L.launchApp(x)}},[]);const a=g=>{L.closeApp(g)},d=r?_.get(r):null,m=(d==null?void 0:d.width)??400,h=r!==null,p={...{overflow:"hidden",display:h?"flex":"none",flexDirection:"column",flexShrink:0,...e&&h?{width:m}:{}},...n};return s.jsx("div",{className:t,style:p,children:i.map(g=>s.jsx(xe,{appId:g.appId,isActive:r===g.appId,onClose:()=>a(g.appId)},g.appId))})}const ie=768,ae=1024,Le={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},Be=u.createContext(Le);function Lt({children:e}){const[t,n]=u.useState(()=>{if(typeof window>"u")return Le;const r=window.innerWidth,o=window.innerHeight;return{isMobile:r<ie,isTablet:r>=ie&&r<ae,isDesktop:r>=ae,width:r,height:o}});return u.useEffect(()=>{const r=()=>{const o=window.innerWidth,i=window.innerHeight;n({isMobile:o<ie,isTablet:o>=ie&&o<ae,isDesktop:o>=ae,width:o,height:i})};return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),s.jsx(Be.Provider,{value:t,children:e})}function De(){return u.useContext(Be)}function Bt({pinnedAppIds:e,className:t=""}){const{isMobile:n}=De(),[r,o]=u.useState(()=>H.getActiveAppId()),[i,c]=u.useState(()=>L.getRunningApps());u.useEffect(()=>{const l=H.subscribe("activeAppId",p=>{o(p)});return()=>{l()}},[]),u.useEffect(()=>L.subscribe(()=>{c(L.getRunningApps())}),[]);const a=l=>{r===l?L.setActiveApp(null):L.launchApp(l)},d=e.map(l=>_.get(l)).filter(l=>!!l),f=i.filter(l=>!e.includes(l.appId)).map(l=>({running:l,def:_.get(l.appId)})).filter(l=>!!l.def),m=l=>i.some(p=>p.appId===l),h=n?24:28;return s.jsxs("div",{className:`nc-app-taskbar ${n?"nc-mobile":"nc-desktop"} ${t}`,children:[d.map(l=>{const p=l.icon,g=r===l.id,b=m(l.id);return s.jsxs("button",{className:`nc-app-taskbar-button ${g?"nc-active":""} ${b?"nc-running":""}`,onClick:()=>a(l.id),title:l.titleKey||l.id,children:[s.jsx(p,{size:h}),b&&s.jsx("span",{className:"nc-app-taskbar-indicator"})]},l.id)}),f.length>0&&s.jsx("div",{className:"nc-app-taskbar-separator"}),f.map(({running:l,def:p})=>{const g=p.icon,b=r===l.appId;return s.jsxs("button",{className:`nc-app-taskbar-button ${b?"nc-active":""} nc-running`,onClick:()=>a(l.appId),title:p.titleKey||p.id,children:[s.jsx(g,{size:h}),s.jsx("span",{className:"nc-app-taskbar-indicator"})]},l.appId)})]})}function Dt({appId:e,open:t,onClose:n,closeOnBackdrop:r=!1,className:o="",maxWidth:i=1200,maxHeight:c=900}){const a=f=>{r&&f.target===f.currentTarget&&n()};if(u.useEffect(()=>{if(!t)return;const f=`app-dialog-${e}-${Date.now()}`;return ge.register(f,100,()=>(n(),!0))},[t,n,e]),!t)return null;const d=s.jsx("div",{className:"nc-dialog-overlay nc-fullscreen",onClick:a,children:s.jsx("div",{className:`nc-app-dialog-container ${o}`,style:{maxWidth:`${i}px`,maxHeight:`${c}px`},onClick:f=>f.stopPropagation(),children:s.jsx(xe,{appId:e,isActive:!0,onClose:n})})});return se.createPortal(d,document.body)}const ve=u.createContext(null),He=u.createContext(null);function Ht(){const e=u.useContext(ve);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function Wt(){const e=u.useContext(He);if(!e)throw new Error("useNavView must be used within NavStack");return e}const we=u.createContext(null);function Gt({rootView:e,children:t}){const{t:n}=U.useTranslation(),r=ze(),[o,i]=u.useState([e]),[c,a]=u.useState([null]),d=u.useCallback((w,A)=>{a(S=>{const v=[...S];return v[w]=A,v})},[]),f=u.useCallback(w=>{a(A=>{const S=[...A];return S[w]=null,S})},[]),m=u.useCallback(w=>{i(A=>[...A,w]),a(A=>[...A,null])},[]),h=u.useCallback(()=>{i(w=>w.length<=1?w:w.slice(0,-1)),a(w=>w.slice(0,-1))},[]),l=u.useCallback(()=>{i([e]),a([null])},[e]),p=o.length,g=p>1,b=o.length-1,x=o[o.length-1],y=x!=null&&x.titleKey?n(x.titleKey):(x==null?void 0:x.title)??"";u.useEffect(()=>{r.setTitle(y)},[y,r]),u.useEffect(()=>{g?r.setBackHandler(h):r.clearBackHandler()},[g,h,r]),u.useEffect(()=>{const w=c[c.length-1];w?r.setToolbar(w):r.clearToolbar()},[c,r]);const j={push:m,pop:h,reset:l,depth:p,canGoBack:g,currentTitle:y},R={stack:o,toolbarStack:c,updateToolbar:d,clearToolbarAt:f,topIndex:b};return s.jsx(ve.Provider,{value:j,children:s.jsx(we.Provider,{value:R,children:t})})}function Ot({index:e,children:t}){const n=u.useContext(we);if(!n)throw new Error("NavViewProvider must be used within NavStackProvider");const{updateToolbar:r,clearToolbarAt:o,topIndex:i}=n,c=u.useCallback(f=>{e===i&&r(e,f)},[e,i,r]),a=u.useCallback(()=>{e===i&&o(e)},[e,i,o]),d={setToolbar:c,clearToolbar:a};return s.jsx(He.Provider,{value:d,children:t})}function Vt(){const e=u.useContext(ve),t=u.useContext(we);if(!e||!t)throw new Error("NavStackContainer must be used within a NavStackProvider");const{stack:n}=t;return s.jsx("div",{className:"nav-stack-container",children:s.jsx("div",{className:"nav-stack-content",children:n.map((r,o)=>{const i=o===n.length-1;return s.jsx(Ot,{index:o,children:s.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:r.component})},r.id)})})})}const ye="-",Yt=e=>{const t=Ut(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const a=c.split(ye);return a[0]===""&&a.length!==1&&a.shift(),We(a,t)||Ft(c)},getConflictingClassGroupIds:(c,a)=>{const d=n[c]||[];return a&&r[c]?[...d,...r[c]]:d}}},We=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?We(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ye);return(c=t.validators.find(({validator:a})=>a(i)))==null?void 0:c.classGroupId},Ce=/^\[(.+)\]$/,Ft=e=>{if(Ce.test(e)){const t=Ce.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ut=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return qt(Object.entries(e.classGroups),n).forEach(([i,c])=>{fe(c,r,i,t)}),r},fe=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Ie(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Kt(o)){fe(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,c])=>{fe(c,Ie(t,i),n,r)})})},Ie=(e,t)=>{let n=e;return t.split(ye).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Kt=e=>e.isThemeGetter,qt=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([c,a])=>[t+c,a])):i);return[n,o]}):e,_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,c)=>{n.set(i,c),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let c=n.get(i);if(c!==void 0)return c;if((c=r.get(i))!==void 0)return o(i,c),c},set(i,c){n.has(i)?n.set(i,c):o(i,c)}}},Ge="!",Jt=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,c=a=>{const d=[];let f=0,m=0,h;for(let x=0;x<a.length;x++){let y=a[x];if(f===0){if(y===o&&(r||a.slice(x,x+i)===t)){d.push(a.slice(m,x)),m=x+i;continue}if(y==="/"){h=x;continue}}y==="["?f++:y==="]"&&f--}const l=d.length===0?a:a.substring(m),p=l.startsWith(Ge),g=p?l.substring(1):l,b=h&&h>m?h-m:void 0;return{modifiers:d,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:c}):c},Xt=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Qt=e=>({cache:_t(e.cacheSize),parseClassName:Jt(e),...Yt(e)}),Zt=/\s+/,en=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],c=e.trim().split(Zt);let a="";for(let d=c.length-1;d>=0;d-=1){const f=c[d],{modifiers:m,hasImportantModifier:h,baseClassName:l,maybePostfixModifierPosition:p}=n(f);let g=!!p,b=r(g?l.substring(0,p):l);if(!b){if(!g){a=f+(a.length>0?" "+a:a);continue}if(b=r(l),!b){a=f+(a.length>0?" "+a:a);continue}g=!1}const x=Xt(m).join(":"),y=h?x+Ge:x,j=y+b;if(i.includes(j))continue;i.push(j);const R=o(b,g);for(let w=0;w<R.length;++w){const A=R[w];i.push(y+A)}a=f+(a.length>0?" "+a:a)}return a};function tn(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Oe(t))&&(r&&(r+=" "),r+=n);return r}const Oe=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Oe(e[r]))&&(n&&(n+=" "),n+=t);return n};function nn(e,...t){let n,r,o,i=c;function c(d){const f=t.reduce((m,h)=>h(m),e());return n=Qt(f),r=n.cache.get,o=n.cache.set,i=a,a(d)}function a(d){const f=r(d);if(f)return f;const m=en(d,n);return o(d,m),m}return function(){return i(tn.apply(null,arguments))}}const z=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ve=/^\[(?:([a-z-]+):)?(.+)\]$/i,rn=/^\d+\/\d+$/,sn=new Set(["px","full","screen"]),on=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,an=/\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$/,cn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ln=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>X(e)||sn.has(e)||rn.test(e),Y=e=>Q(e,"length",xn),X=e=>!!e&&!Number.isNaN(Number(e)),le=e=>Q(e,"number",X),te=e=>!!e&&Number.isInteger(Number(e)),un=e=>e.endsWith("%")&&X(e.slice(0,-1)),N=e=>Ve.test(e),F=e=>on.test(e),pn=new Set(["length","size","percentage"]),fn=e=>Q(e,pn,Ye),hn=e=>Q(e,"position",Ye),mn=new Set(["image","url"]),gn=e=>Q(e,mn,wn),bn=e=>Q(e,"",vn),ne=()=>!0,Q=(e,t,n)=>{const r=Ve.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},xn=e=>an.test(e)&&!cn.test(e),Ye=()=>!1,vn=e=>ln.test(e),wn=e=>dn.test(e),yn=()=>{const e=z("colors"),t=z("spacing"),n=z("blur"),r=z("brightness"),o=z("borderColor"),i=z("borderRadius"),c=z("borderSpacing"),a=z("borderWidth"),d=z("contrast"),f=z("grayscale"),m=z("hueRotate"),h=z("invert"),l=z("gap"),p=z("gradientColorStops"),g=z("gradientColorStopPositions"),b=z("inset"),x=z("margin"),y=z("opacity"),j=z("padding"),R=z("saturate"),w=z("scale"),A=z("sepia"),S=z("skew"),v=z("space"),C=z("translate"),k=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",N,t],M=()=>[N,t],B=()=>["",V,Y],I=()=>["auto",X,N],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ce=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",N],je=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[X,N];return{cacheSize:500,separator:":",theme:{colors:[ne],spacing:[V,Y],blur:["none","",F,N],brightness:G(),borderColor:[e],borderRadius:["none","","full",F,N],borderSpacing:M(),borderWidth:B(),contrast:G(),grayscale:ee(),hueRotate:G(),invert:ee(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[un,Y],inset:T(),margin:T(),opacity:G(),padding:M(),saturate:G(),scale:G(),sepia:ee(),skew:G(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":je()}],"break-before":[{"break-before":je()}],"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:[...$(),N]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",te,N]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",te,N]}],"grid-cols":[{"grid-cols":[ne]}],"col-start-end":[{col:["auto",{span:["full",te,N]},N]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[ne]}],"row-start-end":[{row:["auto",{span:[te,N]},N]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[l]}],"gap-x":[{"gap-x":[l]}],"gap-y":[{"gap-y":[l]}],"justify-content":[{justify:["normal",...ce()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ce(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ce(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[v]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[v]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,Y]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",le]}],"font-family":[{font:[ne]}],"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",N]}],"line-clamp":[{"line-clamp":["none",X,le]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",V,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"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:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",V,Y]}],"underline-offset":[{"underline-offset":["auto",V,N]}],"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",N]}],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",N]}],"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:[...$(),hn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...P(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:P()}],"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:["",...P()]}],"outline-offset":[{"outline-offset":[V,N]}],"outline-w":[{outline:[V,Y]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[V,Y]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,bn]}],"shadow-color":[{shadow:[ne]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",F,N]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[h]}],saturate:[{saturate:[R]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"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",N]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[te,N]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],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",N]}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[V,Y,le]}],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"]}}},jn=nn(yn);function kn(...e){return jn(qe.clsx(e))}exports.ActivityIndicator=he;exports.Alert=_e;exports.AppContainer=xe;exports.AppContext=be;exports.AppDialog=Dt;exports.AppPanel=Tt;exports.AppTaskbar=Bt;exports.AppTitleBar=Te;exports.Battery=Je;exports.Button=D;exports.ButtonGroup=Xe;exports.Checkbox=Ze;exports.CloseButton=me;exports.ComboBox=st;exports.ContextMenu=lt;exports.Dialog=dt;exports.DialogClose=K;exports.EditButton=it;exports.Hyperlink=ct;exports.Input=ft;exports.ListGroup=mt;exports.ListGroupItem=ht;exports.MonthRangePicker=xt;exports.MultiSelect=gt;exports.NavStackContainer=Vt;exports.NavStackProvider=Gt;exports.Notification=$e;exports.NotificationContainer=At;exports.NumberInput=vt;exports.RefreshButton=ot;exports.Slider=wt;exports.Tabs=jt;exports.Toggle=kt;exports.TrashButton=at;exports.ViewportProvider=Lt;exports.appRegistry=_;exports.appStateStore=H;exports.backHandlerRegistry=ge;exports.clearAppInUrl=Pe;exports.cn=kn;exports.createAppI18nFactory=It;exports.notificationManager=Ct;exports.runningAppsStore=L;exports.setAppInUrl=pe;exports.useApp=ze;exports.useDialog=Ee;exports.useNavStack=Ht;exports.useNavView=Wt;exports.useViewport=De;
1
+ "use strict";var Oe=Object.defineProperty;var Ve=(e,t,n)=>t in e?Oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var V=(e,t,n)=>Ve(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("react"),se=require("react-dom"),K=require("react-i18next"),W=require("./GeneratedIcons-HAHchVYC.cjs"),Ye=require("i18next"),Fe=require("./clsx-C11secjj.cjs");function fe({size:e="default",color:t,overlay:n=!1,className:s=""}){const o=r.jsx("svg",{className:`nc-activity-indicator nc-${e} ${s}`,viewBox:"0 0 50 50",style:t?{color:t}:void 0,children:r.jsx("circle",{className:"nc-activity-indicator-circle",cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round"})});return n?r.jsx("div",{className:"nc-activity-indicator-overlay",children:o}):o}function D({variant:e="default",block:t,size:n="default",className:s,disabled:o,textSelectable:i,loading:a,onClick:c,children:d,...f}){const m=["nc-button",e!=="default"?`nc-${e}`:"",t?"nc-block":"",n==="small"?"nc-small":"",n==="large"?"nc-large":"",o||a?"nc-disabled":"",i?"nc-text-selectable":"",a?"nc-loading":"",s??""].filter(Boolean).join(" "),h=l=>{if(!a){if(i){const p=window.getSelection();if(p&&p.toString().length>0)return}c==null||c(l)}};return r.jsxs("button",{className:m,disabled:o||a,onClick:h,...f,children:[a&&r.jsx(fe,{size:"small",className:"nc-button-spinner",color:e!=="default"&&e!=="ghost"?"white":void 0}),d]})}function Ke({code:e,text:t,type:n,button:s,onAction:o}){return r.jsxs("div",{className:`nc-alert nc-${n}`,children:[r.jsxs("span",{className:`nc-alert-message nc-${n}`,children:[r.jsx("span",{className:"nc-alert-code",children:e}),t]}),s&&r.jsx("span",{className:"nc-alert-action",children:r.jsx(D,{size:"small",variant:s.variant??(n==="error"?"danger":"warning"),onClick:o,children:s.text})})]})}function qe({percentage:e=.5,status:t="discharging",darkMode:n=!1,colored:s=!1}){const o=Math.max(0,Math.min(1,Number(e)||0));let i;s?o<.1?i="var(--nc-danger)":o<.2?i="var(--nc-warning)":i="var(--nc-success)":i=n?"#ffffff":"#000000";const a=n?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.2)",c=24,d=14,f=2,m=0,h=12,l=0,p=0,g=0,b=c,x=d,y=x-l*2,j=b-l*2,R=Math.max(1,Math.min(4,x/4)),w=o===0?0:.05+o*.95,A=c+f+h,S=20,v=.65,C=Math.max(d,S*v),k=c+f+1,E=(d-S*v)/2;return r.jsxs("svg",{className:"nc-battery",width:A,height:C,viewBox:`0 0 ${A} ${C}`,role:"img","aria-label":`Battery ${o===0?"-":Math.round(o*100)+"%"} ${t}`,children:[r.jsxs("defs",{children:[r.jsx("mask",{id:`nc-battery-fill-mask-${o}`,children:r.jsx("rect",{x:"0",y:"0",width:j*w,height:y,fill:"white"})}),r.jsxs("mask",{id:`nc-battery-text-mask-${o}`,children:[r.jsx("rect",{x:"0",y:"0",width:A,height:C,fill:"white"}),r.jsx("text",{x:p+b/2,y:d-3,fontSize:11,fontWeight:"bold",fill:"black",textAnchor:"middle",children:o===0?"-":Math.round(o*100)})]})]}),r.jsxs("g",{mask:`url(#nc-battery-text-mask-${o})`,children:[r.jsx("rect",{x:p,y:g,rx:R,ry:R,width:b,height:x,fill:a}),r.jsx("rect",{x:p+l,y:g+l,width:j,height:y,fill:i,rx:R,ry:R,mask:`url(#nc-battery-fill-mask-${o})`}),r.jsx("rect",{x:c+m,y:d*.26,width:f,height:d*.48,rx:.8,ry:.8,fill:o===1?i:a}),t==="charging"?r.jsx("g",{transform:`translate(${k}, ${E}) scale(${v})`,fill:i,children:r.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})]})}function _e({value:e,onChange:t,options:n,disabled:s,labels:o,size:i="default"}){return r.jsx("div",{className:`nc-button-group ${i==="small"?"nc-small":""}`,children:n.map((a,c)=>r.jsx("button",{className:`nc-button-group-item ${e===a?"nc-active":""} ${c<n.length-1?"nc-has-border":""}`,onClick:()=>!s&&t(a),disabled:s,children:o&&o[a]?o[a]:a},a))})}function Ue({size:e}){return r.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:r.jsx("path",{d:"M2 6L5 9L10 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Je({checked:e,onChange:t,disabled:n,label:s,size:o="default",labelColor:i,style:a,className:c=""}){const d=o==="small";return r.jsxs("label",{className:`nc-checkbox-label ${d?"nc-small":""} ${n?"nc-disabled":""} ${c}`.trim(),style:a,onClick:f=>{n||(f.preventDefault(),t(!e))},children:[r.jsx("span",{role:"checkbox","aria-checked":e,tabIndex:0,className:`nc-checkbox-box ${d?"nc-small":""} ${e?"nc-checked":""}`,onKeyDown:f=>{n||(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),t(!e))},children:e&&r.jsx(Ue,{size:o})}),s&&r.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function Xe({option:e,onChange:t,selected:n,highlighted:s,small:o}){const i=u.useRef(null),{t:a}=K.useTranslation();return u.useEffect(()=>{s&&i.current&&i.current.scrollIntoView({block:"nearest"})},[s]),r.jsxs("div",{ref:i,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${s?"nc-highlighted":""}`,role:"option",onMouseDown:()=>t(e.value),"aria-selected":n,style:{cursor:"pointer",background:s?"rgba(59,130,246,0.18)":n?"rgba(59,130,246,0.12)":void 0},children:[e.label,e.default&&r.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",a("common.default"),")"]})]})}function Qe({isOpen:e,options:t,onSelect:n,selectedValue:s,placement:o="bottom",anchorRef:i,small:a,highlightedIndex:c=-1}){const[d,f]=u.useState({top:0,left:0,width:0}),[m,h]=u.useState(o),{t:l}=K.useTranslation();if(u.useEffect(()=>{if(e&&i.current){const g=i.current.getBoundingClientRect();let b=o;if(o==="bottom"){const x=window.innerHeight-g.bottom,y=g.top;x<320&&y>x&&(b="top")}h(b),f({top:b==="top"?g.top-4:g.bottom+4,left:g.left,width:g.width})}},[e,i,o]),!e)return null;const p=r.jsx("div",{className:"nc-combo-dropdown",style:{position:"fixed",top:m==="top"?void 0:d.top,bottom:m==="top"?window.innerHeight-d.top:void 0,left:d.left,width:d.width,zIndex:1e3,maxHeight:300,overflowY:"auto"},children:t.length===0?r.jsx("div",{className:`nc-combo-dropdown-option nc-no-results ${a?"nc-small":""}`,children:l("common.noResults")}):t.map((g,b)=>r.jsx(Xe,{option:g,onChange:n,selected:g.value===s,highlighted:b===c,small:a},g.value))});return se.createPortal(p,document.body)}function Ze({onClick:e,small:t}){return r.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:e,onMouseDown:n=>n.stopPropagation(),"aria-label":"Clear selection",children:"✕"})}function et({open:e,onClick:t,small:n}){return r.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-toggle ${n?"nc-small":""} ${e?"nc-open":""}`,onClick:t,onMouseDown:s=>s.stopPropagation(),"aria-label":e?"Close":"Open",children:"▾"})}function tt({value:e,onChange:t,placeholder:n="Select…",options:s,disabled:o,label:i,clearable:a=!0,allowTyping:c=!1,placement:d="bottom",size:f="default",style:m,className:h}){const[l,p]=u.useState(!1),[g,b]=u.useState(""),[x,y]=u.useState(-1),j=u.useRef(null),R=u.useRef(null),w=f==="small",{t:A}=K.useTranslation(),S=u.useMemo(()=>{const I=g.toLowerCase();return c?s.filter($=>$.label.toLowerCase().includes(I)):s},[s,g,c]);u.useEffect(()=>{l&&y(-1)},[l,S]),u.useEffect(()=>{if(!a&&!e&&s.length>0&&t){const I=s.find($=>$.default)||s[0];t(I.value)}},[a,e,s,t]),u.useEffect(()=>{function I($){var z;$.target instanceof Node&&j.current&&((z=j.current.parentElement)!=null&&z.contains($.target)||p(!1))}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);const v=s.find(I=>I.value===e),C=v&&a,k=!o&&!C,E=!(l&&c)&&!!v,T=(I,$=!1)=>{var z;t==null||t(I),p(!1),b(""),$&&((z=j.current)==null||z.blur())},M=()=>{t==null||t(void 0),b(""),p(!1)},B=I=>{if(!l){(I.key==="ArrowDown"||I.key==="ArrowUp")&&(p(!0),I.preventDefault());return}switch(I.key){case"ArrowDown":I.preventDefault(),y($=>{const z=$+1;return z>=S.length?0:z});break;case"ArrowUp":I.preventDefault(),y($=>{const z=$-1;return z<0?S.length-1:z});break;case"Enter":I.preventDefault(),x>=0&&x<S.length&&T(S[x].value,!0);break;case"Escape":I.preventDefault(),p(!1),b("");break}};return r.jsxs("div",{className:`nc-combo-container ${h||""}`.trim(),style:{position:"relative",...m},children:[i&&r.jsx("span",{className:`nc-label ${w?"nc-small":""}`,children:i}),r.jsxs("div",{ref:R,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:I=>{o||c&&I.target===j.current||(p($=>(!$&&c&&v&&b(v.label),!$)),c&&!l&&setTimeout(()=>{var $,z;($=j.current)==null||$.focus(),(z=j.current)==null||z.select()},0))},children:[r.jsx("input",{ref:j,className:`nc-input ${w?"nc-small":""}`,placeholder:n,onFocus:()=>{var I;!o&&c&&(p(!0),v&&(b(v.label),setTimeout(()=>{var $;return($=j.current)==null?void 0:$.select()},0))),c||(I=j.current)==null||I.blur()},onChange:I=>c&&b(I.target.value),onKeyDown:B,value:l&&c?g:(v==null?void 0:v.label)||"",readOnly:o||!c,style:{width:"100%",paddingRight:k||C?w?32:44:12,caretColor:c?void 0:"transparent",cursor:c?void 0:"pointer",userSelect:c?void 0:"none",color:E?"transparent":"var(--nc-text)"}}),E&&r.jsxs("div",{"aria-hidden":!0,style:{position:"absolute",left:w?8:12,right:k||C?w?12:24:w?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",display:"flex",alignItems:"center",gap:6,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[r.jsx("span",{className:`nc-combo-overlay-text ${w?"nc-small":""}`,children:v==null?void 0:v.label}),(v==null?void 0:v.default)&&r.jsxs("span",{className:`nc-combo-overlay-default ${w?"nc-small":""}`,children:["(",A("common.default"),")"]})]}),C&&r.jsx(Ze,{onClick:M,small:w}),k&&r.jsx(et,{open:l,onClick:()=>p(I=>!I),small:w})]}),r.jsx(Qe,{isOpen:l,options:S,onSelect:T,selectedValue:e,placement:d,anchorRef:R,small:w,highlightedIndex:x})]})}function nt({onClick:e,loading:t=!1,disabled:n=!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 r.jsx("button",{className:"nc-icon-button",onClick:e,disabled:n||t,title:o??c,"aria-label":i??d,"data-size":s,children:r.jsx(W.RefreshIcon,{size:a,className:t?"nc-spinning":""})})}function he({onClick:e,disabled:t=!1,size:n="default",title:s="Close","aria-label":o="Close"}){const i=n==="small"?14:n==="large"?20:18;return r.jsx("button",{className:"nc-icon-button nc-icon-button-close",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":n,children:r.jsx(W.CloseIcon,{size:i})})}function rt({onClick:e,disabled:t=!1,size:n="default",title:s="Edit","aria-label":o="Edit"}){const i=n==="small"?14:n==="large"?20:18;return r.jsx("button",{className:"nc-icon-button nc-icon-button-edit",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":n,children:r.jsx(W.EditIcon,{size:i})})}function st({onClick:e,disabled:t=!1,size:n="default",title:s="Delete","aria-label":o="Delete"}){const i=n==="small"?14:n==="large"?20:18;return r.jsx("button",{className:"nc-icon-button nc-icon-button-trash",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":n,children:r.jsx(W.TrashIcon,{size:i})})}function ot({onClick:e,disabled:t=!1,children:n,title:s,"aria-label":o,size:i="default"}){return r.jsx("button",{className:"nc-hyperlink",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":i,children:n})}function it({open:e,onClose:t,options:n,anchorRef:s,anchor:o,preferredDirection:i="down"}){const a=u.useRef(null),[c,d]=u.useState({top:0,left:0}),f=o||(s==null?void 0:s.current);if(u.useEffect(()=>{if(!e||!f||!a.current)return;const h=f.getBoundingClientRect(),l=a.current.getBoundingClientRect(),p=window.innerHeight,g=window.innerWidth,b=h.bottom+8,x=b+l.height<=p-8;let y=i;(!x&&i==="down"||i==="up"&&x)&&(y="up");let j;y==="down"?j=b:j=h.top-l.height-8;let R=h.left;R+l.width>g-8&&(R=h.right-l.width),d({top:Math.max(8,j),left:Math.max(8,R)})},[e,f,i]),u.useEffect(()=>{if(!e)return;const h=p=>{a.current&&!a.current.contains(p.target)&&f&&!f.contains(p.target)&&t()},l=p=>{p.key==="Escape"&&t()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",l)}},[e,t,f]),!e)return null;const m=h=>{h.disabled||(h.onClick(),t())};return se.createPortal(r.jsx("div",{ref:a,className:"nc-context-menu",style:{position:"fixed",top:`${c.top}px`,left:`${c.left}px`,zIndex:1e4},role:"menu",children:n.map(h=>r.jsxs("button",{className:`nc-context-menu-item ${h.variant==="danger"?"nc-danger":""} ${h.disabled?"nc-disabled":""}`,onClick:()=>m(h),disabled:h.disabled,role:"menuitem",children:[h.icon&&r.jsx("span",{className:"nc-context-menu-icon",children:h.icon}),r.jsx("span",{className:"nc-context-menu-label",children:h.label})]},h.id))}),document.body)}const Ce=u.createContext(null);function Ie(){const e=u.useContext(Ce);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function q({children:e,onClick:t,...n}){const{close:s}=Ie(),{t:o}=K.useTranslation(),i=a=>{t==null||t(a),s()};return r.jsx(D,{onClick:i,...n,children:e??o("common.close")})}function J(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function at({open:e,onClose:t,title:n,children:s,width:o=360,height:i,minWidth:a,minHeight:c,maxWidth:d="95vw",maxHeight:f="95vh",footerType:m="ok-cancel",footer:h,onOk:l,onSave:p,onDelete:g,onCancel:b,onConnect:x,closeOnOverlay:y=!0,primaryDisabled:j=!1,fullScreen:R=!1,hideTitleBar:w=!1}){const A=u.useRef(null),{t:S}=K.useTranslation(),v={close:t},C=T=>{y&&T.target===T.currentTarget&&t()};if(u.useEffect(()=>{e&&A.current&&A.current.focus()},[e]),!e)return null;const k=()=>{switch(m){case"ok":return r.jsx("div",{className:"nc-dialog-footer",children:r.jsx(D,{variant:"primary",onClick:l??t,disabled:j,children:S("common.ok")})});case"ok-cancel":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(D,{variant:"primary",onClick:l??t,disabled:j,children:S("common.ok")}),r.jsx(q,{onClick:b,children:S("common.cancel")})]});case"save-cancel":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(D,{variant:"primary",onClick:p,disabled:j,children:S("common.save")}),r.jsx(q,{onClick:b,children:S("common.cancel")})]});case"delete-cancel":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(D,{variant:"danger",onClick:g,disabled:j,children:S("common.delete")}),r.jsx(q,{onClick:b,children:S("common.cancel")})]});case"connect":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(D,{variant:"primary",onClick:x,disabled:j,children:S("common.connect")}),r.jsx(q,{onClick:b,children:S("common.cancel")})]});case"close":return r.jsx("div",{className:"nc-dialog-footer",children:r.jsx(q,{variant:"primary"})});case"gotit":return r.jsx("div",{className:"nc-dialog-footer",children:r.jsx(q,{variant:"primary",children:S("common.gotit")})});case"custom":return r.jsx("div",{className:"nc-dialog-footer",children:h});case"none":return null;default:return null}},E=r.jsx(Ce.Provider,{value:v,children:r.jsx("div",{className:`nc-dialog-overlay${R?" nc-fullscreen":""}`,onClick:C,children:r.jsxs("div",{ref:A,className:"nc-dialog-container",style:{width:J(o),height:J(i),minWidth:J(a),minHeight:J(c),maxWidth:J(d),maxHeight:J(f)},tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":w?void 0:"nc-dialog-title",children:[!w&&r.jsxs("div",{className:"nc-dialog-header",children:[r.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:n}),r.jsx(he,{onClick:t,"aria-label":"Close dialog"})]}),r.jsx("div",{className:"nc-dialog-content",children:s}),k()]})})});return R?se.createPortal(E,document.body):E}function ct({onClick:e,size:t="default",rightOffset:n=4}){const s=t==="small"?28:34;return r.jsx("button",{className:"nc-button nc-ghost",onClick:e,onMouseDown:o=>o.stopPropagation(),tabIndex:-1,"aria-label":"Clear input",style:{position:"absolute",right:n,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:t==="small"?"12px":"14px"},children:"✕"})}function lt({visible:e,onClick:t,size:n="default"}){const s=n==="small"?28:34,o=n==="small"?16:18;return r.jsx("button",{className:"nc-button nc-ghost",onClick:t,onMouseDown:i=>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?r.jsx(W.EyeHiddenIcon,{size:o}):r.jsx(W.ViewIcon,{size:o})})}function dt({value:e="",onChange:t,onEnter:n,onClear:s,placeholder:o,disabled:i,label:a,clearable:c=!0,type:d="text",className:f="",size:m="default",style:h,showPasswordToggle:l=!1,multiline:p=!1,rows:g=3,validator:b,showErrorMessage:x=!0}){const y=u.useRef(null),j=u.useRef(null),[R,w]=u.useState(!1),A=b?b(e):null,S=!!A,v=d==="password",C=v&&l&&!i&&!p,k=c&&e&&!i,E=m==="small"?32:44;let T=12;k&&C?T=E*2:(k||C)&&(T=E);const M=()=>{var z,Z;t==null||t(""),s==null||s(),p?(z=j.current)==null||z.focus():(Z=y.current)==null||Z.focus()},B=z=>{z.key==="Enter"&&!p&&(n==null||n())},I=z=>{t==null||t(z.target.value)},$=`nc-input ${m==="small"?"nc-small ":""} ${S?"nc-error ":""}${f}`;return r.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...h},children:[a&&r.jsx("span",{className:"nc-label",children:a}),r.jsxs("div",{style:{position:"relative",display:"flex",alignItems:p?"flex-start":"center"},children:[p?r.jsx("textarea",{ref:j,className:$,placeholder:o,value:e,onChange:I,onKeyDown:B,disabled:i,rows:g,style:{width:"100%",paddingRight:T,resize:"vertical"}}):r.jsx("input",{ref:y,type:v&&R?"text":d,className:$,placeholder:o,value:e,onChange:I,onKeyDown:B,disabled:i,style:{width:"100%",paddingRight:T}}),k&&r.jsx(ct,{onClick:M,size:m,rightOffset:C?E+4:4}),C&&r.jsx(lt,{visible:R,onClick:()=>w(!R),size:m})]}),S&&x&&r.jsx("span",{className:"nc-error-message",children:A})]})}function ut({children:e,onClick:t,showBorder:n=!0,selectable:s=!1,style:o}){const[i,a]=u.useState(!1),c=d=>{if(t){if(s){const f=window.getSelection();if(f&&f.toString().length>0)return}t(d)}};return r.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:n?void 0:"none",...o},className:`nc-list-group-item ${t?"nc-list-group-item-clickable":""} ${i?"nc-list-group-item-active":""}`,children:r.jsx("div",{style:{flex:1},children:e})})}function pt({title:e,titleTools:t,children:n,style:s}){return r.jsxs("div",{className:"nc-list-group",style:s,children:[(e||t)&&r.jsxs("div",{className:"nc-list-group-title",children:[r.jsx("div",{children:e}),t&&r.jsx("div",{className:"nc-list-group-title-tools",children:t})]}),r.jsx("div",{className:"nc-list-group-content",children:n})]})}function ft({values:e,onChange:t,options:n,placeholder:s="Select…",label:o}){const[i,a]=u.useState(!1),[c,d]=u.useState(""),f=u.useRef(null),m=u.useMemo(()=>n.filter(l=>l.label.toLowerCase().includes(c.toLowerCase())),[n,c]);u.useEffect(()=>{function l(p){!(p.target instanceof Node)||!f.current||f.current.contains(p.target)||a(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]);const h=l=>{e.includes(l)?t(e.filter(p=>p!==l)):t([...e,l])};return r.jsxs("div",{ref:f,className:"nc-col",style:{position:"relative"},children:[o&&r.jsx("span",{className:"nc-label",children:o}),r.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&&r.jsx("span",{className:"nc-label",children:s}),e.map(l=>{const p=n.find(g=>g.value===l);return p?r.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:[p.label,r.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:()=>h(l),"aria-label":`Remove ${p.label}`,children:"✕"})]},l):null}),r.jsx("input",{className:"nc-input",value:c,onChange:l=>d(l.target.value),onFocus:()=>a(!0),style:{minWidth:50,border:"none",background:"transparent",padding:4,minHeight:32,flex:1}})]}),i&&r.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:[m.map(l=>{const p=e.includes(l.value);return r.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>h(l.value),children:[r.jsx("span",{children:l.label}),r.jsx("span",{children:p?"✔️":""})]},l.value)}),m.length===0&&r.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}const ht=["January","February","March","April","May","June","July","August","September","October","November","December"];function oe(e){if(!e)return null;const t=/^\d{2}-\d{1,2}$/,n=/^\d{4}-\d{1,2}$/;if(!t.test(e)&&!n.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 re(e){if(!e)return"";const t=e.split("-");if(t.length!==2)return e;let n=t[0];const s=t[1].padStart(2,"0");if(n.length===2){const o=parseInt(n,10);n=String(o<50?2e3+o:1900+o)}return`${n}-${s}`}function ye(e){if(!e)return"";const t=re(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[n,s]=t.split("-"),o=parseInt(s,10)-1;return`${ht[o]} ${n}`}function je(){const e=new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0");return`${t}-${n}`}function mt({startMonth:e,endMonth:t,onChange:n,label:s,className:o="",disabled:i=!1}){const[a,c]=u.useState(!1),[d,f]=u.useState(""),[m,h]=u.useState(""),[l,p]=u.useState({top:0,left:0,width:0}),g=u.useRef(null),b=u.useRef(null);u.useEffect(()=>{if(a&&g.current){const E=g.current.getBoundingClientRect();p({top:E.bottom+4,left:E.left,width:E.width})}},[a]),u.useEffect(()=>{if(!a)return;const E=T=>{g.current&&!g.current.contains(T.target)&&b.current&&!b.current.contains(T.target)&&c(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[a]);const x=()=>{f(e||je()),h(t||je()),c(!0)},y=()=>{c(!1)},j=()=>{const E=oe(d),T=oe(m);if(E||T)return;const M=re(d),B=re(m);M&&B&&(n==null||n(M,B)),c(!1)},R=e&&t?`${ye(e)} - ${ye(t)}`:"Select month range",w=oe(d),A=oe(m),S=re(d),v=re(m),C=S&&v&&S>v,k=a?se.createPortal(r.jsx("div",{ref:b,className:"nc-month-range-picker-popup",style:{position:"fixed",top:l.top,left:l.left,width:Math.max(l.width,400),zIndex:1e3},children:r.jsxs("div",{className:"nc-month-range-picker-content",children:[r.jsxs("div",{className:"nc-month-range-picker-row",children:[r.jsxs("div",{className:"nc-month-range-picker-column",children:[r.jsx("label",{className:"nc-label",children:"Start Month"}),r.jsx("input",{type:"text",className:`nc-month-input ${w?"nc-error":""}`,value:d,onChange:E=>f(E.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),w&&r.jsx("div",{className:"nc-month-error-text",children:w})]}),r.jsxs("div",{className:"nc-month-range-picker-column",children:[r.jsx("label",{className:"nc-label",children:"End Month"}),r.jsx("input",{type:"text",className:`nc-month-input ${A?"nc-error":""}`,value:m,onChange:E=>h(E.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),A&&r.jsx("div",{className:"nc-month-error-text",children:A})]})]}),C&&!w&&!A&&r.jsx("div",{className:"nc-month-range-error",children:"End month must be after or equal to start month"}),r.jsxs("div",{className:"nc-month-range-picker-footer",children:[r.jsx(D,{variant:"primary",onClick:j,disabled:!d||!m||!!w||!!A||!!C,children:"Apply"}),r.jsx(D,{variant:"ghost",onClick:y,children:"Cancel"})]})]})}),document.body):null;return r.jsxs("div",{className:`nc-month-range-picker ${o}`,children:[s&&r.jsx("label",{className:"nc-label",children:s}),r.jsx("button",{ref:g,className:"nc-month-range-picker-input",onClick:x,disabled:i,children:R}),k]})}function gt({value:e,onChange:t,min:n,max:s,step:o=1,label:i,disabled:a,size:c="default"}){const d=c==="small",f=()=>{const l=e-o;n!==void 0&&l<n||t(parseFloat(l.toFixed(10)))},m=()=>{const l=e+o;s!==void 0&&l>s||t(parseFloat(l.toFixed(10)))},h=l=>{const p=parseFloat(l.target.value);isNaN(p)||n!==void 0&&p<n||s!==void 0&&p>s||t(p)};return r.jsxs("div",{className:`nc-col nc-number-input-col ${d?"nc-small":""}`,children:[i&&r.jsx("span",{className:`nc-label ${d?"nc-small":""}`,children:i}),r.jsxs("div",{className:`nc-number-input-container ${d?"nc-small":""}`,children:[r.jsx("input",{className:`nc-input nc-number-input ${d?"nc-small":""}`,type:"number",value:e,onChange:h,min:n,max:s,step:o,disabled:a}),r.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${d?"nc-small":""}`,onClick:f,disabled:a||n!==void 0&&e<=n,children:"−"}),r.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${d?"nc-small":""}`,onClick:m,disabled:a||s!==void 0&&e>=s,children:"+"})]})]})}function bt({value:e,onChange:t,min:n=0,max:s=100,step:o=1,label:i,disabled:a,showValue:c=!0,formatValue:d=m=>m.toString(),width:f=200}){const m=l=>{const p=parseFloat(l.target.value);t(p)},h=(e-n)/(s-n)*100;return r.jsxs("div",{className:"nc-col",style:{gap:6},children:[i&&r.jsx("span",{className:"nc-label",children:i}),r.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[r.jsx("input",{type:"range",className:"nc-slider",value:e,onChange:m,min:n,max:s,step:o,disabled:a,style:{width:f,"--nc-slider-percentage":`${h}%`}}),c&&r.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:d(e)})]})]})}const xt=({size:e=24,className:t,style:n})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,style:n,children:r.jsx("polyline",{points:"18 15 12 9 6 15"})});function vt({tabs:e,active:t,onChange:n,className:s,toolbar:o,multiline:i,orientation:a="horizontal",style:c}){const d=u.useRef(null),[f,m]=u.useState(!1),[h,l]=u.useState(!1),p=a==="verticalLeft"||a==="verticalRight",g=u.useRef(!1),b=u.useRef(0),x=u.useRef(0),y=u.useRef(!1);u.useEffect(()=>{const v=()=>{if(d.current)if(p){const{scrollTop:k,scrollHeight:E,clientHeight:T}=d.current;m(k>1),l(k<E-T-1)}else{const{scrollLeft:k,scrollWidth:E,clientWidth:T}=d.current;m(k>1),l(k<E-T-1)}},C=d.current;if(C)return v(),C.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{C.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[e,p]);const j=v=>{d.current&&(g.current=!0,y.current=!1,b.current=p?v.clientY:v.clientX,x.current=p?d.current.scrollTop:d.current.scrollLeft,d.current.style.cursor="grabbing",d.current.style.userSelect="none")},R=v=>{if(!g.current||!d.current)return;const C=p?v.clientY:v.clientX,k=b.current-C;Math.abs(k)>3&&(y.current=!0),p?d.current.scrollTop=x.current+k:d.current.scrollLeft=x.current+k},w=()=>{d.current&&(g.current=!1,d.current.style.cursor="",d.current.style.userSelect="")},A=()=>{w()};u.useEffect(()=>{const v=d.current;if(!v||p)return;const C=k=>{k.deltaY!==0&&(k.preventDefault(),v.scrollLeft+=k.deltaY*.3)};return v.addEventListener("wheel",C,{passive:!1}),()=>{v.removeEventListener("wheel",C)}},[p]);const S=v=>{y.current||n(v)};return r.jsxs("div",{className:`nc-tab-container ${p?`nc-vertical nc-${a}`:""} ${s||""}`,style:c,children:[r.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[f&&r.jsx("div",{className:`nc-tab-scroll-indicator ${p?"nc-top":"nc-left"}`,children:p?r.jsx(xt,{size:16}):r.jsx(W.ChevronLeftIcon,{size:16})}),r.jsx("div",{ref:d,className:`nc-tab-scroll ${i?"nc-multiline":""}`,onMouseDown:j,onMouseMove:R,onMouseUp:w,onMouseLeave:A,style:{cursor:"grab"},children:e.map(v=>r.jsx("div",{className:`nc-tab-item ${t===v?"nc-active":""}`,onClick:()=>S(v),role:"button",tabIndex:0,onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&n(v)},children:p?v:v.toUpperCase()},v))}),h&&r.jsx("div",{className:`nc-tab-scroll-indicator ${p?"nc-bottom":"nc-right"}`,children:p?r.jsx(W.ChevronDownIcon,{size:16}):r.jsx(W.ChevronRightIcon,{size:16})})]}),o&&r.jsx("div",{className:"nc-tab-toolbar",children:o})]})}function wt({checked:e,onChange:t,disabled:n,label:s}){return r.jsxs("label",{className:"nc-row",style:{gap:10,alignItems:"center",cursor:n?"not-allowed":"pointer"},children:[s&&r.jsx("span",{className:"nc-label",children:s}),r.jsx("span",{role:"switch","aria-checked":e,tabIndex:0,onKeyDown:o=>{n||(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(!e))},onClick:()=>!n&&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:r.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"}})})]})}let _={notifications:[]};const de=new Set,ke=new Map;function ue(){const e=_.notifications.slice();for(const t of Array.from(de))try{t(e)}catch{}}function yt(e){de.add(e);try{e(_.notifications.slice())}catch{}return()=>{de.delete(e)}}function jt(e){const t=`notification-${Date.now()}-${Math.random()}`,n={id:t,dismissible:!0,lastingTime:5e3,...e};return _.notifications=[n,..._.notifications],ue(),n.lastingTime&&n.lastingTime>0&&setTimeout(()=>{Re(t)},n.lastingTime),t}function Re(e){const t=_.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,ue();const n=window.setTimeout(()=>{_.notifications=_.notifications.filter(s=>s.id!==e),ue(),ke.delete(e)},300);ke.set(e,n)}function Ee({notification:e}){const{t}=K.useTranslation(),n=()=>{if(e.title)return e.title;switch(e.type){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},s=()=>{Re(e.id)};return r.jsx("div",{className:`nc-notification nc-notification-${e.type||"info"}`,children:r.jsxs("div",{className:"nc-notification-content",children:[r.jsxs("div",{className:"nc-notification-body",style:{paddingRight:e.dismissible?"8px":"0"},children:[r.jsx("div",{className:"nc-notification-title",children:n()}),r.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&r.jsx("button",{className:"nc-notification-dismiss",onClick:s,children:r.jsx(W.CloseIcon,{size:16})})]})})}function kt(){const[e,t]=u.useState([]),[n,s]=u.useState(new Map),[o,i]=u.useState(new Set),a=u.useRef(null),c=u.useRef([]);return u.useEffect(()=>yt(f=>{const m=new Set(c.current.map(l=>l.id)),h=f.filter(l=>!m.has(l.id)).map(l=>l.id);h.length>0?(t(f),i(new Set(h)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(f),c.current=f}),[]),u.useEffect(()=>{if(!a.current)return;const d=new Map;let f=0;const m=a.current.children;e.forEach((h,l)=>{if(d.set(h.id,f),m[l]){const p=m[l].offsetHeight;h.isRemoving||(f+=p+12)}}),s(d)},[e]),r.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none"},children:r.jsx("div",{ref:a,style:{pointerEvents:"auto",position:"relative"},children:e.map(d=>{const f=o.has(d.id),m=d.isRemoving,h=n.get(d.id)||0;return r.jsx("div",{style:{position:"absolute",top:0,left:0,transform:f?"translateY(-120px)":`translateY(${h}px)`,transition:m?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:m?0:1,width:"100%"},children:r.jsx(Ee,{notification:d})},d.id)})})})}const Nt={show:e=>jt(e)};function St(e){const t=Ye.createInstance(),n={};for(const o in e)n[o]={translation:e[o]};const s=typeof document<"u"&&document.documentElement.lang||"en";return t.init({resources:n,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 At{constructor(){V(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 U=new At,Ne="nc-ui-app-state";class Ct{constructor(){V(this,"state");V(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem(Ne);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem(Ne,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,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),()=>{var s;(s=this.listeners.get(t))==null||s.delete(n)}}notify(t,n){var s;(s=this.listeners.get(t))==null||s.forEach(o=>o(n))}}const H=new Ct;class It{constructor(){V(this,"apps",[]);V(this,"activeAppId",null);V(this,"listeners",new Set);V(this,"refReadyResolvers",new Map)}async launchApp(t,n){const{launchInBackground:s=!1}=n||{};if(!U.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),H._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,H._setActiveAppId(t)),this.notify(),this.waitForRef(t)}waitForRef(t){return new Promise(n=>{const s=this.refReadyResolvers.get(t)||[];s.push(n),this.refReadyResolvers.set(t,s)})}setAppRef(t,n){const s=this.apps.find(i=>i.appId===t);if(!s){console.warn(`Cannot set ref for app "${t}": not running`);return}s.ref=n;const o=this.refReadyResolvers.get(t);o&&(o.forEach(i=>i(s)),this.refReadyResolvers.delete(t))}getApp(t){return this.apps.find(n=>n.appId===t)}closeApp(t){const n=this.apps.findIndex(o=>o.appId===t);if(n===-1)return;const s=this.apps[n];if(s.ref&&(s.ref=void 0),this.apps.splice(n,1),this.activeAppId===t){const o=window.innerWidth>=768;this.activeAppId=o&&this.apps.length>0?this.apps[this.apps.length-1].appId:null,H._setActiveAppId(this.activeAppId)}this.notify()}setActiveApp(t){if(t!==null&&!this.apps.find(n=>n.appId===t)){console.warn(`Cannot activate app "${t}": not running`);return}this.activeAppId!==t&&(this.activeAppId=t,this.notify(),H._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?U.get(this.activeAppId)??null:null}getRunningApps(){return[...this.apps]}isRunning(t){return this.apps.some(n=>n.appId===t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){this.listeners.forEach(t=>t())}}const L=new It,me=u.createContext(null);function Me(){const e=u.useContext(me);if(!e)throw new Error("useApp must be used inside an App");return e}function Rt({size:e=16}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M19 12H5"}),r.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function $e({title:e,onClose:t,onBack:n,toolbar:s,hideBackButton:o}){const i=n&&!o;return r.jsxs("div",{className:"nc-app-title-bar",children:[r.jsxs("div",{className:"nc-app-title-bar-left",children:[i&&r.jsx("button",{className:"nc-app-title-bar-back",onClick:n,title:"Back","aria-label":"Go back",children:r.jsx(Rt,{size:16})}),r.jsx("span",{className:"nc-app-title-bar-title",children:e})]}),r.jsxs("div",{className:"nc-app-title-bar-right",children:[s&&r.jsx("div",{className:"nc-app-title-bar-toolbar",children:s}),r.jsx(he,{onClick:t,"aria-label":"Close application"})]})]})}class Et extends u.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error(`Error loading app ${this.props.appId}:`,t,n)}render(){return this.state.hasError?r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,flexDirection:"column",gap:"16px",padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:[r.jsx("div",{children:"Failed to load app"}),this.state.error&&r.jsx("div",{style:{fontSize:"12px",opacity:.7},children:this.state.error.message})]}):this.props.children}}function ge({appId:e,isActive:t,onClose:n}){const{t:s}=K.useTranslation(),o=U.get(e),[i,a]=u.useState(""),[c,d]=u.useState(null),[f,m]=u.useState(null),[h,l]=u.useState(!1),[p,g]=u.useState(!1);u.useEffect(()=>{o!=null&&o.titleKey&&a(s(o.titleKey))},[o,s]);const b=u.useCallback(k=>{a(k)},[]),x=u.useCallback(k=>{d(()=>k)},[]),y=u.useCallback(()=>{d(null)},[]),j=u.useCallback(k=>{m(k)},[]),R=u.useCallback(()=>{m(null)},[]),w=u.useCallback(k=>{l(k)},[]),A=u.useCallback(k=>{g(k)},[]),S=u.useMemo(()=>({setTitle:b,setBackHandler:x,clearBackHandler:y,setToolbar:j,clearToolbar:R,setHideBackButton:w,setHideTitleBar:A,close:n}),[b,x,y,j,R,w,A,n]);if(!o)return null;const v=o.component,C=!o.hideTitleBar&&!p;return r.jsxs("div",{style:{display:t?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:[C&&r.jsx($e,{title:i,onClose:n,onBack:c??void 0,toolbar:f,hideBackButton:h}),r.jsx("div",{className:C?"nc-app-content-wrapper":"",style:{padding:o.padding,flex:1,minHeight:0,display:"flex",flexDirection:"column",backgroundColor:"var(--nc-bg-secondary)",position:"relative"},children:r.jsx(me.Provider,{value:S,children:r.jsx(Et,{appId:e,children:r.jsx(u.Suspense,{fallback:r.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:r.jsx(fe,{})}),children:r.jsx(v,{})})})})})]})}function Mt({autoWidth:e=!0,className:t,style:n}){const[s,o]=u.useState(()=>H.getActiveAppId()),[i,a]=u.useState(()=>L.getRunningApps());u.useEffect(()=>{const g=H.subscribe("activeAppId",b=>{o(b)});return()=>{g()}},[]),u.useEffect(()=>L.subscribe(()=>{a(L.getRunningApps())}),[]),u.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const x=H.getActiveAppId();x&&!L.isRunning(x)&&L.launchApp(x)}},[]);const c=g=>{L.closeApp(g)},d=s?U.get(s):null,m=(d==null?void 0:d.width)??400,h=s!==null,p={...{overflow:"hidden",display:h?"flex":"none",flexDirection:"column",flexShrink:0,...e&&h?{width:m}:{}},...n};return r.jsx("div",{className:t,style:p,children:i.map(g=>r.jsx(ge,{appId:g.appId,isActive:s===g.appId,onClose:()=>c(g.appId)},g.appId))})}const ie=768,ae=1024,ze={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},Pe=u.createContext(ze);function $t({children:e}){const[t,n]=u.useState(()=>{if(typeof window>"u")return ze;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ie,isTablet:s>=ie&&s<ae,isDesktop:s>=ae,width:s,height:o}});return u.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;n({isMobile:o<ie,isTablet:o>=ie&&o<ae,isDesktop:o>=ae,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),r.jsx(Pe.Provider,{value:t,children:e})}function Te(){return u.useContext(Pe)}function zt({pinnedAppIds:e,className:t=""}){const{isMobile:n}=Te(),[s,o]=u.useState(()=>H.getActiveAppId()),[i,a]=u.useState(()=>L.getRunningApps());u.useEffect(()=>{const l=H.subscribe("activeAppId",p=>{o(p)});return()=>{l()}},[]),u.useEffect(()=>L.subscribe(()=>{a(L.getRunningApps())}),[]);const c=l=>{s===l?L.setActiveApp(null):L.launchApp(l)},d=e.map(l=>U.get(l)).filter(l=>!!l),f=i.filter(l=>!e.includes(l.appId)).map(l=>({running:l,def:U.get(l.appId)})).filter(l=>!!l.def),m=l=>i.some(p=>p.appId===l),h=n?24:28;return r.jsxs("div",{className:`nc-app-taskbar ${n?"nc-mobile":"nc-desktop"} ${t}`,children:[d.map(l=>{const p=l.icon,g=s===l.id,b=m(l.id);return r.jsxs("button",{className:`nc-app-taskbar-button ${g?"nc-active":""} ${b?"nc-running":""}`,onClick:()=>c(l.id),title:l.titleKey||l.id,children:[r.jsx(p,{size:h}),b&&r.jsx("span",{className:"nc-app-taskbar-indicator"})]},l.id)}),f.length>0&&r.jsx("div",{className:"nc-app-taskbar-separator"}),f.map(({running:l,def:p})=>{const g=p.icon,b=s===l.appId;return r.jsxs("button",{className:`nc-app-taskbar-button ${b?"nc-active":""} nc-running`,onClick:()=>c(l.appId),title:p.titleKey||p.id,children:[r.jsx(g,{size:h}),r.jsx("span",{className:"nc-app-taskbar-indicator"})]},l.appId)})]})}function Pt({appId:e,open:t,onClose:n,closeOnBackdrop:s=!1,className:o="",maxWidth:i=1200,maxHeight:a=900}){const c=f=>{s&&f.target===f.currentTarget&&n()};if(!t)return null;const d=r.jsx("div",{className:"nc-dialog-overlay nc-fullscreen",onClick:c,children:r.jsx("div",{className:`nc-app-dialog-container ${o}`,style:{maxWidth:`${i}px`,maxHeight:`${a}px`},onClick:f=>f.stopPropagation(),children:r.jsx(ge,{appId:e,isActive:!0,onClose:n})})});return se.createPortal(d,document.body)}const be=u.createContext(null),Le=u.createContext(null);function Tt(){const e=u.useContext(be);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function Lt(){const e=u.useContext(Le);if(!e)throw new Error("useNavView must be used within NavStack");return e}const xe=u.createContext(null);function Bt({rootView:e,children:t}){const{t:n}=K.useTranslation(),s=Me(),[o,i]=u.useState([e]),[a,c]=u.useState([null]),d=u.useCallback((w,A)=>{c(S=>{const v=[...S];return v[w]=A,v})},[]),f=u.useCallback(w=>{c(A=>{const S=[...A];return S[w]=null,S})},[]),m=u.useCallback(w=>{i(A=>[...A,w]),c(A=>[...A,null])},[]),h=u.useCallback(()=>{i(w=>w.length<=1?w:w.slice(0,-1)),c(w=>w.slice(0,-1))},[]),l=u.useCallback(()=>{i([e]),c([null])},[e]),p=o.length,g=p>1,b=o.length-1,x=o[o.length-1],y=x!=null&&x.titleKey?n(x.titleKey):(x==null?void 0:x.title)??"";u.useEffect(()=>{s.setTitle(y)},[y,s]),u.useEffect(()=>{g?s.setBackHandler(h):s.clearBackHandler()},[g,h,s]),u.useEffect(()=>{const w=a[a.length-1];w?s.setToolbar(w):s.clearToolbar()},[a,s]);const j={push:m,pop:h,reset:l,depth:p,canGoBack:g,currentTitle:y},R={stack:o,toolbarStack:a,updateToolbar:d,clearToolbarAt:f,topIndex:b};return r.jsx(be.Provider,{value:j,children:r.jsx(xe.Provider,{value:R,children:t})})}function Dt({index:e,children:t}){const n=u.useContext(xe);if(!n)throw new Error("NavViewProvider must be used within NavStackProvider");const{updateToolbar:s,clearToolbarAt:o,topIndex:i}=n,a=u.useCallback(f=>{e===i&&s(e,f)},[e,i,s]),c=u.useCallback(()=>{e===i&&o(e)},[e,i,o]),d={setToolbar:a,clearToolbar:c};return r.jsx(Le.Provider,{value:d,children:t})}function Ht(){const e=u.useContext(be),t=u.useContext(xe);if(!e||!t)throw new Error("NavStackContainer must be used within a NavStackProvider");const{stack:n}=t;return r.jsx("div",{className:"nav-stack-container",children:r.jsx("div",{className:"nav-stack-content",children:n.map((s,o)=>{const i=o===n.length-1;return r.jsx(Dt,{index:o,children:r.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}const ve="-",Wt=e=>{const t=Ot(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:a=>{const c=a.split(ve);return c[0]===""&&c.length!==1&&c.shift(),Be(c,t)||Gt(a)},getConflictingClassGroupIds:(a,c)=>{const d=n[a]||[];return c&&s[a]?[...d,...s[a]]:d}}},Be=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),o=s?Be(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ve);return(a=t.validators.find(({validator:c})=>c(i)))==null?void 0:a.classGroupId},Se=/^\[(.+)\]$/,Gt=e=>{if(Se.test(e)){const t=Se.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ot=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return Yt(Object.entries(e.classGroups),n).forEach(([i,a])=>{pe(a,s,i,t)}),s},pe=(e,t,n,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Ae(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Vt(o)){pe(o(s),t,n,s);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{pe(a,Ae(t,i),n,s)})})},Ae=(e,t)=>{let n=e;return t.split(ve).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},Vt=e=>e.isThemeGetter,Yt=(e,t)=>t?e.map(([n,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[n,o]}):e,Ft=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=s.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},De="!",Kt=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,o=t[0],i=t.length,a=c=>{const d=[];let f=0,m=0,h;for(let x=0;x<c.length;x++){let y=c[x];if(f===0){if(y===o&&(s||c.slice(x,x+i)===t)){d.push(c.slice(m,x)),m=x+i;continue}if(y==="/"){h=x;continue}}y==="["?f++:y==="]"&&f--}const l=d.length===0?c:c.substring(m),p=l.startsWith(De),g=p?l.substring(1):l,b=h&&h>m?h-m:void 0;return{modifiers:d,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:a}):a},qt=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},_t=e=>({cache:Ft(e.cacheSize),parseClassName:Kt(e),...Wt(e)}),Ut=/\s+/,Jt=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(Ut);let c="";for(let d=a.length-1;d>=0;d-=1){const f=a[d],{modifiers:m,hasImportantModifier:h,baseClassName:l,maybePostfixModifierPosition:p}=n(f);let g=!!p,b=s(g?l.substring(0,p):l);if(!b){if(!g){c=f+(c.length>0?" "+c:c);continue}if(b=s(l),!b){c=f+(c.length>0?" "+c:c);continue}g=!1}const x=qt(m).join(":"),y=h?x+De:x,j=y+b;if(i.includes(j))continue;i.push(j);const R=o(b,g);for(let w=0;w<R.length;++w){const A=R[w];i.push(y+A)}c=f+(c.length>0?" "+c:c)}return c};function Xt(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=He(t))&&(s&&(s+=" "),s+=n);return s}const He=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=He(e[s]))&&(n&&(n+=" "),n+=t);return n};function Qt(e,...t){let n,s,o,i=a;function a(d){const f=t.reduce((m,h)=>h(m),e());return n=_t(f),s=n.cache.get,o=n.cache.set,i=c,c(d)}function c(d){const f=s(d);if(f)return f;const m=Jt(d,n);return o(d,m),m}return function(){return i(Xt.apply(null,arguments))}}const P=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},We=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zt=/^\d+\/\d+$/,en=new Set(["px","full","screen"]),tn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nn=/\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))\(.+\)$/,sn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,on=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,O=e=>X(e)||en.has(e)||Zt.test(e),Y=e=>Q(e,"length",hn),X=e=>!!e&&!Number.isNaN(Number(e)),le=e=>Q(e,"number",X),te=e=>!!e&&Number.isInteger(Number(e)),an=e=>e.endsWith("%")&&X(e.slice(0,-1)),N=e=>We.test(e),F=e=>tn.test(e),cn=new Set(["length","size","percentage"]),ln=e=>Q(e,cn,Ge),dn=e=>Q(e,"position",Ge),un=new Set(["image","url"]),pn=e=>Q(e,un,gn),fn=e=>Q(e,"",mn),ne=()=>!0,Q=(e,t,n)=>{const s=We.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},hn=e=>nn.test(e)&&!rn.test(e),Ge=()=>!1,mn=e=>sn.test(e),gn=e=>on.test(e),bn=()=>{const e=P("colors"),t=P("spacing"),n=P("blur"),s=P("brightness"),o=P("borderColor"),i=P("borderRadius"),a=P("borderSpacing"),c=P("borderWidth"),d=P("contrast"),f=P("grayscale"),m=P("hueRotate"),h=P("invert"),l=P("gap"),p=P("gradientColorStops"),g=P("gradientColorStopPositions"),b=P("inset"),x=P("margin"),y=P("opacity"),j=P("padding"),R=P("saturate"),w=P("scale"),A=P("sepia"),S=P("skew"),v=P("space"),C=P("translate"),k=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",N,t],M=()=>[N,t],B=()=>["",O,Y],I=()=>["auto",X,N],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ce=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",N],we=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[X,N];return{cacheSize:500,separator:":",theme:{colors:[ne],spacing:[O,Y],blur:["none","",F,N],brightness:G(),borderColor:[e],borderRadius:["none","","full",F,N],borderSpacing:M(),borderWidth:B(),contrast:G(),grayscale:ee(),hueRotate:G(),invert:ee(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[an,Y],inset:T(),margin:T(),opacity:G(),padding:M(),saturate:G(),scale:G(),sepia:ee(),skew:G(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":we()}],"break-before":[{"break-before":we()}],"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:[...$(),N]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",te,N]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",te,N]}],"grid-cols":[{"grid-cols":[ne]}],"col-start-end":[{col:["auto",{span:["full",te,N]},N]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[ne]}],"row-start-end":[{row:["auto",{span:[te,N]},N]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[l]}],"gap-x":[{"gap-x":[l]}],"gap-y":[{"gap-y":[l]}],"justify-content":[{justify:["normal",...ce()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ce(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ce(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[v]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[v]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-w":[{"min-w":[N,t,"min","max","fit"]}],"max-w":[{"max-w":[N,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,Y]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",le]}],"font-family":[{font:[ne]}],"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",N]}],"line-clamp":[{"line-clamp":["none",X,le]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",O,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"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:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",O,Y]}],"underline-offset":[{"underline-offset":["auto",O,N]}],"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",N]}],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",N]}],"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:[...$(),dn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ln]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},pn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[...z(),"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:z()}],"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:["",...z()]}],"outline-offset":[{"outline-offset":[O,N]}],"outline-w":[{outline:[O,Y]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[O,Y]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,fn]}],"shadow-color":[{shadow:[ne]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",F,N]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[h]}],saturate:[{saturate:[R]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"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",N]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[te,N]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],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",N]}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[O,Y,le]}],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"]}}},xn=Qt(bn);function vn(...e){return xn(Fe.clsx(e))}exports.ActivityIndicator=fe;exports.Alert=Ke;exports.AppContainer=ge;exports.AppContext=me;exports.AppDialog=Pt;exports.AppPanel=Mt;exports.AppTaskbar=zt;exports.AppTitleBar=$e;exports.Battery=qe;exports.Button=D;exports.ButtonGroup=_e;exports.Checkbox=Je;exports.CloseButton=he;exports.ComboBox=tt;exports.ContextMenu=it;exports.Dialog=at;exports.DialogClose=q;exports.EditButton=rt;exports.Hyperlink=ot;exports.Input=dt;exports.ListGroup=pt;exports.ListGroupItem=ut;exports.MonthRangePicker=mt;exports.MultiSelect=ft;exports.NavStackContainer=Ht;exports.NavStackProvider=Bt;exports.Notification=Ee;exports.NotificationContainer=kt;exports.NumberInput=gt;exports.RefreshButton=nt;exports.Slider=bt;exports.Tabs=vt;exports.Toggle=wt;exports.TrashButton=st;exports.ViewportProvider=$t;exports.appRegistry=U;exports.appStateStore=H;exports.cn=vn;exports.createAppI18nFactory=St;exports.notificationManager=Nt;exports.runningAppsStore=L;exports.useApp=Me;exports.useDialog=Ie;exports.useNavStack=Tt;exports.useNavView=Lt;exports.useViewport=Te;
2
2
  //# sourceMappingURL=index.cjs.map