@nice2dev/ui 1.0.22 → 1.0.23
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/CHANGELOG.md +54 -0
- package/dist/NiceErrorBoundary-BNhkOZtq.cjs +1 -0
- package/dist/NiceErrorBoundary-DyPWyuki.js +770 -0
- package/dist/NiceForm-D_ifvkIf.js +5386 -0
- package/dist/NiceForm-kd4essRP.cjs +382 -0
- package/dist/NiceForm.css +1 -1
- package/dist/NiceModal-4DLpDmAl.js +95 -0
- package/dist/NiceModal-D2xJTZZf.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BZMUuDad.js +6807 -0
- package/dist/NiceModuleLifecyclePanel-C54g5eV_.cjs +1 -0
- package/dist/NicePagination-3be3_sVK.js +171 -0
- package/dist/NicePagination-BCRsVzkR.cjs +1 -0
- package/dist/NicePinCodeInput-BD2bMmVF.cjs +696 -0
- package/dist/NicePinCodeInput-DCLRLR8a.js +13097 -0
- package/dist/NiceSavedQueryPanel-DT9v7kUB.cjs +596 -0
- package/dist/NiceSavedQueryPanel-RLj3BnDR.js +6866 -0
- package/dist/NiceTabs-CFA8DGYR.cjs +1 -0
- package/dist/NiceTabs-Cx9DN6QD.js +1657 -0
- package/dist/NiceWindow-5VCSBJrc.js +1592 -0
- package/dist/NiceWindow-BEFAUTLp.cjs +1 -0
- package/dist/charts-De7FYS1U.cjs +761 -0
- package/dist/charts-DjFvhCdD.js +4657 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-CT5vpy5U.js +25248 -0
- package/dist/core-CZE5v34h.cjs +122 -0
- package/dist/data-branching-B7dCyaWr.cjs +1 -0
- package/dist/data-branching-BPAeL45o.js +6133 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +36 -1
- package/dist/data.mjs +1 -1
- package/dist/devops-C3Pmbnxc.js +7684 -0
- package/dist/devops-CrXz348W.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +5 -2
- package/dist/editors.mjs +3 -3
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +2 -2
- package/dist/index-9Gi1mNY7.js +67912 -0
- package/dist/index-Di3Cgr1P.cjs +5518 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +257 -46
- package/dist/index.mjs +743 -740
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +30 -4
- package/dist/navigation.mjs +4 -4
- package/dist/no-code-CHvv1KjZ.cjs +332 -0
- package/dist/no-code-CyvddsYt.js +7133 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.mjs +31 -31
- package/dist/style.css +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),O=require("./core-CZE5v34h.cjs"),a=require("react"),Ke=require("react-dom"),J=require("./NiceTabs-CFA8DGYR.cjs");function Pn(n,s){switch(s){case"bottom":return{left:n.left+n.width/2,top:n.bottom+6,transform:"translateX(-50%)"};case"left":return{left:n.left-6,top:n.top+n.height/2,transform:"translate(-100%, -50%)"};case"right":return{left:n.right+6,top:n.top+n.height/2,transform:"translateY(-50%)"};case"top":default:return{left:n.left+n.width/2,top:n.top-6,transform:"translate(-50%, -100%)"}}}const re=({content:n,position:s="top",size:i="md",followCursor:l,children:t})=>{const[o,r]=a.useState(!1),[h,d]=a.useState({x:0,y:0}),[c,m]=a.useState(null),b=a.useId(),x=a.useRef(null),f=a.useCallback(M=>{l&&d({x:M.clientX,y:M.clientY})},[l]);a.useLayoutEffect(()=>{if(!o||l)return;const M=()=>{const D=x.current;if(!D)return;const y=D.firstElementChild??D;m(y.getBoundingClientRect())};return M(),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[o,l]);const C=a.cloneElement(t,{"aria-describedby":o?b:void 0}),g=o?(()=>{let M;if(l)M={position:"fixed",left:h.x+12,top:h.y+12};else if(c){const D=Pn(c,s);M={position:"fixed",left:D.left,top:D.top,transform:D.transform}}else M={position:"fixed",left:-9999,top:-9999};return e.jsx("span",{id:b,className:`nice-tooltip nice-tooltip--${s} nice-tooltip--${i} nice-tooltip--portaled`,role:"tooltip",style:M,children:n})})():null,v=typeof document<"u"?document.body:null;return e.jsxs("span",{ref:x,className:"nice-tooltip-wrapper",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onMouseMove:f,onFocus:()=>r(!0),onBlur:()=>r(!1),children:[C,g!=null&&v!=null?Ke.createPortal(g,v):g]})};re.displayName="NiceTooltip";const Yn=({items:n,multiple:s=!1,defaultOpen:i=[],size:l="md",width:t,maxWidth:o,animationDuration:r=220,className:h,style:d,displayStyle:c})=>{O.Es("card",c);const[m,b]=a.useState(new Set(i)),x=a.useId(),f=a.useCallback(g=>{b(v=>{const M=new Set(v);return M.has(g)?M.delete(g):(s||M.clear(),M.add(g)),M})},[s]),C={...d,...t!==void 0?{width:typeof t=="number"?`${t}px`:t}:{},...o!==void 0?{maxWidth:typeof o=="number"?`${o}px`:o}:{},"--nice-accordion-anim":`${Math.max(0,r)}ms`};return e.jsx("div",{className:`nice-accordion nice-accordion--${l} ${h||""}`,style:C,children:n.map((g,v)=>{const M=m.has(g.id),D=`${x}-trigger-${v}`,y=`${x}-panel-${v}`;return e.jsxs("div",{className:"nice-accordion__item",children:[e.jsxs("button",{id:D,className:"nice-accordion__trigger",onClick:()=>!g.disabled&&f(g.id),"aria-expanded":M,"aria-controls":y,"aria-disabled":g.disabled,disabled:g.disabled,children:[e.jsx("span",{children:g.title}),e.jsx("svg",{className:`nice-accordion__chevron ${M?"nice-accordion__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]}),M&&e.jsx("div",{id:y,className:"nice-accordion__content",role:"region","aria-labelledby":D,children:g.content})]},g.id)})})},Un=({items:n,separator:s="/",size:i="md",className:l,style:t})=>e.jsx("nav",{className:`nice-breadcrumb nice-breadcrumb--${i} ${l||""}`,style:t,"aria-label":"Breadcrumb",children:n.map((o,r)=>e.jsxs(a.Fragment,{children:[r>0&&e.jsx("span",{className:"nice-breadcrumb__separator",children:s}),r===n.length-1?e.jsx("span",{className:"nice-breadcrumb__current","aria-current":"page",children:o.label}):e.jsx("span",{className:"nice-breadcrumb__item",children:e.jsx("a",{className:"nice-breadcrumb__link",href:o.href,onClick:h=>{o.onClick&&(h.preventDefault(),o.onClick())},children:o.label})})]},r))}),qe=({children:n,title:s,headerExtra:i,footer:l,hoverable:t,bordered:o=!0,onClick:r,size:h="md",className:d,style:c,displayStyle:m})=>{const b=O.Ns("card",m),x=O.Es("card",m);return e.jsxs("div",{className:`nice-card nice-card--${h} nice-card--ds-${x} ${o?"nice-card--bordered":"nice-card--frameless"} ${t?"nice-card--hoverable":""} ${r?"nice-card--clickable":""} ${d||""}`,style:{...b,...c},onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,children:[(s||i)&&e.jsxs("div",{className:"nice-card__header",children:[s&&e.jsx("h3",{className:"nice-card__title",children:s}),i]}),e.jsx("div",{className:"nice-card__body",children:n}),l&&e.jsx("div",{className:"nice-card__footer",children:l})]})},Hn=Object.freeze(Object.defineProperty({__proto__:null,NiceCard:qe},Symbol.toStringTag,{value:"Module"}));function Me(n){return(n.id??n.key??"")+""}function Qe(n){return n.label??n.text??""}function De(n){return n.children??n.items}function Re(n){const s=De(n);return!s||s.length===0}function Ae(n,s){if(!s)return!1;if(Me(n)===s)return!0;const i=De(n);return i?i.some(l=>Ae(l,s)):!1}const Xe=({items:n,orientation:s="horizontal",variant:i="ghost",density:l="normal",size:t="md",fullWidth:o=!1,showDividers:r=!1,panelAlign:h="start",panelMinWidth:d=200,panelMaxWidth:c=360,itemGap:m,paddingX:b,paddingY:x,portal:f=!0,panelZIndex:C=1100,arrowIcon:g="▾",flyoutArrowIcon:v="▸",closeOnSelect:M=!0,openTrigger:D="click",openDelay:y=120,closeDelay:j=180,onOpenChange:N,activeId:T,activeKey:S,onItemClick:I,ariaLabel:$="Menu",renderTriggerLabel:w,renderEntryLabel:R,maxDepth:p=3,className:u,style:_,id:L,accessMode:V,displayStyle:F})=>{const W=O.Es("menu",F),E=O.Ns("menu",F),B=a.useContext(O.ur)?.portalTarget??(typeof document<"u"?document.body:null),U=O.sc(V,L),K=U==="hidden",H=U==="disabled"||U==="readOnly",Z=a.useId(),te=T??S,ue=Math.min(10,Math.max(1,p)),[ie,P]=a.useState(null),[le,X]=a.useState([]),z=a.useRef(null),Y=a.useRef(null);a.useEffect(()=>{N?.(ie)},[ie,N]);const ae=a.useCallback(()=>{z.current!=null&&(window.clearTimeout(z.current),z.current=null),Y.current!=null&&(window.clearTimeout(Y.current),Y.current=null)},[]);a.useEffect(()=>()=>ae(),[ae]);const ce=a.useCallback(A=>{ae(),ie!==A&&(z.current=window.setTimeout(()=>{P(A),X([])},Math.max(0,y)))},[ae,ie,y]),pe=a.useCallback(()=>{ae(),Y.current=window.setTimeout(()=>{P(null),X([])},Math.max(0,j))},[ae,j]),[Ne,oe]=a.useState(-1),[ge,me]=a.useState(-1),[fe,ye]=a.useState(null),ke=a.useRef(null),Ce=a.useRef(null),xe=a.useRef(new Map),je=a.useCallback(()=>{if(!ie){ye(null);return}const A=xe.current.get(ie);if(!A)return;const G=A.getBoundingClientRect();ye(s==="vertical"?{left:G.right,top:G.top,width:G.width}:{left:G.left,top:G.bottom,width:G.width})},[ie,s]);a.useLayoutEffect(()=>{f&&je()},[f,je]),a.useEffect(()=>{if(!f||!ie)return;const A=()=>je();return window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),()=>{window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A)}},[f,ie,je]);const he=a.useMemo(()=>n.filter(A=>Me(A).length>0),[n]),ve=a.useCallback(()=>{P(null),X([]),me(-1)},[]);a.useEffect(()=>{if(!ie)return;const A=se=>{const Q=se.target;ke.current&&ke.current.contains(Q)||Ce.current&&Ce.current.contains(Q)||ve()},G=se=>{se.key==="Escape"&&ve()};return document.addEventListener("mousedown",A),document.addEventListener("keydown",G),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",G)}},[ie,ve]);const $e=(A,G)=>{if(A.disabled||H)return;const se=Me(A);if(Re(A)){A.onClick?.(G),I?.(A,G),M&&ve();return}X([]),P(ie===se?null:se),me(-1)},Ie=a.useCallback((A,G)=>{X(se=>{const Q=A-2;if(Q<0)return se;if(se[Q]===G)return se.slice(0,Q);const _e=se.slice(0,Q);return _e[Q]=G,_e})},[]),Le=(A,G)=>{A.disabled||(A.onClick?.(G),I?.(A,G),M&&ve())},k=A=>{if(H)return;const G=s==="horizontal",se=G?"ArrowLeft":"ArrowUp",Q=G?"ArrowRight":"ArrowDown";if(A.key===se)A.preventDefault(),oe(be=>be<=0?he.length-1:be-1);else if(A.key===Q)A.preventDefault(),oe(be=>be>=he.length-1?0:be+1);else if(A.key==="Home")A.preventDefault(),oe(0);else if(A.key==="End")A.preventDefault(),oe(he.length-1);else if(A.key==="Enter"||A.key===" "){A.preventDefault();const be=he[Ne];be&&$e(be,A)}else A.key==="Escape"&&ve()};if(K)return null;const ne=["nice-menu",`nice-menu--orientation-${s}`,`nice-menu--variant-${i}`,`nice-menu--density-${l}`,`nice-menu--size-${t}`,o?"nice-menu--full-width":"",r?"nice-menu--show-dividers":"",W??"",u??""].filter(Boolean).join(" "),q={...E,..._,"--nice-menu-panel-min-w":`${d}px`,"--nice-menu-panel-max-w":`${c}px`};return m!==void 0&&(q["--nice-menu-gap"]=typeof m=="number"?`${m}px`:m),b!==void 0&&(q["--nice-menu-padding-x"]=typeof b=="number"?`${b}px`:b),x!==void 0&&(q["--nice-menu-padding-y"]=typeof x=="number"?`${x}px`:x),e.jsx("nav",{id:L,ref:ke,className:ne,style:q,"aria-label":$,children:e.jsx("ul",{className:"nice-menu__list",role:"menubar",onKeyDown:k,tabIndex:0,children:he.map((A,G)=>{const se=Me(A),Q=ie===se,be=!!te&&Ae(A,te),_e=!Re(A),Bn=["nice-menu__item",Q?"nice-menu__item--open":"",be?"nice-menu__item--active":"",A.disabled?"nice-menu__item--disabled":"",A.danger?"nice-menu__item--danger":"",_e?"nice-menu__item--has-children":"",Ne===G?"nice-menu__item--focused":""].filter(Boolean).join(" "),Fn=w?w(A):Qe(A),Ye=e.jsxs(e.Fragment,{children:[A.icon?e.jsx("span",{className:"nice-menu__icon",children:A.icon}):null,e.jsx("span",{className:"nice-menu__label",children:Fn}),A.badge!=null?e.jsx("span",{className:"nice-menu__badge",children:A.badge}):null,_e?e.jsx("span",{className:"nice-menu__arrow","aria-hidden":!0,children:g}):null]});return e.jsxs("li",{className:Bn,role:"none","data-nice-menu-id":se,"data-nice-depth":1,onMouseEnter:_e&&(D==="hover"||D==="both")?()=>ce(se):void 0,onMouseLeave:_e&&(D==="hover"||D==="both")?()=>pe():void 0,children:[A.href&&!_e?e.jsx("a",{ref:de=>{de?xe.current.set(se,de):xe.current.delete(se)},className:"nice-menu__btn",href:A.href,target:A.target,rel:A.rel,role:"menuitem","aria-disabled":A.disabled||void 0,"aria-label":A.ariaLabel,tabIndex:Ne===G?0:-1,onClick:de=>$e(A,de),onFocus:()=>oe(G),children:Ye}):e.jsx("button",{ref:de=>{de?xe.current.set(se,de):xe.current.delete(se)},type:"button",className:"nice-menu__btn",disabled:A.disabled||H,role:"menuitem","aria-haspopup":_e||void 0,"aria-expanded":_e?Q:void 0,"aria-controls":_e?`${Z}-panel-${se}`:void 0,"aria-label":A.ariaLabel,tabIndex:Ne===G?0:-1,onClick:de=>$e(A,de),onFocus:()=>oe(G),children:Ye}),_e&&Q?(()=>{const de=f&&typeof document<"u"&&!!fe&&!!B,Wn=de?{position:"fixed",left:fe.left,top:fe.top,minWidth:Math.max(d,fe.width),maxWidth:c,zIndex:C}:{zIndex:C},Ue=e.jsx(Ge,{items:De(A)??[],depth:2,maxDepth:ue,openPath:le,onToggleBranch:Ie,onLeafClick:Le,effectiveActiveId:te,renderEntryLabel:R,flyoutArrowIcon:v,openTrigger:D,onPanelEnter:()=>ae(),onPanelLeave:()=>pe(),panelClassName:["nice-menu__panel",`nice-menu__panel--align-${h}`,de?"nice-menu__panel--portal":""].filter(Boolean).join(" "),panelStyle:Wn,panelId:`${Z}-panel-${se}`,panelRef:de?Ce:void 0,focusedEntryIdx:ge,setFocusedEntryIdx:me});return de?Ke.createPortal(Ue,B):Ue})():null]},se)})})})};Xe.displayName="NiceMenu";function Ge({items:n,depth:s,maxDepth:i,openPath:l,onToggleBranch:t,onLeafClick:o,effectiveActiveId:r,renderEntryLabel:h,flyoutArrowIcon:d,openTrigger:c,onPanelEnter:m,onPanelLeave:b,panelClassName:x,panelStyle:f,panelId:C,panelRef:g,focusedEntryIdx:v,setFocusedEntryIdx:M}){const D=Math.min(Math.max(s,1),10),y=s===2,j=x??(y?"nice-menu__panel":"nice-menu__subpanel"),T={...{"--nice-row-bg":`var(--nice-menu-level-${D}-bg, var(--bg-elevated, var(--bg-primary)))`,"--nice-row-text":`var(--nice-menu-level-${D}-text, var(--text-primary))`,"--nice-row-border":`var(--nice-menu-level-${D}-border, var(--border-color))`,"--nice-row-hover-bg":`var(--nice-menu-level-${D}-hover-bg, var(--hover-bg))`,"--nice-row-active-bg":`var(--nice-menu-level-${D}-active-bg, var(--selected-bg))`},...f??{}},S=c==="hover"||c==="both"?{onMouseEnter:m,onMouseLeave:b}:{};return e.jsx("div",{ref:g,id:C,className:j,style:T,role:"menu","data-nice-depth":s,...S,children:n.map((I,$)=>{if(I.divider)return e.jsx("hr",{className:"nice-menu__divider"},`d-${$}`);const w=Me(I),p=!Re(I)&&s<i,u=l[s-2]===w,_=!!r&&Ae(I,r),L=["nice-menu__entry",I.disabled?"nice-menu__entry--disabled":"",I.danger?"nice-menu__entry--danger":"",_?"nice-menu__entry--active":"",y&&v===$?"nice-menu__entry--focused":""].filter(Boolean).join(" "),V=e.jsxs(e.Fragment,{children:[I.icon?e.jsx("span",{className:"nice-menu__icon",children:I.icon}):null,e.jsxs("span",{className:"nice-menu__entry-content",children:[e.jsxs("span",{className:"nice-menu__entry-label",children:[h?h(I):Qe(I),I.badge!=null?e.jsx("span",{className:"nice-menu__badge",children:I.badge}):null]}),I.description?e.jsx("span",{className:"nice-menu__entry-desc",children:I.description}):null]}),p?e.jsx("span",{className:"nice-menu__entry-arrow","aria-hidden":!0,children:d}):null]}),F=E=>{p?t(s,w):o(I,E)},W=y?()=>M?.($):void 0;return e.jsxs("div",{style:{position:"relative"},onMouseEnter:p?()=>t(s,w):void 0,children:[I.href&&!p?e.jsx("a",{className:L,href:I.href,target:I.target,rel:I.rel,role:"menuitem","aria-disabled":I.disabled||void 0,"aria-label":I.ariaLabel,onClick:F,onFocus:W,children:V}):e.jsx("button",{type:"button",className:L,disabled:I.disabled,role:"menuitem","aria-haspopup":p||void 0,"aria-expanded":p?u:void 0,"aria-label":I.ariaLabel,onClick:F,onFocus:W,children:V}),p&&u?e.jsx(Ge,{items:De(I)??[],depth:s+1,maxDepth:i,openPath:l,onToggleBranch:t,onLeafClick:o,effectiveActiveId:r,renderEntryLabel:h,flyoutArrowIcon:d,openTrigger:c}):null]},w||`c-${$}`)})})}const Be=({items:n,target:s,onItemClick:i,size:l="md",className:t,style:o})=>{const[r,h]=a.useState(null),d=a.useRef(null);return O.Vs(d,()=>h(null)),a.useEffect(()=>{const c=s.current;if(!c)return;const m=b=>{b.preventDefault(),h({x:b.clientX,y:b.clientY})};return c.addEventListener("contextmenu",m),()=>c.removeEventListener("contextmenu",m)},[s]),r?e.jsx("div",{ref:d,className:`nice-contextmenu nice-contextmenu--${l} ${t||""}`,style:{position:"fixed",left:r.x,top:r.y,zIndex:1e4,...o},children:e.jsx("ul",{className:"nice-contextmenu__list",role:"menu",children:n.map((c,m)=>e.jsx("li",{className:`nice-contextmenu__item ${c.disabled?"nice-contextmenu__item--disabled":""}`,role:"none",children:e.jsxs("button",{type:"button",className:"nice-contextmenu__btn",disabled:c.disabled,"aria-disabled":c.disabled,role:"menuitem",onClick:b=>{c.onClick?.(b),i?.(c),h(null)},children:[c.icon&&e.jsx("span",{className:"nice-contextmenu__icon","aria-hidden":"true",children:c.icon}),e.jsx("span",{children:c.label??c.text??""})]})},c.id??c.key??m))})}):null},Vn=({items:n,selectedIndex:s,onSelectedIndexChange:i,animationEnabled:l=!0,nav:t="tabs",showArrows:o,autoPlay:r=0,size:h="md",className:d,style:c,accessMode:m,id:b})=>{const f=O.sc(m,b)==="hidden",[C,g]=a.useState(0),v=s??C,[M,D]=a.useState("right"),y=a.useRef(null),j=a.useCallback(p=>{D(p>v?"right":"left"),i?i(p):g(p)},[v,i]),N=a.useCallback(()=>j((v+1)%n.length),[j,v,n.length]),T=a.useCallback(()=>j((v-1+n.length)%n.length),[j,v,n.length]);a.useEffect(()=>{if(r>0&&n.length>1)return y.current=setInterval(N,r),()=>{y.current&&clearInterval(y.current)}},[r,N,n.length]);const S=a.useCallback(p=>{p.key==="ArrowRight"||p.key==="ArrowDown"?(p.preventDefault(),N()):(p.key==="ArrowLeft"||p.key==="ArrowUp")&&(p.preventDefault(),T())},[N,T]),I=n[v];if(!I)return null;const $=o??(t==="dots"||t==="arrows"||t==="none"),w=t==="tabs",R=t==="dots";return f?null:e.jsxs("div",{className:["nice-multiview",`nice-multiview--${h}`,l?"nice-multiview--animated":"",d].filter(Boolean).join(" "),style:c,onKeyDown:S,tabIndex:0,role:"region","aria-roledescription":"carousel","aria-label":"Multi-view",children:[w&&e.jsx("div",{className:"nice-multiview__tabs",role:"tablist",children:n.map((p,u)=>e.jsxs("button",{role:"tab","aria-selected":u===v,className:["nice-multiview__tab",u===v?"nice-multiview__tab--active":""].filter(Boolean).join(" "),onClick:()=>j(u),children:[p.icon&&e.jsx("span",{className:"nice-multiview__tab-icon",children:p.icon}),p.label&&e.jsx("span",{className:"nice-multiview__tab-label",children:p.label}),!p.label&&!p.icon&&e.jsx("span",{className:"nice-multiview__tab-label",children:p.key})]},p.key))}),e.jsxs("div",{className:"nice-multiview__viewport",children:[$&&n.length>1&&e.jsx("button",{className:"nice-multiview__arrow nice-multiview__arrow--prev",onClick:T,"aria-label":"Previous",children:"‹"}),e.jsx("div",{className:["nice-multiview__content",l?`nice-multiview__content--slide-${M}`:""].filter(Boolean).join(" "),role:"tabpanel",children:I.render()},I.key),$&&n.length>1&&e.jsx("button",{className:"nice-multiview__arrow nice-multiview__arrow--next",onClick:N,"aria-label":"Next",children:"›"})]}),R&&n.length>1&&e.jsx("div",{className:"nice-multiview__dots",children:n.map((p,u)=>e.jsx("button",{className:["nice-multiview__dot",u===v?"nice-multiview__dot--active":""].filter(Boolean).join(" "),onClick:()=>j(u),"aria-label":`View ${u+1}`},p.key))}),t==="arrows"&&n.length>1&&e.jsxs("div",{className:"nice-multiview__counter",children:[v+1," / ",n.length]})]})},Zn=({items:n,selectedKey:s,onSelectedKeyChange:i,tabPosition:l="top",size:t="md",className:o,style:r,displayStyle:h})=>{O.Es("tab",h);const[d,c]=a.useState(n[0]?.key??""),m=s??d,b=g=>{i?i(g):c(g)},x=n.find(g=>g.key===m),f=l==="left"||l==="right",C=e.jsx("div",{className:"nice-tabpanel__tabs",role:"tablist",style:{display:"flex",flexDirection:f?"column":"row"},children:n.map(g=>e.jsxs("button",{type:"button",role:"tab",className:`nice-tabpanel__tab ${g.key===m?"nice-tabpanel__tab--active":""}`,disabled:g.disabled,onClick:()=>!g.disabled&&b(g.key),"aria-selected":g.key===m,children:[g.icon&&e.jsx("span",{className:"nice-tabpanel__tab-icon",children:g.icon}),e.jsx("span",{children:g.title}),g.badge&&e.jsx("span",{className:"nice-tabpanel__tab-badge",children:g.badge})]},g.key))});return e.jsxs("div",{className:`nice-tabpanel nice-tabpanel--${l} ${o||""}`,style:{display:"flex",flexDirection:f?"row":"column",...r},children:[(l==="top"||l==="left")&&C,e.jsx("div",{className:"nice-tabpanel__content",role:"tabpanel",children:x?.render()}),(l==="bottom"||l==="right")&&C]})},Kn=({panes:n,orientation:s="horizontal",gutterSize:i=6,onResize:l,className:t,style:o,accessMode:r,id:h})=>{const c=O.sc(r,h)==="hidden",m=a.useRef(null),[b,x]=a.useState(()=>n.map(()=>100/n.length)),f=a.useCallback((g,v)=>{v.preventDefault();const M=m.current;if(!M)return;const D=s==="horizontal",y=D?M.offsetWidth:M.offsetHeight,j=D?v.clientX:v.clientY,N=[...b],T=I=>{const $=((D?I.clientX:I.clientY)-j)/y*100,w=[...N],R=n[g].minSize?n[g].minSize/y*100:5,p=n[g+1].minSize?n[g+1].minSize/y*100:5;let u=N[g]+$,_=N[g+1]-$;u<R&&(u=R,_=N[g]+N[g+1]-R),_<p&&(_=p,u=N[g]+N[g+1]-p),w[g]=u,w[g+1]=_,x(w),l?.(w)},S=()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",S)};document.addEventListener("pointermove",T),document.addEventListener("pointerup",S)},[b,s,n,l]),C=s==="horizontal";return c?null:e.jsx("div",{ref:m,className:`nice-splitter nice-splitter--${s} ${t||""}`,style:{display:"flex",flexDirection:C?"row":"column",height:"100%",...o},children:n.map((g,v)=>e.jsxs(a.Fragment,{children:[e.jsx("div",{className:"nice-splitter__pane",style:{[C?"width":"height"]:`calc(${b[v]}% - ${i*(n.length-1)/n.length}px)`,overflow:"auto"},children:g.render()}),v<n.length-1&&e.jsx("div",{className:`nice-splitter__gutter nice-splitter__gutter--${s}`,style:{[C?"width":"height"]:i,cursor:C?"col-resize":"row-resize",flexShrink:0},onPointerDown:M=>f(v,M)})]},g.key))})},qn=({items:n,size:s="md",className:i,style:l,accessMode:t,id:o})=>{const h=O.sc(t,o)==="hidden",d=n.filter(x=>!x.location||x.location==="before"),c=n.filter(x=>x.location==="center"),m=n.filter(x=>x.location==="after"),b=x=>x.widget==="separator"?e.jsx("div",{className:"nice-toolbar__separator"},x.key):x.widget==="spacer"?e.jsx("div",{className:"nice-toolbar__spacer",style:{flex:1}},x.key):x.render?e.jsx("div",{className:"nice-toolbar__custom",children:x.render()},x.key):e.jsxs("button",{type:"button",className:`nice-toolbar__btn nice-btn nice-btn--ghost nice-btn--${s}`,disabled:x.disabled,onClick:x.onClick,children:[x.icon&&e.jsx("span",{className:"nice-toolbar__icon",children:x.icon}),x.text&&e.jsx("span",{children:x.text})]},x.key);return h?null:e.jsxs("div",{className:`nice-toolbar ${i||""}`,style:{display:"flex",alignItems:"center",gap:4,...l},children:[e.jsx("div",{className:"nice-toolbar__section nice-toolbar__section--before",style:{display:"flex",alignItems:"center",gap:4},children:d.map(b)}),c.length>0&&e.jsx("div",{className:"nice-toolbar__section nice-toolbar__section--center",style:{display:"flex",alignItems:"center",gap:4,flex:1,justifyContent:"center"},children:c.map(b)}),e.jsx("div",{className:"nice-toolbar__section nice-toolbar__section--after",style:{display:"flex",alignItems:"center",gap:4,marginLeft:c.length===0?"auto":void 0},children:m.map(b)})]})},Je=({steps:n,activeStep:s,orientation:i="horizontal",onStepClick:l,allowStepClick:t=!1,showStepNumbers:o=!0,className:r,style:h})=>{const{t:d}=O.Zt();return e.jsxs("div",{className:`nice-stepper nice-stepper--${i} ${r||""}`,style:h,children:[e.jsx("div",{className:"nice-stepper__header",children:n.map((c,m)=>{const b=m<s,f=b?"nice-stepper__step--completed":m===s?"nice-stepper__step--active":"";return e.jsxs(a.Fragment,{children:[m>0&&e.jsx("div",{className:`nice-stepper__connector ${b?"nice-stepper__connector--completed":""}`}),e.jsxs("div",{className:`nice-stepper__step ${f}`,onClick:()=>t&&l?.(m),style:{cursor:t?"pointer":void 0},children:[e.jsx("div",{className:"nice-stepper__indicator",children:c.icon?c.icon:b?"✓":o?m+1:""}),e.jsxs("div",{className:"nice-stepper__labels",children:[e.jsx("div",{className:"nice-stepper__title",children:c.title}),c.subtitle&&e.jsx("div",{className:"nice-stepper__subtitle",children:c.subtitle}),c.optional&&e.jsx("div",{className:"nice-stepper__optional",children:d("optional","Optional")})]})]})]},m)})}),n[s]?.content&&e.jsx("div",{className:"nice-stepper__content",children:n[s].content})]})},en=a.forwardRef(({panels:n,columns:s=12,rowHeight:i=80,gap:l=8,draggable:t=!0,resizable:o=!0,onLayoutChange:r,className:h,style:d,id:c},m)=>{const b=O._s(c),[x,f]=a.useState(null),C=a.useRef(null),g=a.useCallback((N,T)=>{t&&(f(T),N.dataTransfer.effectAllowed="move")},[t]),v=a.useCallback((N,T)=>{if(N.preventDefault(),!x||x===T)return;const S=n.find(w=>w.key===x),I=n.find(w=>w.key===T);if(!S||!I)return;const $=n.map(w=>w.key===x?{...w,col:I.col,row:I.row}:w.key===T?{...w,col:S.col,row:S.row}:w);r?.($),f(null)},[x,n,r]),M=a.useCallback(N=>{N.preventDefault()},[]),D=a.useRef(null);a.useEffect(()=>{if(!o)return;const N=S=>{if(!D.current||!C.current)return;const{key:I,startX:$,startY:w,cs:R,rs:p}=D.current,u=S.clientX-$,_=S.clientY-w,L=C.current.clientWidth/s,V=Math.max(1,R+Math.round(u/L)),F=Math.max(1,p+Math.round(_/i)),W=n.map(E=>E.key===I?{...E,colSpan:V,rowSpan:F}:E);r?.(W)},T=()=>{D.current=null};return document.addEventListener("mousemove",N),document.addEventListener("mouseup",T),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",T)}},[o,n,s,i,r]);const y=a.useCallback((N,T,S,I)=>{N.stopPropagation(),D.current={key:T,startX:N.clientX,startY:N.clientY,cs:S,rs:I}},[]),j=Math.max(...n.map(N=>N.row+(N.rowSpan??1)),1);return e.jsx("div",{ref:m,id:b,className:`nice-dashboard ${h||""}`,style:d,children:e.jsx("div",{ref:C,className:"nice-dashboard__grid",style:{display:"grid",gridTemplateColumns:`repeat(${s}, 1fr)`,gridTemplateRows:`repeat(${j}, ${i}px)`,gap:l},children:n.map(N=>e.jsxs("div",{className:`nice-dashboard__panel${x===N.key?" nice-dashboard__panel--dragging":""}`,style:{gridColumn:`${N.col+1} / span ${N.colSpan??1}`,gridRow:`${N.row+1} / span ${N.rowSpan??1}`},draggable:t,onDragStart:T=>g(T,N.key),onDragOver:M,onDrop:T=>v(T,N.key),children:[e.jsx("div",{className:"nice-dashboard__panel-content",children:N.render()}),o&&e.jsx("div",{className:"nice-dashboard__resize-handle",onMouseDown:T=>y(T,N.key,N.colSpan??1,N.rowSpan??1)})]},N.key))})})});en.displayName="NiceDashboardLayout";const nn=a.forwardRef(({header:n,sidebar:s,sidebarWidth:i=260,sidebarCollapsed:l,onToggleSidebar:t,children:o,footer:r,className:h,style:d,id:c},m)=>{const b=O._s(c),[x,f]=a.useState(!1),C=l??x,g=a.useCallback(()=>{const v=!C;f(v),t?.(v)},[C,t]);return e.jsxs("div",{ref:m,id:b,className:`nice-app-layout${C?" nice-app-layout--collapsed":""} ${h||""}`,style:d,children:[n&&e.jsx("header",{className:"nice-app-layout__header",children:n}),e.jsxs("div",{className:"nice-app-layout__body",children:[s&&e.jsx("aside",{className:"nice-app-layout__sidebar",style:{width:C?0:i,overflow:"hidden",transition:"width 0.2s"},children:!C&&s}),s&&e.jsx("button",{type:"button",className:"nice-app-layout__sidebar-toggle",onClick:g,"aria-label":C?"Open sidebar":"Close sidebar",children:C?"☰":"✕"}),e.jsx("main",{className:"nice-app-layout__content",children:o})]}),r&&e.jsx("footer",{className:"nice-app-layout__footer",children:r})]})});nn.displayName="NiceAppLayout";const sn=a.forwardRef(({items:n,activeKey:s,onChange:i,size:l="md",showLabels:t=!0,className:o,style:r,id:h},d)=>{const c=O._s(h);return e.jsx("nav",{ref:d,id:c,className:`nice-bottom-nav nice-bottom-nav--${l} ${o||""}`,style:r,role:"navigation",children:n.map(m=>e.jsxs("button",{type:"button",className:`nice-bottom-nav__item${s===m.key?" nice-bottom-nav__item--active":""}${m.disabled?" nice-bottom-nav__item--disabled":""}`,onClick:()=>!m.disabled&&i?.(m.key),disabled:m.disabled,"aria-current":s===m.key?"page":void 0,children:[m.icon&&e.jsx("span",{className:"nice-bottom-nav__icon",children:m.icon}),t&&e.jsx("span",{className:"nice-bottom-nav__label",children:m.label})]},m.key))})});sn.displayName="NiceBottomNavigation";const an=a.forwardRef(({items:n,position:s="bottom",size:i="md",magnify:l=!0,magnifyScale:t=1.5,activeKey:o,onItemClick:r,contained:h=!1,className:d,style:c,id:m,...b},x)=>{const f=O._s(m),{t:C}=O.Zt(),[g,v]=a.useState(null),M=a.useCallback(y=>{if(!l||g===null)return 1;const j=Math.abs(y-g);return j===0?t:j===1?1+(t-1)*.5:j===2?1+(t-1)*.2:1},[l,g,t]),D=s==="left"||s==="right";return e.jsx("div",{ref:x,id:f,className:`nice-dock nice-dock--${s} nice-dock--${i}${h?" nice-dock--contained":""} ${d??""}`,style:c,role:"toolbar","aria-label":C("dock.label","Dock"),...b,children:e.jsx("div",{className:"nice-dock__bar",style:{flexDirection:D?"column":"row"},children:n.map((y,j)=>{const N=M(j);return e.jsxs("button",{type:"button",className:`nice-dock__item ${o===y.key?"nice-dock__item--active":""} ${y.disabled?"nice-dock__item--disabled":""}`,style:{transform:`scale(${N})`,transition:"transform 0.15s ease-out"},disabled:y.disabled,onClick:()=>r?.(y.key),onMouseEnter:()=>v(j),onMouseLeave:()=>v(null),"aria-label":y.label,title:y.label,children:[e.jsx("span",{className:"nice-dock__icon",children:y.icon}),y.badge!==void 0&&e.jsx("span",{className:"nice-dock__badge",children:y.badge})]},y.key)})})})});an.displayName="NiceDock";const ln=({items:n,label:s,icon:i,position:l,onItemClick:t})=>{const{t:o}=O.Zt(),[r,h]=a.useState(!1),[d,c]=a.useState(null),m=a.useRef(null);a.useEffect(()=>{if(!r)return;const f=C=>{m.current&&!m.current.contains(C.target)&&(h(!1),c(null))};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r]),a.useEffect(()=>{if(!r)return;const f=C=>{C.key==="Escape"&&(h(!1),c(null))};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[r]);const b=l==="bottom"?"bottom-start":l==="top"?"top-start":l==="left"?"left-start":"right-start",x=a.useCallback(f=>{if(f.children&&f.children.length>0){c(d===f.key?null:f.key);return}f.onClick?.(),t?.(f.key),h(!1),c(null)},[t,d]);return e.jsxs("div",{className:"nice-desktop__start",ref:m,children:[e.jsxs("button",{type:"button",className:`nice-desktop__start-btn ${r?"nice-desktop__start-btn--active":""}`,onClick:()=>h(!r),"aria-expanded":r,"aria-haspopup":"menu","aria-label":o("desktop.start","Start"),children:[i&&e.jsx("span",{className:"nice-desktop__start-icon",children:i}),s&&e.jsx("span",{className:"nice-desktop__start-label",children:s}),!i&&!s&&e.jsx("span",{className:"nice-desktop__start-label",children:o("desktop.start","Start")})]}),r&&e.jsx("div",{className:`nice-desktop__start-menu nice-desktop__start-menu--${b}`,role:"menu",children:n.map(f=>e.jsxs(a.Fragment,{children:[f.divider&&e.jsx("div",{className:"nice-desktop__start-divider"}),e.jsxs("div",{className:"nice-desktop__start-item-wrap",children:[e.jsxs("button",{type:"button",className:`nice-desktop__start-item ${d===f.key?"nice-desktop__start-item--open":""}`,disabled:f.disabled,onClick:()=>x(f),role:"menuitem",children:[f.icon&&e.jsx("span",{className:"nice-desktop__start-item-icon",children:f.icon}),e.jsx("span",{className:"nice-desktop__start-item-label",children:f.label}),f.children&&f.children.length>0&&e.jsx("span",{className:"nice-desktop__start-item-arrow",children:"▸"})]}),f.children&&d===f.key&&e.jsx("div",{className:"nice-desktop__start-submenu",role:"menu",children:f.children.map(C=>e.jsxs("button",{type:"button",className:"nice-desktop__start-item",disabled:C.disabled,onClick:()=>x(C),role:"menuitem",children:[C.icon&&e.jsx("span",{className:"nice-desktop__start-item-icon",children:C.icon}),e.jsx("span",{className:"nice-desktop__start-item-label",children:C.label})]},C.key))})]})]},f.key))})]})},Oe=({items:n,position:s,size:i,startMenu:l,systemTray:t,onItemClick:o})=>{const h=s==="left"||s==="right"?{width:i,height:"100%"}:{height:i,width:"100%"};return e.jsxs("div",{className:`nice-desktop__taskbar nice-desktop__taskbar--${s}`,style:h,role:"toolbar","aria-label":"Taskbar",children:[l,e.jsx("div",{className:"nice-desktop__taskbar-items",children:n.map(d=>e.jsxs("button",{type:"button",className:`nice-desktop__taskbar-btn ${d.active?"nice-desktop__taskbar-btn--active":""} ${d.minimized?"nice-desktop__taskbar-btn--minimized":""}`,onClick:()=>o?.(d.key),title:d.label,children:[d.icon&&e.jsx("span",{className:"nice-desktop__taskbar-btn-icon",children:d.icon}),e.jsx("span",{className:"nice-desktop__taskbar-btn-label",children:d.label}),d.badge!==void 0&&e.jsx("span",{className:"nice-desktop__taskbar-btn-badge",children:d.badge})]},d.key))}),t]})},tn=({items:n,showClock:s=!0,onItemClick:i})=>{const[l,t]=a.useState(()=>new Date);return a.useEffect(()=>{if(!s)return;const o=setInterval(()=>t(new Date),3e4);return()=>clearInterval(o)},[s]),e.jsxs("div",{className:"nice-desktop__tray",children:[n.map(o=>e.jsx("button",{type:"button",className:"nice-desktop__tray-item",title:o.tooltip,onClick:()=>{o.onClick?.(),i?.(o.key)},children:o.icon},o.key)),s&&e.jsx("span",{className:"nice-desktop__tray-clock",children:l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},cn=({icons:n,gridColumns:s,iconSize:i,onIconClick:l,onIconDoubleClick:t})=>{const[o,r]=a.useState(null),h=a.useCallback(c=>{r(c),l?.(c)},[l]),d=a.useCallback(c=>{t?.(c)},[t]);return e.jsx("div",{className:`nice-desktop__grid nice-desktop__grid--${i}`,style:{gridTemplateColumns:`repeat(${s}, 1fr)`},children:n.map(c=>e.jsxs("div",{className:`nice-desktop__icon ${o===c.key?"nice-desktop__icon--selected":""} ${c.disabled?"nice-desktop__icon--disabled":""}`,style:c.gridCol!=null||c.gridRow!=null?{gridColumn:c.gridCol,gridRow:c.gridRow}:void 0,onClick:()=>!c.disabled&&h(c.key),onDoubleClick:()=>!c.disabled&&d(c.key),role:"button",tabIndex:c.disabled?-1:0,"aria-label":c.label,onKeyDown:m=>{c.disabled||(m.key==="Enter"&&d(c.key),m.key===" "&&(m.preventDefault(),h(c.key)))},children:[e.jsx("div",{className:"nice-desktop__icon-img",children:c.icon}),e.jsx("span",{className:"nice-desktop__icon-label",children:c.label})]},c.key))})},rn=({items:n,x:s,y:i,onItemClick:l,onClose:t})=>{const o=a.useRef(null);return a.useEffect(()=>{const r=h=>{o.current&&!o.current.contains(h.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[t]),a.useEffect(()=>{const r=h=>{h.key==="Escape"&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t]),e.jsx("div",{ref:o,className:"nice-desktop__context-menu",style:{position:"fixed",left:s,top:i},role:"menu",children:n.map(r=>e.jsxs(a.Fragment,{children:[r.divider&&e.jsx("div",{className:"nice-desktop__context-divider"}),e.jsxs("button",{type:"button",className:"nice-desktop__context-item",disabled:r.disabled,onClick:()=>{r.onClick?.(),l?.(r.key),t()},role:"menuitem",children:[r.icon&&e.jsx("span",{className:"nice-desktop__context-icon",children:r.icon}),e.jsx("span",{children:r.label})]})]},r.key))})},on=a.forwardRef(({icons:n=[],taskbarPosition:s="bottom",taskbarSize:i=40,startMenuItems:l=[],startMenuLabel:t,startMenuIcon:o,taskbarItems:r=[],systemTrayItems:h=[],showClock:d=!0,wallpaper:c,gridColumns:m=8,iconSize:b="md",onIconClick:x,onIconDoubleClick:f,onTaskbarItemClick:C,onStartMenuItemClick:g,onSystemTrayItemClick:v,contextMenuItems:M,onContextMenuItemClick:D,children:y,className:j,style:N,id:T,accessMode:S,...I},$)=>{const w=O._s(T),p=O.sc(S,T)==="hidden",[u,_]=a.useState(null),L=a.useCallback(E=>{!M||M.length===0||(E.preventDefault(),_({x:E.clientX,y:E.clientY}))},[M]),V=l.length>0?e.jsx(ln,{items:l,label:t,icon:o,position:s,onItemClick:g}):null,F=e.jsx(tn,{items:h,showClock:d,onItemClick:v}),W={...N,...c?{background:c}:{}};return p?null:e.jsxs("div",{ref:$,id:w,className:`nice-desktop nice-desktop--taskbar-${s} ${j??""}`,style:W,...I,children:[(s==="top"||s==="left")&&e.jsx(Oe,{items:r,position:s,size:i,startMenu:V,systemTray:F,onItemClick:C}),e.jsxs("div",{className:"nice-desktop__area",onContextMenu:L,children:[n.length>0&&e.jsx(cn,{icons:n,gridColumns:m,iconSize:b,onIconClick:x,onIconDoubleClick:f}),y,u&&M&&e.jsx(rn,{items:M,x:u.x,y:u.y,onItemClick:D,onClose:()=>_(null)})]}),(s==="bottom"||s==="right")&&e.jsx(Oe,{items:r,position:s,size:i,startMenu:V,systemTray:F,onItemClick:C})]})});on.displayName="NiceDesktop";const Qn=({commands:n,onSelect:s,onClose:i})=>{const[l,t]=a.useState(""),o=a.useRef(null),{t:r}=O.Zt();a.useEffect(()=>{o.current?.focus()},[]),a.useEffect(()=>{const d=c=>{c.key==="Escape"&&i()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[i]);const h=l?n.filter(d=>d.label.toLowerCase().includes(l.toLowerCase())):n;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-console__palette-overlay",onClick:i}),e.jsxs("div",{className:"nice-console__palette",role:"dialog","aria-label":r("console.commandPalette","Command Palette"),children:[e.jsx("input",{ref:o,className:"nice-console__palette-input",placeholder:r("console.searchCommands","Search commands..."),value:l,onChange:d=>t(d.target.value),onKeyDown:d=>{d.key==="Enter"&&h.length>0&&(s(h[0].key),i())}}),e.jsxs("div",{className:"nice-console__palette-list",children:[h.map(d=>e.jsxs("button",{type:"button",className:"nice-console__palette-item",disabled:d.disabled,onClick:()=>{s(d.key),i()},children:[d.icon&&e.jsx("span",{className:"nice-console__palette-icon",children:d.icon}),e.jsx("span",{className:"nice-console__palette-label",children:d.label}),d.description&&e.jsx("span",{className:"nice-console__palette-desc",children:d.description}),d.shortcut&&e.jsx("span",{className:"nice-console__palette-shortcut",children:d.shortcut})]},d.key)),h.length===0&&e.jsx("div",{className:"nice-console__palette-empty",children:r("console.noCommands","No matching commands")})]})]})]})},dn=a.forwardRef(({tabs:n=[],activeTabKey:s,onTabChange:i,onTabClose:l,commandPalette:t=[],onCommand:o,statusItems:r=[],toolbar:h,sidePanel:d,sidePanelWidth:c=220,sidePanelCollapsed:m,onToggleSidePanel:b,bottomPanel:x,bottomPanelHeight:f=200,bottomPanelCollapsed:C,onToggleBottomPanel:g,children:v,size:M="md",theme:D="dark",className:y,style:j,id:N,accessMode:T,...S},I)=>{const $=O._s(N),w=O.sc(T,N),{t:R}=O.Zt();if(w==="hidden")return null;const[p,u]=a.useState(n[0]?.key??""),[_,L]=a.useState(!1),[V,F]=a.useState(!1),[W,E]=a.useState(!1),ee=s??p,B=m??_,U=C??V,K=a.useCallback(P=>{i?i(P):u(P)},[i]),H=a.useCallback(()=>{const P=!B;b?b(P):L(P)},[B,b]),Z=a.useCallback(()=>{const P=!U;g?g(P):F(P)},[U,g]);a.useEffect(()=>{if(t.length===0)return;const P=le=>{le.ctrlKey&&le.shiftKey&&le.key==="P"&&(le.preventDefault(),E(X=>!X))};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[t.length]);const te=n.find(P=>P.key===ee),ue=r.filter(P=>!P.position||P.position==="left"),ie=r.filter(P=>P.position==="right");return e.jsxs("div",{ref:I,id:$,className:`nice-console nice-console--${M} nice-console--${D} ${y??""}`,style:j,...S,children:[h&&e.jsx("div",{className:"nice-console__toolbar",children:h}),n.length>0&&e.jsx("div",{className:"nice-console__tabs",role:"tablist",children:n.map(P=>e.jsxs("div",{className:`nice-console__tab ${P.key===ee?"nice-console__tab--active":""}`,role:"tab","aria-selected":P.key===ee,children:[e.jsxs("button",{type:"button",className:"nice-console__tab-btn",onClick:()=>K(P.key),children:[P.icon&&e.jsx("span",{className:"nice-console__tab-icon",children:P.icon}),e.jsx("span",{children:P.label})]}),(P.closable??!0)&&l&&e.jsx("button",{type:"button",className:"nice-console__tab-close",onClick:()=>l(P.key),"aria-label":R("console.closeTab","Close tab"),children:"✕"})]},P.key))}),e.jsxs("div",{className:"nice-console__main",children:[d&&!B&&e.jsxs("aside",{className:"nice-console__side",style:{width:c,flexShrink:0},children:[e.jsx("div",{className:"nice-console__side-header",children:e.jsx("button",{type:"button",className:"nice-console__side-toggle",onClick:H,"aria-label":R("console.closeSidePanel","Close side panel"),children:"✕"})}),e.jsx("div",{className:"nice-console__side-content",children:d})]}),e.jsxs("div",{className:"nice-console__center",children:[e.jsx("div",{className:"nice-console__content",role:"tabpanel",children:te?te.render?te.render():te.content:v}),x&&!U&&e.jsxs("div",{className:"nice-console__bottom",style:{height:f,flexShrink:0},children:[e.jsx("div",{className:"nice-console__bottom-header",children:e.jsx("button",{type:"button",className:"nice-console__bottom-toggle",onClick:Z,"aria-label":R("console.closeBottomPanel","Close bottom panel"),children:"✕"})}),e.jsx("div",{className:"nice-console__bottom-content",children:x})]})]})]}),r.length>0&&e.jsxs("div",{className:"nice-console__statusbar",children:[e.jsxs("div",{className:"nice-console__statusbar-left",children:[d&&B&&e.jsx("button",{type:"button",className:"nice-console__statusbar-btn",onClick:H,title:R("console.openSidePanel","Open side panel"),children:"☰"}),x&&U&&e.jsx("button",{type:"button",className:"nice-console__statusbar-btn",onClick:Z,title:R("console.openBottomPanel","Open bottom panel"),children:"▁"}),ue.map(P=>e.jsx("span",{className:"nice-console__status-item",onClick:P.onClick,role:P.onClick?"button":void 0,tabIndex:P.onClick?0:void 0,children:P.content??P.label},P.key))]}),e.jsx("div",{className:"nice-console__statusbar-right",children:ie.map(P=>e.jsx("span",{className:"nice-console__status-item",onClick:P.onClick,role:P.onClick?"button":void 0,tabIndex:P.onClick?0:void 0,children:P.content??P.label},P.key))})]}),W&&t.length>0&&e.jsx(Qn,{commands:t,onSelect:P=>o?.(P),onClose:()=>E(!1)})]})});dn.displayName="NiceConsole";const un=a.forwardRef(({steps:n,activeStep:s,onStepChange:i,onComplete:l,onCancel:t,allowStepClick:o=!1,variant:r="horizontal",nextLabel:h,prevLabel:d,finishLabel:c,cancelLabel:m,showProgress:b=!0,className:x,style:f,size:C="md",accessMode:g,id:v},M)=>{const y=O.sc(g,v)==="hidden",{t:j}=O.Zt(),N=O._s(v),[T,S]=a.useState(0),[I,$]=a.useState({}),[w,R]=a.useState(new Set([0])),p=s??T,u=n[p],_=p===0,L=p===n.length-1,V=a.useCallback(H=>{const Z=Math.max(0,Math.min(n.length-1,H));S(Z),R(te=>new Set(te).add(Z)),i?.(Z)},[n.length,i]),F=a.useCallback(()=>{if(!u?.validate)return!0;const H=u.validate();return H===!0||H===void 0?($(Z=>{const te={...Z};return delete te[u.id],te}),!0):($(Z=>({...Z,[u.id]:H})),!1)},[u]),W=a.useCallback(()=>{F()&&(L?l?.():V(p+1))},[p,L,F,V,l]),E=a.useCallback(()=>{_||V(p-1)},[p,_,V]),ee=a.useCallback(H=>{const Z=n.findIndex(te=>te.id===H);Z>=0&&V(Z)},[n,V]),B=a.useMemo(()=>({stepIndex:p,totalSteps:n.length,goNext:W,goPrev:E,goTo:ee,isFirst:_,isLast:L}),[p,n.length,W,E,ee,_,L]),U=(p+1)/n.length*100;if(y)return null;const K=n.map(H=>({title:H.title,subtitle:H.description,icon:H.icon,optional:H.optional}));return e.jsxs("div",{ref:M,id:N,className:`nice-wizard nice-wizard--${r} nice-size-${C}${x?` ${x}`:""}`,style:f,children:[e.jsx(Je,{steps:K,activeStep:p,orientation:r,allowStepClick:o,onStepClick:H=>{H<=p&&V(H)}}),b&&e.jsx("div",{className:"nice-wizard__progress",children:e.jsx("div",{className:"nice-wizard__progress-bar",style:{width:`${U}%`}})}),e.jsx("div",{className:"nice-wizard__content",role:"tabpanel",children:u&&e.jsxs(e.Fragment,{children:[typeof u.content=="function"?u.content(B):u.content,I[u.id]&&e.jsx("div",{className:"nice-wizard__error nice-error-text",children:I[u.id]})]})}),e.jsxs("div",{className:"nice-wizard__actions",children:[t&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--text",onClick:t,children:m??j("cancel","Cancel")}),e.jsxs("div",{className:"nice-wizard__actions-right",children:[!_&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outlined",onClick:E,children:d??j("previous","← Previous")}),e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:W,children:L?c??j("finish","Finish ✓"):h??j("next","Next →")})]})]})]})});un.displayName="NiceWizard";const mn=a.createContext(null);function Xn(){const n=a.useContext(mn);if(!n)throw new Error("useSetupWizard must be used within NiceSetupWizard");return n}const hn=a.forwardRef(({steps:n,initialValues:s={},activeStep:i,layout:l="horizontal",size:t="md",defaultQuickMode:o=!1,allowQuickModeToggle:r=!0,showStepNumbers:h=!0,showProgress:d=!0,showEstimatedTime:c=!1,allowStepClick:m=!0,showReviewStep:b=!1,persistKey:x,animation:f="slide",branding:C,header:g,footer:v,onStepChange:M,onValuesChange:D,onComplete:y,onCancel:j,labels:N={},accessMode:T,id:S,className:I,style:$},w)=>{const R=O.sc(T,S),p=R==="hidden",{t:u}=O.Zt(),_=O._s(S),[L,V]=a.useState(o),F=a.useMemo(()=>L?n.filter(k=>!k.quickModeSkip):n,[n,L]),W=a.useMemo(()=>{if(!b)return F;const k={id:"__review__",title:N.review??u("wizard.review","Review"),icon:"📋",content:ne=>e.jsxs("div",{className:"nice-setup-wizard__review",children:[e.jsx("h3",{children:u("wizard.reviewTitle","Review Your Setup")}),F.filter(q=>q.summary).map(q=>e.jsxs("div",{className:"nice-setup-wizard__review-section",children:[e.jsx("h4",{children:q.title}),q.summary?.(ne.values)]},q.id))]})};return[...F,k]},[F,b,N.review,u]),[E,ee]=a.useState(()=>{if(x)try{const k=localStorage.getItem(x);if(k)return{...s,...JSON.parse(k)}}catch{}return s}),[B,U]=a.useState(()=>{if(i)return i;if(x)try{const k=localStorage.getItem(`${x}_step`);if(k&&W.some(ne=>ne.id===k))return k}catch{}return W[0]?.id??""}),[K,H]=a.useState(()=>new Set([B])),[Z,te]=a.useState({}),[ue,ie]=a.useState(!1),[P,le]=a.useState("next"),X=W.findIndex(k=>k.id===B),z=W[X],Y=X===0,ae=X===W.length-1,ce=(X+1)/W.length*100;a.useEffect(()=>{x&&(localStorage.setItem(x,JSON.stringify(E)),localStorage.setItem(`${x}_step`,B))},[E,B,x]);const pe=a.useCallback((k,ne)=>{ee(q=>{const A={...q,[k]:ne};return D?.(A),A})},[D]),Ne=a.useCallback(k=>{ee(ne=>{const q={...ne,...k};return D?.(q),q})},[D]),oe=a.useCallback((k,ne)=>{te(q=>({...q,[k]:ne}))},[]),ge=a.useCallback(k=>{te(ne=>{const q={...ne};return delete q[k],q})},[]),me=a.useCallback(k=>{const ne=W.findIndex(q=>q.id===k);ne>=0&&(le(ne>X?"next":"prev"),U(k),H(q=>new Set(q).add(k)),M?.(k,ne))},[W,X,M]),fe=a.useCallback(async()=>{if(z){if(z.validate){ie(!0);try{const k=await z.validate(E);if(k){oe(z.id,k),ie(!1);return}ge(z.id)}catch(k){oe(z.id,String(k)),ie(!1);return}ie(!1)}if(z.fields){for(const k of z.fields){if(k.required&&!E[k.id]){oe(z.id,`${k.label} ${u("wizard.isRequired","is required")}`);return}if(k.validation?.custom){const ne=k.validation.custom(E[k.id]);if(ne){oe(z.id,ne);return}}}ge(z.id)}if(ae)await y?.(E),x&&(localStorage.removeItem(x),localStorage.removeItem(`${x}_step`));else{let k;z.nextStep?k=typeof z.nextStep=="function"?z.nextStep(E):z.nextStep:k=W[X+1]?.id??"",k&&me(k)}}},[z,E,ae,X,W,y,x,u,oe,ge,me]),ye=a.useCallback(()=>{if(Y)return;const k=z?.prevStep??W[X-1]?.id;k&&(le("prev"),me(k))},[Y,z,X,W,me]),ke=a.useCallback(()=>{if(z?.optional&&!ae){const k=W[X+1]?.id;k&&me(k)}},[z,ae,X,W,me]),Ce=a.useCallback(()=>{y?.(E)},[y,E]),xe=a.useCallback(()=>{j?.()},[j]),je=a.useCallback(()=>{V(k=>!k)},[]),he=a.useMemo(()=>({values:E,setValue:pe,setValues:Ne,currentStep:z,currentIndex:X,totalSteps:W.length,visitedSteps:K,errors:Z,setError:oe,clearError:ge,goNext:fe,goPrev:ye,goTo:me,skip:ke,complete:Ce,cancel:xe,isFirst:Y,isLast:ae,isQuickMode:L,toggleQuickMode:je,progress:ce,t:u}),[E,pe,Ne,z,X,W.length,K,Z,oe,ge,fe,ye,me,ke,Ce,xe,Y,ae,L,je,ce,u]),ve=a.useMemo(()=>{if(!c)return null;const ne=W.map(q=>q.estimatedTime).filter(Boolean).map(q=>{const A=q.match(/(\d+)\s*(min|sec|s|m)/i);if(!A)return 0;const G=parseInt(A[1],10);return A[2].toLowerCase().startsWith("m")?G:G/60}).reduce((q,A)=>q+A,0);return ne>0?`~${Math.ceil(ne)} min`:null},[W,c]);if(!z)return null;const $e=(k,ne)=>{const q=k.id===B,A=K.has(k.id)&&!q&&ne<X,G=!q&&!A,se=!!Z[k.id],Q=m&&(A||ne<=X);return e.jsxs("button",{type:"button",role:"tab","aria-selected":q,"aria-current":q?"step":void 0,className:["nice-setup-wizard__step-indicator",q&&"nice-setup-wizard__step-indicator--active",A&&"nice-setup-wizard__step-indicator--completed",G&&"nice-setup-wizard__step-indicator--pending",se&&"nice-setup-wizard__step-indicator--error"].filter(Boolean).join(" "),onClick:()=>Q&&me(k.id),disabled:!Q,children:[e.jsx("span",{className:"nice-setup-wizard__step-marker",children:A?"✓":se?"!":h?ne+1:k.icon||"○"}),e.jsxs("span",{className:"nice-setup-wizard__step-info",children:[e.jsx("span",{className:"nice-setup-wizard__step-title",children:k.title}),k.subtitle&&e.jsx("span",{className:"nice-setup-wizard__step-subtitle",children:k.subtitle}),k.optional&&e.jsxs("span",{className:"nice-setup-wizard__step-optional",children:["(",N.optional??u("wizard.optional","optional"),")"]})]}),k.badge&&e.jsx("span",{className:"nice-setup-wizard__step-badge",children:k.badge})]},k.id)},Ie=k=>{if(k.showWhen&&!k.showWhen(E))return null;const ne=E[k.id]??k.defaultValue??"",q=Q=>pe(k.id,Q);if(k.render)return e.jsx("div",{className:`nice-setup-wizard__field${k.fullWidth?" nice-setup-wizard__field--full":""}`,children:k.render({value:ne,onChange:q,field:k})},k.id);const A=`${_}-${k.id}`,G={id:A,disabled:k.disabled||R==="disabled"||R==="readOnly",placeholder:k.placeholder,required:k.required};let se;switch(k.type){case"textarea":se=e.jsx("textarea",{...G,className:"nice-setup-wizard__input nice-setup-wizard__textarea",value:String(ne),onChange:Q=>q(Q.target.value),rows:4});break;case"select":se=e.jsxs("select",{...G,className:"nice-setup-wizard__input nice-setup-wizard__select",value:String(ne),onChange:Q=>q(Q.target.value),children:[e.jsx("option",{value:"",children:k.placeholder||u("wizard.select","Select...")}),k.options?.map(Q=>e.jsx("option",{value:Q.value,children:Q.label},Q.value))]});break;case"radio":se=e.jsx("div",{className:"nice-setup-wizard__radio-group",children:k.options?.map(Q=>e.jsxs("label",{className:"nice-setup-wizard__radio-label",children:[e.jsx("input",{type:"radio",name:A,value:Q.value,checked:ne===Q.value,onChange:()=>q(Q.value),disabled:G.disabled}),Q.icon&&e.jsx("span",{className:"nice-setup-wizard__radio-icon",children:Q.icon}),e.jsx("span",{children:Q.label})]},Q.value))});break;case"checkbox":se=e.jsxs("label",{className:"nice-setup-wizard__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:!!ne,onChange:Q=>q(Q.target.checked),disabled:G.disabled}),e.jsx("span",{children:k.label})]});break;case"switch":se=e.jsxs("label",{className:"nice-setup-wizard__switch-label",children:[e.jsx("span",{className:"nice-setup-wizard__switch-text",children:k.label}),e.jsxs("span",{className:`nice-setup-wizard__switch${ne?" nice-setup-wizard__switch--on":""}`,children:[e.jsx("input",{type:"checkbox",checked:!!ne,onChange:Q=>q(Q.target.checked),disabled:G.disabled}),e.jsx("span",{className:"nice-setup-wizard__switch-track"}),e.jsx("span",{className:"nice-setup-wizard__switch-thumb"})]})]});break;case"slider":se=e.jsxs("div",{className:"nice-setup-wizard__slider-wrapper",children:[e.jsx("input",{type:"range",...G,className:"nice-setup-wizard__slider",value:Number(ne)||k.validation?.min||0,min:k.validation?.min,max:k.validation?.max,onChange:Q=>q(Number(Q.target.value))}),e.jsx("span",{className:"nice-setup-wizard__slider-value",children:String(ne??"")})]});break;default:se=e.jsx("input",{type:k.type==="custom"?"text":k.type,...G,className:"nice-setup-wizard__input",value:String(ne),onChange:Q=>q(Q.target.value),minLength:k.validation?.minLength,maxLength:k.validation?.maxLength,min:k.validation?.min,max:k.validation?.max,pattern:k.validation?.pattern?.source})}return e.jsxs("div",{className:`nice-setup-wizard__field${k.fullWidth?" nice-setup-wizard__field--full":""}`,children:[k.type!=="checkbox"&&k.type!=="switch"&&e.jsxs("label",{htmlFor:A,className:"nice-setup-wizard__label",children:[k.label,k.required&&e.jsx("span",{className:"nice-setup-wizard__required",children:"*"})]}),se,k.description&&e.jsx("span",{className:"nice-setup-wizard__field-desc",children:k.description})]},k.id)},Le=()=>z.fields?e.jsx("div",{className:"nice-setup-wizard__fields",children:z.fields.map(Ie)}):z.content?typeof z.content=="function"?z.content(he):z.content:null;return p?null:e.jsx(mn.Provider,{value:he,children:e.jsxs("div",{ref:w,id:_,className:["nice-setup-wizard",`nice-setup-wizard--${l}`,`nice-size-${t}`,f!=="none"&&`nice-setup-wizard--anim-${f}`,I].filter(Boolean).join(" "),style:$,children:[(C||g||r)&&e.jsxs("header",{className:"nice-setup-wizard__header",children:[C&&e.jsx("div",{className:"nice-setup-wizard__branding",children:C}),g,r&&e.jsxs("label",{className:"nice-setup-wizard__quick-toggle",children:[e.jsx("input",{type:"checkbox",checked:L,onChange:je}),e.jsx("span",{children:N.quickMode??u("wizard.quickMode","Quick Setup")})]}),ve&&e.jsx("span",{className:"nice-setup-wizard__time",children:ve})]}),l!=="minimal"&&e.jsx("nav",{className:"nice-setup-wizard__nav",role:"tablist",children:W.map($e)}),d&&e.jsx("div",{className:"nice-setup-wizard__progress",children:e.jsx("div",{className:"nice-setup-wizard__progress-bar",style:{width:`${ce}%`},role:"progressbar","aria-valuenow":ce,"aria-valuemin":0,"aria-valuemax":100})}),e.jsxs("div",{className:["nice-setup-wizard__content",P==="next"&&"nice-setup-wizard__content--slide-next",P==="prev"&&"nice-setup-wizard__content--slide-prev"].filter(Boolean).join(" "),role:"tabpanel",children:[z.description&&e.jsx("p",{className:"nice-setup-wizard__step-description",children:z.description}),Le(),Z[z.id]&&e.jsx("div",{className:"nice-setup-wizard__error",role:"alert",children:Z[z.id]})]},B),e.jsxs("footer",{className:"nice-setup-wizard__footer",children:[e.jsxs("div",{className:"nice-setup-wizard__actions-left",children:[j&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--text",onClick:xe,children:N.cancel??u("wizard.cancel","Cancel")}),z.optional&&!ae&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--text",onClick:ke,children:N.skip??u("wizard.skip","Skip")}),z.actions?.filter(k=>k.position==="left").map(k=>e.jsxs("button",{type:"button",className:`nice-btn nice-btn--${k.variant||"outlined"}`,onClick:()=>k.onClick(he),disabled:k.disabled?.(he),children:[k.icon," ",k.label]},k.id))]}),e.jsxs("div",{className:"nice-setup-wizard__actions-right",children:[z.actions?.filter(k=>k.position!=="left").map(k=>e.jsxs("button",{type:"button",className:`nice-btn nice-btn--${k.variant||"outlined"}`,onClick:()=>k.onClick(he),disabled:k.disabled?.(he),children:[k.icon," ",k.label]},k.id)),!Y&&e.jsx(J.NiceButton,{variant:"outline",size:t,onClick:ye,children:N.prev??u("wizard.prev","← Back")}),e.jsx(J.NiceButton,{variant:"primary",size:t,onClick:fe,disabled:ue,loading:ue,children:ae?N.finish??u("wizard.finish","Finish ✓"):N.next??u("wizard.next","Continue →")})]})]}),v&&e.jsx("div",{className:"nice-setup-wizard__custom-footer",children:v}),l==="minimal"&&e.jsx("div",{className:"nice-setup-wizard__minimal-indicator",children:N.stepOf?N.stepOf.replace("{current}",String(X+1)).replace("{total}",String(W.length)):`${X+1} / ${W.length}`})]})})});hn.displayName="NiceSetupWizard";const _n=a.forwardRef(({label:n,helperText:s,disabled:i,size:l="md",id:t,className:o,style:r,accessMode:h,logo:d,brandName:c,breadcrumbs:m,centerContent:b,rightContent:x,leftContent:f,sticky:C=!0,variant:g="light",height:v="md",onBrandClick:M,displayStyle:D},y)=>{const j=O.sc(h,t),N=j==="hidden";j==="disabled"&&(i=!0);const{t:T}=O.Zt(),S=O._s(t),I=O.Ns("menu",D),$=O.Es("menu",D);return N?null:e.jsxs("nav",{ref:y,id:S,className:`nice-navbar nice-navbar--${g} nice-navbar--h-${v}${C?" nice-navbar--sticky":""} nice-navbar--ds-${$}${o?` ${o}`:""}${i?" nice-disabled":""}`,style:{...I,...r},role:"navigation","aria-label":n??T("mainNavigation","Main navigation"),children:[e.jsxs("div",{className:"nice-navbar__left",children:[f,(d||c)&&e.jsxs("div",{className:"nice-navbar__brand",onClick:M,role:M?"button":void 0,tabIndex:M?0:void 0,children:[d&&e.jsx("span",{className:"nice-navbar__logo",children:d}),c&&e.jsx("span",{className:"nice-navbar__brand-name",children:c})]}),m&&m.length>0&&e.jsx("ol",{className:"nice-navbar__breadcrumbs","aria-label":T("breadcrumbs","Breadcrumbs"),children:m.map((w,R)=>e.jsxs("li",{className:"nice-navbar__breadcrumb",children:[R>0&&e.jsx("span",{className:"nice-navbar__breadcrumb-sep",children:"/"}),w.href||w.onClick?e.jsx("a",{href:w.href??"#",onClick:p=>{w.onClick&&(p.preventDefault(),w.onClick())},children:w.label}):e.jsx("span",{"aria-current":R===m.length-1?"page":void 0,children:w.label})]},R))})]}),b&&e.jsx("div",{className:"nice-navbar__center",children:b}),x&&e.jsx("div",{className:"nice-navbar__right",children:x})]})});_n.displayName="NiceNavbar";const bn=a.forwardRef(({label:n,helperText:s,disabled:i,readOnly:l,size:t="md",id:o,className:r,style:h,accessMode:d,tenants:c,currentTenantId:m,onSwitch:b,onManage:x,onCreate:f,variant:C="dropdown",searchable:g=!1},v)=>{const M=O.sc(d,o),D=M==="hidden";M==="disabled"&&(i=!0),M==="readOnly"&&(l=!0);const{t:y}=O.Zt(),j=O._s(o),[N,T]=a.useState(!1),[S,I]=a.useState(""),$=a.useMemo(()=>c.find(p=>p.id===m),[c,m]),w=a.useMemo(()=>{if(!S)return c;const p=S.toLowerCase();return c.filter(u=>u.name.toLowerCase().includes(p))},[c,S]),R=a.useCallback(p=>{b?.(p),T(!1),I("")},[b]);return C==="inline"?e.jsxs("div",{ref:v,id:j,className:`nice-tenant-switcher nice-tenant-switcher--inline nice-size-${t}${r?` ${r}`:""}${i?" nice-disabled":""}`,style:h,children:[n&&e.jsx("span",{className:"nice-tenant-switcher__label",children:n}),e.jsx("div",{className:"nice-tenant-switcher__list",children:c.map(p=>e.jsxs("button",{type:"button",className:`nice-tenant-switcher__option${p.id===m?" nice-tenant-switcher__option--active":""}`,onClick:()=>R(p.id),disabled:i||l,children:[p.logoUrl&&e.jsx("img",{src:p.logoUrl,alt:"",className:"nice-tenant-switcher__option-logo"}),e.jsx("span",{children:p.name})]},p.id))})]}):D?null:e.jsxs("div",{ref:v,id:j,className:`nice-tenant-switcher nice-size-${t}${r?` ${r}`:""}${i?" nice-disabled":""}`,style:h,children:[e.jsxs("button",{type:"button",className:"nice-tenant-switcher__trigger",onClick:()=>!i&&!l&&T(!N),onBlur:()=>setTimeout(()=>T(!1),200),disabled:i,"aria-haspopup":"listbox","aria-expanded":N,children:[$?.logoUrl&&e.jsx("img",{src:$.logoUrl,alt:"",className:"nice-tenant-switcher__trigger-logo"}),e.jsx("span",{className:"nice-tenant-switcher__trigger-name",children:$?.name??y("selectTenant","Select organization")}),e.jsx("span",{className:"nice-tenant-switcher__trigger-arrow",children:N?"▲":"▼"})]}),N&&e.jsxs("div",{className:"nice-tenant-switcher__dropdown",role:"listbox",children:[g&&e.jsx("input",{type:"text",className:"nice-input nice-tenant-switcher__search",value:S,onChange:p=>I(p.target.value),placeholder:y("searchOrganizations","Search…"),autoFocus:!0}),e.jsxs("div",{className:"nice-tenant-switcher__options",children:[w.map(p=>e.jsxs("div",{className:`nice-tenant-switcher__option${p.id===m?" nice-tenant-switcher__option--active":""}`,role:"option","aria-selected":p.id===m,onClick:()=>R(p.id),children:[p.logoUrl&&e.jsx("img",{src:p.logoUrl,alt:"",className:"nice-tenant-switcher__option-logo"}),e.jsxs("div",{className:"nice-tenant-switcher__option-info",children:[e.jsx("span",{className:"nice-tenant-switcher__option-name",children:p.name}),p.subtitle&&e.jsx("span",{className:"nice-tenant-switcher__option-subtitle",children:p.subtitle})]}),p.id===m&&e.jsx("span",{className:"nice-tenant-switcher__check",children:"✓"})]},p.id)),w.length===0&&e.jsx("div",{className:"nice-tenant-switcher__empty",children:y("noResults","No results")})]}),(x||f)&&e.jsxs("div",{className:"nice-tenant-switcher__footer",children:[x&&e.jsx("button",{type:"button",onClick:x,children:y("manageTenants","Manage organizations")}),f&&e.jsx("button",{type:"button",onClick:f,children:y("createTenant","Create organization")})]})]})]})});bn.displayName="NiceTenantSwitcher";const Gn={online:"var(--nice-color-success, #5cb85c)",away:"var(--nice-color-warning, #f0ad4e)",busy:"var(--nice-color-error, #d9534f)",offline:"var(--nice-color-muted, #999)"},Fe=a.forwardRef(({label:n,disabled:s,size:i="md",id:l,className:t,style:o,accessMode:r,userName:h,userEmail:d,userRole:c,avatarUrl:m,items:b=[],open:x,onOpenChange:f,onProfile:C,onLogout:g,avatarSize:v=36,status:M},D)=>{const y=O.sc(r,l),j=y==="hidden";y==="disabled"&&(s=!0);const{t:N}=O.Zt(),T=O._s(l),[S,I]=a.useState(!1),$=x??S,w=a.useCallback(()=>{const _=!$;I(_),f?.(_)},[$,f]),R=h.split(" ").map(_=>_.charAt(0)).join("").toUpperCase().slice(0,2),p=[];C&&p.push({id:"__profile",label:N("profile","Profile"),onClick:C}),g&&p.push({id:"__divider",label:"",isDivider:!0},{id:"__logout",label:N("logout","Logout"),onClick:g,danger:!0});const u=b.length>0?b:p;return j?null:e.jsxs("div",{ref:D,id:T,className:`nice-user-menu nice-size-${i}${t?` ${t}`:""}${s?" nice-disabled":""}`,style:o,children:[e.jsx("button",{type:"button",className:"nice-user-menu__trigger",onClick:w,onBlur:()=>setTimeout(()=>{I(!1),f?.(!1)},200),disabled:s,"aria-haspopup":"menu","aria-expanded":$,"aria-label":n??h,children:e.jsxs("span",{className:"nice-user-menu__avatar",style:{width:v,height:v},children:[m?e.jsx("img",{src:m,alt:h}):e.jsx("span",{className:"nice-user-menu__initials",children:R}),M&&e.jsx("span",{className:"nice-user-menu__status",style:{backgroundColor:Gn[M]},title:M})]})}),$&&e.jsxs("div",{className:"nice-user-menu__dropdown",role:"menu",children:[e.jsxs("div",{className:"nice-user-menu__info",children:[e.jsx("span",{className:"nice-user-menu__name",children:h}),d&&e.jsx("span",{className:"nice-user-menu__email",children:d}),c&&e.jsx("span",{className:"nice-user-menu__role",children:c})]}),u.length>0&&e.jsx("div",{className:"nice-user-menu__items",children:u.map(_=>_.isDivider?e.jsx("hr",{className:"nice-user-menu__divider"},_.id):e.jsxs("button",{type:"button",role:"menuitem",className:`nice-user-menu__item${_.danger?" nice-user-menu__item--danger":""}`,onClick:()=>{_.onClick?.(),I(!1),f?.(!1)},disabled:_.disabled||s,children:[_.icon&&e.jsx("span",{className:"nice-user-menu__item-icon",children:_.icon}),e.jsx("span",{children:_.label})]},_.id))})]})]})});Fe.displayName="NiceUserMenu";function Jn(n,s){if(!s)return n;const i=s.toLowerCase();return n.map(l=>{const t=l.entities.filter(r=>r.label.toLowerCase().includes(i)||r.name.toLowerCase().includes(i));return l.label.toLowerCase().includes(i)||l.name.toLowerCase().includes(i)?l:t.length>0?{...l,entities:t}:null}).filter(Boolean)}const es=({value:n,onChange:s,placeholder:i})=>e.jsxs("div",{className:"nice-dynamic-sidebar__search",children:[e.jsx("span",{className:"nice-dynamic-sidebar__search-icon","aria-hidden":!0,children:"🔍"}),e.jsx("input",{type:"text",className:"nice-dynamic-sidebar__search-input",value:n,onChange:l=>s(l.target.value),placeholder:i,"aria-label":i}),n&&e.jsx("button",{className:"nice-dynamic-sidebar__search-clear",onClick:()=>s(""),"aria-label":"Clear",type:"button",children:"×"})]}),ns=({module:n,activeRoute:s,collapsed:i,expandedModules:l,onToggleModule:t,onNavigate:o})=>{const r=l.has(n.id);return i?e.jsx("div",{className:"nice-dynamic-sidebar__module nice-dynamic-sidebar__module--collapsed",title:n.label,children:e.jsx("button",{className:`nice-dynamic-sidebar__module-icon ${n.isAvailable?"":"nice-dynamic-sidebar__module-icon--disabled"}`,onClick:()=>n.isAvailable&&n.entities.length>0&&o(n.entities[0].route,n.entities[0]),disabled:!n.isAvailable,type:"button",children:e.jsx("span",{children:n.icon||n.label[0]})})}):e.jsxs("div",{className:`nice-dynamic-sidebar__module ${n.isAvailable?"":"nice-dynamic-sidebar__module--disabled"}`,children:[e.jsxs("button",{className:`nice-dynamic-sidebar__module-header ${r?"nice-dynamic-sidebar__module-header--expanded":""}`,onClick:()=>n.isAvailable&&t(n.id),disabled:!n.isAvailable,type:"button","aria-expanded":r,children:[n.icon&&e.jsx("span",{className:"nice-dynamic-sidebar__module-icon",children:n.icon}),e.jsx("span",{className:"nice-dynamic-sidebar__module-label",children:n.label}),e.jsx("span",{className:`nice-dynamic-sidebar__module-chevron ${r?"nice-dynamic-sidebar__module-chevron--open":""}`,children:"▸"})]}),r&&e.jsx("ul",{className:"nice-dynamic-sidebar__entities",role:"list",children:n.entities.map(h=>e.jsx("li",{className:`nice-dynamic-sidebar__entity ${s===h.route?"nice-dynamic-sidebar__entity--active":""}`,children:e.jsxs("button",{className:"nice-dynamic-sidebar__entity-btn",onClick:()=>o(h.route,h),type:"button",children:[h.icon&&e.jsx("span",{className:"nice-dynamic-sidebar__entity-icon",children:h.icon}),e.jsx("span",{children:h.label})]})},h.id))})]})},ss=({favorites:n,activeRoute:s,onNavigate:i,label:l})=>n.length===0?null:e.jsxs("div",{className:"nice-dynamic-sidebar__favorites",children:[e.jsx("div",{className:"nice-dynamic-sidebar__section-title",children:l}),e.jsx("ul",{role:"list",children:n.map(t=>e.jsx("li",{className:`nice-dynamic-sidebar__favorite ${s===t.route?"nice-dynamic-sidebar__favorite--active":""}`,children:e.jsxs("button",{className:"nice-dynamic-sidebar__favorite-btn",onClick:()=>i(t.route),type:"button",children:[t.icon&&e.jsx("span",{children:t.icon}),e.jsx("span",{children:t.label})]})},t.id))})]}),pn=a.forwardRef(({menu:n,activeRoute:s,collapsed:i,width:l=260,collapsedWidth:t=56,searchable:o=!0,showFavorites:r=!0,showQuickActions:h=!0,collapsible:d=!0,onNavigate:c,onCollapseChange:m,onToggleFavorite:b,header:x,footer:f,className:C,style:g,id:v,accessMode:M,...D},y)=>{const j=O._s(v),N=O.sc(M,v),{t:T}=O.Zt(),[S,I]=a.useState(i??!1),$=i??S,[w,R]=a.useState(""),[p,u]=a.useState(()=>{if(s){const E=n.modules.find(ee=>ee.entities.some(B=>B.route===s));return E?new Set([E.id]):new Set}return new Set}),_=a.useCallback(()=>{const E=!$;I(E),m?.(E)},[$,m]),L=a.useCallback(E=>{u(ee=>{const B=new Set(ee);return B.has(E)?B.delete(E):B.add(E),B})},[]),V=a.useCallback((E,ee)=>{c?.(E,ee)},[c]),F=a.useMemo(()=>Jn(n.modules.filter(E=>E.isAvailable).sort((E,ee)=>E.order-ee.order),w),[n.modules,w]),W=$?t:l;return N==="hidden"?null:e.jsxs("nav",{ref:y,id:j,className:`nice-dynamic-sidebar ${$?"nice-dynamic-sidebar--collapsed":""} ${C??""}`,style:{...g,width:W,minWidth:W},"aria-label":T("nav.sidebar","Sidebar"),...D,children:[x&&e.jsx("div",{className:"nice-dynamic-sidebar__header",children:x}),d&&e.jsx("button",{className:"nice-dynamic-sidebar__toggle",onClick:_,"aria-label":$?T("expand","Expand"):T("collapse","Collapse"),type:"button",children:$?"▸":"◂"}),o&&!$&&e.jsx(es,{value:w,onChange:R,placeholder:T("nav.search","Search")}),r&&!$&&e.jsx(ss,{favorites:n.favorites,activeRoute:s,onNavigate:V,label:T("nav.favorites","Favorites")}),h&&!$&&n.quickActions.length>0&&e.jsx("div",{className:"nice-dynamic-sidebar__quick-actions",children:n.quickActions.map(E=>e.jsxs("button",{className:"nice-dynamic-sidebar__quick-action",onClick:()=>V(E.route),title:E.shortcut?`${E.label} (${E.shortcut})`:E.label,type:"button",children:[E.icon&&e.jsx("span",{children:E.icon}),e.jsx("span",{children:E.label})]},E.id))}),e.jsxs("div",{className:"nice-dynamic-sidebar__modules",role:"navigation",children:[F.map(E=>e.jsx(ns,{module:E,activeRoute:s,collapsed:$,expandedModules:p,onToggleModule:L,onNavigate:V},E.id)),F.length===0&&!$&&e.jsx("div",{className:"nice-dynamic-sidebar__empty",children:T("noData","No data")})]}),f&&e.jsx("div",{className:"nice-dynamic-sidebar__footer",children:f})]})});pn.displayName="NiceDynamicSidebar";const as=e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1.08-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1.08 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),is=e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),e.jsx("line",{x1:"9",y1:"21",x2:"9",y2:"9"})]}),ls=e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),e.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),ts=e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),e.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}),cs=e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("polyline",{points:"23 4 23 10 17 10"}),e.jsx("polyline",{points:"1 20 1 14 7 14"}),e.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]}),We=[{id:"prefs-general",route:"preferences/general",labelKey:"sidebar.prefs.general",labelDefault:"General",icon:as},{id:"prefs-display",route:"preferences/display",labelKey:"sidebar.prefs.display",labelDefault:"Display",icon:is},{id:"prefs-order",route:"preferences/order",labelKey:"sidebar.prefs.order",labelDefault:"Order",icon:ls},{id:"prefs-hidden",route:"preferences/hidden",labelKey:"sidebar.prefs.hidden",labelDefault:"Hidden items",icon:ts},{id:"prefs-reset",route:"preferences/reset",labelKey:"sidebar.prefs.reset",labelDefault:"Reset",icon:cs}];function rs(n){return We.map(s=>({id:s.id,label:n(s.labelKey,s.labelDefault),icon:s.icon,route:s.route}))}const Se=n=>a.createElement("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},n),os=Se([a.createElement("line",{key:"l1",x1:4,y1:7,x2:20,y2:7}),a.createElement("line",{key:"l2",x1:4,y1:12,x2:20,y2:12}),a.createElement("line",{key:"l3",x1:4,y1:17,x2:20,y2:17})]),ds=Se([a.createElement("circle",{key:"h",cx:12,cy:8,r:4}),a.createElement("path",{key:"b",d:"M4 21c0-4 4-7 8-7s8 3 8 7"})]),us=Se([a.createElement("rect",{key:"r",x:4,y:3,width:16,height:18,rx:1}),a.createElement("line",{key:"l1",x1:9,y1:7,x2:9,y2:7.01}),a.createElement("line",{key:"l2",x1:15,y1:7,x2:15,y2:7.01}),a.createElement("line",{key:"l3",x1:9,y1:12,x2:9,y2:12.01}),a.createElement("line",{key:"l4",x1:15,y1:12,x2:15,y2:12.01}),a.createElement("rect",{key:"d",x:10,y:16,width:4,height:5})]),ms=Se(a.createElement("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",fill:"currentColor"})),hs=Se([a.createElement("circle",{key:"c",cx:11,cy:11,r:7}),a.createElement("line",{key:"l",x1:21,y1:21,x2:16.65,y2:16.65})]),_s=Se([a.createElement("circle",{key:"c",cx:12,cy:12,r:3}),a.createElement("path",{key:"g",d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1.08-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1.08 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]),ze={all:{icon:os,label:"Wszystko"},"by-role":{icon:ds,label:"Według roli"},"by-unit":{icon:us,label:"Według jednostki"},favorites:{icon:ms,label:"Ulubione"},search:{icon:hs,label:"Wyszukaj"},preferences:{icon:_s,label:"Preferencje"}},Pe={enableModeIcons:!1,enabledModes:["all","by-role","by-unit","favorites","search","preferences"],activeMode:"all",pinnedSources:{},hiddenItems:[],favorites:[],maxDepth:{},collapsedIds:[],autoExpand:!0,leftClickBehavior:"focus-existing",itemOrder:{}};function Ee(n){return typeof n=="string"?e.jsx(O.Or,{name:n}):n}function xn(n){return`nice_sidebar_nav_${n??"_default"}`}const Te="nice-sidebar-prefs-change";function He(n,s){const i={...Pe,userId:n??"_default"};if(s&&Object.assign(i,s),s&&typeof s.activeMode<"u")return i;try{const l=localStorage.getItem(xn(n));if(l){const t=JSON.parse(l);return Array.isArray(t.favorites)&&(t.favorites=t.favorites.map(o=>o&&typeof o=="object"?{...o,icon:typeof o.icon=="string"||a.isValidElement(o.icon)?o.icon:void 0}:o)),{...i,...t,userId:n??"_default"}}}catch{}return i}function vn(n,s,i,l){const[t,o]=a.useState(()=>{const d=He(n,i);return s!==void 0&&(d.enableModeIcons=s),d});a.useEffect(()=>{i&&o(d=>({...d,...i}))},[i]);const r=a.useCallback(d=>{o(c=>{const m=d(c);if(!i?.activeMode)try{const b={...m,favorites:m.favorites.map(x=>({...x,icon:void 0}))};localStorage.setItem(xn(n),JSON.stringify(b)),typeof window<"u"&&window.dispatchEvent(new CustomEvent(Te,{detail:{userId:n??"_default"}}))}catch{}return l?.(m),m})},[n,i,l]);a.useEffect(()=>{if(typeof window>"u")return;const d=c=>{c.detail?.userId===(n??"_default")&&o(b=>{const x=He(n,i);return s!==void 0&&(x.enableModeIcons=s),JSON.stringify(b)===JSON.stringify(x)?b:x})};return window.addEventListener(Te,d),()=>window.removeEventListener(Te,d)},[n,i,s]);const h=a.useMemo(()=>({setMode:d=>r(c=>({...c,activeMode:d})),setEnableModeIcons:d=>r(c=>({...c,enableModeIcons:d})),toggleMode:d=>r(c=>{if(d==="preferences")return c;const m=c.enabledModes.includes(d);return{...c,enabledModes:m?c.enabledModes.filter(b=>b!==d):[...c.enabledModes,d],activeMode:!m||c.activeMode!==d?c.activeMode:"all"}}),pinSource:(d,c)=>r(m=>({...m,pinnedSources:{...m.pinnedSources,[d]:[...m.pinnedSources[d]??[],c]}})),unpinSource:(d,c)=>r(m=>({...m,pinnedSources:{...m.pinnedSources,[d]:(m.pinnedSources[d]??[]).filter(b=>b!==c)}})),hideItem:d=>r(c=>({...c,hiddenItems:c.hiddenItems.some(m=>m.id===d.id)?c.hiddenItems:[...c.hiddenItems,d]})),restoreItem:d=>r(c=>({...c,hiddenItems:c.hiddenItems.filter(m=>m.id!==d)})),addFavorite:d=>r(c=>({...c,favorites:c.favorites.some(m=>m.id===d.id)?c.favorites:[...c.favorites,{...d,addedAt:Date.now()}]})),removeFavorite:d=>r(c=>({...c,favorites:c.favorites.filter(m=>m.id!==d)})),setMaxDepth:(d,c)=>r(m=>({...m,maxDepth:{...m.maxDepth,[d]:Math.min(10,Math.max(1,c))}})),toggleCollapse:d=>r(c=>({...c,collapsedIds:c.collapsedIds.includes(d)?c.collapsedIds.filter(m=>m!==d):[...c.collapsedIds,d]})),setCollapsed:(d,c)=>r(m=>({...m,collapsedIds:c?Array.from(new Set([...m.collapsedIds,...d])):m.collapsedIds.filter(b=>!d.includes(b))})),setAutoExpand:d=>r(c=>({...c,autoExpand:d})),setLeftClickBehavior:d=>r(c=>({...c,leftClickBehavior:d})),reorderItems:(d,c)=>r(m=>{const b={...m.itemOrder};return c==null?delete b[d]:b[d]=c,{...m,itemOrder:b}}),resetAll:()=>r(()=>({...Pe,userId:n??"_default"}))}),[r,n]);return[t,h]}function bs({enabledModes:n,activeMode:s,onSelect:i,collapsed:l=!1}){const t=[...n.filter(o=>o!=="preferences"),"preferences"];if(l){const o=Math.max(0,t.indexOf(s)),r=t[(o-1+t.length)%t.length],h=t[(o+1)%t.length],d=ze[s];return e.jsxs("div",{className:"nice-sidebar-nav__mode-bar nice-sidebar-nav__mode-bar--carousel",role:"tablist","aria-label":"Tryb nawigacji",children:[e.jsx(re,{content:`Poprzedni tryb: ${ze[r].label}`,position:"bottom",size:"sm",children:e.jsx("button",{type:"button",className:"nice-sidebar-nav__mode-arrow","aria-label":"Poprzedni tryb",onClick:()=>i(r),children:e.jsx("span",{"aria-hidden":"true",children:"‹"})})}),e.jsx(re,{content:d.label,position:"bottom",size:"sm",children:e.jsx("button",{type:"button",role:"tab","aria-selected":!0,"aria-label":d.label,className:"nice-sidebar-nav__mode-pill nice-sidebar-nav__mode-pill--active nice-sidebar-nav__mode-pill--carousel",onClick:()=>i(s),children:e.jsx("span",{className:"nice-sidebar-nav__mode-pill-icon","aria-hidden":"true",children:d.icon})})}),e.jsx(re,{content:`Następny tryb: ${ze[h].label}`,position:"bottom",size:"sm",children:e.jsx("button",{type:"button",className:"nice-sidebar-nav__mode-arrow","aria-label":"Następny tryb",onClick:()=>i(h),children:e.jsx("span",{"aria-hidden":"true",children:"›"})})})]})}return e.jsx("div",{className:"nice-sidebar-nav__mode-bar",role:"tablist","aria-label":"Tryb nawigacji",children:t.map(o=>{const r=ze[o],h=s===o;return e.jsx(re,{content:r.label,position:"bottom",size:"sm",children:e.jsxs("button",{role:"tab","aria-selected":h,"aria-label":r.label,className:["nice-sidebar-nav__mode-pill",h?"nice-sidebar-nav__mode-pill--active":""].filter(Boolean).join(" "),onClick:()=>i(o),children:[e.jsx("span",{className:"nice-sidebar-nav__mode-pill-icon","aria-hidden":"true",children:r.icon}),e.jsx("span",{className:"nice-sidebar-nav__mode-pill-label",children:r.label})]})},o)})})}function fn({open:n,size:s=16}){return e.jsx("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transition:"transform 160ms ease",transform:n?"rotate(0deg)":"rotate(-90deg)"},children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})}function ps({size:n=14}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})}function xs({size:n=14}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:1,strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})}function jn({size:n=14}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),e.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})}function vs({size:n=14,filled:s=!1}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:s?"currentColor":"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"22"}),e.jsx("path",{d:"M5 17h14l-1.5-3V8a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v6L5 17z"})]})}function Nn({size:n=12}){return e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function gn({item:n,depth:s,maxDepth:i,activeRoute:l,collapsedIds:t,hiddenIds:o,autoExpand:r,sidebarCollapsed:h=!1,expandableWhenCollapsed:d=!1,onNavigate:c,onHide:m,onToggleCollapse:b,onAddFavorite:x,onRemoveFavorite:f,isFavorite:C,leftClickBehavior:g="focus-existing",routeToUrl:v,contextMenu:M=!0,disabledActions:D}){const{t:y}=O.Zt(),j=a.useRef(null),N=(n.children?.length??0)>0&&s<i,T=t.includes(n.id),S=r?!T:T,I=!!(n.route&&l&&n.route===l),$=!!n.route,w=$&&C(n.id),R=a.useMemo(()=>{if(!M||!$||!n.route)return[];const u=n.route,_=[{id:"open",label:y("sidebar.menu.open","Open"),onClick:()=>c?.(u,n,{forceNew:!1})},{id:"openNewTab",label:y("sidebar.menu.openNewTab","Open in new tab"),onClick:()=>c?.(u,n,{forceNew:!0})}];return v&&_.push({id:"openBrowserTab",label:y("sidebar.menu.openBrowserTab","Open in new browser tab"),onClick:()=>{typeof window<"u"&&window.open(v(u),"_blank","noopener,noreferrer")}}),_.push({id:"sep-1",divider:!0}),w?_.push({id:"unpinFavorite",label:y("sidebar.menu.unpinFavorite","Remove from favorites"),onClick:()=>f(n.id)}):_.push({id:"pinFavorite",label:y("sidebar.menu.pinFavorite","Add to favorites"),onClick:()=>x({id:n.id,label:n.label,icon:n.icon,route:n.route,sourceId:n.sourceId,moduleId:n.moduleId,addedAt:Date.now()})}),_.push({id:"hide",label:y("sidebar.menu.hide","Hide"),disabled:!!D?.has("hide"),onClick:()=>m({id:n.id,kind:n.kind,label:n.label})}),v&&(_.push({id:"sep-2",divider:!0}),_.push({id:"copyLink",label:y("sidebar.menu.copyLink","Copy link"),onClick:()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(v(u))}})),_},[M,D,$,n,w,v,c,x,f,m,y]);if(o.has(n.id))return null;function p(){if(N){D?.has("collapseToggle")||b(n.id);return}if($&&n.route){const u=g==="open-new";c?.(n.route,n,{forceNew:u})}}return e.jsxs("li",{className:["nice-sidebar-nav__node",`nice-sidebar-nav__node--depth-${s}`,I?"nice-sidebar-nav__node--active":"",N?"nice-sidebar-nav__node--branch":"nice-sidebar-nav__node--leaf"].filter(Boolean).join(" "),"data-nice-depth":s,style:(()=>{const u=Math.min(Math.max(s,1),10);return{"--nice-row-bg":`var(--nice-sidebar-level-${u}-bg, transparent)`,"--nice-row-text":`var(--nice-sidebar-level-${u}-text, inherit)`,"--nice-row-border":`var(--nice-sidebar-level-${u}-border, transparent)`,"--nice-row-hover-bg":`var(--nice-sidebar-level-${u}-hover-bg, var(--hover-bg))`,"--nice-row-active-bg":`var(--nice-sidebar-level-${u}-active-bg, var(--selected-bg))`}})(),children:[e.jsxs("div",{className:"nice-sidebar-nav__node-row",ref:j,children:[N&&e.jsx(re,{content:S?"Zwiń":"Rozwiń",position:"right",size:"sm",children:e.jsx("button",{className:"nice-sidebar-nav__collapse-btn","aria-label":S?"Zwiń":"Rozwiń","aria-expanded":S,disabled:D?.has("collapseToggle"),onClick:()=>b(n.id),children:e.jsx(fn,{open:S,size:20})})}),!N&&e.jsx("span",{className:"nice-sidebar-nav__collapse-spacer"}),e.jsx(re,{content:n.label,position:"right",size:"sm",children:e.jsxs("span",{role:$?"link":void 0,tabIndex:$?0:void 0,className:["nice-sidebar-nav__node-content",$?"nice-sidebar-nav__node-content--link":"",!$&&N?"nice-sidebar-nav__node-content--toggle":""].filter(Boolean).join(" "),onClick:p,onKeyDown:u=>(u.key==="Enter"||u.key===" ")&&p(),children:[n.icon&&e.jsx("span",{className:"nice-sidebar-nav__node-icon","aria-hidden":"true",children:Ee(n.icon)}),e.jsx("span",{className:"nice-sidebar-nav__node-label",children:n.label}),n.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-nav__node-badge","aria-label":`${n.badge} powiadomień`,children:n.badge})]})}),e.jsxs("div",{className:"nice-sidebar-nav__node-actions",children:[$&&!C(n.id)&&e.jsx(re,{content:"Dodaj do ulubionych",position:"top",size:"sm",children:e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--fav","aria-label":"Dodaj do ulubionych",onClick:u=>{u.stopPropagation(),x({id:n.id,label:n.label,icon:n.icon,route:n.route,sourceId:n.sourceId,moduleId:n.moduleId,addedAt:Date.now()})},children:e.jsx(ps,{size:14})})}),C(n.id)&&e.jsx(re,{content:"W ulubionych",position:"top",size:"sm",children:e.jsx("span",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--fav-active","aria-label":"W ulubionych",children:e.jsx(xs,{size:14})})}),e.jsx(re,{content:"Ukryj element",position:"top",size:"sm",children:e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide","aria-label":"Ukryj element",onClick:u=>{u.stopPropagation(),m({id:n.id,kind:n.kind,label:n.label})},children:e.jsx(jn,{size:14})})})]})]}),R.length>0&&e.jsx(Be,{target:j,items:R,size:"sm"}),N&&S&&e.jsx("ul",{className:"nice-sidebar-nav__children",children:n.children.map(u=>e.jsx(gn,{item:u,depth:s+1,maxDepth:i,activeRoute:l,collapsedIds:t,hiddenIds:o,autoExpand:r,sidebarCollapsed:h,expandableWhenCollapsed:d,onNavigate:c,onHide:m,onToggleCollapse:b,onAddFavorite:x,onRemoveFavorite:f,isFavorite:C,leftClickBehavior:g,routeToUrl:v,contextMenu:M,disabledActions:D},u.id))})]})}function fs(n,s){if(!s||s.length===0)return n;const i=new Map(s.map((t,o)=>[t,o])),l=s.length;return[...n].sort((t,o)=>{const r=i.has(t.id)?i.get(t.id):l+n.indexOf(t),h=i.has(o.id)?i.get(o.id):l+n.indexOf(o);return r-h})}function js(n,s){return n.map(i=>({id:i.id,label:i.label,icon:i.icon,kind:"module",sourceId:s,children:i.views.map(l=>({id:l.id,label:l.label,icon:l.icon,route:l.route,badge:l.badge,kind:"view",sourceId:s,moduleId:i.id,children:[]}))}))}function Ns(n,s){return n.map(i=>({id:i.id,label:i.label,icon:i.icon,kind:"role",sourceId:s,children:i.modules.map(l=>({id:`${i.id}:${l.id}`,label:l.label,icon:l.icon,kind:"module",sourceId:s,children:l.views.map(t=>({id:t.id,label:t.label,icon:t.icon,route:t.route,badge:t.badge,kind:"view",sourceId:s,moduleId:l.id,children:[]}))}))}))}function gs(n,s){return n.map(i=>({id:i.id,label:i.label,icon:i.icon,kind:"unit",sourceId:s,children:i.modules.map(l=>({id:`${i.id}:${l.id}`,label:l.label,icon:l.icon,kind:"module",sourceId:s,children:l.views.map(t=>({id:t.id,label:t.label,icon:t.icon,route:t.route,badge:t.badge,kind:"view",sourceId:s,moduleId:l.id,children:[]}))}))}))}function ys({node:n,mode:s,maxDepth:i,isPinned:l,prefs:t,helpers:o,activeRoute:r,onNavigate:h,sidebarCollapsed:d=!1,expandableWhenCollapsed:c=!1,routeToUrl:m,contextMenu:b=!0,disabledActions:x,showHeader:f=!0}){const{t:C}=O.Zt(),g=a.useRef(null),v=a.useMemo(()=>new Set(t.hiddenItems.map(p=>p.id)),[t.hiddenItems]),M=a.useMemo(()=>{let p;return s==="all"?p=js(n.modules,n.source.id):s==="by-role"?p=Ns(n.roles,n.source.id):p=gs(n.units,n.source.id),fs(p,t.itemOrder[s])},[s,n,t.itemOrder]),D=a.useCallback(p=>t.favorites.some(u=>u.id===p),[t.favorites]),y=a.useMemo(()=>b?[{id:l?"unpinSource":"pinSource",label:l?C("sidebar.menu.unpinSource","Unpin source"):C("sidebar.menu.pinSource","Pin source"),onClick:()=>l?o.unpinSource(s,n.source.id):o.pinSource(s,n.source.id)},{id:"hideSource",label:C("sidebar.menu.hideSource","Hide source"),disabled:!!x?.has("hide"),onClick:()=>o.hideItem({id:n.source.id,kind:"source",label:n.source.label})}]:[],[b,x,l,o,s,n.source,C]);if(v.has(n.source.id))return null;const j=t.collapsedIds.includes(n.source.id),N=t.autoExpand?!j:j,T=M.filter(p=>(p.children?.length??0)>0).map(p=>p.id),S=T.length>0,I=S&&T.every(p=>t.collapsedIds.includes(p)),$=S?!I:N,w=!f||S?!0:N,R=()=>{x?.has("collapseToggle")||(S?o.setCollapsed(T,!I):o.toggleCollapse(n.source.id))};return e.jsxs("section",{className:"nice-sidebar-nav__source-section",children:[f&&e.jsx(re,{content:n.source.label,position:"right",size:"sm",children:e.jsxs("div",{ref:g,className:"nice-sidebar-nav__source-header",onClick:p=>{p.target.closest(".nice-sidebar-nav__source-actions")||R()},role:"button",tabIndex:0,"aria-expanded":$,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),R())},children:[e.jsx("span",{className:"nice-sidebar-nav__source-chevron","aria-hidden":"true",children:e.jsx(fn,{open:$,size:16})}),n.source.icon&&e.jsx("span",{className:"nice-sidebar-nav__source-icon","aria-hidden":"true",children:Ee(n.source.icon)}),e.jsx("span",{className:"nice-sidebar-nav__source-label",children:n.source.label}),e.jsxs("div",{className:"nice-sidebar-nav__source-actions",onClick:p=>p.stopPropagation(),children:[e.jsx(re,{content:l?"Odepnij źródło":"Przypnij źródło",position:"top",size:"sm",children:e.jsx("button",{className:["nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--pin",l?"nice-sidebar-nav__action-btn--pin-active":""].filter(Boolean).join(" "),"aria-label":l?"Odepnij źródło":"Przypnij źródło",onClick:()=>l?o.unpinSource(s,n.source.id):o.pinSource(s,n.source.id),children:e.jsx(vs,{size:14,filled:l})})}),e.jsx(re,{content:"Ukryj źródło",position:"top",size:"sm",children:e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide","aria-label":"Ukryj źródło",onClick:()=>o.hideItem({id:n.source.id,kind:"source",label:n.source.label}),children:e.jsx(jn,{size:14})})})]})]})}),f&&y.length>0&&e.jsx(Be,{target:g,items:y,size:"sm"}),i>1&&w&&e.jsx("ul",{className:"nice-sidebar-nav__tree",children:M.map(p=>e.jsx(gn,{item:p,depth:2,maxDepth:i,activeRoute:r,collapsedIds:t.collapsedIds,hiddenIds:v,autoExpand:t.autoExpand,sidebarCollapsed:d,expandableWhenCollapsed:c,onNavigate:h,onHide:o.hideItem,onToggleCollapse:o.toggleCollapse,onAddFavorite:o.addFavorite,onRemoveFavorite:o.removeFavorite,isFavorite:D,leftClickBehavior:t.leftClickBehavior,routeToUrl:m,contextMenu:b,disabledActions:x},p.id))})]})}function ks({favorites:n,activeRoute:s,onNavigate:i,onRemove:l,collapsed:t=!1,leftClickBehavior:o="focus-existing"}){const r=o==="open-new";return n.length===0?e.jsx("p",{className:"nice-sidebar-nav__empty",children:"Brak ulubionych. Najedź na element i kliknij ikonę gwiazdki, aby dodać."}):e.jsx("ul",{className:"nice-sidebar-nav__favorites-list",children:n.map(h=>{const d=!!(h.route&&h.route===s);return e.jsxs("li",{className:["nice-sidebar-nav__fav-item",d?"nice-sidebar-nav__fav-item--active":""].filter(Boolean).join(" "),children:[e.jsx(re,{content:h.label,position:"right",size:"sm",children:e.jsxs("span",{role:"link",tabIndex:0,className:"nice-sidebar-nav__fav-content",onClick:()=>{h.route&&i?.(h.route,h,{forceNew:r})},onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&h.route&&i?.(h.route,h,{forceNew:r})},children:[(typeof h.icon=="string"||a.isValidElement(h.icon))&&e.jsx("span",{className:"nice-sidebar-nav__fav-icon","aria-hidden":"true",children:Ee(h.icon)}),e.jsx("span",{className:"nice-sidebar-nav__fav-label",children:h.label})]})}),!t&&e.jsx(re,{content:"Usuń z ulubionych",position:"top",size:"sm",children:e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--remove","aria-label":"Usuń z ulubionych",onClick:()=>l(h.id),children:e.jsx(Nn,{size:12})})})]},h.id)})})}function ws(n){const s=[],i=new Set;for(const l of n){const t=l.source;for(const o of l.modules)for(const r of o.views){const h=`${t.id}::${r.id}`;i.has(h)||(i.add(h),s.push({view:r,breadcrumb:[{id:t.id,label:t.label,icon:t.icon},{id:o.id,label:o.label,icon:o.icon}]}))}for(const o of l.roles)for(const r of o.modules)for(const h of r.views){const d=`${t.id}::${h.id}`;i.has(d)||(i.add(d),s.push({view:h,breadcrumb:[{id:t.id,label:t.label,icon:t.icon},{id:o.id,label:o.label,icon:o.icon},{id:r.id,label:r.label,icon:r.icon}]}))}for(const o of l.units)for(const r of o.modules)for(const h of r.views){const d=`${t.id}::${h.id}`;i.has(d)||(i.add(d),s.push({view:h,breadcrumb:[{id:t.id,label:t.label,icon:t.icon},{id:o.id,label:o.label,icon:o.icon},{id:r.id,label:r.label,icon:r.icon}]}))}}return s}function Cs({data:n,activeRoute:s,onNavigate:i,hiddenIds:l,leftClickBehavior:t="focus-existing"}){const{t:o}=O.Zt(),[r,h]=a.useState(""),d=t==="open-new",c=a.useMemo(()=>ws(n),[n]),m=a.useMemo(()=>{const b=r.trim().toLowerCase();return b?c.filter(x=>l.has(x.view.id)?!1:x.view.label.toLowerCase().includes(b)?!0:x.breadcrumb.some(f=>f.label.toLowerCase().includes(b))):[]},[c,r,l]);return e.jsxs("div",{className:"nice-sidebar-nav__search",children:[e.jsxs("div",{className:"nice-sidebar-nav__search-inputWrap",children:[e.jsx("span",{className:"nice-sidebar-nav__search-icon","aria-hidden":"true",children:e.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),e.jsx("input",{type:"text",className:"nice-sidebar-nav__search-input",placeholder:o("sidebarNav.search.placeholder","Szukaj widoków…"),value:r,onChange:b=>h(b.target.value),autoFocus:!0,"aria-label":o("sidebarNav.search.label","Szukaj widoków")}),r&&e.jsx("button",{type:"button",className:"nice-sidebar-nav__search-clear","aria-label":o("common.clear","Wyczyść"),onClick:()=>h(""),children:e.jsx(Nn,{size:12})})]}),!r.trim()&&e.jsx("p",{className:"nice-sidebar-nav__empty",children:"Wpisz tekst, aby przeszukać wszystkie widoki dostępne w panelu."}),r.trim()&&m.length===0&&e.jsxs("p",{className:"nice-sidebar-nav__empty",children:["Brak wyników dla „",r,'".']}),m.length>0&&e.jsx("ul",{className:"nice-sidebar-nav__search-results",children:m.map((b,x)=>{const f=!!(b.view.route&&b.view.route===s),C=!!b.view.route;return e.jsx("li",{className:["nice-sidebar-nav__search-result",f?"nice-sidebar-nav__search-result--active":""].filter(Boolean).join(" "),children:e.jsxs("button",{type:"button",className:"nice-sidebar-nav__search-result-btn",disabled:!C,onClick:()=>{C&&b.view.route&&i?.(b.view.route,b.view,{forceNew:d})},children:[e.jsx("span",{className:"nice-sidebar-nav__search-result-breadcrumb",children:b.breadcrumb.map((g,v)=>e.jsxs("span",{className:"nice-sidebar-nav__search-crumb",children:[g.icon&&e.jsx("span",{className:"nice-sidebar-nav__search-crumb-icon","aria-hidden":"true",children:Ee(g.icon)}),e.jsx("span",{className:"nice-sidebar-nav__search-crumb-label",children:g.label}),e.jsx("span",{className:"nice-sidebar-nav__search-crumb-sep","aria-hidden":"true",children:"›"})]},`${g.id}-${v}`))}),e.jsxs("span",{className:"nice-sidebar-nav__search-result-view",children:[b.view.icon&&e.jsx("span",{className:"nice-sidebar-nav__node-icon","aria-hidden":"true",children:Ee(b.view.icon)}),e.jsx("span",{className:"nice-sidebar-nav__node-label",children:b.view.label}),b.view.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-nav__node-badge",children:b.view.badge})]})]})},`${b.view.id}-${x}`)})})]})}function Ss({activeRoute:n,onNavigate:s,leftClickBehavior:i="focus-existing"}){const{t:l}=O.Zt(),t=i==="open-new";return e.jsx("ul",{className:"nice-sidebar-nav__prefs-categories",role:"list",children:We.map(o=>{const r=l(o.labelKey,o.labelDefault),h=n===o.route,d={id:o.id,label:r,icon:o.icon,route:o.route};return e.jsx("li",{className:["nice-sidebar-nav__node nice-sidebar-nav__node--leaf",h?"nice-sidebar-nav__node--active":""].filter(Boolean).join(" "),children:e.jsxs("div",{className:"nice-sidebar-nav__node-row",children:[e.jsx("span",{className:"nice-sidebar-nav__collapse-spacer"}),e.jsx(re,{content:r,position:"right",size:"sm",children:e.jsxs("span",{role:"link",tabIndex:0,className:"nice-sidebar-nav__node-content nice-sidebar-nav__node-content--link",onClick:()=>s?.(o.route,d,{forceNew:t}),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),s?.(o.route,d,{forceNew:t}))},children:[e.jsx("span",{className:"nice-sidebar-nav__node-icon","aria-hidden":"true",children:o.icon}),e.jsx("span",{className:"nice-sidebar-nav__node-label",children:r})]})})]})},o.id)})})}const $s=a.forwardRef(function({data:s,userId:i,activeRoute:l,onNavigate:t,enableModeIcons:o,preferences:r,onPreferencesChange:h,width:d=264,collapsedWidth:c=56,position:m="left",minimal:b=!1,showModeStrip:x,showSources:f,showFavorites:C,showFooterPreferences:g,embedded:v=!1,header:M,footerExtra:D,collapsed:y,onCollapsedChange:j,expandableWhenCollapsed:N=!1,size:T="md",className:S,routeToUrl:I,contextMenu:$=!0,disabledContextMenuActions:w,readonly:R=!1,"data-testid":p},u){const _=a.useMemo(()=>{const le=new Set(w??[]);return R&&["hide","reorder","rename","newGroup"].forEach(X=>le.add(X)),le},[w,R]),L=x??!b,V=f??!b,F=C??!b,W=g??!b,[E,ee]=a.useState(!1),B=v?!1:y??E,U=a.useCallback(()=>{const le=!B;j?j(le):ee(le)},[B,j]),[K,H]=vn(i,o,r,h),Z=a.useMemo(()=>{const le=K.activeMode;if(le==="favorites"||le==="preferences"||le==="search")return s;const X=K.pinnedSources[le];return!X||X.length===0?s:s.filter(z=>X.includes(z.source.id))},[s,K.activeMode,K.pinnedSources]),te=K.maxDepth[K.activeMode]??4;function ue(){const le=K.activeMode;if(F&&le==="favorites")return e.jsx(ks,{favorites:K.favorites,activeRoute:l,onNavigate:t,onRemove:H.removeFavorite,collapsed:B,leftClickBehavior:K.leftClickBehavior});if(W&&le==="preferences")return e.jsx(Ss,{activeRoute:l,onNavigate:t,leftClickBehavior:K.leftClickBehavior});if(L&&le==="search"){const X=new Set(K.hiddenItems.map(z=>z.id));return e.jsx(Cs,{data:s,activeRoute:l,onNavigate:t,hiddenIds:X,leftClickBehavior:K.leftClickBehavior})}return Z.length===0?e.jsx("p",{className:"nice-sidebar-nav__empty",children:"Brak widocznych źródeł danych dla tego trybu."}):Z.map(X=>{const z=(K.pinnedSources[le]??[]).includes(X.source.id);return e.jsx(ys,{node:X,mode:le,maxDepth:te,isPinned:z,prefs:K,helpers:H,activeRoute:l,onNavigate:t,sidebarCollapsed:B,expandableWhenCollapsed:N,routeToUrl:I,contextMenu:$,disabledActions:_,showHeader:V},X.source.id)})}const ie=["nice-sidebar-nav",`nice-sidebar-nav--${T}`,`nice-sidebar-nav--${m}`,b?"nice-sidebar-nav--minimal":"",v?"nice-sidebar-nav--embedded":"",K.enableModeIcons&&L?"nice-sidebar-nav--with-strip":"",B?"nice-sidebar-nav--collapsed":"",B&&N?"nice-sidebar-nav--expandable-collapsed":"",S].filter(Boolean).join(" "),P=v?{width:"100%"}:{"--nice-sidebar-w":`${d}px`,"--nice-sidebar-w-collapsed":`${c}px`,width:B?c:d};return e.jsxs("div",{ref:u,className:ie,style:P,"data-testid":p,"data-mode":K.activeMode,children:[M!=null&&e.jsx("div",{className:"nice-sidebar-nav__header",children:M}),K.enableModeIcons&&L&&e.jsx(bs,{enabledModes:K.enabledModes,activeMode:K.activeMode,onSelect:H.setMode,collapsed:B}),e.jsx("div",{className:"nice-sidebar-nav__content",children:e.jsx("div",{className:"nice-sidebar-nav__body",children:ue()})}),!v&&e.jsxs("div",{className:"nice-sidebar-nav__footer",children:[e.jsxs("button",{type:"button",className:"nice-sidebar-nav__footer-toggle",onClick:U,"aria-label":B?"Rozwiń sidebar":"Zwiń do ikon",title:B?"Rozwiń sidebar":"Zwiń do ikon",children:[e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-icon","aria-hidden":"true",children:e.jsx("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 160ms ease",transform:(m==="right"?!B:B)?"rotate(180deg)":"rotate(0deg)"},children:e.jsx("polyline",{points:"15 18 9 12 15 6"})})}),e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-label",children:B?"Rozwiń":"Zwiń do ikon"})]}),D!=null&&e.jsx("div",{className:"nice-sidebar-nav__footer-extra",children:D})]}),v&&D!=null&&e.jsx("div",{className:"nice-sidebar-nav__footer nice-sidebar-nav__footer--embedded",children:e.jsx("div",{className:"nice-sidebar-nav__footer-extra",children:D})})]})}),yn=a.forwardRef(({user:n,userMenuItems:s,onProfile:i,onLogout:l,showLogin:t=!0,loginLabel:o,onLoginClick:r,showRegister:h,registerLabel:d,onRegisterClick:c,size:m="md",compact:b=!1,className:x,style:f,id:C,"data-testid":g="nice-auth-buttons"},v)=>{const{t:M}=O.Zt(),D=["nice-auth-buttons",`nice-auth-buttons--${m}`,b?"nice-auth-buttons--compact":"",x??""].filter(Boolean).join(" ");if(n)return e.jsx("div",{ref:v,id:C,className:D,style:f,"data-testid":g,children:e.jsx(Fe,{userName:n.name,userEmail:n.email,userRole:n.role,avatarUrl:n.avatarUrl,status:n.status,items:s,onProfile:i,onLogout:l,size:m})});const y=h??!!c;return e.jsxs("div",{ref:v,id:C,className:D,style:f,"data-testid":g,children:[t&&r&&e.jsx(J.NiceButton,{variant:"ghost",size:m,onClick:r,className:"nice-auth-buttons__login",children:o??M("auth.signIn","Sign in")}),y&&c&&e.jsx(J.NiceButton,{variant:"primary",size:m,onClick:c,className:"nice-auth-buttons__register",children:d??M("auth.register","Register")})]})});yn.displayName="NiceAuthButtons";function Ve(n){return!n.children||n.children.length===0}function kn(n,s){return s?n.id===s?!0:(n.children??[]).some(i=>kn(i,s)):!1}const wn=a.forwardRef(({items:n,activeId:s,size:i="md",align:l="start",ariaLabel:t,stretch:o=!1,trigger:r="click",hoverCloseDelay:h=150,className:d,style:c,id:m,"data-testid":b="nice-nav-menu"},x)=>{const{t:f}=O.Zt(),C=a.useId(),[g,v]=a.useState(null),M=a.useRef(null),D=a.useRef(null),y=a.useCallback(()=>{D.current&&(clearTimeout(D.current),D.current=null)},[]),j=a.useCallback(()=>{y(),D.current=setTimeout(()=>{v(null),D.current=null},h)},[y,h]);a.useEffect(()=>()=>y(),[y]);const N=r==="hover",T=_=>!!(_.megaPanel||_.megaColumns&&_.megaColumns.length>0),S=a.useCallback(_=>{M.current=_,typeof x=="function"?x(_):x&&(x.current=_)},[x]);a.useEffect(()=>{if(!g)return;const _=L=>{M.current?.contains(L.target)||v(null)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[g]),a.useEffect(()=>{const _=L=>{L.key==="Escape"&&g&&v(null)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[g]);const I=a.useMemo(()=>n.filter(_=>!_.divider),[n]),$=(_,L)=>{const V=!Ve(_),F=T(_),W=V||F,E=g?.itemId===_.id,B=["nice-nav-menu__item",kn(_,s)?"nice-nav-menu__item--active":"",E?"nice-nav-menu__item--open":"",_.disabled?"nice-nav-menu__item--disabled":"",F?"nice-nav-menu__item--mega":""].filter(Boolean).join(" "),U=H=>{if(H.key==="ArrowRight"){H.preventDefault();const Z=I[(L+1)%I.length];M.current?.querySelector(`[data-nice-nav-id="${Z.id}"]`)?.focus()}else if(H.key==="ArrowLeft"){H.preventDefault();const Z=I[(L-1+I.length)%I.length];M.current?.querySelector(`[data-nice-nav-id="${Z.id}"]`)?.focus()}else(H.key==="ArrowDown"||H.key==="Enter"||H.key===" ")&&W&&(H.preventDefault(),v({itemId:_.id,submenuId:null}))},K=e.jsxs(e.Fragment,{children:[_.icon!=null&&e.jsx("span",{className:"nice-nav-menu__item-icon","aria-hidden":"true",children:_.icon}),e.jsx("span",{className:"nice-nav-menu__item-label",children:_.label}),_.badge!=null&&e.jsx("span",{className:"nice-nav-menu__item-badge",children:_.badge}),W&&e.jsx("span",{className:"nice-nav-menu__item-chevron","aria-hidden":"true",children:"▾"})]});return W?e.jsxs("li",{className:`nice-nav-menu__li${F?" nice-nav-menu__li--mega":""}`,onMouseEnter:N?()=>{y(),v({itemId:_.id,submenuId:null})}:void 0,onMouseLeave:N?j:void 0,children:[e.jsx("button",{type:"button",className:B,"data-nice-nav-id":_.id,"aria-haspopup":F?"true":"menu","aria-expanded":E,"aria-controls":`${C}-panel-${_.id}`,disabled:_.disabled,onClick:()=>{v(N?H=>H?.itemId===_.id?null:{itemId:_.id,submenuId:null}:H=>H?.itemId===_.id?null:{itemId:_.id,submenuId:null})},onKeyDown:U,children:K}),E&&(F?w(_):R(_))]},_.id):_.href&&!_.disabled?e.jsx("li",{className:"nice-nav-menu__li",children:e.jsx("a",{href:_.href,target:_.target,rel:_.rel,className:B,"data-nice-nav-id":_.id,onKeyDown:U,onClick:H=>{_.onClick?.(H),v(null)},children:K})},_.id):e.jsx("li",{className:"nice-nav-menu__li",children:e.jsx("button",{type:"button",className:B,"data-nice-nav-id":_.id,disabled:_.disabled,onClick:H=>{_.onClick?.(H),v(null)},onKeyDown:U,children:K})},_.id)},w=_=>{const L=`${C}-panel-${_.id}`,V=typeof _.megaPanel=="function"?_.megaPanel():_.megaPanel;return e.jsx("div",{id:L,role:"menu","aria-label":typeof _.label=="string"?_.label:void 0,className:"nice-nav-menu__mega",onMouseEnter:N?y:void 0,onMouseLeave:N?j:void 0,children:e.jsxs("div",{className:"nice-nav-menu__mega-inner",children:[V??e.jsx("div",{className:"nice-nav-menu__mega-grid",children:(_.megaColumns??[]).map((F,W)=>e.jsxs("div",{className:"nice-nav-menu__mega-col",children:[F.title!=null&&e.jsx("div",{className:"nice-nav-menu__mega-col-title",children:F.title}),e.jsx("ul",{className:"nice-nav-menu__mega-col-list",children:F.items.map(E=>e.jsx("li",{className:"nice-nav-menu__mega-col-li",children:E.href?e.jsxs("a",{role:"menuitem",className:"nice-nav-menu__mega-col-item",href:E.href,target:E.target,rel:E.rel,onClick:ee=>{E.onClick?.(ee),v(null)},children:[E.icon!=null&&e.jsx("span",{className:"nice-nav-menu__mega-col-item-icon","aria-hidden":"true",children:E.icon}),e.jsxs("span",{className:"nice-nav-menu__mega-col-item-text",children:[e.jsx("span",{className:"nice-nav-menu__mega-col-item-label",children:E.label}),E.description&&e.jsx("span",{className:"nice-nav-menu__mega-col-item-desc",children:E.description})]})]}):e.jsxs("button",{type:"button",role:"menuitem",className:"nice-nav-menu__mega-col-item",disabled:E.disabled,onClick:ee=>{E.onClick?.(ee),v(null)},children:[E.icon!=null&&e.jsx("span",{className:"nice-nav-menu__mega-col-item-icon","aria-hidden":"true",children:E.icon}),e.jsxs("span",{className:"nice-nav-menu__mega-col-item-text",children:[e.jsx("span",{className:"nice-nav-menu__mega-col-item-label",children:E.label}),E.description&&e.jsx("span",{className:"nice-nav-menu__mega-col-item-desc",children:E.description})]})]})},E.id))}),F.footer!=null&&e.jsx("div",{className:"nice-nav-menu__mega-col-footer",children:F.footer})]},W))}),_.megaFooter!=null&&e.jsx("div",{className:"nice-nav-menu__mega-footer",children:_.megaFooter})]})})},R=_=>{const L=_.children??[],V=`${C}-panel-${_.id}`,F=l==="end"?"nice-nav-menu__panel--end":"nice-nav-menu__panel--start";return e.jsx("div",{id:V,role:"menu","aria-label":typeof _.label=="string"?_.label:void 0,className:`nice-nav-menu__panel ${F}`,children:e.jsx("ul",{className:"nice-nav-menu__panel-list",children:L.map((W,E)=>p(_.id,W,E,L))})})},p=(_,L,V,F)=>{if(L.divider)return e.jsx("li",{className:"nice-nav-menu__panel-divider",role:"separator"},`div-${V}`);const W=!Ve(L),E=g?.itemId===_&&g.submenuId===L.id,ee=["nice-nav-menu__panel-item",L.disabled?"nice-nav-menu__panel-item--disabled":"",L.danger?"nice-nav-menu__panel-item--danger":"",E?"nice-nav-menu__panel-item--open":"",L.id===s?"nice-nav-menu__panel-item--active":""].filter(Boolean).join(" "),B=Z=>{const te=F.filter(P=>!P.divider&&!P.disabled),ue=te.findIndex(P=>P.id===L.id);if(ue===-1)return;const ie=te[(ue+Z+te.length)%te.length];M.current?.querySelector(`[data-nice-panel-id="${_}-${ie.id}"]`)?.focus()},U=Z=>{Z.key==="ArrowDown"?(Z.preventDefault(),B(1)):Z.key==="ArrowUp"?(Z.preventDefault(),B(-1)):Z.key==="ArrowRight"&&W?(Z.preventDefault(),v({itemId:_,submenuId:L.id})):Z.key==="ArrowLeft"&&(Z.preventDefault(),g?.submenuId?v({itemId:_,submenuId:null}):(v(null),M.current?.querySelector(`[data-nice-nav-id="${_}"]`)?.focus()))},K=e.jsxs(e.Fragment,{children:[L.icon!=null&&e.jsx("span",{className:"nice-nav-menu__panel-item-icon","aria-hidden":"true",children:L.icon}),e.jsxs("span",{className:"nice-nav-menu__panel-item-text",children:[e.jsx("span",{className:"nice-nav-menu__panel-item-label",children:L.label}),L.description&&e.jsx("span",{className:"nice-nav-menu__panel-item-desc",children:L.description})]}),L.badge!=null&&e.jsx("span",{className:"nice-nav-menu__panel-item-badge",children:L.badge}),W&&e.jsx("span",{className:"nice-nav-menu__panel-item-chevron","aria-hidden":"true",children:"▸"})]}),H=W?e.jsx("button",{type:"button",role:"menuitem",className:ee,"data-nice-panel-id":`${_}-${L.id}`,"aria-haspopup":"menu","aria-expanded":E,disabled:L.disabled,onClick:()=>v(Z=>Z?.itemId===_&&Z.submenuId===L.id?{itemId:_,submenuId:null}:{itemId:_,submenuId:L.id}),onMouseEnter:()=>v({itemId:_,submenuId:L.id}),onKeyDown:U,children:K}):L.href&&!L.disabled?e.jsx("a",{role:"menuitem",className:ee,"data-nice-panel-id":`${_}-${L.id}`,href:L.href,target:L.target,rel:L.rel,onMouseEnter:()=>v({itemId:_,submenuId:null}),onClick:Z=>{L.onClick?.(Z),v(null)},onKeyDown:U,children:K}):e.jsx("button",{type:"button",role:"menuitem",className:ee,"data-nice-panel-id":`${_}-${L.id}`,disabled:L.disabled,onMouseEnter:()=>v({itemId:_,submenuId:null}),onClick:Z=>{L.onClick?.(Z),v(null)},onKeyDown:U,children:K});return e.jsxs("li",{className:"nice-nav-menu__panel-li",children:[H,W&&E&&u(_,L)]},L.id)},u=(_,L)=>{const V=L.children??[];return e.jsxs("div",{role:"menu","aria-label":typeof L.label=="string"?L.label:void 0,className:"nice-nav-menu__subpanel",children:[e.jsx("ul",{className:"nice-nav-menu__panel-list",children:V.map((F,W)=>{if(F.divider)return e.jsx("li",{className:"nice-nav-menu__panel-divider",role:"separator"},`subdiv-${W}`);const E=["nice-nav-menu__panel-item",F.disabled?"nice-nav-menu__panel-item--disabled":"",F.danger?"nice-nav-menu__panel-item--danger":"",F.id===s?"nice-nav-menu__panel-item--active":""].filter(Boolean).join(" "),ee=e.jsxs(e.Fragment,{children:[F.icon!=null&&e.jsx("span",{className:"nice-nav-menu__panel-item-icon","aria-hidden":"true",children:F.icon}),e.jsxs("span",{className:"nice-nav-menu__panel-item-text",children:[e.jsx("span",{className:"nice-nav-menu__panel-item-label",children:F.label}),F.description&&e.jsx("span",{className:"nice-nav-menu__panel-item-desc",children:F.description})]}),F.badge!=null&&e.jsx("span",{className:"nice-nav-menu__panel-item-badge",children:F.badge})]});return e.jsx("li",{className:"nice-nav-menu__panel-li",children:F.href&&!F.disabled?e.jsx("a",{role:"menuitem",className:E,href:F.href,target:F.target,rel:F.rel,onClick:B=>{F.onClick?.(B),v(null)},children:ee}):e.jsx("button",{type:"button",role:"menuitem",className:E,disabled:F.disabled,onClick:B=>{F.onClick?.(B),v(null)},children:ee})},F.id)})}),e.jsx("span",{hidden:!0,"data-parent-id":_})]})};return e.jsx("nav",{ref:S,id:m,className:["nice-nav-menu",`nice-nav-menu--${i}`,o?"nice-nav-menu--stretch":"",d??""].filter(Boolean).join(" "),style:c,"aria-label":t??f("nav.primary","Primary navigation"),"data-testid":b,children:e.jsx("ul",{className:"nice-nav-menu__list",children:I.map($)})})});wn.displayName="NiceNavMenu";const Cn=a.forwardRef(({tabs:n,activeIndex:s,renderTab:i,onActiveChange:l,onCloseTab:t,onReorderTabs:o,onSaveState:r,enableShortcuts:h=!0,maxTabs:d=0,showDirtyIndicator:c=!0,tabBarPosition:m="top",draggable:b=!0,showAddButton:x=!1,onAddTab:f,keepAlive:C=!0,warnOnUnsavedClose:g=!0,maxClosedTabs:v=10,onUndoCloseTab:M,getTabState:D,unsavedWarningMessage:y,className:j,style:N,id:T,accessMode:S,...I},$)=>{const w=O._s(T),R=O.sc(S,T),{t:p}=O.Zt(),u=a.useRef(null),[_,L]=a.useState(null),[V,F]=a.useState(null),[W,E]=a.useState([]),[ee,B]=a.useState(null),U=a.useCallback((z,Y,ae=!1)=>{if(!ae&&g&&z.isDirty){B({tab:z,index:Y});return}const ce={tab:{...z},originalIndex:Y,closedAt:Date.now(),state:D?.(z)};E(pe=>[ce,...pe].slice(0,v)),t?.(z,Y)},[g,v,D,t]),K=a.useCallback(()=>{if(W.length===0)return;const[z,...Y]=W;E(Y),M?.(z)},[W,M]);a.useEffect(()=>{if(!h)return;const z=Y=>{const ae=Y.ctrlKey||Y.metaKey;if(ae&&Y.key==="w"){Y.preventDefault();const ce=n[s];ce&&ce.closable!==!1&&U(ce,s)}else if(ae&&Y.key==="Tab"){Y.preventDefault();const ce=Y.shiftKey?-1:1,pe=(s+ce+n.length)%n.length;l?.(pe)}else ae&&Y.shiftKey&&(Y.key==="t"||Y.key==="T")&&(Y.preventDefault(),K())};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[h,n,s,U,K,l]),a.useEffect(()=>{if(!r)return;const z=setTimeout(()=>{r({tabs:n,activeTabIndex:s})},500);return()=>clearTimeout(z)},[n,s,r]);const H=a.useCallback(z=>{b&&F(z)},[b]),Z=a.useCallback((z,Y)=>{z.preventDefault()},[V]),te=a.useCallback(z=>{if(V===null||V===z)return;const Y=[...n],[ae]=Y.splice(V,1);Y.splice(z,0,ae),o?.(Y),F(null);let ce=s;s===V?ce=z:V<s&&z>=s?ce--:V>s&&z<=s&&ce++,ce!==s&&l?.(ce)},[V,n,s,o,l]),ue=a.useCallback((z,Y)=>{z.preventDefault(),L({tabIndex:Y,x:z.clientX,y:z.clientY})},[]),ie=a.useCallback(()=>L(null),[]),P=a.useMemo(()=>{if(!_)return[];const z=n[_.tabIndex];return[{label:p("wm.close","Close"),action:()=>{U(z,_.tabIndex),ie()},disabled:z.closable===!1},{label:p("wm.closeAll","Close all"),action:()=>{n.forEach((Y,ae)=>Y.closable!==!1&&U(Y,ae)),ie()}},{label:p("wm.closeOthers","Close others"),action:()=>{n.forEach((Y,ae)=>ae!==_.tabIndex&&Y.closable!==!1&&U(Y,ae)),ie()}},{label:p("controls.pin","Pin"),action:()=>ie()},{type:"divider"},{label:p("wm.reopenClosed","Reopen closed tab"),action:()=>{K(),ie()},disabled:W.length===0,shortcut:"Ctrl+Shift+T"}]},[_,n,p,U,K,W.length,ie]);if(a.useEffect(()=>{if(!_)return;const z=()=>ie();return window.addEventListener("click",z),()=>window.removeEventListener("click",z)},[_,ie]),R==="hidden")return null;const le=e.jsxs("div",{className:`nice-mdi__tab-bar nice-mdi__tab-bar--${m}`,role:"tablist",children:[n.map((z,Y)=>e.jsxs("div",{className:`nice-mdi__tab ${Y===s?"nice-mdi__tab--active":""} ${z.isPinned?"nice-mdi__tab--pinned":""}`,role:"tab","aria-selected":Y===s,onClick:()=>l?.(Y),onContextMenu:ae=>ue(ae,Y),draggable:b,onDragStart:()=>H(Y),onDragOver:ae=>Z(ae,Y),onDrop:()=>te(Y),children:[z.icon&&e.jsx("span",{className:"nice-mdi__tab-icon",children:z.icon}),e.jsx("span",{className:"nice-mdi__tab-title",children:z.title}),c&&z.isDirty&&e.jsx("span",{className:"nice-mdi__tab-dirty",title:p("wm.unsaved","Unsaved changes"),children:"●"}),z.closable!==!1&&!z.isPinned&&e.jsx("button",{className:"nice-mdi__tab-close",onClick:ae=>{ae.stopPropagation(),U(z,Y)},"aria-label":p("wm.close","Close"),type:"button",children:"×"})]},z.id)),x&&e.jsx("button",{className:"nice-mdi__tab-add",onClick:f,"aria-label":p("controls.new","New"),type:"button",children:"+"})]}),X=C?e.jsx("div",{className:"nice-mdi__content",children:n.map((z,Y)=>e.jsx("div",{className:"nice-mdi__panel",role:"tabpanel",style:{display:Y===s?"block":"none"},children:i(z,Y)},z.id))}):e.jsx("div",{className:"nice-mdi__content",children:n[s]&&e.jsx("div",{className:"nice-mdi__panel",role:"tabpanel",children:i(n[s],s)})});return e.jsxs("div",{ref:z=>{u.current=z,typeof $=="function"?$(z):$&&($.current=z)},id:w,className:`nice-mdi ${j??""}`,style:N,...I,children:[m==="top"&&le,X,m==="bottom"&&le,_&&e.jsx("div",{className:"nice-mdi__ctx-menu",style:{position:"fixed",left:_.x,top:_.y,zIndex:9999},children:P.map((z,Y)=>"type"in z&&z.type==="divider"?e.jsx("div",{className:"nice-mdi__ctx-divider"},Y):e.jsxs("button",{className:"nice-mdi__ctx-item",onClick:z.action,disabled:z.disabled,type:"button",children:[e.jsx("span",{className:"nice-mdi__ctx-label",children:z.label}),"shortcut"in z&&z.shortcut&&e.jsx("span",{className:"nice-mdi__ctx-shortcut",children:z.shortcut})]},Y))}),ee&&e.jsx("div",{className:"nice-mdi__modal-backdrop",onClick:()=>B(null),children:e.jsxs("div",{className:"nice-mdi__modal",onClick:z=>z.stopPropagation(),children:[e.jsx("div",{className:"nice-mdi__modal-icon",children:"⚠️"}),e.jsx("h3",{className:"nice-mdi__modal-title",children:p("wm.unsavedTitle","Unsaved Changes")}),e.jsx("p",{className:"nice-mdi__modal-message",children:y??p("wm.unsavedMessage",`"${ee.tab.title}" has unsaved changes. Do you want to close it anyway?`)}),e.jsxs("div",{className:"nice-mdi__modal-actions",children:[e.jsx("button",{type:"button",className:"nice-mdi__modal-btn nice-mdi__modal-btn--secondary",onClick:()=>B(null),children:p("controls.cancel","Cancel")}),e.jsx("button",{type:"button",className:"nice-mdi__modal-btn nice-mdi__modal-btn--danger",onClick:()=>{U(ee.tab,ee.index,!0),B(null)},children:p("wm.closeAnyway","Close Anyway")})]})]})})]})});Cn.displayName="NiceMdiWorkspace";const Sn=a.forwardRef(({menu:n,activeRoute:s,toolbar:i,statusBar:l,sidebarHeader:t,sidebarFooter:o,onNavigate:r,children:h,className:d,style:c,id:m,accessMode:b,...x},f)=>{const C=O._s(m),g=O.sc(b,m),{t:v}=O.Zt(),[M,D]=a.useState(!1);return g==="hidden"?null:e.jsxs("div",{ref:f,id:C,className:`nice-shell nice-shell--classic ${M?"nice-shell--sidebar-collapsed":""} ${d??""}`,style:c,...x,children:[e.jsxs("aside",{className:"nice-shell__sidebar",children:[t&&e.jsx("div",{className:"nice-shell__sidebar-header",children:t}),e.jsx("button",{className:"nice-shell__sidebar-toggle",onClick:()=>D(y=>!y),type:"button","aria-label":M?v("expand","Expand"):v("collapse","Collapse"),children:M?"▸":"◂"}),n&&!M&&e.jsx("nav",{className:"nice-shell__nav",role:"navigation",children:n.modules.filter(y=>y.isAvailable).sort((y,j)=>y.order-j.order).map(y=>e.jsxs("div",{className:"nice-shell__nav-group",children:[e.jsxs("div",{className:"nice-shell__nav-group-label",children:[y.icon&&e.jsx("span",{children:y.icon}),e.jsx("span",{children:y.label})]}),e.jsx("ul",{children:y.entities.map(j=>e.jsx("li",{children:e.jsx("button",{className:`nice-shell__nav-item ${s===j.route?"nice-shell__nav-item--active":""}`,onClick:()=>r?.(j.route),type:"button",children:j.label})},j.id))})]},y.id))}),o&&e.jsx("div",{className:"nice-shell__sidebar-footer",children:o})]}),e.jsxs("div",{className:"nice-shell__main",children:[i&&e.jsx("header",{className:"nice-shell__toolbar",children:i}),e.jsx("main",{className:"nice-shell__content",children:h}),l&&e.jsx("footer",{className:"nice-shell__status-bar",children:l})]})]})});Sn.displayName="NiceClassicShell";const $n=a.forwardRef(({topBar:n,sidePanel:s,sidePanelPosition:i="left",sidePanelWidth:l=280,children:t,className:o,style:r,id:h,accessMode:d,...c},m)=>{const b=O._s(h);return O.sc(d,h)==="hidden"?null:e.jsxs("div",{ref:m,id:b,className:`nice-shell nice-shell--dashboard ${o??""}`,style:r,...c,children:[n&&e.jsx("header",{className:"nice-shell__top-bar",children:n}),e.jsxs("div",{className:`nice-shell__dashboard-body nice-shell__dashboard-body--panel-${i}`,children:[s&&e.jsx("aside",{className:"nice-shell__side-panel",style:{width:l},children:s}),e.jsx("main",{className:"nice-shell__dashboard-content",children:t})]})]})});$n.displayName="NiceDashboardShell";const zn=a.forwardRef(({topBar:n,bottomNav:s,children:i,className:l,style:t,id:o,accessMode:r,...h},d)=>{const c=O._s(o);return O.sc(r,o)==="hidden"?null:e.jsxs("div",{ref:d,id:c,className:`nice-shell nice-shell--compact ${l??""}`,style:t,...h,children:[n&&e.jsx("header",{className:"nice-shell__compact-top",children:n}),e.jsx("main",{className:"nice-shell__compact-content",children:i}),s&&e.jsx("footer",{className:"nice-shell__compact-bottom",children:s})]})});zn.displayName="NiceCompactShell";const Mn=a.forwardRef(({overlay:n,lockScreen:s,locked:i=!1,children:l,className:t,style:o,id:r,accessMode:h,...d},c)=>{const m=O._s(r);return O.sc(h,r)==="hidden"?null:e.jsx("div",{ref:c,id:m,className:`nice-shell nice-shell--kiosk ${t??""}`,style:{...o,position:"fixed",inset:0},...d,children:i&&s?e.jsx("div",{className:"nice-shell__kiosk-lock",children:s}):e.jsxs(e.Fragment,{children:[e.jsx("main",{className:"nice-shell__kiosk-content",children:l}),n&&e.jsx("div",{className:"nice-shell__kiosk-overlay",children:n})]})})});Mn.displayName="NiceKioskShell";const En=a.forwardRef(({menu:n,activeRoute:s,tenant:i,topBarActions:l,globalSearch:t,footer:o,onNavigate:r,children:h,className:d,style:c,id:m,accessMode:b,...x},f)=>{const C=O._s(m);return O.sc(b,m)==="hidden"?null:e.jsxs("div",{ref:f,id:C,className:`nice-shell nice-shell--modern ${d??""}`,style:c,...x,children:[e.jsx("aside",{className:"nice-shell__modern-rail",role:"navigation",children:n?.modules.filter(v=>v.isAvailable).sort((v,M)=>v.order-M.order).map(v=>e.jsx("button",{type:"button",title:v.label,className:"nice-shell__modern-rail-item",onClick:()=>v.entities[0]&&r?.(v.entities[0].route),children:e.jsx("span",{"aria-hidden":!0,children:v.icon??"◦"})},v.id))}),e.jsxs("div",{className:"nice-shell__modern-main",children:[e.jsxs("header",{className:"nice-shell__modern-topbar",children:[i&&e.jsxs("div",{className:"nice-shell__modern-tenant",style:i.primaryColor?{borderColor:i.primaryColor}:void 0,children:[i.logoUrl&&e.jsx("img",{src:i.logoUrl,alt:""}),e.jsx("span",{children:i.shortName??i.name}),i.plan&&e.jsx("small",{children:i.plan})]}),t&&e.jsx("div",{className:"nice-shell__modern-search",children:t}),l&&e.jsx("div",{className:"nice-shell__modern-actions",children:l})]}),e.jsx("main",{className:"nice-shell__modern-content","data-active-route":s,children:h}),o&&e.jsx("footer",{className:"nice-shell__modern-footer",children:o})]})]})});En.displayName="NiceModernShell";const Dn=a.forwardRef(({header:n,tenant:s,maxWidth:i=960,centered:l=!0,children:t,className:o,style:r,id:h,accessMode:d,...c},m)=>{const b=O._s(h);return O.sc(d,h)==="hidden"?null:e.jsxs("div",{ref:m,id:b,className:`nice-shell nice-shell--minimal ${l?"nice-shell--minimal-centered":""} ${o??""}`,style:r,...c,children:[(n||s)&&e.jsxs("header",{className:"nice-shell__minimal-header",children:[s&&e.jsxs("div",{className:"nice-shell__minimal-tenant",children:[s.logoUrl&&e.jsx("img",{src:s.logoUrl,alt:""}),e.jsx("span",{children:s.name})]}),n]}),e.jsx("main",{className:"nice-shell__minimal-content",style:{maxWidth:i,marginInline:l?"auto":void 0},children:t})]})});Dn.displayName="NiceMinimalShell";const In=a.forwardRef(({menu:n,activeRoute:s,tenant:i,toolbar:l,inspector:t,inspectorOpen:o=!0,statusBar:r,onNavigate:h,children:d,className:c,style:m,id:b,accessMode:x,...f},C)=>{const g=O._s(b),v=O.sc(x,b),[M,D]=a.useState(o);return v==="hidden"?null:e.jsxs("div",{ref:C,id:g,className:`nice-shell nice-shell--hybrid ${c??""}`,style:m,...f,children:[e.jsxs("header",{className:"nice-shell__hybrid-topbar",children:[i&&e.jsxs("div",{className:"nice-shell__hybrid-tenant",children:[i.logoUrl&&e.jsx("img",{src:i.logoUrl,alt:""}),e.jsx("span",{children:i.name})]}),l,t&&e.jsx("button",{type:"button",className:"nice-shell__hybrid-inspector-toggle",onClick:()=>D(y=>!y),"aria-pressed":M,children:"⚙"})]}),e.jsxs("div",{className:"nice-shell__hybrid-body",children:[e.jsx("aside",{className:"nice-shell__hybrid-sidebar",role:"navigation",children:n?.modules.filter(y=>y.isAvailable).sort((y,j)=>y.order-j.order).map(y=>e.jsxs("div",{className:"nice-shell__hybrid-nav-group",children:[e.jsx("div",{className:"nice-shell__hybrid-nav-group-label",children:y.label}),e.jsx("ul",{children:y.entities.map(j=>e.jsx("li",{children:e.jsx("button",{type:"button",className:`nice-shell__hybrid-nav-item ${s===j.route?"nice-shell__hybrid-nav-item--active":""}`,onClick:()=>h?.(j.route),children:j.label})},j.id))})]},y.id))}),e.jsx("main",{className:"nice-shell__hybrid-content",children:d}),t&&M&&e.jsx("aside",{className:"nice-shell__hybrid-inspector",children:t})]}),r&&e.jsx("footer",{className:"nice-shell__hybrid-status",children:r})]})});In.displayName="NiceHybridShell";const Ln=a.forwardRef(({appTitle:n,tenant:s,topBarActions:i,tabs:l=[],activeTabId:t,onTabChange:o,fab:r,children:h,className:d,style:c,id:m,accessMode:b,...x},f)=>{const C=O._s(m);return O.sc(b,m)==="hidden"?null:e.jsxs("div",{ref:f,id:C,className:`nice-shell nice-shell--pwa ${d??""}`,style:c,...x,children:[e.jsxs("header",{className:"nice-shell__pwa-topbar",children:[e.jsxs("div",{className:"nice-shell__pwa-title",children:[s?.logoUrl&&e.jsx("img",{src:s.logoUrl,alt:""}),e.jsx("span",{children:s?.name??n??""})]}),i&&e.jsx("div",{className:"nice-shell__pwa-actions",children:i})]}),e.jsx("main",{className:"nice-shell__pwa-content",children:h}),r&&e.jsx("div",{className:"nice-shell__pwa-fab",children:r}),l.length>0&&e.jsx("nav",{className:"nice-shell__pwa-tabs",role:"tablist",children:l.map(v=>e.jsxs("button",{type:"button",role:"tab","aria-selected":t===v.id,className:`nice-shell__pwa-tab ${t===v.id?"nice-shell__pwa-tab--active":""}`,onClick:()=>o?.(v.id,v.route),children:[v.icon&&e.jsx("span",{"aria-hidden":!0,children:v.icon}),e.jsx("span",{children:v.label})]},v.id))})]})});Ln.displayName="NicePwaShell";const Tn=a.forwardRef(({modes:n,activeMode:s,onModeChange:i,variant:l="dropdown",gridColumns:t=3,showDescription:o=!0,showColorIndicator:r=!0,compact:h=!1,size:d="md",className:c,style:m,id:b,accessMode:x,...f},C)=>{const g=O._s(b),v=O.sc(x,b),{t:M}=O.Zt(),[D,y]=a.useState(!1),j=a.useRef(null),N=n.find(S=>S.key===s);a.useEffect(()=>{if(!D)return;const S=I=>{j.current&&!j.current.contains(I.target)&&y(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[D]);const T=a.useCallback(S=>{i?.(S),y(!1)},[i]);return v==="hidden"?null:l==="dropdown"?e.jsxs("div",{ref:S=>{j.current=S,typeof C=="function"?C(S):C&&(C.current=S)},id:g,className:`nice-mode-selector nice-mode-selector--dropdown nice-mode-selector--${d} ${c??""}`,style:m,...f,children:[e.jsxs("button",{className:"nice-mode-selector__trigger",onClick:()=>y(S=>!S),"aria-expanded":D,"aria-haspopup":"listbox",type:"button",children:[r&&N?.color&&e.jsx("span",{className:"nice-mode-selector__color",style:{backgroundColor:N.color}}),N?.icon&&e.jsx("span",{className:"nice-mode-selector__icon",children:N.icon}),e.jsx("span",{className:"nice-mode-selector__label",children:N?.displayName??s}),e.jsx("span",{className:"nice-mode-selector__chevron",children:D?"▴":"▾"})]}),D&&e.jsx("ul",{className:"nice-mode-selector__menu",role:"listbox",children:n.map(S=>e.jsxs("li",{className:`nice-mode-selector__option ${S.key===s?"nice-mode-selector__option--active":""}`,role:"option","aria-selected":S.key===s,onClick:()=>T(S),children:[r&&S.color&&e.jsx("span",{className:"nice-mode-selector__color",style:{backgroundColor:S.color}}),S.icon&&e.jsx("span",{className:"nice-mode-selector__icon",children:S.icon}),e.jsxs("div",{children:[e.jsx("div",{className:"nice-mode-selector__name",children:S.displayName}),o&&S.description&&e.jsx("div",{className:"nice-mode-selector__desc",children:S.description})]})]},S.key))})]}):l==="pills"?e.jsx("div",{ref:C,id:g,className:`nice-mode-selector nice-mode-selector--pills ${c??""}`,style:m,role:"radiogroup",...f,children:n.map(S=>e.jsxs("button",{className:`nice-mode-selector__pill ${S.key===s?"nice-mode-selector__pill--active":""}`,style:r&&S.color?{borderColor:S.color}:void 0,onClick:()=>T(S),role:"radio","aria-checked":S.key===s,type:"button",children:[S.icon&&e.jsx("span",{children:S.icon}),e.jsx("span",{children:S.displayName})]},S.key))}):e.jsx("div",{ref:C,id:g,className:`nice-mode-selector nice-mode-selector--card-grid ${c??""}`,style:{...m,gridTemplateColumns:`repeat(${t}, 1fr)`},role:"radiogroup",...f,children:n.map(S=>e.jsxs("button",{className:`nice-mode-selector__card ${S.key===s?"nice-mode-selector__card--active":""} ${h?"nice-mode-selector__card--compact":""}`,onClick:()=>T(S),role:"radio","aria-checked":S.key===s,type:"button",children:[r&&S.color&&e.jsx("div",{className:"nice-mode-selector__card-stripe",style:{backgroundColor:S.color}}),S.icon&&e.jsx("div",{className:"nice-mode-selector__card-icon",children:S.icon}),e.jsx("div",{className:"nice-mode-selector__card-name",children:S.displayName}),o&&S.description&&!h&&e.jsx("div",{className:"nice-mode-selector__card-desc",children:S.description}),S.sourcePackage&&!h&&e.jsx("div",{className:"nice-mode-selector__card-pkg",children:S.sourcePackage})]},S.key))})});Tn.displayName="NiceModeSelector";function zs(n){const s=new Map;for(const i of n.sort((l,t)=>l.orderIndex-t.orderIndex))s.has(i.category)||s.set(i.category,[]),s.get(i.category).push(i);return Array.from(s,([i,l])=>({category:i,items:l}))}const Ms=({question:n,value:s,onChange:i})=>{switch(n.questionType){case"boolean":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--boolean",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsxs("div",{className:"nice-onboarding__boolean-group",children:[e.jsx("button",{className:`nice-onboarding__bool-btn ${s==="true"?"nice-onboarding__bool-btn--active":""}`,onClick:()=>i("true"),type:"button",children:"✓"}),e.jsx("button",{className:`nice-onboarding__bool-btn ${s==="false"?"nice-onboarding__bool-btn--active":""}`,onClick:()=>i("false"),type:"button",children:"✗"})]})]});case"select":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--select",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("div",{className:"nice-onboarding__options",children:n.options?.map(l=>e.jsx("button",{className:`nice-onboarding__option ${s===l?"nice-onboarding__option--selected":""}`,onClick:()=>i(l),type:"button",children:l},l))})]});case"multiSelect":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--multi",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("div",{className:"nice-onboarding__options",children:n.options?.map(l=>{const t=s.split(",").filter(Boolean),o=t.includes(l);return e.jsx("button",{className:`nice-onboarding__option ${o?"nice-onboarding__option--selected":""}`,onClick:()=>{const r=o?t.filter(h=>h!==l):[...t,l];i(r.join(","))},type:"button",children:l},l)})})]});case"number":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--number",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("input",{type:"number",className:"nice-onboarding__input",value:s,onChange:l=>i(l.target.value)})]});case"date":return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--date",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("input",{type:"date",className:"nice-onboarding__input",value:s,onChange:l=>i(l.target.value)})]});default:return e.jsxs("div",{className:"nice-onboarding__field nice-onboarding__field--text",children:[e.jsxs("label",{className:"nice-onboarding__label",children:[n.question,n.isRequired&&e.jsx("span",{className:"nice-onboarding__required",children:"*"})]}),n.helpText&&e.jsx("p",{className:"nice-onboarding__help",children:n.helpText}),e.jsx("input",{type:"text",className:"nice-onboarding__input",value:s,onChange:l=>i(l.target.value),placeholder:n.defaultValue})]})}},Rn=a.forwardRef(({questions:n,initialAnswers:s=[],stepLabels:i,onComplete:l,onCancel:t,onStepChange:o,welcomeContent:r,completionContent:h,showProgress:d=!0,allowBack:c=!0,logo:m,size:b="md",className:x,style:f,id:C,accessMode:g,...v},M)=>{const D=O._s(C),y=O.sc(g,C),{t:j}=O.Zt(),N=a.useMemo(()=>zs(n),[n]),T=!!r,S=!!h,I=T?-1:0,$=S?N.length:N.length-1,[w,R]=a.useState(I),[p,u]=a.useState(()=>{const B=new Map;for(const U of s)B.set(U.questionId,U.answer);for(const U of n)!B.has(U.id)&&U.defaultValue&&B.set(U.id,U.defaultValue);return B}),_=a.useCallback((B,U)=>{u(K=>{const H=new Map(K);return H.set(B,U),H})},[]),L=a.useMemo(()=>w<0||w>=N.length?!0:N[w].items.every(U=>!U.isRequired||(p.get(U.id)??"").trim().length>0),[w,N,p]),V=a.useCallback(()=>{if(w>=$){const U=[];p.forEach((K,H)=>U.push({questionId:H,answer:K})),l?.(U);return}const B=w+1;R(B),o?.(B)},[w,$,p,l,o]),F=a.useCallback(()=>{if(w<=I)return;const B=w-1;R(B),o?.(B)},[w,I,o]),W=N.length+(T?1:0)+(S?1:0),E=w-I,ee=Math.round(E/Math.max(W-1,1)*100);return y==="hidden"?null:e.jsxs("div",{ref:M,id:D,className:`nice-onboarding nice-onboarding--${b} ${x??""}`,style:f,...v,children:[e.jsxs("div",{className:"nice-onboarding__header",children:[m&&e.jsx("div",{className:"nice-onboarding__logo",children:m}),d&&e.jsx("div",{className:"nice-onboarding__progress",children:e.jsx("div",{className:"nice-onboarding__progress-bar",style:{width:`${ee}%`}})}),e.jsx("div",{className:"nice-onboarding__steps",children:N.map((B,U)=>e.jsxs("div",{className:`nice-onboarding__step-dot ${U===w?"nice-onboarding__step-dot--active":""} ${U<w?"nice-onboarding__step-dot--done":""}`,children:[e.jsx("span",{children:U+1}),e.jsx("span",{className:"nice-onboarding__step-label",children:i?.[U]??B.category})]},U))})]}),e.jsxs("div",{className:"nice-onboarding__body",children:[w===-1&&r,w>=0&&w<N.length&&e.jsxs("div",{className:"nice-onboarding__questions",children:[e.jsx("h2",{className:"nice-onboarding__category",children:N[w].category}),N[w].items.map(B=>e.jsx(Ms,{question:B,value:p.get(B.id)??"",onChange:U=>_(B.id,U)},B.id))]}),w===N.length&&h]}),e.jsxs("div",{className:"nice-onboarding__footer",children:[t&&e.jsx("button",{className:"nice-onboarding__btn nice-onboarding__btn--cancel",onClick:t,type:"button",children:j("cancel","Cancel")}),e.jsxs("div",{className:"nice-onboarding__footer-right",children:[c&&w>I&&e.jsx("button",{className:"nice-onboarding__btn nice-onboarding__btn--back",onClick:F,type:"button",children:j("back","Back")}),e.jsx("button",{className:"nice-onboarding__btn nice-onboarding__btn--next",onClick:V,disabled:!L,type:"button",children:w>=$?j("finish","Finish"):j("next","Next")})]})]})]})});Rn.displayName="NiceOnboardingWizard";const Es=[{key:"Mon",label:"Monday"},{key:"Tue",label:"Tuesday"},{key:"Wed",label:"Wednesday"},{key:"Thu",label:"Thursday"},{key:"Fri",label:"Friday"},{key:"Sat",label:"Saturday"},{key:"Sun",label:"Sunday"}],Ds=[{value:"YYYY-MM-DD",label:"YYYY-MM-DD"},{value:"DD/MM/YYYY",label:"DD/MM/YYYY"},{value:"MM/DD/YYYY",label:"MM/DD/YYYY"},{value:"DD.MM.YYYY",label:"DD.MM.YYYY"}],Ze=["basic","contact","address","branding","localization","fiscal","preferences"],we=({title:n,expanded:s,onToggle:i})=>e.jsxs("button",{className:`nice-org-form__section-header ${s?"nice-org-form__section-header--expanded":""}`,onClick:i,type:"button","aria-expanded":s,children:[e.jsx("span",{className:"nice-org-form__section-title",children:n}),e.jsx("span",{className:"nice-org-form__section-chevron",children:s?"▾":"▸"})]}),On=a.forwardRef(({profile:n,onChange:s,onSave:i,onCancel:l,sections:t,expandedSections:o,showActions:r=!0,countryOptions:h,languageOptions:d,currencyOptions:c,timezoneOptions:m,saving:b=!1,className:x,style:f,id:C,accessMode:g,...v},M)=>{const D=O._s(C),y=O.sc(g,C),{t:j}=O.Zt(),N=a.useMemo(()=>t&&t.length>0?t:Ze,[t]),[T,S]=a.useState(()=>new Set(o??Ze)),I=a.useCallback(u=>{S(_=>{const L=new Set(_);return L.has(u)?L.delete(u):L.add(u),L})},[]),$=y==="readOnly",w=y==="disabled",R=a.useCallback((u,_)=>{s?.({...n,[u]:_})},[n,s]),p=a.useCallback(()=>{i?.(n)},[n,i]);return y==="hidden"?null:e.jsxs("div",{ref:M,id:D,className:`nice-org-form ${x??""}`,style:f,...v,children:[N.includes("basic")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(we,{title:j("org.basic","Company Information"),expanded:T.has("basic"),onToggle:()=>I("basic")}),T.has("basic")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(J.NiceTextInput,{label:j("org.name","Company Name"),value:n.name,onChange:u=>R("name",u),required:!0,disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.legalName","Legal Name"),value:n.legalName??"",onChange:u=>R("legalName",u),disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.taxId","Tax ID"),value:n.taxId??"",onChange:u=>R("taxId",u),disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.regNumber","Registration Number"),value:n.registrationNumber??"",onChange:u=>R("registrationNumber",u),disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.industry","Industry"),value:n.industry??"",onChange:u=>R("industry",u),disabled:w,readOnly:$}),e.jsx(J.NiceNumberInput,{label:j("org.employees","Number of Employees"),value:n.employeeCount??null,onChange:u=>R("employeeCount",u??void 0),min:1,disabled:w,readOnly:$})]})]}),N.includes("contact")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(we,{title:j("org.contact","Contact Details"),expanded:T.has("contact"),onToggle:()=>I("contact")}),T.has("contact")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(J.NiceTextInput,{label:j("org.email","Email"),value:n.email??"",onChange:u=>R("email",u),type:"email",disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.phone","Phone"),value:n.phone??"",onChange:u=>R("phone",u),type:"tel",disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.website","Website"),value:n.website??"",onChange:u=>R("website",u),type:"url",disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.fax","Fax"),value:n.fax??"",onChange:u=>R("fax",u),type:"tel",disabled:w,readOnly:$})]})]}),N.includes("address")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(we,{title:j("org.address","Address"),expanded:T.has("address"),onToggle:()=>I("address")}),T.has("address")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(J.NiceTextInput,{label:j("org.street","Street"),value:n.street??"",onChange:u=>R("street",u),disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.city","City"),value:n.city??"",onChange:u=>R("city",u),disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.state","State / Province"),value:n.state??"",onChange:u=>R("state",u),disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.postalCode","Postal Code"),value:n.postalCode??"",onChange:u=>R("postalCode",u),disabled:w,readOnly:$}),h?e.jsx(J.NiceSelect,{label:j("org.country","Country"),value:n.country??"",onChange:u=>R("country",u),options:h,searchable:!0,disabled:w,readOnly:$}):e.jsx(J.NiceTextInput,{label:j("org.country","Country"),value:n.country??"",onChange:u=>R("country",u),disabled:w,readOnly:$})]})]}),N.includes("branding")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(we,{title:j("org.branding","Branding"),expanded:T.has("branding"),onToggle:()=>I("branding")}),T.has("branding")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(J.NiceTextInput,{label:j("org.logoUrl","Logo URL"),value:n.logoUrl??"",onChange:u=>R("logoUrl",u),type:"url",disabled:w,readOnly:$}),e.jsx(J.NiceColorPicker,{label:j("org.primaryColor","Primary Color"),value:n.primaryColor??"var(--color-primary, #3b82f6)",onChange:u=>R("primaryColor",u),disabled:w,readOnly:$}),e.jsx(J.NiceColorPicker,{label:j("org.secondaryColor","Secondary Color"),value:n.secondaryColor??"var(--color-accent, #8b5cf6)",onChange:u=>R("secondaryColor",u),disabled:w,readOnly:$})]})]}),N.includes("localization")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(we,{title:j("org.localization","Localization"),expanded:T.has("localization"),onToggle:()=>I("localization")}),T.has("localization")&&e.jsxs("div",{className:"nice-org-form__fields",children:[d?e.jsx(J.NiceSelect,{label:j("org.language","Default Language"),value:n.defaultLanguage??"",onChange:u=>R("defaultLanguage",u),options:d,searchable:!0,disabled:w,readOnly:$}):e.jsx(J.NiceTextInput,{label:j("org.language","Default Language"),value:n.defaultLanguage??"",onChange:u=>R("defaultLanguage",u),disabled:w,readOnly:$}),c?e.jsx(J.NiceSelect,{label:j("org.currency","Default Currency"),value:n.defaultCurrency??"",onChange:u=>R("defaultCurrency",u),options:c,searchable:!0,disabled:w,readOnly:$}):e.jsx(J.NiceTextInput,{label:j("org.currency","Default Currency"),value:n.defaultCurrency??"",onChange:u=>R("defaultCurrency",u),disabled:w,readOnly:$}),m?e.jsx(J.NiceSelect,{label:j("org.timezone","Default Timezone"),value:n.defaultTimezone??"",onChange:u=>R("defaultTimezone",u),options:m,searchable:!0,disabled:w,readOnly:$}):e.jsx(J.NiceTextInput,{label:j("org.timezone","Default Timezone"),value:n.defaultTimezone??"",onChange:u=>R("defaultTimezone",u),disabled:w,readOnly:$}),e.jsx(J.NiceSelect,{label:j("org.dateFormat","Date Format"),value:n.dateFormat??"YYYY-MM-DD",onChange:u=>R("dateFormat",u),options:Ds,disabled:w,readOnly:$})]})]}),N.includes("fiscal")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(we,{title:j("org.fiscal","Fiscal Settings"),expanded:T.has("fiscal"),onToggle:()=>I("fiscal")}),T.has("fiscal")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(J.NiceTextInput,{label:j("org.fiscalYearStart","Fiscal Year Start"),value:n.fiscalYearStart??"",onChange:u=>R("fiscalYearStart",u),placeholder:"MM-DD",disabled:w,readOnly:$}),e.jsx(J.NiceToggle,{label:j("org.vatEnabled","VAT Enabled"),checked:n.vatEnabled??!1,onChange:u=>R("vatEnabled",u),disabled:w||$}),n.vatEnabled&&e.jsx(J.NiceNumberInput,{label:j("org.defaultVatRate","Default VAT Rate (%)"),value:n.defaultVatRate??null,onChange:u=>R("defaultVatRate",u??void 0),min:0,max:100,step:.5,disabled:w,readOnly:$})]})]}),N.includes("preferences")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(we,{title:j("org.preferences","Work Preferences"),expanded:T.has("preferences"),onToggle:()=>I("preferences")}),T.has("preferences")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsxs("div",{className:"nice-org-form__field-group",children:[e.jsx("label",{className:"nice-org-form__group-label",children:j("org.workingDays","Working Days")}),e.jsx("div",{className:"nice-org-form__checkboxes",children:Es.map(u=>e.jsx(J.NiceCheckbox,{label:u.label,checked:(n.workingDays??["Mon","Tue","Wed","Thu","Fri"]).includes(u.key),onChange:_=>{const L=n.workingDays??["Mon","Tue","Wed","Thu","Fri"],V=_?[...L,u.key]:L.filter(F=>F!==u.key);R("workingDays",V)},disabled:w||$},u.key))})]}),e.jsx(J.NiceTextInput,{label:j("org.workStart","Working Hours Start"),value:n.workingHoursStart??"09:00",onChange:u=>R("workingHoursStart",u),placeholder:"HH:MM",disabled:w,readOnly:$}),e.jsx(J.NiceTextInput,{label:j("org.workEnd","Working Hours End"),value:n.workingHoursEnd??"17:00",onChange:u=>R("workingHoursEnd",u),placeholder:"HH:MM",disabled:w,readOnly:$})]})]}),r&&e.jsxs("div",{className:"nice-org-form__actions",children:[l&&e.jsx(J.NiceButton,{variant:"secondary",onClick:l,disabled:b,children:j("cancel","Cancel")}),i&&e.jsx(J.NiceButton,{variant:"primary",onClick:p,loading:b,disabled:$||w,children:j("save","Save")})]})]})});On.displayName="NiceOrganizationProfileForm";const Is={available:{color:"var(--text-muted, #6b7280)",icon:"○"},installed:{color:"var(--color-primary, #3b82f6)",icon:"◉"},active:{color:"var(--color-success, #10b981)",icon:"●"},disabled:{color:"var(--color-warning, #f59e0b)",icon:"◌"},error:{color:"var(--color-error, #ef4444)",icon:"⊘"},updating:{color:"var(--color-accent, #8b5cf6)",icon:"↻"}};function Ls(n,s){switch(n){case"available":return["install"];case"installed":return["activate",...s?[]:["uninstall"]];case"active":return["deactivate"];case"disabled":return["activate",...s?[]:["uninstall"]];case"error":return["activate",...s?[]:["uninstall"]];case"updating":return[];default:return[]}}const Ts=({module:n,onAction:s,onClick:i,showDependencies:l,showAuthor:t,showVersion:o,processing:r,disabled:h,readOnly:d,t:c,layout:m})=>{const b=Is[n.status],x=Ls(n.status,n.isCore);return e.jsxs("div",{className:`nice-module-card nice-module-card--${m} nice-module-card--${n.status}`,onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,onKeyDown:i?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),i())}:void 0,children:[e.jsxs("div",{className:"nice-module-card__header",children:[e.jsx("span",{className:"nice-module-card__icon",children:n.icon??"📦"}),e.jsxs("div",{className:"nice-module-card__info",children:[e.jsx("div",{className:"nice-module-card__name",children:n.label}),o&&e.jsxs("span",{className:"nice-module-card__version",children:["v",n.version]})]}),e.jsxs("span",{className:"nice-module-card__status",style:{color:b.color},title:n.status,children:[r?"⟳":b.icon," ",n.status]})]}),e.jsx("div",{className:"nice-module-card__desc",children:n.description}),e.jsxs("div",{className:"nice-module-card__meta",children:[t&&n.author&&e.jsx("span",{className:"nice-module-card__author",children:n.author}),n.isCore&&e.jsx("span",{className:"nice-module-card__badge nice-module-card__badge--core",children:c("module.core","Core")})]}),l&&n.dependencies&&n.dependencies.length>0&&e.jsxs("div",{className:"nice-module-card__deps",children:[e.jsxs("span",{className:"nice-module-card__deps-label",children:[c("module.deps","Dependencies"),":"]}),n.dependencies.map(f=>e.jsx("span",{className:"nice-module-card__dep-tag",children:f},f))]}),!d&&x.length>0&&e.jsx("div",{className:"nice-module-card__actions",children:x.map(f=>e.jsx(J.NiceButton,{size:"sm",variant:f==="uninstall"?"error":f==="activate"?"primary":"secondary",onClick:C=>{C.stopPropagation(),s(f)},disabled:h||r,loading:r,children:c(`module.${f}`,f.charAt(0).toUpperCase()+f.slice(1))},f))})]})},An=a.forwardRef(({modules:n,onAction:s,statusFilter:i,searchable:l=!0,showDependencies:t=!0,showAuthor:o=!0,showVersion:r=!0,processingModules:h,layout:d="list",gridColumns:c=3,onModuleClick:m,className:b,style:x,id:f,accessMode:C,...g},v)=>{const M=O._s(f),D=O.sc(C,f),{t:y}=O.Zt(),[j,N]=a.useState(""),[T,S]=a.useState("all"),I=D==="readOnly",$=D==="disabled",w=a.useMemo(()=>{let u=n;if(i&&i.length>0&&(u=u.filter(_=>i.includes(_.status))),T!=="all"&&(u=u.filter(_=>_.status===T)),j){const _=j.toLowerCase();u=u.filter(L=>L.label.toLowerCase().includes(_)||L.name.toLowerCase().includes(_)||L.description.toLowerCase().includes(_))}return u},[n,i,T,j]),R=a.useMemo(()=>{const u={all:n.length};for(const _ of n)u[_.status]=(u[_.status]??0)+1;return u},[n]),p=a.useCallback((u,_)=>{s?.(u,_)},[s]);return D==="hidden"?null:e.jsxs("div",{ref:v,id:M,className:`nice-module-panel ${b??""}`,style:x,...g,children:[e.jsxs("div",{className:"nice-module-panel__toolbar",children:[l&&e.jsx(J.NiceTextInput,{value:j,onChange:N,placeholder:y("module.search","Search modules…"),type:"search",clearable:!0,className:"nice-module-panel__search"}),e.jsx("div",{className:"nice-module-panel__filters",role:"tablist",children:["all","active","installed","disabled","available","error"].map(u=>e.jsxs("button",{className:`nice-module-panel__filter ${T===u?"nice-module-panel__filter--active":""}`,onClick:()=>S(u),role:"tab","aria-selected":T===u,type:"button",children:[y(`module.status.${u}`,u==="all"?"All":u.charAt(0).toUpperCase()+u.slice(1)),e.jsx("span",{className:"nice-module-panel__filter-count",children:R[u]??0})]},u))})]}),e.jsx("div",{className:`nice-module-panel__grid nice-module-panel__grid--${d}`,style:d==="grid"?{gridTemplateColumns:`repeat(${c}, 1fr)`}:void 0,children:w.length===0?e.jsx("div",{className:"nice-module-panel__empty",children:y("module.empty","No modules found")}):w.map(u=>e.jsx(Ts,{module:u,onAction:_=>p(u.id,_),onClick:m?()=>m(u):void 0,showDependencies:t,showAuthor:o,showVersion:r,processing:h?.has(u.id)??!1,disabled:$,readOnly:I,t:y,layout:d},u.id))}),e.jsxs("div",{className:"nice-module-panel__summary",children:[y("module.total","Total"),": ",n.length," ·",y("module.status.active","Active"),":"," ",R.active??0," ·",y("module.status.disabled","Disabled"),":"," ",R.disabled??0," ·",y("module.status.error","Error"),":"," ",R.error??0]})]})});An.displayName="NiceModuleLifecyclePanel";exports.DEFAULT_SIDEBAR_PREFS=Pe;exports.DesktopContextMenu=rn;exports.DesktopGrid=cn;exports.DesktopStartMenu=ln;exports.DesktopSystemTray=tn;exports.DesktopTaskbar=Oe;exports.NiceAccordion=Yn;exports.NiceAppLayout=nn;exports.NiceAuthButtons=yn;exports.NiceBottomNavigation=sn;exports.NiceBreadcrumb=Un;exports.NiceCard=qe;exports.NiceCard$1=Hn;exports.NiceClassicShell=Sn;exports.NiceCompactShell=zn;exports.NiceConsole=dn;exports.NiceContextMenu=Be;exports.NiceDashboardLayout=en;exports.NiceDashboardShell=$n;exports.NiceDesktop=on;exports.NiceDock=an;exports.NiceDynamicSidebar=pn;exports.NiceHybridShell=In;exports.NiceKioskShell=Mn;exports.NiceMdiWorkspace=Cn;exports.NiceMenu=Xe;exports.NiceMinimalShell=Dn;exports.NiceModeSelector=Tn;exports.NiceModernShell=En;exports.NiceModuleLifecyclePanel=An;exports.NiceMultiView=Vn;exports.NiceNavMenu=wn;exports.NiceNavbar=_n;exports.NiceOnboardingWizard=Rn;exports.NiceOrganizationProfileForm=On;exports.NicePwaShell=Ln;exports.NiceSetupWizard=hn;exports.NiceSidebarNav=$s;exports.NiceSplitter=Kn;exports.NiceStepper=Je;exports.NiceTabPanel=Zn;exports.NiceTenantSwitcher=bn;exports.NiceToolbar=qn;exports.NiceTooltip=re;exports.NiceUserMenu=Fe;exports.NiceWizard=un;exports.PREFS_CATEGORIES=We;exports.SIDEBAR_MODE_META=ze;exports.buildPrefsCategoryViews=rs;exports.useSetupWizard=Xn;exports.useSidebarNavPrefs=vn;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { b as y } from "./NiceTabs-Cx9DN6QD.js";
|
|
3
|
+
function M(i, a, l) {
|
|
4
|
+
const r = [];
|
|
5
|
+
if (a <= 1)
|
|
6
|
+
return a === 1 && r.push(1), r;
|
|
7
|
+
const s = Math.max(2, i - l), o = Math.min(a - 1, i + l);
|
|
8
|
+
r.push(1), s > 2 && r.push("dots");
|
|
9
|
+
for (let c = s; c <= o; c++)
|
|
10
|
+
r.push(c);
|
|
11
|
+
return o < a - 1 && r.push("dots"), r.push(a), r;
|
|
12
|
+
}
|
|
13
|
+
const L = ({
|
|
14
|
+
page: i,
|
|
15
|
+
totalPages: a,
|
|
16
|
+
onChange: l,
|
|
17
|
+
showInfo: r,
|
|
18
|
+
siblingCount: s = 1,
|
|
19
|
+
size: o = "md",
|
|
20
|
+
showFirstLast: c,
|
|
21
|
+
showJumpInput: m,
|
|
22
|
+
jumpInputLabel: h,
|
|
23
|
+
showPageSize: b,
|
|
24
|
+
pageSizeOptions: d,
|
|
25
|
+
pageSize: f,
|
|
26
|
+
onPageSizeChange: N,
|
|
27
|
+
disabled: t,
|
|
28
|
+
className: _,
|
|
29
|
+
style: v
|
|
30
|
+
}) => {
|
|
31
|
+
const g = M(i, a, s);
|
|
32
|
+
return /* @__PURE__ */ u(
|
|
33
|
+
"nav",
|
|
34
|
+
{
|
|
35
|
+
className: `nice-pagination nice-pagination--${o} ${_ || ""}`,
|
|
36
|
+
style: v,
|
|
37
|
+
"aria-label": "Pagination",
|
|
38
|
+
children: [
|
|
39
|
+
c && /* @__PURE__ */ e(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
className: "nice-pagination__btn",
|
|
43
|
+
disabled: t || i <= 1,
|
|
44
|
+
onClick: () => l(1),
|
|
45
|
+
"aria-label": "First page",
|
|
46
|
+
title: "First page",
|
|
47
|
+
children: "⏮"
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ e(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
className: "nice-pagination__btn",
|
|
54
|
+
disabled: t || i <= 1,
|
|
55
|
+
onClick: () => l(i - 1),
|
|
56
|
+
"aria-label": "Previous",
|
|
57
|
+
children: /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
|
|
58
|
+
"path",
|
|
59
|
+
{
|
|
60
|
+
fillRule: "evenodd",
|
|
61
|
+
d: "M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z",
|
|
62
|
+
clipRule: "evenodd"
|
|
63
|
+
}
|
|
64
|
+
) })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
g.map(
|
|
68
|
+
(n, p) => n === "dots" ? /* @__PURE__ */ e("span", { className: "nice-pagination__ellipsis", children: "…" }, `dots-${p}`) : /* @__PURE__ */ e(
|
|
69
|
+
"button",
|
|
70
|
+
{
|
|
71
|
+
className: `nice-pagination__btn ${n === i ? "nice-pagination__btn--active" : ""}`,
|
|
72
|
+
disabled: t,
|
|
73
|
+
onClick: () => l(n),
|
|
74
|
+
"aria-current": n === i ? "page" : void 0,
|
|
75
|
+
children: n
|
|
76
|
+
},
|
|
77
|
+
n
|
|
78
|
+
)
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ e(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
className: "nice-pagination__btn",
|
|
84
|
+
disabled: t || i >= a,
|
|
85
|
+
onClick: () => l(i + 1),
|
|
86
|
+
"aria-label": "Next",
|
|
87
|
+
children: /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
|
|
88
|
+
"path",
|
|
89
|
+
{
|
|
90
|
+
fillRule: "evenodd",
|
|
91
|
+
d: "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",
|
|
92
|
+
clipRule: "evenodd"
|
|
93
|
+
}
|
|
94
|
+
) })
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
c && /* @__PURE__ */ e(
|
|
98
|
+
"button",
|
|
99
|
+
{
|
|
100
|
+
className: "nice-pagination__btn",
|
|
101
|
+
disabled: t || i >= a,
|
|
102
|
+
onClick: () => l(a),
|
|
103
|
+
"aria-label": "Last page",
|
|
104
|
+
title: "Last page",
|
|
105
|
+
children: "⏭"
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
r && /* @__PURE__ */ u("span", { className: "nice-pagination__info", children: [
|
|
109
|
+
i,
|
|
110
|
+
" / ",
|
|
111
|
+
a
|
|
112
|
+
] }),
|
|
113
|
+
m && /* @__PURE__ */ u(
|
|
114
|
+
"span",
|
|
115
|
+
{
|
|
116
|
+
className: "nice-pagination__jump",
|
|
117
|
+
style: { display: "inline-flex", alignItems: "center", gap: 6, marginLeft: 8 },
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ e("span", { style: { fontSize: "0.85rem", color: "var(--text-secondary)" }, children: h ?? "Go to" }),
|
|
120
|
+
/* @__PURE__ */ e(
|
|
121
|
+
y,
|
|
122
|
+
{
|
|
123
|
+
size: o === "lg" ? "md" : "sm",
|
|
124
|
+
min: 1,
|
|
125
|
+
max: a,
|
|
126
|
+
step: 1,
|
|
127
|
+
value: i,
|
|
128
|
+
disabled: t,
|
|
129
|
+
onChange: (n) => {
|
|
130
|
+
const p = typeof n == "number" ? n : Number(n);
|
|
131
|
+
if (!Number.isNaN(p)) {
|
|
132
|
+
const x = Math.max(1, Math.min(a, Math.floor(p)));
|
|
133
|
+
l(x);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
b && d && d.length > 0 && /* @__PURE__ */ e(
|
|
142
|
+
"select",
|
|
143
|
+
{
|
|
144
|
+
className: "nice-pagination__size",
|
|
145
|
+
value: f ?? d[0],
|
|
146
|
+
disabled: t,
|
|
147
|
+
onChange: (n) => N?.(Number(n.target.value)),
|
|
148
|
+
style: {
|
|
149
|
+
marginLeft: 8,
|
|
150
|
+
padding: "4px 8px",
|
|
151
|
+
border: "1px solid var(--border-color)",
|
|
152
|
+
borderRadius: 6,
|
|
153
|
+
background: "var(--bg-primary)",
|
|
154
|
+
color: "var(--text-primary)",
|
|
155
|
+
font: "inherit",
|
|
156
|
+
fontSize: "0.85rem"
|
|
157
|
+
},
|
|
158
|
+
"aria-label": "Rows per page",
|
|
159
|
+
children: d.map((n) => /* @__PURE__ */ u("option", { value: n, children: [
|
|
160
|
+
n,
|
|
161
|
+
" / page"
|
|
162
|
+
] }, n))
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
export {
|
|
170
|
+
L as N
|
|
171
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),g=require("./NiceTabs-CFA8DGYR.cjs");function v(e,a,t){const r=[];if(a<=1)return a===1&&r.push(1),r;const o=Math.max(2,e-t),c=Math.min(a-1,e+t);r.push(1),o>2&&r.push("dots");for(let s=o;s<=c;s++)r.push(s);return c<a-1&&r.push("dots"),r.push(a),r}const y=({page:e,totalPages:a,onChange:t,showInfo:r,siblingCount:o=1,size:c="md",showFirstLast:s,showJumpInput:p,jumpInputLabel:h,showPageSize:m,pageSizeOptions:u,pageSize:x,onPageSizeChange:b,disabled:l,className:f,style:N})=>{const _=v(e,a,o);return n.jsxs("nav",{className:`nice-pagination nice-pagination--${c} ${f||""}`,style:N,"aria-label":"Pagination",children:[s&&n.jsx("button",{className:"nice-pagination__btn",disabled:l||e<=1,onClick:()=>t(1),"aria-label":"First page",title:"First page",children:"⏮"}),n.jsx("button",{className:"nice-pagination__btn",disabled:l||e<=1,onClick:()=>t(e-1),"aria-label":"Previous",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z",clipRule:"evenodd"})})}),_.map((i,d)=>i==="dots"?n.jsx("span",{className:"nice-pagination__ellipsis",children:"…"},`dots-${d}`):n.jsx("button",{className:`nice-pagination__btn ${i===e?"nice-pagination__btn--active":""}`,disabled:l,onClick:()=>t(i),"aria-current":i===e?"page":void 0,children:i},i)),n.jsx("button",{className:"nice-pagination__btn",disabled:l||e>=a,onClick:()=>t(e+1),"aria-label":"Next",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})})}),s&&n.jsx("button",{className:"nice-pagination__btn",disabled:l||e>=a,onClick:()=>t(a),"aria-label":"Last page",title:"Last page",children:"⏭"}),r&&n.jsxs("span",{className:"nice-pagination__info",children:[e," / ",a]}),p&&n.jsxs("span",{className:"nice-pagination__jump",style:{display:"inline-flex",alignItems:"center",gap:6,marginLeft:8},children:[n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--text-secondary)"},children:h??"Go to"}),n.jsx(g.NiceNumberInput,{size:c==="lg"?"md":"sm",min:1,max:a,step:1,value:e,disabled:l,onChange:i=>{const d=typeof i=="number"?i:Number(i);if(!Number.isNaN(d)){const j=Math.max(1,Math.min(a,Math.floor(d)));t(j)}}})]}),m&&u&&u.length>0&&n.jsx("select",{className:"nice-pagination__size",value:x??u[0],disabled:l,onChange:i=>b?.(Number(i.target.value)),style:{marginLeft:8,padding:"4px 8px",border:"1px solid var(--border-color)",borderRadius:6,background:"var(--bg-primary)",color:"var(--text-primary)",font:"inherit",fontSize:"0.85rem"},"aria-label":"Rows per page",children:u.map(i=>n.jsxs("option",{value:i,children:[i," / page"]},i))})]})};exports.NicePagination=y;
|