@kingsimba/nc-ui 0.1.7 → 0.1.8

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 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 Y=(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"),ie=require("react-dom"),_=require("react-i18next"),G=require("./GeneratedIcons-HAHchVYC.cjs"),Ye=require("i18next"),Ke=require("./clsx-C11secjj.cjs");function he({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 H({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(he,{size:"small",className:"nc-button-spinner",color:e!=="default"&&e!=="ghost"?"white":void 0}),d]})}function qe({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(H,{size:"small",variant:s.variant??(n==="error"?"danger":"warning"),onClick:o,children:s.text})})]})}function _e({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,v=0,b=c,g=d,j=g-l*2,y=b-l*2,R=Math.max(1,Math.min(4,g/4)),w=o===0?0:.05+o*.95,A=c+f+h,S=20,x=.65,I=Math.max(d,S*x),N=c+f+1,E=(d-S*x)/2;return r.jsxs("svg",{className:"nc-battery",width:A,height:I,viewBox:`0 0 ${A} ${I}`,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:y*w,height:j,fill:"white"})}),r.jsxs("mask",{id:`nc-battery-text-mask-${o}`,children:[r.jsx("rect",{x:"0",y:"0",width:A,height:I,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:v,rx:R,ry:R,width:b,height:g,fill:a}),r.jsx("rect",{x:p+l,y:v+l,width:y,height:j,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(${N}, ${E}) scale(${x})`,fill:i,children:r.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})]})}function Ue({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 Je({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 Xe({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(Je,{size:o})}),s&&r.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function Qe({option:e,onChange:t,selected:n,highlighted:s,small:o}){const i=u.useRef(null),{t:a}=_.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 Ze({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}=_.useTranslation();if(u.useEffect(()=>{if(e&&i.current){const v=i.current.getBoundingClientRect();let b=o;if(o==="bottom"){const g=window.innerHeight-v.bottom,j=v.top;g<320&&j>g&&(b="top")}h(b),f({top:b==="top"?v.top-4:v.bottom+4,left:v.left,width:v.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((v,b)=>r.jsx(Qe,{option:v,onChange:n,selected:v.value===s,highlighted:b===c,small:a},v.value))});return ie.createPortal(p,document.body)}function et({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 tt({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 nt({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),[v,b]=u.useState(""),[g,j]=u.useState(-1),y=u.useRef(null),R=u.useRef(null),w=f==="small",{t:A}=_.useTranslation(),S=u.useMemo(()=>{const C=v.toLowerCase();return c?s.filter($=>$.label.toLowerCase().includes(C)):s},[s,v,c]);u.useEffect(()=>{l&&j(-1)},[l,S]),u.useEffect(()=>{if(!a&&!e&&s.length>0&&t){const C=s.find($=>$.default)||s[0];t(C.value)}},[a,e,s,t]),u.useEffect(()=>{function C($){var T;$.target instanceof Node&&y.current&&((T=y.current.parentElement)!=null&&T.contains($.target)||p(!1))}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]);const x=s.find(C=>C.value===e),I=x&&a,N=!o&&!I,E=!(l&&c)&&!!x,P=(C,$=!1)=>{var T;t==null||t(C),p(!1),b(""),$&&((T=y.current)==null||T.blur())},M=()=>{t==null||t(void 0),b(""),p(!1)},B=C=>{if(!l){(C.key==="ArrowDown"||C.key==="ArrowUp")&&(p(!0),C.preventDefault());return}switch(C.key){case"ArrowDown":C.preventDefault(),j($=>{const T=$+1;return T>=S.length?0:T});break;case"ArrowUp":C.preventDefault(),j($=>{const T=$-1;return T<0?S.length-1:T});break;case"Enter":C.preventDefault(),g>=0&&g<S.length&&P(S[g].value,!0);break;case"Escape":C.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:C=>{o||c&&C.target===y.current||(p($=>(!$&&c&&x&&b(x.label),!$)),c&&!l&&setTimeout(()=>{var $,T;($=y.current)==null||$.focus(),(T=y.current)==null||T.select()},0))},children:[r.jsx("input",{ref:y,className:`nc-input ${w?"nc-small":""}`,placeholder:n,onFocus:()=>{var C;!o&&c&&(p(!0),x&&(b(x.label),setTimeout(()=>{var $;return($=y.current)==null?void 0:$.select()},0))),c||(C=y.current)==null||C.blur()},onChange:C=>c&&b(C.target.value),onKeyDown:B,value:l&&c?v:(x==null?void 0:x.label)||"",readOnly:o||!c,style:{width:"100%",paddingRight:N||I?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:N||I?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:x==null?void 0:x.label}),(x==null?void 0:x.default)&&r.jsxs("span",{className:`nc-combo-overlay-default ${w?"nc-small":""}`,children:["(",A("common.default"),")"]})]}),I&&r.jsx(et,{onClick:M,small:w}),N&&r.jsx(tt,{open:l,onClick:()=>p(C=>!C),small:w})]}),r.jsx(Ze,{isOpen:l,options:S,onSelect:P,selectedValue:e,placement:d,anchorRef:R,small:w,highlightedIndex:g})]})}function rt({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(G.RefreshIcon,{size:a,className:t?"nc-spinning":""})})}function me({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(G.CloseIcon,{size:i})})}function st({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(G.EditIcon,{size:i})})}function ot({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(G.TrashIcon,{size:i})})}function it({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 at({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,v=window.innerWidth,b=h.bottom+8,g=b+l.height<=p-8;let j=i;(!g&&i==="down"||i==="up"&&g)&&(j="up");let y;j==="down"?y=b:y=h.top-l.height-8;let R=h.left;R+l.width>v-8&&(R=h.right-l.width),d({top:Math.max(8,y),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 ie.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 Ie=u.createContext(null);function Re(){const e=u.useContext(Ie);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function U({children:e,onClick:t,...n}){const{close:s}=Re(),{t:o}=_.useTranslation(),i=a=>{t==null||t(a),s()};return r.jsx(H,{onClick:i,...n,children:e??o("common.close")})}function Z(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function ct({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:v,onCancel:b,onConnect:g,closeOnOverlay:j=!0,primaryDisabled:y=!1,fullScreen:R=!1,hideTitleBar:w=!1}){const A=u.useRef(null),{t:S}=_.useTranslation(),x={close:t},I=P=>{j&&P.target===P.currentTarget&&t()};if(u.useEffect(()=>{e&&A.current&&A.current.focus()},[e]),!e)return null;const N=()=>{switch(m){case"ok":return r.jsx("div",{className:"nc-dialog-footer",children:r.jsx(H,{variant:"primary",onClick:l??t,disabled:y,children:S("common.ok")})});case"ok-cancel":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(H,{variant:"primary",onClick:l??t,disabled:y,children:S("common.ok")}),r.jsx(U,{onClick:b,children:S("common.cancel")})]});case"save-cancel":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(H,{variant:"primary",onClick:p,disabled:y,children:S("common.save")}),r.jsx(U,{onClick:b,children:S("common.cancel")})]});case"delete-cancel":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(H,{variant:"danger",onClick:v,disabled:y,children:S("common.delete")}),r.jsx(U,{onClick:b,children:S("common.cancel")})]});case"connect":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(H,{variant:"primary",onClick:g,disabled:y,children:S("common.connect")}),r.jsx(U,{onClick:b,children:S("common.cancel")})]});case"close":return r.jsx("div",{className:"nc-dialog-footer",children:r.jsx(U,{variant:"primary"})});case"gotit":return r.jsx("div",{className:"nc-dialog-footer",children:r.jsx(U,{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(Ie.Provider,{value:x,children:r.jsx("div",{className:`nc-dialog-overlay${R?" nc-fullscreen":""}`,onClick:I,children:r.jsxs("div",{ref:A,className:"nc-dialog-container",style:{width:Z(o),height:Z(i),minWidth:Z(a),minHeight:Z(c),maxWidth:Z(d),maxHeight:Z(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(me,{onClick:t,"aria-label":"Close dialog"})]}),r.jsx("div",{className:"nc-dialog-content",children:s}),N()]})})});return R?ie.createPortal(E,document.body):E}function lt({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 dt({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(G.EyeHiddenIcon,{size:o}):r.jsx(G.ViewIcon,{size:o})})}function ut({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:v=3,validator:b,showErrorMessage:g=!0}){const j=u.useRef(null),y=u.useRef(null),[R,w]=u.useState(!1),[A,S]=u.useState(!1),x=b?b(e):null,I=!!x,N=d==="password",E=N&&l&&!i&&!p,P=c&&e&&!i&&A,M=m==="small"?32:44;let B=12;P&&E?B=M*2:(P||E)&&(B=M);const C=()=>{var F,L;t==null||t(""),s==null||s(),p?(F=y.current)==null||F.focus():(L=j.current)==null||L.focus()},$=F=>{F.key==="Enter"&&!p&&(n==null||n())},T=F=>{t==null||t(F.target.value)},ne=()=>{S(!0)},Q=()=>{S(!1)},V=`nc-input ${m==="small"?"nc-small ":""} ${I?"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:y,className:V,placeholder:o,value:e,onChange:T,onKeyDown:$,onFocus:ne,onBlur:Q,disabled:i,rows:v,style:{width:"100%",paddingRight:B,resize:"vertical"}}):r.jsx("input",{ref:j,type:N&&R?"text":d,className:V,placeholder:o,value:e,onChange:T,onKeyDown:$,onFocus:ne,onBlur:Q,disabled:i,style:{width:"100%",paddingRight:B}}),P&&r.jsx(lt,{onClick:C,size:m,rightOffset:E?M+4:4}),E&&r.jsx(dt,{visible:R,onClick:()=>w(!R),size:m})]}),I&&g&&r.jsx("span",{className:"nc-error-message",children:x})]})}function pt({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 ft({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 ht({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(v=>v.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 mt=["January","February","March","April","May","June","July","August","September","October","November","December"];function ae(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 oe(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 je(e){if(!e)return"";const t=oe(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[n,s]=t.split("-"),o=parseInt(s,10)-1;return`${mt[o]} ${n}`}function ke(){const e=new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0");return`${t}-${n}`}function gt({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}),v=u.useRef(null),b=u.useRef(null);u.useEffect(()=>{if(a&&v.current){const E=v.current.getBoundingClientRect();p({top:E.bottom+4,left:E.left,width:E.width})}},[a]),u.useEffect(()=>{if(!a)return;const E=P=>{v.current&&!v.current.contains(P.target)&&b.current&&!b.current.contains(P.target)&&c(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[a]);const g=()=>{f(e||ke()),h(t||ke()),c(!0)},j=()=>{c(!1)},y=()=>{const E=ae(d),P=ae(m);if(E||P)return;const M=oe(d),B=oe(m);M&&B&&(n==null||n(M,B)),c(!1)},R=e&&t?`${je(e)} - ${je(t)}`:"Select month range",w=ae(d),A=ae(m),S=oe(d),x=oe(m),I=S&&x&&S>x,N=a?ie.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})]})]}),I&&!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(H,{variant:"primary",onClick:y,disabled:!d||!m||!!w||!!A||!!I,children:"Apply"}),r.jsx(H,{variant:"ghost",onClick:j,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:v,className:"nc-month-range-picker-input",onClick:g,disabled:i,children:R}),N]})}function bt({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 xt({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 vt=({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 wt({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",v=u.useRef(!1),b=u.useRef(0),g=u.useRef(0),j=u.useRef(!1);u.useEffect(()=>{const x=()=>{if(d.current)if(p){const{scrollTop:N,scrollHeight:E,clientHeight:P}=d.current;m(N>1),l(N<E-P-1)}else{const{scrollLeft:N,scrollWidth:E,clientWidth:P}=d.current;m(N>1),l(N<E-P-1)}},I=d.current;if(I)return x(),I.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{I.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[e,p]);const y=x=>{d.current&&(v.current=!0,j.current=!1,b.current=p?x.clientY:x.clientX,g.current=p?d.current.scrollTop:d.current.scrollLeft,d.current.style.cursor="grabbing",d.current.style.userSelect="none")},R=x=>{if(!v.current||!d.current)return;const I=p?x.clientY:x.clientX,N=b.current-I;Math.abs(N)>3&&(j.current=!0),p?d.current.scrollTop=g.current+N:d.current.scrollLeft=g.current+N},w=()=>{d.current&&(v.current=!1,d.current.style.cursor="",d.current.style.userSelect="")},A=()=>{w()};u.useEffect(()=>{const x=d.current;if(!x||p)return;const I=N=>{N.deltaY!==0&&(N.preventDefault(),x.scrollLeft+=N.deltaY*.3)};return x.addEventListener("wheel",I,{passive:!1}),()=>{x.removeEventListener("wheel",I)}},[p]);const S=x=>{j.current||n(x)};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(vt,{size:16}):r.jsx(G.ChevronLeftIcon,{size:16})}),r.jsx("div",{ref:d,className:`nc-tab-scroll ${i?"nc-multiline":""}`,onMouseDown:y,onMouseMove:R,onMouseUp:w,onMouseLeave:A,style:{cursor:"grab"},children:e.map(x=>r.jsx("div",{className:`nc-tab-item ${t===x?"nc-active":""}`,onClick:()=>S(x),role:"button",tabIndex:0,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&n(x)},children:p?x:x.toUpperCase()},x))}),h&&r.jsx("div",{className:`nc-tab-scroll-indicator ${p?"nc-bottom":"nc-right"}`,children:p?r.jsx(G.ChevronDownIcon,{size:16}):r.jsx(G.ChevronRightIcon,{size:16})})]}),o&&r.jsx("div",{className:"nc-tab-toolbar",children:o})]})}function yt({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 J={notifications:[]};const ue=new Set,Ne=new Map;function pe(){const e=J.notifications.slice();for(const t of Array.from(ue))try{t(e)}catch{}}function jt(e){ue.add(e);try{e(J.notifications.slice())}catch{}return()=>{ue.delete(e)}}function kt(e){const t=`notification-${Date.now()}-${Math.random()}`,n={id:t,dismissible:!0,lastingTime:5e3,...e};return J.notifications=[n,...J.notifications],pe(),n.lastingTime&&n.lastingTime>0&&setTimeout(()=>{Ee(t)},n.lastingTime),t}function Ee(e){const t=J.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,pe();const n=window.setTimeout(()=>{J.notifications=J.notifications.filter(s=>s.id!==e),pe(),Ne.delete(e)},300);Ne.set(e,n)}function Me({notification:e}){const{t}=_.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=()=>{Ee(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(G.CloseIcon,{size:16})})]})})}function Nt(){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(()=>jt(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(Me,{notification:d})},d.id)})})})}const St={show:e=>kt(e)};function At(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 Ct{constructor(){Y(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 X=new Ct,Se="nc-ui-app-state";class It{constructor(){Y(this,"state");Y(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem(Se);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem(Se,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 W=new It;class Rt{constructor(){Y(this,"apps",[]);Y(this,"activeAppId",null);Y(this,"listeners",new Set);Y(this,"refReadyResolvers",new Map)}async launchApp(t,n){const{launchInBackground:s=!1}=n||{};if(!X.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),W._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,W._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,W._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(),W._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?X.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 D=new Rt,ge=u.createContext(null);function $e(){const e=u.useContext(ge);if(!e)throw new Error("useApp must be used inside an App");return e}function Et({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 ze({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(Et,{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(me,{onClick:t,"aria-label":"Close application"})]})]})}class Mt 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 be({appId:e,isActive:t,onClose:n}){const{t:s}=_.useTranslation(),o=X.get(e),[i,a]=u.useState(""),[c,d]=u.useState(null),[f,m]=u.useState(null),[h,l]=u.useState(!1),[p,v]=u.useState(!1);u.useEffect(()=>{o!=null&&o.titleKey&&a(s(o.titleKey))},[o,s]);const b=u.useCallback(N=>{a(N)},[]),g=u.useCallback(N=>{d(()=>N)},[]),j=u.useCallback(()=>{d(null)},[]),y=u.useCallback(N=>{m(N)},[]),R=u.useCallback(()=>{m(null)},[]),w=u.useCallback(N=>{l(N)},[]),A=u.useCallback(N=>{v(N)},[]),S=u.useMemo(()=>({setTitle:b,setBackHandler:g,clearBackHandler:j,setToolbar:y,clearToolbar:R,setHideBackButton:w,setHideTitleBar:A,close:n}),[b,g,j,y,R,w,A,n]);if(!o)return null;const x=o.component,I=!o.hideTitleBar&&!p;return r.jsxs("div",{style:{display:t?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:[I&&r.jsx(ze,{title:i,onClose:n,onBack:c??void 0,toolbar:f,hideBackButton:h}),r.jsx("div",{className:I?"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(ge.Provider,{value:S,children:r.jsx(Mt,{appId:e,children:r.jsx(u.Suspense,{fallback:r.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:r.jsx(he,{})}),children:r.jsx(x,{})})})})})]})}const ce=768,le=1024,Pe={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},Te=u.createContext(Pe);function $t({children:e}){const[t,n]=u.useState(()=>{if(typeof window>"u")return Pe;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ce,isTablet:s>=ce&&s<le,isDesktop:s>=le,width:s,height:o}});return u.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;n({isMobile:o<ce,isTablet:o>=ce&&o<le,isDesktop:o>=le,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),r.jsx(Te.Provider,{value:t,children:e})}function xe(){return u.useContext(Te)}const ve="-",zt=e=>{const t=Tt(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)||Pt(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},Ae=/^\[(.+)\]$/,Pt=e=>{if(Ae.test(e)){const t=Ae.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Tt=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return Lt(Object.entries(e.classGroups),n).forEach(([i,a])=>{fe(a,s,i,t)}),s},fe=(e,t,n,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Ce(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Bt(o)){fe(o(s),t,n,s);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{fe(a,Ce(t,i),n,s)})})},Ce=(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},Bt=e=>e.isThemeGetter,Lt=(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,Dt=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)}}},Le="!",Ht=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 g=0;g<c.length;g++){let j=c[g];if(f===0){if(j===o&&(s||c.slice(g,g+i)===t)){d.push(c.slice(m,g)),m=g+i;continue}if(j==="/"){h=g;continue}}j==="["?f++:j==="]"&&f--}const l=d.length===0?c:c.substring(m),p=l.startsWith(Le),v=p?l.substring(1):l,b=h&&h>m?h-m:void 0;return{modifiers:d,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:a}):a},Wt=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},Gt=e=>({cache:Dt(e.cacheSize),parseClassName:Ht(e),...zt(e)}),Ft=/\s+/,Ot=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(Ft);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 v=!!p,b=s(v?l.substring(0,p):l);if(!b){if(!v){c=f+(c.length>0?" "+c:c);continue}if(b=s(l),!b){c=f+(c.length>0?" "+c:c);continue}v=!1}const g=Wt(m).join(":"),j=h?g+Le:g,y=j+b;if(i.includes(y))continue;i.push(y);const R=o(b,v);for(let w=0;w<R.length;++w){const A=R[w];i.push(j+A)}c=f+(c.length>0?" "+c:c)}return c};function Vt(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=De(t))&&(s&&(s+=" "),s+=n);return s}const De=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=De(e[s]))&&(n&&(n+=" "),n+=t);return n};function Yt(e,...t){let n,s,o,i=a;function a(d){const f=t.reduce((m,h)=>h(m),e());return n=Gt(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=Ot(d,n);return o(d,m),m}return function(){return i(Vt.apply(null,arguments))}}const z=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},He=/^\[(?:([a-z-]+):)?(.+)\]$/i,Kt=/^\d+\/\d+$/,qt=new Set(["px","full","screen"]),_t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ut=/\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$/,Jt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Xt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,O=e=>ee(e)||qt.has(e)||Kt.test(e),K=e=>te(e,"length",an),ee=e=>!!e&&!Number.isNaN(Number(e)),de=e=>te(e,"number",ee),re=e=>!!e&&Number.isInteger(Number(e)),Zt=e=>e.endsWith("%")&&ee(e.slice(0,-1)),k=e=>He.test(e),q=e=>_t.test(e),en=new Set(["length","size","percentage"]),tn=e=>te(e,en,We),nn=e=>te(e,"position",We),rn=new Set(["image","url"]),sn=e=>te(e,rn,ln),on=e=>te(e,"",cn),se=()=>!0,te=(e,t,n)=>{const s=He.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},an=e=>Ut.test(e)&&!Jt.test(e),We=()=>!1,cn=e=>Xt.test(e),ln=e=>Qt.test(e),dn=()=>{const e=z("colors"),t=z("spacing"),n=z("blur"),s=z("brightness"),o=z("borderColor"),i=z("borderRadius"),a=z("borderSpacing"),c=z("borderWidth"),d=z("contrast"),f=z("grayscale"),m=z("hueRotate"),h=z("invert"),l=z("gap"),p=z("gradientColorStops"),v=z("gradientColorStopPositions"),b=z("inset"),g=z("margin"),j=z("opacity"),y=z("padding"),R=z("saturate"),w=z("scale"),A=z("sepia"),S=z("skew"),x=z("space"),I=z("translate"),N=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",k,t],M=()=>[k,t],B=()=>["",O,K],C=()=>["auto",ee,k],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],T=()=>["solid","dashed","dotted","double","none"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",k],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[ee,k];return{cacheSize:500,separator:":",theme:{colors:[se],spacing:[O,K],blur:["none","",q,k],brightness:L(),borderColor:[e],borderRadius:["none","","full",q,k],borderSpacing:M(),borderWidth:B(),contrast:L(),grayscale:V(),hueRotate:L(),invert:V(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Zt,K],inset:P(),margin:P(),opacity:L(),padding:M(),saturate:L(),scale:L(),sepia:V(),skew:L(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",k]}],container:["container"],columns:[{columns:[q]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...$(),k]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],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",re,k]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",k]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",re,k]}],"grid-cols":[{"grid-cols":[se]}],"col-start-end":[{col:["auto",{span:["full",re,k]},k]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[se]}],"row-start-end":[{row:["auto",{span:[re,k]},k]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",k]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",k]}],gap:[{gap:[l]}],"gap-x":[{"gap-x":[l]}],"gap-y":[{"gap-y":[l]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[x]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[x]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",k,t]}],"min-w":[{"min-w":[k,t,"min","max","fit"]}],"max-w":[{"max-w":[k,t,"none","full","min","max","fit","prose",{screen:[q]},q]}],h:[{h:[k,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[k,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[k,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[k,t,"auto","min","max","fit"]}],"font-size":[{text:["base",q,K]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",de]}],"font-family":[{font:[se]}],"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",k]}],"line-clamp":[{"line-clamp":["none",ee,de]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",O,k]}],"list-image":[{"list-image":["none",k]}],"list-style-type":[{list:["none","disc","decimal",k]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[j]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...T(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",O,K]}],"underline-offset":[{"underline-offset":["auto",O,k]}],"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",k]}],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",k]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[j]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),nn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",tn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"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":[j]}],"border-style":[{border:[...T(),"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":[j]}],"divide-style":[{divide:T()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...T()]}],"outline-offset":[{"outline-offset":[O,k]}],"outline-w":[{outline:[O,K]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[j]}],"ring-offset-w":[{"ring-offset":[O,K]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",q,on]}],"shadow-color":[{shadow:[se]}],opacity:[{opacity:[j]}],"mix-blend":[{"mix-blend":[...ne(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ne()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",q,k]}],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":[j]}],"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",k]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",k]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",k]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[re,k]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"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",k]}],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",k]}],"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",k]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[O,K,de]}],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"]}}},un=Yt(dn);function Ge(...e){return un(Ke.clsx(e))}function pn({autoWidth:e=!0,className:t,style:n}){const[s,o]=u.useState(()=>W.getActiveAppId()),[i,a]=u.useState(()=>D.getRunningApps()),{isMobile:c}=xe();u.useEffect(()=>{const g=W.subscribe("activeAppId",j=>{o(j)});return()=>{g()}},[]),u.useEffect(()=>D.subscribe(()=>{a(D.getRunningApps())}),[]),u.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const y=W.getActiveAppId();y&&!D.isRunning(y)&&D.launchApp(y)}},[]);const d=g=>{D.closeApp(g)},f=s?X.get(s):null,h=(f==null?void 0:f.width)??400,l=s!==null,b={...{overflow:"hidden",display:l?"flex":"none",flexDirection:"column",flexShrink:0,...e&&l?{width:c?"100%":h}:{}},...n};return r.jsx("div",{className:Ge("nc-app-panel",t),style:b,children:i.map(g=>r.jsx(be,{appId:g.appId,isActive:s===g.appId,onClose:()=>d(g.appId)},g.appId))})}function fn({pinnedAppIds:e,className:t=""}){const{isMobile:n}=xe(),[s,o]=u.useState(()=>W.getActiveAppId()),[i,a]=u.useState(()=>D.getRunningApps());u.useEffect(()=>{const l=W.subscribe("activeAppId",p=>{o(p)});return()=>{l()}},[]),u.useEffect(()=>D.subscribe(()=>{a(D.getRunningApps())}),[]);const c=l=>{s===l?D.setActiveApp(null):D.launchApp(l)},d=e.map(l=>X.get(l)).filter(l=>!!l),f=i.filter(l=>!e.includes(l.appId)).map(l=>({running:l,def:X.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,v=s===l.id,b=m(l.id);return r.jsxs("button",{className:`nc-app-taskbar-button ${v?"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 v=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(v,{size:h}),r.jsx("span",{className:"nc-app-taskbar-indicator"})]},l.appId)})]})}function hn({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(be,{appId:e,isActive:!0,onClose:n})})});return ie.createPortal(d,document.body)}const we=u.createContext(null),Fe=u.createContext(null);function mn(){const e=u.useContext(we);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function gn(){const e=u.useContext(Fe);if(!e)throw new Error("useNavView must be used within NavStack");return e}const ye=u.createContext(null);function bn({rootView:e,children:t}){const{t:n}=_.useTranslation(),s=$e(),[o,i]=u.useState([e]),[a,c]=u.useState([null]),d=u.useCallback((w,A)=>{c(S=>{const x=[...S];return x[w]=A,x})},[]),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,v=p>1,b=o.length-1,g=o[o.length-1],j=g!=null&&g.titleKey?n(g.titleKey):(g==null?void 0:g.title)??"";u.useEffect(()=>{s.setTitle(j)},[j,s]),u.useEffect(()=>{v?s.setBackHandler(h):s.clearBackHandler()},[v,h,s]),u.useEffect(()=>{const w=a[a.length-1];w?s.setToolbar(w):s.clearToolbar()},[a,s]);const y={push:m,pop:h,reset:l,depth:p,canGoBack:v,currentTitle:j},R={stack:o,toolbarStack:a,updateToolbar:d,clearToolbarAt:f,topIndex:b};return r.jsx(we.Provider,{value:y,children:r.jsx(ye.Provider,{value:R,children:t})})}function xn({index:e,children:t}){const n=u.useContext(ye);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(Fe.Provider,{value:d,children:t})}function vn(){const e=u.useContext(we),t=u.useContext(ye);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(xn,{index:o,children:r.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.ActivityIndicator=he;exports.Alert=qe;exports.AppContainer=be;exports.AppContext=ge;exports.AppDialog=hn;exports.AppPanel=pn;exports.AppTaskbar=fn;exports.AppTitleBar=ze;exports.Battery=_e;exports.Button=H;exports.ButtonGroup=Ue;exports.Checkbox=Xe;exports.CloseButton=me;exports.ComboBox=nt;exports.ContextMenu=at;exports.Dialog=ct;exports.DialogClose=U;exports.EditButton=st;exports.Hyperlink=it;exports.Input=ut;exports.ListGroup=ft;exports.ListGroupItem=pt;exports.MonthRangePicker=gt;exports.MultiSelect=ht;exports.NavStackContainer=vn;exports.NavStackProvider=bn;exports.Notification=Me;exports.NotificationContainer=Nt;exports.NumberInput=bt;exports.RefreshButton=rt;exports.Slider=xt;exports.Tabs=wt;exports.Toggle=yt;exports.TrashButton=ot;exports.ViewportProvider=$t;exports.appRegistry=X;exports.appStateStore=W;exports.cn=Ge;exports.createAppI18nFactory=At;exports.notificationManager=St;exports.runningAppsStore=D;exports.useApp=$e;exports.useDialog=Re;exports.useNavStack=mn;exports.useNavView=gn;exports.useViewport=xe;
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 Y=(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"),ie=require("react-dom"),_=require("react-i18next"),G=require("./GeneratedIcons-HAHchVYC.cjs"),Ye=require("i18next"),Ke=require("./clsx-C11secjj.cjs");function he({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 H({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(he,{size:"small",className:"nc-button-spinner",color:e!=="default"&&e!=="ghost"?"white":void 0}),d]})}function qe({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(H,{size:"small",variant:s.variant??(n==="error"?"danger":"warning"),onClick:o,children:s.text})})]})}function _e({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,v=0,b=c,g=d,j=g-l*2,y=b-l*2,R=Math.max(1,Math.min(4,g/4)),w=o===0?0:.05+o*.95,A=c+f+h,S=20,x=.65,I=Math.max(d,S*x),N=c+f+1,E=(d-S*x)/2;return r.jsxs("svg",{className:"nc-battery",width:A,height:I,viewBox:`0 0 ${A} ${I}`,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:y*w,height:j,fill:"white"})}),r.jsxs("mask",{id:`nc-battery-text-mask-${o}`,children:[r.jsx("rect",{x:"0",y:"0",width:A,height:I,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:v,rx:R,ry:R,width:b,height:g,fill:a}),r.jsx("rect",{x:p+l,y:v+l,width:y,height:j,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(${N}, ${E}) scale(${x})`,fill:i,children:r.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})]})}function Ue({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 Je({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 Xe({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(Je,{size:o})}),s&&r.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function Qe({option:e,onChange:t,selected:n,highlighted:s,small:o}){const i=u.useRef(null),{t:a}=_.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 Ze({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}=_.useTranslation();if(u.useEffect(()=>{if(e&&i.current){const v=i.current.getBoundingClientRect();let b=o;if(o==="bottom"){const g=window.innerHeight-v.bottom,j=v.top;g<320&&j>g&&(b="top")}h(b),f({top:b==="top"?v.top-4:v.bottom+4,left:v.left,width:v.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((v,b)=>r.jsx(Qe,{option:v,onChange:n,selected:v.value===s,highlighted:b===c,small:a},v.value))});return ie.createPortal(p,document.body)}function et({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 tt({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 nt({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),[v,b]=u.useState(""),[g,j]=u.useState(-1),y=u.useRef(null),R=u.useRef(null),w=f==="small",{t:A}=_.useTranslation(),S=u.useMemo(()=>{const C=v.toLowerCase();return c?s.filter($=>$.label.toLowerCase().includes(C)):s},[s,v,c]);u.useEffect(()=>{l&&j(-1)},[l,S]),u.useEffect(()=>{if(!a&&!e&&s.length>0&&t){const C=s.find($=>$.default)||s[0];t(C.value)}},[a,e,s,t]),u.useEffect(()=>{function C($){var T;$.target instanceof Node&&y.current&&((T=y.current.parentElement)!=null&&T.contains($.target)||p(!1))}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]);const x=s.find(C=>C.value===e),I=x&&a,N=!o&&!I,E=!(l&&c)&&!!x,P=(C,$=!1)=>{var T;t==null||t(C),p(!1),b(""),$&&((T=y.current)==null||T.blur())},M=()=>{t==null||t(void 0),b(""),p(!1)},B=C=>{if(!l){(C.key==="ArrowDown"||C.key==="ArrowUp")&&(p(!0),C.preventDefault());return}switch(C.key){case"ArrowDown":C.preventDefault(),j($=>{const T=$+1;return T>=S.length?0:T});break;case"ArrowUp":C.preventDefault(),j($=>{const T=$-1;return T<0?S.length-1:T});break;case"Enter":C.preventDefault(),g>=0&&g<S.length&&P(S[g].value,!0);break;case"Escape":C.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:C=>{o||c&&C.target===y.current||(p($=>(!$&&c&&x&&b(x.label),!$)),c&&!l&&setTimeout(()=>{var $,T;($=y.current)==null||$.focus(),(T=y.current)==null||T.select()},0))},children:[r.jsx("input",{ref:y,className:`nc-input ${w?"nc-small":""}`,placeholder:n,onFocus:()=>{var C;!o&&c&&(p(!0),x&&(b(x.label),setTimeout(()=>{var $;return($=y.current)==null?void 0:$.select()},0))),c||(C=y.current)==null||C.blur()},onChange:C=>c&&b(C.target.value),onKeyDown:B,value:l&&c?v:(x==null?void 0:x.label)||"",readOnly:o||!c,style:{width:"100%",paddingRight:N||I?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:N||I?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:x==null?void 0:x.label}),(x==null?void 0:x.default)&&r.jsxs("span",{className:`nc-combo-overlay-default ${w?"nc-small":""}`,children:["(",A("common.default"),")"]})]}),I&&r.jsx(et,{onClick:M,small:w}),N&&r.jsx(tt,{open:l,onClick:()=>p(C=>!C),small:w})]}),r.jsx(Ze,{isOpen:l,options:S,onSelect:P,selectedValue:e,placement:d,anchorRef:R,small:w,highlightedIndex:g})]})}function rt({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(G.RefreshIcon,{size:a,className:t?"nc-spinning":""})})}function me({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(G.CloseIcon,{size:i})})}function st({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(G.EditIcon,{size:i})})}function ot({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(G.TrashIcon,{size:i})})}function it({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 at({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,v=window.innerWidth,b=h.bottom+8,g=b+l.height<=p-8;let j=i;(!g&&i==="down"||i==="up"&&g)&&(j="up");let y;j==="down"?y=b:y=h.top-l.height-8;let R=h.left;R+l.width>v-8&&(R=h.right-l.width),d({top:Math.max(8,y),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 ie.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 Ie=u.createContext(null);function Re(){const e=u.useContext(Ie);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function U({children:e,onClick:t,...n}){const{close:s}=Re(),{t:o}=_.useTranslation(),i=a=>{t==null||t(a),s()};return r.jsx(H,{onClick:i,...n,children:e??o("common.close")})}function Z(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function ct({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:v,onCancel:b,onConnect:g,closeOnOverlay:j=!0,primaryDisabled:y=!1,fullScreen:R=!1,hideTitleBar:w=!1}){const A=u.useRef(null),{t:S}=_.useTranslation(),x={close:t},I=P=>{j&&P.target===P.currentTarget&&t()};if(u.useEffect(()=>{e&&A.current&&A.current.focus()},[e]),!e)return null;const N=()=>{switch(m){case"ok":return r.jsx("div",{className:"nc-dialog-footer",children:r.jsx(H,{variant:"primary",onClick:l??t,disabled:y,children:S("common.ok")})});case"ok-cancel":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(H,{variant:"primary",onClick:l??t,disabled:y,children:S("common.ok")}),r.jsx(U,{onClick:b,children:S("common.cancel")})]});case"save-cancel":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(H,{variant:"primary",onClick:p,disabled:y,children:S("common.save")}),r.jsx(U,{onClick:b,children:S("common.cancel")})]});case"delete-cancel":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(H,{variant:"danger",onClick:v,disabled:y,children:S("common.delete")}),r.jsx(U,{onClick:b,children:S("common.cancel")})]});case"connect":return r.jsxs("div",{className:"nc-dialog-footer",children:[r.jsx(H,{variant:"primary",onClick:g,disabled:y,children:S("common.connect")}),r.jsx(U,{onClick:b,children:S("common.cancel")})]});case"close":return r.jsx("div",{className:"nc-dialog-footer",children:r.jsx(U,{variant:"primary"})});case"gotit":return r.jsx("div",{className:"nc-dialog-footer",children:r.jsx(U,{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(Ie.Provider,{value:x,children:r.jsx("div",{className:`nc-dialog-overlay${R?" nc-fullscreen":""}`,onClick:I,children:r.jsxs("div",{ref:A,className:"nc-dialog-container",style:{width:Z(o),height:Z(i),minWidth:Z(a),minHeight:Z(c),maxWidth:Z(d),maxHeight:Z(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(me,{onClick:t,"aria-label":"Close dialog"})]}),r.jsx("div",{className:"nc-dialog-content",children:s}),N()]})})});return R?ie.createPortal(E,document.body):E}function lt({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.preventDefault(),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 dt({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.preventDefault(),i.stopPropagation()},tabIndex:-1,"aria-label":e?"Hide password":"Show password",style:{position:"absolute",right:4,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:e?r.jsx(G.EyeHiddenIcon,{size:o}):r.jsx(G.ViewIcon,{size:o})})}function ut({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:v=3,validator:b,showErrorMessage:g=!0}){const j=u.useRef(null),y=u.useRef(null),[R,w]=u.useState(!1),[A,S]=u.useState(!1),x=b?b(e):null,I=!!x,N=d==="password",E=N&&l&&!i&&!p,P=c&&e&&!i&&A,M=m==="small"?32:44;let B=12;P&&E?B=M*2:(P||E)&&(B=M);const C=()=>{var F,L;t==null||t(""),s==null||s(),p?(F=y.current)==null||F.focus():(L=j.current)==null||L.focus()},$=F=>{F.key==="Enter"&&!p&&(n==null||n())},T=F=>{t==null||t(F.target.value)},ne=()=>{S(!0)},Q=()=>{S(!1)},V=`nc-input ${m==="small"?"nc-small ":""} ${I?"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:y,className:V,placeholder:o,value:e,onChange:T,onKeyDown:$,onFocus:ne,onBlur:Q,disabled:i,rows:v,style:{width:"100%",paddingRight:B,resize:"vertical"}}):r.jsx("input",{ref:j,type:N&&R?"text":d,className:V,placeholder:o,value:e,onChange:T,onKeyDown:$,onFocus:ne,onBlur:Q,disabled:i,style:{width:"100%",paddingRight:B}}),P&&r.jsx(lt,{onClick:C,size:m,rightOffset:E?M+4:4}),E&&r.jsx(dt,{visible:R,onClick:()=>w(!R),size:m})]}),I&&g&&r.jsx("span",{className:"nc-error-message",children:x})]})}function pt({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 ft({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 ht({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(v=>v.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 mt=["January","February","March","April","May","June","July","August","September","October","November","December"];function ae(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 oe(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 je(e){if(!e)return"";const t=oe(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[n,s]=t.split("-"),o=parseInt(s,10)-1;return`${mt[o]} ${n}`}function ke(){const e=new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0");return`${t}-${n}`}function gt({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}),v=u.useRef(null),b=u.useRef(null);u.useEffect(()=>{if(a&&v.current){const E=v.current.getBoundingClientRect();p({top:E.bottom+4,left:E.left,width:E.width})}},[a]),u.useEffect(()=>{if(!a)return;const E=P=>{v.current&&!v.current.contains(P.target)&&b.current&&!b.current.contains(P.target)&&c(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[a]);const g=()=>{f(e||ke()),h(t||ke()),c(!0)},j=()=>{c(!1)},y=()=>{const E=ae(d),P=ae(m);if(E||P)return;const M=oe(d),B=oe(m);M&&B&&(n==null||n(M,B)),c(!1)},R=e&&t?`${je(e)} - ${je(t)}`:"Select month range",w=ae(d),A=ae(m),S=oe(d),x=oe(m),I=S&&x&&S>x,N=a?ie.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})]})]}),I&&!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(H,{variant:"primary",onClick:y,disabled:!d||!m||!!w||!!A||!!I,children:"Apply"}),r.jsx(H,{variant:"ghost",onClick:j,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:v,className:"nc-month-range-picker-input",onClick:g,disabled:i,children:R}),N]})}function bt({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 xt({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 vt=({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 wt({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",v=u.useRef(!1),b=u.useRef(0),g=u.useRef(0),j=u.useRef(!1);u.useEffect(()=>{const x=()=>{if(d.current)if(p){const{scrollTop:N,scrollHeight:E,clientHeight:P}=d.current;m(N>1),l(N<E-P-1)}else{const{scrollLeft:N,scrollWidth:E,clientWidth:P}=d.current;m(N>1),l(N<E-P-1)}},I=d.current;if(I)return x(),I.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{I.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[e,p]);const y=x=>{d.current&&(v.current=!0,j.current=!1,b.current=p?x.clientY:x.clientX,g.current=p?d.current.scrollTop:d.current.scrollLeft,d.current.style.cursor="grabbing",d.current.style.userSelect="none")},R=x=>{if(!v.current||!d.current)return;const I=p?x.clientY:x.clientX,N=b.current-I;Math.abs(N)>3&&(j.current=!0),p?d.current.scrollTop=g.current+N:d.current.scrollLeft=g.current+N},w=()=>{d.current&&(v.current=!1,d.current.style.cursor="",d.current.style.userSelect="")},A=()=>{w()};u.useEffect(()=>{const x=d.current;if(!x||p)return;const I=N=>{N.deltaY!==0&&(N.preventDefault(),x.scrollLeft+=N.deltaY*.3)};return x.addEventListener("wheel",I,{passive:!1}),()=>{x.removeEventListener("wheel",I)}},[p]);const S=x=>{j.current||n(x)};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(vt,{size:16}):r.jsx(G.ChevronLeftIcon,{size:16})}),r.jsx("div",{ref:d,className:`nc-tab-scroll ${i?"nc-multiline":""}`,onMouseDown:y,onMouseMove:R,onMouseUp:w,onMouseLeave:A,style:{cursor:"grab"},children:e.map(x=>r.jsx("div",{className:`nc-tab-item ${t===x?"nc-active":""}`,onClick:()=>S(x),role:"button",tabIndex:0,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&n(x)},children:p?x:x.toUpperCase()},x))}),h&&r.jsx("div",{className:`nc-tab-scroll-indicator ${p?"nc-bottom":"nc-right"}`,children:p?r.jsx(G.ChevronDownIcon,{size:16}):r.jsx(G.ChevronRightIcon,{size:16})})]}),o&&r.jsx("div",{className:"nc-tab-toolbar",children:o})]})}function yt({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 J={notifications:[]};const ue=new Set,Ne=new Map;function pe(){const e=J.notifications.slice();for(const t of Array.from(ue))try{t(e)}catch{}}function jt(e){ue.add(e);try{e(J.notifications.slice())}catch{}return()=>{ue.delete(e)}}function kt(e){const t=`notification-${Date.now()}-${Math.random()}`,n={id:t,dismissible:!0,lastingTime:5e3,...e};return J.notifications=[n,...J.notifications],pe(),n.lastingTime&&n.lastingTime>0&&setTimeout(()=>{Ee(t)},n.lastingTime),t}function Ee(e){const t=J.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,pe();const n=window.setTimeout(()=>{J.notifications=J.notifications.filter(s=>s.id!==e),pe(),Ne.delete(e)},300);Ne.set(e,n)}function Me({notification:e}){const{t}=_.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=()=>{Ee(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(G.CloseIcon,{size:16})})]})})}function Nt(){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(()=>jt(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(Me,{notification:d})},d.id)})})})}const St={show:e=>kt(e)};function At(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 Ct{constructor(){Y(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 X=new Ct,Se="nc-ui-app-state";class It{constructor(){Y(this,"state");Y(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem(Se);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem(Se,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 W=new It;class Rt{constructor(){Y(this,"apps",[]);Y(this,"activeAppId",null);Y(this,"listeners",new Set);Y(this,"refReadyResolvers",new Map)}async launchApp(t,n){const{launchInBackground:s=!1}=n||{};if(!X.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),W._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,W._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,W._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(),W._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?X.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 D=new Rt,ge=u.createContext(null);function $e(){const e=u.useContext(ge);if(!e)throw new Error("useApp must be used inside an App");return e}function Et({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 ze({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(Et,{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(me,{onClick:t,"aria-label":"Close application"})]})]})}class Mt 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 be({appId:e,isActive:t,onClose:n}){const{t:s}=_.useTranslation(),o=X.get(e),[i,a]=u.useState(""),[c,d]=u.useState(null),[f,m]=u.useState(null),[h,l]=u.useState(!1),[p,v]=u.useState(!1);u.useEffect(()=>{o!=null&&o.titleKey&&a(s(o.titleKey))},[o,s]);const b=u.useCallback(N=>{a(N)},[]),g=u.useCallback(N=>{d(()=>N)},[]),j=u.useCallback(()=>{d(null)},[]),y=u.useCallback(N=>{m(N)},[]),R=u.useCallback(()=>{m(null)},[]),w=u.useCallback(N=>{l(N)},[]),A=u.useCallback(N=>{v(N)},[]),S=u.useMemo(()=>({setTitle:b,setBackHandler:g,clearBackHandler:j,setToolbar:y,clearToolbar:R,setHideBackButton:w,setHideTitleBar:A,close:n}),[b,g,j,y,R,w,A,n]);if(!o)return null;const x=o.component,I=!o.hideTitleBar&&!p;return r.jsxs("div",{style:{display:t?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:[I&&r.jsx(ze,{title:i,onClose:n,onBack:c??void 0,toolbar:f,hideBackButton:h}),r.jsx("div",{className:I?"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(ge.Provider,{value:S,children:r.jsx(Mt,{appId:e,children:r.jsx(u.Suspense,{fallback:r.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:r.jsx(he,{})}),children:r.jsx(x,{})})})})})]})}const ce=768,le=1024,Pe={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},Te=u.createContext(Pe);function $t({children:e}){const[t,n]=u.useState(()=>{if(typeof window>"u")return Pe;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ce,isTablet:s>=ce&&s<le,isDesktop:s>=le,width:s,height:o}});return u.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;n({isMobile:o<ce,isTablet:o>=ce&&o<le,isDesktop:o>=le,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),r.jsx(Te.Provider,{value:t,children:e})}function xe(){return u.useContext(Te)}const ve="-",zt=e=>{const t=Tt(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)||Pt(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},Ae=/^\[(.+)\]$/,Pt=e=>{if(Ae.test(e)){const t=Ae.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Tt=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return Lt(Object.entries(e.classGroups),n).forEach(([i,a])=>{fe(a,s,i,t)}),s},fe=(e,t,n,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Ce(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Bt(o)){fe(o(s),t,n,s);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{fe(a,Ce(t,i),n,s)})})},Ce=(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},Bt=e=>e.isThemeGetter,Lt=(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,Dt=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)}}},Le="!",Ht=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 g=0;g<c.length;g++){let j=c[g];if(f===0){if(j===o&&(s||c.slice(g,g+i)===t)){d.push(c.slice(m,g)),m=g+i;continue}if(j==="/"){h=g;continue}}j==="["?f++:j==="]"&&f--}const l=d.length===0?c:c.substring(m),p=l.startsWith(Le),v=p?l.substring(1):l,b=h&&h>m?h-m:void 0;return{modifiers:d,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:a}):a},Wt=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},Gt=e=>({cache:Dt(e.cacheSize),parseClassName:Ht(e),...zt(e)}),Ft=/\s+/,Ot=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(Ft);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 v=!!p,b=s(v?l.substring(0,p):l);if(!b){if(!v){c=f+(c.length>0?" "+c:c);continue}if(b=s(l),!b){c=f+(c.length>0?" "+c:c);continue}v=!1}const g=Wt(m).join(":"),j=h?g+Le:g,y=j+b;if(i.includes(y))continue;i.push(y);const R=o(b,v);for(let w=0;w<R.length;++w){const A=R[w];i.push(j+A)}c=f+(c.length>0?" "+c:c)}return c};function Vt(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=De(t))&&(s&&(s+=" "),s+=n);return s}const De=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=De(e[s]))&&(n&&(n+=" "),n+=t);return n};function Yt(e,...t){let n,s,o,i=a;function a(d){const f=t.reduce((m,h)=>h(m),e());return n=Gt(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=Ot(d,n);return o(d,m),m}return function(){return i(Vt.apply(null,arguments))}}const z=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},He=/^\[(?:([a-z-]+):)?(.+)\]$/i,Kt=/^\d+\/\d+$/,qt=new Set(["px","full","screen"]),_t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ut=/\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$/,Jt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Xt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,O=e=>ee(e)||qt.has(e)||Kt.test(e),K=e=>te(e,"length",an),ee=e=>!!e&&!Number.isNaN(Number(e)),de=e=>te(e,"number",ee),re=e=>!!e&&Number.isInteger(Number(e)),Zt=e=>e.endsWith("%")&&ee(e.slice(0,-1)),k=e=>He.test(e),q=e=>_t.test(e),en=new Set(["length","size","percentage"]),tn=e=>te(e,en,We),nn=e=>te(e,"position",We),rn=new Set(["image","url"]),sn=e=>te(e,rn,ln),on=e=>te(e,"",cn),se=()=>!0,te=(e,t,n)=>{const s=He.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},an=e=>Ut.test(e)&&!Jt.test(e),We=()=>!1,cn=e=>Xt.test(e),ln=e=>Qt.test(e),dn=()=>{const e=z("colors"),t=z("spacing"),n=z("blur"),s=z("brightness"),o=z("borderColor"),i=z("borderRadius"),a=z("borderSpacing"),c=z("borderWidth"),d=z("contrast"),f=z("grayscale"),m=z("hueRotate"),h=z("invert"),l=z("gap"),p=z("gradientColorStops"),v=z("gradientColorStopPositions"),b=z("inset"),g=z("margin"),j=z("opacity"),y=z("padding"),R=z("saturate"),w=z("scale"),A=z("sepia"),S=z("skew"),x=z("space"),I=z("translate"),N=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",k,t],M=()=>[k,t],B=()=>["",O,K],C=()=>["auto",ee,k],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],T=()=>["solid","dashed","dotted","double","none"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",k],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[ee,k];return{cacheSize:500,separator:":",theme:{colors:[se],spacing:[O,K],blur:["none","",q,k],brightness:L(),borderColor:[e],borderRadius:["none","","full",q,k],borderSpacing:M(),borderWidth:B(),contrast:L(),grayscale:V(),hueRotate:L(),invert:V(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Zt,K],inset:P(),margin:P(),opacity:L(),padding:M(),saturate:L(),scale:L(),sepia:V(),skew:L(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",k]}],container:["container"],columns:[{columns:[q]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...$(),k]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],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",re,k]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",k]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",re,k]}],"grid-cols":[{"grid-cols":[se]}],"col-start-end":[{col:["auto",{span:["full",re,k]},k]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[se]}],"row-start-end":[{row:["auto",{span:[re,k]},k]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",k]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",k]}],gap:[{gap:[l]}],"gap-x":[{"gap-x":[l]}],"gap-y":[{"gap-y":[l]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[x]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[x]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",k,t]}],"min-w":[{"min-w":[k,t,"min","max","fit"]}],"max-w":[{"max-w":[k,t,"none","full","min","max","fit","prose",{screen:[q]},q]}],h:[{h:[k,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[k,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[k,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[k,t,"auto","min","max","fit"]}],"font-size":[{text:["base",q,K]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",de]}],"font-family":[{font:[se]}],"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",k]}],"line-clamp":[{"line-clamp":["none",ee,de]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",O,k]}],"list-image":[{"list-image":["none",k]}],"list-style-type":[{list:["none","disc","decimal",k]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[j]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...T(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",O,K]}],"underline-offset":[{"underline-offset":["auto",O,k]}],"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",k]}],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",k]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[j]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),nn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",tn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},sn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"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":[j]}],"border-style":[{border:[...T(),"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":[j]}],"divide-style":[{divide:T()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...T()]}],"outline-offset":[{"outline-offset":[O,k]}],"outline-w":[{outline:[O,K]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[j]}],"ring-offset-w":[{"ring-offset":[O,K]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",q,on]}],"shadow-color":[{shadow:[se]}],opacity:[{opacity:[j]}],"mix-blend":[{"mix-blend":[...ne(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ne()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",q,k]}],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":[j]}],"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",k]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",k]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",k]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[re,k]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"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",k]}],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",k]}],"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",k]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[O,K,de]}],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"]}}},un=Yt(dn);function Ge(...e){return un(Ke.clsx(e))}function pn({autoWidth:e=!0,className:t,style:n}){const[s,o]=u.useState(()=>W.getActiveAppId()),[i,a]=u.useState(()=>D.getRunningApps()),{isMobile:c}=xe();u.useEffect(()=>{const g=W.subscribe("activeAppId",j=>{o(j)});return()=>{g()}},[]),u.useEffect(()=>D.subscribe(()=>{a(D.getRunningApps())}),[]),u.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const y=W.getActiveAppId();y&&!D.isRunning(y)&&D.launchApp(y)}},[]);const d=g=>{D.closeApp(g)},f=s?X.get(s):null,h=(f==null?void 0:f.width)??400,l=s!==null,b={...{overflow:"hidden",display:l?"flex":"none",flexDirection:"column",flexShrink:0,...e&&l?{width:c?"100%":h}:{}},...n};return r.jsx("div",{className:Ge("nc-app-panel",t),style:b,children:i.map(g=>r.jsx(be,{appId:g.appId,isActive:s===g.appId,onClose:()=>d(g.appId)},g.appId))})}function fn({pinnedAppIds:e,className:t=""}){const{isMobile:n}=xe(),[s,o]=u.useState(()=>W.getActiveAppId()),[i,a]=u.useState(()=>D.getRunningApps());u.useEffect(()=>{const l=W.subscribe("activeAppId",p=>{o(p)});return()=>{l()}},[]),u.useEffect(()=>D.subscribe(()=>{a(D.getRunningApps())}),[]);const c=l=>{s===l?D.setActiveApp(null):D.launchApp(l)},d=e.map(l=>X.get(l)).filter(l=>!!l),f=i.filter(l=>!e.includes(l.appId)).map(l=>({running:l,def:X.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,v=s===l.id,b=m(l.id);return r.jsxs("button",{className:`nc-app-taskbar-button ${v?"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 v=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(v,{size:h}),r.jsx("span",{className:"nc-app-taskbar-indicator"})]},l.appId)})]})}function hn({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(be,{appId:e,isActive:!0,onClose:n})})});return ie.createPortal(d,document.body)}const we=u.createContext(null),Fe=u.createContext(null);function mn(){const e=u.useContext(we);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function gn(){const e=u.useContext(Fe);if(!e)throw new Error("useNavView must be used within NavStack");return e}const ye=u.createContext(null);function bn({rootView:e,children:t}){const{t:n}=_.useTranslation(),s=$e(),[o,i]=u.useState([e]),[a,c]=u.useState([null]),d=u.useCallback((w,A)=>{c(S=>{const x=[...S];return x[w]=A,x})},[]),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,v=p>1,b=o.length-1,g=o[o.length-1],j=g!=null&&g.titleKey?n(g.titleKey):(g==null?void 0:g.title)??"";u.useEffect(()=>{s.setTitle(j)},[j,s]),u.useEffect(()=>{v?s.setBackHandler(h):s.clearBackHandler()},[v,h,s]),u.useEffect(()=>{const w=a[a.length-1];w?s.setToolbar(w):s.clearToolbar()},[a,s]);const y={push:m,pop:h,reset:l,depth:p,canGoBack:v,currentTitle:j},R={stack:o,toolbarStack:a,updateToolbar:d,clearToolbarAt:f,topIndex:b};return r.jsx(we.Provider,{value:y,children:r.jsx(ye.Provider,{value:R,children:t})})}function xn({index:e,children:t}){const n=u.useContext(ye);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(Fe.Provider,{value:d,children:t})}function vn(){const e=u.useContext(we),t=u.useContext(ye);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(xn,{index:o,children:r.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.ActivityIndicator=he;exports.Alert=qe;exports.AppContainer=be;exports.AppContext=ge;exports.AppDialog=hn;exports.AppPanel=pn;exports.AppTaskbar=fn;exports.AppTitleBar=ze;exports.Battery=_e;exports.Button=H;exports.ButtonGroup=Ue;exports.Checkbox=Xe;exports.CloseButton=me;exports.ComboBox=nt;exports.ContextMenu=at;exports.Dialog=ct;exports.DialogClose=U;exports.EditButton=st;exports.Hyperlink=it;exports.Input=ut;exports.ListGroup=ft;exports.ListGroupItem=pt;exports.MonthRangePicker=gt;exports.MultiSelect=ht;exports.NavStackContainer=vn;exports.NavStackProvider=bn;exports.Notification=Me;exports.NotificationContainer=Nt;exports.NumberInput=bt;exports.RefreshButton=rt;exports.Slider=xt;exports.Tabs=wt;exports.Toggle=yt;exports.TrashButton=ot;exports.ViewportProvider=$t;exports.appRegistry=X;exports.appStateStore=W;exports.cn=Ge;exports.createAppI18nFactory=At;exports.notificationManager=St;exports.runningAppsStore=D;exports.useApp=$e;exports.useDialog=Re;exports.useNavStack=mn;exports.useNavView=gn;exports.useViewport=xe;
2
2
  //# sourceMappingURL=index.cjs.map