react-luminus-components 1.3.151 → 1.3.152
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/README.md +349 -349
- package/dist/.vite/manifest.json +52 -68
- package/dist/{Loading-DiC4Np7v.js → Loading-D012N8ha.js} +1 -1
- package/dist/Loading-TbgEJLF_.cjs +1 -0
- package/dist/{nivo-bar.es-B2GqU-tV.js → ResponsiveContextDropdown-C9WqbqI0.js} +4970 -4970
- package/dist/{nivo-bar.es-C8-VCzr1.cjs → ResponsiveContextDropdown-ep8LBIy7.cjs} +45 -45
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +40 -40
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +17 -17
- package/dist/layout/index.d.ts +0 -2
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +102 -114
- package/dist/main.cjs.js +2 -2
- package/dist/main.es.js +2961 -2962
- package/dist/{searchUtils-BhpLdWdC.js → searchUtils-Bd-Jy9zp.js} +1 -1
- package/dist/searchUtils-CqU0wzK3.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/useClipboard-BoSxUeRj.cjs +1 -0
- package/dist/{useClipboard-DegAIBUd.js → useClipboard-ClHiiBOP.js} +1 -1
- package/dist/useGetApiData-B2Ap2urp.cjs +1 -0
- package/dist/{useGetApiData-CTK8sM2X.js → useGetApiData-DvRb2p5u.js} +6 -6
- package/dist/usePermissions-CE2IinZO.js +20 -0
- package/dist/usePermissions-LOq-NC5k.cjs +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +17 -17
- package/dist/variables.scss +165 -165
- package/package.json +116 -116
- package/dist/FullScreenContainer-Ahxfk-Xk.js +0 -23
- package/dist/FullScreenContainer-BWYwSExf.cjs +0 -1
- package/dist/Loading-C-Dsxusq.cjs +0 -1
- package/dist/searchUtils-BSGjuykO.cjs +0 -1
- package/dist/useClipboard-D6esVLqf.cjs +0 -1
- package/dist/useGetApiData-D4Xo7Loy.cjs +0 -1
- package/dist/usePermissions-BKn9Opdd.js +0 -20
- package/dist/usePermissions-DMDGiPC1.cjs +0 -1
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var oe=Object.defineProperty;var ae=(e,t,r)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>ae(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./nivo-bar.es-C8-VCzr1.cjs"),u=require("react"),N=require("@azure/msal-browser"),ie=require("@azure/msal-react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");const le=require("./Loading-C-Dsxusq.cjs"),ue=require("./useGetApiData-D4Xo7Loy.cjs"),ce=require("./useLocalStorageState-BFc8Gc8H.cjs");function fe(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function de(){return fe(Date.now())}function me(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,f)=>a-f);return r>=n&&r<=s}function pe(){return o.startOfDay(Date.now())}const he=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),a=u.useCallback(l=>{r(!0),s(l)},[]),f=u.useCallback(()=>{r(!1)},[]),i=u.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:f}),[t,n,a,f]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Ze,{}),e]})},xe=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=u.useContext(o.PromptContext),[a,f]=u.useState(s.defaultValue??""),i=u.useCallback(()=>{n(null)},[n]),l=u.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);u.useEffect(()=>{t===!0&&f(s.defaultValue??"")},[t,s.defaultValue]);const c=u.useMemo(()=>({value:a,onChange:d=>f(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:l,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...c,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...c,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})]})]})]})},ge=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),[a,f]=u.useState({input:"textarea",type:"text"}),i=u.useRef(()=>{}),l=u.useCallback(m=>{s(m),r(!0)},[]),c=u.useCallback(()=>{r(!1)},[]),d=u.useMemo(()=>({isShown:t,text:n,showPrompt:l,hidePrompt:c,resolveRef:i,options:a,setOptions:f}),[t,n,l,c,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(xe,{})]})},ye=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:f,children:i})=>{const l=u.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:f}),[t,e,r,s,a,n,f]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:l,children:o.jsxRuntimeExports.jsx(he,{children:o.jsxRuntimeExports.jsxs(ge,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},ve=({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]),f=u.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:f,children:[t&&o.jsxRuntimeExports.jsx(le.Loading,{}),e]})},Te=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=u.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:f}=u.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[l,c]=u.useState(null),d=u.useCallback(async()=>{const x=await i();x&&c(x)},[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 f(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,f]),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;c(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(l)},[l,n==null?void 0:n.id,K]);const se=u.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:se,children:e})},Ce=({...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??[]:[]}),[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 f=a.payload,i=f.account;e.msalInstance.setActiveAccount(i);const l=f.accessToken,c=f.expiresOn;r("Authorization",l,{path:"/",secure:!0,sameSite:"none",domain:t,expires:c??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(ie.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Ee=({children:e,relativeEndpoint:t})=>{const[r,n,s]=ce.useLocalStorageState("user-delegation",null),a=u.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):pe(),h=r.to?o.parseISO(r.to):de();return me(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:f,setData:i,reloadData:l}=ue.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),c=u.useRef(null);u.useEffect(()=>{const m=()=>{l(),c.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{c.current!==null&&window.clearTimeout(c.current)}},[l]),u.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,l]);const d=u.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:f,setAvailableDelegations:i,refreshAvailableDelegations:l}),[a,n,f,i,l]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var Se=typeof Element<"u",be=typeof Map=="function",Ae=typeof Set=="function",je=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function k(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(!k(e[n],t[n]))return!1;return!0}var a;if(be&&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(!k(n.value[1],t.get(n.value[0])))return!1;return!0}if(Ae&&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(je&&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(Se&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!k(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Oe=function(t,r){try{return k(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 we=o.getDefaultExportFromCjs(Oe);var Pe=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 f=Object.keys(t),i=Object.keys(r);if(f.length!==i.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),c=0;c<f.length;c++){var d=f[c];if(!l(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 Re=o.getDefaultExportFromCjs(Pe);var Z=(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))(Z||{}),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(Z),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},ke=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}),{}),Le=(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},[]),Me=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"&&Me(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const f={};a.filter(l=>{let c;const d=Object.keys(l);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(c==="rel"&&l[c].toLowerCase()==="canonical")&&!(g==="rel"&&l[g].toLowerCase()==="stylesheet")&&(c=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(c=p)}if(!c||!l[c])return!1;const m=l[c].toLowerCase();return n[c]||(n[c]={}),f[c]||(f[c]={}),n[c][m]?!1:(f[c][m]=!0,!0)}).reverse().forEach(l=>s.push(l));const i=Object.keys(f);for(let l=0;l<i.length;l+=1){const c=i[l],d={...n[c],...f[c]};n[c]=d}return s},[]).reverse()},He=(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:Le(["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:ke(e),scriptTags:R("script",["src","innerHTML"],e),styleTags:R("style",["cssText"],e),title:Ie(e),titleAttributes:_("titleAttributes",e),prioritizeSeoTags:He(e,O.PRIORITIZE_SEO_TAGS)}),Q=e=>Array.isArray(e)?e.join(""):e,$e=(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)=>($e(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Y=(e,t)=>({...e,[t]:void 0}),Ue=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),X=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),Ne=(e,t,r,n)=>{const s=X(r),a=Q(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},qe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,f=Object.keys(a).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return c?`${c} ${m}`:m},""),i=a.innerHTML||a.cssText||"",l=Ue.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${f}${l?"/>":`>${i}</${e}>`}`},""),ee=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=B[n];return r[s||n]=e[n],r},t),Fe=(e,t,r)=>{const n={key:t,[T]:!0},s=ee(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 l=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[i]=r[a]}),u.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Fe(e,t.title,t.titleAttributes),toString:()=>Ne(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>ee(t),toString:()=>X(t)};default:return{toComponent:()=>L(e,t),toString:()=>qe(e,t,r)}}},Ge=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=$(e,H.meta),a=$(t,H.link),f=$(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",f.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",f.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:f.default}},ze=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:f,title:i="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=Ge(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",f,n),title:y("title",{title:i,titleAttributes:l},n)}},F=ze,I=[],te=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",te);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?I:this.instances,add:e=>{(this.canUseDOM?I:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?I:this.instances).indexOf(e);(this.canUseDOM?I: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:{}}))}},Be={},re=u.createContext(Be),A,ne=(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(re.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",te),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let f;return t&&t.length&&t.forEach(i=>{const l=document.createElement(e);for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c))if(c==="innerHTML")l.innerHTML=i.innerHTML;else if(c==="cssText")l.styleSheet?l.styleSheet.cssText=i.cssText:l.appendChild(document.createTextNode(i.cssText));else{const d=c,m=typeof i[d]>"u"?"":i[d];l.setAttribute(c,m)}l.setAttribute(T,"true"),s.some((c,d)=>(f=d,l.isEqualNode(c)))?s.splice(f,1):a.push(l)}),s.forEach(i=>{var l;return(l=i.parentNode)==null?void 0:l.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],f=Object.keys(t);for(const i of f){const l=t[i]||"";r.getAttribute(i)!==l&&r.setAttribute(i,l),s.indexOf(i)===-1&&s.push(i);const c=a.indexOf(i);c!==-1&&a.splice(c,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)!==f.join(",")&&r.setAttribute(T,f.join(","))},Ke=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=Q(e)),z("title",t)},J=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:f,noscriptTags:i,onChangeClientState:l,scriptTags:c,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ke(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",f),noscriptTags:j("noscript",i),scriptTags:j("script",c),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(),l(e,g,P)},D=null,Ve=e=>{D&&cancelAnimationFrame(D),e.defer?D=requestAnimationFrame(()=>{J(e,()=>{D=null})}):(J(e),D=null)},Ye=Ve,W=class extends u.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!Re(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 f={...a.props};return delete f.context,f}));ne.canUseDOM?Ye(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,Je=(U=class extends u.Component{shouldComponentUpdate(e){return!we(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,f=Object.keys(a).reduce((l,c)=>(l[De[c]||c]=a[c],l),{});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,f,s);break;default:t=this.mapObjectTypeChildren(n,t,f,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(re.Consumer,null,s=>u.createElement(W,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const We=({defaultHelmet:e,children:t})=>{const[r,n]=u.useState([e]),s=u.useCallback(l=>{n(c=>[...c,l])},[]),a=u.useCallback(()=>{n(l=>l.length>1?l.slice(0,-1):l)},[n]),f=u.useMemo(()=>r.at(-1)??"",[r]),i=u.useMemo(()=>({addHelmet:s,removeHelmet:a}),[s,a]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:i,children:o.jsxRuntimeExports.jsxs(ne,{children:[o.jsxRuntimeExports.jsx(Je,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:f})}),t]})})},Ze=()=>{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=Ce;exports.DelegationProvider=Ee;exports.HelmetProvider=We;exports.LoadingProvider=ve;exports.LuminusComponentsProvider=ye;exports.UserProvider=Te;
|
|
1
|
+
"use strict";var oe=Object.defineProperty;var ae=(e,t,r)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>ae(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./ResponsiveContextDropdown-ep8LBIy7.cjs"),u=require("react"),N=require("@azure/msal-browser"),ie=require("@azure/msal-react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");const le=require("./Loading-TbgEJLF_.cjs"),ue=require("./useGetApiData-B2Ap2urp.cjs"),ce=require("./useLocalStorageState-BFc8Gc8H.cjs");function fe(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function de(){return fe(Date.now())}function me(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,f)=>a-f);return r>=n&&r<=s}function pe(){return o.startOfDay(Date.now())}const he=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),a=u.useCallback(l=>{r(!0),s(l)},[]),f=u.useCallback(()=>{r(!1)},[]),i=u.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:f}),[t,n,a,f]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Ze,{}),e]})},xe=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=u.useContext(o.PromptContext),[a,f]=u.useState(s.defaultValue??""),i=u.useCallback(()=>{n(null)},[n]),l=u.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);u.useEffect(()=>{t===!0&&f(s.defaultValue??"")},[t,s.defaultValue]);const c=u.useMemo(()=>({value:a,onChange:d=>f(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:l,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...c,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...c,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})]})]})]})},ge=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),[a,f]=u.useState({input:"textarea",type:"text"}),i=u.useRef(()=>{}),l=u.useCallback(m=>{s(m),r(!0)},[]),c=u.useCallback(()=>{r(!1)},[]),d=u.useMemo(()=>({isShown:t,text:n,showPrompt:l,hidePrompt:c,resolveRef:i,options:a,setOptions:f}),[t,n,l,c,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(xe,{})]})},ye=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:f,children:i})=>{const l=u.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:f}),[t,e,r,s,a,n,f]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:l,children:o.jsxRuntimeExports.jsx(he,{children:o.jsxRuntimeExports.jsxs(ge,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},ve=({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]),f=u.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:f,children:[t&&o.jsxRuntimeExports.jsx(le.Loading,{}),e]})},Te=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=u.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:f}=u.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[l,c]=u.useState(null),d=u.useCallback(async()=>{const x=await i();x&&c(x)},[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 f(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,f]),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;c(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(l)},[l,n==null?void 0:n.id,K]);const se=u.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:se,children:e})},Ce=({...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??[]:[]}),[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 f=a.payload,i=f.account;e.msalInstance.setActiveAccount(i);const l=f.accessToken,c=f.expiresOn;r("Authorization",l,{path:"/",secure:!0,sameSite:"none",domain:t,expires:c??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(ie.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Ee=({children:e,relativeEndpoint:t})=>{const[r,n,s]=ce.useLocalStorageState("user-delegation",null),a=u.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):pe(),h=r.to?o.parseISO(r.to):de();return me(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:f,setData:i,reloadData:l}=ue.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),c=u.useRef(null);u.useEffect(()=>{const m=()=>{l(),c.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{c.current!==null&&window.clearTimeout(c.current)}},[l]),u.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,l]);const d=u.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:f,setAvailableDelegations:i,refreshAvailableDelegations:l}),[a,n,f,i,l]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var Se=typeof Element<"u",be=typeof Map=="function",Ae=typeof Set=="function",je=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function k(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(!k(e[n],t[n]))return!1;return!0}var a;if(be&&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(!k(n.value[1],t.get(n.value[0])))return!1;return!0}if(Ae&&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(je&&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(Se&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!k(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Oe=function(t,r){try{return k(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 we=o.getDefaultExportFromCjs(Oe);var Pe=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 f=Object.keys(t),i=Object.keys(r);if(f.length!==i.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),c=0;c<f.length;c++){var d=f[c];if(!l(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 Re=o.getDefaultExportFromCjs(Pe);var Z=(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))(Z||{}),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(Z),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},ke=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}),{}),Le=(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},[]),Me=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"&&Me(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const f={};a.filter(l=>{let c;const d=Object.keys(l);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(c==="rel"&&l[c].toLowerCase()==="canonical")&&!(g==="rel"&&l[g].toLowerCase()==="stylesheet")&&(c=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(c=p)}if(!c||!l[c])return!1;const m=l[c].toLowerCase();return n[c]||(n[c]={}),f[c]||(f[c]={}),n[c][m]?!1:(f[c][m]=!0,!0)}).reverse().forEach(l=>s.push(l));const i=Object.keys(f);for(let l=0;l<i.length;l+=1){const c=i[l],d={...n[c],...f[c]};n[c]=d}return s},[]).reverse()},He=(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:Le(["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:ke(e),scriptTags:R("script",["src","innerHTML"],e),styleTags:R("style",["cssText"],e),title:Ie(e),titleAttributes:_("titleAttributes",e),prioritizeSeoTags:He(e,O.PRIORITIZE_SEO_TAGS)}),Q=e=>Array.isArray(e)?e.join(""):e,$e=(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)=>($e(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Y=(e,t)=>({...e,[t]:void 0}),Ue=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),X=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),Ne=(e,t,r,n)=>{const s=X(r),a=Q(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},qe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,f=Object.keys(a).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return c?`${c} ${m}`:m},""),i=a.innerHTML||a.cssText||"",l=Ue.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${f}${l?"/>":`>${i}</${e}>`}`},""),ee=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=B[n];return r[s||n]=e[n],r},t),Fe=(e,t,r)=>{const n={key:t,[T]:!0},s=ee(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 l=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[i]=r[a]}),u.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Fe(e,t.title,t.titleAttributes),toString:()=>Ne(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>ee(t),toString:()=>X(t)};default:return{toComponent:()=>L(e,t),toString:()=>qe(e,t,r)}}},Ge=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=$(e,H.meta),a=$(t,H.link),f=$(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",f.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",f.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:f.default}},ze=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:f,title:i="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=Ge(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",f,n),title:y("title",{title:i,titleAttributes:l},n)}},F=ze,I=[],te=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",te);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?I:this.instances,add:e=>{(this.canUseDOM?I:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?I:this.instances).indexOf(e);(this.canUseDOM?I: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:{}}))}},Be={},re=u.createContext(Be),A,ne=(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(re.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",te),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let f;return t&&t.length&&t.forEach(i=>{const l=document.createElement(e);for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c))if(c==="innerHTML")l.innerHTML=i.innerHTML;else if(c==="cssText")l.styleSheet?l.styleSheet.cssText=i.cssText:l.appendChild(document.createTextNode(i.cssText));else{const d=c,m=typeof i[d]>"u"?"":i[d];l.setAttribute(c,m)}l.setAttribute(T,"true"),s.some((c,d)=>(f=d,l.isEqualNode(c)))?s.splice(f,1):a.push(l)}),s.forEach(i=>{var l;return(l=i.parentNode)==null?void 0:l.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],f=Object.keys(t);for(const i of f){const l=t[i]||"";r.getAttribute(i)!==l&&r.setAttribute(i,l),s.indexOf(i)===-1&&s.push(i);const c=a.indexOf(i);c!==-1&&a.splice(c,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)!==f.join(",")&&r.setAttribute(T,f.join(","))},Ke=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=Q(e)),z("title",t)},J=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:f,noscriptTags:i,onChangeClientState:l,scriptTags:c,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ke(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",f),noscriptTags:j("noscript",i),scriptTags:j("script",c),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(),l(e,g,P)},D=null,Ve=e=>{D&&cancelAnimationFrame(D),e.defer?D=requestAnimationFrame(()=>{J(e,()=>{D=null})}):(J(e),D=null)},Ye=Ve,W=class extends u.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!Re(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 f={...a.props};return delete f.context,f}));ne.canUseDOM?Ye(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,Je=(U=class extends u.Component{shouldComponentUpdate(e){return!we(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,f=Object.keys(a).reduce((l,c)=>(l[De[c]||c]=a[c],l),{});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,f,s);break;default:t=this.mapObjectTypeChildren(n,t,f,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(re.Consumer,null,s=>u.createElement(W,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const We=({defaultHelmet:e,children:t})=>{const[r,n]=u.useState([e]),s=u.useCallback(l=>{n(c=>[...c,l])},[]),a=u.useCallback(()=>{n(l=>l.length>1?l.slice(0,-1):l)},[n]),f=u.useMemo(()=>r.at(-1)??"",[r]),i=u.useMemo(()=>({addHelmet:s,removeHelmet:a}),[s,a]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:i,children:o.jsxRuntimeExports.jsxs(ne,{children:[o.jsxRuntimeExports.jsx(Je,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:f})}),t]})})},Ze=()=>{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=Ce;exports.DelegationProvider=Ee;exports.HelmetProvider=We;exports.LoadingProvider=ve;exports.LuminusComponentsProvider=ye;exports.UserProvider=Te;
|
package/dist/contexts.es.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var Se = Object.defineProperty;
|
|
2
2
|
var be = (e, t, r) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var S = (e, t, r) => be(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { t as N,
|
|
4
|
+
import { t as N, be as Oe, j as f, bf as Ee, a2 as z, a$ as we, bg as ue, ae as b, a_ as Ie, a3 as q, bh as je, aS as Pe, ar as De, az as fe, bi as de, aA as ke, aC as D, aB as Le, bj as He, aQ as se, bk as _e, bl as me, bm as oe, bn as $e, aU as Me } from "./ResponsiveContextDropdown-C9WqbqI0.js";
|
|
5
5
|
import E, { useState as C, useCallback as p, useMemo as A, useContext as _, useEffect as P, useRef as pe, Component as te } from "react";
|
|
6
|
-
import { EventType as
|
|
6
|
+
import { EventType as Q } from "@azure/msal-browser";
|
|
7
7
|
import { MsalProvider as Re } from "@azure/msal-react";
|
|
8
8
|
import "react-router-dom";
|
|
9
9
|
import "react-hook-form";
|
|
10
10
|
import "react-flexmonster";
|
|
11
|
-
import { L as Ue } from "./Loading-
|
|
12
|
-
import { u as Ne } from "./useGetApiData-
|
|
11
|
+
import { L as Ue } from "./Loading-D012N8ha.js";
|
|
12
|
+
import { u as Ne } from "./useGetApiData-DvRb2p5u.js";
|
|
13
13
|
import { u as Fe } from "./useLocalStorageState-Bt99kkCr.js";
|
|
14
|
-
function
|
|
14
|
+
function Ge(e) {
|
|
15
15
|
const t = N(e);
|
|
16
16
|
return t.setHours(23, 59, 59, 999), t;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function qe() {
|
|
19
|
+
return Ge(Date.now());
|
|
20
20
|
}
|
|
21
21
|
function ze(e, t) {
|
|
22
22
|
const r = +N(e), [n, s] = [
|
|
@@ -28,7 +28,7 @@ function ze(e, t) {
|
|
|
28
28
|
function Ke() {
|
|
29
29
|
return Oe(Date.now());
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const Be = ({ children: e }) => {
|
|
32
32
|
const [t, r] = C(!1), [n, s] = C(""), o = p((i) => {
|
|
33
33
|
r(!0), s(i);
|
|
34
34
|
}, []), c = p(() => {
|
|
@@ -38,7 +38,7 @@ const Ve = ({ children: e }) => {
|
|
|
38
38
|
/* @__PURE__ */ f.jsx(At, {}),
|
|
39
39
|
e
|
|
40
40
|
] });
|
|
41
|
-
},
|
|
41
|
+
}, Ve = () => {
|
|
42
42
|
const { texts: { confirm: e } } = _(z), { isShown: t, text: r, onFinish: n } = we(), { options: s } = _(ue), [o, c] = C(s.defaultValue ?? ""), a = p(() => {
|
|
43
43
|
n(null);
|
|
44
44
|
}, [n]), i = p((u) => {
|
|
@@ -62,8 +62,8 @@ const Ve = ({ children: e }) => {
|
|
|
62
62
|
s.input === "input" ? /* @__PURE__ */ f.jsx(Ie, { ...l, type: s.type }) : void 0
|
|
63
63
|
] }),
|
|
64
64
|
/* @__PURE__ */ f.jsxs(b.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
65
|
-
/* @__PURE__ */ f.jsx(
|
|
66
|
-
/* @__PURE__ */ f.jsx(
|
|
65
|
+
/* @__PURE__ */ f.jsx(q, { variant: "outlined", color: "secondary", onClick: a, className: "flex-grow-1", children: e.cancel }),
|
|
66
|
+
/* @__PURE__ */ f.jsx(q, { color: "primary", disabled: s.required && !o, type: "submit", className: "flex-grow-1", children: e.confirm })
|
|
67
67
|
] })
|
|
68
68
|
] })
|
|
69
69
|
] });
|
|
@@ -84,7 +84,7 @@ const Ve = ({ children: e }) => {
|
|
|
84
84
|
}), [t, n, i, l, o]);
|
|
85
85
|
return /* @__PURE__ */ f.jsxs(ue.Provider, { value: u, children: [
|
|
86
86
|
e,
|
|
87
|
-
/* @__PURE__ */ f.jsx(
|
|
87
|
+
/* @__PURE__ */ f.jsx(Ve, {})
|
|
88
88
|
] });
|
|
89
89
|
}, Ht = ({ cookieDomain: e, axiosOptions: t, language: r, texts: n, ProjectIconComponent: s, localizationContext: o, chartColorPalette: c, children: a }) => {
|
|
90
90
|
const i = A(() => ({
|
|
@@ -104,7 +104,7 @@ const Ve = ({ children: e }) => {
|
|
|
104
104
|
n,
|
|
105
105
|
c
|
|
106
106
|
]);
|
|
107
|
-
return /* @__PURE__ */ f.jsx(z.Provider, { value: i, children: /* @__PURE__ */ f.jsx(
|
|
107
|
+
return /* @__PURE__ */ f.jsx(z.Provider, { value: i, children: /* @__PURE__ */ f.jsx(Be, { children: /* @__PURE__ */ f.jsxs(Ye, { children: [
|
|
108
108
|
/* @__PURE__ */ f.jsx(je, {}),
|
|
109
109
|
a
|
|
110
110
|
] }) }) });
|
|
@@ -163,7 +163,7 @@ const Ve = ({ children: e }) => {
|
|
|
163
163
|
P(() => {
|
|
164
164
|
if (r) {
|
|
165
165
|
const y = r.addEventCallback((v) => {
|
|
166
|
-
if (v.eventType ===
|
|
166
|
+
if (v.eventType === Q.LOGIN_SUCCESS && v.payload) {
|
|
167
167
|
const K = v.payload;
|
|
168
168
|
l(K.accessToken);
|
|
169
169
|
}
|
|
@@ -199,7 +199,7 @@ const Ve = ({ children: e }) => {
|
|
|
199
199
|
return P(() => {
|
|
200
200
|
if (e.useMsal) {
|
|
201
201
|
const s = e.msalInstance.addEventCallback((o) => {
|
|
202
|
-
if (o.eventType ===
|
|
202
|
+
if (o.eventType === Q.LOGIN_SUCCESS || o.eventType === Q.ACQUIRE_TOKEN_SUCCESS && o.payload) {
|
|
203
203
|
const c = o.payload, a = c.account;
|
|
204
204
|
e.msalInstance.setActiveAccount(a);
|
|
205
205
|
const i = c.accessToken, l = c.expiresOn;
|
|
@@ -224,7 +224,7 @@ const Ve = ({ children: e }) => {
|
|
|
224
224
|
const [r, n, s] = Fe("user-delegation", null), o = A(() => {
|
|
225
225
|
if (!r)
|
|
226
226
|
return null;
|
|
227
|
-
const d = r.from ? se(r.from) : Ke(), h = r.to ? se(r.to) :
|
|
227
|
+
const d = r.from ? se(r.from) : Ke(), h = r.to ? se(r.to) : qe();
|
|
228
228
|
return ze(new Date(Date.now()), { start: d, end: h }) ? r : (n(null), null);
|
|
229
229
|
}, [r, n]), { data: c, setData: a, reloadData: i } = Ne(t, {
|
|
230
230
|
nullStateBeforeLoad: !1,
|
|
@@ -260,7 +260,7 @@ const Ve = ({ children: e }) => {
|
|
|
260
260
|
]);
|
|
261
261
|
return /* @__PURE__ */ f.jsx(de.Provider, { value: u, children: e });
|
|
262
262
|
};
|
|
263
|
-
var Je = typeof Element < "u",
|
|
263
|
+
var Je = typeof Element < "u", Qe = typeof Map == "function", We = typeof Set == "function", Ze = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
|
|
264
264
|
function F(e, t) {
|
|
265
265
|
if (e === t) return !0;
|
|
266
266
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
@@ -273,7 +273,7 @@ function F(e, t) {
|
|
|
273
273
|
return !0;
|
|
274
274
|
}
|
|
275
275
|
var o;
|
|
276
|
-
if (
|
|
276
|
+
if (Qe && e instanceof Map && t instanceof Map) {
|
|
277
277
|
if (e.size !== t.size) return !1;
|
|
278
278
|
for (o = e.entries(); !(n = o.next()).done; )
|
|
279
279
|
if (!t.has(n.value[0])) return !1;
|
|
@@ -281,13 +281,13 @@ function F(e, t) {
|
|
|
281
281
|
if (!F(n.value[1], t.get(n.value[0]))) return !1;
|
|
282
282
|
return !0;
|
|
283
283
|
}
|
|
284
|
-
if (
|
|
284
|
+
if (We && e instanceof Set && t instanceof Set) {
|
|
285
285
|
if (e.size !== t.size) return !1;
|
|
286
286
|
for (o = e.entries(); !(n = o.next()).done; )
|
|
287
287
|
if (!t.has(n.value[0])) return !1;
|
|
288
288
|
return !0;
|
|
289
289
|
}
|
|
290
|
-
if (
|
|
290
|
+
if (Ze && ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
|
|
291
291
|
if (r = e.length, r != t.length) return !1;
|
|
292
292
|
for (n = r; n-- !== 0; )
|
|
293
293
|
if (e[n] !== t[n]) return !1;
|
|
@@ -339,7 +339,7 @@ var tt = function(t, r, n, s) {
|
|
|
339
339
|
return !0;
|
|
340
340
|
};
|
|
341
341
|
const rt = /* @__PURE__ */ me(tt);
|
|
342
|
-
var he = /* @__PURE__ */ ((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))(he || {}),
|
|
342
|
+
var he = /* @__PURE__ */ ((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))(he || {}), B = {
|
|
343
343
|
link: { rel: ["amphtml", "canonical", "alternate"] },
|
|
344
344
|
script: { type: ["application/ld+json"] },
|
|
345
345
|
meta: {
|
|
@@ -399,7 +399,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
399
399
|
const n = H(e, L.DEFAULT_TITLE);
|
|
400
400
|
return t || n || void 0;
|
|
401
401
|
}, ot = (e) => H(e, L.ON_CHANGE_CLIENT_STATE) || (() => {
|
|
402
|
-
}),
|
|
402
|
+
}), V = (e, t) => t.filter((r) => typeof r[e] < "u").map((r) => r[e]).reduce((r, n) => ({ ...r, ...n }), {}), at = (e, t) => t.filter((r) => typeof r.base < "u").map((r) => r.base).reverse().reduce((r, n) => {
|
|
403
403
|
if (!r.length) {
|
|
404
404
|
const s = Object.keys(n);
|
|
405
405
|
for (let o = 0; o < s.length; o += 1) {
|
|
@@ -449,10 +449,10 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
449
449
|
"href"
|
|
450
450
|
/* HREF */
|
|
451
451
|
], e),
|
|
452
|
-
bodyAttributes:
|
|
452
|
+
bodyAttributes: V("bodyAttributes", e),
|
|
453
453
|
defer: H(e, L.DEFER),
|
|
454
454
|
encode: H(e, L.ENCODE_SPECIAL_CHARACTERS),
|
|
455
|
-
htmlAttributes:
|
|
455
|
+
htmlAttributes: V("htmlAttributes", e),
|
|
456
456
|
linkTags: M(
|
|
457
457
|
"link",
|
|
458
458
|
[
|
|
@@ -493,7 +493,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
493
493
|
/* CSS_TEXT */
|
|
494
494
|
], e),
|
|
495
495
|
title: st(e),
|
|
496
|
-
titleAttributes:
|
|
496
|
+
titleAttributes: V("titleAttributes", e),
|
|
497
497
|
prioritizeSeoTags: lt(e, L.PRIORITIZE_SEO_TAGS)
|
|
498
498
|
}), ye = (e) => Array.isArray(e) ? e.join("") : e, ut = (e, t) => {
|
|
499
499
|
const r = Object.keys(e);
|
|
@@ -512,15 +512,15 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
512
512
|
"script",
|
|
513
513
|
"style"
|
|
514
514
|
/* STYLE */
|
|
515
|
-
],
|
|
515
|
+
], W = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), ge = (e) => Object.keys(e).reduce((t, r) => {
|
|
516
516
|
const n = typeof e[r] < "u" ? `${r}="${e[r]}"` : `${r}`;
|
|
517
517
|
return t ? `${t} ${n}` : n;
|
|
518
518
|
}, ""), dt = (e, t, r, n) => {
|
|
519
519
|
const s = ge(r), o = ye(t);
|
|
520
|
-
return s ? `<${e} ${x}="true" ${s}>${
|
|
520
|
+
return s ? `<${e} ${x}="true" ${s}>${W(
|
|
521
521
|
o,
|
|
522
522
|
n
|
|
523
|
-
)}</${e}>` : `<${e} ${x}="true">${
|
|
523
|
+
)}</${e}>` : `<${e} ${x}="true">${W(
|
|
524
524
|
o,
|
|
525
525
|
n
|
|
526
526
|
)}</${e}>`;
|
|
@@ -528,7 +528,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
528
528
|
const o = s, c = Object.keys(o).filter(
|
|
529
529
|
(l) => !(l === "innerHTML" || l === "cssText")
|
|
530
530
|
).reduce((l, u) => {
|
|
531
|
-
const d = typeof o[u] > "u" ? u : `${u}="${
|
|
531
|
+
const d = typeof o[u] > "u" ? u : `${u}="${W(o[u], r)}"`;
|
|
532
532
|
return l ? `${l} ${d}` : d;
|
|
533
533
|
}, ""), a = o.innerHTML || o.cssText || "", i = ft.indexOf(e) === -1;
|
|
534
534
|
return `${n}<${e} ${x}="true" ${c}${i ? "/>" : `>${a}</${e}>`}`;
|
|
@@ -541,7 +541,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
541
541
|
[x]: !0
|
|
542
542
|
}, s = Te(r, n);
|
|
543
543
|
return [E.createElement("title", s, t)];
|
|
544
|
-
},
|
|
544
|
+
}, G = (e, t) => t.map((r, n) => {
|
|
545
545
|
const s = {
|
|
546
546
|
key: n,
|
|
547
547
|
[x]: !0
|
|
@@ -569,18 +569,18 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
569
569
|
};
|
|
570
570
|
default:
|
|
571
571
|
return {
|
|
572
|
-
toComponent: () =>
|
|
572
|
+
toComponent: () => G(e, t),
|
|
573
573
|
toString: () => mt(e, t, r)
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
}, ht = ({ metaTags: e, linkTags: t, scriptTags: r, encode: n }) => {
|
|
577
|
-
const s = Y(e,
|
|
577
|
+
const s = Y(e, B.meta), o = Y(t, B.link), c = Y(r, B.script);
|
|
578
578
|
return {
|
|
579
579
|
priorityMethods: {
|
|
580
580
|
toComponent: () => [
|
|
581
|
-
...
|
|
582
|
-
...
|
|
583
|
-
...
|
|
581
|
+
...G("meta", s.priority),
|
|
582
|
+
...G("link", o.priority),
|
|
583
|
+
...G("script", c.priority)
|
|
584
584
|
],
|
|
585
585
|
toString: () => (
|
|
586
586
|
// generate all the tags as strings and concatenate them
|
|
@@ -624,7 +624,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
624
624
|
style: T("style", c, n),
|
|
625
625
|
title: T("title", { title: a, titleAttributes: i }, n)
|
|
626
626
|
};
|
|
627
|
-
},
|
|
627
|
+
}, Z = yt, U = [], ve = !!(typeof window < "u" && window.document && window.document.createElement), X = class {
|
|
628
628
|
constructor(e, t) {
|
|
629
629
|
S(this, "instances", []);
|
|
630
630
|
S(this, "canUseDOM", ve);
|
|
@@ -644,7 +644,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
646
|
});
|
|
647
|
-
this.context = e, this.canUseDOM = t || !1, t || (e.helmet =
|
|
647
|
+
this.context = e, this.canUseDOM = t || !1, t || (e.helmet = Z({
|
|
648
648
|
baseTag: [],
|
|
649
649
|
bodyAttributes: {},
|
|
650
650
|
encodeSpecialCharacters: !0,
|
|
@@ -766,7 +766,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
766
766
|
return delete c.context, c;
|
|
767
767
|
})
|
|
768
768
|
);
|
|
769
|
-
Ce.canUseDOM ? xt(s) :
|
|
769
|
+
Ce.canUseDOM ? xt(s) : Z && (n = Z(s)), r(n);
|
|
770
770
|
}
|
|
771
771
|
// componentWillMount will be deprecated
|
|
772
772
|
// for SSR, initialize on first render
|
|
@@ -919,8 +919,8 @@ const Ut = ({ defaultHelmet: e, children: t }) => {
|
|
|
919
919
|
return /* @__PURE__ */ f.jsxs(b, { show: s, size: "sm", centered: !0, onHide: r, children: [
|
|
920
920
|
/* @__PURE__ */ f.jsx(b.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(b.Title, { children: n }) }),
|
|
921
921
|
/* @__PURE__ */ f.jsx(b.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
922
|
-
/* @__PURE__ */ f.jsx(
|
|
923
|
-
/* @__PURE__ */ f.jsx(
|
|
922
|
+
/* @__PURE__ */ f.jsx(q, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: r, children: e.no }),
|
|
923
|
+
/* @__PURE__ */ f.jsx(q, { type: "button", color: "primary", onClick: t, className: "w-100 ml", children: e.yes })
|
|
924
924
|
] }) })
|
|
925
925
|
] });
|
|
926
926
|
};
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./ResponsiveContextDropdown-ep8LBIy7.cjs"),q=require("./useWindowSize-CE6DJWzn.cjs"),x=require("./usePermissions-LOq-NC5k.cjs"),d=require("./useClipboard-BoSxUeRj.cjs"),T=require("./useGetApiData-B2Ap2urp.cjs"),c=require("react"),G=require("./useLocalStorageState-BFc8Gc8H.cjs");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const L=o=>{let e="pending",a;const t=o.then(s=>{e="success",a=s},s=>{e="error",a=s});return()=>{switch(e){case"pending":throw t;case"success":return a;case"error":throw a;default:throw new Error("Unknown status")}}};function B(o,e){const a=u.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 r=a.get(o).then(n=>n.data);s(L(r))})()},[a,o]),t}const E=(o,e,a)=>{let t="pending",s;const l=o.then(r=>{t="success",s=r},r=>{const n=r==null?void 0:r.response;(n==null?void 0:n.status)===404&&a?(t="error-404",s=r):(t="error",s=r)});return()=>{switch(t){case"pending":throw l;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},O=(o,{loadOnInit:e=i.loadOnInit,enabled:a=i.enabled,silent:t=i.silent,nullStateBeforeLoad:s=i.nullStateBeforeLoad,nullStateOnFail:l=i.nullStateOnFail,customApiUrl:r,customBearerToken:n,dataTransformer:h,errorBoundaryOn404:S}=i)=>{const w=u.useAxios({silent:t,customToken:n,differentBaseUrl:r,noToastOnStatus:S?[404]:void 0}),{startLoading:D,stopLoading:g}=c.useContext(u.LoadingContext),P=c.useRef(0),{isAuthenticated:C}=u.useAuth(),[b,p]=c.useState(null),m=c.useCallback(async(f,y)=>{if(!C()||a===!1)return;!t&&D(`loadData-${o}-${y}`),s&&p(null);const k=w.get(o,{signal:f}).then(A=>h?h(A.data):A.data).finally(()=>!t&&g(`loadData-${o}-${y}`));p(E(k,l??!1,S??!1))},[C,a,t,D,o,s,w,h,g,l,S]);return c.useEffect(()=>{if(e===!1)return;const f=new AbortController;return m(f.signal,++P.current),()=>{f.abort()}},[m,e]),{data:b,setData:p,reloadData:m}};exports.cancelToken=u.cancelToken;exports.useAuth=u.useAuth;exports.useAxios=u.useAxios;exports.useConfirm=u.useConfirm;exports.useFormControlType=u.useFormControlType;exports.useNotifications=u.useNotifications;exports.usePrompt=u.usePrompt;exports.useZodSchemaTypes=u.useZodSchemaTypes;exports.useClickOutside=q.useClickOutside;exports.useWindowSize=q.useWindowSize;exports.usePermissions=x.usePermissions;exports.useClipboard=d.useClipboard;exports.useEmployeePhotoPath=d.useEmployeePhotoPath;exports.useKeyPress=d.useKeyPress;exports.useSearchQuery=d.useSearchQuery;exports.useSearchQueryState=d.useSearchQueryState;exports.useGetApiData=T.useGetApiData;exports.useLocalStorageState=G.useLocalStorageState;exports.useGetApiDataBound=O;exports.useGetDataBound=B;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ar as x,
|
|
2
|
-
import {
|
|
1
|
+
import { ar as x, aS as T, aA as U } from "./ResponsiveContextDropdown-C9WqbqI0.js";
|
|
2
|
+
import { bo as j, aU as q, aG as H, aT as J, a$ as M, bp as V } from "./ResponsiveContextDropdown-C9WqbqI0.js";
|
|
3
3
|
import { a as Y, u as _ } from "./useWindowSize-OLYtjFv_.js";
|
|
4
|
-
import { u as et } from "./usePermissions-
|
|
5
|
-
import { u as at, d as ot, a as rt, b as nt, c as ut } from "./useClipboard-
|
|
6
|
-
import { u as lt } from "./useGetApiData-
|
|
7
|
-
import { useState as b, useEffect as C, useContext as
|
|
4
|
+
import { u as et } from "./usePermissions-CE2IinZO.js";
|
|
5
|
+
import { u as at, d as ot, a as rt, b as nt, c as ut } from "./useClipboard-ClHiiBOP.js";
|
|
6
|
+
import { u as lt } from "./useGetApiData-DvRb2p5u.js";
|
|
7
|
+
import { useState as b, useEffect as C, useContext as $, useRef as L, useCallback as P } from "react";
|
|
8
8
|
import { u as ft } from "./useLocalStorageState-Bt99kkCr.js";
|
|
9
9
|
import "react-router-dom";
|
|
10
10
|
import "react-hook-form";
|
|
@@ -31,7 +31,7 @@ const B = (o) => {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
function
|
|
34
|
+
function I(o, t) {
|
|
35
35
|
const a = x({
|
|
36
36
|
silent: !0,
|
|
37
37
|
differentBaseUrl: t == null ? void 0 : t.customBaseUrl,
|
|
@@ -72,20 +72,20 @@ const E = (o, t, a) => {
|
|
|
72
72
|
enabled: !0,
|
|
73
73
|
nullStateBeforeLoad: !0,
|
|
74
74
|
nullStateOnFail: !1
|
|
75
|
-
},
|
|
75
|
+
}, K = (o, { loadOnInit: t = u.loadOnInit, enabled: a = u.enabled, silent: e = u.silent, nullStateBeforeLoad: s = u.nullStateBeforeLoad, nullStateOnFail: c = u.nullStateOnFail, customApiUrl: r, customBearerToken: n, dataTransformer: i, errorBoundaryOn404: f } = u) => {
|
|
76
76
|
const p = x({
|
|
77
77
|
silent: e,
|
|
78
78
|
customToken: n,
|
|
79
79
|
differentBaseUrl: r,
|
|
80
80
|
noToastOnStatus: f ? [404] : void 0
|
|
81
|
-
}), { startLoading: h, stopLoading: w } = T
|
|
81
|
+
}), { startLoading: h, stopLoading: w } = $(T), k = L(0), { isAuthenticated: g } = U(), [A, d] = b(null), m = P(async (l, D) => {
|
|
82
82
|
if (!g() || a === !1)
|
|
83
83
|
return;
|
|
84
84
|
!e && h(`loadData-${o}-${D}`), s && d(null);
|
|
85
|
-
const
|
|
85
|
+
const y = p.get(o, {
|
|
86
86
|
signal: l
|
|
87
87
|
}).then((S) => i ? i(S.data) : S.data).finally(() => !e && w(`loadData-${o}-${D}`));
|
|
88
|
-
d(E(
|
|
88
|
+
d(E(y, c ?? !1, f ?? !1));
|
|
89
89
|
}, [
|
|
90
90
|
g,
|
|
91
91
|
a,
|
|
@@ -106,20 +106,20 @@ const E = (o, t, a) => {
|
|
|
106
106
|
return m(l.signal, ++k.current), () => {
|
|
107
107
|
l.abort();
|
|
108
108
|
};
|
|
109
|
-
}, [m, t]), { data:
|
|
109
|
+
}, [m, t]), { data: A, setData: d, reloadData: m };
|
|
110
110
|
};
|
|
111
111
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
j as cancelToken,
|
|
113
|
+
U as useAuth,
|
|
114
114
|
x as useAxios,
|
|
115
115
|
Y as useClickOutside,
|
|
116
116
|
at as useClipboard,
|
|
117
|
-
|
|
117
|
+
q as useConfirm,
|
|
118
118
|
ot as useEmployeePhotoPath,
|
|
119
119
|
H as useFormControlType,
|
|
120
120
|
lt as useGetApiData,
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
K as useGetApiDataBound,
|
|
122
|
+
I as useGetDataBound,
|
|
123
123
|
rt as useKeyPress,
|
|
124
124
|
ft as useLocalStorageState,
|
|
125
125
|
J as useNotifications,
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { default as SideMenu } from './SideMenu/SideMenu';
|
|
2
2
|
export { default as TopBar } from './TopBar/TopBar';
|
|
3
3
|
export { default as SideContentBar } from './SideContentBar/SideContentBar';
|
|
4
|
-
export { default as MainContainer } from './MainContainer/MainContainer';
|
|
5
|
-
export { default as FullScreenContainer } from './FullScreenContainer/FullScreenContainer';
|
|
6
4
|
export { default as PageContainer } from './PageContainer/PageContainer';
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-ep8LBIy7.cjs"),m=require("react"),y=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const g=require("./useWindowSize-CE6DJWzn.cjs"),k=require("./usePermissions-LOq-NC5k.cjs"),P="_side-menu-item_1o1uo_1",w="_disabled_1o1uo_6",z="_nav-button_1o1uo_10",I="_child_1o1uo_18",f="_text_1o1uo_23",S="_icon_1o1uo_30",q="_collapse-icon_1o1uo_36",L="_collapsed_1o1uo_46",T="_collapse-icon-mini_1o1uo_49",O="_expanded_1o1uo_80",$="_children-container_1o1uo_86",A="_visible_1o1uo_94",D="_children_1o1uo_86",K="_mobile_1o1uo_106",o={"side-menu-item":"_side-menu-item_1o1uo_1",sideMenuItem:P,disabled:w,"nav-button":"_nav-button_1o1uo_10",navButton:z,child:I,text:f,icon:S,"collapse-icon":"_collapse-icon_1o1uo_36",collapseIcon:q,collapsed:L,"collapse-icon-mini":"_collapse-icon-mini_1o1uo_49",collapseIconMini:T,expanded:O,"children-container":"_children-container_1o1uo_86",childrenContainer:$,visible:A,children:D,mobile:K},F=({item:n,menuExpanded:t,useTooltips:i,children:a})=>n.tooltip&&!t&&i?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:n.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:a})}):a,B=({item:n,menuExpanded:t,collapsed:i,onCollapse:a,currentPath:r,useHover:x,useTooltips:v,isMobile:c})=>{var M,h,R,j;const[N,_]=m.useState(!1),[p]=r.split("?"),d=n.linkTo===p||((M=n.children)==null?void 0:M.some(s=>s.linkTo===p)),E=m.useRef(null);return g.useClickOutside([E],()=>i&&a()),e.jsxRuntimeExports.jsxs("li",{ref:E,className:e.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.mobile]:c},{[o.expanded]:t},{active:N||d},{open:i&&n.children},{[o.disabled]:n.disabled||n.notPermitted||((h=n.children)==null?void 0:h.every(s=>s.notPermitted||s.disabled))},{disabled:n.disabled||n.notPermitted||((R=n.children)==null?void 0:R.every(s=>s.notPermitted||s.disabled))}),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[e.jsxRuntimeExports.jsx(F,{item:n,menuExpanded:t,useTooltips:v,children:n.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",o.navButton),onClick:()=>{a()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:n.icon}),!x&&!t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",o.collapseIconMini,{[o.collapsed]:i}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:n.title}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:i}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(y.Link,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:e.classNames("nav-link",o.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:n.icon}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:n.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",o.childrenContainer,{[o.visible]:i}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",o.children),children:(j=n.children)==null?void 0:j.map(s=>e.jsxRuntimeExports.jsx(y.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:s.disabled||s.notPermitted},{disabled:s.disabled||s.notPermitted}),onClick:a,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title})},s.linkTo))})})]})},W="_side-menu_15z3o_1",U="_sidebar-header_15z3o_13",G="_side-menu-content_15z3o_20",J="_expand_15z3o_24",Q="_only-logo_15z3o_28",V="_mobile_15z3o_31",X="_divider_15z3o_45",u={"side-menu":"_side-menu_15z3o_1",sideMenu:W,"sidebar-header":"_sidebar-header_15z3o_13",sidebarHeader:U,"side-menu-content":"_side-menu-content_15z3o_20",sideMenuContent:G,expand:J,"only-logo":"_only-logo_15z3o_28",onlyLogo:Q,mobile:V,divider:X},Y=({headerItem:n,searchItem:t,mainItems:i,secondaryItems:a,expanded:r,setExpanded:x,currentPath:v,useHover:c,useTooltips:N})=>{const[_,p]=m.useState(-1),{checkUserHasPermissions:d}=k.usePermissions(),E=m.useMemo(()=>i.map(s=>{var l;return{...s,notPermitted:!d(s.permissions??[],"any"),children:(l=s.children)==null?void 0:l.map(b=>({...b,notPermitted:!d(b.permissions??[],"any"),disabled:s.disabled||b.disabled}))}}),[i,d]),M=m.useMemo(()=>a.map(s=>{var l;return{...s,notPermitted:!d(s.permissions??[],"any"),children:(l=s.children)==null?void 0:l.map(b=>({...b,notPermitted:!d(b.permissions??[],"any")}))}}),[a,d]),h=s=>{p(s===_?-1:s)};m.useEffect(()=>{r||p(-1)},[r]);const R=m.useRef(null);g.useClickOutside([R],()=>x(!1));const{isMobile:j}=g.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:R,className:e.classNames("luminus-side-menu shadow",u.sideMenu,{[u.mobile]:j},{[u.expand]:r},{expand:r}),onMouseEnter:()=>c&&x(!0),onMouseLeave:()=>c&&x(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",u.sidebarHeader,{[u.onlyLogo]:c}),role:c?void 0:"button",onClick:c?void 0:()=>x(!r),children:c?n:r?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),n]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),e.jsxRuntimeExports.jsxs("ul",{className:u.sideMenuContent,children:[t?e.jsxRuntimeExports.jsx("div",{className:"p-3",children:t}):null,E.map((s,l)=>e.jsxRuntimeExports.jsx(B,{item:s,menuExpanded:r,collapsed:l===_,onCollapse:()=>h(l),currentPath:v,useHover:c,useTooltips:N,isMobile:j},s.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",u.divider)}),M.map((s,l)=>e.jsxRuntimeExports.jsx(B,{item:s,menuExpanded:r,collapsed:l===_,onCollapse:()=>h(l),currentPath:v,useHover:c,useTooltips:N,isMobile:j},s.title))]})]})},Z="_top-bar_1usoa_1",H="_top-bar-brand_1usoa_13",C={"top-bar":"_top-bar_1usoa_1",topBar:Z,"top-bar-brand":"_top-bar-brand_1usoa_13",topBarBrand:H},ee=({appName:n,leftOffset:t,centerContent:i,rightContent:a})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow gap-1 gap-lg-3",C.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[e.jsxRuntimeExports.jsx(y.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",C.topBarBrand),children:n}),i&&e.jsxRuntimeExports.jsx("div",{children:i}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center",children:a??null})]});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=Y;exports.TopBar=ee;
|