@zydon/common-csr 2.1.2 → 2.1.3
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.
|
@@ -228,14 +228,18 @@ type NavButtonSectionProps = Omit<NavListProps, 'data' | 'depth'> & {
|
|
|
228
228
|
pathname: string;
|
|
229
229
|
};
|
|
230
230
|
|
|
231
|
-
declare const NavItem$
|
|
231
|
+
declare const NavItem$4: react.ForwardRefExoticComponent<Omit<NavItemProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
232
232
|
|
|
233
233
|
declare function NavSectionHorizontal({ sx, data, render, slotProps, enabledRootRedirect, cssVars: overridesVars, }: NavSectionProps): react_jsx_runtime.JSX.Element;
|
|
234
234
|
|
|
235
|
-
declare const NavItem$
|
|
235
|
+
declare const NavItem$3: react.ForwardRefExoticComponent<Omit<NavItemProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
236
236
|
|
|
237
237
|
declare const NavSectionMini: ({ sx, data, render, slotProps, enabledRootRedirect, cssVars: overridesVars, }: NavSectionProps) => react_jsx_runtime.JSX.Element;
|
|
238
238
|
|
|
239
|
+
declare const NavItem$2: react.ForwardRefExoticComponent<Omit<NavItemButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
240
|
+
|
|
241
|
+
declare const NavSectionMiniWithButtons: ({ sx, data, render, slotProps, enabledRootRedirect, cssVars: overridesVars, onNavigate, pathname, }: NavButtonSectionProps) => react_jsx_runtime.JSX.Element;
|
|
242
|
+
|
|
239
243
|
declare function stateClasses({ open, active, disabled, }: {
|
|
240
244
|
open?: boolean;
|
|
241
245
|
active?: boolean;
|
|
@@ -317,4 +321,4 @@ declare const NavItem: react.ForwardRefExoticComponent<Omit<NavItemButtonProps,
|
|
|
317
321
|
|
|
318
322
|
declare const NavSectionVerticalWithButtons: ({ sx, data, render, slotProps, enabledRootRedirect, cssVars: overridesVars, onNavigate, pathname, }: NavButtonSectionProps) => react_jsx_runtime.JSX.Element;
|
|
319
323
|
|
|
320
|
-
export { NavButtonGroupProps, NavButtonSectionProps, NavButtonSubListProps, NavCollapse, NavGroupProps, NavItemBaseProps, NavItemButtonProps, NavItemProps, NavItemRenderProps, NavItemSlotProps, NavItemStateProps, NavLi, NavListButtonProps, NavListProps, NavSectionHorizontal, NavItem$
|
|
324
|
+
export { NavButtonGroupProps, NavButtonSectionProps, NavButtonSubListProps, NavCollapse, NavGroupProps, NavItemBaseProps, NavItemButtonProps, NavItemProps, NavItemRenderProps, NavItemSlotProps, NavItemStateProps, NavLi, NavListButtonProps, NavListProps, NavSectionHorizontal, NavItem$4 as NavSectionHorizontalItem, NavSectionMini, NavItem$2 as NavSectionMiniButtonItem, NavItem$3 as NavSectionMiniItem, NavSectionMiniWithButtons, NavSectionProps, NavSectionVertical, NavItem as NavSectionVerticalButtonItem, NavItem$1 as NavSectionVerticalItem, NavSectionVerticalWithButtons, NavSubListProps, NavUl, SlotProps, Subheader, UseNavItemProps, UseNavItemReturn, bulletColor, navSectionClasses, navSectionCssVars, sharedStyles, stateClasses, useNavItem };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { stylesMode, paper, varAlpha } from '@zydon/common/theme/styles';
|
|
2
2
|
import { forwardRef, cloneElement, useState, useCallback, useRef, useEffect, useMemo } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import G from '@mui/material/Box';
|
|
4
|
+
import Ae from '@mui/material/ButtonBase';
|
|
5
5
|
import { styled, useTheme } from '@mui/material/styles';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
6
|
+
import De from '@mui/material/Tooltip';
|
|
7
|
+
import fe from '@zydon/common/components/Icon';
|
|
8
|
+
import _e from '@mui/material/Collapse';
|
|
9
|
+
import Ee from '@mui/material/ListSubheader';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import { Link, matchPath, useLocation } from 'react-router-dom';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
12
|
+
import ao from '@mui/material/Stack';
|
|
13
|
+
import so from '@zydon/common/components/Scrollbar';
|
|
14
|
+
import je from '@mui/material/Paper';
|
|
15
|
+
import eo from '@mui/material/Popover';
|
|
16
16
|
|
|
17
|
-
var t={mini:{root:"nav__section__mini"},horizontal:{root:"nav__section__horizontal"},vertical:{root:"nav__section__vertical"},item:{root:"mnl__nav__item",icon:"mnl__nav__item__icon",info:"mnl__nav__item__info",texts:"mnl__nav__item__texts",title:"mnl__nav__item__title",arrow:"mnl__nav__item__arrow",caption:"mnl__nav__item__caption"},li:"mnl__nav__li",ul:"mnl__nav__ul",paper:"mnl__nav__paper",subheader:"mnl__nav__subheader",state:{open:"state--open",active:"state--active",disabled:"state--disabled"}};var ae={dark:"#282F37",light:"#EDEFF2"};function F(e,n){let{vars:{palette:o}}=e;return {"--nav-item-color":o.text.secondary,"--nav-item-hover-bg":o.action.hover,"--nav-item-caption-color":o.text.disabled,"--nav-item-root-active-color":o.primary.main,"--nav-item-root-active-color-on-dark":o.primary.light,"--nav-item-root-active-bg":varAlpha(o.primary.mainChannel,.08),"--nav-item-root-active-hover-bg":varAlpha(o.primary.mainChannel,.16),"--nav-item-root-open-color":o.text.primary,"--nav-item-root-open-bg":o.action.hover,"--nav-item-sub-active-color":o.text.primary,"--nav-item-sub-active-bg":o.action.selected,"--nav-item-sub-open-color":o.text.primary,"--nav-item-sub-open-bg":o.action.hover,...n==="vertical"&&{"--nav-item-sub-active-bg":o.action.hover,"--nav-subheader-color":o.text.disabled,"--nav-subheader-hover-color":o.text.primary}}}function ye(e){let{shape:n,spacing:o}=e;return {...F(e,"vertical"),"--nav-item-gap":o(.5),"--nav-item-radius":`${n.borderRadius}px`,"--nav-item-pt":o(.5),"--nav-item-pr":o(1),"--nav-item-pb":o(.5),"--nav-item-pl":o(1.5),"--nav-item-root-height":"44px","--nav-item-sub-height":"36px","--nav-icon-size":"24px","--nav-icon-margin":o(0,1.5,0,0),"--nav-bullet-size":"12px","--nav-bullet-light-color":ae.light,"--nav-bullet-dark-color":ae.dark}}function Ie(e){let{shape:n,spacing:o}=e;return {...F(e,"mini"),"--nav-item-gap":o(.5),"--nav-item-radius":`${n.borderRadius}px`,"--nav-item-root-height":"56px","--nav-item-root-padding":o(1,.5,.75,.5),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-root-margin":o(0,0,.75,0),"--nav-icon-sub-margin":o(0,1,0,0)}}function ke(e){let{shape:n,spacing:o}=e;return {...F(e,"horizontal"),"--nav-item-gap":o(.75),"--nav-height":"56px","--nav-item-radius":`${n.borderRadius*.75}px`,"--nav-item-root-height":"32px","--nav-item-root-padding":o(0,.75),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-sub-margin":o(0,1,0,0),"--nav-icon-root-margin":o(0,1,0,0)}}var S={mini:Ie,vertical:ye,horizontal:ke};function w({open:e,active:n,disabled:o}){let i=t.item.root;return n?i+=` ${t.state.active}`:e?i+=` ${t.state.open}`:o&&(i+=` ${t.state.disabled}`),i}var d={icon:{flexShrink:0,display:"inline-flex",["& svg, & img"]:{width:"100%",height:"100%"}},arrow:{width:16,height:16,flexShrink:0,marginLeft:"6px",display:"inline-flex"},info:{fontSize:12,flexShrink:0,fontWeight:600,marginLeft:"6px",lineHeight:18/12,display:"inline-flex"},noWrap:{width:"100%",maxWidth:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},disabled:{opacity:.48,pointerEvents:"none"}};function A({sx:e,open:n,children:o,...i}){return jsxs(we,{disableSticky:!0,component:"div",className:t.subheader,sx:{gap:1,cursor:"pointer",alignItems:"center",position:"relative",typography:"overline",display:"inline-flex",alignSelf:"flex-start",color:"var(--nav-subheader-color)",padding:r=>r.spacing(2,1,1,1.5),fontSize:r=>r.typography.pxToRem(11),transition:r=>r.transitions.create(["color","padding-left"],{duration:r.transitions.duration.standard}),"&:hover":{pl:2,color:"var(--nav-subheader-hover-color)"},...e},...i,children:[jsx(me,{width:16,icon:n?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",sx:{left:-4,opacity:0,position:"absolute",transition:r=>r.transitions.create(["opacity"],{duration:r.transitions.duration.standard})}}),o]})}function D({sx:e,depth:n,children:o,...i}){return jsx(Se,{sx:{...n+1!==1&&{pl:"calc(var(--nav-item-pl) + var(--nav-icon-size) / 2)",[`& .${t.ul}`]:{position:"relative",pl:"var(--nav-bullet-size)","&::before":{top:0,left:0,width:"2px",content:'""',position:"absolute",bottom:"calc(var(--nav-item-sub-height) - 2px - var(--nav-bullet-size) / 2)",bgcolor:"var(--nav-bullet-light-color)",[stylesMode.dark]:{bgcolor:"var(--nav-bullet-dark-color)"}}}},...e},...i,children:o})}function g({sx:e,children:n,disabled:o,...i}){return jsx(U,{component:"li",className:t.li,sx:{display:"flex",flexDirection:"column",...o&&{cursor:"not-allowed"},...e},...i,children:n})}function N({children:e,sx:n,...o}){return jsx(U,{component:"ul",className:t.ul,sx:{display:"flex",flexDirection:"column",...n},...o,children:e})}var se=forwardRef(({href:e,...n},o)=>jsx(Link,{ref:o,to:e,...n}));function $({path:e,icon:n,info:o,depth:i,render:r,hasChild:s,externalLink:l,enabledRootRedirect:a}){let m=i===1,v=!m,c=Number(i)>2,u=s&&!a?{component:"div"}:l?{href:e,target:"_blank",rel:"noopener"}:{component:se,href:e},f=null;n&&r?.navIcon&&typeof n=="string"?f=r?.navIcon[n]:f=n;let h=null;if(o&&r?.navInfo&&Array.isArray(o)){let[x,b]=o,y=r.navInfo(b)[x];h=y?cloneElement(y):null;}else h=o;return {subItem:v,rootItem:m,subDeepItem:c,baseProps:u,renderIcon:f,renderInfo:h}}var J=forwardRef(({path:e,icon:n,info:o,title:i,caption:r,open:s,depth:l,render:a,active:m,disabled:v,hasChild:c,slotProps:p,externalLink:u,enabledRootRedirect:f,...h},x)=>{let b=$({path:e,icon:n,info:o,depth:l,render:a,hasChild:c,externalLink:u,enabledRootRedirect:f});return jsxs(Ve,{ref:x,"aria-label":i,depth:l,active:m,disabled:v,open:s&&!m,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:w({open:s&&!m,active:m,disabled:v}),...b.baseProps,...h,children:[n&&jsx(U,{component:"span",className:t.item.icon,children:b.renderIcon}),i&&jsx(U,{component:"span",className:t.item.title,children:i}),r&&jsx(Te,{title:r,arrow:!0,children:jsx(me,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&jsx(U,{component:"span",className:t.item.info,children:b.renderInfo}),c&&jsx(me,{icon:b.subItem?"CHEVRON_RIGHT":"ARROW_DOWN_SIMPLE",className:t.item.arrow})]})}),Ve=styled(Me,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:n,disabled:o,depth:i,theme:r})=>{let s=i===1,l=!s,a={item:{flexShrink:0,color:"var(--nav-item-color)",borderRadius:"var(--nav-item-radius)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...d.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...d.arrow},info:{...d.info}};return {...s&&{...a.item,padding:"var(--nav-item-root-padding)",minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...a.icon,margin:"var(--nav-icon-root-margin)"},[`& .${t.item.title}`]:{...a.title,whiteSpace:"nowrap"},[`& .${t.item.caption}`]:{...a.caption,marginLeft:r.spacing(.75)},[`& .${t.item.arrow}`]:{...a.arrow},[`& .${t.item.info}`]:{...a.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...n&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...l&&{...a.item,padding:"var(--nav-item-sub-padding)",minHeight:"var(--nav-item-sub-height)",color:r.vars.palette.text.secondary,[`& .${t.item.icon}`]:{...a.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...a.title,flexGrow:1},[`& .${t.item.caption}`]:{...a.caption},[`& .${t.item.arrow}`]:{...a.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...a.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...n&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&d.disabled}});var le=e=>{let n=e.split("?")[1];return n?new URLSearchParams(n).toString().length>0:!1};function K(e){return e!=="/"&&e.endsWith("/")?e.slice(0,-1):e}function pe(e){try{let n=new URL(e,window.location.origin);return K(n.pathname)}catch{return e}}function I(e){return e.startsWith("http")}function k(){let{pathname:e}=useLocation();return useMemo(()=>e,[e])}function E(e,n=!0){let o=K(k()),i=le(e);if(e.startsWith("#")||I(e))return !1;if(n||i){let l=o.includes(e),a=pe(e);return l||i&&a===o}return o===e}function Q({data:e,depth:n,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s}){let l=useTheme(),a=k(),m=useRef(null),v=E(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&f();},[a]);let u=useCallback(()=>{e.children&&p(!0);},[e.children]),f=useCallback(()=>{p(!1);},[]),h=jsx(J,{ref:m,render:o,title:e.title,path:e.path,icon:e.icon,info:e.info,caption:e.caption,depth:n,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:I(e.path),enabledRootRedirect:s,slotProps:n===1?r?.rootItem:r?.subItem,onMouseEnter:u,onMouseLeave:f});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[h,jsx(qe,{disableScrollLock:!0,open:c,anchorEl:m.current,anchorOrigin:n===1?{vertical:"bottom",horizontal:"left"}:{vertical:"center",horizontal:"right"},transformOrigin:n===1?{vertical:"top",horizontal:"left"}:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:u,onMouseLeave:f,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...n===1&&{ml:-.75},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(Fe,{className:t.paper,sx:{minWidth:180,...paper({theme:l,dropdown:!0}),...r?.paper},children:jsx(Qe,{data:e.children,depth:n,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(g,{disabled:e.disabled,children:h})}function Qe({data:e,depth:n,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s}){return jsx(N,{sx:{gap:.5},children:e.map(l=>jsx(Q,{data:l,render:o,depth:n+1,cssVars:i,slotProps:r,enabledRootRedirect:s},l.title))})}function Mr({sx:e,data:n,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s}){let l=useTheme(),a={...S.horizontal(l),...s};return jsx(je,{sx:{height:1},slotProps:{content:{height:1,display:"flex",alignItems:"center"}},children:jsx(Ye,{component:"nav",direction:"row",alignItems:"center",className:t.horizontal.root,sx:{...a,mx:"auto",height:1,minHeight:"var(--nav-height)",...e},children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:n.map(m=>jsx(eo,{render:o,cssVars:a,items:m.items,slotProps:i,enabledRootRedirect:r},m.subheader??m.items[0].title))})})})}function eo({items:e,render:n,slotProps:o,enabledRootRedirect:i,cssVars:r}){return jsx(g,{children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(Q,{depth:1,data:s,render:n,cssVars:r,slotProps:o,enabledRootRedirect:i},s.title))})})}var Y=forwardRef(({path:e,icon:n,info:o,title:i,caption:r,open:s,depth:l,render:a,active:m,disabled:v,hasChild:c,slotProps:p,externalLink:u,enabledRootRedirect:f,...h},x)=>{let b=$({path:e,icon:n,info:o,depth:l,render:a,hasChild:c,externalLink:u,enabledRootRedirect:f});return jsxs(io,{ref:x,"aria-label":i,depth:l,active:m,disabled:v,open:s&&!m,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:w({open:s&&!m,active:m,disabled:v}),...b.baseProps,...h,children:[n&&jsx(U,{component:"span",className:t.item.icon,children:b.renderIcon}),i&&jsx(U,{component:"span",className:t.item.title,children:i}),r&&jsx(Te,{title:r,arrow:!0,placement:"right",children:jsx(me,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&b.subItem&&jsx(U,{component:"span",className:t.item.info,children:b.renderInfo}),c&&jsx(me,{icon:"CHEVRON_RIGHT",className:t.item.arrow})]})}),io=styled(Me,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:n,disabled:o,depth:i,theme:r})=>{let s=i===1,l=!s,a={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...d.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...d.arrow},info:{...d.info}};return {...s&&{...a.item,textAlign:"center",flexDirection:"column",minHeight:"var(--nav-item-root-height)",padding:"var(--nav-item-root-padding)",[`& .${t.item.icon}`]:{...a.icon,margin:"var(--nav-icon-root-margin)"},[`& .${t.item.title}`]:{...a.title,...d.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${t.item.caption}`]:{...a.caption,top:11,left:6,position:"absolute"},[`& .${t.item.arrow}`]:{...a.arrow,top:11,right:6,position:"absolute"},[`& .${t.item.info}`]:{...a.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...n&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...l&&{...a.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${t.item.icon}`]:{...a.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...a.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${t.item.caption}`]:{...a.caption},[`& .${t.item.arrow}`]:{...a.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...a.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...n&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&d.disabled}});var Z=({data:e,depth:n,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s})=>{let l=useTheme(),a=k(),m=useRef(null),v=E(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&f();},[a]);let u=useCallback(()=>{e.children&&p(!0);},[e.children]),f=useCallback(()=>{p(!1);},[]),h=jsx(Y,{ref:m,render:o,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:n,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:I(e.path),enabledRootRedirect:s,slotProps:n===1?r?.rootItem:r?.subItem,onMouseEnter:u,onMouseLeave:f});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[h,jsx(qe,{disableScrollLock:!0,open:c,anchorEl:m.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:u,onMouseLeave:f,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...n>1&&{mt:-1},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(Fe,{className:t.paper,sx:{minWidth:180,...paper({theme:l,dropdown:!0}),...r?.paper},children:jsx(ho,{data:e.children,depth:n,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(g,{disabled:e.disabled,children:h})};function ho({data:e,render:n,depth:o,slotProps:i,enabledRootRedirect:r,cssVars:s}){return jsx(N,{sx:{gap:.5},children:e.map(l=>jsx(Z,{data:l,render:n,depth:o+1,cssVars:s,slotProps:i,enabledRootRedirect:r},l.title))})}var gn=({sx:e,data:n,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let l=useTheme(),a={...S.mini(l),...s};return jsx(Ye,{component:"nav",className:t.mini.root,sx:{...a,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:n.map(m=>jsx(xo,{render:o,cssVars:a,items:m.items,slotProps:i,enabledRootRedirect:r},m.subheader??m.items[0].title))})})},xo=({items:e,render:n,slotProps:o,enabledRootRedirect:i,cssVars:r})=>jsx(g,{children:jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(Z,{depth:1,data:s,render:n,cssVars:r,slotProps:o,enabledRootRedirect:i},s.title))})});var j=forwardRef(({path:e,icon:n,info:o,title:i,caption:r,open:s,depth:l,render:a,active:m,disabled:v,hasChild:c,slotProps:p,externalLink:u,enabledRootRedirect:f,...h},x)=>{let b=$({path:e,icon:n,info:o,depth:l,render:a,hasChild:c,externalLink:u,enabledRootRedirect:f});return jsxs(Co,{ref:x,"aria-label":i,depth:l,active:m,disabled:v,open:s&&!m,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.texts}`]:p?.texts,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:w({open:s&&!m,active:m,disabled:v}),...b.baseProps,...h,children:[n&&jsx(U,{component:"span",className:t.item.icon,children:b.renderIcon}),i&&jsxs(U,{component:"span",className:t.item.texts,children:[jsx(U,{component:"span",className:t.item.title,children:i}),r&&jsx(Te,{title:r,placement:"top-start",children:jsx(U,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(U,{component:"span",className:t.item.info,children:b.renderInfo}),c&&jsx(me,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:t.item.arrow})]})}),Co=styled(Me,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:n,disabled:o,depth:i,theme:r})=>{let s=i===1,l=!s,a={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...d.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...d.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...d.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...d.arrow},info:{...d.info}};return {...s&&{...a.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...a.icon},[`& .${t.item.texts}`]:{...a.texts},[`& .${t.item.title}`]:{...a.title},[`& .${t.item.caption}`]:{...a.caption},[`& .${t.item.arrow}`]:{...a.arrow},[`& .${t.item.info}`]:{...a.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...n&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...l&&{...a.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...a.icon},[`& .${t.item.texts}`]:{...a.texts},[`& .${t.item.title}`]:{...a.title},[`& .${t.item.caption}`]:{...a.caption},[`& .${t.item.arrow}`]:{...a.arrow},[`& .${t.item.info}`]:{...a.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...n&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&d.disabled}});var ee=({data:e,render:n,depth:o,slotProps:i,enabledRootRedirect:r})=>{let s=k(),l=E(e.path,!!e.children),[a,m]=useState(l);useEffect(()=>{l||c();},[s]);let v=useCallback(()=>{e.children&&m(u=>!u);},[e.children]),c=useCallback(()=>{m(!1);},[]),p=jsx(j,{render:n,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:l,disabled:e.disabled,hasChild:!!e.children,open:e.children&&a,externalLink:I(e.path),enabledRootRedirect:r,slotProps:o===1?i?.rootItem:i?.subItem,onClick:v});return e.roles&&i?.currentRole&&!e?.roles?.includes(i?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[p,jsx(D,{"data-group":e.title,in:a,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(Ro,{data:e.children,render:n,depth:o,slotProps:i,enabledRootRedirect:r})})]}):jsx(g,{disabled:e.disabled,children:p})},Ro=({data:e,render:n,depth:o,slotProps:i,enabledRootRedirect:r})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(ee,{data:s,render:n,depth:o+1,slotProps:i,enabledRootRedirect:r},s.title))});var jn=({sx:e,data:n,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let l=useTheme(),a={...S.vertical(l),...s};return jsx(Ye,{component:"nav",className:t.vertical.root,sx:{...a,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:n.map(m=>jsx(To,{subheader:m.subheader,items:m.items,render:o,slotProps:i,enabledRootRedirect:r},m.subheader??m.items[0].title))})})},To=({items:e,render:n,subheader:o,slotProps:i,enabledRootRedirect:r})=>{let[s,l]=useState(!0),a=useCallback(()=>{l(v=>!v);},[]),m=jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(v=>jsx(ee,{data:v,render:n,depth:1,slotProps:i,enabledRootRedirect:r},v.title))});return jsx(g,{children:o?jsxs(Fragment,{children:[jsx(A,{"data-title":o,open:s,onClick:a,sx:i?.subheader,children:o}),jsx(Se,{in:s,children:m})]}):m})};function be({path:e,icon:n,info:o,depth:i,render:r,hasChild:s,externalLink:l,enabledRootRedirect:a,onNavigate:m}){let v=i===1,c=!v,p=Number(i)>2,f=s&&!a?{component:"div"}:l?{href:e,target:"_blank",rel:"noopener"}:{onClick:b=>m(b,e)},h=null;n&&r?.navIcon&&typeof n=="string"?h=r?.navIcon[n]:h=n;let x=null;if(o&&r?.navInfo&&Array.isArray(o)){let[b,y]=o,re=r.navInfo(y)[b];x=re?cloneElement(re):null;}else x=o;return {subItem:c,rootItem:v,subDeepItem:p,baseProps:f,renderIcon:h,renderInfo:x}}var oe=forwardRef(({path:e,icon:n,info:o,title:i,caption:r,open:s,depth:l,render:a,active:m,disabled:v,hasChild:c,slotProps:p,externalLink:u,enabledRootRedirect:f,onNavigate:h,...x},b)=>{let y=be({path:e,icon:n,info:o,depth:l,render:a,hasChild:c,externalLink:u,enabledRootRedirect:f,onNavigate:h});return jsxs(Fo,{ref:b,"aria-label":i,depth:l,active:m,disabled:v,open:s&&!m,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.texts}`]:p?.texts,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:w({open:s&&!m,active:m,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[n&&jsx(U,{component:"span",className:t.item.icon,children:y.renderIcon}),i&&jsxs(U,{component:"span",className:t.item.texts,children:[jsx(U,{component:"span",className:t.item.title,children:i}),r&&jsx(Te,{title:r,placement:"top-start",children:jsx(U,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(U,{component:"span",className:t.item.info,children:y.renderInfo}),c&&jsx(me,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:t.item.arrow})]})}),Fo=styled(Me,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:n,disabled:o,depth:i,theme:r})=>{let s=i===1,l=!s,a={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...d.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...d.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...d.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...d.arrow},info:{...d.info}};return {...s&&{...a.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...a.icon},[`& .${t.item.texts}`]:{...a.texts},[`& .${t.item.title}`]:{...a.title},[`& .${t.item.caption}`]:{...a.caption},[`& .${t.item.arrow}`]:{...a.arrow},[`& .${t.item.info}`]:{...a.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...n&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...l&&{...a.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...a.icon},[`& .${t.item.texts}`]:{...a.texts},[`& .${t.item.title}`]:{...a.title},[`& .${t.item.caption}`]:{...a.caption},[`& .${t.item.arrow}`]:{...a.arrow},[`& .${t.item.info}`]:{...a.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...n&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&d.disabled}});var te=({data:e,render:n,depth:o,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:l})=>{let a=!!matchPath({path:e.path||"",end:!1},l),[m,v]=useState(a);useEffect(()=>{a||p();},[l]);let c=useCallback(()=>{e.children&&v(f=>!f);},[e.children]),p=useCallback(()=>{v(!1);},[]),u=jsx(oe,{render:n,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:a,disabled:e.disabled,hasChild:!!e.children,open:e.children&&m,externalLink:I(e.path),enabledRootRedirect:r,slotProps:o===1?i?.rootItem:i?.subItem,onClick:c,onNavigate:s});return e.roles&&i?.currentRole&&!e?.roles?.includes(i?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[u,jsx(D,{"data-group":e.title,in:m,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(Qo,{data:e.children,render:n,depth:o,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:l})})]}):jsx(g,{disabled:e.disabled,children:u})},Qo=({data:e,render:n,depth:o,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:l})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(a=>jsx(te,{data:a,render:n,depth:o+1,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:l},a.title))});var za=({sx:e,data:n,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:l,pathname:a})=>{let m=useTheme(),v={...S.vertical(m),...s};return jsx(Ye,{component:"nav",className:t.vertical.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:n.map(c=>jsx(tt,{subheader:c.subheader,items:c.items,render:o,renderEmptyView:c.renderEmptyView,slotProps:i,enabledRootRedirect:r,onNavigate:l,pathname:a},c.subheader??c.items[0].title))})})},tt=({items:e,render:n,renderEmptyView:o,subheader:i,slotProps:r,enabledRootRedirect:s,onNavigate:l,pathname:a})=>{let[m,v]=useState(!0),c=useCallback(()=>{v(u=>!u);},[]),p=o&&e.length===0?o():jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(u=>jsx(te,{data:u,render:n,depth:1,slotProps:r,enabledRootRedirect:s,onNavigate:l,pathname:a},u.title))});return jsx(g,{children:i?jsxs(Fragment,{children:[jsx(A,{"data-title":i,open:m,onClick:c,sx:r?.subheader,children:i}),jsx(Se,{in:m,children:p})]}):p})};
|
|
17
|
+
var o={mini:{root:"nav__section__mini"},horizontal:{root:"nav__section__horizontal"},vertical:{root:"nav__section__vertical"},item:{root:"mnl__nav__item",icon:"mnl__nav__item__icon",info:"mnl__nav__item__info",texts:"mnl__nav__item__texts",title:"mnl__nav__item__title",arrow:"mnl__nav__item__arrow",caption:"mnl__nav__item__caption"},li:"mnl__nav__li",ul:"mnl__nav__ul",paper:"mnl__nav__paper",subheader:"mnl__nav__subheader",state:{open:"state--open",active:"state--active",disabled:"state--disabled"}};var ve={dark:"#282F37",light:"#EDEFF2"};function Q(e,a){let{vars:{palette:t}}=e;return {"--nav-item-color":t.text.secondary,"--nav-item-hover-bg":t.action.hover,"--nav-item-caption-color":t.text.disabled,"--nav-item-root-active-color":t.primary.main,"--nav-item-root-active-color-on-dark":t.primary.light,"--nav-item-root-active-bg":varAlpha(t.primary.mainChannel,.08),"--nav-item-root-active-hover-bg":varAlpha(t.primary.mainChannel,.16),"--nav-item-root-open-color":t.text.primary,"--nav-item-root-open-bg":t.action.hover,"--nav-item-sub-active-color":t.text.primary,"--nav-item-sub-active-bg":t.action.selected,"--nav-item-sub-open-color":t.text.primary,"--nav-item-sub-open-bg":t.action.hover,...a==="vertical"&&{"--nav-item-sub-active-bg":t.action.hover,"--nav-subheader-color":t.text.disabled,"--nav-subheader-hover-color":t.text.primary}}}function Pe(e){let{shape:a,spacing:t}=e;return {...Q(e,"vertical"),"--nav-item-gap":t(.5),"--nav-item-radius":`${a.borderRadius}px`,"--nav-item-pt":t(.5),"--nav-item-pr":t(1),"--nav-item-pb":t(.5),"--nav-item-pl":t(1.5),"--nav-item-root-height":"44px","--nav-item-sub-height":"36px","--nav-icon-size":"24px","--nav-icon-margin":t(0,1.5,0,0),"--nav-bullet-size":"12px","--nav-bullet-light-color":ve.light,"--nav-bullet-dark-color":ve.dark}}function Be(e){let{shape:a,spacing:t}=e;return {...Q(e,"mini"),"--nav-item-gap":t(.5),"--nav-item-radius":`${a.borderRadius}px`,"--nav-item-root-height":"56px","--nav-item-root-padding":t(1,.5,.75,.5),"--nav-item-sub-height":"34px","--nav-item-sub-padding":t(0,1),"--nav-icon-size":"22px","--nav-icon-root-margin":t(0,0,.75,0),"--nav-icon-sub-margin":t(0,1,0,0)}}function $e(e){let{shape:a,spacing:t}=e;return {...Q(e,"horizontal"),"--nav-item-gap":t(.75),"--nav-height":"56px","--nav-item-radius":`${a.borderRadius*.75}px`,"--nav-item-root-height":"32px","--nav-item-root-padding":t(0,.75),"--nav-item-sub-height":"34px","--nav-item-sub-padding":t(0,1),"--nav-icon-size":"22px","--nav-icon-sub-margin":t(0,1,0,0),"--nav-icon-root-margin":t(0,1,0,0)}}var k={mini:Be,vertical:Pe,horizontal:$e};function S({open:e,active:a,disabled:t}){let i=o.item.root;return a?i+=` ${o.state.active}`:e?i+=` ${o.state.open}`:t&&(i+=` ${o.state.disabled}`),i}var d={icon:{flexShrink:0,display:"inline-flex",["& svg, & img"]:{width:"100%",height:"100%"}},arrow:{width:16,height:16,flexShrink:0,marginLeft:"6px",display:"inline-flex"},info:{fontSize:12,flexShrink:0,fontWeight:600,marginLeft:"6px",lineHeight:18/12,display:"inline-flex"},noWrap:{width:"100%",maxWidth:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},disabled:{opacity:.48,pointerEvents:"none"}};function F({sx:e,open:a,children:t,...i}){return jsxs(Ee,{disableSticky:!0,component:"div",className:o.subheader,sx:{gap:1,cursor:"pointer",alignItems:"center",position:"relative",typography:"overline",display:"inline-flex",alignSelf:"flex-start",color:"var(--nav-subheader-color)",padding:r=>r.spacing(2,1,1,1.5),fontSize:r=>r.typography.pxToRem(11),transition:r=>r.transitions.create(["color","padding-left"],{duration:r.transitions.duration.standard}),"&:hover":{pl:2,color:"var(--nav-subheader-hover-color)"},...e},...i,children:[jsx(fe,{width:16,icon:a?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",sx:{left:-4,opacity:0,position:"absolute",transition:r=>r.transitions.create(["opacity"],{duration:r.transitions.duration.standard})}}),t]})}function q({sx:e,depth:a,children:t,...i}){return jsx(_e,{sx:{...a+1!==1&&{pl:"calc(var(--nav-item-pl) + var(--nav-icon-size) / 2)",[`& .${o.ul}`]:{position:"relative",pl:"var(--nav-bullet-size)","&::before":{top:0,left:0,width:"2px",content:'""',position:"absolute",bottom:"calc(var(--nav-item-sub-height) - 2px - var(--nav-bullet-size) / 2)",bgcolor:"var(--nav-bullet-light-color)",[stylesMode.dark]:{bgcolor:"var(--nav-bullet-dark-color)"}}}},...e},...i,children:t})}function b({sx:e,children:a,disabled:t,...i}){return jsx(G,{component:"li",className:o.li,sx:{display:"flex",flexDirection:"column",...t&&{cursor:"not-allowed"},...e},...i,children:a})}function g({children:e,sx:a,...t}){return jsx(G,{component:"ul",className:o.ul,sx:{display:"flex",flexDirection:"column",...a},...t,children:e})}var de=forwardRef(({href:e,...a},t)=>jsx(Link,{ref:t,to:e,...a}));function _({path:e,icon:a,info:t,depth:i,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n}){let l=i===1,v=!l,c=Number(i)>2,u=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{component:de,href:e},f=null;a&&r?.navIcon&&typeof a=="string"?f=r?.navIcon[a]:f=a;let h=null;if(t&&r?.navInfo&&Array.isArray(t)){let[x,N]=t,y=r.navInfo(N)[x];h=y?cloneElement(y):null;}else h=t;return {subItem:v,rootItem:l,subDeepItem:c,baseProps:u,renderIcon:f,renderInfo:h}}var Y=forwardRef(({path:e,icon:a,info:t,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:u,enabledRootRedirect:f,...h},x)=>{let N=_({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:f});return jsxs(qe,{ref:x,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${o.item.icon}`]:p?.icon,[`& .${o.item.title}`]:p?.title,[`& .${o.item.caption}`]:p?.caption,[`& .${o.item.info}`]:p?.info,[`& .${o.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...N.baseProps,...h,children:[a&&jsx(G,{component:"span",className:o.item.icon,children:N.renderIcon}),i&&jsx(G,{component:"span",className:o.item.title,children:i}),r&&jsx(De,{title:r,arrow:!0,children:jsx(fe,{icon:"INFO_CIRCLE",className:o.item.caption})}),t&&jsx(G,{component:"span",className:o.item.info,children:N.renderInfo}),c&&jsx(fe,{icon:N.subItem?"CHEVRON_RIGHT":"ARROW_DOWN_SIMPLE",className:o.item.arrow})]})}),qe=styled(Ae,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:t,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{flexShrink:0,color:"var(--nav-item-color)",borderRadius:"var(--nav-item-radius)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...d.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...d.arrow},info:{...d.info}};return {...s&&{...n.item,padding:"var(--nav-item-root-padding)",minHeight:"var(--nav-item-root-height)",[`& .${o.item.icon}`]:{...n.icon,margin:"var(--nav-icon-root-margin)"},[`& .${o.item.title}`]:{...n.title,whiteSpace:"nowrap"},[`& .${o.item.caption}`]:{...n.caption,marginLeft:r.spacing(.75)},[`& .${o.item.arrow}`]:{...n.arrow},[`& .${o.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,padding:"var(--nav-item-sub-padding)",minHeight:"var(--nav-item-sub-height)",color:r.vars.palette.text.secondary,[`& .${o.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${o.item.title}`]:{...n.title,flexGrow:1},[`& .${o.item.caption}`]:{...n.caption},[`& .${o.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${o.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...t&&d.disabled}});var he=e=>{let a=e.split("?")[1];return a?new URLSearchParams(a).toString().length>0:!1};function Z(e){return e!=="/"&&e.endsWith("/")?e.slice(0,-1):e}function be(e){try{let a=new URL(e,window.location.origin);return Z(a.pathname)}catch{return e}}function I(e){return e.startsWith("http")}function w(){let{pathname:e}=useLocation();return useMemo(()=>e,[e])}function M(e,a=!0){let t=Z(w()),i=he(e);if(e.startsWith("#")||I(e))return !1;if(a||i){let m=t.includes(e),n=be(e);return m||i&&n===t}return t===e}function j({data:e,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s}){let m=useTheme(),n=w(),l=useRef(null),v=M(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&f();},[n]);let u=useCallback(()=>{e.children&&p(!0);},[e.children]),f=useCallback(()=>{p(!1);},[]),h=jsx(Y,{ref:l,render:t,title:e.title,path:e.path,icon:e.icon,info:e.info,caption:e.caption,depth:a,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:I(e.path),enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:u,onMouseLeave:f});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,children:[h,jsx(eo,{disableScrollLock:!0,open:c,anchorEl:l.current,anchorOrigin:a===1?{vertical:"bottom",horizontal:"left"}:{vertical:"center",horizontal:"right"},transformOrigin:a===1?{vertical:"top",horizontal:"left"}:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:u,onMouseLeave:f,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a===1&&{ml:-.75},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(je,{className:o.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(ro,{data:e.children,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(b,{disabled:e.disabled,children:h})}function ro({data:e,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s}){return jsx(g,{sx:{gap:.5},children:e.map(m=>jsx(j,{data:m,render:t,depth:a+1,cssVars:i,slotProps:r,enabledRootRedirect:s},m.title))})}function ln({sx:e,data:a,render:t,slotProps:i,enabledRootRedirect:r,cssVars:s}){let m=useTheme(),n={...k.horizontal(m),...s};return jsx(so,{sx:{height:1},slotProps:{content:{height:1,display:"flex",alignItems:"center"}},children:jsx(ao,{component:"nav",direction:"row",alignItems:"center",className:o.horizontal.root,sx:{...n,mx:"auto",height:1,minHeight:"var(--nav-height)",...e},children:jsx(g,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(mo,{render:t,cssVars:n,items:l.items,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})})}function mo({items:e,render:a,slotProps:t,enabledRootRedirect:i,cssVars:r}){return jsx(b,{children:jsx(g,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(j,{depth:1,data:s,render:a,cssVars:r,slotProps:t,enabledRootRedirect:i},s.title))})})}var oe=forwardRef(({path:e,icon:a,info:t,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:u,enabledRootRedirect:f,...h},x)=>{let N=_({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:f});return jsxs(fo,{ref:x,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${o.item.icon}`]:p?.icon,[`& .${o.item.title}`]:p?.title,[`& .${o.item.caption}`]:p?.caption,[`& .${o.item.info}`]:p?.info,[`& .${o.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...N.baseProps,...h,children:[a&&jsx(G,{component:"span",className:o.item.icon,children:N.renderIcon}),i&&jsx(G,{component:"span",className:o.item.title,children:i}),r&&jsx(De,{title:r,arrow:!0,placement:"right",children:jsx(fe,{icon:"INFO_CIRCLE",className:o.item.caption})}),t&&N.subItem&&jsx(G,{component:"span",className:o.item.info,children:N.renderInfo}),c&&jsx(fe,{icon:"CHEVRON_RIGHT",className:o.item.arrow})]})}),fo=styled(Ae,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:t,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...d.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...d.arrow},info:{...d.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",minHeight:"var(--nav-item-root-height)",padding:"var(--nav-item-root-padding)",[`& .${o.item.icon}`]:{...n.icon,margin:"var(--nav-icon-root-margin)"},[`& .${o.item.title}`]:{...n.title,...d.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${o.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${o.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${o.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${o.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${o.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${o.item.caption}`]:{...n.caption},[`& .${o.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${o.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...t&&d.disabled}});var te=({data:e,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s})=>{let m=useTheme(),n=w(),l=useRef(null),v=M(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&f();},[n]);let u=useCallback(()=>{e.children&&p(!0);},[e.children]),f=useCallback(()=>{p(!1);},[]),h=jsx(oe,{ref:l,render:t,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:a,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:I(e.path),enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:u,onMouseLeave:f});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,children:[h,jsx(eo,{disableScrollLock:!0,open:c,anchorEl:l.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:u,onMouseLeave:f,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a>1&&{mt:-1},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(je,{className:o.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(So,{data:e.children,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(b,{disabled:e.disabled,children:h})};function So({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r,cssVars:s}){return jsx(g,{sx:{gap:.5},children:e.map(m=>jsx(te,{data:m,render:a,depth:t+1,cssVars:s,slotProps:i,enabledRootRedirect:r},m.title))})}var qn=({sx:e,data:a,render:t,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.mini(m),...s};return jsx(ao,{component:"nav",className:o.mini.root,sx:{...n,...e},children:jsx(g,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(Ro,{render:t,cssVars:n,items:l.items,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},Ro=({items:e,render:a,slotProps:t,enabledRootRedirect:i,cssVars:r})=>jsx(b,{children:jsx(g,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(te,{depth:1,data:s,render:a,cssVars:r,slotProps:t,enabledRootRedirect:i},s.title))})});function K({path:e,icon:a,info:t,depth:i,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n,onNavigate:l}){let v=i===1,c=!v,p=Number(i)>2,f=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{onClick:N=>l(N,e)},h=null;a&&r?.navIcon&&typeof a=="string"?h=r?.navIcon[a]:h=a;let x=null;if(t&&r?.navInfo&&Array.isArray(t)){let[N,y]=t,pe=r.navInfo(y)[N];x=pe?cloneElement(pe):null;}else x=t;return {subItem:c,rootItem:v,subDeepItem:p,baseProps:f,renderIcon:h,renderInfo:x}}var ne=forwardRef(({path:e,icon:a,info:t,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:u,enabledRootRedirect:f,onNavigate:h,...x},N)=>{let y=K({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:f,onNavigate:h});return jsxs(Wo,{ref:N,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${o.item.icon}`]:p?.icon,[`& .${o.item.title}`]:p?.title,[`& .${o.item.caption}`]:p?.caption,[`& .${o.item.info}`]:p?.info,[`& .${o.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[a&&jsx(G,{component:"span",className:o.item.icon,children:y.renderIcon}),i&&jsx(G,{component:"span",className:o.item.title,children:i}),r&&jsx(De,{title:r,arrow:!0,placement:"right",children:jsx(fe,{icon:"INFO_CIRCLE",className:o.item.caption})}),t&&y.subItem&&jsx(G,{component:"span",className:o.item.info,children:y.renderInfo}),c&&jsx(fe,{icon:"CHEVRON_RIGHT",className:o.item.arrow})]})}),Wo=styled(Ae,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:t,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...d.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...d.arrow},info:{...d.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",minHeight:"var(--nav-item-root-height)",padding:"var(--nav-item-root-padding)",[`& .${o.item.icon}`]:{...n.icon,margin:"var(--nav-icon-root-margin)"},[`& .${o.item.title}`]:{...n.title,...d.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${o.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${o.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${o.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${o.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${o.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${o.item.caption}`]:{...n.caption},[`& .${o.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${o.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...t&&d.disabled}});var ae=({data:e,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v=useRef(null),c=!!matchPath({path:e.path||"",end:!1},n),[p,u]=useState(!1);useEffect(()=>{p&&h();},[n]);let f=useCallback(()=>{e.children&&u(!0);},[e.children]),h=useCallback(()=>{u(!1);},[]),x=jsx(ne,{ref:v,render:t,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:a,active:c,disabled:e.disabled,hasChild:!!e.children,open:e.children&&p,externalLink:I(e.path),enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:f,onMouseLeave:h,onNavigate:m});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,children:[x,jsx(eo,{disableScrollLock:!0,open:p,anchorEl:v.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:f,onMouseLeave:h,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a>1&&{mt:-1},...p&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(je,{className:o.paper,sx:{minWidth:180,...paper({theme:l,dropdown:!0}),...r?.paper},children:jsx(Fo,{data:e.children,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})})})]}):jsx(b,{disabled:e.disabled,children:x})};function Fo({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n}){return jsx(g,{sx:{gap:.5},children:e.map(l=>jsx(ae,{data:l,render:a,depth:t+1,cssVars:s,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n},l.title))})}var Ba=({sx:e,data:a,render:t,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.mini(l),...s};return jsx(ao,{component:"nav",className:o.mini.root,sx:{...v,...e},children:jsx(g,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(c=>jsx(Qo,{render:t,cssVars:v,items:c.items,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n},c.subheader??c.items[0].title))})})},Qo=({items:e,render:a,slotProps:t,enabledRootRedirect:i,cssVars:r,onNavigate:s,pathname:m})=>jsx(b,{children:jsx(g,{sx:{gap:"var(--nav-item-gap)"},children:e.map(n=>jsx(ae,{depth:1,data:n,render:a,cssVars:r,slotProps:t,enabledRootRedirect:i,onNavigate:s,pathname:m},n.title))})});var ie=forwardRef(({path:e,icon:a,info:t,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:u,enabledRootRedirect:f,...h},x)=>{let N=_({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:f});return jsxs(ot,{ref:x,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${o.item.icon}`]:p?.icon,[`& .${o.item.texts}`]:p?.texts,[`& .${o.item.title}`]:p?.title,[`& .${o.item.caption}`]:p?.caption,[`& .${o.item.info}`]:p?.info,[`& .${o.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...N.baseProps,...h,children:[a&&jsx(G,{component:"span",className:o.item.icon,children:N.renderIcon}),i&&jsxs(G,{component:"span",className:o.item.texts,children:[jsx(G,{component:"span",className:o.item.title,children:i}),r&&jsx(De,{title:r,placement:"top-start",children:jsx(G,{component:"span",className:o.item.caption,children:r})})]}),t&&jsx(G,{component:"span",className:o.item.info,children:N.renderInfo}),c&&jsx(fe,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:o.item.arrow})]})}),ot=styled(Ae,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:t,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...d.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...d.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...d.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...d.arrow},info:{...d.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${o.item.icon}`]:{...n.icon},[`& .${o.item.texts}`]:{...n.texts},[`& .${o.item.title}`]:{...n.title},[`& .${o.item.caption}`]:{...n.caption},[`& .${o.item.arrow}`]:{...n.arrow},[`& .${o.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${o.item.icon}`]:{...n.icon},[`& .${o.item.texts}`]:{...n.texts},[`& .${o.item.title}`]:{...n.title},[`& .${o.item.caption}`]:{...n.caption},[`& .${o.item.arrow}`]:{...n.arrow},[`& .${o.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...t&&d.disabled}});var se=({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r})=>{let s=w(),m=M(e.path,!!e.children),[n,l]=useState(m);useEffect(()=>{m||c();},[s]);let v=useCallback(()=>{e.children&&l(u=>!u);},[e.children]),c=useCallback(()=>{l(!1);},[]),p=jsx(ie,{render:a,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:t,active:m,disabled:e.disabled,hasChild:!!e.children,open:e.children&&n,externalLink:I(e.path),enabledRootRedirect:r,slotProps:t===1?i?.rootItem:i?.subItem,onClick:v});return e.roles&&i?.currentRole&&!e?.roles?.includes(i?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,sx:{[`& .${o.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[p,jsx(q,{"data-group":e.title,in:n,depth:t,unmountOnExit:!0,mountOnEnter:!0,children:jsx(nt,{data:e.children,render:a,depth:t,slotProps:i,enabledRootRedirect:r})})]}):jsx(b,{disabled:e.disabled,children:p})},nt=({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r})=>jsx(g,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(se,{data:s,render:a,depth:t+1,slotProps:i,enabledRootRedirect:r},s.title))});var ci=({sx:e,data:a,render:t,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.vertical(m),...s};return jsx(ao,{component:"nav",className:o.vertical.root,sx:{...n,...e},children:jsx(g,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(ct,{subheader:l.subheader,items:l.items,render:t,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},ct=({items:e,render:a,subheader:t,slotProps:i,enabledRootRedirect:r})=>{let[s,m]=useState(!0),n=useCallback(()=>{m(v=>!v);},[]),l=jsx(g,{sx:{gap:"var(--nav-item-gap)"},children:e.map(v=>jsx(se,{data:v,render:a,depth:1,slotProps:i,enabledRootRedirect:r},v.title))});return jsx(b,{children:t?jsxs(Fragment,{children:[jsx(F,{"data-title":t,open:s,onClick:n,sx:i?.subheader,children:t}),jsx(_e,{in:s,children:l})]}):l})};var me=forwardRef(({path:e,icon:a,info:t,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:u,enabledRootRedirect:f,onNavigate:h,...x},N)=>{let y=K({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:f,onNavigate:h});return jsxs(Nt,{ref:N,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${o.item.icon}`]:p?.icon,[`& .${o.item.texts}`]:p?.texts,[`& .${o.item.title}`]:p?.title,[`& .${o.item.caption}`]:p?.caption,[`& .${o.item.info}`]:p?.info,[`& .${o.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[a&&jsx(G,{component:"span",className:o.item.icon,children:y.renderIcon}),i&&jsxs(G,{component:"span",className:o.item.texts,children:[jsx(G,{component:"span",className:o.item.title,children:i}),r&&jsx(De,{title:r,placement:"top-start",children:jsx(G,{component:"span",className:o.item.caption,children:r})})]}),t&&jsx(G,{component:"span",className:o.item.info,children:y.renderInfo}),c&&jsx(fe,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:o.item.arrow})]})}),Nt=styled(Ae,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:t,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...d.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...d.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...d.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...d.arrow},info:{...d.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${o.item.icon}`]:{...n.icon},[`& .${o.item.texts}`]:{...n.texts},[`& .${o.item.title}`]:{...n.title},[`& .${o.item.caption}`]:{...n.caption},[`& .${o.item.arrow}`]:{...n.arrow},[`& .${o.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${o.item.icon}`]:{...n.icon},[`& .${o.item.texts}`]:{...n.texts},[`& .${o.item.title}`]:{...n.title},[`& .${o.item.caption}`]:{...n.caption},[`& .${o.item.arrow}`]:{...n.arrow},[`& .${o.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...t&&d.disabled}});var le=({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})=>{let n=!!matchPath({path:e.path||"",end:!1},m),[l,v]=useState(n);useEffect(()=>{n||p();},[m]);let c=useCallback(()=>{e.children&&v(f=>!f);},[e.children]),p=useCallback(()=>{v(!1);},[]),u=jsx(me,{render:a,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:t,active:n,disabled:e.disabled,hasChild:!!e.children,open:e.children&&l,externalLink:I(e.path),enabledRootRedirect:r,slotProps:t===1?i?.rootItem:i?.subItem,onClick:c,onNavigate:s});return e.roles&&i?.currentRole&&!e?.roles?.includes(i?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,sx:{[`& .${o.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[u,jsx(q,{"data-group":e.title,in:l,depth:t,unmountOnExit:!0,mountOnEnter:!0,children:jsx(kt,{data:e.children,render:a,depth:t,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})})]}):jsx(b,{disabled:e.disabled,children:u})},kt=({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})=>jsx(g,{sx:{gap:"var(--nav-item-gap)"},children:e.map(n=>jsx(le,{data:n,render:a,depth:t+1,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m},n.title))});var Fi=({sx:e,data:a,render:t,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.vertical(l),...s};return jsx(ao,{component:"nav",className:o.vertical.root,sx:{...v,...e},children:jsx(g,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(c=>jsx(Bt,{subheader:c.subheader,items:c.items,render:t,renderEmptyView:c.renderEmptyView,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n},c.subheader??c.items[0].title))})})},Bt=({items:e,render:a,renderEmptyView:t,subheader:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})=>{let[l,v]=useState(!0),c=useCallback(()=>{v(u=>!u);},[]),p=t&&e.length===0?t():jsx(g,{sx:{gap:"var(--nav-item-gap)"},children:e.map(u=>jsx(le,{data:u,render:a,depth:1,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n},u.title))});return jsx(b,{children:i?jsxs(Fragment,{children:[jsx(F,{"data-title":i,open:l,onClick:c,sx:r?.subheader,children:i}),jsx(_e,{in:l,children:p})]}):p})};
|
|
18
18
|
|
|
19
|
-
export {
|
|
19
|
+
export { q as NavCollapse, b as NavLi, ln as NavSectionHorizontal, Y as NavSectionHorizontalItem, qn as NavSectionMini, ne as NavSectionMiniButtonItem, oe as NavSectionMiniItem, Ba as NavSectionMiniWithButtons, ci as NavSectionVertical, me as NavSectionVerticalButtonItem, ie as NavSectionVerticalItem, Fi as NavSectionVerticalWithButtons, g as NavUl, F as Subheader, ve as bulletColor, o as navSectionClasses, k as navSectionCssVars, d as sharedStyles, S as stateClasses, _ as useNavItem };
|
package/package.json
CHANGED