@snmt-react-ui/user-select 2.5.11 → 2.6.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.
- package/dist/UserSelect.d.ts +3 -0
- package/dist/user-select.js +505 -502
- package/package.json +2 -2
package/dist/user-select.js
CHANGED
|
@@ -3,7 +3,7 @@ var ue = (i, e, t) => e in i ? ge(i, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var V1 = (i, e, t) => ue(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { jsx as o, Fragment as n1, jsxs as u } from "react/jsx-runtime";
|
|
6
|
-
import { createContext as o1, forwardRef as k1, useState as j, useRef as X, useEffect as
|
|
6
|
+
import { createContext as o1, forwardRef as k1, useState as j, useRef as X, useEffect as K, useCallback as T, useImperativeHandle as Ce, useContext as e1 } from "react";
|
|
7
7
|
import { Select as pe, Flex as fe, Avatar as we, Checkbox as me, Typography as ke, Tag as Le, Popover as ve } from "antd";
|
|
8
8
|
import { SNMTUiContext as Ne } from "@snmt-react-ui/core";
|
|
9
9
|
var xe = Object.defineProperty, Re = (i, e, t) => e in i ? xe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Me = (i, e, t) => Re(i, e + "", t), ye = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -41,9 +41,9 @@ const q1 = (i, e) => () => {
|
|
|
41
41
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
42
42
|
const s = e.languages[0], n = e.options ? e.options.fallbackLng : !1, a = e.languages[e.languages.length - 1];
|
|
43
43
|
if (s.toLowerCase() === "cimode") return !0;
|
|
44
|
-
const c = (r,
|
|
45
|
-
const
|
|
46
|
-
return
|
|
44
|
+
const c = (r, d) => {
|
|
45
|
+
const g = e.services.backendConnector.state[`${r}|${d}`];
|
|
46
|
+
return g === -1 || g === 2;
|
|
47
47
|
};
|
|
48
48
|
return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !c(e.isLanguageChangingTo, i) ? !1 : !!(e.hasResourceBundle(s, i) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || c(s, i) && (!n || c(a, i)));
|
|
49
49
|
}, _e = function(i, e) {
|
|
@@ -101,10 +101,10 @@ class De {
|
|
|
101
101
|
}
|
|
102
102
|
const Te = (i, e) => {
|
|
103
103
|
const t = X();
|
|
104
|
-
return
|
|
104
|
+
return K(() => {
|
|
105
105
|
t.current = i;
|
|
106
106
|
}, [i, e]), t.current;
|
|
107
|
-
}, X1 = (i, e, t, s) => i.getFixedT(e, t, s), Ge = (i, e, t, s) =>
|
|
107
|
+
}, X1 = (i, e, t, s) => i.getFixedT(e, t, s), Ge = (i, e, t, s) => T(X1(i, e, t, s), [i, e, t, s]), Ke = function(i) {
|
|
108
108
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
109
109
|
const {
|
|
110
110
|
i18n: t
|
|
@@ -114,7 +114,7 @@ const Te = (i, e) => {
|
|
|
114
114
|
} = e1(je) || {}, a = t || s || We();
|
|
115
115
|
if (a && !a.reportNamespaces && (a.reportNamespaces = new De()), !a) {
|
|
116
116
|
M1("You will need to pass in an i18next instance by using initReactI18next");
|
|
117
|
-
const f = (
|
|
117
|
+
const f = (b, w) => Q(w) ? w : He(w) && Q(w.defaultValue) ? w.defaultValue : Array.isArray(b) ? b[b.length - 1] : b, R = [f, {}, !1];
|
|
118
118
|
return R.t = f, R.i18n = {}, R.ready = !1, R;
|
|
119
119
|
}
|
|
120
120
|
a.options.react && a.options.react.wait !== void 0 && M1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
@@ -124,37 +124,37 @@ const Te = (i, e) => {
|
|
|
124
124
|
...e
|
|
125
125
|
}, {
|
|
126
126
|
useSuspense: r,
|
|
127
|
-
keyPrefix:
|
|
127
|
+
keyPrefix: d
|
|
128
128
|
} = c;
|
|
129
|
-
let
|
|
130
|
-
|
|
131
|
-
const l = (a.isInitialized || a.initializedStoreOnce) &&
|
|
132
|
-
let
|
|
133
|
-
e.lng && (
|
|
134
|
-
const E = Te(
|
|
135
|
-
|
|
129
|
+
let g = i;
|
|
130
|
+
g = Q(g) ? [g] : g || ["translation"], a.reportNamespaces.addUsedNamespaces && a.reportNamespaces.addUsedNamespaces(g);
|
|
131
|
+
const l = (a.isInitialized || a.initializedStoreOnce) && g.every((f) => _e(f, a, c)), h = Ge(a, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), C = () => h, p = () => X1(a, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [k, N] = j(C);
|
|
132
|
+
let m = g.join();
|
|
133
|
+
e.lng && (m = `${e.lng}${m}`);
|
|
134
|
+
const E = Te(m), x = X(!0);
|
|
135
|
+
K(() => {
|
|
136
136
|
const {
|
|
137
137
|
bindI18n: f,
|
|
138
138
|
bindI18nStore: R
|
|
139
139
|
} = c;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}) : S1(a,
|
|
143
|
-
|
|
144
|
-
})), l && E && E !==
|
|
145
|
-
const
|
|
146
|
-
|
|
140
|
+
x.current = !0, !l && !r && (e.lng ? O1(a, e.lng, g, () => {
|
|
141
|
+
x.current && N(p);
|
|
142
|
+
}) : S1(a, g, () => {
|
|
143
|
+
x.current && N(p);
|
|
144
|
+
})), l && E && E !== m && x.current && N(p);
|
|
145
|
+
const b = () => {
|
|
146
|
+
x.current && N(p);
|
|
147
147
|
};
|
|
148
|
-
return f && a && a.on(f,
|
|
149
|
-
|
|
148
|
+
return f && a && a.on(f, b), R && a && a.store.on(R, b), () => {
|
|
149
|
+
x.current = !1, f && a && f.split(" ").forEach((w) => a.off(w, b)), R && a && R.split(" ").forEach((w) => a.store.off(w, b));
|
|
150
150
|
};
|
|
151
|
-
}, [a,
|
|
152
|
-
|
|
153
|
-
}, [a,
|
|
154
|
-
const _ = [
|
|
155
|
-
if (_.t =
|
|
151
|
+
}, [a, m]), K(() => {
|
|
152
|
+
x.current && l && N(C);
|
|
153
|
+
}, [a, d, l]);
|
|
154
|
+
const _ = [k, a, l];
|
|
155
|
+
if (_.t = k, _.i18n = a, _.ready = l, l || !l && !r) return _;
|
|
156
156
|
throw new Promise((f) => {
|
|
157
|
-
e.lng ? O1(a, e.lng,
|
|
157
|
+
e.lng ? O1(a, e.lng, g, () => f()) : S1(a, g, () => f());
|
|
158
158
|
});
|
|
159
159
|
}, u1 = ({
|
|
160
160
|
children: i,
|
|
@@ -206,9 +206,9 @@ const $e = ({
|
|
|
206
206
|
disabled: n = !1,
|
|
207
207
|
disableUncheck: a = !1
|
|
208
208
|
}) => {
|
|
209
|
-
const [c, r] = j(i), [
|
|
210
|
-
|
|
211
|
-
r(i),
|
|
209
|
+
const [c, r] = j(i), [d, g] = j(e);
|
|
210
|
+
K(() => {
|
|
211
|
+
r(i), g(e);
|
|
212
212
|
}, [i, e]);
|
|
213
213
|
const { theme: l } = e1(_1);
|
|
214
214
|
return /* @__PURE__ */ o(
|
|
@@ -216,9 +216,9 @@ const $e = ({
|
|
|
216
216
|
{
|
|
217
217
|
className: `snmt-checkbox snmt-checkbox-${l}`,
|
|
218
218
|
checked: c,
|
|
219
|
-
indeterminate:
|
|
219
|
+
indeterminate: d,
|
|
220
220
|
onChange: (h) => {
|
|
221
|
-
a && c || (
|
|
221
|
+
a && c || (g(!1), r(h.target.checked), s && s(h));
|
|
222
222
|
},
|
|
223
223
|
disabled: n,
|
|
224
224
|
children: t
|
|
@@ -3283,13 +3283,13 @@ const Fe = ({
|
|
|
3283
3283
|
disabled: a = !1,
|
|
3284
3284
|
onClick: c
|
|
3285
3285
|
}) => {
|
|
3286
|
-
const [r,
|
|
3287
|
-
return
|
|
3286
|
+
const [r, d] = j(n), { theme: g } = e1(ee), l = a ? g && g === "dark" ? M.GREY_LIGHT_4 : M.GREY_DARK_1 : s, h = a ? void 0 : c;
|
|
3287
|
+
return K(() => {
|
|
3288
3288
|
if (n) {
|
|
3289
|
-
h && !a &&
|
|
3289
|
+
h && !a && d(`${n} clickable`);
|
|
3290
3290
|
return;
|
|
3291
3291
|
}
|
|
3292
|
-
h && !a &&
|
|
3292
|
+
h && !a && d("clickable");
|
|
3293
3293
|
}, [h, n, a]), /* @__PURE__ */ o(n1, { children: (() => {
|
|
3294
3294
|
switch (i) {
|
|
3295
3295
|
case "nextIcon":
|
|
@@ -3551,12 +3551,12 @@ const Fe = ({
|
|
|
3551
3551
|
collapsed: a,
|
|
3552
3552
|
whiteSpace: c = "normal"
|
|
3553
3553
|
}, r) => {
|
|
3554
|
-
const
|
|
3555
|
-
let
|
|
3556
|
-
return i && i !== "inherit" && (
|
|
3554
|
+
const d = e === "h1" || e === "h2" || e === "h3" || e === "h4";
|
|
3555
|
+
let g = `snmt-typography snmt-typography-${e}`;
|
|
3556
|
+
return i && i !== "inherit" && (g += ` snmt-typography-align-${i}`), a && (g += " collapsed"), d ? /* @__PURE__ */ o(
|
|
3557
3557
|
N2,
|
|
3558
3558
|
{
|
|
3559
|
-
className:
|
|
3559
|
+
className: g,
|
|
3560
3560
|
style: { color: t, whiteSpace: c },
|
|
3561
3561
|
onClick: n,
|
|
3562
3562
|
level: R2[e],
|
|
@@ -3566,7 +3566,7 @@ const Fe = ({
|
|
|
3566
3566
|
) : /* @__PURE__ */ o(
|
|
3567
3567
|
x2,
|
|
3568
3568
|
{
|
|
3569
|
-
className:
|
|
3569
|
+
className: g,
|
|
3570
3570
|
style: { color: t, whiteSpace: c },
|
|
3571
3571
|
onClick: n,
|
|
3572
3572
|
ref: r,
|
|
@@ -6633,13 +6633,13 @@ const y2 = ({
|
|
|
6633
6633
|
disabled: a = !1,
|
|
6634
6634
|
onClick: c
|
|
6635
6635
|
}) => {
|
|
6636
|
-
const [r,
|
|
6637
|
-
return
|
|
6636
|
+
const [r, d] = j(n), { theme: g } = e1(te), l = a ? g && g === "dark" ? y.GREY_LIGHT_4 : y.GREY_DARK_1 : s, h = a ? void 0 : c;
|
|
6637
|
+
return K(() => {
|
|
6638
6638
|
if (n) {
|
|
6639
|
-
h && !a &&
|
|
6639
|
+
h && !a && d(`${n} clickable`);
|
|
6640
6640
|
return;
|
|
6641
6641
|
}
|
|
6642
|
-
h && !a &&
|
|
6642
|
+
h && !a && d("clickable");
|
|
6643
6643
|
}, [h, n, a]), /* @__PURE__ */ o(n1, { children: (() => {
|
|
6644
6644
|
switch (i) {
|
|
6645
6645
|
case "nextIcon":
|
|
@@ -6949,8 +6949,8 @@ const ie = ({
|
|
|
6949
6949
|
trigger: "click",
|
|
6950
6950
|
overlayClassName: `snmt-popover ${a ? "" : "padding"}`,
|
|
6951
6951
|
open: t ?? c,
|
|
6952
|
-
onOpenChange: (
|
|
6953
|
-
r(
|
|
6952
|
+
onOpenChange: (d) => {
|
|
6953
|
+
r(d), s == null || s(d);
|
|
6954
6954
|
},
|
|
6955
6955
|
children: /* @__PURE__ */ o("div", { className: "wrapper", children: i })
|
|
6956
6956
|
}
|
|
@@ -6976,14 +6976,14 @@ const r3 = ({
|
|
|
6976
6976
|
options: a,
|
|
6977
6977
|
extraOptions: c
|
|
6978
6978
|
}) => {
|
|
6979
|
-
const { locale: r } = e1(_1), { t:
|
|
6980
|
-
if (
|
|
6979
|
+
const { locale: r } = e1(_1), { t: d } = Ke("common", { lng: r }), [g, l] = j(!1);
|
|
6980
|
+
if (K(() => {
|
|
6981
6981
|
i.length || l(!1);
|
|
6982
6982
|
}, [i]), !i.length)
|
|
6983
6983
|
return null;
|
|
6984
6984
|
const h = (C) => {
|
|
6985
|
-
var p,
|
|
6986
|
-
return ((p = a == null ? void 0 : a.find((N) => N.value === C)) == null ? void 0 : p.label) || ((
|
|
6985
|
+
var p, k;
|
|
6986
|
+
return ((p = a == null ? void 0 : a.find((N) => N.value === C)) == null ? void 0 : p.label) || ((k = c == null ? void 0 : c.find((N) => N.value === C)) == null ? void 0 : k.label) || C;
|
|
6987
6987
|
};
|
|
6988
6988
|
return /* @__PURE__ */ u(
|
|
6989
6989
|
n3,
|
|
@@ -7002,12 +7002,12 @@ const r3 = ({
|
|
|
7002
7002
|
)) }) })
|
|
7003
7003
|
),
|
|
7004
7004
|
placement: "bottomRight",
|
|
7005
|
-
isOpen:
|
|
7005
|
+
isOpen: g,
|
|
7006
7006
|
setIsOpen: l,
|
|
7007
7007
|
children: [
|
|
7008
7008
|
i.length,
|
|
7009
7009
|
" ",
|
|
7010
|
-
|
|
7010
|
+
d("more")
|
|
7011
7011
|
]
|
|
7012
7012
|
}
|
|
7013
7013
|
);
|
|
@@ -7029,105 +7029,105 @@ const r3 = ({
|
|
|
7029
7029
|
options: a,
|
|
7030
7030
|
width: c,
|
|
7031
7031
|
disabled: r = !1,
|
|
7032
|
-
required:
|
|
7033
|
-
clearable:
|
|
7032
|
+
required: d = !1,
|
|
7033
|
+
clearable: g = !1,
|
|
7034
7034
|
scrollThresholdValue: l = 50,
|
|
7035
7035
|
onSearchChange: h,
|
|
7036
7036
|
onDropdownVisibleChange: C,
|
|
7037
7037
|
onScrollToEnd: p,
|
|
7038
|
-
onPopupScroll:
|
|
7038
|
+
onPopupScroll: k,
|
|
7039
7039
|
id: N,
|
|
7040
|
-
extraOptions:
|
|
7040
|
+
extraOptions: m,
|
|
7041
7041
|
dropdownRender: E,
|
|
7042
|
-
optionRender:
|
|
7042
|
+
optionRender: x,
|
|
7043
7043
|
isLoading: _,
|
|
7044
7044
|
readOnly: f
|
|
7045
7045
|
}, R) => {
|
|
7046
|
-
const [
|
|
7047
|
-
|
|
7048
|
-
|
|
7046
|
+
const [b, w] = j(!1), [I, Z] = j(!1), [D, S] = j(!0), [H, P] = j(i), A = X(null);
|
|
7047
|
+
K(() => {
|
|
7048
|
+
P(i);
|
|
7049
7049
|
}, [i]);
|
|
7050
|
-
const
|
|
7051
|
-
w(
|
|
7052
|
-
},
|
|
7053
|
-
var
|
|
7054
|
-
return !!((
|
|
7050
|
+
const V = (v) => {
|
|
7051
|
+
w(v), C && C(v);
|
|
7052
|
+
}, $ = (v, O) => {
|
|
7053
|
+
var F;
|
|
7054
|
+
return !!((F = O == null ? void 0 : O.label) != null && F.toString().toLowerCase().includes(v.toLowerCase()));
|
|
7055
7055
|
}, t1 = () => {
|
|
7056
|
-
|
|
7057
|
-
},
|
|
7058
|
-
|
|
7059
|
-
},
|
|
7060
|
-
(
|
|
7061
|
-
if (
|
|
7062
|
-
const
|
|
7063
|
-
e == null || e(
|
|
7056
|
+
Z(!0);
|
|
7057
|
+
}, W = () => {
|
|
7058
|
+
Z(!1);
|
|
7059
|
+
}, B = T(
|
|
7060
|
+
(v) => {
|
|
7061
|
+
if (P(v), s) {
|
|
7062
|
+
const F = v;
|
|
7063
|
+
e == null || e(F);
|
|
7064
7064
|
return;
|
|
7065
7065
|
}
|
|
7066
|
-
const
|
|
7067
|
-
e == null || e(
|
|
7066
|
+
const O = v;
|
|
7067
|
+
e == null || e(O);
|
|
7068
7068
|
},
|
|
7069
7069
|
[s, e]
|
|
7070
|
-
), U =
|
|
7070
|
+
), U = T(() => {
|
|
7071
7071
|
if (!f) {
|
|
7072
7072
|
if (s) {
|
|
7073
|
-
|
|
7073
|
+
B([]);
|
|
7074
7074
|
return;
|
|
7075
7075
|
}
|
|
7076
|
-
|
|
7076
|
+
B("");
|
|
7077
7077
|
}
|
|
7078
|
-
}, [
|
|
7079
|
-
(
|
|
7080
|
-
const
|
|
7081
|
-
|
|
7078
|
+
}, [B, s, f]), z = T(
|
|
7079
|
+
(v) => {
|
|
7080
|
+
const O = H.filter((F) => F !== v);
|
|
7081
|
+
B(O), P(O);
|
|
7082
7082
|
},
|
|
7083
|
-
[
|
|
7084
|
-
), H1 =
|
|
7085
|
-
(
|
|
7083
|
+
[B, H]
|
|
7084
|
+
), H1 = T(
|
|
7085
|
+
(v) => (H == null ? void 0 : H.indexOf(v)) === 0 ? (
|
|
7086
7086
|
// if the search input is empty
|
|
7087
7087
|
// then display the placeholder, else do not display it
|
|
7088
|
-
/* @__PURE__ */ o("span", { className: "custom-placeholder", children:
|
|
7088
|
+
/* @__PURE__ */ o("span", { className: "custom-placeholder", children: D ? t : "" })
|
|
7089
7089
|
) : /* @__PURE__ */ o(n1, {}),
|
|
7090
|
-
[
|
|
7091
|
-
), le = (
|
|
7092
|
-
|
|
7093
|
-
}, he = async (
|
|
7094
|
-
const { target:
|
|
7095
|
-
|
|
7096
|
-
}, v1 =
|
|
7097
|
-
(
|
|
7098
|
-
var
|
|
7099
|
-
return ((
|
|
7100
|
-
(N1) => N1.value ===
|
|
7101
|
-
)) == null ? void 0 :
|
|
7090
|
+
[D, H, t]
|
|
7091
|
+
), le = (v) => {
|
|
7092
|
+
v.preventDefault(), v.stopPropagation();
|
|
7093
|
+
}, he = async (v) => {
|
|
7094
|
+
const { target: O } = v;
|
|
7095
|
+
O.scrollTop + O.offsetHeight >= O.scrollHeight - l && (p == null || p(!0)), k && await k(v);
|
|
7096
|
+
}, v1 = T(
|
|
7097
|
+
(v) => {
|
|
7098
|
+
var O, F;
|
|
7099
|
+
return ((O = a.find((N1) => N1.value === v)) == null ? void 0 : O.label) || ((F = m == null ? void 0 : m.find(
|
|
7100
|
+
(N1) => N1.value === v
|
|
7101
|
+
)) == null ? void 0 : F.label) || v;
|
|
7102
7102
|
},
|
|
7103
|
-
[
|
|
7104
|
-
), ce =
|
|
7105
|
-
(
|
|
7106
|
-
var
|
|
7103
|
+
[m, a]
|
|
7104
|
+
), ce = T(
|
|
7105
|
+
(v) => {
|
|
7106
|
+
var O;
|
|
7107
7107
|
return /* @__PURE__ */ o(
|
|
7108
7108
|
r3,
|
|
7109
7109
|
{
|
|
7110
|
-
values:
|
|
7110
|
+
values: v,
|
|
7111
7111
|
onTagClose: z,
|
|
7112
|
-
maxWidth: ((
|
|
7112
|
+
maxWidth: ((O = A.current) == null ? void 0 : O.clientWidth) || 0,
|
|
7113
7113
|
disabled: r,
|
|
7114
7114
|
closable: !f,
|
|
7115
7115
|
options: a,
|
|
7116
|
-
extraOptions:
|
|
7116
|
+
extraOptions: m
|
|
7117
7117
|
}
|
|
7118
7118
|
);
|
|
7119
7119
|
},
|
|
7120
|
-
[r,
|
|
7121
|
-
), de =
|
|
7122
|
-
({ label:
|
|
7120
|
+
[r, m, z, a, f]
|
|
7121
|
+
), de = T(
|
|
7122
|
+
({ label: v, value: O, mode: F }) => F === "filter" ? H1(O) : /* @__PURE__ */ o("div", { onMouseDown: le, className: "tag-wrapper", children: /* @__PURE__ */ o(ie, { onClose: () => z(O), disabled: r, children: typeof v == "object" ? v : v1(O) }) }),
|
|
7123
7123
|
[r, v1, z, H1]
|
|
7124
7124
|
);
|
|
7125
7125
|
return /* @__PURE__ */ u(
|
|
7126
7126
|
"div",
|
|
7127
7127
|
{
|
|
7128
|
-
className: `snmt-select ${
|
|
7128
|
+
className: `snmt-select ${I ? "snmt-select-focused" : ""}
|
|
7129
7129
|
${s ? "" : "snmt-select-single"} ${f ? "snmt-select-read-only" : ""}`,
|
|
7130
|
-
ref:
|
|
7130
|
+
ref: A,
|
|
7131
7131
|
style: { width: c },
|
|
7132
7132
|
children: [
|
|
7133
7133
|
/* @__PURE__ */ o(
|
|
@@ -7138,28 +7138,28 @@ const r3 = ({
|
|
|
7138
7138
|
id: N,
|
|
7139
7139
|
ref: R,
|
|
7140
7140
|
showSearch: !!n,
|
|
7141
|
-
filterOption: n &&
|
|
7142
|
-
onDropdownVisibleChange:
|
|
7143
|
-
placeholder: t ?
|
|
7141
|
+
filterOption: n && $,
|
|
7142
|
+
onDropdownVisibleChange: V,
|
|
7143
|
+
placeholder: t ? d ? `${t}*` : t : void 0,
|
|
7144
7144
|
disabled: r,
|
|
7145
|
-
value:
|
|
7146
|
-
labelRender: (
|
|
7145
|
+
value: H || void 0,
|
|
7146
|
+
labelRender: (v) => v1(v.value),
|
|
7147
7147
|
mode: s === "filter" ? "multiple" : s,
|
|
7148
|
-
onChange:
|
|
7148
|
+
onChange: B,
|
|
7149
7149
|
onFocus: t1,
|
|
7150
|
-
onBlur:
|
|
7151
|
-
onSearch: (
|
|
7152
|
-
|
|
7150
|
+
onBlur: W,
|
|
7151
|
+
onSearch: (v) => {
|
|
7152
|
+
S(!v), h && h(v);
|
|
7153
7153
|
},
|
|
7154
|
-
onSelect: () =>
|
|
7155
|
-
onDeselect: () =>
|
|
7156
|
-
tagRender: (
|
|
7154
|
+
onSelect: () => S(!0),
|
|
7155
|
+
onDeselect: () => S(!0),
|
|
7156
|
+
tagRender: (v) => de({ ...v, mode: s }),
|
|
7157
7157
|
maxTagCount: "responsive",
|
|
7158
7158
|
maxTagPlaceholder: ce,
|
|
7159
7159
|
onPopupScroll: he,
|
|
7160
7160
|
prefix: _ && /* @__PURE__ */ o(A1, { size: 15 }),
|
|
7161
7161
|
suffixIcon: /* @__PURE__ */ o("div", { className: "wrapper-suffix-icon", children: s !== "filter" && /* @__PURE__ */ u(n1, { children: [
|
|
7162
|
-
|
|
7162
|
+
H && !!H.length && (s || g) && /* @__PURE__ */ o("div", { onClick: U, children: /* @__PURE__ */ o(
|
|
7163
7163
|
d1,
|
|
7164
7164
|
{
|
|
7165
7165
|
name: "cancel",
|
|
@@ -7171,27 +7171,27 @@ const r3 = ({
|
|
|
7171
7171
|
{
|
|
7172
7172
|
name: "selectArrowIcon",
|
|
7173
7173
|
color: r ? J.GREY_DARK_1 : J.GREY_DARK_5,
|
|
7174
|
-
className:
|
|
7175
|
-
onClick: () => w(!
|
|
7174
|
+
className: b ? "select-arrow-rotated" : "select-arrow",
|
|
7175
|
+
onClick: () => w(!b)
|
|
7176
7176
|
}
|
|
7177
7177
|
)
|
|
7178
7178
|
] }) }),
|
|
7179
7179
|
removeIcon: /* @__PURE__ */ o(d1, { name: "errorSmall", color: J.GREY_DARK_2 }),
|
|
7180
7180
|
options: a,
|
|
7181
|
-
optionRender: (
|
|
7181
|
+
optionRender: (v) => x ? x(v.data) : /* @__PURE__ */ u(u1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
|
|
7182
7182
|
/* @__PURE__ */ u(u1, { alignItems: "center", gap: 12, children: [
|
|
7183
7183
|
s && /* @__PURE__ */ o(
|
|
7184
7184
|
$e,
|
|
7185
7185
|
{
|
|
7186
|
-
checked: !!(
|
|
7186
|
+
checked: !!(H != null && H.includes(v.value))
|
|
7187
7187
|
}
|
|
7188
7188
|
),
|
|
7189
7189
|
/* @__PURE__ */ u(u1, { alignItems: "center", gap: 8, children: [
|
|
7190
|
-
|
|
7191
|
-
/* @__PURE__ */ o("span", { children:
|
|
7190
|
+
v.data.image && /* @__PURE__ */ o(Pe, { src: v.data.image, size: 20 }),
|
|
7191
|
+
/* @__PURE__ */ o("span", { children: v.label })
|
|
7192
7192
|
] })
|
|
7193
7193
|
] }),
|
|
7194
|
-
!s &&
|
|
7194
|
+
!s && H === v.value && /* @__PURE__ */ o(
|
|
7195
7195
|
d1,
|
|
7196
7196
|
{
|
|
7197
7197
|
name: "ok",
|
|
@@ -7211,17 +7211,17 @@ const r3 = ({
|
|
|
7211
7211
|
},
|
|
7212
7212
|
children: /* @__PURE__ */ o(A1, { size: 28 })
|
|
7213
7213
|
}
|
|
7214
|
-
) : (
|
|
7214
|
+
) : (v) => E ? E(v) : v
|
|
7215
7215
|
}
|
|
7216
7216
|
),
|
|
7217
7217
|
/* @__PURE__ */ o(
|
|
7218
7218
|
"fieldset",
|
|
7219
7219
|
{
|
|
7220
|
-
className: `${
|
|
7220
|
+
className: `${I ? "fieldset-focused" : ""}
|
|
7221
7221
|
${r ? "fieldset-disabled" : ""}
|
|
7222
7222
|
${typeof i == "string" && i ? "fieldset-filled" : ""}
|
|
7223
7223
|
${typeof i == "object" && i != null && i.length ? "fieldset-filled" : ""}`,
|
|
7224
|
-
children: /* @__PURE__ */ o("legend", { children: t ? /* @__PURE__ */ o("span", { children:
|
|
7224
|
+
children: /* @__PURE__ */ o("legend", { children: t ? /* @__PURE__ */ o("span", { children: d ? `${t}*` : t }) : "" })
|
|
7225
7225
|
}
|
|
7226
7226
|
)
|
|
7227
7227
|
]
|
|
@@ -7231,7 +7231,7 @@ const r3 = ({
|
|
|
7231
7231
|
);
|
|
7232
7232
|
function a3(i, e = 500) {
|
|
7233
7233
|
const t = X();
|
|
7234
|
-
return
|
|
7234
|
+
return K(() => () => {
|
|
7235
7235
|
t.current && clearTimeout(t.current);
|
|
7236
7236
|
}, []), (...s) => {
|
|
7237
7237
|
const n = setTimeout(() => {
|
|
@@ -7253,77 +7253,77 @@ const r1 = {
|
|
|
7253
7253
|
disabled: a,
|
|
7254
7254
|
scrollThresholdValue: c,
|
|
7255
7255
|
placeholder: r,
|
|
7256
|
-
mode:
|
|
7257
|
-
loadOnClosedState:
|
|
7256
|
+
mode: d,
|
|
7257
|
+
loadOnClosedState: g,
|
|
7258
7258
|
extraOptions: l,
|
|
7259
7259
|
onDropdownVisibleChange: h,
|
|
7260
7260
|
optionRender: C,
|
|
7261
7261
|
dropdownRender: p,
|
|
7262
|
-
readOnly:
|
|
7262
|
+
readOnly: k,
|
|
7263
7263
|
clearable: N
|
|
7264
|
-
},
|
|
7265
|
-
const [E,
|
|
7266
|
-
async (
|
|
7264
|
+
}, m) => {
|
|
7265
|
+
const [E, x] = j([]), [_, f] = j(r1), [R, b] = j(!1), [w, I] = j(null), Z = T(
|
|
7266
|
+
async (V = !1, $) => {
|
|
7267
7267
|
if (!R) {
|
|
7268
|
-
|
|
7268
|
+
b(!0);
|
|
7269
7269
|
try {
|
|
7270
|
-
const t1 =
|
|
7271
|
-
|
|
7272
|
-
(
|
|
7273
|
-
),
|
|
7274
|
-
...
|
|
7275
|
-
offset:
|
|
7270
|
+
const t1 = V ? { ...r1, search: $ } : _, W = await i(t1);
|
|
7271
|
+
x(
|
|
7272
|
+
(B) => V ? W.options : [...B, ...W.options]
|
|
7273
|
+
), I(W.count), f((B) => ({
|
|
7274
|
+
...B,
|
|
7275
|
+
offset: B.offset + B.limit
|
|
7276
7276
|
}));
|
|
7277
7277
|
} finally {
|
|
7278
|
-
|
|
7278
|
+
b(!1);
|
|
7279
7279
|
}
|
|
7280
7280
|
}
|
|
7281
7281
|
},
|
|
7282
7282
|
[_, i, R]
|
|
7283
|
-
),
|
|
7284
|
-
(
|
|
7285
|
-
|
|
7283
|
+
), D = a3(Z), S = T(
|
|
7284
|
+
(V) => {
|
|
7285
|
+
V === "" || V === void 0 || V === null ? (f(r1), D(!0)) : D(!0, V);
|
|
7286
7286
|
},
|
|
7287
|
-
[
|
|
7288
|
-
),
|
|
7289
|
-
|
|
7290
|
-
},
|
|
7291
|
-
(
|
|
7292
|
-
|
|
7287
|
+
[D]
|
|
7288
|
+
), H = async (V) => {
|
|
7289
|
+
V && w !== null && w > E.length && await Z(!1);
|
|
7290
|
+
}, P = T(
|
|
7291
|
+
(V) => {
|
|
7292
|
+
V && !g && (x([]), f(r1), Z(!0)), h == null || h(V);
|
|
7293
7293
|
},
|
|
7294
7294
|
// eslint-disable-next-line
|
|
7295
|
-
[
|
|
7295
|
+
[g]
|
|
7296
7296
|
);
|
|
7297
|
-
|
|
7298
|
-
|
|
7297
|
+
K(() => {
|
|
7298
|
+
g && Z(!1);
|
|
7299
7299
|
}, []);
|
|
7300
|
-
const
|
|
7300
|
+
const A = {
|
|
7301
7301
|
id: n,
|
|
7302
7302
|
width: e,
|
|
7303
7303
|
options: E,
|
|
7304
7304
|
onChange: t,
|
|
7305
|
-
ref:
|
|
7305
|
+
ref: m,
|
|
7306
7306
|
placeholder: r,
|
|
7307
7307
|
search: !0,
|
|
7308
7308
|
value: s,
|
|
7309
|
-
onSearchChange:
|
|
7310
|
-
onDropdownVisibleChange:
|
|
7309
|
+
onSearchChange: S,
|
|
7310
|
+
onDropdownVisibleChange: P,
|
|
7311
7311
|
scrollThresholdValue: c,
|
|
7312
|
-
onScrollToEnd:
|
|
7313
|
-
loadOnClosedState:
|
|
7312
|
+
onScrollToEnd: H,
|
|
7313
|
+
loadOnClosedState: g,
|
|
7314
7314
|
disabled: a,
|
|
7315
7315
|
extraOptions: l,
|
|
7316
7316
|
isLoading: R,
|
|
7317
7317
|
optionRender: C,
|
|
7318
7318
|
dropdownRender: p,
|
|
7319
|
-
readOnly:
|
|
7319
|
+
readOnly: k,
|
|
7320
7320
|
clearable: N
|
|
7321
7321
|
};
|
|
7322
|
-
return Ce(
|
|
7322
|
+
return Ce(m, () => ({
|
|
7323
7323
|
refetchOptions: async () => {
|
|
7324
|
-
f(r1), await
|
|
7324
|
+
f(r1), await Z(!0);
|
|
7325
7325
|
}
|
|
7326
|
-
})),
|
|
7326
|
+
})), d ? /* @__PURE__ */ o(B1, { ...A, onChange: t, value: s, mode: d }) : /* @__PURE__ */ o("div", { className: "snmt-async-select", children: /* @__PURE__ */ o(B1, { ...A, onChange: t, value: s }) });
|
|
7327
7327
|
}
|
|
7328
7328
|
);
|
|
7329
7329
|
var C1 = /* @__PURE__ */ ((i) => (i.ACTIVE = "Active", i.ARCHIVED = "Archived", i))(C1 || {});
|
|
@@ -7370,9 +7370,9 @@ const se = (i, e) => () => {
|
|
|
7370
7370
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
7371
7371
|
const s = e.languages[0], n = e.options ? e.options.fallbackLng : !1, a = e.languages[e.languages.length - 1];
|
|
7372
7372
|
if (s.toLowerCase() === "cimode") return !0;
|
|
7373
|
-
const c = (r,
|
|
7374
|
-
const
|
|
7375
|
-
return
|
|
7373
|
+
const c = (r, d) => {
|
|
7374
|
+
const g = e.services.backendConnector.state[`${r}|${d}`];
|
|
7375
|
+
return g === -1 || g === 2;
|
|
7376
7376
|
};
|
|
7377
7377
|
return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !c(e.isLanguageChangingTo, i) ? !1 : !!(e.hasResourceBundle(s, i) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || c(s, i) && (!n || c(a, i)));
|
|
7378
7378
|
}, d3 = function(i, e) {
|
|
@@ -7444,10 +7444,10 @@ class x3 {
|
|
|
7444
7444
|
}
|
|
7445
7445
|
const R3 = (i, e) => {
|
|
7446
7446
|
const t = X();
|
|
7447
|
-
return
|
|
7447
|
+
return K(() => {
|
|
7448
7448
|
t.current = i;
|
|
7449
7449
|
}, [i, e]), t.current;
|
|
7450
|
-
}, oe = (i, e, t, s) => i.getFixedT(e, t, s), M3 = (i, e, t, s) =>
|
|
7450
|
+
}, oe = (i, e, t, s) => i.getFixedT(e, t, s), M3 = (i, e, t, s) => T(oe(i, e, t, s), [i, e, t, s]), y3 = function(i) {
|
|
7451
7451
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
7452
7452
|
const {
|
|
7453
7453
|
i18n: t
|
|
@@ -7457,7 +7457,7 @@ const R3 = (i, e) => {
|
|
|
7457
7457
|
} = e1(N3) || {}, a = t || s || L3();
|
|
7458
7458
|
if (a && !a.reportNamespaces && (a.reportNamespaces = new x3()), !a) {
|
|
7459
7459
|
y1("You will need to pass in an i18next instance by using initReactI18next");
|
|
7460
|
-
const f = (
|
|
7460
|
+
const f = (b, w) => q(w) ? w : g3(w) && q(w.defaultValue) ? w.defaultValue : Array.isArray(b) ? b[b.length - 1] : b, R = [f, {}, !1];
|
|
7461
7461
|
return R.t = f, R.i18n = {}, R.ready = !1, R;
|
|
7462
7462
|
}
|
|
7463
7463
|
a.options.react && a.options.react.wait !== void 0 && y1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
@@ -7467,39 +7467,39 @@ const R3 = (i, e) => {
|
|
|
7467
7467
|
...e
|
|
7468
7468
|
}, {
|
|
7469
7469
|
useSuspense: r,
|
|
7470
|
-
keyPrefix:
|
|
7470
|
+
keyPrefix: d
|
|
7471
7471
|
} = c;
|
|
7472
|
-
let
|
|
7473
|
-
|
|
7474
|
-
const l = (a.isInitialized || a.initializedStoreOnce) &&
|
|
7475
|
-
let
|
|
7476
|
-
e.lng && (
|
|
7477
|
-
const E = R3(
|
|
7478
|
-
|
|
7472
|
+
let g = i;
|
|
7473
|
+
g = q(g) ? [g] : g || ["translation"], a.reportNamespaces.addUsedNamespaces && a.reportNamespaces.addUsedNamespaces(g);
|
|
7474
|
+
const l = (a.isInitialized || a.initializedStoreOnce) && g.every((f) => d3(f, a, c)), h = M3(a, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), C = () => h, p = () => oe(a, e.lng || null, c.nsMode === "fallback" ? g : g[0], d), [k, N] = j(C);
|
|
7475
|
+
let m = g.join();
|
|
7476
|
+
e.lng && (m = `${e.lng}${m}`);
|
|
7477
|
+
const E = R3(m), x = X(!0);
|
|
7478
|
+
K(() => {
|
|
7479
7479
|
const {
|
|
7480
7480
|
bindI18n: f,
|
|
7481
7481
|
bindI18nStore: R
|
|
7482
7482
|
} = c;
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
}) : j1(a,
|
|
7486
|
-
|
|
7487
|
-
})), l && E && E !==
|
|
7488
|
-
const
|
|
7489
|
-
|
|
7483
|
+
x.current = !0, !l && !r && (e.lng ? D1(a, e.lng, g, () => {
|
|
7484
|
+
x.current && N(p);
|
|
7485
|
+
}) : j1(a, g, () => {
|
|
7486
|
+
x.current && N(p);
|
|
7487
|
+
})), l && E && E !== m && x.current && N(p);
|
|
7488
|
+
const b = () => {
|
|
7489
|
+
x.current && N(p);
|
|
7490
7490
|
};
|
|
7491
|
-
return f && a && a.on(f,
|
|
7492
|
-
|
|
7491
|
+
return f && a && a.on(f, b), R && a && a.store.on(R, b), () => {
|
|
7492
|
+
x.current = !1, f && a && f.split(" ").forEach((w) => a.off(w, b)), R && a && R.split(" ").forEach((w) => a.store.off(w, b));
|
|
7493
7493
|
};
|
|
7494
|
-
}, [a,
|
|
7495
|
-
|
|
7496
|
-
}, [a,
|
|
7497
|
-
const _ = [
|
|
7498
|
-
if (_.t =
|
|
7494
|
+
}, [a, m]), K(() => {
|
|
7495
|
+
x.current && l && N(C);
|
|
7496
|
+
}, [a, d, l]);
|
|
7497
|
+
const _ = [k, a, l];
|
|
7498
|
+
if (_.t = k, _.i18n = a, _.ready = l, l || !l && !r) return _;
|
|
7499
7499
|
throw new Promise((f) => {
|
|
7500
|
-
e.lng ? D1(a, e.lng,
|
|
7500
|
+
e.lng ? D1(a, e.lng, g, () => f()) : j1(a, g, () => f());
|
|
7501
7501
|
});
|
|
7502
|
-
},
|
|
7502
|
+
}, L = (i) => typeof i == "string", a1 = () => {
|
|
7503
7503
|
let i, e;
|
|
7504
7504
|
const t = new Promise((s, n) => {
|
|
7505
7505
|
i = s, e = n;
|
|
@@ -7509,8 +7509,8 @@ const R3 = (i, e) => {
|
|
|
7509
7509
|
i.forEach((s) => {
|
|
7510
7510
|
e[s] && (t[s] = e[s]);
|
|
7511
7511
|
});
|
|
7512
|
-
}, E3 = /###/g, G1 = (i) => i && i.indexOf("###") > -1 ? i.replace(E3, ".") : i, K1 = (i) => !i ||
|
|
7513
|
-
const s =
|
|
7512
|
+
}, E3 = /###/g, G1 = (i) => i && i.indexOf("###") > -1 ? i.replace(E3, ".") : i, K1 = (i) => !i || L(i), h1 = (i, e, t) => {
|
|
7513
|
+
const s = L(e) ? e.split(".") : e;
|
|
7514
7514
|
let n = 0;
|
|
7515
7515
|
for (; n < s.length - 1; ) {
|
|
7516
7516
|
if (K1(i)) return {};
|
|
@@ -7552,7 +7552,7 @@ const R3 = (i, e) => {
|
|
|
7552
7552
|
return s !== void 0 ? s : p1(e, t);
|
|
7553
7553
|
}, re = (i, e, t) => {
|
|
7554
7554
|
for (const s in e)
|
|
7555
|
-
s !== "__proto__" && s !== "constructor" && (s in i ?
|
|
7555
|
+
s !== "__proto__" && s !== "constructor" && (s in i ? L(i[s]) || i[s] instanceof String || L(e[s]) || e[s] instanceof String ? t && (i[s] = e[s]) : re(i[s], e[s], t) : i[s] = e[s]);
|
|
7556
7556
|
return i;
|
|
7557
7557
|
}, i1 = (i) => i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
7558
7558
|
var V3 = {
|
|
@@ -7563,7 +7563,7 @@ var V3 = {
|
|
|
7563
7563
|
"'": "'",
|
|
7564
7564
|
"/": "/"
|
|
7565
7565
|
};
|
|
7566
|
-
const I3 = (i) =>
|
|
7566
|
+
const I3 = (i) => L(i) ? i.replace(/[&<>"'\/]/g, (e) => V3[e]) : i;
|
|
7567
7567
|
class S3 {
|
|
7568
7568
|
constructor(e) {
|
|
7569
7569
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
@@ -7597,11 +7597,11 @@ const O3 = [" ", ",", "?", "!", ";"], A3 = new S3(20), B3 = (i, e, t) => {
|
|
|
7597
7597
|
if (!n || typeof n != "object")
|
|
7598
7598
|
return;
|
|
7599
7599
|
let c, r = "";
|
|
7600
|
-
for (let
|
|
7601
|
-
if (
|
|
7602
|
-
if (["string", "number", "boolean"].indexOf(typeof c) > -1 &&
|
|
7600
|
+
for (let d = a; d < s.length; ++d)
|
|
7601
|
+
if (d !== a && (r += t), r += s[d], c = n[r], c !== void 0) {
|
|
7602
|
+
if (["string", "number", "boolean"].indexOf(typeof c) > -1 && d < s.length - 1)
|
|
7603
7603
|
continue;
|
|
7604
|
-
a +=
|
|
7604
|
+
a += d - a + 1;
|
|
7605
7605
|
break;
|
|
7606
7606
|
}
|
|
7607
7607
|
n = c;
|
|
@@ -7652,7 +7652,7 @@ class w1 {
|
|
|
7652
7652
|
return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
|
|
7653
7653
|
}
|
|
7654
7654
|
forward(e, t, s, n) {
|
|
7655
|
-
return n && !this.debug ? null : (
|
|
7655
|
+
return n && !this.debug ? null : (L(e[0]) && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
7656
7656
|
}
|
|
7657
7657
|
create(e) {
|
|
7658
7658
|
return new w1(this.logger, {
|
|
@@ -7664,7 +7664,7 @@ class w1 {
|
|
|
7664
7664
|
return e = e || this.options, e.prefix = e.prefix || this.prefix, new w1(this.logger, e);
|
|
7665
7665
|
}
|
|
7666
7666
|
}
|
|
7667
|
-
var
|
|
7667
|
+
var Y = new w1();
|
|
7668
7668
|
class L1 {
|
|
7669
7669
|
constructor() {
|
|
7670
7670
|
this.observers = {};
|
|
@@ -7689,12 +7689,12 @@ class L1 {
|
|
|
7689
7689
|
for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
7690
7690
|
s[n - 1] = arguments[n];
|
|
7691
7691
|
this.observers[e] && Array.from(this.observers[e].entries()).forEach((c) => {
|
|
7692
|
-
let [r,
|
|
7693
|
-
for (let
|
|
7692
|
+
let [r, d] = c;
|
|
7693
|
+
for (let g = 0; g < d; g++)
|
|
7694
7694
|
r(...s);
|
|
7695
7695
|
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((c) => {
|
|
7696
|
-
let [r,
|
|
7697
|
-
for (let
|
|
7696
|
+
let [r, d] = c;
|
|
7697
|
+
for (let g = 0; g < d; g++)
|
|
7698
7698
|
r.apply(r, [e, ...s]);
|
|
7699
7699
|
});
|
|
7700
7700
|
}
|
|
@@ -7718,9 +7718,9 @@ class $1 extends L1 {
|
|
|
7718
7718
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
7719
7719
|
const a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, c = n.ignoreJSONStructure !== void 0 ? n.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
7720
7720
|
let r;
|
|
7721
|
-
e.indexOf(".") > -1 ? r = e.split(".") : (r = [e, t], s && (Array.isArray(s) ? r.push(...s) :
|
|
7722
|
-
const
|
|
7723
|
-
return !
|
|
7721
|
+
e.indexOf(".") > -1 ? r = e.split(".") : (r = [e, t], s && (Array.isArray(s) ? r.push(...s) : L(s) && a ? r.push(...s.split(a)) : r.push(s)));
|
|
7722
|
+
const d = p1(this.data, r);
|
|
7723
|
+
return !d && !t && !s && e.indexOf(".") > -1 && (e = r[0], t = r[1], s = r.slice(2).join(".")), d || !c || !L(s) ? d : E1(this.data && this.data[e] && this.data[e][t], s, a);
|
|
7724
7724
|
}
|
|
7725
7725
|
addResource(e, t, s, n) {
|
|
7726
7726
|
let a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
@@ -7735,7 +7735,7 @@ class $1 extends L1 {
|
|
|
7735
7735
|
silent: !1
|
|
7736
7736
|
};
|
|
7737
7737
|
for (const a in s)
|
|
7738
|
-
(
|
|
7738
|
+
(L(s[a]) || Array.isArray(s[a])) && this.addResource(e, t, a, s[a], {
|
|
7739
7739
|
silent: !0
|
|
7740
7740
|
});
|
|
7741
7741
|
n.silent || this.emit("added", e, t, s);
|
|
@@ -7746,11 +7746,11 @@ class $1 extends L1 {
|
|
|
7746
7746
|
skipCopy: !1
|
|
7747
7747
|
}, r = [e, t];
|
|
7748
7748
|
e.indexOf(".") > -1 && (r = e.split("."), n = s, s = t, t = r[1]), this.addNamespaces(t);
|
|
7749
|
-
let
|
|
7750
|
-
c.skipCopy || (s = JSON.parse(JSON.stringify(s))), n ? re(
|
|
7751
|
-
...
|
|
7749
|
+
let d = p1(this.data, r) || {};
|
|
7750
|
+
c.skipCopy || (s = JSON.parse(JSON.stringify(s))), n ? re(d, s, a) : d = {
|
|
7751
|
+
...d,
|
|
7752
7752
|
...s
|
|
7753
|
-
}, P1(this.data, r,
|
|
7753
|
+
}, P1(this.data, r, d), c.silent || this.emit("added", e, t, s);
|
|
7754
7754
|
}
|
|
7755
7755
|
removeResourceBundle(e, t) {
|
|
7756
7756
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -7789,7 +7789,7 @@ const F1 = {};
|
|
|
7789
7789
|
class m1 extends L1 {
|
|
7790
7790
|
constructor(e) {
|
|
7791
7791
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
7792
|
-
super(), b3(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger =
|
|
7792
|
+
super(), b3(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = Y.create("translator");
|
|
7793
7793
|
}
|
|
7794
7794
|
changeLanguage(e) {
|
|
7795
7795
|
e && (this.language = e);
|
|
@@ -7810,18 +7810,18 @@ class m1 extends L1 {
|
|
|
7810
7810
|
let a = t.ns || this.options.defaultNS || [];
|
|
7811
7811
|
const c = s && e.indexOf(s) > -1, r = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !B3(e, s, n);
|
|
7812
7812
|
if (c && !r) {
|
|
7813
|
-
const
|
|
7814
|
-
if (
|
|
7813
|
+
const d = e.match(this.interpolator.nestingRegexp);
|
|
7814
|
+
if (d && d.length > 0)
|
|
7815
7815
|
return {
|
|
7816
7816
|
key: e,
|
|
7817
|
-
namespaces:
|
|
7817
|
+
namespaces: L(a) ? [a] : a
|
|
7818
7818
|
};
|
|
7819
|
-
const
|
|
7820
|
-
(s !== n || s === n && this.options.ns.indexOf(
|
|
7819
|
+
const g = e.split(s);
|
|
7820
|
+
(s !== n || s === n && this.options.ns.indexOf(g[0]) > -1) && (a = g.shift()), e = g.join(n);
|
|
7821
7821
|
}
|
|
7822
7822
|
return {
|
|
7823
7823
|
key: e,
|
|
7824
|
-
namespaces:
|
|
7824
|
+
namespaces: L(a) ? [a] : a
|
|
7825
7825
|
};
|
|
7826
7826
|
}
|
|
7827
7827
|
translate(e, t, s) {
|
|
@@ -7832,32 +7832,32 @@ class m1 extends L1 {
|
|
|
7832
7832
|
const n = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, a = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
|
|
7833
7833
|
key: c,
|
|
7834
7834
|
namespaces: r
|
|
7835
|
-
} = this.extractFromKey(e[e.length - 1], t),
|
|
7836
|
-
if (
|
|
7835
|
+
} = this.extractFromKey(e[e.length - 1], t), d = r[r.length - 1], g = t.lng || this.language, l = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
7836
|
+
if (g && g.toLowerCase() === "cimode") {
|
|
7837
7837
|
if (l) {
|
|
7838
7838
|
const f = t.nsSeparator || this.options.nsSeparator;
|
|
7839
7839
|
return n ? {
|
|
7840
|
-
res: `${
|
|
7840
|
+
res: `${d}${f}${c}`,
|
|
7841
7841
|
usedKey: c,
|
|
7842
7842
|
exactUsedKey: c,
|
|
7843
|
-
usedLng:
|
|
7844
|
-
usedNS:
|
|
7843
|
+
usedLng: g,
|
|
7844
|
+
usedNS: d,
|
|
7845
7845
|
usedParams: this.getUsedParamsDetails(t)
|
|
7846
|
-
} : `${
|
|
7846
|
+
} : `${d}${f}${c}`;
|
|
7847
7847
|
}
|
|
7848
7848
|
return n ? {
|
|
7849
7849
|
res: c,
|
|
7850
7850
|
usedKey: c,
|
|
7851
7851
|
exactUsedKey: c,
|
|
7852
|
-
usedLng:
|
|
7853
|
-
usedNS:
|
|
7852
|
+
usedLng: g,
|
|
7853
|
+
usedNS: d,
|
|
7854
7854
|
usedParams: this.getUsedParamsDetails(t)
|
|
7855
7855
|
} : c;
|
|
7856
7856
|
}
|
|
7857
7857
|
const h = this.resolve(e, t);
|
|
7858
7858
|
let C = h && h.res;
|
|
7859
|
-
const p = h && h.usedKey || c,
|
|
7860
|
-
if (
|
|
7859
|
+
const p = h && h.usedKey || c, k = h && h.exactUsedKey || c, N = Object.prototype.toString.apply(C), m = ["[object Number]", "[object Function]", "[object RegExp]"], E = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, x = !this.i18nFormat || this.i18nFormat.handleAsObject, _ = !L(C) && typeof C != "boolean" && typeof C != "number";
|
|
7860
|
+
if (x && C && _ && m.indexOf(N) < 0 && !(L(E) && Array.isArray(C))) {
|
|
7861
7861
|
if (!t.returnObjects && !this.options.returnObjects) {
|
|
7862
7862
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
7863
7863
|
const f = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, C, {
|
|
@@ -7867,53 +7867,53 @@ class m1 extends L1 {
|
|
|
7867
7867
|
return n ? (h.res = f, h.usedParams = this.getUsedParamsDetails(t), h) : f;
|
|
7868
7868
|
}
|
|
7869
7869
|
if (a) {
|
|
7870
|
-
const f = Array.isArray(C), R = f ? [] : {},
|
|
7870
|
+
const f = Array.isArray(C), R = f ? [] : {}, b = f ? k : p;
|
|
7871
7871
|
for (const w in C)
|
|
7872
7872
|
if (Object.prototype.hasOwnProperty.call(C, w)) {
|
|
7873
|
-
const
|
|
7874
|
-
R[w] = this.translate(
|
|
7873
|
+
const I = `${b}${a}${w}`;
|
|
7874
|
+
R[w] = this.translate(I, {
|
|
7875
7875
|
...t,
|
|
7876
7876
|
joinArrays: !1,
|
|
7877
7877
|
ns: r
|
|
7878
|
-
}), R[w] ===
|
|
7878
|
+
}), R[w] === I && (R[w] = C[w]);
|
|
7879
7879
|
}
|
|
7880
7880
|
C = R;
|
|
7881
7881
|
}
|
|
7882
|
-
} else if (
|
|
7882
|
+
} else if (x && L(E) && Array.isArray(C))
|
|
7883
7883
|
C = C.join(E), C && (C = this.extendTranslation(C, e, t, s));
|
|
7884
7884
|
else {
|
|
7885
7885
|
let f = !1, R = !1;
|
|
7886
|
-
const
|
|
7886
|
+
const b = t.count !== void 0 && !L(t.count), w = m1.hasDefaultValue(t), I = b ? this.pluralResolver.getSuffix(g, t.count, t) : "", Z = t.ordinal && b ? this.pluralResolver.getSuffix(g, t.count, {
|
|
7887
7887
|
ordinal: !1
|
|
7888
|
-
}) : "",
|
|
7889
|
-
!this.isValidLookup(C) && w && (f = !0, C =
|
|
7890
|
-
const
|
|
7891
|
-
if (R || f ||
|
|
7892
|
-
if (this.logger.log(
|
|
7893
|
-
const
|
|
7888
|
+
}) : "", D = b && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), S = D && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${I}`] || t[`defaultValue${Z}`] || t.defaultValue;
|
|
7889
|
+
!this.isValidLookup(C) && w && (f = !0, C = S), this.isValidLookup(C) || (R = !0, C = c);
|
|
7890
|
+
const P = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && R ? void 0 : C, A = w && S !== C && this.options.updateMissing;
|
|
7891
|
+
if (R || f || A) {
|
|
7892
|
+
if (this.logger.log(A ? "updateKey" : "missingKey", g, d, c, A ? S : C), a) {
|
|
7893
|
+
const W = this.resolve(c, {
|
|
7894
7894
|
...t,
|
|
7895
7895
|
keySeparator: !1
|
|
7896
7896
|
});
|
|
7897
|
-
|
|
7898
|
-
}
|
|
7899
|
-
let
|
|
7900
|
-
const
|
|
7901
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
7902
|
-
for (let
|
|
7903
|
-
|
|
7904
|
-
else this.options.saveMissingTo === "all" ?
|
|
7905
|
-
const t1 = (
|
|
7906
|
-
const z = w && U !== C ? U :
|
|
7907
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(
|
|
7897
|
+
W && W.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.");
|
|
7898
|
+
}
|
|
7899
|
+
let V = [];
|
|
7900
|
+
const $ = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
|
7901
|
+
if (this.options.saveMissingTo === "fallback" && $ && $[0])
|
|
7902
|
+
for (let W = 0; W < $.length; W++)
|
|
7903
|
+
V.push($[W]);
|
|
7904
|
+
else this.options.saveMissingTo === "all" ? V = this.languageUtils.toResolveHierarchy(t.lng || this.language) : V.push(t.lng || this.language);
|
|
7905
|
+
const t1 = (W, B, U) => {
|
|
7906
|
+
const z = w && U !== C ? U : P;
|
|
7907
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(W, d, B, z, A, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(W, d, B, z, A, t), this.emit("missingKey", W, d, B, C);
|
|
7908
7908
|
};
|
|
7909
|
-
this.options.saveMissing && (this.options.saveMissingPlurals &&
|
|
7910
|
-
const
|
|
7911
|
-
|
|
7912
|
-
t1([
|
|
7909
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && b ? V.forEach((W) => {
|
|
7910
|
+
const B = this.pluralResolver.getSuffixes(W, t);
|
|
7911
|
+
D && t[`defaultValue${this.options.pluralSeparator}zero`] && B.indexOf(`${this.options.pluralSeparator}zero`) < 0 && B.push(`${this.options.pluralSeparator}zero`), B.forEach((U) => {
|
|
7912
|
+
t1([W], c + U, t[`defaultValue${U}`] || S);
|
|
7913
7913
|
});
|
|
7914
|
-
}) : t1(
|
|
7914
|
+
}) : t1(V, c, S));
|
|
7915
7915
|
}
|
|
7916
|
-
C = this.extendTranslation(C, e, t, h, s), R && C === c && this.options.appendNamespaceToMissingKey && (C = `${
|
|
7916
|
+
C = this.extendTranslation(C, e, t, h, s), R && C === c && this.options.appendNamespaceToMissingKey && (C = `${d}:${c}`), (R || f) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? C = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${d}:${c}` : c, f ? C : void 0) : C = this.options.parseMissingKeyHandler(C));
|
|
7917
7917
|
}
|
|
7918
7918
|
return n ? (h.res = C, h.usedParams = this.getUsedParamsDetails(t), h) : C;
|
|
7919
7919
|
}
|
|
@@ -7934,28 +7934,28 @@ class m1 extends L1 {
|
|
|
7934
7934
|
...s.interpolation
|
|
7935
7935
|
}
|
|
7936
7936
|
});
|
|
7937
|
-
const
|
|
7937
|
+
const g = L(e) && (s && s.interpolation && s.interpolation.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
7938
7938
|
let l;
|
|
7939
|
-
if (
|
|
7939
|
+
if (g) {
|
|
7940
7940
|
const C = e.match(this.interpolator.nestingRegexp);
|
|
7941
7941
|
l = C && C.length;
|
|
7942
7942
|
}
|
|
7943
|
-
let h = s.replace && !
|
|
7943
|
+
let h = s.replace && !L(s.replace) ? s.replace : s;
|
|
7944
7944
|
if (this.options.interpolation.defaultVariables && (h = {
|
|
7945
7945
|
...this.options.interpolation.defaultVariables,
|
|
7946
7946
|
...h
|
|
7947
|
-
}), e = this.interpolator.interpolate(e, h, s.lng || this.language || n.usedLng, s),
|
|
7947
|
+
}), e = this.interpolator.interpolate(e, h, s.lng || this.language || n.usedLng, s), g) {
|
|
7948
7948
|
const C = e.match(this.interpolator.nestingRegexp), p = C && C.length;
|
|
7949
7949
|
l < p && (s.nest = !1);
|
|
7950
7950
|
}
|
|
7951
7951
|
!s.lng && this.options.compatibilityAPI !== "v1" && n && n.res && (s.lng = this.language || n.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, function() {
|
|
7952
|
-
for (var C = arguments.length, p = new Array(C),
|
|
7953
|
-
p[
|
|
7952
|
+
for (var C = arguments.length, p = new Array(C), k = 0; k < C; k++)
|
|
7953
|
+
p[k] = arguments[k];
|
|
7954
7954
|
return a && a[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);
|
|
7955
7955
|
}, s)), s.interpolation && this.interpolator.reset();
|
|
7956
7956
|
}
|
|
7957
|
-
const r = s.postProcess || this.options.postProcess,
|
|
7958
|
-
return e != null &&
|
|
7957
|
+
const r = s.postProcess || this.options.postProcess, d = L(r) ? [r] : r;
|
|
7958
|
+
return e != null && d && d.length && s.applyPostProcessor !== !1 && (e = ae.handle(d, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
7959
7959
|
i18nResolved: {
|
|
7960
7960
|
...n,
|
|
7961
7961
|
usedParams: this.getUsedParamsDetails(s)
|
|
@@ -7965,32 +7965,32 @@ class m1 extends L1 {
|
|
|
7965
7965
|
}
|
|
7966
7966
|
resolve(e) {
|
|
7967
7967
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, n, a, c, r;
|
|
7968
|
-
return
|
|
7968
|
+
return L(e) && (e = [e]), e.forEach((d) => {
|
|
7969
7969
|
if (this.isValidLookup(s)) return;
|
|
7970
|
-
const
|
|
7970
|
+
const g = this.extractFromKey(d, t), l = g.key;
|
|
7971
7971
|
n = l;
|
|
7972
|
-
let h =
|
|
7972
|
+
let h = g.namespaces;
|
|
7973
7973
|
this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
|
|
7974
|
-
const C = t.count !== void 0 && !
|
|
7975
|
-
h.forEach((
|
|
7976
|
-
this.isValidLookup(s) || (r =
|
|
7974
|
+
const C = t.count !== void 0 && !L(t.count), p = C && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), k = t.context !== void 0 && (L(t.context) || typeof t.context == "number") && t.context !== "", N = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
7975
|
+
h.forEach((m) => {
|
|
7976
|
+
this.isValidLookup(s) || (r = m, !F1[`${N[0]}-${m}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(r) && (F1[`${N[0]}-${m}`] = !0, this.logger.warn(`key "${n}" 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) => {
|
|
7977
7977
|
if (this.isValidLookup(s)) return;
|
|
7978
7978
|
c = E;
|
|
7979
|
-
const
|
|
7979
|
+
const x = [l];
|
|
7980
7980
|
if (this.i18nFormat && this.i18nFormat.addLookupKeys)
|
|
7981
|
-
this.i18nFormat.addLookupKeys(
|
|
7981
|
+
this.i18nFormat.addLookupKeys(x, l, E, m, t);
|
|
7982
7982
|
else {
|
|
7983
7983
|
let f;
|
|
7984
7984
|
C && (f = this.pluralResolver.getSuffix(E, t.count, t));
|
|
7985
|
-
const R = `${this.options.pluralSeparator}zero`,
|
|
7986
|
-
if (C && (
|
|
7985
|
+
const R = `${this.options.pluralSeparator}zero`, b = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
7986
|
+
if (C && (x.push(l + f), t.ordinal && f.indexOf(b) === 0 && x.push(l + f.replace(b, this.options.pluralSeparator)), p && x.push(l + R)), k) {
|
|
7987
7987
|
const w = `${l}${this.options.contextSeparator}${t.context}`;
|
|
7988
|
-
|
|
7988
|
+
x.push(w), C && (x.push(w + f), t.ordinal && f.indexOf(b) === 0 && x.push(w + f.replace(b, this.options.pluralSeparator)), p && x.push(w + R));
|
|
7989
7989
|
}
|
|
7990
7990
|
}
|
|
7991
7991
|
let _;
|
|
7992
|
-
for (; _ =
|
|
7993
|
-
this.isValidLookup(s) || (a = _, s = this.getResource(E,
|
|
7992
|
+
for (; _ = x.pop(); )
|
|
7993
|
+
this.isValidLookup(s) || (a = _, s = this.getResource(E, m, _, t));
|
|
7994
7994
|
}));
|
|
7995
7995
|
});
|
|
7996
7996
|
}), {
|
|
@@ -8010,7 +8010,7 @@ class m1 extends L1 {
|
|
|
8010
8010
|
}
|
|
8011
8011
|
getUsedParamsDetails() {
|
|
8012
8012
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
8013
|
-
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = e.replace && !
|
|
8013
|
+
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = e.replace && !L(e.replace);
|
|
8014
8014
|
let n = s ? e.replace : e;
|
|
8015
8015
|
if (s && typeof e.count < "u" && (n.count = e.count), this.options.interpolation.defaultVariables && (n = {
|
|
8016
8016
|
...this.options.interpolation.defaultVariables,
|
|
@@ -8035,7 +8035,7 @@ class m1 extends L1 {
|
|
|
8035
8035
|
const x1 = (i) => i.charAt(0).toUpperCase() + i.slice(1);
|
|
8036
8036
|
class Y1 {
|
|
8037
8037
|
constructor(e) {
|
|
8038
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
|
8038
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = Y.create("languageUtils");
|
|
8039
8039
|
}
|
|
8040
8040
|
getScriptPartFromCode(e) {
|
|
8041
8041
|
if (e = f1(e), !e || e.indexOf("-") < 0) return null;
|
|
@@ -8048,7 +8048,7 @@ class Y1 {
|
|
|
8048
8048
|
return this.formatLanguageCode(t[0]);
|
|
8049
8049
|
}
|
|
8050
8050
|
formatLanguageCode(e) {
|
|
8051
|
-
if (
|
|
8051
|
+
if (L(e) && e.indexOf("-") > -1) {
|
|
8052
8052
|
if (typeof Intl < "u" && typeof Intl.getCanonicalLocales < "u")
|
|
8053
8053
|
try {
|
|
8054
8054
|
let n = Intl.getCanonicalLocales(e)[0];
|
|
@@ -8084,7 +8084,7 @@ class Y1 {
|
|
|
8084
8084
|
}
|
|
8085
8085
|
getFallbackCodes(e, t) {
|
|
8086
8086
|
if (!e) return [];
|
|
8087
|
-
if (typeof e == "function" && (e = e(t)),
|
|
8087
|
+
if (typeof e == "function" && (e = e(t)), L(e) && (e = [e]), Array.isArray(e)) return e;
|
|
8088
8088
|
if (!t) return e.default || [];
|
|
8089
8089
|
let s = e[t];
|
|
8090
8090
|
return s || (s = e[this.getScriptPartFromCode(t)]), s || (s = e[this.formatLanguageCode(t)]), s || (s = e[this.getLanguagePartFromCode(t)]), s || (s = e.default), s || [];
|
|
@@ -8093,7 +8093,7 @@ class Y1 {
|
|
|
8093
8093
|
const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), n = [], a = (c) => {
|
|
8094
8094
|
c && (this.isSupportedCode(c) ? n.push(c) : this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`));
|
|
8095
8095
|
};
|
|
8096
|
-
return
|
|
8096
|
+
return L(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && a(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && a(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && a(this.getLanguagePartFromCode(e))) : L(e) && a(this.formatLanguageCode(e)), s.forEach((c) => {
|
|
8097
8097
|
n.indexOf(c) < 0 && a(this.formatLanguageCode(c));
|
|
8098
8098
|
}), n;
|
|
8099
8099
|
}
|
|
@@ -8235,7 +8235,7 @@ const D3 = ["v1", "v2", "v3"], T3 = ["v4"], U1 = {
|
|
|
8235
8235
|
class K3 {
|
|
8236
8236
|
constructor(e) {
|
|
8237
8237
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
8238
|
-
this.languageUtils = e, this.options = t, this.logger =
|
|
8238
|
+
this.languageUtils = e, this.options = t, this.logger = Y.create("pluralResolver"), (!this.options.compatibilityJSON || T3.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 = G3(), this.pluralRulesCache = {};
|
|
8239
8239
|
}
|
|
8240
8240
|
addRule(e, t) {
|
|
8241
8241
|
this.rules[e] = t;
|
|
@@ -8259,8 +8259,8 @@ class K3 {
|
|
|
8259
8259
|
});
|
|
8260
8260
|
} catch {
|
|
8261
8261
|
if (!e.match(/-|_/)) return;
|
|
8262
|
-
const
|
|
8263
|
-
c = this.getRule(
|
|
8262
|
+
const d = this.languageUtils.getLanguagePartFromCode(e);
|
|
8263
|
+
c = this.getRule(d, t);
|
|
8264
8264
|
}
|
|
8265
8265
|
return this.pluralRulesCache[a] = c, c;
|
|
8266
8266
|
}
|
|
@@ -8298,12 +8298,12 @@ class K3 {
|
|
|
8298
8298
|
}
|
|
8299
8299
|
const z1 = function(i, e, t) {
|
|
8300
8300
|
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = H3(i, e, t);
|
|
8301
|
-
return !a && n &&
|
|
8301
|
+
return !a && n && L(t) && (a = E1(i, t, s), a === void 0 && (a = E1(e, t, s))), a;
|
|
8302
8302
|
}, R1 = (i) => i.replace(/\$/g, "$$$$");
|
|
8303
8303
|
class P3 {
|
|
8304
8304
|
constructor() {
|
|
8305
8305
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
8306
|
-
this.logger =
|
|
8306
|
+
this.logger = Y.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
|
|
8307
8307
|
}
|
|
8308
8308
|
init() {
|
|
8309
8309
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -8317,19 +8317,19 @@ class P3 {
|
|
|
8317
8317
|
prefix: a,
|
|
8318
8318
|
prefixEscaped: c,
|
|
8319
8319
|
suffix: r,
|
|
8320
|
-
suffixEscaped:
|
|
8321
|
-
formatSeparator:
|
|
8320
|
+
suffixEscaped: d,
|
|
8321
|
+
formatSeparator: g,
|
|
8322
8322
|
unescapeSuffix: l,
|
|
8323
8323
|
unescapePrefix: h,
|
|
8324
8324
|
nestingPrefix: C,
|
|
8325
8325
|
nestingPrefixEscaped: p,
|
|
8326
|
-
nestingSuffix:
|
|
8326
|
+
nestingSuffix: k,
|
|
8327
8327
|
nestingSuffixEscaped: N,
|
|
8328
|
-
nestingOptionsSeparator:
|
|
8328
|
+
nestingOptionsSeparator: m,
|
|
8329
8329
|
maxReplaces: E,
|
|
8330
|
-
alwaysFormat:
|
|
8330
|
+
alwaysFormat: x
|
|
8331
8331
|
} = e.interpolation;
|
|
8332
|
-
this.escape = t !== void 0 ? t : I3, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = a ? i1(a) : c || "{{", this.suffix = r ? i1(r) :
|
|
8332
|
+
this.escape = t !== void 0 ? t : I3, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = a ? i1(a) : c || "{{", this.suffix = r ? i1(r) : d || "}}", this.formatSeparator = g || ",", this.unescapePrefix = l ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = C ? i1(C) : p || i1("$t("), this.nestingSuffix = k ? i1(k) : N || i1(")"), this.nestingOptionsSeparator = m || ",", this.maxReplaces = E || 1e3, this.alwaysFormat = x !== void 0 ? x : !1, this.resetRegExp();
|
|
8333
8333
|
}
|
|
8334
8334
|
reset() {
|
|
8335
8335
|
this.options && this.init(this.options);
|
|
@@ -8340,17 +8340,17 @@ class P3 {
|
|
|
8340
8340
|
}
|
|
8341
8341
|
interpolate(e, t, s, n) {
|
|
8342
8342
|
let a, c, r;
|
|
8343
|
-
const
|
|
8343
|
+
const d = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, g = (p) => {
|
|
8344
8344
|
if (p.indexOf(this.formatSeparator) < 0) {
|
|
8345
|
-
const E = z1(t,
|
|
8345
|
+
const E = z1(t, d, p, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
8346
8346
|
return this.alwaysFormat ? this.format(E, void 0, s, {
|
|
8347
8347
|
...n,
|
|
8348
8348
|
...t,
|
|
8349
8349
|
interpolationkey: p
|
|
8350
8350
|
}) : E;
|
|
8351
8351
|
}
|
|
8352
|
-
const
|
|
8353
|
-
return this.format(z1(t,
|
|
8352
|
+
const k = p.split(this.formatSeparator), N = k.shift().trim(), m = k.join(this.formatSeparator).trim();
|
|
8353
|
+
return this.format(z1(t, d, N, this.options.keySeparator, this.options.ignoreJSONStructure), m, s, {
|
|
8354
8354
|
...n,
|
|
8355
8355
|
...t,
|
|
8356
8356
|
interpolationkey: N
|
|
@@ -8366,19 +8366,19 @@ class P3 {
|
|
|
8366
8366
|
safeValue: (p) => this.escapeValue ? R1(this.escape(p)) : R1(p)
|
|
8367
8367
|
}].forEach((p) => {
|
|
8368
8368
|
for (r = 0; a = p.regex.exec(e); ) {
|
|
8369
|
-
const
|
|
8370
|
-
if (c =
|
|
8369
|
+
const k = a[1].trim();
|
|
8370
|
+
if (c = g(k), c === void 0)
|
|
8371
8371
|
if (typeof l == "function") {
|
|
8372
|
-
const
|
|
8373
|
-
c =
|
|
8374
|
-
} else if (n && Object.prototype.hasOwnProperty.call(n,
|
|
8372
|
+
const m = l(e, a, n);
|
|
8373
|
+
c = L(m) ? m : "";
|
|
8374
|
+
} else if (n && Object.prototype.hasOwnProperty.call(n, k))
|
|
8375
8375
|
c = "";
|
|
8376
8376
|
else if (h) {
|
|
8377
8377
|
c = a[0];
|
|
8378
8378
|
continue;
|
|
8379
8379
|
} else
|
|
8380
|
-
this.logger.warn(`missed to pass in variable ${
|
|
8381
|
-
else !
|
|
8380
|
+
this.logger.warn(`missed to pass in variable ${k} for interpolating ${e}`), c = "";
|
|
8381
|
+
else !L(c) && !this.useRawValueToEscape && (c = T1(c));
|
|
8382
8382
|
const N = p.safeValue(c);
|
|
8383
8383
|
if (e = e.replace(a[0], N), h ? (p.regex.lastIndex += c.length, p.regex.lastIndex -= a[0].length) : p.regex.lastIndex = 0, r++, r >= this.maxReplaces)
|
|
8384
8384
|
break;
|
|
@@ -8387,36 +8387,36 @@ class P3 {
|
|
|
8387
8387
|
}
|
|
8388
8388
|
nest(e, t) {
|
|
8389
8389
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n, a, c;
|
|
8390
|
-
const r = (
|
|
8390
|
+
const r = (d, g) => {
|
|
8391
8391
|
const l = this.nestingOptionsSeparator;
|
|
8392
|
-
if (
|
|
8393
|
-
const h =
|
|
8392
|
+
if (d.indexOf(l) < 0) return d;
|
|
8393
|
+
const h = d.split(new RegExp(`${l}[ ]*{`));
|
|
8394
8394
|
let C = `{${h[1]}`;
|
|
8395
|
-
|
|
8396
|
-
const p = C.match(/'/g),
|
|
8397
|
-
(p && p.length % 2 === 0 && !
|
|
8395
|
+
d = h[0], C = this.interpolate(C, c);
|
|
8396
|
+
const p = C.match(/'/g), k = C.match(/"/g);
|
|
8397
|
+
(p && p.length % 2 === 0 && !k || k.length % 2 !== 0) && (C = C.replace(/'/g, '"'));
|
|
8398
8398
|
try {
|
|
8399
|
-
c = JSON.parse(C),
|
|
8400
|
-
...
|
|
8399
|
+
c = JSON.parse(C), g && (c = {
|
|
8400
|
+
...g,
|
|
8401
8401
|
...c
|
|
8402
8402
|
});
|
|
8403
8403
|
} catch (N) {
|
|
8404
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${
|
|
8404
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${d}`, N), `${d}${l}${C}`;
|
|
8405
8405
|
}
|
|
8406
|
-
return c.defaultValue && c.defaultValue.indexOf(this.prefix) > -1 && delete c.defaultValue,
|
|
8406
|
+
return c.defaultValue && c.defaultValue.indexOf(this.prefix) > -1 && delete c.defaultValue, d;
|
|
8407
8407
|
};
|
|
8408
8408
|
for (; n = this.nestingRegexp.exec(e); ) {
|
|
8409
|
-
let
|
|
8409
|
+
let d = [];
|
|
8410
8410
|
c = {
|
|
8411
8411
|
...s
|
|
8412
|
-
}, c = c.replace && !
|
|
8413
|
-
let
|
|
8412
|
+
}, c = c.replace && !L(c.replace) ? c.replace : c, c.applyPostProcessor = !1, delete c.defaultValue;
|
|
8413
|
+
let g = !1;
|
|
8414
8414
|
if (n[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(n[1])) {
|
|
8415
8415
|
const l = n[1].split(this.formatSeparator).map((h) => h.trim());
|
|
8416
|
-
n[1] = l.shift(),
|
|
8416
|
+
n[1] = l.shift(), d = l, g = !0;
|
|
8417
8417
|
}
|
|
8418
|
-
if (a = t(r.call(this, n[1].trim(), c), c), a && n[0] === e && !
|
|
8419
|
-
|
|
8418
|
+
if (a = t(r.call(this, n[1].trim(), c), c), a && n[0] === e && !L(a)) return a;
|
|
8419
|
+
L(a) || (a = T1(a)), a || (this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`), a = ""), g && (a = d.reduce((l, h) => this.format(l, h, s.lng, {
|
|
8420
8420
|
...s,
|
|
8421
8421
|
interpolationkey: n[1].trim()
|
|
8422
8422
|
}), a.trim())), e = e.replace(n[0], a), this.regexp.lastIndex = 0;
|
|
@@ -8433,8 +8433,8 @@ const $3 = (i) => {
|
|
|
8433
8433
|
const n = s[1].substring(0, s[1].length - 1);
|
|
8434
8434
|
e === "currency" && n.indexOf(":") < 0 ? t.currency || (t.currency = n.trim()) : e === "relativetime" && n.indexOf(":") < 0 ? t.range || (t.range = n.trim()) : n.split(";").forEach((c) => {
|
|
8435
8435
|
if (c) {
|
|
8436
|
-
const [r, ...
|
|
8437
|
-
t[l] || (t[l] =
|
|
8436
|
+
const [r, ...d] = c.split(":"), g = d.join(":").trim().replace(/^'+|'+$/g, ""), l = r.trim();
|
|
8437
|
+
t[l] || (t[l] = g), g === "false" && (t[l] = !1), g === "true" && (t[l] = !0), isNaN(g) || (t[l] = parseInt(g, 10));
|
|
8438
8438
|
}
|
|
8439
8439
|
});
|
|
8440
8440
|
}
|
|
@@ -8458,7 +8458,7 @@ const $3 = (i) => {
|
|
|
8458
8458
|
class F3 {
|
|
8459
8459
|
constructor() {
|
|
8460
8460
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
8461
|
-
this.logger =
|
|
8461
|
+
this.logger = Y.create("formatter"), this.options = e, this.formats = {
|
|
8462
8462
|
number: s1((t, s) => {
|
|
8463
8463
|
const n = new Intl.NumberFormat(t, {
|
|
8464
8464
|
...s
|
|
@@ -8508,19 +8508,19 @@ class F3 {
|
|
|
8508
8508
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
8509
8509
|
const a = t.split(this.formatSeparator);
|
|
8510
8510
|
if (a.length > 1 && a[0].indexOf("(") > 1 && a[0].indexOf(")") < 0 && a.find((r) => r.indexOf(")") > -1)) {
|
|
8511
|
-
const r = a.findIndex((
|
|
8511
|
+
const r = a.findIndex((d) => d.indexOf(")") > -1);
|
|
8512
8512
|
a[0] = [a[0], ...a.splice(1, r)].join(this.formatSeparator);
|
|
8513
8513
|
}
|
|
8514
|
-
return a.reduce((r,
|
|
8514
|
+
return a.reduce((r, d) => {
|
|
8515
8515
|
const {
|
|
8516
|
-
formatName:
|
|
8516
|
+
formatName: g,
|
|
8517
8517
|
formatOptions: l
|
|
8518
|
-
} = $3(
|
|
8519
|
-
if (this.formats[
|
|
8518
|
+
} = $3(d);
|
|
8519
|
+
if (this.formats[g]) {
|
|
8520
8520
|
let h = r;
|
|
8521
8521
|
try {
|
|
8522
8522
|
const C = n && n.formatParams && n.formatParams[n.interpolationkey] || {}, p = C.locale || C.lng || n.locale || n.lng || s;
|
|
8523
|
-
h = this.formats[
|
|
8523
|
+
h = this.formats[g](r, p, {
|
|
8524
8524
|
...l,
|
|
8525
8525
|
...n,
|
|
8526
8526
|
...C
|
|
@@ -8530,7 +8530,7 @@ class F3 {
|
|
|
8530
8530
|
}
|
|
8531
8531
|
return h;
|
|
8532
8532
|
} else
|
|
8533
|
-
this.logger.warn(`there was no format function for ${
|
|
8533
|
+
this.logger.warn(`there was no format function for ${g}`);
|
|
8534
8534
|
return r;
|
|
8535
8535
|
}, e);
|
|
8536
8536
|
}
|
|
@@ -8541,16 +8541,16 @@ const Y3 = (i, e) => {
|
|
|
8541
8541
|
class U3 extends L1 {
|
|
8542
8542
|
constructor(e, t, s) {
|
|
8543
8543
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
8544
|
-
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger =
|
|
8544
|
+
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = Y.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);
|
|
8545
8545
|
}
|
|
8546
8546
|
queueLoad(e, t, s, n) {
|
|
8547
|
-
const a = {}, c = {}, r = {},
|
|
8548
|
-
return e.forEach((
|
|
8547
|
+
const a = {}, c = {}, r = {}, d = {};
|
|
8548
|
+
return e.forEach((g) => {
|
|
8549
8549
|
let l = !0;
|
|
8550
8550
|
t.forEach((h) => {
|
|
8551
|
-
const C = `${
|
|
8552
|
-
!s.reload && this.store.hasResourceBundle(
|
|
8553
|
-
}), l || (r[
|
|
8551
|
+
const C = `${g}|${h}`;
|
|
8552
|
+
!s.reload && this.store.hasResourceBundle(g, h) ? this.state[C] = 2 : this.state[C] < 0 || (this.state[C] === 1 ? c[C] === void 0 && (c[C] = !0) : (this.state[C] = 1, l = !1, c[C] === void 0 && (c[C] = !0), a[C] === void 0 && (a[C] = !0), d[h] === void 0 && (d[h] = !0)));
|
|
8553
|
+
}), l || (r[g] = !0);
|
|
8554
8554
|
}), (Object.keys(a).length || Object.keys(c).length) && this.queue.push({
|
|
8555
8555
|
pending: c,
|
|
8556
8556
|
pendingCount: Object.keys(c).length,
|
|
@@ -8561,7 +8561,7 @@ class U3 extends L1 {
|
|
|
8561
8561
|
toLoad: Object.keys(a),
|
|
8562
8562
|
pending: Object.keys(c),
|
|
8563
8563
|
toLoadLanguages: Object.keys(r),
|
|
8564
|
-
toLoadNamespaces: Object.keys(
|
|
8564
|
+
toLoadNamespaces: Object.keys(d)
|
|
8565
8565
|
};
|
|
8566
8566
|
}
|
|
8567
8567
|
loaded(e, t, s) {
|
|
@@ -8570,15 +8570,15 @@ class U3 extends L1 {
|
|
|
8570
8570
|
skipCopy: !0
|
|
8571
8571
|
}), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
|
|
8572
8572
|
const r = {};
|
|
8573
|
-
this.queue.forEach((
|
|
8574
|
-
_3(
|
|
8575
|
-
r[
|
|
8576
|
-
const l =
|
|
8573
|
+
this.queue.forEach((d) => {
|
|
8574
|
+
_3(d.loaded, [a], c), Y3(d, e), t && d.errors.push(t), d.pendingCount === 0 && !d.done && (Object.keys(d.loaded).forEach((g) => {
|
|
8575
|
+
r[g] || (r[g] = {});
|
|
8576
|
+
const l = d.loaded[g];
|
|
8577
8577
|
l.length && l.forEach((h) => {
|
|
8578
|
-
r[
|
|
8578
|
+
r[g][h] === void 0 && (r[g][h] = !0);
|
|
8579
8579
|
});
|
|
8580
|
-
}),
|
|
8581
|
-
}), this.emit("loaded", r), this.queue = this.queue.filter((
|
|
8580
|
+
}), d.done = !0, d.errors.length ? d.callback(d.errors) : d.callback());
|
|
8581
|
+
}), this.emit("loaded", r), this.queue = this.queue.filter((d) => !d.done);
|
|
8582
8582
|
}
|
|
8583
8583
|
read(e, t, s) {
|
|
8584
8584
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, c = arguments.length > 5 ? arguments[5] : void 0;
|
|
@@ -8595,35 +8595,35 @@ class U3 extends L1 {
|
|
|
8595
8595
|
return;
|
|
8596
8596
|
}
|
|
8597
8597
|
this.readingCalls++;
|
|
8598
|
-
const r = (
|
|
8598
|
+
const r = (g, l) => {
|
|
8599
8599
|
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
8600
8600
|
const h = this.waitingReads.shift();
|
|
8601
8601
|
this.read(h.lng, h.ns, h.fcName, h.tried, h.wait, h.callback);
|
|
8602
8602
|
}
|
|
8603
|
-
if (
|
|
8603
|
+
if (g && l && n < this.maxRetries) {
|
|
8604
8604
|
setTimeout(() => {
|
|
8605
8605
|
this.read.call(this, e, t, s, n + 1, a * 2, c);
|
|
8606
8606
|
}, a);
|
|
8607
8607
|
return;
|
|
8608
8608
|
}
|
|
8609
|
-
c(
|
|
8610
|
-
},
|
|
8611
|
-
if (
|
|
8609
|
+
c(g, l);
|
|
8610
|
+
}, d = this.backend[s].bind(this.backend);
|
|
8611
|
+
if (d.length === 2) {
|
|
8612
8612
|
try {
|
|
8613
|
-
const
|
|
8614
|
-
|
|
8615
|
-
} catch (
|
|
8616
|
-
r(
|
|
8613
|
+
const g = d(e, t);
|
|
8614
|
+
g && typeof g.then == "function" ? g.then((l) => r(null, l)).catch(r) : r(null, g);
|
|
8615
|
+
} catch (g) {
|
|
8616
|
+
r(g);
|
|
8617
8617
|
}
|
|
8618
8618
|
return;
|
|
8619
8619
|
}
|
|
8620
|
-
return
|
|
8620
|
+
return d(e, t, r);
|
|
8621
8621
|
}
|
|
8622
8622
|
prepareLoading(e, t) {
|
|
8623
8623
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = arguments.length > 3 ? arguments[3] : void 0;
|
|
8624
8624
|
if (!this.backend)
|
|
8625
8625
|
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), n && n();
|
|
8626
|
-
|
|
8626
|
+
L(e) && (e = this.languageUtils.toResolveHierarchy(e)), L(t) && (t = [t]);
|
|
8627
8627
|
const a = this.queueLoad(e, t, s, n);
|
|
8628
8628
|
if (!a.toLoad.length)
|
|
8629
8629
|
return a.pending.length || n(), null;
|
|
@@ -8655,19 +8655,19 @@ class U3 extends L1 {
|
|
|
8655
8655
|
}
|
|
8656
8656
|
if (!(s == null || s === "")) {
|
|
8657
8657
|
if (this.backend && this.backend.create) {
|
|
8658
|
-
const
|
|
8658
|
+
const d = {
|
|
8659
8659
|
...c,
|
|
8660
8660
|
isUpdate: a
|
|
8661
|
-
},
|
|
8662
|
-
if (
|
|
8661
|
+
}, g = this.backend.create.bind(this.backend);
|
|
8662
|
+
if (g.length < 6)
|
|
8663
8663
|
try {
|
|
8664
8664
|
let l;
|
|
8665
|
-
|
|
8665
|
+
g.length === 5 ? l = g(e, t, s, n, d) : l = g(e, t, s, n), l && typeof l.then == "function" ? l.then((h) => r(null, h)).catch(r) : r(null, l);
|
|
8666
8666
|
} catch (l) {
|
|
8667
8667
|
r(l);
|
|
8668
8668
|
}
|
|
8669
8669
|
else
|
|
8670
|
-
|
|
8670
|
+
g(e, t, s, n, r, d);
|
|
8671
8671
|
}
|
|
8672
8672
|
!e || !e[0] || this.store.addResource(e[0], t, s, n);
|
|
8673
8673
|
}
|
|
@@ -8708,7 +8708,7 @@ const J1 = () => ({
|
|
|
8708
8708
|
appendNamespaceToCIMode: !1,
|
|
8709
8709
|
overloadTranslationOptionHandler: (i) => {
|
|
8710
8710
|
let e = {};
|
|
8711
|
-
if (typeof i[1] == "object" && (e = i[1]),
|
|
8711
|
+
if (typeof i[1] == "object" && (e = i[1]), L(i[1]) && (e.defaultValue = i[1]), L(i[2]) && (e.tDescription = i[2]), typeof i[2] == "object" || typeof i[3] == "object") {
|
|
8712
8712
|
const t = i[3] || i[2];
|
|
8713
8713
|
Object.keys(t).forEach((s) => {
|
|
8714
8714
|
e[s] = t[s];
|
|
@@ -8729,7 +8729,7 @@ const J1 = () => ({
|
|
|
8729
8729
|
maxReplaces: 1e3,
|
|
8730
8730
|
skipOnVariables: !0
|
|
8731
8731
|
}
|
|
8732
|
-
}), Q1 = (i) => (
|
|
8732
|
+
}), Q1 = (i) => (L(i.ns) && (i.ns = [i.ns]), L(i.fallbackLng) && (i.fallbackLng = [i.fallbackLng]), L(i.fallbackNS) && (i.fallbackNS = [i.fallbackNS]), i.supportedLngs && i.supportedLngs.indexOf("cimode") < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), i), g1 = () => {
|
|
8733
8733
|
}, z3 = (i) => {
|
|
8734
8734
|
Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
|
|
8735
8735
|
typeof i[t] == "function" && (i[t] = i[t].bind(i));
|
|
@@ -8738,7 +8738,7 @@ const J1 = () => ({
|
|
|
8738
8738
|
class c1 extends L1 {
|
|
8739
8739
|
constructor() {
|
|
8740
8740
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
8741
|
-
if (super(), this.options = Q1(e), this.services = {}, this.logger =
|
|
8741
|
+
if (super(), this.options = Q1(e), this.services = {}, this.logger = Y, this.modules = {
|
|
8742
8742
|
external: []
|
|
8743
8743
|
}, z3(this), t && !this.isInitialized && !e.isClone) {
|
|
8744
8744
|
if (!this.options.initImmediate)
|
|
@@ -8751,7 +8751,7 @@ class c1 extends L1 {
|
|
|
8751
8751
|
init() {
|
|
8752
8752
|
var e = this;
|
|
8753
8753
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 ? arguments[1] : void 0;
|
|
8754
|
-
this.isInitializing = !0, typeof t == "function" && (s = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (
|
|
8754
|
+
this.isInitializing = !0, typeof t == "function" && (s = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (L(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
8755
8755
|
const n = J1();
|
|
8756
8756
|
this.options = {
|
|
8757
8757
|
...n,
|
|
@@ -8763,25 +8763,25 @@ class c1 extends L1 {
|
|
|
8763
8763
|
}), t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
|
|
8764
8764
|
const a = (l) => l ? typeof l == "function" ? new l() : l : null;
|
|
8765
8765
|
if (!this.options.isClone) {
|
|
8766
|
-
this.modules.logger ?
|
|
8766
|
+
this.modules.logger ? Y.init(a(this.modules.logger), this.options) : Y.init(null, this.options);
|
|
8767
8767
|
let l;
|
|
8768
8768
|
this.modules.formatter ? l = this.modules.formatter : typeof Intl < "u" && (l = F3);
|
|
8769
8769
|
const h = new Y1(this.options);
|
|
8770
8770
|
this.store = new $1(this.options.resources, this.options);
|
|
8771
8771
|
const C = this.services;
|
|
8772
|
-
C.logger =
|
|
8772
|
+
C.logger = Y, C.resourceStore = this.store, C.languageUtils = h, C.pluralResolver = new K3(h, {
|
|
8773
8773
|
prepend: this.options.pluralSeparator,
|
|
8774
8774
|
compatibilityJSON: this.options.compatibilityJSON,
|
|
8775
8775
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
8776
8776
|
}), l && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (C.formatter = a(l), C.formatter.init(C, this.options), this.options.interpolation.format = C.formatter.format.bind(C.formatter)), C.interpolator = new P3(this.options), C.utils = {
|
|
8777
8777
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
8778
8778
|
}, C.backendConnector = new U3(a(this.modules.backend), C.resourceStore, C, this.options), C.backendConnector.on("*", function(p) {
|
|
8779
|
-
for (var
|
|
8780
|
-
N[
|
|
8779
|
+
for (var k = arguments.length, N = new Array(k > 1 ? k - 1 : 0), m = 1; m < k; m++)
|
|
8780
|
+
N[m - 1] = arguments[m];
|
|
8781
8781
|
e.emit(p, ...N);
|
|
8782
8782
|
}), this.modules.languageDetector && (C.languageDetector = a(this.modules.languageDetector), C.languageDetector.init && C.languageDetector.init(C, this.options.detection, this.options)), this.modules.i18nFormat && (C.i18nFormat = a(this.modules.i18nFormat), C.i18nFormat.init && C.i18nFormat.init(this)), this.translator = new m1(this.services, this.options), this.translator.on("*", function(p) {
|
|
8783
|
-
for (var
|
|
8784
|
-
N[
|
|
8783
|
+
for (var k = arguments.length, N = new Array(k > 1 ? k - 1 : 0), m = 1; m < k; m++)
|
|
8784
|
+
N[m - 1] = arguments[m];
|
|
8785
8785
|
e.emit(p, ...N);
|
|
8786
8786
|
}), this.modules.external.forEach((p) => {
|
|
8787
8787
|
p.init && p.init(this);
|
|
@@ -8800,27 +8800,27 @@ class c1 extends L1 {
|
|
|
8800
8800
|
return e.store[l](...arguments), e;
|
|
8801
8801
|
};
|
|
8802
8802
|
});
|
|
8803
|
-
const
|
|
8803
|
+
const d = a1(), g = () => {
|
|
8804
8804
|
const l = (h, C) => {
|
|
8805
|
-
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),
|
|
8805
|
+
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);
|
|
8806
8806
|
};
|
|
8807
8807
|
if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized) return l(null, this.t.bind(this));
|
|
8808
8808
|
this.changeLanguage(this.options.lng, l);
|
|
8809
8809
|
};
|
|
8810
|
-
return this.options.resources || !this.options.initImmediate ?
|
|
8810
|
+
return this.options.resources || !this.options.initImmediate ? g() : setTimeout(g, 0), d;
|
|
8811
8811
|
}
|
|
8812
8812
|
loadResources(e) {
|
|
8813
8813
|
let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : g1;
|
|
8814
|
-
const n =
|
|
8814
|
+
const n = L(e) ? e : this.language;
|
|
8815
8815
|
if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
8816
8816
|
if (n && n.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
|
|
8817
8817
|
const a = [], c = (r) => {
|
|
8818
8818
|
if (!r || r === "cimode") return;
|
|
8819
|
-
this.services.languageUtils.toResolveHierarchy(r).forEach((
|
|
8820
|
-
|
|
8819
|
+
this.services.languageUtils.toResolveHierarchy(r).forEach((g) => {
|
|
8820
|
+
g !== "cimode" && a.indexOf(g) < 0 && a.push(g);
|
|
8821
8821
|
});
|
|
8822
8822
|
};
|
|
8823
|
-
n ? c(n) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((
|
|
8823
|
+
n ? c(n) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((d) => c(d)), this.options.preload && this.options.preload.forEach((r) => c(r)), this.services.backendConnector.load(a, this.options.ns, (r) => {
|
|
8824
8824
|
!r && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(r);
|
|
8825
8825
|
});
|
|
8826
8826
|
} else
|
|
@@ -8852,19 +8852,19 @@ class c1 extends L1 {
|
|
|
8852
8852
|
this.isLanguageChangingTo = e;
|
|
8853
8853
|
const n = a1();
|
|
8854
8854
|
this.emit("languageChanging", e);
|
|
8855
|
-
const a = (
|
|
8856
|
-
this.language =
|
|
8857
|
-
}, c = (
|
|
8858
|
-
|
|
8855
|
+
const a = (d) => {
|
|
8856
|
+
this.language = d, this.languages = this.services.languageUtils.toResolveHierarchy(d), this.resolvedLanguage = void 0, this.setResolvedLanguage(d);
|
|
8857
|
+
}, c = (d, g) => {
|
|
8858
|
+
g ? (a(g), this.translator.changeLanguage(g), this.isLanguageChangingTo = void 0, this.emit("languageChanged", g), this.logger.log("languageChanged", g)) : this.isLanguageChangingTo = void 0, n.resolve(function() {
|
|
8859
8859
|
return s.t(...arguments);
|
|
8860
|
-
}), t && t(
|
|
8860
|
+
}), t && t(d, function() {
|
|
8861
8861
|
return s.t(...arguments);
|
|
8862
8862
|
});
|
|
8863
|
-
}, r = (
|
|
8864
|
-
!e && !
|
|
8865
|
-
const
|
|
8866
|
-
|
|
8867
|
-
c(l,
|
|
8863
|
+
}, r = (d) => {
|
|
8864
|
+
!e && !d && this.services.languageDetector && (d = []);
|
|
8865
|
+
const g = L(d) ? d : this.services.languageUtils.getBestMatchFromCodes(d);
|
|
8866
|
+
g && (this.language || a(g), this.translator.language || this.translator.changeLanguage(g), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(g)), this.loadResources(g, (l) => {
|
|
8867
|
+
c(l, g);
|
|
8868
8868
|
});
|
|
8869
8869
|
};
|
|
8870
8870
|
return !e && this.services.languageDetector && !this.services.languageDetector.async ? r(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(r) : this.services.languageDetector.detect(r) : r(e), n;
|
|
@@ -8872,21 +8872,21 @@ class c1 extends L1 {
|
|
|
8872
8872
|
getFixedT(e, t, s) {
|
|
8873
8873
|
var n = this;
|
|
8874
8874
|
const a = function(c, r) {
|
|
8875
|
-
let
|
|
8875
|
+
let d;
|
|
8876
8876
|
if (typeof r != "object") {
|
|
8877
|
-
for (var
|
|
8877
|
+
for (var g = arguments.length, l = new Array(g > 2 ? g - 2 : 0), h = 2; h < g; h++)
|
|
8878
8878
|
l[h - 2] = arguments[h];
|
|
8879
|
-
|
|
8879
|
+
d = n.options.overloadTranslationOptionHandler([c, r].concat(l));
|
|
8880
8880
|
} else
|
|
8881
|
-
|
|
8881
|
+
d = {
|
|
8882
8882
|
...r
|
|
8883
8883
|
};
|
|
8884
|
-
|
|
8884
|
+
d.lng = d.lng || a.lng, d.lngs = d.lngs || a.lngs, d.ns = d.ns || a.ns, d.keyPrefix !== "" && (d.keyPrefix = d.keyPrefix || s || a.keyPrefix);
|
|
8885
8885
|
const C = n.options.keySeparator || ".";
|
|
8886
8886
|
let p;
|
|
8887
|
-
return
|
|
8887
|
+
return d.keyPrefix && Array.isArray(c) ? p = c.map((k) => `${d.keyPrefix}${C}${k}`) : p = d.keyPrefix ? `${d.keyPrefix}${C}${c}` : c, n.t(p, d);
|
|
8888
8888
|
};
|
|
8889
|
-
return
|
|
8889
|
+
return L(e) ? a.lng = e : a.lngs = e, a.ns = t, a.keyPrefix = s, a;
|
|
8890
8890
|
}
|
|
8891
8891
|
t() {
|
|
8892
8892
|
return this.translator && this.translator.translate(...arguments);
|
|
@@ -8905,9 +8905,9 @@ class c1 extends L1 {
|
|
|
8905
8905
|
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
8906
8906
|
const s = t.lng || this.resolvedLanguage || this.languages[0], n = this.options ? this.options.fallbackLng : !1, a = this.languages[this.languages.length - 1];
|
|
8907
8907
|
if (s.toLowerCase() === "cimode") return !0;
|
|
8908
|
-
const c = (r,
|
|
8909
|
-
const
|
|
8910
|
-
return
|
|
8908
|
+
const c = (r, d) => {
|
|
8909
|
+
const g = this.services.backendConnector.state[`${r}|${d}`];
|
|
8910
|
+
return g === -1 || g === 0 || g === 2;
|
|
8911
8911
|
};
|
|
8912
8912
|
if (t.precheck) {
|
|
8913
8913
|
const r = t.precheck(this, c);
|
|
@@ -8917,7 +8917,7 @@ class c1 extends L1 {
|
|
|
8917
8917
|
}
|
|
8918
8918
|
loadNamespaces(e, t) {
|
|
8919
8919
|
const s = a1();
|
|
8920
|
-
return this.options.ns ? (
|
|
8920
|
+
return this.options.ns ? (L(e) && (e = [e]), e.forEach((n) => {
|
|
8921
8921
|
this.options.ns.indexOf(n) < 0 && this.options.ns.push(n);
|
|
8922
8922
|
}), this.loadResources((n) => {
|
|
8923
8923
|
s.resolve(), t && t(n);
|
|
@@ -8925,7 +8925,7 @@ class c1 extends L1 {
|
|
|
8925
8925
|
}
|
|
8926
8926
|
loadLanguages(e, t) {
|
|
8927
8927
|
const s = a1();
|
|
8928
|
-
|
|
8928
|
+
L(e) && (e = [e]);
|
|
8929
8929
|
const n = this.options.preload || [], a = e.filter((c) => n.indexOf(c) < 0 && this.services.languageUtils.isSupportedCode(c));
|
|
8930
8930
|
return a.length ? (this.options.preload = n.concat(a), this.loadResources((c) => {
|
|
8931
8931
|
s.resolve(), t && t(c);
|
|
@@ -8956,9 +8956,9 @@ class c1 extends L1 {
|
|
|
8956
8956
|
}, a.services.utils = {
|
|
8957
8957
|
hasLoadedNamespace: a.hasLoadedNamespace.bind(a)
|
|
8958
8958
|
}, s && (a.store = new $1(this.store.data, n), a.services.resourceStore = a.store), a.translator = new m1(a.services, n), a.translator.on("*", function(r) {
|
|
8959
|
-
for (var
|
|
8960
|
-
|
|
8961
|
-
a.emit(r, ...
|
|
8959
|
+
for (var d = arguments.length, g = new Array(d > 1 ? d - 1 : 0), l = 1; l < d; l++)
|
|
8960
|
+
g[l - 1] = arguments[l];
|
|
8961
|
+
a.emit(r, ...g);
|
|
8962
8962
|
}), a.init(n, t), a.translator.options = n, a.translator.backendConnector.services.utils = {
|
|
8963
8963
|
hasLoadedNamespace: a.hasLoadedNamespace.bind(a)
|
|
8964
8964
|
}, a;
|
|
@@ -8973,22 +8973,22 @@ class c1 extends L1 {
|
|
|
8973
8973
|
};
|
|
8974
8974
|
}
|
|
8975
8975
|
}
|
|
8976
|
-
const
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8976
|
+
const G = c1.createInstance();
|
|
8977
|
+
G.createInstance = c1.createInstance;
|
|
8978
|
+
G.createInstance;
|
|
8979
|
+
G.dir;
|
|
8980
|
+
G.init;
|
|
8981
|
+
G.loadResources;
|
|
8982
|
+
G.reloadResources;
|
|
8983
|
+
G.use;
|
|
8984
|
+
G.changeLanguage;
|
|
8985
|
+
G.getFixedT;
|
|
8986
|
+
G.t;
|
|
8987
|
+
G.exists;
|
|
8988
|
+
G.setDefaultNamespace;
|
|
8989
|
+
G.hasLoadedNamespace;
|
|
8990
|
+
G.loadNamespaces;
|
|
8991
|
+
G.loadLanguages;
|
|
8992
8992
|
const J3 = "Archived", Q3 = "Deleted", q3 = {
|
|
8993
8993
|
archived: J3,
|
|
8994
8994
|
deleted: Q3
|
|
@@ -8996,7 +8996,7 @@ const J3 = "Archived", Q3 = "Deleted", q3 = {
|
|
|
8996
8996
|
archived: X3,
|
|
8997
8997
|
deleted: e0
|
|
8998
8998
|
};
|
|
8999
|
-
|
|
8999
|
+
G.use(v3).init({
|
|
9000
9000
|
defaultNS: "common",
|
|
9001
9001
|
lng: "en",
|
|
9002
9002
|
resources: {
|
|
@@ -9017,116 +9017,119 @@ const l0 = k1(
|
|
|
9017
9017
|
value: n,
|
|
9018
9018
|
onChange: a,
|
|
9019
9019
|
onError: c,
|
|
9020
|
-
allowEmpty: r = !1
|
|
9020
|
+
allowEmpty: r = !1,
|
|
9021
|
+
showAvatar: d = !1
|
|
9021
9022
|
}, g) => {
|
|
9022
|
-
const { axiosPeople:
|
|
9023
|
-
if (!
|
|
9023
|
+
const { axiosPeople: l, locale: h } = e1(Ne), { t: C } = y3("common", { lng: h }), [p, k] = j([]), [N, m] = j(!0), E = X(p);
|
|
9024
|
+
if (!l)
|
|
9024
9025
|
throw new Error(
|
|
9025
9026
|
`UserSelect requires "axiosPeople" to fetch users.
|
|
9026
9027
|
Please provide it via SNMTUiContext.`
|
|
9027
9028
|
);
|
|
9028
|
-
const
|
|
9029
|
-
(
|
|
9030
|
-
let
|
|
9031
|
-
return
|
|
9029
|
+
const x = T(
|
|
9030
|
+
(w) => {
|
|
9031
|
+
let I = "";
|
|
9032
|
+
return w.deletedAt && (I += `[${C("deleted")}] `), w.status === C1.ARCHIVED && (I += `[${C("archived")}] `), `${I}${w.firstName} ${w.lastName}`;
|
|
9032
9033
|
},
|
|
9033
|
-
[
|
|
9034
|
-
),
|
|
9034
|
+
[C]
|
|
9035
|
+
), _ = T(
|
|
9035
9036
|
async ({
|
|
9036
|
-
offset:
|
|
9037
|
-
limit:
|
|
9037
|
+
offset: w,
|
|
9038
|
+
limit: I,
|
|
9038
9039
|
search: Z
|
|
9039
9040
|
}) => {
|
|
9040
|
-
var
|
|
9041
|
+
var D, S, H;
|
|
9041
9042
|
try {
|
|
9042
|
-
const
|
|
9043
|
-
offset:
|
|
9044
|
-
limit:
|
|
9043
|
+
const P = await l.post("v1/users/search", {
|
|
9044
|
+
offset: w,
|
|
9045
|
+
limit: I,
|
|
9045
9046
|
search: Z,
|
|
9046
9047
|
...i,
|
|
9047
9048
|
includeCount: !0
|
|
9048
|
-
}), { data:
|
|
9049
|
+
}), { data: A, metadata: V } = P.data;
|
|
9049
9050
|
return {
|
|
9050
|
-
options:
|
|
9051
|
-
value:
|
|
9052
|
-
label:
|
|
9051
|
+
options: A.map(($) => ({
|
|
9052
|
+
value: $.id,
|
|
9053
|
+
label: x($),
|
|
9054
|
+
image: d ? $.avatarUrl : void 0
|
|
9053
9055
|
})),
|
|
9054
|
-
count:
|
|
9056
|
+
count: V.count
|
|
9055
9057
|
};
|
|
9056
|
-
} catch (
|
|
9058
|
+
} catch (P) {
|
|
9057
9059
|
return c && c({
|
|
9058
|
-
status: ((
|
|
9059
|
-
message: ((
|
|
9060
|
+
status: ((D = P.response) == null ? void 0 : D.status) ?? 500,
|
|
9061
|
+
message: ((H = (S = P.response) == null ? void 0 : S.data) == null ? void 0 : H.message) ?? "Error while fetching options"
|
|
9060
9062
|
}), {
|
|
9061
9063
|
options: [],
|
|
9062
9064
|
count: 0
|
|
9063
9065
|
};
|
|
9064
9066
|
}
|
|
9065
9067
|
},
|
|
9066
|
-
[
|
|
9067
|
-
),
|
|
9068
|
-
async (
|
|
9069
|
-
var
|
|
9068
|
+
[l, i, x, d, c]
|
|
9069
|
+
), f = T(
|
|
9070
|
+
async (w) => {
|
|
9071
|
+
var I, Z, D;
|
|
9070
9072
|
try {
|
|
9071
|
-
const
|
|
9072
|
-
(
|
|
9073
|
+
const S = w.filter(
|
|
9074
|
+
(A) => !E.current.some((V) => V.value === A)
|
|
9073
9075
|
);
|
|
9074
|
-
let
|
|
9075
|
-
|
|
9076
|
+
let H = [];
|
|
9077
|
+
S.length && (H = (await l.post("v1/users/search", {
|
|
9076
9078
|
filters: {
|
|
9077
|
-
id:
|
|
9079
|
+
id: S,
|
|
9078
9080
|
status: [C1.ACTIVE, C1.ARCHIVED]
|
|
9079
9081
|
}
|
|
9080
9082
|
})).data.data);
|
|
9081
|
-
const
|
|
9082
|
-
value:
|
|
9083
|
-
label:
|
|
9083
|
+
const P = H.map((A) => ({
|
|
9084
|
+
value: A.id,
|
|
9085
|
+
label: x(A),
|
|
9086
|
+
image: d ? A.avatarUrl : void 0
|
|
9084
9087
|
}));
|
|
9085
|
-
return [...
|
|
9086
|
-
} catch (
|
|
9088
|
+
return [...E.current, ...P];
|
|
9089
|
+
} catch (S) {
|
|
9087
9090
|
return c && c({
|
|
9088
|
-
status: ((
|
|
9089
|
-
message: ((
|
|
9091
|
+
status: ((I = S.response) == null ? void 0 : I.status) ?? 500,
|
|
9092
|
+
message: ((D = (Z = S.response) == null ? void 0 : Z.data) == null ? void 0 : D.message) ?? "Error while fetching selected items"
|
|
9090
9093
|
}), [];
|
|
9091
9094
|
}
|
|
9092
9095
|
},
|
|
9093
|
-
[
|
|
9096
|
+
[l, x, c, d]
|
|
9094
9097
|
);
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
}, [
|
|
9098
|
+
K(() => {
|
|
9099
|
+
E.current = p;
|
|
9100
|
+
}, [p]), K(() => {
|
|
9098
9101
|
if (!n) {
|
|
9099
|
-
|
|
9102
|
+
m(!1);
|
|
9100
9103
|
return;
|
|
9101
9104
|
}
|
|
9102
9105
|
(async () => {
|
|
9103
|
-
const
|
|
9104
|
-
|
|
9106
|
+
const I = Array.isArray(n) ? n : [n], Z = await f(I);
|
|
9107
|
+
k(Z), m(!1);
|
|
9105
9108
|
})();
|
|
9106
|
-
}, [
|
|
9107
|
-
const
|
|
9109
|
+
}, [f, n]);
|
|
9110
|
+
const R = T(
|
|
9108
9111
|
async ({
|
|
9109
|
-
limit:
|
|
9110
|
-
offset:
|
|
9112
|
+
limit: w,
|
|
9113
|
+
offset: I,
|
|
9111
9114
|
search: Z
|
|
9112
9115
|
}) => {
|
|
9113
|
-
const { count:
|
|
9114
|
-
offset:
|
|
9115
|
-
limit:
|
|
9116
|
+
const { count: D, ...S } = await _({
|
|
9117
|
+
offset: I,
|
|
9118
|
+
limit: w,
|
|
9116
9119
|
search: Z
|
|
9117
9120
|
});
|
|
9118
|
-
let
|
|
9119
|
-
return r &&
|
|
9120
|
-
options:
|
|
9121
|
-
count:
|
|
9122
|
-
limit:
|
|
9121
|
+
let H = S.options;
|
|
9122
|
+
return r && I === 0 && (H = [{ value: null, label: "None" }, ...H]), {
|
|
9123
|
+
options: H,
|
|
9124
|
+
count: D,
|
|
9125
|
+
limit: w
|
|
9123
9126
|
};
|
|
9124
9127
|
},
|
|
9125
|
-
[r,
|
|
9128
|
+
[r, _]
|
|
9126
9129
|
);
|
|
9127
|
-
if (
|
|
9130
|
+
if (N)
|
|
9128
9131
|
return /* @__PURE__ */ o(l3, {});
|
|
9129
|
-
const
|
|
9132
|
+
const b = {
|
|
9130
9133
|
ref: g,
|
|
9131
9134
|
placeholder: t,
|
|
9132
9135
|
disabled: s
|
|
@@ -9134,24 +9137,24 @@ const l0 = k1(
|
|
|
9134
9137
|
return e ? /* @__PURE__ */ o(
|
|
9135
9138
|
Z1,
|
|
9136
9139
|
{
|
|
9137
|
-
...
|
|
9140
|
+
...b,
|
|
9138
9141
|
mode: e,
|
|
9139
9142
|
value: n,
|
|
9140
9143
|
onChange: a,
|
|
9141
|
-
loadOptions:
|
|
9144
|
+
loadOptions: R,
|
|
9142
9145
|
loadOnClosedState: !0,
|
|
9143
|
-
extraOptions:
|
|
9146
|
+
extraOptions: p
|
|
9144
9147
|
}
|
|
9145
9148
|
) : /* @__PURE__ */ o(
|
|
9146
9149
|
Z1,
|
|
9147
9150
|
{
|
|
9148
|
-
...
|
|
9151
|
+
...b,
|
|
9149
9152
|
value: n,
|
|
9150
9153
|
mode: void 0,
|
|
9151
9154
|
onChange: a,
|
|
9152
|
-
loadOptions:
|
|
9155
|
+
loadOptions: R,
|
|
9153
9156
|
loadOnClosedState: !0,
|
|
9154
|
-
extraOptions:
|
|
9157
|
+
extraOptions: p
|
|
9155
9158
|
}
|
|
9156
9159
|
);
|
|
9157
9160
|
}
|