react-luminus-components 2.0.32 → 2.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./nivo-bar-BkpPCncR.cjs"),U=require("./useLocalStorageState-gKbms6va.cjs"),c=require("react"),F=require("./useIsFormDirty-Cb4GEBID.cjs");require("react/jsx-runtime");require("react-router");const V=require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-react");require("@azure/msal-browser");const B=new Map;function H(t,s){const e=u.useAxios({silent:!0,differentBaseUrl:s==null?void 0:s.customBaseUrl,customToken:s==null?void 0:s.customToken}),n=c.useRef(null);if(!B.has(t)){if(!e.interceptorsUsed)return null;const m=e.get(t).then(r=>(B.set(t,{status:"success",data:r.data}),n.current=setTimeout(()=>{B.delete(t),n.current=null},1e3*10),r.data)).catch(r=>{throw B.set(t,{status:"error",error:r}),n.current=setTimeout(()=>{B.delete(t),n.current=null},1e3*1),r});throw B.set(t,{status:"pending",promise:m}),m}const o=B.get(t);if(o.status==="pending")throw o.promise;if(o.status==="error")throw o.error;return o.data}const Q=t=>s=>(window.addEventListener(`storage_${t}`,s),()=>window.removeEventListener(`storage_${t}`,s)),J=(t,s,e)=>{const n=u.compilerRuntimeExports.c(15),o=e===void 0?localStorage:e,[m]=c.useState(s);let r;n[0]!==s?(r=JSON.stringify(s),n[0]=s,n[1]=r):r=n[1];const i=c.useRef(r),p=c.useRef(s);let v;n[2]!==t||n[3]!==m||n[4]!==o?(v=()=>{const l=o.getItem(t);return l!==i.current&&(i.current=l,p.current=i.current?JSON.parse(i.current):m),p.current},n[2]=t,n[3]=m,n[4]=o,n[5]=v):v=n[5];const y=v;let g;n[6]!==t?(g=Q(t),n[6]=t,n[7]=g):g=n[7];const E=g,d=c.useSyncExternalStore(E,y);let a;n[8]!==y||n[9]!==t||n[10]!==o?(a=l=>{const O=typeof l=="function"?l(y()):l;o.setItem(t,JSON.stringify(O)),window.dispatchEvent(new Event(`storage_${t}`))},n[8]=y,n[9]=t,n[10]=o,n[11]=a):a=n[11];const f=a;let w;return n[12]!==f||n[13]!==d?(w=[d,f],n[12]=f,n[13]=d,n[14]=w):w=n[14],w},M=(t,s,e)=>{let n="pending",o;const m=t.then(r=>{n="success",o=r},r=>{const i=r==null?void 0:r.response;(i==null?void 0:i.status)===404&&e?(n="error-404",o=r):(n="error",o=r)});return()=>{switch(n){case"pending":throw m;case"success":return o;case"error":if(o.code==="ERR_CANCELED")return null;throw o;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},L={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},W=(t,s)=>{const e=u.compilerRuntimeExports.c(26),{loadOnInit:n,enabled:o,silent:m,nullStateBeforeLoad:r,nullStateOnFail:i,customApiUrl:p,customBearerToken:v,dataTransformer:y,errorBoundaryOn404:g}=s===void 0?L:s,E=n===void 0?L.loadOnInit:n,d=o===void 0?L.enabled:o,a=m===void 0?L.silent:m,f=r===void 0?L.nullStateBeforeLoad:r,w=i===void 0?L.nullStateOnFail:i;let h;e[0]!==g?(h=g?[404]:void 0,e[0]=g,e[1]=h):h=e[1];let l;e[2]!==p||e[3]!==v||e[4]!==a||e[5]!==h?(l={silent:a,customToken:v,differentBaseUrl:p,noToastOnStatus:h},e[2]=p,e[3]=v,e[4]=a,e[5]=h,e[6]=l):l=e[6];const O=u.useAxios(l),{startLoading:I,stopLoading:S}=c.useContext(u.LoadingContext),D=c.useRef(0),{isAuthenticated:C}=u.useAuth(),[R,N]=c.useState(null);let P;e[7]!==O||e[8]!==y||e[9]!==d||e[10]!==g||e[11]!==C||e[12]!==f||e[13]!==w||e[14]!==a||e[15]!==I||e[16]!==S||e[17]!==t?(P=async(x,G)=>{if(!C()||d===!1)return;!a&&I(`loadData-${t}-${G}`),f&&N(null);const _=O.get(t,{signal:x}).then(K=>y?y(K.data):K.data).finally(()=>!a&&S(`loadData-${t}-${G}`));N(M(_,w??!1,g??!1))},e[7]=O,e[8]=y,e[9]=d,e[10]=g,e[11]=C,e[12]=f,e[13]=w,e[14]=a,e[15]=I,e[16]=S,e[17]=t,e[18]=P):P=e[18];const T=P;let A,b;e[19]!==T||e[20]!==E?(b=()=>{if(E===!1)return;const x=new AbortController;return T(x.signal,D.current=D.current+1),()=>{x.abort()}},A=[T,E],e[19]=T,e[20]=E,e[21]=A,e[22]=b):(A=e[21],b=e[22]),c.useEffect(b,A);let q;return e[23]!==R||e[24]!==T?(q={data:R,setData:N,reloadData:T},e[23]=R,e[24]=T,e[25]=q):q=e[25],q},z=()=>{const t=c.useRef({}).current;return c.useEffect(()=>{const s=document.createElement("div");return s.style.position="absolute",s.style.pointerEvents="none",s.style.top="0",s.style.width="100%",s.style.height="100%",t.elt=s,document.body.appendChild(s),()=>{document.body.removeChild(s)}},[t]),s=>(e,...n)=>{const o=s(e,...n);return e.draggableProps.style.position==="fixed"?V.createPortal(o,t.elt):o}},$={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},Z=(t,s)=>{const e=u.compilerRuntimeExports.c(18),{storageKey:n,requiredHeight:o,retryInterval:m}=s===void 0?$:s,r=n===void 0?$.storageKey:n,i=o===void 0?$.requiredHeight:o,p=m===void 0?$.retryInterval:m,[v,y]=c.useState(!1),g=c.useRef(null);let E;e[0]!==r?(E=()=>{const S=localStorage.getItem(r);return localStorage.removeItem(r),S===null?null:Number(S)},e[0]=r,e[1]=E):E=e[1];const d=E;let a;e[2]!==r?(a=S=>{localStorage.setItem(r,S)},e[2]=r,e[3]=a):a=e[3];const f=a;let w,h;e[4]!==v||e[5]!==i||e[6]!==d||e[7]!==p||e[8]!==t?(w=()=>{const S=window.setInterval(()=>{if(!v&&t.current!==null&&t.current.getBoundingClientRect().height>i){y(!0);const D=d();D!==null&&t.current.scrollTo({top:D}),window.clearInterval(S)}},p);return()=>{window.clearTimeout(S)}},h=[v,i,d,p,t],e[4]=v,e[5]=i,e[6]=d,e[7]=p,e[8]=t,e[9]=w,e[10]=h):(w=e[9],h=e[10]),c.useEffect(w,h);let l,O;e[11]!==f||e[12]!==t?(l=()=>{var D;const S=new AbortController;return(D=t.current)==null||D.addEventListener("scrollend",()=>{var C;g.current=((C=t.current)==null?void 0:C.scrollTop)??0,f((g.current??0).toString())},{signal:S.signal}),()=>S.abort()},O=[f,t],e[11]=f,e[12]=t,e[13]=l,e[14]=O):(l=e[13],O=e[14]),c.useEffect(l,O);let I;return e[15]!==d||e[16]!==f?(I={saveValue:f,retrieveValue:d},e[15]=d,e[16]=f,e[17]=I):I=e[17],I},j=()=>{const t=X;return c.useSyncExternalStore(t,Y)};function X(t){return window.addEventListener("online",t),window.addEventListener("offline",t),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",t)}}function Y(){return window.navigator.onLine}exports.cancelToken=u.cancelToken;exports.useAuth=u.useAuth;exports.useAxios=u.useAxios;exports.useClickOutside=u.useClickOutside;exports.useClipboard=u.useClipboard;exports.useConfirm=u.useConfirm;exports.useFormControlType=u.useFormControlType;exports.useKeyPress=u.useKeyPress;exports.useNotifications=u.useNotifications;exports.usePermissions=u.usePermissions;exports.usePrompt=u.usePrompt;exports.useWindowSize=u.useWindowSize;exports.useZodSchemaTypes=u.useZodSchemaTypes;exports.useGetApiData=U.useGetApiData;exports.useLocalStorageState=U.useLocalStorageState;exports.useEmployeePhotoPath=F.useEmployeePhotoPath;exports.useIsFormDirty=F.useIsFormDirty;exports.useSearchQuery=F.useSearchQuery;exports.useSearchQueryState=F.useSearchQueryState;exports.useGetApiDataBound=W;exports.useGetDataBound=H;exports.useIsBrowserOnline=j;exports.usePersistentState=J;exports.useRenderDraggableInPortal=z;exports.useScrollSave=Z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./nivo-bar-BkpPCncR.cjs"),U=require("./useLocalStorageState-gKbms6va.cjs"),f=require("react"),F=require("./useIsFormDirty-Cb4GEBID.cjs");require("react/jsx-runtime");require("react-router");const H=require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-react");require("@azure/msal-browser");const Q=require("./useIsBrowserOnline-CREGrf2l.cjs"),C=new Map;function _(s,r){const e=a.useAxios({silent:!0,differentBaseUrl:r==null?void 0:r.customBaseUrl,customToken:r==null?void 0:r.customToken}),t=f.useRef(null);if(!C.has(s)){if(!e.interceptorsUsed)return null;const m=e.get(s).then(n=>(C.set(s,{status:"success",data:n.data}),t.current=setTimeout(()=>{C.delete(s),t.current=null},1e3*10),n.data)).catch(n=>{throw C.set(s,{status:"error",error:n}),t.current=setTimeout(()=>{C.delete(s),t.current=null},1e3*1),n});throw C.set(s,{status:"pending",promise:m}),m}const o=C.get(s);if(o.status==="pending")throw o.promise;if(o.status==="error")throw o.error;return o.data}const J=s=>r=>(window.addEventListener(`storage_${s}`,r),()=>window.removeEventListener(`storage_${s}`,r)),M=(s,r,e)=>{const t=a.compilerRuntimeExports.c(15),o=e===void 0?localStorage:e,[m]=f.useState(r);let n;t[0]!==r?(n=JSON.stringify(r),t[0]=r,t[1]=n):n=t[1];const l=f.useRef(n),w=f.useRef(r);let h;t[2]!==s||t[3]!==m||t[4]!==o?(h=()=>{const i=o.getItem(s);return i!==l.current&&(l.current=i,w.current=l.current?JSON.parse(l.current):m),w.current},t[2]=s,t[3]=m,t[4]=o,t[5]=h):h=t[5];const y=h;let g;t[6]!==s?(g=J(s),t[6]=s,t[7]=g):g=t[7];const I=g,c=f.useSyncExternalStore(I,y);let u;t[8]!==y||t[9]!==s||t[10]!==o?(u=i=>{const O=typeof i=="function"?i(y()):i;o.setItem(s,JSON.stringify(O)),window.dispatchEvent(new Event(`storage_${s}`))},t[8]=y,t[9]=s,t[10]=o,t[11]=u):u=t[11];const d=u;let v;return t[12]!==d||t[13]!==c?(v=[c,d],t[12]=d,t[13]=c,t[14]=v):v=t[14],v},W=(s,r,e)=>{let t="pending",o;const m=s.then(n=>{t="success",o=n},n=>{const l=n==null?void 0:n.response;(l==null?void 0:l.status)===404&&e?(t="error-404",o=n):(t="error",o=n)});return()=>{switch(t){case"pending":throw m;case"success":return o;case"error":if(o.code==="ERR_CANCELED")return null;throw o;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},P={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},z=(s,r)=>{const e=a.compilerRuntimeExports.c(26),{loadOnInit:t,enabled:o,silent:m,nullStateBeforeLoad:n,nullStateOnFail:l,customApiUrl:w,customBearerToken:h,dataTransformer:y,errorBoundaryOn404:g}=r===void 0?P:r,I=t===void 0?P.loadOnInit:t,c=o===void 0?P.enabled:o,u=m===void 0?P.silent:m,d=n===void 0?P.nullStateBeforeLoad:n,v=l===void 0?P.nullStateOnFail:l;let p;e[0]!==g?(p=g?[404]:void 0,e[0]=g,e[1]=p):p=e[1];let i;e[2]!==w||e[3]!==h||e[4]!==u||e[5]!==p?(i={silent:u,customToken:h,differentBaseUrl:w,noToastOnStatus:p},e[2]=w,e[3]=h,e[4]=u,e[5]=p,e[6]=i):i=e[6];const O=a.useAxios(i),{startLoading:D,stopLoading:S}=f.useContext(a.LoadingContext),E=f.useRef(0),{isAuthenticated:B}=a.useAuth(),[R,N]=f.useState(null);let b;e[7]!==O||e[8]!==y||e[9]!==c||e[10]!==g||e[11]!==B||e[12]!==d||e[13]!==v||e[14]!==u||e[15]!==D||e[16]!==S||e[17]!==s?(b=async(x,G)=>{if(!B()||c===!1)return;!u&&D(`loadData-${s}-${G}`),d&&N(null);const V=O.get(s,{signal:x}).then(K=>y?y(K.data):K.data).finally(()=>!u&&S(`loadData-${s}-${G}`));N(W(V,v??!1,g??!1))},e[7]=O,e[8]=y,e[9]=c,e[10]=g,e[11]=B,e[12]=d,e[13]=v,e[14]=u,e[15]=D,e[16]=S,e[17]=s,e[18]=b):b=e[18];const T=b;let q,A;e[19]!==T||e[20]!==I?(A=()=>{if(I===!1)return;const x=new AbortController;return T(x.signal,E.current=E.current+1),()=>{x.abort()}},q=[T,I],e[19]=T,e[20]=I,e[21]=q,e[22]=A):(q=e[21],A=e[22]),f.useEffect(A,q);let L;return e[23]!==R||e[24]!==T?(L={data:R,setData:N,reloadData:T},e[23]=R,e[24]=T,e[25]=L):L=e[25],L},Z=()=>{const s=f.useRef({}).current;return f.useEffect(()=>{const r=document.createElement("div");return r.style.position="absolute",r.style.pointerEvents="none",r.style.top="0",r.style.width="100%",r.style.height="100%",s.elt=r,document.body.appendChild(r),()=>{document.body.removeChild(r)}},[s]),r=>(e,...t)=>{const o=r(e,...t);return e.draggableProps.style.position==="fixed"?H.createPortal(o,s.elt):o}},$={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},j=(s,r)=>{const e=a.compilerRuntimeExports.c(18),{storageKey:t,requiredHeight:o,retryInterval:m}=r===void 0?$:r,n=t===void 0?$.storageKey:t,l=o===void 0?$.requiredHeight:o,w=m===void 0?$.retryInterval:m,[h,y]=f.useState(!1),g=f.useRef(null);let I;e[0]!==n?(I=()=>{const S=localStorage.getItem(n);return localStorage.removeItem(n),S===null?null:Number(S)},e[0]=n,e[1]=I):I=e[1];const c=I;let u;e[2]!==n?(u=S=>{localStorage.setItem(n,S)},e[2]=n,e[3]=u):u=e[3];const d=u;let v,p;e[4]!==h||e[5]!==l||e[6]!==c||e[7]!==w||e[8]!==s?(v=()=>{const S=window.setInterval(()=>{if(!h&&s.current!==null&&s.current.getBoundingClientRect().height>l){y(!0);const E=c();E!==null&&s.current.scrollTo({top:E}),window.clearInterval(S)}},w);return()=>{window.clearTimeout(S)}},p=[h,l,c,w,s],e[4]=h,e[5]=l,e[6]=c,e[7]=w,e[8]=s,e[9]=v,e[10]=p):(v=e[9],p=e[10]),f.useEffect(v,p);let i,O;e[11]!==d||e[12]!==s?(i=()=>{var E;const S=new AbortController;return(E=s.current)==null||E.addEventListener("scrollend",()=>{var B;g.current=((B=s.current)==null?void 0:B.scrollTop)??0,d((g.current??0).toString())},{signal:S.signal}),()=>S.abort()},O=[d,s],e[11]=d,e[12]=s,e[13]=i,e[14]=O):(i=e[13],O=e[14]),f.useEffect(i,O);let D;return e[15]!==c||e[16]!==d?(D={saveValue:d,retrieveValue:c},e[15]=c,e[16]=d,e[17]=D):D=e[17],D};exports.cancelToken=a.cancelToken;exports.useAuth=a.useAuth;exports.useAxios=a.useAxios;exports.useClickOutside=a.useClickOutside;exports.useClipboard=a.useClipboard;exports.useConfirm=a.useConfirm;exports.useFormControlType=a.useFormControlType;exports.useKeyPress=a.useKeyPress;exports.useNotifications=a.useNotifications;exports.usePermissions=a.usePermissions;exports.usePrompt=a.usePrompt;exports.useWindowSize=a.useWindowSize;exports.useZodSchemaTypes=a.useZodSchemaTypes;exports.useGetApiData=U.useGetApiData;exports.useLocalStorageState=U.useLocalStorageState;exports.useEmployeePhotoPath=F.useEmployeePhotoPath;exports.useIsFormDirty=F.useIsFormDirty;exports.useSearchQuery=F.useSearchQuery;exports.useSearchQueryState=F.useSearchQueryState;exports.useIsBrowserOnline=Q.useIsBrowserOnline;exports.useGetApiDataBound=z;exports.useGetDataBound=_;exports.usePersistentState=M;exports.useRenderDraggableInPortal=Z;exports.useScrollSave=j;
package/dist/hooks.es.js CHANGED
@@ -1,8 +1,8 @@
1
- import { ap as q, c as V, ar as Q, be as W } from "./nivo-bar-wBsr2P1t.js";
2
- import { cl as pt, aS as wt, cn as St, ao as ht, cm as Ot, b8 as bt, as as yt, bw as Et, an as It, aH as Lt, aV as Tt } from "./nivo-bar-wBsr2P1t.js";
3
- import { u as Ct, a as Dt } from "./useLocalStorageState-DBd2vOH1.js";
4
- import { useRef as B, useState as _, useSyncExternalStore as G, useContext as z, useEffect as F } from "react";
5
- import { c as $t, u as Pt, a as At, b as Ft } from "./useIsFormDirty-CTuj9_Nd.js";
1
+ import { ap as _, c as V, ar as J, be as Q } from "./nivo-bar-wBsr2P1t.js";
2
+ import { cl as mt, aS as gt, cn as pt, ao as vt, cm as St, b8 as ht, as as wt, bw as yt, an as It, aH as bt, aV as Ot } from "./nivo-bar-wBsr2P1t.js";
3
+ import { u as Ct, a as Et } from "./useLocalStorageState-DBd2vOH1.js";
4
+ import { useRef as D, useState as H, useSyncExternalStore as W, useContext as z, useEffect as F } from "react";
5
+ import { c as xt, u as Bt, a as Lt, b as $t } from "./useIsFormDirty-CTuj9_Nd.js";
6
6
  import "react/jsx-runtime";
7
7
  import "react-router";
8
8
  import { createPortal as M } from "react-dom";
@@ -10,73 +10,74 @@ import "react-hook-form";
10
10
  import "react-flexmonster";
11
11
  import "@azure/msal-react";
12
12
  import "@azure/msal-browser";
13
- const I = /* @__PURE__ */ new Map();
14
- function lt(e, r) {
15
- const t = q({
13
+ import { u as At } from "./useIsBrowserOnline-RAirIO4c.js";
14
+ const T = /* @__PURE__ */ new Map();
15
+ function at(s, r) {
16
+ const t = _({
16
17
  silent: !0,
17
18
  differentBaseUrl: r == null ? void 0 : r.customBaseUrl,
18
19
  customToken: r == null ? void 0 : r.customToken
19
- }), n = B(null);
20
- if (!I.has(e)) {
20
+ }), e = D(null);
21
+ if (!T.has(s)) {
21
22
  if (!t.interceptorsUsed)
22
23
  return null;
23
- const d = t.get(e).then((s) => (I.set(e, {
24
+ const d = t.get(s).then((n) => (T.set(s, {
24
25
  status: "success",
25
- data: s.data
26
- }), n.current = setTimeout(() => {
27
- I.delete(e), n.current = null;
28
- }, 1e3 * 10), s.data)).catch((s) => {
29
- throw I.set(e, {
26
+ data: n.data
27
+ }), e.current = setTimeout(() => {
28
+ T.delete(s), e.current = null;
29
+ }, 1e3 * 10), n.data)).catch((n) => {
30
+ throw T.set(s, {
30
31
  status: "error",
31
- error: s
32
- }), n.current = setTimeout(() => {
33
- I.delete(e), n.current = null;
34
- }, 1e3 * 1), s;
32
+ error: n
33
+ }), e.current = setTimeout(() => {
34
+ T.delete(s), e.current = null;
35
+ }, 1e3 * 1), n;
35
36
  });
36
- throw I.set(e, {
37
+ throw T.set(s, {
37
38
  status: "pending",
38
39
  promise: d
39
40
  }), d;
40
41
  }
41
- const o = I.get(e);
42
+ const o = T.get(s);
42
43
  if (o.status === "pending")
43
44
  throw o.promise;
44
45
  if (o.status === "error")
45
46
  throw o.error;
46
47
  return o.data;
47
48
  }
48
- const Z = (e) => (r) => (window.addEventListener(`storage_${e}`, r), () => window.removeEventListener(`storage_${e}`, r)), ut = (e, r, t) => {
49
- const n = V.c(15), o = t === void 0 ? localStorage : t, [d] = _(r);
50
- let s;
51
- n[0] !== r ? (s = JSON.stringify(r), n[0] = r, n[1] = s) : s = n[1];
52
- const i = B(s), w = B(r);
49
+ const Z = (s) => (r) => (window.addEventListener(`storage_${s}`, r), () => window.removeEventListener(`storage_${s}`, r)), lt = (s, r, t) => {
50
+ const e = V.c(15), o = t === void 0 ? localStorage : t, [d] = H(r);
51
+ let n;
52
+ e[0] !== r ? (n = JSON.stringify(r), e[0] = r, e[1] = n) : n = e[1];
53
+ const l = D(n), S = D(r);
53
54
  let g;
54
- n[2] !== e || n[3] !== d || n[4] !== o ? (g = () => {
55
- const l = o.getItem(e);
56
- return l !== i.current && (i.current = l, w.current = i.current ? JSON.parse(i.current) : d), w.current;
57
- }, n[2] = e, n[3] = d, n[4] = o, n[5] = g) : g = n[5];
58
- const S = g;
55
+ e[2] !== s || e[3] !== d || e[4] !== o ? (g = () => {
56
+ const u = o.getItem(s);
57
+ return u !== l.current && (l.current = u, S.current = l.current ? JSON.parse(l.current) : d), S.current;
58
+ }, e[2] = s, e[3] = d, e[4] = o, e[5] = g) : g = e[5];
59
+ const h = g;
59
60
  let f;
60
- n[6] !== e ? (f = Z(e), n[6] = e, n[7] = f) : f = n[7];
61
- const u = G(f, S);
61
+ e[6] !== s ? (f = Z(s), e[6] = s, e[7] = f) : f = e[7];
62
+ const i = W(f, h);
62
63
  let a;
63
- n[8] !== S || n[9] !== e || n[10] !== o ? (a = (l) => {
64
- const O = typeof l == "function" ? l(S()) : l;
65
- o.setItem(e, JSON.stringify(O)), window.dispatchEvent(new Event(`storage_${e}`));
66
- }, n[8] = S, n[9] = e, n[10] = o, n[11] = a) : a = n[11];
64
+ e[8] !== h || e[9] !== s || e[10] !== o ? (a = (u) => {
65
+ const y = typeof u == "function" ? u(h()) : u;
66
+ o.setItem(s, JSON.stringify(y)), window.dispatchEvent(new Event(`storage_${s}`));
67
+ }, e[8] = h, e[9] = s, e[10] = o, e[11] = a) : a = e[11];
67
68
  const c = a;
68
- let v;
69
- return n[12] !== c || n[13] !== u ? (v = [u, c], n[12] = c, n[13] = u, n[14] = v) : v = n[14], v;
70
- }, j = (e, r, t) => {
71
- let n = "pending", o;
72
- const d = e.then((s) => {
73
- n = "success", o = s;
74
- }, (s) => {
75
- const i = s == null ? void 0 : s.response;
76
- (i == null ? void 0 : i.status) === 404 && t ? (n = "error-404", o = s) : (n = "error", o = s);
69
+ let p;
70
+ return e[12] !== c || e[13] !== i ? (p = [i, c], e[12] = c, e[13] = i, e[14] = p) : p = e[14], p;
71
+ }, j = (s, r, t) => {
72
+ let e = "pending", o;
73
+ const d = s.then((n) => {
74
+ e = "success", o = n;
75
+ }, (n) => {
76
+ const l = n == null ? void 0 : n.response;
77
+ (l == null ? void 0 : l.status) === 404 && t ? (e = "error-404", o = n) : (e = "error", o = n);
77
78
  });
78
79
  return () => {
79
- switch (n) {
80
+ switch (e) {
80
81
  case "pending":
81
82
  throw d;
82
83
  case "success":
@@ -90,161 +91,153 @@ const Z = (e) => (r) => (window.addEventListener(`storage_${e}`, r), () => windo
90
91
  throw new Error("Unknown status");
91
92
  }
92
93
  };
93
- }, T = {
94
+ }, E = {
94
95
  loadOnInit: !0,
95
96
  silent: !1,
96
97
  enabled: !0,
97
98
  nullStateBeforeLoad: !0,
98
99
  nullStateOnFail: !1
99
- }, ct = (e, r) => {
100
+ }, ut = (s, r) => {
100
101
  const t = V.c(26), {
101
- loadOnInit: n,
102
+ loadOnInit: e,
102
103
  enabled: o,
103
104
  silent: d,
104
- nullStateBeforeLoad: s,
105
- nullStateOnFail: i,
106
- customApiUrl: w,
105
+ nullStateBeforeLoad: n,
106
+ nullStateOnFail: l,
107
+ customApiUrl: S,
107
108
  customBearerToken: g,
108
- dataTransformer: S,
109
+ dataTransformer: h,
109
110
  errorBoundaryOn404: f
110
- } = r === void 0 ? T : r, h = n === void 0 ? T.loadOnInit : n, u = o === void 0 ? T.enabled : o, a = d === void 0 ? T.silent : d, c = s === void 0 ? T.nullStateBeforeLoad : s, v = i === void 0 ? T.nullStateOnFail : i;
111
- let p;
112
- t[0] !== f ? (p = f ? [404] : void 0, t[0] = f, t[1] = p) : p = t[1];
113
- let l;
114
- t[2] !== w || t[3] !== g || t[4] !== a || t[5] !== p ? (l = {
111
+ } = r === void 0 ? E : r, w = e === void 0 ? E.loadOnInit : e, i = o === void 0 ? E.enabled : o, a = d === void 0 ? E.silent : d, c = n === void 0 ? E.nullStateBeforeLoad : n, p = l === void 0 ? E.nullStateOnFail : l;
112
+ let v;
113
+ t[0] !== f ? (v = f ? [404] : void 0, t[0] = f, t[1] = v) : v = t[1];
114
+ let u;
115
+ t[2] !== S || t[3] !== g || t[4] !== a || t[5] !== v ? (u = {
115
116
  silent: a,
116
117
  customToken: g,
117
- differentBaseUrl: w,
118
- noToastOnStatus: p
119
- }, t[2] = w, t[3] = g, t[4] = a, t[5] = p, t[6] = l) : l = t[6];
120
- const O = q(l), {
121
- startLoading: b,
118
+ differentBaseUrl: S,
119
+ noToastOnStatus: v
120
+ }, t[2] = S, t[3] = g, t[4] = a, t[5] = v, t[6] = u) : u = t[6];
121
+ const y = _(u), {
122
+ startLoading: I,
122
123
  stopLoading: m
123
- } = z(Q), y = B(0), {
124
- isAuthenticated: L
125
- } = W(), [N, U] = _(null);
126
- let C;
127
- t[7] !== O || t[8] !== S || t[9] !== u || t[10] !== f || t[11] !== L || t[12] !== c || t[13] !== v || t[14] !== a || t[15] !== b || t[16] !== m || t[17] !== e ? (C = async (P, H) => {
128
- if (!L() || u === !1)
124
+ } = z(J), b = D(0), {
125
+ isAuthenticated: C
126
+ } = Q(), [N, U] = H(null);
127
+ let x;
128
+ t[7] !== y || t[8] !== h || t[9] !== i || t[10] !== f || t[11] !== C || t[12] !== c || t[13] !== p || t[14] !== a || t[15] !== I || t[16] !== m || t[17] !== s ? (x = async (P, K) => {
129
+ if (!C() || i === !1)
129
130
  return;
130
- !a && b(`loadData-${e}-${H}`), c && U(null);
131
- const J = O.get(e, {
131
+ !a && I(`loadData-${s}-${K}`), c && U(null);
132
+ const G = y.get(s, {
132
133
  signal: P
133
- }).then((K) => S ? S(K.data) : K.data).finally(() => !a && m(`loadData-${e}-${H}`));
134
- U(j(J, v ?? !1, f ?? !1));
135
- }, t[7] = O, t[8] = S, t[9] = u, t[10] = f, t[11] = L, t[12] = c, t[13] = v, t[14] = a, t[15] = b, t[16] = m, t[17] = e, t[18] = C) : C = t[18];
136
- const E = C;
137
- let D, x;
138
- t[19] !== E || t[20] !== h ? (x = () => {
139
- if (h === !1)
134
+ }).then((q) => h ? h(q.data) : q.data).finally(() => !a && m(`loadData-${s}-${K}`));
135
+ U(j(G, p ?? !1, f ?? !1));
136
+ }, t[7] = y, t[8] = h, t[9] = i, t[10] = f, t[11] = C, t[12] = c, t[13] = p, t[14] = a, t[15] = I, t[16] = m, t[17] = s, t[18] = x) : x = t[18];
137
+ const O = x;
138
+ let B, L;
139
+ t[19] !== O || t[20] !== w ? (L = () => {
140
+ if (w === !1)
140
141
  return;
141
142
  const P = new AbortController();
142
- return E(P.signal, y.current = y.current + 1), () => {
143
+ return O(P.signal, b.current = b.current + 1), () => {
143
144
  P.abort();
144
145
  };
145
- }, D = [E, h], t[19] = E, t[20] = h, t[21] = D, t[22] = x) : (D = t[21], x = t[22]), F(x, D);
146
+ }, B = [O, w], t[19] = O, t[20] = w, t[21] = B, t[22] = L) : (B = t[21], L = t[22]), F(L, B);
146
147
  let $;
147
- return t[23] !== N || t[24] !== E ? ($ = {
148
+ return t[23] !== N || t[24] !== O ? ($ = {
148
149
  data: N,
149
150
  setData: U,
150
- reloadData: E
151
- }, t[23] = N, t[24] = E, t[25] = $) : $ = t[25], $;
152
- }, dt = () => {
153
- const e = B({}).current;
151
+ reloadData: O
152
+ }, t[23] = N, t[24] = O, t[25] = $) : $ = t[25], $;
153
+ }, it = () => {
154
+ const s = D({}).current;
154
155
  return F(() => {
155
156
  const r = document.createElement("div");
156
- return r.style.position = "absolute", r.style.pointerEvents = "none", r.style.top = "0", r.style.width = "100%", r.style.height = "100%", e.elt = r, document.body.appendChild(r), () => {
157
+ return r.style.position = "absolute", r.style.pointerEvents = "none", r.style.top = "0", r.style.width = "100%", r.style.height = "100%", s.elt = r, document.body.appendChild(r), () => {
157
158
  document.body.removeChild(r);
158
159
  };
159
- }, [e]), (r) => (t, ...n) => {
160
- const o = r(t, ...n);
161
- return t.draggableProps.style.position === "fixed" ? M(o, e.elt) : o;
160
+ }, [s]), (r) => (t, ...e) => {
161
+ const o = r(t, ...e);
162
+ return t.draggableProps.style.position === "fixed" ? M(o, s.elt) : o;
162
163
  };
163
164
  }, A = {
164
165
  storageKey: "--tmp-scroll-save--",
165
166
  requiredHeight: 100,
166
167
  retryInterval: 50
167
- }, ft = (e, r) => {
168
+ }, ct = (s, r) => {
168
169
  const t = V.c(18), {
169
- storageKey: n,
170
+ storageKey: e,
170
171
  requiredHeight: o,
171
172
  retryInterval: d
172
- } = r === void 0 ? A : r, s = n === void 0 ? A.storageKey : n, i = o === void 0 ? A.requiredHeight : o, w = d === void 0 ? A.retryInterval : d, [g, S] = _(!1), f = B(null);
173
- let h;
174
- t[0] !== s ? (h = () => {
175
- const m = localStorage.getItem(s);
176
- return localStorage.removeItem(s), m === null ? null : Number(m);
177
- }, t[0] = s, t[1] = h) : h = t[1];
178
- const u = h;
173
+ } = r === void 0 ? A : r, n = e === void 0 ? A.storageKey : e, l = o === void 0 ? A.requiredHeight : o, S = d === void 0 ? A.retryInterval : d, [g, h] = H(!1), f = D(null);
174
+ let w;
175
+ t[0] !== n ? (w = () => {
176
+ const m = localStorage.getItem(n);
177
+ return localStorage.removeItem(n), m === null ? null : Number(m);
178
+ }, t[0] = n, t[1] = w) : w = t[1];
179
+ const i = w;
179
180
  let a;
180
- t[2] !== s ? (a = (m) => {
181
- localStorage.setItem(s, m);
182
- }, t[2] = s, t[3] = a) : a = t[3];
181
+ t[2] !== n ? (a = (m) => {
182
+ localStorage.setItem(n, m);
183
+ }, t[2] = n, t[3] = a) : a = t[3];
183
184
  const c = a;
184
- let v, p;
185
- t[4] !== g || t[5] !== i || t[6] !== u || t[7] !== w || t[8] !== e ? (v = () => {
185
+ let p, v;
186
+ t[4] !== g || t[5] !== l || t[6] !== i || t[7] !== S || t[8] !== s ? (p = () => {
186
187
  const m = window.setInterval(() => {
187
- if (!g && e.current !== null && e.current.getBoundingClientRect().height > i) {
188
- S(!0);
189
- const y = u();
190
- y !== null && e.current.scrollTo({
191
- top: y
188
+ if (!g && s.current !== null && s.current.getBoundingClientRect().height > l) {
189
+ h(!0);
190
+ const b = i();
191
+ b !== null && s.current.scrollTo({
192
+ top: b
192
193
  }), window.clearInterval(m);
193
194
  }
194
- }, w);
195
+ }, S);
195
196
  return () => {
196
197
  window.clearTimeout(m);
197
198
  };
198
- }, p = [g, i, u, w, e], t[4] = g, t[5] = i, t[6] = u, t[7] = w, t[8] = e, t[9] = v, t[10] = p) : (v = t[9], p = t[10]), F(v, p);
199
- let l, O;
200
- t[11] !== c || t[12] !== e ? (l = () => {
201
- var y;
199
+ }, v = [g, l, i, S, s], t[4] = g, t[5] = l, t[6] = i, t[7] = S, t[8] = s, t[9] = p, t[10] = v) : (p = t[9], v = t[10]), F(p, v);
200
+ let u, y;
201
+ t[11] !== c || t[12] !== s ? (u = () => {
202
+ var b;
202
203
  const m = new AbortController();
203
- return (y = e.current) == null || y.addEventListener("scrollend", () => {
204
- var L;
205
- f.current = ((L = e.current) == null ? void 0 : L.scrollTop) ?? 0, c((f.current ?? 0).toString());
204
+ return (b = s.current) == null || b.addEventListener("scrollend", () => {
205
+ var C;
206
+ f.current = ((C = s.current) == null ? void 0 : C.scrollTop) ?? 0, c((f.current ?? 0).toString());
206
207
  }, {
207
208
  signal: m.signal
208
209
  }), () => m.abort();
209
- }, O = [c, e], t[11] = c, t[12] = e, t[13] = l, t[14] = O) : (l = t[13], O = t[14]), F(l, O);
210
- let b;
211
- return t[15] !== u || t[16] !== c ? (b = {
210
+ }, y = [c, s], t[11] = c, t[12] = s, t[13] = u, t[14] = y) : (u = t[13], y = t[14]), F(u, y);
211
+ let I;
212
+ return t[15] !== i || t[16] !== c ? (I = {
212
213
  saveValue: c,
213
- retrieveValue: u
214
- }, t[15] = u, t[16] = c, t[17] = b) : b = t[17], b;
215
- }, mt = () => G(R, X);
216
- function R(e) {
217
- return window.addEventListener("online", e), window.addEventListener("offline", e), () => {
218
- window.removeEventListener("online", e), window.removeEventListener("offline", e);
219
- };
220
- }
221
- function X() {
222
- return window.navigator.onLine;
223
- }
214
+ retrieveValue: i
215
+ }, t[15] = i, t[16] = c, t[17] = I) : I = t[17], I;
216
+ };
224
217
  export {
225
- pt as cancelToken,
226
- W as useAuth,
227
- q as useAxios,
228
- wt as useClickOutside,
229
- St as useClipboard,
230
- ht as useConfirm,
231
- $t as useEmployeePhotoPath,
232
- Ot as useFormControlType,
218
+ mt as cancelToken,
219
+ Q as useAuth,
220
+ _ as useAxios,
221
+ gt as useClickOutside,
222
+ pt as useClipboard,
223
+ vt as useConfirm,
224
+ xt as useEmployeePhotoPath,
225
+ St as useFormControlType,
233
226
  Ct as useGetApiData,
234
- ct as useGetApiDataBound,
235
- lt as useGetDataBound,
236
- mt as useIsBrowserOnline,
237
- Pt as useIsFormDirty,
238
- bt as useKeyPress,
239
- Dt as useLocalStorageState,
240
- yt as useNotifications,
241
- Et as usePermissions,
242
- ut as usePersistentState,
227
+ ut as useGetApiDataBound,
228
+ at as useGetDataBound,
229
+ At as useIsBrowserOnline,
230
+ Bt as useIsFormDirty,
231
+ ht as useKeyPress,
232
+ Et as useLocalStorageState,
233
+ wt as useNotifications,
234
+ yt as usePermissions,
235
+ lt as usePersistentState,
243
236
  It as usePrompt,
244
- dt as useRenderDraggableInPortal,
245
- ft as useScrollSave,
246
- At as useSearchQuery,
247
- Ft as useSearchQueryState,
248
- Lt as useWindowSize,
249
- Tt as useZodSchemaTypes
237
+ it as useRenderDraggableInPortal,
238
+ ct as useScrollSave,
239
+ Lt as useSearchQuery,
240
+ $t as useSearchQueryState,
241
+ bt as useWindowSize,
242
+ Ot as useZodSchemaTypes
250
243
  };