@zydon/common-csr 2.1.5 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,19 +1,20 @@
|
|
|
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 F from '@mui/material/Box';
|
|
4
|
+
import Fe from '@mui/material/ButtonBase';
|
|
5
5
|
import { styled, useTheme } from '@mui/material/styles';
|
|
6
|
-
import
|
|
6
|
+
import Ge from '@mui/material/Tooltip';
|
|
7
7
|
import fe from '@zydon/common/components/Icon';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import Ee from '@mui/material/Collapse';
|
|
9
|
+
import Me 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 io from '@mui/material/Stack';
|
|
13
|
+
import mo from '@zydon/common/components/Scrollbar';
|
|
14
|
+
import eo from '@mui/material/Paper';
|
|
15
|
+
import oo from '@mui/material/Popover';
|
|
16
|
+
import Qo from '@mui/material/Divider';
|
|
16
17
|
|
|
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
|
+
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 Be(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 $e(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:$e,vertical:Be,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 G({sx:e,open:a,children:t,...i}){return jsxs(Me,{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(Ee,{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 g({sx:e,children:a,disabled:t,...i}){return jsx(F,{component:"li",className:o.li,sx:{display:"flex",flexDirection:"column",...t&&{cursor:"not-allowed"},...e},...i,children:a})}function N({children:e,sx:a,...t}){return jsx(F,{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 E({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},h=null;a&&r?.navIcon&&typeof a=="string"?h=r?.navIcon[a]:h=a;let f=null;if(t&&r?.navInfo&&Array.isArray(t)){let[x,b]=t,y=r.navInfo(b)[x];f=y?cloneElement(y):null;}else f=t;return {subItem:v,rootItem:l,subDeepItem:c,baseProps:u,renderIcon:h,renderInfo:f}}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:h,...f},x)=>{let b=E({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:h});return jsxs(Je,{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}),...b.baseProps,...f,children:[a&&jsx(F,{component:"span",className:o.item.icon,children:b.renderIcon}),i&&jsx(F,{component:"span",className:o.item.title,children:i}),r&&jsx(Ge,{title:r,arrow:!0,children:jsx(fe,{icon:"INFO_CIRCLE",className:o.item.caption})}),t&&jsx(F,{component:"span",className:o.item.info,children:b.renderInfo}),c&&jsx(fe,{icon:b.subItem?"CHEVRON_RIGHT":"ARROW_DOWN_SIMPLE",className:o.item.arrow})]})}),Je=styled(Fe,{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 W(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=W(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&h();},[n]);let u=useCallback(()=>{e.children&&p(!0);},[e.children]),h=useCallback(()=>{p(!1);},[]),f=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:h});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[f,jsx(oo,{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:h,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a===1&&{ml:-.75},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(eo,{className:o.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(no,{data:e.children,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(g,{disabled:e.disabled,children:f})}function no({data:e,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s}){return jsx(N,{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 un({sx:e,data:a,render:t,slotProps:i,enabledRootRedirect:r,cssVars:s}){let m=useTheme(),n={...k.horizontal(m),...s};return jsx(mo,{sx:{height:1},slotProps:{content:{height:1,display:"flex",alignItems:"center"}},children:jsx(io,{component:"nav",direction:"row",alignItems:"center",className:o.horizontal.root,sx:{...n,mx:"auto",height:1,minHeight:"var(--nav-height)",...e},children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(lo,{render:t,cssVars:n,items:l.items,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})})}function lo({items:e,render:a,slotProps:t,enabledRootRedirect:i,cssVars:r}){return jsx(g,{children:jsx(N,{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:h,...f},x)=>{let b=E({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:h});return jsxs(ho,{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}),...b.baseProps,...f,children:[a&&jsx(F,{component:"span",className:o.item.icon,children:b.renderIcon}),i&&jsx(F,{component:"span",className:o.item.title,children:i}),r&&jsx(Ge,{title:r,arrow:!0,placement:"right",children:jsx(fe,{icon:"INFO_CIRCLE",className:o.item.caption})}),t&&b.subItem&&jsx(F,{component:"span",className:o.item.info,children:b.renderInfo}),c&&jsx(fe,{icon:"CHEVRON_RIGHT",className:o.item.arrow})]})}),ho=styled(Fe,{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=W(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&h();},[n]);let u=useCallback(()=>{e.children&&p(!0);},[e.children]),h=useCallback(()=>{p(!1);},[]),f=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:h});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[f,jsx(oo,{disableScrollLock:!0,open:c,anchorEl:l.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:u,onMouseLeave:h,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a>1&&{mt:-1},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(eo,{className:o.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(wo,{data:e.children,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(g,{disabled:e.disabled,children:f})};function wo({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r,cssVars:s}){return jsx(N,{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 Xn=({sx:e,data:a,render:t,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.mini(m),...s};return jsx(io,{component:"nav",className:o.mini.root,sx:{...n,...e},children:jsx(N,{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(g,{children:jsx(N,{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,h=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{onClick:b=>l(b,e)},f=null;a&&r?.navIcon&&typeof a=="string"?f=r?.navIcon[a]:f=a;let x=null;if(t&&r?.navInfo&&Array.isArray(t)){let[b,y]=t,pe=r.navInfo(y)[b];x=pe?cloneElement(pe):null;}else x=t;return {subItem:c,rootItem:v,subDeepItem:p,baseProps:h,renderIcon:f,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:h,onNavigate:f,...x},b)=>{let y=K({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:h,onNavigate:f});return jsxs(zo,{ref:b,"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(F,{component:"span",className:o.item.icon,children:y.renderIcon}),i&&jsx(F,{component:"span",className:o.item.title,children:i}),r&&jsx(Ge,{title:r,arrow:!0,placement:"right",children:jsx(fe,{icon:"INFO_CIRCLE",className:o.item.caption})}),t&&y.subItem&&jsx(F,{component:"span",className:o.item.info,children:y.renderInfo})]})}),zo=styled(Fe,{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",width:48,minHeight:44,padding:"var(--nav-item-root-padding)",[`& .${o.item.icon}`]:{...n.icon},[`& .${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:r.palette.primary.contrastText,backgroundColor:r.palette.primary.main,"&:hover":{backgroundColor:r.palette.primary.lighter},[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:!0},n),p=Array.isArray(e.children)?e.children.some(y=>matchPath({path:y.path||"",end:!0},n)):c,[u,h]=useState(!1);useEffect(()=>{u&&x();},[n]);let f=useCallback(()=>{e.children&&h(!0);},[e.children]),x=useCallback(()=>{h(!1);},[]),b=jsx(ne,{ref:v,render:t,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:a,active:p,disabled:e.disabled,hasChild:!!e.children,open:e.children&&u,externalLink:I(e.path),enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:f,onMouseLeave:x,onNavigate:m});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,children:[b,jsx(oo,{disableScrollLock:!0,open:u,anchorEl:v.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:f,onMouseLeave:x,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a>1&&{mt:-1},...u&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(eo,{className:o.paper,sx:{minWidth:180,...paper({theme:l,dropdown:!0}),...r?.paper},children:jsx(qo,{data:e.children,depth:a,render:t,cssVars:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})})})]}):jsx(g,{disabled:e.disabled,children:b})};function qo({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n}){return jsx(N,{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 Ta=({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(io,{component:"nav",className:o.mini.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)",alignItems:"center",justifyContent:"center"},children:a.map(c=>jsxs(Fragment,{children:[c.subheader&&jsx(Fragment,{children:jsx(Qo,{sx:{my:2},flexItem:!0})}),jsx(Zo,{render:t,cssVars:v,items:c.items,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n})]},c.subheader??c.items[0].title))})})},Zo=({items:e,render:a,slotProps:t,enabledRootRedirect:i,cssVars:r,onNavigate:s,pathname:m})=>jsx(g,{children:jsx(N,{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:h,...f},x)=>{let b=E({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:h});return jsxs(it,{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}),...b.baseProps,...f,children:[a&&jsx(F,{component:"span",className:o.item.icon,children:b.renderIcon}),i&&jsxs(F,{component:"span",className:o.item.texts,children:[jsx(F,{component:"span",className:o.item.title,children:i}),r&&jsx(Ge,{title:r,placement:"top-start",children:jsx(F,{component:"span",className:o.item.caption,children:r})})]}),t&&jsx(F,{component:"span",className:o.item.info,children:b.renderInfo}),c&&jsx(fe,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:o.item.arrow})]})}),it=styled(Fe,{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=W(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(g,{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(lt,{data:e.children,render:a,depth:t,slotProps:i,enabledRootRedirect:r})})]}):jsx(g,{disabled:e.disabled,children:p})},lt=({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r})=>jsx(N,{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 bi=({sx:e,data:a,render:t,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.vertical(m),...s};return jsx(io,{component:"nav",className:o.vertical.root,sx:{...n,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(ht,{subheader:l.subheader,items:l.items,render:t,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},ht=({items:e,render:a,subheader:t,slotProps:i,enabledRootRedirect:r})=>{let[s,m]=useState(!0),n=useCallback(()=>{m(v=>!v);},[]),l=jsx(N,{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(g,{children:t?jsxs(Fragment,{children:[jsx(G,{"data-title":t,open:s,onClick:n,sx:i?.subheader,children:t}),jsx(Ee,{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:h,onNavigate:f,...x},b)=>{let y=K({path:e,icon:a,info:t,depth:m,render:n,hasChild:c,externalLink:u,enabledRootRedirect:h,onNavigate:f});return jsxs(St,{ref:b,"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(F,{component:"span",className:o.item.icon,children:y.renderIcon}),i&&jsxs(F,{component:"span",className:o.item.texts,children:[jsx(F,{component:"span",className:o.item.title,children:i}),r&&jsx(Ge,{title:r,placement:"top-start",children:jsx(F,{component:"span",className:o.item.caption,children:r})})]}),t&&jsx(F,{component:"span",className:o.item.info,children:y.renderInfo}),c&&jsx(fe,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:o.item.arrow})]})}),St=styled(Fe,{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:!0},m),l=Array.isArray(e.children)?e.children.some(f=>matchPath({path:f.path||"",end:!0},m)):n,[v,c]=useState(l);useEffect(()=>{l||u();},[m]);let p=useCallback(()=>{e.children&&c(f=>!f);},[e.children]),u=useCallback(()=>{c(!1);},[]),h=jsx(me,{render:a,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:t,active:l,disabled:e.disabled,hasChild:!!e.children,open:e.children&&v,externalLink:I(e.path),enabledRootRedirect:r,slotProps:t===1?i?.rootItem:i?.subItem,onClick:p,onNavigate:s});return e.roles&&i?.currentRole&&!e?.roles?.includes(i?.currentRole)?null:e.children?jsxs(g,{disabled:e.disabled,sx:{[`& .${o.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[h,jsx(q,{"data-group":e.title,in:v,depth:t,unmountOnExit:!0,mountOnEnter:!0,children:jsx(Lt,{data:e.children,render:a,depth:t,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})})]}):jsx(g,{disabled:e.disabled,children:h})},Lt=({data:e,render:a,depth:t,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})=>jsx(N,{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 Yi=({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(io,{component:"nav",className:o.vertical.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(c=>jsx(Mt,{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))})})},Mt=({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(N,{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(g,{children:i?jsxs(Fragment,{children:[jsx(G,{"data-title":i,open:l,onClick:c,sx:r?.subheader,children:i}),jsx(Ee,{in:l,children:p})]}):p})};
|
|
18
19
|
|
|
19
|
-
export { q as NavCollapse,
|
|
20
|
+
export { q as NavCollapse, g as NavLi, un as NavSectionHorizontal, Y as NavSectionHorizontalItem, Xn as NavSectionMini, ne as NavSectionMiniButtonItem, oe as NavSectionMiniItem, Ta as NavSectionMiniWithButtons, bi as NavSectionVertical, me as NavSectionVerticalButtonItem, ie as NavSectionVerticalItem, Yi as NavSectionVerticalWithButtons, N as NavUl, G as Subheader, ve as bulletColor, o as navSectionClasses, k as navSectionCssVars, d as sharedStyles, S as stateClasses, E as useNavItem };
|
package/package.json
CHANGED