react-luminus-components 1.3.40 → 1.3.41

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