@snmt-react-ui/city-select 2.2.1 → 2.3.0

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.
@@ -1,8 +1,8 @@
1
1
  export interface CitySelectProps {
2
2
  /** Sets value for the city select */
3
- value?: string;
3
+ value?: string | null;
4
4
  /** Callback to handle change event */
5
- onChange: (value: string) => void;
5
+ onChange: (value: string | null) => void;
6
6
  /** Sets country value if city select is used first */
7
7
  selectedCountry?: string;
8
8
  /** Custom width of a date picker */
@@ -2,10 +2,10 @@ var ae = Object.defineProperty;
2
2
  var he = (i, e, t) => e in i ? ae(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
3
  var y1 = (i, e, t) => he(i, typeof e != "symbol" ? e + "" : e, t);
4
4
  import "./index.css";
5
- import { jsx as n, Fragment as X, jsxs as u } from "react/jsx-runtime";
5
+ import { jsx as n, Fragment as e1, jsxs as u } from "react/jsx-runtime";
6
6
  import { SNMTUiContext as ce } from "@snmt-react-ui/core";
7
7
  import { Select as de, Flex as ge, Avatar as ue, Checkbox as Ce, Typography as F1, Tag as $1, Popover as pe } from "antd";
8
- import { createContext as s1, forwardRef as f1, useState as B, useRef as n1, useEffect as Z, useCallback as G, useContext as r1 } from "react";
8
+ import { createContext as n1, forwardRef as f1, useState as O, useRef as r1, useEffect as W, useCallback as G, useContext as l1 } from "react";
9
9
  const d1 = ({
10
10
  children: i,
11
11
  direction: e = "row",
@@ -42,8 +42,8 @@ const d1 = ({
42
42
  }
43
43
  );
44
44
  };
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 Y1 = s1({
45
+ var X = /* @__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))(X || {});
46
+ const Y1 = n1({
47
47
  locale: "en",
48
48
  theme: "light"
49
49
  });
@@ -56,11 +56,11 @@ const we = ({
56
56
  disabled: s = !1,
57
57
  disableUncheck: l = !1
58
58
  }) => {
59
- const [c, r] = B(i), [d, g] = B(e);
60
- Z(() => {
59
+ const [c, r] = O(i), [d, g] = O(e);
60
+ W(() => {
61
61
  r(i), g(e);
62
62
  }, [i, e]);
63
- const { theme: a } = r1(Y1);
63
+ const { theme: a } = l1(Y1);
64
64
  return /* @__PURE__ */ n(
65
65
  Ce,
66
66
  {
@@ -76,7 +76,7 @@ const we = ({
76
76
  );
77
77
  };
78
78
  var m = /* @__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))(m || {});
79
- const U1 = s1({
79
+ const U1 = n1({
80
80
  locale: "en",
81
81
  theme: "light"
82
82
  });
@@ -3077,14 +3077,14 @@ const me = ({
3077
3077
  disabled: l = !1,
3078
3078
  onClick: c
3079
3079
  }) => {
3080
- const [r, d] = B(s), { theme: g } = r1(U1), a = l ? g && g === "dark" ? m.GREY_LIGHT_4 : m.GREY_DARK_1 : o, h = l ? void 0 : c;
3081
- return Z(() => {
3080
+ const [r, d] = O(s), { theme: g } = l1(U1), a = l ? g && g === "dark" ? m.GREY_LIGHT_4 : m.GREY_DARK_1 : o, h = l ? void 0 : c;
3081
+ return W(() => {
3082
3082
  if (s) {
3083
3083
  h && !l && d(`${s} clickable`);
3084
3084
  return;
3085
3085
  }
3086
3086
  h && !l && d("clickable");
3087
- }, [h, s, l]), /* @__PURE__ */ n(X, { children: (() => {
3087
+ }, [h, s, l]), /* @__PURE__ */ n(e1, { children: (() => {
3088
3088
  switch (i) {
3089
3089
  case "nextIcon":
3090
3090
  return ct({ width: e, height: t, color: a, className: r, onClick: h });
@@ -3325,7 +3325,7 @@ const me = ({
3325
3325
  case "refresh":
3326
3326
  return $t({ width: e, height: t, color: a, className: r, onClick: h });
3327
3327
  default:
3328
- return /* @__PURE__ */ n(X, { children: "No Icon provided" });
3328
+ return /* @__PURE__ */ n(e1, { children: "No Icon provided" });
3329
3329
  }
3330
3330
  })() });
3331
3331
  }, { Title: Yt, Text: Ut } = F1, zt = {
@@ -3368,7 +3368,7 @@ const me = ({
3368
3368
  }
3369
3369
  );
3370
3370
  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 || {});
3371
- const z1 = s1({
3371
+ const z1 = n1({
3372
3372
  locale: "en",
3373
3373
  theme: "light"
3374
3374
  });
@@ -6369,14 +6369,14 @@ const Qt = ({
6369
6369
  disabled: l = !1,
6370
6370
  onClick: c
6371
6371
  }) => {
6372
- const [r, d] = B(s), { theme: g } = r1(z1), a = l ? g && g === "dark" ? k.GREY_LIGHT_4 : k.GREY_DARK_1 : o, h = l ? void 0 : c;
6373
- return Z(() => {
6372
+ const [r, d] = O(s), { theme: g } = l1(z1), a = l ? g && g === "dark" ? k.GREY_LIGHT_4 : k.GREY_DARK_1 : o, h = l ? void 0 : c;
6373
+ return W(() => {
6374
6374
  if (s) {
6375
6375
  h && !l && d(`${s} clickable`);
6376
6376
  return;
6377
6377
  }
6378
6378
  h && !l && d("clickable");
6379
- }, [h, s, l]), /* @__PURE__ */ n(X, { children: (() => {
6379
+ }, [h, s, l]), /* @__PURE__ */ n(e1, { children: (() => {
6380
6380
  switch (i) {
6381
6381
  case "nextIcon":
6382
6382
  return K2({ width: e, height: t, color: a, className: r, onClick: h });
@@ -6617,12 +6617,12 @@ const Qt = ({
6617
6617
  case "refresh":
6618
6618
  return Mi({ width: e, height: t, color: a, className: r, onClick: h });
6619
6619
  default:
6620
- return /* @__PURE__ */ n(X, { children: "No Icon provided" });
6620
+ return /* @__PURE__ */ n(e1, { children: "No Icon provided" });
6621
6621
  }
6622
6622
  })() });
6623
6623
  };
6624
6624
  var J1 = /* @__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))(J1 || {});
6625
- const bi = s1({
6625
+ const bi = n1({
6626
6626
  locale: "en",
6627
6627
  theme: "light"
6628
6628
  });
@@ -6695,7 +6695,7 @@ const Q1 = ({ children: i, width: e, size: t = "small", onClose: o, closable: s
6695
6695
  placement: s = "topRight",
6696
6696
  noPadding: l = !1
6697
6697
  }) => {
6698
- const [c, r] = B(!1);
6698
+ const [c, r] = O(!1);
6699
6699
  return /* @__PURE__ */ n(
6700
6700
  pe,
6701
6701
  {
@@ -6719,8 +6719,8 @@ const Q1 = ({ children: i, width: e, size: t = "small", onClose: o, closable: s
6719
6719
  options: s,
6720
6720
  extraOptions: l
6721
6721
  }) => {
6722
- const [c, r] = B(!1);
6723
- Z(() => {
6722
+ const [c, r] = O(!1);
6723
+ W(() => {
6724
6724
  i.length || r(!1);
6725
6725
  }, [i]);
6726
6726
  const d = (a) => {
@@ -6750,7 +6750,7 @@ const Q1 = ({ children: i, width: e, size: t = "small", onClose: o, closable: s
6750
6750
  placement: "bottomRight",
6751
6751
  isOpen: c,
6752
6752
  setIsOpen: r,
6753
- children: /* @__PURE__ */ n($1, { className: `overflow-button ${c ? "open" : ""}`, bordered: !1, children: /* @__PURE__ */ u(q1, { variant: "body4", color: c ? q.BLUE_PRIMARY : void 0, children: [
6753
+ children: /* @__PURE__ */ n($1, { className: `overflow-button ${c ? "open" : ""}`, bordered: !1, children: /* @__PURE__ */ u(q1, { variant: "body4", color: c ? X.BLUE_PRIMARY : void 0, children: [
6754
6754
  i.length,
6755
6755
  " more"
6756
6756
  ] }) })
@@ -6781,146 +6781,146 @@ const Q1 = ({ children: i, width: e, size: t = "small", onClose: o, closable: s
6781
6781
  onScrollToEnd: C,
6782
6782
  onPopupScroll: p,
6783
6783
  id: w,
6784
- extraOptions: v,
6785
- dropdownRender: N,
6786
- optionRender: b,
6787
- isLoading: R,
6788
- readOnly: _
6784
+ extraOptions: N,
6785
+ dropdownRender: v,
6786
+ optionRender: E,
6787
+ isLoading: M,
6788
+ readOnly: H
6789
6789
  }, L) => {
6790
- const [M, y] = B(!1), [x, S] = B(!1), [I, O] = B(!0), [H, U] = B(i), F = n1(null);
6791
- Z(() => {
6792
- U(i);
6790
+ const [R, b] = O(!1), [x, Z] = O(!1), [J, U] = O(!0), [y, I] = O(i), B = r1(null);
6791
+ W(() => {
6792
+ I(i);
6793
6793
  }, [i]);
6794
- const j = (f) => {
6795
- y(f), h && h(f);
6796
- }, $ = (f, E) => {
6797
- var D;
6798
- return !!((D = E == null ? void 0 : E.label) != null && D.toString().toLowerCase().includes(f.toLowerCase()));
6799
- }, z = () => {
6800
- S(!0);
6801
- }, l1 = () => {
6802
- S(!1);
6794
+ const D = (f) => {
6795
+ b(f), h && h(f);
6796
+ }, P = (f, _) => {
6797
+ var j;
6798
+ return !!((j = _ == null ? void 0 : _.label) != null && j.toString().toLowerCase().includes(f.toLowerCase()));
6799
+ }, F = () => {
6800
+ Z(!0);
6801
+ }, $ = () => {
6802
+ Z(!1);
6803
6803
  }, V = G(
6804
6804
  (f) => {
6805
- if (U(f), o) {
6806
- const D = f;
6807
- e == null || e(D);
6805
+ if (I(f), o) {
6806
+ const j = f;
6807
+ e == null || e(j);
6808
6808
  return;
6809
6809
  }
6810
- const E = f;
6811
- e == null || e(E);
6810
+ const _ = f;
6811
+ e == null || e(_);
6812
6812
  },
6813
6813
  [o, e]
6814
- ), P = G(() => {
6815
- if (!_) {
6814
+ ), Y = G(() => {
6815
+ if (!H) {
6816
6816
  if (o) {
6817
6817
  V([]);
6818
6818
  return;
6819
6819
  }
6820
6820
  V("");
6821
6821
  }
6822
- }, [V, o, _]), T = G(
6822
+ }, [V, o, H]), T = G(
6823
6823
  (f) => {
6824
- const E = H.filter((D) => D !== f);
6825
- V(E), U(E);
6824
+ const _ = y.filter((j) => j !== f);
6825
+ V(_), I(_);
6826
6826
  },
6827
- [V, H]
6828
- ), e1 = G(
6829
- (f) => (H == null ? void 0 : H.indexOf(f)) === 0 ? (
6827
+ [V, y]
6828
+ ), t1 = G(
6829
+ (f) => (y == null ? void 0 : y.indexOf(f)) === 0 ? (
6830
6830
  // if the search input is empty
6831
6831
  // then display the placeholder, else do not display it
6832
- /* @__PURE__ */ n("span", { className: "custom-placeholder", children: I ? t : "" })
6833
- ) : /* @__PURE__ */ n(X, {}),
6834
- [I, H, t]
6832
+ /* @__PURE__ */ n("span", { className: "custom-placeholder", children: J ? t : "" })
6833
+ ) : /* @__PURE__ */ n(e1, {}),
6834
+ [J, y, t]
6835
6835
  ), se = (f) => {
6836
6836
  f.preventDefault(), f.stopPropagation();
6837
6837
  }, ne = async (f) => {
6838
- const { target: E } = f;
6839
- E.scrollTop + E.offsetHeight >= E.scrollHeight - g && (C == null || C(!0)), p && await p(f);
6838
+ const { target: _ } = f;
6839
+ _.scrollTop + _.offsetHeight >= _.scrollHeight - g && (C == null || C(!0)), p && await p(f);
6840
6840
  }, m1 = G(
6841
6841
  (f) => {
6842
- var E, D;
6843
- return ((E = l.find((k1) => k1.value === f)) == null ? void 0 : E.label) || ((D = v == null ? void 0 : v.find(
6842
+ var _, j;
6843
+ return ((_ = l.find((k1) => k1.value === f)) == null ? void 0 : _.label) || ((j = N == null ? void 0 : N.find(
6844
6844
  (k1) => k1.value === f
6845
- )) == null ? void 0 : D.label) || f;
6845
+ )) == null ? void 0 : j.label) || f;
6846
6846
  },
6847
- [v, l]
6847
+ [N, l]
6848
6848
  ), re = G(
6849
6849
  (f) => {
6850
- var E;
6850
+ var _;
6851
6851
  return /* @__PURE__ */ n(
6852
6852
  Ii,
6853
6853
  {
6854
6854
  values: f,
6855
6855
  onTagClose: T,
6856
- maxWidth: ((E = F.current) == null ? void 0 : E.clientWidth) || 0,
6857
- disabled: r || _,
6856
+ maxWidth: ((_ = B.current) == null ? void 0 : _.clientWidth) || 0,
6857
+ disabled: r || H,
6858
6858
  options: l,
6859
- extraOptions: v
6859
+ extraOptions: N
6860
6860
  }
6861
6861
  );
6862
6862
  },
6863
- [r, v, T, l, _]
6863
+ [r, N, T, l, H]
6864
6864
  ), le = G(
6865
- ({ label: f, value: E, mode: D }) => D === "filter" ? e1(E) : /* @__PURE__ */ n("div", { onMouseDown: se, className: "tag-wrapper", children: /* @__PURE__ */ n(Q1, { onClose: () => T(E), closable: !r, children: /* @__PURE__ */ n(q1, { variant: "body4", children: typeof f == "object" ? f : m1(E) }) }) }),
6866
- [r, m1, T, e1]
6865
+ ({ label: f, value: _, mode: j }) => j === "filter" ? t1(_) : /* @__PURE__ */ n("div", { onMouseDown: se, className: "tag-wrapper", children: /* @__PURE__ */ n(Q1, { onClose: () => T(_), closable: !r, children: /* @__PURE__ */ n(q1, { variant: "body4", children: typeof f == "object" ? f : m1(_) }) }) }),
6866
+ [r, m1, T, t1]
6867
6867
  );
6868
6868
  return /* @__PURE__ */ u(
6869
6869
  "div",
6870
6870
  {
6871
6871
  className: `snmt-select ${x ? "snmt-select-focused" : ""}
6872
- ${o ? "" : "snmt-select-single"} ${_ ? "snmt-select-read-only" : ""}`,
6873
- ref: F,
6872
+ ${o ? "" : "snmt-select-single"} ${H ? "snmt-select-read-only" : ""}`,
6873
+ ref: B,
6874
6874
  style: { width: c },
6875
6875
  children: [
6876
6876
  /* @__PURE__ */ n(
6877
6877
  de,
6878
6878
  {
6879
6879
  className: "snmt-select-blank",
6880
- popupClassName: _ ? "dropdown-read-only" : "",
6880
+ popupClassName: H ? "dropdown-read-only" : "",
6881
6881
  id: w,
6882
6882
  ref: L,
6883
6883
  showSearch: !!s,
6884
- filterOption: s && $,
6885
- onDropdownVisibleChange: j,
6884
+ filterOption: s && P,
6885
+ onDropdownVisibleChange: D,
6886
6886
  placeholder: t ? d ? `${t}*` : t : void 0,
6887
6887
  disabled: r,
6888
- value: H || void 0,
6888
+ value: y || void 0,
6889
6889
  labelRender: (f) => m1(f.value),
6890
6890
  mode: o === "filter" ? "multiple" : o,
6891
6891
  onChange: V,
6892
- onFocus: z,
6893
- onBlur: l1,
6892
+ onFocus: F,
6893
+ onBlur: $,
6894
6894
  onSearch: (f) => {
6895
- O(!f), a && a(f);
6895
+ U(!f), a && a(f);
6896
6896
  },
6897
- onSelect: () => O(!0),
6898
- onDeselect: () => O(!0),
6897
+ onSelect: () => U(!0),
6898
+ onDeselect: () => U(!0),
6899
6899
  tagRender: (f) => le({ ...f, mode: o }),
6900
6900
  maxTagCount: "responsive",
6901
6901
  maxTagPlaceholder: re,
6902
6902
  onPopupScroll: ne,
6903
- prefix: _ && !i && /* @__PURE__ */ n(b1, { size: 15 }),
6904
- suffixIcon: /* @__PURE__ */ n("div", { className: "wrapper-suffix-icon", children: o !== "filter" && /* @__PURE__ */ u(X, { children: [
6905
- o && H && !!H.length && /* @__PURE__ */ n("div", { onClick: P, children: /* @__PURE__ */ n(a1, { name: "cancel" }) }),
6903
+ prefix: H && !i && /* @__PURE__ */ n(b1, { size: 15 }),
6904
+ suffixIcon: /* @__PURE__ */ n("div", { className: "wrapper-suffix-icon", children: o !== "filter" && /* @__PURE__ */ u(e1, { children: [
6905
+ o && y && !!y.length && /* @__PURE__ */ n("div", { onClick: Y, children: /* @__PURE__ */ n(a1, { name: "cancel" }) }),
6906
6906
  /* @__PURE__ */ n(
6907
6907
  a1,
6908
6908
  {
6909
6909
  name: "selectArrowIcon",
6910
- color: r ? q.GREY_DARK_1 : q.GREY_DARK_5,
6911
- className: M ? "select-arrow-rotated" : "select-arrow",
6912
- onClick: () => y(!M)
6910
+ color: r ? X.GREY_DARK_1 : X.GREY_DARK_5,
6911
+ className: R ? "select-arrow-rotated" : "select-arrow",
6912
+ onClick: () => b(!R)
6913
6913
  }
6914
6914
  )
6915
6915
  ] }) }),
6916
- removeIcon: /* @__PURE__ */ n(a1, { name: "errorSmall", color: q.GREY_DARK_2 }),
6916
+ removeIcon: /* @__PURE__ */ n(a1, { name: "errorSmall", color: X.GREY_DARK_2 }),
6917
6917
  options: l,
6918
- optionRender: (f) => b ? b(f.data) : /* @__PURE__ */ u(d1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
6918
+ optionRender: (f) => E ? E(f.data) : /* @__PURE__ */ u(d1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
6919
6919
  /* @__PURE__ */ u(d1, { alignItems: "center", gap: 12, children: [
6920
6920
  o && /* @__PURE__ */ n(
6921
6921
  we,
6922
6922
  {
6923
- checked: !!(H != null && H.includes(f.value))
6923
+ checked: !!(y != null && y.includes(f.value))
6924
6924
  }
6925
6925
  ),
6926
6926
  /* @__PURE__ */ u(d1, { alignItems: "center", gap: 8, children: [
@@ -6928,17 +6928,17 @@ const Q1 = ({ children: i, width: e, size: t = "small", onClose: o, closable: s
6928
6928
  /* @__PURE__ */ n("span", { children: f.label })
6929
6929
  ] })
6930
6930
  ] }),
6931
- !o && H === f.value && /* @__PURE__ */ n(
6931
+ !o && y === f.value && /* @__PURE__ */ n(
6932
6932
  a1,
6933
6933
  {
6934
6934
  name: "ok",
6935
- color: q.BLUE_PRIMARY,
6935
+ color: X.BLUE_PRIMARY,
6936
6936
  width: 16,
6937
6937
  height: 16
6938
6938
  }
6939
6939
  )
6940
6940
  ] }),
6941
- dropdownRender: R ? () => /* @__PURE__ */ n(
6941
+ dropdownRender: M ? () => /* @__PURE__ */ n(
6942
6942
  "div",
6943
6943
  {
6944
6944
  style: {
@@ -6948,7 +6948,7 @@ const Q1 = ({ children: i, width: e, size: t = "small", onClose: o, closable: s
6948
6948
  },
6949
6949
  children: /* @__PURE__ */ n(b1, { size: 28 })
6950
6950
  }
6951
- ) : (f) => N ? N(f) : f
6951
+ ) : (f) => v ? v(f) : f
6952
6952
  }
6953
6953
  ),
6954
6954
  /* @__PURE__ */ n(
@@ -7057,7 +7057,7 @@ class w1 {
7057
7057
  });
7058
7058
  }
7059
7059
  }
7060
- const t1 = () => {
7060
+ const i1 = () => {
7061
7061
  let i, e;
7062
7062
  const t = new Promise((o, s) => {
7063
7063
  i = o, e = s;
@@ -7067,7 +7067,7 @@ const t1 = () => {
7067
7067
  i.forEach((o) => {
7068
7068
  e[o] && (t[o] = e[o]);
7069
7069
  });
7070
- }, Bi = /###/g, _1 = (i) => i && i.indexOf("###") > -1 ? i.replace(Bi, ".") : i, H1 = (i) => !i || typeof i == "string", i1 = (i, e, t) => {
7070
+ }, Bi = /###/g, _1 = (i) => i && i.indexOf("###") > -1 ? i.replace(Bi, ".") : i, H1 = (i) => !i || typeof i == "string", o1 = (i, e, t) => {
7071
7071
  const o = typeof e != "string" ? e : e.split(".");
7072
7072
  let s = 0;
7073
7073
  for (; s < o.length - 1; ) {
@@ -7083,26 +7083,26 @@ const t1 = () => {
7083
7083
  const {
7084
7084
  obj: o,
7085
7085
  k: s
7086
- } = i1(i, e, Object);
7086
+ } = o1(i, e, Object);
7087
7087
  if (o !== void 0 || e.length === 1) {
7088
7088
  o[s] = t;
7089
7089
  return;
7090
7090
  }
7091
- let l = e[e.length - 1], c = e.slice(0, e.length - 1), r = i1(i, c, Object);
7091
+ let l = e[e.length - 1], c = e.slice(0, e.length - 1), r = o1(i, c, Object);
7092
7092
  for (; r.obj === void 0 && c.length; )
7093
- l = `${c[c.length - 1]}.${l}`, c = c.slice(0, c.length - 1), r = i1(i, c, Object), r && r.obj && typeof r.obj[`${r.k}.${l}`] < "u" && (r.obj = void 0);
7093
+ l = `${c[c.length - 1]}.${l}`, c = c.slice(0, c.length - 1), r = o1(i, c, Object), r && r.obj && typeof r.obj[`${r.k}.${l}`] < "u" && (r.obj = void 0);
7094
7094
  r.obj[`${r.k}.${l}`] = t;
7095
7095
  }, Wi = (i, e, t, o) => {
7096
7096
  const {
7097
7097
  obj: s,
7098
7098
  k: l
7099
- } = i1(i, e, Object);
7099
+ } = o1(i, e, Object);
7100
7100
  s[l] = s[l] || [], s[l].push(t);
7101
7101
  }, u1 = (i, e) => {
7102
7102
  const {
7103
7103
  obj: t,
7104
7104
  k: o
7105
- } = i1(i, e);
7105
+ } = o1(i, e);
7106
7106
  if (t)
7107
7107
  return t[o];
7108
7108
  }, ji = (i, e, t) => {
@@ -7112,7 +7112,7 @@ const t1 = () => {
7112
7112
  for (const o in e)
7113
7113
  o !== "__proto__" && o !== "constructor" && (o in i ? typeof i[o] == "string" || i[o] instanceof String || typeof e[o] == "string" || e[o] instanceof String ? t && (i[o] = e[o]) : X1(i[o], e[o], t) : i[o] = e[o]);
7114
7114
  return i;
7115
- }, J = (i) => i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
7115
+ }, Q = (i) => i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
7116
7116
  var Zi = {
7117
7117
  "&": "&amp;",
7118
7118
  "<": "&lt;",
@@ -7323,8 +7323,8 @@ class p1 extends w1 {
7323
7323
  }
7324
7324
  const h = this.resolve(e, t);
7325
7325
  let C = h && h.res;
7326
- const p = h && h.usedKey || c, w = h && h.exactUsedKey || c, v = Object.prototype.toString.apply(C), N = ["[object Number]", "[object Function]", "[object RegExp]"], b = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, R = !this.i18nFormat || this.i18nFormat.handleAsObject;
7327
- if (R && C && (typeof C != "string" && typeof C != "boolean" && typeof C != "number") && N.indexOf(v) < 0 && !(typeof b == "string" && Array.isArray(C))) {
7326
+ const p = h && h.usedKey || c, w = h && h.exactUsedKey || c, N = Object.prototype.toString.apply(C), v = ["[object Number]", "[object Function]", "[object RegExp]"], E = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, M = !this.i18nFormat || this.i18nFormat.handleAsObject;
7327
+ if (M && C && (typeof C != "string" && typeof C != "boolean" && typeof C != "number") && v.indexOf(N) < 0 && !(typeof E == "string" && Array.isArray(C))) {
7328
7328
  if (!t.returnObjects && !this.options.returnObjects) {
7329
7329
  this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
7330
7330
  const L = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, C, {
@@ -7334,53 +7334,53 @@ class p1 extends w1 {
7334
7334
  return s ? (h.res = L, h.usedParams = this.getUsedParamsDetails(t), h) : L;
7335
7335
  }
7336
7336
  if (l) {
7337
- const L = Array.isArray(C), M = L ? [] : {}, y = L ? w : p;
7337
+ const L = Array.isArray(C), R = L ? [] : {}, b = L ? w : p;
7338
7338
  for (const x in C)
7339
7339
  if (Object.prototype.hasOwnProperty.call(C, x)) {
7340
- const S = `${y}${l}${x}`;
7341
- M[x] = this.translate(S, {
7340
+ const Z = `${b}${l}${x}`;
7341
+ R[x] = this.translate(Z, {
7342
7342
  ...t,
7343
7343
  joinArrays: !1,
7344
7344
  ns: r
7345
- }), M[x] === S && (M[x] = C[x]);
7345
+ }), R[x] === Z && (R[x] = C[x]);
7346
7346
  }
7347
- C = M;
7347
+ C = R;
7348
7348
  }
7349
- } else if (R && typeof b == "string" && Array.isArray(C))
7350
- C = C.join(b), C && (C = this.extendTranslation(C, e, t, o));
7349
+ } else if (M && typeof E == "string" && Array.isArray(C))
7350
+ C = C.join(E), C && (C = this.extendTranslation(C, e, t, o));
7351
7351
  else {
7352
- let L = !1, M = !1;
7353
- const y = t.count !== void 0 && typeof t.count != "string", x = p1.hasDefaultValue(t), S = y ? this.pluralResolver.getSuffix(g, t.count, t) : "", I = t.ordinal && y ? this.pluralResolver.getSuffix(g, t.count, {
7352
+ let L = !1, R = !1;
7353
+ const b = t.count !== void 0 && typeof t.count != "string", x = p1.hasDefaultValue(t), Z = b ? this.pluralResolver.getSuffix(g, t.count, t) : "", J = t.ordinal && b ? this.pluralResolver.getSuffix(g, t.count, {
7354
7354
  ordinal: !1
7355
- }) : "", O = y && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), H = O && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${S}`] || t[`defaultValue${I}`] || t.defaultValue;
7356
- !this.isValidLookup(C) && x && (L = !0, C = H), this.isValidLookup(C) || (M = !0, C = c);
7357
- const F = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && M ? void 0 : C, j = x && H !== C && this.options.updateMissing;
7358
- if (M || L || j) {
7359
- if (this.logger.log(j ? "updateKey" : "missingKey", g, d, c, j ? H : C), l) {
7355
+ }) : "", U = b && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), y = U && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${Z}`] || t[`defaultValue${J}`] || t.defaultValue;
7356
+ !this.isValidLookup(C) && x && (L = !0, C = y), this.isValidLookup(C) || (R = !0, C = c);
7357
+ const B = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && R ? void 0 : C, D = x && y !== C && this.options.updateMissing;
7358
+ if (R || L || D) {
7359
+ if (this.logger.log(D ? "updateKey" : "missingKey", g, d, c, D ? y : C), l) {
7360
7360
  const V = this.resolve(c, {
7361
7361
  ...t,
7362
7362
  keySeparator: !1
7363
7363
  });
7364
7364
  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.");
7365
7365
  }
7366
- let $ = [];
7367
- const z = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
7368
- if (this.options.saveMissingTo === "fallback" && z && z[0])
7369
- for (let V = 0; V < z.length; V++)
7370
- $.push(z[V]);
7371
- else this.options.saveMissingTo === "all" ? $ = this.languageUtils.toResolveHierarchy(t.lng || this.language) : $.push(t.lng || this.language);
7372
- const l1 = (V, P, T) => {
7373
- const e1 = x && T !== C ? T : F;
7374
- this.options.missingKeyHandler ? this.options.missingKeyHandler(V, d, P, e1, j, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(V, d, P, e1, j, t), this.emit("missingKey", V, d, P, C);
7366
+ let P = [];
7367
+ const F = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
7368
+ if (this.options.saveMissingTo === "fallback" && F && F[0])
7369
+ for (let V = 0; V < F.length; V++)
7370
+ P.push(F[V]);
7371
+ else this.options.saveMissingTo === "all" ? P = this.languageUtils.toResolveHierarchy(t.lng || this.language) : P.push(t.lng || this.language);
7372
+ const $ = (V, Y, T) => {
7373
+ const t1 = x && T !== C ? T : B;
7374
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(V, d, Y, t1, D, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(V, d, Y, t1, D, t), this.emit("missingKey", V, d, Y, C);
7375
7375
  };
7376
- this.options.saveMissing && (this.options.saveMissingPlurals && y ? $.forEach((V) => {
7377
- const P = this.pluralResolver.getSuffixes(V, t);
7378
- O && t[`defaultValue${this.options.pluralSeparator}zero`] && P.indexOf(`${this.options.pluralSeparator}zero`) < 0 && P.push(`${this.options.pluralSeparator}zero`), P.forEach((T) => {
7379
- l1([V], c + T, t[`defaultValue${T}`] || H);
7376
+ this.options.saveMissing && (this.options.saveMissingPlurals && b ? P.forEach((V) => {
7377
+ const Y = this.pluralResolver.getSuffixes(V, t);
7378
+ U && t[`defaultValue${this.options.pluralSeparator}zero`] && Y.indexOf(`${this.options.pluralSeparator}zero`) < 0 && Y.push(`${this.options.pluralSeparator}zero`), Y.forEach((T) => {
7379
+ $([V], c + T, t[`defaultValue${T}`] || y);
7380
7380
  });
7381
- }) : l1($, c, H));
7381
+ }) : $(P, c, y));
7382
7382
  }
7383
- C = this.extendTranslation(C, e, t, h, o), M && C === c && this.options.appendNamespaceToMissingKey && (C = `${d}:${c}`), (M || L) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? C = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${d}:${c}` : c, L ? C : void 0) : C = this.options.parseMissingKeyHandler(C));
7383
+ C = this.extendTranslation(C, e, t, h, o), R && C === c && this.options.appendNamespaceToMissingKey && (C = `${d}:${c}`), (R || L) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? C = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${d}:${c}` : c, L ? C : void 0) : C = this.options.parseMissingKeyHandler(C));
7384
7384
  }
7385
7385
  return s ? (h.res = C, h.usedParams = this.getUsedParamsDetails(t), h) : C;
7386
7386
  }
@@ -7438,26 +7438,26 @@ class p1 extends w1 {
7438
7438
  s = a;
7439
7439
  let h = g.namespaces;
7440
7440
  this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
7441
- const C = t.count !== void 0 && typeof t.count != "string", p = C && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), w = t.context !== void 0 && (typeof t.context == "string" || typeof t.context == "number") && t.context !== "", v = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
7442
- h.forEach((N) => {
7443
- this.isValidLookup(o) || (r = N, !S1[`${v[0]}-${N}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(r) && (S1[`${v[0]}-${N}`] = !0, this.logger.warn(`key "${s}" for languages "${v.join(", ")}" won't get resolved as namespace "${r}" 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!!!")), v.forEach((b) => {
7441
+ const C = t.count !== void 0 && typeof t.count != "string", p = C && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), w = 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);
7442
+ h.forEach((v) => {
7443
+ this.isValidLookup(o) || (r = v, !S1[`${N[0]}-${v}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(r) && (S1[`${N[0]}-${v}`] = !0, this.logger.warn(`key "${s}" for languages "${N.join(", ")}" won't get resolved as namespace "${r}" 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((E) => {
7444
7444
  if (this.isValidLookup(o)) return;
7445
- c = b;
7446
- const R = [a];
7445
+ c = E;
7446
+ const M = [a];
7447
7447
  if (this.i18nFormat && this.i18nFormat.addLookupKeys)
7448
- this.i18nFormat.addLookupKeys(R, a, b, N, t);
7448
+ this.i18nFormat.addLookupKeys(M, a, E, v, t);
7449
7449
  else {
7450
7450
  let L;
7451
- C && (L = this.pluralResolver.getSuffix(b, t.count, t));
7452
- const M = `${this.options.pluralSeparator}zero`, y = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
7453
- if (C && (R.push(a + L), t.ordinal && L.indexOf(y) === 0 && R.push(a + L.replace(y, this.options.pluralSeparator)), p && R.push(a + M)), w) {
7451
+ C && (L = this.pluralResolver.getSuffix(E, t.count, t));
7452
+ const R = `${this.options.pluralSeparator}zero`, b = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
7453
+ if (C && (M.push(a + L), t.ordinal && L.indexOf(b) === 0 && M.push(a + L.replace(b, this.options.pluralSeparator)), p && M.push(a + R)), w) {
7454
7454
  const x = `${a}${this.options.contextSeparator}${t.context}`;
7455
- R.push(x), C && (R.push(x + L), t.ordinal && L.indexOf(y) === 0 && R.push(x + L.replace(y, this.options.pluralSeparator)), p && R.push(x + M));
7455
+ M.push(x), C && (M.push(x + L), t.ordinal && L.indexOf(b) === 0 && M.push(x + L.replace(b, this.options.pluralSeparator)), p && M.push(x + R));
7456
7456
  }
7457
7457
  }
7458
- let _;
7459
- for (; _ = R.pop(); )
7460
- this.isValidLookup(o) || (l = _, o = this.getResource(b, N, _, t));
7458
+ let H;
7459
+ for (; H = M.pop(); )
7460
+ this.isValidLookup(o) || (l = H, o = this.getResource(E, v, H, t));
7461
7461
  }));
7462
7462
  });
7463
7463
  }), {
@@ -7781,12 +7781,12 @@ class Qi {
7781
7781
  nestingPrefix: C,
7782
7782
  nestingPrefixEscaped: p,
7783
7783
  nestingSuffix: w,
7784
- nestingSuffixEscaped: v,
7785
- nestingOptionsSeparator: N,
7786
- maxReplaces: b,
7787
- alwaysFormat: R
7784
+ nestingSuffixEscaped: N,
7785
+ nestingOptionsSeparator: v,
7786
+ maxReplaces: E,
7787
+ alwaysFormat: M
7788
7788
  } = e.interpolation;
7789
- this.escape = t !== void 0 ? t : Di, this.escapeValue = o !== void 0 ? o : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = l ? J(l) : c || "{{", this.suffix = r ? J(r) : d || "}}", this.formatSeparator = g || ",", this.unescapePrefix = a ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : a || "", this.nestingPrefix = C ? J(C) : p || J("$t("), this.nestingSuffix = w ? J(w) : v || J(")"), this.nestingOptionsSeparator = N || ",", this.maxReplaces = b || 1e3, this.alwaysFormat = R !== void 0 ? R : !1, this.resetRegExp();
7789
+ this.escape = t !== void 0 ? t : Di, this.escapeValue = o !== void 0 ? o : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = l ? Q(l) : c || "{{", this.suffix = r ? Q(r) : d || "}}", this.formatSeparator = g || ",", this.unescapePrefix = a ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : a || "", this.nestingPrefix = C ? Q(C) : p || Q("$t("), this.nestingSuffix = w ? Q(w) : N || Q(")"), this.nestingOptionsSeparator = v || ",", this.maxReplaces = E || 1e3, this.alwaysFormat = M !== void 0 ? M : !1, this.resetRegExp();
7790
7790
  }
7791
7791
  reset() {
7792
7792
  this.options && this.init(this.options);
@@ -7799,18 +7799,18 @@ class Qi {
7799
7799
  let l, c, r;
7800
7800
  const d = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, g = (p) => {
7801
7801
  if (p.indexOf(this.formatSeparator) < 0) {
7802
- const b = B1(t, d, p, this.options.keySeparator, this.options.ignoreJSONStructure);
7803
- return this.alwaysFormat ? this.format(b, void 0, o, {
7802
+ const E = B1(t, d, p, this.options.keySeparator, this.options.ignoreJSONStructure);
7803
+ return this.alwaysFormat ? this.format(E, void 0, o, {
7804
7804
  ...s,
7805
7805
  ...t,
7806
7806
  interpolationkey: p
7807
- }) : b;
7807
+ }) : E;
7808
7808
  }
7809
- const w = p.split(this.formatSeparator), v = w.shift().trim(), N = w.join(this.formatSeparator).trim();
7810
- return this.format(B1(t, d, v, this.options.keySeparator, this.options.ignoreJSONStructure), N, o, {
7809
+ const w = p.split(this.formatSeparator), N = w.shift().trim(), v = w.join(this.formatSeparator).trim();
7810
+ return this.format(B1(t, d, N, this.options.keySeparator, this.options.ignoreJSONStructure), v, o, {
7811
7811
  ...s,
7812
7812
  ...t,
7813
- interpolationkey: v
7813
+ interpolationkey: N
7814
7814
  });
7815
7815
  };
7816
7816
  this.resetRegExp();
@@ -7826,8 +7826,8 @@ class Qi {
7826
7826
  const w = l[1].trim();
7827
7827
  if (c = g(w), c === void 0)
7828
7828
  if (typeof a == "function") {
7829
- const N = a(e, l, s);
7830
- c = typeof N == "string" ? N : "";
7829
+ const v = a(e, l, s);
7830
+ c = typeof v == "string" ? v : "";
7831
7831
  } else if (s && Object.prototype.hasOwnProperty.call(s, w))
7832
7832
  c = "";
7833
7833
  else if (h) {
@@ -7836,8 +7836,8 @@ class Qi {
7836
7836
  } else
7837
7837
  this.logger.warn(`missed to pass in variable ${w} for interpolating ${e}`), c = "";
7838
7838
  else typeof c != "string" && !this.useRawValueToEscape && (c = E1(c));
7839
- const v = p.safeValue(c);
7840
- if (e = e.replace(l[0], v), h ? (p.regex.lastIndex += c.length, p.regex.lastIndex -= l[0].length) : p.regex.lastIndex = 0, r++, r >= this.maxReplaces)
7839
+ const N = p.safeValue(c);
7840
+ if (e = e.replace(l[0], N), h ? (p.regex.lastIndex += c.length, p.regex.lastIndex -= l[0].length) : p.regex.lastIndex = 0, r++, r >= this.maxReplaces)
7841
7841
  break;
7842
7842
  }
7843
7843
  }), e;
@@ -7857,8 +7857,8 @@ class Qi {
7857
7857
  ...g,
7858
7858
  ...c
7859
7859
  });
7860
- } catch (v) {
7861
- return this.logger.warn(`failed parsing options string in nesting for key ${d}`, v), `${d}${a}${C}`;
7860
+ } catch (N) {
7861
+ return this.logger.warn(`failed parsing options string in nesting for key ${d}`, N), `${d}${a}${C}`;
7862
7862
  }
7863
7863
  return c.defaultValue && c.defaultValue.indexOf(this.prefix) > -1 && delete c.defaultValue, d;
7864
7864
  };
@@ -7899,7 +7899,7 @@ const qi = (i) => {
7899
7899
  formatName: e,
7900
7900
  formatOptions: t
7901
7901
  };
7902
- }, Q = (i) => {
7902
+ }, q = (i) => {
7903
7903
  const e = {};
7904
7904
  return (t, o, s) => {
7905
7905
  let l = s;
@@ -7916,32 +7916,32 @@ class Xi {
7916
7916
  constructor() {
7917
7917
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
7918
7918
  this.logger = K.create("formatter"), this.options = e, this.formats = {
7919
- number: Q((t, o) => {
7919
+ number: q((t, o) => {
7920
7920
  const s = new Intl.NumberFormat(t, {
7921
7921
  ...o
7922
7922
  });
7923
7923
  return (l) => s.format(l);
7924
7924
  }),
7925
- currency: Q((t, o) => {
7925
+ currency: q((t, o) => {
7926
7926
  const s = new Intl.NumberFormat(t, {
7927
7927
  ...o,
7928
7928
  style: "currency"
7929
7929
  });
7930
7930
  return (l) => s.format(l);
7931
7931
  }),
7932
- datetime: Q((t, o) => {
7932
+ datetime: q((t, o) => {
7933
7933
  const s = new Intl.DateTimeFormat(t, {
7934
7934
  ...o
7935
7935
  });
7936
7936
  return (l) => s.format(l);
7937
7937
  }),
7938
- relativetime: Q((t, o) => {
7938
+ relativetime: q((t, o) => {
7939
7939
  const s = new Intl.RelativeTimeFormat(t, {
7940
7940
  ...o
7941
7941
  });
7942
7942
  return (l) => s.format(l, o.range || "day");
7943
7943
  }),
7944
- list: Q((t, o) => {
7944
+ list: q((t, o) => {
7945
7945
  const s = new Intl.ListFormat(t, {
7946
7946
  ...o
7947
7947
  });
@@ -7959,7 +7959,7 @@ class Xi {
7959
7959
  this.formats[e.toLowerCase().trim()] = t;
7960
7960
  }
7961
7961
  addCached(e, t) {
7962
- this.formats[e.toLowerCase().trim()] = Q(t);
7962
+ this.formats[e.toLowerCase().trim()] = q(t);
7963
7963
  }
7964
7964
  format(e, t, o) {
7965
7965
  let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
@@ -8192,7 +8192,7 @@ const W1 = () => ({
8192
8192
  typeof i[t] == "function" && (i[t] = i[t].bind(i));
8193
8193
  });
8194
8194
  };
8195
- class o1 extends w1 {
8195
+ class s1 extends w1 {
8196
8196
  constructor() {
8197
8197
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
8198
8198
  if (super(), this.options = j1(e), this.services = {}, this.logger = K, this.modules = {
@@ -8233,13 +8233,13 @@ class o1 extends w1 {
8233
8233
  }), a && (!this.options.interpolation.format || this.options.interpolation.format === s.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 Qi(this.options), C.utils = {
8234
8234
  hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
8235
8235
  }, C.backendConnector = new t5(l(this.modules.backend), C.resourceStore, C, this.options), C.backendConnector.on("*", function(p) {
8236
- for (var w = arguments.length, v = new Array(w > 1 ? w - 1 : 0), N = 1; N < w; N++)
8237
- v[N - 1] = arguments[N];
8238
- e.emit(p, ...v);
8236
+ for (var w = arguments.length, N = new Array(w > 1 ? w - 1 : 0), v = 1; v < w; v++)
8237
+ N[v - 1] = arguments[v];
8238
+ e.emit(p, ...N);
8239
8239
  }), 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) {
8240
- for (var w = arguments.length, v = new Array(w > 1 ? w - 1 : 0), N = 1; N < w; N++)
8241
- v[N - 1] = arguments[N];
8242
- e.emit(p, ...v);
8240
+ for (var w = arguments.length, N = new Array(w > 1 ? w - 1 : 0), v = 1; v < w; v++)
8241
+ N[v - 1] = arguments[v];
8242
+ e.emit(p, ...N);
8243
8243
  }), this.modules.external.forEach((p) => {
8244
8244
  p.init && p.init(this);
8245
8245
  });
@@ -8257,7 +8257,7 @@ class o1 extends w1 {
8257
8257
  return e.store[a](...arguments), e;
8258
8258
  };
8259
8259
  });
8260
- const d = t1(), g = () => {
8260
+ const d = i1(), g = () => {
8261
8261
  const a = (h, C) => {
8262
8262
  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), o(h, C);
8263
8263
  };
@@ -8284,7 +8284,7 @@ class o1 extends w1 {
8284
8284
  o(null);
8285
8285
  }
8286
8286
  reloadResources(e, t, o) {
8287
- const s = t1();
8287
+ const s = i1();
8288
8288
  return typeof e == "function" && (o = e, e = void 0), typeof t == "function" && (o = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), o || (o = h1), this.services.backendConnector.reload(e, t, (l) => {
8289
8289
  s.resolve(), o(l);
8290
8290
  }), s;
@@ -8307,7 +8307,7 @@ class o1 extends w1 {
8307
8307
  changeLanguage(e, t) {
8308
8308
  var o = this;
8309
8309
  this.isLanguageChangingTo = e;
8310
- const s = t1();
8310
+ const s = i1();
8311
8311
  this.emit("languageChanging", e);
8312
8312
  const l = (d) => {
8313
8313
  this.language = d, this.languages = this.services.languageUtils.toResolveHierarchy(d), this.resolvedLanguage = void 0, this.setResolvedLanguage(d);
@@ -8373,7 +8373,7 @@ class o1 extends w1 {
8373
8373
  return !!(this.hasResourceBundle(o, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || c(o, e) && (!s || c(l, e)));
8374
8374
  }
8375
8375
  loadNamespaces(e, t) {
8376
- const o = t1();
8376
+ const o = i1();
8377
8377
  return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach((s) => {
8378
8378
  this.options.ns.indexOf(s) < 0 && this.options.ns.push(s);
8379
8379
  }), this.loadResources((s) => {
@@ -8381,7 +8381,7 @@ class o1 extends w1 {
8381
8381
  }), o) : (t && t(), Promise.resolve());
8382
8382
  }
8383
8383
  loadLanguages(e, t) {
8384
- const o = t1();
8384
+ const o = i1();
8385
8385
  typeof e == "string" && (e = [e]);
8386
8386
  const s = this.options.preload || [], l = e.filter((c) => s.indexOf(c) < 0 && this.services.languageUtils.isSupportedCode(c));
8387
8387
  return l.length ? (this.options.preload = s.concat(l), this.loadResources((c) => {
@@ -8395,7 +8395,7 @@ class o1 extends w1 {
8395
8395
  }
8396
8396
  static createInstance() {
8397
8397
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
8398
- return new o1(e, t);
8398
+ return new s1(e, t);
8399
8399
  }
8400
8400
  cloneInstance() {
8401
8401
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : h1;
@@ -8405,7 +8405,7 @@ class o1 extends w1 {
8405
8405
  ...this.options,
8406
8406
  ...e,
8407
8407
  isClone: !0
8408
- }, l = new o1(s);
8408
+ }, l = new s1(s);
8409
8409
  return (e.debug !== void 0 || e.prefix !== void 0) && (l.logger = l.logger.clone(e)), ["store", "services", "language"].forEach((r) => {
8410
8410
  l[r] = this[r];
8411
8411
  }), l.services = {
@@ -8430,34 +8430,34 @@ class o1 extends w1 {
8430
8430
  };
8431
8431
  }
8432
8432
  }
8433
- const W = o1.createInstance();
8434
- W.createInstance = o1.createInstance;
8435
- W.createInstance;
8436
- W.dir;
8437
- W.init;
8438
- W.loadResources;
8439
- W.reloadResources;
8440
- W.use;
8441
- W.changeLanguage;
8442
- W.getFixedT;
8443
- W.t;
8444
- W.exists;
8445
- W.setDefaultNamespace;
8446
- W.hasLoadedNamespace;
8447
- W.loadNamespaces;
8448
- W.loadLanguages;
8433
+ const A = s1.createInstance();
8434
+ A.createInstance = s1.createInstance;
8435
+ A.createInstance;
8436
+ A.dir;
8437
+ A.init;
8438
+ A.loadResources;
8439
+ A.reloadResources;
8440
+ A.use;
8441
+ A.changeLanguage;
8442
+ A.getFixedT;
8443
+ A.t;
8444
+ A.exists;
8445
+ A.setDefaultNamespace;
8446
+ A.hasLoadedNamespace;
8447
+ A.loadNamespaces;
8448
+ A.loadLanguages;
8449
8449
  function o5() {
8450
8450
  if (console && console.warn) {
8451
8451
  for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
8452
8452
  e[t] = arguments[t];
8453
- Y(e[0]) && (e[0] = `react-i18next:: ${e[0]}`), console.warn(...e);
8453
+ z(e[0]) && (e[0] = `react-i18next:: ${e[0]}`), console.warn(...e);
8454
8454
  }
8455
8455
  }
8456
8456
  const Z1 = {};
8457
8457
  function R1() {
8458
8458
  for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
8459
8459
  e[t] = arguments[t];
8460
- Y(e[0]) && Z1[e[0]] || (Y(e[0]) && (Z1[e[0]] = /* @__PURE__ */ new Date()), o5(...e));
8460
+ z(e[0]) && Z1[e[0]] || (z(e[0]) && (Z1[e[0]] = /* @__PURE__ */ new Date()), o5(...e));
8461
8461
  }
8462
8462
  const te = (i, e) => () => {
8463
8463
  if (i.isInitialized)
@@ -8473,7 +8473,7 @@ const te = (i, e) => () => {
8473
8473
  }, D1 = (i, e, t) => {
8474
8474
  i.loadNamespaces(e, te(i, t));
8475
8475
  }, T1 = (i, e, t, o) => {
8476
- Y(t) && (t = [t]), t.forEach((s) => {
8476
+ z(t) && (t = [t]), t.forEach((s) => {
8477
8477
  i.options.ns.indexOf(s) < 0 && i.options.ns.push(s);
8478
8478
  }), i.loadLanguages(e, te(i, o));
8479
8479
  }, s5 = function(i, e) {
@@ -8493,7 +8493,7 @@ const te = (i, e) => () => {
8493
8493
  if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && s.services.backendConnector.backend && s.isLanguageChangingTo && !l(s.isLanguageChangingTo, i)) return !1;
8494
8494
  }
8495
8495
  }) : s5(i, e, t);
8496
- }, Y = (i) => typeof i == "string", r5 = (i) => typeof i == "object" && i !== null, l5 = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, a5 = {
8496
+ }, z = (i) => typeof i == "string", r5 = (i) => typeof i == "object" && i !== null, l5 = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, a5 = {
8497
8497
  "&amp;": "&",
8498
8498
  "&#38;": "&",
8499
8499
  "&lt;": "<",
@@ -8540,7 +8540,7 @@ const u5 = (i) => {
8540
8540
  init(i) {
8541
8541
  d5(i.options.react), u5(i);
8542
8542
  }
8543
- }, f5 = s1();
8543
+ }, f5 = n1();
8544
8544
  class w5 {
8545
8545
  constructor() {
8546
8546
  y1(this, "getUsedNamespaces", () => Object.keys(this.usedNamespaces));
@@ -8553,8 +8553,8 @@ class w5 {
8553
8553
  }
8554
8554
  }
8555
8555
  const m5 = (i, e) => {
8556
- const t = n1();
8557
- return Z(() => {
8556
+ const t = r1();
8557
+ return W(() => {
8558
8558
  t.current = i;
8559
8559
  }, [i, e]), t.current;
8560
8560
  }, oe = (i, e, t, o) => i.getFixedT(e, t, o), k5 = (i, e, t, o) => G(oe(i, e, t, o), [i, e, t, o]), L5 = function(i) {
@@ -8564,11 +8564,11 @@ const m5 = (i, e) => {
8564
8564
  } = e, {
8565
8565
  i18n: o,
8566
8566
  defaultNS: s
8567
- } = r1(f5) || {}, l = t || o || C5();
8567
+ } = l1(f5) || {}, l = t || o || C5();
8568
8568
  if (l && !l.reportNamespaces && (l.reportNamespaces = new w5()), !l) {
8569
8569
  R1("You will need to pass in an i18next instance by using initReactI18next");
8570
- const L = (y, x) => Y(x) ? x : r5(x) && Y(x.defaultValue) ? x.defaultValue : Array.isArray(y) ? y[y.length - 1] : y, M = [L, {}, !1];
8571
- return M.t = L, M.i18n = {}, M.ready = !1, M;
8570
+ const L = (b, x) => z(x) ? x : r5(x) && z(x.defaultValue) ? x.defaultValue : Array.isArray(b) ? b[b.length - 1] : b, R = [L, {}, !1];
8571
+ return R.t = L, R.i18n = {}, R.ready = !1, R;
8572
8572
  }
8573
8573
  l.options.react && l.options.react.wait !== void 0 && R1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
8574
8574
  const c = {
@@ -8580,41 +8580,41 @@ const m5 = (i, e) => {
8580
8580
  keyPrefix: d
8581
8581
  } = c;
8582
8582
  let g = i;
8583
- g = Y(g) ? [g] : g || ["translation"], l.reportNamespaces.addUsedNamespaces && l.reportNamespaces.addUsedNamespaces(g);
8584
- const a = (l.isInitialized || l.initializedStoreOnce) && g.every((L) => n5(L, l, c)), h = k5(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), C = () => h, p = () => oe(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [w, v] = B(C);
8585
- let N = g.join();
8586
- e.lng && (N = `${e.lng}${N}`);
8587
- const b = m5(N), R = n1(!0);
8588
- Z(() => {
8583
+ g = z(g) ? [g] : g || ["translation"], l.reportNamespaces.addUsedNamespaces && l.reportNamespaces.addUsedNamespaces(g);
8584
+ const a = (l.isInitialized || l.initializedStoreOnce) && g.every((L) => n5(L, l, c)), h = k5(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), C = () => h, p = () => oe(l, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [w, N] = O(C);
8585
+ let v = g.join();
8586
+ e.lng && (v = `${e.lng}${v}`);
8587
+ const E = m5(v), M = r1(!0);
8588
+ W(() => {
8589
8589
  const {
8590
8590
  bindI18n: L,
8591
- bindI18nStore: M
8591
+ bindI18nStore: R
8592
8592
  } = c;
8593
- R.current = !0, !a && !r && (e.lng ? T1(l, e.lng, g, () => {
8594
- R.current && v(p);
8593
+ M.current = !0, !a && !r && (e.lng ? T1(l, e.lng, g, () => {
8594
+ M.current && N(p);
8595
8595
  }) : D1(l, g, () => {
8596
- R.current && v(p);
8597
- })), a && b && b !== N && R.current && v(p);
8598
- const y = () => {
8599
- R.current && v(p);
8596
+ M.current && N(p);
8597
+ })), a && E && E !== v && M.current && N(p);
8598
+ const b = () => {
8599
+ M.current && N(p);
8600
8600
  };
8601
- return L && l && l.on(L, y), M && l && l.store.on(M, y), () => {
8602
- R.current = !1, L && l && L.split(" ").forEach((x) => l.off(x, y)), M && l && M.split(" ").forEach((x) => l.store.off(x, y));
8601
+ return L && l && l.on(L, b), R && l && l.store.on(R, b), () => {
8602
+ M.current = !1, L && l && L.split(" ").forEach((x) => l.off(x, b)), R && l && R.split(" ").forEach((x) => l.store.off(x, b));
8603
8603
  };
8604
- }, [l, N]), Z(() => {
8605
- R.current && a && v(C);
8604
+ }, [l, v]), W(() => {
8605
+ M.current && a && N(C);
8606
8606
  }, [l, d, a]);
8607
- const _ = [w, l, a];
8608
- if (_.t = w, _.i18n = l, _.ready = a, a || !a && !r) return _;
8607
+ const H = [w, l, a];
8608
+ if (H.t = w, H.i18n = l, H.ready = a, a || !a && !r) return H;
8609
8609
  throw new Promise((L) => {
8610
8610
  e.lng ? T1(l, e.lng, g, () => L()) : D1(l, g, () => L());
8611
8611
  });
8612
8612
  };
8613
- var A = [];
8613
+ var S = [];
8614
8614
  for (var N1 = 0; N1 < 256; ++N1)
8615
- A.push((N1 + 256).toString(16).slice(1));
8615
+ S.push((N1 + 256).toString(16).slice(1));
8616
8616
  function v5(i, e = 0) {
8617
- return (A[i[e + 0]] + A[i[e + 1]] + A[i[e + 2]] + A[i[e + 3]] + "-" + A[i[e + 4]] + A[i[e + 5]] + "-" + A[i[e + 6]] + A[i[e + 7]] + "-" + A[i[e + 8]] + A[i[e + 9]] + "-" + A[i[e + 10]] + A[i[e + 11]] + A[i[e + 12]] + A[i[e + 13]] + A[i[e + 14]] + A[i[e + 15]]).toLowerCase();
8617
+ return (S[i[e + 0]] + S[i[e + 1]] + S[i[e + 2]] + S[i[e + 3]] + "-" + S[i[e + 4]] + S[i[e + 5]] + "-" + S[i[e + 6]] + S[i[e + 7]] + "-" + S[i[e + 8]] + S[i[e + 9]] + "-" + S[i[e + 10]] + S[i[e + 11]] + S[i[e + 12]] + S[i[e + 13]] + S[i[e + 14]] + S[i[e + 15]]).toLowerCase();
8618
8618
  }
8619
8619
  var c1, N5 = new Uint8Array(16);
8620
8620
  function x5() {
@@ -8639,8 +8639,8 @@ const M5 = "City", y5 = {
8639
8639
  placeholder: b5
8640
8640
  };
8641
8641
  function _5(i, e = 500) {
8642
- const t = n1();
8643
- return Z(() => () => {
8642
+ const t = r1();
8643
+ return W(() => () => {
8644
8644
  t.current && clearTimeout(t.current);
8645
8645
  }, []), (...s) => {
8646
8646
  const l = setTimeout(() => {
@@ -8649,7 +8649,7 @@ function _5(i, e = 500) {
8649
8649
  clearTimeout(t.current), t.current = l;
8650
8650
  };
8651
8651
  }
8652
- W.use(p5).init({
8652
+ A.use(p5).init({
8653
8653
  defaultNS: "common",
8654
8654
  lng: "en",
8655
8655
  resources: {
@@ -8666,60 +8666,60 @@ const P1 = {
8666
8666
  offset: 0
8667
8667
  }, W5 = f1(
8668
8668
  ({ width: i, selectedCountry: e, onChange: t, value: o, id: s, disabled: l }, c) => {
8669
- const [r, d] = B([]), [g, a] = B(P1), [h, C] = B(null), [p, w] = B([]), [, v] = B(!1), N = n1(e), { locale: b, axiosPeople: R } = r1(ce);
8669
+ const [r, d] = O([]), [g, a] = O(P1), [h, C] = O(null), [p, w] = O([]), [N, v] = O(!1), [E, M] = O(!1), H = r1(e), { locale: L, axiosPeople: R } = l1(ce);
8670
8670
  if (!R)
8671
8671
  throw new Error(
8672
8672
  `CitySelect requires "axiosPeople" to fetch cities.
8673
8673
  Please provide it via SNMTUiContext.`
8674
8674
  );
8675
- const { t: _ } = L5("common", { lng: b }), L = G(
8676
- async (S) => {
8677
- v(!0);
8675
+ const { t: b } = L5("common", { lng: L }), x = G(
8676
+ async (y) => {
8677
+ y ? M(!0) : v(!0);
8678
8678
  try {
8679
8679
  const I = {
8680
8680
  offset: g.offset,
8681
8681
  limit: g.limit
8682
8682
  };
8683
- e && e.length > 0 && (I.countryId = e), S && (I.search = S);
8684
- const O = await R.post("v1/cities/search", I), H = (O == null ? void 0 : O.data.data) || [], U = O == null ? void 0 : O.data.metadata.count, F = H.map((j) => ({
8683
+ e && e.length > 0 && (I.countryId = e), y && (I.search = y);
8684
+ const B = await R.post("v1/cities/search", I), D = (B == null ? void 0 : B.data.data) || [], P = B == null ? void 0 : B.data.metadata.count, F = D.map(($) => ({
8685
8685
  key: K1(),
8686
- label: j.name,
8687
- value: j.geoNameId
8686
+ label: $.name,
8687
+ value: $.geoNameId
8688
8688
  }));
8689
8689
  d(
8690
- (j) => g.offset === 0 ? F : [...j, ...F]
8691
- ), w(H), C(U);
8690
+ ($) => g.offset === 0 ? F : [...$, ...F]
8691
+ ), w(D), C(P);
8692
8692
  } finally {
8693
- v(!1);
8693
+ v(!1), M(!1);
8694
8694
  }
8695
8695
  },
8696
8696
  [R, g, e]
8697
8697
  );
8698
- Z(() => {
8698
+ W(() => {
8699
8699
  a(P1);
8700
- }, [e]), Z(() => {
8701
- L();
8702
- }, [L, e]), Z(() => {
8700
+ }, [e]), W(() => {
8701
+ x();
8702
+ }, [x, e]), W(() => {
8703
8703
  t("");
8704
- const S = p.map((I) => ({
8704
+ const y = p.map((I) => ({
8705
8705
  key: K1(),
8706
8706
  label: I.name,
8707
8707
  value: I.geoNameId
8708
8708
  }));
8709
8709
  d(
8710
- (I) => g.offset === 0 ? S : [...I, ...S]
8711
- ), N.current = e, o && t(o);
8710
+ (I) => g.offset === 0 ? y : [...I, ...y]
8711
+ ), H.current = e, o && t(o);
8712
8712
  }, [e, t, o, p, g.offset]);
8713
- const M = _5(L), y = G(
8714
- (S) => {
8715
- a((I) => ({ ...I, offset: 0, search: S })), M(S);
8713
+ const Z = _5(x), J = G(
8714
+ (y) => {
8715
+ a((I) => ({ ...I, offset: 0, search: y })), M(!0), Z(y);
8716
8716
  },
8717
- [M]
8718
- ), x = async (S) => {
8719
- const { target: I } = S;
8720
- I.scrollTop + I.offsetHeight >= I.scrollHeight - 50 && h !== null && h > 0 && a((O) => ({
8721
- ...O,
8722
- offset: O.offset + O.limit
8717
+ [Z]
8718
+ ), U = async (y) => {
8719
+ const { target: I } = y;
8720
+ I.scrollTop + I.offsetHeight >= I.scrollHeight - 50 && h !== null && h > 0 && a((B) => ({
8721
+ ...B,
8722
+ offset: B.offset + B.limit
8723
8723
  }));
8724
8724
  };
8725
8725
  return /* @__PURE__ */ n("div", { className: "snmt-city-select", children: /* @__PURE__ */ n(
@@ -8732,10 +8732,11 @@ const P1 = {
8732
8732
  ref: c,
8733
8733
  search: !0,
8734
8734
  value: o,
8735
- onSearchChange: y,
8736
- placeholder: _("placeholder"),
8737
- onPopupScroll: x,
8738
- disabled: l
8735
+ onSearchChange: J,
8736
+ placeholder: b("placeholder"),
8737
+ onPopupScroll: U,
8738
+ disabled: l,
8739
+ isLoading: N || E
8739
8740
  }
8740
8741
  ) });
8741
8742
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@snmt-react-ui/city-select",
3
3
  "private": false,
4
- "version": "2.2.1",
4
+ "version": "2.3.0",
5
5
  "type": "module",
6
6
  "main": "dist/city-select.js",
7
7
  "types": "dist/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@snmt-react-ui/core": "^2.1.0",
22
- "@snmt-react-ui/select": "^1.12.0",
22
+ "@snmt-react-ui/select": "^1.13.0",
23
23
  "i18next": "^23.11.5",
24
24
  "react-i18next": "^14.1.1",
25
25
  "uuid": "^10.0.0"
@@ -27,5 +27,5 @@
27
27
  "peerDependencies": {
28
28
  "antd": "^5.22.0"
29
29
  },
30
- "gitHead": "7be922c2cfdfbbba8daf541f78bb957ac462cdc5"
30
+ "gitHead": "1c62f906731e5202b370cd64a425b97b796e3f47"
31
31
  }