@snmt-react-ui/user-select 2.5.0 → 2.5.2

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 (2) hide show
  1. package/dist/user-select.js +348 -350
  2. package/package.json +3 -3
@@ -3,10 +3,10 @@ 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 B, 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 A, useRef as l1, useEffect as G, useCallback as Z, useImperativeHandle as ae, useContext as a1 } 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
- const c1 = ({
9
+ const d1 = ({
10
10
  children: i,
11
11
  direction: e = "row",
12
12
  flexWrap: t = "nowrap",
@@ -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] = B(i), [d, g] = B(e);
60
- T(() => {
59
+ const [c, o] = A(i), [d, g] = A(e);
60
+ G(() => {
61
61
  o(i), g(e);
62
62
  }, [i, e]);
63
- const { theme: a } = o1($1);
63
+ const { theme: a } = a1($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
+ ), h1 = ({
3072
3072
  name: i,
3073
3073
  width: e,
3074
3074
  height: t,
@@ -3077,8 +3077,8 @@ const we = ({
3077
3077
  disabled: l = !1,
3078
3078
  onClick: c
3079
3079
  }) => {
3080
- const [o, d] = B(n), { theme: g } = o1(F1), a = l ? g && g === "dark" ? k.GREY_LIGHT_4 : k.GREY_DARK_1 : s, h = l ? void 0 : c;
3081
- return T(() => {
3080
+ const [o, d] = A(n), { theme: g } = a1(F1), a = l ? g && g === "dark" ? k.GREY_LIGHT_4 : k.GREY_DARK_1 : s, h = l ? void 0 : c;
3081
+ return G(() => {
3082
3082
  if (n) {
3083
3083
  h && !l && d(`${n} clickable`);
3084
3084
  return;
@@ -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,8 +6369,8 @@ const Jt = ({
6369
6369
  disabled: l = !1,
6370
6370
  onClick: c
6371
6371
  }) => {
6372
- const [o, d] = B(n), { theme: g } = o1(Y1), a = l ? g && g === "dark" ? L.GREY_LIGHT_4 : L.GREY_DARK_1 : s, h = l ? void 0 : c;
6373
- return T(() => {
6372
+ const [o, d] = A(n), { theme: g } = a1(Y1), a = l ? g && g === "dark" ? L.GREY_LIGHT_4 : L.GREY_DARK_1 : s, h = l ? void 0 : c;
6373
+ return G(() => {
6374
6374
  if (n) {
6375
6375
  h && !l && d(`${n} clickable`);
6376
6376
  return;
@@ -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] = B(!1);
6698
+ const [c, o] = A(!1);
6699
6699
  return /* @__PURE__ */ r(
6700
6700
  ue,
6701
6701
  {
@@ -6719,8 +6719,8 @@ 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] = B(!1);
6723
- T(() => {
6722
+ const [c, o] = A(!1);
6723
+ G(() => {
6724
6724
  i.length || o(!1);
6725
6725
  }, [i]);
6726
6726
  const d = (a) => {
@@ -6737,7 +6737,7 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
6737
6737
  {
6738
6738
  content: (
6739
6739
  // 90: paddings + margins + gaps and so on
6740
- /* @__PURE__ */ r("div", { style: { maxWidth: t - 90 }, children: /* @__PURE__ */ r(c1, { gap: 6, flexWrap: "wrap", children: i.map(({ value: a }) => /* @__PURE__ */ r(
6740
+ /* @__PURE__ */ r("div", { style: { maxWidth: t - 90 }, children: /* @__PURE__ */ r(d1, { gap: 6, flexWrap: "wrap", children: i.map(({ value: a }) => /* @__PURE__ */ r(
6741
6741
  z1,
6742
6742
  {
6743
6743
  onClose: () => e(a),
@@ -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,97 +6780,97 @@ 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: x,
6783
+ id: v,
6784
6784
  extraOptions: R,
6785
- dropdownRender: v,
6786
- optionRender: _,
6785
+ dropdownRender: N,
6786
+ optionRender: E,
6787
6787
  isLoading: y,
6788
6788
  readOnly: V
6789
- }, w) => {
6790
- const [m, N] = B(!1), [M, I] = B(!1), [A, S] = B(!0), [b, P] = B(i), Z = f1(null);
6791
- T(() => {
6792
- P(i);
6789
+ }, m) => {
6790
+ const [M, x] = A(!1), [f, I] = A(!1), [B, S] = A(!0), [b, D] = A(i), j = l1(null);
6791
+ G(() => {
6792
+ D(i);
6793
6793
  }, [i]);
6794
- const H = (f) => {
6795
- N(f), h && h(f);
6796
- }, $ = (f, O) => {
6797
- var D;
6798
- return !!((D = O == null ? void 0 : O.label) != null && D.toString().toLowerCase().includes(f.toLowerCase()));
6794
+ const _ = (w) => {
6795
+ x(w), h && h(w);
6796
+ }, T = (w, O) => {
6797
+ var K;
6798
+ return !!((K = O == null ? void 0 : O.label) != null && K.toString().toLowerCase().includes(w.toLowerCase()));
6799
6799
  }, Y = () => {
6800
6800
  I(!0);
6801
6801
  }, U = () => {
6802
6802
  I(!1);
6803
- }, E = j(
6804
- (f) => {
6805
- if (P(f), s) {
6806
- const D = f;
6807
- e == null || e(D);
6803
+ }, H = Z(
6804
+ (w) => {
6805
+ if (D(w), s) {
6806
+ const K = w;
6807
+ e == null || e(K);
6808
6808
  return;
6809
6809
  }
6810
- const O = f;
6810
+ const O = w;
6811
6811
  e == null || e(O);
6812
6812
  },
6813
6813
  [s, e]
6814
- ), F = j(() => {
6814
+ ), F = Z(() => {
6815
6815
  if (!V) {
6816
6816
  if (s) {
6817
- E([]);
6817
+ H([]);
6818
6818
  return;
6819
6819
  }
6820
- E("");
6820
+ H("");
6821
6821
  }
6822
- }, [E, s, V]), G = j(
6823
- (f) => {
6824
- const O = b.filter((D) => D !== f);
6825
- E(O), P(O);
6822
+ }, [H, s, V]), P = Z(
6823
+ (w) => {
6824
+ const O = b.filter((K) => K !== w);
6825
+ H(O), D(O);
6826
6826
  },
6827
- [E, b]
6828
- ), e1 = j(
6829
- (f) => (b == null ? void 0 : b.indexOf(f)) === 0 ? (
6827
+ [H, b]
6828
+ ), e1 = Z(
6829
+ (w) => (b == null ? void 0 : b.indexOf(w)) === 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: A ? t : "" })
6832
+ /* @__PURE__ */ r("span", { className: "custom-placeholder", children: B ? t : "" })
6833
6833
  ) : /* @__PURE__ */ r(X, {}),
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
- }, m1 = j(
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;
6834
+ [B, b, t]
6835
+ ), ie = (w) => {
6836
+ w.preventDefault(), w.stopPropagation();
6837
+ }, se = async (w) => {
6838
+ const { target: O } = w;
6839
+ O.scrollTop + O.offsetHeight >= O.scrollHeight - g && (C == null || C(!0)), p && await p(w);
6840
+ }, m1 = Z(
6841
+ (w) => {
6842
+ var O, K;
6843
+ return ((O = l.find((k1) => k1.value === w)) == null ? void 0 : O.label) || ((K = R == null ? void 0 : R.find(
6844
+ (k1) => k1.value === w
6845
+ )) == null ? void 0 : K.label) || w;
6846
6846
  },
6847
6847
  [R, l]
6848
- ), ne = j(
6849
- (f) => {
6848
+ ), ne = Z(
6849
+ (w) => {
6850
6850
  var O;
6851
6851
  return /* @__PURE__ */ r(
6852
6852
  _i,
6853
6853
  {
6854
- values: f,
6855
- onTagClose: G,
6856
- maxWidth: ((O = Z.current) == null ? void 0 : O.clientWidth) || 0,
6854
+ values: w,
6855
+ onTagClose: P,
6856
+ maxWidth: ((O = j.current) == null ? void 0 : O.clientWidth) || 0,
6857
6857
  disabled: o || V,
6858
6858
  options: l,
6859
6859
  extraOptions: R
6860
6860
  }
6861
6861
  );
6862
6862
  },
6863
- [o, R, G, l, V]
6864
- ), re = j(
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]
6863
+ [o, R, P, l, V]
6864
+ ), re = Z(
6865
+ ({ label: w, value: O, mode: K }) => K === "filter" ? e1(O) : /* @__PURE__ */ r("div", { onMouseDown: ie, className: "tag-wrapper", children: /* @__PURE__ */ r(z1, { onClose: () => P(O), closable: !o, children: /* @__PURE__ */ r(J1, { variant: "body4", children: typeof w == "object" ? w : m1(O) }) }) }),
6866
+ [o, m1, P, e1]
6867
6867
  );
6868
6868
  return /* @__PURE__ */ u(
6869
6869
  "div",
6870
6870
  {
6871
- className: `snmt-select ${M ? "snmt-select-focused" : ""}
6871
+ className: `snmt-select ${f ? "snmt-select-focused" : ""}
6872
6872
  ${s ? "" : "snmt-select-single"} ${V ? "snmt-select-read-only" : ""}`,
6873
- ref: Z,
6873
+ ref: j,
6874
6874
  style: { width: c },
6875
6875
  children: [
6876
6876
  /* @__PURE__ */ r(
@@ -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: V ? "dropdown-read-only" : "",
6881
- id: x,
6882
- ref: w,
6881
+ id: v,
6882
+ ref: m,
6883
6883
  showSearch: !!n,
6884
- filterOption: n && $,
6885
- onDropdownVisibleChange: H,
6884
+ filterOption: n && T,
6885
+ onDropdownVisibleChange: _,
6886
6886
  placeholder: t ? d ? `${t}*` : t : void 0,
6887
6887
  disabled: o,
6888
6888
  value: b || void 0,
6889
- labelRender: (f) => m1(f.value),
6889
+ labelRender: (w) => m1(w.value),
6890
6890
  mode: s === "filter" ? "multiple" : s,
6891
- onChange: E,
6891
+ onChange: H,
6892
6892
  onFocus: Y,
6893
6893
  onBlur: U,
6894
- onSearch: (f) => {
6895
- S(!f), a && a(f);
6894
+ onSearch: (w) => {
6895
+ S(!w), a && a(w);
6896
6896
  },
6897
6897
  onSelect: () => S(!0),
6898
6898
  onDeselect: () => S(!0),
6899
- tagRender: (f) => re({ ...f, mode: s }),
6899
+ tagRender: (w) => re({ ...w, mode: s }),
6900
6900
  maxTagCount: "responsive",
6901
6901
  maxTagPlaceholder: ne,
6902
6902
  onPopupScroll: se,
6903
6903
  prefix: V && !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 && b && !!b.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(h1, { name: "cancel" }) }),
6906
6906
  /* @__PURE__ */ r(
6907
- l1,
6907
+ h1,
6908
6908
  {
6909
6909
  name: "selectArrowIcon",
6910
6910
  color: o ? q.GREY_DARK_1 : q.GREY_DARK_5,
6911
- className: m ? "select-arrow-rotated" : "select-arrow",
6912
- onClick: () => N(!m)
6911
+ className: M ? "select-arrow-rotated" : "select-arrow",
6912
+ onClick: () => x(!M)
6913
6913
  }
6914
6914
  )
6915
6915
  ] }) }),
6916
- removeIcon: /* @__PURE__ */ r(l1, { name: "errorSmall", color: q.GREY_DARK_2 }),
6916
+ removeIcon: /* @__PURE__ */ r(h1, { name: "errorSmall", color: q.GREY_DARK_2 }),
6917
6917
  options: l,
6918
- optionRender: (f) => _ ? _(f.data) : /* @__PURE__ */ u(c1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
6919
- /* @__PURE__ */ u(c1, { alignItems: "center", gap: 12, children: [
6918
+ optionRender: (w) => E ? E(w.data) : /* @__PURE__ */ u(d1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
6919
+ /* @__PURE__ */ u(d1, { alignItems: "center", gap: 12, children: [
6920
6920
  s && /* @__PURE__ */ r(
6921
6921
  fe,
6922
6922
  {
6923
- checked: !!(b != null && b.includes(f.value))
6923
+ checked: !!(b != null && b.includes(w.value))
6924
6924
  }
6925
6925
  ),
6926
- /* @__PURE__ */ u(c1, { alignItems: "center", gap: 8, children: [
6927
- f.data.image && /* @__PURE__ */ r(pe, { src: f.data.image, size: 20 }),
6928
- /* @__PURE__ */ r("span", { children: f.label })
6926
+ /* @__PURE__ */ u(d1, { 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 })
6929
6929
  ] })
6930
6930
  ] }),
6931
- !s && b === f.value && /* @__PURE__ */ r(
6932
- l1,
6931
+ !s && b === w.value && /* @__PURE__ */ r(
6932
+ h1,
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
- ) : (f) => v ? v(f) : f
6951
+ ) : (w) => N ? N(w) : w
6952
6952
  }
6953
6953
  ),
6954
6954
  /* @__PURE__ */ r(
6955
6955
  "fieldset",
6956
6956
  {
6957
- className: `${M ? "fieldset-focused" : ""}
6957
+ className: `${f ? "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" : ""}`,
@@ -6967,8 +6967,8 @@ const z1 = ({ children: i, width: e, size: t = "small", onClose: s, closable: n
6967
6967
  }
6968
6968
  );
6969
6969
  function Ii(i, e = 500) {
6970
- const t = f1();
6971
- return T(() => () => {
6970
+ const t = l1();
6971
+ return G(() => () => {
6972
6972
  t.current && clearTimeout(t.current);
6973
6973
  }, []), (...s) => {
6974
6974
  const n = setTimeout(() => {
@@ -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,72 +6996,72 @@ const a1 = {
6996
6996
  onDropdownVisibleChange: h,
6997
6997
  optionRender: C,
6998
6998
  dropdownRender: p,
6999
- readOnly: x
6999
+ readOnly: v
7000
7000
  }, R) => {
7001
- const [v, _] = B([]), [y, V] = B(a1), [w, m] = B(!1), [N, M] = B(null), I = j(
7002
- async (H = !1, $) => {
7003
- if (!w) {
7004
- m(!0);
7001
+ const [N, E] = A([]), [y, V] = A(t1), [m, M] = A(!1), [x, f] = A(null), I = Z(
7002
+ async (_ = !1, T) => {
7003
+ if (!m) {
7004
+ M(!0);
7005
7005
  try {
7006
- const Y = H ? { ...a1, search: $ } : y, U = await i(Y);
7007
- _(
7008
- (E) => H ? U.options : [...E, ...U.options]
7009
- ), M(U.count), V((E) => ({
7010
- ...E,
7011
- offset: E.offset + E.limit
7006
+ const Y = _ ? { ...t1, search: T } : y, U = await i(Y);
7007
+ E(
7008
+ (H) => _ ? U.options : [...H, ...U.options]
7009
+ ), f(U.count), V((H) => ({
7010
+ ...H,
7011
+ offset: H.offset + H.limit
7012
7012
  }));
7013
7013
  } finally {
7014
- m(!1);
7014
+ M(!1);
7015
7015
  }
7016
7016
  }
7017
7017
  },
7018
- [y, i, w]
7019
- ), A = Ii(I), S = j(
7020
- (H) => {
7021
- H === "" || H === void 0 || H === null ? (V(a1), A(!0)) : A(!0, H);
7018
+ [y, i, m]
7019
+ ), B = Ii(I), S = Z(
7020
+ (_) => {
7021
+ _ === "" || _ === void 0 || _ === null ? (V(t1), B(!0)) : B(!0, _);
7022
7022
  },
7023
- [A]
7024
- ), b = async (H) => {
7025
- H && N !== null && N > v.length && await I(!1);
7026
- }, P = j(
7027
- (H) => {
7028
- H && !g && I(!1), h && h(H);
7023
+ [B]
7024
+ ), b = async (_) => {
7025
+ _ && x !== null && x > N.length && await I(!1);
7026
+ }, D = Z(
7027
+ (_) => {
7028
+ _ && !g && (E([]), V(t1), I(!0)), h == null || h(_);
7029
7029
  },
7030
7030
  // eslint-disable-next-line
7031
7031
  [g]
7032
7032
  );
7033
- T(() => {
7033
+ G(() => {
7034
7034
  g && I(!1);
7035
7035
  }, []);
7036
- const Z = {
7036
+ const j = {
7037
7037
  id: n,
7038
7038
  width: e,
7039
- options: v,
7039
+ options: N,
7040
7040
  onChange: t,
7041
7041
  ref: R,
7042
7042
  placeholder: o,
7043
7043
  search: !0,
7044
7044
  value: s,
7045
7045
  onSearchChange: S,
7046
- onDropdownVisibleChange: P,
7046
+ onDropdownVisibleChange: D,
7047
7047
  scrollThresholdValue: c,
7048
7048
  onScrollToEnd: b,
7049
7049
  loadOnClosedState: g,
7050
7050
  disabled: l,
7051
7051
  extraOptions: a,
7052
- isLoading: w,
7052
+ isLoading: m,
7053
7053
  optionRender: C,
7054
7054
  dropdownRender: p,
7055
- readOnly: x
7055
+ readOnly: v
7056
7056
  };
7057
7057
  return ae(R, () => ({
7058
7058
  refetchOptions: async () => {
7059
- V(a1), await I(!0);
7059
+ V(t1), await I(!0);
7060
7060
  }
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 }) });
7061
+ })), d ? /* @__PURE__ */ r(b1, { ...j, onChange: t, value: s, mode: d }) : /* @__PURE__ */ r("div", { className: "snmt-async-select", children: /* @__PURE__ */ r(b1, { ...j, onChange: t, value: s }) });
7062
7062
  }
7063
7063
  );
7064
- var d1 = /* @__PURE__ */ ((i) => (i.ACTIVE = "Active", i.ARCHIVED = "Archived", i))(d1 || {});
7064
+ var g1 = /* @__PURE__ */ ((i) => (i.ACTIVE = "Active", i.ARCHIVED = "Archived", i))(g1 || {});
7065
7065
  const Oi = ({ size: i = 30, color: e = "#004ed7" }) => {
7066
7066
  const t = `no-repeat linear-gradient(${e}
7067
7067
  calc(50% - 10px), #0000 0 calc(50% + 10px), ${e} 0)`, s = {
@@ -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));
@@ -7178,22 +7178,22 @@ class Ui {
7178
7178
  }
7179
7179
  }
7180
7180
  const zi = (i, e) => {
7181
- const t = f1();
7182
- return T(() => {
7181
+ const t = l1();
7182
+ return G(() => {
7183
7183
  t.current = i;
7184
7184
  }, [i, e]), t.current;
7185
- }, X1 = (i, e, t, s) => i.getFixedT(e, t, s), Ji = (i, e, t, s) => j(X1(i, e, t, s), [i, e, t, s]), Qi = function(i) {
7185
+ }, X1 = (i, e, t, s) => i.getFixedT(e, t, s), Ji = (i, e, t, s) => Z(X1(i, e, t, s), [i, e, t, s]), Qi = function(i) {
7186
7186
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
7187
7187
  const {
7188
7188
  i18n: t
7189
7189
  } = e, {
7190
7190
  i18n: s,
7191
7191
  defaultNS: n
7192
- } = o1(Yi) || {}, l = t || s || $i();
7192
+ } = a1(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 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;
7195
+ const m = (x, f) => z(f) ? f : Wi(f) && z(f.defaultValue) ? f.defaultValue : Array.isArray(x) ? x[x.length - 1] : x, M = [m, {}, !1];
7196
+ return M.t = m, 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((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 _ = zi(v), y = f1(!0);
7213
- T(() => {
7209
+ const a = (l.isInitialized || l.initializedStoreOnce) && g.every((m) => Bi(m, 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, R] = A(C);
7210
+ let N = g.join();
7211
+ e.lng && (N = `${e.lng}${N}`);
7212
+ const E = zi(N), y = l1(!0);
7213
+ G(() => {
7214
7214
  const {
7215
- bindI18n: w,
7216
- bindI18nStore: m
7215
+ bindI18n: m,
7216
+ bindI18nStore: M
7217
7217
  } = c;
7218
7218
  y.current = !0, !a && !o && (e.lng ? _1(l, e.lng, g, () => {
7219
7219
  y.current && R(p);
7220
7220
  }) : H1(l, g, () => {
7221
7221
  y.current && R(p);
7222
- })), a && _ && _ !== v && y.current && R(p);
7223
- const N = () => {
7222
+ })), a && E && E !== N && y.current && R(p);
7223
+ const x = () => {
7224
7224
  y.current && R(p);
7225
7225
  };
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));
7226
+ return m && l && l.on(m, x), M && l && l.store.on(M, x), () => {
7227
+ y.current = !1, m && l && m.split(" ").forEach((f) => l.off(f, x)), M && l && M.split(" ").forEach((f) => l.store.off(f, x));
7228
7228
  };
7229
- }, [l, v]), T(() => {
7229
+ }, [l, N]), G(() => {
7230
7230
  y.current && a && R(C);
7231
7231
  }, [l, d, a]);
7232
- const V = [x, l, a];
7233
- if (V.t = x, V.i18n = l, V.ready = a, a || !a && !o) return V;
7234
- throw new Promise((w) => {
7235
- e.lng ? _1(l, e.lng, g, () => w()) : H1(l, g, () => w());
7232
+ const V = [v, l, a];
7233
+ if (V.t = v, V.i18n = l, V.ready = a, a || !a && !o) return V;
7234
+ throw new Promise((m) => {
7235
+ e.lng ? _1(l, e.lng, g, () => m()) : H1(l, g, () => m());
7236
7236
  });
7237
7237
  }, qi = {
7238
7238
  type: "logger",
@@ -7249,7 +7249,7 @@ const zi = (i, e) => {
7249
7249
  console && console[i] && console[i].apply(console, e);
7250
7250
  }
7251
7251
  };
7252
- class g1 {
7252
+ class u1 {
7253
7253
  constructor(e) {
7254
7254
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
7255
7255
  this.init(e, t);
@@ -7282,16 +7282,16 @@ class g1 {
7282
7282
  return n && !this.debug ? null : (typeof e[0] == "string" && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
7283
7283
  }
7284
7284
  create(e) {
7285
- return new g1(this.logger, {
7285
+ return new u1(this.logger, {
7286
7286
  prefix: `${this.prefix}:${e}:`,
7287
7287
  ...this.options
7288
7288
  });
7289
7289
  }
7290
7290
  clone(e) {
7291
- return e = e || this.options, e.prefix = e.prefix || this.prefix, new g1(this.logger, e);
7291
+ return e = e || this.options, e.prefix = e.prefix || this.prefix, new u1(this.logger, e);
7292
7292
  }
7293
7293
  }
7294
- var K = new g1();
7294
+ var $ = new u1();
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,31 +7352,31 @@ 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
- }, u1 = (i, e) => {
7370
+ }, C1 = (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) => {
7378
- const s = u1(i, t);
7379
- return s !== void 0 ? s : u1(e, t);
7378
+ const s = C1(i, t);
7379
+ return s !== void 0 ? s : C1(e, t);
7380
7380
  }, ee = (i, e, t) => {
7381
7381
  for (const s in e)
7382
7382
  s !== "__proto__" && s !== "constructor" && (s in i ? typeof i[s] == "string" || i[s] instanceof String || typeof e[s] == "string" || e[s] instanceof String ? t && (i[s] = e[s]) : ee(i[s], e[s], t) : i[s] = e[s]);
@@ -7434,7 +7434,7 @@ const o5 = [" ", ",", "?", "!", ";"], l5 = new r5(20), a5 = (i, e, t) => {
7434
7434
  n = c;
7435
7435
  }
7436
7436
  return n;
7437
- }, C1 = (i) => i && i.indexOf("_") > 0 ? i.replace("_", "-") : i;
7437
+ }, p1 = (i) => i && i.indexOf("_") > 0 ? i.replace("_", "-") : i;
7438
7438
  class B1 extends w1 {
7439
7439
  constructor(e) {
7440
7440
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
@@ -7455,7 +7455,7 @@ class B1 extends w1 {
7455
7455
  const l = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, c = n.ignoreJSONStructure !== void 0 ? n.ignoreJSONStructure : this.options.ignoreJSONStructure;
7456
7456
  let o;
7457
7457
  e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], s && (Array.isArray(s) ? o.push(...s) : typeof s == "string" && l ? o.push(...s.split(l)) : o.push(s)));
7458
- const d = u1(this.data, o);
7458
+ const d = C1(this.data, o);
7459
7459
  return !d && !t && !s && e.indexOf(".") > -1 && (e = o[0], t = o[1], s = o.slice(2).join(".")), d || !c || typeof s != "string" ? d : R1(this.data && this.data[e] && this.data[e][t], s, l);
7460
7460
  }
7461
7461
  addResource(e, t, s, n) {
@@ -7482,7 +7482,7 @@ class B1 extends w1 {
7482
7482
  skipCopy: !1
7483
7483
  }, o = [e, t];
7484
7484
  e.indexOf(".") > -1 && (o = e.split("."), n = s, s = t, t = o[1]), this.addNamespaces(t);
7485
- let d = u1(this.data, o) || {};
7485
+ let d = C1(this.data, o) || {};
7486
7486
  c.skipCopy || (s = JSON.parse(JSON.stringify(s))), n ? ee(d, s, l) : d = {
7487
7487
  ...d,
7488
7488
  ...s
@@ -7522,10 +7522,10 @@ var te = {
7522
7522
  }
7523
7523
  };
7524
7524
  const W1 = {};
7525
- class p1 extends w1 {
7525
+ class f1 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 = K.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 = $.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 w = t.nsSeparator || this.options.nsSeparator;
7574
+ const m = t.nsSeparator || this.options.nsSeparator;
7575
7575
  return n ? {
7576
- res: `${d}${w}${c}`,
7576
+ res: `${d}${m}${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}${w}${c}`;
7582
+ } : `${d}${m}${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, x = h && h.exactUsedKey || c, R = Object.prototype.toString.apply(C), v = ["[object Number]", "[object Function]", "[object RegExp]"], _ = 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 _ == "string" && Array.isArray(C))) {
7595
+ const p = h && h.usedKey || c, v = h && h.exactUsedKey || c, R = Object.prototype.toString.apply(C), N = ["[object Number]", "[object Function]", "[object RegExp]"], E = 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") && N.indexOf(R) < 0 && !(typeof E == "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 w = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, C, {
7599
+ const m = 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 = w, h.usedParams = this.getUsedParamsDetails(t), h) : w;
7603
+ return n ? (h.res = m, h.usedParams = this.getUsedParamsDetails(t), h) : m;
7604
7604
  }
7605
7605
  if (l) {
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, {
7606
+ const m = Array.isArray(C), M = m ? [] : {}, x = m ? v : p;
7607
+ for (const f in C)
7608
+ if (Object.prototype.hasOwnProperty.call(C, f)) {
7609
+ const I = `${x}${l}${f}`;
7610
+ M[f] = this.translate(I, {
7611
7611
  ...t,
7612
7612
  joinArrays: !1,
7613
7613
  ns: o
7614
- }), m[M] === I && (m[M] = C[M]);
7614
+ }), M[f] === I && (M[f] = C[f]);
7615
7615
  }
7616
- C = m;
7616
+ C = M;
7617
7617
  }
7618
- } else if (y && typeof _ == "string" && Array.isArray(C))
7619
- C = C.join(_), C && (C = this.extendTranslation(C, e, t, s));
7618
+ } else if (y && typeof E == "string" && Array.isArray(C))
7619
+ C = C.join(E), C && (C = this.extendTranslation(C, e, t, s));
7620
7620
  else {
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, {
7621
+ let m = !1, M = !1;
7622
+ const x = t.count !== void 0 && typeof t.count != "string", f = f1.hasDefaultValue(t), I = x ? this.pluralResolver.getSuffix(g, t.count, t) : "", B = t.ordinal && x ? this.pluralResolver.getSuffix(g, t.count, {
7623
7623
  ordinal: !1
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, H = M && b !== C && this.options.updateMissing;
7627
- if (m || w || H) {
7628
- if (this.logger.log(H ? "updateKey" : "missingKey", g, d, c, H ? b : C), l) {
7629
- const E = this.resolve(c, {
7624
+ }) : "", S = x && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), b = S && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${I}`] || t[`defaultValue${B}`] || t.defaultValue;
7625
+ !this.isValidLookup(C) && f && (m = !0, C = b), this.isValidLookup(C) || (M = !0, C = c);
7626
+ const j = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && M ? void 0 : C, _ = f && b !== C && this.options.updateMissing;
7627
+ if (M || m || _) {
7628
+ if (this.logger.log(_ ? "updateKey" : "missingKey", g, d, c, _ ? b : C), l) {
7629
+ const H = this.resolve(c, {
7630
7630
  ...t,
7631
7631
  keySeparator: !1
7632
7632
  });
7633
- E && E.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
+ H && H.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
- let $ = [];
7635
+ let T = [];
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 E = 0; E < Y.length; E++)
7639
- $.push(Y[E]);
7640
- else this.options.saveMissingTo === "all" ? $ = this.languageUtils.toResolveHierarchy(t.lng || this.language) : $.push(t.lng || this.language);
7641
- const U = (E, F, G) => {
7642
- const e1 = M && G !== C ? G : Z;
7643
- this.options.missingKeyHandler ? this.options.missingKeyHandler(E, d, F, e1, H, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(E, d, F, e1, H, t), this.emit("missingKey", E, d, F, C);
7638
+ for (let H = 0; H < Y.length; H++)
7639
+ T.push(Y[H]);
7640
+ else this.options.saveMissingTo === "all" ? T = this.languageUtils.toResolveHierarchy(t.lng || this.language) : T.push(t.lng || this.language);
7641
+ const U = (H, F, P) => {
7642
+ const e1 = f && P !== C ? P : j;
7643
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(H, d, F, e1, _, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(H, d, F, e1, _, t), this.emit("missingKey", H, d, F, C);
7644
7644
  };
7645
- this.options.saveMissing && (this.options.saveMissingPlurals && N ? $.forEach((E) => {
7646
- const F = this.pluralResolver.getSuffixes(E, 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([E], c + G, t[`defaultValue${G}`] || b);
7645
+ this.options.saveMissing && (this.options.saveMissingPlurals && x ? T.forEach((H) => {
7646
+ const F = this.pluralResolver.getSuffixes(H, t);
7647
+ S && t[`defaultValue${this.options.pluralSeparator}zero`] && F.indexOf(`${this.options.pluralSeparator}zero`) < 0 && F.push(`${this.options.pluralSeparator}zero`), F.forEach((P) => {
7648
+ U([H], c + P, t[`defaultValue${P}`] || b);
7649
7649
  });
7650
- }) : U($, c, b));
7650
+ }) : U(T, c, b));
7651
7651
  }
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));
7652
+ C = this.extendTranslation(C, e, t, h, s), M && C === c && this.options.appendNamespaceToMissingKey && (C = `${d}:${c}`), (M || m) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? C = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${d}:${c}` : c, m ? 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), x = 0; x < C; x++)
7689
- p[x] = arguments[x];
7688
+ for (var C = arguments.length, p = new Array(C), v = 0; v < C; v++)
7689
+ p[v] = arguments[v];
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(), 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((_) => {
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 !== "", R = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
7711
+ h.forEach((N) => {
7712
+ this.isValidLookup(s) || (o = N, !W1[`${R[0]}-${N}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o) && (W1[`${R[0]}-${N}`] = !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((E) => {
7713
7713
  if (this.isValidLookup(s)) return;
7714
- c = _;
7714
+ c = E;
7715
7715
  const y = [a];
7716
7716
  if (this.i18nFormat && this.i18nFormat.addLookupKeys)
7717
- this.i18nFormat.addLookupKeys(y, a, _, v, t);
7717
+ this.i18nFormat.addLookupKeys(y, a, E, N, t);
7718
7718
  else {
7719
- let w;
7720
- C && (w = this.pluralResolver.getSuffix(_, 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));
7719
+ let m;
7720
+ C && (m = this.pluralResolver.getSuffix(E, t.count, t));
7721
+ const M = `${this.options.pluralSeparator}zero`, x = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
7722
+ if (C && (y.push(a + m), t.ordinal && m.indexOf(x) === 0 && y.push(a + m.replace(x, this.options.pluralSeparator)), p && y.push(a + M)), v) {
7723
+ const f = `${a}${this.options.contextSeparator}${t.context}`;
7724
+ y.push(f), C && (y.push(f + m), t.ordinal && m.indexOf(x) === 0 && y.push(f + m.replace(x, this.options.pluralSeparator)), p && y.push(f + M));
7725
7725
  }
7726
7726
  }
7727
7727
  let V;
7728
7728
  for (; V = y.pop(); )
7729
- this.isValidLookup(s) || (l = V, s = this.getResource(_, v, V, t));
7729
+ this.isValidLookup(s) || (l = V, s = this.getResource(E, N, V, t));
7730
7730
  }));
7731
7731
  });
7732
7732
  }), {
@@ -7771,15 +7771,15 @@ 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 = K.create("languageUtils");
7774
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = $.create("languageUtils");
7775
7775
  }
7776
7776
  getScriptPartFromCode(e) {
7777
- if (e = C1(e), !e || e.indexOf("-") < 0) return null;
7777
+ if (e = p1(e), !e || e.indexOf("-") < 0) return null;
7778
7778
  const t = e.split("-");
7779
7779
  return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
7780
7780
  }
7781
7781
  getLanguagePartFromCode(e) {
7782
- if (e = C1(e), !e || e.indexOf("-") < 0) return e;
7782
+ if (e = p1(e), !e || e.indexOf("-") < 0) return e;
7783
7783
  const t = e.split("-");
7784
7784
  return this.formatLanguageCode(t[0]);
7785
7785
  }
@@ -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 = 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 = {};
7968
+ this.languageUtils = e, this.options = t, this.logger = $.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;
@@ -7977,7 +7977,7 @@ class C5 {
7977
7977
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
7978
7978
  if (this.shouldUseIntlApi())
7979
7979
  try {
7980
- const s = C1(e === "dev" ? "en" : e), n = t.ordinal ? "ordinal" : "cardinal", l = JSON.stringify({
7980
+ const s = p1(e === "dev" ? "en" : e), n = t.ordinal ? "ordinal" : "cardinal", l = JSON.stringify({
7981
7981
  cleanedCode: s,
7982
7982
  type: n
7983
7983
  });
@@ -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 = K.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
8032
+ this.logger = $.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: x,
8052
+ nestingSuffix: v,
8053
8053
  nestingSuffixEscaped: R,
8054
- nestingOptionsSeparator: v,
8055
- maxReplaces: _,
8054
+ nestingOptionsSeparator: N,
8055
+ maxReplaces: E,
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 = x ? J(x) : R || J(")"), this.nestingOptionsSeparator = v || ",", this.maxReplaces = _ || 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 = v ? J(v) : R || J(")"), this.nestingOptionsSeparator = N || ",", this.maxReplaces = E || 1e3, this.alwaysFormat = y !== void 0 ? y : !1, this.resetRegExp();
8059
8059
  }
8060
8060
  reset() {
8061
8061
  this.options && this.init(this.options);
@@ -8068,15 +8068,15 @@ 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 _ = D1(t, d, p, this.options.keySeparator, this.options.ignoreJSONStructure);
8072
- return this.alwaysFormat ? this.format(_, void 0, s, {
8071
+ const E = D1(t, d, p, this.options.keySeparator, this.options.ignoreJSONStructure);
8072
+ return this.alwaysFormat ? this.format(E, void 0, s, {
8073
8073
  ...n,
8074
8074
  ...t,
8075
8075
  interpolationkey: p
8076
- }) : _;
8076
+ }) : E;
8077
8077
  }
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, {
8078
+ const v = p.split(this.formatSeparator), R = v.shift().trim(), N = v.join(this.formatSeparator).trim();
8079
+ return this.format(D1(t, d, R, this.options.keySeparator, this.options.ignoreJSONStructure), N, s, {
8080
8080
  ...n,
8081
8081
  ...t,
8082
8082
  interpolationkey: R
@@ -8092,18 +8092,18 @@ 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 x = l[1].trim();
8096
- if (c = g(x), c === void 0)
8095
+ const v = l[1].trim();
8096
+ if (c = g(v), c === void 0)
8097
8097
  if (typeof a == "function") {
8098
- const v = a(e, l, n);
8099
- c = typeof v == "string" ? v : "";
8100
- } else if (n && Object.prototype.hasOwnProperty.call(n, x))
8098
+ const N = a(e, l, n);
8099
+ c = typeof N == "string" ? N : "";
8100
+ } else if (n && Object.prototype.hasOwnProperty.call(n, v))
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 ${x} for interpolating ${e}`), c = "";
8106
+ this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`), c = "";
8107
8107
  else typeof c != "string" && !this.useRawValueToEscape && (c = I1(c));
8108
8108
  const R = p.safeValue(c);
8109
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)
@@ -8119,8 +8119,8 @@ 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), x = C.match(/"/g);
8123
- (p && p.length % 2 === 0 && !x || x.length % 2 !== 0) && (C = C.replace(/'/g, '"'));
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, '"'));
8124
8124
  try {
8125
8125
  c = JSON.parse(C), g && (c = {
8126
8126
  ...g,
@@ -8178,13 +8178,13 @@ const f5 = (i) => {
8178
8178
  });
8179
8179
  const c = s + JSON.stringify(l);
8180
8180
  let o = e[c];
8181
- return o || (o = i(C1(s), n), e[c] = o), o(t);
8181
+ return o || (o = i(p1(s), n), e[c] = o), o(t);
8182
8182
  };
8183
8183
  };
8184
8184
  class w5 {
8185
8185
  constructor() {
8186
8186
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
8187
- this.logger = K.create("formatter"), this.options = e, this.formats = {
8187
+ this.logger = $.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 = 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);
8270
+ super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = $.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 = {};
@@ -8455,16 +8455,16 @@ const T1 = () => ({
8455
8455
  maxReplaces: 1e3,
8456
8456
  skipOnVariables: !0
8457
8457
  }
8458
- }), G1 = (i) => (typeof i.ns == "string" && (i.ns = [i.ns]), typeof i.fallbackLng == "string" && (i.fallbackLng = [i.fallbackLng]), typeof i.fallbackNS == "string" && (i.fallbackNS = [i.fallbackNS]), i.supportedLngs && i.supportedLngs.indexOf("cimode") < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), i), h1 = () => {
8458
+ }), G1 = (i) => (typeof i.ns == "string" && (i.ns = [i.ns]), typeof i.fallbackLng == "string" && (i.fallbackLng = [i.fallbackLng]), typeof i.fallbackNS == "string" && (i.fallbackNS = [i.fallbackNS]), i.supportedLngs && i.supportedLngs.indexOf("cimode") < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), i), c1 = () => {
8459
8459
  }, L5 = (i) => {
8460
8460
  Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
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 = K, this.modules = {
8467
+ if (super(), this.options = G1(e), this.services = {}, this.logger = $, this.modules = {
8468
8468
  external: []
8469
8469
  }, L5(this), t && !this.isInitialized && !e.isClone) {
8470
8470
  if (!this.options.initImmediate)
@@ -8489,31 +8489,31 @@ 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 ? K.init(l(this.modules.logger), this.options) : K.init(null, this.options);
8492
+ this.modules.logger ? $.init(l(this.modules.logger), this.options) : $.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 = K, C.resourceStore = this.store, C.languageUtils = h, C.pluralResolver = new C5(h, {
8498
+ C.logger = $, 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 x = arguments.length, R = new Array(x > 1 ? x - 1 : 0), v = 1; v < x; v++)
8506
- R[v - 1] = arguments[v];
8505
+ for (var v = arguments.length, R = new Array(v > 1 ? v - 1 : 0), N = 1; N < v; N++)
8506
+ R[N - 1] = arguments[N];
8507
8507
  e.emit(p, ...R);
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 x = arguments.length, R = new Array(x > 1 ? x - 1 : 0), v = 1; v < x; v++)
8510
- R[v - 1] = arguments[v];
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 f1(this.services, this.options), this.translator.on("*", function(p) {
8509
+ for (var v = arguments.length, R = new Array(v > 1 ? v - 1 : 0), N = 1; N < v; N++)
8510
+ R[N - 1] = arguments[N];
8511
8511
  e.emit(p, ...R);
8512
8512
  }), this.modules.external.forEach((p) => {
8513
8513
  p.init && p.init(this);
8514
8514
  });
8515
8515
  }
8516
- if (this.format = this.options.interpolation.format, s || (s = h1), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
8516
+ if (this.format = this.options.interpolation.format, s || (s = c1), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
8517
8517
  const a = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
8518
8518
  a.length > 0 && a[0] !== "dev" && (this.options.lng = a[0]);
8519
8519
  }
@@ -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
  };
@@ -8536,7 +8536,7 @@ class s1 extends w1 {
8536
8536
  return this.options.resources || !this.options.initImmediate ? g() : setTimeout(g, 0), d;
8537
8537
  }
8538
8538
  loadResources(e) {
8539
- let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : h1;
8539
+ let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : c1;
8540
8540
  const n = typeof e == "string" ? e : this.language;
8541
8541
  if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
8542
8542
  if (n && n.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
@@ -8553,8 +8553,8 @@ class s1 extends w1 {
8553
8553
  s(null);
8554
8554
  }
8555
8555
  reloadResources(e, t, s) {
8556
- const n = t1();
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) => {
8556
+ const n = i1();
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 = c1), this.services.backendConnector.reload(e, t, (l) => {
8558
8558
  n.resolve(), s(l);
8559
8559
  }), n;
8560
8560
  }
@@ -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((x) => `${d.keyPrefix}${C}${x}`) : p = d.keyPrefix ? `${d.keyPrefix}${C}${c}` : c, n.t(p, d);
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);
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,24 +8664,24 @@ 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
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : h1;
8670
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : c1;
8671
8671
  const s = e.forkResourceStore;
8672
8672
  s && delete e.forkResourceStore;
8673
8673
  const n = {
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 = {
8681
8681
  ...this.services
8682
8682
  }, l.services.utils = {
8683
8683
  hasLoadedNamespace: l.hasLoadedNamespace.bind(l)
8684
- }, s && (l.store = new B1(this.store.data, n), l.services.resourceStore = l.store), l.translator = new p1(l.services, n), l.translator.on("*", function(o) {
8684
+ }, s && (l.store = new B1(this.store.data, n), l.services.resourceStore = l.store), l.translator = new f1(l.services, n), l.translator.on("*", function(o) {
8685
8685
  for (var d = arguments.length, g = new Array(d > 1 ? d - 1 : 0), a = 1; a < d; a++)
8686
8686
  g[a - 1] = arguments[a];
8687
8687
  l.emit(o, ...g);
@@ -8699,8 +8699,8 @@ class s1 extends w1 {
8699
8699
  };
8700
8700
  }
8701
8701
  }
8702
- const W = s1.createInstance();
8703
- W.createInstance = s1.createInstance;
8702
+ const W = n1.createInstance();
8703
+ W.createInstance = n1.createInstance;
8704
8704
  W.createInstance;
8705
8705
  W.dir;
8706
8706
  W.init;
@@ -8734,7 +8734,7 @@ W.use(Fi).init({
8734
8734
  }
8735
8735
  }
8736
8736
  });
8737
- const O5 = r1(
8737
+ const O5 = o1(
8738
8738
  ({
8739
8739
  fetchParams: i,
8740
8740
  mode: e = void 0,
@@ -8745,116 +8745,114 @@ const O5 = r1(
8745
8745
  onError: c,
8746
8746
  allowEmpty: o = !1
8747
8747
  }, d) => {
8748
- const { axiosPeople: g, locale: a } = o1(Ce), { t: h } = Qi("common", { lng: a }), [C, p] = B([]), [x, R] = B(!0);
8748
+ const { axiosPeople: g, locale: a } = a1(Ce), { t: h } = Qi("common", { lng: a }), [C, p] = A([]), [v, R] = A(!0), N = l1(C);
8749
8749
  if (!g)
8750
8750
  throw new Error(
8751
8751
  `UserSelect requires "axiosPeople" to fetch users.
8752
8752
  Please provide it via SNMTUiContext.`
8753
8753
  );
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}`;
8754
+ const E = Z(
8755
+ (x) => {
8756
+ let f = "";
8757
+ return x.deletedAt && (f += `[${h("deleted")}] `), x.status === g1.ARCHIVED && (f += `[${h("archived")}] `), `${f}${x.firstName} ${x.lastName}`;
8758
8758
  },
8759
8759
  [h]
8760
- ), _ = j(
8760
+ ), y = Z(
8761
8761
  async ({
8762
- offset: m,
8763
- limit: N,
8764
- search: M
8762
+ offset: x,
8763
+ limit: f,
8764
+ search: I
8765
8765
  }) => {
8766
- var I, A, S;
8766
+ var B, S, b;
8767
8767
  try {
8768
- const b = await g.post("v1/users/search", {
8769
- offset: m,
8770
- limit: N,
8771
- search: M,
8768
+ const D = await g.post("v1/users/search", {
8769
+ offset: x,
8770
+ limit: f,
8771
+ search: I,
8772
8772
  ...i,
8773
8773
  includeCount: !0
8774
- }), { data: P, metadata: Z } = b.data;
8774
+ }), { data: j, metadata: _ } = D.data;
8775
8775
  return {
8776
- options: P.map((H) => ({
8777
- value: H.id,
8778
- label: v(H)
8776
+ options: j.map((T) => ({
8777
+ value: T.id,
8778
+ label: E(T)
8779
8779
  })),
8780
- count: Z.count
8780
+ count: _.count
8781
8781
  };
8782
- } catch (b) {
8782
+ } catch (D) {
8783
8783
  return c && c({
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"
8784
+ status: ((B = D.response) == null ? void 0 : B.status) ?? 500,
8785
+ message: ((b = (S = D.response) == null ? void 0 : S.data) == null ? void 0 : b.message) ?? "Error while fetching options"
8786
8786
  }), {
8787
8787
  options: [],
8788
8788
  count: 0
8789
8789
  };
8790
8790
  }
8791
8791
  },
8792
- [g, i, c, v]
8793
- ), y = j(
8794
- async (m) => {
8795
- var N, M, I;
8792
+ [g, i, c, E]
8793
+ ), V = Z(
8794
+ async (x) => {
8795
+ var f, I, B;
8796
8796
  try {
8797
- return await Promise.all(
8798
- m.map(async (S) => {
8799
- const b = C.find((H) => H.value === S);
8800
- if (b)
8801
- return b;
8802
- const Z = (await g.post("v1/users/search", {
8803
- filters: {
8804
- id: [S],
8805
- status: [d1.ACTIVE, d1.ARCHIVED]
8806
- }
8807
- })).data.data[0];
8808
- return {
8809
- value: S,
8810
- label: v(Z)
8811
- };
8812
- })
8797
+ const S = x.filter(
8798
+ (j) => !N.current.some((_) => _.value === j)
8813
8799
  );
8814
- } catch (A) {
8800
+ let b = [];
8801
+ S.length && (b = (await g.post("v1/users/search", {
8802
+ filters: {
8803
+ id: S,
8804
+ status: [g1.ACTIVE, g1.ARCHIVED]
8805
+ }
8806
+ })).data.data);
8807
+ const D = b.map((j) => ({
8808
+ value: j.id,
8809
+ label: E(j)
8810
+ }));
8811
+ return [...N.current, ...D];
8812
+ } catch (S) {
8815
8813
  return c && c({
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"
8814
+ status: ((f = S.response) == null ? void 0 : f.status) ?? 500,
8815
+ message: ((B = (I = S.response) == null ? void 0 : I.data) == null ? void 0 : B.message) ?? "Error while fetching selected items"
8818
8816
  }), [];
8819
8817
  }
8820
8818
  },
8821
- // Use eslint disable to exclude selectedOptions to prevent infinity rerender
8822
- // eslint-disable-next-line react-hooks/exhaustive-deps
8823
- [g, v, c]
8819
+ [g, E, c]
8824
8820
  );
8825
- T(() => {
8821
+ G(() => {
8822
+ N.current = C;
8823
+ }, [C]), G(() => {
8826
8824
  if (!n) {
8827
8825
  R(!1);
8828
8826
  return;
8829
8827
  }
8830
8828
  (async () => {
8831
- const N = Array.isArray(n) ? n : [n], M = await y(N);
8832
- p(M), R(!1);
8829
+ const f = Array.isArray(n) ? n : [n], I = await V(f);
8830
+ p(I), R(!1);
8833
8831
  })();
8834
- }, [y, n]);
8835
- const V = j(
8832
+ }, [V, n]);
8833
+ const m = Z(
8836
8834
  async ({
8837
- limit: m,
8838
- offset: N,
8839
- search: M
8835
+ limit: x,
8836
+ offset: f,
8837
+ search: I
8840
8838
  }) => {
8841
- const { count: I, ...A } = await _({
8842
- offset: N,
8843
- limit: m,
8844
- search: M
8839
+ const { count: B, ...S } = await y({
8840
+ offset: f,
8841
+ limit: x,
8842
+ search: I
8845
8843
  });
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
8844
+ let b = S.options;
8845
+ return o && f === 0 && (b = [{ value: null, label: "None" }, ...b]), {
8846
+ options: b,
8847
+ count: B,
8848
+ limit: x
8851
8849
  };
8852
8850
  },
8853
- [o, _]
8851
+ [o, y]
8854
8852
  );
8855
- if (x)
8853
+ if (v)
8856
8854
  return /* @__PURE__ */ r(Oi, {});
8857
- const w = {
8855
+ const M = {
8858
8856
  ref: d,
8859
8857
  placeholder: t,
8860
8858
  disabled: s
@@ -8862,22 +8860,22 @@ const O5 = r1(
8862
8860
  return e ? /* @__PURE__ */ r(
8863
8861
  E1,
8864
8862
  {
8865
- ...w,
8863
+ ...M,
8866
8864
  mode: e,
8867
8865
  value: n,
8868
8866
  onChange: l,
8869
- loadOptions: V,
8867
+ loadOptions: m,
8870
8868
  loadOnClosedState: !0,
8871
8869
  extraOptions: C
8872
8870
  }
8873
8871
  ) : /* @__PURE__ */ r(
8874
8872
  E1,
8875
8873
  {
8876
- ...w,
8874
+ ...M,
8877
8875
  value: n,
8878
8876
  mode: void 0,
8879
8877
  onChange: l,
8880
- loadOptions: V,
8878
+ loadOptions: m,
8881
8879
  loadOnClosedState: !0,
8882
8880
  extraOptions: C
8883
8881
  }