react-luminus-components 1.3.33 → 1.3.34

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 (165) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +64 -64
  3. package/dist/{FromToDatePickerDropdownToggle-BcOIaLyQ.cjs → FromToDatePickerDropdownToggle-DhzBIJXw.cjs} +1 -1
  4. package/dist/{FromToDatePickerDropdownToggle-CGnDN_zs.js → FromToDatePickerDropdownToggle-Dk7MFcJp.js} +59 -59
  5. package/dist/{PrimaryButton-B6qFyVVD.js → PrimaryButton-Bbl06m-g.js} +1 -1
  6. package/dist/{PrimaryButton-Dow_5lBe.cjs → PrimaryButton-D33g-RWP.cjs} +1 -1
  7. package/dist/{SimpleTooltip-CpLiAgNs.cjs → SimpleTooltip-Bz22xxXa.cjs} +1 -1
  8. package/dist/{SimpleTooltip-B0I1MS-L.js → SimpleTooltip-C32Faxrc.js} +1 -1
  9. package/dist/components/BnfTableValueFormats/UserAvatarValueFormat/UserAvatarValueFormat.d.ts +2 -1
  10. package/dist/components/Buttons/FloatingSubmit/FloatingFormSubmit.d.ts +1 -0
  11. package/dist/components/Dropdown/Dropdown.d.ts +1 -0
  12. package/dist/components/Dropdown/comps/DropdownDivider/DropdownDivider.d.ts +2 -1
  13. package/dist/components/Dropdown/comps/DropdownToggle/DropdownToggle.d.ts +1 -0
  14. package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +2 -1
  15. package/dist/components/Dropdown/comps/UserAvatarToggle/UserAvatarToggle.d.ts +2 -1
  16. package/dist/components/Form/CheckInput/CheckInput.d.ts +2 -1
  17. package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +2 -1
  18. package/dist/components/Form/NumericStepperInput/NumericStepperInput.d.ts +2 -1
  19. package/dist/components/Form/SelectInput/SelectInput.d.ts +2 -1
  20. package/dist/components/Form/TextAreaInput/TextAreaInput.d.ts +2 -1
  21. package/dist/components/Form/TextInput/TextInput.d.ts +2 -1
  22. package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +2 -1
  23. package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +2 -1
  24. package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +3 -2
  25. package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +2 -1
  26. package/dist/components/HookForm/FloatingSubmit/HookFormFloatingSubmit.d.ts +1 -0
  27. package/dist/components/HookForm/NumericStepperInput/HookFormNumericStepperInput.d.ts +2 -1
  28. package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +2 -1
  29. package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +2 -1
  30. package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +2 -1
  31. package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +2 -1
  32. package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +2 -2
  33. package/dist/components/InputContainers/InputAnchorContainer/InputAnchorContainer.d.ts +2 -1
  34. package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +2 -2
  35. package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +2 -2
  36. package/dist/components/Layout/MessageBoard/MessageBoard.d.ts +2 -1
  37. package/dist/components/Layout/MessageBoard/components/MessageList/MessageList.d.ts +2 -1
  38. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageItem/MessageItem.d.ts +2 -1
  39. package/dist/components/NewTabs/Tab/Tab.d.ts +1 -0
  40. package/dist/components/NewTabs/Tabs/Tabs.d.ts +2 -1
  41. package/dist/components/Tabs/Tabs.d.ts +1 -0
  42. package/dist/components/Tabs/comps/Tab/Tab.d.ts +1 -0
  43. package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +1 -0
  44. package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +1 -0
  45. package/dist/components/common/Alert/Alert.d.ts +1 -0
  46. package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +2 -1
  47. package/dist/components/common/AppSearch/AppSearch.d.ts +2 -1
  48. package/dist/components/common/AppSearch/comps/AutocompleteWindow/AutocompleteWindow.d.ts +2 -1
  49. package/dist/components/common/AppSearch/comps/TypeSelector/TypeSelector.d.ts +3 -2
  50. package/dist/components/common/AppSearch/hooks/useSearchItems.d.ts +2 -1
  51. package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +2 -1
  52. package/dist/components/common/ErrorBoundary/ErrorBoundary.d.ts +2 -1
  53. package/dist/components/common/FromToDatePicker/FromToDatePicker.d.ts +3 -2
  54. package/dist/components/common/FromToDatePicker/components/FromToDatePickerDropdownToggle/FromToDatePickerDropdownToggle.d.ts +2 -1
  55. package/dist/components/common/FromToDatePicker/hooks/useFromToDatePicker.d.ts +2 -1
  56. package/dist/components/common/FromToDatePicker/utils/utilsFromToDatePicker.d.ts +1 -0
  57. package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +3 -2
  58. package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +2 -1
  59. package/dist/components/common/HomeDashboard/comps/WidgetPicker/WidgetPicker.d.ts +2 -1
  60. package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +2 -1
  61. package/dist/components/common/ImgApi/ImgApi.d.ts +2 -1
  62. package/dist/components/common/ImgApi/hooks/useGetImgData.d.ts +2 -1
  63. package/dist/components/common/ImgDirect/ImgDirect.d.ts +2 -1
  64. package/dist/components/common/Loading/LoadingBlock.d.ts +1 -0
  65. package/dist/components/common/MonthPicker/MonthPicker.d.ts +1 -0
  66. package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +2 -1
  67. package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +2 -1
  68. package/dist/components/common/SimplePicker/SimplePicker.d.ts +2 -1
  69. package/dist/components/common/Timeline/Timeline.d.ts +2 -1
  70. package/dist/components/common/Widget/WidgetCard.d.ts +1 -0
  71. package/dist/components/common/Widget/WidgetWrapper.d.ts +1 -0
  72. package/dist/contexts/auth/AuthContext.d.ts +3 -2
  73. package/dist/contexts/auth/AuthProvider.d.ts +2 -1
  74. package/dist/contexts/confirm/ConfirmContext.d.ts +1 -1
  75. package/dist/contexts/delegation/DelegationContext.d.ts +3 -2
  76. package/dist/contexts/loading/LoadingContext.d.ts +1 -1
  77. package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +3 -2
  78. package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +3 -2
  79. package/dist/contexts/prompt/PromptContext.d.ts +3 -2
  80. package/dist/contexts/prompt/PromptProvider.d.ts +1 -0
  81. package/dist/contexts/user/UserContext.d.ts +4 -3
  82. package/dist/contexts.cjs.js +1 -1
  83. package/dist/contexts.d.ts +1 -240
  84. package/dist/contexts.es.js +9 -9
  85. package/dist/{dateUtils-Bc53BdYm.js → dateUtils-B9-rf1Eh.js} +1 -1
  86. package/dist/{dateUtils-Y_XPaYyg.cjs → dateUtils-Bs39Qj7k.cjs} +1 -1
  87. package/dist/hooks/useAxios/useAxios.d.ts +2 -1
  88. package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -0
  89. package/dist/hooks/useGetApiData/useGetApiData.d.ts +3 -2
  90. package/dist/hooks/useLocalStorageState/useLocalStorageState.d.ts +1 -1
  91. package/dist/hooks/usePrompt/usePrompt.d.ts +2 -1
  92. package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +2 -1
  93. package/dist/hooks.cjs.js +1 -1
  94. package/dist/hooks.d.ts +1 -160
  95. package/dist/hooks.es.js +6 -6
  96. package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +2 -1
  97. package/dist/layout/MainContainer/MainContainer.d.ts +2 -1
  98. package/dist/layout/PageTitle/PageTitle.d.ts +1 -0
  99. package/dist/layout/SideContentBar/SideContentBar.d.ts +1 -0
  100. package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +2 -1
  101. package/dist/layout/SideMenu/SideMenu.d.ts +2 -1
  102. package/dist/layout.cjs.js +1 -1
  103. package/dist/layout.d.ts +1 -54
  104. package/dist/layout.es.js +3 -3
  105. package/dist/main.cjs.js +1 -1
  106. package/dist/main.d.ts +1 -1
  107. package/dist/main.es.js +1467 -1467
  108. package/dist/models/luminus-context-types/ILocalizationContext.d.ts +1 -0
  109. package/dist/models/prop-types/ContainerProps.d.ts +1 -0
  110. package/dist/models/prop-types/DashboardWidgetCommonProps.d.ts +1 -0
  111. package/dist/models/prop-types/FormInputProps/FormCheckInputProps.d.ts +2 -1
  112. package/dist/models/prop-types/FormInputProps/FormFileInputProps.d.ts +2 -1
  113. package/dist/models/prop-types/FormInputProps/FormNumericStepperInputProps.d.ts +2 -1
  114. package/dist/models/prop-types/FormInputProps/FormRadioInputProps.d.ts +2 -1
  115. package/dist/models/prop-types/FormInputProps/FormSelectInputProps.d.ts +2 -1
  116. package/dist/models/prop-types/FormInputProps/FormTextAreaInputProps.d.ts +2 -1
  117. package/dist/models/prop-types/FormInputProps/FormTextInputProps.d.ts +2 -1
  118. package/dist/models/prop-types/HookFormInputProps/HookFormCheckInputProps.d.ts +3 -2
  119. package/dist/models/prop-types/HookFormInputProps/HookFormDropdownPickerProps.d.ts +3 -2
  120. package/dist/models/prop-types/HookFormInputProps/HookFormFileInputProps.d.ts +3 -2
  121. package/dist/models/prop-types/HookFormInputProps/HookFormInputBaseProps.d.ts +2 -1
  122. package/dist/models/prop-types/HookFormInputProps/HookFormInputProps.d.ts +2 -1
  123. package/dist/models/prop-types/HookFormInputProps/HookFormNumericStepperInputProps.d.ts +3 -2
  124. package/dist/models/prop-types/HookFormInputProps/HookFormRadioInputProps.d.ts +3 -2
  125. package/dist/models/prop-types/HookFormInputProps/HookFormSelectInputProps.d.ts +3 -2
  126. package/dist/models/prop-types/HookFormInputProps/HookFormTextAreaInputProps.d.ts +3 -2
  127. package/dist/models/prop-types/HookFormInputProps/HookFormTextInputProps.d.ts +3 -2
  128. package/dist/models/prop-types/ImgProps.d.ts +1 -0
  129. package/dist/models/prop-types/InputProps/CheckInputProps.d.ts +2 -1
  130. package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +5 -4
  131. package/dist/models/prop-types/InputProps/FileInputProps.d.ts +2 -1
  132. package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +2 -1
  133. package/dist/models/prop-types/InputProps/NumericInputProps.d.ts +2 -1
  134. package/dist/models/prop-types/InputProps/RadioInputProps.d.ts +3 -2
  135. package/dist/models/prop-types/InputProps/SelectInputProps.d.ts +3 -2
  136. package/dist/models/prop-types/InputProps/TextAreaInputProps.d.ts +2 -1
  137. package/dist/models/prop-types/InputProps/TextInputProps.d.ts +2 -1
  138. package/dist/models/texts/ComponentsContextTexts.d.ts +12 -11
  139. package/dist/models/texts/ErrorBoundaryTexts.d.ts +1 -0
  140. package/dist/models/types/ApiErrorResult.d.ts +2 -1
  141. package/dist/models/types/DashboardConfig.d.ts +2 -1
  142. package/dist/models/types/DashboardWidget.d.ts +2 -1
  143. package/dist/models/types/DropdownPickerOption.d.ts +2 -1
  144. package/dist/models/types/HookFormInputProps.d.ts +2 -1
  145. package/dist/models/types/MenuItemTypeExtended.d.ts +2 -1
  146. package/dist/models/types/SearchResultGroupModel.d.ts +3 -2
  147. package/dist/models/types/SearchResultModel.d.ts +2 -1
  148. package/dist/models/types/TimelineStep.d.ts +2 -1
  149. package/dist/models/types/UserLoginState.d.ts +3 -2
  150. package/dist/models/types/UserModel.d.ts +2 -1
  151. package/dist/{searchUtils-kismAHZM.js → searchUtils-BCxOKHVq.js} +1 -1
  152. package/dist/{searchUtils-qxu0IgEU.cjs → searchUtils-CxNriHg_.cjs} +1 -1
  153. package/dist/style.css +1 -1
  154. package/dist/{useFormControlType-BAFqxupC.js → useFormControlType-oJGqgThz.js} +3 -3
  155. package/dist/{useLocalStorageState-BxKcArKF.cjs → useLocalStorageState-3ebV2Hf5.cjs} +1 -1
  156. package/dist/{useLocalStorageState-HYmARj_B.js → useLocalStorageState-Cs1tOpr1.js} +1 -1
  157. package/dist/{usePermissions-yx-0zHae.cjs → usePermissions-BZPN1OT2.cjs} +1 -1
  158. package/dist/{usePermissions-Dl5tlwwt.js → usePermissions-CfJgVLTi.js} +3 -3
  159. package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +2 -1
  160. package/dist/utils/hookForm/hookFormUtils.d.ts +2 -1
  161. package/dist/utils.cjs.js +1 -1
  162. package/dist/utils.d.ts +1 -151
  163. package/dist/utils.es.js +6 -6
  164. package/dist/variables.scss +171 -171
  165. package/package.json +106 -106
package/dist/main.es.js CHANGED
@@ -1,18 +1,18 @@
1
- import { j as r, c as g, t as Z, a as Se, m as Pr, b as Vr, d as zr, s as Yr, e as Gr, f as Ur, g as Kr, h as qr, i as Qr, k as Jr, l as Xr, T as cn, n as dn, o as St, E as Zr, p as un, q as dt, r as fn, u as es, v as A, w as ue, x as pn, F as st, y as ts, z as ns, A as rs, B as ss, C as os, D as as, G as ls, H as cs, I as ut, J as hn, K as mn, L as is, M as $e, N as ds, O as us, P as Ne, Q as fs, R as Ke, S as Y, U as ce, V as ps, W as hs, X as gn, Y as ft, Z as pt, _ as ms, $ as xn, a0 as gs, a1 as vn, a2 as ht, a3 as xs, a4 as vs, a5 as mt, a6 as jn, a7 as fe, a8 as js, a9 as ws, aa as ys, ab as _s, ac as bs, ad as wn, ae as Ns, af as Ce, ag as yn, ah as Et, ai as $s, aj as xe } from "./FromToDatePickerDropdownToggle-CGnDN_zs.js";
2
- import { ak as pi } from "./FromToDatePickerDropdownToggle-CGnDN_zs.js";
1
+ import { j as r, c as g, t as Z, a as Se, m as Pr, b as Vr, d as zr, s as Yr, e as Gr, f as Ur, g as Kr, h as qr, i as Qr, k as Jr, l as Xr, T as cn, n as dn, o as St, E as Zr, p as un, q as dt, r as fn, u as es, v as A, w as ue, x as pn, F as st, y as ts, z as ns, A as rs, B as ss, C as os, D as as, G as ls, H as cs, I as ut, J as hn, K as mn, L as is, M as $e, N as ds, O as us, P as Ne, Q as fs, R as Ke, S as Y, U as ce, V as ps, W as hs, X as gn, Y as ft, Z as pt, _ as Ce, $ as fe, a0 as xn, a1 as ht, a2 as xe, a3 as vn, a4 as mt, a5 as ms, a6 as jn, a7 as gs, a8 as wn, a9 as xs, aa as vs, ab as yn, ac as js, ad as ws, ae as ys, af as _s, ag as bs, ah as Ns, ai as Et, aj as $s } from "./FromToDatePickerDropdownToggle-Dk7MFcJp.js";
2
+ import { ak as pi } from "./FromToDatePickerDropdownToggle-Dk7MFcJp.js";
3
3
  import * as O from "react";
4
- import oe, { useCallback as D, useMemo as z, useEffect as T, useRef as V, useState as E, useReducer as _n, useContext as W, Component as ks, isValidElement as Cs, Suspense as Ds, createElement as Is } from "react";
5
- import { c as he, d as ze, C as Ss, a as bn, u as Es, q as Ot, F as Os, b as Nn, A as Ms, M as Fs, B as Ts, e as Rs, g as Bs, P as Mt, f as Te, L as Ft } from "./PrimaryButton-B6qFyVVD.js";
4
+ import oe, { useCallback as D, useMemo as z, useEffect as T, useRef as V, useState as E, useReducer as _n, useContext as W, createElement as ks, Component as Cs, isValidElement as Ds, Suspense as Is } from "react";
5
+ import { c as he, d as ze, C as Ss, a as bn, u as Es, q as Ot, F as Os, b as Nn, A as Ms, M as Fs, B as Ts, e as Rs, g as Bs, P as Mt, f as Te, L as Ft } from "./PrimaryButton-Bbl06m-g.js";
6
6
  import { InteractionType as Ls } from "@azure/msal-browser";
7
7
  import { MsalAuthenticationTemplate as As } from "@azure/msal-react";
8
8
  import "zod";
9
9
  import { Link as ke, Navigate as Re } from "react-router-dom";
10
10
  import { useFormContext as pe, Controller as $n } from "react-hook-form";
11
- import { s as Tt, g as Rt, d as Le, f as Ee, t as ge, a as Hs, b as Ws, p as Ps } from "./dateUtils-Bc53BdYm.js";
12
- import { S as Vs } from "./SimpleTooltip-B0I1MS-L.js";
13
- import { u as kn, a as Cn, b as Dn } from "./useFormControlType-BAFqxupC.js";
11
+ import { s as Tt, g as Rt, d as Le, f as Ee, p as Hs, t as ge, a as Ws, b as Ps } from "./dateUtils-B9-rf1Eh.js";
12
+ import { S as Vs } from "./SimpleTooltip-C32Faxrc.js";
13
+ import { u as kn, a as Cn, b as Dn } from "./useFormControlType-oJGqgThz.js";
14
14
  import He from "react-dom";
15
- import { s as zs } from "./searchUtils-kismAHZM.js";
15
+ import { s as zs } from "./searchUtils-BCxOKHVq.js";
16
16
  const Sc = ({ fileLoader: t, fileName: e, children: n }) => {
17
17
  const s = D(async () => {
18
18
  var i, c;
@@ -1746,7 +1746,7 @@ const Ec = ({ heading: t, content: e, placement: n, children: s, trigger: o, ...
1746
1746
  /* @__PURE__ */ r.jsx(Ke.Body, { children: e })
1747
1747
  ] }), trigger: o ?? "hover", rootClose: !0, show: a.controlled ? a.isOpen : void 0, onToggle: a.controlled ? (l) => a.setIsOpen(l) : void 0, children: s }), Vo = ({ children: t, onStorno: e, noSpacer: n }) => {
1748
1748
  const { texts: { formSubmit: s } } = W(ce);
1749
- return /* @__PURE__ */ r.jsxs(Kl, { noSpacer: n, children: [
1749
+ return /* @__PURE__ */ r.jsxs(nc, { noSpacer: n, children: [
1750
1750
  /* @__PURE__ */ r.jsxs(Mt, { as: "button", color: "primary", size: "lg", type: "submit", children: [
1751
1751
  /* @__PURE__ */ r.jsx(ps, {}),
1752
1752
  t
@@ -1850,347 +1850,148 @@ const Ec = ({ heading: t, content: e, placement: n, children: s, trigger: o, ...
1850
1850
  ] });
1851
1851
  }, Xo = "_widget_etgh3_1", Zo = {
1852
1852
  widget: Xo
1853
- }, ea = ({ show: t, widgets: e, handleClose: n, onWidgetPicked: s, texts: o }) => /* @__PURE__ */ r.jsxs(Te, { show: t, onHide: () => n(), children: [
1854
- /* @__PURE__ */ r.jsx(Te.Header, { closeButton: !0, children: /* @__PURE__ */ r.jsx(Te.Title, { children: o.pickWidgetToAdd }) }),
1855
- /* @__PURE__ */ r.jsx(Te.Body, { children: /* @__PURE__ */ r.jsx("div", { className: "list-group", children: e.filter((a) => a.id >= 0).map((a) => /* @__PURE__ */ r.jsx("div", { role: "button", className: "list-group-item bg-white", onClick: () => s(a.id), children: /* @__PURE__ */ r.jsx(Y, { variant: "body", children: a.name }) })) }) })
1856
- ] }), Qt = ({ availableWidgets: t, onAdd: e, texts: n }) => {
1857
- const [s, o] = E(!1);
1858
- return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1859
- /* @__PURE__ */ r.jsx("div", { className: g("luminus-empty-widget", Zo.widget), children: /* @__PURE__ */ r.jsx(G, { onClick: () => o(!0), children: /* @__PURE__ */ r.jsx(ms, {}) }) }),
1860
- /* @__PURE__ */ r.jsx(ea, { show: s, widgets: t, handleClose: () => o(!1), onWidgetPicked: (a) => {
1861
- o(!1), e(a);
1862
- }, texts: n })
1853
+ }, Sr = ({ currentSelection: t, selectedItemNavigateTo: e, children: n }) => {
1854
+ if (!t || !t.id || !e)
1855
+ return /* @__PURE__ */ r.jsx("div", { className: "luminus-input-container position-relative w-100", children: n });
1856
+ const s = e(t);
1857
+ return /* @__PURE__ */ r.jsx(ke, { to: s, className: "luminus-input-container position-relative w-100 text-decoration-none", children: n });
1858
+ }, Fc = ({ InputContainer: t = Ce, label: e, value: n, onChange: s, hidden: o, disabled: a, className: l, type: i, withoutLabel: c }) => /* @__PURE__ */ r.jsx(t, { isForCheckInput: !0, hidden: o, label: e ?? "", withoutLabel: c, className: l, children: /* @__PURE__ */ r.jsx(ee.Check, { id: `check-${e}`, type: i ?? "checkbox", label: e ?? "", checked: n, onChange: (d) => {
1859
+ var u;
1860
+ s && s(((u = d.target) == null ? void 0 : u.checked) ?? !1);
1861
+ }, className: l ?? "", hidden: o ?? !1, disabled: a ?? !1 }) }), Qt = ({ InputContainer: t = Ce, type: e, value: n, onChange: s, debounceMs: o, label: a, withoutLabel: l, placeholder: i, size: c, hidden: d, disabled: u, showClearIcon: f, clearValue: p, list: h, className: v, step: y, noSelectOnFocus: x }) => {
1862
+ const b = e === "number", k = D(() => {
1863
+ if (!s)
1864
+ return;
1865
+ const w = p ?? null;
1866
+ s(b ? w ? Number(w) : null : (w == null ? void 0 : w.toString()) ?? "");
1867
+ }, [p, b, s]), m = V(null), [N, j] = E((n == null ? void 0 : n.toString()) ?? ""), $ = D((w) => {
1868
+ const C = w;
1869
+ s && (b && s(C == null || C === "" ? null : Number(C)), s(C || null));
1870
+ }, [b, s]), _ = D((w) => {
1871
+ var L;
1872
+ const C = (L = w.target) == null ? void 0 : L.value;
1873
+ if (!o) {
1874
+ $(C);
1875
+ return;
1876
+ }
1877
+ j(C), m.current !== null && window.clearTimeout(m.current), m.current = window.setTimeout(() => {
1878
+ $(C);
1879
+ }, o);
1880
+ }, [o, $]);
1881
+ T(() => {
1882
+ j(n === null ? "" : n.toString());
1883
+ }, [n]);
1884
+ const [M, I] = E(!1), S = kn(e, n ? n.toString() ?? null : null, M);
1885
+ return /* @__PURE__ */ r.jsxs(t, { withoutLabel: l, label: a ?? "", hidden: d, className: v, children: [
1886
+ /* @__PURE__ */ r.jsx(ee.Control, { type: S, placeholder: i ?? a, size: c, value: o ? N : (n == null ? void 0 : n.toString()) ?? "", onChange: _, className: v ?? "", hidden: d, disabled: u ?? !1, list: h, onFocus: (w) => {
1887
+ I(!0), !x && w.target.select();
1888
+ }, onBlur: () => I(!1), step: y }),
1889
+ f && n !== null && s && !u && /* @__PURE__ */ r.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: k, children: /* @__PURE__ */ r.jsx(fe, {}) }) })
1863
1890
  ] });
1864
- }, ta = (t) => {
1865
- const [e, n] = E({ widgets: [] });
1891
+ }, Tc = ({
1892
+ InputContainer: t = Ce,
1893
+ value: e,
1894
+ options: n,
1895
+ onChange: s,
1896
+ label: o,
1897
+ withoutLabel: a,
1898
+ isNumber: l,
1899
+ size: i,
1900
+ hidden: c,
1901
+ disabled: d,
1902
+ showClearIcon: u,
1903
+ clearValue: f,
1904
+ noSortOptions: p,
1905
+ className: h,
1906
+ noEmptyOption: v
1907
+ // it will still add the empty option if there is no value provided or value is empty string or null
1908
+ }) => {
1909
+ const y = D(() => {
1910
+ if (!s)
1911
+ return;
1912
+ const x = f ?? null;
1913
+ s(l ? x ? Number(x) : null : (x == null ? void 0 : x.toString()) ?? "");
1914
+ }, [f, l, s]);
1915
+ return /* @__PURE__ */ r.jsxs(t, { withoutLabel: a, label: o ?? "", hidden: c, className: h, children: [
1916
+ /* @__PURE__ */ r.jsxs(ee.Select, { size: i, value: e ?? "", onChange: (x) => {
1917
+ var k;
1918
+ if (!s)
1919
+ return;
1920
+ const b = (k = x.target) == null ? void 0 : k.value;
1921
+ l && s(b ? parseInt(b, 10) : null), s(b || null);
1922
+ }, className: h ?? "", hidden: c, disabled: d ?? !1, children: [
1923
+ v && !(e == null || e === "") ? void 0 : /* @__PURE__ */ r.jsx("option", { value: "" }),
1924
+ n == null ? void 0 : n.sort((x, b) => p ? 0 : (x.name ?? "").localeCompare(b.name ?? "")).map((x) => /* @__PURE__ */ r.jsx("option", { value: x.id ?? "", children: x.name }, x.id))
1925
+ ] }),
1926
+ u && e && s && !d && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: y, children: /* @__PURE__ */ r.jsx(fe, {}) }) })
1927
+ ] });
1928
+ }, Rc = ({ InputContainer: t = Ce, items: e, defaultSelection: n, selectedItemNavigateTo: s, onSearchQueryChange: o, texts: a, isLoading: l, isNumber: i, onSelect: c, label: d, withoutLabel: u, size: f, dropdownItemsNameWidth: p, additionalColumns: h, hidden: v, disabled: y, displayIdAsName: x, CustomOnChangeComponent: b, className: k }) => {
1929
+ var C, L;
1930
+ const [m, N] = E(n), [j, $] = E(!1);
1866
1931
  T(() => {
1867
- const o = localStorage.getItem("dashboardConfig");
1868
- o ? n(JSON.parse(o)) : t && n(t);
1869
- }, [t]);
1870
- const s = D((o) => {
1871
- n(o), localStorage.setItem("dashboardConfig", JSON.stringify(o));
1872
- }, []);
1873
- return { dashboardConfig: e, onChangeDashboardConfig: s };
1874
- }, na = "_dashboard_16plm_1", ra = "_widgets-grid_16plm_1", sa = "_widget-wrapper_16plm_8", oa = "_full-width_16plm_13", aa = "_widget-edit_16plm_16", la = "_remove-icon_16plm_19", ca = "_full-width-icon_16plm_26", ia = "_widget-edit-overlay_16plm_36", de = {
1875
- dashboard: na,
1876
- "widgets-grid": "_widgets-grid_16plm_1",
1877
- widgetsGrid: ra,
1878
- "widget-wrapper": "_widget-wrapper_16plm_8",
1879
- widgetWrapper: sa,
1880
- "full-width": "_full-width_16plm_13",
1881
- fullWidth: oa,
1882
- "widget-edit": "_widget-edit_16plm_16",
1883
- widgetEdit: aa,
1884
- "remove-icon": "_remove-icon_16plm_19",
1885
- removeIcon: la,
1886
- "full-width-icon": "_full-width-icon_16plm_26",
1887
- fullWidthIcon: ca,
1888
- "widget-edit-overlay": "_widget-edit-overlay_16plm_36",
1889
- widgetEditOverlay: ia
1890
- };
1891
- class da extends ks {
1892
- constructor(e) {
1893
- super(e), this.state = { hasError: !1 }, this.reload = this.reload.bind(this);
1894
- }
1895
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1896
- static getDerivedStateFromError(e) {
1897
- return { hasError: !0 };
1898
- }
1899
- componentDidUpdate(e) {
1900
- this.state.hasError && e.keyForErrorState !== this.props.keyForErrorState && this.setState({ hasError: !1 });
1901
- }
1902
- componentDidCatch(e, n) {
1903
- console.error("Error:", e, n);
1904
- }
1905
- reload() {
1906
- this.setState({ hasError: !1 });
1907
- }
1908
- render() {
1909
- const { fallback: e, children: n, texts: s, reloadButtonDisplay: o = "append-after-child" } = this.props;
1910
- return this.state.hasError ? o === "inject-to-child" && Cs(e) ? oe.cloneElement(e, {
1911
- ...e.props
1912
- }, /* @__PURE__ */ r.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
1913
- ...e.props.children,
1914
- /* @__PURE__ */ r.jsx(ct, { type: "button", onClick: this.reload, children: s.reloadButtonContent })
1915
- ] })) : /* @__PURE__ */ r.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
1916
- e,
1917
- o === "none" ? null : /* @__PURE__ */ r.jsx(ct, { type: "button", onClick: this.reload, children: s.reloadButtonContent })
1918
- ] }) : n;
1919
- }
1920
- }
1921
- const ua = (t) => (n) => {
1922
- const { texts: { errorBoundary: s } } = W(ce);
1923
- return /* @__PURE__ */ r.jsx(t, { texts: s, ...n });
1924
- }, fa = ua(da), pa = "_widget-card_e9tsb_1", ha = {
1925
- "widget-card": "_widget-card_e9tsb_1",
1926
- widgetCard: pa
1927
- }, Jt = ({ children: t, title: e, headerContent: n }) => /* @__PURE__ */ r.jsx(ml, { className: g(ha.widgetCard, "luminus-widget"), title: e, headerContent: n, contentClassName: "h-100 overflow-auto", children: t }), ma = ({ children: t, title: e }) => {
1928
- const { texts: { widget: n } } = W(ce);
1929
- return /* @__PURE__ */ r.jsx(fa, { fallback: /* @__PURE__ */ r.jsx(Jt, { title: e, children: n.fallbackError }), reloadButtonDisplay: "inject-to-child", children: /* @__PURE__ */ r.jsx(Ds, { fallback: /* @__PURE__ */ r.jsx(Jt, { title: e, children: /* @__PURE__ */ r.jsx(Ys, {}) }), children: t }) });
1930
- }, Fc = ({ availableWidgets: t, editMode: e, defaultDashboardConfig: n }) => {
1931
- var u;
1932
- const { texts: { homeDashboard: s } } = W(ce), { dashboardConfig: o, onChangeDashboardConfig: a } = ta(n), l = D((f, p) => {
1933
- var h, v;
1934
- f === ((h = o.widgets) == null ? void 0 : h.length) ? a({
1935
- ...o,
1936
- widgets: [...o.widgets, { widgetId: p, fullWidth: !1 }]
1937
- }) : a({
1938
- ...o,
1939
- widgets: ((v = o.widgets) == null ? void 0 : v.map((y, x) => x === f ? { widgetId: p, fullWidth: !1 } : y)) ?? []
1940
- });
1941
- }, [o, a]), i = D((f) => {
1942
- var p, h;
1943
- ((p = o.widgets[f]) == null ? void 0 : p.widgetId) === -1 ? a({
1944
- ...o,
1945
- widgets: ((h = o.widgets) == null ? void 0 : h.filter((v, y) => y !== f)) ?? []
1946
- }) : l(f, -1);
1947
- }, [o, a, l]), c = D((f) => {
1948
- var p;
1949
- a({
1950
- ...o,
1951
- widgets: ((p = o.widgets) == null ? void 0 : p.map((h, v) => v === f ? { ...h, fullWidth: !h.fullWidth } : h)) ?? []
1952
- });
1953
- }, [o, a]), d = D((f, p, h) => f ? /* @__PURE__ */ r.jsxs("div", { className: g(de.widgetWrapper, {
1954
- [de.widgetEdit]: e && f.id !== -1
1955
- }, { [de.fullWidth]: h }), children: [
1956
- e && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1957
- /* @__PURE__ */ r.jsx(G, { color: "danger", onClick: () => i(p), className: g(de.removeIcon), children: /* @__PURE__ */ r.jsx(xn, {}) }),
1958
- /* @__PURE__ */ r.jsx(G, { color: h ? "danger" : "primary", onClick: () => c(p), className: g(de.fullWidthIcon), children: /* @__PURE__ */ r.jsx(gs, {}) })
1932
+ N(n);
1933
+ }, [n]);
1934
+ const _ = D((H) => {
1935
+ N(H);
1936
+ }, []), M = D((H) => {
1937
+ $(!1), _(H);
1938
+ }, [_]);
1939
+ T(() => {
1940
+ c && c(m);
1941
+ }, [m, c]);
1942
+ const I = V(null), S = s !== void 0, w = S && m !== null;
1943
+ return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(t, { withoutLabel: u, label: d ?? "", hidden: v, inputContainerClassName: g({ "luminus-dropdown-select-open": j }), className: k, children: [
1944
+ /* @__PURE__ */ r.jsxs(Sr, { currentSelection: m, selectedItemNavigateTo: s, children: [
1945
+ x && (m == null ? void 0 : m.name) && /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: m.name }),
1946
+ /* @__PURE__ */ r.jsxs(ee.Select, { ref: I, size: f, value: (m == null ? void 0 : m.id) ?? "", onChange: (H) => N({
1947
+ id: i ? Number(H.target.value) ?? null : H.target.value,
1948
+ name: ""
1949
+ }), onMouseDown: (H) => {
1950
+ H.currentTarget.focus(), H.preventDefault();
1951
+ }, onClick: () => {
1952
+ !S && !y && $(!0);
1953
+ }, className: g("w-100", {
1954
+ "luminus-dropdown-picker-disabled": y,
1955
+ "luminus-dropdown-picker-link": w
1956
+ }), hidden: v, children: [
1957
+ /* @__PURE__ */ r.jsx("option", { value: "" }),
1958
+ n && /* @__PURE__ */ r.jsx("option", { value: n.id ?? void 0, children: n.name && ((C = n.name) == null ? void 0 : C.length) > 0 ? n.name : n.id }),
1959
+ m && /* @__PURE__ */ r.jsx("option", { value: m.id ?? void 0, children: m.name && ((L = m.name) == null ? void 0 : L.length) > 0 ? m.name : m.id })
1960
+ ] }),
1961
+ b || !y && S ? /* @__PURE__ */ r.jsxs("div", { className: "custom-picker-button", children: [
1962
+ !b && !y && S && /* @__PURE__ */ r.jsx(G, { size: "sm", color: "secondary", onClick: (H) => {
1963
+ H.preventDefault(), H.stopPropagation(), $(!0);
1964
+ }, children: /* @__PURE__ */ r.jsx(xn, {}) }),
1965
+ b ?? null
1966
+ ] }) : null
1959
1967
  ] }),
1960
- f.id === -1 ? e && /* @__PURE__ */ r.jsx("div", { className: de.widgetWrapper, children: /* @__PURE__ */ r.jsx(Qt, { availableWidgets: t, onAdd: (v) => l(p, v), texts: s }) }) : /* @__PURE__ */ r.jsx(ma, { title: f.title, children: /* @__PURE__ */ r.jsx(f.WidgetElement, { title: f.title }) }),
1961
- f.id > -1 && e && /* @__PURE__ */ r.jsx("div", { className: de.widgetEditOverlay })
1962
- ] }, p) : /* @__PURE__ */ r.jsx(r.Fragment, {}), [
1963
- e,
1964
- l,
1965
- i,
1966
- c,
1967
- t,
1968
- s
1969
- ]);
1970
- return /* @__PURE__ */ r.jsx("div", { className: de.dashboard, children: /* @__PURE__ */ r.jsxs("div", { className: de.widgetsGrid, children: [
1971
- (u = o.widgets) == null ? void 0 : u.map((f, p) => d(t.find((h) => h.id === f.widgetId), p, f.fullWidth)),
1972
- e && /* @__PURE__ */ r.jsx(Qt, { availableWidgets: t, onAdd: (f) => {
1973
- var p;
1974
- return l((p = o.widgets) == null ? void 0 : p.length, f);
1975
- }, texts: s })
1968
+ I.current && /* @__PURE__ */ r.jsx(kt, { show: j, onCancel: () => $(!1), items: e, currentSelection: m, onSelectionChange: M, onSearchQueryChange: o, texts: a, itemsNameWidth: p, additionalColumns: h, isLoading: l, disabled: y, inputRef: I })
1976
1969
  ] }) });
1977
- }, ga = "_badge_nhser_1", xa = "_sm_nhser_1", va = "_md_nhser_4", ja = "_lg_nhser_7", Xt = {
1978
- badge: ga,
1979
- sm: xa,
1980
- md: va,
1981
- lg: ja
1982
- }, Tc = ({ children: t, color: e = "primary", size: n = "md", className: s }) => /* @__PURE__ */ r.jsx("span", { className: g(`luminus-badge badge bg-${e} ${s ?? ""}`, Xt.badge, Xt[n]), children: t }), wa = "_collapse-icon_1ahhn_1", ya = "_collapsed_1ahhn_6", Zt = {
1983
- "collapse-icon": "_collapse-icon_1ahhn_1",
1984
- collapseIcon: wa,
1985
- collapsed: ya
1986
- }, Rc = ({ title: t, children: e, className: n, ...s }) => {
1987
- const o = s.controlled ? !1 : s.defaultOpen ?? !1, [a, l] = E(o), i = s.controlled ? s.isOpen : a;
1970
+ }, Bc = ({ InputContainer: t = Ce, value: e, onChange: n, label: s, size: o, showClearIcon: a, clearValue: l, hidden: i, disabled: c, rows: d, withoutLabel: u, debounceMs: f, className: p }) => {
1971
+ const h = D(() => {
1972
+ if (!n)
1973
+ return;
1974
+ const m = l ?? null;
1975
+ n((m == null ? void 0 : m.toString()) ?? "");
1976
+ }, [l, n]), v = V(null), [y, x] = E((e == null ? void 0 : e.toString()) ?? ""), b = D((m) => {
1977
+ const N = m;
1978
+ n && n(N || null);
1979
+ }, [n]), k = D((m) => {
1980
+ var j;
1981
+ const N = (j = m.target) == null ? void 0 : j.value;
1982
+ if (!f) {
1983
+ b(N);
1984
+ return;
1985
+ }
1986
+ x(N), v.current !== null && window.clearTimeout(v.current), v.current = window.setTimeout(() => {
1987
+ b(N);
1988
+ }, f);
1989
+ }, [f, b]);
1988
1990
  return T(() => {
1989
- l(o);
1990
- }, [o]), /* @__PURE__ */ r.jsxs("div", { className: n ?? "", children: [
1991
- /* @__PURE__ */ r.jsxs("div", { role: "button", className: "d-flex align-items-center justify-content-between pb-3 pt-2", onClick: () => s.controlled ? s.onToggle(!s.isOpen) : l(!a), children: [
1992
- /* @__PURE__ */ r.jsx(Y, { variant: "h6", children: t }),
1993
- /* @__PURE__ */ r.jsx(vn, { className: g(Zt.collapseIcon, {
1994
- [Zt.collapsed]: i
1995
- }) })
1996
- ] }),
1997
- /* @__PURE__ */ r.jsx(En, { in: i, children: /* @__PURE__ */ r.jsx("div", { children: e }) }),
1998
- /* @__PURE__ */ r.jsx("hr", { className: `my-0 ${i ? "mt-3" : ""}` })
1999
- ] });
2000
- }, _a = "_feedback_esh1j_1", ba = "_feedback-spacer_esh1j_8", en = {
2001
- feedback: _a,
2002
- "feedback-spacer": "_feedback-spacer_esh1j_8",
2003
- feedbackSpacer: ba
2004
- }, ve = ({ message: t }) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2005
- /* @__PURE__ */ r.jsx("div", { className: g("invalid-feedback luminus-invalid-feedback", en.feedback), children: t }),
2006
- /* @__PURE__ */ r.jsx("div", { className: g("invalid-feedback-spacer", en.feedbackSpacer), children: t })
2007
- ] });
2008
- function Na(t, e, n) {
2009
- var s = this, o = V(null), a = V(0), l = V(null), i = V([]), c = V(), d = V(), u = V(t), f = V(!0);
2010
- u.current = t;
2011
- var p = typeof window < "u", h = !e && e !== 0 && p;
2012
- if (typeof t != "function") throw new TypeError("Expected a function");
2013
- e = +e || 0;
2014
- var v = !!(n = n || {}).leading, y = !("trailing" in n) || !!n.trailing, x = "maxWait" in n, b = "debounceOnServer" in n && !!n.debounceOnServer, k = x ? Math.max(+n.maxWait || 0, e) : null;
2015
- T(function() {
2016
- return f.current = !0, function() {
2017
- f.current = !1;
2018
- };
2019
- }, []);
2020
- var m = z(function() {
2021
- var N = function(S) {
2022
- var w = i.current, C = c.current;
2023
- return i.current = c.current = null, a.current = S, d.current = u.current.apply(C, w);
2024
- }, j = function(S, w) {
2025
- h && cancelAnimationFrame(l.current), l.current = h ? requestAnimationFrame(S) : setTimeout(S, w);
2026
- }, $ = function(S) {
2027
- if (!f.current) return !1;
2028
- var w = S - o.current;
2029
- return !o.current || w >= e || w < 0 || x && S - a.current >= k;
2030
- }, _ = function(S) {
2031
- return l.current = null, y && i.current ? N(S) : (i.current = c.current = null, d.current);
2032
- }, M = function S() {
2033
- var w = Date.now();
2034
- if ($(w)) return _(w);
2035
- if (f.current) {
2036
- var C = e - (w - o.current), L = x ? Math.min(C, k - (w - a.current)) : C;
2037
- j(S, L);
2038
- }
2039
- }, I = function() {
2040
- if (p || b) {
2041
- var S = Date.now(), w = $(S);
2042
- if (i.current = [].slice.call(arguments), c.current = s, o.current = S, w) {
2043
- if (!l.current && f.current) return a.current = o.current, j(M, e), v ? N(o.current) : d.current;
2044
- if (x) return j(M, e), N(o.current);
2045
- }
2046
- return l.current || j(M, e), d.current;
2047
- }
2048
- };
2049
- return I.cancel = function() {
2050
- l.current && (h ? cancelAnimationFrame(l.current) : clearTimeout(l.current)), a.current = 0, i.current = o.current = c.current = l.current = null;
2051
- }, I.isPending = function() {
2052
- return !!l.current;
2053
- }, I.flush = function() {
2054
- return l.current ? _(Date.now()) : d.current;
2055
- }, I;
2056
- }, [v, x, e, k, y, h, p, b]);
2057
- return m;
2058
- }
2059
- function $a(t, e) {
2060
- return t === e;
2061
- }
2062
- function ka(t, e) {
2063
- return e;
2064
- }
2065
- function Sr(t, e, n) {
2066
- var s = $a, o = _n(ka, t), a = o[0], l = o[1], i = Na(D(function(d) {
2067
- return l(d);
2068
- }, [l]), e, n), c = V(t);
2069
- return s(c.current, t) || (i(t), c.current = t), s(a, t) && i.cancel(), [a, i];
2070
- }
2071
- const Ca = "_wrapper_uccrb_1", Da = "_open_uccrb_9", Ia = "_dropdown_uccrb_13", Sa = "_search-input-container_uccrb_19", Ea = "_search-input_uccrb_19", Oa = "_loading-container_uccrb_25", Ma = "_items-container_uccrb_32", Fa = "_header-row_uccrb_38", Ta = "_item_uccrb_32", Ra = "_name_uccrb_57", Ba = "_column-item_uccrb_62", La = "_icon_uccrb_66", Aa = "_clear-button_uccrb_74", se = {
2072
- wrapper: Ca,
2073
- open: Da,
2074
- dropdown: Ia,
2075
- "search-input-container": "_search-input-container_uccrb_19",
2076
- searchInputContainer: Sa,
2077
- "search-input": "_search-input_uccrb_19",
2078
- searchInput: Ea,
2079
- "loading-container": "_loading-container_uccrb_25",
2080
- loadingContainer: Oa,
2081
- "items-container": "_items-container_uccrb_32",
2082
- itemsContainer: Ma,
2083
- "header-row": "_header-row_uccrb_38",
2084
- headerRow: Fa,
2085
- item: Ta,
2086
- name: Ra,
2087
- "column-item": "_column-item_uccrb_62",
2088
- columnItem: Ba,
2089
- icon: La,
2090
- "clear-button": "_clear-button_uccrb_74",
2091
- clearButton: Aa
2092
- }, kt = ({ show: t, onCancel: e, items: n, currentSelection: s, onSelectionChange: o, onSearchQueryChange: a, texts: l, itemsNameWidth: i, additionalColumns: c, displayIdAsName: d = !1, autoHideSearch: u = !1, allItemsLength: f, disabled: p, isLoading: h = !1, inputRef: v }) => {
2093
- var P;
2094
- const y = V(null), x = V(null), b = V(null), k = V(null), [m, N] = E(""), [j] = Sr(m, 500), [, $] = E(!1), _ = (P = v.current) == null ? void 0 : P.getBoundingClientRect(), M = (_ == null ? void 0 : _.x) ?? 0, I = ((_ == null ? void 0 : _.x) ?? 0) + ((_ == null ? void 0 : _.width) ?? 0), S = (_ == null ? void 0 : _.y) ?? 0, w = ((_ == null ? void 0 : _.y) ?? 0) + ((_ == null ? void 0 : _.height) ?? 0), C = (_ == null ? void 0 : _.width) ?? 0, L = (_ == null ? void 0 : _.height) ?? 0, H = 5, Q = z(() => M ? M > window.innerWidth / 2 : !1, [M]), K = z(() => S ? S > window.innerHeight / 2 : !1, [S]);
2095
- T(() => {
2096
- var B;
2097
- t && ((B = b.current) == null || B.focus());
2098
- }, [b, t]), T(() => {
2099
- t || N("");
2100
- }, [t]), T(() => {
2101
- a(j);
2102
- }, [j, a]);
2103
- const [R, U] = E(null);
2104
- T(() => {
2105
- t && n.length > 0 ? U(0) : U(null);
2106
- }, [n, t]);
2107
- const te = z(() => R !== null ? n.at(R) ?? null : null, [R, n]), q = D((B, X) => {
2108
- var Ct, Dt;
2109
- const le = document.getElementById(`item-${B}`);
2110
- if (le) {
2111
- const It = le.clientHeight ?? 0;
2112
- X === "down" ? (Ct = k.current) == null || Ct.scrollBy({
2113
- left: 0,
2114
- top: It,
2115
- behavior: "smooth"
2116
- }) : (Dt = k.current) == null || Dt.scrollBy({
2117
- left: 0,
2118
- top: -It,
2119
- behavior: "smooth"
2120
- });
2121
- }
2122
- }, []), F = D((B) => {
2123
- if (R === null || p)
2124
- return;
2125
- const X = R + B;
2126
- X < 0 || X >= n.length || U((le) => (le !== null && q(le, B > 0 ? "down" : "up"), X));
2127
- }, [R, n, p, q]), J = D((B) => {
2128
- if (t)
2129
- switch (B.key) {
2130
- case "Escape":
2131
- B.stopPropagation(), B.preventDefault(), e();
2132
- break;
2133
- case "Enter":
2134
- B.stopPropagation(), B.preventDefault(), p || o(te);
2135
- break;
2136
- case "ArrowUp":
2137
- B.stopPropagation(), B.preventDefault(), F(-1);
2138
- break;
2139
- case "ArrowDown":
2140
- B.stopPropagation(), B.preventDefault(), F(1);
2141
- break;
2142
- }
2143
- }, [e, t, F, te, p, o]), re = D(() => {
2144
- $((B) => !B);
2145
- }, []);
2146
- T(() => (window.addEventListener("scroll", re), () => {
2147
- window.removeEventListener("scroll", re);
2148
- }), [re]), T(() => (window.addEventListener("resize", re), () => {
2149
- window.removeEventListener("resize", re);
2150
- }), [re]), kn(J), Cn([y, x], e);
2151
- const je = i ?? (c && c.length > 0 ? 250 : 0), ne = (c == null ? void 0 : c.reduce((B, X) => B + (X.width ?? 100), 0)) ?? 0, ie = `calc(max(${C}px, ${je}px + ${ne}px))`;
2152
- return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2153
- /* @__PURE__ */ r.jsx(Ar, { show: t, onClick: e }),
2154
- s && t && !p && /* @__PURE__ */ r.jsx("button", { ref: x, type: "button", className: g("luminus-dropdown-picker-clear-button", se.clearButton), onClick: () => !p && o(null), style: {
2155
- top: `calc(${S}px + ${L / 2}px - 12px)`,
2156
- left: `calc(${M}px - 24px - 8px)`
2157
- }, children: /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: "text-danger", children: /* @__PURE__ */ r.jsx(xn, { size: 16 }) }) }),
2158
- /* @__PURE__ */ r.jsx("div", { className: g("luminus-dropdown-picker", se.wrapper, {
2159
- [se.open]: t
2160
- }), style: {
2161
- top: K ? `calc(${S}px - 50vh - 8px)` : `calc(${w}px + 8px)`,
2162
- left: Q ? `calc(${I}px - ${ie})` : M,
2163
- right: Q ? `${I}px` : `calc(${M}px + ${ie})`,
2164
- width: ie,
2165
- justifyContent: K ? "flex-end" : "flex-start"
2166
- }, children: /* @__PURE__ */ r.jsx("div", { ref: y, className: g("shadow rounded", se.dropdown), children: !p && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2167
- u && (f ?? n.length) <= H ? null : /* @__PURE__ */ r.jsx("div", { className: g("search-input-container border-bottom", se.searchInputContainer), children: /* @__PURE__ */ r.jsx(ee.Control, { ref: b, type: "search", size: "sm", className: se.searchInput, placeholder: l.searchPlaceholder, value: m, onChange: (B) => {
2168
- var X;
2169
- return N(((X = B.target) == null ? void 0 : X.value) ?? "");
2170
- } }) }),
2171
- h ? /* @__PURE__ */ r.jsx("div", { className: se.loadingContainer, children: /* @__PURE__ */ r.jsx($t, { animation: "border", variant: "primary" }) }) : n.length > 0 && /* @__PURE__ */ r.jsxs("div", { ref: k, className: g("items", se.itemsContainer), children: [
2172
- c && c.length > 0 && /* @__PURE__ */ r.jsxs("div", { className: g("header-row border-bottom", se.headerRow), children: [
2173
- /* @__PURE__ */ r.jsx("div", { className: se.name }),
2174
- c == null ? void 0 : c.map((B) => /* @__PURE__ */ r.jsx("div", { className: se.columnItem, style: {
2175
- width: `${B.width ?? 100}px`,
2176
- minWidth: `${B.width ?? 100}px`,
2177
- maxWidth: `${B.width ?? 100}px`
2178
- }, children: /* @__PURE__ */ r.jsx(Y, { variant: "caption", children: B.name }) }, B.key))
2179
- ] }),
2180
- n == null ? void 0 : n.map((B, X) => /* @__PURE__ */ r.jsxs("button", { id: `item-${X}`, type: "button", className: g("item cursor-pointer", se.item, {
2181
- [se.focused]: R === X
2182
- }, {
2183
- focused: R === X
2184
- }), onClick: () => !p && o(B), onMouseEnter: () => U(X), children: [
2185
- /* @__PURE__ */ r.jsx("div", { className: se.name, children: /* @__PURE__ */ r.jsx(Y, { variant: "body2", children: d ? B.id : B.name }) }),
2186
- c == null ? void 0 : c.map((le) => /* @__PURE__ */ r.jsx("div", { className: se.columnItem, style: {
2187
- width: `${le.width ?? 100}px`,
2188
- minWidth: `${le.width ?? 100}px`,
2189
- maxWidth: `${le.width ?? 100}px`
2190
- }, children: /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: g("text-muted"), children: B.additionalColumns && B.additionalColumns[le.key] }) }, le.key))
2191
- ] }, B.id))
2192
- ] })
2193
- ] }) }) })
1991
+ x(e === null ? "" : e.toString());
1992
+ }, [e]), /* @__PURE__ */ r.jsxs(t, { label: s ?? "", hidden: i, withoutLabel: u, className: p, isForTextAreaInput: !0, children: [
1993
+ /* @__PURE__ */ r.jsx(ee.Control, { as: "textarea", size: o, value: f ? y : e ?? "", onChange: k, hidden: i, disabled: c, rows: d ?? 2, className: "w-100" }),
1994
+ a && e && n && !c && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: h, children: /* @__PURE__ */ r.jsx(fe, {}) }) })
2194
1995
  ] });
2195
1996
  };
2196
1997
  function Er(t) {
@@ -2199,758 +2000,42 @@ function Er(t) {
2199
2000
  function Or(t) {
2200
2001
  return ht({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z" }, child: [] }] })(t);
2201
2002
  }
2202
- function Ha(t) {
2003
+ function ea(t) {
2203
2004
  return ht({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z" }, child: [] }] })(t);
2204
2005
  }
2205
- const Wa = "_item_1dy8x_1", Mr = {
2206
- item: Wa
2207
- }, Fr = ({
2208
- color: t = "primary",
2209
- // icon = <MdOutlineArrowOutward />,
2210
- icon: e,
2211
- className: n,
2212
- children: s,
2213
- ...o
2214
- }) => /* @__PURE__ */ r.jsxs(Oe.Item, { className: g(`btn luminus-dropdown-item text-nowrap rounded text-${t} ${n ?? ""}`, Mr.item), ...o, children: [
2215
- e,
2216
- s
2217
- ] }), Tr = (t) => /* @__PURE__ */ r.jsx(Oe.Toggle, { ...t }), Bc = ({ color: t = "primary", icon: e = /* @__PURE__ */ r.jsx(gn, { size: 12 }), inputId: n = "context-file-input", accept: s = "*", onUpload: o, multiple: a, className: l, children: i, ...c }) => {
2218
- const d = (u) => {
2219
- u.target.files && (o(u.target.files), u.target.value = "");
2220
- };
2221
- return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2222
- /* @__PURE__ */ r.jsxs("label", { htmlFor: n, className: g(`btn luminus-dropdown-item text-nowrap rounded text-${t} ${l ?? ""}`, Mr.item), ...c, children: [
2223
- e,
2224
- i
2225
- ] }),
2226
- /* @__PURE__ */ r.jsx("input", { id: n, type: "file", accept: s, onChange: d, hidden: !0, multiple: a })
2227
- ] });
2228
- }, Pa = "_divider_1e6rk_1", Va = {
2229
- divider: Pa
2230
- }, Lc = ({ className: t }) => /* @__PURE__ */ r.jsx(Oe.Divider, { className: g("luminus-dropdown-divider", t, Va.divider) }), za = "_dropdown_1lk66_1", Ya = {
2231
- dropdown: za
2232
- }, Rr = ({ toggle: t, children: e, ...n }) => /* @__PURE__ */ r.jsxs(Oe, { ...n, children: [
2233
- t,
2234
- /* @__PURE__ */ r.jsx(Oe.Menu, { className: g("luminus-dropdown rounded shadow", Ya.dropdown), children: e })
2235
- ] }), Ga = ({ searchTypes: t, selectedType: e, setSelectedType: n }) => /* @__PURE__ */ r.jsx(Rr, { toggle: /* @__PURE__ */ r.jsx(Tr, { as: xs, icon: null, text: e == null ? void 0 : e.text }), children: t.map((s) => /* @__PURE__ */ r.jsx(Fr, { icon: null, onClick: () => n(s.key), children: s.text }, s.key)) }), Ua = "_dropdown_1ddrg_1", Ka = "_open_1ddrg_12", qa = "_loading-container_1ddrg_15", Qa = "_groups-container_1ddrg_22", Ja = "_group_1ddrg_22", Xa = "_header_1ddrg_26", Za = "_item_1ddrg_33", we = {
2236
- dropdown: Ua,
2237
- open: Ka,
2238
- "loading-container": "_loading-container_1ddrg_15",
2239
- loadingContainer: qa,
2240
- "groups-container": "_groups-container_1ddrg_22",
2241
- groupsContainer: Qa,
2242
- group: Ja,
2243
- header: Xa,
2244
- item: Za
2245
- }, el = ({ show: t, query: e, onCancel: n, groups: s, isLoading: o, searchTypes: a }) => {
2246
- const { texts: { appSearch: l } } = W(ce), i = V(null), c = D((d) => {
2247
- var f;
2248
- const u = (f = a.find((p) => p.key === d.type)) == null ? void 0 : f.toPath;
2249
- return u ? `${u}/${d.searchKey}` : "/not-found";
2250
- }, [a]);
2251
- return Cn([i], n), /* @__PURE__ */ r.jsx("div", { ref: i, className: g("luminus-app-search-dropdown shadow rounded", we.dropdown, {
2252
- [we.open]: t
2253
- }), children: o ? /* @__PURE__ */ r.jsx("div", { className: we.loadingContainer, children: /* @__PURE__ */ r.jsx($t, { animation: "border", variant: "primary" }) }) : /* @__PURE__ */ r.jsx("div", { className: we.groupsContainer, children: s == null ? void 0 : s.map((d) => {
2254
- var u;
2255
- return /* @__PURE__ */ r.jsxs("div", { className: g(we.group), children: [
2256
- /* @__PURE__ */ r.jsxs(ke, { to: `/search?query=${e}&type=${d.key.category}`, className: g("group-header", we.header), onClick: n, children: [
2257
- /* @__PURE__ */ r.jsx(Y, { variant: "body", className: "text-primary", children: d.key.categoryName }),
2258
- /* @__PURE__ */ r.jsxs(Y, { variant: "caption", children: [
2259
- d.items.length,
2260
- " ",
2261
- l.amountFrom,
2262
- " ",
2263
- d.key.totalCount
2264
- ] })
2265
- ] }),
2266
- (u = d.items) == null ? void 0 : u.map((f, p) => /* @__PURE__ */ r.jsxs(
2267
- ke,
2268
- {
2269
- to: c(f),
2270
- className: g("search-item d-flex gap-3 align-items-center justify-content-between", we.item),
2271
- onClick: n,
2272
- children: [
2273
- /* @__PURE__ */ r.jsx(Y, { variant: "body2", className: "text-nowrap text-truncate", children: f.name }),
2274
- /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: "text-primary", children: /* @__PURE__ */ r.jsx(vs, {}) })
2275
- ]
2276
- },
2277
- p
2278
- ))
2279
- ] }, d.key.category);
2280
- }) }) });
2281
- }, tl = "_input-group_1lkfy_1", nl = "_input-group-text_1lkfy_5", rl = "_left_1lkfy_9", sl = "_right_1lkfy_13", ol = "_input_1lkfy_1", al = "_submit-button_1lkfy_20", ye = {
2282
- "input-group": "_input-group_1lkfy_1",
2283
- inputGroup: tl,
2284
- "input-group-text": "_input-group-text_1lkfy_5",
2285
- inputGroupText: nl,
2286
- left: rl,
2287
- right: sl,
2288
- input: ol,
2289
- "submit-button": "_submit-button_1lkfy_20",
2290
- submitButton: al
2291
- }, ll = (t, e) => {
2292
- const n = mt(), [s, o] = E(!1), [a, l] = E([]), i = !t || !t.key, c = D(() => {
2293
- if (e.length < 3) {
2294
- l([]);
2006
+ const Lc = ({ InputContainer: t = Ce, value: e, onChange: n, debounceMs: s, label: o, withoutLabel: a, placeholder: l, size: i, hidden: c, disabled: d, showClearIcon: u, clearValue: f, className: p, step: h, stepperStep: v = 1 }) => {
2007
+ const y = D(() => {
2008
+ if (!n)
2009
+ return;
2010
+ const j = f ?? null;
2011
+ n(j ? Number(j) : null);
2012
+ }, [f, n]), x = V(null), [b, k] = E((e == null ? void 0 : e.toString()) ?? ""), m = D((j) => {
2013
+ const $ = j;
2014
+ n && n($ == null || $ === "" ? null : Number($));
2015
+ }, [n]), N = D((j) => {
2016
+ var _;
2017
+ const $ = (_ = j.target) == null ? void 0 : _.value;
2018
+ if (!s) {
2019
+ m($);
2295
2020
  return;
2296
2021
  }
2297
- o(!0), n.get(`/search/${e}?count=${i ? 5 : 20}${i ? "" : `&type=${t.key}`}`).then(({ data: d }) => {
2298
- l(d), o(!1);
2299
- }).catch(() => {
2300
- o(!1);
2301
- });
2302
- }, [t, e, n, i]);
2303
- return T(() => {
2304
- c();
2305
- }, [c]), { isLoading: s, searchItems: a };
2306
- }, Ac = ({ searchTypes: t, navigateFunction: e, currentPath: n }) => {
2307
- var y;
2308
- const { texts: { appSearch: s } } = W(ce), [o, a] = E(t.length > 0 ? ((y = t.at(0)) == null ? void 0 : y.key) ?? null : null), l = z(() => t.find((x) => x.key === o) ?? null, [t, o]), [i, c] = E(""), [d, u] = Sr(i, 500), { isLoading: f, searchItems: p } = ll(l, d), [h, v] = E(!1);
2022
+ k($), x.current !== null && window.clearTimeout(x.current), x.current = window.setTimeout(() => {
2023
+ m($);
2024
+ }, s);
2025
+ }, [s, m]);
2309
2026
  return T(() => {
2310
- (p.length > 0 || f) && v(!0);
2311
- }, [p, f]), T(() => {
2312
- c("");
2313
- }, [n]), /* @__PURE__ */ r.jsx(ee, { onSubmit: (x) => {
2314
- x.preventDefault(), x.stopPropagation(), u.flush(), v(!1), i.length > 2 && e(`/search?query=${i}${l && l.key && `&type=${l == null ? void 0 : l.key}`}`);
2315
- }, children: /* @__PURE__ */ r.jsxs(Ze, { className: ye.inputGroup, children: [
2316
- /* @__PURE__ */ r.jsx(Ze.Text, { className: g("p-1 rounded", ye.inputGroupText, ye.left), children: /* @__PURE__ */ r.jsx(Ga, { searchTypes: t, selectedType: l, setSelectedType: a }) }),
2317
- /* @__PURE__ */ r.jsx(ee.Control, { placeholder: s.searchPlaceholder, type: "text", size: "sm", className: g("luminus-app-search-input", ye.input), value: i, onChange: (x) => {
2318
- var b;
2319
- return c(((b = x.target) == null ? void 0 : b.value) ?? "");
2320
- }, onFocus: () => p.length > 0 && v(!0) }),
2321
- /* @__PURE__ */ r.jsx(Ze.Text, { className: g("p-0 rounded", ye.inputGroupText, ye.right), children: /* @__PURE__ */ r.jsx("button", { type: "submit", className: g("text-primary", ye.submitButton), children: /* @__PURE__ */ r.jsx(Ha, {}) }) }),
2322
- /* @__PURE__ */ r.jsx(el, { query: d, searchTypes: t, show: h, onCancel: () => v(!1), groups: p, isLoading: f })
2027
+ k(e === null ? "" : e.toString());
2028
+ }, [e]), /* @__PURE__ */ r.jsx(t, { withoutLabel: a, label: o ?? "", hidden: c, className: p, children: /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
2029
+ /* @__PURE__ */ r.jsx(ee.Control, { type: "number", placeholder: l ?? o, size: i, value: s ? b : e ?? "", onChange: N, className: `luminus-numeric-stepper ${p ?? ""}`, hidden: c, disabled: d ?? !1, step: h }),
2030
+ /* @__PURE__ */ r.jsx("div", { className: "stepper-icon left", children: !d && /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (j) => {
2031
+ j.preventDefault(), j.stopPropagation(), m(((e ?? 0) - v).toString());
2032
+ }, children: /* @__PURE__ */ r.jsx(Er, {}) }) }),
2033
+ /* @__PURE__ */ r.jsx("div", { className: "stepper-icon right", children: !d && /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (j) => {
2034
+ j.preventDefault(), j.stopPropagation(), m(((e ?? 0) + v).toString());
2035
+ }, children: /* @__PURE__ */ r.jsx(Or, {}) }) }),
2036
+ u && e && n && !d && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: y, children: /* @__PURE__ */ r.jsx(fe, {}) }) })
2323
2037
  ] }) });
2324
- }, cl = "_card_19733_1", il = "_header_19733_6", dl = "_header-content_19733_13", ul = "_title_19733_19", fl = "_collapse-icon_19733_22", pl = "_collapsed_19733_27", hl = "_content_19733_30", _e = {
2325
- card: cl,
2326
- header: il,
2327
- "header-content": "_header-content_19733_13",
2328
- headerContent: dl,
2329
- title: ul,
2330
- "collapse-icon": "_collapse-icon_19733_22",
2331
- collapseIcon: fl,
2332
- collapsed: pl,
2333
- content: hl
2334
- }, ml = ({ title: t, headerContent: e, children: n, className: s, headerClassName: o, contentClassName: a, ...l }) => {
2335
- const i = l.collapsible ? l.controlled ? !1 : l.defaultOpen ?? !1 : !0, [c, d] = E(i), u = l.collapsible ? l.controlled ? l.isOpen : c : !0;
2336
- return T(() => {
2337
- d(i);
2338
- }, [i]), /* @__PURE__ */ r.jsxs("div", { className: g("luminus-card rounded shadow-sm", _e.card, {
2339
- [s ?? ""]: s
2340
- }), children: [
2341
- /* @__PURE__ */ r.jsxs("div", { role: l.collapsible ? "button" : void 0, className: g("header", _e.header, {
2342
- [o ?? ""]: o
2343
- }), onClick: () => {
2344
- l.collapsible && (l.controlled ? l.onToggle(!l.isOpen) : d(!c));
2345
- }, children: [
2346
- /* @__PURE__ */ r.jsxs("div", { className: g("header-content", _e.headerContent), children: [
2347
- /* @__PURE__ */ r.jsx(Y, { variant: "h6", className: g("text-primary", _e.title), children: t }),
2348
- e ?? null
2349
- ] }),
2350
- l.collapsible && /* @__PURE__ */ r.jsx(vn, { className: g(_e.collapseIcon, {
2351
- [_e.collapsed]: u
2352
- }) })
2353
- ] }),
2354
- /* @__PURE__ */ r.jsx(En, { in: u, children: /* @__PURE__ */ r.jsx("div", { className: g("card-content border-top border-primary", _e.content, {
2355
- [a ?? ""]: a
2356
- }), children: n }) })
2357
- ] });
2358
- };
2359
- var gl = !!(typeof window < "u" && window.document && window.document.createElement), xl = /* @__PURE__ */ function() {
2360
- function t(e, n) {
2361
- for (var s = 0; s < n.length; s++) {
2362
- var o = n[s];
2363
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
2364
- }
2365
- }
2366
- return function(e, n, s) {
2367
- return n && t(e.prototype, n), s && t(e, s), e;
2368
- };
2369
- }();
2370
- function vl(t, e) {
2371
- if (!(t instanceof e))
2372
- throw new TypeError("Cannot call a class as a function");
2373
- }
2374
- function jl(t, e) {
2375
- if (!t)
2376
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2377
- return e && (typeof e == "object" || typeof e == "function") ? e : t;
2378
- }
2379
- function wl(t, e) {
2380
- if (typeof e != "function" && e !== null)
2381
- throw new TypeError("Super expression must either be null or a function, not " + typeof e);
2382
- t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
2383
- }
2384
- var Br = function(t) {
2385
- wl(e, t);
2386
- function e() {
2387
- return vl(this, e), jl(this, (e.__proto__ || Object.getPrototypeOf(e)).apply(this, arguments));
2388
- }
2389
- return xl(e, [{
2390
- key: "componentWillUnmount",
2391
- value: function() {
2392
- this.defaultNode && document.body.removeChild(this.defaultNode), this.defaultNode = null;
2393
- }
2394
- }, {
2395
- key: "render",
2396
- value: function() {
2397
- return gl ? (!this.props.node && !this.defaultNode && (this.defaultNode = document.createElement("div"), document.body.appendChild(this.defaultNode)), He.createPortal(this.props.children, this.props.node || this.defaultNode)) : null;
2398
- }
2399
- }]), e;
2400
- }(oe.Component);
2401
- Br.propTypes = {
2402
- children: Ne.node.isRequired,
2403
- node: Ne.any
2404
- };
2405
- var yl = /* @__PURE__ */ function() {
2406
- function t(e, n) {
2407
- for (var s = 0; s < n.length; s++) {
2408
- var o = n[s];
2409
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
2410
- }
2411
- }
2412
- return function(e, n, s) {
2413
- return n && t(e.prototype, n), s && t(e, s), e;
2414
- };
2415
- }();
2416
- function _l(t, e) {
2417
- if (!(t instanceof e))
2418
- throw new TypeError("Cannot call a class as a function");
2419
- }
2420
- function bl(t, e) {
2421
- if (!t)
2422
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2423
- return e && (typeof e == "object" || typeof e == "function") ? e : t;
2424
- }
2425
- function Nl(t, e) {
2426
- if (typeof e != "function" && e !== null)
2427
- throw new TypeError("Super expression must either be null or a function, not " + typeof e);
2428
- t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
2429
- }
2430
- var Lr = function(t) {
2431
- Nl(e, t);
2432
- function e() {
2433
- return _l(this, e), bl(this, (e.__proto__ || Object.getPrototypeOf(e)).apply(this, arguments));
2434
- }
2435
- return yl(e, [{
2436
- key: "componentDidMount",
2437
- value: function() {
2438
- this.renderPortal();
2439
- }
2440
- }, {
2441
- key: "componentDidUpdate",
2442
- value: function(s) {
2443
- this.renderPortal();
2444
- }
2445
- }, {
2446
- key: "componentWillUnmount",
2447
- value: function() {
2448
- He.unmountComponentAtNode(this.defaultNode || this.props.node), this.defaultNode && document.body.removeChild(this.defaultNode), this.defaultNode = null, this.portal = null;
2449
- }
2450
- }, {
2451
- key: "renderPortal",
2452
- value: function(s) {
2453
- !this.props.node && !this.defaultNode && (this.defaultNode = document.createElement("div"), document.body.appendChild(this.defaultNode));
2454
- var o = this.props.children;
2455
- typeof this.props.children.type == "function" && (o = oe.cloneElement(this.props.children)), this.portal = He.unstable_renderSubtreeIntoContainer(this, o, this.props.node || this.defaultNode);
2456
- }
2457
- }, {
2458
- key: "render",
2459
- value: function() {
2460
- return null;
2461
- }
2462
- }]), e;
2463
- }(oe.Component);
2464
- Lr.propTypes = {
2465
- children: Ne.node.isRequired,
2466
- node: Ne.any
2467
- };
2468
- var it = void 0;
2469
- He.createPortal ? it = Br : it = Lr;
2470
- const $l = "_lightbox_14acg_1", kl = "_show_14acg_16", Cl = "_header_14acg_20", Dl = "_photo-actions_14acg_26", Il = "_photo-container_14acg_31", Sl = "_photo_14acg_26", El = "_nav-button_14acg_41", Ol = "_photos-preview_14acg_49", Ml = "_selected_14acg_62", Fl = "_default-indicator_14acg_66", ae = {
2471
- lightbox: $l,
2472
- show: kl,
2473
- header: Cl,
2474
- "photo-actions": "_photo-actions_14acg_26",
2475
- photoActions: Dl,
2476
- "photo-container": "_photo-container_14acg_31",
2477
- photoContainer: Il,
2478
- photo: Sl,
2479
- "nav-button": "_nav-button_14acg_41",
2480
- navButton: El,
2481
- "photos-preview": "_photos-preview_14acg_49",
2482
- photosPreview: Ol,
2483
- selected: Ml,
2484
- "default-indicator": "_default-indicator_14acg_66",
2485
- defaultIndicator: Fl
2486
- }, Tl = "_backdrop_3huvf_1", Rl = "_show_3huvf_11", tn = {
2487
- backdrop: Tl,
2488
- show: Rl
2489
- }, Ar = ({ show: t, onClick: e }) => /* @__PURE__ */ r.jsx("div", { className: g("luminus-backdrop", tn.backdrop, {
2490
- [tn.show]: t
2491
- }), onClick: () => e && e() }), Hr = ({ src: t, alt: e, baseUrl: n, customToken: s, placeholder: o, ...a }) => /* @__PURE__ */ r.jsx("img", { ...a, alt: e ?? "", src: t ?? o }), Bl = ({ show: t, onClose: e, photos: n, defaultIndex: s, uploadPhotosText: o, noPhotosText: a, onUploadPhotos: l, photoActions: i, baseUrl: c, customToken: d, placeholder: u, ImgComponent: f = Hr }) => {
2492
- const p = V(null), [h, v] = E(s), y = n.at(h), x = h > 0, b = h < n.length - 1;
2493
- T(() => {
2494
- t && v(s);
2495
- }, [s, t]), T(() => {
2496
- h >= n.length && v(n.length - 1);
2497
- }, [n, h]);
2498
- const k = D((m) => {
2499
- switch (m.key) {
2500
- case "ArrowLeft":
2501
- m.stopPropagation(), x && v((N) => N - 1);
2502
- break;
2503
- case "ArrowRight":
2504
- m.stopPropagation(), b && v((N) => N + 1);
2505
- break;
2506
- case "Escape":
2507
- m.stopPropagation(), e();
2508
- break;
2509
- }
2510
- }, [b, x, e]);
2511
- return kn(k), /* @__PURE__ */ r.jsxs(it, { children: [
2512
- /* @__PURE__ */ r.jsx(Ar, { show: t, onClick: e }),
2513
- /* @__PURE__ */ r.jsxs("div", { ref: p, className: g("luminus-lightbox rounded shadow", ae.lightbox, {
2514
- [ae.show]: t
2515
- }), children: [
2516
- /* @__PURE__ */ r.jsxs("div", { className: ae.header, children: [
2517
- /* @__PURE__ */ r.jsxs("div", { className: g("rounded", ae.photoActions), children: [
2518
- l && /* @__PURE__ */ r.jsx(Ir, { accept: ".jpg,.jpeg,.png", onUpload: (m) => {
2519
- m.length > 0 && l(Array.from(m));
2520
- }, icon: /* @__PURE__ */ r.jsx(jn, { style: { fontSize: 18 } }), multiple: !0, className: "me-3", children: o ?? null }),
2521
- y && (i == null ? void 0 : i.map(({ label: m, onClick: N, ...j }, $) => /* @__PURE__ */ r.jsx(
2522
- ct,
2523
- {
2524
- onClick: () => N(y.id),
2525
- ...j,
2526
- children: m
2527
- },
2528
- `action-${$}`
2529
- )))
2530
- ] }),
2531
- /* @__PURE__ */ r.jsx("div", { role: "button", onClick: e, children: /* @__PURE__ */ r.jsx(fe, { style: { fontSize: "32px" } }) })
2532
- ] }),
2533
- n.length === 0 && /* @__PURE__ */ r.jsx("div", { className: "w-100 h-100 d-flex align-items-center justify-content-center", children: /* @__PURE__ */ r.jsx(Y, { variant: "body", children: a ?? "No photos available" }) }),
2534
- y && /* @__PURE__ */ r.jsxs("div", { className: ae.photoContainer, children: [
2535
- /* @__PURE__ */ r.jsx("div", { role: x ? "button" : void 0, className: g("align-items-start", ae.navButton), onClick: () => x && v((m) => m - 1), children: x && /* @__PURE__ */ r.jsx(ft, { style: { fontSize: "40px" } }) }),
2536
- /* @__PURE__ */ r.jsx(f, { src: y.lgSrc, alt: y.alt, className: g("rounded", ae.photo), baseUrl: c, customToken: d, placeholder: u }),
2537
- /* @__PURE__ */ r.jsx("div", { role: b ? "button" : void 0, className: g("align-items-end", ae.navButton), onClick: () => b && v((m) => m + 1), children: b && /* @__PURE__ */ r.jsx(pt, { style: { fontSize: "40px" } }) })
2538
- ] }),
2539
- /* @__PURE__ */ r.jsx("div", { className: ae.photosPreview, children: n.map((m, N) => /* @__PURE__ */ r.jsxs("div", { role: "button", onClick: () => v(N), className: "position-relative", children: [
2540
- /* @__PURE__ */ r.jsx(f, { role: N !== h ? "button" : void 0, src: m.smSrc, alt: m.alt, className: g("rounded", ae.photo, {
2541
- [ae.selected]: N === h
2542
- }), baseUrl: c, customToken: d, placeholder: u }, m.id),
2543
- m.isDefault && /* @__PURE__ */ r.jsx("div", { className: g("text-primary", ae.defaultIndicator), children: /* @__PURE__ */ r.jsx(js, {}) })
2544
- ] })) })
2545
- ] })
2546
- ] });
2547
- }, Hc = ({ photos: t, onUploadPhotos: e, uploadPhotosText: n, photoActions: s, baseUrl: o, customToken: a, placeholder: l, ImgComponent: i = Hr }) => {
2548
- const [c, d] = E(null), u = c !== null ? t[c] : null, [f, p] = E(!1);
2549
- return T(() => {
2550
- if (t.length === 0) {
2551
- d(null), p(!1);
2552
- return;
2553
- }
2554
- const h = t.findIndex((v) => v.isDefault);
2555
- d(h > -1 ? h : 0);
2556
- }, [t]), u ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2557
- /* @__PURE__ */ r.jsx(i, { role: "button", src: u.smSrc, alt: u.alt, className: "rounded w-100", onClick: () => p(!0), baseUrl: o, customToken: a, placeholder: l }),
2558
- /* @__PURE__ */ r.jsx(Bl, { show: f, onClose: () => p(!1), photos: t, defaultIndex: c ?? 0, uploadPhotosText: n, onUploadPhotos: e, photoActions: s, baseUrl: o, customToken: a, placeholder: l, ImgComponent: i })
2559
- ] }) : e ? /* @__PURE__ */ r.jsx(Ir, { accept: ".jpg,.jpeg,.png", onUpload: (h) => {
2560
- h.length > 0 && e(Array.from(h));
2561
- }, icon: /* @__PURE__ */ r.jsx(jn, { style: { fontSize: 18 } }), multiple: !0, children: n ?? null }) : null;
2562
- }, Wc = ({ appAccessPermissions: t, children: e }) => {
2563
- const { useMsal: n, msalScopes: s } = W(ws), { isAuthenticated: o } = ys(), { userLoginState: a } = W(_s), l = a.state === bs.LOGGING_IN, i = a.user && (t == null ? void 0 : t.every((c) => {
2564
- var d, u;
2565
- return (u = (d = a.user) == null ? void 0 : d.permissions) == null ? void 0 : u.includes(c);
2566
- }));
2567
- return n ? /* @__PURE__ */ r.jsx(As, { interactionType: Ls.Redirect, authenticationRequest: { scopes: s }, children: l || !o() ? /* @__PURE__ */ r.jsx(Ft, {}) : a.user ? i ? /* @__PURE__ */ r.jsx(r.Fragment, { children: e }) : /* @__PURE__ */ r.jsx(Re, { to: "/user-not-permitted", replace: !0 }) : /* @__PURE__ */ r.jsx(Re, { to: "/no-user-login", replace: !0 }) }) : l ? /* @__PURE__ */ r.jsx(Ft, {}) : !o() || !a.user ? /* @__PURE__ */ r.jsx(Re, { to: "/login", replace: !0 }) : i ? e : /* @__PURE__ */ r.jsx(Re, { to: "/user-not-permitted", replace: !0 });
2568
- }, Ll = (t) => {
2569
- const { variant: e, children: n, className: s, size: o = "md", typographyVariant: a = o === "sm" ? "body2" : "body", ...l } = { ...t };
2570
- return /* @__PURE__ */ r.jsx(uo, { variant: e, className: `text-center ${o === "sm" ? "p-1" : o === "md" ? "p-3" : "p-4"} bg-${e} bg-opacity-10 border-none ${s ?? ""}`, ...l, children: /* @__PURE__ */ r.jsx(Y, { variant: a, children: n }) });
2571
- }, Al = "_item_1lf6j_1", Hl = "_level-success_1lf6j_4", Wl = "_level-info_1lf6j_10", Pl = "_level-warning_1lf6j_16", Vl = "_level-danger_1lf6j_22", zl = "_type-icon_1lf6j_28", tt = {
2572
- item: Al,
2573
- "level-success": "_level-success_1lf6j_4",
2574
- levelSuccess: Hl,
2575
- "level-info": "_level-info_1lf6j_10",
2576
- levelInfo: Wl,
2577
- "level-warning": "_level-warning_1lf6j_16",
2578
- levelWarning: Pl,
2579
- "level-danger": "_level-danger_1lf6j_22",
2580
- levelDanger: Vl,
2581
- "type-icon": "_type-icon_1lf6j_28",
2582
- typeIcon: zl
2583
- }, Yl = ({ level: t, children: e, customIcon: n, noIcon: s }) => {
2584
- const { ProjectIconComponent: o } = W(ce), a = D(() => {
2585
- switch (t) {
2586
- case "info":
2587
- return /* @__PURE__ */ r.jsx(o, { icon: "info" });
2588
- case "warning":
2589
- return /* @__PURE__ */ r.jsx(o, { icon: "warning" });
2590
- case "danger":
2591
- return /* @__PURE__ */ r.jsx(o, { icon: "danger" });
2592
- default:
2593
- return /* @__PURE__ */ r.jsx(o, { icon: "check" });
2594
- }
2595
- }, [o, t]);
2596
- return /* @__PURE__ */ r.jsxs("div", { className: g("p-2 rounded d-flex gap-1 align-items-center justify-content-between", { "ps-1": !s }, tt.item, tt[`level-${t}`]), children: [
2597
- !s && /* @__PURE__ */ r.jsx("div", { className: g(tt.typeIcon), children: n ?? a() }),
2598
- /* @__PURE__ */ r.jsx(Y, { variant: "body2", className: "w-100", children: e })
2599
- ] });
2600
- }, Pc = ({ version: t }) => /* @__PURE__ */ r.jsx("div", { className: "rounded", style: {
2601
- position: "fixed",
2602
- right: "0px",
2603
- bottom: "0px",
2604
- zIndex: "10000",
2605
- backgroundColor: "rgba(255, 255, 255, 0.5)",
2606
- padding: "4px",
2607
- pointerEvents: "all"
2608
- }, children: /* @__PURE__ */ r.jsxs(Y, { variant: "caption", className: "w-100 text-end", children: [
2609
- "verze ",
2610
- t
2611
- ] }) }), Gl = "_submit-container_a9slg_1", Ul = "_spacer_a9slg_14", nn = {
2612
- "submit-container": "_submit-container_a9slg_1",
2613
- submitContainer: Gl,
2614
- spacer: Ul
2615
- }, Kl = ({ children: t, noSpacer: e = !1 }) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2616
- !e && /* @__PURE__ */ r.jsx("div", { className: nn.spacer }),
2617
- /* @__PURE__ */ r.jsx("div", { className: g("luminus-floating-action-container shadow", nn.submitContainer), children: t })
2618
- ] }), ql = "_timeline_g1754_1", Ql = "_step-container_g1754_1", Jl = "_step-date_g1754_1", Xl = "_step-content_g1754_4", Zl = "_content-header_g1754_8", ec = "_content-text_g1754_11", tc = "_step-icon_g1754_14", be = {
2619
- timeline: ql,
2620
- "step-container": "_step-container_g1754_1",
2621
- stepContainer: Ql,
2622
- "step-date": "_step-date_g1754_1",
2623
- stepDate: Jl,
2624
- "step-content": "_step-content_g1754_4",
2625
- stepContent: Xl,
2626
- "content-header": "_content-header_g1754_8",
2627
- contentHeader: Zl,
2628
- "content-text": "_content-text_g1754_11",
2629
- contentText: ec,
2630
- "step-icon": "_step-icon_g1754_14",
2631
- stepIcon: tc
2632
- }, Vc = ({ steps: t }) => /* @__PURE__ */ r.jsx("div", { className: be.timeline, children: t.sort((e, n) => Us(e.date ?? /* @__PURE__ */ new Date(), n.date ?? /* @__PURE__ */ new Date())).map((e, n) => /* @__PURE__ */ r.jsxs("div", { className: g("row g-0 gx-3", be.stepContainer), children: [
2633
- /* @__PURE__ */ r.jsx("div", { className: "col-3", children: e.date && /* @__PURE__ */ r.jsxs(Y, { variant: "caption", className: g("h-100 d-flex flex-column align-items-end justify-content-center gap-0", be.stepDate), children: [
2634
- /* @__PURE__ */ r.jsx("div", { children: Ee(e.date, "dd.MM.yyyy") }),
2635
- /* @__PURE__ */ r.jsx("div", { children: Ee(e.date, "HH:mm") })
2636
- ] }) }),
2637
- /* @__PURE__ */ r.jsx("div", { className: "col-9", children: /* @__PURE__ */ r.jsxs("div", { className: g("h-100 d-flex flex-column gap-1 border-start border-2 p-3", be.stepContent), children: [
2638
- /* @__PURE__ */ r.jsxs("div", { className: g("d-flex gap-2 align-items-center", be.contentHeader), children: [
2639
- e.person && /* @__PURE__ */ r.jsx(wn, { name: e.person.name ?? "", size: 22, fontSize: 12 }),
2640
- typeof e.title == "string" ? /* @__PURE__ */ r.jsx(Y, { variant: "body", className: "fw-bold", children: e.title }) : e.title
2641
- ] }),
2642
- e.text && /* @__PURE__ */ r.jsx(Y, { variant: "body2", className: be.contentText, children: e.text }),
2643
- /* @__PURE__ */ r.jsx("div", { className: g("text-primary", be.stepIcon), children: e.icon ?? /* @__PURE__ */ r.jsx(Ns, {}) })
2644
- ] }) })
2645
- ] }, n)) }), nc = (t, e, n, s = !0) => {
2646
- const o = mt({ silent: s, differentBaseUrl: e, customToken: n }), [a, l] = E(!1), [i, c] = E(null), d = D(async (u) => {
2647
- l(!0), c(null), o.get(t, {
2648
- signal: u,
2649
- responseType: "blob"
2650
- }).then((f) => {
2651
- l(!1), c(f.data);
2652
- }).catch(() => {
2653
- l(!1), c(null);
2654
- });
2655
- }, [o, t]);
2656
- return T(() => {
2657
- const u = new AbortController();
2658
- return d(u.signal), () => {
2659
- u.abort();
2660
- };
2661
- }, [d]), { data: i, setData: c, reloadData: d, isLoading: a };
2662
- }, zc = ({ src: t, alt: e, baseUrl: n, customToken: s, placeholder: o, ...a }) => {
2663
- const { data: l } = nc(t, n, s), [i, c] = E(null);
2664
- return T(() => {
2665
- let d = null;
2666
- return l !== null ? (d = URL.createObjectURL(l), c(d)) : c(null), () => {
2667
- d !== null && URL.revokeObjectURL(d);
2668
- };
2669
- }, [l]), i === null && !o ? null : /* @__PURE__ */ r.jsx("img", { ...a, alt: e ?? "", src: i ?? o });
2670
- }, Wr = ({ currentSelection: t, selectedItemNavigateTo: e, children: n }) => {
2671
- if (!t || !t.id || !e)
2672
- return /* @__PURE__ */ r.jsx("div", { className: "luminus-input-container position-relative w-100", children: n });
2673
- const s = e(t);
2674
- return /* @__PURE__ */ r.jsx(ke, { to: s, className: "luminus-input-container position-relative w-100 text-decoration-none", children: n });
2675
- }, Yc = ({ InputContainer: t = Ce, label: e, value: n, onChange: s, hidden: o, disabled: a, className: l, type: i, withoutLabel: c }) => /* @__PURE__ */ r.jsx(t, { isForCheckInput: !0, hidden: o, label: e ?? "", withoutLabel: c, className: l, children: /* @__PURE__ */ r.jsx(ee.Check, { id: `check-${e}`, type: i ?? "checkbox", label: e ?? "", checked: n, onChange: (d) => {
2676
- var u;
2677
- s && s(((u = d.target) == null ? void 0 : u.checked) ?? !1);
2678
- }, className: l ?? "", hidden: o ?? !1, disabled: a ?? !1 }) }), rn = ({ InputContainer: t = Ce, type: e, value: n, onChange: s, debounceMs: o, label: a, withoutLabel: l, placeholder: i, size: c, hidden: d, disabled: u, showClearIcon: f, clearValue: p, list: h, className: v, step: y, noSelectOnFocus: x }) => {
2679
- const b = e === "number", k = D(() => {
2680
- if (!s)
2681
- return;
2682
- const w = p ?? null;
2683
- s(b ? w ? Number(w) : null : (w == null ? void 0 : w.toString()) ?? "");
2684
- }, [p, b, s]), m = V(null), [N, j] = E((n == null ? void 0 : n.toString()) ?? ""), $ = D((w) => {
2685
- const C = w;
2686
- s && (b && s(C == null || C === "" ? null : Number(C)), s(C || null));
2687
- }, [b, s]), _ = D((w) => {
2688
- var L;
2689
- const C = (L = w.target) == null ? void 0 : L.value;
2690
- if (!o) {
2691
- $(C);
2692
- return;
2693
- }
2694
- j(C), m.current !== null && window.clearTimeout(m.current), m.current = window.setTimeout(() => {
2695
- $(C);
2696
- }, o);
2697
- }, [o, $]);
2698
- T(() => {
2699
- j(n === null ? "" : n.toString());
2700
- }, [n]);
2701
- const [M, I] = E(!1), S = Dn(e, n ? n.toString() ?? null : null, M);
2702
- return /* @__PURE__ */ r.jsxs(t, { withoutLabel: l, label: a ?? "", hidden: d, className: v, children: [
2703
- /* @__PURE__ */ r.jsx(ee.Control, { type: S, placeholder: i ?? a, size: c, value: o ? N : (n == null ? void 0 : n.toString()) ?? "", onChange: _, className: v ?? "", hidden: d, disabled: u ?? !1, list: h, onFocus: (w) => {
2704
- I(!0), !x && w.target.select();
2705
- }, onBlur: () => I(!1), step: y }),
2706
- f && n !== null && s && !u && /* @__PURE__ */ r.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: k, children: /* @__PURE__ */ r.jsx(fe, {}) }) })
2707
- ] });
2708
- }, Gc = ({
2709
- InputContainer: t = Ce,
2710
- value: e,
2711
- options: n,
2712
- onChange: s,
2713
- label: o,
2714
- withoutLabel: a,
2715
- isNumber: l,
2716
- size: i,
2717
- hidden: c,
2718
- disabled: d,
2719
- showClearIcon: u,
2720
- clearValue: f,
2721
- noSortOptions: p,
2722
- className: h,
2723
- noEmptyOption: v
2724
- // it will still add the empty option if there is no value provided or value is empty string or null
2725
- }) => {
2726
- const y = D(() => {
2727
- if (!s)
2728
- return;
2729
- const x = f ?? null;
2730
- s(l ? x ? Number(x) : null : (x == null ? void 0 : x.toString()) ?? "");
2731
- }, [f, l, s]);
2732
- return /* @__PURE__ */ r.jsxs(t, { withoutLabel: a, label: o ?? "", hidden: c, className: h, children: [
2733
- /* @__PURE__ */ r.jsxs(ee.Select, { size: i, value: e ?? "", onChange: (x) => {
2734
- var k;
2735
- if (!s)
2736
- return;
2737
- const b = (k = x.target) == null ? void 0 : k.value;
2738
- l && s(b ? parseInt(b, 10) : null), s(b || null);
2739
- }, className: h ?? "", hidden: c, disabled: d ?? !1, children: [
2740
- v && !(e == null || e === "") ? void 0 : /* @__PURE__ */ r.jsx("option", { value: "" }),
2741
- n == null ? void 0 : n.sort((x, b) => p ? 0 : (x.name ?? "").localeCompare(b.name ?? "")).map((x) => /* @__PURE__ */ r.jsx("option", { value: x.id ?? "", children: x.name }, x.id))
2742
- ] }),
2743
- u && e && s && !d && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: y, children: /* @__PURE__ */ r.jsx(fe, {}) }) })
2744
- ] });
2745
- }, Uc = ({ InputContainer: t = Ce, items: e, defaultSelection: n, selectedItemNavigateTo: s, onSearchQueryChange: o, texts: a, isLoading: l, isNumber: i, onSelect: c, label: d, withoutLabel: u, size: f, dropdownItemsNameWidth: p, additionalColumns: h, hidden: v, disabled: y, displayIdAsName: x, CustomOnChangeComponent: b, className: k }) => {
2746
- var C, L;
2747
- const [m, N] = E(n), [j, $] = E(!1);
2748
- T(() => {
2749
- N(n);
2750
- }, [n]);
2751
- const _ = D((H) => {
2752
- N(H);
2753
- }, []), M = D((H) => {
2754
- $(!1), _(H);
2755
- }, [_]);
2756
- T(() => {
2757
- c && c(m);
2758
- }, [m, c]);
2759
- const I = V(null), S = s !== void 0, w = S && m !== null;
2760
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(t, { withoutLabel: u, label: d ?? "", hidden: v, inputContainerClassName: g({ "luminus-dropdown-select-open": j }), className: k, children: [
2761
- /* @__PURE__ */ r.jsxs(Wr, { currentSelection: m, selectedItemNavigateTo: s, children: [
2762
- x && (m == null ? void 0 : m.name) && /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: m.name }),
2763
- /* @__PURE__ */ r.jsxs(ee.Select, { ref: I, size: f, value: (m == null ? void 0 : m.id) ?? "", onChange: (H) => N({
2764
- id: i ? Number(H.target.value) ?? null : H.target.value,
2765
- name: ""
2766
- }), onMouseDown: (H) => {
2767
- H.currentTarget.focus(), H.preventDefault();
2768
- }, onClick: () => {
2769
- !S && !y && $(!0);
2770
- }, className: g("w-100", {
2771
- "luminus-dropdown-picker-disabled": y,
2772
- "luminus-dropdown-picker-link": w
2773
- }), hidden: v, children: [
2774
- /* @__PURE__ */ r.jsx("option", { value: "" }),
2775
- n && /* @__PURE__ */ r.jsx("option", { value: n.id ?? void 0, children: n.name && ((C = n.name) == null ? void 0 : C.length) > 0 ? n.name : n.id }),
2776
- m && /* @__PURE__ */ r.jsx("option", { value: m.id ?? void 0, children: m.name && ((L = m.name) == null ? void 0 : L.length) > 0 ? m.name : m.id })
2777
- ] }),
2778
- b || !y && S ? /* @__PURE__ */ r.jsxs("div", { className: "custom-picker-button", children: [
2779
- !b && !y && S && /* @__PURE__ */ r.jsx(G, { size: "sm", color: "secondary", onClick: (H) => {
2780
- H.preventDefault(), H.stopPropagation(), $(!0);
2781
- }, children: /* @__PURE__ */ r.jsx(yn, {}) }),
2782
- b ?? null
2783
- ] }) : null
2784
- ] }),
2785
- I.current && /* @__PURE__ */ r.jsx(kt, { show: j, onCancel: () => $(!1), items: e, currentSelection: m, onSelectionChange: M, onSearchQueryChange: o, texts: a, itemsNameWidth: p, additionalColumns: h, isLoading: l, disabled: y, inputRef: I })
2786
- ] }) });
2787
- }, Kc = ({ InputContainer: t = Ce, value: e, onChange: n, label: s, size: o, showClearIcon: a, clearValue: l, hidden: i, disabled: c, rows: d, withoutLabel: u, debounceMs: f, className: p }) => {
2788
- const h = D(() => {
2789
- if (!n)
2790
- return;
2791
- const m = l ?? null;
2792
- n((m == null ? void 0 : m.toString()) ?? "");
2793
- }, [l, n]), v = V(null), [y, x] = E((e == null ? void 0 : e.toString()) ?? ""), b = D((m) => {
2794
- const N = m;
2795
- n && n(N || null);
2796
- }, [n]), k = D((m) => {
2797
- var j;
2798
- const N = (j = m.target) == null ? void 0 : j.value;
2799
- if (!f) {
2800
- b(N);
2801
- return;
2802
- }
2803
- x(N), v.current !== null && window.clearTimeout(v.current), v.current = window.setTimeout(() => {
2804
- b(N);
2805
- }, f);
2806
- }, [f, b]);
2807
- return T(() => {
2808
- x(e === null ? "" : e.toString());
2809
- }, [e]), /* @__PURE__ */ r.jsxs(t, { label: s ?? "", hidden: i, withoutLabel: u, className: p, isForTextAreaInput: !0, children: [
2810
- /* @__PURE__ */ r.jsx(ee.Control, { as: "textarea", size: o, value: f ? y : e ?? "", onChange: k, hidden: i, disabled: c, rows: d ?? 2, className: "w-100" }),
2811
- a && e && n && !c && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: h, children: /* @__PURE__ */ r.jsx(fe, {}) }) })
2812
- ] });
2813
- }, qc = ({ InputContainer: t = Ce, value: e, onChange: n, debounceMs: s, label: o, withoutLabel: a, placeholder: l, size: i, hidden: c, disabled: d, showClearIcon: u, clearValue: f, className: p, step: h, stepperStep: v = 1 }) => {
2814
- const y = D(() => {
2815
- if (!n)
2816
- return;
2817
- const j = f ?? null;
2818
- n(j ? Number(j) : null);
2819
- }, [f, n]), x = V(null), [b, k] = E((e == null ? void 0 : e.toString()) ?? ""), m = D((j) => {
2820
- const $ = j;
2821
- n && n($ == null || $ === "" ? null : Number($));
2822
- }, [n]), N = D((j) => {
2823
- var _;
2824
- const $ = (_ = j.target) == null ? void 0 : _.value;
2825
- if (!s) {
2826
- m($);
2827
- return;
2828
- }
2829
- k($), x.current !== null && window.clearTimeout(x.current), x.current = window.setTimeout(() => {
2830
- m($);
2831
- }, s);
2832
- }, [s, m]);
2833
- return T(() => {
2834
- k(e === null ? "" : e.toString());
2835
- }, [e]), /* @__PURE__ */ r.jsx(t, { withoutLabel: a, label: o ?? "", hidden: c, className: p, children: /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
2836
- /* @__PURE__ */ r.jsx(ee.Control, { type: "number", placeholder: l ?? o, size: i, value: s ? b : e ?? "", onChange: N, className: `luminus-numeric-stepper ${p ?? ""}`, hidden: c, disabled: d ?? !1, step: h }),
2837
- /* @__PURE__ */ r.jsx("div", { className: "stepper-icon left", children: !d && /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (j) => {
2838
- j.preventDefault(), j.stopPropagation(), m(((e ?? 0) - v).toString());
2839
- }, children: /* @__PURE__ */ r.jsx(Er, {}) }) }),
2840
- /* @__PURE__ */ r.jsx("div", { className: "stepper-icon right", children: !d && /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (j) => {
2841
- j.preventDefault(), j.stopPropagation(), m(((e ?? 0) + v).toString());
2842
- }, children: /* @__PURE__ */ r.jsx(Or, {}) }) }),
2843
- u && e && n && !d && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: y, children: /* @__PURE__ */ r.jsx(fe, {}) }) })
2844
- ] }) });
2845
- }, sn = [
2846
- ["D", "day"],
2847
- // ['W', 'week'],
2848
- ["M", "month"],
2849
- ["Y", "year"],
2850
- ["C", "custom"]
2851
- ], rc = "_wrapper_qfqux_1", sc = "_lg_qfqux_7", oc = "_sm_qfqux_11", ac = "_md_qfqux_14", on = {
2852
- wrapper: rc,
2853
- lg: sc,
2854
- sm: oc,
2855
- md: ac
2856
- }, Ae = (t) => {
2857
- const e = new Date(t), n = ge(e.toISOString());
2858
- e.setMonth(e.getMonth() + 1), e.setDate(e.getDate() - 1);
2859
- const s = ge(e.toISOString());
2860
- return { from: n, to: s };
2861
- }, Ie = (t) => {
2862
- const e = new Date(t), n = ge(e.toISOString());
2863
- e.setFullYear(e.getFullYear() + 1), e.setDate(e.getDate() - 1);
2864
- const s = ge(e.toISOString());
2865
- return { from: n, to: s };
2866
- }, lc = (t, e) => {
2867
- if (t === null || e === null)
2868
- return "C";
2869
- if (t === e)
2870
- return "D";
2871
- const n = new Date(t);
2872
- return Ae(n).to === e ? "M" : Ie(n).to === e ? "Y" : (console.log(Ie(n), e), "C");
2873
- }, cc = (t, e, n) => {
2874
- const s = D((l, i) => {
2875
- if (t === "C") {
2876
- n((c) => ({ ...c, [l]: i }));
2877
- return;
2878
- }
2879
- switch (l) {
2880
- case "from":
2881
- n((c) => {
2882
- if (i === null)
2883
- return c;
2884
- const d = new Date(i);
2885
- if (t === "D") {
2886
- const u = ge(d.toISOString());
2887
- return {
2888
- from: u,
2889
- to: u
2890
- };
2891
- }
2892
- return t === "M" ? Ae(d) : t === "Y" ? Ie(d) : c;
2893
- });
2894
- break;
2895
- case "to":
2896
- e("C"), n((c) => ({ ...c, [l]: i }));
2897
- break;
2898
- }
2899
- }, [t, n, e]), o = D((l) => {
2900
- n((i) => {
2901
- if (i.from === null || i.to === null)
2902
- return i;
2903
- const c = new Date(i.from);
2904
- c.setHours(c.getHours() - c.getTimezoneOffset() / 60);
2905
- const d = new Date(i.to);
2906
- if (t === "D") {
2907
- c.setDate(c.getDate() + l);
2908
- const u = ge(c.toISOString());
2909
- return {
2910
- from: u,
2911
- to: u
2912
- };
2913
- }
2914
- return t === "M" ? (c.setMonth(c.getMonth() + l), Ae(c)) : t === "Y" ? (c.setFullYear(c.getFullYear() + l), Ie(c)) : {
2915
- from: ge(c.toISOString()),
2916
- to: ge(d.toISOString())
2917
- };
2918
- });
2919
- }, [t, n]), a = D((l) => {
2920
- l === "D" ? n((i) => ({ from: i.from, to: i.from })) : l === "M" ? n((i) => {
2921
- if (i.from === null)
2922
- return i;
2923
- const c = Hs(i.from);
2924
- return Ae(c);
2925
- }) : l === "Y" && n((i) => {
2926
- if (i.from === null)
2927
- return i;
2928
- const c = Ws(new Date(i.from).getFullYear());
2929
- return Ie(c);
2930
- }), e(l);
2931
- }, [n, e]);
2932
- return { setFromToProp: s, handleArrowClick: o, handleRangeChange: a };
2933
- }, Qc = ({ fromtoState: [t, e], className: n, size: s }) => {
2934
- const { texts: { date: o }, ProjectIconComponent: a } = W(ce), [l, i] = E("C"), { handleArrowClick: c, handleRangeChange: d, setFromToProp: u } = cc(l, i, e), f = z(() => l === "C", [l]), p = V(!0);
2935
- return T(() => {
2936
- if (p.current) {
2937
- const h = lc(t.from, t.to);
2938
- i(h), p.current = !1;
2939
- }
2940
- }, [t.from, t.to]), /* @__PURE__ */ r.jsxs("div", { className: g("d-inline-flex align-items-center gap-1", on.wrapper, on[s ?? "md"], n), children: [
2941
- /* @__PURE__ */ r.jsx(G, { disabled: f, onClick: () => {
2942
- c(-1);
2943
- }, children: /* @__PURE__ */ r.jsx(a, { icon: "chevron-left" }) }),
2944
- /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center gap-1", children: [
2945
- /* @__PURE__ */ r.jsx(rn, { type: "date", value: t.from, onChange: (h) => u("from", h === null ? null : h.toString()), InputContainer: Et, size: s }),
2946
- /* @__PURE__ */ r.jsx(Rr, { toggle: /* @__PURE__ */ r.jsx(Tr, { text: o[sn.find((h) => h[0] === l)[1]].substring(0, 1), as: $s }), children: sn.map((h) => /* @__PURE__ */ r.jsx(Fr, { disabled: h[0] === l, className: g(h[0] === l ? "text-black-50" : ""), onClick: () => d(h[0]), role: "button", children: o[h[1]] }, h[0])) }),
2947
- /* @__PURE__ */ r.jsx(rn, { type: "date", value: t.to, onChange: (h) => u("to", h === null ? null : h.toString()), InputContainer: Et, size: s })
2948
- ] }) }),
2949
- /* @__PURE__ */ r.jsx(G, { disabled: f, onClick: () => {
2950
- c(1);
2951
- }, children: /* @__PURE__ */ r.jsx(a, { icon: "chevron-right" }) })
2952
- ] });
2953
- }, Jc = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: s, type: o, required: a, hidden: l, disabled: i, withoutLabel: c, className: d }) => {
2038
+ }, Ac = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: s, type: o, required: a, hidden: l, disabled: i, withoutLabel: c, className: d }) => {
2954
2039
  const { register: u, formState: f, setValue: p } = pe(), [h, v] = E(void 0), [y, x] = E(!1);
2955
2040
  T(() => {
2956
2041
  const k = e.split(".");
@@ -2965,431 +2050,1346 @@ const $l = "_lightbox_14acg_1", kl = "_show_14acg_16", Cl = "_header_14acg_20",
2965
2050
  return /* @__PURE__ */ r.jsxs(t, { isForCheckInput: !0, hidden: l, label: `${n}${a ? " *" : ""}`, isInvalid: b, withoutLabel: c, className: d, children: [
2966
2051
  /* @__PURE__ */ r.jsx(ee.Check, { id: `check-${e}`, type: o ?? "checkbox", label: `${n}${a ? " *" : ""}`, ...u(e, {
2967
2052
  onChange: () => {
2968
- s && s.forEach((k) => p(k, null, { shouldDirty: !0, shouldValidate: y }));
2053
+ s && s.forEach((k) => p(k, null, { shouldDirty: !0, shouldValidate: y }));
2054
+ }
2055
+ }), isInvalid: b, hidden: l, disabled: i, className: "w-100" }),
2056
+ h && /* @__PURE__ */ r.jsx(ve, { message: h.message })
2057
+ ] });
2058
+ }, Hc = ({ InputContainer: t = xe, label: e, formField: n, options: s, resetsFields: o, required: a, disabled: l, hidden: i, className: c }) => {
2059
+ const { register: d, formState: u, setValue: f, watch: p } = pe(), [h, v] = E(void 0), [y, x] = E(!1), b = z(() => s, [s]);
2060
+ T(() => {
2061
+ const m = n.split(".");
2062
+ let N = u.errors;
2063
+ m.forEach((j) => {
2064
+ N !== void 0 && (N = N[j]);
2065
+ }), v(N);
2066
+ }, [u, n]), T(() => {
2067
+ u.isSubmitted && x(!0);
2068
+ }, [u]);
2069
+ const k = h !== void 0;
2070
+ return /* @__PURE__ */ r.jsxs(t, { isForRadioInput: !0, hidden: i, withoutLabel: !e, label: `${e}${a ? " *" : ""}`, isInvalid: k, className: c, children: [
2071
+ b.map((m) => /* @__PURE__ */ r.jsx(ee.Check, { id: `radio-${m.id}`, label: m.name, type: "radio", value: m.id ?? "", checked: p(n) === m.id, ...d(n, {
2072
+ onChange: () => {
2073
+ o && o.forEach((N) => f(N, null, { shouldDirty: !0, shouldValidate: y }));
2074
+ }
2075
+ }), isInvalid: k, hidden: i, disabled: l, className: "w-100" }, m.id)),
2076
+ h && /* @__PURE__ */ r.jsx(ve, { message: h.message })
2077
+ ] });
2078
+ }, Wc = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: s, size: o, showClearIcon: a, clearValue: l, required: i, hidden: c, disabled: d, rows: u, withoutLabel: f, customFormControlProps: p, className: h }) => {
2079
+ const { register: v, formState: y, setValue: x, watch: b } = pe(), [k, m] = E(void 0), [N, j] = E(!1), $ = D(() => {
2080
+ const I = l ?? null;
2081
+ x(e, (I == null ? void 0 : I.toString()) ?? "", { shouldDirty: !0, shouldValidate: N });
2082
+ }, [l, x, e, N]), _ = D(() => {
2083
+ const I = e.split(".");
2084
+ let S = y.errors;
2085
+ I.forEach((w) => {
2086
+ S !== void 0 && (S = S[w]);
2087
+ }), m(S);
2088
+ }, [y, e]);
2089
+ T(() => {
2090
+ _();
2091
+ }, [_]), T(() => {
2092
+ y.isSubmitted && j(!0);
2093
+ }, [y]);
2094
+ const M = k !== void 0;
2095
+ return /* @__PURE__ */ r.jsxs(t, { label: `${n}${i ? " *" : ""}`, hidden: c, withoutLabel: f, isInvalid: M, className: h, isForTextAreaInput: !0, children: [
2096
+ /* @__PURE__ */ r.jsx(ee.Control, { as: "textarea", size: o, ...v(e, {
2097
+ setValueAs: (I) => I == null || I === "" ? null : I,
2098
+ onChange: () => {
2099
+ s && s.forEach((I) => x(I, null, { shouldDirty: !0, shouldValidate: N }));
2969
2100
  }
2970
- }), isInvalid: b, hidden: l, disabled: i, className: "w-100" }),
2971
- h && /* @__PURE__ */ r.jsx(ve, { message: h.message })
2101
+ }), isInvalid: M, hidden: c, disabled: d, rows: u ?? 2, className: "w-100", ...p }),
2102
+ a && b(e) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: $, children: /* @__PURE__ */ r.jsx(fe, {}) }) }),
2103
+ k && /* @__PURE__ */ r.jsx(ve, { message: k.message })
2972
2104
  ] });
2973
- }, Xc = ({ InputContainer: t = xe, label: e, formField: n, options: s, resetsFields: o, required: a, disabled: l, hidden: i, className: c }) => {
2974
- const { register: d, formState: u, setValue: f, watch: p } = pe(), [h, v] = E(void 0), [y, x] = E(!1), b = z(() => s, [s]);
2105
+ }, Pc = ({ InputContainer: t = xe, type: e, formField: n, label: s, placeholder: o, size: a, resetsFields: l, showClearIcon: i, clearValue: c, required: d, hidden: u, disabled: f, withoutLabel: p, list: h, step: v, CustomOnChangeComponent: y, noSelectOnFocus: x, className: b }) => {
2106
+ const { register: k, formState: m, setValue: N, watch: j } = pe(), [$, _] = E(void 0), [M, I] = E(!1), S = D(() => {
2107
+ const R = c ?? null;
2108
+ e === "number" ? N(n, R !== null ? Number(R) : null, {
2109
+ shouldDirty: !0,
2110
+ shouldValidate: M
2111
+ }) : N(n, (R == null ? void 0 : R.toString()) ?? "", { shouldDirty: !0, shouldValidate: M });
2112
+ }, [c, e, N, n, M]), w = D(() => {
2113
+ const R = n.split(".");
2114
+ let U = m.errors;
2115
+ R.forEach((te) => {
2116
+ U !== void 0 && (U = U[te]);
2117
+ }), _(U);
2118
+ }, [m, n]);
2975
2119
  T(() => {
2976
- const m = n.split(".");
2977
- let N = u.errors;
2978
- m.forEach((j) => {
2979
- N !== void 0 && (N = N[j]);
2980
- }), v(N);
2981
- }, [u, n]), T(() => {
2982
- u.isSubmitted && x(!0);
2983
- }, [u]);
2984
- const k = h !== void 0;
2985
- return /* @__PURE__ */ r.jsxs(t, { isForRadioInput: !0, hidden: i, withoutLabel: !e, label: `${e}${a ? " *" : ""}`, isInvalid: k, className: c, children: [
2986
- b.map((m) => /* @__PURE__ */ r.jsx(ee.Check, { id: `radio-${m.id}`, label: m.name, type: "radio", value: m.id ?? "", checked: p(n) === m.id, ...d(n, {
2120
+ w();
2121
+ }, [w]), T(() => {
2122
+ m.isSubmitted && I(!0);
2123
+ }, [m]);
2124
+ const C = $ !== void 0, [L, H] = E(!1), Q = j(n), K = kn(e, Q ?? null, L);
2125
+ return /* @__PURE__ */ r.jsxs(t, { label: `${s}${d ? " *" : ""}`, hidden: u, withoutLabel: p, isInvalid: C, className: b, children: [
2126
+ /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
2127
+ /* @__PURE__ */ r.jsx(ee.Control, { type: K, placeholder: o ?? s, size: a, onFocus: (R) => {
2128
+ H(!0), !x && R.target.select();
2129
+ }, ...k(n, {
2130
+ setValueAs: (R) => e === "number" ? R == null || R === "" ? null : Number(R) : R == null || R === "" ? null : R,
2131
+ onChange: () => {
2132
+ l && l.forEach((R) => N(R, null, { shouldDirty: !0, shouldValidate: M }));
2133
+ },
2134
+ onBlur: () => H(!1)
2135
+ }), isInvalid: C, hidden: u, disabled: f, list: h, className: "w-100", step: v }),
2136
+ y && /* @__PURE__ */ r.jsx("div", { className: "custom-picker-button", children: y })
2137
+ ] }),
2138
+ i && j(n) && /* @__PURE__ */ r.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: S, children: /* @__PURE__ */ r.jsx(fe, {}) }) }),
2139
+ $ && /* @__PURE__ */ r.jsx(ve, { message: $.message })
2140
+ ] });
2141
+ }, Vc = ({ InputContainer: t = xe, formField: e, label: n, size: s, defaultSelection: o, resetsFields: a, isNumber: l, required: i, hidden: c, disabled: d, items: u, onSearchQueryChange: f, selectedItemNavigateTo: p, texts: h, dropdownItemsNameWidth: v, isLoading: y, withoutLabel: x, additionalColumns: b, CustomOnChangeComponent: k, displayIdAsName: m, onSelect: N, className: j }) => {
2142
+ const { formState: $, setValue: _, watch: M, control: I } = pe(), [S, w] = E(void 0), [C, L] = E(!1), [H, Q] = E(!1), K = M(e) ?? null, R = K === (o == null ? void 0 : o.id) ? o == null ? void 0 : o.name : M(`${e}-DropdownName`), U = z(() => K == null ? null : { id: K ?? null, name: R ?? "" }, [K, R]), te = D(() => {
2143
+ const P = e.split(".");
2144
+ let B = $.errors;
2145
+ P.forEach((X) => {
2146
+ B !== void 0 && (B = B[X]);
2147
+ }), w(B);
2148
+ }, [$, e]), q = D((P) => {
2149
+ if ((P == null ? void 0 : P.id) === K)
2150
+ return;
2151
+ if (N && N(P), a && a.forEach((X) => _(X, null, { shouldDirty: !0, shouldValidate: H })), P === null) {
2152
+ _(e, null, {
2153
+ shouldDirty: !0,
2154
+ shouldValidate: H
2155
+ }), _(`${e}-DropdownName`, null);
2156
+ return;
2157
+ }
2158
+ let B = null;
2159
+ l ? B = (P == null ? void 0 : P.id) !== null && (P == null ? void 0 : P.id) !== "" ? parseInt(P.id.toString(), 10) : null : B = P.id === null || P.id === void 0 || P.id === "" ? null : P.id, _(e, B, {
2160
+ shouldDirty: !0,
2161
+ shouldValidate: H
2162
+ }), _(`${e}-DropdownName`, P.name ?? "");
2163
+ }, [_, e, H, l, a, K, N]), F = D((P) => {
2164
+ L(!1), q(P);
2165
+ }, [q]), J = D(() => {
2166
+ L(!1);
2167
+ }, []);
2168
+ T(() => {
2169
+ te();
2170
+ }, [te]), T(() => {
2171
+ $.isSubmitted && Q(!0);
2172
+ }, [$]);
2173
+ const re = V(null), je = S !== void 0, ne = p !== void 0, ie = ne && U !== null;
2174
+ return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(t, { label: `${n}${i ? " *" : ""}`, hidden: c, withoutLabel: x, isInvalid: je, inputContainerClassName: g({ "luminus-dropdown-select-open": C }), className: j, children: [
2175
+ /* @__PURE__ */ r.jsxs(Sr, { currentSelection: U, selectedItemNavigateTo: p, children: [
2176
+ m && (U == null ? void 0 : U.name) && /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: U.name }),
2177
+ /* @__PURE__ */ r.jsx($n, { control: I, name: e, render: () => /* @__PURE__ */ r.jsx(ee.Select, { size: s, onMouseDown: (P) => {
2178
+ P.currentTarget.focus(), P.preventDefault();
2179
+ }, onClick: () => {
2180
+ !ne && !d && L(!0);
2181
+ }, ref: re, value: K ?? "", onChange: () => {
2182
+ }, isInvalid: je, hidden: c, className: g("w-100", {
2183
+ "luminus-dropdown-picker-disabled": d,
2184
+ "luminus-dropdown-picker-link": ie
2185
+ }), children: /* @__PURE__ */ r.jsx("option", { value: K, children: m ? K : (R == null ? void 0 : R.length) > 0 ? R : K }) }) }),
2186
+ k || !d && ne ? /* @__PURE__ */ r.jsxs("div", { className: "custom-picker-button", children: [
2187
+ !k && !d && ne && /* @__PURE__ */ r.jsx(G, { size: "sm", color: "secondary", onClick: (P) => {
2188
+ P.preventDefault(), P.stopPropagation(), L(!0);
2189
+ }, children: /* @__PURE__ */ r.jsx(xn, {}) }),
2190
+ k ?? null
2191
+ ] }) : null
2192
+ ] }),
2193
+ S && /* @__PURE__ */ r.jsx(ve, { message: S.message }),
2194
+ re.current && /* @__PURE__ */ r.jsx(kt, { show: C, onCancel: J, items: u, currentSelection: U, onSelectionChange: F, onSearchQueryChange: f, texts: h, itemsNameWidth: v, additionalColumns: b, displayIdAsName: m, isLoading: y, disabled: d, inputRef: re })
2195
+ ] }) });
2196
+ }, zc = ({ InputContainer: t = xe, label: e, formField: n, hidden: s, required: o, placeholder: a, disabled: l, showClearIcon: i, resetsFields: c, multiple: d, accept: u, withoutLabel: f, className: p }) => {
2197
+ const { watch: h, setValue: v, register: y, formState: x } = pe(), [b, k] = E(!1), [m, N] = E(void 0), j = D(() => {
2198
+ v(n, "");
2199
+ }, [v, n]), $ = D(() => {
2200
+ const M = n.split(".");
2201
+ let I = x.errors;
2202
+ M.forEach((S) => {
2203
+ I !== void 0 && (I = I[S]);
2204
+ }), N(I);
2205
+ }, [x, n]);
2206
+ T($, [$]), T(() => {
2207
+ x.isSubmitted && k(!0);
2208
+ }, [x]);
2209
+ const _ = m !== void 0;
2210
+ return /* @__PURE__ */ r.jsxs(t, { label: `${e}${o ? "*" : ""}`, hidden: s, withoutLabel: f, isInvalid: _, className: p, children: [
2211
+ /* @__PURE__ */ r.jsx(Nn, { type: "file", multiple: d, accept: u.join(", "), placeholder: a ?? e, isInvalid: _, hidden: s, disabled: l, className: "w-100", ...y(n, {
2987
2212
  onChange: () => {
2988
- o && o.forEach((N) => f(N, null, { shouldDirty: !0, shouldValidate: y }));
2213
+ c && c.forEach((M) => v(M, null, { shouldDirty: !0, shouldValidate: b }));
2989
2214
  }
2990
- }), isInvalid: k, hidden: i, disabled: l, className: "w-100" }, m.id)),
2991
- h && /* @__PURE__ */ r.jsx(ve, { message: h.message })
2215
+ }) }),
2216
+ i && h(n) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: j, children: /* @__PURE__ */ r.jsx(fe, {}) }) }),
2217
+ m && /* @__PURE__ */ r.jsx(ve, { message: m.message })
2218
+ ] });
2219
+ }, Yc = ({ children: t, onStorno: e, noSpacer: n }) => {
2220
+ const { formState: s } = pe(), [o, a] = E(!1);
2221
+ return T(() => {
2222
+ a(Object.keys(s.dirtyFields).length > 0);
2223
+ }, [s]), o ? /* @__PURE__ */ r.jsx(Vo, { onStorno: e, noSpacer: n, children: t }) : null;
2224
+ }, Gc = ({ InputContainer: t = xe, options: e, formField: n, label: s, size: o, resetsFields: a, isNumber: l, required: i, hidden: c, disabled: d, withoutLabel: u, noSortOptions: f, suffixIdToName: p, className: h }) => {
2225
+ const { texts: { customSelect: v } } = W(ce), { formState: y, setValue: x, watch: b, control: k } = pe(), [m, N] = E(void 0), [j, $] = E(!1), [_, M] = E(!1), [I, S] = E(""), w = b(n), C = z(() => e.find((F) => F.id === w) ?? null, [e, w]), L = D(() => {
2226
+ const F = n.split(".");
2227
+ let J = y.errors;
2228
+ F.forEach((re) => {
2229
+ J !== void 0 && (J = J[re]);
2230
+ }), N(J);
2231
+ }, [y, n]), H = D((F) => {
2232
+ if ((F == null ? void 0 : F.id) === w)
2233
+ return;
2234
+ if (a && a.forEach((re) => x(re, null, { shouldDirty: !0, shouldValidate: _ })), F === null) {
2235
+ x(n, null, {
2236
+ shouldDirty: !0,
2237
+ shouldValidate: _
2238
+ });
2239
+ return;
2240
+ }
2241
+ let J = null;
2242
+ l ? J = (F == null ? void 0 : F.id) !== null && (F == null ? void 0 : F.id) !== "" ? parseInt(F.id.toString(), 10) : null : J = F.id === null || F.id === void 0 || F.id === "" ? null : F.id, x(n, J, {
2243
+ shouldDirty: !0,
2244
+ shouldValidate: _
2245
+ });
2246
+ }, [x, n, l, a, w, _]), Q = D((F) => {
2247
+ $(!1), H(F);
2248
+ }, [H]), K = D((F) => {
2249
+ S(F);
2250
+ }, []);
2251
+ T(() => {
2252
+ L();
2253
+ }, [L]), T(() => {
2254
+ y.isSubmitted && M(!0);
2255
+ }, [y]);
2256
+ const R = D((F) => {
2257
+ var J;
2258
+ return F === null ? "" : !F.name || F.name.length === 0 ? ((J = F.id) == null ? void 0 : J.toString()) ?? "" : p ? `${F.name} (${F.id})` : F.name;
2259
+ }, [p]), U = z(() => e.map((F) => ({
2260
+ id: F.id,
2261
+ name: R(F)
2262
+ })).filter((F) => zs(F.name, I)).sort((F, J) => f ? 0 : (F.name ?? "").localeCompare(J.name ?? "")), [e, f, I, R]), te = V(null), q = m !== void 0;
2263
+ return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(t, { label: `${s}${i ? " *" : ""}`, hidden: c, withoutLabel: u, isInvalid: q, inputContainerClassName: g({ "luminus-dropdown-select-open": j }), className: h, children: [
2264
+ /* @__PURE__ */ r.jsx($n, { control: k, name: n, render: () => /* @__PURE__ */ r.jsx(ee.Select, { size: o, onMouseDown: (F) => {
2265
+ F.currentTarget.focus(), F.preventDefault();
2266
+ }, onClick: () => {
2267
+ $(!0);
2268
+ }, ref: te, value: w ?? "", onChange: () => {
2269
+ }, isInvalid: q, hidden: c, disabled: d, className: "w-100", children: /* @__PURE__ */ r.jsx("option", { value: (C == null ? void 0 : C.id) ?? "", children: R(C) }) }) }),
2270
+ m && /* @__PURE__ */ r.jsx(ve, { message: m.message }),
2271
+ te.current && /* @__PURE__ */ r.jsx(kt, { show: j, onCancel: () => $(!1), items: U, currentSelection: C ?? null, onSelectionChange: Q, onSearchQueryChange: K, texts: v, disabled: d, inputRef: te, autoHideSearch: !0, allItemsLength: e.length })
2272
+ ] }) });
2273
+ }, Uc = ({ InputContainer: t = xe, formField: e, label: n, placeholder: s, size: o, resetsFields: a, showClearIcon: l, clearValue: i, required: c, hidden: d, disabled: u, withoutLabel: f, step: p, stepperStep: h = 1, className: v }) => {
2274
+ const { register: y, formState: x, setValue: b, watch: k } = pe(), [m, N] = E(void 0), [j, $] = E(!1), _ = D(() => {
2275
+ const w = i ?? null;
2276
+ b(e, w !== null ? Number(w) : null, {
2277
+ shouldDirty: !0,
2278
+ shouldValidate: j
2279
+ });
2280
+ }, [i, b, e, j]), M = D(() => {
2281
+ const w = e.split(".");
2282
+ let C = x.errors;
2283
+ w.forEach((L) => {
2284
+ C !== void 0 && (C = C[L]);
2285
+ }), N(C);
2286
+ }, [x, e]);
2287
+ T(() => {
2288
+ M();
2289
+ }, [M]), T(() => {
2290
+ x.isSubmitted && $(!0);
2291
+ }, [x]);
2292
+ const I = m !== void 0, S = k(e);
2293
+ return /* @__PURE__ */ r.jsxs(t, { label: `${n}${c ? " *" : ""}`, hidden: d, withoutLabel: f, isInvalid: I, className: v, children: [
2294
+ /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
2295
+ /* @__PURE__ */ r.jsx(ee.Control, { type: "number", placeholder: s ?? n, size: o, ...y(e, {
2296
+ setValueAs: (w) => w == null || w === "" ? null : Number(w),
2297
+ onChange: () => {
2298
+ a && a.forEach((w) => b(w, null, { shouldDirty: !0, shouldValidate: j }));
2299
+ }
2300
+ }), isInvalid: I, hidden: d, disabled: u, className: "w-100 luminus-numeric-stepper", step: p }),
2301
+ /* @__PURE__ */ r.jsx("div", { className: "stepper-icon left", children: !u && /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (w) => {
2302
+ w.preventDefault(), w.stopPropagation(), b(e, ((S ? Number(S) : 0) - h).toString(), { shouldDirty: !0, shouldValidate: j });
2303
+ }, children: /* @__PURE__ */ r.jsx(Er, {}) }) }),
2304
+ /* @__PURE__ */ r.jsx("div", { className: "stepper-icon right", children: !u && /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (w) => {
2305
+ w.preventDefault(), w.stopPropagation(), b(e, ((S ? Number(S) : 0) + h).toString(), { shouldDirty: !0, shouldValidate: j });
2306
+ }, children: /* @__PURE__ */ r.jsx(Or, {}) }) })
2307
+ ] }),
2308
+ l && k(e) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: _, children: /* @__PURE__ */ r.jsx(fe, {}) }) }),
2309
+ m && /* @__PURE__ */ r.jsx(ve, { message: m.message })
2310
+ ] });
2311
+ }, ta = "_item_1dy8x_1", Mr = {
2312
+ item: ta
2313
+ }, Fr = ({
2314
+ color: t = "primary",
2315
+ // icon = <MdOutlineArrowOutward />,
2316
+ icon: e,
2317
+ className: n,
2318
+ children: s,
2319
+ ...o
2320
+ }) => /* @__PURE__ */ r.jsxs(Oe.Item, { className: g(`btn luminus-dropdown-item text-nowrap rounded text-${t} ${n ?? ""}`, Mr.item), ...o, children: [
2321
+ e,
2322
+ s
2323
+ ] }), Tr = (t) => /* @__PURE__ */ r.jsx(Oe.Toggle, { ...t }), Kc = ({ color: t = "primary", icon: e = /* @__PURE__ */ r.jsx(gn, { size: 12 }), inputId: n = "context-file-input", accept: s = "*", onUpload: o, multiple: a, className: l, children: i, ...c }) => {
2324
+ const d = (u) => {
2325
+ u.target.files && (o(u.target.files), u.target.value = "");
2326
+ };
2327
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2328
+ /* @__PURE__ */ r.jsxs("label", { htmlFor: n, className: g(`btn luminus-dropdown-item text-nowrap rounded text-${t} ${l ?? ""}`, Mr.item), ...c, children: [
2329
+ e,
2330
+ i
2331
+ ] }),
2332
+ /* @__PURE__ */ r.jsx("input", { id: n, type: "file", accept: s, onChange: d, hidden: !0, multiple: a })
2333
+ ] });
2334
+ }, na = "_divider_1e6rk_1", ra = {
2335
+ divider: na
2336
+ }, qc = ({ className: t }) => /* @__PURE__ */ r.jsx(Oe.Divider, { className: g("luminus-dropdown-divider", t, ra.divider) }), sa = "_dropdown_1lk66_1", oa = {
2337
+ dropdown: sa
2338
+ }, Rr = ({ toggle: t, children: e, ...n }) => /* @__PURE__ */ r.jsxs(Oe, { ...n, children: [
2339
+ t,
2340
+ /* @__PURE__ */ r.jsx(Oe.Menu, { className: g("luminus-dropdown rounded shadow", oa.dropdown), children: e })
2341
+ ] }), Qc = ({ cell: { value: t } }) => /* @__PURE__ */ r.jsx(r.Fragment, { children: t ? /* @__PURE__ */ r.jsx(vn, { name: t, size: 21, fontSize: 12 }) : /* @__PURE__ */ r.jsx(r.Fragment, {}) }), aa = ({ typeFilter: t, onChangeTypeFilter: e }) => {
2342
+ const n = ["info", "warning", "danger"];
2343
+ return /* @__PURE__ */ r.jsx("div", { className: "mb-1 d-flex justify-content-center gap-2", children: n.map((s) => /* @__PURE__ */ r.jsx("div", { role: "button", style: {
2344
+ height: "14px",
2345
+ width: "14px",
2346
+ borderRadius: "50%",
2347
+ border: "2px solid transparent",
2348
+ backgroundColor: "transparent"
2349
+ }, className: g(`border-${s}`, s === t && `bg-${s}`), onClick: () => {
2350
+ e(t === s ? null : s);
2351
+ } }, s)) });
2352
+ }, la = ({ linksTo: t, onClick: e, children: n }) => t ? /* @__PURE__ */ r.jsx(ke, { to: t, className: "text-decoration-none", onClick: e, children: n }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: n }), ca = ({ message: t, onDeleteMessage: e, onClickMessage: n, getIcon: s, getLinksTo: o }) => {
2353
+ const { ProjectIconComponent: a, localizationContext: l } = W(ce), { dateFnsLocale: i } = W(l), c = t.dateTime ? Hs(t.dateTime) : null, d = c ? Ks(new Date(Date.now()), c) : 0;
2354
+ return /* @__PURE__ */ r.jsxs("div", { children: [
2355
+ c && /* @__PURE__ */ r.jsx("div", { className: "d-flex justify-content-end", children: /* @__PURE__ */ r.jsx(Vs, { text: Ee(c, "dd.MM.yyyy HH:mm"), placement: "left", children: /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsx(Y, { variant: "caption", children: d > 2 ? Ee(c, "dd.MM.yyyy") : Qs(c, new Date(Date.now()), {
2356
+ locale: i.code
2357
+ }) }) }) }) }),
2358
+ /* @__PURE__ */ r.jsx(la, { linksTo: o(t) ?? void 0, onClick: n, children: /* @__PURE__ */ r.jsx(Zl, { level: t.type, noIcon: !0, children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-start gap-2", children: [
2359
+ s(t),
2360
+ /* @__PURE__ */ r.jsxs("div", { className: "d-flex flex-column gap-1 w-100", children: [
2361
+ /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-start justify-content-between gap-3", children: [
2362
+ /* @__PURE__ */ r.jsx(Y, { variant: "body2", className: "fw-bold", children: t.subject }),
2363
+ /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (u) => {
2364
+ u.preventDefault(), u.stopPropagation(), e(t.id);
2365
+ }, children: /* @__PURE__ */ r.jsx(a, { icon: "delete" }) })
2366
+ ] }),
2367
+ /* @__PURE__ */ r.jsx(Y, { variant: "body2", children: t.text })
2368
+ ] })
2369
+ ] }) }) })
2992
2370
  ] });
2993
- }, Zc = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: s, size: o, showClearIcon: a, clearValue: l, required: i, hidden: c, disabled: d, rows: u, withoutLabel: f, customFormControlProps: p, className: h }) => {
2994
- const { register: v, formState: y, setValue: x, watch: b } = pe(), [k, m] = E(void 0), [N, j] = E(!1), $ = D(() => {
2995
- const I = l ?? null;
2996
- x(e, (I == null ? void 0 : I.toString()) ?? "", { shouldDirty: !0, shouldValidate: N });
2997
- }, [l, x, e, N]), _ = D(() => {
2998
- const I = e.split(".");
2999
- let S = y.errors;
3000
- I.forEach((w) => {
3001
- S !== void 0 && (S = S[w]);
3002
- }), m(S);
3003
- }, [y, e]);
2371
+ }, Jt = ({ messages: t, isLoading: e, onDeleteMessage: n, onClickMessage: s, getIcon: o, getLinksTo: a }) => {
2372
+ const { texts: { messageBoard: l } } = W(ce), [i, c] = E(null), d = z(() => t.filter((u) => i ? u.type === i : !0), [i, t]);
2373
+ return /* @__PURE__ */ r.jsxs("div", { className: "h-100 d-flex flex-column overflow-hidden", children: [
2374
+ /* @__PURE__ */ r.jsx(aa, { typeFilter: i, onChangeTypeFilter: (u) => c(u) }),
2375
+ e && /* @__PURE__ */ r.jsxs("div", { className: "p-3 w-100", children: [
2376
+ /* @__PURE__ */ r.jsx(me, { as: zt.Title, animation: "glow", children: /* @__PURE__ */ r.jsx(me, { xs: 6 }) }),
2377
+ /* @__PURE__ */ r.jsxs(me, { as: zt.Text, animation: "glow", children: [
2378
+ /* @__PURE__ */ r.jsx(me, { xs: 7 }),
2379
+ " ",
2380
+ /* @__PURE__ */ r.jsx(me, { xs: 4 }),
2381
+ " ",
2382
+ /* @__PURE__ */ r.jsx(me, { xs: 4 }),
2383
+ " ",
2384
+ /* @__PURE__ */ r.jsx(me, { xs: 6 }),
2385
+ " ",
2386
+ /* @__PURE__ */ r.jsx(me, { xs: 8 })
2387
+ ] })
2388
+ ] }),
2389
+ !e && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2390
+ t.length === 0 && /* @__PURE__ */ r.jsx(Gl, { variant: "info", size: "sm", className: "mt-2", children: l.noMessages }),
2391
+ /* @__PURE__ */ r.jsx("div", { className: "h-100 overflow-y-auto d-flex flex-column gap-2", children: d.map((u) => /* @__PURE__ */ r.jsx(ca, { message: u, onDeleteMessage: n, onClickMessage: s, getIcon: o, getLinksTo: a }, u.id)) })
2392
+ ] })
2393
+ ] });
2394
+ }, tt = {
2395
+ apiGet: "/messageBoard",
2396
+ apiDelete: "/messageBoard/"
2397
+ }, Jc = ({ renderAsNotifPanel: t, notifIcon: e, apiUrls: { apiGet: n = tt.apiGet, apiDelete: s = tt.apiDelete } = tt, getIcon: o, getLinksTo: a }) => {
2398
+ const i = mt(), [c, d] = E([]), [u, f] = E(!1), [p, h] = E(!1), [v, y] = E(!1), x = D(async () => {
2399
+ h(!0), await i.get(n).then(({ data: j }) => {
2400
+ d(j), f(!0), h(!1);
2401
+ }).catch(() => {
2402
+ d([]), h(!1);
2403
+ });
2404
+ }, [n, i]), b = D(async (j) => i.delete(`${s}${j}`).then(() => !0).catch(() => !1), [s, i]), k = D((j) => {
2405
+ b(j).then(($) => {
2406
+ $ && d(c.filter((_) => _.id !== j));
2407
+ });
2408
+ }, [b, c]);
3004
2409
  T(() => {
3005
- _();
3006
- }, [_]), T(() => {
3007
- y.isSubmitted && j(!0);
3008
- }, [y]);
3009
- const M = k !== void 0;
3010
- return /* @__PURE__ */ r.jsxs(t, { label: `${n}${i ? " *" : ""}`, hidden: c, withoutLabel: f, isInvalid: M, className: h, isForTextAreaInput: !0, children: [
3011
- /* @__PURE__ */ r.jsx(ee.Control, { as: "textarea", size: o, ...v(e, {
3012
- setValueAs: (I) => I == null || I === "" ? null : I,
3013
- onChange: () => {
3014
- s && s.forEach((I) => x(I, null, { shouldDirty: !0, shouldValidate: N }));
3015
- }
3016
- }), isInvalid: M, hidden: c, disabled: d, rows: u ?? 2, className: "w-100", ...p }),
3017
- a && b(e) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: $, children: /* @__PURE__ */ r.jsx(fe, {}) }) }),
3018
- k && /* @__PURE__ */ r.jsx(ve, { message: k.message })
2410
+ x();
2411
+ const j = setInterval(() => x(), 60 * 1e3);
2412
+ return () => {
2413
+ clearInterval(j);
2414
+ };
2415
+ }, [x]);
2416
+ const m = c.filter((j) => j.type === "danger").length, N = u ? !1 : p;
2417
+ return t ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2418
+ /* @__PURE__ */ r.jsxs("div", { className: "position-relative", children: [
2419
+ /* @__PURE__ */ r.jsx(G, { size: "md", onClick: () => y(!v), children: e }),
2420
+ m > 0 && /* @__PURE__ */ r.jsx("div", { className: "badge rounded-pill bg-danger p-1 px-2 text-white", style: { position: "absolute", top: "-6px", right: "-10px", fontSize: "10px" }, children: m })
2421
+ ] }),
2422
+ /* @__PURE__ */ r.jsx(qt, { show: v, onHide: () => y(!1), placement: "end", children: /* @__PURE__ */ r.jsx(qt.Body, { children: /* @__PURE__ */ r.jsx(Jt, { messages: c, isLoading: N, onDeleteMessage: k, onClickMessage: () => y(!1), getIcon: o, getLinksTo: a }) }) })
2423
+ ] }) : /* @__PURE__ */ r.jsx(Jt, { messages: c, isLoading: N, onDeleteMessage: k, getIcon: o, getLinksTo: a });
2424
+ }, ia = "_tab-panel_d8l8q_1", da = "_full-height-no-overflow_d8l8q_5", ua = "_disabled_d8l8q_12", nt = {
2425
+ "tab-panel": "_tab-panel_d8l8q_1",
2426
+ tabPanel: ia,
2427
+ "full-height-no-overflow": "_full-height-no-overflow_d8l8q_5",
2428
+ fullHeightNoOverflow: da,
2429
+ disabled: ua
2430
+ }, Xc = ({ eventKey: t, activeTab: e, fullHeightNoOverflow: n, disabled: s, className: o, children: a }) => t !== e ? null : /* @__PURE__ */ r.jsx("div", { className: g("luminus-tab-panel", nt.tabPanel, { [nt.fullHeightNoOverflow]: n }, { disabled: s }, { [nt.disabled]: s }, o), children: a }), Zc = ({ activeTab: t, onSelect: e, children: n }) => /* @__PURE__ */ r.jsx("div", { className: g("luminus-tabs d-flex gap-1 mb-2"), children: n.map((s) => {
2431
+ const o = s.type, a = s.props;
2432
+ if (!a)
2433
+ return null;
2434
+ const l = a.eventKey, i = a.children, c = a.className, d = a.onClick;
2435
+ return /* @__PURE__ */ ks(o, { ...a, key: a.eventKey, className: g({ active: t === l }, c), onClick: () => {
2436
+ e(l), d && d(l);
2437
+ } }, i);
2438
+ }) }), fa = "_tab_1hdhk_1", pa = "_disabled_1hdhk_8", Xt = {
2439
+ tab: fa,
2440
+ disabled: pa
2441
+ }, ei = ({ eventKey: t, className: e, onClick: n, disabled: s, children: o }) => /* @__PURE__ */ r.jsx("div", { role: "button", className: g("luminus-tab text-primary rounded", Xt.tab, e, {
2442
+ disabled: s
2443
+ }, { [Xt.disabled]: s }), onClick: () => n && !s && n(t), children: typeof o == "string" ? /* @__PURE__ */ r.jsx(Y, { variant: "h6", className: "text-primary", children: o }) : o }), ha = ({ show: t, widgets: e, handleClose: n, onWidgetPicked: s, texts: o }) => /* @__PURE__ */ r.jsxs(Te, { show: t, onHide: () => n(), children: [
2444
+ /* @__PURE__ */ r.jsx(Te.Header, { closeButton: !0, children: /* @__PURE__ */ r.jsx(Te.Title, { children: o.pickWidgetToAdd }) }),
2445
+ /* @__PURE__ */ r.jsx(Te.Body, { children: /* @__PURE__ */ r.jsx("div", { className: "list-group", children: e.filter((a) => a.id >= 0).map((a) => /* @__PURE__ */ r.jsx("div", { role: "button", className: "list-group-item bg-white", onClick: () => s(a.id), children: /* @__PURE__ */ r.jsx(Y, { variant: "body", children: a.name }) })) }) })
2446
+ ] }), Zt = ({ availableWidgets: t, onAdd: e, texts: n }) => {
2447
+ const [s, o] = E(!1);
2448
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2449
+ /* @__PURE__ */ r.jsx("div", { className: g("luminus-empty-widget", Zo.widget), children: /* @__PURE__ */ r.jsx(G, { onClick: () => o(!0), children: /* @__PURE__ */ r.jsx(ms, {}) }) }),
2450
+ /* @__PURE__ */ r.jsx(ha, { show: s, widgets: t, handleClose: () => o(!1), onWidgetPicked: (a) => {
2451
+ o(!1), e(a);
2452
+ }, texts: n })
3019
2453
  ] });
3020
- }, ei = ({ InputContainer: t = xe, type: e, formField: n, label: s, placeholder: o, size: a, resetsFields: l, showClearIcon: i, clearValue: c, required: d, hidden: u, disabled: f, withoutLabel: p, list: h, step: v, CustomOnChangeComponent: y, noSelectOnFocus: x, className: b }) => {
3021
- const { register: k, formState: m, setValue: N, watch: j } = pe(), [$, _] = E(void 0), [M, I] = E(!1), S = D(() => {
3022
- const R = c ?? null;
3023
- e === "number" ? N(n, R !== null ? Number(R) : null, {
3024
- shouldDirty: !0,
3025
- shouldValidate: M
3026
- }) : N(n, (R == null ? void 0 : R.toString()) ?? "", { shouldDirty: !0, shouldValidate: M });
3027
- }, [c, e, N, n, M]), w = D(() => {
3028
- const R = n.split(".");
3029
- let U = m.errors;
3030
- R.forEach((te) => {
3031
- U !== void 0 && (U = U[te]);
3032
- }), _(U);
3033
- }, [m, n]);
2454
+ }, ma = (t) => {
2455
+ const [e, n] = E({ widgets: [] });
3034
2456
  T(() => {
3035
- w();
3036
- }, [w]), T(() => {
3037
- m.isSubmitted && I(!0);
3038
- }, [m]);
3039
- const C = $ !== void 0, [L, H] = E(!1), Q = j(n), K = Dn(e, Q ?? null, L);
3040
- return /* @__PURE__ */ r.jsxs(t, { label: `${s}${d ? " *" : ""}`, hidden: u, withoutLabel: p, isInvalid: C, className: b, children: [
3041
- /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
3042
- /* @__PURE__ */ r.jsx(ee.Control, { type: K, placeholder: o ?? s, size: a, onFocus: (R) => {
3043
- H(!0), !x && R.target.select();
3044
- }, ...k(n, {
3045
- setValueAs: (R) => e === "number" ? R == null || R === "" ? null : Number(R) : R == null || R === "" ? null : R,
3046
- onChange: () => {
3047
- l && l.forEach((R) => N(R, null, { shouldDirty: !0, shouldValidate: M }));
3048
- },
3049
- onBlur: () => H(!1)
3050
- }), isInvalid: C, hidden: u, disabled: f, list: h, className: "w-100", step: v }),
3051
- y && /* @__PURE__ */ r.jsx("div", { className: "custom-picker-button", children: y })
2457
+ const o = localStorage.getItem("dashboardConfig");
2458
+ o ? n(JSON.parse(o)) : t && n(t);
2459
+ }, [t]);
2460
+ const s = D((o) => {
2461
+ n(o), localStorage.setItem("dashboardConfig", JSON.stringify(o));
2462
+ }, []);
2463
+ return { dashboardConfig: e, onChangeDashboardConfig: s };
2464
+ }, ga = "_dashboard_16plm_1", xa = "_widgets-grid_16plm_1", va = "_widget-wrapper_16plm_8", ja = "_full-width_16plm_13", wa = "_widget-edit_16plm_16", ya = "_remove-icon_16plm_19", _a = "_full-width-icon_16plm_26", ba = "_widget-edit-overlay_16plm_36", de = {
2465
+ dashboard: ga,
2466
+ "widgets-grid": "_widgets-grid_16plm_1",
2467
+ widgetsGrid: xa,
2468
+ "widget-wrapper": "_widget-wrapper_16plm_8",
2469
+ widgetWrapper: va,
2470
+ "full-width": "_full-width_16plm_13",
2471
+ fullWidth: ja,
2472
+ "widget-edit": "_widget-edit_16plm_16",
2473
+ widgetEdit: wa,
2474
+ "remove-icon": "_remove-icon_16plm_19",
2475
+ removeIcon: ya,
2476
+ "full-width-icon": "_full-width-icon_16plm_26",
2477
+ fullWidthIcon: _a,
2478
+ "widget-edit-overlay": "_widget-edit-overlay_16plm_36",
2479
+ widgetEditOverlay: ba
2480
+ };
2481
+ class Na extends Cs {
2482
+ constructor(e) {
2483
+ super(e), this.state = { hasError: !1 }, this.reload = this.reload.bind(this);
2484
+ }
2485
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2486
+ static getDerivedStateFromError(e) {
2487
+ return { hasError: !0 };
2488
+ }
2489
+ componentDidUpdate(e) {
2490
+ this.state.hasError && e.keyForErrorState !== this.props.keyForErrorState && this.setState({ hasError: !1 });
2491
+ }
2492
+ componentDidCatch(e, n) {
2493
+ console.error("Error:", e, n);
2494
+ }
2495
+ reload() {
2496
+ this.setState({ hasError: !1 });
2497
+ }
2498
+ render() {
2499
+ const { fallback: e, children: n, texts: s, reloadButtonDisplay: o = "append-after-child" } = this.props;
2500
+ return this.state.hasError ? o === "inject-to-child" && Ds(e) ? oe.cloneElement(e, {
2501
+ ...e.props
2502
+ }, /* @__PURE__ */ r.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
2503
+ ...e.props.children,
2504
+ /* @__PURE__ */ r.jsx(ct, { type: "button", onClick: this.reload, children: s.reloadButtonContent })
2505
+ ] })) : /* @__PURE__ */ r.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
2506
+ e,
2507
+ o === "none" ? null : /* @__PURE__ */ r.jsx(ct, { type: "button", onClick: this.reload, children: s.reloadButtonContent })
2508
+ ] }) : n;
2509
+ }
2510
+ }
2511
+ const $a = (t) => (n) => {
2512
+ const { texts: { errorBoundary: s } } = W(ce);
2513
+ return /* @__PURE__ */ r.jsx(t, { texts: s, ...n });
2514
+ }, ka = $a(Na), Ca = "_widget-card_e9tsb_1", Da = {
2515
+ "widget-card": "_widget-card_e9tsb_1",
2516
+ widgetCard: Ca
2517
+ }, en = ({ children: t, title: e, headerContent: n }) => /* @__PURE__ */ r.jsx(bl, { className: g(Da.widgetCard, "luminus-widget"), title: e, headerContent: n, contentClassName: "h-100 overflow-auto", children: t }), Ia = ({ children: t, title: e }) => {
2518
+ const { texts: { widget: n } } = W(ce);
2519
+ return /* @__PURE__ */ r.jsx(ka, { fallback: /* @__PURE__ */ r.jsx(en, { title: e, children: n.fallbackError }), reloadButtonDisplay: "inject-to-child", children: /* @__PURE__ */ r.jsx(Is, { fallback: /* @__PURE__ */ r.jsx(en, { title: e, children: /* @__PURE__ */ r.jsx(Ys, {}) }), children: t }) });
2520
+ }, ti = ({ availableWidgets: t, editMode: e, defaultDashboardConfig: n }) => {
2521
+ var u;
2522
+ const { texts: { homeDashboard: s } } = W(ce), { dashboardConfig: o, onChangeDashboardConfig: a } = ma(n), l = D((f, p) => {
2523
+ var h, v;
2524
+ f === ((h = o.widgets) == null ? void 0 : h.length) ? a({
2525
+ ...o,
2526
+ widgets: [...o.widgets, { widgetId: p, fullWidth: !1 }]
2527
+ }) : a({
2528
+ ...o,
2529
+ widgets: ((v = o.widgets) == null ? void 0 : v.map((y, x) => x === f ? { widgetId: p, fullWidth: !1 } : y)) ?? []
2530
+ });
2531
+ }, [o, a]), i = D((f) => {
2532
+ var p, h;
2533
+ ((p = o.widgets[f]) == null ? void 0 : p.widgetId) === -1 ? a({
2534
+ ...o,
2535
+ widgets: ((h = o.widgets) == null ? void 0 : h.filter((v, y) => y !== f)) ?? []
2536
+ }) : l(f, -1);
2537
+ }, [o, a, l]), c = D((f) => {
2538
+ var p;
2539
+ a({
2540
+ ...o,
2541
+ widgets: ((p = o.widgets) == null ? void 0 : p.map((h, v) => v === f ? { ...h, fullWidth: !h.fullWidth } : h)) ?? []
2542
+ });
2543
+ }, [o, a]), d = D((f, p, h) => f ? /* @__PURE__ */ r.jsxs("div", { className: g(de.widgetWrapper, {
2544
+ [de.widgetEdit]: e && f.id !== -1
2545
+ }, { [de.fullWidth]: h }), children: [
2546
+ e && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2547
+ /* @__PURE__ */ r.jsx(G, { color: "danger", onClick: () => i(p), className: g(de.removeIcon), children: /* @__PURE__ */ r.jsx(jn, {}) }),
2548
+ /* @__PURE__ */ r.jsx(G, { color: h ? "danger" : "primary", onClick: () => c(p), className: g(de.fullWidthIcon), children: /* @__PURE__ */ r.jsx(gs, {}) })
3052
2549
  ] }),
3053
- i && j(n) && /* @__PURE__ */ r.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: S, children: /* @__PURE__ */ r.jsx(fe, {}) }) }),
3054
- $ && /* @__PURE__ */ r.jsx(ve, { message: $.message })
2550
+ f.id === -1 ? e && /* @__PURE__ */ r.jsx("div", { className: de.widgetWrapper, children: /* @__PURE__ */ r.jsx(Zt, { availableWidgets: t, onAdd: (v) => l(p, v), texts: s }) }) : /* @__PURE__ */ r.jsx(Ia, { title: f.title, children: /* @__PURE__ */ r.jsx(f.WidgetElement, { title: f.title }) }),
2551
+ f.id > -1 && e && /* @__PURE__ */ r.jsx("div", { className: de.widgetEditOverlay })
2552
+ ] }, p) : /* @__PURE__ */ r.jsx(r.Fragment, {}), [
2553
+ e,
2554
+ l,
2555
+ i,
2556
+ c,
2557
+ t,
2558
+ s
2559
+ ]);
2560
+ return /* @__PURE__ */ r.jsx("div", { className: de.dashboard, children: /* @__PURE__ */ r.jsxs("div", { className: de.widgetsGrid, children: [
2561
+ (u = o.widgets) == null ? void 0 : u.map((f, p) => d(t.find((h) => h.id === f.widgetId), p, f.fullWidth)),
2562
+ e && /* @__PURE__ */ r.jsx(Zt, { availableWidgets: t, onAdd: (f) => {
2563
+ var p;
2564
+ return l((p = o.widgets) == null ? void 0 : p.length, f);
2565
+ }, texts: s })
2566
+ ] }) });
2567
+ }, Sa = "_badge_nhser_1", Ea = "_sm_nhser_1", Oa = "_md_nhser_4", Ma = "_lg_nhser_7", tn = {
2568
+ badge: Sa,
2569
+ sm: Ea,
2570
+ md: Oa,
2571
+ lg: Ma
2572
+ }, ni = ({ children: t, color: e = "primary", size: n = "md", className: s }) => /* @__PURE__ */ r.jsx("span", { className: g(`luminus-badge badge bg-${e} ${s ?? ""}`, tn.badge, tn[n]), children: t }), Fa = "_collapse-icon_1ahhn_1", Ta = "_collapsed_1ahhn_6", nn = {
2573
+ "collapse-icon": "_collapse-icon_1ahhn_1",
2574
+ collapseIcon: Fa,
2575
+ collapsed: Ta
2576
+ }, ri = ({ title: t, children: e, className: n, ...s }) => {
2577
+ const o = s.controlled ? !1 : s.defaultOpen ?? !1, [a, l] = E(o), i = s.controlled ? s.isOpen : a;
2578
+ return T(() => {
2579
+ l(o);
2580
+ }, [o]), /* @__PURE__ */ r.jsxs("div", { className: n ?? "", children: [
2581
+ /* @__PURE__ */ r.jsxs("div", { role: "button", className: "d-flex align-items-center justify-content-between pb-3 pt-2", onClick: () => s.controlled ? s.onToggle(!s.isOpen) : l(!a), children: [
2582
+ /* @__PURE__ */ r.jsx(Y, { variant: "h6", children: t }),
2583
+ /* @__PURE__ */ r.jsx(wn, { className: g(nn.collapseIcon, {
2584
+ [nn.collapsed]: i
2585
+ }) })
2586
+ ] }),
2587
+ /* @__PURE__ */ r.jsx(En, { in: i, children: /* @__PURE__ */ r.jsx("div", { children: e }) }),
2588
+ /* @__PURE__ */ r.jsx("hr", { className: `my-0 ${i ? "mt-3" : ""}` })
3055
2589
  ] });
3056
- }, ti = ({ InputContainer: t = xe, formField: e, label: n, size: s, defaultSelection: o, resetsFields: a, isNumber: l, required: i, hidden: c, disabled: d, items: u, onSearchQueryChange: f, selectedItemNavigateTo: p, texts: h, dropdownItemsNameWidth: v, isLoading: y, withoutLabel: x, additionalColumns: b, CustomOnChangeComponent: k, displayIdAsName: m, onSelect: N, className: j }) => {
3057
- const { formState: $, setValue: _, watch: M, control: I } = pe(), [S, w] = E(void 0), [C, L] = E(!1), [H, Q] = E(!1), K = M(e) ?? null, R = K === (o == null ? void 0 : o.id) ? o == null ? void 0 : o.name : M(`${e}-DropdownName`), U = z(() => K == null ? null : { id: K ?? null, name: R ?? "" }, [K, R]), te = D(() => {
3058
- const P = e.split(".");
3059
- let B = $.errors;
3060
- P.forEach((X) => {
3061
- B !== void 0 && (B = B[X]);
3062
- }), w(B);
3063
- }, [$, e]), q = D((P) => {
3064
- if ((P == null ? void 0 : P.id) === K)
3065
- return;
3066
- if (N && N(P), a && a.forEach((X) => _(X, null, { shouldDirty: !0, shouldValidate: H })), P === null) {
3067
- _(e, null, {
3068
- shouldDirty: !0,
3069
- shouldValidate: H
3070
- }), _(`${e}-DropdownName`, null);
3071
- return;
3072
- }
3073
- let B = null;
3074
- l ? B = (P == null ? void 0 : P.id) !== null && (P == null ? void 0 : P.id) !== "" ? parseInt(P.id.toString(), 10) : null : B = P.id === null || P.id === void 0 || P.id === "" ? null : P.id, _(e, B, {
3075
- shouldDirty: !0,
3076
- shouldValidate: H
3077
- }), _(`${e}-DropdownName`, P.name ?? "");
3078
- }, [_, e, H, l, a, K, N]), F = D((P) => {
3079
- L(!1), q(P);
3080
- }, [q]), J = D(() => {
3081
- L(!1);
2590
+ }, Ra = "_feedback_esh1j_1", Ba = "_feedback-spacer_esh1j_8", rn = {
2591
+ feedback: Ra,
2592
+ "feedback-spacer": "_feedback-spacer_esh1j_8",
2593
+ feedbackSpacer: Ba
2594
+ }, ve = ({ message: t }) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2595
+ /* @__PURE__ */ r.jsx("div", { className: g("invalid-feedback luminus-invalid-feedback", rn.feedback), children: t }),
2596
+ /* @__PURE__ */ r.jsx("div", { className: g("invalid-feedback-spacer", rn.feedbackSpacer), children: t })
2597
+ ] });
2598
+ function La(t, e, n) {
2599
+ var s = this, o = V(null), a = V(0), l = V(null), i = V([]), c = V(), d = V(), u = V(t), f = V(!0);
2600
+ u.current = t;
2601
+ var p = typeof window < "u", h = !e && e !== 0 && p;
2602
+ if (typeof t != "function") throw new TypeError("Expected a function");
2603
+ e = +e || 0;
2604
+ var v = !!(n = n || {}).leading, y = !("trailing" in n) || !!n.trailing, x = "maxWait" in n, b = "debounceOnServer" in n && !!n.debounceOnServer, k = x ? Math.max(+n.maxWait || 0, e) : null;
2605
+ T(function() {
2606
+ return f.current = !0, function() {
2607
+ f.current = !1;
2608
+ };
3082
2609
  }, []);
2610
+ var m = z(function() {
2611
+ var N = function(S) {
2612
+ var w = i.current, C = c.current;
2613
+ return i.current = c.current = null, a.current = S, d.current = u.current.apply(C, w);
2614
+ }, j = function(S, w) {
2615
+ h && cancelAnimationFrame(l.current), l.current = h ? requestAnimationFrame(S) : setTimeout(S, w);
2616
+ }, $ = function(S) {
2617
+ if (!f.current) return !1;
2618
+ var w = S - o.current;
2619
+ return !o.current || w >= e || w < 0 || x && S - a.current >= k;
2620
+ }, _ = function(S) {
2621
+ return l.current = null, y && i.current ? N(S) : (i.current = c.current = null, d.current);
2622
+ }, M = function S() {
2623
+ var w = Date.now();
2624
+ if ($(w)) return _(w);
2625
+ if (f.current) {
2626
+ var C = e - (w - o.current), L = x ? Math.min(C, k - (w - a.current)) : C;
2627
+ j(S, L);
2628
+ }
2629
+ }, I = function() {
2630
+ if (p || b) {
2631
+ var S = Date.now(), w = $(S);
2632
+ if (i.current = [].slice.call(arguments), c.current = s, o.current = S, w) {
2633
+ if (!l.current && f.current) return a.current = o.current, j(M, e), v ? N(o.current) : d.current;
2634
+ if (x) return j(M, e), N(o.current);
2635
+ }
2636
+ return l.current || j(M, e), d.current;
2637
+ }
2638
+ };
2639
+ return I.cancel = function() {
2640
+ l.current && (h ? cancelAnimationFrame(l.current) : clearTimeout(l.current)), a.current = 0, i.current = o.current = c.current = l.current = null;
2641
+ }, I.isPending = function() {
2642
+ return !!l.current;
2643
+ }, I.flush = function() {
2644
+ return l.current ? _(Date.now()) : d.current;
2645
+ }, I;
2646
+ }, [v, x, e, k, y, h, p, b]);
2647
+ return m;
2648
+ }
2649
+ function Aa(t, e) {
2650
+ return t === e;
2651
+ }
2652
+ function Ha(t, e) {
2653
+ return e;
2654
+ }
2655
+ function Br(t, e, n) {
2656
+ var s = Aa, o = _n(Ha, t), a = o[0], l = o[1], i = La(D(function(d) {
2657
+ return l(d);
2658
+ }, [l]), e, n), c = V(t);
2659
+ return s(c.current, t) || (i(t), c.current = t), s(a, t) && i.cancel(), [a, i];
2660
+ }
2661
+ const Wa = "_wrapper_uccrb_1", Pa = "_open_uccrb_9", Va = "_dropdown_uccrb_13", za = "_search-input-container_uccrb_19", Ya = "_search-input_uccrb_19", Ga = "_loading-container_uccrb_25", Ua = "_items-container_uccrb_32", Ka = "_header-row_uccrb_38", qa = "_item_uccrb_32", Qa = "_name_uccrb_57", Ja = "_column-item_uccrb_62", Xa = "_icon_uccrb_66", Za = "_clear-button_uccrb_74", se = {
2662
+ wrapper: Wa,
2663
+ open: Pa,
2664
+ dropdown: Va,
2665
+ "search-input-container": "_search-input-container_uccrb_19",
2666
+ searchInputContainer: za,
2667
+ "search-input": "_search-input_uccrb_19",
2668
+ searchInput: Ya,
2669
+ "loading-container": "_loading-container_uccrb_25",
2670
+ loadingContainer: Ga,
2671
+ "items-container": "_items-container_uccrb_32",
2672
+ itemsContainer: Ua,
2673
+ "header-row": "_header-row_uccrb_38",
2674
+ headerRow: Ka,
2675
+ item: qa,
2676
+ name: Qa,
2677
+ "column-item": "_column-item_uccrb_62",
2678
+ columnItem: Ja,
2679
+ icon: Xa,
2680
+ "clear-button": "_clear-button_uccrb_74",
2681
+ clearButton: Za
2682
+ }, kt = ({ show: t, onCancel: e, items: n, currentSelection: s, onSelectionChange: o, onSearchQueryChange: a, texts: l, itemsNameWidth: i, additionalColumns: c, displayIdAsName: d = !1, autoHideSearch: u = !1, allItemsLength: f, disabled: p, isLoading: h = !1, inputRef: v }) => {
2683
+ var P;
2684
+ const y = V(null), x = V(null), b = V(null), k = V(null), [m, N] = E(""), [j] = Br(m, 500), [, $] = E(!1), _ = (P = v.current) == null ? void 0 : P.getBoundingClientRect(), M = (_ == null ? void 0 : _.x) ?? 0, I = ((_ == null ? void 0 : _.x) ?? 0) + ((_ == null ? void 0 : _.width) ?? 0), S = (_ == null ? void 0 : _.y) ?? 0, w = ((_ == null ? void 0 : _.y) ?? 0) + ((_ == null ? void 0 : _.height) ?? 0), C = (_ == null ? void 0 : _.width) ?? 0, L = (_ == null ? void 0 : _.height) ?? 0, H = 5, Q = z(() => M ? M > window.innerWidth / 2 : !1, [M]), K = z(() => S ? S > window.innerHeight / 2 : !1, [S]);
3083
2685
  T(() => {
3084
- te();
3085
- }, [te]), T(() => {
3086
- $.isSubmitted && Q(!0);
3087
- }, [$]);
3088
- const re = V(null), je = S !== void 0, ne = p !== void 0, ie = ne && U !== null;
3089
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(t, { label: `${n}${i ? " *" : ""}`, hidden: c, withoutLabel: x, isInvalid: je, inputContainerClassName: g({ "luminus-dropdown-select-open": C }), className: j, children: [
3090
- /* @__PURE__ */ r.jsxs(Wr, { currentSelection: U, selectedItemNavigateTo: p, children: [
3091
- m && (U == null ? void 0 : U.name) && /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: U.name }),
3092
- /* @__PURE__ */ r.jsx($n, { control: I, name: e, render: () => /* @__PURE__ */ r.jsx(ee.Select, { size: s, onMouseDown: (P) => {
3093
- P.currentTarget.focus(), P.preventDefault();
3094
- }, onClick: () => {
3095
- !ne && !d && L(!0);
3096
- }, ref: re, value: K ?? "", onChange: () => {
3097
- }, isInvalid: je, hidden: c, className: g("w-100", {
3098
- "luminus-dropdown-picker-disabled": d,
3099
- "luminus-dropdown-picker-link": ie
3100
- }), children: /* @__PURE__ */ r.jsx("option", { value: K, children: m ? K : (R == null ? void 0 : R.length) > 0 ? R : K }) }) }),
3101
- k || !d && ne ? /* @__PURE__ */ r.jsxs("div", { className: "custom-picker-button", children: [
3102
- !k && !d && ne && /* @__PURE__ */ r.jsx(G, { size: "sm", color: "secondary", onClick: (P) => {
3103
- P.preventDefault(), P.stopPropagation(), L(!0);
3104
- }, children: /* @__PURE__ */ r.jsx(yn, {}) }),
3105
- k ?? null
3106
- ] }) : null
3107
- ] }),
3108
- S && /* @__PURE__ */ r.jsx(ve, { message: S.message }),
3109
- re.current && /* @__PURE__ */ r.jsx(kt, { show: C, onCancel: J, items: u, currentSelection: U, onSelectionChange: F, onSearchQueryChange: f, texts: h, itemsNameWidth: v, additionalColumns: b, displayIdAsName: m, isLoading: y, disabled: d, inputRef: re })
3110
- ] }) });
3111
- }, ni = ({ InputContainer: t = xe, label: e, formField: n, hidden: s, required: o, placeholder: a, disabled: l, showClearIcon: i, resetsFields: c, multiple: d, accept: u, withoutLabel: f, className: p }) => {
3112
- const { watch: h, setValue: v, register: y, formState: x } = pe(), [b, k] = E(!1), [m, N] = E(void 0), j = D(() => {
3113
- v(n, "");
3114
- }, [v, n]), $ = D(() => {
3115
- const M = n.split(".");
3116
- let I = x.errors;
3117
- M.forEach((S) => {
3118
- I !== void 0 && (I = I[S]);
3119
- }), N(I);
3120
- }, [x, n]);
3121
- T($, [$]), T(() => {
3122
- x.isSubmitted && k(!0);
3123
- }, [x]);
3124
- const _ = m !== void 0;
3125
- return /* @__PURE__ */ r.jsxs(t, { label: `${e}${o ? "*" : ""}`, hidden: s, withoutLabel: f, isInvalid: _, className: p, children: [
3126
- /* @__PURE__ */ r.jsx(Nn, { type: "file", multiple: d, accept: u.join(", "), placeholder: a ?? e, isInvalid: _, hidden: s, disabled: l, className: "w-100", ...y(n, {
3127
- onChange: () => {
3128
- c && c.forEach((M) => v(M, null, { shouldDirty: !0, shouldValidate: b }));
2686
+ var B;
2687
+ t && ((B = b.current) == null || B.focus());
2688
+ }, [b, t]), T(() => {
2689
+ t || N("");
2690
+ }, [t]), T(() => {
2691
+ a(j);
2692
+ }, [j, a]);
2693
+ const [R, U] = E(null);
2694
+ T(() => {
2695
+ t && n.length > 0 ? U(0) : U(null);
2696
+ }, [n, t]);
2697
+ const te = z(() => R !== null ? n.at(R) ?? null : null, [R, n]), q = D((B, X) => {
2698
+ var Ct, Dt;
2699
+ const le = document.getElementById(`item-${B}`);
2700
+ if (le) {
2701
+ const It = le.clientHeight ?? 0;
2702
+ X === "down" ? (Ct = k.current) == null || Ct.scrollBy({
2703
+ left: 0,
2704
+ top: It,
2705
+ behavior: "smooth"
2706
+ }) : (Dt = k.current) == null || Dt.scrollBy({
2707
+ left: 0,
2708
+ top: -It,
2709
+ behavior: "smooth"
2710
+ });
2711
+ }
2712
+ }, []), F = D((B) => {
2713
+ if (R === null || p)
2714
+ return;
2715
+ const X = R + B;
2716
+ X < 0 || X >= n.length || U((le) => (le !== null && q(le, B > 0 ? "down" : "up"), X));
2717
+ }, [R, n, p, q]), J = D((B) => {
2718
+ if (t)
2719
+ switch (B.key) {
2720
+ case "Escape":
2721
+ B.stopPropagation(), B.preventDefault(), e();
2722
+ break;
2723
+ case "Enter":
2724
+ B.stopPropagation(), B.preventDefault(), p || o(te);
2725
+ break;
2726
+ case "ArrowUp":
2727
+ B.stopPropagation(), B.preventDefault(), F(-1);
2728
+ break;
2729
+ case "ArrowDown":
2730
+ B.stopPropagation(), B.preventDefault(), F(1);
2731
+ break;
3129
2732
  }
3130
- }) }),
3131
- i && h(n) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: j, children: /* @__PURE__ */ r.jsx(fe, {}) }) }),
3132
- m && /* @__PURE__ */ r.jsx(ve, { message: m.message })
2733
+ }, [e, t, F, te, p, o]), re = D(() => {
2734
+ $((B) => !B);
2735
+ }, []);
2736
+ T(() => (window.addEventListener("scroll", re), () => {
2737
+ window.removeEventListener("scroll", re);
2738
+ }), [re]), T(() => (window.addEventListener("resize", re), () => {
2739
+ window.removeEventListener("resize", re);
2740
+ }), [re]), Cn(J), Dn([y, x], e);
2741
+ const je = i ?? (c && c.length > 0 ? 250 : 0), ne = (c == null ? void 0 : c.reduce((B, X) => B + (X.width ?? 100), 0)) ?? 0, ie = `calc(max(${C}px, ${je}px + ${ne}px))`;
2742
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2743
+ /* @__PURE__ */ r.jsx(Hr, { show: t, onClick: e }),
2744
+ s && t && !p && /* @__PURE__ */ r.jsx("button", { ref: x, type: "button", className: g("luminus-dropdown-picker-clear-button", se.clearButton), onClick: () => !p && o(null), style: {
2745
+ top: `calc(${S}px + ${L / 2}px - 12px)`,
2746
+ left: `calc(${M}px - 24px - 8px)`
2747
+ }, children: /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: "text-danger", children: /* @__PURE__ */ r.jsx(jn, { size: 16 }) }) }),
2748
+ /* @__PURE__ */ r.jsx("div", { className: g("luminus-dropdown-picker", se.wrapper, {
2749
+ [se.open]: t
2750
+ }), style: {
2751
+ top: K ? `calc(${S}px - 50vh - 8px)` : `calc(${w}px + 8px)`,
2752
+ left: Q ? `calc(${I}px - ${ie})` : M,
2753
+ right: Q ? `${I}px` : `calc(${M}px + ${ie})`,
2754
+ width: ie,
2755
+ justifyContent: K ? "flex-end" : "flex-start"
2756
+ }, children: /* @__PURE__ */ r.jsx("div", { ref: y, className: g("shadow rounded", se.dropdown), children: !p && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
2757
+ u && (f ?? n.length) <= H ? null : /* @__PURE__ */ r.jsx("div", { className: g("search-input-container border-bottom", se.searchInputContainer), children: /* @__PURE__ */ r.jsx(ee.Control, { ref: b, type: "search", size: "sm", className: se.searchInput, placeholder: l.searchPlaceholder, value: m, onChange: (B) => {
2758
+ var X;
2759
+ return N(((X = B.target) == null ? void 0 : X.value) ?? "");
2760
+ } }) }),
2761
+ h ? /* @__PURE__ */ r.jsx("div", { className: se.loadingContainer, children: /* @__PURE__ */ r.jsx($t, { animation: "border", variant: "primary" }) }) : n.length > 0 && /* @__PURE__ */ r.jsxs("div", { ref: k, className: g("items", se.itemsContainer), children: [
2762
+ c && c.length > 0 && /* @__PURE__ */ r.jsxs("div", { className: g("header-row border-bottom", se.headerRow), children: [
2763
+ /* @__PURE__ */ r.jsx("div", { className: se.name }),
2764
+ c == null ? void 0 : c.map((B) => /* @__PURE__ */ r.jsx("div", { className: se.columnItem, style: {
2765
+ width: `${B.width ?? 100}px`,
2766
+ minWidth: `${B.width ?? 100}px`,
2767
+ maxWidth: `${B.width ?? 100}px`
2768
+ }, children: /* @__PURE__ */ r.jsx(Y, { variant: "caption", children: B.name }) }, B.key))
2769
+ ] }),
2770
+ n == null ? void 0 : n.map((B, X) => /* @__PURE__ */ r.jsxs("button", { id: `item-${X}`, type: "button", className: g("item cursor-pointer", se.item, {
2771
+ [se.focused]: R === X
2772
+ }, {
2773
+ focused: R === X
2774
+ }), onClick: () => !p && o(B), onMouseEnter: () => U(X), children: [
2775
+ /* @__PURE__ */ r.jsx("div", { className: se.name, children: /* @__PURE__ */ r.jsx(Y, { variant: "body2", children: d ? B.id : B.name }) }),
2776
+ c == null ? void 0 : c.map((le) => /* @__PURE__ */ r.jsx("div", { className: se.columnItem, style: {
2777
+ width: `${le.width ?? 100}px`,
2778
+ minWidth: `${le.width ?? 100}px`,
2779
+ maxWidth: `${le.width ?? 100}px`
2780
+ }, children: /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: g("text-muted"), children: B.additionalColumns && B.additionalColumns[le.key] }) }, le.key))
2781
+ ] }, B.id))
2782
+ ] })
2783
+ ] }) }) })
3133
2784
  ] });
3134
- }, ri = ({ children: t, onStorno: e, noSpacer: n }) => {
3135
- const { formState: s } = pe(), [o, a] = E(!1);
3136
- return T(() => {
3137
- a(Object.keys(s.dirtyFields).length > 0);
3138
- }, [s]), o ? /* @__PURE__ */ r.jsx(Vo, { onStorno: e, noSpacer: n, children: t }) : null;
3139
- }, si = ({ InputContainer: t = xe, options: e, formField: n, label: s, size: o, resetsFields: a, isNumber: l, required: i, hidden: c, disabled: d, withoutLabel: u, noSortOptions: f, suffixIdToName: p, className: h }) => {
3140
- const { texts: { customSelect: v } } = W(ce), { formState: y, setValue: x, watch: b, control: k } = pe(), [m, N] = E(void 0), [j, $] = E(!1), [_, M] = E(!1), [I, S] = E(""), w = b(n), C = z(() => e.find((F) => F.id === w) ?? null, [e, w]), L = D(() => {
3141
- const F = n.split(".");
3142
- let J = y.errors;
3143
- F.forEach((re) => {
3144
- J !== void 0 && (J = J[re]);
3145
- }), N(J);
3146
- }, [y, n]), H = D((F) => {
3147
- if ((F == null ? void 0 : F.id) === w)
3148
- return;
3149
- if (a && a.forEach((re) => x(re, null, { shouldDirty: !0, shouldValidate: _ })), F === null) {
3150
- x(n, null, {
3151
- shouldDirty: !0,
3152
- shouldValidate: _
3153
- });
2785
+ }, el = ({ searchTypes: t, selectedType: e, setSelectedType: n }) => /* @__PURE__ */ r.jsx(Rr, { toggle: /* @__PURE__ */ r.jsx(Tr, { as: xs, icon: null, text: e == null ? void 0 : e.text }), children: t.map((s) => /* @__PURE__ */ r.jsx(Fr, { icon: null, onClick: () => n(s.key), children: s.text }, s.key)) }), tl = "_dropdown_1ddrg_1", nl = "_open_1ddrg_12", rl = "_loading-container_1ddrg_15", sl = "_groups-container_1ddrg_22", ol = "_group_1ddrg_22", al = "_header_1ddrg_26", ll = "_item_1ddrg_33", we = {
2786
+ dropdown: tl,
2787
+ open: nl,
2788
+ "loading-container": "_loading-container_1ddrg_15",
2789
+ loadingContainer: rl,
2790
+ "groups-container": "_groups-container_1ddrg_22",
2791
+ groupsContainer: sl,
2792
+ group: ol,
2793
+ header: al,
2794
+ item: ll
2795
+ }, cl = ({ show: t, query: e, onCancel: n, groups: s, isLoading: o, searchTypes: a }) => {
2796
+ const { texts: { appSearch: l } } = W(ce), i = V(null), c = D((d) => {
2797
+ var f;
2798
+ const u = (f = a.find((p) => p.key === d.type)) == null ? void 0 : f.toPath;
2799
+ return u ? `${u}/${d.searchKey}` : "/not-found";
2800
+ }, [a]);
2801
+ return Dn([i], n), /* @__PURE__ */ r.jsx("div", { ref: i, className: g("luminus-app-search-dropdown shadow rounded", we.dropdown, {
2802
+ [we.open]: t
2803
+ }), children: o ? /* @__PURE__ */ r.jsx("div", { className: we.loadingContainer, children: /* @__PURE__ */ r.jsx($t, { animation: "border", variant: "primary" }) }) : /* @__PURE__ */ r.jsx("div", { className: we.groupsContainer, children: s == null ? void 0 : s.map((d) => {
2804
+ var u;
2805
+ return /* @__PURE__ */ r.jsxs("div", { className: g(we.group), children: [
2806
+ /* @__PURE__ */ r.jsxs(ke, { to: `/search?query=${e}&type=${d.key.category}`, className: g("group-header", we.header), onClick: n, children: [
2807
+ /* @__PURE__ */ r.jsx(Y, { variant: "body", className: "text-primary", children: d.key.categoryName }),
2808
+ /* @__PURE__ */ r.jsxs(Y, { variant: "caption", children: [
2809
+ d.items.length,
2810
+ " ",
2811
+ l.amountFrom,
2812
+ " ",
2813
+ d.key.totalCount
2814
+ ] })
2815
+ ] }),
2816
+ (u = d.items) == null ? void 0 : u.map((f, p) => /* @__PURE__ */ r.jsxs(
2817
+ ke,
2818
+ {
2819
+ to: c(f),
2820
+ className: g("search-item d-flex gap-3 align-items-center justify-content-between", we.item),
2821
+ onClick: n,
2822
+ children: [
2823
+ /* @__PURE__ */ r.jsx(Y, { variant: "body2", className: "text-nowrap text-truncate", children: f.name }),
2824
+ /* @__PURE__ */ r.jsx(Y, { variant: "caption", className: "text-primary", children: /* @__PURE__ */ r.jsx(vs, {}) })
2825
+ ]
2826
+ },
2827
+ p
2828
+ ))
2829
+ ] }, d.key.category);
2830
+ }) }) });
2831
+ }, il = "_input-group_1lkfy_1", dl = "_input-group-text_1lkfy_5", ul = "_left_1lkfy_9", fl = "_right_1lkfy_13", pl = "_input_1lkfy_1", hl = "_submit-button_1lkfy_20", ye = {
2832
+ "input-group": "_input-group_1lkfy_1",
2833
+ inputGroup: il,
2834
+ "input-group-text": "_input-group-text_1lkfy_5",
2835
+ inputGroupText: dl,
2836
+ left: ul,
2837
+ right: fl,
2838
+ input: pl,
2839
+ "submit-button": "_submit-button_1lkfy_20",
2840
+ submitButton: hl
2841
+ }, ml = (t, e) => {
2842
+ const n = mt(), [s, o] = E(!1), [a, l] = E([]), i = !t || !t.key, c = D(() => {
2843
+ if (e.length < 3) {
2844
+ l([]);
3154
2845
  return;
3155
2846
  }
3156
- let J = null;
3157
- l ? J = (F == null ? void 0 : F.id) !== null && (F == null ? void 0 : F.id) !== "" ? parseInt(F.id.toString(), 10) : null : J = F.id === null || F.id === void 0 || F.id === "" ? null : F.id, x(n, J, {
3158
- shouldDirty: !0,
3159
- shouldValidate: _
2847
+ o(!0), n.get(`/search/${e}?count=${i ? 5 : 20}${i ? "" : `&type=${t.key}`}`).then(({ data: d }) => {
2848
+ l(d), o(!1);
2849
+ }).catch(() => {
2850
+ o(!1);
3160
2851
  });
3161
- }, [x, n, l, a, w, _]), Q = D((F) => {
3162
- $(!1), H(F);
3163
- }, [H]), K = D((F) => {
3164
- S(F);
3165
- }, []);
3166
- T(() => {
3167
- L();
3168
- }, [L]), T(() => {
3169
- y.isSubmitted && M(!0);
3170
- }, [y]);
3171
- const R = D((F) => {
3172
- var J;
3173
- return F === null ? "" : !F.name || F.name.length === 0 ? ((J = F.id) == null ? void 0 : J.toString()) ?? "" : p ? `${F.name} (${F.id})` : F.name;
3174
- }, [p]), U = z(() => e.map((F) => ({
3175
- id: F.id,
3176
- name: R(F)
3177
- })).filter((F) => zs(F.name, I)).sort((F, J) => f ? 0 : (F.name ?? "").localeCompare(J.name ?? "")), [e, f, I, R]), te = V(null), q = m !== void 0;
3178
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(t, { label: `${s}${i ? " *" : ""}`, hidden: c, withoutLabel: u, isInvalid: q, inputContainerClassName: g({ "luminus-dropdown-select-open": j }), className: h, children: [
3179
- /* @__PURE__ */ r.jsx($n, { control: k, name: n, render: () => /* @__PURE__ */ r.jsx(ee.Select, { size: o, onMouseDown: (F) => {
3180
- F.currentTarget.focus(), F.preventDefault();
3181
- }, onClick: () => {
3182
- $(!0);
3183
- }, ref: te, value: w ?? "", onChange: () => {
3184
- }, isInvalid: q, hidden: c, disabled: d, className: "w-100", children: /* @__PURE__ */ r.jsx("option", { value: (C == null ? void 0 : C.id) ?? "", children: R(C) }) }) }),
3185
- m && /* @__PURE__ */ r.jsx(ve, { message: m.message }),
3186
- te.current && /* @__PURE__ */ r.jsx(kt, { show: j, onCancel: () => $(!1), items: U, currentSelection: C ?? null, onSelectionChange: Q, onSearchQueryChange: K, texts: v, disabled: d, inputRef: te, autoHideSearch: !0, allItemsLength: e.length })
2852
+ }, [t, e, n, i]);
2853
+ return T(() => {
2854
+ c();
2855
+ }, [c]), { isLoading: s, searchItems: a };
2856
+ }, si = ({ searchTypes: t, navigateFunction: e, currentPath: n }) => {
2857
+ var y;
2858
+ const { texts: { appSearch: s } } = W(ce), [o, a] = E(t.length > 0 ? ((y = t.at(0)) == null ? void 0 : y.key) ?? null : null), l = z(() => t.find((x) => x.key === o) ?? null, [t, o]), [i, c] = E(""), [d, u] = Br(i, 500), { isLoading: f, searchItems: p } = ml(l, d), [h, v] = E(!1);
2859
+ return T(() => {
2860
+ (p.length > 0 || f) && v(!0);
2861
+ }, [p, f]), T(() => {
2862
+ c("");
2863
+ }, [n]), /* @__PURE__ */ r.jsx(ee, { onSubmit: (x) => {
2864
+ x.preventDefault(), x.stopPropagation(), u.flush(), v(!1), i.length > 2 && e(`/search?query=${i}${l && l.key && `&type=${l == null ? void 0 : l.key}`}`);
2865
+ }, children: /* @__PURE__ */ r.jsxs(Ze, { className: ye.inputGroup, children: [
2866
+ /* @__PURE__ */ r.jsx(Ze.Text, { className: g("p-1 rounded", ye.inputGroupText, ye.left), children: /* @__PURE__ */ r.jsx(el, { searchTypes: t, selectedType: l, setSelectedType: a }) }),
2867
+ /* @__PURE__ */ r.jsx(ee.Control, { placeholder: s.searchPlaceholder, type: "text", size: "sm", className: g("luminus-app-search-input", ye.input), value: i, onChange: (x) => {
2868
+ var b;
2869
+ return c(((b = x.target) == null ? void 0 : b.value) ?? "");
2870
+ }, onFocus: () => p.length > 0 && v(!0) }),
2871
+ /* @__PURE__ */ r.jsx(Ze.Text, { className: g("p-0 rounded", ye.inputGroupText, ye.right), children: /* @__PURE__ */ r.jsx("button", { type: "submit", className: g("text-primary", ye.submitButton), children: /* @__PURE__ */ r.jsx(ea, {}) }) }),
2872
+ /* @__PURE__ */ r.jsx(cl, { query: d, searchTypes: t, show: h, onCancel: () => v(!1), groups: p, isLoading: f })
3187
2873
  ] }) });
3188
- }, oi = ({ InputContainer: t = xe, formField: e, label: n, placeholder: s, size: o, resetsFields: a, showClearIcon: l, clearValue: i, required: c, hidden: d, disabled: u, withoutLabel: f, step: p, stepperStep: h = 1, className: v }) => {
3189
- const { register: y, formState: x, setValue: b, watch: k } = pe(), [m, N] = E(void 0), [j, $] = E(!1), _ = D(() => {
3190
- const w = i ?? null;
3191
- b(e, w !== null ? Number(w) : null, {
3192
- shouldDirty: !0,
3193
- shouldValidate: j
3194
- });
3195
- }, [i, b, e, j]), M = D(() => {
3196
- const w = e.split(".");
3197
- let C = x.errors;
3198
- w.forEach((L) => {
3199
- C !== void 0 && (C = C[L]);
3200
- }), N(C);
3201
- }, [x, e]);
3202
- T(() => {
3203
- M();
3204
- }, [M]), T(() => {
3205
- x.isSubmitted && $(!0);
3206
- }, [x]);
3207
- const I = m !== void 0, S = k(e);
3208
- return /* @__PURE__ */ r.jsxs(t, { label: `${n}${c ? " *" : ""}`, hidden: d, withoutLabel: f, isInvalid: I, className: v, children: [
3209
- /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
3210
- /* @__PURE__ */ r.jsx(ee.Control, { type: "number", placeholder: s ?? n, size: o, ...y(e, {
3211
- setValueAs: (w) => w == null || w === "" ? null : Number(w),
3212
- onChange: () => {
3213
- a && a.forEach((w) => b(w, null, { shouldDirty: !0, shouldValidate: j }));
3214
- }
3215
- }), isInvalid: I, hidden: d, disabled: u, className: "w-100 luminus-numeric-stepper", step: p }),
3216
- /* @__PURE__ */ r.jsx("div", { className: "stepper-icon left", children: !u && /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (w) => {
3217
- w.preventDefault(), w.stopPropagation(), b(e, ((S ? Number(S) : 0) - h).toString(), { shouldDirty: !0, shouldValidate: j });
3218
- }, children: /* @__PURE__ */ r.jsx(Er, {}) }) }),
3219
- /* @__PURE__ */ r.jsx("div", { className: "stepper-icon right", children: !u && /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (w) => {
3220
- w.preventDefault(), w.stopPropagation(), b(e, ((S ? Number(S) : 0) + h).toString(), { shouldDirty: !0, shouldValidate: j });
3221
- }, children: /* @__PURE__ */ r.jsx(Or, {}) }) })
2874
+ }, gl = "_card_19733_1", xl = "_header_19733_6", vl = "_header-content_19733_13", jl = "_title_19733_19", wl = "_collapse-icon_19733_22", yl = "_collapsed_19733_27", _l = "_content_19733_30", _e = {
2875
+ card: gl,
2876
+ header: xl,
2877
+ "header-content": "_header-content_19733_13",
2878
+ headerContent: vl,
2879
+ title: jl,
2880
+ "collapse-icon": "_collapse-icon_19733_22",
2881
+ collapseIcon: wl,
2882
+ collapsed: yl,
2883
+ content: _l
2884
+ }, bl = ({ title: t, headerContent: e, children: n, className: s, headerClassName: o, contentClassName: a, ...l }) => {
2885
+ const i = l.collapsible ? l.controlled ? !1 : l.defaultOpen ?? !1 : !0, [c, d] = E(i), u = l.collapsible ? l.controlled ? l.isOpen : c : !0;
2886
+ return T(() => {
2887
+ d(i);
2888
+ }, [i]), /* @__PURE__ */ r.jsxs("div", { className: g("luminus-card rounded shadow-sm", _e.card, {
2889
+ [s ?? ""]: s
2890
+ }), children: [
2891
+ /* @__PURE__ */ r.jsxs("div", { role: l.collapsible ? "button" : void 0, className: g("header", _e.header, {
2892
+ [o ?? ""]: o
2893
+ }), onClick: () => {
2894
+ l.collapsible && (l.controlled ? l.onToggle(!l.isOpen) : d(!c));
2895
+ }, children: [
2896
+ /* @__PURE__ */ r.jsxs("div", { className: g("header-content", _e.headerContent), children: [
2897
+ /* @__PURE__ */ r.jsx(Y, { variant: "h6", className: g("text-primary", _e.title), children: t }),
2898
+ e ?? null
2899
+ ] }),
2900
+ l.collapsible && /* @__PURE__ */ r.jsx(wn, { className: g(_e.collapseIcon, {
2901
+ [_e.collapsed]: u
2902
+ }) })
3222
2903
  ] }),
3223
- l && k(e) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(G, { color: "secondary", size: "sm", onClick: _, children: /* @__PURE__ */ r.jsx(fe, {}) }) }),
3224
- m && /* @__PURE__ */ r.jsx(ve, { message: m.message })
2904
+ /* @__PURE__ */ r.jsx(En, { in: u, children: /* @__PURE__ */ r.jsx("div", { className: g("card-content border-top border-primary", _e.content, {
2905
+ [a ?? ""]: a
2906
+ }), children: n }) })
3225
2907
  ] });
3226
- }, ai = ({ cell: { value: t } }) => /* @__PURE__ */ r.jsx(r.Fragment, { children: t ? /* @__PURE__ */ r.jsx(wn, { name: t, size: 21, fontSize: 12 }) : /* @__PURE__ */ r.jsx(r.Fragment, {}) }), ic = ({ typeFilter: t, onChangeTypeFilter: e }) => {
3227
- const n = ["info", "warning", "danger"];
3228
- return /* @__PURE__ */ r.jsx("div", { className: "mb-1 d-flex justify-content-center gap-2", children: n.map((s) => /* @__PURE__ */ r.jsx("div", { role: "button", style: {
3229
- height: "14px",
3230
- width: "14px",
3231
- borderRadius: "50%",
3232
- border: "2px solid transparent",
3233
- backgroundColor: "transparent"
3234
- }, className: g(`border-${s}`, s === t && `bg-${s}`), onClick: () => {
3235
- e(t === s ? null : s);
3236
- } }, s)) });
3237
- }, dc = ({ linksTo: t, onClick: e, children: n }) => t ? /* @__PURE__ */ r.jsx(ke, { to: t, className: "text-decoration-none", onClick: e, children: n }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: n }), uc = ({ message: t, onDeleteMessage: e, onClickMessage: n, getIcon: s, getLinksTo: o }) => {
3238
- const { ProjectIconComponent: a, localizationContext: l } = W(ce), { dateFnsLocale: i } = W(l), c = t.dateTime ? Ps(t.dateTime) : null, d = c ? Ks(new Date(Date.now()), c) : 0;
3239
- return /* @__PURE__ */ r.jsxs("div", { children: [
3240
- c && /* @__PURE__ */ r.jsx("div", { className: "d-flex justify-content-end", children: /* @__PURE__ */ r.jsx(Vs, { text: Ee(c, "dd.MM.yyyy HH:mm"), placement: "left", children: /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsx(Y, { variant: "caption", children: d > 2 ? Ee(c, "dd.MM.yyyy") : Qs(c, new Date(Date.now()), {
3241
- locale: i.code
3242
- }) }) }) }) }),
3243
- /* @__PURE__ */ r.jsx(dc, { linksTo: o(t) ?? void 0, onClick: n, children: /* @__PURE__ */ r.jsx(Yl, { level: t.type, noIcon: !0, children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-start gap-2", children: [
3244
- s(t),
3245
- /* @__PURE__ */ r.jsxs("div", { className: "d-flex flex-column gap-1 w-100", children: [
3246
- /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-start justify-content-between gap-3", children: [
3247
- /* @__PURE__ */ r.jsx(Y, { variant: "body2", className: "fw-bold", children: t.subject }),
3248
- /* @__PURE__ */ r.jsx(G, { size: "sm", onClick: (u) => {
3249
- u.preventDefault(), u.stopPropagation(), e(t.id);
3250
- }, children: /* @__PURE__ */ r.jsx(a, { icon: "delete" }) })
2908
+ };
2909
+ var Nl = !!(typeof window < "u" && window.document && window.document.createElement), $l = /* @__PURE__ */ function() {
2910
+ function t(e, n) {
2911
+ for (var s = 0; s < n.length; s++) {
2912
+ var o = n[s];
2913
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
2914
+ }
2915
+ }
2916
+ return function(e, n, s) {
2917
+ return n && t(e.prototype, n), s && t(e, s), e;
2918
+ };
2919
+ }();
2920
+ function kl(t, e) {
2921
+ if (!(t instanceof e))
2922
+ throw new TypeError("Cannot call a class as a function");
2923
+ }
2924
+ function Cl(t, e) {
2925
+ if (!t)
2926
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2927
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
2928
+ }
2929
+ function Dl(t, e) {
2930
+ if (typeof e != "function" && e !== null)
2931
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
2932
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
2933
+ }
2934
+ var Lr = function(t) {
2935
+ Dl(e, t);
2936
+ function e() {
2937
+ return kl(this, e), Cl(this, (e.__proto__ || Object.getPrototypeOf(e)).apply(this, arguments));
2938
+ }
2939
+ return $l(e, [{
2940
+ key: "componentWillUnmount",
2941
+ value: function() {
2942
+ this.defaultNode && document.body.removeChild(this.defaultNode), this.defaultNode = null;
2943
+ }
2944
+ }, {
2945
+ key: "render",
2946
+ value: function() {
2947
+ return Nl ? (!this.props.node && !this.defaultNode && (this.defaultNode = document.createElement("div"), document.body.appendChild(this.defaultNode)), He.createPortal(this.props.children, this.props.node || this.defaultNode)) : null;
2948
+ }
2949
+ }]), e;
2950
+ }(oe.Component);
2951
+ Lr.propTypes = {
2952
+ children: Ne.node.isRequired,
2953
+ node: Ne.any
2954
+ };
2955
+ var Il = /* @__PURE__ */ function() {
2956
+ function t(e, n) {
2957
+ for (var s = 0; s < n.length; s++) {
2958
+ var o = n[s];
2959
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
2960
+ }
2961
+ }
2962
+ return function(e, n, s) {
2963
+ return n && t(e.prototype, n), s && t(e, s), e;
2964
+ };
2965
+ }();
2966
+ function Sl(t, e) {
2967
+ if (!(t instanceof e))
2968
+ throw new TypeError("Cannot call a class as a function");
2969
+ }
2970
+ function El(t, e) {
2971
+ if (!t)
2972
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2973
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
2974
+ }
2975
+ function Ol(t, e) {
2976
+ if (typeof e != "function" && e !== null)
2977
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
2978
+ t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
2979
+ }
2980
+ var Ar = function(t) {
2981
+ Ol(e, t);
2982
+ function e() {
2983
+ return Sl(this, e), El(this, (e.__proto__ || Object.getPrototypeOf(e)).apply(this, arguments));
2984
+ }
2985
+ return Il(e, [{
2986
+ key: "componentDidMount",
2987
+ value: function() {
2988
+ this.renderPortal();
2989
+ }
2990
+ }, {
2991
+ key: "componentDidUpdate",
2992
+ value: function(s) {
2993
+ this.renderPortal();
2994
+ }
2995
+ }, {
2996
+ key: "componentWillUnmount",
2997
+ value: function() {
2998
+ He.unmountComponentAtNode(this.defaultNode || this.props.node), this.defaultNode && document.body.removeChild(this.defaultNode), this.defaultNode = null, this.portal = null;
2999
+ }
3000
+ }, {
3001
+ key: "renderPortal",
3002
+ value: function(s) {
3003
+ !this.props.node && !this.defaultNode && (this.defaultNode = document.createElement("div"), document.body.appendChild(this.defaultNode));
3004
+ var o = this.props.children;
3005
+ typeof this.props.children.type == "function" && (o = oe.cloneElement(this.props.children)), this.portal = He.unstable_renderSubtreeIntoContainer(this, o, this.props.node || this.defaultNode);
3006
+ }
3007
+ }, {
3008
+ key: "render",
3009
+ value: function() {
3010
+ return null;
3011
+ }
3012
+ }]), e;
3013
+ }(oe.Component);
3014
+ Ar.propTypes = {
3015
+ children: Ne.node.isRequired,
3016
+ node: Ne.any
3017
+ };
3018
+ var it = void 0;
3019
+ He.createPortal ? it = Lr : it = Ar;
3020
+ const Ml = "_lightbox_14acg_1", Fl = "_show_14acg_16", Tl = "_header_14acg_20", Rl = "_photo-actions_14acg_26", Bl = "_photo-container_14acg_31", Ll = "_photo_14acg_26", Al = "_nav-button_14acg_41", Hl = "_photos-preview_14acg_49", Wl = "_selected_14acg_62", Pl = "_default-indicator_14acg_66", ae = {
3021
+ lightbox: Ml,
3022
+ show: Fl,
3023
+ header: Tl,
3024
+ "photo-actions": "_photo-actions_14acg_26",
3025
+ photoActions: Rl,
3026
+ "photo-container": "_photo-container_14acg_31",
3027
+ photoContainer: Bl,
3028
+ photo: Ll,
3029
+ "nav-button": "_nav-button_14acg_41",
3030
+ navButton: Al,
3031
+ "photos-preview": "_photos-preview_14acg_49",
3032
+ photosPreview: Hl,
3033
+ selected: Wl,
3034
+ "default-indicator": "_default-indicator_14acg_66",
3035
+ defaultIndicator: Pl
3036
+ }, Vl = "_backdrop_3huvf_1", zl = "_show_3huvf_11", sn = {
3037
+ backdrop: Vl,
3038
+ show: zl
3039
+ }, Hr = ({ show: t, onClick: e }) => /* @__PURE__ */ r.jsx("div", { className: g("luminus-backdrop", sn.backdrop, {
3040
+ [sn.show]: t
3041
+ }), onClick: () => e && e() }), Wr = ({ src: t, alt: e, baseUrl: n, customToken: s, placeholder: o, ...a }) => /* @__PURE__ */ r.jsx("img", { ...a, alt: e ?? "", src: t ?? o }), Yl = ({ show: t, onClose: e, photos: n, defaultIndex: s, uploadPhotosText: o, noPhotosText: a, onUploadPhotos: l, photoActions: i, baseUrl: c, customToken: d, placeholder: u, ImgComponent: f = Wr }) => {
3042
+ const p = V(null), [h, v] = E(s), y = n.at(h), x = h > 0, b = h < n.length - 1;
3043
+ T(() => {
3044
+ t && v(s);
3045
+ }, [s, t]), T(() => {
3046
+ h >= n.length && v(n.length - 1);
3047
+ }, [n, h]);
3048
+ const k = D((m) => {
3049
+ switch (m.key) {
3050
+ case "ArrowLeft":
3051
+ m.stopPropagation(), x && v((N) => N - 1);
3052
+ break;
3053
+ case "ArrowRight":
3054
+ m.stopPropagation(), b && v((N) => N + 1);
3055
+ break;
3056
+ case "Escape":
3057
+ m.stopPropagation(), e();
3058
+ break;
3059
+ }
3060
+ }, [b, x, e]);
3061
+ return Cn(k), /* @__PURE__ */ r.jsxs(it, { children: [
3062
+ /* @__PURE__ */ r.jsx(Hr, { show: t, onClick: e }),
3063
+ /* @__PURE__ */ r.jsxs("div", { ref: p, className: g("luminus-lightbox rounded shadow", ae.lightbox, {
3064
+ [ae.show]: t
3065
+ }), children: [
3066
+ /* @__PURE__ */ r.jsxs("div", { className: ae.header, children: [
3067
+ /* @__PURE__ */ r.jsxs("div", { className: g("rounded", ae.photoActions), children: [
3068
+ l && /* @__PURE__ */ r.jsx(Ir, { accept: ".jpg,.jpeg,.png", onUpload: (m) => {
3069
+ m.length > 0 && l(Array.from(m));
3070
+ }, icon: /* @__PURE__ */ r.jsx(yn, { style: { fontSize: 18 } }), multiple: !0, className: "me-3", children: o ?? null }),
3071
+ y && (i == null ? void 0 : i.map(({ label: m, onClick: N, ...j }, $) => /* @__PURE__ */ r.jsx(
3072
+ ct,
3073
+ {
3074
+ onClick: () => N(y.id),
3075
+ ...j,
3076
+ children: m
3077
+ },
3078
+ `action-${$}`
3079
+ )))
3251
3080
  ] }),
3252
- /* @__PURE__ */ r.jsx(Y, { variant: "body2", children: t.text })
3253
- ] })
3254
- ] }) }) })
3255
- ] });
3256
- }, an = ({ messages: t, isLoading: e, onDeleteMessage: n, onClickMessage: s, getIcon: o, getLinksTo: a }) => {
3257
- const { texts: { messageBoard: l } } = W(ce), [i, c] = E(null), d = z(() => t.filter((u) => i ? u.type === i : !0), [i, t]);
3258
- return /* @__PURE__ */ r.jsxs("div", { className: "h-100 d-flex flex-column overflow-hidden", children: [
3259
- /* @__PURE__ */ r.jsx(ic, { typeFilter: i, onChangeTypeFilter: (u) => c(u) }),
3260
- e && /* @__PURE__ */ r.jsxs("div", { className: "p-3 w-100", children: [
3261
- /* @__PURE__ */ r.jsx(me, { as: zt.Title, animation: "glow", children: /* @__PURE__ */ r.jsx(me, { xs: 6 }) }),
3262
- /* @__PURE__ */ r.jsxs(me, { as: zt.Text, animation: "glow", children: [
3263
- /* @__PURE__ */ r.jsx(me, { xs: 7 }),
3264
- " ",
3265
- /* @__PURE__ */ r.jsx(me, { xs: 4 }),
3266
- " ",
3267
- /* @__PURE__ */ r.jsx(me, { xs: 4 }),
3268
- " ",
3269
- /* @__PURE__ */ r.jsx(me, { xs: 6 }),
3270
- " ",
3271
- /* @__PURE__ */ r.jsx(me, { xs: 8 })
3272
- ] })
3273
- ] }),
3274
- !e && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3275
- t.length === 0 && /* @__PURE__ */ r.jsx(Ll, { variant: "info", size: "sm", className: "mt-2", children: l.noMessages }),
3276
- /* @__PURE__ */ r.jsx("div", { className: "h-100 overflow-y-auto d-flex flex-column gap-2", children: d.map((u) => /* @__PURE__ */ r.jsx(uc, { message: u, onDeleteMessage: n, onClickMessage: s, getIcon: o, getLinksTo: a }, u.id)) })
3081
+ /* @__PURE__ */ r.jsx("div", { role: "button", onClick: e, children: /* @__PURE__ */ r.jsx(fe, { style: { fontSize: "32px" } }) })
3082
+ ] }),
3083
+ n.length === 0 && /* @__PURE__ */ r.jsx("div", { className: "w-100 h-100 d-flex align-items-center justify-content-center", children: /* @__PURE__ */ r.jsx(Y, { variant: "body", children: a ?? "No photos available" }) }),
3084
+ y && /* @__PURE__ */ r.jsxs("div", { className: ae.photoContainer, children: [
3085
+ /* @__PURE__ */ r.jsx("div", { role: x ? "button" : void 0, className: g("align-items-start", ae.navButton), onClick: () => x && v((m) => m - 1), children: x && /* @__PURE__ */ r.jsx(ft, { style: { fontSize: "40px" } }) }),
3086
+ /* @__PURE__ */ r.jsx(f, { src: y.lgSrc, alt: y.alt, className: g("rounded", ae.photo), baseUrl: c, customToken: d, placeholder: u }),
3087
+ /* @__PURE__ */ r.jsx("div", { role: b ? "button" : void 0, className: g("align-items-end", ae.navButton), onClick: () => b && v((m) => m + 1), children: b && /* @__PURE__ */ r.jsx(pt, { style: { fontSize: "40px" } }) })
3088
+ ] }),
3089
+ /* @__PURE__ */ r.jsx("div", { className: ae.photosPreview, children: n.map((m, N) => /* @__PURE__ */ r.jsxs("div", { role: "button", onClick: () => v(N), className: "position-relative", children: [
3090
+ /* @__PURE__ */ r.jsx(f, { role: N !== h ? "button" : void 0, src: m.smSrc, alt: m.alt, className: g("rounded", ae.photo, {
3091
+ [ae.selected]: N === h
3092
+ }), baseUrl: c, customToken: d, placeholder: u }, m.id),
3093
+ m.isDefault && /* @__PURE__ */ r.jsx("div", { className: g("text-primary", ae.defaultIndicator), children: /* @__PURE__ */ r.jsx(js, {}) })
3094
+ ] })) })
3277
3095
  ] })
3278
3096
  ] });
3279
- }, nt = {
3280
- apiGet: "/messageBoard",
3281
- apiDelete: "/messageBoard/"
3282
- }, li = ({ renderAsNotifPanel: t, notifIcon: e, apiUrls: { apiGet: n = nt.apiGet, apiDelete: s = nt.apiDelete } = nt, getIcon: o, getLinksTo: a }) => {
3283
- const i = mt(), [c, d] = E([]), [u, f] = E(!1), [p, h] = E(!1), [v, y] = E(!1), x = D(async () => {
3284
- h(!0), await i.get(n).then(({ data: j }) => {
3285
- d(j), f(!0), h(!1);
3097
+ }, oi = ({ photos: t, onUploadPhotos: e, uploadPhotosText: n, photoActions: s, baseUrl: o, customToken: a, placeholder: l, ImgComponent: i = Wr }) => {
3098
+ const [c, d] = E(null), u = c !== null ? t[c] : null, [f, p] = E(!1);
3099
+ return T(() => {
3100
+ if (t.length === 0) {
3101
+ d(null), p(!1);
3102
+ return;
3103
+ }
3104
+ const h = t.findIndex((v) => v.isDefault);
3105
+ d(h > -1 ? h : 0);
3106
+ }, [t]), u ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3107
+ /* @__PURE__ */ r.jsx(i, { role: "button", src: u.smSrc, alt: u.alt, className: "rounded w-100", onClick: () => p(!0), baseUrl: o, customToken: a, placeholder: l }),
3108
+ /* @__PURE__ */ r.jsx(Yl, { show: f, onClose: () => p(!1), photos: t, defaultIndex: c ?? 0, uploadPhotosText: n, onUploadPhotos: e, photoActions: s, baseUrl: o, customToken: a, placeholder: l, ImgComponent: i })
3109
+ ] }) : e ? /* @__PURE__ */ r.jsx(Ir, { accept: ".jpg,.jpeg,.png", onUpload: (h) => {
3110
+ h.length > 0 && e(Array.from(h));
3111
+ }, icon: /* @__PURE__ */ r.jsx(yn, { style: { fontSize: 18 } }), multiple: !0, children: n ?? null }) : null;
3112
+ }, ai = ({ appAccessPermissions: t, children: e }) => {
3113
+ const { useMsal: n, msalScopes: s } = W(ws), { isAuthenticated: o } = ys(), { userLoginState: a } = W(_s), l = a.state === bs.LOGGING_IN, i = a.user && (t == null ? void 0 : t.every((c) => {
3114
+ var d, u;
3115
+ return (u = (d = a.user) == null ? void 0 : d.permissions) == null ? void 0 : u.includes(c);
3116
+ }));
3117
+ return n ? /* @__PURE__ */ r.jsx(As, { interactionType: Ls.Redirect, authenticationRequest: { scopes: s }, children: l || !o() ? /* @__PURE__ */ r.jsx(Ft, {}) : a.user ? i ? /* @__PURE__ */ r.jsx(r.Fragment, { children: e }) : /* @__PURE__ */ r.jsx(Re, { to: "/user-not-permitted", replace: !0 }) : /* @__PURE__ */ r.jsx(Re, { to: "/no-user-login", replace: !0 }) }) : l ? /* @__PURE__ */ r.jsx(Ft, {}) : !o() || !a.user ? /* @__PURE__ */ r.jsx(Re, { to: "/login", replace: !0 }) : i ? e : /* @__PURE__ */ r.jsx(Re, { to: "/user-not-permitted", replace: !0 });
3118
+ }, Gl = (t) => {
3119
+ const { variant: e, children: n, className: s, size: o = "md", typographyVariant: a = o === "sm" ? "body2" : "body", ...l } = { ...t };
3120
+ return /* @__PURE__ */ r.jsx(uo, { variant: e, className: `text-center ${o === "sm" ? "p-1" : o === "md" ? "p-3" : "p-4"} bg-${e} bg-opacity-10 border-none ${s ?? ""}`, ...l, children: /* @__PURE__ */ r.jsx(Y, { variant: a, children: n }) });
3121
+ }, Ul = "_item_1lf6j_1", Kl = "_level-success_1lf6j_4", ql = "_level-info_1lf6j_10", Ql = "_level-warning_1lf6j_16", Jl = "_level-danger_1lf6j_22", Xl = "_type-icon_1lf6j_28", rt = {
3122
+ item: Ul,
3123
+ "level-success": "_level-success_1lf6j_4",
3124
+ levelSuccess: Kl,
3125
+ "level-info": "_level-info_1lf6j_10",
3126
+ levelInfo: ql,
3127
+ "level-warning": "_level-warning_1lf6j_16",
3128
+ levelWarning: Ql,
3129
+ "level-danger": "_level-danger_1lf6j_22",
3130
+ levelDanger: Jl,
3131
+ "type-icon": "_type-icon_1lf6j_28",
3132
+ typeIcon: Xl
3133
+ }, Zl = ({ level: t, children: e, customIcon: n, noIcon: s }) => {
3134
+ const { ProjectIconComponent: o } = W(ce), a = D(() => {
3135
+ switch (t) {
3136
+ case "info":
3137
+ return /* @__PURE__ */ r.jsx(o, { icon: "info" });
3138
+ case "warning":
3139
+ return /* @__PURE__ */ r.jsx(o, { icon: "warning" });
3140
+ case "danger":
3141
+ return /* @__PURE__ */ r.jsx(o, { icon: "danger" });
3142
+ default:
3143
+ return /* @__PURE__ */ r.jsx(o, { icon: "check" });
3144
+ }
3145
+ }, [o, t]);
3146
+ return /* @__PURE__ */ r.jsxs("div", { className: g("p-2 rounded d-flex gap-1 align-items-center justify-content-between", { "ps-1": !s }, rt.item, rt[`level-${t}`]), children: [
3147
+ !s && /* @__PURE__ */ r.jsx("div", { className: g(rt.typeIcon), children: n ?? a() }),
3148
+ /* @__PURE__ */ r.jsx(Y, { variant: "body2", className: "w-100", children: e })
3149
+ ] });
3150
+ }, li = ({ version: t }) => /* @__PURE__ */ r.jsx("div", { className: "rounded", style: {
3151
+ position: "fixed",
3152
+ right: "0px",
3153
+ bottom: "0px",
3154
+ zIndex: "10000",
3155
+ backgroundColor: "rgba(255, 255, 255, 0.5)",
3156
+ padding: "4px",
3157
+ pointerEvents: "all"
3158
+ }, children: /* @__PURE__ */ r.jsxs(Y, { variant: "caption", className: "w-100 text-end", children: [
3159
+ "verze ",
3160
+ t
3161
+ ] }) }), ec = "_submit-container_a9slg_1", tc = "_spacer_a9slg_14", on = {
3162
+ "submit-container": "_submit-container_a9slg_1",
3163
+ submitContainer: ec,
3164
+ spacer: tc
3165
+ }, nc = ({ children: t, noSpacer: e = !1 }) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3166
+ !e && /* @__PURE__ */ r.jsx("div", { className: on.spacer }),
3167
+ /* @__PURE__ */ r.jsx("div", { className: g("luminus-floating-action-container shadow", on.submitContainer), children: t })
3168
+ ] }), rc = "_timeline_g1754_1", sc = "_step-container_g1754_1", oc = "_step-date_g1754_1", ac = "_step-content_g1754_4", lc = "_content-header_g1754_8", cc = "_content-text_g1754_11", ic = "_step-icon_g1754_14", be = {
3169
+ timeline: rc,
3170
+ "step-container": "_step-container_g1754_1",
3171
+ stepContainer: sc,
3172
+ "step-date": "_step-date_g1754_1",
3173
+ stepDate: oc,
3174
+ "step-content": "_step-content_g1754_4",
3175
+ stepContent: ac,
3176
+ "content-header": "_content-header_g1754_8",
3177
+ contentHeader: lc,
3178
+ "content-text": "_content-text_g1754_11",
3179
+ contentText: cc,
3180
+ "step-icon": "_step-icon_g1754_14",
3181
+ stepIcon: ic
3182
+ }, ci = ({ steps: t }) => /* @__PURE__ */ r.jsx("div", { className: be.timeline, children: t.sort((e, n) => Us(e.date ?? /* @__PURE__ */ new Date(), n.date ?? /* @__PURE__ */ new Date())).map((e, n) => /* @__PURE__ */ r.jsxs("div", { className: g("row g-0 gx-3", be.stepContainer), children: [
3183
+ /* @__PURE__ */ r.jsx("div", { className: "col-3", children: e.date && /* @__PURE__ */ r.jsxs(Y, { variant: "caption", className: g("h-100 d-flex flex-column align-items-end justify-content-center gap-0", be.stepDate), children: [
3184
+ /* @__PURE__ */ r.jsx("div", { children: Ee(e.date, "dd.MM.yyyy") }),
3185
+ /* @__PURE__ */ r.jsx("div", { children: Ee(e.date, "HH:mm") })
3186
+ ] }) }),
3187
+ /* @__PURE__ */ r.jsx("div", { className: "col-9", children: /* @__PURE__ */ r.jsxs("div", { className: g("h-100 d-flex flex-column gap-1 border-start border-2 p-3", be.stepContent), children: [
3188
+ /* @__PURE__ */ r.jsxs("div", { className: g("d-flex gap-2 align-items-center", be.contentHeader), children: [
3189
+ e.person && /* @__PURE__ */ r.jsx(vn, { name: e.person.name ?? "", size: 22, fontSize: 12 }),
3190
+ typeof e.title == "string" ? /* @__PURE__ */ r.jsx(Y, { variant: "body", className: "fw-bold", children: e.title }) : e.title
3191
+ ] }),
3192
+ e.text && /* @__PURE__ */ r.jsx(Y, { variant: "body2", className: be.contentText, children: e.text }),
3193
+ /* @__PURE__ */ r.jsx("div", { className: g("text-primary", be.stepIcon), children: e.icon ?? /* @__PURE__ */ r.jsx(Ns, {}) })
3194
+ ] }) })
3195
+ ] }, n)) }), dc = (t, e, n, s = !0) => {
3196
+ const o = mt({ silent: s, differentBaseUrl: e, customToken: n }), [a, l] = E(!1), [i, c] = E(null), d = D(async (u) => {
3197
+ l(!0), c(null), o.get(t, {
3198
+ signal: u,
3199
+ responseType: "blob"
3200
+ }).then((f) => {
3201
+ l(!1), c(f.data);
3286
3202
  }).catch(() => {
3287
- d([]), h(!1);
3288
- });
3289
- }, [n, i]), b = D(async (j) => i.delete(`${s}${j}`).then(() => !0).catch(() => !1), [s, i]), k = D((j) => {
3290
- b(j).then(($) => {
3291
- $ && d(c.filter((_) => _.id !== j));
3203
+ l(!1), c(null);
3292
3204
  });
3293
- }, [b, c]);
3294
- T(() => {
3295
- x();
3296
- const j = setInterval(() => x(), 60 * 1e3);
3297
- return () => {
3298
- clearInterval(j);
3205
+ }, [o, t]);
3206
+ return T(() => {
3207
+ const u = new AbortController();
3208
+ return d(u.signal), () => {
3209
+ u.abort();
3299
3210
  };
3300
- }, [x]);
3301
- const m = c.filter((j) => j.type === "danger").length, N = u ? !1 : p;
3302
- return t ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3303
- /* @__PURE__ */ r.jsxs("div", { className: "position-relative", children: [
3304
- /* @__PURE__ */ r.jsx(G, { size: "md", onClick: () => y(!v), children: e }),
3305
- m > 0 && /* @__PURE__ */ r.jsx("div", { className: "badge rounded-pill bg-danger p-1 px-2 text-white", style: { position: "absolute", top: "-6px", right: "-10px", fontSize: "10px" }, children: m })
3306
- ] }),
3307
- /* @__PURE__ */ r.jsx(qt, { show: v, onHide: () => y(!1), placement: "end", children: /* @__PURE__ */ r.jsx(qt.Body, { children: /* @__PURE__ */ r.jsx(an, { messages: c, isLoading: N, onDeleteMessage: k, onClickMessage: () => y(!1), getIcon: o, getLinksTo: a }) }) })
3308
- ] }) : /* @__PURE__ */ r.jsx(an, { messages: c, isLoading: N, onDeleteMessage: k, getIcon: o, getLinksTo: a });
3309
- }, fc = "_tab-panel_d8l8q_1", pc = "_full-height-no-overflow_d8l8q_5", hc = "_disabled_d8l8q_12", rt = {
3310
- "tab-panel": "_tab-panel_d8l8q_1",
3311
- tabPanel: fc,
3312
- "full-height-no-overflow": "_full-height-no-overflow_d8l8q_5",
3313
- fullHeightNoOverflow: pc,
3314
- disabled: hc
3315
- }, ci = ({ eventKey: t, activeTab: e, fullHeightNoOverflow: n, disabled: s, className: o, children: a }) => t !== e ? null : /* @__PURE__ */ r.jsx("div", { className: g("luminus-tab-panel", rt.tabPanel, { [rt.fullHeightNoOverflow]: n }, { disabled: s }, { [rt.disabled]: s }, o), children: a }), ii = ({ activeTab: t, onSelect: e, children: n }) => /* @__PURE__ */ r.jsx("div", { className: g("luminus-tabs d-flex gap-1 mb-2"), children: n.map((s) => {
3316
- const o = s.type, a = s.props;
3317
- if (!a)
3318
- return null;
3319
- const l = a.eventKey, i = a.children, c = a.className, d = a.onClick;
3320
- return /* @__PURE__ */ Is(o, { ...a, key: a.eventKey, className: g({ active: t === l }, c), onClick: () => {
3321
- e(l), d && d(l);
3322
- } }, i);
3323
- }) }), mc = "_tab_1hdhk_1", gc = "_disabled_1hdhk_8", ln = {
3324
- tab: mc,
3325
- disabled: gc
3326
- }, di = ({ eventKey: t, className: e, onClick: n, disabled: s, children: o }) => /* @__PURE__ */ r.jsx("div", { role: "button", className: g("luminus-tab text-primary rounded", ln.tab, e, {
3327
- disabled: s
3328
- }, { [ln.disabled]: s }), onClick: () => n && !s && n(t), children: typeof o == "string" ? /* @__PURE__ */ r.jsx(Y, { variant: "h6", className: "text-primary", children: o }) : o });
3211
+ }, [d]), { data: i, setData: c, reloadData: d, isLoading: a };
3212
+ }, ii = ({ src: t, alt: e, baseUrl: n, customToken: s, placeholder: o, ...a }) => {
3213
+ const { data: l } = dc(t, n, s), [i, c] = E(null);
3214
+ return T(() => {
3215
+ let d = null;
3216
+ return l !== null ? (d = URL.createObjectURL(l), c(d)) : c(null), () => {
3217
+ d !== null && URL.revokeObjectURL(d);
3218
+ };
3219
+ }, [l]), i === null && !o ? null : /* @__PURE__ */ r.jsx("img", { ...a, alt: e ?? "", src: i ?? o });
3220
+ }, an = [
3221
+ ["D", "day"],
3222
+ // ['W', 'week'],
3223
+ ["M", "month"],
3224
+ ["Y", "year"],
3225
+ ["C", "custom"]
3226
+ ], uc = "_wrapper_qfqux_1", fc = "_lg_qfqux_7", pc = "_sm_qfqux_11", hc = "_md_qfqux_14", ln = {
3227
+ wrapper: uc,
3228
+ lg: fc,
3229
+ sm: pc,
3230
+ md: hc
3231
+ }, Ae = (t) => {
3232
+ const e = new Date(t), n = ge(e.toISOString());
3233
+ e.setMonth(e.getMonth() + 1), e.setDate(e.getDate() - 1);
3234
+ const s = ge(e.toISOString());
3235
+ return { from: n, to: s };
3236
+ }, Ie = (t) => {
3237
+ const e = new Date(t), n = ge(e.toISOString());
3238
+ e.setFullYear(e.getFullYear() + 1), e.setDate(e.getDate() - 1);
3239
+ const s = ge(e.toISOString());
3240
+ return { from: n, to: s };
3241
+ }, mc = (t, e) => {
3242
+ if (t === null || e === null)
3243
+ return "C";
3244
+ if (t === e)
3245
+ return "D";
3246
+ const n = new Date(t);
3247
+ return Ae(n).to === e ? "M" : Ie(n).to === e ? "Y" : (console.log(Ie(n), e), "C");
3248
+ }, gc = (t, e, n) => {
3249
+ const s = D((l, i) => {
3250
+ if (t === "C") {
3251
+ n((c) => ({ ...c, [l]: i }));
3252
+ return;
3253
+ }
3254
+ switch (l) {
3255
+ case "from":
3256
+ n((c) => {
3257
+ if (i === null)
3258
+ return c;
3259
+ const d = new Date(i);
3260
+ if (t === "D") {
3261
+ const u = ge(d.toISOString());
3262
+ return {
3263
+ from: u,
3264
+ to: u
3265
+ };
3266
+ }
3267
+ return t === "M" ? Ae(d) : t === "Y" ? Ie(d) : c;
3268
+ });
3269
+ break;
3270
+ case "to":
3271
+ e("C"), n((c) => ({ ...c, [l]: i }));
3272
+ break;
3273
+ }
3274
+ }, [t, n, e]), o = D((l) => {
3275
+ n((i) => {
3276
+ if (i.from === null || i.to === null)
3277
+ return i;
3278
+ const c = new Date(i.from);
3279
+ c.setHours(c.getHours() - c.getTimezoneOffset() / 60);
3280
+ const d = new Date(i.to);
3281
+ if (t === "D") {
3282
+ c.setDate(c.getDate() + l);
3283
+ const u = ge(c.toISOString());
3284
+ return {
3285
+ from: u,
3286
+ to: u
3287
+ };
3288
+ }
3289
+ return t === "M" ? (c.setMonth(c.getMonth() + l), Ae(c)) : t === "Y" ? (c.setFullYear(c.getFullYear() + l), Ie(c)) : {
3290
+ from: ge(c.toISOString()),
3291
+ to: ge(d.toISOString())
3292
+ };
3293
+ });
3294
+ }, [t, n]), a = D((l) => {
3295
+ l === "D" ? n((i) => ({ from: i.from, to: i.from })) : l === "M" ? n((i) => {
3296
+ if (i.from === null)
3297
+ return i;
3298
+ const c = Ws(i.from);
3299
+ return Ae(c);
3300
+ }) : l === "Y" && n((i) => {
3301
+ if (i.from === null)
3302
+ return i;
3303
+ const c = Ps(new Date(i.from).getFullYear());
3304
+ return Ie(c);
3305
+ }), e(l);
3306
+ }, [n, e]);
3307
+ return { setFromToProp: s, handleArrowClick: o, handleRangeChange: a };
3308
+ }, di = ({ fromtoState: [t, e], className: n, size: s }) => {
3309
+ const { texts: { date: o }, ProjectIconComponent: a } = W(ce), [l, i] = E("C"), { handleArrowClick: c, handleRangeChange: d, setFromToProp: u } = gc(l, i, e), f = z(() => l === "C", [l]), p = V(!0);
3310
+ return T(() => {
3311
+ if (p.current) {
3312
+ const h = mc(t.from, t.to);
3313
+ i(h), p.current = !1;
3314
+ }
3315
+ }, [t.from, t.to]), /* @__PURE__ */ r.jsxs("div", { className: g("d-inline-flex align-items-center gap-1", ln.wrapper, ln[s ?? "md"], n), children: [
3316
+ /* @__PURE__ */ r.jsx(G, { disabled: f, onClick: () => {
3317
+ c(-1);
3318
+ }, children: /* @__PURE__ */ r.jsx(a, { icon: "chevron-left" }) }),
3319
+ /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center gap-1", children: [
3320
+ /* @__PURE__ */ r.jsx(Qt, { type: "date", value: t.from, onChange: (h) => u("from", h === null ? null : h.toString()), InputContainer: Et, size: s }),
3321
+ /* @__PURE__ */ r.jsx(Rr, { toggle: /* @__PURE__ */ r.jsx(Tr, { text: o[an.find((h) => h[0] === l)[1]].substring(0, 1), as: $s }), children: an.map((h) => /* @__PURE__ */ r.jsx(Fr, { disabled: h[0] === l, className: g(h[0] === l ? "text-black-50" : ""), onClick: () => d(h[0]), role: "button", children: o[h[1]] }, h[0])) }),
3322
+ /* @__PURE__ */ r.jsx(Qt, { type: "date", value: t.to, onChange: (h) => u("to", h === null ? null : h.toString()), InputContainer: Et, size: s })
3323
+ ] }) }),
3324
+ /* @__PURE__ */ r.jsx(G, { disabled: f, onClick: () => {
3325
+ c(1);
3326
+ }, children: /* @__PURE__ */ r.jsx(a, { icon: "chevron-right" }) })
3327
+ ] });
3328
+ };
3329
3329
  export {
3330
- Ll as Alert,
3331
- Yl as AlertItem,
3330
+ Gl as Alert,
3331
+ Zl as AlertItem,
3332
3332
  Sc as ApiFileDownloadButton,
3333
- Ac as AppSearch,
3334
- Wc as AuthTemplate,
3335
- wn as AvatarIcon,
3336
- Ar as Backdrop,
3337
- Tc as Badge,
3338
- ml as Card,
3339
- Yc as CheckInput,
3340
- Rc as Collapse,
3333
+ si as AppSearch,
3334
+ ai as AuthTemplate,
3335
+ vn as AvatarIcon,
3336
+ Hr as Backdrop,
3337
+ ni as Badge,
3338
+ bl as Card,
3339
+ Fc as CheckInput,
3340
+ ri as Collapse,
3341
3341
  ct as ContextButton,
3342
3342
  Rr as Dropdown,
3343
- Lc as DropdownDivider,
3343
+ qc as DropdownDivider,
3344
3344
  Fr as DropdownItem,
3345
- Uc as DropdownPicker,
3345
+ Rc as DropdownPicker,
3346
3346
  Tr as DropdownToggle,
3347
- fa as ErrorBoundary,
3347
+ ka as ErrorBoundary,
3348
3348
  Ir as FileUploadContextButton,
3349
- Bc as FileUploadDropdownItem,
3350
- Kl as FloatingActionContainer,
3349
+ Kc as FileUploadDropdownItem,
3350
+ nc as FloatingActionContainer,
3351
3351
  Vo as FloatingFormSubmit,
3352
3352
  Ce as FloatingLabelInput,
3353
- Qc as FromToDatePicker,
3354
- Fc as HomeDashboard,
3355
- Jc as HookFormCheckInput,
3356
- ti as HookFormDropdownPicker,
3357
- ni as HookFormFileInput,
3358
- ri as HookFormFloatingSubmit,
3359
- oi as HookFormNumericStepperInput,
3360
- Xc as HookFormRadioInput,
3361
- si as HookFormSelectInput,
3362
- Zc as HookFormTextAreaInput,
3363
- ei as HookFormTextInput,
3353
+ di as FromToDatePicker,
3354
+ ti as HomeDashboard,
3355
+ Ac as HookFormCheckInput,
3356
+ Vc as HookFormDropdownPicker,
3357
+ zc as HookFormFileInput,
3358
+ Yc as HookFormFloatingSubmit,
3359
+ Uc as HookFormNumericStepperInput,
3360
+ Hc as HookFormRadioInput,
3361
+ Gc as HookFormSelectInput,
3362
+ Wc as HookFormTextAreaInput,
3363
+ Pc as HookFormTextInput,
3364
3364
  Ec as HtmlTooltip,
3365
3365
  G as IconButton,
3366
- zc as ImgApi,
3367
- Hr as ImgDirect,
3366
+ ii as ImgApi,
3367
+ Wr as ImgDirect,
3368
3368
  ve as InvalidFeedback,
3369
3369
  Ft as Loading,
3370
3370
  Ys as LoadingBlock,
3371
- li as MessageBoard,
3371
+ Jc as MessageBoard,
3372
3372
  Oc as MonthPicker,
3373
3373
  Et as NoInputContainer,
3374
- qc as NumericStepperInput,
3375
- Hc as PhotoLibrary,
3376
- Bl as PhotoLightbox,
3374
+ Lc as NumericStepperInput,
3375
+ oi as PhotoLibrary,
3376
+ Yl as PhotoLightbox,
3377
3377
  Mt as PrimaryButton,
3378
3378
  xe as RowLabelInput,
3379
- Gc as SelectInput,
3379
+ Tc as SelectInput,
3380
3380
  kt as SimplePicker,
3381
3381
  xs as SimpleToggle,
3382
3382
  Vs as SimpleTooltip,
3383
- di as Tab,
3384
- ci as TabPanel,
3385
- ii as Tabs,
3386
- Kc as TextAreaInput,
3387
- rn as TextInput,
3388
- Vc as Timeline,
3383
+ ei as Tab,
3384
+ Xc as TabPanel,
3385
+ Zc as Tabs,
3386
+ Bc as TextAreaInput,
3387
+ Qt as TextInput,
3388
+ ci as Timeline,
3389
3389
  Y as Typography,
3390
3390
  pi as UserAvatarToggle,
3391
- ai as UserAvatarValueFormat,
3392
- Pc as VersionInfo,
3393
- Jt as WidgetCard,
3391
+ Qc as UserAvatarValueFormat,
3392
+ li as VersionInfo,
3393
+ en as WidgetCard,
3394
3394
  Mc as YearPicker
3395
3395
  };