react-luminus-components 1.3.201 → 1.3.203

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.
Files changed (33) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +52 -52
  3. package/dist/Loading-CgVipx1p.cjs +1 -0
  4. package/dist/{Loading-CqPyNIvP.js → Loading-xjqgdxQw.js} +1 -1
  5. package/dist/{nivo-bar.es-BPqfqgFz.js → ShortcutLinksContext-CDA4_y4H.js} +5604 -5602
  6. package/dist/{nivo-bar.es-C8Q7uf5o.cjs → ShortcutLinksContext-CtT9qbGN.cjs} +6 -6
  7. package/dist/contexts.cjs.js +1 -1
  8. package/dist/contexts.es.js +82 -82
  9. package/dist/hooks.cjs.js +1 -1
  10. package/dist/hooks.es.js +22 -22
  11. package/dist/layout.cjs.js +1 -1
  12. package/dist/layout.es.js +15 -15
  13. package/dist/main.cjs.js +2 -2
  14. package/dist/main.es.js +3506 -3496
  15. package/dist/searchUtils-B6MFKz3h.cjs +1 -0
  16. package/dist/{searchUtils-DI5xcTMJ.js → searchUtils-CmuWMIMp.js} +1 -1
  17. package/dist/style.css +1 -1
  18. package/dist/{useClipboard-4e8QzHoB.js → useClipboard-B6o3_c4j.js} +1 -1
  19. package/dist/useClipboard-BDAZwNR9.cjs +1 -0
  20. package/dist/useGetApiData-CRj_Oj2M.cjs +1 -0
  21. package/dist/{useGetApiData-BHS98zA6.js → useGetApiData-yPRYMljx.js} +7 -7
  22. package/dist/usePermissions-BJHLPP0j.js +20 -0
  23. package/dist/usePermissions-BND9X9_G.cjs +1 -0
  24. package/dist/utils.cjs.js +1 -1
  25. package/dist/utils.es.js +23 -23
  26. package/dist/variables.scss +165 -165
  27. package/package.json +116 -116
  28. package/dist/Loading-DCjV7Ypk.cjs +0 -1
  29. package/dist/searchUtils-CsnD-WsL.cjs +0 -1
  30. package/dist/useClipboard-C0CnZHu7.cjs +0 -1
  31. package/dist/useGetApiData-bKrnrpzU.cjs +0 -1
  32. package/dist/usePermissions-DEjIIcAy.js +0 -20
  33. package/dist/usePermissions-luBa161q.cjs +0 -1
@@ -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("./nivo-bar.es-C8Q7uf5o.cjs"),u=require("react"),N=require("@azure/msal-browser"),le=require("@azure/msal-react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");const ue=require("./Loading-DCjV7Ypk.cjs"),ce=require("./useGetApiData-bKrnrpzU.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 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(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(!k(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)&&!k(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var we=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 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 De=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"},Ie=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},ke=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:ke(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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),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,I=[],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?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:{}}))}},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)},D=null,Ye=e=>{D&&cancelAnimationFrame(D),e.defer?D=requestAnimationFrame(()=>{J(e,()=>{D=null})}):(J(e),D=null)},Je=Ye,W=class extends u.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!De(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[Ie[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-CtT9qbGN.cjs"),u=require("react"),N=require("@azure/msal-browser"),le=require("@azure/msal-react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");const ue=require("./Loading-CgVipx1p.cjs"),ce=require("./useGetApiData-CRj_Oj2M.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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),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,15 +1,15 @@
1
- var be = Object.defineProperty;
2
- var Oe = (e, t, r) => t in e ? be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var S = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { t as N, bl as Ee, j as f, bm as we, $ as z, ap as Ie, bn as fe, av as b, am as je, a0 as G, bo as Pe, at as De, ar as ke, aX as de, bp as me, aY as Le, aZ as D, as as He, bq as $e, aF as se, br as _e, bs as pe, bt as oe, bu as Me, aq as Re } from "./nivo-bar.es-BPqfqgFz.js";
5
- import E, { useState as C, useCallback as p, useMemo as A, useContext as $, useEffect as P, useRef as he, Component as te } from "react";
6
- import { EventType as J } from "@azure/msal-browser";
1
+ var Se = Object.defineProperty;
2
+ var Ee = (e, t, r) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var A = (e, t, r) => Ee(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { t as N, bl as Oe, j as f, bm as we, $ as z, b6 as Ie, bn as fe, ad as S, b5 as je, a0 as G, bo as De, aV as Pe, au as ke, aC as de, bp as me, aD as Le, aF as P, aE as He, bq as $e, aT as se, br as _e, bs as pe, bt as oe, bu as Me, aX as Re } from "./ShortcutLinksContext-CDA4_y4H.js";
5
+ import O, { useState as C, useCallback as p, useMemo as b, useContext as $, useEffect as D, useRef as he, Component as te } from "react";
6
+ import { EventType as W } from "@azure/msal-browser";
7
7
  import { MsalProvider as Ue } 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 Ne } from "./Loading-CqPyNIvP.js";
12
- import { u as Fe } from "./useGetApiData-BHS98zA6.js";
11
+ import { L as Ne } from "./Loading-xjqgdxQw.js";
12
+ import { u as Fe } from "./useGetApiData-yPRYMljx.js";
13
13
  import { u as qe } from "./useLocalStorageState-Bt99kkCr.js";
14
14
  function Ge(e) {
15
15
  const t = N(e);
@@ -26,16 +26,16 @@ function Ke(e, t) {
26
26
  return r >= n && r <= s;
27
27
  }
28
28
  function Ve() {
29
- return Ee(Date.now());
29
+ return Oe(Date.now());
30
30
  }
31
31
  const Be = ({ children: e }) => {
32
32
  const [t, r] = C(!1), [n, s] = C(""), o = p((c) => {
33
33
  r(!0), s(c);
34
34
  }, []), l = p(() => {
35
35
  r(!1);
36
- }, []), a = A(() => ({ show: t, text: n, showConfirm: o, hideConfirm: l }), [t, n, o, l]);
36
+ }, []), a = b(() => ({ show: t, text: n, showConfirm: o, hideConfirm: l }), [t, n, o, l]);
37
37
  return /* @__PURE__ */ f.jsxs(we.Provider, { value: a, children: [
38
- /* @__PURE__ */ f.jsx(St, {}),
38
+ /* @__PURE__ */ f.jsx(At, {}),
39
39
  e
40
40
  ] });
41
41
  }, Ye = () => {
@@ -44,36 +44,36 @@ const Be = ({ children: e }) => {
44
44
  }, [n]), c = p((u) => {
45
45
  u.preventDefault(), !(s.required && !o) && n(o);
46
46
  }, [n, s.required, o]);
47
- P(() => {
47
+ D(() => {
48
48
  t === !0 && l(s.defaultValue ?? "");
49
49
  }, [t, s.defaultValue]);
50
- const i = A(() => ({
50
+ const i = b(() => ({
51
51
  value: o,
52
52
  onChange: (u) => l(u.currentTarget.value),
53
53
  className: "w-100",
54
54
  autoFocus: !0,
55
55
  tabIndex: 0
56
56
  }), [o]);
57
- return /* @__PURE__ */ f.jsxs(b, { show: t, size: "sm", centered: !0, onHide: a, children: [
58
- /* @__PURE__ */ f.jsx(b.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(b.Title, { children: r }) }),
57
+ return /* @__PURE__ */ f.jsxs(S, { show: t, size: "sm", centered: !0, onHide: a, children: [
58
+ /* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: r }) }),
59
59
  /* @__PURE__ */ f.jsxs("form", { onSubmit: c, children: [
60
- /* @__PURE__ */ f.jsxs(b.Body, { children: [
60
+ /* @__PURE__ */ f.jsxs(S.Body, { children: [
61
61
  s.input === "textarea" ? /* @__PURE__ */ f.jsx("textarea", { ...i, rows: 5 }) : void 0,
62
62
  s.input === "input" ? /* @__PURE__ */ f.jsx(je, { ...i, type: s.type }) : void 0
63
63
  ] }),
64
- /* @__PURE__ */ f.jsxs(b.Footer, { className: "w-100 d-flex gap-5", children: [
64
+ /* @__PURE__ */ f.jsxs(S.Footer, { className: "w-100 d-flex gap-5", children: [
65
65
  /* @__PURE__ */ f.jsx(G, { variant: "outlined", color: "secondary", onClick: a, className: "flex-grow-1", children: e.cancel }),
66
66
  /* @__PURE__ */ f.jsx(G, { color: "primary", disabled: s.required && !o, type: "submit", className: "flex-grow-1", children: e.confirm })
67
67
  ] })
68
68
  ] })
69
69
  ] });
70
- }, Ze = ({ children: e }) => {
70
+ }, Je = ({ children: e }) => {
71
71
  const [t, r] = C(!1), [n, s] = C(""), [o, l] = C({ input: "textarea", type: "text" }), a = he(() => {
72
72
  }), c = p((d) => {
73
73
  s(d), r(!0);
74
74
  }, []), i = p(() => {
75
75
  r(!1);
76
- }, []), u = A(() => ({
76
+ }, []), u = b(() => ({
77
77
  isShown: t,
78
78
  text: n,
79
79
  showPrompt: c,
@@ -87,7 +87,7 @@ const Be = ({ children: e }) => {
87
87
  /* @__PURE__ */ f.jsx(Ye, {})
88
88
  ] });
89
89
  }, $t = ({ cookieDomain: e, axiosOptions: t, language: r, texts: n, ProjectIconComponent: s, localizationContext: o, chartColorPalette: l, children: a }) => {
90
- const c = A(() => ({
90
+ const c = b(() => ({
91
91
  axiosOptions: t,
92
92
  cookieDomain: e,
93
93
  language: r,
@@ -104,8 +104,8 @@ const Be = ({ children: e }) => {
104
104
  n,
105
105
  l
106
106
  ]);
107
- return /* @__PURE__ */ f.jsx(z.Provider, { value: c, children: /* @__PURE__ */ f.jsx(Be, { children: /* @__PURE__ */ f.jsxs(Ze, { children: [
108
- /* @__PURE__ */ f.jsx(Pe, {}),
107
+ return /* @__PURE__ */ f.jsx(z.Provider, { value: c, children: /* @__PURE__ */ f.jsx(Be, { children: /* @__PURE__ */ f.jsxs(Je, { children: [
108
+ /* @__PURE__ */ f.jsx(De, {}),
109
109
  a
110
110
  ] }) }) });
111
111
  }, _t = ({ children: e }) => {
@@ -113,8 +113,8 @@ const Be = ({ children: e }) => {
113
113
  n.add(a), r(!0);
114
114
  }, [n]), o = p((a) => {
115
115
  n.delete(a), n.size === 0 && r(!1);
116
- }, [n]), l = A(() => ({ isLoading: t, startLoading: s, stopLoading: o }), [t, s, o]);
117
- return /* @__PURE__ */ f.jsxs(De.Provider, { value: l, children: [
116
+ }, [n]), l = b(() => ({ isLoading: t, startLoading: s, stopLoading: o }), [t, s, o]);
117
+ return /* @__PURE__ */ f.jsxs(Pe.Provider, { value: l, children: [
118
118
  t && /* @__PURE__ */ f.jsx(Ne, {}),
119
119
  e
120
120
  ] });
@@ -123,14 +123,14 @@ const Be = ({ children: e }) => {
123
123
  const y = await a();
124
124
  y && i(y.token);
125
125
  }, [a]);
126
- P(() => {
126
+ D(() => {
127
127
  u();
128
128
  }, [u]);
129
129
  const h = p(() => {
130
130
  const y = localStorage.getItem("user") ?? null;
131
131
  return y ? JSON.parse(y ?? "") : null;
132
132
  }, [])(), [m, g] = C({
133
- state: h ? D.LOGGED_IN : D.LOGGING_IN,
133
+ state: h ? P.LOGGED_IN : P.LOGGING_IN,
134
134
  user: h
135
135
  }), _ = p(async (y) => {
136
136
  let v = null;
@@ -141,29 +141,29 @@ const Be = ({ children: e }) => {
141
141
  }), v;
142
142
  }, [t]), w = p(() => {
143
143
  localStorage.removeItem("user"), g({
144
- state: D.LOGGED_OUT,
144
+ state: P.LOGGED_OUT,
145
145
  user: null
146
146
  }), s(null), o(null);
147
- }, [o, s]), O = p(async (y) => {
147
+ }, [o, s]), E = p(async (y) => {
148
148
  g({
149
- state: D.LOGGING_IN,
149
+ state: P.LOGGING_IN,
150
150
  user: null
151
151
  });
152
152
  const v = await _(y);
153
153
  return v ? (g({
154
- state: D.LOGGED_IN,
154
+ state: P.LOGGED_IN,
155
155
  user: v
156
156
  }), localStorage.setItem("user", JSON.stringify(v)), await l(), !0) : (g({
157
- state: D.LOGIN_FAILED,
157
+ state: P.LOGIN_FAILED,
158
158
  user: null
159
159
  }), !1);
160
160
  }, [_, l]), I = p(() => {
161
161
  w();
162
162
  }, [w]);
163
- P(() => {
163
+ D(() => {
164
164
  if (r) {
165
165
  const y = r.addEventCallback((v) => {
166
- if (v.eventType === J.LOGIN_SUCCESS && v.payload) {
166
+ if (v.eventType === W.LOGIN_SUCCESS && v.payload) {
167
167
  const K = v.payload;
168
168
  i(K.accessToken);
169
169
  }
@@ -174,33 +174,33 @@ const Be = ({ children: e }) => {
174
174
  }
175
175
  return () => {
176
176
  };
177
- }, [r, O, I]);
177
+ }, [r, E, I]);
178
178
  const ne = p(async (y) => {
179
- y && await O(y).catch(() => {
179
+ y && await E(y).catch(() => {
180
180
  I(), s(null);
181
181
  });
182
- }, [O, I, s]);
183
- P(() => {
182
+ }, [E, I, s]);
183
+ D(() => {
184
184
  ne(c);
185
185
  }, [c, n == null ? void 0 : n.id, ne]);
186
- const Se = A(() => ({
186
+ const Ae = b(() => ({
187
187
  user: m.user,
188
188
  userLoginState: m,
189
- loginUser: O,
189
+ loginUser: E,
190
190
  logoutUser: I
191
- }), [m, O, I]);
192
- return /* @__PURE__ */ f.jsx(He.Provider, { value: Se, children: e });
191
+ }), [m, E, I]);
192
+ return /* @__PURE__ */ f.jsx(He.Provider, { value: Ae, children: e });
193
193
  }, Rt = ({ ...e }) => {
194
- const { cookieDomain: t } = $(z), [, r] = $e(["Authorization"]), n = A(() => ({
194
+ const { cookieDomain: t } = $(z), [, r] = $e(["Authorization"]), n = b(() => ({
195
195
  useMsal: e.useMsal ?? !1,
196
196
  msalInstance: e.useMsal ? e.msalInstance ?? null : null,
197
197
  msalScopes: e.useMsal ? e.msalScopes ?? [] : [],
198
198
  msalExtraScopes: e.useMsal ? e.msalExtraScopes ?? [] : []
199
199
  }), [e]);
200
- return P(() => {
200
+ return D(() => {
201
201
  if (e.useMsal) {
202
202
  const s = e.msalInstance.addEventCallback((o) => {
203
- if (o.eventType === J.LOGIN_SUCCESS || o.eventType === J.ACQUIRE_TOKEN_SUCCESS && o.payload) {
203
+ if (o.eventType === W.LOGIN_SUCCESS || o.eventType === W.ACQUIRE_TOKEN_SUCCESS && o.payload) {
204
204
  const l = o.payload, a = l.account;
205
205
  e.msalInstance.setActiveAccount(a);
206
206
  const c = l.accessToken, i = l.expiresOn;
@@ -222,7 +222,7 @@ const Be = ({ children: e }) => {
222
222
  };
223
223
  }, [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 });
224
224
  }, Ut = ({ children: e, relativeEndpoint: t }) => {
225
- const [r, n, s] = qe("user-delegation", null), o = A(() => {
225
+ const [r, n, s] = qe("user-delegation", null), o = b(() => {
226
226
  if (!r)
227
227
  return null;
228
228
  const d = r.from ? se(r.from) : Ve(), h = r.to ? se(r.to) : ze();
@@ -231,14 +231,14 @@ const Be = ({ children: e }) => {
231
231
  nullStateBeforeLoad: !1,
232
232
  nullStateOnFail: !0
233
233
  }), i = he(null);
234
- P(() => {
234
+ D(() => {
235
235
  const d = () => {
236
236
  c(), i.current = window.setTimeout(d, _e() + 5e3);
237
237
  };
238
238
  return d(), () => {
239
239
  i.current !== null && window.clearTimeout(i.current);
240
240
  };
241
- }, [c]), P(() => {
241
+ }, [c]), D(() => {
242
242
  const d = () => {
243
243
  s();
244
244
  };
@@ -246,7 +246,7 @@ const Be = ({ children: e }) => {
246
246
  window.removeEventListener("focus", d);
247
247
  };
248
248
  }, [s, c]);
249
- const u = A(() => ({
249
+ const u = b(() => ({
250
250
  delegation: o,
251
251
  setDelegation: n,
252
252
  availableDelegations: l,
@@ -261,7 +261,7 @@ const Be = ({ children: e }) => {
261
261
  ]);
262
262
  return /* @__PURE__ */ f.jsx(me.Provider, { value: u, children: e });
263
263
  };
264
- var Je = typeof Element < "u", We = typeof Map == "function", Qe = typeof Set == "function", Xe = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
264
+ var We = typeof Element < "u", Ze = typeof Map == "function", Qe = typeof Set == "function", Xe = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
265
265
  function F(e, t) {
266
266
  if (e === t) return !0;
267
267
  if (e && t && typeof e == "object" && typeof t == "object") {
@@ -274,7 +274,7 @@ function F(e, t) {
274
274
  return !0;
275
275
  }
276
276
  var o;
277
- if (We && e instanceof Map && t instanceof Map) {
277
+ if (Ze && e instanceof Map && t instanceof Map) {
278
278
  if (e.size !== t.size) return !1;
279
279
  for (o = e.entries(); !(n = o.next()).done; )
280
280
  if (!t.has(n.value[0])) return !1;
@@ -300,7 +300,7 @@ function F(e, t) {
300
300
  if (s = Object.keys(e), r = s.length, r !== Object.keys(t).length) return !1;
301
301
  for (n = r; n-- !== 0; )
302
302
  if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1;
303
- if (Je && e instanceof Element) return !1;
303
+ if (We && e instanceof Element) return !1;
304
304
  for (n = r; n-- !== 0; )
305
305
  if (!((s[n] === "_owner" || s[n] === "__v" || s[n] === "__o") && e.$$typeof) && !F(e[s[n]], t[s[n]]))
306
306
  return !1;
@@ -513,15 +513,15 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
513
513
  "script",
514
514
  "style"
515
515
  /* STYLE */
516
- ], W = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;"), Te = (e) => Object.keys(e).reduce((t, r) => {
516
+ ], Z = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;"), Te = (e) => Object.keys(e).reduce((t, r) => {
517
517
  const n = typeof e[r] < "u" ? `${r}="${e[r]}"` : `${r}`;
518
518
  return t ? `${t} ${n}` : n;
519
519
  }, ""), mt = (e, t, r, n) => {
520
520
  const s = Te(r), o = ge(t);
521
- return s ? `<${e} ${x}="true" ${s}>${W(
521
+ return s ? `<${e} ${x}="true" ${s}>${Z(
522
522
  o,
523
523
  n
524
- )}</${e}>` : `<${e} ${x}="true">${W(
524
+ )}</${e}>` : `<${e} ${x}="true">${Z(
525
525
  o,
526
526
  n
527
527
  )}</${e}>`;
@@ -529,7 +529,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
529
529
  const o = s, l = Object.keys(o).filter(
530
530
  (i) => !(i === "innerHTML" || i === "cssText")
531
531
  ).reduce((i, u) => {
532
- const d = typeof o[u] > "u" ? u : `${u}="${W(o[u], r)}"`;
532
+ const d = typeof o[u] > "u" ? u : `${u}="${Z(o[u], r)}"`;
533
533
  return i ? `${i} ${d}` : d;
534
534
  }, ""), a = o.innerHTML || o.cssText || "", c = dt.indexOf(e) === -1;
535
535
  return `${n}<${e} ${x}="true" ${l}${c ? "/>" : `>${a}</${e}>`}`;
@@ -541,7 +541,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
541
541
  key: t,
542
542
  [x]: !0
543
543
  }, s = ve(r, n);
544
- return [E.createElement("title", s, t)];
544
+ return [O.createElement("title", s, t)];
545
545
  }, q = (e, t) => t.map((r, n) => {
546
546
  const s = {
547
547
  key: n,
@@ -554,7 +554,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
554
554
  s.dangerouslySetInnerHTML = { __html: c };
555
555
  } else
556
556
  s[a] = r[o];
557
- }), E.createElement(e, s);
557
+ }), O.createElement(e, s);
558
558
  }), T = (e, t, r = !0) => {
559
559
  switch (e) {
560
560
  case "title":
@@ -627,10 +627,10 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
627
627
  };
628
628
  }, Q = gt, U = [], xe = !!(typeof window < "u" && window.document && window.document.createElement), X = class {
629
629
  constructor(e, t) {
630
- S(this, "instances", []);
631
- S(this, "canUseDOM", xe);
632
- S(this, "context");
633
- S(this, "value", {
630
+ A(this, "instances", []);
631
+ A(this, "canUseDOM", xe);
632
+ A(this, "context");
633
+ A(this, "value", {
634
634
  setHelmet: (e) => {
635
635
  this.context.helmet = e;
636
636
  },
@@ -659,16 +659,16 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
659
659
  titleAttributes: {}
660
660
  }));
661
661
  }
662
- }, Tt = {}, Ce = E.createContext(Tt), j, Ae = (j = class extends te {
662
+ }, Tt = {}, Ce = O.createContext(Tt), j, be = (j = class extends te {
663
663
  constructor(r) {
664
664
  super(r);
665
- S(this, "helmetData");
665
+ A(this, "helmetData");
666
666
  this.helmetData = new X(this.props.context || {}, j.canUseDOM);
667
667
  }
668
668
  render() {
669
- return /* @__PURE__ */ E.createElement(Ce.Provider, { value: this.helmetData.value }, this.props.children);
669
+ return /* @__PURE__ */ O.createElement(Ce.Provider, { value: this.helmetData.value }, this.props.children);
670
670
  }
671
- }, S(j, "canUseDOM", xe), j), k = (e, t) => {
671
+ }, A(j, "canUseDOM", xe), j), k = (e, t) => {
672
672
  const r = document.head || document.querySelector(
673
673
  "head"
674
674
  /* HEAD */
@@ -734,8 +734,8 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
734
734
  styleTags: k("style", u)
735
735
  }, g = {}, _ = {};
736
736
  Object.keys(m).forEach((w) => {
737
- const { newTags: O, oldTags: I } = m[w];
738
- O.length && (g[w] = O), I.length && (_[w] = m[w].oldTags);
737
+ const { newTags: E, oldTags: I } = m[w];
738
+ E.length && (g[w] = E), I.length && (_[w] = m[w].oldTags);
739
739
  }), t && t(), c(e, g, _);
740
740
  }, R = null, xt = (e) => {
741
741
  R && cancelAnimationFrame(R), e.defer ? R = requestAnimationFrame(() => {
@@ -746,7 +746,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
746
746
  }, Ct = xt, ce = class extends te {
747
747
  constructor() {
748
748
  super(...arguments);
749
- S(this, "rendered", !1);
749
+ A(this, "rendered", !1);
750
750
  }
751
751
  shouldComponentUpdate(t) {
752
752
  return !nt(t, this.props);
@@ -767,7 +767,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
767
767
  return delete l.context, l;
768
768
  })
769
769
  );
770
- Ae.canUseDOM ? Ct(s) : Q && (n = Q(s)), r(n);
770
+ be.canUseDOM ? Ct(s) : Q && (n = Q(s)), r(n);
771
771
  }
772
772
  // componentWillMount will be deprecated
773
773
  // for SSR, initialize on first render
@@ -782,7 +782,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
782
782
  render() {
783
783
  return this.init(), null;
784
784
  }
785
- }, Z, At = (Z = class extends te {
785
+ }, J, bt = (J = class extends te {
786
786
  shouldComponentUpdate(e) {
787
787
  return !tt(ie(this.props, "helmetData"), ie(e, "helmetData"));
788
788
  }
@@ -864,7 +864,7 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
864
864
  }
865
865
  mapChildrenToProps(e, t) {
866
866
  let r = {};
867
- return E.Children.forEach(e, (n) => {
867
+ return O.Children.forEach(e, (n) => {
868
868
  if (!n || !n.props)
869
869
  return;
870
870
  const { children: s, ...o } = n.props, l = Object.keys(o).reduce((c, i) => (c[st[i] || i] = o[i], c), {});
@@ -898,13 +898,13 @@ var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
898
898
  const s = n;
899
899
  n = new X(s.context, !0), delete r.helmetData;
900
900
  }
901
- return n ? /* @__PURE__ */ E.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ E.createElement(Ce.Consumer, null, (s) => /* @__PURE__ */ E.createElement(ce, { ...r, context: s }));
901
+ return n ? /* @__PURE__ */ O.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ O.createElement(Ce.Consumer, null, (s) => /* @__PURE__ */ O.createElement(ce, { ...r, context: s }));
902
902
  }
903
- }, S(Z, "defaultProps", {
903
+ }, A(J, "defaultProps", {
904
904
  defer: !0,
905
905
  encodeSpecialCharacters: !0,
906
906
  prioritizeSeoTags: !1
907
- }), Z);
907
+ }), J);
908
908
  const ue = (e, t) => e ? `${e} | ${t}` : t, Nt = ({ defaultHelmet: e, children: t, helmetPrefix: r }) => {
909
909
  const [n, s] = C([
910
910
  ue(r ?? "", e)
@@ -912,16 +912,16 @@ const ue = (e, t) => e ? `${e} | ${t}` : t, Nt = ({ defaultHelmet: e, children:
912
912
  s((u) => [...u, ue(r ?? "", i)]);
913
913
  }, [r]), l = p(() => {
914
914
  s((i) => i.length > 1 ? i.slice(0, -1) : i);
915
- }, [s]), a = A(() => n.at(-1) ?? "", [n]), c = A(() => ({ addHelmet: o, removeHelmet: l }), [o, l]);
916
- return /* @__PURE__ */ f.jsx(Me.Provider, { value: c, children: /* @__PURE__ */ f.jsxs(Ae, { children: [
917
- /* @__PURE__ */ f.jsx(At, { defer: !1, children: /* @__PURE__ */ f.jsx("title", { children: a }) }),
915
+ }, [s]), a = b(() => n.at(-1) ?? "", [n]), c = b(() => ({ addHelmet: o, removeHelmet: l }), [o, l]);
916
+ return /* @__PURE__ */ f.jsx(Me.Provider, { value: c, children: /* @__PURE__ */ f.jsxs(be, { children: [
917
+ /* @__PURE__ */ f.jsx(bt, { defer: !1, children: /* @__PURE__ */ f.jsx("title", { children: a }) }),
918
918
  t
919
919
  ] }) });
920
- }, St = () => {
920
+ }, At = () => {
921
921
  const { texts: { confirm: e } } = $(z), { onConfirm: t, onCancel: r, text: n, show: s } = Re();
922
- return /* @__PURE__ */ f.jsxs(b, { show: s, size: "sm", centered: !0, onHide: r, children: [
923
- /* @__PURE__ */ f.jsx(b.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(b.Title, { children: n }) }),
924
- /* @__PURE__ */ f.jsx(b.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
922
+ return /* @__PURE__ */ f.jsxs(S, { show: s, size: "sm", centered: !0, onHide: r, children: [
923
+ /* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: n }) }),
924
+ /* @__PURE__ */ f.jsx(S.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
925
925
  /* @__PURE__ */ f.jsx(G, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: r, children: e.no }),
926
926
  /* @__PURE__ */ f.jsx(G, { type: "button", color: "primary", onClick: t, className: "w-100 ml", children: e.yes })
927
927
  ] }) })
@@ -934,7 +934,7 @@ export {
934
934
  Ut as DelegationProvider,
935
935
  Me as HelmetContext,
936
936
  Nt as HelmetProvider,
937
- De as LoadingContext,
937
+ Pe as LoadingContext,
938
938
  _t as LoadingProvider,
939
939
  z as LuminusComponentsContext,
940
940
  $t as LuminusComponentsProvider,
package/dist/hooks.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./nivo-bar.es-C8Q7uf5o.cjs"),q=require("./useWindowSize-CE6DJWzn.cjs"),T=require("./usePermissions-luBa161q.cjs"),d=require("./useClipboard-C0CnZHu7.cjs"),x=require("./useGetApiData-bKrnrpzU.cjs"),c=require("react"),B=require("./useLocalStorageState-BFc8Gc8H.cjs");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const G=r=>{let e="pending",a;const t=r.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 L(r,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 n=a.get(r).then(o=>o.data);s(G(n))})()},[a,r]),t}const E=(r,e,a)=>{let t="pending",s;const l=r.then(n=>{t="success",s=n},n=>{const o=n==null?void 0:n.response;(o==null?void 0:o.status)===404&&a?(t="error-404",s=n):(t="error",s=n)});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=(r,{loadOnInit:e=i.loadOnInit,enabled:a=i.enabled,silent:t=i.silent,nullStateBeforeLoad:s=i.nullStateBeforeLoad,nullStateOnFail:l=i.nullStateOnFail,customApiUrl:n,customBearerToken:o,dataTransformer:h,errorBoundaryOn404:S}=i)=>{const g=u.useAxios({silent:t,customToken:o,differentBaseUrl:n,noToastOnStatus:S?[404]:void 0}),{startLoading:w,stopLoading:D}=c.useContext(u.LoadingContext),P=c.useRef(0),{isAuthenticated:y}=u.useAuth(),[b,m]=c.useState(null),p=c.useCallback(async(f,A)=>{if(!y()||a===!1)return;!t&&w(`loadData-${r}-${A}`),s&&m(null);const k=g.get(r,{signal:f}).then(C=>h?h(C.data):C.data).finally(()=>!t&&D(`loadData-${r}-${A}`));m(E(k,l??!1,S??!1))},[y,a,t,w,r,s,g,h,D,l,S]);return c.useEffect(()=>{if(e===!1)return;const f=new AbortController;return p(f.signal,++P.current),()=>{f.abort()}},[p,e]),{data:b,setData:m,reloadData:p}};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=T.usePermissions;exports.useClipboard=d.useClipboard;exports.useEmployeePhotoPath=d.useEmployeePhotoPath;exports.useKeyPress=d.useKeyPress;exports.useSearchQuery=d.useSearchQuery;exports.useSearchQueryState=d.useSearchQueryState;exports.useGetApiData=x.useGetApiData;exports.useLocalStorageState=B.useLocalStorageState;exports.useGetApiDataBound=O;exports.useGetDataBound=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./ShortcutLinksContext-CtT9qbGN.cjs"),q=require("./useWindowSize-CE6DJWzn.cjs"),x=require("./usePermissions-BND9X9_G.cjs"),d=require("./useClipboard-BDAZwNR9.cjs"),T=require("./useGetApiData-CRj_Oj2M.cjs"),c=require("react"),L=require("./useLocalStorageState-BFc8Gc8H.cjs");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const G=r=>{let e="pending",a;const t=r.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(r,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 n=a.get(r).then(o=>o.data);s(G(n))})()},[a,r]),t}const E=(r,e,a)=>{let t="pending",s;const l=r.then(n=>{t="success",s=n},n=>{const o=n==null?void 0:n.response;(o==null?void 0:o.status)===404&&a?(t="error-404",s=n):(t="error",s=n)});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=(r,{loadOnInit:e=i.loadOnInit,enabled:a=i.enabled,silent:t=i.silent,nullStateBeforeLoad:s=i.nullStateBeforeLoad,nullStateOnFail:l=i.nullStateOnFail,customApiUrl:n,customBearerToken:o,dataTransformer:h,errorBoundaryOn404:S}=i)=>{const g=u.useAxios({silent:t,customToken:o,differentBaseUrl:n,noToastOnStatus:S?[404]:void 0}),{startLoading:w,stopLoading:D}=c.useContext(u.LoadingContext),P=c.useRef(0),{isAuthenticated:C}=u.useAuth(),[k,m]=c.useState(null),p=c.useCallback(async(f,y)=>{if(!C()||a===!1)return;!t&&w(`loadData-${r}-${y}`),s&&m(null);const b=g.get(r,{signal:f}).then(A=>h?h(A.data):A.data).finally(()=>!t&&D(`loadData-${r}-${y}`));m(E(b,l??!1,S??!1))},[C,a,t,w,r,s,g,h,D,l,S]);return c.useEffect(()=>{if(e===!1)return;const f=new AbortController;return p(f.signal,++P.current),()=>{f.abort()}},[p,e]),{data:k,setData:m,reloadData:p}};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=L.useLocalStorageState;exports.useGetApiDataBound=O;exports.useGetDataBound=B;