@ukpc-lib/react 0.9.10 → 0.9.11
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.module-6dda824c.cjs → index.module-717b3b78.cjs} +1 -1
- package/dist/{index.module-b9cf604b.js → index.module-e2b96839.js} +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-7ce75adb.js → index-bb9945d2.js} +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),j=require("react"),g=require("../index.module-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),j=require("react"),g=require("../index.module-717b3b78.cjs"),K=require("moment"),O=require("@mui/material");require("@r2wc/react-to-web-component");require("axios");const an=require("react-router-dom");require("react-query");require("react-dom");function Qn(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 F=Qn(j),eo=e=>{var n,o;const{tabs:t}=e,r=i=>{e.setCurrentTab(i.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),s.jsxs(s.Fragment,{children:[s.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 { jsxs as N, Fragment as be, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import * as L from "react";
|
|
3
3
|
import ge, { useState as G, useContext as _e, useEffect as Q, useCallback as We, useRef as ve, forwardRef as Eo, createElement as tr, PureComponent as Co } from "react";
|
|
4
|
-
import { c as Te, a as Ke, C as ke, p as Oo, L as Pr, u as No, b as To, S as ko, d as Io, e as $o, Q as $n, f as yt, g as hr, h as Mo, s as vt, _ as z, i as Se, P as k, j as he, k as Ao, o as Po, l as Ro, m as Do, n as Rr, q as wt, r as Dr, I as zo, t as Fo, v as zr, D as Lo, w as Mn, x as An, y as jo, z as Vo, A as Ho, B as rt } from "../index.module-
|
|
5
|
-
import { H as Lc, G as jc, K as Vc, E as Hc, F as Bc, J as Wc } from "../index.module-
|
|
4
|
+
import { c as Te, a as Ke, C as ke, p as Oo, L as Pr, u as No, b as To, S as ko, d as Io, e as $o, Q as $n, f as yt, g as hr, h as Mo, s as vt, _ as z, i as Se, P as k, j as he, k as Ao, o as Po, l as Ro, m as Do, n as Rr, q as wt, r as Dr, I as zo, t as Fo, v as zr, D as Lo, w as Mn, x as An, y as jo, z as Vo, A as Ho, B as rt } from "../index.module-e2b96839.js";
|
|
5
|
+
import { H as Lc, G as jc, K as Vc, E as Hc, F as Bc, J as Wc } from "../index.module-e2b96839.js";
|
|
6
6
|
import Z from "moment";
|
|
7
7
|
import { Stack as te, Dialog as Bo, DialogTitle as Wo, Typography as ye, DialogContent as Uo, DialogActions as Yo, Button as kt, Box as qo, ClickAwayListener as Go, TextField as Pn, IconButton as Ko, CircularProgress as Zo, Fade as Jo, Paper as Xo, Checkbox as Qo } from "@mui/material";
|
|
8
8
|
import "@r2wc/react-to-web-component";
|
|
@@ -138,7 +138,7 @@ Incoming: %s`,Di,"["+g.join(", ")+"]","["+w.join(", ")+"]");for(var A=0;A<w.leng
|
|
|
138
138
|
Error generating stack: `+$.message+`
|
|
139
139
|
`+$.stack}}var il=n.ReactCurrentDispatcher,Ts=n.ReactDebugCurrentFrame,Qu=0,Pi=1,ol=2,Ql=3,Ga=4,Cs=0,ec=1,qa=2,tc=12800;function nc(g){return console.error(g),null}function So(){}function Yf(g,w,A,$,Z,se,ve,Ae,h){var b=[],_=new Set,M={destination:null,responseState:w,progressiveChunkSize:$===void 0?tc:$,status:Cs,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:_,pingedTasks:b,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:Z===void 0?nc:Z,onAllReady:se===void 0?So:se,onShellReady:ve===void 0?So:ve,onShellError:Ae===void 0?So:Ae,onFatalError:h===void 0?So:h},Y=eu(M,0,null,A,!1,!1);Y.parentFlushed=!0;var ie=al(M,g,null,Y,_,Nn,Wc,Hf);return b.push(ie),M}function Gf(g,w){var A=g.pingedTasks;A.push(w),A.length===1&&s(function(){return pl(g)})}function Es(g,w){return{id:Ui,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:w,errorDigest:null}}function al(g,w,A,$,Z,se,ve,Ae){g.allPendingTasks++,A===null?g.pendingRootTasks++:A.pendingTasks++;var h={node:w,ping:function(){return Gf(g,h)},blockedBoundary:A,blockedSegment:$,abortSet:Z,legacyContext:se,context:ve,treeContext:Ae};return h.componentStack=null,Z.add(h),h}function eu(g,w,A,$,Z,se){return{status:Qu,id:-1,index:w,parentFlushed:!1,chunks:[],children:[],formatContext:$,boundary:A,lastPushedText:Z,textEmbedded:se}}var Qi=null;function ks(){return Qi===null||Qi.componentStack===null?"":Qc(Qi.componentStack)}function Uo(g,w){g.componentStack={tag:0,parent:g.componentStack,type:w}}function eo(g,w){g.componentStack={tag:1,parent:g.componentStack,type:w}}function Os(g,w){g.componentStack={tag:2,parent:g.componentStack,type:w}}function Ri(g){g.componentStack===null?i("Unexpectedly popped too many stack frames. This is a bug in React."):g.componentStack=g.componentStack.parent}var Xa=null;function tu(g,w){{var A;typeof w=="string"?A=w:w&&typeof w.message=="string"?A=w.message:A=String(w);var $=Xa||ks();Xa=null,g.errorMessage=A,g.errorComponentStack=$}}function Ii(g,w){var A=g.onError(w);if(A!=null&&typeof A!="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 A+'" instead');return A}function Wo(g,w){var A=g.onShellError;A(w);var $=g.onFatalError;$(w),g.destination!==null?(g.status=qa,U(g.destination,w)):(g.status=ec,g.fatalError=w)}function rc(g,w,A){Uo(w,"Suspense");var $=w.blockedBoundary,Z=w.blockedSegment,se=A.fallback,ve=A.children,Ae=new Set,h=Es(g,Ae),b=Z.chunks.length,_=eu(g,b,h,Z.formatContext,!1,!1);Z.children.push(_),Z.lastPushedText=!1;var M=eu(g,0,null,Z.formatContext,!1,!1);M.parentFlushed=!0,w.blockedBoundary=h,w.blockedSegment=M;try{if(dl(g,w,ve),Fr(M.chunks,g.responseState,M.lastPushedText,M.textEmbedded),M.status=Pi,hl(h,M),h.pendingTasks===0){Ri(w);return}}catch(ie){M.status=Ga,h.forceClientRender=!0,h.errorDigest=Ii(g,ie),tu(h,ie)}finally{w.blockedBoundary=$,w.blockedSegment=Z}var Y=al(g,se,$,_,Ae,w.legacyContext,w.context,w.treeContext);Y.componentStack=w.componentStack,g.pingedTasks.push(Y),Ri(w)}function Ka(g,w,A,$){Uo(w,A);var Z=w.blockedSegment,se=ia(Z.chunks,A,$,g.responseState,Z.formatContext);Z.lastPushedText=!1;var ve=Z.formatContext;Z.formatContext=ni(ve,A,$),dl(g,w,se),Z.formatContext=ve,Lo(Z.chunks,A),Z.lastPushedText=!1,Ri(w)}function sl(g){return g.prototype&&g.prototype.isReactComponent}function nu(g,w,A,$,Z){var se={};Yu(w,se);var ve=A($,Z);return va(A,$,ve,Z)}function ef(g,w,A,$,Z){var se=A.render();A.props!==Z&&(_s||i("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",_n($)||"a component"),_s=!0);{var ve=$.childContextTypes;if(ve!=null){var Ae=w.legacyContext,h=Uu(A,$,Ae,ve);w.legacyContext=h,si(g,w,se),w.legacyContext=Ae;return}}si(g,w,se)}function ic(g,w,A,$){Os(w,A);var Z=Hu(A,w.legacyContext),se=wo(A,$,Z);Xc(se,A,$,Z),ef(g,w,se,A,$),Ri(w)}var Gt={},ll={},tf={},Za={},_s=!1,oc=!1,ac=!1,oi=!1;function nf(g,w,A,$){var Z;if(Z=Hu(A,w.legacyContext),eo(w,A),A.prototype&&typeof A.prototype.render=="function"){var se=_n(A)||"Unknown";Gt[se]||(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.",se,se),Gt[se]=!0)}var ve=nu(g,w,A,$,Z),Ae=zr();if(typeof ve=="object"&&ve!==null&&typeof ve.render=="function"&&ve.$$typeof===void 0){var h=_n(A)||"Unknown";ll[h]||(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.",h,h,h),ll[h]=!0)}if(typeof ve=="object"&&ve!==null&&typeof ve.render=="function"&&ve.$$typeof===void 0){{var b=_n(A)||"Unknown";ll[b]||(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.",b,b,b),ll[b]=!0)}Xc(ve,A,$,Z),ef(g,w,ve,A,$)}else if(ul(A),Ae){var _=w.treeContext,M=1,Y=0;w.treeContext=Yl(_,M,Y);try{si(g,w,ve)}finally{w.treeContext=_}}else si(g,w,ve);Ri(w)}function ul(g){{if(g&&g.childContextTypes&&i("%s(...): childContextTypes cannot be defined on a function component.",g.displayName||g.name||"Component"),typeof g.getDerivedStateFromProps=="function"){var w=_n(g)||"Unknown";Za[w]||(i("%s: Function components do not support getDerivedStateFromProps.",w),Za[w]=!0)}if(typeof g.contextType=="object"&&g.contextType!==null){var A=_n(g)||"Unknown";tf[A]||(i("%s: Function components do not support contextType.",A),tf[A]=!0)}}}function cl(g,w){if(g&&g.defaultProps){var A=ee({},w),$=g.defaultProps;for(var Z in $)A[Z]===void 0&&(A[Z]=$[Z]);return A}return w}function rf(g,w,A,$,Z){eo(w,A.render);var se=nu(g,w,A.render,$,Z),ve=zr();if(ve){var Ae=w.treeContext,h=1,b=0;w.treeContext=Yl(Ae,h,b);try{si(g,w,se)}finally{w.treeContext=Ae}}else si(g,w,se);Ri(w)}function of(g,w,A,$,Z){var se=A.type,ve=cl(se,$);ru(g,w,se,ve,Z)}function ai(g,w,A,$){A._context===void 0?A!==A.Consumer&&(oi||(oi=!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?"))):A=A._context;var Z=$.children;typeof Z!="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 se=Js(A),ve=Z(se);si(g,w,ve)}function ya(g,w,A,$){var Z=A._context,se=$.value,ve=$.children,Ae;Ae=w.context,w.context=zc(Z,se),si(g,w,ve),w.context=Yc(Z),Ae!==w.context&&i("Popping the context provider did not return back to the original snapshot. This is a bug in React.")}function sc(g,w,A,$,Z){Uo(w,"Lazy");var se=A._payload,ve=A._init,Ae=ve(se),h=cl(Ae,$);ru(g,w,Ae,h,Z),Ri(w)}function ru(g,w,A,$,Z){if(typeof A=="function")if(sl(A)){ic(g,w,A,$);return}else{nf(g,w,A,$);return}if(typeof A=="string"){Ka(g,w,A,$);return}switch(A){case Ln:case Yt:case Q:case he:case Oe:{si(g,w,$.children);return}case dt:{Uo(w,"SuspenseList"),si(g,w,$.children),Ri(w);return}case kt:throw new Error("ReactDOMServer does not yet support scope components.");case ft:{rc(g,w,$);return}}if(typeof A=="object"&&A!==null)switch(A.$$typeof){case ze:{rf(g,w,A,$,Z);return}case ut:{of(g,w,A,$,Z);return}case de:{ya(g,w,A,$);return}case Ve:{ai(g,w,A,$);return}case At:{sc(g,w,A,$);return}}var se="";throw(A===void 0||typeof A=="object"&&A!==null&&Object.keys(A).length===0)&&(se+=" 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: "+(A==null?A:typeof A)+"."+se))}function iu(g,w){typeof Symbol=="function"&&g[Symbol.toStringTag]==="Generator"&&(oc||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."),oc=!0),g.entries===w&&(ac||i("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ac=!0)}function si(g,w,A){try{return fl(g,w,A)}catch($){throw typeof $=="object"&&$!==null&&typeof $.then=="function"||(Xa=Xa!==null?Xa:ks()),$}}function fl(g,w,A){if(w.node=A,typeof A=="object"&&A!==null){switch(A.$$typeof){case ye:{var $=A,Z=$.type,se=$.props,ve=$.ref;ru(g,w,Z,se,ve);return}case De: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 At:{var Ae=A,h=Ae._payload,b=Ae._init,_;try{_=b(h)}catch(St){throw typeof St=="object"&&St!==null&&typeof St.then=="function"&&Uo(w,"Lazy"),St}si(g,w,_);return}}if(Ci(A)){lc(g,w,A);return}var M=qi(A);if(M){iu(A,M);var Y=M.call(A);if(Y){var ie=Y.next();if(!ie.done){var fe=[];do fe.push(ie.value),ie=Y.next();while(!ie.done);lc(g,w,fe);return}return}}var Ie=Object.prototype.toString.call(A);throw new Error("Objects are not valid as a React child (found: "+(Ie==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":Ie)+"). If you meant to render a collection of children, use an array instead.")}if(typeof A=="string"){var Ze=w.blockedSegment;Ze.lastPushedText=Wi(w.blockedSegment.chunks,A,g.responseState,Ze.lastPushedText);return}if(typeof A=="number"){var ht=w.blockedSegment;ht.lastPushedText=Wi(w.blockedSegment.chunks,""+A,g.responseState,ht.lastPushedText);return}typeof A=="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 lc(g,w,A){for(var $=A.length,Z=0;Z<$;Z++){var se=w.treeContext;w.treeContext=Yl(se,$,Z);try{dl(g,w,A[Z])}finally{w.treeContext=se}}}function Yr(g,w,A){var $=w.blockedSegment,Z=$.chunks.length,se=eu(g,Z,null,$.formatContext,$.lastPushedText,!0);$.children.push(se),$.lastPushedText=!1;var ve=al(g,w.node,w.blockedBoundary,se,w.abortSet,w.legacyContext,w.context,w.treeContext);w.componentStack!==null&&(ve.componentStack=w.componentStack.parent);var Ae=ve.ping;A.then(Ae,Ae)}function dl(g,w,A){var $=w.blockedSegment.formatContext,Z=w.legacyContext,se=w.context,ve=null;ve=w.componentStack;try{return si(g,w,A)}catch(Ae){if(Gu(),typeof Ae=="object"&&Ae!==null&&typeof Ae.then=="function"){Yr(g,w,Ae),w.blockedSegment.formatContext=$,w.legacyContext=Z,w.context=se,Zs(se),w.componentStack=ve;return}else throw w.blockedSegment.formatContext=$,w.legacyContext=Z,w.context=se,Zs(se),w.componentStack=ve,Ae}}function zo(g,w,A,$){var Z=Ii(g,$);if(w===null?Wo(g,$):(w.pendingTasks--,w.forceClientRender||(w.forceClientRender=!0,w.errorDigest=Z,tu(w,$),w.parentFlushed&&g.clientRenderedBoundaries.push(w))),g.allPendingTasks--,g.allPendingTasks===0){var se=g.onAllReady;se()}}function qf(g){var w=this,A=g.blockedBoundary,$=g.blockedSegment;$.status=Ql,uc(w,A,$)}function to(g,w,A){var $=g.blockedBoundary,Z=g.blockedSegment;if(Z.status=Ql,$===null)w.allPendingTasks--,w.status!==qa&&(w.status=qa,w.destination!==null&&P(w.destination));else{if($.pendingTasks--,!$.forceClientRender){$.forceClientRender=!0;var se=A===void 0?new Error("The render was aborted by the server without a reason."):A;$.errorDigest=w.onError(se);{var ve="The server did not finish this Suspense boundary: ";se&&typeof se.message=="string"?se=ve+se.message:se=ve+String(se);var Ae=Qi;Qi=g;try{tu($,se)}finally{Qi=Ae}}$.parentFlushed&&w.clientRenderedBoundaries.push($)}if($.fallbackAbortableTasks.forEach(function(b){return to(b,w,A)}),$.fallbackAbortableTasks.clear(),w.allPendingTasks--,w.allPendingTasks===0){var h=w.onAllReady;h()}}}function hl(g,w){if(w.chunks.length===0&&w.children.length===1&&w.children[0].boundary===null){var A=w.children[0];A.id=w.id,A.parentFlushed=!0,A.status===Pi&&hl(g,A)}else{var $=g.completedSegments;$.push(w)}}function uc(g,w,A){if(w===null){if(A.parentFlushed){if(g.completedRootSegment!==null)throw new Error("There can only be one root segment. This is a bug in React.");g.completedRootSegment=A}if(g.pendingRootTasks--,g.pendingRootTasks===0){g.onShellError=So;var $=g.onShellReady;$()}}else if(w.pendingTasks--,!w.forceClientRender){if(w.pendingTasks===0)A.parentFlushed&&A.status===Pi&&hl(w,A),w.parentFlushed&&g.completedBoundaries.push(w),w.fallbackAbortableTasks.forEach(qf,g),w.fallbackAbortableTasks.clear();else if(A.parentFlushed&&A.status===Pi){hl(w,A);var Z=w.completedSegments;Z.length===1&&w.parentFlushed&&g.partialBoundaries.push(w)}}if(g.allPendingTasks--,g.allPendingTasks===0){var se=g.onAllReady;se()}}function ou(g,w){var A=w.blockedSegment;if(A.status===Qu){Zs(w.context);var $=null;$=Qi,Qi=w;try{si(g,w,w.node),Fr(A.chunks,g.responseState,A.lastPushedText,A.textEmbedded),w.abortSet.delete(w),A.status=Pi,uc(g,w.blockedBoundary,A)}catch(se){if(Gu(),typeof se=="object"&&se!==null&&typeof se.then=="function"){var Z=w.ping;se.then(Z,Z)}else w.abortSet.delete(w),A.status=Ga,zo(g,w.blockedBoundary,A,se)}finally{Qi=$}}}function pl(g){if(g.status!==qa){var w=Vl(),A=il.current;il.current=kr;var $;$=Ts.getCurrentStack,Ts.getCurrentStack=ks;var Z=nl;rl(g.responseState);try{var se=g.pingedTasks,ve;for(ve=0;ve<se.length;ve++){var Ae=se[ve];ou(g,Ae)}se.splice(0,ve),g.destination!==null&&vr(g,g.destination)}catch(h){Ii(g,h),Wo(g,h)}finally{rl(Z),il.current=A,Ts.getCurrentStack=$,A===kr&&Zs(w)}}}function gl(g,w,A){switch(A.parentFlushed=!0,A.status){case Qu:{var $=A.id=g.nextSegmentId++;return A.lastPushedText=!1,A.textEmbedded=!1,er(w,g.responseState,$)}case Pi:{A.status=ol;for(var Z=!0,se=A.chunks,ve=0,Ae=A.children,h=0;h<Ae.length;h++){for(var b=Ae[h];ve<b.index;ve++)p(w,se[ve]);Z=au(g,w,b)}for(;ve<se.length-1;ve++)p(w,se[ve]);return ve<se.length&&(Z=x(w,se[ve])),Z}default:throw new Error("Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.")}}function au(g,w,A){var $=A.boundary;if($===null)return gl(g,w,A);if($.parentFlushed=!0,$.forceClientRender)return qe(w,g.responseState,$.errorDigest,$.errorMessage,$.errorComponentStack),gl(g,w,A),It(w,g.responseState);if($.pendingTasks>0){$.rootSegmentID=g.nextSegmentId++,$.completedSegments.length>0&&g.partialBoundaries.push($);var Z=$.id=Pn(g.responseState);return ke(w,g.responseState,Z),gl(g,w,A),Dt(w,g.responseState)}else{if($.byteSize>g.progressiveChunkSize)return $.rootSegmentID=g.nextSegmentId++,g.completedBoundaries.push($),ke(w,g.responseState,$.id),gl(g,w,A),Dt(w,g.responseState);je(w,g.responseState);var se=$.completedSegments;if(se.length!==1)throw new Error("A previously unvisited boundary must have exactly one root segment. This is a bug in React.");var ve=se[0];return au(g,w,ve),ct(w,g.responseState)}}function cc(g,w,A){return zs(w,g.responseState,A.id,A.errorDigest,A.errorMessage,A.errorComponentStack)}function Ds(g,w,A){return _t(w,g.responseState,A.formatContext,A.id),au(g,w,A),Ct(w,A.formatContext)}function vl(g,w,A){for(var $=A.completedSegments,Z=0;Z<$.length;Z++){var se=$[Z];su(g,w,A,se)}return $.length=0,Gi(w,g.responseState,A.id,A.rootSegmentID)}function af(g,w,A){for(var $=A.completedSegments,Z=0;Z<$.length;Z++){var se=$[Z];if(!su(g,w,A,se))return Z++,$.splice(0,Z),!1}return $.splice(0,Z),!0}function su(g,w,A,$){if($.status===ol)return!0;var Z=$.id;if(Z===-1){var se=$.id=A.rootSegmentID;if(se===-1)throw new Error("A root segment ID must have been assigned by now. This is a bug in React.");return Ds(g,w,$)}else return Ds(g,w,$),Us(w,g.responseState,Z)}function vr(g,w){v();try{var A=g.completedRootSegment;A!==null&&g.pendingRootTasks===0&&(au(g,w,A),g.completedRootSegment=null,xi(w,g.responseState));var $=g.clientRenderedBoundaries,Z;for(Z=0;Z<$.length;Z++){var se=$[Z];cc(g,w,se)}$.splice(0,Z);var ve=g.completedBoundaries;for(Z=0;Z<ve.length;Z++){var Ae=ve[Z];vl(g,w,Ae)}ve.splice(0,Z),T(w),v(w);var h=g.partialBoundaries;for(Z=0;Z<h.length;Z++){var b=h[Z];if(!af(g,w,b)){g.destination=null,Z++,h.splice(0,Z);return}}h.splice(0,Z);var _=g.completedBoundaries;for(Z=0;Z<_.length;Z++){var M=_[Z];vl(g,w,M)}_.splice(0,Z)}finally{T(w),g.allPendingTasks===0&&g.pingedTasks.length===0&&g.clientRenderedBoundaries.length===0&&g.completedBoundaries.length===0&&(g.abortableTasks.size!==0&&i("There was still abortable task at the root when we closed. This is a bug in React."),P(w))}}function To(g){s(function(){return pl(g)})}function sf(g,w){if(g.status===ec){g.status=qa,U(w,g.fatalError);return}if(g.status!==qa&&g.destination===null){g.destination=w;try{vr(g,w)}catch(A){Ii(g,A),Wo(g,A)}}}function lu(g,w){try{var A=g.abortableTasks;A.forEach(function($){return to($,g,w)}),A.clear(),g.destination!==null&&vr(g,g.destination)}catch($){Ii(g,$),Wo(g,$)}}function uu(g,w){return new Promise(function(A,$){var Z,se,ve=new Promise(function(Y,ie){se=Y,Z=ie});function Ae(){var Y=new ReadableStream({type:"bytes",pull:function(ie){sf(b,ie)},cancel:function(ie){lu(b)}},{highWaterMark:0});Y.allReady=ve,A(Y)}function h(Y){ve.catch(function(){}),$(Y)}var b=Yf(g,Ar(w?w.identifierPrefix:void 0,w?w.nonce:void 0,w?w.bootstrapScriptContent:void 0,w?w.bootstrapScripts:void 0,w?w.bootstrapModules:void 0),ti(w?w.namespaceURI:void 0),w?w.progressiveChunkSize:void 0,w?w.onError:void 0,se,Ae,h,Z);if(w&&w.signal){var _=w.signal,M=function(){lu(b,_.reason),_.removeEventListener("abort",M)};_.addEventListener("abort",M)}To(b)})}Vh.renderToReadableStream=uu,Vh.version=t}()),Vh}var Ac,Nm;process.env.NODE_ENV==="production"?(Ac=Y5(),Nm=G5()):(Ac=q5(),Nm=X5());Ac.version;var K5=Ac.renderToString;Ac.renderToStaticMarkup;Ac.renderToNodeStream;Ac.renderToStaticNodeStream;Nm.renderToReadableStream;var Z5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hO(e,t){return e(t={exports:{}},t.exports),t.exports}var J5=hO(function(e){(function(t){var n=function(L,I,U){if(!c(I)||v(I)||p(I)||x(I)||l(I))return I;var W,te=0,J=0;if(d(I))for(W=[],J=I.length;te<J;te++)W.push(n(L,I[te],U));else for(var ge in W={},I)Object.prototype.hasOwnProperty.call(I,ge)&&(W[L(ge,U)]=n(L,I[ge],U));return W},r=function(L){return T(L)?L:(L=L.replace(/[\-_\s]+(.)?/g,function(I,U){return U?U.toUpperCase():""})).substr(0,1).toLowerCase()+L.substr(1)},i=function(L){var I=r(L);return I.substr(0,1).toUpperCase()+I.substr(1)},o=function(L,I){return function(U,W){var te=(W=W||{}).separator||"_",J=W.split||/(?=[A-Z])/;return U.split(J).join(te)}(L,I).toLowerCase()},s=Object.prototype.toString,l=function(L){return typeof L=="function"},c=function(L){return L===Object(L)},d=function(L){return s.call(L)=="[object Array]"},v=function(L){return s.call(L)=="[object Date]"},p=function(L){return s.call(L)=="[object RegExp]"},x=function(L){return s.call(L)=="[object Boolean]"},T=function(L){return(L-=0)==L},P=function(L,I){var U=I&&"process"in I?I.process:I;return typeof U!="function"?L:function(W,te){return U(W,L,te)}},R={camelize:r,decamelize:o,pascalize:i,depascalize:o,camelizeKeys:function(L,I){return n(P(r,I),L)},decamelizeKeys:function(L,I){return n(P(o,I),L,I)},pascalizeKeys:function(L,I){return n(P(i,I),L)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=R:t.humps=R})(Z5)}).decamelize,Q5=function(e){if(Array.isArray(e))return e},e4=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,l=e[Symbol.iterator]();!(r=(s=l.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(c){i=!0,o=c}finally{try{r||l.return==null||l.return()}finally{if(i)throw o}}return n}},u1=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},t4=function(e,t){if(e){if(typeof e=="string")return u1(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)?u1(e,t):void 0}},n4=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
140
140
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},r4=function(e,t){return Q5(e)||e4(e,t)||t4(e,t)||n4()},pO=hO(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}),i4=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},gO=function(e,t){if(e==null)return{};var n,r,i=i4(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},o4=X.createContext(null);function jm(e){var t=e.children,n=gO(e,["children"]);return typeof t!="string"&&(t=K5(t)),X.createElement("template",pO({},n,{dangerouslySetInnerHTML:{__html:t}}))}function Bm(e){var t=e.root,n=e.children;return qm.createPortal(n,t)}function a4(e){var t=X.forwardRef(function(n,r){var i,o,s=n.mode,l=n.delegatesFocus,c=n.styleSheets,d=n.ssr,v=n.children,p=gO(n,["mode","delegatesFocus","styleSheets","ssr","children"]),x=(o=X.useRef((i=r)&&i.current),X.useEffect(function(){i&&(i.current=o.current)},[i]),o),T=X.useState(null),P=r4(T,2),R=P[0],L=P[1],I="node_".concat(s).concat(l);return X.useLayoutEffect(function(){if(x.current)try{if(typeof r=="function"&&r(x.current),d){var U=x.current.shadowRoot;return void L(U)}var W=x.current.attachShadow({mode:s,delegatesFocus:l});c.length>0&&(W.adoptedStyleSheets=c),L(W)}catch(te){(function(J){var ge=J.error,S=J.styleSheets,ce=J.root;switch(ge.name){case"NotSupportedError":S.length>0&&(ce.adoptedStyleSheets=S);break;default:throw ge}})({error:te,styleSheets:c,root:R})}},[r,x,c]),X.createElement(X.Fragment,null,X.createElement(e.tag,pO({key:I,ref:x},p),(R||d)&&X.createElement(o4.Provider,{value:R},d?X.createElement(jm,{shadowroot:s,shadowrootmode:s},e.render({root:R,ssr:d,children:v})):X.createElement(Bm,{root:R},e.render({root:R,ssr:d,children:v})))))});return t.propTypes={mode:Oa.oneOf(["open","closed"]),delegatesFocus:Oa.bool,styleSheets:Oa.arrayOf(Oa.instanceOf(globalThis.CSSStyleSheet)),ssr:Oa.bool,children:Oa.node},t.defaultProps={mode:"open",delegatesFocus:!1,styleSheets:[],ssr:!1,children:null},t}jm.propTypes={children:Oa.oneOfType([Oa.string,Oa.node])},jm.defaultProps={children:""},Bm.propTypes={root:Oa.object.isRequired,children:Oa.node},Bm.defaultProps={children:null};var Dv=new Map;function s4(){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=J5(i,{separator:"-"}),s="".concat(t,"-").concat(o);return Dv.has(s)||Dv.set(s,a4({tag:o,render:n})),Dv.get(s)}})}var vO=s4();const l4=`.app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}
|
|
141
|
-
`;function u4(e){const t=new CustomEvent("updateFavoriteMenu",{detail:{menuItem:e}});window.dispatchEvent(t)}function c4(e){const t=Dp.useLocation(),[n,r]=X.useState([]),[i,o]=X.useState(window.location.href);X.useEffect(()=>{o(window.location.href)},[t]);const s=x=>`${x}`;function l(x,T){for(const P of x){if(P.id===T)return P;if(P.children){const R=l(P.children,T);if(R)return R}}return null}console.log("favoriteItems",n);function c(x,T){const P=l(n,x);P?(P.isFavorite=T,u4(P),t0(x,T)):console.error(`Item with id ${x} not found`)}const d=x=>{console.log("Favorite menus changed",x),r(x.detail.favoriteMenus||[])};X.useEffect(()=>(window.addEventListener("favoriteMenusChange",d),()=>{window.removeEventListener("favoriteMenusChange",d)}),[]),console.log("favoriteItems",n);function v(x,T){return!T||n.indexOf(T)===-1?1:v(T,n.find(R=>R.id===T.parentKey))+1}const p=(x,T,P)=>{const R=L=>P.some(I=>I.id===L);return console.log("matchPaths",P),We.jsx(dO,{isActive:R,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,item:x,level:T,onSetFavoriteSuccess:c})};return We.jsx(We.Fragment,{children:n.length?We.jsx("div",{className:s("side-bar"),children:We.jsx("div",{className:s("wrap-section side-bar__menu"),style:{flex:1,overflow:"auto",width:"100%",overflowY:"hidden",display:"flex",alignItems:"center",scrollbarWidth:"thin"},children:n.map(x=>We.jsx("div",{children:p(x,v(),[])},x.id))})}):""})}function f4(e){return We.jsx(vO.div,{children:We.jsx(Km,{styles:[mT,z5,l4],children:We.jsx(c4,{...e})})})}function t0(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 mO({...e}){var He,et,at,Ee,Pe;const t=e.item,n=e.level||0,r=!!((He=e.item.children)!=null&&He.length),{isActive:i,isCollapsed:o}=e,s=`level-${n}`,l=o?"collapsed":"expanded",c=i(t.id)?"active":"",d=(Be,Ue=s)=>`${Be} ${Ue} ${l} ${c}`,[v,p]=X.useState(!1),[x,T]=X.useState(t.isFavorite||!1);X.useEffect(()=>{T(!!e.item.isFavorite)},[e.item.isFavorite]);const P=X.useRef(),R=X.useRef();R!=null&&R.current&&((et=R==null?void 0:R.current)==null?void 0:et.scrollWidth)>((at=R==null?void 0:R.current)==null?void 0:at.clientWidth);const L=window.location.origin,I=t.path&&t.path.includes("http")?new URL(t.path):{origin:"",pathname:""},U=window.location.pathname.split("/")[1],W=I.pathname.split("/")[1],te=e.ssr||!L.includes("local")&&L!==I.origin||W!==U,J=r||n===0?"div":te?"a":Dp.Link,ge=t.path||"#",S=n+1,ce=r&&o&&v,ae=o||n===0?void 0:`${n+.25}rem`,Ne=()=>{p(!0)},Je=()=>{p(!1)},Ye="/global-menu-config/api/v1/menu-items/user/set-favorite",Qe=t.serviceKey==="mn_poms";e.params.depth*20,e.params.depth,H3(t.id,e.params.isOpen,e.params.onToggle);const tt=Be=>{Be.stopPropagation(),e.params.onToggle()},Ce=Qe||o&&n===0?t.name==="POMs"?"Parking Operations Management":t.description||t.name:null;return We.jsxs("div",{ref:P,className:d("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s"},onMouseOver:Ne,onMouseOut:Je,onDragStart:Be=>{o&&n>1&&Be.preventDefault()},children:[We.jsx(os.Tooltip,{placement:"top",title:Ce,disableInteractive:!0,children:We.jsxs(J,{to:ge,href:ge,draggable:"true",className:d("menu-item__link"),style:{paddingLeft:ae,transition:"all 0.3s",color:i(t.id)?((Ee=e.brandColors)==null?void 0:Ee.primary400)||ui.primary400:void 0,backgroundColor:i(t.id)&&n===0?(Pe=e.brandColors)==null?void 0:Pe.primary200:void 0},onClick:Be=>{o||tt(Be)},children:[We.jsx(d4,{cls:d,item:t}),We.jsx("span",{className:d("menu-item__label"),ref:R,children:t.name}),We.jsx(h4,{tooltipPosition:Ce?"right":"top",menuLevel:n,hasChildren:r,isHovered:v,isFavorite:x,onClick:Be=>{const Ue={menuConfigId:t.id,isFavorite:Be},Re=e.baseUrl+Ye;is.post(Re,Ue).then(Fe=>{var Ge;T(Be),ty("Set favorite menu item successfully"),(Ge=e.onSetFavoriteSuccess)==null||Ge.call(e,e.item.id,Be),t0(e.item.id,Be)}).catch(Fe=>{var Ge,lt;Hd(((lt=(Ge=Fe.response)==null?void 0:Ge.data)==null?void 0:lt.errorMessage)||"Have error when set favorite menu item")})}}),r&&We.jsx("div",{className:d("menu-item__icon-arrow__wrapper"),children:We.jsx(f5,{className:d(`menu-item__icon-arrow__icon ${e.params.isOpen?"open":"close"}`)})})]})}),ce&&We.jsx(d5,{parentRef:P,onlyChild:!o,renderChildren:({maxHeight:Be})=>{var Ue;return We.jsx(rO.div,{className:d(`menu-item__dropdown ${e.params.isOpen?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${S}`),style:Qy({maxHeight:Be,overflowY:"auto",paddingRight:3},Be!=="auto"&&!!S),children:(Ue=t.children)==null?void 0:Ue.map(Re=>X.createElement(mO,{...e,key:Re.id,item:Re,level:S}))})}})]})}function d4({item:e,cls:t}){return We.jsx("div",{className:t("menu-item__icon"),children:We.jsx(fO,{item:e})})}function h4(e){const t={marginRight:e.hasChildren?10:0,fontSize:22,fill:ui.warning};return console.log("props.isHovered && !props.isFavorite",e.isHovered&&!e.isFavorite),console.log("props.isFavorite",e.isFavorite),We.jsxs(We.Fragment,{children:[e.isHovered&&!e.isFavorite&&We.jsx(os.Tooltip,{placement:e.tooltipPosition||"top",title:"Add to favorites",disableInteractive:!0,children:We.jsx("div",{children:We.jsx(iO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!0)}})})}),e.isFavorite&&We.jsx(os.Tooltip,{placement:e.tooltipPosition||"top",title:"Remove from favorites",disableInteractive:!0,children:We.jsx("div",{children:We.jsx(oO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!1)}})})})]})}function p4(){return We.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:We.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 g4(){return We.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:We.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function v4(e){return We.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:We.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 m4=`.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{display:flex;flex-direction:column;max-width:18rem;height:calc(100vh - 64px);border-right:1px solid #ddd;background-color:#fafafa;transition:all .3s}.side-bar.expanded{width:17rem}.side-bar.collapsed{width:64px}.side-bar__wrap-btn-logout,.side-bar__btn-logout{margin:40px 0}.side-bar__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:1}.side-bar__logout-btn__text.collapsed{opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.side-bar__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px}.side-bar__wrapper-toggle-btn.collapsed{justify-content:center;width:100%}.side-bar__toggle-btn{margin-top:-6px;color:#85858a}.side-bar__logout-btn{width:100%;text-align:left;display:flex;flex-direction:row;align-items:center;padding:8px 16px 8px 18.6665px;min-height:48px;border-radius:.375rem;overflow:hidden;transition:all .3s ease-in-out;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__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:180px;max-width:180px;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}}
|
|
141
|
+
`;function u4(e){const t=new CustomEvent("updateFavoriteMenu",{detail:{menuItem:e}});window.dispatchEvent(t)}function c4(e){const t=Dp.useLocation(),[n,r]=X.useState([]),[i,o]=X.useState(window.location.href);X.useEffect(()=>{o(window.location.href)},[t]);const s=x=>`${x}`;function l(x,T){for(const P of x){if(P.id===T)return P;if(P.children){const R=l(P.children,T);if(R)return R}}return null}console.log("favoriteItems",n);function c(x,T){const P=l(n,x);P?(P.isFavorite=T,u4(P),t0(x,T)):console.error(`Item with id ${x} not found`)}const d=x=>{console.log("Favorite menus changed",x),r(x.detail.favoriteMenus||[])};X.useEffect(()=>(window.addEventListener("favoriteMenusChange",d),()=>{window.removeEventListener("favoriteMenusChange",d)}),[]),console.log("favoriteItems",n);function v(x,T){return!T||n.indexOf(T)===-1?1:v(T,n.find(R=>R.id===T.parentKey))+1}const p=(x,T,P)=>{const R=L=>P.some(I=>I.id===L);return console.log("matchPaths",P),We.jsx(dO,{isActive:R,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,item:x,level:T,onSetFavoriteSuccess:c})};return We.jsx(We.Fragment,{children:n.length?We.jsx("div",{className:s("side-bar"),children:We.jsx("div",{className:s("wrap-section side-bar__menu"),style:{flex:1,overflow:"auto",width:"100%",overflowY:"hidden",display:"flex",alignItems:"center",scrollbarWidth:"thin"},children:n.map(x=>We.jsx("div",{children:p(x,v(),[])},x.id))})}):""})}function f4(e){return We.jsx(vO.div,{children:We.jsx(Km,{styles:[mT,z5,l4],children:We.jsx(c4,{...e})})})}function t0(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 mO({...e}){var He,et,at,Ee,Pe;const t=e.item,n=e.level||0,r=!!((He=e.item.children)!=null&&He.length),{isActive:i,isCollapsed:o}=e,s=`level-${n}`,l=o?"collapsed":"expanded",c=i(t.id)?"active":"",d=(Be,Ue=s)=>`${Be} ${Ue} ${l} ${c}`,[v,p]=X.useState(!1),[x,T]=X.useState(t.isFavorite||!1);X.useEffect(()=>{T(!!e.item.isFavorite)},[e.item.isFavorite]);const P=X.useRef(),R=X.useRef();R!=null&&R.current&&((et=R==null?void 0:R.current)==null?void 0:et.scrollWidth)>((at=R==null?void 0:R.current)==null?void 0:at.clientWidth);const L=window.location.origin,I=t.path&&t.path.includes("http")?new URL(t.path):{origin:"",pathname:""},U=window.location.pathname.split("/")[1],W=I.pathname.split("/")[1],te=e.ssr||!L.includes("local")&&L!==I.origin||W!==U,J=r||n===0?"div":te?"a":Dp.Link,ge=t.path||"#",S=n+1,ce=r&&o&&v,ae=o||n===0?void 0:`${n+.25}rem`,Ne=()=>{p(!0)},Je=()=>{p(!1)},Ye="/global-menu-config/api/v1/menu-items/user/set-favorite",Qe=t.serviceKey==="mn_poms";e.params.depth*20,e.params.depth,H3(t.id,e.params.isOpen,e.params.onToggle);const tt=Be=>{Be.stopPropagation(),e.params.onToggle()},Ce=Qe||o&&n===0?t.name==="POMs"?"Parking Operations Management":t.description||t.name:null;return We.jsxs("div",{ref:P,className:d("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s"},onMouseOver:Ne,onMouseOut:Je,onDragStart:Be=>{o&&n>1&&Be.preventDefault()},children:[We.jsx(os.Tooltip,{placement:"top",title:Ce,disableInteractive:!0,children:We.jsxs(J,{to:ge,href:ge,draggable:"true",className:d("menu-item__link"),style:{paddingLeft:ae,transition:"all 0.3s",color:i(t.id)?((Ee=e.brandColors)==null?void 0:Ee.primary400)||ui.primary400:void 0,backgroundColor:i(t.id)&&n===0?(Pe=e.brandColors)==null?void 0:Pe.primary200:void 0},onClick:Be=>{o||tt(Be)},children:[We.jsx(d4,{cls:d,item:t}),We.jsx("span",{className:d("menu-item__label"),ref:R,children:t.name}),We.jsx(h4,{tooltipPosition:Ce?"right":"top",menuLevel:n,hasChildren:r,isHovered:v,isFavorite:x,onClick:Be=>{const Ue={menuConfigId:t.id,isFavorite:Be},Re=e.baseUrl+Ye;is.post(Re,Ue).then(Fe=>{var Ge;T(Be),ty("Set favorite menu item successfully"),(Ge=e.onSetFavoriteSuccess)==null||Ge.call(e,e.item.id,Be),t0(e.item.id,Be)}).catch(Fe=>{var Ge,lt;Hd(((lt=(Ge=Fe.response)==null?void 0:Ge.data)==null?void 0:lt.errorMessage)||"Have error when set favorite menu item")})}}),r&&We.jsx("div",{className:d("menu-item__icon-arrow__wrapper"),children:We.jsx(f5,{className:d(`menu-item__icon-arrow__icon ${e.params.isOpen?"open":"close"}`)})})]})}),ce&&We.jsx(d5,{parentRef:P,onlyChild:!o,renderChildren:({maxHeight:Be})=>{var Ue;return We.jsx(rO.div,{className:d(`menu-item__dropdown ${e.params.isOpen?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${S}`),style:Qy({maxHeight:Be,overflowY:"auto",paddingRight:3},Be!=="auto"&&!!S),children:(Ue=t.children)==null?void 0:Ue.map(Re=>X.createElement(mO,{...e,key:Re.id,item:Re,level:S}))})}})]})}function d4({item:e,cls:t}){return We.jsx("div",{className:t("menu-item__icon"),children:We.jsx(fO,{item:e})})}function h4(e){const t={marginRight:e.hasChildren?10:0,fontSize:18,fill:ui.warning};return console.log("props.isHovered && !props.isFavorite",e.isHovered&&!e.isFavorite),console.log("props.isFavorite",e.isFavorite),We.jsxs(We.Fragment,{children:[e.isHovered&&!e.isFavorite&&We.jsx(os.Tooltip,{placement:e.tooltipPosition||"top",title:"Add to favorites",disableInteractive:!0,children:We.jsx("div",{children:We.jsx(iO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!0)}})})}),e.isFavorite&&We.jsx(os.Tooltip,{placement:e.tooltipPosition||"top",title:"Remove from favorites",disableInteractive:!0,children:We.jsx("div",{children:We.jsx(oO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!1)}})})})]})}function p4(){return We.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:We.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 g4(){return We.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:We.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function v4(e){return We.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:We.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 m4=`.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{display:flex;flex-direction:column;max-width:18rem;height:calc(100vh - 64px);border-right:1px solid #ddd;background-color:#fafafa;transition:all .3s}.side-bar.expanded{width:17rem}.side-bar.collapsed{width:64px}.side-bar__wrap-btn-logout,.side-bar__btn-logout{margin:40px 0}.side-bar__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:1}.side-bar__logout-btn__text.collapsed{opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.side-bar__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px}.side-bar__wrapper-toggle-btn.collapsed{justify-content:center;width:100%}.side-bar__toggle-btn{margin-top:-6px;color:#85858a}.side-bar__logout-btn{width:100%;text-align:left;display:flex;flex-direction:row;align-items:center;padding:8px 16px 8px 18.6665px;min-height:48px;border-radius:.375rem;overflow:hidden;transition:all .3s ease-in-out;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__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:180px;max-width:180px;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}}
|
|
142
142
|
`,y4=e=>{const t=e.isCollapsed?0:e.depth*16;return We.jsx("div",{style:{backgroundColor:e.color||"#93D500",height:"2px",position:"absolute",right:"0",top:"0",left:t}})},b4=`.app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}
|
|
143
143
|
`,w4=e=>{const[t,n]=X.useState(()=>{const r=localStorage.getItem("openingMenuIds");return r&&r!=="[]"?JSON.parse(r):(e==null?void 0:e.initOpenIds)||[]});return X.useEffect(()=>{localStorage.setItem("openingMenuIds",JSON.stringify(t))},[t]),[t,n]},Pv=localStorage.getItem("isCollapsed");function x4(e){const t=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:e}});window.dispatchEvent(t)}function S4(e){const t=Dp.useLocation(),[n,r]=X.useState([]),i=n.map(ce=>ce.data),[o,s]=X.useState(!1),[l,c]=X.useState(Pv===null?!0:Pv==="true"),[d,v]=X.useState(window.location.href),p=X.useRef(null);X.useEffect(()=>{var ce;(ce=e.handleCallback)==null||ce.call(e,i)},[i,e.handleCallback]),X.useEffect(()=>{v(window.location.href)},[t]);const x=C4(i,d);console.log("matchPaths:",d,t,x);const[T,P]=w4({initOpenIds:e.initOpenIds}),R=()=>{var ce,ae;if(c(!l),localStorage.setItem("isCollapsed",JSON.stringify(!l)),l)T&&((ce=p.current)==null||ce.open(T));else{const Ne=n.filter(Je=>Je.parent===0).map(Je=>Je.id);console.log("closeIds:",Ne),(ae=p.current)==null||ae.close(Ne)}},[L,I]=X.useState(!1),U=l?"collapsed":"expanded",W=ce=>`${ce} ${U}`,te=X.useRef(null);X.useLayoutEffect(()=>{(async()=>{var ae,Ne;try{const Je=e.menuPath||"/global-menu-config/api/v1/menu-items/user",Ye=e.baseUrl+Je,{data:Qe}=await is.get(Ye);let tt=Qe.map(Ce=>({...Ce,parentKey:Ce.parentKey||0}));tt=bO(tt),e.replacePath&&(tt=yO(tt,e.replacePath));const pe=tt.map(Ce=>({id:Ce.id,parent:Ce.parentKey,text:Ce.name,data:Ce}));r(pe)}catch(Je){console.error(Je),Hd(((Ne=(ae=Je.response)==null?void 0:ae.data)==null?void 0:Ne.errorMessage)||"Have error when get menu items")}})()},[e.baseUrl,e.menuPath,e.replacePath]),X.useEffect(()=>{const ce=JSON.parse(localStorage.getItem("favoriteItems")||"[]");let ae=[];ce.forEach(Ye=>{const Qe=i.find(tt=>tt.id===Ye&&tt.isFavorite===!0);Qe&&(ae=[...ae,Qe])});function Ne(Ye){return i.every(Qe=>Qe.parentKey!==Ye.id)?Ye:{...Ye,children:i.filter(Qe=>Qe.parentKey===Ye.id).map(Qe=>Ne(Qe))}}const Je=ae.map(Ye=>Ne(Ye));x4(Je)},[i]);function J(ce){const ae=ce.detail.menuItem;r(Ne=>Ne.map(Je=>Je.id!==ae.id?Je:{...Je,data:ae}))}X.useEffect(()=>(window.addEventListener("updateFavoriteMenu",J),()=>{window.removeEventListener("updateFavoriteMenu",J)}),[]),X.useLayoutEffect(()=>{var Je;const ce=localStorage.getItem("scrollPos");ce&&te.current&&setTimeout(()=>{const Ye=te.current.getScrollElement();Ye.scrollTop=parseInt(ce)},0);const ae=()=>{if(te.current){const Ye=te.current.getScrollElement();localStorage.setItem("scrollPos",Ye.scrollTop.toString())}},Ne=(Je=te.current)==null?void 0:Je.getScrollElement();return Ne==null||Ne.addEventListener("scroll",ae),()=>{Ne==null||Ne.removeEventListener("scroll",ae)}},[i]);function ge(ce){s(!0);const ae=[...n];r(ce);const Ne=ce.map((Je,Ye)=>({menuItemId:Je.id,order:Ye}));is.post("/global-menu-config/api/v1/menu-items/user",Ne,{baseURL:e.baseUrl}).then(()=>{}).catch(Je=>{console.error(Je),r(ae)}).finally(()=>{s(!1)})}const S=X.useMemo(()=>Pv==="false"?T:[],[]);return We.jsxs("div",{className:W("side-bar"),children:[We.jsx("div",{className:W("wrap-section side-bar__wrapper-toggle-btn"),children:We.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:R,children:l?We.jsx(g4,{}):We.jsx(p4,{})})}),We.jsx(vT,{ref:te,className:W("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:We.jsx(EV,{backend:d3,options:M3(),children:We.jsx(eH,{ref:p,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:ge,render:(ce,ae)=>{function Ne(tt){return n.every(pe=>pe.parent!==tt.id)?tt:{...tt,children:n.filter(pe=>pe.parent===tt.id).map(pe=>Ne(pe.data))}}const Je=Ne(ce.data),Ye=tt=>x.some(pe=>pe.id===tt);function Qe(tt,pe){r(Ce=>Ce.map(He=>He.id===tt?{...He,data:{...He.data,isFavorite:pe}}:He))}return We.jsx(mO,{isActive:Ye,isCollapsed:l,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,node:ce,params:ae,nodes:n,item:Je,expanded:()=>!1,toggleExpand:()=>{},level:ae.depth,onSetFavoriteSuccess:Qe})},placeholderRender:(ce,{depth:ae})=>{var Ne;return We.jsx(y4,{node:ce,depth:ae,color:(Ne=e.brandColors)==null?void 0:Ne.primary300,isCollapsed:l})},canDrag:()=>!o,canDrop:(ce,{dragSource:ae,dropTargetId:Ne})=>(ae==null?void 0:ae.parent)===Ne,onDragStart:ce=>{console.log("onDragStart",ce)},onChangeOpen:ce=>{localStorage.getItem("isCollapsed")==="false"&&(console.log("onChangeOpen:",ce),P(ce))},initialOpen:S})})}),We.jsxs("div",{className:W("wrap-section side-bar__wrap-btn-logout"),children:[We.jsxs("button",{className:W("side-bar__logout-btn"),onClick:()=>I(!0),children:[We.jsx(v4,{className:W("side-bar__icon-logout")}),We.jsx("span",{className:W("side-bar__logout-btn__text"),children:"Logout"})]}),We.jsx(_1,{isOpen:L,onClose:()=>I(!1),onConfirm:()=>e.logout?e.logout():j1(e.baseUrl)})]})]})}function T4(e,t){const n=new URL(e).searchParams,r=new URL(t).searchParams;return Array.from(r).filter(([i,o])=>o===n.get(i)).length}function C4(e,t){var c;console.log("menuItems:",e);const n=new URL(t);let r=e.filter(d=>d.path&&d.path.includes("http")).map(d=>({item:d,itemUrl:new URL(d.path),matchingParamsCount:T4(t,d.path)})).sort((d,v)=>{const p=new URL(d.itemUrl).searchParams,x=new URL(v.itemUrl).searchParams;return Array.from(p).length-Array.from(x).length}).filter(({itemUrl:d})=>n.origin===d.origin);const i=r.filter(({itemUrl:d})=>n.pathname===d.pathname),o=r.filter(({itemUrl:d})=>n.pathname.includes(d.pathname));r=i.length>0?i:o,r=r.sort((d,v)=>v.matchingParamsCount-d.matchingParamsCount);let s=r.length>0?(c=r.find(d=>d.item.parentKey))==null?void 0:c.item:null;console.log("matchingItems:",r);let l=[];for(;s;)l=[s,...l],s=e.find(d=>d.id===(s==null?void 0:s.parentKey))||null;return console.log("parents:",l),l}function yO(e,t){return e.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=yO(n.children,t)):n.path=t(n.path),n})}function bO(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=bO(n.children)),n))}function E4(e){return We.jsx(vO.div,{children:We.jsx(Km,{styles:[mT,m4,b4],style:{position:"sticky",zIndex:20},children:We.jsx(S4,{...e})})})}const k4={"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 kp={exports:{}};/**
|
|
144
144
|
* @license
|
|
@@ -29122,7 +29122,7 @@ function y4({ item: e, cls: t }) {
|
|
|
29122
29122
|
function b4(e) {
|
|
29123
29123
|
const t = {
|
|
29124
29124
|
marginRight: e.hasChildren ? 10 : 0,
|
|
29125
|
-
fontSize:
|
|
29125
|
+
fontSize: 18,
|
|
29126
29126
|
fill: _i.warning
|
|
29127
29127
|
};
|
|
29128
29128
|
return console.log(
|
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-717b3b78.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=r=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>o(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,o)=>{const s=c(r);return o?t.every(n=>s==null?void 0:s.includes(n)):t.some(n=>s==null?void 0:s.includes(n))},h=({baseUrl:r,accessWith:t,requireAll:o,children:s})=>a(r)(t,o)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:o,unAuthorizedPath:s,children:n})=>a(o)(r,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:s,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, a1 as y, Z as F, a as H, c as I, $ as M, U as N, R as O, T as $, V as j, t as w, a0 as U, X as V, W as X, b as Y, u as Z, g as _, Y as b } from "../index.module-
|
|
1
|
+
import { M as R, N as S, O as G, a1 as y, Z as F, a as H, c as I, $ as M, U as N, R as O, T as $, V as j, t as w, a0 as U, X as V, W as X, b as Y, u as Z, g as _, Y as b } from "../index.module-e2b96839.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
|
@@ -42305,7 +42305,7 @@ function Bve({ item: e, cls: t }) {
|
|
|
42305
42305
|
function Vve(e) {
|
|
42306
42306
|
const t = {
|
|
42307
42307
|
marginRight: e.hasChildren ? 10 : 0,
|
|
42308
|
-
fontSize:
|
|
42308
|
+
fontSize: 18,
|
|
42309
42309
|
fill: En.warning
|
|
42310
42310
|
};
|
|
42311
42311
|
return console.log(
|