import{r as g,u as I,m as $,a as L,f as N,b as A,c as P,d as z,R as k,B as y,e as H,g as O,h as G,i as U,j as M,k as t,U as V,G as T,l as b,n as F,o as _,L as q}from "./index-y8OWP3zI.js";import{V as K}from "./Views-WvrQ7LwQ.js";import{c as Y,n as J,A as R}from "./AuthorityCheck-ILqP0giz.js";import{g as Q,c as m,u as W,S as X}from "./SimpleSideBarBottomContent-PDKzNzI8.js";import{T as Z}from "./Text-RDjPAdg3.js";import{C as ee}from "./Card-hmUBRbY3.js";function te(s){if(!s||typeof s=="string")return 0;const r=s/36;return Math.round((4+15*r**.25+r/5)*10)}function C(s){return s!=null&&s.current?s.current.scrollHeight:"auto"}const x=typeof window<"u"&&window.requestAnimationFrame;function se({transitionDuration:s,transitionTimingFunction:r="ease",onTransitionEnd:u=()=>{},opened:n}){const l=g.useRef(null),a=0,d={display:"none",height:0,overflow:"hidden"},[e,p]=g.useState(n?{}:d),h= i=>{L.flushSync(()=>p(i))},c= i=>{h(f=>({...f,...i}))};function o(i){const f=s||te(i);return{transition:`height ${f}ms ${r}, opacity ${f}ms ${r}`}}I(()=>{typeof x=="function"&&x(n?()=>{c({willChange:"height",display:"block",overflow:"hidden"}),x(()=>{const i=C(l);c({...o(i),height:i})})}:()=>{const i=C(l);c({...o(i),willChange:"height",height:i}),x(()=>c({height:a,overflow:"hidden"}))})},[n]);const j= i=>{if(!(i.target!==l.current||i.propertyName!=="height"))if(n){const f=C(l);f===e.height?h({}):c({height:f}),u()}else e.height===a&&(h(d),u())};function v({style:i={},refKey:f="ref",...w}={}){const D=w[f];return{"aria-hidden":!n,...w,[f]:$(l,D),onTransitionEnd:j,style:{boxSizing:"border-box",...i,...e}}}return v}const ne={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},E=N((s, r)=>{const{children:u,in:n,transitionDuration:l,transitionTimingFunction:a,style:d,onTransitionEnd:e,animateOpacity:p,...h}=A("Collapse",ne,s),c=P(),o=z(),v=(c.respectReducedMotion?o:!1)?0:l,i=se({opened:n,transitionDuration:v,transitionTimingFunction:a,onTransitionEnd:e});return v===0?n?k.createElement(y,{...h},u):null:k.createElement(y,{...i({style:{opacity:n||!p?1:0,transition:p?`opacity ${v}ms ${a}`:"none",...Q(d,c)},ref:r,...h})},u)});E.displayName="@mantine/core/Collapse";var B={root:"m_7341320d"};const oe={},ae=O((s, {size:r,radius:u,variant:n,gradient:l,color:a,autoContrast:d})=>{const e=s.variantColorResolver({color:a||s.primaryColor,theme:s,gradient:l,variant:n||"filled",autoContrast:d});return{root:{"--ti-size":G(r,"ti-size"),"--ti-radius":u===void 0?void 0:U(u),"--ti-bg":a||n?e.background:void 0,"--ti-color":a||n?e.color:void 0,"--ti-bd":a||n?e.border:void 0}}}),S=N((s, r)=>{const u=A("ThemeIcon",oe,s),{classNames:n,className:l,style:a,styles:d,unstyled:e,vars:p,autoContrast:h,...c}=u,o=H({name:"ThemeIcon",classes:B,props:u,className:l,style:a,classNames:n,styles:d,unstyled:e,vars:p,varsResolver:ae});return k.createElement(y,{ref:r,...o("root"),...c})});S.classes=B;S.displayName="@mantine/core/ThemeIcon";/**
 * @license @tabler/icons-react v3.1.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var ie=Y("outline","chevron-right","IconChevronRight",[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]]);function re({icon:s,label:r,initiallyOpened:u,links:n}){const l=Array.isArray(n),[a,d]=g.useState(u||!1),e=M(),[p,h]=g.useState("");g.useEffect(()=>{const o=location.pathname;h(o)},[location.pathname]);const c=(l?n:[]).map(o=>t.jsx(Z,{component:"a","data-active":o.link===p?"true":void 0,className:m.link,href:o.link,onClick:j=>{e(o.link),j.preventDefault()},children:o.label},o.label));return t.jsxs("div",{style:{marginBottom:"0.8rem"},children:[t.jsx(V,{onClick:()=>d(o=>!o),className:m.control,children:t.jsxs(T,{justify:"space-between",gap:5,children:[t.jsxs(y,{style:{display:"flex",alignItems:"center"},children:[t.jsx(S,{variant:"light",size:30,children:t.jsx(s,{style:{width:b(18),height:b(18)}})}),t.jsx(y,{ml:"md",children:r})]}),l&&t.jsx(ie,{className:m.chevron,stroke:1.5,style:{width:b(16),height:b(16),transform:a?"rotate(-90deg)":"none"}})]})}),l?t.jsx(E,{in:a,children:c}):null]})}function le(){const s=M(),r=F(),[u,n]=g.useState(""),{t:l}=W(),a=_(e=>e.auth.user.role);g.useEffect(()=>{const e=r.pathname.split("/")[1];n(e)},[r.pathname]);const d=J.map((e,p)=>{let h=[];if(e.subMenu&&e.subMenu.length>0){h=e.subMenu.map(o=>({label:o.title,link:o.path,authority:o.authority}));const c=h.some(o=>r.pathname.includes(o.link));return t.jsx(R,{userAuthority:a||[],authority:e.authority,children:t.jsx(y,{ml:10,my:10,children:t.jsx(re,{initiallyOpened:c,icon:e.icon,label:e.title,links:h})})},p)}else return t.jsx(R,{userAuthority:a||[],authority:e.authority,children:t.jsxs(q,{className:m.link,"data-active":e.path.split("/")[1]===u?"true":void 0,to:e.path,onClick:c=>{c.preventDefault(),n(e.path.split("/")[1]),s(e.path)},children:[t.jsx(e.icon,{className:m.linkIcon,stroke:1.5}),t.jsx("span",{children:e.translateKey?l(e.translateKey):e.title})]})},p)});return t.jsxs("nav",{className:m.navbar,children:[t.jsxs("div",{className:m.navbarMain,children:[t.jsx(T,{className:m.header,justify:"space-between",children:t.jsx("img",{className:m.logo,alt:"Mantine Logo",src:"/logo/logo-light-full.svg"})}),d]}),t.jsx(X,{})]})}function me(){return t.jsxs("div",{style:{overflow:"hidden",backgroundColor:"rgb(236,236,236)",display:"flex",flex:"1 1 auto",height:"100vh"},children:[t.jsx(le,{}),t.jsx("div",{style:{padding:"2rem",backgroundColor:"#ffffff",flex:1,overflow:"hidden",display:"flex",flexDirection:"column",height:"100vh"},children:t.jsx(ee,{style:{overflowY:"auto",maxHeight:"100%",width:"100%",flex:1},radius:15,withBorder:!0,p:40,children:t.jsx(K,{})})})]})}export{me as default};
