@snmt-react-ui/user-select 2.4.1 → 2.5.1

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.
@@ -3,7 +3,7 @@ var le = (i, e, t) => e in i ? oe(i, e, { enumerable: !0, configurable: !0, writ
3
3
  var M1 = (i, e, t) => le(i, typeof e != "symbol" ? e + "" : e, t);
4
4
  import "./index.css";
5
5
  import { jsx as r, Fragment as X, jsxs as u } from "react/jsx-runtime";
6
- import { createContext as n1, forwardRef as r1, useState as S, useRef as f1, useEffect as T, useCallback as j, useImperativeHandle as ae, useContext as o1 } from "react";
6
+ import { createContext as r1, forwardRef as o1, useState as B, useRef as f1, useEffect as T, useCallback as j, useImperativeHandle as ae, useContext as l1 } from "react";
7
7
  import { Select as he, Flex as ce, Avatar as de, Checkbox as ge, Typography as K1, Tag as P1, Popover as ue } from "antd";
8
8
  import { SNMTUiContext as Ce } from "@snmt-react-ui/core";
9
9
  const c1 = ({
@@ -43,7 +43,7 @@ const c1 = ({
43
43
  );
44
44
  };
45
45
  var q = /* @__PURE__ */ ((i) => (i.GREY_LIGHT_0 = "var(--grey-light-0)", i.GREY_LIGHT_1 = "var(--grey-light-1)", i.GREY_LIGHT_2 = "var(--grey-light-2)", i.GREY_LIGHT_3 = "var(--grey-light-3)", i.GREY_LIGHT_4 = "var(--grey-light-4)", i.GREY_DARK_1 = "var(--grey-dark-1)", i.GREY_DARK_2 = "var(--grey-dark-2)", i.GREY_DARK_3 = "var(--grey-dark-3)", i.GREY_DARK_4 = "var(--grey-dark-4)", i.GREY_DARK_5 = "var(--grey-dark-5)", i.BLUE_PRIMARY = "var(--blue-primary)", i.BLUE_HOVER = "var(--blue-hover)", i.BLUE_LIGHT_1 = "var(--blue-light-1)", i.BLUE_LIGHT_2 = "var(--blue-light-2)", i.BLUE_LIGHT_3 = "var(--blue-light-3)", i.BLUE_LIGHT_4 = "var(--blue-light-4)", i.BLUE_DARK_1 = "var(--blue-dark-1)", i.PURPLE_LIGHT = "var(--purple-light)", i.PURPLE_DARK = "var(--purple-dark)", i.NOTIFICATION_WARNING_LIGHT = "var(--notification-warning-light)", i.NOTIFICATION_WARNING_DARK = "var(--notification-warning-dark)", i.NOTIFICATION_SUCCESS_LIGHT = "var(--notification-success-light)", i.NOTIFICATION_SUCCESS_DARK = "var(--notification-success-dark)", i.NOTIFICATION_ERROR_LIGHT = "var(--notification-error-light)", i.NOTIFICATION_ERROR_DARK = "var(--notification-error-dark)", i.NOTIFICATION_ERROR_DARK_MODE = "var(--notification-error-dark-mode)", i))(q || {});
46
- const $1 = n1({
46
+ const $1 = r1({
47
47
  locale: "en",
48
48
  theme: "light"
49
49
  });
@@ -56,11 +56,11 @@ const fe = ({
56
56
  disabled: n = !1,
57
57
  disableUncheck: l = !1
58
58
  }) => {
59
- const [c, o] = S(i), [d, g] = S(e);
59
+ const [c, o] = B(i), [d, g] = B(e);
60
60
  T(() => {
61
61
  o(i), g(e);
62
62
  }, [i, e]);
63
- const { theme: a } = o1($1);
63
+ const { theme: a } = l1($1);
64
64
  return /* @__PURE__ */ r(
65
65
  ge,
66
66
  {
@@ -76,7 +76,7 @@ const fe = ({
76
76
  );
77
77
  };
78
78
  var k = /* @__PURE__ */ ((i) => (i.GREY_LIGHT_0 = "var(--grey-light-0)", i.GREY_LIGHT_1 = "var(--grey-light-1)", i.GREY_LIGHT_2 = "var(--grey-light-2)", i.GREY_LIGHT_3 = "var(--grey-light-3)", i.GREY_LIGHT_4 = "var(--grey-light-4)", i.GREY_DARK_1 = "var(--grey-dark-1)", i.GREY_DARK_2 = "var(--grey-dark-2)", i.GREY_DARK_3 = "var(--grey-dark-3)", i.GREY_DARK_4 = "var(--grey-dark-4)", i.GREY_DARK_5 = "var(--grey-dark-5)", i.BLUE_PRIMARY = "var(--blue-primary)", i.BLUE_HOVER = "var(--blue-hover)", i.BLUE_LIGHT_1 = "var(--blue-light-1)", i.BLUE_LIGHT_2 = "var(--blue-light-2)", i.BLUE_LIGHT_3 = "var(--blue-light-3)", i.BLUE_LIGHT_4 = "var(--blue-light-4)", i.BLUE_DARK_1 = "var(--blue-dark-1)", i.PURPLE_LIGHT = "var(--purple-light)", i.PURPLE_DARK = "var(--purple-dark)", i.NOTIFICATION_WARNING_LIGHT = "var(--notification-warning-light)", i.NOTIFICATION_WARNING_DARK = "var(--notification-warning-dark)", i.NOTIFICATION_SUCCESS_LIGHT = "var(--notification-success-light)", i.NOTIFICATION_SUCCESS_DARK = "var(--notification-success-dark)", i.NOTIFICATION_ERROR_LIGHT = "var(--notification-error-light)", i.NOTIFICATION_ERROR_DARK = "var(--notification-error-dark)", i.NOTIFICATION_ERROR_DARK_MODE = "var(--notification-error-dark-mode)", i))(k || {});
79
- const F1 = n1({
79
+ const F1 = r1({
80
80
  locale: "en",
81
81
  theme: "light"
82
82
  });
@@ -3068,7 +3068,7 @@ const we = ({
3068
3068
  )
3069
3069
  ] }) })
3070
3070
  }
3071
- ), l1 = ({
3071
+ ), a1 = ({
3072
3072
  name: i,
3073
3073
  width: e,
3074
3074
  height: t,
@@ -3077,7 +3077,7 @@ const we = ({
3077
3077
  disabled: l = !1,
3078
3078
  onClick: c
3079
3079
  }) => {
3080
- const [o, d] = S(n), { theme: g } = o1(F1), a = l ? g && g === "dark" ? k.GREY_LIGHT_4 : k.GREY_DARK_1 : s, h = l ? void 0 : c;
3080
+ const [o, d] = B(n), { theme: g } = l1(F1), a = l ? g && g === "dark" ? k.GREY_LIGHT_4 : k.GREY_DARK_1 : s, h = l ? void 0 : c;
3081
3081
  return T(() => {
3082
3082
  if (n) {
3083
3083
  h && !l && d(`${n} clickable`);
@@ -3333,7 +3333,7 @@ const we = ({
3333
3333
  h2: 2,
3334
3334
  h3: 3,
3335
3335
  h4: 4
3336
- }, zt = r1(
3336
+ }, zt = o1(
3337
3337
  ({
3338
3338
  align: i = "inherit",
3339
3339
  variant: e = "body1",
@@ -3368,7 +3368,7 @@ const we = ({
3368
3368
  }
3369
3369
  );
3370
3370
  var L = /* @__PURE__ */ ((i) => (i.GREY_LIGHT_0 = "var(--grey-light-0)", i.GREY_LIGHT_1 = "var(--grey-light-1)", i.GREY_LIGHT_2 = "var(--grey-light-2)", i.GREY_LIGHT_3 = "var(--grey-light-3)", i.GREY_LIGHT_4 = "var(--grey-light-4)", i.GREY_DARK_1 = "var(--grey-dark-1)", i.GREY_DARK_2 = "var(--grey-dark-2)", i.GREY_DARK_3 = "var(--grey-dark-3)", i.GREY_DARK_4 = "var(--grey-dark-4)", i.GREY_DARK_5 = "var(--grey-dark-5)", i.BLUE_PRIMARY = "var(--blue-primary)", i.BLUE_HOVER = "var(--blue-hover)", i.BLUE_LIGHT_1 = "var(--blue-light-1)", i.BLUE_LIGHT_2 = "var(--blue-light-2)", i.BLUE_LIGHT_3 = "var(--blue-light-3)", i.BLUE_LIGHT_4 = "var(--blue-light-4)", i.BLUE_DARK_1 = "var(--blue-dark-1)", i.PURPLE_LIGHT = "var(--purple-light)", i.PURPLE_DARK = "var(--purple-dark)", i.NOTIFICATION_WARNING_LIGHT = "var(--notification-warning-light)", i.NOTIFICATION_WARNING_DARK = "var(--notification-warning-dark)", i.NOTIFICATION_SUCCESS_LIGHT = "var(--notification-success-light)", i.NOTIFICATION_SUCCESS_DARK = "var(--notification-success-dark)", i.NOTIFICATION_ERROR_LIGHT = "var(--notification-error-light)", i.NOTIFICATION_ERROR_DARK = "var(--notification-error-dark)", i.NOTIFICATION_ERROR_DARK_MODE = "var(--notification-error-dark-mode)", i))(L || {});
3371
- const Y1 = n1({
3371
+ const Y1 = r1({
3372
3372
  locale: "en",
3373
3373
  theme: "light"
3374
3374
  });
@@ -6369,7 +6369,7 @@ const Jt = ({
6369
6369
  disabled: l = !1,
6370
6370
  onClick: c
6371
6371
  }) => {
6372
- const [o, d] = S(n), { theme: g } = o1(Y1), a = l ? g && g === "dark" ? L.GREY_LIGHT_4 : L.GREY_DARK_1 : s, h = l ? void 0 : c;
6372
+ const [o, d] = B(n), { theme: g } = l1(Y1), a = l ? g && g === "dark" ? L.GREY_LIGHT_4 : L.GREY_DARK_1 : s, h = l ? void 0 : c;
6373
6373
  return T(() => {
6374
6374
  if (n) {
6375
6375
  h && !l && d(`${n} clickable`);
@@ -6622,7 +6622,7 @@ const Jt = ({
6622
6622
  })() });
6623
6623
  };
6624
6624
  var U1 = /* @__PURE__ */ ((i) => (i.GREY_LIGHT_0 = "var(--grey-light-0)", i.GREY_LIGHT_1 = "var(--grey-light-1)", i.GREY_LIGHT_2 = "var(--grey-light-2)", i.GREY_LIGHT_3 = "var(--grey-light-3)", i.GREY_LIGHT_4 = "var(--grey-light-4)", i.GREY_DARK_1 = "var(--grey-dark-1)", i.GREY_DARK_2 = "var(--grey-dark-2)", i.GREY_DARK_3 = "var(--grey-dark-3)", i.GREY_DARK_4 = "var(--grey-dark-4)", i.GREY_DARK_5 = "var(--grey-dark-5)", i.BLUE_PRIMARY = "var(--blue-primary)", i.BLUE_HOVER = "var(--blue-hover)", i.BLUE_LIGHT_1 = "var(--blue-light-1)", i.BLUE_LIGHT_2 = "var(--blue-light-2)", i.BLUE_LIGHT_3 = "var(--blue-light-3)", i.BLUE_LIGHT_4 = "var(--blue-light-4)", i.BLUE_DARK_1 = "var(--blue-dark-1)", i.PURPLE_LIGHT = "var(--purple-light)", i.PURPLE_DARK = "var(--purple-dark)", i.NOTIFICATION_WARNING_LIGHT = "var(--notification-warning-light)", i.NOTIFICATION_WARNING_DARK = "var(--notification-warning-dark)", i.NOTIFICATION_SUCCESS_LIGHT = "var(--notification-success-light)", i.NOTIFICATION_SUCCESS_DARK = "var(--notification-success-dark)", i.NOTIFICATION_ERROR_LIGHT = "var(--notification-error-light)", i.NOTIFICATION_ERROR_DARK = "var(--notification-error-dark)", i.NOTIFICATION_ERROR_DARK_MODE = "var(--notification-error-dark-mode)", i))(U1 || {});
6625
- const yi = n1({
6625
+ const yi = r1({
6626
6626
  locale: "en",
6627
6627
  theme: "light"
6628
6628
  });
@@ -6654,7 +6654,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
6654
6654
  h2: 2,
6655
6655
  h3: 3,
6656
6656
  h4: 4
6657
- }, J1 = r1(
6657
+ }, J1 = o1(
6658
6658
  ({
6659
6659
  align: i = "inherit",
6660
6660
  variant: e = "body1",
@@ -6695,7 +6695,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
6695
6695
  placement: n = "topRight",
6696
6696
  noPadding: l = !1
6697
6697
  }) => {
6698
- const [c, o] = S(!1);
6698
+ const [c, o] = B(!1);
6699
6699
  return /* @__PURE__ */ r(
6700
6700
  ue,
6701
6701
  {
@@ -6719,7 +6719,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
6719
6719
  options: n,
6720
6720
  extraOptions: l
6721
6721
  }) => {
6722
- const [c, o] = S(!1);
6722
+ const [c, o] = B(!1);
6723
6723
  T(() => {
6724
6724
  i.length || o(!1);
6725
6725
  }, [i]);
@@ -6764,7 +6764,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
6764
6764
  backgroundSize: "20% calc(200% + 20px)"
6765
6765
  };
6766
6766
  return /* @__PURE__ */ r("span", { className: "snmt-loader", style: s });
6767
- }, b1 = r1(
6767
+ }, b1 = o1(
6768
6768
  ({
6769
6769
  value: i,
6770
6770
  onChange: e,
@@ -6780,95 +6780,95 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
6780
6780
  onDropdownVisibleChange: h,
6781
6781
  onScrollToEnd: C,
6782
6782
  onPopupScroll: p,
6783
- id: v,
6784
- extraOptions: N,
6785
- dropdownRender: x,
6786
- optionRender: V,
6783
+ id: x,
6784
+ extraOptions: R,
6785
+ dropdownRender: v,
6786
+ optionRender: H,
6787
6787
  isLoading: y,
6788
6788
  readOnly: E
6789
- }, f) => {
6790
- const [m, M] = S(!1), [R, H] = S(!1), [W, A] = S(!0), [_, G] = S(i), Z = f1(null);
6789
+ }, w) => {
6790
+ const [m, N] = B(!1), [M, I] = B(!1), [A, S] = B(!0), [b, P] = B(i), Z = f1(null);
6791
6791
  T(() => {
6792
- G(i);
6792
+ P(i);
6793
6793
  }, [i]);
6794
- const O = (w) => {
6795
- M(w), h && h(w);
6796
- }, $ = (w, I) => {
6794
+ const _ = (f) => {
6795
+ N(f), h && h(f);
6796
+ }, $ = (f, O) => {
6797
6797
  var D;
6798
- return !!((D = I == null ? void 0 : I.label) != null && D.toString().toLowerCase().includes(w.toLowerCase()));
6798
+ return !!((D = O == null ? void 0 : O.label) != null && D.toString().toLowerCase().includes(f.toLowerCase()));
6799
6799
  }, Y = () => {
6800
- H(!0);
6800
+ I(!0);
6801
6801
  }, U = () => {
6802
- H(!1);
6803
- }, b = j(
6804
- (w) => {
6805
- if (G(w), s) {
6806
- const D = w;
6802
+ I(!1);
6803
+ }, V = j(
6804
+ (f) => {
6805
+ if (P(f), s) {
6806
+ const D = f;
6807
6807
  e == null || e(D);
6808
6808
  return;
6809
6809
  }
6810
- const I = w;
6811
- e == null || e(I);
6810
+ const O = f;
6811
+ e == null || e(O);
6812
6812
  },
6813
6813
  [s, e]
6814
6814
  ), F = j(() => {
6815
6815
  if (!E) {
6816
6816
  if (s) {
6817
- b([]);
6817
+ V([]);
6818
6818
  return;
6819
6819
  }
6820
- b("");
6820
+ V("");
6821
6821
  }
6822
- }, [b, s, E]), K = j(
6823
- (w) => {
6824
- const I = _.filter((D) => D !== w);
6825
- b(I), G(I);
6822
+ }, [V, s, E]), G = j(
6823
+ (f) => {
6824
+ const O = b.filter((D) => D !== f);
6825
+ V(O), P(O);
6826
6826
  },
6827
- [b, _]
6827
+ [V, b]
6828
6828
  ), e1 = j(
6829
- (w) => (_ == null ? void 0 : _.indexOf(w)) === 0 ? (
6829
+ (f) => (b == null ? void 0 : b.indexOf(f)) === 0 ? (
6830
6830
  // if the search input is empty
6831
6831
  // then display the placeholder, else do not display it
6832
- /* @__PURE__ */ r("span", { className: "custom-placeholder", children: W ? t : "" })
6832
+ /* @__PURE__ */ r("span", { className: "custom-placeholder", children: A ? t : "" })
6833
6833
  ) : /* @__PURE__ */ r(X, {}),
6834
- [W, _, t]
6835
- ), ie = (w) => {
6836
- w.preventDefault(), w.stopPropagation();
6837
- }, se = async (w) => {
6838
- const { target: I } = w;
6839
- I.scrollTop + I.offsetHeight >= I.scrollHeight - g && (C == null || C(!0)), p && await p(w);
6834
+ [A, b, t]
6835
+ ), ie = (f) => {
6836
+ f.preventDefault(), f.stopPropagation();
6837
+ }, se = async (f) => {
6838
+ const { target: O } = f;
6839
+ O.scrollTop + O.offsetHeight >= O.scrollHeight - g && (C == null || C(!0)), p && await p(f);
6840
6840
  }, m1 = j(
6841
- (w) => {
6842
- var I, D;
6843
- return ((I = l.find((k1) => k1.value === w)) == null ? void 0 : I.label) || ((D = N == null ? void 0 : N.find(
6844
- (k1) => k1.value === w
6845
- )) == null ? void 0 : D.label) || w;
6841
+ (f) => {
6842
+ var O, D;
6843
+ return ((O = l.find((k1) => k1.value === f)) == null ? void 0 : O.label) || ((D = R == null ? void 0 : R.find(
6844
+ (k1) => k1.value === f
6845
+ )) == null ? void 0 : D.label) || f;
6846
6846
  },
6847
- [N, l]
6847
+ [R, l]
6848
6848
  ), ne = j(
6849
- (w) => {
6850
- var I;
6849
+ (f) => {
6850
+ var O;
6851
6851
  return /* @__PURE__ */ r(
6852
6852
  _i,
6853
6853
  {
6854
- values: w,
6855
- onTagClose: K,
6856
- maxWidth: ((I = Z.current) == null ? void 0 : I.clientWidth) || 0,
6854
+ values: f,
6855
+ onTagClose: G,
6856
+ maxWidth: ((O = Z.current) == null ? void 0 : O.clientWidth) || 0,
6857
6857
  disabled: o || E,
6858
6858
  options: l,
6859
- extraOptions: N
6859
+ extraOptions: R
6860
6860
  }
6861
6861
  );
6862
6862
  },
6863
- [o, N, K, l, E]
6863
+ [o, R, G, l, E]
6864
6864
  ), re = j(
6865
- ({ label: w, value: I, mode: D }) => D === "filter" ? e1(I) : /* @__PURE__ */ r("div", { onMouseDown: ie, className: "tag-wrapper", children: /* @__PURE__ */ r(z1, { onClose: () => K(I), closable: !o, children: /* @__PURE__ */ r(J1, { variant: "body4", children: typeof w == "object" ? w : m1(I) }) }) }),
6866
- [o, m1, K, e1]
6865
+ ({ label: f, value: O, mode: D }) => D === "filter" ? e1(O) : /* @__PURE__ */ r("div", { onMouseDown: ie, className: "tag-wrapper", children: /* @__PURE__ */ r(z1, { onClose: () => G(O), closable: !o, children: /* @__PURE__ */ r(J1, { variant: "body4", children: typeof f == "object" ? f : m1(O) }) }) }),
6866
+ [o, m1, G, e1]
6867
6867
  );
6868
6868
  return /* @__PURE__ */ u(
6869
6869
  "div",
6870
6870
  {
6871
- className: `snmt-select ${R ? "snmt-select-focused" : ""}
6871
+ className: `snmt-select ${M ? "snmt-select-focused" : ""}
6872
6872
  ${s ? "" : "snmt-select-single"} ${E ? "snmt-select-read-only" : ""}`,
6873
6873
  ref: Z,
6874
6874
  style: { width: c },
@@ -6878,58 +6878,58 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
6878
6878
  {
6879
6879
  className: "snmt-select-blank",
6880
6880
  popupClassName: E ? "dropdown-read-only" : "",
6881
- id: v,
6882
- ref: f,
6881
+ id: x,
6882
+ ref: w,
6883
6883
  showSearch: !!n,
6884
6884
  filterOption: n && $,
6885
- onDropdownVisibleChange: O,
6885
+ onDropdownVisibleChange: _,
6886
6886
  placeholder: t ? d ? `${t}*` : t : void 0,
6887
6887
  disabled: o,
6888
- value: _ || void 0,
6889
- labelRender: (w) => m1(w.value),
6888
+ value: b || void 0,
6889
+ labelRender: (f) => m1(f.value),
6890
6890
  mode: s === "filter" ? "multiple" : s,
6891
- onChange: b,
6891
+ onChange: V,
6892
6892
  onFocus: Y,
6893
6893
  onBlur: U,
6894
- onSearch: (w) => {
6895
- A(!w), a && a(w);
6894
+ onSearch: (f) => {
6895
+ S(!f), a && a(f);
6896
6896
  },
6897
- onSelect: () => A(!0),
6898
- onDeselect: () => A(!0),
6899
- tagRender: (w) => re({ ...w, mode: s }),
6897
+ onSelect: () => S(!0),
6898
+ onDeselect: () => S(!0),
6899
+ tagRender: (f) => re({ ...f, mode: s }),
6900
6900
  maxTagCount: "responsive",
6901
6901
  maxTagPlaceholder: ne,
6902
6902
  onPopupScroll: se,
6903
6903
  prefix: E && !i && /* @__PURE__ */ r(y1, { size: 15 }),
6904
6904
  suffixIcon: /* @__PURE__ */ r("div", { className: "wrapper-suffix-icon", children: s !== "filter" && /* @__PURE__ */ u(X, { children: [
6905
- s && _ && !!_.length && /* @__PURE__ */ r("div", { onClick: F, children: /* @__PURE__ */ r(l1, { name: "cancel" }) }),
6905
+ s && b && !!b.length && /* @__PURE__ */ r("div", { onClick: F, children: /* @__PURE__ */ r(a1, { name: "cancel" }) }),
6906
6906
  /* @__PURE__ */ r(
6907
- l1,
6907
+ a1,
6908
6908
  {
6909
6909
  name: "selectArrowIcon",
6910
6910
  color: o ? q.GREY_DARK_1 : q.GREY_DARK_5,
6911
6911
  className: m ? "select-arrow-rotated" : "select-arrow",
6912
- onClick: () => M(!m)
6912
+ onClick: () => N(!m)
6913
6913
  }
6914
6914
  )
6915
6915
  ] }) }),
6916
- removeIcon: /* @__PURE__ */ r(l1, { name: "errorSmall", color: q.GREY_DARK_2 }),
6916
+ removeIcon: /* @__PURE__ */ r(a1, { name: "errorSmall", color: q.GREY_DARK_2 }),
6917
6917
  options: l,
6918
- optionRender: (w) => V ? V(w.data) : /* @__PURE__ */ u(c1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
6918
+ optionRender: (f) => H ? H(f.data) : /* @__PURE__ */ u(c1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
6919
6919
  /* @__PURE__ */ u(c1, { alignItems: "center", gap: 12, children: [
6920
6920
  s && /* @__PURE__ */ r(
6921
6921
  fe,
6922
6922
  {
6923
- checked: !!(_ != null && _.includes(w.value))
6923
+ checked: !!(b != null && b.includes(f.value))
6924
6924
  }
6925
6925
  ),
6926
6926
  /* @__PURE__ */ u(c1, { alignItems: "center", gap: 8, children: [
6927
- w.data.image && /* @__PURE__ */ r(pe, { src: w.data.image, size: 20 }),
6928
- /* @__PURE__ */ r("span", { children: w.label })
6927
+ f.data.image && /* @__PURE__ */ r(pe, { src: f.data.image, size: 20 }),
6928
+ /* @__PURE__ */ r("span", { children: f.label })
6929
6929
  ] })
6930
6930
  ] }),
6931
- !s && _ === w.value && /* @__PURE__ */ r(
6932
- l1,
6931
+ !s && b === f.value && /* @__PURE__ */ r(
6932
+ a1,
6933
6933
  {
6934
6934
  name: "ok",
6935
6935
  color: q.BLUE_PRIMARY,
@@ -6948,13 +6948,13 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
6948
6948
  },
6949
6949
  children: /* @__PURE__ */ r(y1, { size: 28 })
6950
6950
  }
6951
- ) : (w) => x ? x(w) : w
6951
+ ) : (f) => v ? v(f) : f
6952
6952
  }
6953
6953
  ),
6954
6954
  /* @__PURE__ */ r(
6955
6955
  "fieldset",
6956
6956
  {
6957
- className: `${R ? "fieldset-focused" : ""}
6957
+ className: `${M ? "fieldset-focused" : ""}
6958
6958
  ${o ? "fieldset-disabled" : ""}
6959
6959
  ${typeof i == "string" && i ? "fieldset-filled" : ""}
6960
6960
  ${typeof i == "object" && i != null && i.length ? "fieldset-filled" : ""}`,
@@ -6977,10 +6977,10 @@ function Ii(i, e = 500) {
6977
6977
  clearTimeout(t.current), t.current = n;
6978
6978
  };
6979
6979
  }
6980
- const a1 = {
6980
+ const t1 = {
6981
6981
  limit: 100,
6982
6982
  offset: 0
6983
- }, E1 = r1(
6983
+ }, E1 = o1(
6984
6984
  ({
6985
6985
  loadOptions: i,
6986
6986
  width: e,
@@ -6996,67 +6996,67 @@ const a1 = {
6996
6996
  onDropdownVisibleChange: h,
6997
6997
  optionRender: C,
6998
6998
  dropdownRender: p,
6999
- readOnly: v
7000
- }, N) => {
7001
- const [x, V] = S([]), [y, E] = S(a1), [f, m] = S(!1), [M, R] = S(null), H = j(
7002
- async (O = !1, $) => {
7003
- if (!f) {
6999
+ readOnly: x
7000
+ }, R) => {
7001
+ const [v, H] = B([]), [y, E] = B(t1), [w, m] = B(!1), [N, M] = B(null), I = j(
7002
+ async (_ = !1, $) => {
7003
+ if (!w) {
7004
7004
  m(!0);
7005
7005
  try {
7006
- const Y = O ? { ...a1, search: $ } : y, U = await i(Y);
7007
- V(
7008
- (b) => O ? U.options : [...b, ...U.options]
7009
- ), R(U.count), E((b) => ({
7010
- ...b,
7011
- offset: b.offset + b.limit
7006
+ const Y = _ ? { ...t1, search: $ } : y, U = await i(Y);
7007
+ H(
7008
+ (V) => _ ? U.options : [...V, ...U.options]
7009
+ ), M(U.count), E((V) => ({
7010
+ ...V,
7011
+ offset: V.offset + V.limit
7012
7012
  }));
7013
7013
  } finally {
7014
7014
  m(!1);
7015
7015
  }
7016
7016
  }
7017
7017
  },
7018
- [y, i, f]
7019
- ), W = Ii(H), A = j(
7020
- (O) => {
7021
- O === "" || O === void 0 || O === null ? (E(a1), W(!0)) : W(!0, O);
7018
+ [y, i, w]
7019
+ ), A = Ii(I), S = j(
7020
+ (_) => {
7021
+ _ === "" || _ === void 0 || _ === null ? (E(t1), A(!0)) : A(!0, _);
7022
7022
  },
7023
- [W]
7024
- ), _ = async (O) => {
7025
- O && M !== null && M > x.length && await H(!1);
7026
- }, G = j(
7027
- (O) => {
7028
- O && !g && H(!1), h && h(O);
7023
+ [A]
7024
+ ), b = async (_) => {
7025
+ _ && N !== null && N > v.length && await I(!1);
7026
+ }, P = j(
7027
+ (_) => {
7028
+ _ && !g && (H([]), E(t1), I(!0)), h == null || h(_);
7029
7029
  },
7030
7030
  // eslint-disable-next-line
7031
7031
  [g]
7032
7032
  );
7033
7033
  T(() => {
7034
- g && H(!1);
7034
+ g && I(!1);
7035
7035
  }, []);
7036
7036
  const Z = {
7037
7037
  id: n,
7038
7038
  width: e,
7039
- options: x,
7039
+ options: v,
7040
7040
  onChange: t,
7041
- ref: N,
7041
+ ref: R,
7042
7042
  placeholder: o,
7043
7043
  search: !0,
7044
7044
  value: s,
7045
- onSearchChange: A,
7046
- onDropdownVisibleChange: G,
7045
+ onSearchChange: S,
7046
+ onDropdownVisibleChange: P,
7047
7047
  scrollThresholdValue: c,
7048
- onScrollToEnd: _,
7048
+ onScrollToEnd: b,
7049
7049
  loadOnClosedState: g,
7050
7050
  disabled: l,
7051
7051
  extraOptions: a,
7052
- isLoading: f,
7052
+ isLoading: w,
7053
7053
  optionRender: C,
7054
7054
  dropdownRender: p,
7055
- readOnly: v
7055
+ readOnly: x
7056
7056
  };
7057
- return ae(N, () => ({
7057
+ return ae(R, () => ({
7058
7058
  refetchOptions: async () => {
7059
- E(a1), await H(!0);
7059
+ E(t1), await I(!0);
7060
7060
  }
7061
7061
  })), d ? /* @__PURE__ */ r(b1, { ...Z, onChange: t, value: s, mode: d }) : /* @__PURE__ */ r("div", { className: "snmt-async-select", children: /* @__PURE__ */ r(b1, { ...Z, onChange: t, value: s }) });
7062
7062
  }
@@ -7165,7 +7165,7 @@ const Pi = (i) => {
7165
7165
  init(i) {
7166
7166
  Gi(i.options.react), Pi(i);
7167
7167
  }
7168
- }, Yi = n1();
7168
+ }, Yi = r1();
7169
7169
  class Ui {
7170
7170
  constructor() {
7171
7171
  M1(this, "getUsedNamespaces", () => Object.keys(this.usedNamespaces));
@@ -7189,11 +7189,11 @@ const zi = (i, e) => {
7189
7189
  } = e, {
7190
7190
  i18n: s,
7191
7191
  defaultNS: n
7192
- } = o1(Yi) || {}, l = t || s || $i();
7192
+ } = l1(Yi) || {}, l = t || s || $i();
7193
7193
  if (l && !l.reportNamespaces && (l.reportNamespaces = new Ui()), !l) {
7194
7194
  N1("You will need to pass in an i18next instance by using initReactI18next");
7195
- const f = (M, R) => z(R) ? R : Wi(R) && z(R.defaultValue) ? R.defaultValue : Array.isArray(M) ? M[M.length - 1] : M, m = [f, {}, !1];
7196
- return m.t = f, m.i18n = {}, m.ready = !1, m;
7195
+ const w = (N, M) => z(M) ? M : Wi(M) && z(M.defaultValue) ? M.defaultValue : Array.isArray(N) ? N[N.length - 1] : N, m = [w, {}, !1];
7196
+ return m.t = w, m.i18n = {}, m.ready = !1, m;
7197
7197
  }
7198
7198
  l.options.react && l.options.react.wait !== void 0 && N1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
7199
7199
  const c = {
@@ -7206,33 +7206,33 @@ const zi = (i, e) => {
7206
7206
  } = c;
7207
7207
  let g = i;
7208
7208
  g = z(g) ? [g] : g || ["translation"], l.reportNamespaces.addUsedNamespaces && l.reportNamespaces.addUsedNamespaces(g);
7209
- const a = (l.isInitialized || l.initializedStoreOnce) && g.every((f) => Bi(f, l, c)), h = Ji(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), C = () => h, p = () => X1(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [v, N] = S(C);
7210
- let x = g.join();
7211
- e.lng && (x = `${e.lng}${x}`);
7212
- const V = zi(x), y = f1(!0);
7209
+ const a = (l.isInitialized || l.initializedStoreOnce) && g.every((w) => Bi(w, l, c)), h = Ji(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), C = () => h, p = () => X1(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [x, R] = B(C);
7210
+ let v = g.join();
7211
+ e.lng && (v = `${e.lng}${v}`);
7212
+ const H = zi(v), y = f1(!0);
7213
7213
  T(() => {
7214
7214
  const {
7215
- bindI18n: f,
7215
+ bindI18n: w,
7216
7216
  bindI18nStore: m
7217
7217
  } = c;
7218
7218
  y.current = !0, !a && !o && (e.lng ? _1(l, e.lng, g, () => {
7219
- y.current && N(p);
7219
+ y.current && R(p);
7220
7220
  }) : H1(l, g, () => {
7221
- y.current && N(p);
7222
- })), a && V && V !== x && y.current && N(p);
7223
- const M = () => {
7224
- y.current && N(p);
7221
+ y.current && R(p);
7222
+ })), a && H && H !== v && y.current && R(p);
7223
+ const N = () => {
7224
+ y.current && R(p);
7225
7225
  };
7226
- return f && l && l.on(f, M), m && l && l.store.on(m, M), () => {
7227
- y.current = !1, f && l && f.split(" ").forEach((R) => l.off(R, M)), m && l && m.split(" ").forEach((R) => l.store.off(R, M));
7226
+ return w && l && l.on(w, N), m && l && l.store.on(m, N), () => {
7227
+ y.current = !1, w && l && w.split(" ").forEach((M) => l.off(M, N)), m && l && m.split(" ").forEach((M) => l.store.off(M, N));
7228
7228
  };
7229
- }, [l, x]), T(() => {
7230
- y.current && a && N(C);
7229
+ }, [l, v]), T(() => {
7230
+ y.current && a && R(C);
7231
7231
  }, [l, d, a]);
7232
- const E = [v, l, a];
7233
- if (E.t = v, E.i18n = l, E.ready = a, a || !a && !o) return E;
7234
- throw new Promise((f) => {
7235
- e.lng ? _1(l, e.lng, g, () => f()) : H1(l, g, () => f());
7232
+ const E = [x, l, a];
7233
+ if (E.t = x, E.i18n = l, E.ready = a, a || !a && !o) return E;
7234
+ throw new Promise((w) => {
7235
+ e.lng ? _1(l, e.lng, g, () => w()) : H1(l, g, () => w());
7236
7236
  });
7237
7237
  }, qi = {
7238
7238
  type: "logger",
@@ -7291,7 +7291,7 @@ class g1 {
7291
7291
  return e = e || this.options, e.prefix = e.prefix || this.prefix, new g1(this.logger, e);
7292
7292
  }
7293
7293
  }
7294
- var P = new g1();
7294
+ var K = new g1();
7295
7295
  class w1 {
7296
7296
  constructor() {
7297
7297
  this.observers = {};
@@ -7326,7 +7326,7 @@ class w1 {
7326
7326
  });
7327
7327
  }
7328
7328
  }
7329
- const t1 = () => {
7329
+ const i1 = () => {
7330
7330
  let i, e;
7331
7331
  const t = new Promise((s, n) => {
7332
7332
  i = s, e = n;
@@ -7336,7 +7336,7 @@ const t1 = () => {
7336
7336
  i.forEach((s) => {
7337
7337
  e[s] && (t[s] = e[s]);
7338
7338
  });
7339
- }, e5 = /###/g, O1 = (i) => i && i.indexOf("###") > -1 ? i.replace(e5, ".") : i, S1 = (i) => !i || typeof i == "string", i1 = (i, e, t) => {
7339
+ }, e5 = /###/g, O1 = (i) => i && i.indexOf("###") > -1 ? i.replace(e5, ".") : i, S1 = (i) => !i || typeof i == "string", s1 = (i, e, t) => {
7340
7340
  const s = typeof e != "string" ? e : e.split(".");
7341
7341
  let n = 0;
7342
7342
  for (; n < s.length - 1; ) {
@@ -7352,26 +7352,26 @@ const t1 = () => {
7352
7352
  const {
7353
7353
  obj: s,
7354
7354
  k: n
7355
- } = i1(i, e, Object);
7355
+ } = s1(i, e, Object);
7356
7356
  if (s !== void 0 || e.length === 1) {
7357
7357
  s[n] = t;
7358
7358
  return;
7359
7359
  }
7360
- let l = e[e.length - 1], c = e.slice(0, e.length - 1), o = i1(i, c, Object);
7360
+ let l = e[e.length - 1], c = e.slice(0, e.length - 1), o = s1(i, c, Object);
7361
7361
  for (; o.obj === void 0 && c.length; )
7362
- l = `${c[c.length - 1]}.${l}`, c = c.slice(0, c.length - 1), o = i1(i, c, Object), o && o.obj && typeof o.obj[`${o.k}.${l}`] < "u" && (o.obj = void 0);
7362
+ l = `${c[c.length - 1]}.${l}`, c = c.slice(0, c.length - 1), o = s1(i, c, Object), o && o.obj && typeof o.obj[`${o.k}.${l}`] < "u" && (o.obj = void 0);
7363
7363
  o.obj[`${o.k}.${l}`] = t;
7364
7364
  }, t5 = (i, e, t, s) => {
7365
7365
  const {
7366
7366
  obj: n,
7367
7367
  k: l
7368
- } = i1(i, e, Object);
7368
+ } = s1(i, e, Object);
7369
7369
  n[l] = n[l] || [], n[l].push(t);
7370
7370
  }, u1 = (i, e) => {
7371
7371
  const {
7372
7372
  obj: t,
7373
7373
  k: s
7374
- } = i1(i, e);
7374
+ } = s1(i, e);
7375
7375
  if (t)
7376
7376
  return t[s];
7377
7377
  }, i5 = (i, e, t) => {
@@ -7525,7 +7525,7 @@ const W1 = {};
7525
7525
  class p1 extends w1 {
7526
7526
  constructor(e) {
7527
7527
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
7528
- super(), Xi(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = P.create("translator");
7528
+ super(), Xi(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = K.create("translator");
7529
7529
  }
7530
7530
  changeLanguage(e) {
7531
7531
  e && (this.language = e);
@@ -7571,15 +7571,15 @@ class p1 extends w1 {
7571
7571
  } = this.extractFromKey(e[e.length - 1], t), d = o[o.length - 1], g = t.lng || this.language, a = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
7572
7572
  if (g && g.toLowerCase() === "cimode") {
7573
7573
  if (a) {
7574
- const f = t.nsSeparator || this.options.nsSeparator;
7574
+ const w = t.nsSeparator || this.options.nsSeparator;
7575
7575
  return n ? {
7576
- res: `${d}${f}${c}`,
7576
+ res: `${d}${w}${c}`,
7577
7577
  usedKey: c,
7578
7578
  exactUsedKey: c,
7579
7579
  usedLng: g,
7580
7580
  usedNS: d,
7581
7581
  usedParams: this.getUsedParamsDetails(t)
7582
- } : `${d}${f}${c}`;
7582
+ } : `${d}${w}${c}`;
7583
7583
  }
7584
7584
  return n ? {
7585
7585
  res: c,
@@ -7592,64 +7592,64 @@ class p1 extends w1 {
7592
7592
  }
7593
7593
  const h = this.resolve(e, t);
7594
7594
  let C = h && h.res;
7595
- const p = h && h.usedKey || c, v = h && h.exactUsedKey || c, N = Object.prototype.toString.apply(C), x = ["[object Number]", "[object Function]", "[object RegExp]"], V = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject;
7596
- if (y && C && (typeof C != "string" && typeof C != "boolean" && typeof C != "number") && x.indexOf(N) < 0 && !(typeof V == "string" && Array.isArray(C))) {
7595
+ const p = h && h.usedKey || c, x = h && h.exactUsedKey || c, R = Object.prototype.toString.apply(C), v = ["[object Number]", "[object Function]", "[object RegExp]"], H = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, y = !this.i18nFormat || this.i18nFormat.handleAsObject;
7596
+ if (y && C && (typeof C != "string" && typeof C != "boolean" && typeof C != "number") && v.indexOf(R) < 0 && !(typeof H == "string" && Array.isArray(C))) {
7597
7597
  if (!t.returnObjects && !this.options.returnObjects) {
7598
7598
  this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
7599
- const f = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, C, {
7599
+ const w = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, C, {
7600
7600
  ...t,
7601
7601
  ns: o
7602
7602
  }) : `key '${c} (${this.language})' returned an object instead of string.`;
7603
- return n ? (h.res = f, h.usedParams = this.getUsedParamsDetails(t), h) : f;
7603
+ return n ? (h.res = w, h.usedParams = this.getUsedParamsDetails(t), h) : w;
7604
7604
  }
7605
7605
  if (l) {
7606
- const f = Array.isArray(C), m = f ? [] : {}, M = f ? v : p;
7607
- for (const R in C)
7608
- if (Object.prototype.hasOwnProperty.call(C, R)) {
7609
- const H = `${M}${l}${R}`;
7610
- m[R] = this.translate(H, {
7606
+ const w = Array.isArray(C), m = w ? [] : {}, N = w ? x : p;
7607
+ for (const M in C)
7608
+ if (Object.prototype.hasOwnProperty.call(C, M)) {
7609
+ const I = `${N}${l}${M}`;
7610
+ m[M] = this.translate(I, {
7611
7611
  ...t,
7612
7612
  joinArrays: !1,
7613
7613
  ns: o
7614
- }), m[R] === H && (m[R] = C[R]);
7614
+ }), m[M] === I && (m[M] = C[M]);
7615
7615
  }
7616
7616
  C = m;
7617
7617
  }
7618
- } else if (y && typeof V == "string" && Array.isArray(C))
7619
- C = C.join(V), C && (C = this.extendTranslation(C, e, t, s));
7618
+ } else if (y && typeof H == "string" && Array.isArray(C))
7619
+ C = C.join(H), C && (C = this.extendTranslation(C, e, t, s));
7620
7620
  else {
7621
- let f = !1, m = !1;
7622
- const M = t.count !== void 0 && typeof t.count != "string", R = p1.hasDefaultValue(t), H = M ? this.pluralResolver.getSuffix(g, t.count, t) : "", W = t.ordinal && M ? this.pluralResolver.getSuffix(g, t.count, {
7621
+ let w = !1, m = !1;
7622
+ const N = t.count !== void 0 && typeof t.count != "string", M = p1.hasDefaultValue(t), I = N ? this.pluralResolver.getSuffix(g, t.count, t) : "", A = t.ordinal && N ? this.pluralResolver.getSuffix(g, t.count, {
7623
7623
  ordinal: !1
7624
- }) : "", A = M && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), _ = A && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${H}`] || t[`defaultValue${W}`] || t.defaultValue;
7625
- !this.isValidLookup(C) && R && (f = !0, C = _), this.isValidLookup(C) || (m = !0, C = c);
7626
- const Z = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && m ? void 0 : C, O = R && _ !== C && this.options.updateMissing;
7627
- if (m || f || O) {
7628
- if (this.logger.log(O ? "updateKey" : "missingKey", g, d, c, O ? _ : C), l) {
7629
- const b = this.resolve(c, {
7624
+ }) : "", S = N && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), b = S && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${I}`] || t[`defaultValue${A}`] || t.defaultValue;
7625
+ !this.isValidLookup(C) && M && (w = !0, C = b), this.isValidLookup(C) || (m = !0, C = c);
7626
+ const Z = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && m ? void 0 : C, _ = M && b !== C && this.options.updateMissing;
7627
+ if (m || w || _) {
7628
+ if (this.logger.log(_ ? "updateKey" : "missingKey", g, d, c, _ ? b : C), l) {
7629
+ const V = this.resolve(c, {
7630
7630
  ...t,
7631
7631
  keySeparator: !1
7632
7632
  });
7633
- b && b.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
7633
+ V && V.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
7634
7634
  }
7635
7635
  let $ = [];
7636
7636
  const Y = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
7637
7637
  if (this.options.saveMissingTo === "fallback" && Y && Y[0])
7638
- for (let b = 0; b < Y.length; b++)
7639
- $.push(Y[b]);
7638
+ for (let V = 0; V < Y.length; V++)
7639
+ $.push(Y[V]);
7640
7640
  else this.options.saveMissingTo === "all" ? $ = this.languageUtils.toResolveHierarchy(t.lng || this.language) : $.push(t.lng || this.language);
7641
- const U = (b, F, K) => {
7642
- const e1 = R && K !== C ? K : Z;
7643
- this.options.missingKeyHandler ? this.options.missingKeyHandler(b, d, F, e1, O, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(b, d, F, e1, O, t), this.emit("missingKey", b, d, F, C);
7641
+ const U = (V, F, G) => {
7642
+ const e1 = M && G !== C ? G : Z;
7643
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(V, d, F, e1, _, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(V, d, F, e1, _, t), this.emit("missingKey", V, d, F, C);
7644
7644
  };
7645
- this.options.saveMissing && (this.options.saveMissingPlurals && M ? $.forEach((b) => {
7646
- const F = this.pluralResolver.getSuffixes(b, t);
7647
- A && t[`defaultValue${this.options.pluralSeparator}zero`] && F.indexOf(`${this.options.pluralSeparator}zero`) < 0 && F.push(`${this.options.pluralSeparator}zero`), F.forEach((K) => {
7648
- U([b], c + K, t[`defaultValue${K}`] || _);
7645
+ this.options.saveMissing && (this.options.saveMissingPlurals && N ? $.forEach((V) => {
7646
+ const F = this.pluralResolver.getSuffixes(V, t);
7647
+ S && t[`defaultValue${this.options.pluralSeparator}zero`] && F.indexOf(`${this.options.pluralSeparator}zero`) < 0 && F.push(`${this.options.pluralSeparator}zero`), F.forEach((G) => {
7648
+ U([V], c + G, t[`defaultValue${G}`] || b);
7649
7649
  });
7650
- }) : U($, c, _));
7650
+ }) : U($, c, b));
7651
7651
  }
7652
- C = this.extendTranslation(C, e, t, h, s), m && C === c && this.options.appendNamespaceToMissingKey && (C = `${d}:${c}`), (m || f) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? C = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${d}:${c}` : c, f ? C : void 0) : C = this.options.parseMissingKeyHandler(C));
7652
+ C = this.extendTranslation(C, e, t, h, s), m && C === c && this.options.appendNamespaceToMissingKey && (C = `${d}:${c}`), (m || w) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? C = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${d}:${c}` : c, w ? C : void 0) : C = this.options.parseMissingKeyHandler(C));
7653
7653
  }
7654
7654
  return n ? (h.res = C, h.usedParams = this.getUsedParamsDetails(t), h) : C;
7655
7655
  }
@@ -7685,8 +7685,8 @@ class p1 extends w1 {
7685
7685
  a < p && (s.nest = !1);
7686
7686
  }
7687
7687
  !s.lng && this.options.compatibilityAPI !== "v1" && n && n.res && (s.lng = this.language || n.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, function() {
7688
- for (var C = arguments.length, p = new Array(C), v = 0; v < C; v++)
7689
- p[v] = arguments[v];
7688
+ for (var C = arguments.length, p = new Array(C), x = 0; x < C; x++)
7689
+ p[x] = arguments[x];
7690
7690
  return l && l[0] === p[0] && !s.context ? (c.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`), null) : c.translate(...p, t);
7691
7691
  }, s)), s.interpolation && this.interpolator.reset();
7692
7692
  }
@@ -7707,26 +7707,26 @@ class p1 extends w1 {
7707
7707
  n = a;
7708
7708
  let h = g.namespaces;
7709
7709
  this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
7710
- const C = t.count !== void 0 && typeof t.count != "string", p = C && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), v = t.context !== void 0 && (typeof t.context == "string" || typeof t.context == "number") && t.context !== "", N = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
7711
- h.forEach((x) => {
7712
- this.isValidLookup(s) || (o = x, !W1[`${N[0]}-${x}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o) && (W1[`${N[0]}-${x}`] = !0, this.logger.warn(`key "${n}" for languages "${N.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), N.forEach((V) => {
7710
+ const C = t.count !== void 0 && typeof t.count != "string", p = C && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), x = t.context !== void 0 && (typeof t.context == "string" || typeof t.context == "number") && t.context !== "", R = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
7711
+ h.forEach((v) => {
7712
+ this.isValidLookup(s) || (o = v, !W1[`${R[0]}-${v}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o) && (W1[`${R[0]}-${v}`] = !0, this.logger.warn(`key "${n}" for languages "${R.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), R.forEach((H) => {
7713
7713
  if (this.isValidLookup(s)) return;
7714
- c = V;
7714
+ c = H;
7715
7715
  const y = [a];
7716
7716
  if (this.i18nFormat && this.i18nFormat.addLookupKeys)
7717
- this.i18nFormat.addLookupKeys(y, a, V, x, t);
7717
+ this.i18nFormat.addLookupKeys(y, a, H, v, t);
7718
7718
  else {
7719
- let f;
7720
- C && (f = this.pluralResolver.getSuffix(V, t.count, t));
7721
- const m = `${this.options.pluralSeparator}zero`, M = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
7722
- if (C && (y.push(a + f), t.ordinal && f.indexOf(M) === 0 && y.push(a + f.replace(M, this.options.pluralSeparator)), p && y.push(a + m)), v) {
7723
- const R = `${a}${this.options.contextSeparator}${t.context}`;
7724
- y.push(R), C && (y.push(R + f), t.ordinal && f.indexOf(M) === 0 && y.push(R + f.replace(M, this.options.pluralSeparator)), p && y.push(R + m));
7719
+ let w;
7720
+ C && (w = this.pluralResolver.getSuffix(H, t.count, t));
7721
+ const m = `${this.options.pluralSeparator}zero`, N = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
7722
+ if (C && (y.push(a + w), t.ordinal && w.indexOf(N) === 0 && y.push(a + w.replace(N, this.options.pluralSeparator)), p && y.push(a + m)), x) {
7723
+ const M = `${a}${this.options.contextSeparator}${t.context}`;
7724
+ y.push(M), C && (y.push(M + w), t.ordinal && w.indexOf(N) === 0 && y.push(M + w.replace(N, this.options.pluralSeparator)), p && y.push(M + m));
7725
7725
  }
7726
7726
  }
7727
7727
  let E;
7728
7728
  for (; E = y.pop(); )
7729
- this.isValidLookup(s) || (l = E, s = this.getResource(V, x, E, t));
7729
+ this.isValidLookup(s) || (l = E, s = this.getResource(H, v, E, t));
7730
7730
  }));
7731
7731
  });
7732
7732
  }), {
@@ -7771,7 +7771,7 @@ class p1 extends w1 {
7771
7771
  const L1 = (i) => i.charAt(0).toUpperCase() + i.slice(1);
7772
7772
  class j1 {
7773
7773
  constructor(e) {
7774
- this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = P.create("languageUtils");
7774
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = K.create("languageUtils");
7775
7775
  }
7776
7776
  getScriptPartFromCode(e) {
7777
7777
  if (e = C1(e), !e || e.indexOf("-") < 0) return null;
@@ -7965,7 +7965,7 @@ const d5 = ["v1", "v2", "v3"], g5 = ["v4"], Z1 = {
7965
7965
  class C5 {
7966
7966
  constructor(e) {
7967
7967
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
7968
- this.languageUtils = e, this.options = t, this.logger = P.create("pluralResolver"), (!this.options.compatibilityJSON || g5.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = u5(), this.pluralRulesCache = {};
7968
+ this.languageUtils = e, this.options = t, this.logger = K.create("pluralResolver"), (!this.options.compatibilityJSON || g5.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = u5(), this.pluralRulesCache = {};
7969
7969
  }
7970
7970
  addRule(e, t) {
7971
7971
  this.rules[e] = t;
@@ -8029,7 +8029,7 @@ const D1 = function(i, e, t) {
8029
8029
  class p5 {
8030
8030
  constructor() {
8031
8031
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
8032
- this.logger = P.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
8032
+ this.logger = K.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
8033
8033
  }
8034
8034
  init() {
8035
8035
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -8049,13 +8049,13 @@ class p5 {
8049
8049
  unescapePrefix: h,
8050
8050
  nestingPrefix: C,
8051
8051
  nestingPrefixEscaped: p,
8052
- nestingSuffix: v,
8053
- nestingSuffixEscaped: N,
8054
- nestingOptionsSeparator: x,
8055
- maxReplaces: V,
8052
+ nestingSuffix: x,
8053
+ nestingSuffixEscaped: R,
8054
+ nestingOptionsSeparator: v,
8055
+ maxReplaces: H,
8056
8056
  alwaysFormat: y
8057
8057
  } = e.interpolation;
8058
- this.escape = t !== void 0 ? t : n5, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = l ? J(l) : c || "{{", this.suffix = o ? J(o) : d || "}}", this.formatSeparator = g || ",", this.unescapePrefix = a ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : a || "", this.nestingPrefix = C ? J(C) : p || J("$t("), this.nestingSuffix = v ? J(v) : N || J(")"), this.nestingOptionsSeparator = x || ",", this.maxReplaces = V || 1e3, this.alwaysFormat = y !== void 0 ? y : !1, this.resetRegExp();
8058
+ this.escape = t !== void 0 ? t : n5, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = l ? J(l) : c || "{{", this.suffix = o ? J(o) : d || "}}", this.formatSeparator = g || ",", this.unescapePrefix = a ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : a || "", this.nestingPrefix = C ? J(C) : p || J("$t("), this.nestingSuffix = x ? J(x) : R || J(")"), this.nestingOptionsSeparator = v || ",", this.maxReplaces = H || 1e3, this.alwaysFormat = y !== void 0 ? y : !1, this.resetRegExp();
8059
8059
  }
8060
8060
  reset() {
8061
8061
  this.options && this.init(this.options);
@@ -8068,18 +8068,18 @@ class p5 {
8068
8068
  let l, c, o;
8069
8069
  const d = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, g = (p) => {
8070
8070
  if (p.indexOf(this.formatSeparator) < 0) {
8071
- const V = D1(t, d, p, this.options.keySeparator, this.options.ignoreJSONStructure);
8072
- return this.alwaysFormat ? this.format(V, void 0, s, {
8071
+ const H = D1(t, d, p, this.options.keySeparator, this.options.ignoreJSONStructure);
8072
+ return this.alwaysFormat ? this.format(H, void 0, s, {
8073
8073
  ...n,
8074
8074
  ...t,
8075
8075
  interpolationkey: p
8076
- }) : V;
8076
+ }) : H;
8077
8077
  }
8078
- const v = p.split(this.formatSeparator), N = v.shift().trim(), x = v.join(this.formatSeparator).trim();
8079
- return this.format(D1(t, d, N, this.options.keySeparator, this.options.ignoreJSONStructure), x, s, {
8078
+ const x = p.split(this.formatSeparator), R = x.shift().trim(), v = x.join(this.formatSeparator).trim();
8079
+ return this.format(D1(t, d, R, this.options.keySeparator, this.options.ignoreJSONStructure), v, s, {
8080
8080
  ...n,
8081
8081
  ...t,
8082
- interpolationkey: N
8082
+ interpolationkey: R
8083
8083
  });
8084
8084
  };
8085
8085
  this.resetRegExp();
@@ -8092,21 +8092,21 @@ class p5 {
8092
8092
  safeValue: (p) => this.escapeValue ? v1(this.escape(p)) : v1(p)
8093
8093
  }].forEach((p) => {
8094
8094
  for (o = 0; l = p.regex.exec(e); ) {
8095
- const v = l[1].trim();
8096
- if (c = g(v), c === void 0)
8095
+ const x = l[1].trim();
8096
+ if (c = g(x), c === void 0)
8097
8097
  if (typeof a == "function") {
8098
- const x = a(e, l, n);
8099
- c = typeof x == "string" ? x : "";
8100
- } else if (n && Object.prototype.hasOwnProperty.call(n, v))
8098
+ const v = a(e, l, n);
8099
+ c = typeof v == "string" ? v : "";
8100
+ } else if (n && Object.prototype.hasOwnProperty.call(n, x))
8101
8101
  c = "";
8102
8102
  else if (h) {
8103
8103
  c = l[0];
8104
8104
  continue;
8105
8105
  } else
8106
- this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`), c = "";
8106
+ this.logger.warn(`missed to pass in variable ${x} for interpolating ${e}`), c = "";
8107
8107
  else typeof c != "string" && !this.useRawValueToEscape && (c = I1(c));
8108
- const N = p.safeValue(c);
8109
- if (e = e.replace(l[0], N), h ? (p.regex.lastIndex += c.length, p.regex.lastIndex -= l[0].length) : p.regex.lastIndex = 0, o++, o >= this.maxReplaces)
8108
+ const R = p.safeValue(c);
8109
+ if (e = e.replace(l[0], R), h ? (p.regex.lastIndex += c.length, p.regex.lastIndex -= l[0].length) : p.regex.lastIndex = 0, o++, o >= this.maxReplaces)
8110
8110
  break;
8111
8111
  }
8112
8112
  }), e;
@@ -8119,15 +8119,15 @@ class p5 {
8119
8119
  const h = d.split(new RegExp(`${a}[ ]*{`));
8120
8120
  let C = `{${h[1]}`;
8121
8121
  d = h[0], C = this.interpolate(C, c);
8122
- const p = C.match(/'/g), v = C.match(/"/g);
8123
- (p && p.length % 2 === 0 && !v || v.length % 2 !== 0) && (C = C.replace(/'/g, '"'));
8122
+ const p = C.match(/'/g), x = C.match(/"/g);
8123
+ (p && p.length % 2 === 0 && !x || x.length % 2 !== 0) && (C = C.replace(/'/g, '"'));
8124
8124
  try {
8125
8125
  c = JSON.parse(C), g && (c = {
8126
8126
  ...g,
8127
8127
  ...c
8128
8128
  });
8129
- } catch (N) {
8130
- return this.logger.warn(`failed parsing options string in nesting for key ${d}`, N), `${d}${a}${C}`;
8129
+ } catch (R) {
8130
+ return this.logger.warn(`failed parsing options string in nesting for key ${d}`, R), `${d}${a}${C}`;
8131
8131
  }
8132
8132
  return c.defaultValue && c.defaultValue.indexOf(this.prefix) > -1 && delete c.defaultValue, d;
8133
8133
  };
@@ -8184,7 +8184,7 @@ const f5 = (i) => {
8184
8184
  class w5 {
8185
8185
  constructor() {
8186
8186
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
8187
- this.logger = P.create("formatter"), this.options = e, this.formats = {
8187
+ this.logger = K.create("formatter"), this.options = e, this.formats = {
8188
8188
  number: Q((t, s) => {
8189
8189
  const n = new Intl.NumberFormat(t, {
8190
8190
  ...s
@@ -8267,7 +8267,7 @@ const m5 = (i, e) => {
8267
8267
  class k5 extends w1 {
8268
8268
  constructor(e, t, s) {
8269
8269
  let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
8270
- super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = P.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = n.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = n.maxRetries >= 0 ? n.maxRetries : 5, this.retryTimeout = n.retryTimeout >= 1 ? n.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(s, n.backend, n);
8270
+ super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = K.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = n.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = n.maxRetries >= 0 ? n.maxRetries : 5, this.retryTimeout = n.retryTimeout >= 1 ? n.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(s, n.backend, n);
8271
8271
  }
8272
8272
  queueLoad(e, t, s, n) {
8273
8273
  const l = {}, c = {}, o = {}, d = {};
@@ -8461,10 +8461,10 @@ const T1 = () => ({
8461
8461
  typeof i[t] == "function" && (i[t] = i[t].bind(i));
8462
8462
  });
8463
8463
  };
8464
- class s1 extends w1 {
8464
+ class n1 extends w1 {
8465
8465
  constructor() {
8466
8466
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
8467
- if (super(), this.options = G1(e), this.services = {}, this.logger = P, this.modules = {
8467
+ if (super(), this.options = G1(e), this.services = {}, this.logger = K, this.modules = {
8468
8468
  external: []
8469
8469
  }, L5(this), t && !this.isInitialized && !e.isClone) {
8470
8470
  if (!this.options.initImmediate)
@@ -8489,26 +8489,26 @@ class s1 extends w1 {
8489
8489
  }), t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
8490
8490
  const l = (a) => a ? typeof a == "function" ? new a() : a : null;
8491
8491
  if (!this.options.isClone) {
8492
- this.modules.logger ? P.init(l(this.modules.logger), this.options) : P.init(null, this.options);
8492
+ this.modules.logger ? K.init(l(this.modules.logger), this.options) : K.init(null, this.options);
8493
8493
  let a;
8494
8494
  this.modules.formatter ? a = this.modules.formatter : typeof Intl < "u" && (a = w5);
8495
8495
  const h = new j1(this.options);
8496
8496
  this.store = new B1(this.options.resources, this.options);
8497
8497
  const C = this.services;
8498
- C.logger = P, C.resourceStore = this.store, C.languageUtils = h, C.pluralResolver = new C5(h, {
8498
+ C.logger = K, C.resourceStore = this.store, C.languageUtils = h, C.pluralResolver = new C5(h, {
8499
8499
  prepend: this.options.pluralSeparator,
8500
8500
  compatibilityJSON: this.options.compatibilityJSON,
8501
8501
  simplifyPluralSuffix: this.options.simplifyPluralSuffix
8502
8502
  }), a && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (C.formatter = l(a), C.formatter.init(C, this.options), this.options.interpolation.format = C.formatter.format.bind(C.formatter)), C.interpolator = new p5(this.options), C.utils = {
8503
8503
  hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
8504
8504
  }, C.backendConnector = new k5(l(this.modules.backend), C.resourceStore, C, this.options), C.backendConnector.on("*", function(p) {
8505
- for (var v = arguments.length, N = new Array(v > 1 ? v - 1 : 0), x = 1; x < v; x++)
8506
- N[x - 1] = arguments[x];
8507
- e.emit(p, ...N);
8505
+ for (var x = arguments.length, R = new Array(x > 1 ? x - 1 : 0), v = 1; v < x; v++)
8506
+ R[v - 1] = arguments[v];
8507
+ e.emit(p, ...R);
8508
8508
  }), this.modules.languageDetector && (C.languageDetector = l(this.modules.languageDetector), C.languageDetector.init && C.languageDetector.init(C, this.options.detection, this.options)), this.modules.i18nFormat && (C.i18nFormat = l(this.modules.i18nFormat), C.i18nFormat.init && C.i18nFormat.init(this)), this.translator = new p1(this.services, this.options), this.translator.on("*", function(p) {
8509
- for (var v = arguments.length, N = new Array(v > 1 ? v - 1 : 0), x = 1; x < v; x++)
8510
- N[x - 1] = arguments[x];
8511
- e.emit(p, ...N);
8509
+ for (var x = arguments.length, R = new Array(x > 1 ? x - 1 : 0), v = 1; v < x; v++)
8510
+ R[v - 1] = arguments[v];
8511
+ e.emit(p, ...R);
8512
8512
  }), this.modules.external.forEach((p) => {
8513
8513
  p.init && p.init(this);
8514
8514
  });
@@ -8526,7 +8526,7 @@ class s1 extends w1 {
8526
8526
  return e.store[a](...arguments), e;
8527
8527
  };
8528
8528
  });
8529
- const d = t1(), g = () => {
8529
+ const d = i1(), g = () => {
8530
8530
  const a = (h, C) => {
8531
8531
  this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), d.resolve(C), s(h, C);
8532
8532
  };
@@ -8553,7 +8553,7 @@ class s1 extends w1 {
8553
8553
  s(null);
8554
8554
  }
8555
8555
  reloadResources(e, t, s) {
8556
- const n = t1();
8556
+ const n = i1();
8557
8557
  return typeof e == "function" && (s = e, e = void 0), typeof t == "function" && (s = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), s || (s = h1), this.services.backendConnector.reload(e, t, (l) => {
8558
8558
  n.resolve(), s(l);
8559
8559
  }), n;
@@ -8576,7 +8576,7 @@ class s1 extends w1 {
8576
8576
  changeLanguage(e, t) {
8577
8577
  var s = this;
8578
8578
  this.isLanguageChangingTo = e;
8579
- const n = t1();
8579
+ const n = i1();
8580
8580
  this.emit("languageChanging", e);
8581
8581
  const l = (d) => {
8582
8582
  this.language = d, this.languages = this.services.languageUtils.toResolveHierarchy(d), this.resolvedLanguage = void 0, this.setResolvedLanguage(d);
@@ -8610,7 +8610,7 @@ class s1 extends w1 {
8610
8610
  d.lng = d.lng || l.lng, d.lngs = d.lngs || l.lngs, d.ns = d.ns || l.ns, d.keyPrefix !== "" && (d.keyPrefix = d.keyPrefix || s || l.keyPrefix);
8611
8611
  const C = n.options.keySeparator || ".";
8612
8612
  let p;
8613
- return d.keyPrefix && Array.isArray(c) ? p = c.map((v) => `${d.keyPrefix}${C}${v}`) : p = d.keyPrefix ? `${d.keyPrefix}${C}${c}` : c, n.t(p, d);
8613
+ return d.keyPrefix && Array.isArray(c) ? p = c.map((x) => `${d.keyPrefix}${C}${x}`) : p = d.keyPrefix ? `${d.keyPrefix}${C}${c}` : c, n.t(p, d);
8614
8614
  };
8615
8615
  return typeof e == "string" ? l.lng = e : l.lngs = e, l.ns = t, l.keyPrefix = s, l;
8616
8616
  }
@@ -8642,7 +8642,7 @@ class s1 extends w1 {
8642
8642
  return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || c(s, e) && (!n || c(l, e)));
8643
8643
  }
8644
8644
  loadNamespaces(e, t) {
8645
- const s = t1();
8645
+ const s = i1();
8646
8646
  return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach((n) => {
8647
8647
  this.options.ns.indexOf(n) < 0 && this.options.ns.push(n);
8648
8648
  }), this.loadResources((n) => {
@@ -8650,7 +8650,7 @@ class s1 extends w1 {
8650
8650
  }), s) : (t && t(), Promise.resolve());
8651
8651
  }
8652
8652
  loadLanguages(e, t) {
8653
- const s = t1();
8653
+ const s = i1();
8654
8654
  typeof e == "string" && (e = [e]);
8655
8655
  const n = this.options.preload || [], l = e.filter((c) => n.indexOf(c) < 0 && this.services.languageUtils.isSupportedCode(c));
8656
8656
  return l.length ? (this.options.preload = n.concat(l), this.loadResources((c) => {
@@ -8664,7 +8664,7 @@ class s1 extends w1 {
8664
8664
  }
8665
8665
  static createInstance() {
8666
8666
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
8667
- return new s1(e, t);
8667
+ return new n1(e, t);
8668
8668
  }
8669
8669
  cloneInstance() {
8670
8670
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : h1;
@@ -8674,7 +8674,7 @@ class s1 extends w1 {
8674
8674
  ...this.options,
8675
8675
  ...e,
8676
8676
  isClone: !0
8677
- }, l = new s1(n);
8677
+ }, l = new n1(n);
8678
8678
  return (e.debug !== void 0 || e.prefix !== void 0) && (l.logger = l.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
8679
8679
  l[o] = this[o];
8680
8680
  }), l.services = {
@@ -8699,22 +8699,22 @@ class s1 extends w1 {
8699
8699
  };
8700
8700
  }
8701
8701
  }
8702
- const B = s1.createInstance();
8703
- B.createInstance = s1.createInstance;
8704
- B.createInstance;
8705
- B.dir;
8706
- B.init;
8707
- B.loadResources;
8708
- B.reloadResources;
8709
- B.use;
8710
- B.changeLanguage;
8711
- B.getFixedT;
8712
- B.t;
8713
- B.exists;
8714
- B.setDefaultNamespace;
8715
- B.hasLoadedNamespace;
8716
- B.loadNamespaces;
8717
- B.loadLanguages;
8702
+ const W = n1.createInstance();
8703
+ W.createInstance = n1.createInstance;
8704
+ W.createInstance;
8705
+ W.dir;
8706
+ W.init;
8707
+ W.loadResources;
8708
+ W.reloadResources;
8709
+ W.use;
8710
+ W.changeLanguage;
8711
+ W.getFixedT;
8712
+ W.t;
8713
+ W.exists;
8714
+ W.setDefaultNamespace;
8715
+ W.hasLoadedNamespace;
8716
+ W.loadNamespaces;
8717
+ W.loadLanguages;
8718
8718
  const v5 = "Archived", N5 = "Deleted", x5 = {
8719
8719
  archived: v5,
8720
8720
  deleted: N5
@@ -8722,7 +8722,7 @@ const v5 = "Archived", N5 = "Deleted", x5 = {
8722
8722
  archived: R5,
8723
8723
  deleted: M5
8724
8724
  };
8725
- B.use(Fi).init({
8725
+ W.use(Fi).init({
8726
8726
  defaultNS: "common",
8727
8727
  lng: "en",
8728
8728
  resources: {
@@ -8734,142 +8734,152 @@ B.use(Fi).init({
8734
8734
  }
8735
8735
  }
8736
8736
  });
8737
- const O5 = r1(
8738
- ({ fetchParams: i, mode: e = void 0, placeholder: t, disabled: s, value: n, onChange: l, onError: c }, o) => {
8739
- const { axiosPeople: d, locale: g } = o1(Ce), { t: a } = Qi("common", { lng: g }), [h, C] = S([]), [p, v] = S(!0);
8740
- if (!d)
8737
+ const O5 = o1(
8738
+ ({
8739
+ fetchParams: i,
8740
+ mode: e = void 0,
8741
+ placeholder: t,
8742
+ disabled: s,
8743
+ value: n,
8744
+ onChange: l,
8745
+ onError: c,
8746
+ allowEmpty: o = !1
8747
+ }, d) => {
8748
+ const { axiosPeople: g, locale: a } = l1(Ce), { t: h } = Qi("common", { lng: a }), [C, p] = B([]), [x, R] = B(!0);
8749
+ if (!g)
8741
8750
  throw new Error(
8742
8751
  `UserSelect requires "axiosPeople" to fetch users.
8743
8752
  Please provide it via SNMTUiContext.`
8744
8753
  );
8745
- const N = j(
8746
- (f) => {
8747
- let m = "";
8748
- return f.deletedAt && (m += `[${a("deleted")}] `), f.status === d1.ARCHIVED && (m += `[${a("archived")}] `), `${m}${f.firstName} ${f.lastName}`;
8754
+ const v = j(
8755
+ (m) => {
8756
+ let N = "";
8757
+ return m.deletedAt && (N += `[${h("deleted")}] `), m.status === d1.ARCHIVED && (N += `[${h("archived")}] `), `${N}${m.firstName} ${m.lastName}`;
8749
8758
  },
8750
- [a]
8751
- ), x = j(
8759
+ [h]
8760
+ ), H = j(
8752
8761
  async ({
8753
- offset: f,
8754
- limit: m,
8762
+ offset: m,
8763
+ limit: N,
8755
8764
  search: M
8756
8765
  }) => {
8757
- var R, H, W;
8766
+ var I, A, S;
8758
8767
  try {
8759
- const A = await d.post("v1/users/search", {
8760
- offset: f,
8761
- limit: m,
8768
+ const b = await g.post("v1/users/search", {
8769
+ offset: m,
8770
+ limit: N,
8762
8771
  search: M,
8763
8772
  ...i,
8764
8773
  includeCount: !0
8765
- }), { data: _, metadata: G } = A.data;
8774
+ }), { data: P, metadata: Z } = b.data;
8766
8775
  return {
8767
- options: _.map((Z) => ({
8768
- value: Z.id,
8769
- label: N(Z)
8776
+ options: P.map((_) => ({
8777
+ value: _.id,
8778
+ label: v(_)
8770
8779
  })),
8771
- count: G.count
8780
+ count: Z.count
8772
8781
  };
8773
- } catch (A) {
8782
+ } catch (b) {
8774
8783
  return c && c({
8775
- status: ((R = A.response) == null ? void 0 : R.status) ?? 500,
8776
- message: ((W = (H = A.response) == null ? void 0 : H.data) == null ? void 0 : W.message) ?? "Error while fetching options"
8784
+ status: ((I = b.response) == null ? void 0 : I.status) ?? 500,
8785
+ message: ((S = (A = b.response) == null ? void 0 : A.data) == null ? void 0 : S.message) ?? "Error while fetching options"
8777
8786
  }), {
8778
8787
  options: [],
8779
8788
  count: 0
8780
8789
  };
8781
8790
  }
8782
8791
  },
8783
- [d, i, c, N]
8784
- ), V = j(
8785
- async (f) => {
8786
- var m, M, R;
8792
+ [g, i, c, v]
8793
+ ), y = j(
8794
+ async (m) => {
8795
+ var N, M, I;
8787
8796
  try {
8788
8797
  return await Promise.all(
8789
- f.map(async (W) => {
8790
- const A = h.find((Z) => Z.value === W);
8791
- if (A)
8792
- return A;
8793
- const G = (await d.post("v1/users/search", {
8798
+ m.map(async (S) => {
8799
+ const b = C.find((_) => _.value === S);
8800
+ if (b)
8801
+ return b;
8802
+ const Z = (await g.post("v1/users/search", {
8794
8803
  filters: {
8795
- id: [W],
8804
+ id: [S],
8796
8805
  status: [d1.ACTIVE, d1.ARCHIVED]
8797
8806
  }
8798
8807
  })).data.data[0];
8799
8808
  return {
8800
- value: W,
8801
- label: N(G)
8809
+ value: S,
8810
+ label: v(Z)
8802
8811
  };
8803
8812
  })
8804
8813
  );
8805
- } catch (H) {
8814
+ } catch (A) {
8806
8815
  return c && c({
8807
- status: ((m = H.response) == null ? void 0 : m.status) ?? 500,
8808
- message: ((R = (M = H.response) == null ? void 0 : M.data) == null ? void 0 : R.message) ?? "Error while fetching selected items"
8816
+ status: ((N = A.response) == null ? void 0 : N.status) ?? 500,
8817
+ message: ((I = (M = A.response) == null ? void 0 : M.data) == null ? void 0 : I.message) ?? "Error while fetching selected items"
8809
8818
  }), [];
8810
8819
  }
8811
8820
  },
8812
8821
  // Use eslint disable to exclude selectedOptions to prevent infinity rerender
8813
8822
  // eslint-disable-next-line react-hooks/exhaustive-deps
8814
- [d, N, c]
8823
+ [g, v, c]
8815
8824
  );
8816
8825
  T(() => {
8817
8826
  if (!n) {
8818
- v(!1);
8827
+ R(!1);
8819
8828
  return;
8820
8829
  }
8821
8830
  (async () => {
8822
- const m = Array.isArray(n) ? n : [n], M = await V(m);
8823
- C(M), v(!1);
8831
+ const N = Array.isArray(n) ? n : [n], M = await y(N);
8832
+ p(M), R(!1);
8824
8833
  })();
8825
- }, [V, n]);
8826
- const y = j(
8834
+ }, [y, n]);
8835
+ const E = j(
8827
8836
  async ({
8828
- limit: f,
8829
- offset: m,
8837
+ limit: m,
8838
+ offset: N,
8830
8839
  search: M
8831
8840
  }) => {
8832
- const { options: R, count: H } = await x({
8833
- offset: m,
8834
- limit: f,
8841
+ const { count: I, ...A } = await H({
8842
+ offset: N,
8843
+ limit: m,
8835
8844
  search: M
8836
8845
  });
8837
- return {
8838
- options: R,
8839
- count: H,
8840
- limit: f
8846
+ let S = A.options;
8847
+ return o && N === 0 && (S = [{ value: null, label: "None" }, ...S]), {
8848
+ options: S,
8849
+ count: I,
8850
+ limit: m
8841
8851
  };
8842
8852
  },
8843
- [x]
8853
+ [o, H]
8844
8854
  );
8845
- if (p)
8855
+ if (x)
8846
8856
  return /* @__PURE__ */ r(Oi, {});
8847
- const E = {
8848
- ref: o,
8857
+ const w = {
8858
+ ref: d,
8849
8859
  placeholder: t,
8850
8860
  disabled: s
8851
8861
  };
8852
8862
  return e ? /* @__PURE__ */ r(
8853
8863
  E1,
8854
8864
  {
8855
- ...E,
8865
+ ...w,
8856
8866
  mode: e,
8857
8867
  value: n,
8858
8868
  onChange: l,
8859
- loadOptions: y,
8869
+ loadOptions: E,
8860
8870
  loadOnClosedState: !0,
8861
- extraOptions: h
8871
+ extraOptions: C
8862
8872
  }
8863
8873
  ) : /* @__PURE__ */ r(
8864
8874
  E1,
8865
8875
  {
8866
- ...E,
8876
+ ...w,
8867
8877
  value: n,
8868
8878
  mode: void 0,
8869
8879
  onChange: l,
8870
- loadOptions: y,
8880
+ loadOptions: E,
8871
8881
  loadOnClosedState: !0,
8872
- extraOptions: h
8882
+ extraOptions: C
8873
8883
  }
8874
8884
  );
8875
8885
  }