@ukpc-lib/react 0.12.6 → 0.12.7
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-D8jHeHt_.js → index.esm2017-DJUHu_yr.js} +1 -2
- package/dist/{index.esm2017-CgX2g4fr.cjs → index.esm2017-VatsG2Hx.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-BSRZKjgR.js → index-BBdL3Lk4.js} +1 -2
|
@@ -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-VatsG2Hx.cjs"),X=require("moment"),N=require("@mui/material");require("axios");require("@r2wc/react-to-web-component");const mn=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 n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const A=$o(T),Ao=e=>{var r,o;const{tabs:t}=e,n=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-DJUHu_yr.js";
|
|
5
|
+
import { H as au, G as su, K as lu, E as cu, F as uu, J as du } from "../index.esm2017-DJUHu_yr.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";
|
|
@@ -29087,8 +29087,7 @@ function a6(e) {
|
|
|
29087
29087
|
display: "flex",
|
|
29088
29088
|
alignItems: "center",
|
|
29089
29089
|
justifyContent: "center",
|
|
29090
|
-
borderLeft: R && V ? "2px solid
|
|
29091
|
-
cursor: "move"
|
|
29090
|
+
borderLeft: R && V ? "2px solid var(--primary300)" : "transparent"
|
|
29092
29091
|
}
|
|
29093
29092
|
}
|
|
29094
29093
|
);
|
|
@@ -133,7 +133,7 @@ Previous: %s
|
|
|
133
133
|
Incoming: %s`,qi,"["+m.join(", ")+"]","["+l.join(", ")+"]");for(var d=0;d<l.length&&d<m.length;d++)if(!Xt(m[d],l[d]))return!1;return!0}function Vu(){if(xo>0)throw new Error("Rendered more hooks than during the previous render");return{memoizedState:null,queue:null,next:null}}function Si(){return Jt===null?Va===null?(ua=!1,Va=Jt=Vu()):(ua=!0,Jt=Va):Jt.next===null?(ua=!1,Jt=Jt.next=Vu()):(ua=!0,Jt=Jt.next),Jt}function Hu(m,l){wi=l,xs=m,Br=!1,ti=0}function Ua(m,l,d,v){for(;tl;)tl=!1,ti=0,xo+=1,Jt=null,d=m(l,v);return Uu(),d}function $r(){var m=ti!==0;return m}function Uu(){Br=!1,wi=null,xs=null,tl=!1,Va=null,xo=0,xi=null,Jt=null}function Wu(m){return Br&&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()."),ws(m)}function zu(m){return qi="useContext",Ha(),ws(m)}function Wa(m,l){return typeof l=="function"?l(m):l}function ca(m){return qi="useState",Yu(Wa,m)}function Yu(m,l,d){if(m!==Wa&&(qi="useReducer"),wi=Ha(),Jt=Si(),ua){var v=Jt.queue,x=v.dispatch;if(xi!==null){var I=xi.get(v);if(I!==void 0){xi.delete(v);var B=Jt.memoizedState,Y=I;do{var re=Y.action;Br=!0,B=m(B,re),Br=!1,Y=Y.next}while(Y!==null);return Jt.memoizedState=B,[B,x]}}return[Jt.memoizedState,x]}else{Br=!0;var be;m===Wa?be=typeof l=="function"?l():l:be=d!==void 0?d(l):l,Br=!1,Jt.memoizedState=be;var We=Jt.queue={last:null,dispatch:null},Ze=We.dispatch=Bc.bind(null,wi,We);return[Jt.memoizedState,Ze]}}function jc(m,l){wi=Ha(),Jt=Si();var d=l===void 0?null:l;if(Jt!==null){var v=Jt.memoizedState;if(v!==null&&d!==null){var x=v[1];if(Nc(d,x))return v[0]}}Br=!0;var I=m();return Br=!1,Jt.memoizedState=[I,d],I}function Vl(m){wi=Ha(),Jt=Si();var l=Jt.memoizedState;if(l===null){var d={current:m};return Object.seal(d),Jt.memoizedState=d,d}else return l}function Wf(m,l){qi="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 Bc(m,l,d){if(xo>=$u)throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(m===wi){tl=!0;var v={action:d,next:null};xi===null&&(xi=new Map);var x=xi.get(l);if(x===void 0)xi.set(l,v);else{for(var I=x;I.next!==null;)I=I.next;I.next=v}}}function fr(m,l){return jc(function(){return m},l)}function Gu(m,l,d){return Ha(),l(m._source)}function $c(m,l,d){if(d===void 0)throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");return d()}function Ti(m){return Ha(),m}function Hl(){throw new Error("startTransition cannot be called during server rendering.")}function Ss(){return Ha(),[!1,Hl]}function fa(){var m=xs,l=$o(m.treeContext),d=za;if(d===null)throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");var v=ti++;return Bn(d,l,v)}function nl(){}var nr={readContext:Wu,useContext:zu,useMemo:jc,useReducer:Yu,useRef:Vl,useState:ca,useInsertionEffect:nl,useLayoutEffect:Wf,useCallback:fr,useImperativeHandle:nl,useEffect:nl,useDebugValue:nl,useDeferredValue:Ti,useTransition:Ss,useId:fa,useMutableSource:Gu,useSyncExternalStore:$c},za=null;function Ul(m){za=m}function Ts(m){try{var l="",d=m;do{switch(d.tag){case 0:l+=Gi(d.type,null,null);break;case 1:l+=gs(d.type,null,null);break;case 2:l+=Rc(d.type,null,null);break}d=d.parent}while(d);return l}catch(v){return`
|
|
134
134
|
Error generating stack: `+v.message+`
|
|
135
135
|
`+v.stack}}var Wl=n.ReactCurrentDispatcher,Cs=n.ReactDebugCurrentFrame,zl=0,So=1,Yl=2,Ya=3,Vc=4,rl=0,Es=1,ks=2,qu=12800;function Hc(m){return console.error(m),null}function Ga(){}function Gl(m,l,d,v,x,I,B,Y,re){var be=[],We=new Set,Ze={destination:null,responseState:l,progressiveChunkSize:v===void 0?qu:v,status:rl,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:We,pingedTasks:be,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:x===void 0?Hc:x,onAllReady:I===void 0?Ga:I,onShellReady:B===void 0?Ga:B,onShellError:Y===void 0?Ga:Y,onFatalError:re===void 0?Ga:re},it=il(Ze,0,null,d,!1,!1);it.parentFlushed=!0;var St=Ho(Ze,m,null,it,We,qn,Fl,$f);return be.push(St),Ze}function Vo(m,l){var d=m.pingedTasks;d.push(l),d.length===1&&s(function(){return tc(m)})}function ql(m,l){return{id:_i,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:l,errorDigest:null}}function Ho(m,l,d,v,x,I,B,Y){m.allPendingTasks++,d===null?m.pendingRootTasks++:d.pendingTasks++;var re={node:l,ping:function(){return Vo(m,re)},blockedBoundary:d,blockedSegment:v,abortSet:x,legacyContext:I,context:B,treeContext:Y};return re.componentStack=null,x.add(re),re}function il(m,l,d,v,x,I){return{status:zl,id:-1,index:l,parentFlushed:!1,chunks:[],children:[],formatContext:v,boundary:d,lastPushedText:x,textEmbedded:I}}var Xi=null;function Ki(){return Xi===null||Xi.componentStack===null?"":Ts(Xi.componentStack)}function To(m,l){m.componentStack={tag:0,parent:m.componentStack,type:l}}function ol(m,l){m.componentStack={tag:1,parent:m.componentStack,type:l}}function da(m,l){m.componentStack={tag:2,parent:m.componentStack,type:l}}function Zi(m){m.componentStack===null?i("Unexpectedly popped too many stack frames. This is a bug in React."):m.componentStack=m.componentStack.parent}var Ds=null;function Xl(m,l){{var d;typeof l=="string"?d=l:l&&typeof l.message=="string"?d=l.message:d=String(l);var v=Ds||Ki();Ds=null,m.errorMessage=d,m.errorComponentStack=v}}function al(m,l){var d=m.onError(l);if(d!=null&&typeof d!="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 d+'" instead');return d}function Os(m,l){var d=m.onShellError;d(l);var v=m.onFatalError;v(l),m.destination!==null?(m.status=ks,V(m.destination,l)):(m.status=Es,m.fatalError=l)}function Uc(m,l,d){To(l,"Suspense");var v=l.blockedBoundary,x=l.blockedSegment,I=d.fallback,B=d.children,Y=new Set,re=ql(m,Y),be=x.chunks.length,We=il(m,be,re,x.formatContext,!1,!1);x.children.push(We),x.lastPushedText=!1;var Ze=il(m,0,null,x.formatContext,!1,!1);Ze.parentFlushed=!0,l.blockedBoundary=re,l.blockedSegment=Ze;try{if(Ci(m,l,B),Rn(Ze.chunks,m.responseState,Ze.lastPushedText,Ze.textEmbedded),Ze.status=So,ga(re,Ze),re.pendingTasks===0){Zi(l);return}}catch(St){Ze.status=Vc,re.forceClientRender=!0,re.errorDigest=al(m,St),Xl(re,St)}finally{l.blockedBoundary=v,l.blockedSegment=x}var it=Ho(m,I,v,We,Y,l.legacyContext,l.context,l.treeContext);it.componentStack=l.componentStack,m.pingedTasks.push(it),Zi(l)}function Xu(m,l,d,v){To(l,d);var x=l.blockedSegment,I=uo(x.chunks,d,v,m.responseState,x.formatContext);x.lastPushedText=!1;var B=x.formatContext;x.formatContext=gi(B,d,v),Ci(m,l,I),x.formatContext=B,Io(x.chunks,d),x.lastPushedText=!1,Zi(l)}function Ku(m){return m.prototype&&m.prototype.isReactComponent}function qa(m,l,d,v,x){var I={};Hu(l,I);var B=d(v,x);return Ua(d,v,B,x)}function Zu(m,l,d,v,x){var I=d.render();d.props!==x&&(Zl||i("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",gn(v)||"a component"),Zl=!0);{var B=v.childContextTypes;if(B!=null){var Y=l.legacyContext,re=Mu(d,v,Y,B);l.legacyContext=re,dr(m,l,I),l.legacyContext=Y;return}}dr(m,l,I)}function Kl(m,l,d,v){da(l,d);var x=ia(d,l.legacyContext),I=wo(d,v,x);el(I,d,v,x),Zu(m,l,I,d,v),Zi(l)}var Bt={},sl={},Ju={},Xa={},Zl=!1,Wc={},zc=!1,ni=!1,Yc=!1;function Jl(m,l,d,v){var x;if(x=ia(d,l.legacyContext),ol(l,d),d.prototype&&typeof d.prototype.render=="function"){var I=gn(d)||"Unknown";Bt[I]||(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.",I,I),Bt[I]=!0)}var B=qa(m,l,d,v,x),Y=$r();if(typeof B=="object"&&B!==null&&typeof B.render=="function"&&B.$$typeof===void 0){var re=gn(d)||"Unknown";sl[re]||(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.",re,re,re),sl[re]=!0)}if(typeof B=="object"&&B!==null&&typeof B.render=="function"&&B.$$typeof===void 0){{var be=gn(d)||"Unknown";sl[be]||(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.",be,be,be),sl[be]=!0)}el(B,d,v,x),Zu(m,l,B,d,v)}else if(Qu(d),Y){var We=l.treeContext,Ze=1,it=0;l.treeContext=ju(We,Ze,it);try{dr(m,l,B)}finally{l.treeContext=We}}else dr(m,l,B);Zi(l)}function Qu(m){{if(m&&m.childContextTypes&&i("%s(...): childContextTypes cannot be defined on a function component.",m.displayName||m.name||"Component"),m.defaultProps!==void 0){var l=gn(m)||"Unknown";Wc[l]||(i("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",l),Wc[l]=!0)}if(typeof m.getDerivedStateFromProps=="function"){var d=gn(m)||"Unknown";Xa[d]||(i("%s: Function components do not support getDerivedStateFromProps.",d),Xa[d]=!0)}if(typeof m.contextType=="object"&&m.contextType!==null){var v=gn(m)||"Unknown";Ju[v]||(i("%s: Function components do not support contextType.",v),Ju[v]=!0)}}}function ec(m,l){if(m&&m.defaultProps){var d=Q({},l),v=m.defaultProps;for(var x in v)d[x]===void 0&&(d[x]=v[x]);return d}return l}function Gc(m,l,d,v,x){ol(l,d.render);var I=qa(m,l,d.render,v,x),B=$r();if(B){var Y=l.treeContext,re=1,be=0;l.treeContext=ju(Y,re,be);try{dr(m,l,I)}finally{l.treeContext=Y}}else dr(m,l,I);Zi(l)}function Vr(m,l,d,v,x){var I=d.type,B=ec(I,v);Ka(m,l,I,B,x)}function ha(m,l,d,v){d._context===void 0?d!==d.Consumer&&(Yc||(Yc=!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?"))):d=d._context;var x=v.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 I=ws(d),B=x(I);dr(m,l,B)}function Hr(m,l,d,v){var x=d._context,I=v.value,B=v.children,Y;Y=l.context,l.context=Lu(x,I),dr(m,l,B),l.context=Ff(x),Y!==l.context&&i("Popping the context provider did not return back to the original snapshot. This is a bug in React.")}function qc(m,l,d,v,x){To(l,"Lazy");var I=d._payload,B=d._init,Y=B(I),re=ec(Y,v);Ka(m,l,Y,re,x),Zi(l)}function Ka(m,l,d,v,x){if(typeof d=="function")if(Ku(d)){Kl(m,l,d,v);return}else{Jl(m,l,d,v);return}if(typeof d=="string"){Xu(m,l,d,v);return}switch(d){case Gn:case Vt:case Z:case ue:case De:{dr(m,l,v.children);return}case ft:{To(l,"SuspenseList"),dr(m,l,v.children),Zi(l);return}case xt:throw new Error("ReactDOMServer does not yet support scope components.");case ut:{Uc(m,l,v);return}}if(typeof d=="object"&&d!==null)switch(d.$$typeof){case Ve:{Gc(m,l,d,v,x);return}case ot:{Vr(m,l,d,v,x);return}case se:{Hr(m,l,d,v);return}case Me:{ha(m,l,d,v);return}case Mt:{qc(m,l,d,v);return}}var I="";throw(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(I+=" 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: "+(d==null?d:typeof d)+"."+I))}function Xc(m,l){typeof Symbol=="function"&&m[Symbol.toStringTag]==="Generator"&&(zc||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."),zc=!0),m.entries===l&&(ni||i("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ni=!0)}function dr(m,l,d){try{return Kc(m,l,d)}catch(v){throw typeof v=="object"&&v!==null&&typeof v.then=="function"||(Ds=Ds!==null?Ds:Ki()),v}}function Kc(m,l,d){if(l.node=d,typeof d=="object"&&d!==null){switch(d.$$typeof){case fe:{var v=d,x=v.type,I=v.props,B=v.ref;Ka(m,l,x,I,B);return}case Te: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 Mt:{var Y=d,re=Y._payload,be=Y._init,We;try{We=be(re)}catch(Ji){throw typeof Ji=="object"&&Ji!==null&&typeof Ji.then=="function"&&To(l,"Lazy"),Ji}dr(m,l,We);return}}if(Qn(d)){Ql(m,l,d);return}var Ze=Nr(d);if(Ze){Xc(d,Ze);var it=Ze.call(d);if(it){var St=it.next();if(!St.done){var tn=[];do tn.push(St.value),St=it.next();while(!St.done);Ql(m,l,tn);return}return}}var rr=Object.prototype.toString.call(d);throw new Error("Objects are not valid as a React child (found: "+(rr==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":rr)+"). If you meant to render a collection of children, use an array instead.")}if(typeof d=="string"){var Co=l.blockedSegment;Co.lastPushedText=Pn(l.blockedSegment.chunks,d,m.responseState,Co.lastPushedText);return}if(typeof d=="number"){var va=l.blockedSegment;va.lastPushedText=Pn(l.blockedSegment.chunks,""+d,m.responseState,va.lastPushedText);return}typeof d=="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 Ql(m,l,d){for(var v=d.length,x=0;x<v;x++){var I=l.treeContext;l.treeContext=ju(I,v,x);try{Ci(m,l,d[x])}finally{l.treeContext=I}}}function eu(m,l,d){var v=l.blockedSegment,x=v.chunks.length,I=il(m,x,null,v.formatContext,v.lastPushedText,!0);v.children.push(I),v.lastPushedText=!1;var B=Ho(m,l.node,l.blockedBoundary,I,l.abortSet,l.legacyContext,l.context,l.treeContext);l.componentStack!==null&&(B.componentStack=l.componentStack.parent);var Y=B.ping;d.then(Y,Y)}function Ci(m,l,d){var v=l.blockedSegment.formatContext,x=l.legacyContext,I=l.context,B=null;B=l.componentStack;try{return dr(m,l,d)}catch(Y){if(Uu(),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"){eu(m,l,Y),l.blockedSegment.formatContext=v,l.legacyContext=x,l.context=I,sa(I),l.componentStack=B;return}else throw l.blockedSegment.formatContext=v,l.legacyContext=x,l.context=I,sa(I),l.componentStack=B,Y}}function Zc(m,l,d,v){var x=al(m,v);if(l===null?Os(m,v):(l.pendingTasks--,l.forceClientRender||(l.forceClientRender=!0,l.errorDigest=x,Xl(l,v),l.parentFlushed&&m.clientRenderedBoundaries.push(l))),m.allPendingTasks--,m.allPendingTasks===0){var I=m.onAllReady;I()}}function pa(m){var l=this,d=m.blockedBoundary,v=m.blockedSegment;v.status=Ya,Za(l,d,v)}function tu(m,l,d){var v=m.blockedBoundary,x=m.blockedSegment;if(x.status=Ya,v===null)l.allPendingTasks--,l.status!==ks&&(l.status=ks,l.destination!==null&&P(l.destination));else{if(v.pendingTasks--,!v.forceClientRender){v.forceClientRender=!0;var I=d===void 0?new Error("The render was aborted by the server without a reason."):d;v.errorDigest=l.onError(I);{var B="The server did not finish this Suspense boundary: ";I&&typeof I.message=="string"?I=B+I.message:I=B+String(I);var Y=Xi;Xi=m;try{Xl(v,I)}finally{Xi=Y}}v.parentFlushed&&l.clientRenderedBoundaries.push(v)}if(v.fallbackAbortableTasks.forEach(function(be){return tu(be,l,d)}),v.fallbackAbortableTasks.clear(),l.allPendingTasks--,l.allPendingTasks===0){var re=l.onAllReady;re()}}}function ga(m,l){if(l.chunks.length===0&&l.children.length===1&&l.children[0].boundary===null){var d=l.children[0];d.id=l.id,d.parentFlushed=!0,d.status===So&&ga(m,d)}else{var v=m.completedSegments;v.push(l)}}function Za(m,l,d){if(l===null){if(d.parentFlushed){if(m.completedRootSegment!==null)throw new Error("There can only be one root segment. This is a bug in React.");m.completedRootSegment=d}if(m.pendingRootTasks--,m.pendingRootTasks===0){m.onShellError=Ga;var v=m.onShellReady;v()}}else if(l.pendingTasks--,!l.forceClientRender){if(l.pendingTasks===0)d.parentFlushed&&d.status===So&&ga(l,d),l.parentFlushed&&m.completedBoundaries.push(l),l.fallbackAbortableTasks.forEach(pa,m),l.fallbackAbortableTasks.clear();else if(d.parentFlushed&&d.status===So){ga(l,d);var x=l.completedSegments;x.length===1&&l.parentFlushed&&m.partialBoundaries.push(l)}}if(m.allPendingTasks--,m.allPendingTasks===0){var I=m.onAllReady;I()}}function zf(m,l){var d=l.blockedSegment;if(d.status===zl){sa(l.context);var v=null;v=Xi,Xi=l;try{dr(m,l,l.node),Rn(d.chunks,m.responseState,d.lastPushedText,d.textEmbedded),l.abortSet.delete(l),d.status=So,Za(m,l.blockedBoundary,d)}catch(I){if(Uu(),typeof I=="object"&&I!==null&&typeof I.then=="function"){var x=l.ping;I.then(x,x)}else l.abortSet.delete(l),d.status=Vc,Zc(m,l.blockedBoundary,d,I)}finally{Xi=v}}}function tc(m){if(m.status!==ks){var l=Ac(),d=Wl.current;Wl.current=nr;var v;v=Cs.getCurrentStack,Cs.getCurrentStack=Ki;var x=za;Ul(m.responseState);try{var I=m.pingedTasks,B;for(B=0;B<I.length;B++){var Y=I[B];zf(m,Y)}I.splice(0,B),m.destination!==null&&Ii(m,m.destination)}catch(re){al(m,re),Os(m,re)}finally{Ul(x),Wl.current=d,Cs.getCurrentStack=v,d===nr&&sa(l)}}}function ll(m,l,d){switch(d.parentFlushed=!0,d.status){case zl:{var v=d.id=m.nextSegmentId++;return d.lastPushedText=!1,d.textEmbedded=!1,cr(l,m.responseState,v)}case So:{d.status=Yl;for(var x=!0,I=d.chunks,B=0,Y=d.children,re=0;re<Y.length;re++){for(var be=Y[re];B<be.index;B++)g(l,I[B]);x=ul(m,l,be)}for(;B<I.length-1;B++)g(l,I[B]);return B<I.length&&(x=S(l,I[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(m,l,d){var v=d.boundary;if(v===null)return ll(m,l,d);if(v.parentFlushed=!0,v.forceClientRender)return Ye(l,m.responseState,v.errorDigest,v.errorMessage,v.errorComponentStack),ll(m,l,d),kt(l,m.responseState);if(v.pendingTasks>0){v.rootSegmentID=m.nextSegmentId++,v.completedSegments.length>0&&m.partialBoundaries.push(v);var x=v.id=rn(m.responseState);return xe(l,m.responseState,x),ll(m,l,d),Ct(l,m.responseState)}else{if(v.byteSize>m.progressiveChunkSize)return v.rootSegmentID=m.nextSegmentId++,m.completedBoundaries.push(v),xe(l,m.responseState,v.id),ll(m,l,d),Ct(l,m.responseState);Ae(l,m.responseState);var I=v.completedSegments;if(I.length!==1)throw new Error("A previously unvisited boundary must have exactly one root segment. This is a bug in React.");var B=I[0];return ul(m,l,B),st(l,m.responseState)}}function nc(m,l,d){return Il(l,m.responseState,d.id,d.errorDigest,d.errorMessage,d.errorComponentStack)}function nu(m,l,d){return Tt(l,m.responseState,d.formatContext,d.id),ul(m,l,d),bt(l,d.formatContext)}function rc(m,l,d){for(var v=d.completedSegments,x=0;x<v.length;x++){var I=v[x];Ur(m,l,d,I)}return v.length=0,go(l,m.responseState,d.id,d.rootSegmentID)}function Jc(m,l,d){for(var v=d.completedSegments,x=0;x<v.length;x++){var I=v[x];if(!Ur(m,l,d,I))return x++,v.splice(0,x),!1}return v.splice(0,x),!0}function Ur(m,l,d,v){if(v.status===Yl)return!0;var x=v.id;if(x===-1){var I=v.id=d.rootSegmentID;if(I===-1)throw new Error("A root segment ID must have been assigned by now. This is a bug in React.");return nu(m,l,v)}else return nu(m,l,v),zs(l,m.responseState,x)}function Ii(m,l){y();try{var d=m.completedRootSegment;d!==null&&m.pendingRootTasks===0&&(ul(m,l,d),m.completedRootSegment=null,bi(l,m.responseState));var v=m.clientRenderedBoundaries,x;for(x=0;x<v.length;x++){var I=v[x];nc(m,l,I)}v.splice(0,x);var B=m.completedBoundaries;for(x=0;x<B.length;x++){var Y=B[x];rc(m,l,Y)}B.splice(0,x),C(l),y(l);var re=m.partialBoundaries;for(x=0;x<re.length;x++){var be=re[x];if(!Jc(m,l,be)){m.destination=null,x++,re.splice(0,x);return}}re.splice(0,x);var We=m.completedBoundaries;for(x=0;x<We.length;x++){var Ze=We[x];rc(m,l,Ze)}We.splice(0,x)}finally{C(l),m.allPendingTasks===0&&m.pingedTasks.length===0&&m.clientRenderedBoundaries.length===0&&m.completedBoundaries.length===0&&(m.abortableTasks.size!==0&&i("There was still abortable task at the root when we closed. This is a bug in React."),P(l))}}function Qc(m){s(function(){return tc(m)})}function Yf(m,l){if(m.status===Es){m.status=ks,V(l,m.fatalError);return}if(m.status!==ks&&m.destination===null){m.destination=l;try{Ii(m,l)}catch(d){al(m,d),Os(m,d)}}}function cl(m,l){try{var d=m.abortableTasks;d.forEach(function(v){return tu(v,m,l)}),d.clear(),m.destination!==null&&Ii(m,m.destination)}catch(v){al(m,v),Os(m,v)}}function _s(m,l){return new Promise(function(d,v){var x,I,B=new Promise(function(it,St){I=it,x=St});function Y(){var it=new ReadableStream({type:"bytes",pull:function(St){Yf(be,St)},cancel:function(St){cl(be)}},{highWaterMark:0});it.allReady=B,d(it)}function re(it){B.catch(function(){}),v(it)}var be=Gl(m,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),pi(l?l.namespaceURI:void 0),l?l.progressiveChunkSize:void 0,l?l.onError:void 0,I,Y,re,x);if(l&&l.signal){var We=l.signal,Ze=function(){cl(be,We.reason),We.removeEventListener("abort",Ze)};We.addEventListener("abort",Ze)}Qc(be)})}Bh.renderToReadableStream=_s,Bh.version=t}()),Bh}var Cc,Pm;process.env.NODE_ENV==="production"?(Cc=I4(),Pm=A4()):(Cc=M4(),Pm=L4());Cc.version;var F4=Cc.renderToString;Cc.renderToStaticMarkup;Cc.renderToNodeStream;Cc.renderToStaticNodeStream;Pm.renderToReadableStream;var N4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function OD(e,t){return e(t={exports:{}},t.exports),t.exports}var j4=OD(function(e){(function(t){var n=function(M,R,V){if(!f(R)||y(R)||g(R)||S(R)||c(R))return R;var U,J=0,K=0;if(p(R))for(U=[],K=R.length;J<K;J++)U.push(n(M,R[J],V));else for(var le in U={},R)Object.prototype.hasOwnProperty.call(R,le)&&(U[M(le,V)]=n(M,R[le],V));return U},r=function(M){return C(M)?M:(M=M.replace(/[\-_\s]+(.)?/g,function(R,V){return V?V.toUpperCase():""})).substr(0,1).toLowerCase()+M.substr(1)},i=function(M){var R=r(M);return R.substr(0,1).toUpperCase()+R.substr(1)},o=function(M,R){return function(V,U){var J=(U=U||{}).separator||"_",K=U.split||/(?=[A-Z])/;return V.split(K).join(J)}(M,R).toLowerCase()},s=Object.prototype.toString,c=function(M){return typeof M=="function"},f=function(M){return M===Object(M)},p=function(M){return s.call(M)=="[object Array]"},y=function(M){return s.call(M)=="[object Date]"},g=function(M){return s.call(M)=="[object RegExp]"},S=function(M){return s.call(M)=="[object Boolean]"},C=function(M){return(M-=0)==M},P=function(M,R){var V=R&&"process"in R?R.process:R;return typeof V!="function"?M:function(U,J){return V(U,M,J)}},A={camelize:r,decamelize:o,pascalize:i,depascalize:o,camelizeKeys:function(M,R){return n(P(r,R),M)},decamelizeKeys:function(M,R){return n(P(o,R),M,R)},pascalizeKeys:function(M,R){return n(P(i,R),M)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=A:t.humps=A})(N4)}).decamelize,B4=function(e){if(Array.isArray(e))return e},$4=function(e,t){if(typeof Symbol<"u"&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,c=e[Symbol.iterator]();!(r=(s=c.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(f){i=!0,o=f}finally{try{r||c.return==null||c.return()}finally{if(i)throw o}}return n}},d1=function(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},V4=function(e,t){if(e){if(typeof e=="string")return d1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d1(e,t):void 0}},H4=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.`)},U4=function(e,t){return B4(e)||$4(e,t)||V4(e,t)||H4()},_D=OD(function(e){function t(){return e.exports=t=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},t.apply(this,arguments)}e.exports=t}),W4=function(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i},PD=function(e,t){if(e==null)return{};var n,r,i=W4(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},z4=q.createContext(null);function RD(e){var t=e.children,n=t===void 0?"":t,r=PD(e,["children"]);return typeof n!="string"&&(n=F4(n)),q.createElement("template",_D({},r,{dangerouslySetInnerHTML:{__html:n}}))}function ID(e){var t=e.root,n=e.children;return Vm.createPortal(n===void 0?null:n,t)}function Y4(e){var t=q.forwardRef(function(n,r){var i,o,s=n.mode,c=s===void 0?"open":s,f=n.delegatesFocus,p=f!==void 0&&f,y=n.styleSheets,g=y===void 0?[]:y,S=n.ssr,C=S!==void 0&&S,P=n.children,A=PD(n,["mode","delegatesFocus","styleSheets","ssr","children"]),M=(o=q.useRef((i=r)&&i.current),q.useEffect(function(){i&&(i.current=o.current)},[i]),o),R=q.useState(null),V=U4(R,2),U=V[0],J=V[1],K="node_".concat(c).concat(p);return q.useLayoutEffect(function(){if(M.current)try{if(typeof r=="function"&&r(M.current),C){var le=M.current.shadowRoot;return void J(le)}var T=M.current.attachShadow({mode:c,delegatesFocus:p});g.length>0&&(T.adoptedStyleSheets=g),J(T)}catch(he){(function(oe){var ze=oe.error,je=oe.styleSheets,Pe=oe.root;switch(ze.name){case"NotSupportedError":je.length>0&&(Pe.adoptedStyleSheets=je);break;default:throw ze}})({error:he,styleSheets:g,root:U})}},[r,M,g]),q.createElement(q.Fragment,null,q.createElement(e.tag,_D({key:K,ref:M},A),(U||C)&&q.createElement(z4.Provider,{value:U},C?q.createElement(RD,{shadowroot:c,shadowrootmode:c},e.render({root:U,ssr:C,children:P})):q.createElement(ID,{root:U},e.render({root:U,ssr:C,children:P})))))});return t.propTypes={mode:Ea.oneOf(["open","closed"]),delegatesFocus:Ea.bool,styleSheets:Ea.arrayOf(Ea.instanceOf(globalThis.CSSStyleSheet)),ssr:Ea.bool,children:Ea.node},t}RD.propTypes={children:Ea.oneOfType([Ea.string,Ea.node])},ID.propTypes={root:Ea.object.isRequired,children:Ea.node};var Sv=new Map;function G4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=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(e,{get:function(r,i){var o=j4(i,{separator:"-"}),s="".concat(t,"-").concat(o);return Sv.has(s)||Sv.set(s,Y4({tag:o,render:n})),Sv.get(s)}})}var AD=G4();const q4=".app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}",X4=".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 h1;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(h1||(h1={}));const K4=Object.freeze({x:0,y:0});var wf;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(wf||(wf={}));var p1;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(p1||(p1={}));var ka;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ka||(ka={}));ka.Space,ka.Enter,ka.Esc,ka.Space,ka.Enter,ka.Tab;var g1;(function(e){e[e.RightClick=2]="RightClick"})(g1||(g1={}));var v1;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(v1||(v1={}));var m1;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(m1||(m1={}));wf.Backward+"",wf.Forward+"",wf.Backward+"",wf.Forward+"";var Rm;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Rm||(Rm={}));var Im;(function(e){e.Optimized="optimized"})(Im||(Im={}));Rm.WhileDragging,Im.Optimized;({...K4});var y1;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(y1||(y1={}));function Z4(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}ka.Down,ka.Right,ka.Up,ka.Left;function J4(e){const t=new CustomEvent("updateFavoriteMenu",{detail:{menuItem:e}});window.dispatchEvent(t)}const Tv="MENU_ITEM";function Q4(e){const t=kp.useLocation(),[n,r]=q.useState([]),[i,o]=q.useState(!1);console.log("isSubmit",i);const s=q.useRef(null),[c,f]=q.useState(window.location.href);q.useEffect(()=>{f(window.location.href)},[t]);const p=M=>`${M}`;function y(M,R){for(const V of M){if(V.id===R)return V;if(V.children){const U=y(V.children,R);if(U)return U}}return null}function g(M,R){const V=y(n,M);V?(V.isFavorite=R,J4(V),Zy(M,R)):console.error(`Item with id ${M} not found`)}const S=M=>{console.log("Favorite menus changed",M);const R=M.detail.favoriteMenus||[];r(R)};q.useEffect(()=>(window.addEventListener("favoriteMenusChange",S),()=>{window.removeEventListener("favoriteMenusChange",S)}),[]);const C=(M,R)=>{n[M];const V=Z4(n,M,R);r(V),o(!0);const U={menuItemIds:V.map(J=>J.id)};Da.post("global-menu-config/api/v1/menu-items/user/order-favorites",U,{baseURL:e.baseUrl}).then(()=>{}).catch(J=>{console.error(J),r(n)}).finally(()=>{o(!1)})},P=({item:M,index:R})=>{const V=q.useRef(null),[{isDragging:U},J]=BE({type:Tv,item:()=>({id:M.id,index:R}),collect:oe=>({isDragging:oe.isDragging()})}),[{isOver:K,isOverCurrent:le},T]=hp(()=>({accept:Tv,collect:oe=>({isOver:oe.isOver(),isOverCurrent:oe.isOver({shallow:!0})}),drop:oe=>{C(oe.index,R),oe.index=R}}),[]);let he="hover-off";return(le||K)&&(he="hover-on"),J(T(V)),Fe.jsx("div",{ref:V,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 ${he}`,children:Fe.jsx(DD,{replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,item:M,level:1,onSetFavoriteSuccess:g})})},A=()=>{const M=q.useRef(null),[{isOver:R,canDrop:V},U]=hp(()=>({accept:Tv,drop:J=>{C(J.index,n.length-1),J.index=n.length-1},collect:J=>({isOver:J.isOver(),canDrop:J.canDrop()})}),[n]);return U(M),Fe.jsx("div",{ref:M,style:{height:40,width:150,display:"flex",alignItems:"center",justifyContent:"center",borderLeft:R&&V?"2px solid red":"transparent",cursor:"move"}})};return Fe.jsx(Fe.Fragment,{children:n.length?Fe.jsx("div",{className:p("favorite-menu"),children:Fe.jsx(Xm,{ref:s,className:p("wrap-section favorite-menu__menu"),style:{marginTop:4,flex:1,overflow:"auto",height:"100%",overflowY:"hidden"},children:Fe.jsx(AE,{backend:UT,children:Fe.jsxs("div",{style:{display:"inline-flex"},children:[n.map((M,R)=>Fe.jsx(P,{item:M,index:R},M.id)),Fe.jsx(A,{})]})})})}):""})}function e6(e=32){const[t,n]=q.useState(!0),[r,i]=q.useState(0),o=()=>{const s=window.scrollY;s>r&&s>e?n(!1):s<r&&n(!0),i(s)};return q.useEffect(()=>(window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)),[r]),{isFavoriteBarVisible:t}}function t6(e){const{isFavoriteBarVisible:t}=e6();return Fe.jsxs(Fe.Fragment,{children:[Fe.jsx("style",{children:X4}),Fe.jsx("div",{className:`favorite-bar ${t?"favorite-bar--visible":"favorite-bar--hidden"}`,children:Fe.jsx(AD.div,{children:Fe.jsx(Ym,{styles:[PT,R4,q4],children:Fe.jsx(Q4,{...e})})})})]})}function Zy(e,t){const n=JSON.parse(localStorage.getItem("favoriteItems")||"[]");if(t)n.includes(e)||n.push(e);else{const r=n.indexOf(e);r>-1&&n.splice(r,1)}localStorage.setItem("favoriteItems",JSON.stringify(n))}function MD({...e}){var Ee,Ue,$e,ke,_e;const t=e.item,n=e.level||0,r=!!((Ee=e.item.children)!=null&&Ee.length),{isActive:i,isCollapsed:o}=e,s=`level-${n}`,c=o?"collapsed":"expanded",f=i(t.id)?"active":"",p=r?"parent":"child",y=e.params.isOpen?"isOpen":"isClose",g=e.isInternalApp?"isInternalApp":"",S=(Ne,rt=s)=>`${Ne} ${rt} ${c} ${f} ${p} ${y} ${g}`,[C,P]=q.useState(!1),[A,M]=q.useState(t.isFavorite||!1);q.useEffect(()=>{M(!!e.item.isFavorite)},[e.item.isFavorite]);const R=q.useRef(),V=q.useRef();V!=null&&V.current&&((Ue=V==null?void 0:V.current)==null?void 0:Ue.scrollWidth)>(($e=V==null?void 0:V.current)==null?void 0:$e.clientWidth);const U=window.location.origin,J=t.path&&t.path.includes("http")?new URL(t.path):{origin:"",pathname:""},K=window.location.pathname.split("/")[1],le=J.pathname.split("/")[1],T=e.item.redirectUrl||e.ssr||!U.includes("local")&&U!==J.origin||le!==K,he=r?"div":!e.isInternalApp&&T?"a":kp.Link,oe=t.redirectUrl||t.path||"#",ze=n+1,je=r&&o&&C,Pe=o||n===0?void 0:`${n+.25}rem`,Be=()=>{P(!0)},He=()=>{P(!1)},ce="/global-menu-config/api/v1/menu-items/user/set-favorite",Se=t.serviceKey==="mn_poms";e.params.depth*20,e.params.depth,OH(t.id,e.params.isOpen,e.params.onToggle);const Ie=Ne=>{Ne.stopPropagation(),e.params.onToggle()},tt=Se||o&&n===0?t.name==="POMs"?"Parking Operations Management":t.description||t.name:null;Object.entries(e.brandColors||{}).reduce((Ne,[rt,at])=>(at&&(Ne[`--${rt}`]=at),Ne),{});const we=U!==J.origin||e.item.redirectUrl?"_blank":"_self";return Fe.jsxs("div",{ref:R,className:S("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s"},onMouseOver:Be,onMouseOut:He,onDragStart:Ne=>{o&&n>1&&Ne.preventDefault()},children:[Fe.jsx(os.Tooltip,{placement:"top",title:tt,disableInteractive:!0,children:Fe.jsxs(he,{target:we,to:oe,href:oe,draggable:"true",className:S("menu-item__link"),style:{paddingLeft:Pe,transition:"all 0.3s",color:i(t.id)?((ke=e.brandColors)==null?void 0:ke.primary400)||ii.primary400:void 0,backgroundColor:i(t.id)&&n===0?(_e=e.brandColors)==null?void 0:_e.primary200:void 0},onClick:Ne=>{o||Ie(Ne)},children:[Fe.jsx(n6,{cls:S,item:t}),Fe.jsx("span",{className:S("menu-item__label"),ref:V,children:t.name}),Fe.jsx(r6,{tooltipPosition:tt?"right":"top",menuLevel:n,hasChildren:r,isHovered:C,isFavorite:A,onClick:Ne=>{const rt={menuConfigId:t.id,isFavorite:Ne},at=e.baseUrl+ce;Da.post(at,rt).then(ht=>{var lt;M(Ne),Zm("Set favorite menu item successfully"),(lt=e.onSetFavoriteSuccess)==null||lt.call(e,e.item.id,Ne),Zy(e.item.id,Ne)}).catch(ht=>{var lt,mt;Vd(((mt=(lt=ht.response)==null?void 0:lt.data)==null?void 0:mt.errorMessage)||"Have error when set favorite menu item")})}}),r&&Fe.jsx("div",{className:S("menu-item__icon-arrow__wrapper"),children:Fe.jsx(Z5,{className:S(`menu-item__icon-arrow__icon ${e.params.isOpen?"open":"close"}`)})})]})}),je&&Fe.jsx(J5,{parentRef:R,onlyChild:!o,renderChildren:({maxHeight:Ne})=>{var rt;return Fe.jsx(yD.div,{className:S(`menu-item__dropdown ${e.params.isOpen?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${ze}`),style:Xy({maxHeight:Ne,overflowY:"auto",paddingRight:3},Ne!=="auto"&&!!ze),children:(rt=t.children)==null?void 0:rt.map(at=>q.createElement(MD,{...e,key:at.id,item:at,level:ze}))})}})]})}function n6({item:e,cls:t}){return Fe.jsx("div",{className:t("menu-item__icon"),children:Fe.jsx(kD,{item:e})})}function r6(e){const t={marginRight:e.hasChildren?10:0,fontSize:18,fill:ii.warning};return Fe.jsxs(Fe.Fragment,{children:[e.isHovered&&!e.isFavorite&&Fe.jsx(os.Tooltip,{placement:e.tooltipPosition||"top",title:"Add to favorites",disableInteractive:!0,children:Fe.jsx("div",{children:Fe.jsx(bD,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!0)}})})}),e.isFavorite&&Fe.jsx(os.Tooltip,{placement:e.tooltipPosition||"top",title:"Remove from favorites",disableInteractive:!0,children:Fe.jsx("div",{children:Fe.jsx(wD,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!1)}})})})]})}function i6(){return Fe.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:Fe.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 o6(){return Fe.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:Fe.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function a6(e){return Fe.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:Fe.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: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;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%}.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.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.menu-item__link.collapsed.level-0{padding: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-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;color:#292929;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}.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: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: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}}",l6=e=>{const t=e.isCollapsed?0:e.depth*16;return Fe.jsx("div",{style:{backgroundColor:e.color||"#93D500",height:"2px",position:"absolute",right:"0",top:"0",left:t}})},u6=".app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}",c6=e=>{const[t,n]=q.useState(()=>{const r=localStorage.getItem("openingMenuIds");return r&&r!=="[]"?JSON.parse(r):(e==null?void 0:e.initOpenIds)||[]});return q.useEffect(()=>{localStorage.setItem("openingMenuIds",JSON.stringify(t))},[t]),[t,n]};function LD(e){document.documentElement.style.setProperty("--global-menu-width",!e||e==="true"?"64px":"17rem")}const Xh=localStorage.getItem("isCollapsed");LD(Xh);function f6(e){const t=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:e}});window.dispatchEvent(t)}function d6(e){const t=kp.useLocation(),[n,r]=q.useState([]),i=n.map(je=>je.data),[o,s]=q.useState(!1),[c,f]=q.useState([]),[p,y]=q.useState(Xh===null?!0:Xh==="true"),[g,S]=q.useState(window.location.href),C=q.useRef(null);q.useEffect(()=>{var je;(je=e.handleCallback)==null||je.call(e,i)},[i,e.handleCallback]),q.useEffect(()=>{S(window.location.href)},[t]);const P=p6(i,g),[A,M]=c6({initOpenIds:e.initOpenIds}),R=()=>{var je,Pe;if(y(!p),localStorage.setItem("isCollapsed",JSON.stringify(!p)),LD(p),p)A&&((je=C.current)==null||je.open(A));else{const Be=n.filter(He=>He.parent===0).map(He=>He.id);console.log("closeIds:",Be),(Pe=C.current)==null||Pe.close(Be)}},[V,U]=q.useState(!1),J=p?"collapsed":"expanded",K=je=>`${je} ${J}`,le=q.useRef(null);q.useLayoutEffect(()=>{(async()=>{var Pe,Be;try{const He=e.menuPath||"/global-menu-config/api/v1/menu-items/user",ce=e.baseUrl+He,{data:Se}=await Da.get(ce);let Ie=Se.map(tt=>({...tt,parentKey:tt.parentKey||0}));Ie=ND(Ie),e.replacePath&&(Ie=FD(Ie,e.replacePath));const Ge=Ie.map(tt=>({id:tt.id,parent:tt.parentKey,text:tt.name,data:tt}));r(Ge)}catch(He){console.error("Global menu",He),Vd(((Be=(Pe=He.response)==null?void 0:Pe.data)==null?void 0:Be.errorMessage)||"Have error when get menu items")}})()},[e.baseUrl,e.menuPath,e.replacePath]);const T=async()=>{try{const je=await fetch(`${e.baseUrl}/global-menu-config/api/v1/menu-items/user/get-favorites`);if(!je.ok)throw new Error("Failed to fetch favorite items");const Pe=await je.json();f(Pe)}catch(je){console.error("Error fetching favorite items:",je)}};q.useEffect(()=>{T()},[e.baseUrl]),q.useEffect(()=>{let je=[];c.forEach(He=>{const ce=i.find(Se=>Se.id===He&&Se.isFavorite===!0);ce&&(je=[...je,ce])}),console.log(je);function Pe(He){return i.every(ce=>ce.parentKey!==He.id)?He:{...He,children:i.filter(ce=>ce.parentKey===He.id).map(ce=>Pe(ce))}}const Be=je.map(He=>Pe(He));f6(Be)},[i]);function he(je){const Pe=je.detail.menuItem;r(Be=>Be.map(He=>He.id!==Pe.id?He:{...He,data:Pe})),T()}q.useEffect(()=>(window.addEventListener("updateFavoriteMenu",he),()=>{window.removeEventListener("updateFavoriteMenu",he)}),[]),q.useLayoutEffect(()=>{var He;const je=localStorage.getItem("scrollPos");je&&le.current&&setTimeout(()=>{const ce=le.current.getScrollElement();ce.scrollTop=parseInt(je)},0);const Pe=()=>{if(le.current){const ce=le.current.getScrollElement();localStorage.setItem("scrollPos",ce.scrollTop.toString())}},Be=(He=le.current)==null?void 0:He.getScrollElement();return Be==null||Be.addEventListener("scroll",Pe),()=>{Be==null||Be.removeEventListener("scroll",Pe)}},[i]);function oe(je){s(!0);const Pe=[...n];r(je);const Be=je.map((He,ce)=>({menuItemId:He.id,order:ce}));Da.post("/global-menu-config/api/v1/menu-items/user",Be,{baseURL:e.baseUrl}).then(()=>{}).catch(He=>{console.error(He),r(Pe)}).finally(()=>{s(!1)})}const ze=q.useMemo(()=>Xh==="false"?A:[],[]);return console.log("nodesglobal menu",n),Fe.jsxs("div",{className:K("side-bar"),children:[Fe.jsx("div",{className:K("wrap-section side-bar__wrapper-toggle-btn"),children:Fe.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:R,children:p?Fe.jsx(o6,{}):Fe.jsx(i6,{})})}),Fe.jsx(Xm,{ref:le,className:K("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:Fe.jsx(AE,{backend:J3,options:wH(),children:Fe.jsx($H,{ref:C,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:oe,render:(je,Pe)=>{function Be(Ie){return n.every(Ge=>Ge.parent!==Ie.id)?Ie:{...Ie,children:n.filter(Ge=>Ge.parent===Ie.id).map(Ge=>Be(Ge.data))}}const He=Be(je.data),ce=Ie=>P.some(Ge=>Ge.id===Ie);function Se(Ie,Ge){r(tt=>tt.map(we=>we.id===Ie?{...we,data:{...we.data,isFavorite:Ge}}:we)),T()}return Fe.jsx(MD,{isInternalApp:e.isInternalApp,isActive:ce,isCollapsed:p,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,node:je,params:Pe,nodes:n,item:He,expanded:()=>!1,toggleExpand:()=>{},level:Pe.depth,onSetFavoriteSuccess:Se})},placeholderRender:(je,{depth:Pe})=>{var Be;return Fe.jsx(l6,{node:je,depth:Pe,color:(Be=e.brandColors)==null?void 0:Be.primary300,isCollapsed:p})},canDrag:()=>!o,canDrop:(je,{dragSource:Pe,dropTargetId:Be})=>(Pe==null?void 0:Pe.parent)===Be,onDragStart:je=>{console.log("onDragStart",je)},onChangeOpen:je=>{localStorage.getItem("isCollapsed")==="false"&&(console.log("onChangeOpen:",je),M(je))},initialOpen:ze})})}),Fe.jsxs("div",{className:K("wrap-section side-bar__wrap-btn-logout"),children:[Fe.jsxs("button",{className:K("side-bar__logout-btn"),onClick:()=>U(!0),children:[Fe.jsx(a6,{className:K("side-bar__icon-logout")}),Fe.jsx("span",{className:K("side-bar__logout-btn__text"),children:"Logout"})]}),Fe.jsx(j1,{isOpen:V,onClose:()=>U(!1),onConfirm:()=>e.logout?e.logout():q1(e.baseUrl)})]})]})}function h6(e,t){const n=new URL(e,window.location.origin),r=new URL(t,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 p6(e,t){const n=e.map(s=>({item:s,priority:s.path?h6(s.path,t):0})).filter(s=>s.priority>0),r=n.length>0?n.reduce((s,c)=>c.priority>s.priority?c:s).item:null,i=[];let o=r;for(;o;)i.unshift(o),o=e.find(s=>s.id===(o==null?void 0:o.parentKey))||null;return i}function FD(e,t){return e.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=FD(n.children,t)):n.path=t(n.path),n})}function ND(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=ND(n.children)),n))}function g6(e){return Fe.jsx(AD.div,{children:Fe.jsx(Ym,{styles:[PT,s6,u6],style:{position:"sticky",zIndex:1300},children:Fe.jsx(d6,{...e})})})}const v6={"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 Tp={exports:{}};/**
|
|
136
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},U4=function(e,t){return B4(e)||$4(e,t)||V4(e,t)||H4()},_D=OD(function(e){function t(){return e.exports=t=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},t.apply(this,arguments)}e.exports=t}),W4=function(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i},PD=function(e,t){if(e==null)return{};var n,r,i=W4(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},z4=q.createContext(null);function RD(e){var t=e.children,n=t===void 0?"":t,r=PD(e,["children"]);return typeof n!="string"&&(n=F4(n)),q.createElement("template",_D({},r,{dangerouslySetInnerHTML:{__html:n}}))}function ID(e){var t=e.root,n=e.children;return Vm.createPortal(n===void 0?null:n,t)}function Y4(e){var t=q.forwardRef(function(n,r){var i,o,s=n.mode,c=s===void 0?"open":s,f=n.delegatesFocus,p=f!==void 0&&f,y=n.styleSheets,g=y===void 0?[]:y,S=n.ssr,C=S!==void 0&&S,P=n.children,A=PD(n,["mode","delegatesFocus","styleSheets","ssr","children"]),M=(o=q.useRef((i=r)&&i.current),q.useEffect(function(){i&&(i.current=o.current)},[i]),o),R=q.useState(null),V=U4(R,2),U=V[0],J=V[1],K="node_".concat(c).concat(p);return q.useLayoutEffect(function(){if(M.current)try{if(typeof r=="function"&&r(M.current),C){var le=M.current.shadowRoot;return void J(le)}var T=M.current.attachShadow({mode:c,delegatesFocus:p});g.length>0&&(T.adoptedStyleSheets=g),J(T)}catch(he){(function(oe){var ze=oe.error,je=oe.styleSheets,Pe=oe.root;switch(ze.name){case"NotSupportedError":je.length>0&&(Pe.adoptedStyleSheets=je);break;default:throw ze}})({error:he,styleSheets:g,root:U})}},[r,M,g]),q.createElement(q.Fragment,null,q.createElement(e.tag,_D({key:K,ref:M},A),(U||C)&&q.createElement(z4.Provider,{value:U},C?q.createElement(RD,{shadowroot:c,shadowrootmode:c},e.render({root:U,ssr:C,children:P})):q.createElement(ID,{root:U},e.render({root:U,ssr:C,children:P})))))});return t.propTypes={mode:Ea.oneOf(["open","closed"]),delegatesFocus:Ea.bool,styleSheets:Ea.arrayOf(Ea.instanceOf(globalThis.CSSStyleSheet)),ssr:Ea.bool,children:Ea.node},t}RD.propTypes={children:Ea.oneOfType([Ea.string,Ea.node])},ID.propTypes={root:Ea.object.isRequired,children:Ea.node};var Sv=new Map;function G4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=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(e,{get:function(r,i){var o=j4(i,{separator:"-"}),s="".concat(t,"-").concat(o);return Sv.has(s)||Sv.set(s,Y4({tag:o,render:n})),Sv.get(s)}})}var AD=G4();const q4=".app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}",X4=".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 h1;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(h1||(h1={}));const K4=Object.freeze({x:0,y:0});var wf;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(wf||(wf={}));var p1;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(p1||(p1={}));var ka;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ka||(ka={}));ka.Space,ka.Enter,ka.Esc,ka.Space,ka.Enter,ka.Tab;var g1;(function(e){e[e.RightClick=2]="RightClick"})(g1||(g1={}));var v1;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(v1||(v1={}));var m1;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(m1||(m1={}));wf.Backward+"",wf.Forward+"",wf.Backward+"",wf.Forward+"";var Rm;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Rm||(Rm={}));var Im;(function(e){e.Optimized="optimized"})(Im||(Im={}));Rm.WhileDragging,Im.Optimized;({...K4});var y1;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(y1||(y1={}));function Z4(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}ka.Down,ka.Right,ka.Up,ka.Left;function J4(e){const t=new CustomEvent("updateFavoriteMenu",{detail:{menuItem:e}});window.dispatchEvent(t)}const Tv="MENU_ITEM";function Q4(e){const t=kp.useLocation(),[n,r]=q.useState([]),[i,o]=q.useState(!1);console.log("isSubmit",i);const s=q.useRef(null),[c,f]=q.useState(window.location.href);q.useEffect(()=>{f(window.location.href)},[t]);const p=M=>`${M}`;function y(M,R){for(const V of M){if(V.id===R)return V;if(V.children){const U=y(V.children,R);if(U)return U}}return null}function g(M,R){const V=y(n,M);V?(V.isFavorite=R,J4(V),Zy(M,R)):console.error(`Item with id ${M} not found`)}const S=M=>{console.log("Favorite menus changed",M);const R=M.detail.favoriteMenus||[];r(R)};q.useEffect(()=>(window.addEventListener("favoriteMenusChange",S),()=>{window.removeEventListener("favoriteMenusChange",S)}),[]);const C=(M,R)=>{n[M];const V=Z4(n,M,R);r(V),o(!0);const U={menuItemIds:V.map(J=>J.id)};Da.post("global-menu-config/api/v1/menu-items/user/order-favorites",U,{baseURL:e.baseUrl}).then(()=>{}).catch(J=>{console.error(J),r(n)}).finally(()=>{o(!1)})},P=({item:M,index:R})=>{const V=q.useRef(null),[{isDragging:U},J]=BE({type:Tv,item:()=>({id:M.id,index:R}),collect:oe=>({isDragging:oe.isDragging()})}),[{isOver:K,isOverCurrent:le},T]=hp(()=>({accept:Tv,collect:oe=>({isOver:oe.isOver(),isOverCurrent:oe.isOver({shallow:!0})}),drop:oe=>{C(oe.index,R),oe.index=R}}),[]);let he="hover-off";return(le||K)&&(he="hover-on"),J(T(V)),Fe.jsx("div",{ref:V,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 ${he}`,children:Fe.jsx(DD,{replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,item:M,level:1,onSetFavoriteSuccess:g})})},A=()=>{const M=q.useRef(null),[{isOver:R,canDrop:V},U]=hp(()=>({accept:Tv,drop:J=>{C(J.index,n.length-1),J.index=n.length-1},collect:J=>({isOver:J.isOver(),canDrop:J.canDrop()})}),[n]);return U(M),Fe.jsx("div",{ref:M,style:{height:40,width:150,display:"flex",alignItems:"center",justifyContent:"center",borderLeft:R&&V?"2px solid var(--primary300)":"transparent"}})};return Fe.jsx(Fe.Fragment,{children:n.length?Fe.jsx("div",{className:p("favorite-menu"),children:Fe.jsx(Xm,{ref:s,className:p("wrap-section favorite-menu__menu"),style:{marginTop:4,flex:1,overflow:"auto",height:"100%",overflowY:"hidden"},children:Fe.jsx(AE,{backend:UT,children:Fe.jsxs("div",{style:{display:"inline-flex"},children:[n.map((M,R)=>Fe.jsx(P,{item:M,index:R},M.id)),Fe.jsx(A,{})]})})})}):""})}function e6(e=32){const[t,n]=q.useState(!0),[r,i]=q.useState(0),o=()=>{const s=window.scrollY;s>r&&s>e?n(!1):s<r&&n(!0),i(s)};return q.useEffect(()=>(window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)),[r]),{isFavoriteBarVisible:t}}function t6(e){const{isFavoriteBarVisible:t}=e6();return Fe.jsxs(Fe.Fragment,{children:[Fe.jsx("style",{children:X4}),Fe.jsx("div",{className:`favorite-bar ${t?"favorite-bar--visible":"favorite-bar--hidden"}`,children:Fe.jsx(AD.div,{children:Fe.jsx(Ym,{styles:[PT,R4,q4],children:Fe.jsx(Q4,{...e})})})})]})}function Zy(e,t){const n=JSON.parse(localStorage.getItem("favoriteItems")||"[]");if(t)n.includes(e)||n.push(e);else{const r=n.indexOf(e);r>-1&&n.splice(r,1)}localStorage.setItem("favoriteItems",JSON.stringify(n))}function MD({...e}){var Ee,Ue,$e,ke,_e;const t=e.item,n=e.level||0,r=!!((Ee=e.item.children)!=null&&Ee.length),{isActive:i,isCollapsed:o}=e,s=`level-${n}`,c=o?"collapsed":"expanded",f=i(t.id)?"active":"",p=r?"parent":"child",y=e.params.isOpen?"isOpen":"isClose",g=e.isInternalApp?"isInternalApp":"",S=(Ne,rt=s)=>`${Ne} ${rt} ${c} ${f} ${p} ${y} ${g}`,[C,P]=q.useState(!1),[A,M]=q.useState(t.isFavorite||!1);q.useEffect(()=>{M(!!e.item.isFavorite)},[e.item.isFavorite]);const R=q.useRef(),V=q.useRef();V!=null&&V.current&&((Ue=V==null?void 0:V.current)==null?void 0:Ue.scrollWidth)>(($e=V==null?void 0:V.current)==null?void 0:$e.clientWidth);const U=window.location.origin,J=t.path&&t.path.includes("http")?new URL(t.path):{origin:"",pathname:""},K=window.location.pathname.split("/")[1],le=J.pathname.split("/")[1],T=e.item.redirectUrl||e.ssr||!U.includes("local")&&U!==J.origin||le!==K,he=r?"div":!e.isInternalApp&&T?"a":kp.Link,oe=t.redirectUrl||t.path||"#",ze=n+1,je=r&&o&&C,Pe=o||n===0?void 0:`${n+.25}rem`,Be=()=>{P(!0)},He=()=>{P(!1)},ce="/global-menu-config/api/v1/menu-items/user/set-favorite",Se=t.serviceKey==="mn_poms";e.params.depth*20,e.params.depth,OH(t.id,e.params.isOpen,e.params.onToggle);const Ie=Ne=>{Ne.stopPropagation(),e.params.onToggle()},tt=Se||o&&n===0?t.name==="POMs"?"Parking Operations Management":t.description||t.name:null;Object.entries(e.brandColors||{}).reduce((Ne,[rt,at])=>(at&&(Ne[`--${rt}`]=at),Ne),{});const we=U!==J.origin||e.item.redirectUrl?"_blank":"_self";return Fe.jsxs("div",{ref:R,className:S("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s"},onMouseOver:Be,onMouseOut:He,onDragStart:Ne=>{o&&n>1&&Ne.preventDefault()},children:[Fe.jsx(os.Tooltip,{placement:"top",title:tt,disableInteractive:!0,children:Fe.jsxs(he,{target:we,to:oe,href:oe,draggable:"true",className:S("menu-item__link"),style:{paddingLeft:Pe,transition:"all 0.3s",color:i(t.id)?((ke=e.brandColors)==null?void 0:ke.primary400)||ii.primary400:void 0,backgroundColor:i(t.id)&&n===0?(_e=e.brandColors)==null?void 0:_e.primary200:void 0},onClick:Ne=>{o||Ie(Ne)},children:[Fe.jsx(n6,{cls:S,item:t}),Fe.jsx("span",{className:S("menu-item__label"),ref:V,children:t.name}),Fe.jsx(r6,{tooltipPosition:tt?"right":"top",menuLevel:n,hasChildren:r,isHovered:C,isFavorite:A,onClick:Ne=>{const rt={menuConfigId:t.id,isFavorite:Ne},at=e.baseUrl+ce;Da.post(at,rt).then(ht=>{var lt;M(Ne),Zm("Set favorite menu item successfully"),(lt=e.onSetFavoriteSuccess)==null||lt.call(e,e.item.id,Ne),Zy(e.item.id,Ne)}).catch(ht=>{var lt,mt;Vd(((mt=(lt=ht.response)==null?void 0:lt.data)==null?void 0:mt.errorMessage)||"Have error when set favorite menu item")})}}),r&&Fe.jsx("div",{className:S("menu-item__icon-arrow__wrapper"),children:Fe.jsx(Z5,{className:S(`menu-item__icon-arrow__icon ${e.params.isOpen?"open":"close"}`)})})]})}),je&&Fe.jsx(J5,{parentRef:R,onlyChild:!o,renderChildren:({maxHeight:Ne})=>{var rt;return Fe.jsx(yD.div,{className:S(`menu-item__dropdown ${e.params.isOpen?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${ze}`),style:Xy({maxHeight:Ne,overflowY:"auto",paddingRight:3},Ne!=="auto"&&!!ze),children:(rt=t.children)==null?void 0:rt.map(at=>q.createElement(MD,{...e,key:at.id,item:at,level:ze}))})}})]})}function n6({item:e,cls:t}){return Fe.jsx("div",{className:t("menu-item__icon"),children:Fe.jsx(kD,{item:e})})}function r6(e){const t={marginRight:e.hasChildren?10:0,fontSize:18,fill:ii.warning};return Fe.jsxs(Fe.Fragment,{children:[e.isHovered&&!e.isFavorite&&Fe.jsx(os.Tooltip,{placement:e.tooltipPosition||"top",title:"Add to favorites",disableInteractive:!0,children:Fe.jsx("div",{children:Fe.jsx(bD,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!0)}})})}),e.isFavorite&&Fe.jsx(os.Tooltip,{placement:e.tooltipPosition||"top",title:"Remove from favorites",disableInteractive:!0,children:Fe.jsx("div",{children:Fe.jsx(wD,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!1)}})})})]})}function i6(){return Fe.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:Fe.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 o6(){return Fe.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:Fe.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function a6(e){return Fe.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:Fe.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: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;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%}.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.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.menu-item__link.collapsed.level-0{padding: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-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;color:#292929;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}.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: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: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}}",l6=e=>{const t=e.isCollapsed?0:e.depth*16;return Fe.jsx("div",{style:{backgroundColor:e.color||"#93D500",height:"2px",position:"absolute",right:"0",top:"0",left:t}})},u6=".app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}",c6=e=>{const[t,n]=q.useState(()=>{const r=localStorage.getItem("openingMenuIds");return r&&r!=="[]"?JSON.parse(r):(e==null?void 0:e.initOpenIds)||[]});return q.useEffect(()=>{localStorage.setItem("openingMenuIds",JSON.stringify(t))},[t]),[t,n]};function LD(e){document.documentElement.style.setProperty("--global-menu-width",!e||e==="true"?"64px":"17rem")}const Xh=localStorage.getItem("isCollapsed");LD(Xh);function f6(e){const t=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:e}});window.dispatchEvent(t)}function d6(e){const t=kp.useLocation(),[n,r]=q.useState([]),i=n.map(je=>je.data),[o,s]=q.useState(!1),[c,f]=q.useState([]),[p,y]=q.useState(Xh===null?!0:Xh==="true"),[g,S]=q.useState(window.location.href),C=q.useRef(null);q.useEffect(()=>{var je;(je=e.handleCallback)==null||je.call(e,i)},[i,e.handleCallback]),q.useEffect(()=>{S(window.location.href)},[t]);const P=p6(i,g),[A,M]=c6({initOpenIds:e.initOpenIds}),R=()=>{var je,Pe;if(y(!p),localStorage.setItem("isCollapsed",JSON.stringify(!p)),LD(p),p)A&&((je=C.current)==null||je.open(A));else{const Be=n.filter(He=>He.parent===0).map(He=>He.id);console.log("closeIds:",Be),(Pe=C.current)==null||Pe.close(Be)}},[V,U]=q.useState(!1),J=p?"collapsed":"expanded",K=je=>`${je} ${J}`,le=q.useRef(null);q.useLayoutEffect(()=>{(async()=>{var Pe,Be;try{const He=e.menuPath||"/global-menu-config/api/v1/menu-items/user",ce=e.baseUrl+He,{data:Se}=await Da.get(ce);let Ie=Se.map(tt=>({...tt,parentKey:tt.parentKey||0}));Ie=ND(Ie),e.replacePath&&(Ie=FD(Ie,e.replacePath));const Ge=Ie.map(tt=>({id:tt.id,parent:tt.parentKey,text:tt.name,data:tt}));r(Ge)}catch(He){console.error("Global menu",He),Vd(((Be=(Pe=He.response)==null?void 0:Pe.data)==null?void 0:Be.errorMessage)||"Have error when get menu items")}})()},[e.baseUrl,e.menuPath,e.replacePath]);const T=async()=>{try{const je=await fetch(`${e.baseUrl}/global-menu-config/api/v1/menu-items/user/get-favorites`);if(!je.ok)throw new Error("Failed to fetch favorite items");const Pe=await je.json();f(Pe)}catch(je){console.error("Error fetching favorite items:",je)}};q.useEffect(()=>{T()},[e.baseUrl]),q.useEffect(()=>{let je=[];c.forEach(He=>{const ce=i.find(Se=>Se.id===He&&Se.isFavorite===!0);ce&&(je=[...je,ce])}),console.log(je);function Pe(He){return i.every(ce=>ce.parentKey!==He.id)?He:{...He,children:i.filter(ce=>ce.parentKey===He.id).map(ce=>Pe(ce))}}const Be=je.map(He=>Pe(He));f6(Be)},[i]);function he(je){const Pe=je.detail.menuItem;r(Be=>Be.map(He=>He.id!==Pe.id?He:{...He,data:Pe})),T()}q.useEffect(()=>(window.addEventListener("updateFavoriteMenu",he),()=>{window.removeEventListener("updateFavoriteMenu",he)}),[]),q.useLayoutEffect(()=>{var He;const je=localStorage.getItem("scrollPos");je&&le.current&&setTimeout(()=>{const ce=le.current.getScrollElement();ce.scrollTop=parseInt(je)},0);const Pe=()=>{if(le.current){const ce=le.current.getScrollElement();localStorage.setItem("scrollPos",ce.scrollTop.toString())}},Be=(He=le.current)==null?void 0:He.getScrollElement();return Be==null||Be.addEventListener("scroll",Pe),()=>{Be==null||Be.removeEventListener("scroll",Pe)}},[i]);function oe(je){s(!0);const Pe=[...n];r(je);const Be=je.map((He,ce)=>({menuItemId:He.id,order:ce}));Da.post("/global-menu-config/api/v1/menu-items/user",Be,{baseURL:e.baseUrl}).then(()=>{}).catch(He=>{console.error(He),r(Pe)}).finally(()=>{s(!1)})}const ze=q.useMemo(()=>Xh==="false"?A:[],[]);return console.log("nodesglobal menu",n),Fe.jsxs("div",{className:K("side-bar"),children:[Fe.jsx("div",{className:K("wrap-section side-bar__wrapper-toggle-btn"),children:Fe.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:R,children:p?Fe.jsx(o6,{}):Fe.jsx(i6,{})})}),Fe.jsx(Xm,{ref:le,className:K("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:Fe.jsx(AE,{backend:J3,options:wH(),children:Fe.jsx($H,{ref:C,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:oe,render:(je,Pe)=>{function Be(Ie){return n.every(Ge=>Ge.parent!==Ie.id)?Ie:{...Ie,children:n.filter(Ge=>Ge.parent===Ie.id).map(Ge=>Be(Ge.data))}}const He=Be(je.data),ce=Ie=>P.some(Ge=>Ge.id===Ie);function Se(Ie,Ge){r(tt=>tt.map(we=>we.id===Ie?{...we,data:{...we.data,isFavorite:Ge}}:we)),T()}return Fe.jsx(MD,{isInternalApp:e.isInternalApp,isActive:ce,isCollapsed:p,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,node:je,params:Pe,nodes:n,item:He,expanded:()=>!1,toggleExpand:()=>{},level:Pe.depth,onSetFavoriteSuccess:Se})},placeholderRender:(je,{depth:Pe})=>{var Be;return Fe.jsx(l6,{node:je,depth:Pe,color:(Be=e.brandColors)==null?void 0:Be.primary300,isCollapsed:p})},canDrag:()=>!o,canDrop:(je,{dragSource:Pe,dropTargetId:Be})=>(Pe==null?void 0:Pe.parent)===Be,onDragStart:je=>{console.log("onDragStart",je)},onChangeOpen:je=>{localStorage.getItem("isCollapsed")==="false"&&(console.log("onChangeOpen:",je),M(je))},initialOpen:ze})})}),Fe.jsxs("div",{className:K("wrap-section side-bar__wrap-btn-logout"),children:[Fe.jsxs("button",{className:K("side-bar__logout-btn"),onClick:()=>U(!0),children:[Fe.jsx(a6,{className:K("side-bar__icon-logout")}),Fe.jsx("span",{className:K("side-bar__logout-btn__text"),children:"Logout"})]}),Fe.jsx(j1,{isOpen:V,onClose:()=>U(!1),onConfirm:()=>e.logout?e.logout():q1(e.baseUrl)})]})]})}function h6(e,t){const n=new URL(e,window.location.origin),r=new URL(t,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 p6(e,t){const n=e.map(s=>({item:s,priority:s.path?h6(s.path,t):0})).filter(s=>s.priority>0),r=n.length>0?n.reduce((s,c)=>c.priority>s.priority?c:s).item:null,i=[];let o=r;for(;o;)i.unshift(o),o=e.find(s=>s.id===(o==null?void 0:o.parentKey))||null;return i}function FD(e,t){return e.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=FD(n.children,t)):n.path=t(n.path),n})}function ND(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=ND(n.children)),n))}function g6(e){return Fe.jsx(AD.div,{children:Fe.jsx(Ym,{styles:[PT,s6,u6],style:{position:"sticky",zIndex:1300},children:Fe.jsx(d6,{...e})})})}const v6={"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 Tp={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-VatsG2Hx.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-DJUHu_yr.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
|
@@ -22058,8 +22058,7 @@ function See(e) {
|
|
|
22058
22058
|
display: "flex",
|
|
22059
22059
|
alignItems: "center",
|
|
22060
22060
|
justifyContent: "center",
|
|
22061
|
-
borderLeft: T && R ? "2px solid
|
|
22062
|
-
cursor: "move"
|
|
22061
|
+
borderLeft: T && R ? "2px solid var(--primary300)" : "transparent"
|
|
22063
22062
|
}
|
|
22064
22063
|
}
|
|
22065
22064
|
);
|