@ukpc-lib/react 0.12.1-dev.8 → 0.12.1-dev.9
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.
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/{index.esm2017-B86w0LQi.js → index.esm2017-D13q7k3i.js} +1 -0
- package/dist/{index.esm2017-DMgzbuon.cjs → index.esm2017-DIs_XI9p.cjs} +1 -1
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +1 -1
- package/package.json +1 -1
- package/web-components-bundle/favorite-menu/index.js +1 -1
- package/web-components-bundle/global-menu/index.js +1 -1
- package/web-components-bundle/global-topbar/index.js +1 -1
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-CaxjbvSW.js → index-DSZn86FM.js} +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),T=require("react"),m=require("../index.esm2017-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),T=require("react"),m=require("../index.esm2017-DIs_XI9p.cjs"),X=require("moment"),N=require("@mui/material");require("axios");require("@r2wc/react-to-web-component");const pr=require("react-router-dom");require("react-query");require("react-dom");function $o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const A=$o(T),Ao=e=>{var n,o;const{tabs:t}=e,r=s=>{e.setCurrentTab(s.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
|
|
2
2
|
.tab-title {
|
|
3
3
|
min-width: 90px;
|
|
4
4
|
padding: 5px 16px;
|
package/dist/components/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ii, { jsxs as M, Fragment as le, jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import * as N from "react";
|
|
3
3
|
import ye, { useState as W, useContext as $e, useEffect as q, useRef as Se, useCallback as Mt, forwardRef as ai, createElement as sr, PureComponent as si } from "react";
|
|
4
|
-
import { c as ne, a as gt, C as Le, t as ct, p as li, L as Xr, u as ci, b as ui, S as qn, d as di, e as fi, Q as Zn, f as Et, g as Xn, h as hi, s as Ct, _ as B, P as R, i as pe, j as mi, o as pi, k as Ne, l as gi, m as yi, n as Jr, q as Ot, r as Qr, I as vi, v as bi, w as en, D as xi, x as Jn, y as Qn, z as Si, A as wi, B as _i } from "../index.esm2017-
|
|
5
|
-
import { H as au, G as su, K as lu, E as cu, F as uu, J as du } from "../index.esm2017-
|
|
4
|
+
import { c as ne, a as gt, C as Le, t as ct, p as li, L as Xr, u as ci, b as ui, S as qn, d as di, e as fi, Q as Zn, f as Et, g as Xn, h as hi, s as Ct, _ as B, P as R, i as pe, j as mi, o as pi, k as Ne, l as gi, m as yi, n as Jr, q as Ot, r as Qr, I as vi, v as bi, w as en, D as xi, x as Jn, y as Qn, z as Si, A as wi, B as _i } from "../index.esm2017-D13q7k3i.js";
|
|
5
|
+
import { H as au, G as su, K as lu, E as cu, F as uu, J as du } from "../index.esm2017-D13q7k3i.js";
|
|
6
6
|
import Q from "moment";
|
|
7
7
|
import { Stack as me, Dialog as Ei, DialogTitle as Ci, Typography as Ce, DialogContent as Ti, DialogActions as Ii, Button as pr, Box as ki, ClickAwayListener as Mi, TextField as eo, IconButton as Oi, CircularProgress as $i, Fade as Ai, Paper as Ni, Checkbox as Ri, Breadcrumbs as Pi } from "@mui/material";
|
|
8
8
|
import "axios";
|
|
@@ -30153,6 +30153,7 @@ function b6(t) {
|
|
|
30153
30153
|
return /* @__PURE__ */ Ve(
|
|
30154
30154
|
ZD,
|
|
30155
30155
|
{
|
|
30156
|
+
isInternalApp: t.isInternalApp,
|
|
30156
30157
|
isActive: de,
|
|
30157
30158
|
isCollapsed: p,
|
|
30158
30159
|
replacePath: t.replacePath,
|
|
@@ -133,7 +133,7 @@ Previous: %s
|
|
|
133
133
|
Incoming: %s`,Ki,"["+v.join(", ")+"]","["+l.join(", ")+"]");for(var f=0;f<l.length&&f<v.length;f++)if(!qt(v[f],l[f]))return!1;return!0}function Bu(){if(So>0)throw new Error("Rendered more hooks than during the previous render");return{memoizedState:null,queue:null,next:null}}function xi(){return Zt===null?Ws===null?(hs=!1,Ws=Zt=Bu()):(hs=!0,Zt=Ws):Zt.next===null?(hs=!1,Zt=Zt.next=Bu()):(hs=!0,Zt=Zt.next),Zt}function $u(v,l){bi=l,Sa=v,$r=!1,ti=0}function Ys(v,l,f,g){for(;tl;)tl=!1,ti=0,So+=1,Zt=null,f=v(l,g);return Vu(),f}function Vr(){var v=ti!==0;return v}function Vu(){$r=!1,bi=null,Sa=null,tl=!1,Ws=null,So=0,wi=null,Zt=null}function Hu(v){return $r&&i("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),xa(v)}function Uu(v){return Ki="useContext",zs(),xa(v)}function Gs(v,l){return typeof l=="function"?l(v):l}function ps(v){return Ki="useState",Wu(Gs,v)}function Wu(v,l,f){if(v!==Gs&&(Ki="useReducer"),bi=zs(),Zt=xi(),hs){var g=Zt.queue,x=g.dispatch;if(wi!==null){var R=wi.get(g);if(R!==void 0){wi.delete(g);var B=Zt.memoizedState,z=R;do{var ne=z.action;$r=!0,B=v(B,ne),$r=!1,z=z.next}while(z!==null);return Zt.memoizedState=B,[B,x]}}return[Zt.memoizedState,x]}else{$r=!0;var we;v===Gs?we=typeof l=="function"?l():l:we=f!==void 0?f(l):l,$r=!1,Zt.memoizedState=we;var je=Zt.queue={last:null,dispatch:null},Ge=je.dispatch=Vc.bind(null,bi,je);return[Zt.memoizedState,Ge]}}function $c(v,l){bi=zs(),Zt=xi();var f=l===void 0?null:l;if(Zt!==null){var g=Zt.memoizedState;if(g!==null&&f!==null){var x=g[1];if(Bc(f,x))return g[0]}}$r=!0;var R=v();return $r=!1,Zt.memoizedState=[R,f],R}function Bl(v){bi=zs(),Zt=xi();var l=Zt.memoizedState;if(l===null){var f={current:v};return Object.seal(f),Zt.memoizedState=f,f}else return l}function Gf(v,l){Ki="useLayoutEffect",i("useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.")}function Vc(v,l,f){if(So>=ju)throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(v===bi){tl=!0;var g={action:f,next:null};wi===null&&(wi=new Map);var x=wi.get(l);if(x===void 0)wi.set(l,g);else{for(var R=x;R.next!==null;)R=R.next;R.next=g}}}function fr(v,l){return $c(function(){return v},l)}function zu(v,l,f){return zs(),l(v._source)}function Hc(v,l,f){if(f===void 0)throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");return f()}function Si(v){return zs(),v}function $l(){throw new Error("startTransition cannot be called during server rendering.")}function Ta(){return zs(),[!1,$l]}function gs(){var v=Sa,l=Ho(v.treeContext),f=qs;if(f===null)throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");var g=ti++;return jn(f,l,g)}function nl(){}var rr={readContext:Hu,useContext:Uu,useMemo:$c,useReducer:Wu,useRef:Bl,useState:ps,useInsertionEffect:nl,useLayoutEffect:Gf,useCallback:fr,useImperativeHandle:nl,useEffect:nl,useDebugValue:nl,useDeferredValue:Si,useTransition:Ta,useId:gs,useMutableSource:zu,useSyncExternalStore:Hc},qs=null;function Vl(v){qs=v}function Ca(v){try{var l="",f=v;do{switch(f.tag){case 0:l+=Xi(f.type,null,null);break;case 1:l+=ma(f.type,null,null);break;case 2:l+=Ic(f.type,null,null);break}f=f.parent}while(f);return l}catch(g){return`
|
|
134
134
|
Error generating stack: `+g.message+`
|
|
135
135
|
`+g.stack}}var Hl=n.ReactCurrentDispatcher,Ea=n.ReactDebugCurrentFrame,Ul=0,To=1,Wl=2,Xs=3,Uc=4,rl=0,ka=1,Da=2,Yu=12800;function Wc(v){return console.error(v),null}function Ks(){}function zl(v,l,f,g,x,R,B,z,ne){var we=[],je=new Set,Ge={destination:null,responseState:l,progressiveChunkSize:g===void 0?Yu:g,status:rl,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:je,pingedTasks:we,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:x===void 0?Wc:x,onAllReady:R===void 0?Ks:R,onShellReady:B===void 0?Ks:B,onShellError:z===void 0?Ks:z,onFatalError:ne===void 0?Ks:ne},nt=il(Ge,0,null,f,!1,!1);nt.parentFlushed=!0;var xt=Wo(Ge,v,null,nt,je,Gn,Ml,Uf);return we.push(xt),Ge}function Uo(v,l){var f=v.pingedTasks;f.push(l),f.length===1&&a(function(){return Qu(v)})}function Yl(v,l){return{id:_i,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:l,errorDigest:null}}function Wo(v,l,f,g,x,R,B,z){v.allPendingTasks++,f===null?v.pendingRootTasks++:f.pendingTasks++;var ne={node:l,ping:function(){return Uo(v,ne)},blockedBoundary:f,blockedSegment:g,abortSet:x,legacyContext:R,context:B,treeContext:z};return ne.componentStack=null,x.add(ne),ne}function il(v,l,f,g,x,R){return{status:Ul,id:-1,index:l,parentFlushed:!1,chunks:[],children:[],formatContext:g,boundary:f,lastPushedText:x,textEmbedded:R}}var Zi=null;function Ji(){return Zi===null||Zi.componentStack===null?"":Ca(Zi.componentStack)}function Co(v,l){v.componentStack={tag:0,parent:v.componentStack,type:l}}function ol(v,l){v.componentStack={tag:1,parent:v.componentStack,type:l}}function ms(v,l){v.componentStack={tag:2,parent:v.componentStack,type:l}}function Qi(v){v.componentStack===null?i("Unexpectedly popped too many stack frames. This is a bug in React."):v.componentStack=v.componentStack.parent}var Pa=null;function Gl(v,l){{var f;typeof l=="string"?f=l:l&&typeof l.message=="string"?f=l.message:f=String(l);var g=Pa||Ji();Pa=null,v.errorMessage=f,v.errorComponentStack=g}}function sl(v,l){var f=v.onError(l);if(f!=null&&typeof f!="string")throw new Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof f+'" instead');return f}function Oa(v,l){var f=v.onShellError;f(l);var g=v.onFatalError;g(l),v.destination!==null?(v.status=Da,U(v.destination,l)):(v.status=ka,v.fatalError=l)}function zc(v,l,f){Co(l,"Suspense");var g=l.blockedBoundary,x=l.blockedSegment,R=f.fallback,B=f.children,z=new Set,ne=Yl(v,z),we=x.chunks.length,je=il(v,we,ne,x.formatContext,!1,!1);x.children.push(je),x.lastPushedText=!1;var Ge=il(v,0,null,x.formatContext,!1,!1);Ge.parentFlushed=!0,l.blockedBoundary=ne,l.blockedSegment=Ge;try{if(Ti(v,l,B),_n(Ge.chunks,v.responseState,Ge.lastPushedText,Ge.textEmbedded),Ge.status=To,bs(ne,Ge),ne.pendingTasks===0){Qi(l);return}}catch(xt){Ge.status=Uc,ne.forceClientRender=!0,ne.errorDigest=sl(v,xt),Gl(ne,xt)}finally{l.blockedBoundary=g,l.blockedSegment=x}var nt=Wo(v,R,g,je,z,l.legacyContext,l.context,l.treeContext);nt.componentStack=l.componentStack,v.pingedTasks.push(nt),Qi(l)}function Gu(v,l,f,g){Co(l,f);var x=l.blockedSegment,R=co(x.chunks,f,g,v.responseState,x.formatContext);x.lastPushedText=!1;var B=x.formatContext;x.formatContext=pi(B,f,g),Ti(v,l,R),x.formatContext=B,Mo(x.chunks,f),x.lastPushedText=!1,Qi(l)}function qu(v){return v.prototype&&v.prototype.isReactComponent}function Zs(v,l,f,g,x){var R={};$u(l,R);var B=f(g,x);return Ys(f,g,B,x)}function Xu(v,l,f,g,x){var R=f.render();f.props!==x&&(Xl||i("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",pn(g)||"a component"),Xl=!0);{var B=g.childContextTypes;if(B!=null){var z=l.legacyContext,ne=Au(f,g,z,B);l.legacyContext=ne,dr(v,l,R),l.legacyContext=z;return}}dr(v,l,R)}function ql(v,l,f,g){ms(l,f);var x=ls(f,l.legacyContext),R=xo(f,g,x);el(R,f,g,x),Xu(v,l,R,f,g),Qi(l)}var Bt={},al={},Ku={},Js={},Xl=!1,Yc={},Gc=!1,ni=!1,qc=!1;function Kl(v,l,f,g){var x;if(x=ls(f,l.legacyContext),ol(l,f),f.prototype&&typeof f.prototype.render=="function"){var R=pn(f)||"Unknown";Bt[R]||(i("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",R,R),Bt[R]=!0)}var B=Zs(v,l,f,g,x),z=Vr();if(typeof B=="object"&&B!==null&&typeof B.render=="function"&&B.$$typeof===void 0){var ne=pn(f)||"Unknown";al[ne]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",ne,ne,ne),al[ne]=!0)}if(typeof B=="object"&&B!==null&&typeof B.render=="function"&&B.$$typeof===void 0){{var we=pn(f)||"Unknown";al[we]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",we,we,we),al[we]=!0)}el(B,f,g,x),Xu(v,l,B,f,g)}else if(Zu(f),z){var je=l.treeContext,Ge=1,nt=0;l.treeContext=Fu(je,Ge,nt);try{dr(v,l,B)}finally{l.treeContext=je}}else dr(v,l,B);Qi(l)}function Zu(v){{if(v&&v.childContextTypes&&i("%s(...): childContextTypes cannot be defined on a function component.",v.displayName||v.name||"Component"),v.defaultProps!==void 0){var l=pn(v)||"Unknown";Yc[l]||(i("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",l),Yc[l]=!0)}if(typeof v.getDerivedStateFromProps=="function"){var f=pn(v)||"Unknown";Js[f]||(i("%s: Function components do not support getDerivedStateFromProps.",f),Js[f]=!0)}if(typeof v.contextType=="object"&&v.contextType!==null){var g=pn(v)||"Unknown";Ku[g]||(i("%s: Function components do not support contextType.",g),Ku[g]=!0)}}}function Ju(v,l){if(v&&v.defaultProps){var f=J({},l),g=v.defaultProps;for(var x in g)f[x]===void 0&&(f[x]=g[x]);return f}return l}function Xc(v,l,f,g,x){ol(l,f.render);var R=Zs(v,l,f.render,g,x),B=Vr();if(B){var z=l.treeContext,ne=1,we=0;l.treeContext=Fu(z,ne,we);try{dr(v,l,R)}finally{l.treeContext=z}}else dr(v,l,R);Qi(l)}function Hr(v,l,f,g,x){var R=f.type,B=Ju(R,g);Qs(v,l,R,B,x)}function vs(v,l,f,g){f._context===void 0?f!==f.Consumer&&(qc||(qc=!0,i("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):f=f._context;var x=g.children;typeof x!="function"&&i("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");var R=xa(f),B=x(R);dr(v,l,B)}function Ur(v,l,f,g){var x=f._context,R=g.value,B=g.children,z;z=l.context,l.context=Iu(x,R),dr(v,l,B),l.context=Bf(x),z!==l.context&&i("Popping the context provider did not return back to the original snapshot. This is a bug in React.")}function Kc(v,l,f,g,x){Co(l,"Lazy");var R=f._payload,B=f._init,z=B(R),ne=Ju(z,g);Qs(v,l,z,ne,x),Qi(l)}function Qs(v,l,f,g,x){if(typeof f=="function")if(qu(f)){ql(v,l,f,g);return}else{Kl(v,l,f,g);return}if(typeof f=="string"){Gu(v,l,f,g);return}switch(f){case Yn:case Vt:case K:case le:case Ce:{dr(v,l,g.children);return}case lt:{Co(l,"SuspenseList"),dr(v,l,g.children),Qi(l);return}case wt:throw new Error("ReactDOMServer does not yet support scope components.");case st:{zc(v,l,g);return}}if(typeof f=="object"&&f!==null)switch(f.$$typeof){case Le:{Xc(v,l,f,g,x);return}case rt:{Hr(v,l,f,g,x);return}case se:{Ur(v,l,f,g);return}case Re:{vs(v,l,f,g);return}case It:{Kc(v,l,f,g);return}}var R="";throw(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(R+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(f==null?f:typeof f)+"."+R))}function Zc(v,l){typeof Symbol=="function"&&v[Symbol.toStringTag]==="Generator"&&(Gc||i("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),Gc=!0),v.entries===l&&(ni||i("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ni=!0)}function dr(v,l,f){try{return Jc(v,l,f)}catch(g){throw typeof g=="object"&&g!==null&&typeof g.then=="function"||(Pa=Pa!==null?Pa:Ji()),g}}function Jc(v,l,f){if(l.node=f,typeof f=="object"&&f!==null){switch(f.$$typeof){case fe:{var g=f,x=g.type,R=g.props,B=g.ref;Qs(v,l,x,R,B);return}case Se:throw new Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.");case It:{var z=f,ne=z._payload,we=z._init,je;try{je=we(ne)}catch(eo){throw typeof eo=="object"&&eo!==null&&typeof eo.then=="function"&&Co(l,"Lazy"),eo}dr(v,l,je);return}}if(er(f)){Zl(v,l,f);return}var Ge=jr(f);if(Ge){Zc(f,Ge);var nt=Ge.call(f);if(nt){var xt=nt.next();if(!xt.done){var en=[];do en.push(xt.value),xt=nt.next();while(!xt.done);Zl(v,l,en);return}return}}var ir=Object.prototype.toString.call(f);throw new Error("Objects are not valid as a React child (found: "+(ir==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":ir)+"). If you meant to render a collection of children, use an array instead.")}if(typeof f=="string"){var Eo=l.blockedSegment;Eo.lastPushedText=On(l.blockedSegment.chunks,f,v.responseState,Eo.lastPushedText);return}if(typeof f=="number"){var ws=l.blockedSegment;ws.lastPushedText=On(l.blockedSegment.chunks,""+f,v.responseState,ws.lastPushedText);return}typeof f=="function"&&i("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}function Zl(v,l,f){for(var g=f.length,x=0;x<g;x++){var R=l.treeContext;l.treeContext=Fu(R,g,x);try{Ti(v,l,f[x])}finally{l.treeContext=R}}}function Jl(v,l,f){var g=l.blockedSegment,x=g.chunks.length,R=il(v,x,null,g.formatContext,g.lastPushedText,!0);g.children.push(R),g.lastPushedText=!1;var B=Wo(v,l.node,l.blockedBoundary,R,l.abortSet,l.legacyContext,l.context,l.treeContext);l.componentStack!==null&&(B.componentStack=l.componentStack.parent);var z=B.ping;f.then(z,z)}function Ti(v,l,f){var g=l.blockedSegment.formatContext,x=l.legacyContext,R=l.context,B=null;B=l.componentStack;try{return dr(v,l,f)}catch(z){if(Vu(),typeof z=="object"&&z!==null&&typeof z.then=="function"){Jl(v,l,z),l.blockedSegment.formatContext=g,l.legacyContext=x,l.context=R,fs(R),l.componentStack=B;return}else throw l.blockedSegment.formatContext=g,l.legacyContext=x,l.context=R,fs(R),l.componentStack=B,z}}function Qc(v,l,f,g){var x=sl(v,g);if(l===null?Oa(v,g):(l.pendingTasks--,l.forceClientRender||(l.forceClientRender=!0,l.errorDigest=x,Gl(l,g),l.parentFlushed&&v.clientRenderedBoundaries.push(l))),v.allPendingTasks--,v.allPendingTasks===0){var R=v.onAllReady;R()}}function ys(v){var l=this,f=v.blockedBoundary,g=v.blockedSegment;g.status=Xs,ea(l,f,g)}function Ql(v,l,f){var g=v.blockedBoundary,x=v.blockedSegment;if(x.status=Xs,g===null)l.allPendingTasks--,l.status!==Da&&(l.status=Da,l.destination!==null&&I(l.destination));else{if(g.pendingTasks--,!g.forceClientRender){g.forceClientRender=!0;var R=f===void 0?new Error("The render was aborted by the server without a reason."):f;g.errorDigest=l.onError(R);{var B="The server did not finish this Suspense boundary: ";R&&typeof R.message=="string"?R=B+R.message:R=B+String(R);var z=Zi;Zi=v;try{Gl(g,R)}finally{Zi=z}}g.parentFlushed&&l.clientRenderedBoundaries.push(g)}if(g.fallbackAbortableTasks.forEach(function(we){return Ql(we,l,f)}),g.fallbackAbortableTasks.clear(),l.allPendingTasks--,l.allPendingTasks===0){var ne=l.onAllReady;ne()}}}function bs(v,l){if(l.chunks.length===0&&l.children.length===1&&l.children[0].boundary===null){var f=l.children[0];f.id=l.id,f.parentFlushed=!0,f.status===To&&bs(v,f)}else{var g=v.completedSegments;g.push(l)}}function ea(v,l,f){if(l===null){if(f.parentFlushed){if(v.completedRootSegment!==null)throw new Error("There can only be one root segment. This is a bug in React.");v.completedRootSegment=f}if(v.pendingRootTasks--,v.pendingRootTasks===0){v.onShellError=Ks;var g=v.onShellReady;g()}}else if(l.pendingTasks--,!l.forceClientRender){if(l.pendingTasks===0)f.parentFlushed&&f.status===To&&bs(l,f),l.parentFlushed&&v.completedBoundaries.push(l),l.fallbackAbortableTasks.forEach(ys,v),l.fallbackAbortableTasks.clear();else if(f.parentFlushed&&f.status===To){bs(l,f);var x=l.completedSegments;x.length===1&&l.parentFlushed&&v.partialBoundaries.push(l)}}if(v.allPendingTasks--,v.allPendingTasks===0){var R=v.onAllReady;R()}}function qf(v,l){var f=l.blockedSegment;if(f.status===Ul){fs(l.context);var g=null;g=Zi,Zi=l;try{dr(v,l,l.node),_n(f.chunks,v.responseState,f.lastPushedText,f.textEmbedded),l.abortSet.delete(l),f.status=To,ea(v,l.blockedBoundary,f)}catch(R){if(Vu(),typeof R=="object"&&R!==null&&typeof R.then=="function"){var x=l.ping;R.then(x,x)}else l.abortSet.delete(l),f.status=Uc,Qc(v,l.blockedBoundary,f,R)}finally{Zi=g}}}function Qu(v){if(v.status!==Da){var l=Lc(),f=Hl.current;Hl.current=rr;var g;g=Ea.getCurrentStack,Ea.getCurrentStack=Ji;var x=qs;Vl(v.responseState);try{var R=v.pingedTasks,B;for(B=0;B<R.length;B++){var z=R[B];qf(v,z)}R.splice(0,B),v.destination!==null&&Ii(v,v.destination)}catch(ne){sl(v,ne),Oa(v,ne)}finally{Vl(x),Hl.current=f,Ea.getCurrentStack=g,f===rr&&fs(l)}}}function ll(v,l,f){switch(f.parentFlushed=!0,f.status){case Ul:{var g=f.id=v.nextSegmentId++;return f.lastPushedText=!1,f.textEmbedded=!1,cr(l,v.responseState,g)}case To:{f.status=Wl;for(var x=!0,R=f.chunks,B=0,z=f.children,ne=0;ne<z.length;ne++){for(var we=z[ne];B<we.index;B++)m(l,R[B]);x=ul(v,l,we)}for(;B<R.length-1;B++)m(l,R[B]);return B<R.length&&(x=T(l,R[B])),x}default:throw new Error("Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.")}}function ul(v,l,f){var g=f.boundary;if(g===null)return ll(v,l,f);if(g.parentFlushed=!0,g.forceClientRender)return Be(l,v.responseState,g.errorDigest,g.errorMessage,g.errorComponentStack),ll(v,l,f),Et(l,v.responseState);if(g.pendingTasks>0){g.rootSegmentID=v.nextSegmentId++,g.completedSegments.length>0&&v.partialBoundaries.push(g);var x=g.id=nn(v.responseState);return xe(l,v.responseState,x),ll(v,l,f),Tt(l,v.responseState)}else{if(g.byteSize>v.progressiveChunkSize)return g.rootSegmentID=v.nextSegmentId++,v.completedBoundaries.push(g),xe(l,v.responseState,g.id),ll(v,l,f),Tt(l,v.responseState);_e(l,v.responseState);var R=g.completedSegments;if(R.length!==1)throw new Error("A previously unvisited boundary must have exactly one root segment. This is a bug in React.");var B=R[0];return ul(v,l,B),it(l,v.responseState)}}function ec(v,l,f){return _l(l,v.responseState,f.id,f.errorDigest,f.errorMessage,f.errorComponentStack)}function eu(v,l,f){return St(l,v.responseState,f.formatContext,f.id),ul(v,l,f),vt(l,f.formatContext)}function tc(v,l,f){for(var g=f.completedSegments,x=0;x<g.length;x++){var R=g[x];Wr(v,l,f,R)}return g.length=0,mo(l,v.responseState,f.id,f.rootSegmentID)}function ef(v,l,f){for(var g=f.completedSegments,x=0;x<g.length;x++){var R=g[x];if(!Wr(v,l,f,R))return x++,g.splice(0,x),!1}return g.splice(0,x),!0}function Wr(v,l,f,g){if(g.status===Wl)return!0;var x=g.id;if(x===-1){var R=g.id=f.rootSegmentID;if(R===-1)throw new Error("A root segment ID must have been assigned by now. This is a bug in React.");return eu(v,l,g)}else return eu(v,l,g),za(l,v.responseState,x)}function Ii(v,l){w();try{var f=v.completedRootSegment;f!==null&&v.pendingRootTasks===0&&(ul(v,l,f),v.completedRootSegment=null,yi(l,v.responseState));var g=v.clientRenderedBoundaries,x;for(x=0;x<g.length;x++){var R=g[x];ec(v,l,R)}g.splice(0,x);var B=v.completedBoundaries;for(x=0;x<B.length;x++){var z=B[x];tc(v,l,z)}B.splice(0,x),E(l),w(l);var ne=v.partialBoundaries;for(x=0;x<ne.length;x++){var we=ne[x];if(!ef(v,l,we)){v.destination=null,x++,ne.splice(0,x);return}}ne.splice(0,x);var je=v.completedBoundaries;for(x=0;x<je.length;x++){var Ge=je[x];tc(v,l,Ge)}je.splice(0,x)}finally{E(l),v.allPendingTasks===0&&v.pingedTasks.length===0&&v.clientRenderedBoundaries.length===0&&v.completedBoundaries.length===0&&(v.abortableTasks.size!==0&&i("There was still abortable task at the root when we closed. This is a bug in React."),I(l))}}function tf(v){a(function(){return Qu(v)})}function Xf(v,l){if(v.status===ka){v.status=Da,U(l,v.fatalError);return}if(v.status!==Da&&v.destination===null){v.destination=l;try{Ii(v,l)}catch(f){sl(v,f),Oa(v,f)}}}function cl(v,l){try{var f=v.abortableTasks;f.forEach(function(g){return Ql(g,v,l)}),f.clear(),v.destination!==null&&Ii(v,v.destination)}catch(g){sl(v,g),Oa(v,g)}}function _a(v,l){return new Promise(function(f,g){var x,R,B=new Promise(function(nt,xt){R=nt,x=xt});function z(){var nt=new ReadableStream({type:"bytes",pull:function(xt){Xf(we,xt)},cancel:function(xt){cl(we)}},{highWaterMark:0});nt.allReady=B,f(nt)}function ne(nt){B.catch(function(){}),g(nt)}var we=zl(v,Oi(l?l.identifierPrefix:void 0,l?l.nonce:void 0,l?l.bootstrapScriptContent:void 0,l?l.bootstrapScripts:void 0,l?l.bootstrapModules:void 0),hi(l?l.namespaceURI:void 0),l?l.progressiveChunkSize:void 0,l?l.onError:void 0,R,z,ne,x);if(l&&l.signal){var je=l.signal,Ge=function(){cl(we,je.reason),je.removeEventListener("abort",Ge)};je.addEventListener("abort",Ge)}tf(we)})}Mh.renderToReadableStream=_a,Mh.version=e}()),Mh}var Ec,Sv;process.env.NODE_ENV==="production"?(Ec=R4(),Sv=A4()):(Ec=I4(),Sv=M4());Ec.version;var L4=Ec.renderToString;Ec.renderToStaticMarkup;Ec.renderToNodeStream;Ec.renderToStaticNodeStream;Sv.renderToReadableStream;var F4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ND(t,e){return t(e={exports:{}},e.exports),e.exports}var N4=ND(function(t){(function(e){var n=function(L,_,U){if(!d(_)||w(_)||m(_)||T(_)||c(_))return _;var G,re=0,Z=0;if(p(_))for(G=[],Z=_.length;re<Z;re++)G.push(n(L,_[re],U));else for(var ue in G={},_)Object.prototype.hasOwnProperty.call(_,ue)&&(G[L(ue,U)]=n(L,_[ue],U));return G},r=function(L){return E(L)?L:(L=L.replace(/[\-_\s]+(.)?/g,function(_,U){return U?U.toUpperCase():""})).substr(0,1).toLowerCase()+L.substr(1)},i=function(L){var _=r(L);return _.substr(0,1).toUpperCase()+_.substr(1)},o=function(L,_){return function(U,G){var re=(G=G||{}).separator||"_",Z=G.split||/(?=[A-Z])/;return U.split(Z).join(re)}(L,_).toLowerCase()},a=Object.prototype.toString,c=function(L){return typeof L=="function"},d=function(L){return L===Object(L)},p=function(L){return a.call(L)=="[object Array]"},w=function(L){return a.call(L)=="[object Date]"},m=function(L){return a.call(L)=="[object RegExp]"},T=function(L){return a.call(L)=="[object Boolean]"},E=function(L){return(L-=0)==L},I=function(L,_){var U=_&&"process"in _?_.process:_;return typeof U!="function"?L:function(G,re){return U(G,L,re)}},A={camelize:r,decamelize:o,pascalize:i,depascalize:o,camelizeKeys:function(L,_){return n(I(r,_),L)},decamelizeKeys:function(L,_){return n(I(o,_),L,_)},pascalizeKeys:function(L,_){return n(I(i,_),L)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};t.exports?t.exports=A:e.humps=A})(F4)}).decamelize,j4=function(t){if(Array.isArray(t))return t},B4=function(t,e){if(typeof Symbol<"u"&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(d){i=!0,o=d}finally{try{r||c.return==null||c.return()}finally{if(i)throw o}}return n}},w1=function(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},$4=function(t,e){if(t){if(typeof t=="string")return w1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w1(t,e):void 0}},V4=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
136
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},H4=function(t,e){return j4(t)||B4(t,e)||$4(t,e)||V4()},jD=ND(function(t){function e(){return t.exports=e=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},e.apply(this,arguments)}t.exports=e}),U4=function(t,e){if(t==null)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i},BD=function(t,e){if(t==null)return{};var n,r,i=U4(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i},W4=q.createContext(null);function $D(t){var e=t.children,n=e===void 0?"":e,r=BD(t,["children"]);return typeof n!="string"&&(n=L4(n)),q.createElement("template",jD({},r,{dangerouslySetInnerHTML:{__html:n}}))}function VD(t){var e=t.root,n=t.children;return Iv.createPortal(n===void 0?null:n,e)}function z4(t){var e=q.forwardRef(function(n,r){var i,o,a=n.mode,c=a===void 0?"open":a,d=n.delegatesFocus,p=d!==void 0&&d,w=n.styleSheets,m=w===void 0?[]:w,T=n.ssr,E=T!==void 0&&T,I=n.children,A=BD(n,["mode","delegatesFocus","styleSheets","ssr","children"]),L=(o=q.useRef((i=r)&&i.current),q.useEffect(function(){i&&(i.current=o.current)},[i]),o),_=q.useState(null),U=H4(_,2),G=U[0],re=U[1],Z="node_".concat(c).concat(p);return q.useLayoutEffect(function(){if(L.current)try{if(typeof r=="function"&&r(L.current),E){var ue=L.current.shadowRoot;return void re(ue)}var S=L.current.attachShadow({mode:c,delegatesFocus:p});m.length>0&&(S.adoptedStyleSheets=m),re(S)}catch(ae){(function(ce){var Ue=ce.error,Me=ce.styleSheets,Fe=ce.root;switch(Ue.name){case"NotSupportedError":Me.length>0&&(Fe.adoptedStyleSheets=Me);break;default:throw Ue}})({error:ae,styleSheets:m,root:G})}},[r,L,m]),q.createElement(q.Fragment,null,q.createElement(t.tag,jD({key:Z,ref:L},A),(G||E)&&q.createElement(W4.Provider,{value:G},E?q.createElement($D,{shadowroot:c,shadowrootmode:c},t.render({root:G,ssr:E,children:I})):q.createElement(VD,{root:G},t.render({root:G,ssr:E,children:I})))))});return e.propTypes={mode:_s.oneOf(["open","closed"]),delegatesFocus:_s.bool,styleSheets:_s.arrayOf(_s.instanceOf(globalThis.CSSStyleSheet)),ssr:_s.bool,children:_s.node},e}$D.propTypes={children:_s.oneOfType([_s.string,_s.node])},VD.propTypes={root:_s.object.isRequired,children:_s.node};var gm=new Map;function Y4(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"core",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(r){return r.children};return new Proxy(t,{get:function(r,i){var o=N4(i,{separator:"-"}),a="".concat(e,"-").concat(o);return gm.has(a)||gm.set(a,z4({tag:o,render:n})),gm.get(a)}})}var HD=Y4();const G4=".app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}",q4=".favorite-bar{position:sticky;top:64px;z-index:900;transition:transform .3s ease,opacity .3s ease;border-bottom:1px solid #ddd}.favorite-bar--hidden{transform:translateY(-100%);opacity:0}.favorite-bar--visible{transform:translateY(0);opacity:1}";var x1;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(x1||(x1={}));const X4=Object.freeze({x:0,y:0});var Tf;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Tf||(Tf={}));var S1;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(S1||(S1={}));var Rs;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Rs||(Rs={}));Rs.Space,Rs.Enter,Rs.Esc,Rs.Space,Rs.Enter,Rs.Tab;var T1;(function(t){t[t.RightClick=2]="RightClick"})(T1||(T1={}));var C1;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(C1||(C1={}));var E1;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(E1||(E1={}));Tf.Backward+"",Tf.Forward+"",Tf.Backward+"",Tf.Forward+"";var Tv;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Tv||(Tv={}));var Cv;(function(t){t.Optimized="optimized"})(Cv||(Cv={}));Tv.WhileDragging,Cv.Optimized;({...X4});var k1;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(k1||(k1={}));function K4(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}Rs.Down,Rs.Right,Rs.Up,Rs.Left;function Z4(t){const e=new CustomEvent("updateFavoriteMenu",{detail:{menuItem:t}});window.dispatchEvent(e)}const D1="MENU_ITEM";function J4(t){const e=xp.useLocation(),[n,r]=q.useState([]),[i,o]=q.useState(!1);console.log("isSubmit",i);const a=q.useRef(null),[c,d]=q.useState(window.location.href);q.useEffect(()=>{d(window.location.href)},[e]);const p=A=>`${A}`;function w(A,L){for(const _ of A){if(_.id===L)return _;if(_.children){const U=w(_.children,L);if(U)return U}}return null}function m(A,L){const _=w(n,A);_?(_.isFavorite=L,Z4(_),eb(A,L)):console.error(`Item with id ${A} not found`)}const T=A=>{console.log("Favorite menus changed",A);const L=A.detail.favoriteMenus||[];r(L)};q.useEffect(()=>(window.addEventListener("favoriteMenusChange",T),()=>{window.removeEventListener("favoriteMenusChange",T)}),[]);const E=(A,L)=>{n[A];const _=K4(n,A,L);r(_),o(!0);const U={menuItemIds:_.map(G=>G.id)};As.post("global-menu-config/api/v1/menu-items/user/order-favorites",U,{baseURL:t.baseUrl}).then(()=>{}).catch(G=>{console.error(G),r(n)}).finally(()=>{o(!1)})},I=({item:A,index:L})=>{const _=q.useRef(null),[{isDragging:U},G]=GE({type:D1,item:()=>({id:A.id,index:L}),collect:ae=>({isDragging:ae.isDragging()})}),[{isOver:re,isOverCurrent:Z},ue]=Oy(()=>({accept:D1,collect:ae=>({isOver:ae.isOver(),isOverCurrent:ae.isOver({shallow:!0})}),drop:ae=>{E(ae.index,L),ae.index=L}}),[]);let S="hover-off";return(Z||re)&&(S="hover-on"),G(ue(_)),Ie.jsx("div",{ref:_,style:{opacity:U?.7:1,boxShadow:U?"0 4px 8px rgba(0, 0, 0, 0.2)":"none",cursor:"move",display:"inline-block",marginRight:"8px",position:"relative",transition:"transform 0.3s ease-in-out"},className:`item ${S}`,children:Ie.jsx(FD,{replacePath:t.replacePath,ssr:t.ssr,brandColors:t.brandColors,baseUrl:t.baseUrl,item:A,level:1,onSetFavoriteSuccess:m})})};return Ie.jsx(Ie.Fragment,{children:n.length?Ie.jsx("div",{className:p("favorite-menu"),children:Ie.jsx(Vv,{ref:a,className:p("wrap-section favorite-menu__menu"),style:{marginTop:4,flex:1,overflow:"auto",height:"100%",overflowY:"hidden"},children:Ie.jsx(VE,{backend:JT,children:Ie.jsx("div",{style:{display:"inline-flex"},children:n.map((A,L)=>Ie.jsx(I,{item:A,index:L},A.id))})})})}):""})}function Q4(t=32){const[e,n]=q.useState(!0),[r,i]=q.useState(0),o=()=>{const a=window.scrollY;a>r&&a>t?n(!1):a<r&&n(!0),i(a)};return q.useEffect(()=>(window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)),[r]),{isFavoriteBarVisible:e}}function e6(t){const{isFavoriteBarVisible:e}=Q4();return Ie.jsxs(Ie.Fragment,{children:[Ie.jsx("style",{children:q4}),Ie.jsx("div",{className:`favorite-bar ${e?"favorite-bar--visible":"favorite-bar--hidden"}`,children:Ie.jsx(HD.div,{children:Ie.jsx(jv,{styles:[BT,_4,G4],children:Ie.jsx(J4,{...t})})})})]})}function eb(t,e){const n=JSON.parse(localStorage.getItem("favoriteItems")||"[]");if(e)n.includes(t)||n.push(t);else{const r=n.indexOf(t);r>-1&&n.splice(r,1)}localStorage.setItem("favoriteItems",JSON.stringify(n))}function UD({...t}){var ke,ze,et;const e=t.item,n=t.level||0,r=!!((ke=t.item.children)!=null&&ke.length),{isActive:i,isCollapsed:o}=t,a=`level-${n}`,c=o?"collapsed":"expanded",d=i(e.id)?"active":"",p=r?"parent":"child",w=t.params.isOpen?"isOpen":"isClose",m=t.isInternalApp?"isInternalApp":"",T=(qe,Je=a)=>`${qe} ${Je} ${c} ${d} ${p} ${w} ${m}`,[E,I]=q.useState(!1),[A,L]=q.useState(e.isFavorite||!1);q.useEffect(()=>{L(!!t.item.isFavorite)},[t.item.isFavorite]);const _=q.useRef(),U=q.useRef();U!=null&&U.current&&((ze=U==null?void 0:U.current)==null?void 0:ze.scrollWidth)>((et=U==null?void 0:U.current)==null?void 0:et.clientWidth);const G=window.location.origin,re=e.path&&e.path.includes("http")?new URL(e.path):{origin:"",pathname:""},Z=window.location.pathname.split("/")[1],ue=re.pathname.split("/")[1],S=!t.isInternalApp||t.item.redirectUrl||t.ssr||!G.includes("local")&&G!==re.origin||ue!==Z,ae=r?"div":S?"a":xp.Link,ce=e.redirectUrl||e.path||"#",Ue=n+1,Me=r&&o&&E,Fe=o||n===0?void 0:`${n+.25}rem`,Ve=()=>{I(!0)},We=()=>{I(!1)},he="/global-menu-config/api/v1/menu-items/user/set-favorite",Ee=e.serviceKey==="mn_poms";t.params.depth*20,t.params.depth,DH(e.id,t.params.isOpen,t.params.onToggle);const Ne=Ee||o&&n===0?e.name==="POMs"?"Parking Operations Management":e.description||e.name:null,tt=Object.entries(t.brandColors||{}).reduce((qe,[Je,Ke])=>(Ke&&(qe[`--${Je}`]=Ke),qe),{}),me=G!==re.origin||t.item.redirectUrl?"_blank":"_self";return Ie.jsxs("div",{ref:_,className:T("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s",...tt},onMouseOver:Ve,onMouseOut:We,onDragStart:qe=>{o&&n>1&&qe.preventDefault()},children:[Ie.jsx(sa.Tooltip,{placement:"top",title:Ne,disableInteractive:!0,children:Ie.jsxs(ae,{target:me,to:ce,href:ce,draggable:"true",className:T("menu-item__link"),style:{paddingLeft:Fe},onClick:qe=>{ae==="a"&&me==="_blank"||o||t.toggleExpand(qe)},children:[Ie.jsx(t6,{cls:T,item:e}),Ie.jsx("span",{className:T("menu-item__label"),ref:U,children:e.name}),Ie.jsx(n6,{tooltipPosition:Ne?"right":"top",menuLevel:n,hasChildren:r,isHovered:E,isFavorite:A,onClick:qe=>{const Je={menuConfigId:e.id,isFavorite:qe},Ke=t.baseUrl+he;As.post(Ke,Je).then(ot=>{var ct;L(qe),Uv("Set favorite menu item successfully"),(ct=t.onSetFavoriteSuccess)==null||ct.call(t,t.item.id,qe),eb(t.item.id,qe)}).catch(ot=>{var ct,pt;Wd(((pt=(ct=ot.response)==null?void 0:ct.data)==null?void 0:pt.errorMessage)||"Have error when set favorite menu item")})}}),r&&Ie.jsx("div",{className:T("menu-item__icon-arrow__wrapper"),children:Ie.jsx(K5,{className:T(`menu-item__icon-arrow__icon ${t.params.isOpen?"open":"close"}`)})})]})}),Me&&Ie.jsx(Z5,{parentRef:_,onlyChild:!o,renderChildren:({maxHeight:qe})=>{var Je;return Ie.jsx(DD.div,{className:T(`menu-item__dropdown ${t.params.isOpen?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${Ue}`),style:Jy({maxHeight:qe,overflowY:"auto",paddingRight:3},qe!=="auto"&&!!Ue),children:(Je=e.children)==null?void 0:Je.map(Ke=>q.createElement(UD,{...t,key:Ke.id,item:Ke,level:Ue}))})}})]})}function t6({item:t,cls:e}){return Ie.jsx("div",{className:e("menu-item__icon"),children:Ie.jsx(LD,{item:t})})}function n6(t){const e={marginRight:t.hasChildren?10:0,fontSize:18,fill:ki.warning};return Ie.jsxs(Ie.Fragment,{children:[t.isHovered&&!t.isFavorite&&Ie.jsx(sa.Tooltip,{placement:t.tooltipPosition||"top",title:"Add to favorites",disableInteractive:!0,children:Ie.jsx("div",{children:Ie.jsx(PD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!0)}})})}),t.isFavorite&&Ie.jsx(sa.Tooltip,{placement:t.tooltipPosition||"top",title:"Remove from favorites",disableInteractive:!0,children:Ie.jsx("div",{children:Ie.jsx(OD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!1)}})})})]})}function r6(){return Ie.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:Ie.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 i6(){return Ie.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:Ie.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function o6(t){return Ie.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...t,children:Ie.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 s6=".flex-col-center{display:flex;flex-direction:column;justify-content:center}.wrap-section{padding:0 8px;transition:all .3s}.wrap-section.collapsed{padding:0 4px}.side-bar{position:fixed;top:64px;left:0;height:calc(100vh - 64px);max-width:18rem;display:flex;flex-direction:column;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:5px 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;background-color:initial}.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%;color:#292929}.menu-item__wrapper.collapsed.active,.menu-item__wrapper.expanded.active.parent.isClose,.menu-item__wrapper.expanded.active.child{color:var(--primary400);background-color:var(--primary200)}.menu-item__link{display:flex;flex-direction:row;border-radius:.375rem;align-items:center;padding:.5rem;position:relative;height:48px;cursor:pointer}.menu-item__link.expanded.level-0{padding:.5rem 10px}.menu-item__link:hover{background-color:#919eab14}.menu-item__link.collapsed.level-0{padding-left:calc(.5rem + 7.665px)!important}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-0,.menu-item__link.active.level-1,.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{background-color:inherit;color:inherit}.menu-item__link.active.level-1:hover,.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-0:hover{background-color:#919eab14}.menu-item__link.level-0{transition:padding .2s}.menu-item__link.menu-item__link.collapsed.level-0{padding:0}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center;color:#85858a}.menu-item__icon.collapsed.active,.menu-item__icon.expanded.active.parent.isClose,.menu-item__icon.expanded.active.child{color:inherit}.menu-item__icon.collapsed.level-0>*{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;opacity:1}.menu-item__label.level-0.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{font-size:.875rem;opacity:0;transition-delay:.15s}.menu-item__label.level-0{margin-left:8px;font-weight:500;font-size:.951rem}.menu-item__label.level-0.isInternalApp{font-weight:unset!important}.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__icon{transition:transform .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:210px;max-width:210px;padding:4px;z-index:1200}.menu-item__dropdown::-webkit-scrollbar{width:4px}.menu-item__dropdown::-webkit-scrollbar-thumb{background-color:#9b9b9b99;border-radius:2px}.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-0{height:48px}.menu-item__dropdown.collapsed.level-0{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}}",a6=t=>{const e=t.isCollapsed?0:t.depth*16;return Ie.jsx("div",{style:{backgroundColor:t.color||"#93D500",height:"2px",position:"absolute",right:"0",top:"0",left:e}})},l6=".app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}",u6=t=>{const[e,n]=q.useState(()=>{const r=localStorage.getItem("openingMenuIds");return r&&r!=="[]"?JSON.parse(r):(t==null?void 0:t.initOpenIds)||[]});return q.useEffect(()=>{localStorage.setItem("openingMenuIds",JSON.stringify(e))},[e]),[e,n]};function WD(t){document.documentElement.style.setProperty("--global-menu-width",!t||t==="true"?"64px":"17rem")}const Gh=localStorage.getItem("isCollapsed");WD(Gh);function c6(t){const e=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:t}});window.dispatchEvent(e)}function f6(t){const e=xp.useLocation(),[n,r]=q.useState([]),i=n.map(Me=>Me.data),[o,a]=q.useState(!1),[c,d]=q.useState([]),[p,w]=q.useState(Gh===null?!0:Gh==="true"),[m,T]=q.useState(window.location.href),E=q.useRef(null);q.useEffect(()=>{var Me;(Me=t.handleCallback)==null||Me.call(t,i)},[i,t.handleCallback]),q.useEffect(()=>{T(window.location.href)},[e]);const I=h6(i,m),[A,L]=u6({initOpenIds:t.initOpenIds}),_=()=>{var Me,Fe;if(w(!p),localStorage.setItem("isCollapsed",JSON.stringify(!p)),WD(p),p)A&&((Me=E.current)==null||Me.open(A));else{const Ve=n.filter(We=>We.parent===0).map(We=>We.id);console.log("closeIds:",Ve),(Fe=E.current)==null||Fe.close(Ve)}},[U,G]=q.useState(!1),re=p?"collapsed":"expanded",Z=Me=>`${Me} ${re}`,ue=q.useRef(null);q.useLayoutEffect(()=>{(async()=>{var Fe,Ve;try{const We=t.menuPath||"/global-menu-config/api/v1/menu-items/user",he=t.baseUrl+We,{data:Ee}=await As.get(he);let Oe=Ee.map(tt=>({...tt,parentKey:tt.parentKey||0}));Oe=YD(Oe),t.replacePath&&(Oe=zD(Oe,t.replacePath));const Ne=Oe.map(tt=>({id:tt.id,parent:tt.parentKey,text:tt.name,data:tt}));r(Ne)}catch(We){console.error("Global menu",We),Wd(((Ve=(Fe=We.response)==null?void 0:Fe.data)==null?void 0:Ve.errorMessage)||"Have error when get menu items")}})()},[t.baseUrl,t.menuPath,t.replacePath]);const S=async()=>{try{const Me=await fetch(`${t.baseUrl}/global-menu-config/api/v1/menu-items/user/get-favorites`);if(!Me.ok)throw new Error("Failed to fetch favorite items");const Fe=await Me.json();d(Fe)}catch(Me){console.error("Error fetching favorite items:",Me)}};q.useEffect(()=>{S()},[t.baseUrl]),q.useEffect(()=>{let Me=[];c.forEach(We=>{const he=i.find(Ee=>Ee.id===We&&Ee.isFavorite===!0);he&&(Me=[...Me,he])}),console.log(Me);function Fe(We){return i.every(he=>he.parentKey!==We.id)?We:{...We,children:i.filter(he=>he.parentKey===We.id).map(he=>Fe(he))}}const Ve=Me.map(We=>Fe(We));c6(Ve)},[i]);function ae(Me){const Fe=Me.detail.menuItem;r(Ve=>Ve.map(We=>We.id!==Fe.id?We:{...We,data:Fe})),S()}q.useEffect(()=>(window.addEventListener("updateFavoriteMenu",ae),()=>{window.removeEventListener("updateFavoriteMenu",ae)}),[]),q.useLayoutEffect(()=>{var We;const Me=localStorage.getItem("scrollPos");Me&&ue.current&&setTimeout(()=>{const he=ue.current.getScrollElement();he.scrollTop=parseInt(Me)},0);const Fe=()=>{if(ue.current){const he=ue.current.getScrollElement();localStorage.setItem("scrollPos",he.scrollTop.toString())}},Ve=(We=ue.current)==null?void 0:We.getScrollElement();return Ve==null||Ve.addEventListener("scroll",Fe),()=>{Ve==null||Ve.removeEventListener("scroll",Fe)}},[i]);function ce(Me){a(!0);const Fe=[...n];r(Me);const Ve=Me.map((We,he)=>({menuItemId:We.id,order:he}));As.post("/global-menu-config/api/v1/menu-items/user",Ve,{baseURL:t.baseUrl}).then(()=>{}).catch(We=>{console.error(We),r(Fe)}).finally(()=>{a(!1)})}const Ue=q.useMemo(()=>Gh==="false"?A:[],[]);return console.log("nodesglobal menu",n),Ie.jsxs("div",{className:Z("side-bar"),children:[Ie.jsx("div",{className:Z("wrap-section side-bar__wrapper-toggle-btn"),children:Ie.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:_,children:p?Ie.jsx(i6,{}):Ie.jsx(r6,{})})}),Ie.jsx(Vv,{ref:ue,className:Z("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:Ie.jsx(VE,{backend:Z3,options:SH(),children:Ie.jsx(BH,{ref:E,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:ce,render:(Me,Fe)=>{function Ve(Oe){return n.every(Ne=>Ne.parent!==Oe.id)?Oe:{...Oe,children:n.filter(Ne=>Ne.parent===Oe.id).map(Ne=>Ve(Ne.data))}}const We=Ve(Me.data),he=Oe=>I.some(Ne=>Ne.id===Oe);function Ee(Oe,Ne){r(tt=>tt.map(me=>me.id===Oe?{...me,data:{...me.data,isFavorite:Ne}}:me)),S()}return Ie.jsx(UD,{isActive:he,isCollapsed:p,replacePath:t.replacePath,ssr:t.ssr,brandColors:t.brandColors,baseUrl:t.baseUrl,node:Me,params:Fe,nodes:n,item:We,expanded:()=>!1,toggleExpand:Oe=>{var Ne;if(Oe.stopPropagation(),Fe.isOpen)console.log("open toggleExpand"),Fe.onToggle();else{console.log("close toggleExpand");const tt=n.filter(me=>me.parent===Me.parent&&me.id!==Me.id).map(me=>me.id);console.log(" closeIds:",tt),(Ne=E.current)==null||Ne.open(Me.id),setTimeout(()=>{var me;(me=E.current)==null||me.close(tt)},0)}},level:Fe.depth,onSetFavoriteSuccess:Ee})},placeholderRender:(Me,{depth:Fe})=>{var Ve;return Ie.jsx(a6,{node:Me,depth:Fe,color:(Ve=t.brandColors)==null?void 0:Ve.primary300,isCollapsed:p})},canDrag:()=>!o,canDrop:(Me,{dragSource:Fe,dropTargetId:Ve})=>(Fe==null?void 0:Fe.parent)===Ve,onDragStart:Me=>{console.log("onDragStart",Me)},onChangeOpen:Me=>{localStorage.getItem("isCollapsed")==="false"&&(console.log("onChangeOpen:",Me),L(Me))},initialOpen:Ue})})}),Ie.jsxs("div",{className:Z("wrap-section side-bar__wrap-btn-logout"),children:[Ie.jsxs("button",{className:Z("side-bar__logout-btn"),onClick:()=>G(!0),children:[Ie.jsx(o6,{className:Z("side-bar__icon-logout")}),Ie.jsx("span",{className:Z("side-bar__logout-btn__text"),children:"Logout"})]}),Ie.jsx(G1,{isOpen:U,onClose:()=>G(!1),onConfirm:()=>t.logout?t.logout():rT(t.baseUrl)})]})]})}function d6(t,e){const n=new URL(t,window.location.origin),r=new URL(e,window.location.origin);return n.pathname===r.pathname&&n.search===r.search?3:n.pathname===r.pathname?2:r.pathname.startsWith(n.pathname)?1:0}function h6(t,e){const n=t.map(a=>({item:a,priority:a.path?d6(a.path,e):0})).filter(a=>a.priority>0),r=n.length>0?n.reduce((a,c)=>c.priority>a.priority?c:a).item:null,i=[];let o=r;for(;o;)i.unshift(o),o=t.find(a=>a.id===(o==null?void 0:o.parentKey))||null;return i}function zD(t,e){return t.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=zD(n.children,e)):n.path=e(n.path),n})}function YD(t){return t.map(n=>n.path&&!n.path.includes("http")&&n.path.includes("/")?{...n,path:window.location.origin+n.path}:(n.children&&(n.children=YD(n.children)),n))}function p6(t){return Ie.jsx(HD.div,{children:Ie.jsx(jv,{styles:[BT,s6,l6],style:{position:"sticky",zIndex:1300},children:Ie.jsx(f6,{...t})})})}const g6={"page-container":"_page-container_1pwo1_1","page-main-content":"_page-main-content_1pwo1_8","page-title":"_page-title_1pwo1_19","text-base":"_text-base_1pwo1_26","mt-4":"_mt-4_1pwo1_33"};var yp={exports:{}};/**
|
|
136
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},H4=function(t,e){return j4(t)||B4(t,e)||$4(t,e)||V4()},jD=ND(function(t){function e(){return t.exports=e=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},e.apply(this,arguments)}t.exports=e}),U4=function(t,e){if(t==null)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i},BD=function(t,e){if(t==null)return{};var n,r,i=U4(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i},W4=q.createContext(null);function $D(t){var e=t.children,n=e===void 0?"":e,r=BD(t,["children"]);return typeof n!="string"&&(n=L4(n)),q.createElement("template",jD({},r,{dangerouslySetInnerHTML:{__html:n}}))}function VD(t){var e=t.root,n=t.children;return Iv.createPortal(n===void 0?null:n,e)}function z4(t){var e=q.forwardRef(function(n,r){var i,o,a=n.mode,c=a===void 0?"open":a,d=n.delegatesFocus,p=d!==void 0&&d,w=n.styleSheets,m=w===void 0?[]:w,T=n.ssr,E=T!==void 0&&T,I=n.children,A=BD(n,["mode","delegatesFocus","styleSheets","ssr","children"]),L=(o=q.useRef((i=r)&&i.current),q.useEffect(function(){i&&(i.current=o.current)},[i]),o),_=q.useState(null),U=H4(_,2),G=U[0],re=U[1],Z="node_".concat(c).concat(p);return q.useLayoutEffect(function(){if(L.current)try{if(typeof r=="function"&&r(L.current),E){var ue=L.current.shadowRoot;return void re(ue)}var S=L.current.attachShadow({mode:c,delegatesFocus:p});m.length>0&&(S.adoptedStyleSheets=m),re(S)}catch(ae){(function(ce){var Ue=ce.error,Me=ce.styleSheets,Fe=ce.root;switch(Ue.name){case"NotSupportedError":Me.length>0&&(Fe.adoptedStyleSheets=Me);break;default:throw Ue}})({error:ae,styleSheets:m,root:G})}},[r,L,m]),q.createElement(q.Fragment,null,q.createElement(t.tag,jD({key:Z,ref:L},A),(G||E)&&q.createElement(W4.Provider,{value:G},E?q.createElement($D,{shadowroot:c,shadowrootmode:c},t.render({root:G,ssr:E,children:I})):q.createElement(VD,{root:G},t.render({root:G,ssr:E,children:I})))))});return e.propTypes={mode:_s.oneOf(["open","closed"]),delegatesFocus:_s.bool,styleSheets:_s.arrayOf(_s.instanceOf(globalThis.CSSStyleSheet)),ssr:_s.bool,children:_s.node},e}$D.propTypes={children:_s.oneOfType([_s.string,_s.node])},VD.propTypes={root:_s.object.isRequired,children:_s.node};var gm=new Map;function Y4(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"core",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(r){return r.children};return new Proxy(t,{get:function(r,i){var o=N4(i,{separator:"-"}),a="".concat(e,"-").concat(o);return gm.has(a)||gm.set(a,z4({tag:o,render:n})),gm.get(a)}})}var HD=Y4();const G4=".app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}",q4=".favorite-bar{position:sticky;top:64px;z-index:900;transition:transform .3s ease,opacity .3s ease;border-bottom:1px solid #ddd}.favorite-bar--hidden{transform:translateY(-100%);opacity:0}.favorite-bar--visible{transform:translateY(0);opacity:1}";var x1;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(x1||(x1={}));const X4=Object.freeze({x:0,y:0});var Tf;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Tf||(Tf={}));var S1;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(S1||(S1={}));var Rs;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Rs||(Rs={}));Rs.Space,Rs.Enter,Rs.Esc,Rs.Space,Rs.Enter,Rs.Tab;var T1;(function(t){t[t.RightClick=2]="RightClick"})(T1||(T1={}));var C1;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(C1||(C1={}));var E1;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(E1||(E1={}));Tf.Backward+"",Tf.Forward+"",Tf.Backward+"",Tf.Forward+"";var Tv;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Tv||(Tv={}));var Cv;(function(t){t.Optimized="optimized"})(Cv||(Cv={}));Tv.WhileDragging,Cv.Optimized;({...X4});var k1;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(k1||(k1={}));function K4(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}Rs.Down,Rs.Right,Rs.Up,Rs.Left;function Z4(t){const e=new CustomEvent("updateFavoriteMenu",{detail:{menuItem:t}});window.dispatchEvent(e)}const D1="MENU_ITEM";function J4(t){const e=xp.useLocation(),[n,r]=q.useState([]),[i,o]=q.useState(!1);console.log("isSubmit",i);const a=q.useRef(null),[c,d]=q.useState(window.location.href);q.useEffect(()=>{d(window.location.href)},[e]);const p=A=>`${A}`;function w(A,L){for(const _ of A){if(_.id===L)return _;if(_.children){const U=w(_.children,L);if(U)return U}}return null}function m(A,L){const _=w(n,A);_?(_.isFavorite=L,Z4(_),eb(A,L)):console.error(`Item with id ${A} not found`)}const T=A=>{console.log("Favorite menus changed",A);const L=A.detail.favoriteMenus||[];r(L)};q.useEffect(()=>(window.addEventListener("favoriteMenusChange",T),()=>{window.removeEventListener("favoriteMenusChange",T)}),[]);const E=(A,L)=>{n[A];const _=K4(n,A,L);r(_),o(!0);const U={menuItemIds:_.map(G=>G.id)};As.post("global-menu-config/api/v1/menu-items/user/order-favorites",U,{baseURL:t.baseUrl}).then(()=>{}).catch(G=>{console.error(G),r(n)}).finally(()=>{o(!1)})},I=({item:A,index:L})=>{const _=q.useRef(null),[{isDragging:U},G]=GE({type:D1,item:()=>({id:A.id,index:L}),collect:ae=>({isDragging:ae.isDragging()})}),[{isOver:re,isOverCurrent:Z},ue]=Oy(()=>({accept:D1,collect:ae=>({isOver:ae.isOver(),isOverCurrent:ae.isOver({shallow:!0})}),drop:ae=>{E(ae.index,L),ae.index=L}}),[]);let S="hover-off";return(Z||re)&&(S="hover-on"),G(ue(_)),Ie.jsx("div",{ref:_,style:{opacity:U?.7:1,boxShadow:U?"0 4px 8px rgba(0, 0, 0, 0.2)":"none",cursor:"move",display:"inline-block",marginRight:"8px",position:"relative",transition:"transform 0.3s ease-in-out"},className:`item ${S}`,children:Ie.jsx(FD,{replacePath:t.replacePath,ssr:t.ssr,brandColors:t.brandColors,baseUrl:t.baseUrl,item:A,level:1,onSetFavoriteSuccess:m})})};return Ie.jsx(Ie.Fragment,{children:n.length?Ie.jsx("div",{className:p("favorite-menu"),children:Ie.jsx(Vv,{ref:a,className:p("wrap-section favorite-menu__menu"),style:{marginTop:4,flex:1,overflow:"auto",height:"100%",overflowY:"hidden"},children:Ie.jsx(VE,{backend:JT,children:Ie.jsx("div",{style:{display:"inline-flex"},children:n.map((A,L)=>Ie.jsx(I,{item:A,index:L},A.id))})})})}):""})}function Q4(t=32){const[e,n]=q.useState(!0),[r,i]=q.useState(0),o=()=>{const a=window.scrollY;a>r&&a>t?n(!1):a<r&&n(!0),i(a)};return q.useEffect(()=>(window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)),[r]),{isFavoriteBarVisible:e}}function e6(t){const{isFavoriteBarVisible:e}=Q4();return Ie.jsxs(Ie.Fragment,{children:[Ie.jsx("style",{children:q4}),Ie.jsx("div",{className:`favorite-bar ${e?"favorite-bar--visible":"favorite-bar--hidden"}`,children:Ie.jsx(HD.div,{children:Ie.jsx(jv,{styles:[BT,_4,G4],children:Ie.jsx(J4,{...t})})})})]})}function eb(t,e){const n=JSON.parse(localStorage.getItem("favoriteItems")||"[]");if(e)n.includes(t)||n.push(t);else{const r=n.indexOf(t);r>-1&&n.splice(r,1)}localStorage.setItem("favoriteItems",JSON.stringify(n))}function UD({...t}){var ke,ze,et;const e=t.item,n=t.level||0,r=!!((ke=t.item.children)!=null&&ke.length),{isActive:i,isCollapsed:o}=t,a=`level-${n}`,c=o?"collapsed":"expanded",d=i(e.id)?"active":"",p=r?"parent":"child",w=t.params.isOpen?"isOpen":"isClose",m=t.isInternalApp?"isInternalApp":"",T=(qe,Je=a)=>`${qe} ${Je} ${c} ${d} ${p} ${w} ${m}`,[E,I]=q.useState(!1),[A,L]=q.useState(e.isFavorite||!1);q.useEffect(()=>{L(!!t.item.isFavorite)},[t.item.isFavorite]);const _=q.useRef(),U=q.useRef();U!=null&&U.current&&((ze=U==null?void 0:U.current)==null?void 0:ze.scrollWidth)>((et=U==null?void 0:U.current)==null?void 0:et.clientWidth);const G=window.location.origin,re=e.path&&e.path.includes("http")?new URL(e.path):{origin:"",pathname:""},Z=window.location.pathname.split("/")[1],ue=re.pathname.split("/")[1],S=!t.isInternalApp||t.item.redirectUrl||t.ssr||!G.includes("local")&&G!==re.origin||ue!==Z,ae=r?"div":S?"a":xp.Link,ce=e.redirectUrl||e.path||"#",Ue=n+1,Me=r&&o&&E,Fe=o||n===0?void 0:`${n+.25}rem`,Ve=()=>{I(!0)},We=()=>{I(!1)},he="/global-menu-config/api/v1/menu-items/user/set-favorite",Ee=e.serviceKey==="mn_poms";t.params.depth*20,t.params.depth,DH(e.id,t.params.isOpen,t.params.onToggle);const Ne=Ee||o&&n===0?e.name==="POMs"?"Parking Operations Management":e.description||e.name:null,tt=Object.entries(t.brandColors||{}).reduce((qe,[Je,Ke])=>(Ke&&(qe[`--${Je}`]=Ke),qe),{}),me=G!==re.origin||t.item.redirectUrl?"_blank":"_self";return Ie.jsxs("div",{ref:_,className:T("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s",...tt},onMouseOver:Ve,onMouseOut:We,onDragStart:qe=>{o&&n>1&&qe.preventDefault()},children:[Ie.jsx(sa.Tooltip,{placement:"top",title:Ne,disableInteractive:!0,children:Ie.jsxs(ae,{target:me,to:ce,href:ce,draggable:"true",className:T("menu-item__link"),style:{paddingLeft:Fe},onClick:qe=>{ae==="a"&&me==="_blank"||o||t.toggleExpand(qe)},children:[Ie.jsx(t6,{cls:T,item:e}),Ie.jsx("span",{className:T("menu-item__label"),ref:U,children:e.name}),Ie.jsx(n6,{tooltipPosition:Ne?"right":"top",menuLevel:n,hasChildren:r,isHovered:E,isFavorite:A,onClick:qe=>{const Je={menuConfigId:e.id,isFavorite:qe},Ke=t.baseUrl+he;As.post(Ke,Je).then(ot=>{var ct;L(qe),Uv("Set favorite menu item successfully"),(ct=t.onSetFavoriteSuccess)==null||ct.call(t,t.item.id,qe),eb(t.item.id,qe)}).catch(ot=>{var ct,pt;Wd(((pt=(ct=ot.response)==null?void 0:ct.data)==null?void 0:pt.errorMessage)||"Have error when set favorite menu item")})}}),r&&Ie.jsx("div",{className:T("menu-item__icon-arrow__wrapper"),children:Ie.jsx(K5,{className:T(`menu-item__icon-arrow__icon ${t.params.isOpen?"open":"close"}`)})})]})}),Me&&Ie.jsx(Z5,{parentRef:_,onlyChild:!o,renderChildren:({maxHeight:qe})=>{var Je;return Ie.jsx(DD.div,{className:T(`menu-item__dropdown ${t.params.isOpen?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${Ue}`),style:Jy({maxHeight:qe,overflowY:"auto",paddingRight:3},qe!=="auto"&&!!Ue),children:(Je=e.children)==null?void 0:Je.map(Ke=>q.createElement(UD,{...t,key:Ke.id,item:Ke,level:Ue}))})}})]})}function t6({item:t,cls:e}){return Ie.jsx("div",{className:e("menu-item__icon"),children:Ie.jsx(LD,{item:t})})}function n6(t){const e={marginRight:t.hasChildren?10:0,fontSize:18,fill:ki.warning};return Ie.jsxs(Ie.Fragment,{children:[t.isHovered&&!t.isFavorite&&Ie.jsx(sa.Tooltip,{placement:t.tooltipPosition||"top",title:"Add to favorites",disableInteractive:!0,children:Ie.jsx("div",{children:Ie.jsx(PD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!0)}})})}),t.isFavorite&&Ie.jsx(sa.Tooltip,{placement:t.tooltipPosition||"top",title:"Remove from favorites",disableInteractive:!0,children:Ie.jsx("div",{children:Ie.jsx(OD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!1)}})})})]})}function r6(){return Ie.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:Ie.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 i6(){return Ie.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:Ie.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function o6(t){return Ie.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...t,children:Ie.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 s6=".flex-col-center{display:flex;flex-direction:column;justify-content:center}.wrap-section{padding:0 8px;transition:all .3s}.wrap-section.collapsed{padding:0 4px}.side-bar{position:fixed;top:64px;left:0;height:calc(100vh - 64px);max-width:18rem;display:flex;flex-direction:column;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:5px 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;background-color:initial}.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%;color:#292929}.menu-item__wrapper.collapsed.active,.menu-item__wrapper.expanded.active.parent.isClose,.menu-item__wrapper.expanded.active.child{color:var(--primary400);background-color:var(--primary200)}.menu-item__link{display:flex;flex-direction:row;border-radius:.375rem;align-items:center;padding:.5rem;position:relative;height:48px;cursor:pointer}.menu-item__link.expanded.level-0{padding:.5rem 10px}.menu-item__link:hover{background-color:#919eab14}.menu-item__link.collapsed.level-0{padding-left:calc(.5rem + 7.665px)!important}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-0,.menu-item__link.active.level-1,.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{background-color:inherit;color:inherit}.menu-item__link.active.level-1:hover,.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-0:hover{background-color:#919eab14}.menu-item__link.level-0{transition:padding .2s}.menu-item__link.menu-item__link.collapsed.level-0{padding:0}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center;color:#85858a}.menu-item__icon.collapsed.active,.menu-item__icon.expanded.active.parent.isClose,.menu-item__icon.expanded.active.child{color:inherit}.menu-item__icon.collapsed.level-0>*{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;opacity:1}.menu-item__label.level-0.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{font-size:.875rem;opacity:0;transition-delay:.15s}.menu-item__label.level-0{margin-left:8px;font-weight:500;font-size:.951rem}.menu-item__label.level-0.isInternalApp{font-weight:unset!important}.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__icon{transition:transform .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:210px;max-width:210px;padding:4px;z-index:1200}.menu-item__dropdown::-webkit-scrollbar{width:4px}.menu-item__dropdown::-webkit-scrollbar-thumb{background-color:#9b9b9b99;border-radius:2px}.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-0{height:48px}.menu-item__dropdown.collapsed.level-0{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}}",a6=t=>{const e=t.isCollapsed?0:t.depth*16;return Ie.jsx("div",{style:{backgroundColor:t.color||"#93D500",height:"2px",position:"absolute",right:"0",top:"0",left:e}})},l6=".app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}",u6=t=>{const[e,n]=q.useState(()=>{const r=localStorage.getItem("openingMenuIds");return r&&r!=="[]"?JSON.parse(r):(t==null?void 0:t.initOpenIds)||[]});return q.useEffect(()=>{localStorage.setItem("openingMenuIds",JSON.stringify(e))},[e]),[e,n]};function WD(t){document.documentElement.style.setProperty("--global-menu-width",!t||t==="true"?"64px":"17rem")}const Gh=localStorage.getItem("isCollapsed");WD(Gh);function c6(t){const e=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:t}});window.dispatchEvent(e)}function f6(t){const e=xp.useLocation(),[n,r]=q.useState([]),i=n.map(Me=>Me.data),[o,a]=q.useState(!1),[c,d]=q.useState([]),[p,w]=q.useState(Gh===null?!0:Gh==="true"),[m,T]=q.useState(window.location.href),E=q.useRef(null);q.useEffect(()=>{var Me;(Me=t.handleCallback)==null||Me.call(t,i)},[i,t.handleCallback]),q.useEffect(()=>{T(window.location.href)},[e]);const I=h6(i,m),[A,L]=u6({initOpenIds:t.initOpenIds}),_=()=>{var Me,Fe;if(w(!p),localStorage.setItem("isCollapsed",JSON.stringify(!p)),WD(p),p)A&&((Me=E.current)==null||Me.open(A));else{const Ve=n.filter(We=>We.parent===0).map(We=>We.id);console.log("closeIds:",Ve),(Fe=E.current)==null||Fe.close(Ve)}},[U,G]=q.useState(!1),re=p?"collapsed":"expanded",Z=Me=>`${Me} ${re}`,ue=q.useRef(null);q.useLayoutEffect(()=>{(async()=>{var Fe,Ve;try{const We=t.menuPath||"/global-menu-config/api/v1/menu-items/user",he=t.baseUrl+We,{data:Ee}=await As.get(he);let Oe=Ee.map(tt=>({...tt,parentKey:tt.parentKey||0}));Oe=YD(Oe),t.replacePath&&(Oe=zD(Oe,t.replacePath));const Ne=Oe.map(tt=>({id:tt.id,parent:tt.parentKey,text:tt.name,data:tt}));r(Ne)}catch(We){console.error("Global menu",We),Wd(((Ve=(Fe=We.response)==null?void 0:Fe.data)==null?void 0:Ve.errorMessage)||"Have error when get menu items")}})()},[t.baseUrl,t.menuPath,t.replacePath]);const S=async()=>{try{const Me=await fetch(`${t.baseUrl}/global-menu-config/api/v1/menu-items/user/get-favorites`);if(!Me.ok)throw new Error("Failed to fetch favorite items");const Fe=await Me.json();d(Fe)}catch(Me){console.error("Error fetching favorite items:",Me)}};q.useEffect(()=>{S()},[t.baseUrl]),q.useEffect(()=>{let Me=[];c.forEach(We=>{const he=i.find(Ee=>Ee.id===We&&Ee.isFavorite===!0);he&&(Me=[...Me,he])}),console.log(Me);function Fe(We){return i.every(he=>he.parentKey!==We.id)?We:{...We,children:i.filter(he=>he.parentKey===We.id).map(he=>Fe(he))}}const Ve=Me.map(We=>Fe(We));c6(Ve)},[i]);function ae(Me){const Fe=Me.detail.menuItem;r(Ve=>Ve.map(We=>We.id!==Fe.id?We:{...We,data:Fe})),S()}q.useEffect(()=>(window.addEventListener("updateFavoriteMenu",ae),()=>{window.removeEventListener("updateFavoriteMenu",ae)}),[]),q.useLayoutEffect(()=>{var We;const Me=localStorage.getItem("scrollPos");Me&&ue.current&&setTimeout(()=>{const he=ue.current.getScrollElement();he.scrollTop=parseInt(Me)},0);const Fe=()=>{if(ue.current){const he=ue.current.getScrollElement();localStorage.setItem("scrollPos",he.scrollTop.toString())}},Ve=(We=ue.current)==null?void 0:We.getScrollElement();return Ve==null||Ve.addEventListener("scroll",Fe),()=>{Ve==null||Ve.removeEventListener("scroll",Fe)}},[i]);function ce(Me){a(!0);const Fe=[...n];r(Me);const Ve=Me.map((We,he)=>({menuItemId:We.id,order:he}));As.post("/global-menu-config/api/v1/menu-items/user",Ve,{baseURL:t.baseUrl}).then(()=>{}).catch(We=>{console.error(We),r(Fe)}).finally(()=>{a(!1)})}const Ue=q.useMemo(()=>Gh==="false"?A:[],[]);return console.log("nodesglobal menu",n),Ie.jsxs("div",{className:Z("side-bar"),children:[Ie.jsx("div",{className:Z("wrap-section side-bar__wrapper-toggle-btn"),children:Ie.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:_,children:p?Ie.jsx(i6,{}):Ie.jsx(r6,{})})}),Ie.jsx(Vv,{ref:ue,className:Z("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:Ie.jsx(VE,{backend:Z3,options:SH(),children:Ie.jsx(BH,{ref:E,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:ce,render:(Me,Fe)=>{function Ve(Oe){return n.every(Ne=>Ne.parent!==Oe.id)?Oe:{...Oe,children:n.filter(Ne=>Ne.parent===Oe.id).map(Ne=>Ve(Ne.data))}}const We=Ve(Me.data),he=Oe=>I.some(Ne=>Ne.id===Oe);function Ee(Oe,Ne){r(tt=>tt.map(me=>me.id===Oe?{...me,data:{...me.data,isFavorite:Ne}}:me)),S()}return Ie.jsx(UD,{isInternalApp:t.isInternalApp,isActive:he,isCollapsed:p,replacePath:t.replacePath,ssr:t.ssr,brandColors:t.brandColors,baseUrl:t.baseUrl,node:Me,params:Fe,nodes:n,item:We,expanded:()=>!1,toggleExpand:Oe=>{var Ne;if(Oe.stopPropagation(),Fe.isOpen)console.log("open toggleExpand"),Fe.onToggle();else{console.log("close toggleExpand");const tt=n.filter(me=>me.parent===Me.parent&&me.id!==Me.id).map(me=>me.id);console.log(" closeIds:",tt),(Ne=E.current)==null||Ne.open(Me.id),setTimeout(()=>{var me;(me=E.current)==null||me.close(tt)},0)}},level:Fe.depth,onSetFavoriteSuccess:Ee})},placeholderRender:(Me,{depth:Fe})=>{var Ve;return Ie.jsx(a6,{node:Me,depth:Fe,color:(Ve=t.brandColors)==null?void 0:Ve.primary300,isCollapsed:p})},canDrag:()=>!o,canDrop:(Me,{dragSource:Fe,dropTargetId:Ve})=>(Fe==null?void 0:Fe.parent)===Ve,onDragStart:Me=>{console.log("onDragStart",Me)},onChangeOpen:Me=>{localStorage.getItem("isCollapsed")==="false"&&(console.log("onChangeOpen:",Me),L(Me))},initialOpen:Ue})})}),Ie.jsxs("div",{className:Z("wrap-section side-bar__wrap-btn-logout"),children:[Ie.jsxs("button",{className:Z("side-bar__logout-btn"),onClick:()=>G(!0),children:[Ie.jsx(o6,{className:Z("side-bar__icon-logout")}),Ie.jsx("span",{className:Z("side-bar__logout-btn__text"),children:"Logout"})]}),Ie.jsx(G1,{isOpen:U,onClose:()=>G(!1),onConfirm:()=>t.logout?t.logout():rT(t.baseUrl)})]})]})}function d6(t,e){const n=new URL(t,window.location.origin),r=new URL(e,window.location.origin);return n.pathname===r.pathname&&n.search===r.search?3:n.pathname===r.pathname?2:r.pathname.startsWith(n.pathname)?1:0}function h6(t,e){const n=t.map(a=>({item:a,priority:a.path?d6(a.path,e):0})).filter(a=>a.priority>0),r=n.length>0?n.reduce((a,c)=>c.priority>a.priority?c:a).item:null,i=[];let o=r;for(;o;)i.unshift(o),o=t.find(a=>a.id===(o==null?void 0:o.parentKey))||null;return i}function zD(t,e){return t.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=zD(n.children,e)):n.path=e(n.path),n})}function YD(t){return t.map(n=>n.path&&!n.path.includes("http")&&n.path.includes("/")?{...n,path:window.location.origin+n.path}:(n.children&&(n.children=YD(n.children)),n))}function p6(t){return Ie.jsx(HD.div,{children:Ie.jsx(jv,{styles:[BT,s6,l6],style:{position:"sticky",zIndex:1300},children:Ie.jsx(f6,{...t})})})}const g6={"page-container":"_page-container_1pwo1_1","page-main-content":"_page-main-content_1pwo1_8","page-title":"_page-title_1pwo1_19","text-base":"_text-base_1pwo1_26","mt-4":"_mt-4_1pwo1_33"};var yp={exports:{}};/**
|
|
137
137
|
* @license
|
|
138
138
|
* Lodash <https://lodash.com/>
|
|
139
139
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-DIs_XI9p.cjs"),m=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const c=s=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${s}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(r=>o(r.data)).catch(r=>{console.error("Getting user permission error:",r)})},[s]),t},a=s=>(t,o)=>{const r=c(s);return o?t.every(n=>r==null?void 0:r.includes(n)):t.some(n=>r==null?void 0:r.includes(n))},h=({baseUrl:s,accessWith:t,requireAll:o,children:r})=>a(s)(t,o)?i.jsx(i.Fragment,{children:r}):null,P=({accessWith:s,requireAll:t,baseUrl:o,unAuthorizedPath:r,children:n})=>a(o)(s,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:r,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.SaasThemeProvider=e.SaasThemeProvider;exports.TranslationProvider=e.TranslationProvider;exports.axiosInstance=e.axiosInstance;exports.color=e.color;exports.createCustomTheme=e.createCustomTheme;exports.handleErrorAxios=e.handleErrorAxios;exports.login=e.login;exports.logout=e.logout;exports.responseInterceptor=e.responseInterceptor;exports.search=e.search;exports.setFavicon=e.setFavicon;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
|
package/dist/share/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as R, N as S, O as G, a0 as y, Y as F, a as H, c as I, Z as M, U as N, R as O, T as $, V as j, v as w, $ as U, t as V, W as X, b as Y, u as Z, g as _, X as b } from "../index.esm2017-
|
|
1
|
+
import { M as R, N as S, O as G, a0 as y, Y as F, a as H, c as I, Z as M, U as N, R as O, T as $, V as j, v as w, $ as U, t as V, W as X, b as Y, u as Z, g as _, X as b } from "../index.esm2017-D13q7k3i.js";
|
|
2
2
|
import u from "axios";
|
|
3
3
|
import { useState as m, useEffect as c } from "react";
|
|
4
4
|
import { jsx as a, Fragment as n } from "react/jsx-runtime";
|
package/package.json
CHANGED
|
@@ -39828,6 +39828,7 @@ function ece(e) {
|
|
|
39828
39828
|
return /* @__PURE__ */ I.jsx(
|
|
39829
39829
|
$L,
|
|
39830
39830
|
{
|
|
39831
|
+
isInternalApp: e.isInternalApp,
|
|
39831
39832
|
isActive: ge,
|
|
39832
39833
|
isCollapsed: d,
|
|
39833
39834
|
replacePath: e.replacePath,
|