react-luminus-components 1.3.31 → 1.3.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.
Files changed (133) hide show
  1. package/README.md +349 -355
  2. package/dist/.vite/manifest.json +64 -64
  3. package/dist/FromToDatePickerDropdownToggle-BcOIaLyQ.cjs +253 -0
  4. package/dist/{FromToDatePickerDropdownToggle-a6zb7EV7.js → FromToDatePickerDropdownToggle-CGnDN_zs.js} +2949 -3196
  5. package/dist/PrimaryButton-B6qFyVVD.js +680 -0
  6. package/dist/PrimaryButton-Dow_5lBe.cjs +1 -0
  7. package/dist/SimpleTooltip-B0I1MS-L.js +5 -0
  8. package/dist/{SimpleTooltip-ngcscCjg.cjs → SimpleTooltip-CpLiAgNs.cjs} +1 -1
  9. package/dist/components/Buttons/ContextButton/ContextButton.d.ts +0 -1
  10. package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +0 -1
  11. package/dist/components/Buttons/IconButton/IconButton.d.ts +0 -1
  12. package/dist/components/Buttons/PrimaryButton/PrimaryButton.d.ts +0 -1
  13. package/dist/components/Dropdown/Dropdown.d.ts +0 -1
  14. package/dist/components/Dropdown/comps/DropdownItem/DropdownItem.d.ts +0 -1
  15. package/dist/components/Dropdown/comps/DropdownItem/FileUploadDropdownItem.d.ts +0 -1
  16. package/dist/components/Dropdown/comps/DropdownToggle/DropdownToggle.d.ts +0 -1
  17. package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +3 -3
  18. package/dist/components/Form/CheckInput/CheckInput.d.ts +0 -1
  19. package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +0 -1
  20. package/dist/components/Form/NumericStepperInput/NumericStepperInput.d.ts +0 -1
  21. package/dist/components/Form/SelectInput/SelectInput.d.ts +0 -1
  22. package/dist/components/Form/TextAreaInput/TextAreaInput.d.ts +0 -1
  23. package/dist/components/Form/TextInput/TextInput.d.ts +0 -1
  24. package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +0 -1
  25. package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +0 -1
  26. package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +0 -1
  27. package/dist/components/HookForm/NumericStepperInput/HookFormNumericStepperInput.d.ts +0 -1
  28. package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +0 -1
  29. package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +0 -1
  30. package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +0 -1
  31. package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +0 -1
  32. package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +20 -21
  33. package/dist/components/InputContainers/InputAnchorContainer/InputAnchorContainer.d.ts +0 -1
  34. package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +20 -21
  35. package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +20 -21
  36. package/dist/components/Layout/MessageBoard/components/MessageList/MessageList.d.ts +0 -1
  37. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageFilters/MessageFilters.d.ts +0 -1
  38. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageItem/MessageItem.d.ts +0 -1
  39. package/dist/components/NewTabs/Tab/Tab.d.ts +5 -5
  40. package/dist/components/NewTabs/TabPanel/TabPanel.d.ts +0 -1
  41. package/dist/components/NewTabs/Tabs/Tabs.d.ts +7 -7
  42. package/dist/components/Tabs/Tabs.d.ts +0 -1
  43. package/dist/components/Tabs/comps/Tab/Tab.d.ts +0 -1
  44. package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +0 -1
  45. package/dist/components/common/Alert/Alert.d.ts +0 -1
  46. package/dist/components/common/AlertItem/AlertItem.d.ts +0 -1
  47. package/dist/components/common/AppSearch/AppSearch.d.ts +0 -1
  48. package/dist/components/common/AppSearch/comps/AutocompleteWindow/AutocompleteWindow.d.ts +0 -1
  49. package/dist/components/common/Backdrop/Backdrop.d.ts +0 -1
  50. package/dist/components/common/Badge/Badge.d.ts +0 -1
  51. package/dist/components/common/Card/Card.d.ts +0 -1
  52. package/dist/components/common/Collapse/Collapse.d.ts +0 -1
  53. package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +0 -1
  54. package/dist/components/common/FloatingActionContainer/FloatingActionContainer.d.ts +0 -1
  55. package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +0 -1
  56. package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +0 -1
  57. package/dist/components/common/HomeDashboard/comps/WidgetPicker/WidgetPicker.d.ts +0 -1
  58. package/dist/components/common/ImgApi/ImgApi.d.ts +0 -1
  59. package/dist/components/common/ImgApi/hooks/useGetImgData.d.ts +0 -1
  60. package/dist/components/common/ImgDirect/ImgDirect.d.ts +0 -1
  61. package/dist/components/common/InvalidFeedback/InvalidFeedback.d.ts +0 -1
  62. package/dist/components/common/Loading/Loading.d.ts +0 -1
  63. package/dist/components/common/MonthPicker/MonthPicker.d.ts +0 -1
  64. package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +0 -1
  65. package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +0 -1
  66. package/dist/components/common/PromptDialog/PromptDialog.d.ts +0 -1
  67. package/dist/components/common/Timeline/Timeline.d.ts +0 -1
  68. package/dist/components/common/Typography/Typography.d.ts +0 -1
  69. package/dist/components/common/VersionInfo/VersionInfo.d.ts +0 -1
  70. package/dist/components/common/YearPicker/YearPicker.d.ts +0 -1
  71. package/dist/contexts/auth/AuthContext.d.ts +0 -1
  72. package/dist/contexts/auth/AuthProvider.d.ts +0 -1
  73. package/dist/contexts/confirm/ConfirmContext.d.ts +0 -1
  74. package/dist/contexts/confirm/ConfirmProvider.d.ts +0 -1
  75. package/dist/contexts/delegation/DelegationProvider.d.ts +0 -1
  76. package/dist/contexts/loading/LoadingContext.d.ts +0 -1
  77. package/dist/contexts/loading/LoadingProvider.d.ts +0 -1
  78. package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +1 -15
  79. package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +2 -16
  80. package/dist/contexts/prompt/PromptContext.d.ts +0 -1
  81. package/dist/contexts/user/UserContext.d.ts +0 -1
  82. package/dist/contexts/user/UserProvider.d.ts +0 -1
  83. package/dist/contexts.cjs.js +1 -1
  84. package/dist/contexts.d.ts +10 -27
  85. package/dist/contexts.es.js +184 -337
  86. package/dist/{dateUtils-D5PdELhi.js → dateUtils-Bc53BdYm.js} +11 -21
  87. package/dist/{dateUtils-CIDS0n5B.cjs → dateUtils-Y_XPaYyg.cjs} +1 -1
  88. package/dist/hooks/useFormControlType/useFormControlType.d.ts +1 -1
  89. package/dist/hooks/useGetApiData/useGetApiData.d.ts +0 -1
  90. package/dist/hooks/useLocalStorageState/useLocalStorageState.d.ts +0 -1
  91. package/dist/hooks/useNotifications/useNotifications.d.ts +1 -1
  92. package/dist/hooks.cjs.js +1 -1
  93. package/dist/hooks.d.ts +3 -5
  94. package/dist/hooks.es.js +46 -44
  95. package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +0 -1
  96. package/dist/layout/MainContainer/MainContainer.d.ts +0 -1
  97. package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +0 -1
  98. package/dist/layout/SideMenu/SideMenu.d.ts +0 -1
  99. package/dist/layout/TopBar/TopBar.d.ts +0 -1
  100. package/dist/layout.cjs.js +1 -1
  101. package/dist/layout.d.ts +0 -2
  102. package/dist/layout.es.js +95 -96
  103. package/dist/main.cjs.js +1 -1
  104. package/dist/main.es.js +2062 -2455
  105. package/dist/models/prop-types/InputContainerProps.d.ts +0 -1
  106. package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +0 -1
  107. package/dist/models/prop-types/InputProps/TextInputProps.d.ts +0 -1
  108. package/dist/models/texts/ComponentsContextTexts.d.ts +18 -0
  109. package/dist/models/types/MenuItemType.d.ts +0 -1
  110. package/dist/models/types/PhotoAction.d.ts +0 -1
  111. package/dist/models/types/TimelineStep.d.ts +0 -1
  112. package/dist/{searchUtils-CEjMiULh.js → searchUtils-kismAHZM.js} +1 -1
  113. package/dist/{searchUtils-9_EWs2V9.cjs → searchUtils-qxu0IgEU.cjs} +1 -1
  114. package/dist/style.css +1 -1
  115. package/dist/{useFormControlType-oJGqgThz.js → useFormControlType-BAFqxupC.js} +3 -3
  116. package/dist/useLocalStorageState-BxKcArKF.cjs +1 -0
  117. package/dist/useLocalStorageState-HYmARj_B.js +76 -0
  118. package/dist/usePermissions-Dl5tlwwt.js +17 -0
  119. package/dist/usePermissions-yx-0zHae.cjs +1 -0
  120. package/dist/utils/bnfValueFormat/bnfValueFormat.d.ts +0 -1
  121. package/dist/utils.cjs.js +1 -1
  122. package/dist/utils.d.ts +0 -2
  123. package/dist/utils.es.js +55 -53
  124. package/dist/variables.scss +171 -171
  125. package/package.json +106 -106
  126. package/dist/FromToDatePickerDropdownToggle-EhHpHC9A.cjs +0 -253
  127. package/dist/PrimaryButton-BbKMePCv.js +0 -718
  128. package/dist/PrimaryButton-ugYzKlak.cjs +0 -1
  129. package/dist/SimpleTooltip-Boktzm98.js +0 -5
  130. package/dist/useLocalStorageState-CT8xepqa.cjs +0 -1
  131. package/dist/useLocalStorageState-DkeM8Y6R.js +0 -74
  132. package/dist/usePermissions-BkVAe1PL.cjs +0 -1
  133. package/dist/usePermissions-Dh1Sgbd7.js +0 -15
@@ -1,402 +1,249 @@
1
- import { j as a, aw as K, a3 as j, ax as M, ay as $, az as q, $ as O, _ as d, aA as V, aB as Q, aC as D, af as J, ao as F, aD as z, ap as W, ar as T, aq as X, aE as Y } from "./FromToDatePickerDropdownToggle-a6zb7EV7.js";
2
- import Z, { useState as h, useCallback as E, useMemo as C, useContext as y, useEffect as v, useRef as B, useReducer as ee } from "react";
1
+ import { j as n, al as R, U as L, am as U, an as z, ao as F, a5 as B, a9 as G, ap as O, aa as q, ac as S, ab as H, aq as V } from "./FromToDatePickerDropdownToggle-CGnDN_zs.js";
2
+ import { useState as h, useCallback as d, useMemo as g, useContext as j, useEffect as C, useRef as M } from "react";
3
+ import { EventType as b } from "@azure/msal-browser";
4
+ import { MsalProvider as J } from "@azure/msal-react";
3
5
  import "zod";
4
- import "react-hook-form";
5
6
  import "react-router-dom";
6
- import { u as te, a as se, b as ne, c as re } from "./useLocalStorageState-DkeM8Y6R.js";
7
- import { f as S, b as oe, P as w, L as ae, E as f } from "./PrimaryButton-BbKMePCv.js";
8
- import { m as ce } from "./dateUtils-D5PdELhi.js";
9
- const le = ({ children: e }) => {
10
- const [o, t] = h(!1), [n, s] = h(""), r = E((i) => {
11
- t(!0), s(i);
12
- }, []), c = E(() => {
13
- t(!1);
14
- }, []), l = C(() => ({ show: o, text: n, showConfirm: r, hideConfirm: c }), [o, n, r, c]);
15
- return /* @__PURE__ */ a.jsxs(K.Provider, { value: l, children: [
16
- /* @__PURE__ */ a.jsx(Ee, {}),
7
+ import "react-hook-form";
8
+ import { u as K, a as Q, b as $, c as W } from "./useLocalStorageState-HYmARj_B.js";
9
+ import { f as v, b as X, P as I, L as Y } from "./PrimaryButton-B6qFyVVD.js";
10
+ import { m as Z } from "./dateUtils-Bc53BdYm.js";
11
+ const ee = ({ children: e }) => {
12
+ const [r, a] = h(!1), [o, t] = h(""), s = d((u) => {
13
+ a(!0), t(u);
14
+ }, []), i = d(() => {
15
+ a(!1);
16
+ }, []), l = g(() => ({ show: r, text: o, showConfirm: s, hideConfirm: i }), [r, o, s, i]);
17
+ return /* @__PURE__ */ n.jsxs(R.Provider, { value: l, children: [
18
+ /* @__PURE__ */ n.jsx(ne, {}),
17
19
  e
18
20
  ] });
19
- }, ie = () => {
20
- const { confirmTexts: e } = y(j), { isShown: o, text: t, onFinish: n } = te(), { options: s } = y(M), [r, c] = h(s.defaultValue ?? ""), l = E(() => {
21
- n(null);
22
- }, [n]), i = E((u) => {
23
- u.preventDefault(), !(s.required && !r) && n(r);
24
- }, [n, s.required, r]);
25
- v(() => {
26
- o === !0 && c(s.defaultValue ?? "");
27
- }, [o, s.defaultValue]);
28
- const g = C(() => ({
29
- value: r,
30
- onChange: (u) => c(u.currentTarget.value),
21
+ }, te = () => {
22
+ const { texts: { confirm: e } } = j(L), { isShown: r, text: a, onFinish: o } = K(), { options: t } = j(U), [s, i] = h(t.defaultValue ?? ""), l = d(() => {
23
+ o(null);
24
+ }, [o]), u = d((m) => {
25
+ m.preventDefault(), !(t.required && !s) && o(s);
26
+ }, [o, t.required, s]);
27
+ C(() => {
28
+ r === !0 && i(t.defaultValue ?? "");
29
+ }, [r, t.defaultValue]);
30
+ const x = g(() => ({
31
+ value: s,
32
+ onChange: (m) => i(m.currentTarget.value),
31
33
  className: "w-100",
32
34
  autoFocus: !0,
33
35
  tabIndex: 0
34
- }), [r]);
35
- return /* @__PURE__ */ a.jsxs(S, { show: o, size: "sm", centered: !0, onHide: l, children: [
36
- /* @__PURE__ */ a.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ a.jsx(S.Title, { children: t }) }),
37
- /* @__PURE__ */ a.jsxs("form", { onSubmit: i, children: [
38
- /* @__PURE__ */ a.jsxs(S.Body, { children: [
39
- s.input === "textarea" ? /* @__PURE__ */ a.jsx("textarea", { ...g, rows: 5 }) : void 0,
40
- s.input === "input" ? /* @__PURE__ */ a.jsx(oe, { ...g, type: s.type }) : void 0
36
+ }), [s]);
37
+ return /* @__PURE__ */ n.jsxs(v, { show: r, size: "sm", centered: !0, onHide: l, children: [
38
+ /* @__PURE__ */ n.jsx(v.Header, { className: "justify-content-center", children: /* @__PURE__ */ n.jsx(v.Title, { children: a }) }),
39
+ /* @__PURE__ */ n.jsxs("form", { onSubmit: u, children: [
40
+ /* @__PURE__ */ n.jsxs(v.Body, { children: [
41
+ t.input === "textarea" ? /* @__PURE__ */ n.jsx("textarea", { ...x, rows: 5 }) : void 0,
42
+ t.input === "input" ? /* @__PURE__ */ n.jsx(X, { ...x, type: t.type }) : void 0
41
43
  ] }),
42
- /* @__PURE__ */ a.jsxs(S.Footer, { className: "w-100 d-flex gap-5", children: [
43
- /* @__PURE__ */ a.jsx(w, { variant: "outlined", color: "secondary", onClick: l, className: "flex-grow-1", children: e.cancel }),
44
- /* @__PURE__ */ a.jsx(w, { color: "primary", disabled: s.required && !r, type: "submit", className: "flex-grow-1", children: e.confirm })
44
+ /* @__PURE__ */ n.jsxs(v.Footer, { className: "w-100 d-flex gap-5", children: [
45
+ /* @__PURE__ */ n.jsx(I, { variant: "outlined", color: "secondary", onClick: l, className: "flex-grow-1", children: e.cancel }),
46
+ /* @__PURE__ */ n.jsx(I, { color: "primary", disabled: t.required && !s, type: "submit", className: "flex-grow-1", children: e.confirm })
45
47
  ] })
46
48
  ] })
47
49
  ] });
48
- }, ue = ({ children: e }) => {
49
- const [o, t] = h(!1), [n, s] = h(""), [r, c] = h({ input: "textarea", type: "text" }), l = B(() => {
50
- }), i = E((R) => {
51
- s(R), t(!0);
52
- }, []), g = E(() => {
53
- t(!1);
54
- }, []), u = C(() => ({
55
- isShown: o,
56
- text: n,
57
- showPrompt: i,
58
- hidePrompt: g,
50
+ }, se = ({ children: e }) => {
51
+ const [r, a] = h(!1), [o, t] = h(""), [s, i] = h({ input: "textarea", type: "text" }), l = M(() => {
52
+ }), u = d((N) => {
53
+ t(N), a(!0);
54
+ }, []), x = d(() => {
55
+ a(!1);
56
+ }, []), m = g(() => ({
57
+ isShown: r,
58
+ text: o,
59
+ showPrompt: u,
60
+ hidePrompt: x,
59
61
  resolveRef: l,
60
- options: r,
61
- setOptions: c
62
- }), [o, n, i, g, r]);
63
- return /* @__PURE__ */ a.jsxs(M.Provider, { value: u, children: [
62
+ options: s,
63
+ setOptions: i
64
+ }), [r, o, u, x, s]);
65
+ return /* @__PURE__ */ n.jsxs(U.Provider, { value: m, children: [
64
66
  e,
65
- /* @__PURE__ */ a.jsx(ie, {})
67
+ /* @__PURE__ */ n.jsx(te, {})
66
68
  ] });
67
- }, Le = ({ cookieDomain: e, axiosOptions: o, LinkComponent: t, NavigateComponent: n, language: s, axiosTexts: r, confirmTexts: c, formValidationTexts: l, homeDashboardTexts: i, formSubmitTexts: g, appSearchTexts: u, customSelectTexts: R, errorBoundaryTexts: A, widgetTexts: L, texts: I, ProjectIconComponent: _, localizationContext: p, children: P }) => {
68
- const N = C(() => ({
69
- axiosOptions: o,
69
+ }, fe = ({ cookieDomain: e, axiosOptions: r, language: a, texts: o, ProjectIconComponent: t, localizationContext: s, children: i }) => {
70
+ const l = g(() => ({
71
+ axiosOptions: r,
70
72
  cookieDomain: e,
71
- LinkComponent: t,
72
- NavigateComponent: n,
73
- language: s,
74
- axiosTexts: r,
75
- confirmTexts: c,
76
- formValidationTexts: l,
77
- homeDashboardTexts: i,
78
- formSubmitTexts: g,
79
- appSearchTexts: u,
80
- customSelectTexts: R,
81
- errorBoundaryTexts: A,
82
- widgetTexts: L,
83
- texts: I,
84
- ProjectIconComponent: _,
85
- localizationContext: p
86
- }), [
87
- o,
88
- e,
89
- t,
90
- n,
91
- s,
92
- r,
93
- c,
94
- l,
95
- i,
96
- g,
97
- u,
98
- R,
99
- A,
100
- L,
101
- _,
102
- p,
103
- I
104
- ]);
105
- return /* @__PURE__ */ a.jsx(j.Provider, { value: N, children: /* @__PURE__ */ a.jsx(le, { children: /* @__PURE__ */ a.jsxs(ue, { children: [
106
- /* @__PURE__ */ a.jsx($, {}),
107
- P
73
+ language: a,
74
+ texts: o,
75
+ ProjectIconComponent: t,
76
+ localizationContext: s
77
+ }), [r, e, a, t, s, o]);
78
+ return /* @__PURE__ */ n.jsx(L.Provider, { value: l, children: /* @__PURE__ */ n.jsx(ee, { children: /* @__PURE__ */ n.jsxs(se, { children: [
79
+ /* @__PURE__ */ n.jsx(z, {}),
80
+ i
108
81
  ] }) }) });
109
- }, Te = ({ children: e }) => {
110
- const [o, t] = h(!1), [n] = h(/* @__PURE__ */ new Set()), s = E((l) => {
111
- n.add(l), t(!0);
112
- }, [n]), r = E((l) => {
113
- n.delete(l), n.size === 0 && t(!1);
114
- }, [n]), c = C(() => ({ isLoading: o, startLoading: s, stopLoading: r }), [o, s, r]);
115
- return /* @__PURE__ */ a.jsxs(q.Provider, { value: c, children: [
116
- o && /* @__PURE__ */ a.jsx(ae, {}),
82
+ }, he = ({ children: e }) => {
83
+ const [r, a] = h(!1), [o] = h(/* @__PURE__ */ new Set()), t = d((l) => {
84
+ o.add(l), a(!0);
85
+ }, [o]), s = d((l) => {
86
+ o.delete(l), o.size === 0 && a(!1);
87
+ }, [o]), i = g(() => ({ isLoading: r, startLoading: t, stopLoading: s }), [r, t, s]);
88
+ return /* @__PURE__ */ n.jsxs(F.Provider, { value: i, children: [
89
+ r && /* @__PURE__ */ n.jsx(Y, {}),
117
90
  e
118
91
  ] });
119
- };
120
- /*! @azure/msal-browser v3.14.0 2024-05-07 */
121
- class de {
122
- /**
123
- * Gets interaction status from event message
124
- * @param message
125
- * @param currentStatus
126
- */
127
- static getInteractionStatusFromEvent(o, t) {
128
- switch (o.eventType) {
129
- case f.LOGIN_START:
130
- return d.Login;
131
- case f.SSO_SILENT_START:
132
- return d.SsoSilent;
133
- case f.ACQUIRE_TOKEN_START:
134
- if (o.interactionType === O.Redirect || o.interactionType === O.Popup)
135
- return d.AcquireToken;
136
- break;
137
- case f.HANDLE_REDIRECT_START:
138
- return d.HandleRedirect;
139
- case f.LOGOUT_START:
140
- return d.Logout;
141
- case f.SSO_SILENT_SUCCESS:
142
- case f.SSO_SILENT_FAILURE:
143
- if (t && t !== d.SsoSilent)
144
- break;
145
- return d.None;
146
- case f.LOGOUT_END:
147
- if (t && t !== d.Logout)
148
- break;
149
- return d.None;
150
- case f.HANDLE_REDIRECT_END:
151
- if (t && t !== d.HandleRedirect)
152
- break;
153
- return d.None;
154
- case f.LOGIN_SUCCESS:
155
- case f.LOGIN_FAILURE:
156
- case f.ACQUIRE_TOKEN_SUCCESS:
157
- case f.ACQUIRE_TOKEN_FAILURE:
158
- case f.RESTORE_FROM_BFCACHE:
159
- if (o.interactionType === O.Redirect || o.interactionType === O.Popup) {
160
- if (t && t !== d.Login && t !== d.AcquireToken)
161
- break;
162
- return d.None;
163
- }
164
- break;
165
- }
166
- return null;
167
- }
168
- }
169
- /*! @azure/msal-react v2.0.16 2024-05-07 */
170
- const fe = "@azure/msal-react", G = "2.0.16";
171
- /*! @azure/msal-react v2.0.16 2024-05-07 */
172
- const b = {
173
- UNBLOCK_INPROGRESS: "UNBLOCK_INPROGRESS",
174
- EVENT: "EVENT"
175
- }, me = (e, o) => {
176
- const { type: t, payload: n } = o;
177
- let s = e.inProgress;
178
- switch (t) {
179
- case b.UNBLOCK_INPROGRESS:
180
- e.inProgress === d.Startup && (s = d.None, n.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
181
- break;
182
- case b.EVENT:
183
- const c = n.message, l = de.getInteractionStatusFromEvent(c, e.inProgress);
184
- l && (n.logger.info(`MsalProvider - ${c.eventType} results in setting inProgress from ${e.inProgress} to ${l}`), s = l);
185
- break;
186
- default:
187
- throw new Error(`Unknown action type: ${t}`);
188
- }
189
- const r = n.instance.getAllAccounts();
190
- return s !== e.inProgress && !D(r, e.accounts) ? {
191
- ...e,
192
- inProgress: s,
193
- accounts: r
194
- } : s !== e.inProgress ? {
195
- ...e,
196
- inProgress: s
197
- } : D(r, e.accounts) ? e : {
198
- ...e,
199
- accounts: r
200
- };
201
- };
202
- function ge({ instance: e, children: o }) {
203
- v(() => {
204
- e.initializeWrapperLibrary(V.React, G);
205
- }, [e]);
206
- const t = C(() => e.getLogger().clone(fe, G), [e]), [n, s] = ee(me, void 0, () => ({
207
- inProgress: d.Startup,
208
- accounts: e.getAllAccounts()
209
- }));
210
- v(() => {
211
- const c = e.addEventCallback((l) => {
212
- s({
213
- payload: {
214
- instance: e,
215
- logger: t,
216
- message: l
217
- },
218
- type: b.EVENT
219
- });
220
- });
221
- return t.verbose(`MsalProvider - Registered event callback with id: ${c}`), e.initialize().then(() => {
222
- e.handleRedirectPromise().catch(() => {
223
- }).finally(() => {
224
- s({
225
- payload: {
226
- instance: e,
227
- logger: t
228
- },
229
- type: b.UNBLOCK_INPROGRESS
230
- });
231
- });
232
- }).catch(() => {
233
- }), () => {
234
- c && (t.verbose(`MsalProvider - Removing event callback ${c}`), e.removeEventCallback(c));
235
- };
236
- }, [e, t]);
237
- const r = {
238
- instance: e,
239
- inProgress: n.inProgress,
240
- accounts: n.accounts,
241
- logger: t
242
- };
243
- return Z.createElement(Q.Provider, { value: r }, o);
244
- }
245
- const ye = ({ children: e }) => {
246
- const o = J(), { msalInstance: t } = y(F), { delegation: n, setDelegation: s, setAvailableDelegations: r, refreshAvailableDelegations: c } = y(z), { getToken: l } = W(), [i, g] = h(null), u = E(async () => {
247
- const m = await l();
248
- m && g(m);
92
+ }, ve = ({ children: e }) => {
93
+ const r = B(), { msalInstance: a } = j(G), { delegation: o, setDelegation: t, setAvailableDelegations: s, refreshAvailableDelegations: i } = j(O), { getToken: l } = q(), [u, x] = h(null), m = d(async () => {
94
+ const c = await l();
95
+ c && x(c);
249
96
  }, [l]);
250
- v(() => {
251
- u();
252
- }, [u]);
253
- const A = E(() => {
254
- const m = localStorage.getItem("user") ?? null;
255
- return m ? JSON.parse(m ?? "") : null;
256
- }, [])(), [L, I] = h({
257
- state: A ? T.LOGGED_IN : T.LOGGING_IN,
258
- user: A
259
- }), _ = E(async (m) => {
260
- let x = null;
261
- return await o.get("/user/detail", m ? { headers: { Authorization: `Bearer ${m}` } } : void 0).then((k) => {
262
- x = k.data;
97
+ C(() => {
98
+ m();
99
+ }, [m]);
100
+ const D = d(() => {
101
+ const c = localStorage.getItem("user") ?? null;
102
+ return c ? JSON.parse(c ?? "") : null;
103
+ }, [])(), [P, y] = h({
104
+ state: D ? S.LOGGED_IN : S.LOGGING_IN,
105
+ user: D
106
+ }), k = d(async (c) => {
107
+ let f = null;
108
+ return await r.get("/user/detail", c ? { headers: { Authorization: `Bearer ${c}` } } : void 0).then((T) => {
109
+ f = T.data;
263
110
  }).catch(() => {
264
- x = null;
265
- }), x;
266
- }, [o]), p = E(() => {
267
- localStorage.removeItem("user"), I({
268
- state: T.LOGGED_OUT,
111
+ f = null;
112
+ }), f;
113
+ }, [r]), A = d(() => {
114
+ localStorage.removeItem("user"), y({
115
+ state: S.LOGGED_OUT,
269
116
  user: null
270
- }), s(null), r(null);
271
- }, [r, s]), P = E(async (m) => {
272
- I({
273
- state: T.LOGGING_IN,
117
+ }), t(null), s(null);
118
+ }, [s, t]), w = d(async (c) => {
119
+ y({
120
+ state: S.LOGGING_IN,
274
121
  user: null
275
122
  });
276
- const x = await _(m);
277
- return x ? (I({
278
- state: T.LOGGED_IN,
279
- user: x
280
- }), localStorage.setItem("user", JSON.stringify(x)), await c(), !0) : (I({
281
- state: T.LOGIN_FAILED,
123
+ const f = await k(c);
124
+ return f ? (y({
125
+ state: S.LOGGED_IN,
126
+ user: f
127
+ }), localStorage.setItem("user", JSON.stringify(f)), await i(), !0) : (y({
128
+ state: S.LOGIN_FAILED,
282
129
  user: null
283
130
  }), !1);
284
- }, [_, c]), N = E(() => {
285
- p();
286
- }, [p]);
287
- v(() => {
288
- if (t) {
289
- const m = t.addEventCallback((x) => {
290
- if (x.eventType === f.LOGIN_SUCCESS && x.payload) {
291
- const k = x.payload;
292
- g(k.accessToken);
131
+ }, [k, i]), p = d(() => {
132
+ A();
133
+ }, [A]);
134
+ C(() => {
135
+ if (a) {
136
+ const c = a.addEventCallback((f) => {
137
+ if (f.eventType === b.LOGIN_SUCCESS && f.payload) {
138
+ const T = f.payload;
139
+ x(T.accessToken);
293
140
  }
294
141
  });
295
142
  return () => {
296
- m && t.removeEventCallback(m);
143
+ c && a.removeEventCallback(c);
297
144
  };
298
145
  }
299
146
  return () => {
300
147
  };
301
- }, [t, P, N]);
302
- const U = E(async (m) => {
303
- m && await P(m).catch(() => {
304
- N(), s(null);
148
+ }, [a, w, p]);
149
+ const E = d(async (c) => {
150
+ c && await w(c).catch(() => {
151
+ p(), t(null);
305
152
  });
306
- }, [P, N, s]);
307
- v(() => {
308
- U(i);
309
- }, [i, n == null ? void 0 : n.id, U]);
310
- const H = C(() => ({
311
- user: L.user,
312
- userLoginState: L,
313
- loginUser: P,
314
- logoutUser: N
315
- }), [L, P, N]);
316
- return /* @__PURE__ */ a.jsx(X.Provider, { value: H, children: e });
317
- }, Re = ({ ...e }) => {
318
- const { cookieDomain: o } = y(j), [, t] = Y(["Authorization"]), n = C(() => ({
153
+ }, [w, p, t]);
154
+ C(() => {
155
+ E(u);
156
+ }, [u, o == null ? void 0 : o.id, E]);
157
+ const _ = g(() => ({
158
+ user: P.user,
159
+ userLoginState: P,
160
+ loginUser: w,
161
+ logoutUser: p
162
+ }), [P, w, p]);
163
+ return /* @__PURE__ */ n.jsx(H.Provider, { value: _, children: e });
164
+ }, ge = ({ ...e }) => {
165
+ const { cookieDomain: r } = j(L), [, a] = V(["Authorization"]), o = g(() => ({
319
166
  useMsal: e.useMsal ?? !1,
320
167
  msalInstance: e.useMsal ? e.msalInstance ?? null : null,
321
168
  msalScopes: e.useMsal ? e.msalScopes ?? [] : []
322
169
  }), [e]);
323
- return v(() => {
170
+ return C(() => {
324
171
  if (e.useMsal) {
325
- const s = e.msalInstance.addEventCallback((r) => {
326
- if (r.eventType === f.LOGIN_SUCCESS || r.eventType === f.ACQUIRE_TOKEN_SUCCESS && r.payload) {
327
- const c = r.payload, l = c.account;
172
+ const t = e.msalInstance.addEventCallback((s) => {
173
+ if (s.eventType === b.LOGIN_SUCCESS || s.eventType === b.ACQUIRE_TOKEN_SUCCESS && s.payload) {
174
+ const i = s.payload, l = i.account;
328
175
  e.msalInstance.setActiveAccount(l);
329
- const i = c.accessToken, g = c.expiresOn;
330
- t("Authorization", i, {
176
+ const u = i.accessToken, x = i.expiresOn;
177
+ a("Authorization", u, {
331
178
  path: "/",
332
179
  secure: !0,
333
180
  sameSite: "none",
334
- domain: o,
335
- expires: g ?? void 0
181
+ domain: r,
182
+ expires: x ?? void 0
336
183
  });
337
184
  }
338
- r.error && console.error("AuthProvider MSAL Error", r);
185
+ s.error && console.error("AuthProvider MSAL Error", s);
339
186
  });
340
187
  return () => {
341
- s && e.msalInstance.removeEventCallback(s);
188
+ t && e.msalInstance.removeEventCallback(t);
342
189
  };
343
190
  }
344
191
  return () => {
345
192
  };
346
- }, [e, t, o]), /* @__PURE__ */ a.jsx(F.Provider, { value: n, children: e.useMsal ? /* @__PURE__ */ a.jsx(ge, { instance: e.msalInstance, children: e.children }) : e.children });
347
- }, Ae = ({ children: e, relativeEndpoint: o }) => {
348
- const [t, n, s] = se("user-delegation", null), { data: r, setData: c, reloadData: l } = ne(o, {
193
+ }, [e, a, r]), /* @__PURE__ */ n.jsx(G.Provider, { value: o, children: e.useMsal ? /* @__PURE__ */ n.jsx(J, { instance: e.msalInstance, children: e.children }) : e.children });
194
+ }, Ce = ({ children: e, relativeEndpoint: r }) => {
195
+ const [a, o, t] = Q("user-delegation", null), { data: s, setData: i, reloadData: l } = $(r, {
349
196
  nullStateBeforeLoad: !1,
350
197
  nullStateOnFail: !0
351
- }), i = B(null);
352
- v(() => {
353
- const u = () => {
354
- l(), i.current = window.setTimeout(u, ce() + 5e3);
198
+ }), u = M(null);
199
+ C(() => {
200
+ const m = () => {
201
+ l(), u.current = window.setTimeout(m, Z() + 5e3);
355
202
  };
356
- return u(), () => {
357
- i.current !== null && window.clearTimeout(i.current);
203
+ return m(), () => {
204
+ u.current !== null && window.clearTimeout(u.current);
358
205
  };
359
- }, [l]), v(() => {
360
- const u = () => {
361
- s();
206
+ }, [l]), C(() => {
207
+ const m = () => {
208
+ t();
362
209
  };
363
- return window.addEventListener("focus", u), () => {
364
- window.removeEventListener("focus", u);
210
+ return window.addEventListener("focus", m), () => {
211
+ window.removeEventListener("focus", m);
365
212
  };
366
- }, [s, l]);
367
- const g = C(() => ({
368
- delegation: t,
369
- setDelegation: n,
370
- availableDelegations: r,
371
- setAvailableDelegations: c,
213
+ }, [t, l]);
214
+ const x = g(() => ({
215
+ delegation: a,
216
+ setDelegation: o,
217
+ availableDelegations: s,
218
+ setAvailableDelegations: i,
372
219
  refreshAvailableDelegations: l
373
220
  }), [
374
- t,
375
- n,
376
- r,
377
- c,
221
+ a,
222
+ o,
223
+ s,
224
+ i,
378
225
  l
379
226
  ]);
380
- return /* @__PURE__ */ a.jsx(z.Provider, { value: g, children: e });
381
- }, Ee = () => {
382
- const { confirmTexts: e } = y(j), { onConfirm: o, onCancel: t, text: n, show: s } = re();
383
- return /* @__PURE__ */ a.jsxs(S, { show: s, size: "sm", centered: !0, onHide: t, children: [
384
- /* @__PURE__ */ a.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ a.jsx(S.Title, { children: n }) }),
385
- /* @__PURE__ */ a.jsx(S.Body, { children: /* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
386
- /* @__PURE__ */ a.jsx(w, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: t, children: e.no }),
387
- /* @__PURE__ */ a.jsx(w, { type: "button", color: "primary", onClick: o, className: "w-100 ml", children: e.yes })
227
+ return /* @__PURE__ */ n.jsx(O.Provider, { value: x, children: e });
228
+ }, ne = () => {
229
+ const { texts: { confirm: e } } = j(L), { onConfirm: r, onCancel: a, text: o, show: t } = W();
230
+ return /* @__PURE__ */ n.jsxs(v, { show: t, size: "sm", centered: !0, onHide: a, children: [
231
+ /* @__PURE__ */ n.jsx(v.Header, { className: "justify-content-center", children: /* @__PURE__ */ n.jsx(v.Title, { children: o }) }),
232
+ /* @__PURE__ */ n.jsx(v.Body, { children: /* @__PURE__ */ n.jsxs("div", { className: "w-100 d-flex gap-5", children: [
233
+ /* @__PURE__ */ n.jsx(I, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: a, children: e.no }),
234
+ /* @__PURE__ */ n.jsx(I, { type: "button", color: "primary", onClick: r, className: "w-100 ml", children: e.yes })
388
235
  ] }) })
389
236
  ] });
390
237
  };
391
238
  export {
392
- F as AuthContext,
393
- Re as AuthProvider,
394
- z as DelegationContext,
395
- Ae as DelegationProvider,
396
- q as LoadingContext,
397
- Te as LoadingProvider,
398
- j as LuminusComponentsContext,
399
- Le as LuminusComponentsProvider,
400
- X as UserContext,
401
- ye as UserProvider
239
+ G as AuthContext,
240
+ ge as AuthProvider,
241
+ O as DelegationContext,
242
+ Ce as DelegationProvider,
243
+ F as LoadingContext,
244
+ he as LoadingProvider,
245
+ L as LuminusComponentsContext,
246
+ fe as LuminusComponentsProvider,
247
+ H as UserContext,
248
+ ve as UserProvider
402
249
  };