react-luminus-components 1.3.206 → 1.3.207
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/.vite/manifest.json +61 -61
- package/dist/{Loading-74l0p5M0.cjs → Loading-DagdrJCq.cjs} +1 -1
- package/dist/{Loading-CTiNUYCJ.js → Loading-JUsRX9kB.js} +1 -1
- package/dist/{ShortcutLinksContext-DjWgKFrF.js → ShortcutLinksContext-D5EF_fp9.js} +7985 -7833
- package/dist/ShortcutLinksContext-DeePM3HF.cjs +279 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +47 -47
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +20 -20
- package/dist/layout/SideContentBar/SideContentBar.d.ts +3 -2
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +20 -20
- package/dist/main.cjs.js +36 -36
- package/dist/main.es.js +15 -15
- package/dist/{searchUtils-Dn39KADP.js → searchUtils-Cdh2yY-o.js} +1 -1
- package/dist/{searchUtils-D1Q5ffaA.cjs → searchUtils-DAoQu554.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/useClickOutside-BmlXg38T.js +14 -0
- package/dist/useClickOutside-D0505nsm.cjs +1 -0
- package/dist/{useGetApiData-BiGeqiNF.cjs → useGetApiData-D-AsBqMJ.cjs} +1 -1
- package/dist/{useGetApiData-Dng3v-c1.js → useGetApiData-DZ5S90WY.js} +6 -6
- package/dist/{usePermissions-DpJaM3Pd.cjs → usePermissions-BQuSQHym.cjs} +1 -1
- package/dist/{usePermissions-DH1EcMcR.js → usePermissions-CZniQNTq.js} +1 -1
- package/dist/{useRenderDraggableInPortal-DhdgZl3K.js → useRenderDraggableInPortal-C9Qmlq8B.js} +4 -4
- package/dist/{useRenderDraggableInPortal-DIQFNh3P.cjs → useRenderDraggableInPortal-QO101Q7g.cjs} +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +11 -11
- package/package.json +3 -2
- package/dist/ShortcutLinksContext-D6SOjqrB.cjs +0 -279
- package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +0 -4
- package/dist/layout/MainContainer/MainContainer.d.ts +0 -4
- package/dist/useWindowSize-CE6DJWzn.cjs +0 -1
- package/dist/useWindowSize-OLYtjFv_.js +0 -20
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ae=Object.defineProperty;var ie=(e,t,r)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>ie(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./ShortcutLinksContext-D6SOjqrB.cjs"),u=require("react"),N=require("@azure/msal-browser"),le=require("@azure/msal-react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");const ue=require("./Loading-74l0p5M0.cjs"),ce=require("./useGetApiData-BiGeqiNF.cjs"),fe=require("./useLocalStorageState-BFc8Gc8H.cjs");function de(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function me(){return de(Date.now())}function pe(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,c)=>a-c);return r>=n&&r<=s}function he(){return o.startOfDay(Date.now())}const xe=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),a=u.useCallback(f=>{r(!0),s(f)},[]),c=u.useCallback(()=>{r(!1)},[]),i=u.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:c}),[t,n,a,c]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Qe,{}),e]})},ge=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=u.useContext(o.PromptContext),[a,c]=u.useState(s.defaultValue??""),i=u.useCallback(()=>{n(null)},[n]),f=u.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);u.useEffect(()=>{t===!0&&c(s.defaultValue??"")},[t,s.defaultValue]);const l=u.useMemo(()=>({value:a,onChange:d=>c(d.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[a]);return o.jsxRuntimeExports.jsxs(o.Modal,{show:t,size:"sm",centered:!0,onHide:i,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:r})}),o.jsxRuntimeExports.jsxs("form",{onSubmit:f,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...l,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...l,type:s.type}):void 0]}),o.jsxRuntimeExports.jsxs(o.Modal.Footer,{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{variant:"outlined",color:"secondary",onClick:i,className:"flex-grow-1",children:e.cancel}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{color:"primary",disabled:s.required&&!a,type:"submit",className:"flex-grow-1",children:e.confirm})]})]})]})},ye=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),[a,c]=u.useState({input:"textarea",type:"text"}),i=u.useRef(()=>{}),f=u.useCallback(m=>{s(m),r(!0)},[]),l=u.useCallback(()=>{r(!1)},[]),d=u.useMemo(()=>({isShown:t,text:n,showPrompt:f,hidePrompt:l,resolveRef:i,options:a,setOptions:c}),[t,n,f,l,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(ge,{})]})},ve=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c,children:i})=>{const f=u.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c}),[t,e,r,s,a,n,c]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:f,children:o.jsxRuntimeExports.jsx(xe,{children:o.jsxRuntimeExports.jsxs(ye,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},Te=({children:e})=>{const[t,r]=u.useState(!1),[n]=u.useState(new Set),s=u.useCallback(i=>{n.add(i),r(!0)},[n]),a=u.useCallback(i=>{n.delete(i),n.size===0&&r(!1)},[n]),c=u.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:c,children:[t&&o.jsxRuntimeExports.jsx(ue.Loading,{}),e]})},Ce=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=u.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:c}=u.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[f,l]=u.useState(null),d=u.useCallback(async()=>{const x=await i();x&&l(x.token)},[i]);u.useEffect(()=>{d()},[d]);const h=u.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[p,g]=u.useState({state:h?o.LoginState.LOGGED_IN:o.LoginState.LOGGING_IN,user:h}),P=u.useCallback(async x=>{let v=null;return await t.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(M=>{v=M.data}).catch(()=>{v=null}),v},[t]),S=u.useCallback(()=>{localStorage.removeItem("user"),g({state:o.LoginState.LOGGED_OUT,user:null}),s(null),a(null)},[a,s]),E=u.useCallback(async x=>{g({state:o.LoginState.LOGGING_IN,user:null});const v=await P(x);return v?(g({state:o.LoginState.LOGGED_IN,user:v}),localStorage.setItem("user",JSON.stringify(v)),await c(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,c]),b=u.useCallback(()=>{S()},[S]);u.useEffect(()=>{if(r){const x=r.addEventCallback(v=>{if(v.eventType===N.EventType.LOGIN_SUCCESS&&v.payload){const M=v.payload;l(M.accessToken)}});return()=>{x&&r.removeEventCallback(x)}}return()=>{}},[r,E,b]);const K=u.useCallback(async x=>{x&&await E(x).catch(()=>{b(),s(null)})},[E,b,s]);u.useEffect(()=>{K(f)},[f,n==null?void 0:n.id,K]);const oe=u.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:oe,children:e})},Ee=({...e})=>{const{cookieDomain:t}=u.useContext(o.LuminusComponentsContext),[,r]=o.useCookies(["Authorization"]),n=u.useMemo(()=>({useMsal:e.useMsal??!1,msalInstance:e.useMsal?e.msalInstance??null:null,msalScopes:e.useMsal?e.msalScopes??[]:[],msalExtraScopes:e.useMsal?e.msalExtraScopes??[]:[]}),[e]);return u.useEffect(()=>{if(e.useMsal){const s=e.msalInstance.addEventCallback(a=>{if(a.eventType===N.EventType.LOGIN_SUCCESS||a.eventType===N.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const c=a.payload,i=c.account;e.msalInstance.setActiveAccount(i);const f=c.accessToken,l=c.expiresOn;r("Authorization",f,{path:"/",secure:!0,sameSite:"none",domain:t,expires:l??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{s&&e.msalInstance.removeEventCallback(s)}}return()=>{}},[e,r,t]),o.jsxRuntimeExports.jsx(o.AuthContext.Provider,{value:n,children:e.useMsal?o.jsxRuntimeExports.jsx(le.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Se=({children:e,relativeEndpoint:t})=>{const[r,n,s]=fe.useLocalStorageState("user-delegation",null),a=u.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):he(),h=r.to?o.parseISO(r.to):me();return pe(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:c,setData:i,reloadData:f}=ce.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),l=u.useRef(null);u.useEffect(()=>{const m=()=>{f(),l.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{l.current!==null&&window.clearTimeout(l.current)}},[f]),u.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,f]);const d=u.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:c,setAvailableDelegations:i,refreshAvailableDelegations:f}),[a,n,c,i,f]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var be=typeof Element<"u",Ae=typeof Map=="function",je=typeof Set=="function",Oe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function I(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!I(e[n],t[n]))return!1;return!0}var a;if(Ae&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!I(n.value[1],t.get(n.value[0])))return!1;return!0}if(je&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(Oe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(be&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!I(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var we=function(t,r){try{return I(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Pe=o.getDefaultExportFromCjs(we);var Re=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var c=Object.keys(t),i=Object.keys(r);if(c.length!==i.length)return!1;for(var f=Object.prototype.hasOwnProperty.bind(r),l=0;l<c.length;l++){var d=c[l];if(!f(d))return!1;var m=t[d],h=r[d];if(a=n?n.call(s,m,h,d):void 0,a===!1||a===void 0&&m!==h)return!1}return!0};const ke=o.getDefaultExportFromCjs(Re);var Q=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Q||{}),H={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},V=Object.values(Q),B={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},De=Object.entries(B).reduce((e,[t,r])=>(e[r]=t,e),{}),T="data-rh",O={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},w=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},Ie=e=>{let t=w(e,"title");const r=w(e,O.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=w(e,O.DEFAULT_TITLE);return t||n||void 0},Le=e=>w(e,O.ON_CHANGE_CLIENT_STATE)||(()=>{}),$=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),Me=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let a=0;a<s.length;a+=1){const i=s[a].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}}return r},[]),He=e=>console&&typeof console.warn=="function"&&console.warn(e),R=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&He(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const c={};a.filter(f=>{let l;const d=Object.keys(f);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(l==="rel"&&f[l].toLowerCase()==="canonical")&&!(g==="rel"&&f[g].toLowerCase()==="stylesheet")&&(l=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(l=p)}if(!l||!f[l])return!1;const m=f[l].toLowerCase();return n[l]||(n[l]={}),c[l]||(c[l]={}),n[l][m]?!1:(c[l][m]=!0,!0)}).reverse().forEach(f=>s.push(f));const i=Object.keys(c);for(let f=0;f<i.length;f+=1){const l=i[f],d={...n[l],...c[l]};n[l]=d}return s},[]).reverse()},$e=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},_e=e=>({baseTag:Me(["href"],e),bodyAttributes:$("bodyAttributes",e),defer:w(e,O.DEFER),encode:w(e,O.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:$("htmlAttributes",e),linkTags:R("link",["rel","href"],e),metaTags:R("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:R("noscript",["innerHTML"],e),onChangeClientState:Le(e),scriptTags:R("script",["src","innerHTML"],e),styleTags:R("style",["cssText"],e),title:Ie(e),titleAttributes:$("titleAttributes",e),prioritizeSeoTags:$e(e,O.PRIORITIZE_SEO_TAGS)}),X=e=>Array.isArray(e)?e.join(""):e,Ue=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},_=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(Ue(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Y=(e,t)=>({...e,[t]:void 0}),Ne=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),ee=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),qe=(e,t,r,n)=>{const s=ee(r),a=X(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},Fe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,c=Object.keys(a).filter(l=>!(l==="innerHTML"||l==="cssText")).reduce((l,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return l?`${l} ${m}`:m},""),i=a.innerHTML||a.cssText||"",f=Ne.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${c}${f?"/>":`>${i}</${e}>`}`},""),te=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=B[n];return r[s||n]=e[n],r},t),Ge=(e,t,r)=>{const n={key:t,[T]:!0},s=te(r,n);return[u.createElement("title",s,t)]},L=(e,t)=>t.map((r,n)=>{const s={key:n,[T]:!0};return Object.keys(r).forEach(a=>{const i=B[a]||a;if(i==="innerHTML"||i==="cssText"){const f=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:f}}else s[i]=r[a]}),u.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Ge(e,t.title,t.titleAttributes),toString:()=>qe(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>te(t),toString:()=>ee(t)};default:return{toComponent:()=>L(e,t),toString:()=>Fe(e,t,r)}}},ze=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=_(e,H.meta),a=_(t,H.link),c=_(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",c.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",c.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:c.default}},Be=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:c,title:i="",titleAttributes:f,prioritizeSeoTags:l}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return l&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=ze(e)),{priority:p,base:y("base",t,n),bodyAttributes:y("bodyAttributes",r,n),htmlAttributes:y("htmlAttributes",s,n),link:y("link",d,n),meta:y("meta",m,n),noscript:y("noscript",a,n),script:y("script",h,n),style:y("style",c,n),title:y("title",{title:i,titleAttributes:f},n)}},F=Be,D=[],re=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",re);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?D:this.instances,add:e=>{(this.canUseDOM?D:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?D:this.instances).indexOf(e);(this.canUseDOM?D:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=F({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Ke={},ne=u.createContext(Ke),A,se=(A=class extends u.Component{constructor(r){super(r);C(this,"helmetData");this.helmetData=new G(this.props.context||{},A.canUseDOM)}render(){return u.createElement(ne.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",re),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let c;return t&&t.length&&t.forEach(i=>{const f=document.createElement(e);for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l))if(l==="innerHTML")f.innerHTML=i.innerHTML;else if(l==="cssText")f.styleSheet?f.styleSheet.cssText=i.cssText:f.appendChild(document.createTextNode(i.cssText));else{const d=l,m=typeof i[d]>"u"?"":i[d];f.setAttribute(l,m)}f.setAttribute(T,"true"),s.some((l,d)=>(c=d,f.isEqualNode(l)))?s.splice(c,1):a.push(f)}),s.forEach(i=>{var f;return(f=i.parentNode)==null?void 0:f.removeChild(i)}),a.forEach(i=>r.appendChild(i)),{oldTags:s,newTags:a}},z=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(T),s=n?n.split(","):[],a=[...s],c=Object.keys(t);for(const i of c){const f=t[i]||"";r.getAttribute(i)!==f&&r.setAttribute(i,f),s.indexOf(i)===-1&&s.push(i);const l=a.indexOf(i);l!==-1&&a.splice(l,1)}for(let i=a.length-1;i>=0;i-=1)r.removeAttribute(a[i]);s.length===a.length?r.removeAttribute(T):r.getAttribute(T)!==c.join(",")&&r.setAttribute(T,c.join(","))},Ve=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=X(e)),z("title",t)},J=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:c,noscriptTags:i,onChangeClientState:f,scriptTags:l,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ve(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",c),noscriptTags:j("noscript",i),scriptTags:j("script",l),styleTags:j("style",d)},g={},P={};Object.keys(p).forEach(S=>{const{newTags:E,oldTags:b}=p[S];E.length&&(g[S]=E),b.length&&(P[S]=p[S].oldTags)}),t&&t(),f(e,g,P)},k=null,Ye=e=>{k&&cancelAnimationFrame(k),e.defer?k=requestAnimationFrame(()=>{J(e,()=>{k=null})}):(J(e),k=null)},Je=Ye,W=class extends u.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!ke(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=_e(t.get().map(a=>{const c={...a.props};return delete c.context,c}));se.canUseDOM?Je(s):F&&(n=F(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},U,We=(U=class extends u.Component{shouldComponentUpdate(e){return!Pe(Y(this.props,"helmetData"),Y(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return o.invariant(V.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${V.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),o.invariant(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return u.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...a}=n.props,c=Object.keys(a).reduce((f,l)=>(f[De[l]||l]=a[l],f),{});let{type:i}=n;switch(typeof i=="symbol"?i=i.toString():this.warnOnInvalidChildren(n,s),i){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,c,s);break;default:t=this.mapObjectTypeChildren(n,t,c,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof G)){const s=n;n=new G(s.context,!0),delete r.helmetData}return n?u.createElement(W,{...r,context:n.value}):u.createElement(ne.Consumer,null,s=>u.createElement(W,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const Z=(e,t)=>e?`${e} | ${t}`:t,Ze=({defaultHelmet:e,children:t,helmetPrefix:r})=>{const[n,s]=u.useState([Z(r??"",e)]),a=u.useCallback(l=>{s(d=>[...d,Z(r??"",l)])},[r]),c=u.useCallback(()=>{s(l=>l.length>1?l.slice(0,-1):l)},[s]),i=u.useMemo(()=>n.at(-1)??"",[n]),f=u.useMemo(()=>({addHelmet:a,removeHelmet:c}),[a,c]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:f,children:o.jsxRuntimeExports.jsxs(se,{children:[o.jsxRuntimeExports.jsx(We,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:i})}),t]})})},Qe=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{onConfirm:t,onCancel:r,text:n,show:s}=o.useConfirm();return o.jsxRuntimeExports.jsxs(o.Modal,{show:s,size:"sm",centered:!0,onHide:r,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:n})}),o.jsxRuntimeExports.jsx(o.Modal.Body,{children:o.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:r,children:e.no}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",color:"primary",onClick:t,className:"w-100 ml",children:e.yes})]})})]})};exports.AuthContext=o.AuthContext;exports.DelegationContext=o.DelegationContext;exports.HelmetContext=o.HelmetContext;exports.LoadingContext=o.LoadingContext;exports.LuminusComponentsContext=o.LuminusComponentsContext;exports.UserContext=o.UserContext;exports.AuthProvider=Ee;exports.DelegationProvider=Se;exports.HelmetProvider=Ze;exports.LoadingProvider=Te;exports.LuminusComponentsProvider=ve;exports.UserProvider=Ce;
|
|
1
|
+
"use strict";var ae=Object.defineProperty;var ie=(e,t,r)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>ie(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./ShortcutLinksContext-DeePM3HF.cjs"),u=require("react"),N=require("@azure/msal-browser"),le=require("@azure/msal-react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");const ue=require("./Loading-DagdrJCq.cjs"),ce=require("./useGetApiData-D-AsBqMJ.cjs"),fe=require("./useLocalStorageState-BFc8Gc8H.cjs");function de(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function me(){return de(Date.now())}function pe(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,c)=>a-c);return r>=n&&r<=s}function he(){return o.startOfDay(Date.now())}const xe=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),a=u.useCallback(f=>{r(!0),s(f)},[]),c=u.useCallback(()=>{r(!1)},[]),i=u.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:c}),[t,n,a,c]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Qe,{}),e]})},ge=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=u.useContext(o.PromptContext),[a,c]=u.useState(s.defaultValue??""),i=u.useCallback(()=>{n(null)},[n]),f=u.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);u.useEffect(()=>{t===!0&&c(s.defaultValue??"")},[t,s.defaultValue]);const l=u.useMemo(()=>({value:a,onChange:d=>c(d.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[a]);return o.jsxRuntimeExports.jsxs(o.Modal,{show:t,size:"sm",centered:!0,onHide:i,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:r})}),o.jsxRuntimeExports.jsxs("form",{onSubmit:f,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...l,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...l,type:s.type}):void 0]}),o.jsxRuntimeExports.jsxs(o.Modal.Footer,{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{variant:"outlined",color:"secondary",onClick:i,className:"flex-grow-1",children:e.cancel}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{color:"primary",disabled:s.required&&!a,type:"submit",className:"flex-grow-1",children:e.confirm})]})]})]})},ye=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),[a,c]=u.useState({input:"textarea",type:"text"}),i=u.useRef(()=>{}),f=u.useCallback(m=>{s(m),r(!0)},[]),l=u.useCallback(()=>{r(!1)},[]),d=u.useMemo(()=>({isShown:t,text:n,showPrompt:f,hidePrompt:l,resolveRef:i,options:a,setOptions:c}),[t,n,f,l,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(ge,{})]})},ve=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c,children:i})=>{const f=u.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c}),[t,e,r,s,a,n,c]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:f,children:o.jsxRuntimeExports.jsx(xe,{children:o.jsxRuntimeExports.jsxs(ye,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},Te=({children:e})=>{const[t,r]=u.useState(!1),[n]=u.useState(new Set),s=u.useCallback(i=>{n.add(i),r(!0)},[n]),a=u.useCallback(i=>{n.delete(i),n.size===0&&r(!1)},[n]),c=u.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:c,children:[t&&o.jsxRuntimeExports.jsx(ue.Loading,{}),e]})},Ce=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=u.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:c}=u.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[f,l]=u.useState(null),d=u.useCallback(async()=>{const x=await i();x&&l(x.token)},[i]);u.useEffect(()=>{d()},[d]);const h=u.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[p,g]=u.useState({state:h?o.LoginState.LOGGED_IN:o.LoginState.LOGGING_IN,user:h}),P=u.useCallback(async x=>{let v=null;return await t.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(M=>{v=M.data}).catch(()=>{v=null}),v},[t]),S=u.useCallback(()=>{localStorage.removeItem("user"),g({state:o.LoginState.LOGGED_OUT,user:null}),s(null),a(null)},[a,s]),E=u.useCallback(async x=>{g({state:o.LoginState.LOGGING_IN,user:null});const v=await P(x);return v?(g({state:o.LoginState.LOGGED_IN,user:v}),localStorage.setItem("user",JSON.stringify(v)),await c(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,c]),b=u.useCallback(()=>{S()},[S]);u.useEffect(()=>{if(r){const x=r.addEventCallback(v=>{if(v.eventType===N.EventType.LOGIN_SUCCESS&&v.payload){const M=v.payload;l(M.accessToken)}});return()=>{x&&r.removeEventCallback(x)}}return()=>{}},[r,E,b]);const K=u.useCallback(async x=>{x&&await E(x).catch(()=>{b(),s(null)})},[E,b,s]);u.useEffect(()=>{K(f)},[f,n==null?void 0:n.id,K]);const oe=u.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:oe,children:e})},Ee=({...e})=>{const{cookieDomain:t}=u.useContext(o.LuminusComponentsContext),[,r]=o.useCookies(["Authorization"]),n=u.useMemo(()=>({useMsal:e.useMsal??!1,msalInstance:e.useMsal?e.msalInstance??null:null,msalScopes:e.useMsal?e.msalScopes??[]:[],msalExtraScopes:e.useMsal?e.msalExtraScopes??[]:[]}),[e]);return u.useEffect(()=>{if(e.useMsal){const s=e.msalInstance.addEventCallback(a=>{if(a.eventType===N.EventType.LOGIN_SUCCESS||a.eventType===N.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const c=a.payload,i=c.account;e.msalInstance.setActiveAccount(i);const f=c.accessToken,l=c.expiresOn;r("Authorization",f,{path:"/",secure:!0,sameSite:"none",domain:t,expires:l??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{s&&e.msalInstance.removeEventCallback(s)}}return()=>{}},[e,r,t]),o.jsxRuntimeExports.jsx(o.AuthContext.Provider,{value:n,children:e.useMsal?o.jsxRuntimeExports.jsx(le.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Se=({children:e,relativeEndpoint:t})=>{const[r,n,s]=fe.useLocalStorageState("user-delegation",null),a=u.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):he(),h=r.to?o.parseISO(r.to):me();return pe(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:c,setData:i,reloadData:f}=ce.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),l=u.useRef(null);u.useEffect(()=>{const m=()=>{f(),l.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{l.current!==null&&window.clearTimeout(l.current)}},[f]),u.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,f]);const d=u.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:c,setAvailableDelegations:i,refreshAvailableDelegations:f}),[a,n,c,i,f]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var be=typeof Element<"u",Ae=typeof Map=="function",je=typeof Set=="function",Oe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function I(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!I(e[n],t[n]))return!1;return!0}var a;if(Ae&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!I(n.value[1],t.get(n.value[0])))return!1;return!0}if(je&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(Oe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(be&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!I(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var we=function(t,r){try{return I(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Pe=o.getDefaultExportFromCjs(we);var Re=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var c=Object.keys(t),i=Object.keys(r);if(c.length!==i.length)return!1;for(var f=Object.prototype.hasOwnProperty.bind(r),l=0;l<c.length;l++){var d=c[l];if(!f(d))return!1;var m=t[d],h=r[d];if(a=n?n.call(s,m,h,d):void 0,a===!1||a===void 0&&m!==h)return!1}return!0};const ke=o.getDefaultExportFromCjs(Re);var Q=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Q||{}),H={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},V=Object.values(Q),B={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},De=Object.entries(B).reduce((e,[t,r])=>(e[r]=t,e),{}),T="data-rh",O={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},w=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},Ie=e=>{let t=w(e,"title");const r=w(e,O.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=w(e,O.DEFAULT_TITLE);return t||n||void 0},Le=e=>w(e,O.ON_CHANGE_CLIENT_STATE)||(()=>{}),$=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),Me=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let a=0;a<s.length;a+=1){const i=s[a].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}}return r},[]),He=e=>console&&typeof console.warn=="function"&&console.warn(e),R=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&He(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const c={};a.filter(f=>{let l;const d=Object.keys(f);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(l==="rel"&&f[l].toLowerCase()==="canonical")&&!(g==="rel"&&f[g].toLowerCase()==="stylesheet")&&(l=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(l=p)}if(!l||!f[l])return!1;const m=f[l].toLowerCase();return n[l]||(n[l]={}),c[l]||(c[l]={}),n[l][m]?!1:(c[l][m]=!0,!0)}).reverse().forEach(f=>s.push(f));const i=Object.keys(c);for(let f=0;f<i.length;f+=1){const l=i[f],d={...n[l],...c[l]};n[l]=d}return s},[]).reverse()},$e=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},_e=e=>({baseTag:Me(["href"],e),bodyAttributes:$("bodyAttributes",e),defer:w(e,O.DEFER),encode:w(e,O.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:$("htmlAttributes",e),linkTags:R("link",["rel","href"],e),metaTags:R("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:R("noscript",["innerHTML"],e),onChangeClientState:Le(e),scriptTags:R("script",["src","innerHTML"],e),styleTags:R("style",["cssText"],e),title:Ie(e),titleAttributes:$("titleAttributes",e),prioritizeSeoTags:$e(e,O.PRIORITIZE_SEO_TAGS)}),X=e=>Array.isArray(e)?e.join(""):e,Ue=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},_=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(Ue(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Y=(e,t)=>({...e,[t]:void 0}),Ne=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),ee=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),qe=(e,t,r,n)=>{const s=ee(r),a=X(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},Fe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,c=Object.keys(a).filter(l=>!(l==="innerHTML"||l==="cssText")).reduce((l,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return l?`${l} ${m}`:m},""),i=a.innerHTML||a.cssText||"",f=Ne.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${c}${f?"/>":`>${i}</${e}>`}`},""),te=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=B[n];return r[s||n]=e[n],r},t),Ge=(e,t,r)=>{const n={key:t,[T]:!0},s=te(r,n);return[u.createElement("title",s,t)]},L=(e,t)=>t.map((r,n)=>{const s={key:n,[T]:!0};return Object.keys(r).forEach(a=>{const i=B[a]||a;if(i==="innerHTML"||i==="cssText"){const f=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:f}}else s[i]=r[a]}),u.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Ge(e,t.title,t.titleAttributes),toString:()=>qe(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>te(t),toString:()=>ee(t)};default:return{toComponent:()=>L(e,t),toString:()=>Fe(e,t,r)}}},ze=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=_(e,H.meta),a=_(t,H.link),c=_(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",c.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",c.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:c.default}},Be=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:c,title:i="",titleAttributes:f,prioritizeSeoTags:l}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return l&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=ze(e)),{priority:p,base:y("base",t,n),bodyAttributes:y("bodyAttributes",r,n),htmlAttributes:y("htmlAttributes",s,n),link:y("link",d,n),meta:y("meta",m,n),noscript:y("noscript",a,n),script:y("script",h,n),style:y("style",c,n),title:y("title",{title:i,titleAttributes:f},n)}},F=Be,D=[],re=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",re);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?D:this.instances,add:e=>{(this.canUseDOM?D:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?D:this.instances).indexOf(e);(this.canUseDOM?D:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=F({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Ke={},ne=u.createContext(Ke),A,se=(A=class extends u.Component{constructor(r){super(r);C(this,"helmetData");this.helmetData=new G(this.props.context||{},A.canUseDOM)}render(){return u.createElement(ne.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",re),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let c;return t&&t.length&&t.forEach(i=>{const f=document.createElement(e);for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l))if(l==="innerHTML")f.innerHTML=i.innerHTML;else if(l==="cssText")f.styleSheet?f.styleSheet.cssText=i.cssText:f.appendChild(document.createTextNode(i.cssText));else{const d=l,m=typeof i[d]>"u"?"":i[d];f.setAttribute(l,m)}f.setAttribute(T,"true"),s.some((l,d)=>(c=d,f.isEqualNode(l)))?s.splice(c,1):a.push(f)}),s.forEach(i=>{var f;return(f=i.parentNode)==null?void 0:f.removeChild(i)}),a.forEach(i=>r.appendChild(i)),{oldTags:s,newTags:a}},z=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(T),s=n?n.split(","):[],a=[...s],c=Object.keys(t);for(const i of c){const f=t[i]||"";r.getAttribute(i)!==f&&r.setAttribute(i,f),s.indexOf(i)===-1&&s.push(i);const l=a.indexOf(i);l!==-1&&a.splice(l,1)}for(let i=a.length-1;i>=0;i-=1)r.removeAttribute(a[i]);s.length===a.length?r.removeAttribute(T):r.getAttribute(T)!==c.join(",")&&r.setAttribute(T,c.join(","))},Ve=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=X(e)),z("title",t)},J=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:c,noscriptTags:i,onChangeClientState:f,scriptTags:l,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ve(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",c),noscriptTags:j("noscript",i),scriptTags:j("script",l),styleTags:j("style",d)},g={},P={};Object.keys(p).forEach(S=>{const{newTags:E,oldTags:b}=p[S];E.length&&(g[S]=E),b.length&&(P[S]=p[S].oldTags)}),t&&t(),f(e,g,P)},k=null,Ye=e=>{k&&cancelAnimationFrame(k),e.defer?k=requestAnimationFrame(()=>{J(e,()=>{k=null})}):(J(e),k=null)},Je=Ye,W=class extends u.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!ke(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=_e(t.get().map(a=>{const c={...a.props};return delete c.context,c}));se.canUseDOM?Je(s):F&&(n=F(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},U,We=(U=class extends u.Component{shouldComponentUpdate(e){return!Pe(Y(this.props,"helmetData"),Y(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return o.invariant(V.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${V.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),o.invariant(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return u.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...a}=n.props,c=Object.keys(a).reduce((f,l)=>(f[De[l]||l]=a[l],f),{});let{type:i}=n;switch(typeof i=="symbol"?i=i.toString():this.warnOnInvalidChildren(n,s),i){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,c,s);break;default:t=this.mapObjectTypeChildren(n,t,c,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof G)){const s=n;n=new G(s.context,!0),delete r.helmetData}return n?u.createElement(W,{...r,context:n.value}):u.createElement(ne.Consumer,null,s=>u.createElement(W,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const Z=(e,t)=>e?`${e} | ${t}`:t,Ze=({defaultHelmet:e,children:t,helmetPrefix:r})=>{const[n,s]=u.useState([Z(r??"",e)]),a=u.useCallback(l=>{s(d=>[...d,Z(r??"",l)])},[r]),c=u.useCallback(()=>{s(l=>l.length>1?l.slice(0,-1):l)},[s]),i=u.useMemo(()=>n.at(-1)??"",[n]),f=u.useMemo(()=>({addHelmet:a,removeHelmet:c}),[a,c]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:f,children:o.jsxRuntimeExports.jsxs(se,{children:[o.jsxRuntimeExports.jsx(We,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:i})}),t]})})},Qe=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{onConfirm:t,onCancel:r,text:n,show:s}=o.useConfirm();return o.jsxRuntimeExports.jsxs(o.Modal,{show:s,size:"sm",centered:!0,onHide:r,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:n})}),o.jsxRuntimeExports.jsx(o.Modal.Body,{children:o.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:r,children:e.no}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",color:"primary",onClick:t,className:"w-100 ml",children:e.yes})]})})]})};exports.AuthContext=o.AuthContext;exports.DelegationContext=o.DelegationContext;exports.HelmetContext=o.HelmetContext;exports.LoadingContext=o.LoadingContext;exports.LuminusComponentsContext=o.LuminusComponentsContext;exports.UserContext=o.UserContext;exports.AuthProvider=Ee;exports.DelegationProvider=Se;exports.HelmetProvider=Ze;exports.LoadingProvider=Te;exports.LuminusComponentsProvider=ve;exports.UserProvider=Ce;
|
package/dist/contexts.es.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var Se = Object.defineProperty;
|
|
2
2
|
var Oe = (e, t, r) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var A = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { t as N,
|
|
5
|
-
import E, { useState as C, useCallback as p, useMemo as b, useContext as
|
|
6
|
-
import { EventType as
|
|
4
|
+
import { t as N, br as Ee, j as f, bs as we, $ as q, bc as Ie, bt as fe, ad as S, bb as je, a0 as G, bu as Pe, a$ as De, av as ke, aI as de, bv as me, aJ as Le, aL as D, aK as $e, bw as He, aZ as se, bx as _e, az as pe, by as oe, bz as Me, b1 as Re } from "./ShortcutLinksContext-D5EF_fp9.js";
|
|
5
|
+
import E, { useState as C, useCallback as p, useMemo as b, useContext as H, useEffect as P, useRef as he, Component as te } from "react";
|
|
6
|
+
import { EventType as Z } from "@azure/msal-browser";
|
|
7
7
|
import { MsalProvider as Ue } from "@azure/msal-react";
|
|
8
8
|
import "react-router-dom";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
import "react-hook-form";
|
|
11
11
|
import "react-flexmonster";
|
|
12
|
-
import { L as Ne } from "./Loading-
|
|
13
|
-
import { u as Fe } from "./useGetApiData-
|
|
14
|
-
import { u as
|
|
12
|
+
import { L as Ne } from "./Loading-JUsRX9kB.js";
|
|
13
|
+
import { u as Fe } from "./useGetApiData-DZ5S90WY.js";
|
|
14
|
+
import { u as ze } from "./useLocalStorageState-Bt99kkCr.js";
|
|
15
15
|
function Ge(e) {
|
|
16
16
|
const t = N(e);
|
|
17
17
|
return t.setHours(23, 59, 59, 999), t;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function qe() {
|
|
20
20
|
return Ge(Date.now());
|
|
21
21
|
}
|
|
22
22
|
function Ke(e, t) {
|
|
@@ -40,7 +40,7 @@ const Be = ({ children: e }) => {
|
|
|
40
40
|
e
|
|
41
41
|
] });
|
|
42
42
|
}, Ye = () => {
|
|
43
|
-
const { texts: { confirm: e } } =
|
|
43
|
+
const { texts: { confirm: e } } = H(q), { isShown: t, text: r, onFinish: n } = Ie(), { options: s } = H(fe), [o, l] = C(s.defaultValue ?? ""), a = p(() => {
|
|
44
44
|
n(null);
|
|
45
45
|
}, [n]), c = p((u) => {
|
|
46
46
|
u.preventDefault(), !(s.required && !o) && n(o);
|
|
@@ -87,7 +87,7 @@ const Be = ({ children: e }) => {
|
|
|
87
87
|
e,
|
|
88
88
|
/* @__PURE__ */ f.jsx(Ye, {})
|
|
89
89
|
] });
|
|
90
|
-
},
|
|
90
|
+
}, _t = ({ cookieDomain: e, axiosOptions: t, language: r, texts: n, ProjectIconComponent: s, localizationContext: o, chartColorPalette: l, children: a }) => {
|
|
91
91
|
const c = b(() => ({
|
|
92
92
|
axiosOptions: t,
|
|
93
93
|
cookieDomain: e,
|
|
@@ -105,7 +105,7 @@ const Be = ({ children: e }) => {
|
|
|
105
105
|
n,
|
|
106
106
|
l
|
|
107
107
|
]);
|
|
108
|
-
return /* @__PURE__ */ f.jsx(
|
|
108
|
+
return /* @__PURE__ */ f.jsx(q.Provider, { value: c, children: /* @__PURE__ */ f.jsx(Be, { children: /* @__PURE__ */ f.jsxs(Je, { children: [
|
|
109
109
|
/* @__PURE__ */ f.jsx(Pe, {}),
|
|
110
110
|
a
|
|
111
111
|
] }) }) });
|
|
@@ -120,7 +120,7 @@ const Be = ({ children: e }) => {
|
|
|
120
120
|
e
|
|
121
121
|
] });
|
|
122
122
|
}, Rt = ({ children: e }) => {
|
|
123
|
-
const t = ke(), { msalInstance: r } =
|
|
123
|
+
const t = ke(), { msalInstance: r } = H(de), { delegation: n, setDelegation: s, setAvailableDelegations: o, refreshAvailableDelegations: l } = H(me), { getToken: a } = Le(), [c, i] = C(null), u = p(async () => {
|
|
124
124
|
const y = await a();
|
|
125
125
|
y && i(y.token);
|
|
126
126
|
}, [a]);
|
|
@@ -133,7 +133,7 @@ const Be = ({ children: e }) => {
|
|
|
133
133
|
}, [])(), [m, g] = C({
|
|
134
134
|
state: h ? D.LOGGED_IN : D.LOGGING_IN,
|
|
135
135
|
user: h
|
|
136
|
-
}),
|
|
136
|
+
}), _ = p(async (y) => {
|
|
137
137
|
let v = null;
|
|
138
138
|
return await t.get("/user/detail", y ? { headers: { Authorization: `Bearer ${y}` } } : void 0).then((K) => {
|
|
139
139
|
v = K.data;
|
|
@@ -150,7 +150,7 @@ const Be = ({ children: e }) => {
|
|
|
150
150
|
state: D.LOGGING_IN,
|
|
151
151
|
user: null
|
|
152
152
|
});
|
|
153
|
-
const v = await
|
|
153
|
+
const v = await _(y);
|
|
154
154
|
return v ? (g({
|
|
155
155
|
state: D.LOGGED_IN,
|
|
156
156
|
user: v
|
|
@@ -158,13 +158,13 @@ const Be = ({ children: e }) => {
|
|
|
158
158
|
state: D.LOGIN_FAILED,
|
|
159
159
|
user: null
|
|
160
160
|
}), !1);
|
|
161
|
-
}, [
|
|
161
|
+
}, [_, l]), I = p(() => {
|
|
162
162
|
w();
|
|
163
163
|
}, [w]);
|
|
164
164
|
P(() => {
|
|
165
165
|
if (r) {
|
|
166
166
|
const y = r.addEventCallback((v) => {
|
|
167
|
-
if (v.eventType ===
|
|
167
|
+
if (v.eventType === Z.LOGIN_SUCCESS && v.payload) {
|
|
168
168
|
const K = v.payload;
|
|
169
169
|
i(K.accessToken);
|
|
170
170
|
}
|
|
@@ -190,9 +190,9 @@ const Be = ({ children: e }) => {
|
|
|
190
190
|
loginUser: O,
|
|
191
191
|
logoutUser: I
|
|
192
192
|
}), [m, O, I]);
|
|
193
|
-
return /* @__PURE__ */ f.jsx(
|
|
193
|
+
return /* @__PURE__ */ f.jsx($e.Provider, { value: Ae, children: e });
|
|
194
194
|
}, Ut = ({ ...e }) => {
|
|
195
|
-
const { cookieDomain: t } =
|
|
195
|
+
const { cookieDomain: t } = H(q), [, r] = He(["Authorization"]), n = b(() => ({
|
|
196
196
|
useMsal: e.useMsal ?? !1,
|
|
197
197
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
198
198
|
msalScopes: e.useMsal ? e.msalScopes ?? [] : [],
|
|
@@ -201,7 +201,7 @@ const Be = ({ children: e }) => {
|
|
|
201
201
|
return P(() => {
|
|
202
202
|
if (e.useMsal) {
|
|
203
203
|
const s = e.msalInstance.addEventCallback((o) => {
|
|
204
|
-
if (o.eventType ===
|
|
204
|
+
if (o.eventType === Z.LOGIN_SUCCESS || o.eventType === Z.ACQUIRE_TOKEN_SUCCESS && o.payload) {
|
|
205
205
|
const l = o.payload, a = l.account;
|
|
206
206
|
e.msalInstance.setActiveAccount(a);
|
|
207
207
|
const c = l.accessToken, i = l.expiresOn;
|
|
@@ -223,10 +223,10 @@ const Be = ({ children: e }) => {
|
|
|
223
223
|
};
|
|
224
224
|
}, [e, r, t]), /* @__PURE__ */ f.jsx(de.Provider, { value: n, children: e.useMsal ? /* @__PURE__ */ f.jsx(Ue, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
225
225
|
}, Nt = ({ children: e, relativeEndpoint: t }) => {
|
|
226
|
-
const [r, n, s] =
|
|
226
|
+
const [r, n, s] = ze("user-delegation", null), o = b(() => {
|
|
227
227
|
if (!r)
|
|
228
228
|
return null;
|
|
229
|
-
const d = r.from ? se(r.from) : Ve(), h = r.to ? se(r.to) :
|
|
229
|
+
const d = r.from ? se(r.from) : Ve(), h = r.to ? se(r.to) : qe();
|
|
230
230
|
return Ke(new Date(Date.now()), { start: d, end: h }) ? r : (n(null), null);
|
|
231
231
|
}, [r, n]), { data: l, setData: a, reloadData: c } = Fe(t, {
|
|
232
232
|
nullStateBeforeLoad: !1,
|
|
@@ -234,7 +234,7 @@ const Be = ({ children: e }) => {
|
|
|
234
234
|
}), i = he(null);
|
|
235
235
|
P(() => {
|
|
236
236
|
const d = () => {
|
|
237
|
-
c(), i.current = window.setTimeout(d,
|
|
237
|
+
c(), i.current = window.setTimeout(d, _e() + 5e3);
|
|
238
238
|
};
|
|
239
239
|
return d(), () => {
|
|
240
240
|
i.current !== null && window.clearTimeout(i.current);
|
|
@@ -262,7 +262,7 @@ const Be = ({ children: e }) => {
|
|
|
262
262
|
]);
|
|
263
263
|
return /* @__PURE__ */ f.jsx(me.Provider, { value: u, children: e });
|
|
264
264
|
};
|
|
265
|
-
var
|
|
265
|
+
var Ze = typeof Element < "u", We = typeof Map == "function", Qe = typeof Set == "function", Xe = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
|
|
266
266
|
function F(e, t) {
|
|
267
267
|
if (e === t) return !0;
|
|
268
268
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
@@ -275,7 +275,7 @@ function F(e, t) {
|
|
|
275
275
|
return !0;
|
|
276
276
|
}
|
|
277
277
|
var o;
|
|
278
|
-
if (
|
|
278
|
+
if (We && e instanceof Map && t instanceof Map) {
|
|
279
279
|
if (e.size !== t.size) return !1;
|
|
280
280
|
for (o = e.entries(); !(n = o.next()).done; )
|
|
281
281
|
if (!t.has(n.value[0])) return !1;
|
|
@@ -301,7 +301,7 @@ function F(e, t) {
|
|
|
301
301
|
if (s = Object.keys(e), r = s.length, r !== Object.keys(t).length) return !1;
|
|
302
302
|
for (n = r; n-- !== 0; )
|
|
303
303
|
if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1;
|
|
304
|
-
if (
|
|
304
|
+
if (Ze && e instanceof Element) return !1;
|
|
305
305
|
for (n = r; n-- !== 0; )
|
|
306
306
|
if (!((s[n] === "_owner" || s[n] === "__v" || s[n] === "__o") && e.$$typeof) && !F(e[s[n]], t[s[n]]))
|
|
307
307
|
return !1;
|
|
@@ -382,7 +382,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
382
382
|
ON_CHANGE_CLIENT_STATE: "onChangeClientState",
|
|
383
383
|
TITLE_TEMPLATE: "titleTemplate",
|
|
384
384
|
PRIORITIZE_SEO_TAGS: "prioritizeSeoTags"
|
|
385
|
-
},
|
|
385
|
+
}, $ = (e, t) => {
|
|
386
386
|
for (let r = e.length - 1; r >= 0; r -= 1) {
|
|
387
387
|
const n = e[r];
|
|
388
388
|
if (Object.prototype.hasOwnProperty.call(n, t))
|
|
@@ -390,17 +390,17 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
390
390
|
}
|
|
391
391
|
return null;
|
|
392
392
|
}, ot = (e) => {
|
|
393
|
-
let t =
|
|
393
|
+
let t = $(
|
|
394
394
|
e,
|
|
395
395
|
"title"
|
|
396
396
|
/* TITLE */
|
|
397
397
|
);
|
|
398
|
-
const r =
|
|
398
|
+
const r = $(e, L.TITLE_TEMPLATE);
|
|
399
399
|
if (Array.isArray(t) && (t = t.join("")), r && t)
|
|
400
400
|
return r.replace(/%s/g, () => t);
|
|
401
|
-
const n =
|
|
401
|
+
const n = $(e, L.DEFAULT_TITLE);
|
|
402
402
|
return t || n || void 0;
|
|
403
|
-
}, at = (e) =>
|
|
403
|
+
}, at = (e) => $(e, L.ON_CHANGE_CLIENT_STATE) || (() => {
|
|
404
404
|
}), B = (e, t) => t.filter((r) => typeof r[e] < "u").map((r) => r[e]).reduce((r, n) => ({ ...r, ...n }), {}), it = (e, t) => t.filter((r) => typeof r.base < "u").map((r) => r.base).reverse().reduce((r, n) => {
|
|
405
405
|
if (!r.length) {
|
|
406
406
|
const s = Object.keys(n);
|
|
@@ -452,8 +452,8 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
452
452
|
/* HREF */
|
|
453
453
|
], e),
|
|
454
454
|
bodyAttributes: B("bodyAttributes", e),
|
|
455
|
-
defer:
|
|
456
|
-
encode:
|
|
455
|
+
defer: $(e, L.DEFER),
|
|
456
|
+
encode: $(e, L.ENCODE_SPECIAL_CHARACTERS),
|
|
457
457
|
htmlAttributes: B("htmlAttributes", e),
|
|
458
458
|
linkTags: M(
|
|
459
459
|
"link",
|
|
@@ -514,15 +514,15 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
514
514
|
"script",
|
|
515
515
|
"style"
|
|
516
516
|
/* STYLE */
|
|
517
|
-
],
|
|
517
|
+
], W = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), Te = (e) => Object.keys(e).reduce((t, r) => {
|
|
518
518
|
const n = typeof e[r] < "u" ? `${r}="${e[r]}"` : `${r}`;
|
|
519
519
|
return t ? `${t} ${n}` : n;
|
|
520
520
|
}, ""), mt = (e, t, r, n) => {
|
|
521
521
|
const s = Te(r), o = ge(t);
|
|
522
|
-
return s ? `<${e} ${x}="true" ${s}>${
|
|
522
|
+
return s ? `<${e} ${x}="true" ${s}>${W(
|
|
523
523
|
o,
|
|
524
524
|
n
|
|
525
|
-
)}</${e}>` : `<${e} ${x}="true">${
|
|
525
|
+
)}</${e}>` : `<${e} ${x}="true">${W(
|
|
526
526
|
o,
|
|
527
527
|
n
|
|
528
528
|
)}</${e}>`;
|
|
@@ -530,7 +530,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
530
530
|
const o = s, l = Object.keys(o).filter(
|
|
531
531
|
(i) => !(i === "innerHTML" || i === "cssText")
|
|
532
532
|
).reduce((i, u) => {
|
|
533
|
-
const d = typeof o[u] > "u" ? u : `${u}="${
|
|
533
|
+
const d = typeof o[u] > "u" ? u : `${u}="${W(o[u], r)}"`;
|
|
534
534
|
return i ? `${i} ${d}` : d;
|
|
535
535
|
}, ""), a = o.innerHTML || o.cssText || "", c = dt.indexOf(e) === -1;
|
|
536
536
|
return `${n}<${e} ${x}="true" ${l}${c ? "/>" : `>${a}</${e}>`}`;
|
|
@@ -543,7 +543,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
543
543
|
[x]: !0
|
|
544
544
|
}, s = ve(r, n);
|
|
545
545
|
return [E.createElement("title", s, t)];
|
|
546
|
-
},
|
|
546
|
+
}, z = (e, t) => t.map((r, n) => {
|
|
547
547
|
const s = {
|
|
548
548
|
key: n,
|
|
549
549
|
[x]: !0
|
|
@@ -571,7 +571,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
571
571
|
};
|
|
572
572
|
default:
|
|
573
573
|
return {
|
|
574
|
-
toComponent: () =>
|
|
574
|
+
toComponent: () => z(e, t),
|
|
575
575
|
toString: () => pt(e, t, r)
|
|
576
576
|
};
|
|
577
577
|
}
|
|
@@ -580,9 +580,9 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
580
580
|
return {
|
|
581
581
|
priorityMethods: {
|
|
582
582
|
toComponent: () => [
|
|
583
|
-
...
|
|
584
|
-
...
|
|
585
|
-
...
|
|
583
|
+
...z("meta", s.priority),
|
|
584
|
+
...z("link", o.priority),
|
|
585
|
+
...z("script", l.priority)
|
|
586
586
|
],
|
|
587
587
|
toString: () => (
|
|
588
588
|
// generate all the tags as strings and concatenate them
|
|
@@ -733,11 +733,11 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
733
733
|
noscriptTags: k("noscript", a),
|
|
734
734
|
scriptTags: k("script", i),
|
|
735
735
|
styleTags: k("style", u)
|
|
736
|
-
}, g = {},
|
|
736
|
+
}, g = {}, _ = {};
|
|
737
737
|
Object.keys(m).forEach((w) => {
|
|
738
738
|
const { newTags: O, oldTags: I } = m[w];
|
|
739
|
-
O.length && (g[w] = O), I.length && (
|
|
740
|
-
}), t && t(), c(e, g,
|
|
739
|
+
O.length && (g[w] = O), I.length && (_[w] = m[w].oldTags);
|
|
740
|
+
}), t && t(), c(e, g, _);
|
|
741
741
|
}, R = null, xt = (e) => {
|
|
742
742
|
R && cancelAnimationFrame(R), e.defer ? R = requestAnimationFrame(() => {
|
|
743
743
|
le(e, () => {
|
|
@@ -919,7 +919,7 @@ const ue = (e, t) => e ? `${e} | ${t}` : t, Ft = ({ defaultHelmet: e, children:
|
|
|
919
919
|
t
|
|
920
920
|
] }) });
|
|
921
921
|
}, At = () => {
|
|
922
|
-
const { texts: { confirm: e } } =
|
|
922
|
+
const { texts: { confirm: e } } = H(q), { onConfirm: t, onCancel: r, text: n, show: s } = Re();
|
|
923
923
|
return /* @__PURE__ */ f.jsxs(S, { show: s, size: "sm", centered: !0, onHide: r, children: [
|
|
924
924
|
/* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: n }) }),
|
|
925
925
|
/* @__PURE__ */ f.jsx(S.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
@@ -937,8 +937,8 @@ export {
|
|
|
937
937
|
Ft as HelmetProvider,
|
|
938
938
|
De as LoadingContext,
|
|
939
939
|
Mt as LoadingProvider,
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
940
|
+
q as LuminusComponentsContext,
|
|
941
|
+
_t as LuminusComponentsProvider,
|
|
942
|
+
$e as UserContext,
|
|
943
943
|
Rt as UserProvider
|
|
944
944
|
};
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./ShortcutLinksContext-DeePM3HF.cjs"),k=require("./useClickOutside-D0505nsm.cjs"),x=require("./usePermissions-BQuSQHym.cjs"),l=require("./useRenderDraggableInPortal-QO101Q7g.cjs"),T=require("./useGetApiData-D-AsBqMJ.cjs"),c=require("react"),L=require("./useLocalStorageState-BFc8Gc8H.cjs");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const G=r=>{let e="pending",u;const t=r.then(s=>{e="success",u=s},s=>{e="error",u=s});return()=>{switch(e){case"pending":throw t;case"success":return u;case"error":throw u;default:throw new Error("Unknown status")}}};function O(r,e){const u=a.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[t,s]=c.useState(null);return c.useEffect(()=>{(async()=>{const n=u.get(r).then(o=>o.data);s(G(n))})()},[u,r]),t}const B=(r,e,u)=>{let t="pending",s;const d=r.then(n=>{t="success",s=n},n=>{const o=n==null?void 0:n.response;(o==null?void 0:o.status)===404&&u?(t="error-404",s=n):(t="error",s=n)});return()=>{switch(t){case"pending":throw d;case"success":return s;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},i={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},E=(r,{loadOnInit:e=i.loadOnInit,enabled:u=i.enabled,silent:t=i.silent,nullStateBeforeLoad:s=i.nullStateBeforeLoad,nullStateOnFail:d=i.nullStateOnFail,customApiUrl:n,customBearerToken:o,dataTransformer:h,errorBoundaryOn404:S}=i)=>{const p=a.useAxios({silent:t,customToken:o,differentBaseUrl:n,noToastOnStatus:S?[404]:void 0}),{startLoading:D,stopLoading:w}=c.useContext(a.LoadingContext),A=c.useRef(0),{isAuthenticated:C}=a.useAuth(),[q,g]=c.useState(null),m=c.useCallback(async(f,P)=>{if(!C()||u===!1)return;!t&&D(`loadData-${r}-${P}`),s&&g(null);const b=p.get(r,{signal:f}).then(y=>h?h(y.data):y.data).finally(()=>!t&&w(`loadData-${r}-${P}`));g(B(b,d??!1,S??!1))},[C,u,t,D,r,s,p,h,w,d,S]);return c.useEffect(()=>{if(e===!1)return;const f=new AbortController;return m(f.signal,++A.current),()=>{f.abort()}},[m,e]),{data:q,setData:g,reloadData:m}};exports.cancelToken=a.cancelToken;exports.useAuth=a.useAuth;exports.useAxios=a.useAxios;exports.useConfirm=a.useConfirm;exports.useFormControlType=a.useFormControlType;exports.useNotifications=a.useNotifications;exports.usePrompt=a.usePrompt;exports.useWindowSize=a.useWindowSize;exports.useZodSchemaTypes=a.useZodSchemaTypes;exports.useClickOutside=k.useClickOutside;exports.usePermissions=x.usePermissions;exports.useClipboard=l.useClipboard;exports.useEmployeePhotoPath=l.useEmployeePhotoPath;exports.useKeyPress=l.useKeyPress;exports.useRenderDraggableInPortal=l.useRenderDraggableInPortal;exports.useSearchQuery=l.useSearchQuery;exports.useSearchQueryState=l.useSearchQueryState;exports.useGetApiData=T.useGetApiData;exports.useLocalStorageState=L.useLocalStorageState;exports.useGetApiDataBound=E;exports.useGetDataBound=O;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { u as se } from "./usePermissions-
|
|
5
|
-
import { u as oe, e as re, a as ne, b as ue, c as ce, d as le } from "./useRenderDraggableInPortal-
|
|
6
|
-
import { u as fe } from "./useGetApiData-
|
|
7
|
-
import { useState as S, useEffect as C, useContext as
|
|
1
|
+
import { av as x, a$ as y, aJ as $ } from "./ShortcutLinksContext-D5EF_fp9.js";
|
|
2
|
+
import { bA as j, b1 as q, aP as H, b0 as M, bc as V, af as X, bB as Y } from "./ShortcutLinksContext-D5EF_fp9.js";
|
|
3
|
+
import { u as ee } from "./useClickOutside-BmlXg38T.js";
|
|
4
|
+
import { u as se } from "./usePermissions-CZniQNTq.js";
|
|
5
|
+
import { u as oe, e as re, a as ne, b as ue, c as ce, d as le } from "./useRenderDraggableInPortal-C9Qmlq8B.js";
|
|
6
|
+
import { u as fe } from "./useGetApiData-DZ5S90WY.js";
|
|
7
|
+
import { useState as S, useEffect as C, useContext as B, useRef as L, useCallback as T } from "react";
|
|
8
8
|
import { u as me } from "./useLocalStorageState-Bt99kkCr.js";
|
|
9
9
|
import "react-router-dom";
|
|
10
10
|
import "react-dom";
|
|
@@ -32,7 +32,7 @@ const U = (o) => {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
function
|
|
35
|
+
function J(o, e) {
|
|
36
36
|
const a = x({
|
|
37
37
|
silent: !0,
|
|
38
38
|
differentBaseUrl: e == null ? void 0 : e.customBaseUrl,
|
|
@@ -45,7 +45,7 @@ function K(o, e) {
|
|
|
45
45
|
})();
|
|
46
46
|
}, [a, o]), t;
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const E = (o, e, a) => {
|
|
49
49
|
let t = "pending", s;
|
|
50
50
|
const c = o.then((r) => {
|
|
51
51
|
t = "success", s = r;
|
|
@@ -73,20 +73,20 @@ const B = (o, e, a) => {
|
|
|
73
73
|
enabled: !0,
|
|
74
74
|
nullStateBeforeLoad: !0,
|
|
75
75
|
nullStateOnFail: !1
|
|
76
|
-
},
|
|
76
|
+
}, K = (o, { loadOnInit: e = u.loadOnInit, enabled: a = u.enabled, silent: t = u.silent, nullStateBeforeLoad: s = u.nullStateBeforeLoad, nullStateOnFail: c = u.nullStateOnFail, customApiUrl: r, customBearerToken: n, dataTransformer: i, errorBoundaryOn404: f } = u) => {
|
|
77
77
|
const p = x({
|
|
78
78
|
silent: t,
|
|
79
79
|
customToken: n,
|
|
80
80
|
differentBaseUrl: r,
|
|
81
81
|
noToastOnStatus: f ? [404] : void 0
|
|
82
|
-
}), { startLoading: h, stopLoading: g } =
|
|
82
|
+
}), { startLoading: h, stopLoading: g } = B(y), k = L(0), { isAuthenticated: w } = $(), [A, d] = S(null), m = T(async (l, D) => {
|
|
83
83
|
if (!w() || a === !1)
|
|
84
84
|
return;
|
|
85
85
|
!t && h(`loadData-${o}-${D}`), s && d(null);
|
|
86
|
-
const
|
|
86
|
+
const P = p.get(o, {
|
|
87
87
|
signal: l
|
|
88
88
|
}).then((b) => i ? i(b.data) : b.data).finally(() => !t && g(`loadData-${o}-${D}`));
|
|
89
|
-
d(
|
|
89
|
+
d(E(P, c ?? !1, f ?? !1));
|
|
90
90
|
}, [
|
|
91
91
|
w,
|
|
92
92
|
a,
|
|
@@ -113,22 +113,22 @@ export {
|
|
|
113
113
|
j as cancelToken,
|
|
114
114
|
$ as useAuth,
|
|
115
115
|
x as useAxios,
|
|
116
|
-
|
|
116
|
+
ee as useClickOutside,
|
|
117
117
|
oe as useClipboard,
|
|
118
118
|
q as useConfirm,
|
|
119
119
|
re as useEmployeePhotoPath,
|
|
120
120
|
H as useFormControlType,
|
|
121
121
|
fe as useGetApiData,
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
K as useGetApiDataBound,
|
|
123
|
+
J as useGetDataBound,
|
|
124
124
|
ne as useKeyPress,
|
|
125
125
|
me as useLocalStorageState,
|
|
126
|
-
|
|
126
|
+
M as useNotifications,
|
|
127
127
|
se as usePermissions,
|
|
128
|
-
|
|
128
|
+
V as usePrompt,
|
|
129
129
|
ue as useRenderDraggableInPortal,
|
|
130
130
|
ce as useSearchQuery,
|
|
131
131
|
le as useSearchQueryState,
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
X as useWindowSize,
|
|
133
|
+
Y as useZodSchemaTypes
|
|
134
134
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
2
2
|
|
|
3
3
|
type Props = {
|
|
4
4
|
width: number;
|
|
5
5
|
children?: ReactNode;
|
|
6
|
+
isExpandedOnMobileState: [boolean, Dispatch<SetStateAction<boolean>>];
|
|
6
7
|
};
|
|
7
|
-
declare const SideContentBar: ({ width, children }: Props) => import("react").JSX.Element;
|
|
8
|
+
declare const SideContentBar: ({ width, children, isExpandedOnMobileState: [isExpandedOnMobile, setIsExpandedOnMobile], }: Props) => import("react").JSX.Element;
|
|
8
9
|
export default SideContentBar;
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-DeePM3HF.cjs"),x=require("react"),y=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const k=require("./useClickOutside-D0505nsm.cjs");require("react-dom");const B=require("./usePermissions-BQuSQHym.cjs"),P="_side-menu-item_1o1uo_1",f="_disabled_1o1uo_6",w="_nav-button_1o1uo_10",S="_child_1o1uo_18",I="_text_1o1uo_23",L="_icon_1o1uo_30",T="_collapse-icon_1o1uo_36",O="_collapsed_1o1uo_46",$="_collapse-icon-mini_1o1uo_49",A="_expanded_1o1uo_80",K="_children-container_1o1uo_86",D="_visible_1o1uo_94",F="_children_1o1uo_86",z="_mobile_1o1uo_106",o={"side-menu-item":"_side-menu-item_1o1uo_1",sideMenuItem:P,disabled:f,"nav-button":"_nav-button_1o1uo_10",navButton:w,child:S,text:I,icon:L,"collapse-icon":"_collapse-icon_1o1uo_36",collapseIcon:T,collapsed:O,"collapse-icon-mini":"_collapse-icon-mini_1o1uo_49",collapseIconMini:$,expanded:A,"children-container":"_children-container_1o1uo_86",childrenContainer:K,visible:D,children:F,mobile:z},U=({item:s,menuExpanded:i,useTooltips:l,children:r})=>s.tooltip&&!i&&l?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:s.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:r})}):r,g=({item:s,menuExpanded:i,collapsed:l,onCollapse:r,currentPath:_,useHover:a,useTooltips:p,isMobile:E})=>{var M,q,v,N;const[d,h]=x.useState(!1),[j]=_.split("?"),R=s.linkTo===j||((M=s.children)==null?void 0:M.some(n=>n.linkTo===j)),u=x.useRef(null);return k.useClickOutside([u],()=>l&&r()),e.jsxRuntimeExports.jsxs("li",{ref:u,className:e.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.mobile]:E},{[o.expanded]:i},{active:d||R},{open:l&&s.children},{[o.disabled]:s.disabled||s.notPermitted||((q=s.children)==null?void 0:q.every(n=>n.notPermitted||n.disabled))},{disabled:s.disabled||s.notPermitted||((v=s.children)==null?void 0:v.every(n=>n.notPermitted||n.disabled))}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[e.jsxRuntimeExports.jsx(U,{item:s,menuExpanded:i,useTooltips:p,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",o.navButton),onClick:()=>{r()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:s.icon}),!a&&!i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",o.collapseIconMini,{[o.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(y.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",o.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:s.icon}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",o.childrenContainer,{[o.visible]:l}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",o.children),children:(N=s.children)==null?void 0:N.map(n=>e.jsxRuntimeExports.jsx(y.Link,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:e.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:n.disabled||n.notPermitted},{disabled:n.disabled||n.notPermitted}),onClick:r,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:n.title})},n.linkTo))})})]})},W="_side-menu_1q9oh_1",G="_sidebar-header_1q9oh_15",J="_side-menu-content_1q9oh_22",Q="_expand_1q9oh_27",V="_only-logo_1q9oh_31",X="_mobile_1q9oh_34",Y="_divider_1q9oh_49",m={"side-menu":"_side-menu_1q9oh_1",sideMenu:W,"sidebar-header":"_sidebar-header_1q9oh_15",sidebarHeader:G,"side-menu-content":"_side-menu-content_1q9oh_22",sideMenuContent:J,expand:Q,"only-logo":"_only-logo_1q9oh_31",onlyLogo:V,mobile:X,divider:Y},Z=({headerItem:s,searchItem:i,shortcutsItem:l,mainItems:r,secondaryItems:_,expanded:a,setExpanded:p,currentPath:E,useHover:d,useTooltips:h})=>{const[j,R]=x.useState(-1),{checkUserHasPermissions:u}=B.usePermissions(),M=x.useMemo(()=>r.map(t=>{var c;return{...t,notPermitted:!u(t.permissions??[],"any"),children:(c=t.children)==null?void 0:c.map(b=>({...b,notPermitted:!u(b.permissions??[],"any"),disabled:t.disabled||b.disabled}))}}),[r,u]),q=x.useMemo(()=>_.map(t=>{var c;return{...t,notPermitted:!u(t.permissions??[],"any"),children:(c=t.children)==null?void 0:c.map(b=>({...b,notPermitted:!u(b.permissions??[],"any")}))}}),[_,u]),v=t=>{R(t===j?-1:t)};x.useEffect(()=>{a||R(-1)},[a]);const N=x.useRef(null);k.useClickOutside([N],()=>p(!1));const{isMobile:n}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:N,className:e.classNames("luminus-side-menu shadow",m.sideMenu,{[m.mobile]:n},{[m.expand]:a},{expand:a}),onMouseEnter:()=>d&&p(!0),onMouseLeave:()=>d&&p(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",m.sidebarHeader,{[m.onlyLogo]:d}),role:d?void 0:"button",onClick:d?void 0:()=>p(!a),children:d?s:a?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),a&&(i||l)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[l&&a?l:null,i&&a?i:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:m.sideMenuContent,children:[M.map((t,c)=>e.jsxRuntimeExports.jsx(g,{item:t,menuExpanded:a,collapsed:c===j,onCollapse:()=>v(c),currentPath:E,useHover:d,useTooltips:h,isMobile:n},t.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",m.divider)}),q.map((t,c)=>e.jsxRuntimeExports.jsx(g,{item:t,menuExpanded:a,collapsed:c===j,onCollapse:()=>v(c),currentPath:E,useHover:d,useTooltips:h,isMobile:n},t.title))]})]})},H="_top-bar_lnmq0_1",ee="_top-bar-brand_lnmq0_12",C={"top-bar":"_top-bar_lnmq0_1",topBar:H,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:ee},se=({appName:s,leftOffset:i,leftContent:l,centerContent:r,rightContent:_})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",C.topBar),style:{width:i?`calc(100% - ${i}px)`:void 0,left:i?`${i}px`:void 0},children:e.jsxRuntimeExports.jsxs("div",{className:"w-100 row g-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"col-4 d-flex gap-3 align-items-center",children:[e.jsxRuntimeExports.jsx(y.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",C.topBarBrand),children:s}),l]}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex align-items-center",children:r??null}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex justify-content-end align-items-center",children:_??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=Z;exports.TopBar=se;
|