import{r as p,p as ee,f as oe,b as A,c as be,e as te,q as ne,s as se,R as y,O as ae,B as re,g as ie,i as le,t as ce,v as Pe,u as Te,T as _e,w as Ee,k as n,n as Ce,o as je,U as ke,l as Z,L as De}from "./index-y8OWP3zI.js";import{g as Me,u as Re,S as Se}from "./SimpleSideBarBottomContent-PDKzNzI8.js";import{u as pe,s as de,g as Le,F as Ne,a as Fe,o as Be,f as Oe,b as Ae,i as Ge,d as ze,e as Ue,h as $e,j as Ie,k as Ke,l as Ve,m as qe,p as Ye,q as He,r as Xe,n as J,A as Q}from "./AuthorityCheck-ILqP0giz.js";import{V as Ze}from "./Views-WvrQ7LwQ.js";import{T as Je}from "./Title-F8NexOoA.js";import"./Text-RDjPAdg3.js";const Qe={duration:100,transition:"fade"};function We(e, s){return{...Qe,...s,...e}}function eo({offset:e,position:s}){const[t,a]=p.useState(!1),u=p.useRef(),{x:w,y:d,elements:m,refs:i,update:h,placement:o}=pe({placement:s,middleware:[de({crossAxis:!0,padding:5,rootBoundary:"document"})]}),c=o.includes("right")?e:s.includes("left")?e*-1:0,f=o.includes("bottom")?e:s.includes("top")?e*-1:0,r=p.useCallback(({clientX:l,clientY:v})=>{i.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:l,y:v,left:l+c,top:v+f,right:l,bottom:v}}})},[m.reference]);return p.useEffect(()=>{if(i.floating.current){const l=u.current;l.addEventListener("mousemove",r);const v=Le(i.floating.current);return v.forEach(g=>{g.addEventListener("scroll",h)}),()=>{l.removeEventListener("mousemove",r),v.forEach(g=>{g.removeEventListener("scroll",h)})}}},[m.reference,i.floating.current,h,r,t]),{handleMouseMove:r,x:w,y:d,opened:t,setOpened:a,boundaryRef:u,floating:i.setFloating}}var G={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const oo={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:ee("popover")},to=ie((e, {radius:s,color:t})=>({tooltip:{"--tooltip-radius":s===void 0?void 0:le(s),"--tooltip-bg":t?ce(t,e):void 0,"--tooltip-color":t?"var(--mantine-color-white)":void 0}})),Y=oe((e, s)=>{const t=A("TooltipFloating",oo,e),{children:a,refProp:u,withinPortal:w,style:d,className:m,classNames:i,styles:h,unstyled:o,radius:c,color:f,label:r,offset:l,position:v,multiline:g,zIndex:L,disabled:C,variant:j,vars:k,portalProps:D,...M}=t,R=be(),T=te({name:"TooltipFloating",props:t,classes:G,className:m,style:d,classNames:i,styles:h,unstyled:o,rootSelector:"tooltip",vars:k,varsResolver:to}),{handleMouseMove:P,x:F,y:B,opened:z,boundaryRef:U,floating:$,setOpened:O}=eo({offset:l,position:v});if(!ne(a))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const I=se(U,a.ref,s),K= S=>{var _,E;(E=(_=a.props).onMouseEnter)==null||E.call(_,S),P(S),O(!0)},V= S=>{var _,E;(E=(_=a.props).onMouseLeave)==null||E.call(_,S),O(!1)};return y.createElement(y.Fragment,null,y.createElement(ae,{...D,withinPortal:w},y.createElement(re,{...M,...T("tooltip",{style:{...Me(d,R),zIndex:L,display:!C&&z?"block":"none",top:(B&&Math.round(B))??"",left:(F&&Math.round(F))??""}}),variant:j,ref:$,mod:{multiline:g}},r)),p.cloneElement(a,{...a.props,[u]:I,onMouseEnter:K,onMouseLeave:V}))});Y.classes=G;Y.displayName="@mantine/core/TooltipFloating";const ue=p.createContext(!1),no=ue.Provider,so=()=>p.useContext(ue),ao={openDelay:0,closeDelay:0};function fe(e){const{openDelay:s,closeDelay:t,children:a}=A("TooltipGroup",ao,e);return y.createElement(no,{value:!0},y.createElement(Ne,{delay:{open:s,close:t}},a))}fe.displayName="@mantine/core/TooltipGroup";function ro(e){var M,R,T;const[s,t]=p.useState(!1),u=typeof e.opened=="boolean"?e.opened:s,w=so(),d=Pe(),{delay:m,currentId:i,setCurrentId:h}=Fe(),o=p.useCallback(P=>{t(P),P&&h(d)},[h,d]),{x:c,y:f,context:r,refs:l,update:v,placement:g,middlewareData:{arrow:{x:L,y:C}={}}}=pe({strategy:e.strategy,placement:e.position,open:u,onOpenChange:o,middleware:[Be(e.offset),de({padding:8}),Oe(),Ae({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[Ge()]:[]]}),{getReferenceProps:j,getFloatingProps:k}=ze([Ue(r,{enabled:(M=e.events)==null?void 0:M.hover,delay:w?m:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((R=e.events)!=null&&R.touch)}),$e(r,{enabled:(T=e.events)==null?void 0:T.focus,visibleOnly:!0}),Ie(r,{role:"tooltip"}),Ke(r,{enabled:typeof e.opened>"u"}),Ve(r,{id:d})]);qe({opened:u,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:l,update:v}}),Te(()=>{var P;(P=e.onPositionChange)==null||P.call(e,g)},[g]);const D=u&&i&&i!==d;return{x:c,y:f,arrowX:L,arrowY:C,reference:l.setReference,floating:l.setFloating,getFloatingProps:k,getReferenceProps:j,isGroupPhase:D,opened:u,placement:g}}const W={position:"top",refProp:"ref",withinPortal:!0,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:ee("popover"),positionDependencies:[]},io=ie((e, {radius:s,color:t})=>({tooltip:{"--tooltip-radius":s===void 0?void 0:le(s),"--tooltip-bg":t?ce(t,e):void 0,"--tooltip-color":t?"var(--mantine-color-white)":void 0}})),N=oe((e, s)=>{const t=A("Tooltip",W,e),{children:a,position:u,refProp:w,label:d,openDelay:m,closeDelay:i,onPositionChange:h,opened:o,withinPortal:c,radius:f,color:r,classNames:l,styles:v,unstyled:g,style:L,className:C,withArrow:j,arrowSize:k,arrowOffset:D,arrowRadius:M,arrowPosition:R,offset:T,transitionProps:P,multiline:F,events:B,zIndex:z,disabled:U,positionDependencies:$,onClick:O,onMouseEnter:I,onMouseLeave:K,inline:V,variant:S,keepMounted:_,vars:E,portalProps:me,mod:he,floatingStrategy:ve,...ye}=A("Tooltip",W,t),{dir:ge}=Ye(),H=p.useRef(null),x=ro({position:He(ge,u),closeDelay:i,openDelay:m,onPositionChange:h,opened:o,events:B,arrowRef:H,arrowOffset:D,offset:typeof T=="number"?T+(j?k/2:0):T,positionDependencies:[...$,a],inline:V,strategy:ve}),q=te({name:"Tooltip",props:t,classes:G,className:C,style:L,classNames:l,styles:v,unstyled:g,rootSelector:"tooltip",vars:E,varsResolver:io});if(!ne(a))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const xe=se(x.reference,a.ref,s),X=We(P,{duration:100,transition:"fade"});return y.createElement(y.Fragment,null,y.createElement(ae,{...me,withinPortal:c},y.createElement(_e,{...X,keepMounted:_,mounted:!U&&!!x.opened,duration:x.isGroupPhase?10:X.duration}, we=>y.createElement(re,{...ye,variant:S,mod:[{multiline:F},he],...x.getFloatingProps({ref:x.floating,className:q("tooltip").className,style:{...q("tooltip").style,...we,zIndex:z,top:x.y??0,left:x.x??0}})},d,y.createElement(Xe,{ref:H,arrowX:x.arrowX,arrowY:x.arrowY,visible:j,position:x.placement,arrowSize:k,arrowOffset:D,arrowRadius:M,arrowPosition:R,...q("arrow")})))),p.cloneElement(a,x.getReferenceProps({onClick:O,onMouseEnter:I,onMouseLeave:K,onMouseMove:t.onMouseMove,onPointerDown:t.onPointerDown,onPointerEnter:t.onPointerEnter,[w]:xe,className:Ee(C,a.props.className),...a.props})))});N.classes=G;N.displayName="@mantine/core/Tooltip";N.Floating=Y;N.Group=fe;const lo="_navbar_1pbxn_1",co="_wrapper_1pbxn_10",po="_aside_1pbxn_15",uo="_main_1pbxn_24",fo="_mainLink_1pbxn_34",mo="_stickyTitle_1pbxn_57",ho="_title_1pbxn_65",vo="_logo_1pbxn_76",yo="_link_1pbxn_86",go="_sideBarBottomContent_1pbxn_115",b={navbar:lo,wrapper:co,aside:po,main:uo,mainLink:fo,stickyTitle:mo,title:ho,logo:vo,link:yo,sideBarBottomContent:go};function xo(){const[e,s]=p.useState(""),[t,a]=p.useState(""),[u,w]=p.useState(""),d=Ce(),{t:m}=Re(),i=je(o=>o.auth.user.role);p.useEffect(()=>{const o=d.pathname.split("/"),c=o[1],f=o[2];s(c),a(f),w(c.toUpperCase())},[d.pathname]);const h=(o, c, f)=>{s(o.split("/")[1]),w(f?m(f):c)};return n.jsx("nav",{className:b.navbar,children:n.jsxs("div",{className:b.wrapper,children:[n.jsxs("div",{className:b.aside,children:[n.jsx("div",{children:n.jsx("img",{className:b.logo,alt:"Mantine Logo",src:"/logo/logo-light-full.svg"})}),n.jsx("div",{style:{overflowY:"auto"},children:J.map((o, c)=>n.jsx(Q,{userAuthority:i||[],authority:o.authority,children:n.jsx(N,{label:o.translateKey?m(o.translateKey):o.title,position:"right",withArrow:!0,transitionProps:{duration:0},children:n.jsx(ke,{onClick:()=>h(o.path,o.title,o.translateKey),className:b.mainLink,"data-active":o.path.split("/")[1]===e||void 0,children:n.jsx(o.icon,{style:{width:Z(22),height:Z(22)},stroke:1.5})})},c)}))})]}),n.jsxs("div",{className:b.main,children:[n.jsxs("div",{children:[n.jsx("div",{className:b.stickyTitle,children:n.jsx(Je,{order:4,className:b.title,children:u.toUpperCase()})}),n.jsx("div",{children:J.map((o, c)=>{var f;return n.jsx("div",{style:{display:o.path.split("/")[1]===e?"block":"none"},children:(f=o.subMenu)==null?void 0:f.map((r, l)=>n.jsx(Q,{userAuthority:i||[],authority:r.authority,children:n.jsx(De,{to:`${o.path}/${r.path}`,className:b.link,"data-active":`${r.path}`===t||void 0,children:r.translateKey?m(r.translateKey):r.title},l)}))},c)})})]}),n.jsx("div",{className:b.sideBarBottomContent,children:n.jsx(Se,{})})]})]})})}function Co(){return n.jsxs("div",{style:{overflow:"hidden",backgroundColor:"rgb(236,236,236)",display:"flex",flex:"1 1 auto",height:"100vh"},children:[n.jsx(xo,{}),n.jsx("div",{style:{padding:"1rem",backgroundColor:"rgb(241,240,240)",flex:1},children:n.jsx(Ze,{})})]})}export{Co as default};
