@ukpc-lib/react 0.3.25 → 0.3.27

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.
@@ -63,5 +63,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
63
63
  * content-type
64
64
  * Copyright(c) 2015 Douglas Christopher Wilson
65
65
  * MIT Licensed
66
- */var wl=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Rb=/\\([\u000b\u0020-\u00ff])/g,Ab=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,Ob=_b;function _b(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?Mb(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var n=t.indexOf(";"),r=n!==-1?t.slice(0,n).trim():t.trim();if(!Ab.test(r))throw new TypeError("invalid media type");var i=new jb(r.toLowerCase());if(n!==-1){var o,s,a;for(wl.lastIndex=n;s=wl.exec(t);){if(s.index!==n)throw new TypeError("invalid parameter format");n+=s[0].length,o=s[1].toLowerCase(),a=s[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(Rb,"$1"))),i.parameters[o]=a}if(n!==t.length)throw new TypeError("invalid parameter format")}return i}function Mb(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function jb(e){this.parameters=Object.create(null),this.type=e}var Rt=new Map,Gf=function(t){return t.cloneNode(!0)},Sl=function(){return window.location.protocol==="file:"},Xf=function(t,n,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){try{if(!/\.svg/i.test(t)&&i.readyState===2){var o=i.getResponseHeader("Content-Type");if(!o)throw new Error("Content type not found");var s=Ob(o).type;if(!(s==="image/svg+xml"||s==="text/plain"))throw new Error("Invalid content type: ".concat(s))}if(i.readyState===4){if(i.status===404||i.responseXML===null)throw new Error(Sl()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+t);if(i.status===200||Sl()&&i.status===0)r(null,i);else throw new Error("There was a problem injecting the SVG: "+i.status+" "+i.statusText)}}catch(a){if(i.abort(),a instanceof Error)r(a,i);else throw a}},i.open("GET",t),i.withCredentials=n,i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()},Qe={},El=function(t,n){Qe[t]=Qe[t]||[],Qe[t].push(n)},Vb=function(t){for(var n=function(s,a){setTimeout(function(){if(Array.isArray(Qe[t])){var l=Rt.get(t),u=Qe[t][s];l instanceof SVGSVGElement&&u(null,Gf(l)),l instanceof Error&&u(l),s===Qe[t].length-1&&delete Qe[t]}},0)},r=0,i=Qe[t].length;r<i;r++)n(r)},Lb=function(t,n,r){if(Rt.has(t)){var i=Rt.get(t);if(i===void 0){El(t,r);return}if(i instanceof SVGSVGElement){r(null,Gf(i));return}}Rt.set(t,void 0),El(t,r),Xf(t,n,function(o,s){var a;o?Rt.set(t,o):((a=s.responseXML)===null||a===void 0?void 0:a.documentElement)instanceof SVGSVGElement&&Rt.set(t,s.responseXML.documentElement),Vb(t)})},Fb=function(t,n,r){Xf(t,n,function(i,o){var s;i?r(i):((s=o.responseXML)===null||s===void 0?void 0:s.documentElement)instanceof SVGSVGElement&&r(null,o.responseXML.documentElement)})},Db=0,Ib=function(){return++Db},Pe=[],Cl={},Nb="http://www.w3.org/2000/svg",wi="http://www.w3.org/1999/xlink",kl=function(t,n,r,i,o,s,a){var l=t.getAttribute("data-src")||t.getAttribute("src");if(!l){a(new Error("Invalid data-src or src attribute"));return}if(Pe.indexOf(t)!==-1){Pe.splice(Pe.indexOf(t),1),t=null;return}Pe.push(t),t.setAttribute("src","");var u=i?Lb:Fb;u(l,o,function(f,c){if(!c){Pe.splice(Pe.indexOf(t),1),t=null,a(f);return}var d=t.getAttribute("id");d&&c.setAttribute("id",d);var h=t.getAttribute("title");h&&c.setAttribute("title",h);var p=t.getAttribute("width");p&&c.setAttribute("width",p);var g=t.getAttribute("height");g&&c.setAttribute("height",g);var y=Array.from(new Set(bi(bi(bi([],(c.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(t.getAttribute("class")||"").split(" "),!0))).join(" ").trim();c.setAttribute("class",y);var v=t.getAttribute("style");v&&c.setAttribute("style",v),c.setAttribute("data-src",l);var b=[].filter.call(t.attributes,function(Q){return/^data-\w[\w-]*$/.test(Q.name)});if(Array.prototype.forEach.call(b,function(Q){Q.name&&Q.value&&c.setAttribute(Q.name,Q.value)}),r){var x={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},S,E,k,T,P;Object.keys(x).forEach(function(Q){S=Q,k=x[Q],E=c.querySelectorAll(S+"[id]");for(var We=function(Et,Ur){T=E[Et].id,P=T+"-"+Ib();var at;Array.prototype.forEach.call(k,function(Wr){at=c.querySelectorAll("["+Wr+'*="'+T+'"]');for(var En=0,ed=at.length;En<ed;En++){var Qo=at[En].getAttribute(Wr);Qo&&!Qo.match(new RegExp('url\\("?#'+T+'"?\\)'))||at[En].setAttribute(Wr,"url(#"+P+")")}});for(var Le=c.querySelectorAll("[*|href]"),Ct=[],kt=0,Ut=Le.length;kt<Ut;kt++){var lt=Le[kt].getAttributeNS(wi,"href");lt&&lt.toString()==="#"+E[Et].id&&Ct.push(Le[kt])}for(var Ee=0,Zo=Ct.length;Ee<Zo;Ee++)Ct[Ee].setAttributeNS(wi,"href","#"+P);E[Et].id=P},wt=0,D=E.length;wt<D;wt++)We(wt)})}c.removeAttribute("xmlns:a");for(var _=c.querySelectorAll("script"),H=[],z,$,q=0,X=_.length;q<X;q++)$=_[q].getAttribute("type"),(!$||$==="application/ecmascript"||$==="application/javascript"||$==="text/javascript")&&(z=_[q].innerText||_[q].textContent,z&&H.push(z),c.removeChild(_[q]));if(H.length>0&&(n==="always"||n==="once"&&!Cl[l])){for(var Z=0,G=H.length;Z<G;Z++)new Function(H[Z])(window);Cl[l]=!0}var Te=c.querySelectorAll("style");if(Array.prototype.forEach.call(Te,function(Q){Q.textContent+=""}),c.setAttribute("xmlns",Nb),c.setAttribute("xmlns:xlink",wi),s(c),!t.parentNode){Pe.splice(Pe.indexOf(t),1),t=null,a(new Error("Parent node is null"));return}t.parentNode.replaceChild(c,t),Pe.splice(Pe.indexOf(t),1),t=null,a(null,c)})},Bb=function(t,n){var r=n===void 0?{}:n,i=r.afterAll,o=i===void 0?function(){}:i,s=r.afterEach,a=s===void 0?function(){}:s,l=r.beforeEach,u=l===void 0?function(){}:l,f=r.cacheRequests,c=f===void 0?!0:f,d=r.evalScripts,h=d===void 0?"never":d,p=r.httpRequestWithCredentials,g=p===void 0?!1:p,y=r.renumerateIRIElements,v=y===void 0?!0:y;if(t&&"length"in t)for(var b=0,x=0,S=t.length;x<S;x++)kl(t[x],h,v,c,g,u,function(E,k){a(E,k),t&&"length"in t&&t.length===++b&&o(b)});else t?kl(t,h,v,c,g,u,function(E,k){a(E,k),o(1),t=null}):o(0)},$b=function(t){var n=(t==null?void 0:t.ownerDocument)||document;return n.defaultView||window},zb=function(t,n){for(var r in t)if(!(r in n))return!0;for(var i in n)if(t[i]!==n[i])return!0;return!1},Ub=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Vn="http://www.w3.org/2000/svg",Tl="http://www.w3.org/1999/xlink",Yo=function(e){qf(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(a){r.reactWrapper=a},r}var n=t.prototype;return n.renderSVG=function(){var i=this;if(this.reactWrapper instanceof $b(this.reactWrapper).Node){var o=this.props,s=o.desc,a=o.evalScripts,l=o.httpRequestWithCredentials,u=o.renumerateIRIElements,f=o.src,c=o.title,d=o.useRequestCache,h=this.props.onError,p=this.props.beforeInjection,g=this.props.afterInjection,y=this.props.wrapper,v,b;y==="svg"?(v=document.createElementNS(Vn,y),v.setAttribute("xmlns",Vn),v.setAttribute("xmlns:xlink",Tl),b=document.createElementNS(Vn,y)):(v=document.createElement(y),b=document.createElement(y)),v.appendChild(b),b.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(v);var x=function(T){if(i.removeSVG(),!i._isMounted){h(T);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){h(T)})},S=function(T,P){if(T){x(T);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{g(P)}catch(_){x(_)}})},E=function(T){if(T.setAttribute("role","img"),s){var P=T.querySelector(":scope > desc");P&&T.removeChild(P);var _=document.createElement("desc");_.innerHTML=s,T.prepend(_)}if(c){var H=T.querySelector(":scope > title");H&&T.removeChild(H);var z=document.createElement("title");z.innerHTML=c,T.prepend(z)}try{p(T)}catch($){x($)}};Bb(b,{afterEach:S,beforeEach:E,cacheRequests:d,evalScripts:a,httpRequestWithCredentials:l,renumerateIRIElements:u})}},n.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(i){var o=this;zb(It({},i),this.props)&&this.setState(function(){return o.initialState},function(){o.removeSVG(),o.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var o=i.fallback;i.httpRequestWithCredentials;var s=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var a=i.wrapper,l=Ko(i,Ub),u=a;return m.reactExports.createElement(u,It({},l,{ref:this.refCallback},a==="svg"?{xmlns:Vn,xmlnsXlink:Tl}:{}),this.state.isLoading&&s&&m.reactExports.createElement(s,null),this.state.hasError&&o&&m.reactExports.createElement(o,null))},t}(m.reactExports.Component);Yo.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Yo.propTypes={afterInjection:K.func,beforeInjection:K.func,desc:K.string,evalScripts:K.oneOf(["always","once","never"]),fallback:K.oneOfType([K.func,K.object,K.string]),httpRequestWithCredentials:K.bool,loading:K.oneOfType([K.func,K.object,K.string]),onError:K.func,renumerateIRIElements:K.bool,src:K.string.isRequired,title:K.string,useRequestCache:K.bool,wrapper:K.oneOf(["div","span","svg"])};function Wb(e){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,children:m.jsxRuntimeExports.jsx("path",{fill:"currenColor",d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})})}function Hb(e){const{children:t,parentRef:n,onlyChild:r}=e,[i,o]=m.reactExports.useState({top:0,left:0});return m.reactExports.useLayoutEffect(()=>{if(n.current){const s=n.current.getBoundingClientRect();o({top:s.top,left:s.left+s.width})}},[n]),r?t:m.reactDomExports.createPortal(m.jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:i.top,left:i.left,zIndex:1200},children:t}),n.current)}function qb(e){const{children:t,title:n,hasTooltip:r}=e,i=m.reactExports.useRef(),[o,s]=m.reactExports.useState(!1),[a,l]=m.reactExports.useState({top:0,left:0});return m.jsxRuntimeExports.jsxs("div",{className:"tooltip-item__wrapper",onMouseOver:()=>{if(s(!0),i.current){const u=i.current.getBoundingClientRect();l({top:u.top-20,left:u.left})}},onMouseLeave:()=>s(!1),ref:i,children:[m.jsxRuntimeExports.jsx("div",{children:t}),o&&r&&m.jsxRuntimeExports.jsx("div",{className:"tooltip-item__content",style:{position:"fixed",background:"#85858A",borderRadius:"4px",color:"#fff",padding:"4px 8px",top:a.top,left:a.left,zIndex:1400,fontSize:10,transition:"all 0.2s ease-in-out",animation:"fadeIn 0.2s ease-in-out",pointerEvents:"none"},children:n})]})}function Kf({item:e,level:t=0,...n}){var z,$,q,X;const{isActive:r,isCollapsed:i,expanded:o,toggleExpand:s}=n,a=`level-${t}`,l=i?"collapsed":"expanded",u=r(e.id)?"active":"",f=(Z,G=a)=>`${Z} ${G} ${l} ${u}`,c=!!((z=e.children)!=null&&z.length),[d,h]=m.reactExports.useState(!1),p=m.reactExports.useRef(),g=window.location.origin,y=e.path&&e.path.includes("http")?new URL(e.path):{origin:"",pathname:""},v=window.location.pathname.split("/")[1],b=y.pathname.split("/")[1],x=n.ssr||!g.includes("local")&&g!==y.origin||b!==v,S=c||t===0?"div":x?"a":Cb,E=e.path||"#",k=t+1,T=c&&!(i&&k>=2&&!d),P=i||t===0?void 0:`${t}rem`;console.log("hasDropdown:",T);const _=()=>{h(!0)},H=()=>{h(!1)};return m.jsxRuntimeExports.jsxs("div",{ref:p,className:f("menu-item__wrapper"),onMouseOver:_,onMouseOut:H,children:[m.jsxRuntimeExports.jsx(qb,{hasTooltip:i&&t===1,children:m.jsxRuntimeExports.jsxs(S,{to:E,href:E,className:f("menu-item__link"),style:{paddingLeft:P,transition:"all 0.3s",color:r(e.id)?(($=n.brandColors)==null?void 0:$.primary400)||Vt.primary400:void 0,backgroundColor:r(e.id)&&t===1?(q=n.brandColors)==null?void 0:q.primary200:void 0},onClick:Z=>{c&&(Z.preventDefault(),i||s(e.id))},children:[t!==0&&m.jsxRuntimeExports.jsx(Gb,{cls:f,item:e}),m.jsxRuntimeExports.jsx("span",{className:f("menu-item__label"),children:e.name}),c&&m.jsxRuntimeExports.jsx("div",{className:f("menu-item__icon-arrow__wrapper"),children:m.jsxRuntimeExports.jsx(Wb,{className:f(`menu-item__icon-arrow__icon ${o(e.id)?"open":"close"}`)})})]}),title:e.name}),T&&m.jsxRuntimeExports.jsx(Hb,{parentRef:p,onlyChild:!i||i&&k<2,children:m.jsxRuntimeExports.jsx(Jx.div,{className:f(`menu-item__dropdown ${o(e.id)?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${k}`),initial:{height:i||o(e.id)?"auto":0},animate:{height:i||o(e.id)?"auto":0},transition:{duration:.25},children:(X=e.children)==null?void 0:X.map(Z=>m.reactExports.createElement(Kf,{...n,key:Z.id,item:Z,level:k}))})})]})}function Gb({item:e,cls:t}){var s,a;const[n,r]=m.reactExports.useState(!e.icon),i=()=>{r(!0)},o=(s=e.icon)==null?void 0:s.endsWith(".svg");return m.jsxRuntimeExports.jsx("div",{className:t("menu-item__icon"),children:n?m.jsxRuntimeExports.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center"},children:(a=e.name.trim().at(0))==null?void 0:a.toUpperCase()}):o?m.jsxRuntimeExports.jsx(Yo,{src:e.icon,beforeInjection:l=>{l.setAttribute("style","margin: 0 auto;"),l.querySelectorAll("path").forEach(f=>{f.hasAttribute("fill")&&f.setAttribute("fill","currentColor"),f.hasAttribute("stroke")&&f.setAttribute("stroke","currentColor")})}}):m.jsxRuntimeExports.jsx("img",{src:e.icon||"/",alt:" ",style:{height:24,maxHeight:24},onError:i})})}function Xb(){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:m.jsxRuntimeExports.jsx("path",{d:"M21 18v2H3v-2h18zM6.596 3.903L8.01 5.318 4.828 8.5 8.01 11.68l-1.414 1.415L2 8.5l4.596-4.597zM21 11v2h-9v-2h9zm0-7v2h-9V4h9z"})})}function Kb(){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:m.jsxRuntimeExports.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function Yb(e){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:m.jsxRuntimeExports.jsx("path",{fill:"#E01B00",fillRule:"evenodd",d:"M.179 2.875A2.375 2.375 0 012.554.5h3.393a1.018 1.018 0 010 2.036H2.554a.34.34 0 00-.34.339v14.25c0 .187.152.34.34.34h3.393a1.018 1.018 0 110 2.035H2.554a2.375 2.375 0 01-2.375-2.375V2.875zm14.167 6.107h-7.72a1.018 1.018 0 000 2.036h7.72l-2.673 2.673a1.018 1.018 0 101.44 1.44l4.41-4.411a1.018 1.018 0 000-1.44l-4.41-4.41a1.018 1.018 0 10-1.44 1.439l2.673 2.673z",clipRule:"evenodd"})})}const Jb=`.wrap-section{padding:0 8px;transition:all .3s}.wrap-section.collapsed{padding:0 4px}.side-bar{display:flex;flex-direction:column;max-width:18rem;height:calc(100vh - 64px);border-right:1px solid #ddd;background-color:#fafafa;transition:all .3s}.side-bar.expanded{width:17rem}.side-bar.collapsed{width:64px}.side-bar__wrap-btn-logout,.side-bar__btn-logout{margin:40px 0}.side-bar__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:1}.side-bar__logout-btn__text.collapsed{opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.side-bar__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px}.side-bar__wrapper-toggle-btn.collapsed{justify-content:center;width:100%}.side-bar__toggle-btn{margin-top:-6px;color:#85858a}.side-bar__logout-btn{width:100%;text-align:left;display:flex;flex-direction:row;align-items:center;padding:8px 16px 8px 18.6665px;min-height:48px;border-radius:.375rem;overflow:hidden;transition:all .3s ease-in-out}.side-bar__logout-btn:hover{background-color:#919eab14}.side-bar__icon-logout{flex-shrink:0}.menu-item__wrapper{display:flex;flex-direction:column;position:relative;width:100%}.menu-item__link{display:flex;flex-direction:row;border-radius:.375rem;align-items:center;padding:.5rem;position:relative;height:48px;cursor:pointer;color:#85858a}.menu-item__link:hover{background-color:#919eab14}.menu-item__link.collapsed.level-1{padding-left:calc(.5rem + 7.665px)!important}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-2,.menu-item__link.active.level-3,.menu-item__link.active.level-4,.menu-item__link.active.level-5,.menu-item__link.active.level-6,.menu-item__link.active.level-7,.menu-item__link.active.level-8,.menu-item__link.active.level-9,.menu-item__link.active.level-10{background-color:inherit;color:inherit}.menu-item__link.active.level-2:hover,.menu-item__link.active.level-3:hover,.menu-item__link.active.level-4:hover,.menu-item__link.active.level-5:hover,.menu-item__link.active.level-6:hover,.menu-item__link.active.level-7:hover,.menu-item__link.active.level-8:hover,.menu-item__link.active.level-9:hover,.menu-item__link.active.level-10:hover{background-color:#919eab14}.menu-item__link.level-0{height:37px}.menu-item__link.menu-item__link.collapsed.level-0{padding:0;height:0;transition:all .15s}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center}.menu-item__icon.collapsed.level-1>*{margin:0 auto}.menu-item__label{font-size:.875rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;flex-shrink:1;margin-left:12px;padding-right:12px;color:#292929;opacity:1}.menu-item__label.level-1.collapsed{text-overflow:unset}.menu-item__label.active{color:inherit}.menu-item__label.collapsed{margin-left:8px;font-size:.75rem;line-height:1rem}.menu-item__label.collapsed.level-0,.menu-item__label.collapsed.level-1{font-size:.875rem;opacity:0;transition-delay:.15s}.menu-item__label.level-0{color:#85858a;margin-left:0}.menu-item__icon-arrow__wrapper{display:grid;place-items:center;position:absolute;top:50%;transform:translateY(-50%);right:0}.menu-item__icon-arrow__wrapper.expanded{right:4px}.menu-item__icon-arrow__wrapper.level-0.collapsed{display:none}.menu-item__icon-arrow__icon{transition:all .3s!important;transform:rotate(-90deg)!important}.menu-item__icon-arrow__icon.active{color:inherit}.menu-item__icon-arrow__icon.expanded.open{transform:rotate(0)!important}.menu-item__dropdown.collapsed{background-color:#fafafa;border:1px solid #ddd;box-shadow:#0000001a 0 10px 15px -3px,#0000000d 0 4px 6px -2px;border-radius:4px;width:180px;max-width:180px;padding:4px;z-index:1200}.menu-item__dropdown,.menu-item__dropdown>*{margin-top:4px}.menu-item__dropdown.expanded.menu-item__dropdown--close{margin-top:0;transition:margin-top .3s}.menu-item__dropdown:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown.collapsed .menu-item__link{height:40px}.menu-item__dropdown.collapsed .menu-item__link.level-1{height:48px}.menu-item__dropdown.collapsed.level-1{width:auto;max-width:unset;box-shadow:none;border:none;padding:0;background-color:unset}.menu-item__dropdown.expanded{overflow:hidden}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:50%;background-color:transparent;transition:background-color .3s ease;border:none}.icon-btn:hover{background-color:var(--btn-bg-hover)}.simplebar-scrollbar:before{background-color:#0000002d}.side-bar__menu.collapsed .simplebar-track.simplebar-vertical{display:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}
66
+ */var wl=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Rb=/\\([\u000b\u0020-\u00ff])/g,Ab=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,Ob=_b;function _b(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?Mb(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var n=t.indexOf(";"),r=n!==-1?t.slice(0,n).trim():t.trim();if(!Ab.test(r))throw new TypeError("invalid media type");var i=new jb(r.toLowerCase());if(n!==-1){var o,s,a;for(wl.lastIndex=n;s=wl.exec(t);){if(s.index!==n)throw new TypeError("invalid parameter format");n+=s[0].length,o=s[1].toLowerCase(),a=s[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(Rb,"$1"))),i.parameters[o]=a}if(n!==t.length)throw new TypeError("invalid parameter format")}return i}function Mb(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function jb(e){this.parameters=Object.create(null),this.type=e}var Rt=new Map,Gf=function(t){return t.cloneNode(!0)},Sl=function(){return window.location.protocol==="file:"},Xf=function(t,n,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){try{if(!/\.svg/i.test(t)&&i.readyState===2){var o=i.getResponseHeader("Content-Type");if(!o)throw new Error("Content type not found");var s=Ob(o).type;if(!(s==="image/svg+xml"||s==="text/plain"))throw new Error("Invalid content type: ".concat(s))}if(i.readyState===4){if(i.status===404||i.responseXML===null)throw new Error(Sl()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+t);if(i.status===200||Sl()&&i.status===0)r(null,i);else throw new Error("There was a problem injecting the SVG: "+i.status+" "+i.statusText)}}catch(a){if(i.abort(),a instanceof Error)r(a,i);else throw a}},i.open("GET",t),i.withCredentials=n,i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()},Qe={},El=function(t,n){Qe[t]=Qe[t]||[],Qe[t].push(n)},Vb=function(t){for(var n=function(s,a){setTimeout(function(){if(Array.isArray(Qe[t])){var l=Rt.get(t),u=Qe[t][s];l instanceof SVGSVGElement&&u(null,Gf(l)),l instanceof Error&&u(l),s===Qe[t].length-1&&delete Qe[t]}},0)},r=0,i=Qe[t].length;r<i;r++)n(r)},Lb=function(t,n,r){if(Rt.has(t)){var i=Rt.get(t);if(i===void 0){El(t,r);return}if(i instanceof SVGSVGElement){r(null,Gf(i));return}}Rt.set(t,void 0),El(t,r),Xf(t,n,function(o,s){var a;o?Rt.set(t,o):((a=s.responseXML)===null||a===void 0?void 0:a.documentElement)instanceof SVGSVGElement&&Rt.set(t,s.responseXML.documentElement),Vb(t)})},Fb=function(t,n,r){Xf(t,n,function(i,o){var s;i?r(i):((s=o.responseXML)===null||s===void 0?void 0:s.documentElement)instanceof SVGSVGElement&&r(null,o.responseXML.documentElement)})},Db=0,Ib=function(){return++Db},Pe=[],Cl={},Nb="http://www.w3.org/2000/svg",wi="http://www.w3.org/1999/xlink",kl=function(t,n,r,i,o,s,a){var l=t.getAttribute("data-src")||t.getAttribute("src");if(!l){a(new Error("Invalid data-src or src attribute"));return}if(Pe.indexOf(t)!==-1){Pe.splice(Pe.indexOf(t),1),t=null;return}Pe.push(t),t.setAttribute("src","");var u=i?Lb:Fb;u(l,o,function(f,c){if(!c){Pe.splice(Pe.indexOf(t),1),t=null,a(f);return}var d=t.getAttribute("id");d&&c.setAttribute("id",d);var h=t.getAttribute("title");h&&c.setAttribute("title",h);var p=t.getAttribute("width");p&&c.setAttribute("width",p);var g=t.getAttribute("height");g&&c.setAttribute("height",g);var y=Array.from(new Set(bi(bi(bi([],(c.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(t.getAttribute("class")||"").split(" "),!0))).join(" ").trim();c.setAttribute("class",y);var v=t.getAttribute("style");v&&c.setAttribute("style",v),c.setAttribute("data-src",l);var b=[].filter.call(t.attributes,function(Q){return/^data-\w[\w-]*$/.test(Q.name)});if(Array.prototype.forEach.call(b,function(Q){Q.name&&Q.value&&c.setAttribute(Q.name,Q.value)}),r){var x={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},S,E,k,T,P;Object.keys(x).forEach(function(Q){S=Q,k=x[Q],E=c.querySelectorAll(S+"[id]");for(var We=function(Et,Ur){T=E[Et].id,P=T+"-"+Ib();var at;Array.prototype.forEach.call(k,function(Wr){at=c.querySelectorAll("["+Wr+'*="'+T+'"]');for(var En=0,ed=at.length;En<ed;En++){var Qo=at[En].getAttribute(Wr);Qo&&!Qo.match(new RegExp('url\\("?#'+T+'"?\\)'))||at[En].setAttribute(Wr,"url(#"+P+")")}});for(var Le=c.querySelectorAll("[*|href]"),Ct=[],kt=0,Ut=Le.length;kt<Ut;kt++){var lt=Le[kt].getAttributeNS(wi,"href");lt&&lt.toString()==="#"+E[Et].id&&Ct.push(Le[kt])}for(var Ee=0,Zo=Ct.length;Ee<Zo;Ee++)Ct[Ee].setAttributeNS(wi,"href","#"+P);E[Et].id=P},wt=0,D=E.length;wt<D;wt++)We(wt)})}c.removeAttribute("xmlns:a");for(var _=c.querySelectorAll("script"),H=[],z,$,q=0,X=_.length;q<X;q++)$=_[q].getAttribute("type"),(!$||$==="application/ecmascript"||$==="application/javascript"||$==="text/javascript")&&(z=_[q].innerText||_[q].textContent,z&&H.push(z),c.removeChild(_[q]));if(H.length>0&&(n==="always"||n==="once"&&!Cl[l])){for(var Z=0,G=H.length;Z<G;Z++)new Function(H[Z])(window);Cl[l]=!0}var Te=c.querySelectorAll("style");if(Array.prototype.forEach.call(Te,function(Q){Q.textContent+=""}),c.setAttribute("xmlns",Nb),c.setAttribute("xmlns:xlink",wi),s(c),!t.parentNode){Pe.splice(Pe.indexOf(t),1),t=null,a(new Error("Parent node is null"));return}t.parentNode.replaceChild(c,t),Pe.splice(Pe.indexOf(t),1),t=null,a(null,c)})},Bb=function(t,n){var r=n===void 0?{}:n,i=r.afterAll,o=i===void 0?function(){}:i,s=r.afterEach,a=s===void 0?function(){}:s,l=r.beforeEach,u=l===void 0?function(){}:l,f=r.cacheRequests,c=f===void 0?!0:f,d=r.evalScripts,h=d===void 0?"never":d,p=r.httpRequestWithCredentials,g=p===void 0?!1:p,y=r.renumerateIRIElements,v=y===void 0?!0:y;if(t&&"length"in t)for(var b=0,x=0,S=t.length;x<S;x++)kl(t[x],h,v,c,g,u,function(E,k){a(E,k),t&&"length"in t&&t.length===++b&&o(b)});else t?kl(t,h,v,c,g,u,function(E,k){a(E,k),o(1),t=null}):o(0)},$b=function(t){var n=(t==null?void 0:t.ownerDocument)||document;return n.defaultView||window},zb=function(t,n){for(var r in t)if(!(r in n))return!0;for(var i in n)if(t[i]!==n[i])return!0;return!1},Ub=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Vn="http://www.w3.org/2000/svg",Tl="http://www.w3.org/1999/xlink",Yo=function(e){qf(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(a){r.reactWrapper=a},r}var n=t.prototype;return n.renderSVG=function(){var i=this;if(this.reactWrapper instanceof $b(this.reactWrapper).Node){var o=this.props,s=o.desc,a=o.evalScripts,l=o.httpRequestWithCredentials,u=o.renumerateIRIElements,f=o.src,c=o.title,d=o.useRequestCache,h=this.props.onError,p=this.props.beforeInjection,g=this.props.afterInjection,y=this.props.wrapper,v,b;y==="svg"?(v=document.createElementNS(Vn,y),v.setAttribute("xmlns",Vn),v.setAttribute("xmlns:xlink",Tl),b=document.createElementNS(Vn,y)):(v=document.createElement(y),b=document.createElement(y)),v.appendChild(b),b.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(v);var x=function(T){if(i.removeSVG(),!i._isMounted){h(T);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){h(T)})},S=function(T,P){if(T){x(T);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{g(P)}catch(_){x(_)}})},E=function(T){if(T.setAttribute("role","img"),s){var P=T.querySelector(":scope > desc");P&&T.removeChild(P);var _=document.createElement("desc");_.innerHTML=s,T.prepend(_)}if(c){var H=T.querySelector(":scope > title");H&&T.removeChild(H);var z=document.createElement("title");z.innerHTML=c,T.prepend(z)}try{p(T)}catch($){x($)}};Bb(b,{afterEach:S,beforeEach:E,cacheRequests:d,evalScripts:a,httpRequestWithCredentials:l,renumerateIRIElements:u})}},n.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(i){var o=this;zb(It({},i),this.props)&&this.setState(function(){return o.initialState},function(){o.removeSVG(),o.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var o=i.fallback;i.httpRequestWithCredentials;var s=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var a=i.wrapper,l=Ko(i,Ub),u=a;return m.reactExports.createElement(u,It({},l,{ref:this.refCallback},a==="svg"?{xmlns:Vn,xmlnsXlink:Tl}:{}),this.state.isLoading&&s&&m.reactExports.createElement(s,null),this.state.hasError&&o&&m.reactExports.createElement(o,null))},t}(m.reactExports.Component);Yo.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Yo.propTypes={afterInjection:K.func,beforeInjection:K.func,desc:K.string,evalScripts:K.oneOf(["always","once","never"]),fallback:K.oneOfType([K.func,K.object,K.string]),httpRequestWithCredentials:K.bool,loading:K.oneOfType([K.func,K.object,K.string]),onError:K.func,renumerateIRIElements:K.bool,src:K.string.isRequired,title:K.string,useRequestCache:K.bool,wrapper:K.oneOf(["div","span","svg"])};function Wb(e){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,children:m.jsxRuntimeExports.jsx("path",{fill:"currenColor",d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})})}function Hb(e){const{children:t,parentRef:n,onlyChild:r}=e,[i,o]=m.reactExports.useState({top:0,left:0});return m.reactExports.useLayoutEffect(()=>{if(n.current){const s=n.current.getBoundingClientRect();o({top:s.top,left:s.left+s.width})}},[n]),r?t:m.reactDomExports.createPortal(m.jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:i.top,left:i.left,zIndex:1200},children:t}),n.current)}function qb(e){const{children:t,title:n,hasTooltip:r}=e,i=m.reactExports.useRef(),[o,s]=m.reactExports.useState(!1),[a,l]=m.reactExports.useState({top:0,left:0});return m.jsxRuntimeExports.jsxs("div",{className:"tooltip-item__wrapper",onMouseOver:()=>{if(s(!0),i.current){const u=i.current.getBoundingClientRect();l({top:u.top-20,left:u.left})}},onMouseLeave:()=>s(!1),ref:i,children:[m.jsxRuntimeExports.jsx("div",{children:t}),o&&r&&m.jsxRuntimeExports.jsx("div",{className:"tooltip-item__content",style:{position:"fixed",background:"#85858A",borderRadius:"4px",color:"#fff",padding:"4px 8px",top:a.top,left:a.left,zIndex:1400,fontSize:"10px",transition:"all 0.2s ease-in-out",animation:"fadeIn 0.2s ease-in-out",pointerEvents:"none"},children:n})]})}function Kf({item:e,level:t=0,...n}){var z,$,q,X;const{isActive:r,isCollapsed:i,expanded:o,toggleExpand:s}=n,a=`level-${t}`,l=i?"collapsed":"expanded",u=r(e.id)?"active":"",f=(Z,G=a)=>`${Z} ${G} ${l} ${u}`,c=!!((z=e.children)!=null&&z.length),[d,h]=m.reactExports.useState(!1),p=m.reactExports.useRef(),g=window.location.origin,y=e.path&&e.path.includes("http")?new URL(e.path):{origin:"",pathname:""},v=window.location.pathname.split("/")[1],b=y.pathname.split("/")[1],x=n.ssr||!g.includes("local")&&g!==y.origin||b!==v,S=c||t===0?"div":x?"a":Cb,E=e.path||"#",k=t+1,T=c&&!(i&&k>=2&&!d),P=i||t===0?void 0:`${t}rem`;console.log("hasDropdown:",T);const _=()=>{h(!0)},H=()=>{h(!1)};return m.jsxRuntimeExports.jsxs("div",{ref:p,className:f("menu-item__wrapper"),onMouseOver:_,onMouseOut:H,children:[m.jsxRuntimeExports.jsx(qb,{hasTooltip:i&&t===1,children:m.jsxRuntimeExports.jsxs(S,{to:E,href:E,className:f("menu-item__link"),style:{paddingLeft:P,transition:"all 0.3s",color:r(e.id)?(($=n.brandColors)==null?void 0:$.primary400)||Vt.primary400:void 0,backgroundColor:r(e.id)&&t===1?(q=n.brandColors)==null?void 0:q.primary200:void 0},onClick:Z=>{c&&(Z.preventDefault(),i||s(e.id))},children:[t!==0&&m.jsxRuntimeExports.jsx(Gb,{cls:f,item:e}),m.jsxRuntimeExports.jsx("span",{className:f("menu-item__label"),children:e.name}),c&&m.jsxRuntimeExports.jsx("div",{className:f("menu-item__icon-arrow__wrapper"),children:m.jsxRuntimeExports.jsx(Wb,{className:f(`menu-item__icon-arrow__icon ${o(e.id)?"open":"close"}`)})})]}),title:e.name}),T&&m.jsxRuntimeExports.jsx(Hb,{parentRef:p,onlyChild:!i||i&&k<2,children:m.jsxRuntimeExports.jsx(Jx.div,{className:f(`menu-item__dropdown ${o(e.id)?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${k}`),initial:{height:i||o(e.id)?"auto":0},animate:{height:i||o(e.id)?"auto":0},transition:{duration:.25},children:(X=e.children)==null?void 0:X.map(Z=>m.reactExports.createElement(Kf,{...n,key:Z.id,item:Z,level:k}))})})]})}function Gb({item:e,cls:t}){var s,a;const[n,r]=m.reactExports.useState(!e.icon),i=()=>{r(!0)},o=(s=e.icon)==null?void 0:s.endsWith(".svg");return m.jsxRuntimeExports.jsx("div",{className:t("menu-item__icon"),children:n?m.jsxRuntimeExports.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center"},children:(a=e.name.trim().at(0))==null?void 0:a.toUpperCase()}):o?m.jsxRuntimeExports.jsx(Yo,{src:e.icon,beforeInjection:l=>{l.setAttribute("style","margin: 0 auto;"),l.querySelectorAll("path").forEach(f=>{f.hasAttribute("fill")&&f.setAttribute("fill","currentColor"),f.hasAttribute("stroke")&&f.setAttribute("stroke","currentColor")})}}):m.jsxRuntimeExports.jsx("img",{src:e.icon||"/",alt:" ",style:{height:24,maxHeight:24},onError:i})})}function Xb(){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:m.jsxRuntimeExports.jsx("path",{d:"M21 18v2H3v-2h18zM6.596 3.903L8.01 5.318 4.828 8.5 8.01 11.68l-1.414 1.415L2 8.5l4.596-4.597zM21 11v2h-9v-2h9zm0-7v2h-9V4h9z"})})}function Kb(){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:m.jsxRuntimeExports.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function Yb(e){return m.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:m.jsxRuntimeExports.jsx("path",{fill:"#E01B00",fillRule:"evenodd",d:"M.179 2.875A2.375 2.375 0 012.554.5h3.393a1.018 1.018 0 010 2.036H2.554a.34.34 0 00-.34.339v14.25c0 .187.152.34.34.34h3.393a1.018 1.018 0 110 2.035H2.554a2.375 2.375 0 01-2.375-2.375V2.875zm14.167 6.107h-7.72a1.018 1.018 0 000 2.036h7.72l-2.673 2.673a1.018 1.018 0 101.44 1.44l4.41-4.411a1.018 1.018 0 000-1.44l-4.41-4.41a1.018 1.018 0 10-1.44 1.439l2.673 2.673z",clipRule:"evenodd"})})}const Jb=`.wrap-section{padding:0 8px;transition:all .3s}.wrap-section.collapsed{padding:0 4px}.side-bar{display:flex;flex-direction:column;max-width:18rem;height:calc(100vh - 64px);border-right:1px solid #ddd;background-color:#fafafa;transition:all .3s}.side-bar.expanded{width:17rem}.side-bar.collapsed{width:64px}.side-bar__wrap-btn-logout,.side-bar__btn-logout{margin:40px 0}.side-bar__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:1}.side-bar__logout-btn__text.collapsed{opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.side-bar__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px}.side-bar__wrapper-toggle-btn.collapsed{justify-content:center;width:100%}.side-bar__toggle-btn{margin-top:-6px;color:#85858a}.side-bar__logout-btn{width:100%;text-align:left;display:flex;flex-direction:row;align-items:center;padding:8px 16px 8px 18.6665px;min-height:48px;border-radius:.375rem;overflow:hidden;transition:all .3s ease-in-out}.side-bar__logout-btn:hover{background-color:#919eab14}.side-bar__icon-logout{flex-shrink:0}.menu-item__wrapper{display:flex;flex-direction:column;position:relative;width:100%}.menu-item__link{display:flex;flex-direction:row;border-radius:.375rem;align-items:center;padding:.5rem;position:relative;height:48px;cursor:pointer;color:#85858a}.menu-item__link:hover{background-color:#919eab14}.menu-item__link.collapsed.level-1{padding-left:calc(.5rem + 7.665px)!important}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-2,.menu-item__link.active.level-3,.menu-item__link.active.level-4,.menu-item__link.active.level-5,.menu-item__link.active.level-6,.menu-item__link.active.level-7,.menu-item__link.active.level-8,.menu-item__link.active.level-9,.menu-item__link.active.level-10{background-color:inherit;color:inherit}.menu-item__link.active.level-2:hover,.menu-item__link.active.level-3:hover,.menu-item__link.active.level-4:hover,.menu-item__link.active.level-5:hover,.menu-item__link.active.level-6:hover,.menu-item__link.active.level-7:hover,.menu-item__link.active.level-8:hover,.menu-item__link.active.level-9:hover,.menu-item__link.active.level-10:hover{background-color:#919eab14}.menu-item__link.level-0{height:37px}.menu-item__link.menu-item__link.collapsed.level-0{padding:0;height:0;transition:all .15s}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center}.menu-item__icon.collapsed.level-1>*{margin:0 auto}.menu-item__label{font-size:.875rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;flex-shrink:1;margin-left:12px;padding-right:12px;color:#292929;opacity:1}.menu-item__label.level-1.collapsed{text-overflow:unset}.menu-item__label.active{color:inherit}.menu-item__label.collapsed{margin-left:8px;font-size:.75rem;line-height:1rem}.menu-item__label.collapsed.level-0,.menu-item__label.collapsed.level-1{font-size:.875rem;opacity:0;transition-delay:.15s}.menu-item__label.level-0{color:#85858a;margin-left:0}.menu-item__icon-arrow__wrapper{display:grid;place-items:center;position:absolute;top:50%;transform:translateY(-50%);right:0}.menu-item__icon-arrow__wrapper.expanded{right:4px}.menu-item__icon-arrow__wrapper.level-0.collapsed{display:none}.menu-item__icon-arrow__icon{transition:all .3s!important;transform:rotate(-90deg)!important}.menu-item__icon-arrow__icon.active{color:inherit}.menu-item__icon-arrow__icon.expanded.open{transform:rotate(0)!important}.menu-item__dropdown.collapsed{background-color:#fafafa;border:1px solid #ddd;box-shadow:#0000001a 0 10px 15px -3px,#0000000d 0 4px 6px -2px;border-radius:4px;width:180px;max-width:180px;padding:4px;z-index:1200}.menu-item__dropdown,.menu-item__dropdown>*{margin-top:4px}.menu-item__dropdown.expanded.menu-item__dropdown--close{margin-top:0;transition:margin-top .3s}.menu-item__dropdown:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown.collapsed .menu-item__link{height:40px}.menu-item__dropdown.collapsed .menu-item__link.level-1{height:48px}.menu-item__dropdown.collapsed.level-1{width:auto;max-width:unset;box-shadow:none;border:none;padding:0;background-color:unset}.menu-item__dropdown.expanded{overflow:hidden}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:50%;background-color:transparent;transition:background-color .3s ease;border:none}.icon-btn:hover{background-color:var(--btn-bg-hover)}.simplebar-scrollbar:before{background-color:#0000002d}.side-bar__menu.collapsed .simplebar-track.simplebar-vertical{display:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}
67
67
  `,Pl=localStorage.getItem("isCollapsed");function Zb(e){const{baseUrl:t,menuPath:n}=e,r=zr(),[i,o]=m.reactExports.useState([]),[s,a]=m.reactExports.useState(Pl===null?!0:Pl==="true"),[l,u]=m.reactExports.useState({}),f=Jo(i),[c,d]=m.reactExports.useState(window.location.href);m.reactExports.useEffect(()=>{d(window.location.href)},[r]);const h=Yf(f,c).filter(E=>E.parentKey!==0);console.log("matchPaths:",c,r,h);const p=E=>{u({...l,[E]:!l[E]})},g=()=>{a(!s),localStorage.setItem("isCollapsed",JSON.stringify(!s))};m.reactExports.useLayoutEffect(()=>{(async()=>{var k,T;try{const _=t+(n||"/global-menu-config/api/v1/menu-items/user"),{data:H}=await Kl.get(_,{withCredentials:!0});let z=H.map(q=>({...q,parentKey:0}));z=Zf(z),e.replacePath&&(z=Jf(z,e.replacePath));const $=ew(z);u($),o(z)}catch(P){console.log(P),hc(((T=(k=P.response)==null?void 0:k.data)==null?void 0:T.errorMessage)||"Have error when get menu items")}})()},[t,n,e.replacePath]);const[y,v]=m.reactExports.useState(!1),b=s?"collapsed":"expanded",x=E=>`${E} ${b}`,S=m.reactExports.useRef(null);return m.jsxRuntimeExports.jsxs("div",{className:x("side-bar"),children:[m.jsxRuntimeExports.jsx("div",{className:x("wrap-section side-bar__wrapper-toggle-btn"),children:m.jsxRuntimeExports.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:g,children:s?m.jsxRuntimeExports.jsx(Kb,{}):m.jsxRuntimeExports.jsx(Xb,{})})}),m.jsxRuntimeExports.jsx(ou,{ref:S,className:x("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:i.map(E=>{const k=T=>h.some(P=>P.id===T);return m.jsxRuntimeExports.jsx(Kf,{item:E,isActive:k,isCollapsed:s,expanded:T=>l[T],toggleExpand:p,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors},E.id)})}),m.jsxRuntimeExports.jsxs("div",{className:x("wrap-section side-bar__wrap-btn-logout"),children:[m.jsxRuntimeExports.jsxs("button",{className:x("side-bar__logout-btn"),onClick:()=>v(!0),children:[m.jsxRuntimeExports.jsx(Yb,{className:x("side-bar__icon-logout")}),m.jsxRuntimeExports.jsx("span",{className:x("side-bar__logout-btn__text"),children:"Logout"})]}),m.jsxRuntimeExports.jsx(su,{isOpen:y,onClose:()=>v(!1),onConfirm:()=>e.logout?e.logout():rp(e.baseUrl)})]})]})}function Jo(e){let t=[];for(const n of e)t.push(n),n.children&&(t=t.concat(Jo(n.children)));return t}function Qb(e,t){const n=new URL(e).searchParams,r=new URL(t).searchParams;return Array.from(r).filter(([i,o])=>o===n.get(i)).length}function Yf(e,t){const n=new URL(t),r=e.filter(s=>s.path&&s.path.includes("http")).map(s=>({item:s,itemUrl:new URL(s.path),matchingParamsCount:Qb(t,s.path)})).sort((s,a)=>{const l=new URL(s.itemUrl).searchParams,u=new URL(a.itemUrl).searchParams;return Array.from(l).length-Array.from(u).length}).filter(({itemUrl:s})=>n.origin===s.origin).filter(({itemUrl:s})=>n.pathname===s.pathname).sort((s,a)=>a.matchingParamsCount-s.matchingParamsCount);let i=r.length>0?r[0].item:null;console.log("matchingItems:",r);let o=[];for(;i;)o=[i,...o],i=e.find(s=>s.id===(i==null?void 0:i.parentKey))||null;return o}function Jf(e,t){return e.map(n=>(n.path&&(n.path=t(n.path)),n.children&&n.children.length>0&&(n.children=Jf(n.children,t)),n))}function Zf(e){return e.map(n=>n.path&&!n.path.includes("http")&&n.path.includes("/")?{...n,path:window.location.origin+n.path}:(n.children&&(n.children=Zf(n.children)),n))}function ew(e){const t=Jo(e),n=Yf(t,window.location.href),r={};return n.forEach(i=>r[i.id]=!0),t.forEach(i=>{i.parentKey||(r[i.id]=!0)}),r}function Qf(e){return m.jsxRuntimeExports.jsx(uc,{styles:[ep,Jb],style:{position:"sticky",zIndex:20},children:m.jsxRuntimeExports.jsx(Zb,{...e})})}function tw(e){return m.jsxRuntimeExports.jsx(wb,{children:m.jsxRuntimeExports.jsx(Qf,{...e,ssr:!0})})}{const e=m.s(tw,{props:{baseUrl:"string",menuPath:"string",logout:"function",replacePath:"function",ssr:"boolean",brandColors:"json"}});customElements.define("global-menu",e)}exports.ERROR_MESSAGE=tp;exports.GlobalMenu=Qf;exports.LogoutConfirmModal=su;exports.ShadowDomWrapper=uc;exports._extends=It;exports._extends$1=Pb;exports._inheritsLoose=qf;exports._objectWithoutPropertiesLoose=Ko;exports.axios=Kl;exports.color=Vt;exports.login=np;exports.notify=Ng;exports.objectWithoutPropertiesLoose=Tb;exports.pushError=hc;