@nice2dev/ui 1.4.19 → 1.4.21
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 +57 -0
- package/dist/NiceGantt-Drl4gvw9.cjs +1 -0
- package/dist/{NiceGantt.doc-B6YZcJvG.cjs → NiceGantt.doc-DTv0r7bP.cjs} +2 -2
- package/dist/NiceModuleLifecyclePanel-jckyVqqt.cjs +1 -0
- package/dist/NiceWindow-DQyf5wat.cjs +1 -0
- package/dist/{core-lazy-BhQxFuLf.cjs → core-lazy-DirbU7jp.cjs} +1 -1
- package/dist/display/NiceDocumentApprovalFlow.mjs +67 -89
- package/dist/display/NiceLeaderboard.mjs +47 -40
- package/dist/display/NiceQuestCard.mjs +93 -76
- package/dist/docs/NiceGantt.doc.json.mjs +9 -9
- package/dist/documentation/utils.mjs +1 -1
- package/dist/index.cjs +94 -94
- package/dist/index.d.ts +58 -2
- package/dist/index.mjs +778 -776
- package/dist/navigation/NiceMenu.mjs +249 -248
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +6 -0
- package/dist/overlays/NiceResponsiveBox.mjs +51 -24
- package/dist/overlays/NiceTutorial.mjs +136 -127
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +25 -2
- package/dist/planning/NiceGantt.mjs +130 -121
- package/dist/planning/NiceStepper.mjs +36 -35
- package/dist/style.css +2 -2
- package/dist/tools/NiceDraggable.mjs +44 -29
- package/dist/tools/NiceSortable.mjs +66 -48
- package/dist/tools/NiceSpeechToText.mjs +67 -52
- package/dist/tools/NiceValidationBuilder.mjs +210 -119
- package/dist/tools/NiceViewRegistry.mjs +67 -34
- package/package.json +4 -4
- package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +0 -8
- package/dist/NiceGantt-BygumlaY.cjs +0 -1
- package/dist/NiceModuleLifecyclePanel-DAIbzfZd.cjs +0 -1
- package/dist/NiceWindow-BklnkBpu.cjs +0 -1
- package/dist/docs/NiceBottomSheet.doc.json.mjs +0 -32
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),h=require("@nice2dev/ui-core"),i=require("react"),gn=require("react-dom"),Se=require("./no-code-DPc82kyy.cjs"),rn=require("./pickerCommons-CQnae2FM.cjs"),vn=require("./NiceButton-DzCqkG5a.cjs"),Xe=require("./devops-o6Zm0VKB.cjs"),As=require("./NiceColorPicker-79rkvaSk.cjs"),qs=[{code:"en",nativeName:"English",englishName:"English",flagCountryCode:"GB"},{code:"en-US",nativeName:"English (US)",englishName:"English (US)",flagCountryCode:"US"},{code:"en-GB",nativeName:"English (UK)",englishName:"English (UK)",flagCountryCode:"GB"},{code:"pl",nativeName:"Polski",englishName:"Polish",flagCountryCode:"PL"},{code:"de",nativeName:"Deutsch",englishName:"German",flagCountryCode:"DE"},{code:"de-AT",nativeName:"Deutsch (Österreich)",englishName:"German (Austria)",flagCountryCode:"AT"},{code:"de-CH",nativeName:"Deutsch (Schweiz)",englishName:"German (Switzerland)",flagCountryCode:"CH"},{code:"fr",nativeName:"Français",englishName:"French",flagCountryCode:"FR"},{code:"fr-CA",nativeName:"Français (Canada)",englishName:"French (Canada)",flagCountryCode:"CA"},{code:"es",nativeName:"Español",englishName:"Spanish",flagCountryCode:"ES"},{code:"es-MX",nativeName:"Español (México)",englishName:"Spanish (Mexico)",flagCountryCode:"MX"},{code:"es-AR",nativeName:"Español (Argentina)",englishName:"Spanish (Argentina)",flagCountryCode:"AR"},{code:"it",nativeName:"Italiano",englishName:"Italian",flagCountryCode:"IT"},{code:"pt",nativeName:"Português",englishName:"Portuguese",flagCountryCode:"PT"},{code:"pt-BR",nativeName:"Português (Brasil)",englishName:"Portuguese (Brazil)",flagCountryCode:"BR"},{code:"nl",nativeName:"Nederlands",englishName:"Dutch",flagCountryCode:"NL"},{code:"sv",nativeName:"Svenska",englishName:"Swedish",flagCountryCode:"SE"},{code:"no",nativeName:"Norsk",englishName:"Norwegian",flagCountryCode:"NO"},{code:"da",nativeName:"Dansk",englishName:"Danish",flagCountryCode:"DK"},{code:"fi",nativeName:"Suomi",englishName:"Finnish",flagCountryCode:"FI"},{code:"cs",nativeName:"Čeština",englishName:"Czech",flagCountryCode:"CZ"},{code:"sk",nativeName:"Slovenčina",englishName:"Slovak",flagCountryCode:"SK"},{code:"hu",nativeName:"Magyar",englishName:"Hungarian",flagCountryCode:"HU"},{code:"ro",nativeName:"Română",englishName:"Romanian",flagCountryCode:"RO"},{code:"bg",nativeName:"Български",englishName:"Bulgarian",flagCountryCode:"BG"},{code:"el",nativeName:"Ελληνικά",englishName:"Greek",flagCountryCode:"GR"},{code:"tr",nativeName:"Türkçe",englishName:"Turkish",flagCountryCode:"TR"},{code:"ru",nativeName:"Русский",englishName:"Russian",flagCountryCode:"RU"},{code:"uk",nativeName:"Українська",englishName:"Ukrainian",flagCountryCode:"UA"},{code:"ar",nativeName:"العربية",englishName:"Arabic",flagCountryCode:"SA"},{code:"he",nativeName:"עברית",englishName:"Hebrew",flagCountryCode:"IL"},{code:"fa",nativeName:"فارسی",englishName:"Persian",flagCountryCode:"IR"},{code:"hi",nativeName:"हिन्दी",englishName:"Hindi",flagCountryCode:"IN"},{code:"zh",nativeName:"中文",englishName:"Chinese",flagCountryCode:"CN"},{code:"zh-TW",nativeName:"繁體中文",englishName:"Chinese (Traditional)",flagCountryCode:"TW"},{code:"ja",nativeName:"日本語",englishName:"Japanese",flagCountryCode:"JP"},{code:"ko",nativeName:"한국어",englishName:"Korean",flagCountryCode:"KR"},{code:"th",nativeName:"ไทย",englishName:"Thai",flagCountryCode:"TH"},{code:"vi",nativeName:"Tiếng Việt",englishName:"Vietnamese",flagCountryCode:"VN"},{code:"id",nativeName:"Bahasa Indonesia",englishName:"Indonesian",flagCountryCode:"ID"}],xs=({value:n,defaultValue:s,onChange:t,placeholder:a,showSearch:r=!0,searchThreshold:o=8,searchPlaceholder:l,isOpen:m,onOpenChange:f,showFlagInValue:p=!0,triggerIcon:u="flag",showFlagInMenu:g=!0,showTextInValue:d,showTextInMenu:c=!0,showCodeInValue:v,showCodeInMenu:x=!0,displayName:b="native",compact:S=!1,variant:C="default",dropdownAlign:I,disabled:j=!1,languages:$,allowedCodes:M,priorityCodes:D=["en","pl","de","fr","es"],allowClear:P=!1,size:E="md",className:N="",style:z,label:B,helperText:w,error:_,required:T,readOnly:O,loading:Z,labelPlacement:y,errorPlacement:R,labelWidth:A,controlWidth:V,id:te,"data-testid":G="nice-language-picker","aria-label":ne})=>{const{t:ie}=h.useNiceTranslation(),se=i.useRef(null),U=i.useRef(null),de=i.useRef(null),[re,le]=i.useState(s),[ge,H]=i.useState(!1),q=m??ge,pe=i.useCallback(F=>{const Ne=typeof F=="function"?F(q):F;m===void 0&&H(Ne),f?.(Ne)},[q,m,f]),[_e,Re]=i.useState(""),Ae=d??(!S&&C!=="ghost"),Ye=v??!1,X=S?320:280,je=rn.useDropdownAlignment(q,U,I??(S?"auto":"left"),X),Y=n!==void 0?n:re,Q=$??qs,ue=i.useMemo(()=>{if(!M||M.length===0)return Q;const F=M.map(Me=>Me.toLowerCase()),Ne=new Set(F),ee=new Set(F.map(Me=>Me.split("-")[0])),me=Q.filter(Me=>{const Ze=Me.code.toLowerCase();return!!(Ne.has(Ze)||!Ze.includes("-")&&ee.has(Ze))});return process.env.NODE_ENV!=="production"&&me.length===0&&console.warn(`[Nice2Dev] <NiceLanguagePicker> received \`allowedCodes\` but none matched any entry in the language list. Picker will render empty. Got codes: ${JSON.stringify(M)}. Tip: pass canonical BCP-47 primary tags (e.g. \`pl\`, not \`pl-PL\`).`),me},[Q,M]),we=i.useMemo(()=>{if(!D?.length)return ue;const F=new Set(D),Ne=ue.filter(me=>F.has(me.code)),ee=ue.filter(me=>!F.has(me.code));return[...Ne,...ee]},[ue,D]),Ie=i.useMemo(()=>{if(!_e)return we;const F=_e.toLowerCase();return we.filter(Ne=>Ne.nativeName.toLowerCase().includes(F)||Ne.englishName.toLowerCase().includes(F)||Ne.code.toLowerCase().includes(F))},[we,_e]),De=i.useMemo(()=>Y?ue.find(F=>F.code===Y)??null:null,[Y,ue]),Ke=r&&ue.length>=o;i.useEffect(()=>{if(!q)return;const F=Ne=>{se.current&&!se.current.contains(Ne.target)&&(pe(!1),Re(""))};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[q,pe]);const Pe=i.useCallback(F=>{n===void 0&&le(F.code),t?.(F),pe(!1),Re("")},[n,t,pe]),Be=i.useCallback(()=>{n===void 0&&le(void 0),t?.(null)},[n,t]),Ue=i.useCallback(F=>{F.stopPropagation(),Be()},[Be]),ke=P&&!!De&&!j&&!O,W=i.useRef(null),ve=i.useCallback(()=>{pe(!1),Re("")},[pe]),{activeIndex:Oe,setActiveIndex:Je,handleKeyDown:Fe}=rn.useListKeyboardNav(Ie,{open:q,onSelect:F=>Pe(F),onClose:ve,onOpen:()=>!j&&!O&&pe(!0),intentRef:W}),Ve=F=>{if((F.key==="Delete"||F.key==="Backspace")&&ke&&!q){F.preventDefault(),Be();return}Fe(F)};h.useOverlayFocus(W,{open:q,modal:!1,initialFocus:Ke?de:"none",onClose:ve}),i.useEffect(()=>{Je(0)},[_e,Je]);const an=i.useId(),$e=`${an}-listbox`,J=q&&Ie[Oe]?`${$e}-${Oe}`:void 0;i.useLayoutEffect(()=>{J&&document.getElementById(J)?.scrollIntoView?.({block:"nearest"})},[J]);const fe=F=>b==="english"?F.englishName:F.nativeName,xe=te??`${an}-trigger`,ze=ne??(!!B||(De?Ae:!S)?void 0:De?ie("languagePicker.ariaLabelValue","Language: {name}").replace("{name}",fe(De)):ie("languagePicker.ariaLabel","Language"));return e.jsxs("div",{ref:se,className:`nice-field nice-field--${E} nice-field--language-picker ${y==="left"?"nice-field--label-left":""} ${R==="right"?"nice-field--error-right":""} ${_?"nice-field--error":""} ${Z?"nice-field--loading":""} nice-country-picker nice-language-picker nice-country-picker--${E} ${S?"nice-country-picker--compact":""} ${C==="ghost"?"nice-country-picker--ghost":""} ${q?"nice-country-picker--open":""} ${j?"nice-country-picker--disabled":""} ${N}`,style:{...z,...A!=null&&{"--nice-field-label-width":typeof A=="number"?`${A}px`:A},...V!=null&&{"--nice-field-control-width":typeof V=="number"?`${V}px`:V}},"data-testid":G,"aria-busy":Z||void 0,children:[B&&e.jsxs("label",{className:"nice-field__label",htmlFor:xe,children:[B,T&&e.jsx("span",{className:"nice-field__required",children:"*"})]}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("button",{ref:U,type:"button",className:"nice-country-picker__trigger",onClick:F=>{j||O||(F.stopPropagation(),pe(!q))},onKeyDown:Ve,disabled:j,id:xe,"aria-label":ze,role:"combobox","aria-keyshortcuts":ke?"Delete":void 0,"aria-haspopup":"listbox","aria-expanded":q,"aria-controls":q?$e:void 0,"aria-activedescendant":Ke?void 0:J,"aria-invalid":_?!0:void 0,"data-testid":`${G}-trigger`,children:[De?e.jsxs("span",{className:"nice-country-picker__value",children:[p&&e.jsx("span",{className:"nice-country-picker__flag","aria-hidden":"true",children:u==="globe"?e.jsx(h.NiceIcon,{name:"globe",size:18}):e.jsx(rn.FlagIcon,{code:De.flagCountryCode})}),Ae&&e.jsx("span",{className:"nice-country-picker__name",children:fe(De)}),Ye&&e.jsxs("span",{className:"nice-country-picker__dial-code",children:["(",De.code,")"]})]}):e.jsxs("span",{className:"nice-country-picker__placeholder",children:[u==="globe"&&e.jsx("span",{className:"nice-country-picker__flag","aria-hidden":"true",children:e.jsx(h.NiceIcon,{name:"globe",size:18})}),S?"":a??ie("controls.select","Select language")]}),e.jsxs("span",{className:"nice-country-picker__icons",children:[ke&&e.jsx("span",{className:"nice-country-picker__clear",onClick:Ue,role:"presentation",children:e.jsx(h.NiceIcon,{name:"close",size:14})}),C!=="ghost"&&e.jsx("span",{className:"nice-country-picker__arrow",children:e.jsx(h.NiceIcon,{name:q?"chevron-up":"chevron-down",size:16})})]})]}),q&&e.jsxs("div",{className:`nice-country-picker__dropdown nice-country-picker__dropdown--align-${je}`,style:S?{minWidth:`${X}px`,maxWidth:"calc(100vw - 16px)"}:void 0,role:"listbox",ref:W,id:$e,"data-testid":`${G}-dropdown`,children:[Ke&&e.jsx("div",{className:"nice-country-picker__search",children:e.jsx("input",{ref:de,type:"text",value:_e,onChange:F=>Re(F.target.value),onKeyDown:Fe,placeholder:l??ie("languagePicker.filter","Filter languages…"),"aria-label":l??ie("languagePicker.filter","Filter languages…"),"aria-controls":$e,"aria-activedescendant":J,"aria-autocomplete":"list",className:"nice-country-picker__search-input","data-testid":`${G}-search`})}),e.jsx("div",{className:"nice-country-picker__list",children:Ie.length===0?e.jsx("div",{className:"nice-country-picker__empty",children:ie("noData","No languages found")}):Ie.map((F,Ne)=>e.jsxs("div",{id:`${$e}-${Ne}`,className:`nice-country-picker__option ${F.code===Y?"nice-country-picker__option--selected":""} ${Ne===Oe?"nice-country-picker__option--highlighted":""}`,onClick:()=>Pe(F),onMouseEnter:()=>Je(Ne),role:"option","aria-selected":F.code===Y,"data-testid":`${G}-option-${F.code}`,children:[g&&e.jsx("span",{className:"nice-country-picker__flag","aria-hidden":"true",children:e.jsx(rn.FlagIcon,{code:F.flagCountryCode})}),c&&e.jsx("span",{className:"nice-country-picker__name",children:fe(F)}),x&&e.jsx("span",{className:"nice-country-picker__dial-code",children:F.code})]},F.code))})]}),Z&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),R==="right"&&_&&e.jsx("div",{className:"nice-field__error",role:"alert",children:_}),R==="right"&&!_&&w&&e.jsx("div",{className:"nice-field__helper",children:w})]}),R!=="right"&&_&&e.jsx("div",{className:"nice-field__error",role:"alert",children:_}),R!=="right"&&!_&&w&&e.jsx("div",{className:"nice-field__helper",children:w})]})};process.env.NODE_ENV!=="production"&&(xs.displayName="NiceLanguagePicker");function Gs(n){const s=h.resolveTheme(n).theme;return{id:n.name,name:n.name,preview:{background:s.backgrounds.primary,backgroundSecondary:s.backgrounds.secondary,primary:s.colors.primary,textColor:s.text.primary,border:s.borders.color,roles:h.themePreviewRoles(n)},readOnly:!0}}const hs=h.NICE_THEME_PRESETS.map(Gs),Qi=(n,s)=>{const t=encodeURIComponent(s.returnUrl);if(s.themeId){const r=n.includes("?")?"&":"?";return`${n}${r}themeId=${encodeURIComponent(s.themeId)}&returnUrl=${t}`}return`${n.replace(/\/+$/,"")}/new?returnUrl=${t}`},Ji=n=>{typeof window<"u"&&(window.location.href=n)},rs=n=>n.nativeName??n.name,Ns=({value:n,defaultValue:s,onChange:t,themes:a,placeholder:r,showSearch:o=!0,searchThreshold:l=8,searchPlaceholder:m,isOpen:f,onOpenChange:p,showPreviewInValue:u=!0,showPreviewInMenu:g=!0,showTextInValue:d,showTextInMenu:c=!0,showIdInValue:v=!1,showIdInMenu:x=!1,compact:b=!1,variant:S="default",dropdownAlign:C,previewSize:I,previewShape:j="page",edit:$,disabled:M=!1,allowClear:D=!1,size:P="md",className:E="",style:N,label:z,helperText:B,error:w,required:_,readOnly:T,loading:O,labelPlacement:Z,errorPlacement:y,labelWidth:R,controlWidth:A,id:V,"data-testid":te="nice-theme-picker","aria-label":G})=>{const{t:ne}=h.useNiceTranslation(),ie=i.useMemo(()=>!a||a.length===0?(process.env.NODE_ENV!=="production"&&Array.isArray(a)&&console.warn(`[Nice2Dev] <NiceThemePicker> received \`themes={[]}\` (empty array). Falling back to ${hs.length} built-in presets. Omit the \`themes\` prop to silence this warning, or pass at least one descriptor.`),hs):a,[a]),se=i.useRef(null),U=i.useRef(null),de=i.useRef(null),[re,le]=i.useState(s),[ge,H]=i.useState(!1),q=f??ge,pe=i.useCallback(F=>{const Ne=typeof F=="function"?F(q):F;f===void 0&&H(Ne),p?.(Ne)},[q,f,p]),[_e,Re]=i.useState(""),Ae=d??(!b&&S!=="ghost"),Ye=I??(b?24:28),X=I??40,je=b?320:280,Y=rn.useDropdownAlignment(q,U,C??(b?"auto":"left"),je),Q=n!==void 0?n:re,ue=i.useMemo(()=>{if(!_e)return ie;const F=_e.toLowerCase();return ie.filter(Ne=>Ne.id.toLowerCase().includes(F)||Ne.name.toLowerCase().includes(F)||(Ne.nativeName?.toLowerCase().includes(F)??!1))},[ie,_e]),we=i.useMemo(()=>Q?ie.find(F=>F.id===Q)??null:null,[Q,ie]),Ie=o&&ie.length>=l;i.useEffect(()=>{if(!q)return;const F=Ne=>{se.current&&!se.current.contains(Ne.target)&&(pe(!1),Re(""))};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[q,pe]);const De=i.useRef(!1);i.useEffect(()=>{process.env.NODE_ENV!=="production"&&ie.length===0&&!De.current&&(De.current=!0,console.warn("[@nice2dev/ui] <NiceThemePicker> received an empty `themes` array. Omit the prop to use NICE_THEME_PICKER_PRESETS, or pass your own NiceThemeDescriptor[] (use `toThemeDescriptor(theme)` to adapt a NiceTheme)."))},[ie]);const Ke=i.useCallback(F=>{n===void 0&&le(F.id),t?.(F),pe(!1),Re("")},[n,t,pe]),Pe=i.useCallback(()=>{n===void 0&&le(void 0),t?.(null)},[n,t]),Be=i.useCallback(F=>{F.stopPropagation(),Pe()},[Pe]),Ue=D&&!!we&&!M&&!T,ke=i.useCallback(F=>{if(!$?.enabled&&!$?.addNew?.enabled)return;const Ne=$.returnUrl??(typeof window<"u"?window.location.href:"/"),ee=($.buildUrl??(me=>Qi($.editorRoute,me)))({themeId:F,returnUrl:Ne});($.navigate??Ji)(ee),pe(!1)},[$,pe]),W=i.useRef(null),ve=i.useCallback(()=>{pe(!1),Re("")},[pe]),{activeIndex:Oe,setActiveIndex:Je,handleKeyDown:Fe}=rn.useListKeyboardNav(ue,{open:q,onSelect:F=>Ke(F),onClose:ve,onOpen:()=>!M&&!T&&pe(!0),intentRef:W}),Ve=F=>{if((F.key==="Delete"||F.key==="Backspace")&&Ue&&!q){F.preventDefault(),Pe();return}Fe(F)};h.useOverlayFocus(W,{open:q,modal:!1,initialFocus:Ie?de:"none",onClose:ve}),i.useEffect(()=>{Je(0)},[_e,Je]);const an=i.useId(),$e=`${an}-listbox`,J=q&&ue[Oe]?`${$e}-${Oe}`:void 0;i.useLayoutEffect(()=>{J&&document.getElementById(J)?.scrollIntoView?.({block:"nearest"})},[J]);const fe=F=>!!($?.enabled&&(!F.readOnly||$?.allowEditBuiltIn)),xe=V??`${an}-trigger`,ze=G??(!!z||(we?Ae:!b)?void 0:we?ne("themePicker.ariaLabelValue","Theme: {name}").replace("{name}",rs(we)):ne("themePicker.ariaLabel","Theme"));return e.jsxs("div",{ref:se,className:`nice-field nice-field--${P} nice-field--theme-switcher ${Z==="left"?"nice-field--label-left":""} ${y==="right"?"nice-field--error-right":""} ${w?"nice-field--error":""} ${O?"nice-field--loading":""} nice-country-picker nice-theme-picker nice-country-picker--${P} ${b?"nice-country-picker--compact":""} ${S==="ghost"?"nice-country-picker--ghost":""} ${q?"nice-country-picker--open":""} ${M?"nice-country-picker--disabled":""} ${E}`,style:{...N,...R!=null&&{"--nice-field-label-width":typeof R=="number"?`${R}px`:R},...A!=null&&{"--nice-field-control-width":typeof A=="number"?`${A}px`:A}},"data-testid":te,"aria-busy":O||void 0,children:[z&&e.jsxs("label",{className:"nice-field__label",htmlFor:xe,children:[z,_&&e.jsx("span",{className:"nice-field__required",children:"*"})]}),e.jsxs("div",{className:"nice-field__control",children:[e.jsxs("button",{ref:U,type:"button",className:"nice-country-picker__trigger",onClick:F=>{M||T||(F.stopPropagation(),pe(!q))},onKeyDown:Ve,disabled:M,id:xe,"aria-label":ze,role:"combobox","aria-keyshortcuts":Ue?"Delete":void 0,"aria-haspopup":"listbox","aria-expanded":q,"aria-controls":q?$e:void 0,"aria-activedescendant":Ie?void 0:J,"aria-invalid":w?!0:void 0,"data-testid":`${te}-trigger`,children:[we?e.jsxs("span",{className:"nice-country-picker__value",children:[u&&e.jsx("span",{className:"nice-country-picker__flag","aria-hidden":"true",children:e.jsx(rn.ThemePreviewSwatch,{colors:we.preview,size:Ye,shape:j})}),Ae&&e.jsx("span",{className:"nice-country-picker__name",children:rs(we)}),v&&e.jsxs("span",{className:"nice-country-picker__dial-code",children:["(",we.id,")"]})]}):e.jsx("span",{className:"nice-country-picker__placeholder",children:b?"":r??ne("controls.select","Select theme")}),e.jsxs("span",{className:"nice-country-picker__icons",children:[Ue&&e.jsx("span",{className:"nice-country-picker__clear",onClick:Be,role:"presentation",children:e.jsx(h.NiceIcon,{name:"close",size:14})}),S!=="ghost"&&e.jsx("span",{className:"nice-country-picker__arrow",children:e.jsx(h.NiceIcon,{name:q?"chevron-up":"chevron-down",size:16})})]})]}),q&&e.jsxs("div",{className:`nice-country-picker__dropdown nice-country-picker__dropdown--align-${Y}`,style:b?{minWidth:`${je}px`,maxWidth:"calc(100vw - 16px)"}:void 0,role:"listbox",ref:W,id:$e,"data-testid":`${te}-dropdown`,children:[Ie&&e.jsx("div",{className:"nice-country-picker__search",children:e.jsx("input",{ref:de,type:"text",value:_e,onChange:F=>Re(F.target.value),onKeyDown:Fe,placeholder:m??ne("themePicker.filter","Filter themes…"),"aria-label":m??ne("themePicker.filter","Filter themes…"),"aria-controls":$e,"aria-activedescendant":J,"aria-autocomplete":"list",className:"nice-country-picker__search-input","data-testid":`${te}-search`})}),$?.addNew?.enabled&&e.jsxs("button",{type:"button",className:"nice-theme-picker__add-btn nice-theme-picker__add-btn--top",onClick:()=>ke(void 0),"data-testid":`${te}-add`,children:[e.jsx(h.NiceIcon,{name:"plus",size:14})," ",$.addNew.label??$.addLabel??ne("themePicker.addTheme","Add theme")]}),e.jsx("div",{className:"nice-country-picker__list",children:ue.length===0?e.jsx("div",{className:"nice-country-picker__empty",children:ne("noData","No themes found")}):ue.map((F,Ne)=>e.jsxs("div",{id:`${$e}-${Ne}`,className:`nice-country-picker__option nice-theme-picker__option ${F.id===Q?"nice-country-picker__option--selected":""} ${Ne===Oe?"nice-country-picker__option--highlighted":""}`,onClick:()=>Ke(F),onMouseEnter:()=>Je(Ne),role:"option","aria-selected":F.id===Q,"data-testid":`${te}-option-${F.id}`,children:[g&&e.jsx("span",{className:"nice-country-picker__flag","aria-hidden":"true",children:e.jsx(rn.ThemePreviewSwatch,{colors:F.preview,size:X,shape:j})}),c&&e.jsx("span",{className:"nice-country-picker__name",children:rs(F)}),x&&e.jsx("span",{className:"nice-country-picker__dial-code",children:F.id}),fe(F)&&e.jsx("button",{type:"button",className:"nice-theme-picker__edit-btn",onClick:ee=>{ee.stopPropagation(),ke(F.id)},"aria-label":$?.editLabel??ne("themePicker.editTheme","Edit theme"),"data-testid":`${te}-edit-${F.id}`,children:e.jsx(h.NiceIcon,{name:"edit",size:12})})]},F.id))}),$?.enabled&&!$.addNew?.enabled&&e.jsxs("button",{type:"button",className:"nice-theme-picker__add-btn",onClick:()=>ke(void 0),"data-testid":`${te}-add`,children:[e.jsx(h.NiceIcon,{name:"plus",size:14})," ",$.addLabel??ne("themePicker.addTheme","Add theme")]})]}),O&&e.jsx("span",{className:"nice-field__spinner",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),y==="right"&&w&&e.jsx("div",{className:"nice-field__error",role:"alert",children:w}),y==="right"&&!w&&B&&e.jsx("div",{className:"nice-field__helper",children:B})]}),y!=="right"&&w&&e.jsx("div",{className:"nice-field__error",role:"alert",children:w}),y!=="right"&&!w&&B&&e.jsx("div",{className:"nice-field__helper",children:B})]})};process.env.NODE_ENV!=="production"&&(Ns.displayName="NiceThemePicker");const gs=i.createContext(null),js=i.createContext(null),Ws=({children:n,title:s,icon:t,headerExtra:a,footer:r,hoverable:o,bordered:l=!0,onClick:m,selectable:f,selected:p,value:u,onSelect:g,name:d,disabled:c,readOnly:v,loading:x,error:b,size:S,className:C,style:I,displayStyle:j,id:$,testId:M,"data-testid":D})=>{const P=h.useComponentDisplayStyle("card",j),E=h.useComponentDisplayClass("card",j),N=i.useContext(gs),z=i.useContext(js),B=S??z??"md",w=i.useMemo(()=>{if(j)return P;const{background:de,border:re,boxShadow:le,backdropFilter:ge,WebkitBackdropFilter:H,...q}=P;return q},[P,j]),_=N!=null&&u!=null,T=f||_||g!=null,O=d??(_?N.name:void 0),Z=T&&p===void 0&&!_,[y,R]=i.useState(!1),A=_?N.value===u:Z?y:!!p,V=()=>{u!=null&&(g?.(u),_&&N.onChange(u))},te=c||x,G=()=>{te||(T&&!v&&(V(),Z&&R(de=>!de)),m?.())},ne=de=>{!te&&T&&!v&&(de.key===" "||de.key==="Enter")&&(de.preventDefault(),G())},ie=T||m!=null,se=T?"radio":m?"button":void 0,U=typeof b=="string"?b.length>0:!!b;return e.jsxs("div",{className:"nice-card-field",children:[e.jsxs("div",{className:`nice-card nice-card--${B} nice-card--ds-${E} ${l?"nice-card--bordered":"nice-card--frameless"} ${o?"nice-card--hoverable":""} ${m?"nice-card--clickable":""} ${T?"nice-card--selectable":""} ${A?"nice-card--selected":""} ${c?"nice-card--disabled":""} ${v?"nice-card--readonly":""} ${x?"nice-card--loading":""} ${U?"nice-card--error":""} ${C||""}`,style:{...w,...I},id:$,"data-testid":D??M,onClick:ie?G:void 0,onKeyDown:ie?ne:void 0,role:se,"aria-checked":T?A:void 0,"aria-disabled":c||void 0,"aria-busy":x||void 0,"data-value":u!=null?String(u):void 0,"data-name":O,tabIndex:ie&&!c?0:void 0,children:[(s||t||a)&&e.jsxs("div",{className:"nice-card__header",children:[(s||t)&&e.jsxs("div",{className:"nice-card__heading",children:[t&&e.jsx("span",{className:"nice-card__title-icon","aria-hidden":"true",children:t}),s&&e.jsx("h3",{className:"nice-card__title",children:s})]}),a]}),e.jsx("div",{className:"nice-card__body",children:n}),r&&e.jsx("div",{className:"nice-card__footer",children:r}),x&&e.jsx("span",{className:"nice-card__spinner","aria-hidden":"true",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})})]}),typeof b=="string"&&b&&e.jsx("div",{className:"nice-card__error",role:"alert",children:b})]})},Zi=Object.freeze(Object.defineProperty({__proto__:null,NiceCard:Ws,NiceCardGroupSizeContext:js,NiceCardRadioContext:gs},Symbol.toStringTag,{value:"Module"}));function et(n,s,t){const r=window.innerWidth,o=window.innerHeight,l={top:n.top,bottom:o-n.bottom,left:n.left,right:r-n.right},m={top:t+6,bottom:t+6,left:s+6,right:s+6},f=["top","bottom","right","left"],p=f.filter(g=>l[g]>=m[g]),u=p.length?p:f;return u.reduce((g,d)=>l[d]>l[g]?d:g,u[0])}function nt(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 He=({content:n,position:s="auto",size:t="md",followCursor:a,children:r})=>{const[o,l]=i.useState(!1),[m,f]=i.useState({x:0,y:0}),[p,u]=i.useState(null),[g,d]=i.useState("top"),c=i.useId(),v=i.useRef(null),x=i.useRef(null),b=s==="auto"?g:s,S=i.useCallback($=>{a&&f({x:$.clientX,y:$.clientY})},[a]);i.useLayoutEffect(()=>{if(!o||a)return;const $=()=>{const M=v.current;if(!M)return;const D=M.firstElementChild??M;u(D.getBoundingClientRect())};return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[o,a]),i.useLayoutEffect(()=>{if(s!=="auto"||!o||a||!p||!x.current)return;const $=x.current.getBoundingClientRect(),M=et(p,$.width,$.height);d(D=>D===M?D:M)},[s,o,a,p,n,t]);const C=i.cloneElement(r,{"aria-describedby":o?c:void 0}),I=o?(()=>{let $;if(a)$={position:"fixed",left:m.x+12,top:m.y+12};else if(p){const M=nt(p,b);$={position:"fixed",left:M.left,top:M.top,transform:M.transform}}else $={position:"fixed",left:-9999,top:-9999};return e.jsx("span",{ref:x,id:c,className:`nice-tooltip nice-tooltip--${b} nice-tooltip--${t} nice-tooltip--portaled`,role:"tooltip",style:$,children:n})})():null,j=typeof document<"u"?document.body:null;return e.jsxs("span",{ref:v,className:"nice-tooltip-wrapper",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onMouseMove:S,onFocus:()=>l(!0),onBlur:()=>l(!1),children:[C,I!=null&&j!=null?gn.createPortal(I,j):I]})};process.env.NODE_ENV!=="production"&&(He.displayName="NiceTooltip");const Xs=({size:n="md",className:s,style:t,testId:a,"data-testid":r})=>{const{t:o}=h.useNiceTranslation();return e.jsx("div",{className:`nice-spinner nice-spinner--${n} ${s||""}`,style:t,"data-testid":r??a,role:"status","aria-label":o("spinner.loading","Loading")})},st=[],it=({items:n=st,multiple:s=!1,defaultOpen:t=[],size:a="md",width:r,maxWidth:o,animationDuration:l=220,className:m,"data-testid":f,style:p,displayStyle:u})=>{h.useComponentDisplayClass("card",u);const g=h.normalizeSize(a,"NiceAccordion"),[d,c]=i.useState(new Set(t)),v=i.useId(),x=i.useCallback(I=>{c(j=>{const $=new Set(j);return $.has(I)?$.delete(I):(s||$.clear(),$.add(I)),$})},[s]),b=i.useRef(null),S=I=>{const j=[...b.current?.querySelectorAll(":scope > .nice-accordion__item > .nice-accordion__trigger:not(:disabled)")??[]],$=j.indexOf(I.currentTarget),M=I.key==="ArrowDown"?$+1:I.key==="ArrowUp"?$-1:I.key==="Home"?0:I.key==="End"?j.length-1:-1,D=$>=0&&M>=0?j[M]:void 0;D&&D!==I.currentTarget&&(I.preventDefault(),D.focus())},C={...p,...r!==void 0?{width:typeof r=="number"?`${r}px`:r}:{},...o!==void 0?{maxWidth:typeof o=="number"?`${o}px`:o}:{},"--nice-accordion-anim":`${Math.max(0,l)}ms`};return e.jsx("div",{ref:b,className:`nice-accordion nice-accordion--${g} ${m||""}`,style:C,"data-testid":f,children:n.map((I,j)=>{const $=d.has(I.id),M=`${v}-trigger-${j}`,D=`${v}-panel-${j}`;return e.jsxs("div",{className:"nice-accordion__item",children:[e.jsxs("button",{type:"button",id:M,className:"nice-accordion__trigger",onClick:()=>!I.disabled&&x(I.id),onKeyDown:S,"aria-expanded":$,"aria-controls":$?D:void 0,"aria-disabled":I.disabled,disabled:I.disabled,children:[e.jsx("span",{children:I.title}),e.jsx(h.NiceIcon,{name:"chevron-down",size:16,className:`nice-accordion__chevron ${$?"nice-accordion__chevron--open":""}`})]}),$&&e.jsx("div",{id:D,className:"nice-accordion__content",role:"region","aria-labelledby":M,children:I.content})]},I.id)})})},tt=[],at=({items:n=tt,separator:s="/",size:t="md",className:a,"data-testid":r,style:o})=>{const{t:l}=h.useNiceTranslation();return e.jsx("nav",{className:`nice-breadcrumb nice-breadcrumb--${t} ${a||""}`,style:o,"data-testid":r,"aria-label":l("breadcrumb.breadcrumb","Breadcrumb"),children:n.map((m,f)=>e.jsxs(i.Fragment,{children:[f>0&&e.jsx("span",{className:"nice-breadcrumb__separator","aria-hidden":"true",children:s}),f===n.length-1?e.jsx("span",{className:"nice-breadcrumb__current","aria-current":"page",children:m.label}):e.jsx("span",{className:"nice-breadcrumb__item",children:m.href!==void 0?e.jsx("a",{className:"nice-breadcrumb__link",href:m.href,onClick:p=>{m.onClick&&(p.preventDefault(),m.onClick())},children:m.label}):m.onClick?e.jsx("button",{type:"button",className:"nice-breadcrumb__link nice-breadcrumb__link--button",onClick:m.onClick,children:m.label}):m.label})]},f))})},ct=[];function Dn(n){return(n.id??n.key??"")+""}function Qs(n){return n.label??n.text??""}function Zn(n){return n.children??n.items}function ps(n){const s=Zn(n);return!s||s.length===0}function ys(n,s){if(!s)return!1;if(Dn(n)===s)return!0;const t=Zn(n);return t?t.some(a=>ys(a,s)):!1}const Js=({items:n=ct,orientation:s="horizontal",variant:t="ghost",density:a="normal",size:r="md",loading:o=!1,fullWidth:l=!1,showDividers:m=!1,panelAlign:f="start",panelAnchor:p="item",panelMinWidth:u=200,panelMaxWidth:g=360,itemGap:d,paddingX:c,paddingY:v,portal:x=!0,panelZIndex:b=1100,arrowIcon:S=e.jsx(h.NiceIcon,{name:"chevron-down",size:14}),flyoutArrowIcon:C=e.jsx(h.NiceIcon,{name:"chevron-right",size:14}),closeOnSelect:I=!0,openTrigger:j="click",openDelay:$=120,closeDelay:M=180,onOpenChange:D,activeId:P,activeKey:E,onItemClick:N,ariaLabel:z,renderTriggerLabel:B,renderEntryLabel:w,maxDepth:_=3,className:T,"data-testid":O,style:Z,id:y,accessMode:R,displayStyle:A})=>{const{t:V}=h.useNiceTranslation(),te=z??V("menu.menu","Menu"),G=h.useComponentDisplayClass("menu",A),ne=h.useComponentDisplayStyle("menu",A),se=i.useContext(h.NiceThemeContext)?.portalTarget??(typeof document<"u"?document.body:null),U=h.useNiceAccessMode(R,y),de=U==="hidden",re=U==="disabled"||U==="readOnly"||o,le=i.useId(),ge=P??E,H=Math.min(10,Math.max(1,_)),[q,pe]=i.useState(null),[_e,Re]=i.useState([]),Ae=i.useRef(null),Ye=i.useRef(null);i.useEffect(()=>{D?.(q)},[q,D]);const X=i.useCallback(()=>{Ae.current!=null&&(window.clearTimeout(Ae.current),Ae.current=null),Ye.current!=null&&(window.clearTimeout(Ye.current),Ye.current=null)},[]);i.useEffect(()=>()=>X(),[X]);const je=i.useCallback(J=>{X(),q!==J&&(Ae.current=window.setTimeout(()=>{pe(J),Re([])},Math.max(0,$)))},[X,q,$]),Y=i.useCallback(()=>{X(),Ye.current=window.setTimeout(()=>{pe(null),Re([])},Math.max(0,M))},[X,M]),[Q,ue]=i.useState(-1),[we,Ie]=i.useState(-1),[De,Ke]=i.useState(null),Pe=i.useRef(null),Be=i.useRef(null),Ue=i.useRef(new Map),ke=i.useCallback(()=>{if(!q){Ke(null);return}const J=Ue.current.get(q);if(!J)return;const fe=J.getBoundingClientRect();if(s==="vertical")Ke({left:fe.right,top:fe.top,width:fe.width});else{const xe=Be.current?.offsetWidth??Math.max(u,fe.width),Ce=p==="menu"&&Pe.current?Pe.current.getBoundingClientRect():fe;let ze=Ce.left;f==="end"?ze=Ce.right-xe:f==="center"&&(ze=Ce.left+Ce.width/2-xe/2),Ke({left:ze,top:fe.bottom,width:fe.width})}},[q,s,f,p,u]);i.useLayoutEffect(()=>{if(x&&(ke(),q&&(f==="end"||f==="center"))){const J=requestAnimationFrame(ke);return()=>cancelAnimationFrame(J)}},[x,ke,q,f]),i.useEffect(()=>{if(!x||!q)return;const J=()=>ke();return window.addEventListener("scroll",J,!0),window.addEventListener("resize",J),()=>{window.removeEventListener("scroll",J,!0),window.removeEventListener("resize",J)}},[x,q,ke]);const W=i.useMemo(()=>n.filter(J=>Dn(J).length>0),[n]),ve=i.useCallback(()=>{pe(null),Re([]),Ie(-1)},[]);i.useEffect(()=>{if(!q)return;const J=xe=>{const Ce=xe.target;Pe.current&&Pe.current.contains(Ce)||Be.current&&Be.current.contains(Ce)||ve()},fe=xe=>{xe.key==="Escape"&&ve()};return document.addEventListener("mousedown",J),document.addEventListener("keydown",fe),()=>{document.removeEventListener("mousedown",J),document.removeEventListener("keydown",fe)}},[q,ve]);const Oe=(J,fe)=>{if(J.disabled||re)return;const xe=Dn(J);if(ps(J)){J.onClick?.(fe),N?.(J,fe),I&&ve();return}Re([]),pe(q===xe?null:xe),Ie(-1)},Je=i.useCallback((J,fe)=>{Re(xe=>{const Ce=J-2;if(Ce<0)return xe;if(xe[Ce]===fe)return xe.slice(0,Ce);const F=xe.slice(0,Ce);return F[Ce]=fe,F})},[]),Fe=(J,fe)=>{J.disabled||(J.onClick?.(fe),N?.(J,fe),I&&ve())},Ve=J=>{if(re)return;const fe=s==="horizontal",xe=fe?"ArrowLeft":"ArrowUp",Ce=fe?"ArrowRight":"ArrowDown";if(J.key===xe)J.preventDefault(),ue(ze=>ze<=0?W.length-1:ze-1);else if(J.key===Ce)J.preventDefault(),ue(ze=>ze>=W.length-1?0:ze+1);else if(J.key==="Home")J.preventDefault(),ue(0);else if(J.key==="End")J.preventDefault(),ue(W.length-1);else if(J.key==="Enter"||J.key===" "){J.preventDefault();const ze=W[Q];ze&&Oe(ze,J)}else J.key==="Escape"&&ve()};if(de)return null;const an=["nice-menu",`nice-menu--orientation-${s}`,`nice-menu--variant-${t}`,`nice-menu--density-${a}`,`nice-menu--size-${r}`,l?"nice-menu--full-width":"",m?"nice-menu--show-dividers":"",o?"nice-menu--loading":"",G??"",T??""].filter(Boolean).join(" "),$e={...ne,...Z,"--nice-menu-panel-min-w":`${u}px`,"--nice-menu-panel-max-w":`${g}px`};return d!==void 0&&($e["--nice-menu-gap"]=typeof d=="number"?`${d}px`:d),c!==void 0&&($e["--nice-menu-padding-x"]=typeof c=="number"?`${c}px`:c),v!==void 0&&($e["--nice-menu-padding-y"]=typeof v=="number"?`${v}px`:v),e.jsxs("nav",{id:y,ref:Pe,className:an,style:$e,"data-testid":O,"aria-label":te,"aria-busy":o||void 0,children:[o&&e.jsx("span",{className:"nice-menu__spinner","aria-hidden":"true",children:e.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),e.jsx("ul",{className:"nice-menu__list",role:"menubar",onKeyDown:Ve,tabIndex:0,children:W.map((J,fe)=>{const xe=Dn(J),Ce=q===xe,ze=!!ge&&ys(J,ge),F=!ps(J),Ne=["nice-menu__item",Ce?"nice-menu__item--open":"",ze?"nice-menu__item--active":"",J.disabled?"nice-menu__item--disabled":"",J.danger?"nice-menu__item--danger":"",F?"nice-menu__item--has-children":"",Q===fe?"nice-menu__item--focused":""].filter(Boolean).join(" "),ee=B?B(J):Qs(J),me=e.jsxs(e.Fragment,{children:[J.icon?e.jsx("span",{className:"nice-menu__icon",children:J.icon}):null,e.jsx("span",{className:"nice-menu__label",children:ee}),J.badge!=null?e.jsx("span",{className:"nice-menu__badge",children:J.badge}):null,F?e.jsx("span",{className:"nice-menu__arrow","aria-hidden":!0,children:S}):null]});return e.jsxs("li",{className:Ne,role:"none","data-nice-menu-id":xe,"data-nice-depth":1,onMouseEnter:F&&(j==="hover"||j==="both")?()=>je(xe):void 0,onMouseLeave:F&&(j==="hover"||j==="both")?()=>Y():void 0,children:[J.href&&!F?e.jsx("a",{ref:Me=>{Me?Ue.current.set(xe,Me):Ue.current.delete(xe)},className:"nice-menu__btn",href:J.href,target:J.target,rel:J.rel,role:"menuitem","aria-disabled":J.disabled||void 0,"aria-label":J.ariaLabel,tabIndex:Q===fe?0:-1,onClick:Me=>Oe(J,Me),onFocus:()=>ue(fe),children:me}):e.jsx("button",{ref:Me=>{Me?Ue.current.set(xe,Me):Ue.current.delete(xe)},type:"button",className:"nice-menu__btn",disabled:J.disabled||re,role:"menuitem","aria-haspopup":F||void 0,"aria-expanded":F?Ce:void 0,"aria-controls":F?`${le}-panel-${xe}`:void 0,"aria-label":J.ariaLabel,tabIndex:Q===fe?0:-1,onClick:Me=>Oe(J,Me),onFocus:()=>ue(fe),children:me}),F&&Ce?(()=>{const Me=x&&typeof document<"u"&&!!De&&!!se,Ze=Me?{position:"fixed",left:De.left,top:De.top,minWidth:Math.max(u,De.width),maxWidth:g,zIndex:b}:{zIndex:b},en=e.jsx(Zs,{items:Zn(J)??[],depth:2,maxDepth:H,openPath:_e,onToggleBranch:Je,onLeafClick:Fe,effectiveActiveId:ge,renderEntryLabel:w,flyoutArrowIcon:C,openTrigger:j,onPanelEnter:()=>X(),onPanelLeave:()=>Y(),panelClassName:["nice-menu__panel",`nice-menu__panel--align-${f}`,Me?"nice-menu__panel--portal":""].filter(Boolean).join(" "),panelStyle:Ze,panelId:`${le}-panel-${xe}`,panelRef:Me?Be:void 0,focusedEntryIdx:we,setFocusedEntryIdx:Ie});return Me?gn.createPortal(en,se):en})():null]},xe)})})]})};process.env.NODE_ENV!=="production"&&(Js.displayName="NiceMenu");function Zs({items:n,depth:s,maxDepth:t,openPath:a,onToggleBranch:r,onLeafClick:o,effectiveActiveId:l,renderEntryLabel:m,flyoutArrowIcon:f,openTrigger:p,onPanelEnter:u,onPanelLeave:g,panelClassName:d,panelStyle:c,panelId:v,panelRef:x,focusedEntryIdx:b,setFocusedEntryIdx:S}){const C=Math.min(Math.max(s,1),10),I=s===2,j=d??(I?"nice-menu__panel":"nice-menu__subpanel"),M={...{"--nice-row-bg":`var(--nice-menu-level-${C}-bg, var(--nice-bg-elevated, var(--nice-bg-primary)))`,"--nice-row-text":`var(--nice-menu-level-${C}-text, var(--nice-text-primary))`,"--nice-row-border":`var(--nice-menu-level-${C}-border, var(--nice-border-color))`,"--nice-row-hover-bg":`var(--nice-menu-level-${C}-hover-bg, var(--nice-hover-bg))`,"--nice-row-active-bg":`var(--nice-menu-level-${C}-active-bg, var(--nice-selected-bg))`},...c??{}},D=p==="hover"||p==="both"?{onMouseEnter:u,onMouseLeave:g}:{};return e.jsx("div",{ref:x,id:v,className:j,style:M,role:"menu","data-nice-depth":s,...D,children:n.map((P,E)=>{if(P.divider)return e.jsx("hr",{className:"nice-menu__divider"},`d-${E}`);const N=Dn(P),B=!ps(P)&&s<t,w=a[s-2]===N,_=!!l&&ys(P,l),T=["nice-menu__entry",P.disabled?"nice-menu__entry--disabled":"",P.danger?"nice-menu__entry--danger":"",_?"nice-menu__entry--active":"",I&&b===E?"nice-menu__entry--focused":""].filter(Boolean).join(" "),O=e.jsxs(e.Fragment,{children:[P.icon?e.jsx("span",{className:"nice-menu__icon",children:P.icon}):null,e.jsxs("span",{className:"nice-menu__entry-content",children:[e.jsxs("span",{className:"nice-menu__entry-label",children:[m?m(P):Qs(P),P.badge!=null?e.jsx("span",{className:"nice-menu__badge",children:P.badge}):null]}),P.description?e.jsx("span",{className:"nice-menu__entry-desc",children:P.description}):null]}),B?e.jsx("span",{className:"nice-menu__entry-arrow","aria-hidden":!0,children:f}):null]}),Z=R=>{B?r(s,N):o(P,R)},y=I?()=>S?.(E):void 0;return e.jsxs("div",{style:{position:"relative"},onMouseEnter:B?()=>r(s,N):void 0,children:[P.href&&!B?e.jsx("a",{className:T,href:P.href,target:P.target,rel:P.rel,role:"menuitem","aria-disabled":P.disabled||void 0,"aria-label":P.ariaLabel,onClick:Z,onFocus:y,children:O}):e.jsx("button",{type:"button",className:T,disabled:P.disabled,role:"menuitem","aria-haspopup":B||void 0,"aria-expanded":B?w:void 0,"aria-label":P.ariaLabel,onClick:Z,onFocus:y,children:O}),B&&w?e.jsx(Zs,{items:Zn(P)??[],depth:s+1,maxDepth:t,openPath:a,onToggleBranch:r,onLeafClick:o,effectiveActiveId:l,renderEntryLabel:m,flyoutArrowIcon:f,openTrigger:p}):null]},N||`c-${E}`)})})}const rt=[],es=({items:n=rt,target:s,onItemClick:t,size:a="md",className:r,"data-testid":o,style:l})=>{const[m,f]=i.useState(null),p=i.useRef(null);return h.useClickOutside(p,()=>f(null)),h.useOverlayFocus(p,{open:m!=null,modal:!1,onClose:()=>f(null)}),h.useRovingFocus(p,{orientation:"vertical",wrap:!0,typeahead:!0}),i.useEffect(()=>{const u=s.current;if(!u)return;const g=d=>{if(d.preventDefault(),d.clientX===0&&d.clientY===0&&d.target instanceof Element){const c=d.target.getBoundingClientRect();f({x:c.left,y:c.bottom})}else f({x:d.clientX,y:d.clientY})};return u.addEventListener("contextmenu",g),()=>u.removeEventListener("contextmenu",g)},[s]),m?e.jsx("div",{ref:p,"data-testid":o,className:`nice-contextmenu nice-contextmenu--${a} ${r||""}`,style:{position:"fixed",left:m.x,top:m.y,zIndex:1e4,...l},children:e.jsx("ul",{className:"nice-contextmenu__list",role:"menu",children:n.map((u,g)=>e.jsx("li",{className:`nice-contextmenu__item ${u.disabled?"nice-contextmenu__item--disabled":""}`,role:"none",children:e.jsxs("button",{type:"button",className:"nice-contextmenu__btn",disabled:u.disabled,"aria-disabled":u.disabled,role:"menuitem",onClick:d=>{u.onClick?.(d),t?.(u),f(null)},children:[u.icon&&e.jsx("span",{className:"nice-contextmenu__icon","aria-hidden":"true",children:u.icon}),e.jsx("span",{children:u.label??u.text??""})]})},u.id??u.key??g))})}):null},ot=[];function lt(n,s){if(n==null)return null;if(typeof n=="number")return n/s*100;const t=n.trim();if(t.endsWith("%"))return parseFloat(t);const a=parseFloat(t);return Number.isFinite(a)?a/s*100:null}function dt(n,s){const t=n.length||1;let a=n.map(d=>lt(d.size,s));const r=a.reduce((d,c)=>d+(c??0),0),o=a.filter(d=>d==null).length,l=Math.max(0,100-r);a=a.map(d=>d??(o?l/o:100/t));let m=n.map(d=>d.collapsible?0:d.minSize?d.minSize/s*100:0);const f=m.reduce((d,c)=>d+c,0);if(f>100){const d=100/f;m=m.map(c=>c*d)}const p=n.map(d=>d.maxSize?d.maxSize/s*100:100),u=a.map((d,c)=>Math.min(p[c],Math.max(m[c],d??0))),g=u.reduce((d,c)=>d+c,0)||1;return u.map(d=>d/g*100)}const ut=({panes:n=ot,orientation:s="horizontal",gutterSize:t=6,onResize:a,className:r,"data-testid":o,style:l,accessMode:m,id:f})=>{const u=h.useNiceAccessMode(m,f)==="hidden",g=i.useRef(null),[d,c]=i.useState(()=>n.map(()=>100/n.length)),v=i.useRef("");i.useLayoutEffect(()=>{const S=g.current;if(!S)return;const C=s==="horizontal"?S.offsetWidth:S.offsetHeight;if(!C)return;const I=`${s}:${n.map(j=>j.key).join("|")}`;v.current!==I&&(v.current=I,c(dt(n,C)))},[n,s]);const x=i.useCallback((S,C)=>{C.preventDefault();const I=g.current;if(!I)return;const j=C.currentTarget;try{j.setPointerCapture?.(C.pointerId)}catch{}const $=s==="horizontal",M=$?I.offsetWidth:I.offsetHeight,D=$?C.clientX:C.clientY,P=[...d],E=document.body.style.userSelect;document.body.style.userSelect="none";const N=n.map(O=>O.collapsible?0:O.minSize?O.minSize/M*100:5),z=N.reduce((O,Z)=>O+Z,0),B=z>100?100/z:1,w=n.map(O=>O.maxSize?O.maxSize/M*100:100),_=O=>{const Z=(($?O.clientX:O.clientY)-D)/M*100,y=[...P],R=P[S]+P[S+1],A=N[S]*B,V=N[S+1]*B,te=w[S],G=w[S+1];let ne=P[S]+Z,ie=P[S+1]-Z;ne<A&&(ne=A,ie=R-A),ie<V&&(ie=V,ne=R-V),ne>te&&(ne=te,ie=R-te),ie>G&&(ie=G,ne=R-G),y[S]=ne,y[S+1]=ie,c(y),a?.(y)},T=()=>{try{j.releasePointerCapture?.(C.pointerId)}catch{}document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",T),document.removeEventListener("pointercancel",T),document.body.style.userSelect=E};document.addEventListener("pointermove",_),document.addEventListener("pointerup",T),document.addEventListener("pointercancel",T)},[d,s,n,a]),b=s==="horizontal";return u?null:e.jsx("div",{ref:g,"data-testid":o,className:`nice-splitter nice-splitter--${s} ${r||""}`,style:{display:"flex",flexDirection:b?"row":"column",height:"100%",...l},children:n.map((S,C)=>{const I=`calc(${d[C]}% - ${t*(n.length-1)/n.length}px)`;return e.jsxs(i.Fragment,{children:[e.jsx("div",{className:"nice-splitter__pane",style:{"--nice-splitter-pane-size":I,[b?"width":"height"]:I,overflow:"auto"},children:S.render()}),C<n.length-1&&e.jsx("div",{className:`nice-splitter__gutter nice-splitter__gutter--${s}`,role:"separator","aria-orientation":b?"vertical":"horizontal",style:{[b?"width":"height"]:t,cursor:b?"col-resize":"row-resize",flexShrink:0,touchAction:"none"},onPointerDown:j=>x(C,j),children:e.jsx("span",{className:"nice-splitter__grip","aria-hidden":"true"})})]},S.key)})})},ei=i.createContext(null);function jn(){return i.useContext(ei)}const mt=5;function ks(n,s,t,a,r){if(s.button!==0)return;const o=s.currentTarget,l=s.pointerId,m=s.clientX,f=s.clientY;let p=!1,u={x:m,y:f};const g=()=>{try{o.setPointerCapture?.(l)}catch{}};r?.captureOnStart||g();const d=C=>{if(C.pointerId===l){if(u={x:C.clientX,y:C.clientY},!p){if(Math.hypot(C.clientX-m,C.clientY-f)<mt)return;p=!0,r?.captureOnStart&&g()}C.preventDefault(),n.setGhost({label:a,x:C.clientX,y:C.clientY}),n.emit({type:"move",payload:t,x:C.clientX,y:C.clientY})}};let c=!1;const v=C=>{if(!c&&(c=!0,o.removeEventListener("pointermove",d),o.removeEventListener("pointerup",x),o.removeEventListener("pointercancel",b),o.removeEventListener("keydown",S),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",b),p)){n.setGhost(null),n.emit({type:"end",payload:t,x:u.x,y:u.y,commit:C});const I=j=>{j.stopPropagation(),j.preventDefault()};o.addEventListener("click",I,{capture:!0,once:!0}),window.setTimeout(()=>o.removeEventListener("click",I,{capture:!0}),0)}},x=C=>{C.pointerId===l&&v(!0)},b=C=>{C.pointerId===l&&v(!1)},S=C=>{C.key==="Escape"&&p&&(C.preventDefault(),v(!1))};o.addEventListener("pointermove",d),o.addEventListener("pointerup",x),o.addEventListener("pointercancel",b),o.addEventListener("keydown",S),r?.captureOnStart&&(window.addEventListener("pointerup",x),window.addEventListener("pointercancel",b))}const ni=({children:n})=>{const s=i.useRef(new Set),[t,a]=i.useState(null),r=i.useMemo(()=>({subscribe:o=>(s.current.add(o),()=>{s.current.delete(o)}),emit:o=>{s.current.forEach(l=>l(o))},setGhost:a}),[]);return e.jsxs(ei.Provider,{value:r,children:[n,t&&e.jsx("div",{className:"nice-sortable-tree__ghost","aria-hidden":"true",style:{left:t.x,top:t.y},children:t.label})]})};function ht({item:n,active:s,inert:t,onSelect:a}){const r=i.useRef(null);return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:r,type:"button",className:`nice-icon-rail__item${s?" nice-icon-rail__item--active":""}`,title:n.title??n.label,"aria-current":s?"page":void 0,"aria-haspopup":n.menu?.length?"menu":void 0,disabled:t||n.disabled,onClick:()=>{n.onClick?.(),a?.(n)},children:[e.jsxs("span",{className:"nice-icon-rail__icon","aria-hidden":"true",children:[n.icon,n.badge!==void 0&&n.badge!==""&&e.jsx("span",{className:"nice-icon-rail__badge",children:n.badge})]}),e.jsx("span",{className:"nice-icon-rail__label",children:n.label})]}),!!n.menu?.length&&!t&&typeof document<"u"&&gn.createPortal(e.jsx(es,{target:r,items:n.menu,size:"sm"}),document.body)]})}const pt=[],bs=({items:n=pt,orientation:s="vertical",activeId:t,onSelect:a,"aria-label":r,size:o="md",className:l,style:m,id:f,title:p,accessMode:u,"data-testid":g})=>{const{t:d}=h.useNiceTranslation(),c=h.useNiceAccessMode(u,f),v=i.useRef(null);if(h.useRovingFocus(v,{orientation:s,itemSelector:".nice-icon-rail__item"}),c==="hidden")return null;const x=c==="disabled"||c==="readOnly";return e.jsx("div",{ref:v,id:f,title:p,"data-testid":g,role:"toolbar","aria-orientation":s,"aria-label":r??d("iconRail.label","Shortcuts"),className:["nice-icon-rail",`nice-icon-rail--${s}`,`nice-icon-rail--${o}`,l??""].filter(Boolean).join(" "),style:m,children:n.map(b=>e.jsx(ht,{item:b,active:b.id===t,inert:x,onSelect:a},b.id))})},Cs=n=>({kind:"nice-nav-item",item:n});function si(n){return typeof n=="object"&&n!==null&&n.kind==="nice-nav-item"}function bt(){const n=jn(),[s,t]=i.useState(!1);return i.useEffect(()=>{if(n)return n.subscribe(a=>{si(a.payload)&&t(a.type==="move")})},[n]),s}function Wn(n,s,t){const a=jn(),[r,o]=i.useState(!1),l=i.useRef(s);l.current=s;const m=i.useRef(t);return m.current=t,i.useEffect(()=>{if(a)return a.subscribe(f=>{if(!si(f.payload)||!l.current)return;const p=n.current?.getBoundingClientRect(),u=!!p&&f.x>=p.left&&f.x<=p.right&&f.y>=p.top&&f.y<=p.bottom;if(f.type==="move"){o(u),m.current?.(u?{x:f.x,y:f.y}:null);return}o(!1),m.current?.(null),f.commit&&u&&l.current(f.payload.item,{x:f.x,y:f.y})})},[a,n]),r}const ii=10,vt=.12,ti="var(--nice-text-on-warning, #0f172a)";function yn(n){return Math.min(Math.max(n,1),ii)}function vs(n){return h.isDerivableColor(n)?h.nestingLevelColors(1,{palette:[n]},n,ti)[0]:{bg:n,text:"inherit",hoverBg:`color-mix(in srgb, ${n} 88%, currentColor)`,activeBg:`color-mix(in srgb, ${n} 76%, currentColor)`}}function ai(n,s,t){const a=ii-yn(s)+1;if(n.length===0)return[];const r=n.slice(0,a).map(vs),o=a-r.length;if(o>0){const l=n[n.length-1];if(h.isDerivableColor(l)){const m=h.nestingLevelColors(o+1,{palette:[l],bgDerivation:t,bgStep:vt},l,ti);r.push(...m.slice(1))}else r.push(...Array.from({length:o},()=>vs(l)))}return r}function ci(n,s){const t={};return n.forEach((a,r)=>{const o=yn(s)+r;t[`--nice-sidebar-level-${o}-bg`]=a.bg,t[`--nice-sidebar-level-${o}-text`]=a.text,t[`--nice-sidebar-level-${o}-hover-bg`]=a.hoverBg,t[`--nice-sidebar-level-${o}-active-bg`]=a.activeBg}),t}function ri(n,s){return n&&n.length>0?{colors:ai(n,1,s),fromLevel:1}:{fromLevel:1}}function ws(n,s,t,a){const r=s?.levelColors?.length?s.levelColors:s?.color?[s.color]:void 0;if(!r)return{scope:n};const o=yn(t),l=ai(r,o,a);return{scope:{colors:l,fromLevel:o,branchColor:r[0]},vars:ci(l,o)}}function Tn(n,s){return n.colors?.[yn(s)-n.fromLevel]}function ft(n){return vs(n)}const oi=6,_t="45%";function On(n,s){const t=Math.min(n,oi);return`var(--nice-sidebar-level-${n}-${s}, var(--nice-sidebar-shade-${t}-${s}))`}function xt(){return{"--nice-source-head-bg":On(1,"bg"),"--nice-source-head-color":On(1,"text"),"--nice-source-head-bg-active":li(1,On(1,"bg")),"--nice-source-head-accent":"var(--nice-source-head-color)"}}function li(n,s){const t=Math.min(n,oi);return`var(--nice-sidenav-path-${n}-bg, color-mix(in srgb, var(--nice-sidenav-highlight) var(--nice-sidenav-highlight-step-${t}), ${s}))`}function Nt(n,s){const t=yn(n),a=On(t,"bg"),r=On(t,"text"),o=s?a:`var(--nice-bg-sidenav-item, color-mix(in srgb, ${a} var(--nice-sidenav-item-tint, ${_t}), var(--nice-bg-primary)))`,l=s?r:"var(--nice-text-sidenav-item, var(--nice-text-primary))",m={"--nice-row-path-bg":li(t,a),"--nice-row-path-text":`var(--nice-sidenav-path-${t}-text, ${r})`,"--nice-row-active-bg":"var(--nice-sidenav-highlight)","--nice-row-active-text":"var(--nice-text-sidenav-highlight)"};return{"--nice-row-bg":o,"--nice-row-text":l,"--nice-row-hover-bg":`color-mix(in srgb, ${o} 88%, ${l})`,"--nice-row-label":l,"--nice-row-muted":l,"--nice-row-accent":s?l:"var(--nice-color-primary)",...m}}const kn=n=>i.createElement(h.NiceIcon,{name:n,size:18}),gt=kn("list"),jt=kn("user"),yt=kn("building"),kt=kn("star"),Ct=kn("search"),wt=kn("settings"),Fn={all:{icon:gt,label:"Everything"},"by-role":{icon:jt,label:"By role"},"by-unit":{icon:yt,label:"By unit"},favorites:{icon:kt,label:"Favorites"},search:{icon:Ct,label:"Search"},preferences:{icon:wt,label:"Preferences"}},St={all:"all","by-role":"byRole","by-unit":"byUnit",favorites:"favorites",search:"search",preferences:"preferences"};function Rn(n,s){const t=Fn[s];return t?n(`sidebarNav.mode.${St[s]}`,t.label):s}const tn="favorites",Ss={enableModeIcons:!1,enabledModes:["all","by-role","by-unit","favorites","search","preferences"],activeMode:"all",pinnedSources:{},hiddenItems:[],favorites:[],favoriteLists:[],activeFavoriteListId:tn,shortcuts:[],activeGroupId:{},maxDepth:{},collapsedIds:[],autoExpand:!0,leftClickBehavior:"focus-existing",itemOrder:{},colorStyle:"theme",indent:"steps",stickyHeaders:"path",pageMode:"auto"};function di(n,s){return[{id:tn,label:s,items:n.favorites,createdAt:0},...n.favoriteLists??[]]}function Xn(n,s){return s===tn?n.favorites:n.favoriteLists?.find(t=>t.id===s)?.items??[]}function ui(n){const s=n.activeFavoriteListId;return s&&(n.favoriteLists??[]).some(t=>t.id===s)?s:tn}function ns(n,s){const t=n.favorites.some(a=>a.id===s)?[tn]:[];for(const a of n.favoriteLists??[])a.items.some(r=>r.id===s)&&t.push(a.id);return t}function zn(n){return{...n,icon:typeof n.icon=="string"?n.icon:void 0,tooltip:typeof n.tooltip=="string"?n.tooltip:void 0,...n.path?{path:Is(n.path)}:{}}}function Is(n){return n.map(s=>typeof s.icon=="string"?{id:s.id,label:s.label,icon:s.icon}:{id:s.id,label:s.label})}function mi(n,s,t){const a=[],r=(o,l)=>{let m=o.find(f=>f.id===l.id);return m||(m={id:l.id,label:l.label,icon:l.icon,children:[]},o.push(m)),m};for(const o of n){let l=a;for(const f of s(o))l=r(l,f).children;const m=r(l,o);m.favorite=o,m.label=o.label,m.icon=o.icon??m.icon}if(t){const o=l=>{const m=f=>t(f.id)??Number.POSITIVE_INFINITY;l.sort((f,p)=>m(f)===m(p)?0:m(f)<m(p)?-1:1),l.forEach(f=>o(f.children))};o(a)}return a}const qn=n=>({id:n.id,label:n.label,icon:n.icon});function An(n,s,t={}){const a=t.trees??["modules"],r=t.shading??"tint",o=ri(t.levelColors,r),l=(p,u,g,d,c,v)=>{const{scope:x}=ws(c,p,g,r);return s({item:p,kind:u,depth:g,ancestors:d,branchColor:x.branchColor,color:Tn(x,g)?.bg,...v})===!1?void 0:x},m=(p,u,g,d,c)=>{for(const v of p){const x=l(v,"view",u,g,d,c);x&&v.children?.length&&m(v.children,u+1,[...g,qn(v)],x,c)}},f=(p,u,g,d,c,v)=>{for(const x of p){const b={sourceId:c,moduleId:x.id,tree:v},S=l(x,"module",u,g,d,b);S&&m(x.views,u+1,[...g,qn(x)],S,b)}};for(const p of n){const u=p.source,g=l(u,"source",1,[],o,{sourceId:u.id});if(!g)continue;const d=[qn(u)];for(const c of a){if(c==="modules"){f(p.modules,2,d,g,u.id,c);continue}const v=c==="roles"?p.roles:p.units;for(const x of v){const S=l(x,c==="roles"?"role":"unit",2,d,g,{sourceId:u.id,tree:c});S&&f(x.modules,3,[...d,qn(x)],S,u.id,c)}}}}function hi(n,s,t={}){let a;return An(n,r=>{if(a)return!1;if(r.kind==="view"&&r.item.route===s)return a=r,!1},{trees:["modules","roles","units"],...t}),a}function It(n,s){const t=(r,o)=>r.map(l=>{const m=s(l,o);return l.children?.length?{...m,children:t(l.children,o+1)}:m}),a=(r,o)=>r.map(l=>({...l,views:t(l.views,o+1)}));return n.map(r=>({...r,modules:a(r.modules,2),roles:r.roles.map(o=>({...o,modules:a(o.modules,3)})),units:r.units.map(o=>({...o,modules:a(o.modules,3)}))}))}const $t=e.jsx(h.NiceIcon,{name:"settings",size:16}),Et=e.jsx(h.NiceIcon,{name:"columns",size:16}),Mt=e.jsx(h.NiceIcon,{name:"list",size:16}),Lt=e.jsx(h.NiceIcon,{name:"eye-off",size:16}),Rt=e.jsx(h.NiceIcon,{name:"refresh-ccw",size:16}),$s=[{id:"prefs-general",route:"preferences/general",labelKey:"sidebar.prefs.general",labelDefault:"General",icon:$t},{id:"prefs-display",route:"preferences/display",labelKey:"sidebar.prefs.display",labelDefault:"Display",icon:Et},{id:"prefs-order",route:"preferences/order",labelKey:"sidebar.prefs.order",labelDefault:"Order",icon:Mt},{id:"prefs-hidden",route:"preferences/hidden",labelKey:"sidebar.prefs.hidden",labelDefault:"Hidden items",icon:Lt},{id:"prefs-reset",route:"preferences/reset",labelKey:"sidebar.prefs.reset",labelDefault:"Reset",icon:Rt}];function zt(n){return $s.map(s=>({id:s.id,label:n(s.labelKey,s.labelDefault),icon:s.icon,route:s.route}))}function pi({anchorRef:n,onClose:s,options:t,selected:a,multiple:r=!1,onPick:o,onCreate:l,footer:m,title:f,"aria-label":p}){const{t:u}=h.useNiceTranslation(),g=h.useControlId(),[d,c]=i.useState(""),[v,x]=i.useState(null),{popupRef:b,coords:S,ready:C,themeClass:I,portalTarget:j}=Se.useAnchoredPopup(!0,n,s,{maxHeight:360}),$=d.trim(),M=i.useMemo(()=>{const O=$.toLowerCase(),Z=t.filter(R=>!O||R.label.toLowerCase().includes(O)).map(R=>({kind:"option",option:R})),y=t.some(R=>R.label.toLowerCase()===O);return l&&!y&&v===null&&Z.push({kind:"create",label:$}),Z},[t,$,l,v]),D=O=>{l?.(O),c(""),x(null),r||s()},P=O=>{if(O.kind==="create"){O.label?D(O.label):x("");return}o(O.option.id),r||s()},{activeIndex:E,setActiveIndex:N,handleKeyDown:z}=rn.useListKeyboardNav(M,{open:!0,onSelect:P,onClose:s,intentRef:b}),B=O=>`${g}-o${O}`,w=i.useRef(null);i.useEffect(()=>{C&&w.current?.focus()},[C]);const _=i.useRef(null),T=v!==null;return i.useEffect(()=>{T&&_.current?.focus()},[T]),!S||!j?null:gn.createPortal(e.jsxs("div",{ref:b,className:`nice-select__dropdown nice-sidebar-nav__scope-panel${I?` ${I}`:""}`,"data-theme":I==="nice-dark"?"dark":I==="nice-light"?"light":void 0,style:{position:"fixed",left:S.left,top:S.top,width:Math.max(S.width,220),maxHeight:360,zIndex:1e3,opacity:C?1:0,pointerEvents:C?void 0:"none"},children:[e.jsxs("div",{className:"nice-sidebar-nav__scope-head",children:[e.jsx("span",{className:"nice-sidebar-nav__scope-title",children:f??p}),e.jsx("button",{type:"button",className:"nice-sidebar-nav__scope-close","aria-label":u("controls.close","Close"),title:u("controls.close","Close"),onClick:s,children:e.jsx(h.NiceIcon,{name:"close",size:14})})]}),e.jsx("div",{className:"nice-select__search",children:e.jsx("input",{type:"text",value:d,onChange:O=>{c(O.target.value),N(0)},onKeyDown:z,placeholder:u("controls.search","Search..."),"aria-label":u("controls.search","Search..."),"aria-controls":g,"aria-activedescendant":M.length>0?B(E):void 0,"aria-autocomplete":"list",ref:w})}),e.jsxs("div",{id:g,role:"listbox","aria-label":p,"aria-multiselectable":r||void 0,className:"nice-sidebar-nav__scope-options",children:[M.length===0&&e.jsx("div",{className:"nice-select__empty",children:u("controls.noResults","No results found")}),M.map((O,Z)=>{const y=O.kind==="option"&&a.includes(O.option.id);return e.jsx("button",{id:B(Z),type:"button",role:"option",tabIndex:-1,"aria-selected":y,className:["nice-select__option","nice-sidebar-nav__scope-option",y?"nice-select__option--selected":"",Z===E?"nice-select__option--highlighted":"",O.kind==="create"?"nice-sidebar-nav__scope-option--create":""].filter(Boolean).join(" "),onMouseEnter:()=>N(Z),onClick:()=>P(O),children:O.kind==="create"?e.jsxs(e.Fragment,{children:[e.jsx(h.NiceIcon,{name:"plus",size:14}),e.jsx("span",{className:"nice-sidebar-nav__scope-option-label",children:$?u("sidebarNav.favLists.createNamed",'Create "{name}"').replace("{name}",$):u("sidebarNav.favLists.create","New list…")})]}):e.jsxs(e.Fragment,{children:[r&&e.jsx("span",{className:`nice-sidebar-nav__scope-check${y?" nice-sidebar-nav__scope-check--on":""}`,"aria-hidden":"true",children:y&&e.jsx(h.NiceIcon,{name:"check",size:12})}),e.jsx("span",{className:"nice-sidebar-nav__scope-option-label",children:O.option.label}),O.option.count!==void 0&&e.jsx("span",{className:"nice-sidebar-nav__scope-count",children:O.option.count}),!r&&y&&e.jsx(h.NiceIcon,{name:"check",size:14,className:"nice-select__option-check"})]})},O.kind==="option"?O.option.id:"__create")})]}),v!==null&&e.jsxs("form",{className:"nice-sidebar-nav__scope-edit nice-sidebar-nav__scope-new",onSubmit:O=>{O.preventDefault(),v.trim()&&D(v.trim())},children:[e.jsx("input",{ref:_,className:"nice-sidebar-nav__scope-field",value:v,onChange:O=>x(O.target.value),placeholder:u("sidebarNav.favLists.renameField","List name"),"aria-label":u("sidebarNav.favLists.renameField","List name")}),e.jsx("button",{type:"submit",className:"nice-sidebar-nav__scope-action nice-sidebar-nav__scope-action--primary",disabled:!v.trim(),children:u("sidebarNav.favLists.createButton","Create")}),e.jsx("button",{type:"button",className:"nice-sidebar-nav__scope-action",onClick:()=>x(null),children:u("sidebarNav.favLists.cancel","Cancel")})]}),m&&e.jsx("div",{className:"nice-sidebar-nav__scope-footer",children:m})]}),j)}function Dt({label:n,onRename:s,onRemove:t}){const{t:a}=h.useNiceTranslation(),[r,o]=i.useState("idle"),[l,m]=i.useState(n),f=i.useRef(null);return i.useEffect(()=>{r==="rename"&&(f.current?.focus(),f.current?.select())},[r]),r==="rename"?e.jsxs("form",{className:"nice-sidebar-nav__scope-edit",onSubmit:p=>{p.preventDefault(),l.trim()&&s(l.trim()),o("idle")},children:[e.jsx("input",{ref:f,className:"nice-sidebar-nav__scope-field",value:l,onChange:p=>m(p.target.value),"aria-label":a("sidebarNav.favLists.renameField","List name")}),e.jsx("button",{type:"submit",className:"nice-sidebar-nav__scope-action",children:a("sidebarNav.favLists.save","Save")}),e.jsx("button",{type:"button",className:"nice-sidebar-nav__scope-action",onClick:()=>o("idle"),children:a("sidebarNav.favLists.cancel","Cancel")})]}):r==="remove"?e.jsxs("div",{className:"nice-sidebar-nav__scope-edit",role:"group","aria-label":n,children:[e.jsx("span",{className:"nice-sidebar-nav__scope-question",children:a("sidebarNav.favLists.removeConfirm",'Remove the list "{name}"?').replace("{name}",n)}),e.jsx("button",{type:"button",className:"nice-sidebar-nav__scope-action nice-sidebar-nav__scope-action--danger",onClick:t,children:a("sidebarNav.favLists.remove","Remove")}),e.jsx("button",{type:"button",className:"nice-sidebar-nav__scope-action",onClick:()=>o("idle"),children:a("sidebarNav.favLists.cancel","Cancel")})]}):e.jsxs("div",{className:"nice-sidebar-nav__scope-edit",children:[e.jsxs("button",{type:"button",className:"nice-sidebar-nav__scope-action",onClick:()=>{m(n),o("rename")},children:[e.jsx(h.NiceIcon,{name:"edit",size:14}),a("sidebarNav.favLists.rename","Rename")]}),e.jsxs("button",{type:"button",className:"nice-sidebar-nav__scope-action nice-sidebar-nav__scope-action--danger",onClick:()=>o("remove"),children:[e.jsx(h.NiceIcon,{name:"trash",size:14}),a("sidebarNav.favLists.removeList","Remove the list")]})]})}function Ps({options:n,value:s,onChange:t,collapsed:a=!1,icon:r,"aria-label":o,onCreate:l,renderFooter:m}){const{t:f}=h.useNiceTranslation(),p=i.useRef(null),[u,g]=i.useState(!1),d=Math.max(0,n.findIndex(b=>b.id===s)),c=n[d],v=b=>{n.length>1&&t(n[(d+b+n.length)%n.length].id)},x=()=>g(!1);return e.jsxs("div",{ref:p,role:"group","aria-label":o,className:`nice-sidebar-nav__scope${a?" nice-sidebar-nav__scope--collapsed":""}`,children:[e.jsx("button",{type:"button",className:"nice-sidebar-nav__scope-arrow","aria-label":f("sidebarNav.scope.previous","Previous"),title:f("sidebarNav.scope.previous","Previous"),disabled:n.length<2,onClick:()=>v(-1),children:e.jsx(h.NiceIcon,{name:"chevron-left",size:16})}),e.jsxs("button",{type:"button",className:"nice-sidebar-nav__scope-current","aria-haspopup":"listbox","aria-expanded":u,title:c?.label,onClick:()=>g(b=>!b),onKeyDown:b=>{(b.key==="ArrowLeft"||b.key==="ArrowRight")&&(b.preventDefault(),v(b.key==="ArrowLeft"?-1:1))},children:[e.jsx("span",{className:"nice-sidebar-nav__scope-icon","aria-hidden":"true",children:r}),!a&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-sidebar-nav__scope-name",children:c?.label}),c?.count!==void 0&&e.jsx("span",{className:"nice-sidebar-nav__scope-count",children:c.count}),e.jsx("span",{className:"nice-sidebar-nav__scope-caret","aria-hidden":"true",children:e.jsx(h.NiceIcon,{name:"chevron-down",size:14})})]})]}),e.jsx("button",{type:"button",className:"nice-sidebar-nav__scope-arrow","aria-label":f("sidebarNav.scope.next","Next"),title:f("sidebarNav.scope.next","Next"),disabled:n.length<2,onClick:()=>v(1),children:e.jsx(h.NiceIcon,{name:"chevron-right",size:16})}),u&&e.jsx(pi,{anchorRef:p,onClose:x,options:n,selected:c?[c.id]:[],onPick:t,onCreate:l,footer:m?.(x),"aria-label":o})]})}function Qn(n){return n.normalize("NFD").replace(/\p{M}/gu,"").replace(/ł/g,"l").replace(/Ł/g,"L").toLowerCase().trim()}function Bs(n){return typeof n=="string"||typeof n=="number"?String(n):""}function Jn(n,s){return Qn(Bs(n.label)).includes(s)||Qn(Bs(n.tooltip)).includes(s)}function ss(n,s,t){if(!s)return n;const a=[];for(const r of n){if(Jn(r,s)){a.push(r);continue}const o=r.children?.length?ss(r.children,s,t):[];o.length>0&&(t.add(r.id),a.push({...r,children:o}))}return a}function fn(n){return typeof n=="string"?e.jsx(h.NiceIcon,{name:n}):n}const Tt=[],Ot=[],Pn=i.createContext("theme"),bi=i.createContext(!0),vi=i.createContext(null),fi=i.createContext(null),_i=i.createContext(!1),os="__nice-shortcuts__";function Hs(n,s){const t=new Set(s.map(r=>r.toLowerCase()));let a=n;for(let r=2;t.has(a.toLowerCase());r++)a=`${n} ${r}`;return a}function xi(n){return`nice_sidebar_nav_${n??"_default"}`}const ls="nice-sidebar-prefs-change";function Ni(n,s){return n!=null&&(s!=null||n.activeMode!==void 0)}function Ys(n,s,t=s?.activeMode!==void 0){const a={...Ss,userId:n??"_default"};if(s&&Object.assign(a,s),t)return a;try{const r=localStorage.getItem(xi(n));if(r){const o=JSON.parse(r);return Array.isArray(o.favorites)&&(o.favorites=o.favorites.map(l=>l&&typeof l=="object"?{...l,icon:typeof l.icon=="string"||i.isValidElement(l.icon)?l.icon:void 0}:l)),{...a,...o,userId:n??"_default"}}}catch{}return a}function ds(n,s,t,a){if(s===tn){const m=n.favorites.some(f=>f.id===t.id);return a===m?n:{...n,favorites:a?[...n.favorites,{...t,addedAt:Date.now()}]:n.favorites.filter(f=>f.id!==t.id)}}const r=n.favoriteLists??[],o=r.find(m=>m.id===s);if(!o||a===o.items.some(m=>m.id===t.id))return n;const l=a?[...o.items,{...zn(t),addedAt:Date.now()}]:o.items.filter(m=>m.id!==t.id);return{...n,favoriteLists:r.map(m=>m.id===s?{...m,items:l}:m)}}function gi(n,s,t,a,r){const o=r?.controlled??Ni(t,a),[l,m]=i.useState(()=>{const d=Ys(n,t,o);return s!==void 0&&(d.enableModeIcons=s),d}),f=i.useRef(t);i.useEffect(()=>{!t||f.current===t||(f.current=t,m(d=>({...d,...t})))},[t]);const p=i.useRef(l);p.current=l;const u=i.useCallback(d=>{const c=p.current,v=d(c);if(v!==c){if(p.current=v,m(v),!o)try{const x={...v,favorites:v.favorites.map(b=>({...b,icon:void 0})),favoriteLists:(v.favoriteLists??[]).map(b=>({...b,items:b.items.map(zn)})),shortcuts:(v.shortcuts??[]).map(zn)};localStorage.setItem(xi(n),JSON.stringify(x)),typeof window<"u"&&window.dispatchEvent(new CustomEvent(ls,{detail:{userId:n??"_default"}}))}catch{}if(a){const x={};for(const b of Object.keys(v))v[b]!==c[b]&&(x[b]=v[b]);a(v,x)}}},[n,o,a]);i.useEffect(()=>{if(typeof window>"u"||o)return;const d=c=>{c.detail?.userId===(n??"_default")&&m(x=>{const b=Ys(n,t,!1);return s!==void 0&&(b.enableModeIcons=s),JSON.stringify(x)===JSON.stringify(b)?x:b})};return window.addEventListener(ls,d),()=>window.removeEventListener(ls,d)},[n,t,s,o]);const g=i.useMemo(()=>({setMode:d=>u(c=>({...c,activeMode:d})),setEnableModeIcons:d=>u(c=>({...c,enableModeIcons:d})),toggleMode:d=>u(c=>{if(d==="preferences")return c;const v=c.enabledModes.includes(d);return{...c,enabledModes:v?c.enabledModes.filter(x=>x!==d):[...c.enabledModes,d],activeMode:!v||c.activeMode!==d?c.activeMode:"all"}}),pinSource:(d,c)=>u(v=>({...v,pinnedSources:{...v.pinnedSources,[d]:[...v.pinnedSources[d]??[],c]}})),unpinSource:(d,c)=>u(v=>({...v,pinnedSources:{...v.pinnedSources,[d]:(v.pinnedSources[d]??[]).filter(x=>x!==c)}})),hideItem:d=>u(c=>({...c,hiddenItems:c.hiddenItems.some(v=>v.id===d.id)?c.hiddenItems:[...c.hiddenItems,d]})),restoreItem:d=>u(c=>({...c,hiddenItems:c.hiddenItems.filter(v=>v.id!==d)})),addFavorite:(d,c=tn)=>u(v=>ds(v,c,d,!0)),removeFavorite:(d,c=tn)=>u(v=>ds(v,c,{id:d,label:d,addedAt:0},!1)),toggleFavoriteInList:(d,c)=>u(v=>ds(v,c,d,!Xn(v,c).some(x=>x.id===d.id))),createFavoriteList:(d,c)=>{const v=`list-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;return u(x=>(x.favoriteLists??[]).some(b=>b.id===v)?x:{...x,favoriteLists:[...x.favoriteLists??[],{id:v,label:d,items:c?[{...zn(c),addedAt:Date.now()}]:[],createdAt:Date.now()}]}),v},renameFavoriteList:(d,c)=>u(v=>({...v,favoriteLists:(v.favoriteLists??[]).map(x=>x.id===d?{...x,label:c}:x)})),removeFavoriteList:d=>u(c=>d===tn?c:{...c,favoriteLists:(c.favoriteLists??[]).filter(v=>v.id!==d),activeFavoriteListId:c.activeFavoriteListId===d?tn:c.activeFavoriteListId}),setActiveFavoriteList:d=>u(c=>({...c,activeFavoriteListId:d})),addShortcut:(d,c)=>u(v=>{const x=v.shortcuts??[];if(x.some(C=>C.id===d.id))return v;const b=Math.max(0,Math.min(x.length,c??x.length)),S={...zn(d),addedAt:Date.now()};return{...v,shortcuts:[...x.slice(0,b),S,...x.slice(b)]}}),removeShortcut:d=>u(c=>(c.shortcuts??[]).some(v=>v.id===d)?{...c,shortcuts:(c.shortcuts??[]).filter(v=>v.id!==d)}:c),moveShortcut:(d,c)=>u(v=>{const x=v.shortcuts??[],b=x.findIndex(I=>I.id===d),S=Math.max(0,Math.min(x.length-1,c));if(b<0||b===S)return v;const C=x.filter(I=>I.id!==d);return C.splice(S,0,x[b]),{...v,shortcuts:C}}),setActiveGroup:(d,c)=>u(v=>({...v,activeGroupId:{...v.activeGroupId,[d]:c}})),setMaxDepth:(d,c)=>u(v=>({...v,maxDepth:{...v.maxDepth,[d]:Math.min(10,Math.max(1,c))}})),toggleCollapse:d=>u(c=>({...c,collapsedIds:c.collapsedIds.includes(d)?c.collapsedIds.filter(v=>v!==d):[...c.collapsedIds,d]})),setCollapsed:(d,c)=>u(v=>({...v,collapsedIds:c?Array.from(new Set([...v.collapsedIds,...d])):v.collapsedIds.filter(x=>!d.includes(x))})),setAutoExpand:d=>u(c=>({...c,autoExpand:d})),setLeftClickBehavior:d=>u(c=>({...c,leftClickBehavior:d})),reorderItems:(d,c)=>u(v=>{const x={...v.itemOrder};return c==null?delete x[d]:x[d]=c,{...v,itemOrder:x}}),setColorStyle:d=>u(c=>({...c,colorStyle:d})),setIndent:d=>u(c=>({...c,indent:d})),setStickyHeaders:d=>u(c=>({...c,stickyHeaders:d})),setPageMode:d=>u(c=>({...c,pageMode:d})),setFirstRun:(d,c)=>u(v=>{const x={...v,firstRun:d};return c?.pageMode!==void 0&&(x.pageMode=c.pageMode),c?.colorStyle!==void 0&&(x.colorStyle=c.colorStyle),x}),resetAll:()=>u(()=>({...Ss,userId:n??"_default"}))}),[u,n]);return[l,g]}function Ft({enabledModes:n,activeMode:s,onSelect:t,collapsed:a=!1}){const r=i.useRef(null);h.useRovingFocus(r,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const o=i.useRef(null);h.useRovingFocus(o,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const{t:l}=h.useNiceTranslation(),m=[...n.filter(p=>p!=="preferences"),"preferences"],f=l("sidebarNav.modeBar.label","Navigation mode");if(a){const p=Math.max(0,m.indexOf(s)),u=m[(p-1+m.length)%m.length],g=m[(p+1)%m.length],d=Fn[s],c=Rn(l,s);return e.jsxs("div",{className:"nice-sidebar-nav__mode-bar nice-sidebar-nav__mode-bar--carousel",ref:r,role:"tablist","aria-label":f,children:[e.jsx(He,{content:`${l("sidebarNav.modeBar.previous","Previous mode")}: ${Rn(l,u)}`,position:"bottom",size:"sm",children:e.jsx("button",{type:"button",className:"nice-sidebar-nav__mode-arrow","aria-label":l("sidebarNav.modeBar.previous","Previous mode"),onClick:()=>t(u),children:e.jsx("span",{"aria-hidden":"true",children:"‹"})})}),e.jsx(He,{content:c,position:"bottom",size:"sm",children:e.jsx("button",{type:"button",role:"tab","aria-selected":!0,"aria-label":c,className:"nice-sidebar-nav__mode-pill nice-sidebar-nav__mode-pill--active nice-sidebar-nav__mode-pill--carousel",onClick:()=>t(s),children:e.jsx("span",{className:"nice-sidebar-nav__mode-pill-icon","aria-hidden":"true",children:d.icon})})}),e.jsx(He,{content:`${l("sidebarNav.modeBar.next","Next mode")}: ${Rn(l,g)}`,position:"bottom",size:"sm",children:e.jsx("button",{type:"button",className:"nice-sidebar-nav__mode-arrow","aria-label":l("sidebarNav.modeBar.next","Next mode"),onClick:()=>t(g),children:e.jsx("span",{"aria-hidden":"true",children:"›"})})})]})}return e.jsx("div",{className:"nice-sidebar-nav__mode-bar",ref:o,role:"tablist","aria-label":f,children:m.map(p=>{const u=Fn[p],g=Rn(l,p),d=s===p;return e.jsx(He,{content:g,position:"bottom",size:"sm",children:e.jsxs("button",{role:"tab","aria-selected":d,"aria-label":g,className:["nice-sidebar-nav__mode-pill",d?"nice-sidebar-nav__mode-pill--active":""].filter(Boolean).join(" "),onClick:()=>t(p),children:[e.jsx("span",{className:"nice-sidebar-nav__mode-pill-icon","aria-hidden":"true",children:u.icon}),e.jsx("span",{className:"nice-sidebar-nav__mode-pill-label",children:g})]})},p)})})}function Es({open:n,size:s=16}){return e.jsx(h.NiceIcon,{name:"chevron-down",size:s,style:{transition:"transform 160ms ease",transform:n?"rotate(0deg)":"rotate(-90deg)"}})}function ji({size:n=14}){return e.jsx(h.NiceIcon,{name:"star",size:n})}function yi({size:n=14}){return e.jsx(h.NiceIcon,{name:"star",size:n,style:{fill:"currentColor"}})}function ki({size:n=14}){return e.jsx(h.NiceIcon,{name:"eye-off",size:n})}function At({size:n=14,filled:s=!1}){return e.jsx(h.NiceIcon,{name:"pin",size:n,style:s?{fill:"currentColor"}:void 0})}function Ms({size:n=12}){return e.jsx(h.NiceIcon,{name:"close",size:n})}const Ci=i.createContext(null);function Ls({item:n,depth:s,maxDepth:t,activeRoute:a,collapsedIds:r,hiddenIds:o,autoExpand:l,sidebarCollapsed:m=!1,expandableWhenCollapsed:f=!1,onNavigate:p,onHide:u,onToggleCollapse:g,onAddFavorite:d,onRemoveFavorite:c,isFavorite:v,leftClickBehavior:x="focus-existing",routeToUrl:b,contextMenu:S=!0,disabledActions:C,colorScope:I,shading:j,path:$,onRemoveFromList:M}){const{t:D}=h.useNiceTranslation(),P=i.useContext(Pn),E=i.useContext(bi),N=i.useContext(vi),z=i.useContext(fi),B=jn(),w=i.useContext(_i),[_,T]=i.useState(!1),O=i.useRef(null),Z=(n.children?.length??0)>0&&s<t,y=r.includes(n.id),A=i.useContext(Ci)?.has(n.id)===!0||(l?!y:y),V=i.useCallback(()=>{const X=O.current,je=X?.parentElement,Y=X&&je&&A&&X.getBoundingClientRect().top-je.getBoundingClientRect().top>1?X.getBoundingClientRect().top:null;g(n.id),Y!==null&&je&&requestAnimationFrame(()=>{const Q=je.closest(".nice-sidebar-nav__body");Q&&(Q.scrollTop+=je.getBoundingClientRect().top-Y)})},[A,g,n.id]),te=!!(n.route&&a&&n.route===a),G=!!n.route,ne=G&&v(n.id),ie=G&&z?z.stateOf(n.id):"predefined",se=ie!=="predefined",{scope:U,vars:de}=i.useMemo(()=>ws(I,n,s,j),[I,n,s,j]),re=i.useMemo(()=>[...$,{id:n.id,label:n.label,icon:n.icon}],[$,n.id,n.label,n.icon]),le=i.useCallback(X=>({forceNew:X,color:Tn(U,s)?.bg,branchColor:U.branchColor,path:re}),[U,s,re]),ge=i.useCallback(()=>({id:n.id,label:n.label,icon:n.icon,route:n.route,sourceId:n.sourceId,moduleId:n.moduleId,color:U.branchColor??Tn(U,s)?.bg,path:Is($),addedAt:Date.now()}),[n,U,s,$]),H=i.useMemo(()=>{if(!S||!G||!n.route)return[];const X=n.route,je=[{id:"open",label:D("sidebar.menu.open","Open"),onClick:()=>p?.(X,n,le(!1))}];return E&&je.push({id:"openNewTab",label:D("sidebar.menu.openNewTab","Open in new tab"),onClick:()=>p?.(X,n,le(!0))}),b&&je.push({id:"openBrowserTab",label:D("sidebar.menu.openBrowserTab","Open in new browser tab"),onClick:()=>{typeof window<"u"&&window.open(b(X),"_blank","noopener,noreferrer")}}),je.push({id:"sep-1",divider:!0}),M?je.push({id:"removeFromList",label:D("sidebarNav.removeFavourite","Remove from favourites"),onClick:()=>M(n.id)}):ne?je.push({id:"unpinFavorite",label:D("sidebar.menu.unpinFavorite","Remove from favorites"),onClick:()=>c(n.id)}):je.push({id:"pinFavorite",label:D("sidebar.menu.pinFavorite","Add to favorites"),onClick:()=>d(ge())}),N&&je.push({id:"favoriteLists",label:D("sidebarNav.favLists.addTo","Add to a list…"),onClick:()=>T(!0)}),z&&se&&je.push({id:ie==="user"?"removeShortcut":"addShortcut",label:ie==="user"?D("sidebarNav.removeShortcut","Remove from shortcuts"):D("sidebarNav.addShortcut","Add to shortcuts"),onClick:()=>z.toggle(ge())}),M||je.push({id:"hide",label:D("sidebar.menu.hide","Hide"),disabled:!!C?.has("hide"),onClick:()=>u({id:n.id,kind:n.kind,label:n.label})}),b&&(je.push({id:"sep-2",divider:!0}),je.push({id:"copyLink",label:D("sidebar.menu.copyLink","Copy link"),onClick:()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(b(X))}})),je},[S,E,C,G,n,ne,b,p,d,c,u,le,ge,N,z,ie,se,M,D]);if(o.has(n.id))return null;function q(){if(Z&&!G){C?.has("collapseToggle")||V();return}G&&n.route&&(p?.(n.route,n,le(x==="open-new")),Z&&!A&&!C?.has("collapseToggle")&&g(n.id))}const pe=yn(s),_e=Tn(U,s),Re=P==="fill",Ae=P==="bar"&&!!_e,Ye=m?re.map(X=>X.label).join(" › "):n.tooltip??n.label;return e.jsxs("li",{className:["nice-sidebar-nav__node",`nice-sidebar-nav__node--depth-${s}`,s>4?"nice-sidebar-nav__node--deep":"",Re?_e?"nice-sidebar-nav__node--colored":"":"nice-sidebar-nav__node--shaded",Ae?"nice-sidebar-nav__node--marked":"",te?"nice-sidebar-nav__node--active":"",Z?"nice-sidebar-nav__node--branch":"nice-sidebar-nav__node--leaf"].filter(Boolean).join(" "),"data-nice-depth":s,style:{...Re?de:void 0,"--nice-depth":s,...Re?{"--nice-row-bg":`var(--nice-sidebar-level-${pe}-bg, transparent)`,"--nice-row-text":`var(--nice-sidebar-level-${pe}-text, inherit)`,"--nice-row-border":`var(--nice-sidebar-level-${pe}-border, transparent)`,"--nice-row-hover-bg":`var(--nice-sidebar-level-${pe}-hover-bg, var(--nice-hover-bg))`,"--nice-row-active-bg":`var(--nice-sidebar-level-${pe}-active-bg, var(--nice-selected-bg))`,"--nice-row-accent":`var(--nice-sidebar-level-${pe}-text, var(--nice-color-primary, #3b82f6))`,"--nice-row-label":`var(--nice-sidebar-level-${pe}-text, var(--nice-text-primary))`,"--nice-row-muted":`var(--nice-sidebar-level-${pe}-text, var(--nice-text-muted))`}:{...Nt(s,Z),...Ae&&_e?{"--nice-row-mark":_e.bg}:void 0}},children:[e.jsxs("div",{className:"nice-sidebar-nav__node-row",ref:O,children:[Z&&e.jsx(He,{content:A?D("sidebarNav.collapse","Collapse"):D("sidebarNav.expand","Expand"),position:"right",size:"sm",children:e.jsx("button",{className:"nice-sidebar-nav__collapse-btn","aria-label":A?D("sidebarNav.collapse","Collapse"):D("sidebarNav.expand","Expand"),"aria-expanded":A,disabled:C?.has("collapseToggle"),onClick:V,children:e.jsx(Es,{open:A,size:20})})}),!Z&&e.jsx("span",{className:"nice-sidebar-nav__collapse-spacer"}),e.jsx(He,{content:Ye,position:"right",size:"sm",children:e.jsxs("span",{role:G?"link":void 0,tabIndex:G?0:void 0,className:["nice-sidebar-nav__node-content",G?"nice-sidebar-nav__node-content--link":"",!G&&Z?"nice-sidebar-nav__node-content--toggle":""].filter(Boolean).join(" "),onClick:q,onKeyDown:X=>(X.key==="Enter"||X.key===" ")&&q(),onPointerDown:w&&B&&G?X=>{X.pointerType!=="touch"&&ks(B,X,Cs(ge()),n.label,{captureOnStart:!0})}:void 0,children:[n.icon&&e.jsx("span",{className:"nice-sidebar-nav__node-icon","aria-hidden":"true",children:fn(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} ${D("sidebarNav.notifications","notifications")}`,children:n.badge})]})}),e.jsxs("div",{className:"nice-sidebar-nav__node-actions",children:[G&&e.jsx(He,{content:ne?D("sidebarNav.inFavorites","In favorites"):D("sidebarNav.addFavorite","Add to favorites"),position:"top",size:"sm",children:e.jsx("button",{type:"button",className:`nice-sidebar-nav__action-btn ${ne?"nice-sidebar-nav__action-btn--fav-active":"nice-sidebar-nav__action-btn--fav"}`,"aria-label":ne?D("sidebarNav.inFavorites","In favorites"):D("sidebarNav.addFavorite","Add to favorites"),"aria-haspopup":N?"listbox":void 0,"aria-expanded":N?_:void 0,onClick:X=>{X.stopPropagation(),N?T(je=>!je):ne||d(ge())},children:ne?e.jsx(yi,{size:14}):e.jsx(ji,{size:14})})}),M?G&&e.jsx(He,{content:D("sidebarNav.removeFavourite","Remove from favourites"),position:"top",size:"sm",children:e.jsx("button",{type:"button",className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--remove","aria-label":D("sidebarNav.removeFavourite","Remove from favourites"),onClick:X=>{X.stopPropagation(),M(n.id)},children:e.jsx(Ms,{size:12})})}):e.jsx(He,{content:D("sidebarNav.hideItem","Hide item"),position:"top",size:"sm",children:e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide","aria-label":D("sidebarNav.hideItem","Hide item"),onClick:X=>{X.stopPropagation(),u({id:n.id,kind:n.kind,label:n.label})},children:e.jsx(ki,{size:14})})})]})]}),H.length>0&&e.jsx(es,{target:O,items:H,size:"sm"}),_&&N&&e.jsx(pi,{anchorRef:O,onClose:()=>T(!1),multiple:!0,options:z&&se?[...N.lists,{id:os,label:D("sidebarNav.shortcuts","Shortcuts"),count:z.count}]:N.lists,selected:ie==="user"?[...N.listsOf(n.id),os]:N.listsOf(n.id),onPick:X=>X===os&&z?z.toggle(ge()):N.toggle(ge(),X),onCreate:X=>N.create(X,ge()),"aria-label":D("sidebarNav.favLists.title","Favourites lists")}),Z&&A&&e.jsx("ul",{className:"nice-sidebar-nav__children",children:n.children.map(X=>e.jsx(Ls,{item:X,depth:s+1,maxDepth:t,activeRoute:a,collapsedIds:r,hiddenIds:o,autoExpand:l,sidebarCollapsed:m,expandableWhenCollapsed:f,onNavigate:p,onHide:u,onToggleCollapse:g,onAddFavorite:d,onRemoveFavorite:c,isFavorite:v,leftClickBehavior:x,routeToUrl:b,contextMenu:S,disabledActions:C,colorScope:U,shading:j,path:re,onRemoveFromList:M},X.id))})]})}function Ks(n,s){if(!s||s.length===0)return n;const t=new Map(s.map((r,o)=>[r,o])),a=s.length;return[...n].sort((r,o)=>{const l=t.has(r.id)?t.get(r.id):a+n.indexOf(r),m=t.has(o.id)?t.get(o.id):a+n.indexOf(o);return l-m})}function wi(n,s,t){return n.map(a=>({id:a.id,label:a.label,tooltip:a.tooltip,icon:a.icon,route:a.route,badge:a.badge,kind:"view",sourceId:s,moduleId:t,color:a.color,levelColors:a.levelColors,children:a.children?.length?wi(a.children,s,t):[]}))}function Si(n,s,t=n.id){return{id:t,label:n.label,tooltip:n.tooltip,icon:n.icon,kind:"module",sourceId:s,color:n.color,levelColors:n.levelColors,children:wi(n.views,s,n.id)}}function Pt(n,s){return n.map(t=>Si(t,s))}function Rs(n,s,t){return n.map(a=>({id:a.id,label:a.label,tooltip:a.tooltip,icon:a.icon,kind:s,sourceId:t,color:a.color,levelColors:a.levelColors,children:a.modules.map(r=>Si(r,t,`${a.id}:${r.id}`))}))}function Bt(n,s){return Rs(n,"role",s)}function Ht(n,s){return Rs(n,"unit",s)}function Ii(n,s,t,a){if(s==="all")return Ks(Pt(n.modules,n.source.id),a);if(t!==void 0){const r=(s==="by-role"?n.roles:n.units).filter(o=>o.id===t);return Rs(r,s==="by-role"?"role":"unit",n.source.id).flatMap(o=>o.children??[])}return Ks(s==="by-role"?Bt(n.roles,n.source.id):Ht(n.units,n.source.id),a)}const us=xt();function $i(n,s,t,a){const{scope:r,vars:o}=ws(n,s,1,t),l=Tn(r,1);return a==="theme"?{scope:r,style:us,marked:!1}:a==="bar"?l?{scope:r,style:{...us,"--nice-source-mark":l.bg},marked:!0}:{scope:r,style:us,marked:!1}:l?{scope:r,style:{...o,"--nice-source-head-bg":l.bg,"--nice-source-head-color":l.text,"--nice-source-head-bg-active":l.activeBg,"--nice-source-head-accent":l.text},marked:!1}:{scope:r,style:o,marked:!1}}function fs(n,s){for(const t of n){if(t.route===s)return[];if(t.children?.length){const a=fs(t.children,s);if(a)return[t.id,...a]}}}function Yt({node:n,mode:s,maxDepth:t,isPinned:a,prefs:r,helpers:o,activeRoute:l,onNavigate:m,sidebarCollapsed:f=!1,expandableWhenCollapsed:p=!1,routeToUrl:u,contextMenu:g=!0,disabledActions:d,showHeader:c=!0,colorScope:v,shading:x,groupFilter:b,pin:S,query:C=""}){const{t:I}=h.useNiceTranslation(),j=i.useRef(null),$=i.useMemo(()=>new Set(r.hiddenItems.map(re=>re.id)),[r.hiddenItems]),M=i.useContext(Pn),{scope:D,style:P,marked:E}=i.useMemo(()=>$i(v,n.source,x,M),[v,n.source,x,M]),N=i.useMemo(()=>{const re=[{id:n.source.id,label:n.source.label,icon:n.source.icon}],le=b===void 0||s==="all"?void 0:(s==="by-role"?n.roles:n.units).find(ge=>ge.id===b);return le?[...re,{id:le.id,label:le.label,icon:le.icon}]:re},[n,s,b]),{children:z,searchOpen:B}=i.useMemo(()=>{const re=Ii(n,s,b,r.itemOrder[s]);if(!C)return{children:re,searchOpen:null};const le=new Set;return{children:ss(re,C,le),searchOpen:le}},[s,n,r.itemOrder,b,C]),w=i.useCallback(re=>ns({favorites:r.favorites,favoriteLists:r.favoriteLists},re).length>0,[r.favorites,r.favoriteLists]),_=i.useRef(void 0);i.useEffect(()=>{if(!l||_.current===l)return;const re=fs(z,l);if(!re)return;_.current=l;const le=re.filter(ge=>r.autoExpand?r.collapsedIds.includes(ge):!r.collapsedIds.includes(ge));le.length>0&&o.setCollapsed(le,!r.autoExpand)},[l,z,r.autoExpand,r.collapsedIds,o]);const T=i.useMemo(()=>g?[{id:a?"unpinSource":"pinSource",label:a?I("sidebar.menu.unpinSource","Unpin source"):I("sidebar.menu.pinSource","Pin source"),onClick:()=>a?o.unpinSource(s,n.source.id):o.pinSource(s,n.source.id)},{id:"hideSource",label:I("sidebar.menu.hideSource","Hide source"),disabled:!!d?.has("hide"),onClick:()=>o.hideItem({id:n.source.id,kind:"source",label:n.source.label})}]:[],[g,d,a,o,s,n.source,I]),O=i.useMemo(()=>!!l&&fs(z,l)!==void 0,[l,z]);if($.has(n.source.id))return null;const Z=r.collapsedIds.includes(n.source.id),y=r.autoExpand?!Z:Z,R=z.filter(re=>(re.children?.length??0)>0).map(re=>re.id),A=R.length>0,V=A&&R.every(re=>r.collapsedIds.includes(re)),te=A?!V:y,G=!c||A?!0:y,ne=()=>{d?.has("collapseToggle")||(A?o.setCollapsed(R,!V):o.toggleCollapse(n.source.id))},ie=E?"nice-sidebar-nav__source-section nice-sidebar-nav__source-section--marked":"nice-sidebar-nav__source-section",se=re=>e.jsx(He,{content:n.source.tooltip??n.source.label,position:"right",size:"sm",children:e.jsxs("div",{ref:re?j:void 0,className:"nice-sidebar-nav__source-header",onClick:le=>{le.target.closest(".nice-sidebar-nav__source-actions")||ne()},role:"button",tabIndex:0,"aria-expanded":te,onKeyDown:le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),ne())},children:[e.jsx("span",{className:"nice-sidebar-nav__source-chevron","aria-hidden":"true",children:e.jsx(Es,{open:te,size:16})}),n.source.icon&&e.jsx("span",{className:"nice-sidebar-nav__source-icon","aria-hidden":"true",children:fn(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:le=>le.stopPropagation(),onKeyDown:le=>{le.key!=="Escape"&&le.stopPropagation()},children:[e.jsx(He,{content:a?I("sidebarNav.unpinSource","Unpin source"):I("sidebarNav.pinSource","Pin source"),position:"top",size:"sm",children:e.jsx("button",{className:["nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--pin",a?"nice-sidebar-nav__action-btn--pin-active":""].filter(Boolean).join(" "),"aria-label":a?I("sidebarNav.unpinSource","Unpin source"):I("sidebarNav.pinSource","Pin source"),onClick:()=>a?o.unpinSource(s,n.source.id):o.pinSource(s,n.source.id),children:e.jsx(At,{size:14,filled:a})})}),e.jsx(He,{content:I("sidebarNav.hideSource","Hide source"),position:"top",size:"sm",children:e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide","aria-label":I("sidebarNav.hideSource","Hide source"),onClick:()=>o.hideItem({id:n.source.id,kind:"source",label:n.source.label}),children:e.jsx(ki,{size:14})})})]})]})}),U=T.length>0?e.jsx(es,{target:j,items:T,size:"sm"}):null,de=!!S?.current;return e.jsxs("section",{className:ie,style:P,"data-source-index":S?.index,children:[c&&!S&&e.jsxs(e.Fragment,{children:[se(!0),U]}),c&&S&&S.index>0&&e.jsxs("div",{className:"nice-sidebar-nav__source-flow",inert:de||void 0,"aria-hidden":de||void 0,children:[se(!de),!de&&U]}),c&&de&&S?.slot&&gn.createPortal(e.jsxs("section",{className:[ie,"nice-sidebar-nav__source-section--pinned",O?"nice-sidebar-nav__source-section--has-active":""].filter(Boolean).join(" "),style:P,children:[se(!0),U]}),S.slot),t>1&&G&&e.jsx(Ci.Provider,{value:B,children:e.jsx("ul",{className:"nice-sidebar-nav__tree",children:z.map(re=>e.jsx(Ls,{item:re,depth:2,maxDepth:t,activeRoute:l,collapsedIds:r.collapsedIds,hiddenIds:$,autoExpand:r.autoExpand,sidebarCollapsed:f,expandableWhenCollapsed:p,onNavigate:m,onHide:o.hideItem,onToggleCollapse:o.toggleCollapse,onAddFavorite:o.addFavorite,onRemoveFavorite:o.removeFavorite,isFavorite:w,leftClickBehavior:r.leftClickBehavior,routeToUrl:u,contextMenu:g,disabledActions:d,colorScope:D,shading:x,path:N},re.id))})})]})}function Kt({favorites:n,activeRoute:s,onNavigate:t,onRemove:a,collapsed:r=!1,leftClickBehavior:o="focus-existing"}){const{t:l}=h.useNiceTranslation(),m=i.useContext(Pn),f=m==="fill",p=o==="open-new";return n.length===0?e.jsx("p",{className:"nice-sidebar-nav__empty",children:l("sidebarNav.noFavourites","No favourites yet. Hover an item and click the star to add it.")}):e.jsx("ul",{className:"nice-sidebar-nav__favorites-list",children:n.map(u=>{const g=!!(u.route&&u.route===s),d={forceNew:p,color:u.color,branchColor:u.color},c=u.color&&m!=="theme"?ft(u.color):void 0;return e.jsxs("li",{className:["nice-sidebar-nav__fav-item",g?"nice-sidebar-nav__fav-item--active":"",c?f?"nice-sidebar-nav__fav-item--colored":"nice-sidebar-nav__fav-item--marked":""].filter(Boolean).join(" "),style:c?f?{"--nice-fav-bg":c.bg,"--nice-fav-text":c.text,"--nice-fav-hover-bg":c.hoverBg}:{"--nice-fav-mark":c.bg}:void 0,children:[e.jsx(He,{content:u.tooltip??u.label,position:"right",size:"sm",children:e.jsxs("span",{role:"link",tabIndex:0,className:"nice-sidebar-nav__fav-content",onClick:()=>{u.route&&t?.(u.route,u,d)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&u.route&&t?.(u.route,u,d)},children:[(typeof u.icon=="string"||i.isValidElement(u.icon))&&e.jsx("span",{className:"nice-sidebar-nav__fav-icon","aria-hidden":"true",children:fn(u.icon)}),e.jsx("span",{className:"nice-sidebar-nav__fav-label",children:u.label})]})}),!r&&e.jsx(He,{content:l("sidebarNav.removeFavourite","Remove from favourites"),position:"top",size:"sm",children:e.jsx("button",{className:"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--remove","aria-label":l("sidebarNav.removeFavourite","Remove from favourites"),onClick:()=>a(u.id),children:e.jsx(Ms,{size:12})})})]},u.id)})})}const ms="fav:",Ut=new Set;function Ei(n){const s=n.favorite;return{id:n.id,label:n.label,icon:n.icon,tooltip:s?.tooltip,route:s?.route,kind:s?"view":"module",sourceId:s?.sourceId,moduleId:s?.moduleId,children:n.children.map(Ei)}}function Vt({favorites:n,pathOf:s,sources:t,rank:a,showSources:r,prefs:o,helpers:l,activeRoute:m,onNavigate:f,onRemove:p,collapsed:u,routeToUrl:g,contextMenu:d,disabledActions:c,colorScope:v,shading:x}){const{t:b}=h.useNiceTranslation(),S=i.useContext(Pn),C=i.useMemo(()=>mi(n,s,N=>a.get(N)),[n,s,a]),I=i.useMemo(()=>o.collapsedIds.filter(N=>N.startsWith(ms)).map(N=>N.slice(ms.length)),[o.collapsedIds]),j=i.useCallback(N=>l.toggleCollapse(ms+N),[l]),$=i.useCallback(N=>ns({favorites:o.favorites,favoriteLists:o.favoriteLists},N).length>0,[o.favorites,o.favoriteLists]);if(n.length===0)return e.jsx("p",{className:"nice-sidebar-nav__empty",children:b("sidebarNav.noFavourites","No favourites yet. Hover an item and click the star to add it.")});const M=(N,z,B,w)=>e.jsx(Ls,{item:Ei(N),depth:2,maxDepth:Number.POSITIVE_INFINITY,activeRoute:m,collapsedIds:I,hiddenIds:Ut,autoExpand:!0,sidebarCollapsed:u,onNavigate:f,onHide:l.hideItem,onToggleCollapse:j,onAddFavorite:l.addFavorite,onRemoveFavorite:l.removeFavorite,isFavorite:$,leftClickBehavior:o.leftClickBehavior,routeToUrl:g,contextMenu:d,disabledActions:c,colorScope:z,shading:x,path:B,onRemoveFromList:p},w),D=[];let P=[];const E=()=>{P.length>0&&(D.push(e.jsx("ul",{className:"nice-sidebar-nav__tree",children:P},`rows-${D.length}`)),P=[])};for(const N of C){const z=t.get(N.id);if(!z){P.push(M(N,v,[],N.id));continue}const{scope:B,style:w,marked:_}=$i(v,z,x,S),T=[{id:z.id,label:z.label,icon:z.icon}];if(!r){for(const Z of N.children)P.push(M(Z,B,T,`${N.id}/${Z.id}`));continue}E();const O=!I.includes(N.id);D.push(e.jsxs("section",{className:_?"nice-sidebar-nav__source-section nice-sidebar-nav__source-section--marked":"nice-sidebar-nav__source-section",style:w,children:[e.jsx(He,{content:z.tooltip??z.label,position:"right",size:"sm",children:e.jsxs("div",{className:"nice-sidebar-nav__source-header",role:"button",tabIndex:0,"aria-expanded":O,onClick:()=>j(N.id),onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),j(N.id))},children:[e.jsx("span",{className:"nice-sidebar-nav__source-chevron","aria-hidden":"true",children:e.jsx(Es,{open:O,size:16})}),z.icon&&e.jsx("span",{className:"nice-sidebar-nav__source-icon","aria-hidden":"true",children:fn(z.icon)}),e.jsx("span",{className:"nice-sidebar-nav__source-label",children:z.label})]})}),O&&e.jsx("ul",{className:"nice-sidebar-nav__tree",children:N.children.map(Z=>M(Z,B,T,Z.id))})]},N.id))}return E(),e.jsx(e.Fragment,{children:D})}function qt(n,s,t){const a=[],r=new Set;return An(n,o=>{if(o.kind!=="view")return;const l=o.item;if(l.children?.length&&!l.route)return;const m=`${o.sourceId}::${l.id}`;r.has(m)||(r.add(m),a.push({view:l,breadcrumb:o.ancestors,color:o.color,branchColor:o.branchColor}))},{trees:["modules","roles","units"],levelColors:s,shading:t}),a}function Gt({data:n,activeRoute:s,onNavigate:t,hiddenIds:a,leftClickBehavior:r="focus-existing",levelColors:o,shading:l}){const{t:m}=h.useNiceTranslation(),[f,p]=i.useState(""),u=r==="open-new",g=i.useMemo(()=>qt(n,o,l),[n,o,l]),d=i.useMemo(()=>{const c=f.trim().toLowerCase();return c?g.filter(v=>a.has(v.view.id)||v.breadcrumb.some(x=>a.has(x.id))?!1:v.view.label.toLowerCase().includes(c)?!0:v.breadcrumb.some(x=>x.label.toLowerCase().includes(c))):[]},[g,f,a]);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.jsx(h.NiceIcon,{name:"search",size:14})}),e.jsx("input",{type:"text",className:"nice-sidebar-nav__search-input",placeholder:m("sidebarNav.search.placeholder","Search views…"),value:f,onChange:c=>p(c.target.value),autoFocus:!0,"aria-label":m("sidebarNav.search.label","Search views")}),f&&e.jsx("button",{type:"button",className:"nice-sidebar-nav__search-clear","aria-label":m("common.clear","Clear"),onClick:()=>p(""),children:e.jsx(Ms,{size:12})})]}),!f.trim()&&e.jsx("p",{className:"nice-sidebar-nav__empty",children:m("sidebarNav.searchHint","Type to search every view available in the panel.")}),f.trim()&&d.length===0&&e.jsxs("p",{className:"nice-sidebar-nav__empty",children:[m("sidebarNav.noResults","No results for")," “",f,"”."]}),d.length>0&&e.jsx("ul",{className:"nice-sidebar-nav__search-results",children:d.map((c,v)=>{const x=!!(c.view.route&&c.view.route===s),b=!!c.view.route;return e.jsx("li",{className:["nice-sidebar-nav__search-result",x?"nice-sidebar-nav__search-result--active":""].filter(Boolean).join(" "),children:e.jsxs("button",{type:"button",className:"nice-sidebar-nav__search-result-btn",disabled:!b,onClick:()=>{b&&c.view.route&&t?.(c.view.route,c.view,{forceNew:u,color:c.color,branchColor:c.branchColor,path:[...c.breadcrumb,{id:c.view.id,label:c.view.label}]})},children:[e.jsx("span",{className:"nice-sidebar-nav__search-result-breadcrumb",children:c.breadcrumb.map((S,C)=>e.jsxs("span",{className:"nice-sidebar-nav__search-crumb",children:[S.icon&&e.jsx("span",{className:"nice-sidebar-nav__search-crumb-icon","aria-hidden":"true",children:fn(S.icon)}),e.jsx("span",{className:"nice-sidebar-nav__search-crumb-label",children:S.label}),e.jsx("span",{className:"nice-sidebar-nav__search-crumb-sep","aria-hidden":"true",children:"›"})]},`${S.id}-${C}`))}),e.jsxs("span",{className:"nice-sidebar-nav__search-result-view",children:[c.view.icon&&e.jsx("span",{className:"nice-sidebar-nav__node-icon","aria-hidden":"true",children:fn(c.view.icon)}),e.jsx("span",{className:"nice-sidebar-nav__node-label",children:c.view.label}),c.view.badge!==void 0&&e.jsx("span",{className:"nice-sidebar-nav__node-badge",children:c.view.badge})]})]})},`${c.view.id}-${v}`)})})]})}function Wt({activeRoute:n,onNavigate:s,leftClickBehavior:t="focus-existing"}){const{t:a}=h.useNiceTranslation(),r=t==="open-new";return e.jsx("ul",{className:"nice-sidebar-nav__prefs-categories",role:"list",children:$s.map(o=>{const l=a(o.labelKey,o.labelDefault),m=n===o.route,f={id:o.id,label:l,icon:o.icon,route:o.route};return e.jsx("li",{className:["nice-sidebar-nav__node nice-sidebar-nav__node--leaf",m?"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(He,{content:l,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,f,{forceNew:r}),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),s?.(o.route,f,{forceNew:r}))},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:l})]})})]})},o.id)})})}function Xt({onFavorite:n,onShortcut:s}){const{t}=h.useNiceTranslation(),a=bt(),r=i.useRef(null),o=i.useRef(null),l=Wn(r,n),m=Wn(o,s);if(!a||!n&&!s)return null;const f=p=>`nice-sidebar-nav__drop-zone${p?" nice-sidebar-nav__drop-zone--over":""}`;return e.jsxs("div",{className:"nice-sidebar-nav__drop-bar","aria-hidden":"true","data-testid":"sidebar-drop-bar",children:[n&&e.jsxs("div",{ref:r,className:f(l),title:t("sidebarNav.dropFavorites","Add to favourites"),"data-testid":"sidebar-drop-favorites",children:[e.jsx(ji,{size:16}),e.jsx("span",{className:"nice-sidebar-nav__drop-label",children:t("sidebarNav.favLists.default","Favourites")})]}),s&&e.jsxs("div",{ref:o,className:f(m),title:t("sidebarNav.addShortcut","Add to shortcuts"),"data-testid":"sidebar-drop-shortcuts",children:[e.jsx(h.NiceIcon,{name:"pin",size:16}),e.jsx("span",{className:"nice-sidebar-nav__drop-label",children:t("sidebarNav.shortcuts","Shortcuts")})]})]})}const Qt=i.forwardRef(function({data:s=Tt,userId:t,activeRoute:a,onNavigate:r,enableModeIcons:o,preferences:l,onPreferencesChange:m,width:f=264,collapsedWidth:p=56,position:u="left",minimal:g=!1,showModeStrip:d,showSources:c,showFavorites:v,showFooterPreferences:x,sticky:b=!0,surfaceOpacity:S,embedded:C=!1,header:I,footerExtra:j,collapsed:$,onCollapsedChange:M,expandableWhenCollapsed:D=!1,railItems:P,railOpen:E,defaultRailOpen:N,onRailOpenChange:z,railWidth:B=76,railActiveId:w,shortcutsRail:_=!1,predefinedShortcuts:T,allowUserShortcuts:O=!0,collapseLevel:Z,defaultCollapseLevel:y="expanded",onCollapseLevelChange:R,groupPicker:A=!0,favoritesLayout:V="list",getFavoritePath:te,inlineSearch:G=!1,searchText:ne,defaultSearchText:ie="",onSearchChange:se,searchPlaceholder:U,size:de="md",className:re,routeToUrl:le,contextMenu:ge=!0,openInNewTab:H=!0,disabledContextMenuActions:q,readonly:pe=!1,levelColors:_e,levelShading:Re="auto","data-testid":Ae},Ye){const{t:X}=h.useNiceTranslation(),je=i.useContext(h.NiceThemeContext),Y=Re==="auto"?je?.theme.darkMode==="dark"?"shade":"tint":Re,Q=i.useMemo(()=>ri(_e,Y),[_e,Y]),ue=i.useMemo(()=>{const L=new Set(q??[]);return pe&&["hide","reorder","rename","newGroup"].forEach(K=>L.add(K)),L},[q,pe]),we=d??!g,Ie=c??!g,De=v??!g,Ke=x??!g,Pe=!C&&_,[Be,Ue]=i.useState(y),ke=Z??($===void 0?Be:$?Be==="expanded"?"icons":Be:"expanded"),W=C?"expanded":ke==="rail"&&!Pe?"icons":ke,ve=W!=="expanded",Oe=i.useCallback(L=>{if(L===W)return;Ue(L),R?.(L);const K=L!=="expanded";K!==ve&&M?.(K)},[W,ve,R,M]),Je=i.useCallback(()=>Oe(ve?"expanded":"icons"),[ve,Oe]),Fe=!C&&!!P&&P.length>0,[Ve,an]=h.useControllableState({value:E,defaultValue:N,fallbackValue:!1,componentName:"NiceSidebarNav"}),$e=Fe&&Ve&&!ve,J=L=>{an(L),z?.(L)},fe=$e||W==="expanded"||W==="icons"&&Pe,xe=()=>{$e?J(!1):W==="expanded"?Oe("icons"):W==="icons"&&Pe&&Oe("rail")},Ce=ve||Fe&&!$e,ze=()=>{W==="rail"?Oe("icons"):W==="icons"?Oe("expanded"):Fe&&!$e&&J(!0)},F=w??P?.find(L=>L.route&&L.route===a)?.id,Ne=L=>{!L.onClick&&L.route&&r?.(L.route,{id:L.id,label:L.label,icon:L.icon,route:L.route})},[ee,me]=gi(t,o,l,m),[Me,Ze]=i.useState(ie),en=ne??Me,nn=G?Qn(en):"",Cn=i.useCallback(L=>{ne===void 0&&Ze(L),se?.(L)},[ne,se]),on=i.useMemo(()=>{const L=ee.activeMode;if(L==="favorites"||L==="preferences"||L==="search")return s;const K=ee.pinnedSources[L];return!K||K.length===0?s:s.filter(oe=>K.includes(oe.source.id))},[s,ee.activeMode,ee.pinnedSources]),wn=ee.maxDepth[ee.activeMode],Sn=wn==null||wn>=10?Number.POSITIVE_INFINITY:wn,dn=X("sidebarNav.favLists.default","Favourites"),hn=i.useMemo(()=>di({favorites:ee.favorites,favoriteLists:ee.favoriteLists},dn),[ee.favorites,ee.favoriteLists,dn]),Qe=ui(ee),Bn=i.useMemo(()=>({lists:hn.map(L=>({id:L.id,label:L.label,count:L.items.length})),listsOf:L=>ns({favorites:ee.favorites,favoriteLists:ee.favoriteLists},L),toggle:me.toggleFavoriteInList,create:(L,K)=>{me.createFavoriteList(Hs(L,hn.map(oe=>oe.label)),K)}}),[hn,ee.favorites,ee.favoriteLists,me]),sn=O&&ee.shortcuts||Ot,un=Pe&&O,is=i.useMemo(()=>{if(!un)return null;const L=new Set((T??[]).map(oe=>oe.id)),K=new Set(sn.map(oe=>oe.id));return{stateOf:oe=>L.has(oe)?"predefined":K.has(oe)?"user":null,toggle:oe=>K.has(oe.id)?me.removeShortcut(oe.id):me.addShortcut(oe),count:sn.length}},[un,T,sn,me]),In=i.useRef(null),$n=i.useMemo(()=>{if(W!=="rail")return{buttons:[],entries:[]};const L=new Map;An(s,be=>{const Ge=be.item.icon??[...be.ancestors.slice(1)].reverse().find(ln=>ln.icon!=null)?.icon??null;Ge!=null&&!L.has(be.item.id)&&L.set(be.item.id,Ge)},{trees:["modules","roles","units"]});const K=ee.leftClickBehavior==="open-new",oe=new Set,Le=[],ae=[],ye=(be,Ge)=>{if(oe.has(be.id))return;oe.add(be.id),ae.push({fav:be,own:Ge});const ln=be.icon??L.get(be.id)??[...be.path??[]].reverse().find(Ln=>Ln.icon!=null)?.icon??"circle",Mn=Ln=>{be.route&&(In.current=be.route,r?.(be.route,be,{forceNew:Ln,color:be.color,branchColor:be.color,path:be.path}))},Vn=sn.findIndex(Ln=>Ln.id===be.id),cs=[];H&&be.route&&cs.push({id:"openNewTab",label:X("sidebar.menu.openNewTab","Open in new tab"),onClick:()=>Mn(!0)}),Ge&&cs.push({id:"moveUp",label:X("sidebarNav.moveShortcutUp","Move up"),disabled:Vn<=0,onClick:()=>me.moveShortcut(be.id,Vn-1)},{id:"moveDown",label:X("sidebarNav.moveShortcutDown","Move down"),disabled:Vn>=sn.length-1,onClick:()=>me.moveShortcut(be.id,Vn+1)},{id:"removeShortcut",label:X("sidebarNav.removeShortcut","Remove from shortcuts"),onClick:()=>me.removeShortcut(be.id)}),Le.push({id:be.id,label:be.label,icon:fn(ln),title:typeof be.tooltip=="string"?be.tooltip:be.label,route:be.route,onClick:()=>Mn(K),menu:cs})};return(T??[]).forEach(be=>ye(be,!1)),sn.forEach(be=>ye(be,!0)),{buttons:Le,entries:ae}},[W,s,T,sn,ee.leftClickBehavior,r,H,me,X]),_n=$n.buttons,xn=jn(),Nn=i.useCallback(L=>{if(L.id)return{...L,addedAt:Date.now()};const K=L.route?hi(s,L.route):void 0;return K?{id:K.item.id,label:K.item.label,icon:K.item.icon,route:L.route,sourceId:K.sourceId,moduleId:K.moduleId,color:K.branchColor??K.color,path:Is(K.ancestors),addedAt:Date.now()}:{...L,id:`route:${L.route??L.label}`,addedAt:Date.now()}},[s]),En=i.useCallback(L=>me.addFavorite(Nn(L),Qe),[me,Nn,Qe]),k=i.useCallback((L,K)=>{const oe=Nn(L);if((T??[]).some(ae=>ae.id===oe.id))return;const Le=sn.findIndex(ae=>ae.id===oe.id);Le<0?me.addShortcut(oe,K):K!==void 0&&me.moveShortcut(oe.id,Le<K?K-1:K)},[Nn,T,sn,me]),ce=i.useRef(null),[he,Te]=i.useState(null),qe=L=>{const K=ce.current,oe=K?.getBoundingClientRect().top??0,Le=K?Array.from(K.querySelectorAll(".nice-icon-rail__item")):[],ae=$n.entries.flatMap((ln,Mn)=>ln.own&&Le[Mn]?[Le[Mn].getBoundingClientRect()]:[]),ye=ae.filter(ln=>ln.top+ln.height/2<L).length,be=Le[Le.length-1]?.getBoundingClientRect(),Ge=ye<ae.length?ae[ye].top:ae.length>0?ae[ae.length-1].bottom:be?.bottom??oe;return{index:ye,line:Ge-oe}},We=Wn(ce,W==="rail"&&un?(L,K)=>k(L,qe(K.y).index):null,L=>Te(L?qe(L.y).line:null)),Ee=L=>{const K=L.target.closest(".nice-icon-rail__item");if(!xn||!K||L.pointerType==="touch")return;const oe=Array.from(L.currentTarget.querySelectorAll(".nice-icon-rail__item")).indexOf(K),Le=$n.entries[oe];Le?.own&&ks(xn,L,Cs(Le.fav),Le.fav.label,{captureOnStart:!0})},pn=i.useMemo(()=>{const L=new Map,K=new Map,oe=new Map,Le=new Map;return V!=="tree"?{parentsOf:L,items:K,sources:oe,rank:Le}:(An(s,ae=>{const ye={id:ae.item.id,label:ae.item.label,icon:ae.item.icon};ae.kind==="source"&&oe.set(ae.item.id,ae.item);const be=ae.tree==="roles"||ae.tree==="units";be&&ae.kind==="module"?K.set(`${ae.ancestors[1].id}:${ae.item.id}`,ye):K.has(ae.item.id)||K.set(ae.item.id,ye),ae.kind==="view"&&!L.has(ae.item.id)&&L.set(ae.item.id,be?ae.ancestors.map((Ge,ln)=>ln===2?{...Ge,id:`${ae.ancestors[1].id}:${Ge.id}`}:Ge):ae.ancestors)},{trees:["modules","roles","units"]}),[...K.keys()].forEach((ae,ye)=>Le.set(ae,ye)),{parentsOf:L,items:K,sources:oe,rank:Le})},[s,V]),Ai=i.useCallback(L=>(te?.(L)??L.path??pn.parentsOf.get(L.id)??[]).map(K=>{const oe=pn.items.get(K.id);return oe?{id:K.id,label:oe.label,icon:oe.icon??K.icon}:K}),[te,pn]),zs=i.useMemo(()=>V!=="tree"?[]:Xn({favorites:ee.favorites,favoriteLists:ee.favoriteLists},Qe).map(L=>typeof L.icon=="string"||i.isValidElement(L.icon)?L:{...L,icon:pn.items.get(L.id)?.icon}),[V,ee.favorites,ee.favoriteLists,Qe,pn]),cn=ee.activeMode==="by-role"||ee.activeMode==="by-unit"?ee.activeMode:null,Hn=i.useMemo(()=>{if(!cn||A===!1)return[];const L=new Set(ee.hiddenItems.map(ae=>ae.id)),K=new Map;for(const ae of on)for(const ye of cn==="by-role"?ae.roles:ae.units)!L.has(ye.id)&&!K.has(ye.id)&&K.set(ye.id,{id:ye.id,label:ye.label});const oe=ee.itemOrder[cn]??[],Le=ae=>{const ye=oe.indexOf(ae);return ye<0?oe.length:ye};return[...K.values()].map((ae,ye)=>({o:ae,i:ye})).sort((ae,ye)=>Le(ae.o.id)-Le(ye.o.id)||ae.i-ye.i).map(({o:ae})=>ae)},[cn,A,on,ee.hiddenItems,ee.itemOrder]),mn=cn&&Hn.length>1?Hn.find(L=>L.id===ee.activeGroupId?.[cn])?.id??Hn[0].id:void 0,Pi=ee.activeMode==="all"||ee.activeMode==="by-role"||ee.activeMode==="by-unit",Bi=new Set(ee.hiddenItems.map(L=>L.id)),ts=i.useMemo(()=>{const L=ee.activeMode;return!nn||L==="favorites"||L==="preferences"||L==="search"?on:on.filter(K=>ss(Ii(K,L,mn,ee.itemOrder[L]),nn,new Set).length>0)},[nn,on,ee.activeMode,ee.itemOrder,mn]),Yn=Pi?ts.filter(L=>!Bi.has(L.source.id)&&(mn===void 0||(ee.activeMode==="by-role"?L.roles:L.units).some(K=>K.id===mn))):[],Kn=ee.stickyHeaders!=="none"&&Ie&&Yn.length>0,[Hi,Yi]=i.useState(null),[Ds,Ki]=i.useState(0),Un=i.useRef(null),Ui=Wn(Un,W!=="rail"&&De&&ee.activeMode==="favorites"?En:null);i.useEffect(()=>{const L=In.current;if(!L||L!==a)return;const K=requestAnimationFrame(()=>{const oe=Un.current,ae=oe?.querySelector(".nice-sidebar-nav__node--active > *")?.getBoundingClientRect();if(!oe||!ae||ae.height===0)return;In.current=null;const ye=oe.getBoundingClientRect();if(ae.top>=ye.top&&ae.bottom<=ye.bottom)return;const be=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;oe.scrollBy({top:ae.top-ye.top-(ye.height-ae.height)/2,behavior:be?"auto":"smooth"})});return()=>cancelAnimationFrame(K)});const Vi=Yn.map(L=>L.source.id).join("|");i.useEffect(()=>{const L=Un.current;if(!Kn||!L)return;let K=0;const oe=()=>{K=0;const ae=L.getBoundingClientRect().top;let ye=0;L.querySelectorAll("[data-source-index] > .nice-sidebar-nav__source-flow").forEach(be=>{const Ge=be.querySelector(".nice-sidebar-nav__source-header")?.getBoundingClientRect();Ge&&Ge.height>0&&Ge.bottom<=ae&&(ye=Math.max(ye,Number(be.parentElement?.dataset.sourceIndex??0)))}),Ki(ye)},Le=()=>{K||(K=requestAnimationFrame(oe))};return oe(),L.addEventListener("scroll",Le,{passive:!0}),()=>{L.removeEventListener("scroll",Le),K&&cancelAnimationFrame(K)}},[Kn,Vi,ee.activeMode]);const qi=Ds<Yn.length?Ds:0;function Gi(){const L=ee.activeMode;if(De&&L==="favorites")return V==="tree"?e.jsx(Vt,{favorites:nn?zs.filter(K=>Jn(K,nn)):zs,pathOf:Ai,sources:pn.sources,rank:pn.rank,showSources:Ie,prefs:ee,helpers:me,activeRoute:a,onNavigate:r,onRemove:K=>me.removeFavorite(K,Qe),collapsed:ve,routeToUrl:le,contextMenu:ge,disabledActions:ue,colorScope:Q,shading:Y}):e.jsx(Kt,{favorites:Xn(ee,Qe).filter(K=>!nn||Jn(K,nn)),activeRoute:a,onNavigate:r,onRemove:K=>me.removeFavorite(K,Qe),collapsed:ve,leftClickBehavior:ee.leftClickBehavior});if(Ke&&L==="preferences")return e.jsx(Wt,{activeRoute:a,onNavigate:r,leftClickBehavior:ee.leftClickBehavior});if(we&&L==="search"){const K=new Set(ee.hiddenItems.map(oe=>oe.id));return e.jsx(Gt,{data:s,activeRoute:a,onNavigate:r,hiddenIds:K,leftClickBehavior:ee.leftClickBehavior,levelColors:_e,shading:Y})}return on.length===0?e.jsx("p",{className:"nice-sidebar-nav__empty",children:X("sidebarNav.noSources","No data sources are visible in this mode.")}):ts.length===0?e.jsx("p",{className:"nice-sidebar-nav__empty",children:X("sidebarNav.noMatches","Nothing matches “{query}”.").replace("{query}",en)}):ts.map(K=>{const oe=(ee.pinnedSources[L]??[]).includes(K.source.id);if(mn!==void 0&&!(L==="by-role"?K.roles:K.units).some(ae=>ae.id===mn))return null;const Le=Yn.indexOf(K);return e.jsx(Yt,{node:K,mode:L,maxDepth:Sn,isPinned:oe,prefs:ee,helpers:me,activeRoute:a,onNavigate:r,sidebarCollapsed:ve,expandableWhenCollapsed:D,routeToUrl:le,contextMenu:ge,disabledActions:ue,showHeader:Ie,colorScope:Q,shading:Y,groupFilter:mn,query:nn,pin:Kn&&Le>=0?{slot:Hi,index:Le,current:Le===qi}:void 0},K.source.id)})}let as=null;if(De&&ee.activeMode==="favorites"){const L=hn.find(K=>K.id===Qe);as=e.jsx(Ps,{options:Bn.lists,value:Qe,onChange:me.setActiveFavoriteList,collapsed:ve,icon:e.jsx(yi,{size:16}),"aria-label":X("sidebarNav.favLists.title","Favourites lists"),onCreate:K=>me.setActiveFavoriteList(me.createFavoriteList(Hs(K,hn.map(oe=>oe.label)))),renderFooter:L&&L.id!==tn?K=>e.jsx(Dt,{label:L.label,onRename:oe=>me.renameFavoriteList(L.id,oe),onRemove:()=>{me.removeFavoriteList(L.id),K()}}):void 0},"favorites")}else cn&&mn!==void 0&&(as=e.jsx(Ps,{options:Hn,value:mn,onChange:L=>me.setActiveGroup(cn,L),collapsed:ve,icon:Fn[cn].icon,"aria-label":cn==="by-role"?X("sidebarNav.scope.role","Role"):X("sidebarNav.scope.unit","Organizational unit")},cn));const Ts=$e?X("sidebarNav.railHide","Hide the bar"):W==="expanded"?X("sidebarNav.collapseToIcons","Collapse to icons"):X("sidebarNav.collapseToShortcuts","Fold to the shortcuts"),Os=W==="rail"?X("sidebarNav.shortcutsToIcons","Show the icons"):ve?X("sidebarNav.expand","Expand the sidebar"):X("sidebarNav.railShow","Show the bar"),Wi=["nice-sidebar-nav",`nice-sidebar-nav--${de}`,`nice-sidebar-nav--${u}`,g?"nice-sidebar-nav--minimal":"",C?"nice-sidebar-nav--embedded":"",b&&!C?"nice-sidebar-nav--sticky":"",ee.enableModeIcons&&we?"nice-sidebar-nav--with-strip":"",ve?"nice-sidebar-nav--collapsed":"",ve&&D?"nice-sidebar-nav--expandable-collapsed":"",$e?"nice-sidebar-nav--with-rail":"",W==="rail"?"nice-sidebar-nav--shortcuts-rail":"",ee.colorStyle!=="fill"?"nice-sidebar-nav--shaded":"",ee.indent==="none"?"nice-sidebar-nav--flat":"",ee.stickyHeaders==="path"&&!ve?"nice-sidebar-nav--sticky-path":"",re].filter(Boolean).join(" "),Fs={...S!=null?{"--nice-sidebar-surface-alpha":String(S)}:{},...Q.colors?ci(Q.colors,1):{}},Xi=C?{width:"100%",...Fs}:{"--nice-sidebar-w":`${f}px`,"--nice-sidebar-w-collapsed":`${W==="rail"?B:p}px`,...Fe?{"--nice-sidebar-rail-w":`${B}px`}:{},width:W==="rail"?B:ve?p:$e?f+B:f,...Fs};return e.jsxs("div",{ref:Ye,className:Wi,style:Xi,"data-testid":Ae,"data-mode":ee.activeMode,children:[$e&&e.jsx(bs,{className:"nice-sidebar-nav__rail",items:P,activeId:F,onSelect:Ne,"aria-label":X("sidebarNav.rail","Shortcuts")}),I!=null&&e.jsx("div",{className:"nice-sidebar-nav__header",children:I}),ee.enableModeIcons&&we&&W!=="rail"&&e.jsx(Ft,{enabledModes:G?ee.enabledModes.filter(L=>L!=="search"):ee.enabledModes,activeMode:ee.activeMode,onSelect:me.setMode,collapsed:ve}),W!=="rail"&&as,G&&!ve&&e.jsxs("div",{className:"nice-sidebar-nav__search-box",role:"search",children:[e.jsx(h.NiceIcon,{name:"search",size:14}),e.jsx("input",{type:"search",className:"nice-sidebar-nav__search-box-input",value:en,onChange:L=>Cn(L.target.value),onKeyDown:L=>{L.key==="Escape"&&en&&(L.stopPropagation(),Cn(""))},placeholder:U??X("sidebarNav.searchPlaceholder","Search the menu"),"aria-label":U??X("sidebarNav.searchPlaceholder","Search the menu"),"data-testid":"sidebar-inline-search"})]}),W==="rail"?e.jsxs("div",{ref:ce,className:["nice-sidebar-nav__content","nice-sidebar-nav__shortcuts",We?"nice-sidebar-nav__shortcuts--drop":""].filter(Boolean).join(" "),onPointerDown:Ee,children:[We&&he!==null&&e.jsx("div",{className:"nice-sidebar-nav__drop-line",style:{top:he},"aria-hidden":"true"}),_n.length>0?e.jsx(bs,{className:"nice-sidebar-nav__shortcuts-rail",items:_n,activeId:_n.find(L=>L.route&&L.route===a)?.id??void 0,"aria-label":X("sidebarNav.shortcuts","Shortcuts"),"data-testid":"sidebar-shortcuts-rail"}):un&&e.jsx("p",{className:"nice-sidebar-nav__shortcuts-empty",children:X("sidebarNav.shortcutsEmpty","No shortcuts yet — add them from an item’s star.")})]}):e.jsx("div",{className:"nice-sidebar-nav__content",children:e.jsx(Pn.Provider,{value:ee.colorStyle,children:e.jsx(bi.Provider,{value:H,children:e.jsx(vi.Provider,{value:Bn,children:e.jsx(fi.Provider,{value:is,children:e.jsxs(_i.Provider,{value:!!xn&&(De||un),children:[Kn&&e.jsx("div",{className:"nice-sidebar-nav__pinned",ref:Yi}),e.jsx("div",{className:`nice-sidebar-nav__body${Ui?" nice-sidebar-nav__body--drop":""}`,ref:Un,children:Gi()})]})})})})})}),W!=="rail"&&e.jsx(Xt,{onFavorite:De?En:null,onShortcut:un?k:null}),(Fe||Pe)&&e.jsxs("div",{className:"nice-sidebar-nav__footer nice-sidebar-nav__footer--levels",children:[fe&&e.jsxs("button",{type:"button",className:"nice-sidebar-nav__footer-toggle nice-sidebar-nav__footer-toggle--down",onClick:xe,"aria-label":Ts,title:Ts,children:[e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-icon","aria-hidden":"true",children:e.jsx(h.NiceIcon,{name:u==="right"?"chevron-right":"chevron-left",size:18})}),e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-label",children:X("sidebarNav.collapseShort","Collapse")})]}),e.jsxs("button",{type:"button",className:"nice-sidebar-nav__footer-toggle nice-sidebar-nav__footer-toggle--up",onClick:ze,disabled:!Ce,"aria-label":Os,title:Os,children:[e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-label",children:X("sidebarNav.expandShort","Expand")}),e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-icon","aria-hidden":"true",children:e.jsx(h.NiceIcon,{name:u==="right"?"chevron-left":"chevron-right",size:18})})]}),j!=null&&e.jsx("div",{className:"nice-sidebar-nav__footer-extra",children:j})]}),!C&&!Fe&&!Pe&&e.jsxs("div",{className:"nice-sidebar-nav__footer",children:[e.jsxs("button",{type:"button",className:"nice-sidebar-nav__footer-toggle",onClick:Je,"aria-label":ve?X("sidebarNav.expand","Expand the sidebar"):X("sidebarNav.collapseToIcons","Collapse to icons"),title:ve?X("sidebarNav.expand","Expand the sidebar"):X("sidebarNav.collapseToIcons","Collapse to icons"),children:[e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-icon","aria-hidden":"true",children:e.jsx(h.NiceIcon,{name:"chevron-left",size:18,style:{transition:"transform 160ms ease",transform:(u==="right"?!ve:ve)?"rotate(180deg)":"rotate(0deg)"}})}),e.jsx("span",{className:"nice-sidebar-nav__footer-toggle-label",children:ve?X("sidebarNav.expandShort","Expand"):X("sidebarNav.collapseToIcons","Collapse to icons")})]}),j!=null&&e.jsx("div",{className:"nice-sidebar-nav__footer-extra",children:j})]}),C&&j!=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:j})})]})}),Jt=i.forwardRef(function(s,t){const a=jn(),r=e.jsx(Qt,{...s,ref:t});return a?r:e.jsx(ni,{children:r})}),Zt=[],Mi=({steps:n=Zt,activeStep:s,orientation:t="horizontal",onStepClick:a,allowStepClick:r=!1,showStepNumbers:o=!0,className:l,style:m,"data-testid":f})=>{const{t:p}=h.useNiceTranslation();return e.jsxs("div",{className:`nice-stepper nice-stepper--${t} ${l||""}`,style:m,"data-testid":f,children:[e.jsx("div",{className:"nice-stepper__header",children:n.map((u,g)=>{const d=(C,I)=>C.status??(I<s?"completed":I===s?"active":"pending"),c=d(u,g),v=c==="completed",x=c==="active",b=g>0&&d(n[g-1],g-1)==="completed",S=c==="pending"?"":`nice-stepper__step--${c}`;return e.jsxs(i.Fragment,{children:[g>0&&e.jsx("div",{className:`nice-stepper__connector ${b?"nice-stepper__connector--completed":""}`}),e.jsxs("div",{className:`nice-stepper__step ${S}`,"aria-current":x?"step":void 0,...r&&{role:"button",tabIndex:0,onClick:()=>a?.(g),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a?.(g))}},style:{cursor:r?"pointer":void 0},children:[e.jsx("div",{className:"nice-stepper__indicator",children:u.icon?u.icon:v?e.jsx(h.NiceIcon,{name:"check",size:14}):c==="error"?e.jsx(h.NiceIcon,{name:"close",size:14}):o?g+1:""}),e.jsxs("div",{className:"nice-stepper__labels",children:[e.jsx("div",{className:"nice-stepper__title",children:u.title}),u.subtitle&&e.jsx("div",{className:"nice-stepper__subtitle",children:u.subtitle}),u.optional&&e.jsx("div",{className:"nice-stepper__optional",children:p("optional","Optional")}),u.description&&e.jsx("div",{className:"nice-stepper__description",children:u.description})]})]})]},g)})}),n[s]?.content&&e.jsx("div",{className:"nice-stepper__content",children:n[s].content})]})},ea=[],na=Object.assign(i.forwardRef(({panels:n=ea,columns:s=12,rowHeight:t=80,gap:a=8,draggable:r=!0,resizable:o=!0,onLayoutChange:l,className:m,"data-testid":f,style:p,id:u},g)=>{const d=h.useControlId(u),[c,v]=i.useState(null),[x,b]=i.useState(null),S=i.useRef(null),C=i.useCallback((E,N)=>{r&&(v(N),E.dataTransfer.effectAllowed="move")},[r]),I=i.useCallback((E,N)=>{if(E.preventDefault(),b(null),!c||c===N)return;const z=n.find(_=>_.key===c),B=n.find(_=>_.key===N);if(!z||!B)return;const w=n.map(_=>_.key===c?{..._,col:B.col,row:B.row}:_.key===N?{..._,col:z.col,row:z.row}:_);l?.(w),v(null)},[c,n,l]),j=i.useCallback((E,N)=>{E.preventDefault(),r&&c&&c!==N&&b(N)},[r,c]),$=i.useCallback(()=>{v(null),b(null)},[]),M=i.useRef(null);i.useEffect(()=>{if(!o)return;const E=z=>{if(!M.current||!S.current)return;const{key:B,startX:w,startY:_,cs:T,rs:O}=M.current,Z=z.clientX-w,y=z.clientY-_,R=S.current.clientWidth/s,A=Math.max(1,T+Math.round(Z/R)),V=Math.max(1,O+Math.round(y/t)),te=n.map(G=>G.key===B?{...G,colSpan:A,rowSpan:V}:G);l?.(te)},N=()=>{M.current=null};return document.addEventListener("mousemove",E),document.addEventListener("mouseup",N),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",N)}},[o,n,s,t,l]);const D=i.useCallback((E,N,z,B)=>{E.stopPropagation(),M.current={key:N,startX:E.clientX,startY:E.clientY,cs:z,rs:B}},[]),P=Math.max(...n.map(E=>E.row+(E.rowSpan??1)),1);return e.jsx("div",{ref:g,id:d,className:`nice-dashboard ${m||""}`,style:p,"data-testid":f,children:e.jsx("div",{ref:S,className:"nice-dashboard__grid",style:{display:"grid",gridTemplateColumns:`repeat(${s}, 1fr)`,gridTemplateRows:`repeat(${P}, ${t}px)`,gap:a},children:n.map(E=>e.jsxs("div",{className:`nice-dashboard__panel${r?" nice-dashboard__panel--draggable":""}${c===E.key?" nice-dashboard__panel--dragging":""}${x===E.key?" nice-dashboard__panel--dragover":""}`,style:{gridColumn:`${E.col+1} / span ${E.colSpan??1}`,gridRow:`${E.row+1} / span ${E.rowSpan??1}`},draggable:r,onDragStart:N=>C(N,E.key),onDragOver:N=>j(N,E.key),onDragLeave:()=>b(N=>N===E.key?null:N),onDragEnd:$,onDrop:N=>I(N,E.key),children:[e.jsx("div",{className:"nice-dashboard__panel-content",children:E.render()}),o&&e.jsx("div",{className:"nice-dashboard__resize-handle",draggable:!1,onMouseDown:N=>D(N,E.key,E.colSpan??1,E.rowSpan??1)})]},E.key))})})}),{displayName:"NiceDashboardLayout"}),sa=Object.assign(i.forwardRef(({header:n,sidebar:s,sidebarWidth:t=260,sidebarCollapsed:a,onToggleSidebar:r,children:o,footer:l,className:m,"data-testid":f,style:p,id:u},g)=>{const{t:d}=h.useNiceTranslation(),c=h.useControlId(u),[v,x]=i.useState(!1),b=a??v,S=i.useCallback(()=>{const C=!b;x(C),r?.(C)},[b,r]);return e.jsxs("div",{ref:g,id:c,className:`nice-app-layout${b?" nice-app-layout--collapsed":""} ${m||""}`,style:p,"data-testid":f,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:b?0:t,overflow:"hidden",transition:"width 0.2s"},children:!b&&s}),s&&e.jsx("button",{type:"button",className:"nice-app-layout__sidebar-toggle",onClick:S,"aria-label":b?d("appLayout.openSidebar","Open sidebar"):d("appLayout.closeSidebar","Close sidebar"),children:e.jsx(h.NiceIcon,{name:b?"menu":"close",size:16})}),e.jsx("main",{className:"nice-app-layout__content",children:o})]}),l&&e.jsx("footer",{className:"nice-app-layout__footer",children:l})]})}),{displayName:"NiceAppLayout"}),ia=[],ta=Object.assign(i.forwardRef(({items:n=ia,position:s="bottom",size:t="md",magnify:a=!0,magnifyScale:r=1.5,activeKey:o,onItemClick:l,contained:m=!1,className:f,style:p,id:u,...g},d)=>{const c=h.useControlId(u),{t:v}=h.useNiceTranslation(),[x,b]=i.useState(null),S=i.useCallback($=>{if(!a||x===null)return 1;const M=Math.abs($-x);return M===0?r:M===1?1+(r-1)*.5:M===2?1+(r-1)*.2:1},[a,x,r]),C=s==="left"||s==="right",I=i.useRef(null);h.useRovingFocus(I,{orientation:C?"vertical":"horizontal",itemSelector:"button"});const j=s==="left"?"left center":s==="right"?"right center":"bottom center";return e.jsx("div",{ref:d,id:c,className:`nice-dock nice-dock--${s} nice-dock--${t}${m?" nice-dock--contained":""} ${f??""}`,style:p,role:"toolbar","aria-label":v("dock.label","Dock"),"aria-orientation":C?"vertical":"horizontal",...g,children:e.jsx("div",{ref:I,className:"nice-dock__bar",style:{flexDirection:C?"column":"row"},children:n.map(($,M)=>{const D=S(M);return e.jsxs("button",{type:"button",className:`nice-dock__item ${o===$.key?"nice-dock__item--active":""} ${$.disabled?"nice-dock__item--disabled":""}`,style:{transform:`scale(${D})`,transformOrigin:j,transition:"transform 0.15s ease-out"},disabled:$.disabled,onClick:()=>l?.($.key),onMouseEnter:()=>b(M),onMouseLeave:()=>b(null),onFocus:()=>b(M),onBlur:()=>b(null),"aria-label":$.label,title:$.label,children:[e.jsx("span",{className:"nice-dock__icon",children:$.icon}),$.badge!==void 0&&e.jsx("span",{className:"nice-dock__badge",children:$.badge})]},$.key)})})})}),{displayName:"NiceDock"}),Li=({items:n,label:s,icon:t,position:a,onItemClick:r})=>{const{t:o}=h.useNiceTranslation(),[l,m]=i.useState(!1),[f,p]=i.useState(null),u=i.useRef(null),g=i.useRef(null),d=i.useRef(null),c=i.useCallback(b=>{m(b),b||p(null)},[]);h.useMenuButton(u,g,{open:l,onOpenChange:c}),h.useOverlayFocus(d,{open:l&&f!=null,modal:!1,onClose:()=>p(null)}),h.useRovingFocus(d,{orientation:"vertical",wrap:!0,typeahead:!0});const v=a==="bottom"?"bottom-start":a==="top"?"top-start":a==="left"?"left-start":"right-start",x=i.useCallback(b=>{if(b.children&&b.children.length>0){p(f===b.key?null:b.key);return}b.onClick?.(),r?.(b.key),m(!1),p(null)},[r,f]);return e.jsxs("div",{className:"nice-desktop__start",children:[e.jsxs("button",{ref:u,type:"button",className:`nice-desktop__start-btn ${l?"nice-desktop__start-btn--active":""}`,onClick:()=>m(!l),"aria-expanded":l,"aria-haspopup":"menu","aria-label":o("desktop.start","Start"),children:[t&&e.jsx("span",{className:"nice-desktop__start-icon",children:t}),s&&e.jsx("span",{className:"nice-desktop__start-label",children:s}),!t&&!s&&e.jsx("span",{className:"nice-desktop__start-label",children:o("desktop.start","Start")})]}),l&&e.jsx("div",{ref:g,className:`nice-desktop__start-menu nice-desktop__start-menu--${v}`,role:"menu",children:n.map(b=>e.jsxs(i.Fragment,{children:[b.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 ${f===b.key?"nice-desktop__start-item--open":""}`,disabled:b.disabled,onClick:()=>x(b),onKeyDown:S=>{b.children?.length&&S.key==="ArrowRight"&&(S.preventDefault(),p(b.key))},role:"menuitem","aria-haspopup":b.children?.length?"menu":void 0,"aria-expanded":b.children?.length?f===b.key:void 0,children:[b.icon&&e.jsx("span",{className:"nice-desktop__start-item-icon",children:b.icon}),e.jsx("span",{className:"nice-desktop__start-item-label",children:b.label}),b.children&&b.children.length>0&&e.jsx("span",{className:"nice-desktop__start-item-arrow",children:e.jsx(h.NiceIcon,{name:"chevron-right",size:14})})]}),b.children&&f===b.key&&e.jsx("div",{ref:d,className:"nice-desktop__start-submenu",role:"menu",onKeyDown:S=>{S.key==="ArrowLeft"&&(S.preventDefault(),p(null))},children:b.children.map(S=>e.jsxs("button",{type:"button",className:"nice-desktop__start-item",disabled:S.disabled,onClick:()=>x(S),role:"menuitem",children:[S.icon&&e.jsx("span",{className:"nice-desktop__start-item-icon",children:S.icon}),e.jsx("span",{className:"nice-desktop__start-item-label",children:S.label})]},S.key))})]})]},b.key))})]})},_s=({items:n,position:s,size:t,startMenu:a,systemTray:r,onItemClick:o})=>{const{t:l}=h.useNiceTranslation(),m=s==="left"||s==="right",f=m?{width:t,height:"100%"}:{height:t,width:"100%"},p=i.useRef(null);return h.useRovingFocus(p,{orientation:m?"vertical":"horizontal",itemSelector:"button"}),e.jsxs("div",{ref:p,className:`nice-desktop__taskbar nice-desktop__taskbar--${s}`,style:f,role:"toolbar","aria-label":l("desktop.taskbar","Taskbar"),"aria-orientation":m?"vertical":"horizontal",children:[a,e.jsx("div",{className:"nice-desktop__taskbar-items",children:n.map(u=>e.jsxs("button",{type:"button",className:`nice-desktop__taskbar-btn ${u.active?"nice-desktop__taskbar-btn--active":""} ${u.minimized?"nice-desktop__taskbar-btn--minimized":""}`,onClick:()=>o?.(u.key),title:u.label,children:[u.icon&&e.jsx("span",{className:"nice-desktop__taskbar-btn-icon",children:u.icon}),e.jsx("span",{className:"nice-desktop__taskbar-btn-label",children:u.label}),u.badge!==void 0&&e.jsx("span",{className:"nice-desktop__taskbar-btn-badge",children:u.badge})]},u.key))}),r]})},Ri=({items:n,showClock:s=!0,onItemClick:t})=>{const[a,r]=i.useState(()=>new Date);return i.useEffect(()=>{if(!s)return;const o=setInterval(()=>r(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?.(),t?.(o.key)},children:o.icon},o.key)),s&&e.jsx("span",{className:"nice-desktop__tray-clock",children:a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},zi=({icons:n,gridColumns:s,iconSize:t,onIconClick:a,onIconDoubleClick:r})=>{const[o,l]=i.useState(null),m=i.useCallback(p=>{l(p),a?.(p)},[a]),f=i.useCallback(p=>{r?.(p)},[r]);return e.jsx("div",{className:`nice-desktop__grid nice-desktop__grid--${t}`,style:{gridTemplateColumns:`repeat(${s}, 1fr)`},children:n.map(p=>e.jsxs("div",{className:`nice-desktop__icon ${o===p.key?"nice-desktop__icon--selected":""} ${p.disabled?"nice-desktop__icon--disabled":""}`,style:p.gridCol!=null||p.gridRow!=null?{gridColumn:p.gridCol,gridRow:p.gridRow}:void 0,onClick:()=>!p.disabled&&m(p.key),onDoubleClick:()=>!p.disabled&&f(p.key),role:"button",tabIndex:p.disabled?-1:0,"aria-label":p.label,onKeyDown:u=>{p.disabled||(u.key==="Enter"&&f(p.key),u.key===" "&&(u.preventDefault(),m(p.key)))},children:[e.jsx("div",{className:"nice-desktop__icon-img",children:p.icon}),e.jsx("span",{className:"nice-desktop__icon-label",children:p.label})]},p.key))})},Di=({items:n,x:s,y:t,onItemClick:a,onClose:r})=>{const o=i.useRef(null);return i.useEffect(()=>{const l=m=>{o.current&&!o.current.contains(m.target)&&r()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),h.useOverlayFocus(o,{open:!0,modal:!1,onClose:r}),h.useRovingFocus(o,{orientation:"vertical",wrap:!0,typeahead:!0}),e.jsx("div",{ref:o,className:"nice-desktop__context-menu",style:{position:"fixed",left:s,top:t},role:"menu",children:n.map(l=>e.jsxs(i.Fragment,{children:[l.divider&&e.jsx("div",{className:"nice-desktop__context-divider"}),e.jsxs("button",{type:"button",className:"nice-desktop__context-item",disabled:l.disabled,onClick:()=>{l.onClick?.(),a?.(l.key),r()},role:"menuitem",children:[l.icon&&e.jsx("span",{className:"nice-desktop__context-icon",children:l.icon}),e.jsx("span",{children:l.label})]})]},l.key))})},aa=Object.assign(i.forwardRef(({icons:n=[],taskbarPosition:s="bottom",taskbarSize:t=40,startMenuItems:a=[],startMenuLabel:r,startMenuIcon:o,taskbarItems:l=[],systemTrayItems:m=[],showClock:f=!0,wallpaper:p,gridColumns:u=8,iconSize:g="md",onIconClick:d,onIconDoubleClick:c,onTaskbarItemClick:v,onStartMenuItemClick:x,onSystemTrayItemClick:b,contextMenuItems:S,onContextMenuItemClick:C,children:I,className:j,style:$,id:M,accessMode:D,...P},E)=>{const N=h.useControlId(M),B=h.useNiceAccessMode(D,M)==="hidden",[w,_]=i.useState(null),T=i.useCallback(R=>{!S||S.length===0||(R.preventDefault(),_({x:R.clientX,y:R.clientY}))},[S]),O=a.length>0?e.jsx(Li,{items:a,label:r,icon:o,position:s,onItemClick:x}):null,Z=e.jsx(Ri,{items:m,showClock:f,onItemClick:b}),y={...$,...p?{background:p}:{}};return B?null:e.jsxs("div",{ref:E,id:N,className:`nice-desktop nice-desktop--taskbar-${s} ${j??""}`,style:y,...P,children:[(s==="top"||s==="left")&&e.jsx(_s,{items:l,position:s,size:t,startMenu:O,systemTray:Z,onItemClick:v}),e.jsxs("div",{className:"nice-desktop__area",onContextMenu:T,children:[n.length>0&&e.jsx(zi,{icons:n,gridColumns:u,iconSize:g,onIconClick:d,onIconDoubleClick:c}),I,w&&S&&e.jsx(Di,{items:S,x:w.x,y:w.y,onItemClick:C,onClose:()=>_(null)})]}),(s==="bottom"||s==="right")&&e.jsx(_s,{items:l,position:s,size:t,startMenu:O,systemTray:Z,onItemClick:v})]})}),{displayName:"NiceDesktop"}),ca=({commands:n,onSelect:s,onClose:t})=>{const[a,r]=i.useState(""),o=i.useRef(null),l=i.useRef(null),{t:m}=h.useNiceTranslation();h.useOverlayFocus(l,{open:!0,initialFocus:o,onClose:t});const f=a?n.filter(p=>p.label.toLowerCase().includes(a.toLowerCase())):n;return e.jsxs(e.Fragment,{children:[e.jsx("div",{role:"presentation",className:"nice-console__palette-overlay",onClick:t}),e.jsxs("div",{ref:l,className:"nice-console__palette",role:"dialog","aria-label":m("console.commandPalette","Command Palette"),children:[e.jsx("input",{ref:o,className:"nice-console__palette-input",placeholder:m("console.searchCommands","Search commands..."),value:a,onChange:p=>r(p.target.value),onKeyDown:p=>{p.key==="Enter"&&f.length>0&&(s(f[0].key),t())}}),e.jsxs("div",{className:"nice-console__palette-list",children:[f.map(p=>e.jsxs("button",{type:"button",className:"nice-console__palette-item",disabled:p.disabled,onClick:()=>{s(p.key),t()},children:[p.icon&&e.jsx("span",{className:"nice-console__palette-icon",children:p.icon}),e.jsx("span",{className:"nice-console__palette-label",children:p.label}),p.description&&e.jsx("span",{className:"nice-console__palette-desc",children:p.description}),p.shortcut&&e.jsx("span",{className:"nice-console__palette-shortcut",children:p.shortcut})]},p.key)),f.length===0&&e.jsx("div",{className:"nice-console__palette-empty",children:m("console.noCommands","No matching commands")})]})]})]})},ra=Object.assign(i.forwardRef(({tabs:n=[],activeTabKey:s,onTabChange:t,onTabClose:a,commandPalette:r=[],onCommand:o,statusItems:l=[],toolbar:m,sidePanel:f,sidePanelWidth:p=220,sidePanelCollapsed:u,onToggleSidePanel:g,bottomPanel:d,bottomPanelHeight:c=200,bottomPanelCollapsed:v,onToggleBottomPanel:x,children:b,size:S="md",theme:C="dark",className:I,style:j,id:$,accessMode:M,...D},P)=>{const E=i.useRef(null);h.useRovingFocus(E,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const N=h.useControlId($),z=h.useNiceAccessMode(M,$),{t:B}=h.useNiceTranslation(),[w,_]=i.useState(n[0]?.key??""),[T,O]=i.useState(!1),[Z,y]=i.useState(!1),[R,A]=i.useState(!1),V=s??w,te=u??T,G=v??Z,ne=i.useCallback(H=>{t?t(H):_(H)},[t]),ie=i.useCallback(()=>{const H=!te;g?g(H):O(H)},[te,g]),se=i.useCallback(()=>{const H=!G;x?x(H):y(H)},[G,x]);i.useEffect(()=>{if(r.length===0)return;const H=q=>{q.ctrlKey&&q.shiftKey&&q.key==="P"&&(q.preventDefault(),A(pe=>!pe))};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[r.length]);const U=i.useRef(null),de=i.useCallback(H=>{U.current=H,typeof P=="function"?P(H):P&&(P.current=H)},[P]);h.useIntent("menu",()=>A(H=>!H),{ref:U,enabled:r.length>0});const re=n.find(H=>H.key===V),le=l.filter(H=>!H.position||H.position==="left"),ge=l.filter(H=>H.position==="right");return z==="hidden"?null:e.jsxs("div",{ref:de,id:N,className:`nice-console nice-console--${S} nice-console--${C} ${I??""}`,style:j,...D,children:[m&&e.jsx("div",{className:"nice-console__toolbar",children:m}),n.length>0&&e.jsx("div",{className:"nice-console__tabs",ref:E,role:"tablist",children:n.map(H=>e.jsxs("div",{className:`nice-console__tab ${H.key===V?"nice-console__tab--active":""}`,role:"tab","aria-selected":H.key===V,children:[e.jsxs("button",{type:"button",className:"nice-console__tab-btn",onClick:()=>ne(H.key),children:[H.icon&&e.jsx("span",{className:"nice-console__tab-icon",children:H.icon}),e.jsx("span",{children:H.label})]}),(H.closable??!0)&&a&&e.jsx("button",{type:"button",className:"nice-console__tab-close",onClick:()=>a(H.key),"aria-label":B("console.closeTab","Close tab"),children:e.jsx(h.NiceIcon,{name:"close",size:14})})]},H.key))}),e.jsxs("div",{className:"nice-console__main",children:[f&&!te&&e.jsxs("aside",{className:"nice-console__side",style:{width:p,flexShrink:0},children:[e.jsx("div",{className:"nice-console__side-header",children:e.jsx("button",{type:"button",className:"nice-console__side-toggle",onClick:ie,"aria-label":B("console.closeSidePanel","Close side panel"),children:e.jsx(h.NiceIcon,{name:"close",size:14})})}),e.jsx("div",{className:"nice-console__side-content",children:f})]}),e.jsxs("div",{className:"nice-console__center",children:[e.jsx("div",{className:"nice-console__content",role:"tabpanel",children:re?re.render?re.render():re.content:b}),d&&!G&&e.jsxs("div",{className:"nice-console__bottom",style:{height:c,flexShrink:0},children:[e.jsx("div",{className:"nice-console__bottom-header",children:e.jsx("button",{type:"button",className:"nice-console__bottom-toggle",onClick:se,"aria-label":B("console.closeBottomPanel","Close bottom panel"),children:e.jsx(h.NiceIcon,{name:"close",size:14})})}),e.jsx("div",{className:"nice-console__bottom-content",children:d})]})]})]}),l.length>0&&e.jsxs("div",{className:"nice-console__statusbar",children:[e.jsxs("div",{className:"nice-console__statusbar-left",children:[f&&te&&e.jsx("button",{type:"button",className:"nice-console__statusbar-btn",onClick:ie,title:B("console.openSidePanel","Open side panel"),children:e.jsx(h.NiceIcon,{name:"menu",size:14})}),d&&G&&e.jsx("button",{type:"button",className:"nice-console__statusbar-btn",onClick:se,title:B("console.openBottomPanel","Open bottom panel"),children:e.jsx(h.NiceIcon,{name:"chevron-up",size:14})}),le.map(H=>e.jsx("span",{onKeyDown:h.clickOnActivationKey,className:"nice-console__status-item",onClick:H.onClick,role:H.onClick?"button":void 0,tabIndex:H.onClick?0:void 0,children:H.content??H.label},H.key))]}),e.jsx("div",{className:"nice-console__statusbar-right",children:ge.map(H=>e.jsx("span",{onKeyDown:h.clickOnActivationKey,className:"nice-console__status-item",onClick:H.onClick,role:H.onClick?"button":void 0,tabIndex:H.onClick?0:void 0,children:H.content??H.label},H.key))})]}),R&&r.length>0&&e.jsx(ca,{commands:r,onSelect:H=>o?.(H),onClose:()=>A(!1)})]})}),{displayName:"NiceConsole"}),oa=[],la=Object.assign(i.forwardRef(({steps:n=oa,activeStep:s,onStepChange:t,onComplete:a,onCancel:r,allowStepClick:o=!1,variant:l="horizontal",nextLabel:m,prevLabel:f,finishLabel:p,cancelLabel:u,showProgress:g=!0,className:d,style:c,size:v="md",accessMode:x,id:b},S)=>{const I=h.useNiceAccessMode(x,b)==="hidden",{t:j}=h.useNiceTranslation(),$=h.useControlId(b),[M,D]=i.useState(0),[P,E]=i.useState({}),[N,z]=i.useState(new Set([0])),B=s??M,w=n[B],_=B===0,T=B===n.length-1,O=i.useCallback(se=>{const U=Math.max(0,Math.min(n.length-1,se));D(U),z(de=>new Set(de).add(U)),t?.(U)},[n.length,t]),Z=i.useCallback(()=>{if(!w?.validate)return!0;const se=w.validate();return se===!0||se===void 0?(E(U=>{const de={...U};return delete de[w.id],de}),!0):(E(U=>({...U,[w.id]:se})),!1)},[w]),y=i.useCallback(()=>{Z()&&(T?a?.():O(B+1))},[B,T,Z,O,a]),R=i.useCallback(()=>{_||O(B-1)},[B,_,O]),A=i.useCallback(se=>{const U=n.findIndex(de=>de.id===se);U>=0&&O(U)},[n,O]),V=i.useMemo(()=>({stepIndex:B,totalSteps:n.length,goNext:y,goPrev:R,goTo:A,isFirst:_,isLast:T}),[B,n.length,y,R,A,_,T]),te=n.length>0?(B+1)/n.length*100:0,G=i.useRef(null),ne=i.useCallback(se=>{G.current=se,typeof S=="function"?S(se):S&&(S.current=se)},[S]);if(h.useIntent(["sectionPrev","sectionNext"],se=>se.intent==="sectionNext"?y():R(),{ref:G,enabled:!I&&n.length>0}),h.useInputHints(G,[..._?[]:[{intent:"sectionPrev",label:j("wizard.previousStep","Previous step")}],{intent:"sectionNext",label:T?j("finish","Finish"):j("wizard.nextStep","Next step")}],{enabled:n.length>0}),I)return null;const ie=n.map(se=>({title:se.title,subtitle:se.description,icon:se.icon,optional:se.optional}));return e.jsxs("div",{ref:ne,id:$,className:`nice-wizard nice-wizard--${l} nice-size-${v}${d?` ${d}`:""}`,style:c,children:[e.jsx(Mi,{steps:ie,activeStep:B,orientation:l,allowStepClick:o,onStepClick:se=>{se<=B&&O(se)}}),g&&e.jsx("div",{className:"nice-wizard__progress",role:"progressbar","aria-label":j("wizard.progress","Progress"),"aria-valuemin":1,"aria-valuemax":Math.max(1,n.length),"aria-valuenow":Math.min(B+1,Math.max(1,n.length)),children:e.jsx("div",{className:"nice-wizard__progress-bar",style:{width:`${te}%`}})}),e.jsx("div",{className:"nice-wizard__content",role:"group","aria-label":w?.title,children:w&&e.jsxs(e.Fragment,{children:[typeof w.content=="function"?w.content(V):w.content,P[w.id]&&e.jsx("div",{className:"nice-wizard__error nice-error-text",role:"alert",children:P[w.id]})]})}),e.jsxs("div",{className:"nice-wizard__actions",children:[r&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--text",onClick:r,children:u??j("cancel","Cancel")}),e.jsxs("div",{className:"nice-wizard__actions-right",children:[!_&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--outlined",onClick:R,children:f??e.jsxs(e.Fragment,{children:[e.jsx(h.NiceIcon,{name:"arrow-left",size:14})," ",j("previous","Previous")]})}),e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:y,children:T?p??e.jsxs(e.Fragment,{children:[j("finish","Finish")," ",e.jsx(h.NiceIcon,{name:"check",size:14})]}):m??e.jsxs(e.Fragment,{children:[j("next","Next")," ",e.jsx(h.NiceIcon,{name:"arrow-right",size:14})]})})]})]})]})}),{displayName:"NiceWizard"}),da=[],Ti=i.createContext(null);function ua(){const n=i.useContext(Ti);if(!n)throw new Error("useSetupWizard must be used within NiceSetupWizard");return n}const ma=e.jsx(h.NiceIcon,{name:"refresh",size:18});function ha({children:n}){const s=i.useRef(null),t=h.useMediaQuery("(prefers-reduced-motion: reduce)");return i.useEffect(()=>{const a=s.current?.querySelectorAll("svg")??[];for(const r of a)t?r.pauseAnimations?.():r.unpauseAnimations?.()},[t,n]),e.jsx("div",{ref:s,className:"nice-setup-wizard__loading-indicator","aria-hidden":"true",children:n})}const pa=Object.assign(i.forwardRef(({steps:n=da,initialValues:s={},activeStep:t,completedSteps:a,layout:r="horizontal",size:o="md",defaultQuickMode:l=!1,allowQuickModeToggle:m=!0,showStepNumbers:f=!0,showProgress:p=!0,showEstimatedTime:u=!1,allowStepClick:g=!0,showReviewStep:d=!1,persistKey:c,animation:v="slide",theme:x,branding:b,showLanguagePicker:S=!1,languagePickerProps:C,showThemePicker:I=!1,themePickerProps:j,showRestart:$=!1,onRestart:M,restart:D={},header:P,footer:E,onStepChange:N,onValuesChange:z,onComplete:B,onCancel:w,labels:_={},accessMode:T,height:O,loading:Z=!1,loadingText:y,loadingIndicator:R,id:A,className:V,style:te},G)=>{const ne=i.useRef(null);h.useRovingFocus(ne,{orientation:r==="vertical"?"vertical":"horizontal",wrap:!0,activateOnMove:!0});const ie=h.useNiceAccessMode(T,A),se=ie==="hidden",{t:U}=h.useNiceTranslation(),de=h.useControlId(A),[re,le]=i.useState(l),ge=i.useMemo(()=>re?n.filter(k=>!k.quickModeSkip):n,[n,re]),H=i.useMemo(()=>{if(!d)return ge;const k={id:"__review__",title:_.review??U("wizard.review","Review"),icon:e.jsx(h.NiceIcon,{name:"clipboard",size:16}),content:ce=>e.jsxs("div",{className:"nice-setup-wizard__review",children:[e.jsx("h3",{children:U("wizard.reviewTitle","Review Your Setup")}),ge.filter(he=>he.summary).map(he=>e.jsxs("div",{className:"nice-setup-wizard__review-section",children:[e.jsx("h4",{children:he.title}),he.summary?.(ce.values)]},he.id))]})};return[...ge,k]},[ge,d,_.review,U]),[q,pe]=i.useState(()=>{if(c)try{const k=localStorage.getItem(c);if(k)return{...s,...JSON.parse(k)}}catch{}return s}),[_e,Re]=i.useState(()=>{if(t)return t;if(c)try{const k=localStorage.getItem(`${c}_step`);if(k&&H.some(ce=>ce.id===k))return k}catch{}return H[0]?.id??""}),[Ae,Ye]=i.useState(()=>new Set([_e])),[X,je]=i.useState({}),[Y,Q]=i.useState(!1),[ue,we]=i.useState(!1),Ie=i.useRef(!1),[De,Ke]=i.useState("next"),[Pe,Be]=i.useState(!1),Ue=H.findIndex(k=>k.id===_e),ke=Ue>=0?Ue:H.length>0?0:-1,W=H[ke],ve=ke===0,Oe=ke===H.length-1,Fe=H.some(k=>k.final)?!!W?.final:Oe&&W?.final!==!1,Ve=i.useMemo(()=>{const k=new Map;for(const ce of H)ce.numbered!==!1&&k.set(ce.id,k.size+1);return k},[H]),an=H.slice(0,ke+1).filter(k=>k.numbered!==!1).length,$e=Ve.size>0?an/Ve.size*100:0,J=i.useRef(t);i.useEffect(()=>{if(t===void 0||t===J.current)return;const k=H.findIndex(ce=>ce.id===t);k<0||(J.current=t,t!==_e&&(Ke(k>H.findIndex(ce=>ce.id===_e)?"next":"prev"),Re(t),Ye(ce=>new Set(ce).add(t))))},[t,H,_e]),i.useEffect(()=>{c&&(localStorage.setItem(c,JSON.stringify(q)),localStorage.setItem(`${c}_step`,_e))},[q,_e,c]);const fe=i.useCallback((k,ce)=>{pe(he=>{const Te={...he,[k]:ce};return z?.(Te),Te})},[z]),xe=i.useCallback(k=>{pe(ce=>{const he={...ce,...k};return z?.(he),he})},[z]),Ce=i.useCallback((k,ce)=>{je(he=>({...he,[k]:ce}))},[]),ze=i.useCallback(k=>{je(ce=>{const he={...ce};return delete he[k],he})},[]),F=i.useRef(null),[Ne,ee]=i.useState(0),me=i.useCallback(k=>{const ce=H.findIndex(he=>he.id===k);ce>=0&&(F.current=null,Ke(ce>ke?"next":"prev"),Re(k),Ye(he=>new Set(he).add(k)),N?.(k,ce))},[H,ke,N]),Me=i.useCallback((k,ce)=>k.nextStep?typeof k.nextStep=="function"?k.nextStep(q):k.nextStep:H[ce+1]?.id??"",[q,H]),Ze=i.useCallback(async()=>{if(!(!W||W.canProceed===!1)){if(W.validate){Q(!0);try{const k=await W.validate(q);if(k){Ce(W.id,k),Q(!1);return}ze(W.id)}catch(k){Ce(W.id,String(k)),Q(!1);return}Q(!1)}if(W.fields){for(const k of W.fields){if(k.required&&!q[k.id]){Ce(W.id,`${k.label} ${U("wizard.isRequired","is required")}`);return}if(k.validation?.custom){const ce=k.validation.custom(q[k.id]);if(ce){Ce(W.id,ce);return}}}ze(W.id)}if(Fe){if(Ie.current)return;Ie.current=!0,we(!0);try{await B?.(q),c&&(localStorage.removeItem(c),localStorage.removeItem(`${c}_step`))}catch(k){Ce(W.id,k instanceof Error?k.message:String(k))}finally{Ie.current=!1,we(!1)}}else{const k=Me(W,ke);k&&H.some(ce=>ce.id===k)?me(k):(F.current=W.id,ee(ce=>ce+1))}}},[W,q,Fe,ke,B,c,U,Ce,ze,me,Me,H]);i.useEffect(()=>{const k=F.current;if(k===null)return;if(k!==_e){F.current=null;return}const ce=H.findIndex(Te=>Te.id===k);if(ce<0)return;const he=Me(H[ce],ce);he&&H.some(Te=>Te.id===he)&&me(he)},[H,_e,Me,me,Ne]);const en=i.useCallback(()=>{if(ve||W?.canGoBack===!1)return;const k=W?.prevStep??H[ke-1]?.id;k&&(Ke("prev"),me(k))},[ve,W,ke,H,me]),nn=i.useCallback(()=>{if(W?.optional&&!Fe){const k=Me(W,ke);k&&me(k)}},[W,Fe,ke,Me,me]),Cn=i.useCallback(()=>{B?.(q)},[B,q]),on=i.useCallback(()=>{w?.()},[w]),wn=i.useCallback(()=>{D.skipConfirm?M?.():Be(!0)},[D.skipConfirm,M]),Sn=i.useCallback(()=>{le(k=>!k)},[]),dn=i.useMemo(()=>({values:q,setValue:fe,setValues:xe,currentStep:W,currentIndex:ke,totalSteps:H.length,visitedSteps:Ae,errors:X,setError:Ce,clearError:ze,goNext:Ze,goPrev:en,goTo:me,skip:nn,complete:Cn,cancel:on,isFirst:ve,isLast:Oe,isQuickMode:re,toggleQuickMode:Sn,progress:$e,t:U}),[q,fe,xe,W,ke,H.length,Ae,X,Ce,ze,Ze,en,me,nn,Cn,on,ve,Oe,re,Sn,$e,U]),hn=i.useMemo(()=>{if(!u)return null;const ce=H.map(he=>he.estimatedTime).filter(Boolean).map(he=>{const Te=he.match(/(\d+)\s*(min|sec|s|m)/i);if(!Te)return 0;const qe=parseInt(Te[1],10);return Te[2].toLowerCase().startsWith("m")?qe:qe/60}).reduce((he,Te)=>he+Te,0);return ce>0?`~${Math.ceil(ce)} min`:null},[H,u]),Qe=i.useRef(null),Bn=i.useCallback(k=>{Qe.current=k,typeof G=="function"?G(k):G&&(G.current=k)},[G]);h.useIntent(["sectionPrev","sectionNext"],k=>{k.intent==="sectionNext"?Ze():en()},{ref:Qe,enabled:!se&&!!W});const sn=!ve&&W?.canGoBack!==!1,un=W?.canProceed!==!1;if(h.useInputHints(Qe,[...sn?[{intent:"sectionPrev",label:_.prev??U("wizard.prev","Back")}]:[],...un?[{intent:"sectionNext",label:W?.nextLabel??(Fe?_.finish??U("wizard.finish","Finish"):_.next??U("wizard.next","Continue"))}]:[]],{enabled:!!W&&!Z}),!W&&!Z)return null;const is=(k,ce)=>{const he=k.id===_e,Te=!he&&(!!a?.includes(k.id)||Ae.has(k.id)&&ce<ke),qe=!he&&!Te,We=!!X[k.id],Ee=g&&(Te||ce<=ke);return e.jsxs("button",{type:"button",role:"tab","aria-selected":he,"aria-current":he?"step":void 0,className:["nice-setup-wizard__step-indicator",he&&"nice-setup-wizard__step-indicator--active",Te&&"nice-setup-wizard__step-indicator--completed",qe&&"nice-setup-wizard__step-indicator--pending",We&&"nice-setup-wizard__step-indicator--error"].filter(Boolean).join(" "),onClick:()=>Ee&&me(k.id),disabled:!Ee,children:[e.jsx("span",{className:"nice-setup-wizard__step-marker",children:We?"!":Te?e.jsx(h.NiceIcon,{name:"check",size:14}):f&&k.numbered!==!1?Ve.get(k.id):k.icon||e.jsx(h.NiceIcon,{name:"circle",size:12})}),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:["(",_.optional??U("wizard.optional","optional"),")"]})]}),k.badge&&e.jsx("span",{className:"nice-setup-wizard__step-badge",children:k.badge})]},k.id)},In=k=>{if(k.showWhen&&!k.showWhen(q))return null;const ce=q[k.id]??k.defaultValue??"",he=Ee=>fe(k.id,Ee);if(k.render)return e.jsx("div",{className:`nice-setup-wizard__field${k.fullWidth?" nice-setup-wizard__field--full":""}`,children:k.render({value:ce,onChange:he,field:k})},k.id);const Te=`${de}-${k.id}`,qe={id:Te,disabled:k.disabled||ie==="disabled"||ie==="readOnly",placeholder:k.placeholder,required:k.required};let We;switch(k.type){case"textarea":We=e.jsx("textarea",{...qe,className:"nice-setup-wizard__input nice-setup-wizard__textarea",value:String(ce),onChange:Ee=>he(Ee.target.value),rows:4});break;case"select":We=e.jsxs("select",{...qe,className:"nice-setup-wizard__input nice-setup-wizard__select",value:String(ce),onChange:Ee=>he(Ee.target.value),children:[e.jsx("option",{value:"",children:k.placeholder||U("wizard.select","Select...")}),k.options?.map(Ee=>e.jsx("option",{value:Ee.value,children:Ee.label},Ee.value))]});break;case"radio":We=e.jsx("div",{className:"nice-setup-wizard__radio-group",children:k.options?.map(Ee=>e.jsxs("label",{className:"nice-setup-wizard__radio-label",children:[e.jsx("input",{type:"radio",name:Te,value:Ee.value,checked:ce===Ee.value,onChange:()=>he(Ee.value),disabled:qe.disabled}),Ee.icon&&e.jsx("span",{className:"nice-setup-wizard__radio-icon",children:Ee.icon}),e.jsx("span",{children:Ee.label})]},Ee.value))});break;case"checkbox":We=e.jsxs("label",{className:"nice-setup-wizard__checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:!!ce,onChange:Ee=>he(Ee.target.checked),disabled:qe.disabled}),e.jsx("span",{children:k.label})]});break;case"switch":We=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${ce?" nice-setup-wizard__switch--on":""}`,children:[e.jsx("input",{type:"checkbox",checked:!!ce,onChange:Ee=>he(Ee.target.checked),disabled:qe.disabled}),e.jsx("span",{className:"nice-setup-wizard__switch-track"}),e.jsx("span",{className:"nice-setup-wizard__switch-thumb"})]})]});break;case"slider":We=e.jsxs("div",{className:"nice-setup-wizard__slider-wrapper",children:[e.jsx("input",{type:"range",...qe,className:"nice-setup-wizard__slider",value:Number(ce)||k.validation?.min||0,min:k.validation?.min,max:k.validation?.max,onChange:Ee=>he(Number(Ee.target.value))}),e.jsx("span",{className:"nice-setup-wizard__slider-value",children:String(ce??"")})]});break;default:We=e.jsx("input",{type:k.type==="custom"?"text":k.type,...qe,className:"nice-setup-wizard__input",value:String(ce),onChange:Ee=>he(Ee.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:Te,className:"nice-setup-wizard__label",children:[k.label,k.required&&e.jsx("span",{className:"nice-setup-wizard__required",children:"*"})]}),We,k.description&&e.jsx("span",{className:"nice-setup-wizard__field-desc",children:k.description})]},k.id)},$n=()=>W.fields?e.jsx("div",{className:"nice-setup-wizard__fields",children:W.fields.map(In)}):W.content?typeof W.content=="function"?W.content(dn):W.content:null;if(se)return null;const _n=S||I||$,xn=D.label??U("wizard.restart","Start over"),Nn=Z||!W,En=e.jsx(Ti.Provider,{value:dn,children:e.jsxs("div",{ref:Bn,id:de,className:["nice-setup-wizard",`nice-setup-wizard--${r}`,`nice-size-${o}`,v!=="none"&&`nice-setup-wizard--anim-${v}`,V].filter(Boolean).join(" "),style:O!=null?{height:O,minHeight:0,maxHeight:"none",boxSizing:"border-box",...te}:te,children:[(b||P||m||_n)&&e.jsxs("header",{className:"nice-setup-wizard__header",children:[b&&e.jsx("div",{className:"nice-setup-wizard__branding",children:b}),_n&&e.jsxs("div",{className:"nice-setup-wizard__header-controls",children:[S&&e.jsx(xs,{compact:!0,variant:"ghost",...C}),I&&e.jsx(Ns,{compact:!0,variant:"ghost",...j}),$&&e.jsx("button",{type:"button",className:"nice-setup-wizard__icon-btn nice-setup-wizard__restart",onClick:wn,title:xn,"aria-label":xn,children:D.icon??ma})]}),P,m&&e.jsxs("label",{className:"nice-setup-wizard__quick-toggle",children:[e.jsx("input",{type:"checkbox",checked:re,onChange:Sn}),e.jsx("span",{children:_.quickMode??U("wizard.quickMode","Quick Setup")})]}),hn&&e.jsx("span",{className:"nice-setup-wizard__time",children:hn})]}),Nn?e.jsxs("div",{className:"nice-setup-wizard__loading",role:"status","aria-busy":"true",children:[e.jsx(ha,{children:R??e.jsx(Xs,{size:"lg"})}),e.jsx("div",{className:"nice-setup-wizard__loading-text",children:y??U("wizard.loading","Loading…")})]}):e.jsxs(e.Fragment,{children:[r!=="minimal"&&e.jsx("nav",{className:"nice-setup-wizard__nav",ref:ne,role:"tablist",children:H.map(is)}),p&&e.jsx("div",{className:"nice-setup-wizard__progress",children:e.jsx("div",{className:"nice-setup-wizard__progress-bar",style:{width:`${$e}%`},role:"progressbar","aria-valuenow":$e,"aria-valuemin":0,"aria-valuemax":100})}),e.jsxs("div",{className:["nice-setup-wizard__content",De==="next"&&"nice-setup-wizard__content--slide-next",De==="prev"&&"nice-setup-wizard__content--slide-prev"].filter(Boolean).join(" "),role:"tabpanel",children:[W.description&&e.jsx("p",{className:"nice-setup-wizard__step-description",children:W.description}),$n(),X[W.id]&&e.jsx("div",{className:"nice-setup-wizard__error",role:"alert",children:X[W.id]})]},_e),e.jsxs("footer",{className:"nice-setup-wizard__footer",children:[e.jsxs("div",{className:"nice-setup-wizard__actions-left",children:[w&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--text",onClick:on,children:_.cancel??U("wizard.cancel","Cancel")}),W.optional&&!Fe&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--text",onClick:nn,children:_.skip??U("wizard.skip","Skip")}),W.actions?.filter(k=>k.position==="left").map(k=>e.jsxs("button",{type:"button",className:`nice-btn nice-btn--${k.variant||"outlined"}`,onClick:()=>k.onClick(dn),disabled:k.disabled?.(dn),children:[k.icon," ",k.label]},k.id))]}),e.jsxs("div",{className:"nice-setup-wizard__actions-right",children:[W.actions?.filter(k=>k.position!=="left").map(k=>e.jsxs("button",{type:"button",className:`nice-btn nice-btn--${k.variant||"outlined"}`,onClick:()=>k.onClick(dn),disabled:k.disabled?.(dn),children:[k.icon," ",k.label]},k.id)),sn&&e.jsx(vn.NiceButton,{variant:"outline",size:o,onClick:en,children:_.prev??e.jsxs(e.Fragment,{children:[e.jsx(h.NiceIcon,{name:"arrow-left",size:14})," ",U("wizard.prev","Back")]})}),e.jsx(vn.NiceButton,{variant:"primary",size:o,onClick:Ze,disabled:Y||ue||!un,loading:Y||ue,children:W.nextLabel??(Fe?_.finish??e.jsxs(e.Fragment,{children:[U("wizard.finish","Finish")," ",e.jsx(h.NiceIcon,{name:"check",size:14})]}):_.next??e.jsxs(e.Fragment,{children:[U("wizard.next","Continue")," ",e.jsx(h.NiceIcon,{name:"arrow-right",size:14})]}))})]})]}),E&&e.jsx("div",{className:"nice-setup-wizard__custom-footer",children:E}),r==="minimal"&&Ve.has(W.id)&&e.jsx("div",{className:"nice-setup-wizard__minimal-indicator",children:_.stepOf?_.stepOf.replace("{current}",String(Ve.get(W.id))).replace("{total}",String(Ve.size)):`${Ve.get(W.id)} / ${Ve.size}`})]}),$&&!D.skipConfirm&&e.jsx(Xe.NiceConfirmDialog,{visible:Pe,variant:"warning",size:o,header:D.confirmTitle??U("wizard.restartConfirmTitle","Start setup over?"),message:D.confirmMessage??U("wizard.restartConfirmMessage","This will discard your progress and restart the setup from the beginning."),acceptLabel:D.confirmLabel??U("wizard.restartConfirmAccept","Yes, start over"),rejectLabel:D.cancelLabel??U("wizard.restartConfirmReject","Cancel"),onAccept:()=>{Be(!1),M?.()},onReject:()=>Be(!1)})]})});return x!=null?e.jsx(h.NiceThemeProvider,{theme:x,children:En}):En}),{displayName:"NiceSetupWizard"}),ba=Object.assign(i.forwardRef(({label:n,helperText:s,disabled:t,size:a="md",id:r,className:o,style:l,accessMode:m,logo:f,brandName:p,breadcrumbs:u,centerContent:g,rightContent:d,leftContent:c,sticky:v=!0,variant:x="light",height:b="md",onBrandClick:S,displayStyle:C},I)=>{const j=h.useNiceAccessMode(m,r),$=j==="hidden";j==="disabled"&&(t=!0);const{t:M}=h.useNiceTranslation(),D=h.useControlId(r),P=h.useComponentDisplayStyle("menu",C),E=h.useComponentDisplayClass("menu",C);return $?null:e.jsxs("nav",{ref:I,id:D,className:`nice-navbar nice-navbar--${x} nice-navbar--h-${b}${v?" nice-navbar--sticky":""} nice-navbar--ds-${E}${o?` ${o}`:""}${t?" nice-disabled":""}`,style:{...P,...l},role:"navigation","aria-label":n??M("mainNavigation","Main navigation"),children:[e.jsxs("div",{className:"nice-navbar__left",children:[c,(f||p)&&e.jsxs("div",{onKeyDown:h.clickOnActivationKey,className:"nice-navbar__brand",onClick:S,role:S?"button":void 0,tabIndex:S?0:void 0,children:[f&&e.jsx("span",{className:"nice-navbar__logo",children:f}),p&&e.jsx("span",{className:"nice-navbar__brand-name",children:p})]}),u&&u.length>0&&e.jsx("ol",{className:"nice-navbar__breadcrumbs","aria-label":M("breadcrumbs","Breadcrumbs"),children:u.map((N,z)=>e.jsxs("li",{className:"nice-navbar__breadcrumb",children:[z>0&&e.jsx("span",{className:"nice-navbar__breadcrumb-sep",children:"/"}),N.href||N.onClick?e.jsx("a",{href:N.href??"#",onClick:B=>{N.onClick&&(B.preventDefault(),N.onClick())},children:N.label}):e.jsx("span",{"aria-current":z===u.length-1?"page":void 0,children:N.label})]},z))})]}),g&&e.jsx("div",{className:"nice-navbar__center",children:g}),d&&e.jsx("div",{className:"nice-navbar__right",children:d})]})}),{displayName:"NiceNavbar"}),va={online:"var(--nice-color-success, #5cb85c)",away:"var(--nice-color-warning, #f0ad4e)",busy:"var(--nice-color-error, #d9534f)",offline:"var(--nice-text-muted, #999)"},Oi=Object.assign(i.forwardRef(({label:n,disabled:s,size:t="md",id:a,className:r,style:o,accessMode:l,userName:m,userEmail:f,userRole:p,avatarUrl:u,items:g=[],open:d,onOpenChange:c,onProfile:v,onLogout:x,avatarSize:b=36,status:S},C)=>{const I=h.useNiceAccessMode(l,a),j=I==="hidden";I==="disabled"&&(s=!0);const{t:$}=h.useNiceTranslation(),M=h.useControlId(a),[D,P]=i.useState(!1),E=d??D,N=i.useCallback(A=>{P(A),c?.(A)},[c]),z=i.useCallback(()=>N(!E),[E,N]),B=i.useRef(null),w=i.useRef(null);h.useMenuButton(B,w,{open:E,onOpenChange:N});const[_,T]=i.useState(null),O=i.useCallback(()=>{const A=B.current?.getBoundingClientRect();A&&T({top:A.bottom+6,right:window.innerWidth-A.right})},[]);i.useLayoutEffect(()=>{E&&O()},[E,O]),i.useEffect(()=>{if(!E)return;const A=()=>O();return window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),()=>{window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A)}},[E,O]);const Z=m.split(" ").map(A=>A.charAt(0)).join("").toUpperCase().slice(0,2),y=[];v&&y.push({id:"__profile",label:$("profile","Profile"),onClick:v}),x&&y.push({id:"__divider",label:"",isDivider:!0},{id:"__logout",label:$("logout","Logout"),onClick:x,danger:!0});const R=g.length>0?g:y;return j?null:e.jsxs("div",{ref:C,id:M,className:`nice-user-menu nice-size-${t}${r?` ${r}`:""}${s?" nice-disabled":""}`,style:o,children:[e.jsxs("button",{ref:B,type:"button",className:"nice-user-menu__trigger",onClick:z,disabled:s,"aria-haspopup":"menu","aria-expanded":E,"aria-label":n??m,children:[e.jsx("span",{className:"nice-user-menu__avatar",style:{width:b,height:b},children:u?e.jsx("img",{src:u,alt:m}):e.jsx("span",{className:"nice-user-menu__initials",children:Z})}),S&&e.jsx("span",{className:"nice-user-menu__status",style:{backgroundColor:va[S]},title:S})]}),E&&_&&typeof document<"u"&&gn.createPortal(e.jsxs("div",{ref:w,className:`nice-user-menu__dropdown nice-user-menu__dropdown--portal ${Xe.scopeThemeClass(B.current)}`,role:"menu",style:{position:"fixed",top:_.top,right:_.right,zIndex:1e3},onMouseDown:A=>A.preventDefault(),children:[e.jsxs("div",{className:"nice-user-menu__info",children:[e.jsx("span",{className:"nice-user-menu__name",children:m}),f&&e.jsx("span",{className:"nice-user-menu__email",children:f}),p&&e.jsx("span",{className:"nice-user-menu__role",children:p})]}),R.length>0&&e.jsx("div",{className:"nice-user-menu__items",children:R.map(A=>A.isDivider?e.jsx("hr",{className:"nice-user-menu__divider"},A.id):e.jsxs("button",{type:"button",role:"menuitem",className:`nice-user-menu__item${A.danger?" nice-user-menu__item--danger":""}`,onClick:()=>{A.onClick?.(),N(!1)},disabled:A.disabled||s,children:[A.icon&&e.jsx("span",{className:"nice-user-menu__item-icon",children:A.icon}),e.jsx("span",{children:A.label})]},A.id))})]}),document.body)]})}),{displayName:"NiceUserMenu"});function fa(n,s){if(!s)return n;const t=s.toLowerCase();return n.map(a=>{const r=a.entities.filter(l=>l.label.toLowerCase().includes(t)||l.name.toLowerCase().includes(t));return a.label.toLowerCase().includes(t)||a.name.toLowerCase().includes(t)?a:r.length>0?{...a,entities:r}:null}).filter(Boolean)}const _a=({value:n,onChange:s,placeholder:t})=>{const{t:a}=h.useNiceTranslation();return e.jsxs("div",{className:"nice-dynamic-sidebar__search",children:[e.jsx("span",{className:"nice-dynamic-sidebar__search-icon","aria-hidden":!0,children:e.jsx(h.NiceIcon,{name:"search",size:16})}),e.jsx("input",{type:"text",className:"nice-dynamic-sidebar__search-input",value:n,onChange:r=>s(r.target.value),placeholder:t,"aria-label":t}),n&&e.jsx("button",{className:"nice-dynamic-sidebar__search-clear",onClick:()=>s(""),"aria-label":a("nav.clear","Clear"),type:"button",children:e.jsx(h.NiceIcon,{name:"close",size:14})})]})},xa=({module:n,activeRoute:s,collapsed:t,expandedModules:a,onToggleModule:r,onNavigate:o})=>{const l=a.has(n.id);return t?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:n.icon?e.jsx(h.NiceIcon,{name:n.icon,size:18}):e.jsx("span",{children: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 ${l?"nice-dynamic-sidebar__module-header--expanded":""}`,onClick:()=>n.isAvailable&&r(n.id),disabled:!n.isAvailable,type:"button","aria-expanded":l,children:[n.icon&&e.jsx("span",{className:"nice-dynamic-sidebar__module-icon",children:e.jsx(h.NiceIcon,{name:n.icon,size:16})}),e.jsx("span",{className:"nice-dynamic-sidebar__module-label",children:n.label}),e.jsx("span",{className:`nice-dynamic-sidebar__module-chevron ${l?"nice-dynamic-sidebar__module-chevron--open":""}`,children:e.jsx(h.NiceIcon,{name:"chevron-right",size:14})})]}),l&&e.jsx("ul",{className:"nice-dynamic-sidebar__entities",role:"list",children:n.entities.map(m=>e.jsx("li",{className:`nice-dynamic-sidebar__entity ${s===m.route?"nice-dynamic-sidebar__entity--active":""}`,children:e.jsxs("button",{className:"nice-dynamic-sidebar__entity-btn",onClick:()=>o(m.route,m),type:"button",children:[m.icon&&e.jsx("span",{className:"nice-dynamic-sidebar__entity-icon",children:e.jsx(h.NiceIcon,{name:m.icon,size:14})}),e.jsx("span",{children:m.label})]})},m.id))})]})},Na=({favorites:n,activeRoute:s,onNavigate:t,label:a})=>n.length===0?null:e.jsxs("div",{className:"nice-dynamic-sidebar__favorites",children:[e.jsx("div",{className:"nice-dynamic-sidebar__section-title",children:a}),e.jsx("ul",{role:"list",children:n.map(r=>e.jsx("li",{className:`nice-dynamic-sidebar__favorite ${s===r.route?"nice-dynamic-sidebar__favorite--active":""}`,children:e.jsxs("button",{className:"nice-dynamic-sidebar__favorite-btn",onClick:()=>t(r.route),type:"button",children:[r.icon&&e.jsx(h.NiceIcon,{name:r.icon,size:14}),e.jsx("span",{children:r.label})]})},r.id))})]}),ga=Object.assign(i.forwardRef(({menu:n,activeRoute:s,collapsed:t,width:a=260,collapsedWidth:r=56,searchable:o=!0,showFavorites:l=!0,showQuickActions:m=!0,collapsible:f=!0,onNavigate:p,onCollapseChange:u,onToggleFavorite:g,header:d,footer:c,className:v,style:x,id:b,accessMode:S,...C},I)=>{const j=h.useControlId(b),$=h.useNiceAccessMode(S,b),{t:M}=h.useNiceTranslation(),[D,P]=i.useState(t??!1),E=t??D,[N,z]=i.useState(""),[B,w]=i.useState(()=>{if(s){const R=n.modules.find(A=>A.entities.some(V=>V.route===s));return R?new Set([R.id]):new Set}return new Set}),_=i.useCallback(()=>{const R=!E;P(R),u?.(R)},[E,u]),T=i.useCallback(R=>{w(A=>{const V=new Set(A);return V.has(R)?V.delete(R):V.add(R),V})},[]),O=i.useCallback((R,A)=>{p?.(R,A)},[p]),Z=i.useMemo(()=>fa(n.modules.filter(R=>R.isAvailable).sort((R,A)=>R.order-A.order),N),[n.modules,N]),y=E?r:a;return $==="hidden"?null:e.jsxs("nav",{ref:I,id:j,className:`nice-dynamic-sidebar ${E?"nice-dynamic-sidebar--collapsed":""} ${v??""}`,style:{...x,width:y,minWidth:y},"aria-label":M("nav.sidebar","Sidebar"),...C,children:[d&&e.jsx("div",{className:"nice-dynamic-sidebar__header",children:d}),f&&e.jsx("button",{className:"nice-dynamic-sidebar__toggle",onClick:_,"aria-label":E?M("expand","Expand"):M("collapse","Collapse"),type:"button",children:e.jsx(h.NiceIcon,{name:E?"chevron-right":"chevron-left",size:14})}),o&&!E&&e.jsx(_a,{value:N,onChange:z,placeholder:M("nav.search","Search")}),l&&!E&&e.jsx(Na,{favorites:n.favorites,activeRoute:s,onNavigate:O,label:M("nav.favorites","Favorites")}),m&&!E&&n.quickActions.length>0&&e.jsx("div",{className:"nice-dynamic-sidebar__quick-actions",children:n.quickActions.map(R=>e.jsxs("button",{className:"nice-dynamic-sidebar__quick-action",onClick:()=>O(R.route),title:R.shortcut?`${R.label} (${R.shortcut})`:R.label,type:"button",children:[R.icon&&e.jsx(h.NiceIcon,{name:R.icon,size:14}),e.jsx("span",{children:R.label})]},R.id))}),e.jsxs("div",{className:"nice-dynamic-sidebar__modules",role:"navigation",children:[Z.map(R=>e.jsx(xa,{module:R,activeRoute:s,collapsed:E,expandedModules:B,onToggleModule:T,onNavigate:O},R.id)),Z.length===0&&!E&&e.jsx("div",{className:"nice-dynamic-sidebar__empty",children:M("noData","No data")})]}),c&&e.jsx("div",{className:"nice-dynamic-sidebar__footer",children:c})]})}),{displayName:"NiceDynamicSidebar"}),ja=Object.assign(i.forwardRef(({user:n,userMenuItems:s,onProfile:t,onLogout:a,showLogin:r=!0,loginLabel:o,onLoginClick:l,showRegister:m,registerLabel:f,onRegisterClick:p,size:u="md",compact:g=!1,className:d,style:c,id:v,"data-testid":x="nice-auth-buttons"},b)=>{const{t:S}=h.useNiceTranslation(),C=["nice-auth-buttons",`nice-auth-buttons--${u}`,g?"nice-auth-buttons--compact":"",d??""].filter(Boolean).join(" ");if(n)return e.jsx("div",{ref:b,id:v,className:C,style:c,"data-testid":x,children:e.jsx(Oi,{userName:n.name,userEmail:n.email,userRole:n.role,avatarUrl:n.avatarUrl,status:n.status,items:s,onProfile:t,onLogout:a,size:u})});const I=m??!!p;return e.jsxs("div",{ref:b,id:v,className:C,style:c,"data-testid":x,children:[r&&l&&e.jsx(vn.NiceButton,{variant:"ghost",size:u,onClick:l,className:"nice-auth-buttons__login",children:o??S("auth.signIn","Sign in")}),I&&p&&e.jsx(vn.NiceButton,{variant:"primary",size:u,onClick:p,className:"nice-auth-buttons__register",children:f??S("auth.register","Register")})]})}),{displayName:"NiceAuthButtons"}),ya=[];function Us(n){return!n.children||n.children.length===0}function Fi(n,s){return s?n.id===s?!0:(n.children??[]).some(t=>Fi(t,s)):!1}const ka=Object.assign(i.forwardRef(({items:n=ya,activeId:s,size:t="md",align:a="start",ariaLabel:r,stretch:o=!1,trigger:l="click",hoverCloseDelay:m=150,className:f,style:p,id:u,"data-testid":g="nice-nav-menu"},d)=>{const{t:c}=h.useNiceTranslation(),v=i.useId(),[x,b]=i.useState(null),S=i.useRef(null),C=i.useRef(null),I=i.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null)},[]),j=i.useCallback(()=>{I(),C.current=setTimeout(()=>{b(null),C.current=null},m)},[I,m]);i.useEffect(()=>()=>I(),[I]);const $=l==="hover",M=y=>!!(y.megaPanel||y.megaColumns&&y.megaColumns.length>0),D=i.useCallback(y=>{S.current=y,typeof d=="function"?d(y):d&&(d.current=y)},[d]);i.useEffect(()=>{if(!x)return;const y=R=>{S.current?.contains(R.target)||b(null)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[x]);const P=i.useRef(null),E=i.useRef(null),N=i.useRef(null),z=x?n.find(y=>y.id===x.itemId):void 0;h.useRovingFocus(P,{orientation:"horizontal",wrap:!0,itemSelector:"[data-nice-nav-id]"}),h.useOverlayFocus(E,{open:x!=null&&!x.byPointer,modal:!1,onClose:()=>b(null)}),h.useRovingFocus(E,{orientation:z&&M(z)?"grid":"vertical",wrap:!0,typeahead:!0}),h.useOverlayFocus(N,{open:x?.submenuId!=null&&!x.byPointer&&!x.subByPointer,modal:!1,onClose:()=>b(y=>y&&{...y,submenuId:null})}),h.useRovingFocus(N,{orientation:"vertical",wrap:!0,typeahead:!0});const B=i.useMemo(()=>n.filter(y=>!y.divider),[n]),w=y=>{const R=!Us(y),A=M(y),V=R||A,te=x?.itemId===y.id,ne=["nice-nav-menu__item",Fi(y,s)?"nice-nav-menu__item--active":"",te?"nice-nav-menu__item--open":"",y.disabled?"nice-nav-menu__item--disabled":"",A?"nice-nav-menu__item--mega":""].filter(Boolean).join(" "),ie=U=>{const de=U.nativeEvent.niceSource;V&&(U.key==="Enter"||U.key===" "||U.key==="ArrowDown"&&de!=="gamepad")&&(U.preventDefault(),b({itemId:y.id,submenuId:null}))},se=e.jsxs(e.Fragment,{children:[y.icon!=null&&e.jsx("span",{className:"nice-nav-menu__item-icon","aria-hidden":"true",children:y.icon}),e.jsx("span",{className:"nice-nav-menu__item-label",children:y.label}),y.badge!=null&&e.jsx("span",{className:"nice-nav-menu__item-badge",children:y.badge}),V&&e.jsx("span",{className:"nice-nav-menu__item-chevron","aria-hidden":"true",children:e.jsx(h.NiceIcon,{name:"chevron-down",size:14})})]});return V?e.jsxs("li",{className:`nice-nav-menu__li${A?" nice-nav-menu__li--mega":""}`,onMouseEnter:$?()=>{I(),b(U=>U?.itemId===y.id?U:{itemId:y.id,submenuId:null,byPointer:!0})}:void 0,onMouseLeave:$?j:void 0,children:[e.jsx("button",{type:"button",className:ne,"data-nice-nav-id":y.id,"aria-haspopup":A?"true":"menu","aria-expanded":te,"aria-controls":`${v}-panel-${y.id}`,disabled:y.disabled,onClick:()=>{b($?U=>U?.itemId===y.id?null:{itemId:y.id,submenuId:null}:U=>U?.itemId===y.id?null:{itemId:y.id,submenuId:null})},onKeyDown:ie,children:se}),te&&(A?_(y):T(y))]},y.id):y.href&&!y.disabled?e.jsx("li",{className:"nice-nav-menu__li",children:e.jsx("a",{href:y.href,target:y.target,rel:y.rel,className:ne,"data-nice-nav-id":y.id,onKeyDown:ie,onClick:U=>{y.onClick?.(U),b(null)},children:se})},y.id):e.jsx("li",{className:"nice-nav-menu__li",children:e.jsx("button",{type:"button",className:ne,"data-nice-nav-id":y.id,disabled:y.disabled,onClick:U=>{y.onClick?.(U),b(null)},onKeyDown:ie,children:se})},y.id)},_=y=>{const R=`${v}-panel-${y.id}`,A=typeof y.megaPanel=="function"?y.megaPanel():y.megaPanel;return e.jsx("div",{ref:E,id:R,role:"menu","aria-label":typeof y.label=="string"?y.label:void 0,className:"nice-nav-menu__mega",onMouseEnter:$?I:void 0,onMouseLeave:$?j:void 0,children:e.jsxs("div",{className:"nice-nav-menu__mega-inner",children:[A??e.jsx("div",{className:"nice-nav-menu__mega-grid",children:(y.megaColumns??[]).map((V,te)=>e.jsxs("div",{className:"nice-nav-menu__mega-col",children:[V.title!=null&&e.jsx("div",{className:"nice-nav-menu__mega-col-title",children:V.title}),e.jsx("ul",{className:"nice-nav-menu__mega-col-list",children:V.items.map(G=>e.jsx("li",{className:"nice-nav-menu__mega-col-li",children:G.href?e.jsxs("a",{role:"menuitem",className:"nice-nav-menu__mega-col-item",href:G.href,target:G.target,rel:G.rel,onClick:ne=>{G.onClick?.(ne),b(null)},children:[G.icon!=null&&e.jsx("span",{className:"nice-nav-menu__mega-col-item-icon","aria-hidden":"true",children:G.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:G.label}),G.description&&e.jsx("span",{className:"nice-nav-menu__mega-col-item-desc",children:G.description})]})]}):e.jsxs("button",{type:"button",role:"menuitem",className:"nice-nav-menu__mega-col-item",disabled:G.disabled,onClick:ne=>{G.onClick?.(ne),b(null)},children:[G.icon!=null&&e.jsx("span",{className:"nice-nav-menu__mega-col-item-icon","aria-hidden":"true",children:G.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:G.label}),G.description&&e.jsx("span",{className:"nice-nav-menu__mega-col-item-desc",children:G.description})]})]})},G.id))}),V.footer!=null&&e.jsx("div",{className:"nice-nav-menu__mega-col-footer",children:V.footer})]},te))}),y.megaFooter!=null&&e.jsx("div",{className:"nice-nav-menu__mega-footer",children:y.megaFooter})]})})},T=y=>{const R=y.children??[],A=`${v}-panel-${y.id}`,V=a==="end"?"nice-nav-menu__panel--end":"nice-nav-menu__panel--start";return e.jsx("div",{ref:E,id:A,role:"menu","aria-label":typeof y.label=="string"?y.label:void 0,className:`nice-nav-menu__panel ${V}`,children:e.jsx("ul",{className:"nice-nav-menu__panel-list",children:R.map((te,G)=>O(y.id,te,G))})})},O=(y,R,A)=>{if(R.divider)return e.jsx("li",{className:"nice-nav-menu__panel-divider",role:"separator"},`div-${A}`);const V=!Us(R),te=x?.itemId===y&&x.submenuId===R.id,G=["nice-nav-menu__panel-item",R.disabled?"nice-nav-menu__panel-item--disabled":"",R.danger?"nice-nav-menu__panel-item--danger":"",te?"nice-nav-menu__panel-item--open":"",R.id===s?"nice-nav-menu__panel-item--active":""].filter(Boolean).join(" "),ne=(de,re=!1)=>b(le=>le&&le.itemId===y?{...le,submenuId:de,subByPointer:re}:{itemId:y,submenuId:de,subByPointer:re}),ie=de=>{de.key==="ArrowRight"&&V?(de.preventDefault(),ne(R.id)):de.key==="ArrowLeft"&&(de.preventDefault(),x?.submenuId?ne(null):(b(null),S.current?.querySelector(`[data-nice-nav-id="${y}"]`)?.focus()))},se=e.jsxs(e.Fragment,{children:[R.icon!=null&&e.jsx("span",{className:"nice-nav-menu__panel-item-icon","aria-hidden":"true",children:R.icon}),e.jsxs("span",{className:"nice-nav-menu__panel-item-text",children:[e.jsx("span",{className:"nice-nav-menu__panel-item-label",children:R.label}),R.description&&e.jsx("span",{className:"nice-nav-menu__panel-item-desc",children:R.description})]}),R.badge!=null&&e.jsx("span",{className:"nice-nav-menu__panel-item-badge",children:R.badge}),V&&e.jsx("span",{className:"nice-nav-menu__panel-item-chevron","aria-hidden":"true",children:e.jsx(h.NiceIcon,{name:"chevron-right",size:14})})]}),U=V?e.jsx("button",{type:"button",role:"menuitem",className:G,"data-nice-panel-id":`${y}-${R.id}`,"aria-haspopup":"menu","aria-expanded":te,disabled:R.disabled,onClick:()=>ne(te?null:R.id),onMouseEnter:()=>{te||ne(R.id,!0)},onKeyDown:ie,children:se}):R.href&&!R.disabled?e.jsx("a",{role:"menuitem",className:G,"data-nice-panel-id":`${y}-${R.id}`,href:R.href,target:R.target,rel:R.rel,onMouseEnter:()=>x?.submenuId&&ne(null,!0),onClick:de=>{R.onClick?.(de),b(null)},onKeyDown:ie,children:se}):e.jsx("button",{type:"button",role:"menuitem",className:G,"data-nice-panel-id":`${y}-${R.id}`,disabled:R.disabled,onMouseEnter:()=>x?.submenuId&&ne(null,!0),onClick:de=>{R.onClick?.(de),b(null)},onKeyDown:ie,children:se});return e.jsxs("li",{className:"nice-nav-menu__panel-li",children:[U,V&&te&&Z(y,R)]},R.id)},Z=(y,R)=>{const A=R.children??[];return e.jsxs("div",{ref:N,role:"menu","aria-label":typeof R.label=="string"?R.label:void 0,className:"nice-nav-menu__subpanel",onKeyDown:V=>{V.key==="ArrowLeft"&&(V.preventDefault(),V.stopPropagation(),b(te=>te&&{...te,submenuId:null}))},children:[e.jsx("ul",{className:"nice-nav-menu__panel-list",children:A.map((V,te)=>{if(V.divider)return e.jsx("li",{className:"nice-nav-menu__panel-divider",role:"separator"},`subdiv-${te}`);const G=["nice-nav-menu__panel-item",V.disabled?"nice-nav-menu__panel-item--disabled":"",V.danger?"nice-nav-menu__panel-item--danger":"",V.id===s?"nice-nav-menu__panel-item--active":""].filter(Boolean).join(" "),ne=e.jsxs(e.Fragment,{children:[V.icon!=null&&e.jsx("span",{className:"nice-nav-menu__panel-item-icon","aria-hidden":"true",children:V.icon}),e.jsxs("span",{className:"nice-nav-menu__panel-item-text",children:[e.jsx("span",{className:"nice-nav-menu__panel-item-label",children:V.label}),V.description&&e.jsx("span",{className:"nice-nav-menu__panel-item-desc",children:V.description})]}),V.badge!=null&&e.jsx("span",{className:"nice-nav-menu__panel-item-badge",children:V.badge})]});return e.jsx("li",{className:"nice-nav-menu__panel-li",children:V.href&&!V.disabled?e.jsx("a",{role:"menuitem",className:G,href:V.href,target:V.target,rel:V.rel,onClick:ie=>{V.onClick?.(ie),b(null)},children:ne}):e.jsx("button",{type:"button",role:"menuitem",className:G,disabled:V.disabled,onClick:ie=>{V.onClick?.(ie),b(null)},children:ne})},V.id)})}),e.jsx("span",{hidden:!0,"data-parent-id":y})]})};return e.jsx("nav",{ref:D,id:u,className:["nice-nav-menu",`nice-nav-menu--${t}`,o?"nice-nav-menu--stretch":"",f??""].filter(Boolean).join(" "),style:p,"aria-label":r??c("nav.primary","Primary navigation"),"data-testid":g,children:e.jsx("ul",{className:"nice-nav-menu__list",ref:P,children:B.map(w)})})}),{displayName:"NiceNavMenu"}),Ca=[],wa=Object.assign(i.forwardRef(({tabs:n=Ca,activeIndex:s,defaultActiveIndex:t,renderTab:a,onActiveChange:r,onCloseTab:o,onReorderTabs:l,onSaveState:m,enableShortcuts:f=!0,maxTabs:p=0,showDirtyIndicator:u=!0,tabBarPosition:g="top",draggable:d=!0,showAddButton:c=!1,onAddTab:v,keepAlive:x=!0,warnOnUnsavedClose:b=!0,maxClosedTabs:S=10,onUndoCloseTab:C,getTabState:I,unsavedWarningMessage:j,className:$,style:M,id:D,accessMode:P,...E},N)=>{const z=i.useRef(null);h.useRovingFocus(z,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const B=h.useControlId(D),w=h.useNiceAccessMode(P,D),{t:_}=h.useNiceTranslation(),[T,O]=h.useControllableState({value:s,defaultValue:t,fallbackValue:0,onChange:r,componentName:"NiceMdiWorkspace"}),Z=i.useRef(null),[y,R]=i.useState(null),[A,V]=i.useState(null),[te,G]=i.useState([]),[ne,ie]=i.useState(null),se=i.useCallback((Y,Q,ue=!1)=>{if(!ue&&b&&Y.isDirty){ie({tab:Y,index:Q});return}const we={tab:{...Y},originalIndex:Q,closedAt:Date.now(),state:I?.(Y)};G(Ie=>[we,...Ie].slice(0,S)),o?.(Y,Q)},[b,S,I,o]),U=i.useCallback(()=>{if(te.length===0)return;const[Y,...Q]=te;G(Q),C?.(Y)},[te,C]);i.useEffect(()=>{if(!f)return;const Y=Q=>{const ue=Q.ctrlKey||Q.metaKey;if(ue&&Q.key==="w"){Q.preventDefault();const we=n[T];we&&we.closable!==!1&&se(we,T)}else if(ue&&Q.key==="Tab"){Q.preventDefault();const we=Q.shiftKey?-1:1,Ie=(T+we+n.length)%n.length;O(Ie)}else ue&&Q.shiftKey&&(Q.key==="t"||Q.key==="T")&&(Q.preventDefault(),U())};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[f,n,T,se,U,O]),i.useEffect(()=>{if(!m)return;const Y=setTimeout(()=>{m({tabs:n,activeTabIndex:T})},500);return()=>clearTimeout(Y)},[n,T,m]);const de=i.useCallback(Y=>{d&&V(Y)},[d]),re=i.useCallback((Y,Q)=>{Y.preventDefault()},[A]),le=i.useCallback((Y,Q)=>{if(Y===Q||Q<0||Q>=n.length)return;const ue=[...n],[we]=ue.splice(Y,1);ue.splice(Q,0,we),l?.(ue);let Ie=T;T===Y?Ie=Q:Y<T&&Q>=T?Ie--:Y>T&&Q<=T&&Ie++,Ie!==T&&O(Ie)},[n,T,l,O]),ge=i.useCallback(Y=>{A===null||A===Y||(le(A,Y),V(null))},[A,le]),H=i.useCallback((Y,Q)=>{Y.preventDefault(),R({tabIndex:Q,x:Y.clientX,y:Y.clientY})},[]),q=i.useCallback(()=>R(null),[]),pe=i.useMemo(()=>{if(!y)return[];const Y=n[y.tabIndex];return[{label:_("wm.close","Close"),action:()=>{se(Y,y.tabIndex),q()},disabled:Y.closable===!1},{label:_("wm.closeAll","Close all"),action:()=>{n.forEach((Q,ue)=>Q.closable!==!1&&se(Q,ue)),q()}},{label:_("wm.closeOthers","Close others"),action:()=>{n.forEach((Q,ue)=>ue!==y.tabIndex&&Q.closable!==!1&&se(Q,ue)),q()}},{label:_("controls.pin","Pin"),action:()=>q()},...d&&l?[{label:_("wm.moveLeft","Move left"),action:()=>{le(y.tabIndex,y.tabIndex-1),q()},disabled:y.tabIndex===0},{label:_("wm.moveRight","Move right"),action:()=>{le(y.tabIndex,y.tabIndex+1),q()},disabled:y.tabIndex===n.length-1}]:[],{type:"divider"},{label:_("wm.reopenClosed","Reopen closed tab"),action:()=>{U(),q()},disabled:te.length===0,shortcut:"Ctrl+Shift+T"}]},[y,n,_,se,U,te.length,q,d,l,le]);i.useEffect(()=>{if(!y)return;const Y=()=>q();return window.addEventListener("click",Y),()=>window.removeEventListener("click",Y)},[y,q]);const _e=i.useRef(null);h.useOverlayFocus(_e,{open:!!y,modal:!1,onClose:q}),h.useRovingFocus(_e,{orientation:"vertical",wrap:!0});const Re=i.useRef(null);h.useOverlayFocus(Re,{open:!!ne,modal:!0,onClose:()=>ie(null)});const Ae=i.useCallback(Y=>{z.current?.querySelectorAll('[role="tab"]')[Y]?.focus()},[]);h.useIntent(["sectionPrev","sectionNext"],Y=>{if(n.length<2)return!1;const Q=(T+(Y.intent==="sectionNext"?1:-1)+n.length)%n.length;O(Q),Ae(Q)},{ref:Z}),h.useInputHints(Z,[{intent:"sectionPrev",label:_("wm.previousTab","Previous tab")},{intent:"sectionNext",label:_("wm.nextTab","Next tab")}]),h.useInputHints(z,[{intent:"secondary",label:_("wm.tabMenu","Tab menu")}]);const Ye=(Y,Q,ue)=>{Y.key==="Delete"&&Q.closable!==!1&&!Q.isPinned&&(Y.preventDefault(),se(Q,ue))};if(w==="hidden")return null;const X=e.jsxs("div",{className:`nice-mdi__tab-bar nice-mdi__tab-bar--${g}`,ref:z,role:"tablist",children:[n.map((Y,Q)=>e.jsxs("div",{className:`nice-mdi__tab ${Q===T?"nice-mdi__tab--active":""} ${Y.isPinned?"nice-mdi__tab--pinned":""}`,role:"tab","aria-selected":Q===T,onClick:()=>O(Q),onKeyDown:ue=>Ye(ue,Y,Q),onContextMenu:ue=>H(ue,Q),draggable:d,onDragStart:()=>de(Q),onDragOver:ue=>re(ue,Q),onDrop:()=>ge(Q),children:[Y.icon&&e.jsx("span",{className:"nice-mdi__tab-icon",children:e.jsx(h.NiceIcon,{name:Y.icon,size:14})}),e.jsx("span",{className:"nice-mdi__tab-title",children:Y.title}),u&&Y.isDirty&&e.jsx("span",{className:"nice-mdi__tab-dirty",title:_("wm.unsaved","Unsaved changes"),children:e.jsx(h.NiceIcon,{name:"circle",size:10})}),Y.closable!==!1&&!Y.isPinned&&e.jsx("button",{className:"nice-mdi__tab-close",onClick:ue=>{ue.stopPropagation(),se(Y,Q)},"aria-label":_("wm.close","Close"),type:"button",children:e.jsx(h.NiceIcon,{name:"close",size:14})})]},Y.id)),c&&e.jsx("button",{className:"nice-mdi__tab-add",onClick:v,"aria-label":_("controls.new","New"),type:"button",children:e.jsx(h.NiceIcon,{name:"plus",size:14})})]}),je=x?e.jsx("div",{className:"nice-mdi__content",children:n.map((Y,Q)=>e.jsx("div",{className:"nice-mdi__panel",role:"tabpanel",style:{display:Q===T?"block":"none"},children:a(Y,Q)},Y.id))}):e.jsx("div",{className:"nice-mdi__content",children:n[T]&&e.jsx("div",{className:"nice-mdi__panel",role:"tabpanel",children:a(n[T],T)})});return e.jsxs("div",{ref:Y=>{Z.current=Y,typeof N=="function"?N(Y):N&&(N.current=Y)},id:B,className:`nice-mdi ${$??""}`,style:M,...E,children:[g==="top"&&X,je,g==="bottom"&&X,y&&e.jsx("div",{ref:_e,className:"nice-mdi__ctx-menu",role:"menu","aria-label":_("wm.tabMenu","Tab menu"),style:{position:"fixed",left:y.x,top:y.y,zIndex:9999},children:pe.map((Y,Q)=>"type"in Y&&Y.type==="divider"?e.jsx("div",{className:"nice-mdi__ctx-divider",role:"separator"},Q):e.jsxs("button",{className:"nice-mdi__ctx-item",onClick:Y.action,disabled:Y.disabled,type:"button",role:"menuitem",children:[e.jsx("span",{className:"nice-mdi__ctx-label",children:Y.label}),"shortcut"in Y&&Y.shortcut&&e.jsx("span",{className:"nice-mdi__ctx-shortcut",children:Y.shortcut})]},Q))}),ne&&e.jsx("div",{role:"presentation",className:"nice-mdi__modal-backdrop",onClick:Y=>Y.target===Y.currentTarget&&ie(null),children:e.jsxs("div",{ref:Re,className:"nice-mdi__modal",role:"dialog","aria-modal":"true","aria-labelledby":`${B}-unsaved-title`,children:[e.jsx("div",{className:"nice-mdi__modal-icon",children:e.jsx(h.NiceIcon,{name:"warning",size:32})}),e.jsx("h3",{id:`${B}-unsaved-title`,className:"nice-mdi__modal-title",children:_("wm.unsavedTitle","Unsaved Changes")}),e.jsx("p",{className:"nice-mdi__modal-message",children:j??_("wm.unsavedMessage",'"{title}" has unsaved changes. Do you want to close it anyway?').replace("{title}",ne.tab.title)}),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:()=>ie(null),"data-autofocus":"",children:_("controls.cancel","Cancel")}),e.jsx("button",{type:"button",className:"nice-mdi__modal-btn nice-mdi__modal-btn--danger",onClick:()=>{se(ne.tab,ne.index,!0),ie(null)},children:_("wm.closeAnyway","Close Anyway")})]})]})})]})}),{displayName:"NiceMdiWorkspace"}),Sa=Object.assign(i.forwardRef(({topBar:n,sidePanel:s,sidePanelPosition:t="left",sidePanelWidth:a=280,children:r,hintBar:o="bottom",className:l,style:m,id:f,accessMode:p,...u},g)=>{const d=h.useControlId(f),c=Xe.useShellInput();return h.useNiceAccessMode(p,f)==="hidden"?null:e.jsxs("div",{ref:g,id:d,...c,className:`nice-shell nice-shell--dashboard ${l??""}`,style:m,...u,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-${t}`,children:[s&&e.jsx("aside",{className:"nice-shell__side-panel",style:{width:a},children:s}),e.jsx("main",{className:"nice-shell__dashboard-content",children:r})]}),e.jsx(Xe.ShellHintBar,{position:o,block:"nice-shell"})]})}),{displayName:"NiceDashboardShell"}),Ia=Object.assign(i.forwardRef(({overlay:n,lockScreen:s,locked:t=!1,children:a,hintBar:r="bottom",tv:o=!1,className:l,style:m,id:f,accessMode:p,...u},g)=>{const d=h.useControlId(f),c=Xe.useShellInput();return h.useNiceAccessMode(p,f)==="hidden"?null:e.jsxs("div",{ref:g,id:d,...c,"data-nice-tv":o?"on":void 0,className:`nice-shell nice-shell--kiosk ${l??""}`,style:{position:"fixed",inset:0,...m},...u,children:[t&&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:a}),n&&e.jsx("div",{className:"nice-shell__kiosk-overlay",children:n})]}),e.jsx(Xe.ShellHintBar,{position:r,block:"nice-shell"})]})}),{displayName:"NiceKioskShell"}),$a=Object.assign(i.forwardRef(({menu:n,activeRoute:s,tenant:t,topBarActions:a,globalSearch:r,footer:o,onNavigate:l,children:m,hintBar:f="bottom",className:p,style:u,id:g,accessMode:d,...c},v)=>{const x=h.useControlId(g),b=Xe.useShellInput();return h.useNiceAccessMode(d,g)==="hidden"?null:e.jsxs("div",{ref:v,id:x,...b,className:`nice-shell nice-shell--modern ${p??""}`,style:u,...c,children:[e.jsx("aside",{className:"nice-shell__modern-rail",role:"navigation",children:n?.modules.filter(C=>C.isAvailable).sort((C,I)=>C.order-I.order).map(C=>e.jsx("button",{type:"button",title:C.label,className:"nice-shell__modern-rail-item",onClick:()=>C.entities[0]&&l?.(C.entities[0].route),children:e.jsx("span",{"aria-hidden":!0,children:C.icon??e.jsx(h.NiceIcon,{name:"circle",size:16})})},C.id))}),e.jsxs("div",{className:"nice-shell__modern-main",children:[e.jsxs("header",{className:"nice-shell__modern-topbar",children:[t&&e.jsxs("div",{className:"nice-shell__modern-tenant",style:t.primaryColor?{borderColor:t.primaryColor}:void 0,children:[t.logoUrl&&e.jsx("img",{src:t.logoUrl,alt:""}),e.jsx("span",{children:t.shortName??t.name}),t.plan&&e.jsx("small",{children:t.plan})]}),r&&e.jsx("div",{className:"nice-shell__modern-search",children:r}),a&&e.jsx("div",{className:"nice-shell__modern-actions",children:a})]}),e.jsx("main",{className:"nice-shell__modern-content","data-active-route":s,children:m}),o&&e.jsx("footer",{className:"nice-shell__modern-footer",children:o})]}),e.jsx(Xe.ShellHintBar,{position:f,block:"nice-shell"})]})}),{displayName:"NiceModernShell"}),Ea=Object.assign(i.forwardRef(({header:n,tenant:s,maxWidth:t=960,centered:a=!0,children:r,hintBar:o="bottom",className:l,style:m,id:f,accessMode:p,...u},g)=>{const d=h.useControlId(f),c=Xe.useShellInput();return h.useNiceAccessMode(p,f)==="hidden"?null:e.jsxs("div",{ref:g,id:d,...c,className:`nice-shell nice-shell--minimal ${a?"nice-shell--minimal-centered":""} ${l??""}`,style:m,...u,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:t,marginInline:a?"auto":void 0},children:r}),e.jsx(Xe.ShellHintBar,{position:o,block:"nice-shell"})]})}),{displayName:"NiceMinimalShell"}),Ma=Object.assign(i.forwardRef(({menu:n,activeRoute:s,tenant:t,toolbar:a,inspector:r,inspectorOpen:o=!0,statusBar:l,onNavigate:m,children:f,hintBar:p="bottom",className:u,style:g,id:d,accessMode:c,...v},x)=>{const{t:b}=h.useNiceTranslation(),S=h.useControlId(d),C=Xe.useShellInput(),I=h.useNiceAccessMode(c,d),[j,$]=i.useState(o);return I==="hidden"?null:e.jsxs("div",{ref:x,id:S,...C,className:`nice-shell nice-shell--hybrid ${u??""}`,style:g,...v,children:[e.jsxs("header",{className:"nice-shell__hybrid-topbar",children:[t&&e.jsxs("div",{className:"nice-shell__hybrid-tenant",children:[t.logoUrl&&e.jsx("img",{src:t.logoUrl,alt:""}),e.jsx("span",{children:t.name})]}),a,r&&e.jsx("button",{type:"button",className:"nice-shell__hybrid-inspector-toggle",onClick:()=>$(M=>!M),"aria-pressed":j,"aria-label":b("shells.toggleInspector","Toggle inspector"),children:e.jsx(h.NiceIcon,{name:"settings",size:16})})]}),e.jsxs("div",{className:"nice-shell__hybrid-body",children:[e.jsx("aside",{className:"nice-shell__hybrid-sidebar",role:"navigation",children:n?.modules.filter(M=>M.isAvailable).sort((M,D)=>M.order-D.order).map(M=>e.jsxs("div",{className:"nice-shell__hybrid-nav-group",children:[e.jsx("div",{className:"nice-shell__hybrid-nav-group-label",children:M.label}),e.jsx("ul",{children:M.entities.map(D=>e.jsx("li",{children:e.jsx("button",{type:"button",className:`nice-shell__hybrid-nav-item ${s===D.route?"nice-shell__hybrid-nav-item--active":""}`,onClick:()=>m?.(D.route),children:D.label})},D.id))})]},M.id))}),e.jsx("main",{className:"nice-shell__hybrid-content",children:f}),r&&j&&e.jsx("aside",{className:"nice-shell__hybrid-inspector",children:r})]}),l&&e.jsx("footer",{className:"nice-shell__hybrid-status",children:l}),e.jsx(Xe.ShellHintBar,{position:p,block:"nice-shell"})]})}),{displayName:"NiceHybridShell"}),La=Object.assign(i.forwardRef(({appTitle:n,tenant:s,topBarActions:t,tabs:a=[],activeTabId:r,onTabChange:o,fab:l,children:m,hintBar:f="bottom",className:p,style:u,id:g,accessMode:d,...c},v)=>{const x=i.useRef(null);h.useRovingFocus(x,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const b=h.useControlId(g),S=Xe.useShellInput();return h.useNiceAccessMode(d,g)==="hidden"?null:e.jsxs("div",{ref:v,id:b,...S,className:`nice-shell nice-shell--pwa ${p??""}`,style:u,...c,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??""})]}),t&&e.jsx("div",{className:"nice-shell__pwa-actions",children:t})]}),e.jsx("main",{className:"nice-shell__pwa-content",children:m}),l&&e.jsx("div",{className:"nice-shell__pwa-fab",children:l}),a.length>0&&e.jsx("nav",{className:"nice-shell__pwa-tabs",ref:x,role:"tablist",children:a.map(I=>e.jsxs("button",{type:"button",role:"tab","aria-selected":r===I.id,className:`nice-shell__pwa-tab ${r===I.id?"nice-shell__pwa-tab--active":""}`,onClick:()=>o?.(I.id,I.route),children:[I.icon&&e.jsx("span",{"aria-hidden":!0,children:I.icon}),e.jsx("span",{children:I.label})]},I.id))}),e.jsx(Xe.ShellHintBar,{position:f,block:"nice-shell"})]})}),{displayName:"NicePwaShell"}),Ra=[];function Gn(n,s=16){return typeof n=="string"?e.jsx(h.NiceIcon,{name:n,size:s}):n}const za=Object.assign(i.forwardRef(({modes:n=Ra,activeMode:s,onModeChange:t,variant:a="dropdown",gridColumns:r=3,showDescription:o=!0,showColorIndicator:l=!0,compact:m=!1,size:f="md",className:p,style:u,id:g,accessMode:d,...c},v)=>{const x=h.useControlId(g),b=h.useNiceAccessMode(d,g),{t:S}=h.useNiceTranslation(),[C,I]=i.useState(!1),j=i.useRef(null),$=n.find(_=>_.key===s);i.useEffect(()=>{if(!C)return;const _=T=>{j.current&&!j.current.contains(T.target)&&I(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[C]);const M=i.useCallback(_=>{t?.(_),I(!1)},[t]),D=i.useRef(null),P=i.useCallback(_=>{D.current=_,j.current=_,typeof v=="function"?v(_):v&&(v.current=_)},[v]),{activeIndex:E,setActiveIndex:N,handleKeyDown:z}=rn.useListKeyboardNav(n,{open:C,onSelect:_=>M(_),onClose:()=>I(!1),onOpen:()=>B()}),B=()=>{N(Math.max(0,n.findIndex(_=>_.key===s))),I(!0)};h.useRovingFocus(D,{orientation:a==="card-grid"?"grid":"both",wrap:!0,activateOnMove:!0,enabled:a!=="dropdown"});const w=`${x}-modes`;return b==="hidden"?null:a==="dropdown"?e.jsxs("div",{ref:P,id:x,className:`nice-mode-selector nice-mode-selector--dropdown nice-mode-selector--${f}${m?" nice-mode-selector--compact":""} ${p??""}`,style:u,...c,children:[e.jsxs("button",{className:"nice-mode-selector__trigger",onClick:()=>C?I(!1):B(),onKeyDown:z,role:"combobox","aria-expanded":C,"aria-haspopup":"listbox","aria-controls":C?w:void 0,"aria-activedescendant":C&&n[E]?`${w}-${E}`:void 0,"aria-label":m?$?.displayName??s:void 0,title:m?$?.displayName??s:void 0,type:"button",children:[l&&$?.color&&e.jsx("span",{className:"nice-mode-selector__color",style:{backgroundColor:$.color}}),$?.icon&&e.jsx("span",{className:"nice-mode-selector__icon",children:Gn($.icon)}),!m&&e.jsx("span",{className:"nice-mode-selector__label",children:$?.displayName??s}),e.jsx("span",{className:"nice-mode-selector__chevron",children:e.jsx(h.NiceIcon,{name:C?"chevron-up":"chevron-down",size:"xs"})})]}),C&&e.jsx("ul",{className:"nice-mode-selector__menu",role:"listbox",id:w,children:n.map((_,T)=>e.jsxs("li",{id:`${w}-${T}`,className:`nice-mode-selector__option ${_.key===s?"nice-mode-selector__option--active":""} ${T===E?"nice-mode-selector__option--highlighted":""}`,onMouseEnter:()=>N(T),role:"option","aria-selected":_.key===s,onClick:()=>M(_),children:[l&&_.color&&e.jsx("span",{className:"nice-mode-selector__color",style:{backgroundColor:_.color}}),_.icon&&e.jsx("span",{className:"nice-mode-selector__icon",children:Gn(_.icon)}),e.jsxs("div",{children:[e.jsx("div",{className:"nice-mode-selector__name",children:_.displayName}),o&&_.description&&e.jsx("div",{className:"nice-mode-selector__desc",children:_.description})]})]},_.key))})]}):a==="pills"?e.jsx("div",{ref:P,id:x,className:`nice-mode-selector nice-mode-selector--pills ${p??""}`,style:u,role:"radiogroup",...c,children:n.map(_=>e.jsxs("button",{className:`nice-mode-selector__pill ${_.key===s?"nice-mode-selector__pill--active":""}`,style:l&&_.color?{borderColor:_.color}:void 0,onClick:()=>M(_),role:"radio","aria-checked":_.key===s,type:"button",children:[_.icon&&e.jsx("span",{children:Gn(_.icon)}),e.jsx("span",{children:_.displayName})]},_.key))}):e.jsx("div",{ref:P,id:x,className:`nice-mode-selector nice-mode-selector--card-grid ${p??""}`,style:{...u,gridTemplateColumns:`repeat(${r}, 1fr)`},role:"radiogroup",...c,children:n.map(_=>e.jsxs("button",{className:`nice-mode-selector__card ${_.key===s?"nice-mode-selector__card--active":""} ${m?"nice-mode-selector__card--compact":""}`,onClick:()=>M(_),role:"radio","aria-checked":_.key===s,type:"button",children:[l&&_.color&&e.jsx("div",{className:"nice-mode-selector__card-stripe",style:{backgroundColor:_.color}}),_.icon&&e.jsx("div",{className:"nice-mode-selector__card-icon",children:Gn(_.icon,24)}),e.jsx("div",{className:"nice-mode-selector__card-name",children:_.displayName}),o&&_.description&&!m&&e.jsx("div",{className:"nice-mode-selector__card-desc",children:_.description}),_.sourcePackage&&!m&&e.jsx("div",{className:"nice-mode-selector__card-pkg",children:_.sourcePackage})]},_.key))})}),{displayName:"NiceModeSelector"}),Da=[{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"}],Ta=[{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"}],Vs=["basic","contact","address","branding","localization","fiscal","preferences"],bn=({title:n,expanded:s,onToggle:t})=>e.jsxs("button",{className:`nice-org-form__section-header ${s?"nice-org-form__section-header--expanded":""}`,onClick:t,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:e.jsx(h.NiceIcon,{name:s?"chevron-down":"chevron-right",size:14})})]}),Oa=Object.assign(i.forwardRef(({profile:n,onChange:s,onSave:t,onCancel:a,sections:r,expandedSections:o,showActions:l=!0,countryOptions:m,languageOptions:f,currencyOptions:p,timezoneOptions:u,saving:g=!1,className:d,style:c,id:v,accessMode:x,...b},S)=>{const C=h.useControlId(v),I=h.useNiceAccessMode(x,v),{t:j}=h.useNiceTranslation(),$=i.useMemo(()=>r&&r.length>0?r:Vs,[r]),[M,D]=i.useState(()=>new Set(o??Vs)),P=i.useCallback(w=>{D(_=>{const T=new Set(_);return T.has(w)?T.delete(w):T.add(w),T})},[]),E=I==="readOnly",N=I==="disabled",z=i.useCallback((w,_)=>{s?.({...n,[w]:_})},[n,s]),B=i.useCallback(()=>{t?.(n)},[n,t]);return I==="hidden"?null:e.jsxs("div",{ref:S,id:C,className:`nice-org-form ${d??""}`,style:c,...b,children:[$.includes("basic")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(bn,{title:j("org.basic","Company Information"),expanded:M.has("basic"),onToggle:()=>P("basic")}),M.has("basic")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(Se.NiceTextInput,{label:j("org.name","Company Name"),value:n.name,onChange:w=>z("name",w),required:!0,disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.legalName","Legal Name"),value:n.legalName??"",onChange:w=>z("legalName",w),disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.taxId","Tax ID"),value:n.taxId??"",onChange:w=>z("taxId",w),disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.regNumber","Registration Number"),value:n.registrationNumber??"",onChange:w=>z("registrationNumber",w),disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.industry","Industry"),value:n.industry??"",onChange:w=>z("industry",w),disabled:N,readOnly:E}),e.jsx(Se.NiceNumberInput,{label:j("org.employees","Number of Employees"),value:n.employeeCount??null,onChange:w=>z("employeeCount",w??void 0),min:1,disabled:N,readOnly:E})]})]}),$.includes("contact")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(bn,{title:j("org.contact","Contact Details"),expanded:M.has("contact"),onToggle:()=>P("contact")}),M.has("contact")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(Se.NiceTextInput,{label:j("org.email","Email"),value:n.email??"",onChange:w=>z("email",w),type:"email",disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.phone","Phone"),value:n.phone??"",onChange:w=>z("phone",w),type:"tel",disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.website","Website"),value:n.website??"",onChange:w=>z("website",w),type:"url",disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.fax","Fax"),value:n.fax??"",onChange:w=>z("fax",w),type:"tel",disabled:N,readOnly:E})]})]}),$.includes("address")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(bn,{title:j("org.address","Address"),expanded:M.has("address"),onToggle:()=>P("address")}),M.has("address")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(Se.NiceTextInput,{label:j("org.street","Street"),value:n.street??"",onChange:w=>z("street",w),disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.city","City"),value:n.city??"",onChange:w=>z("city",w),disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.state","State / Province"),value:n.state??"",onChange:w=>z("state",w),disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.postalCode","Postal Code"),value:n.postalCode??"",onChange:w=>z("postalCode",w),disabled:N,readOnly:E}),m?e.jsx(Se.NiceSelect,{label:j("org.country","Country"),value:n.country??"",onChange:w=>z("country",w),options:m,searchable:!0,disabled:N,readOnly:E}):e.jsx(Se.NiceTextInput,{label:j("org.country","Country"),value:n.country??"",onChange:w=>z("country",w),disabled:N,readOnly:E})]})]}),$.includes("branding")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(bn,{title:j("org.branding","Branding"),expanded:M.has("branding"),onToggle:()=>P("branding")}),M.has("branding")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(Se.NiceTextInput,{label:j("org.logoUrl","Logo URL"),value:n.logoUrl??"",onChange:w=>z("logoUrl",w),type:"url",disabled:N,readOnly:E}),e.jsx(As.NiceColorPicker,{label:j("org.primaryColor","Primary Color"),value:n.primaryColor??"var(--nice-color-primary, #3b82f6)",onChange:w=>z("primaryColor",w),disabled:N,readOnly:E}),e.jsx(As.NiceColorPicker,{label:j("org.secondaryColor","Secondary Color"),value:n.secondaryColor??"var(--nice-color-accent, #8b5cf6)",onChange:w=>z("secondaryColor",w),disabled:N,readOnly:E})]})]}),$.includes("localization")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(bn,{title:j("org.localization","Localization"),expanded:M.has("localization"),onToggle:()=>P("localization")}),M.has("localization")&&e.jsxs("div",{className:"nice-org-form__fields",children:[f?e.jsx(Se.NiceSelect,{label:j("org.language","Default Language"),value:n.defaultLanguage??"",onChange:w=>z("defaultLanguage",w),options:f,searchable:!0,disabled:N,readOnly:E}):e.jsx(Se.NiceTextInput,{label:j("org.language","Default Language"),value:n.defaultLanguage??"",onChange:w=>z("defaultLanguage",w),disabled:N,readOnly:E}),p?e.jsx(Se.NiceSelect,{label:j("org.currency","Default Currency"),value:n.defaultCurrency??"",onChange:w=>z("defaultCurrency",w),options:p,searchable:!0,disabled:N,readOnly:E}):e.jsx(Se.NiceTextInput,{label:j("org.currency","Default Currency"),value:n.defaultCurrency??"",onChange:w=>z("defaultCurrency",w),disabled:N,readOnly:E}),u?e.jsx(Se.NiceSelect,{label:j("org.timezone","Default Timezone"),value:n.defaultTimezone??"",onChange:w=>z("defaultTimezone",w),options:u,searchable:!0,disabled:N,readOnly:E}):e.jsx(Se.NiceTextInput,{label:j("org.timezone","Default Timezone"),value:n.defaultTimezone??"",onChange:w=>z("defaultTimezone",w),disabled:N,readOnly:E}),e.jsx(Se.NiceSelect,{label:j("org.dateFormat","Date Format"),value:n.dateFormat??"YYYY-MM-DD",onChange:w=>z("dateFormat",w),options:Ta,disabled:N,readOnly:E})]})]}),$.includes("fiscal")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(bn,{title:j("org.fiscal","Fiscal Settings"),expanded:M.has("fiscal"),onToggle:()=>P("fiscal")}),M.has("fiscal")&&e.jsxs("div",{className:"nice-org-form__fields",children:[e.jsx(Se.NiceTextInput,{label:j("org.fiscalYearStart","Fiscal Year Start"),value:n.fiscalYearStart??"",onChange:w=>z("fiscalYearStart",w),placeholder:j("org.mmDd","MM-DD"),disabled:N,readOnly:E}),e.jsx(rn.NiceToggle,{label:j("org.vatEnabled","VAT Enabled"),checked:n.vatEnabled??!1,onChange:w=>z("vatEnabled",w),disabled:N||E}),n.vatEnabled&&e.jsx(Se.NiceNumberInput,{label:j("org.defaultVatRate","Default VAT Rate (%)"),value:n.defaultVatRate??null,onChange:w=>z("defaultVatRate",w??void 0),min:0,max:100,step:.5,disabled:N,readOnly:E})]})]}),$.includes("preferences")&&e.jsxs("div",{className:"nice-org-form__section",children:[e.jsx(bn,{title:j("org.preferences","Work Preferences"),expanded:M.has("preferences"),onToggle:()=>P("preferences")}),M.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:Da.map(w=>e.jsx(Se.NiceCheckbox,{label:w.label,checked:(n.workingDays??["Mon","Tue","Wed","Thu","Fri"]).includes(w.key),onChange:_=>{const T=n.workingDays??["Mon","Tue","Wed","Thu","Fri"],O=_?[...T,w.key]:T.filter(Z=>Z!==w.key);z("workingDays",O)},disabled:N||E},w.key))})]}),e.jsx(Se.NiceTextInput,{label:j("org.workStart","Working Hours Start"),value:n.workingHoursStart??"09:00",onChange:w=>z("workingHoursStart",w),placeholder:j("org.hhMm","HH:MM"),disabled:N,readOnly:E}),e.jsx(Se.NiceTextInput,{label:j("org.workEnd","Working Hours End"),value:n.workingHoursEnd??"17:00",onChange:w=>z("workingHoursEnd",w),placeholder:j("org.hhMm","HH:MM"),disabled:N,readOnly:E})]})]}),l&&e.jsxs("div",{className:"nice-org-form__actions",children:[a&&e.jsx(vn.NiceButton,{variant:"secondary",onClick:a,disabled:g,children:j("cancel","Cancel")}),t&&e.jsx(vn.NiceButton,{variant:"primary",onClick:B,loading:g,disabled:E||N,children:j("save","Save")})]})]})}),{displayName:"NiceOrganizationProfileForm"}),Fa=[],Aa={available:{color:"var(--nice-text-muted, #6b7280)",icon:"circle"},installed:{color:"var(--nice-color-primary, #3b82f6)",icon:"circle"},active:{color:"var(--nice-color-success, #10b981)",icon:"success"},disabled:{color:"var(--nice-color-warning, #f59e0b)",icon:"minus"},error:{color:"var(--nice-color-error, #ef4444)",icon:"error"},updating:{color:"var(--nice-color-accent, #8b5cf6)",icon:"refresh"}};function Pa(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 Ba=({module:n,onAction:s,onClick:t,showDependencies:a,showAuthor:r,showVersion:o,processing:l,disabled:m,readOnly:f,t:p,layout:u})=>{const g=Aa[n.status],d=Pa(n.status,n.isCore);return e.jsxs("div",{className:`nice-module-card nice-module-card--${u} nice-module-card--${n.status}`,onClick:t,role:t?"button":void 0,tabIndex:t?0:void 0,onKeyDown:t?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),t())}:void 0,children:[e.jsxs("div",{className:"nice-module-card__header",children:[e.jsx("span",{className:"nice-module-card__icon",children:e.jsx(h.NiceIcon,{name:n.icon??"box",size:20})}),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:g.color},title:n.status,children:[e.jsx(h.NiceIcon,{name:l?"refresh":g.icon,size:14})," ",n.status]})]}),e.jsx("div",{className:"nice-module-card__desc",children:n.description}),e.jsxs("div",{className:"nice-module-card__meta",children:[r&&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:p("module.core","Core")})]}),a&&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:[p("module.deps","Dependencies"),":"]}),n.dependencies.map(c=>e.jsx("span",{className:"nice-module-card__dep-tag",children:c},c))]}),!f&&d.length>0&&e.jsx("div",{className:"nice-module-card__actions",children:d.map(c=>e.jsx(vn.NiceButton,{size:"sm",variant:c==="uninstall"?"error":c==="activate"?"primary":"secondary",onClick:v=>{v.stopPropagation(),s(c)},disabled:m||l,loading:l,children:p(`module.${c}`,c.charAt(0).toUpperCase()+c.slice(1))},c))})]})},Ha=Object.assign(i.forwardRef(({modules:n=Fa,onAction:s,statusFilter:t,searchable:a=!0,showDependencies:r=!0,showAuthor:o=!0,showVersion:l=!0,processingModules:m,layout:f="list",gridColumns:p=3,onModuleClick:u,className:g,style:d,id:c,accessMode:v,...x},b)=>{const S=i.useRef(null);h.useRovingFocus(S,{orientation:"horizontal",wrap:!0,activateOnMove:!0});const C=h.useControlId(c),I=h.useNiceAccessMode(v,c),{t:j}=h.useNiceTranslation(),[$,M]=i.useState(""),[D,P]=i.useState("all"),E=I==="readOnly",N=I==="disabled",z=i.useMemo(()=>{let _=n;if(t&&t.length>0&&(_=_.filter(T=>t.includes(T.status))),D!=="all"&&(_=_.filter(T=>T.status===D)),$){const T=$.toLowerCase();_=_.filter(O=>O.label.toLowerCase().includes(T)||O.name.toLowerCase().includes(T)||O.description.toLowerCase().includes(T))}return _},[n,t,D,$]),B=i.useMemo(()=>{const _={all:n.length};for(const T of n)_[T.status]=(_[T.status]??0)+1;return _},[n]),w=i.useCallback((_,T)=>{s?.(_,T)},[s]);return I==="hidden"?null:e.jsxs("div",{ref:b,id:C,className:`nice-module-panel ${g??""}`,style:d,...x,children:[e.jsxs("div",{className:"nice-module-panel__toolbar",children:[a&&e.jsx(Se.NiceTextInput,{value:$,onChange:M,placeholder:j("module.search","Search modules…"),type:"search",clearable:!0,className:"nice-module-panel__search"}),e.jsx("div",{className:"nice-module-panel__filters",ref:S,role:"tablist",children:["all","active","installed","disabled","available","error"].map(_=>e.jsxs("button",{className:`nice-module-panel__filter ${D===_?"nice-module-panel__filter--active":""}`,onClick:()=>P(_),role:"tab","aria-selected":D===_,type:"button",children:[j(`module.status.${_}`,_==="all"?"All":_.charAt(0).toUpperCase()+_.slice(1)),e.jsx("span",{className:"nice-module-panel__filter-count",children:B[_]??0})]},_))})]}),e.jsx("div",{className:`nice-module-panel__grid nice-module-panel__grid--${f}`,style:f==="grid"?{gridTemplateColumns:`repeat(${p}, 1fr)`}:void 0,children:z.length===0?e.jsx("div",{className:"nice-module-panel__empty",children:j("module.empty","No modules found")}):z.map(_=>e.jsx(Ba,{module:_,onAction:T=>w(_.id,T),onClick:u?()=>u(_):void 0,showDependencies:r,showAuthor:o,showVersion:l,processing:m?.has(_.id)??!1,disabled:N,readOnly:E,t:j,layout:f},_.id))}),e.jsxs("div",{className:"nice-module-panel__summary",children:[j("module.total","Total"),": ",n.length," · ",j("module.status.active","Active"),":"," ",B.active??0," · ",j("module.status.disabled","Disabled"),":"," ",B.disabled??0," · ",j("module.status.error","Error"),":"," ",B.error??0]})]})}),{displayName:"NiceModuleLifecyclePanel"});exports.DEFAULT_SIDEBAR_PREFS=Ss;exports.DesktopContextMenu=Di;exports.DesktopGrid=zi;exports.DesktopStartMenu=Li;exports.DesktopSystemTray=Ri;exports.DesktopTaskbar=_s;exports.LANGUAGES=qs;exports.NICE_THEME_PICKER_PRESETS=hs;exports.NiceAccordion=it;exports.NiceAppLayout=sa;exports.NiceAuthButtons=ja;exports.NiceBreadcrumb=at;exports.NiceCard=Ws;exports.NiceCard$1=Zi;exports.NiceCardGroupSizeContext=js;exports.NiceCardRadioContext=gs;exports.NiceConsole=ra;exports.NiceContextMenu=es;exports.NiceDashboardLayout=na;exports.NiceDashboardShell=Sa;exports.NiceDesktop=aa;exports.NiceDock=ta;exports.NiceDynamicSidebar=ga;exports.NiceHybridShell=Ma;exports.NiceIconRail=bs;exports.NiceKioskShell=Ia;exports.NiceLanguagePicker=xs;exports.NiceMdiWorkspace=wa;exports.NiceMenu=Js;exports.NiceMinimalShell=Ea;exports.NiceModeSelector=za;exports.NiceModernShell=$a;exports.NiceModuleLifecyclePanel=Ha;exports.NiceNavMenu=ka;exports.NiceNavbar=ba;exports.NiceOrganizationProfileForm=Oa;exports.NicePwaShell=La;exports.NiceSetupWizard=pa;exports.NiceSidebarNav=Jt;exports.NiceSpinner=Xs;exports.NiceSplitter=ut;exports.NiceStepper=Mi;exports.NiceThemePicker=Ns;exports.NiceTooltip=He;exports.NiceUserMenu=Oi;exports.NiceWizard=la;exports.PREFS_CATEGORIES=$s;exports.SIDEBAR_DEFAULT_FAVORITE_LIST=tn;exports.SIDEBAR_MODE_META=Fn;exports.TreeDragSessionProvider=ni;exports.activeSidebarFavoriteList=ui;exports.buildPrefsCategoryViews=zt;exports.filterSidebarItems=ss;exports.findSidebarItemByRoute=hi;exports.mapSidebarViews=It;exports.navItemDrag=Cs;exports.normalizeSidebarSearch=Qn;exports.sidebarFavoriteItems=Xn;exports.sidebarFavoriteLists=di;exports.sidebarFavoriteListsOf=ns;exports.sidebarFavoriteTree=mi;exports.sidebarItemMatches=Jn;exports.sidebarModeLabel=Rn;exports.sidebarPrefsHostControlled=Ni;exports.startTreeDrag=ks;exports.toThemeDescriptor=Gs;exports.useSetupWizard=ua;exports.useSidebarNavPrefs=gi;exports.useTreeDragSession=jn;exports.walkSidebarNav=An;
|