@snmt-react-ui/user-select 2.7.24 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/user-select.js +571 -543
- package/package.json +6 -6
package/dist/user-select.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var ke = Object.defineProperty;
|
|
2
2
|
var Le = (i, e, t) => e in i ? ke(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var B1 = (i, e, t) => Le(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { jsx as r, Fragment as i1, jsxs as C } from "react/jsx-runtime";
|
|
6
|
-
import { createContext as d1, forwardRef as k1,
|
|
6
|
+
import { createContext as d1, forwardRef as k1, useRef as q, useImperativeHandle as _1, useState as T, useEffect as j, useCallback as $, useMemo as ve, useContext as r1 } from "react";
|
|
7
7
|
import { Select as Ne, Flex as xe, Avatar as Re, Checkbox as Me, Typography as ae, Tag as be, Popover as ye } from "antd";
|
|
8
8
|
import { SNMTUiContext as Ee } from "@snmt-react-ui/core";
|
|
9
9
|
var _e = Object.defineProperty, He = (i, e, t) => e in i ? _e(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Ie = (i, e, t) => He(i, e + "", t), Oe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -14,11 +14,11 @@ function Se() {
|
|
|
14
14
|
s1(e[0]) && (e[0] = `react-i18next:: ${e[0]}`), console.warn(...e);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
17
|
+
const j1 = {};
|
|
18
|
+
function V1() {
|
|
19
19
|
for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
|
|
20
20
|
e[t] = arguments[t];
|
|
21
|
-
s1(e[0]) &&
|
|
21
|
+
s1(e[0]) && j1[e[0]] || (s1(e[0]) && (j1[e[0]] = /* @__PURE__ */ new Date()), Se(...e));
|
|
22
22
|
}
|
|
23
23
|
const le = (i, e) => () => {
|
|
24
24
|
if (i.isInitialized)
|
|
@@ -31,9 +31,9 @@ const le = (i, e) => () => {
|
|
|
31
31
|
};
|
|
32
32
|
i.on("initialized", t);
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, W1 = (i, e, t) => {
|
|
35
35
|
i.loadNamespaces(e, le(i, t));
|
|
36
|
-
},
|
|
36
|
+
}, G1 = (i, e, t, s) => {
|
|
37
37
|
s1(t) && (t = [t]), t.forEach((n) => {
|
|
38
38
|
i.options.ns.indexOf(n) < 0 && i.options.ns.push(n);
|
|
39
39
|
}), i.loadLanguages(e, le(i, s));
|
|
@@ -41,14 +41,14 @@ const le = (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, o = e.languages[e.languages.length - 1];
|
|
43
43
|
if (s.toLowerCase() === "cimode") return !0;
|
|
44
|
-
const c = (a,
|
|
45
|
-
const
|
|
46
|
-
return
|
|
44
|
+
const c = (a, g) => {
|
|
45
|
+
const d = e.services.backendConnector.state[`${a}|${g}`];
|
|
46
|
+
return d === -1 || d === 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(o, i)));
|
|
49
49
|
}, Ae = function(i, e) {
|
|
50
50
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
51
|
-
return !e.languages || !e.languages.length ? (
|
|
51
|
+
return !e.languages || !e.languages.length ? (V1("i18n.languages were undefined or empty", e.languages), !0) : e.options.ignoreJSONStructure !== void 0 ? e.hasLoadedNamespace(i, {
|
|
52
52
|
lng: t.lng,
|
|
53
53
|
precheck: (s, n) => {
|
|
54
54
|
if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && s.services.backendConnector.backend && s.isLanguageChangingTo && !n(s.isLanguageChangingTo, i)) return !1;
|
|
@@ -100,8 +100,8 @@ class Fe {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
const Ye = (i, e) => {
|
|
103
|
-
const t =
|
|
104
|
-
return
|
|
103
|
+
const t = q();
|
|
104
|
+
return j(() => {
|
|
105
105
|
t.current = i;
|
|
106
106
|
}, [i, e]), t.current;
|
|
107
107
|
}, he = (i, e, t, s) => i.getFixedT(e, t, s), Ue = (i, e, t, s) => $(he(i, e, t, s), [i, e, t, s]), ze = function(i) {
|
|
@@ -113,48 +113,48 @@ const Ye = (i, e) => {
|
|
|
113
113
|
defaultNS: n
|
|
114
114
|
} = r1(Pe) || {}, o = t || s || $e();
|
|
115
115
|
if (o && !o.reportNamespaces && (o.reportNamespaces = new Fe()), !o) {
|
|
116
|
-
|
|
117
|
-
const f = (x,
|
|
116
|
+
V1("You will need to pass in an i18next instance by using initReactI18next");
|
|
117
|
+
const f = (x, v) => s1(v) ? v : Te(v) && s1(v.defaultValue) ? v.defaultValue : Array.isArray(x) ? x[x.length - 1] : x, N = [f, {}, !1];
|
|
118
118
|
return N.t = f, N.i18n = {}, N.ready = !1, N;
|
|
119
119
|
}
|
|
120
|
-
o.options.react && o.options.react.wait !== void 0 &&
|
|
120
|
+
o.options.react && o.options.react.wait !== void 0 && V1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
121
121
|
const c = {
|
|
122
122
|
...Ge(),
|
|
123
123
|
...o.options.react,
|
|
124
124
|
...e
|
|
125
125
|
}, {
|
|
126
126
|
useSuspense: a,
|
|
127
|
-
keyPrefix:
|
|
127
|
+
keyPrefix: g
|
|
128
128
|
} = c;
|
|
129
|
-
let
|
|
130
|
-
|
|
131
|
-
const l = (o.isInitialized || o.initializedStoreOnce) &&
|
|
132
|
-
let m =
|
|
129
|
+
let d = i;
|
|
130
|
+
d = s1(d) ? [d] : d || ["translation"], o.reportNamespaces.addUsedNamespaces && o.reportNamespaces.addUsedNamespaces(d);
|
|
131
|
+
const l = (o.isInitialized || o.initializedStoreOnce) && d.every((f) => Ae(f, o, c)), h = Ue(o, e.lng || null, c.nsMode === "fallback" ? d : d[0], g), u = () => h, p = () => he(o, e.lng || null, c.nsMode === "fallback" ? d : d[0], g), [w, k] = T(u);
|
|
132
|
+
let m = d.join();
|
|
133
133
|
e.lng && (m = `${e.lng}${m}`);
|
|
134
|
-
const
|
|
135
|
-
|
|
134
|
+
const _ = Ye(m), M = q(!0);
|
|
135
|
+
j(() => {
|
|
136
136
|
const {
|
|
137
137
|
bindI18n: f,
|
|
138
138
|
bindI18nStore: N
|
|
139
139
|
} = c;
|
|
140
|
-
M.current = !0, !l && !a && (e.lng ?
|
|
141
|
-
M.current &&
|
|
142
|
-
}) :
|
|
143
|
-
M.current &&
|
|
144
|
-
})), l &&
|
|
140
|
+
M.current = !0, !l && !a && (e.lng ? G1(o, e.lng, d, () => {
|
|
141
|
+
M.current && k(p);
|
|
142
|
+
}) : W1(o, d, () => {
|
|
143
|
+
M.current && k(p);
|
|
144
|
+
})), l && _ && _ !== m && M.current && k(p);
|
|
145
145
|
const x = () => {
|
|
146
|
-
M.current &&
|
|
146
|
+
M.current && k(p);
|
|
147
147
|
};
|
|
148
148
|
return f && o && o.on(f, x), N && o && o.store.on(N, x), () => {
|
|
149
|
-
M.current = !1, f && o && f.split(" ").forEach((
|
|
149
|
+
M.current = !1, f && o && f.split(" ").forEach((v) => o.off(v, x)), N && o && N.split(" ").forEach((v) => o.store.off(v, x));
|
|
150
150
|
};
|
|
151
|
-
}, [o, m]),
|
|
152
|
-
M.current && l &&
|
|
153
|
-
}, [o,
|
|
154
|
-
const S = [
|
|
155
|
-
if (S.t =
|
|
151
|
+
}, [o, m]), j(() => {
|
|
152
|
+
M.current && l && k(u);
|
|
153
|
+
}, [o, g, l]);
|
|
154
|
+
const S = [w, o, l];
|
|
155
|
+
if (S.t = w, S.i18n = o, S.ready = l, l || !l && !a) return S;
|
|
156
156
|
throw new Promise((f) => {
|
|
157
|
-
e.lng ?
|
|
157
|
+
e.lng ? G1(o, e.lng, d, () => f()) : W1(o, d, () => f());
|
|
158
158
|
});
|
|
159
159
|
}, p1 = ({
|
|
160
160
|
children: i,
|
|
@@ -193,12 +193,12 @@ const Ye = (i, e) => {
|
|
|
193
193
|
);
|
|
194
194
|
};
|
|
195
195
|
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.BLUE_DARK_3 = "var(--blue-dark-3)", 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 || {});
|
|
196
|
-
const
|
|
196
|
+
const D1 = d1({
|
|
197
197
|
locale: "en",
|
|
198
198
|
theme: "light"
|
|
199
199
|
});
|
|
200
|
-
|
|
201
|
-
const
|
|
200
|
+
D1.Provider;
|
|
201
|
+
const qe = ({
|
|
202
202
|
checked: i = !0,
|
|
203
203
|
indeterminate: e = !1,
|
|
204
204
|
children: t,
|
|
@@ -206,19 +206,19 @@ const Qe = ({
|
|
|
206
206
|
disabled: n = !1,
|
|
207
207
|
disableUncheck: o = !1
|
|
208
208
|
}) => {
|
|
209
|
-
const [c, a] =
|
|
210
|
-
|
|
211
|
-
a(i),
|
|
209
|
+
const [c, a] = T(i), [g, d] = T(e);
|
|
210
|
+
j(() => {
|
|
211
|
+
a(i), d(e);
|
|
212
212
|
}, [i, e]);
|
|
213
|
-
const { theme: l } = r1(
|
|
213
|
+
const { theme: l } = r1(D1);
|
|
214
214
|
return /* @__PURE__ */ r(
|
|
215
215
|
Me,
|
|
216
216
|
{
|
|
217
217
|
className: `snmt-checkbox snmt-checkbox-${l}`,
|
|
218
218
|
checked: c,
|
|
219
|
-
indeterminate:
|
|
219
|
+
indeterminate: g,
|
|
220
220
|
onChange: (h) => {
|
|
221
|
-
o && c || (
|
|
221
|
+
o && c || (d(!1), a(h.target.checked), s && s(h));
|
|
222
222
|
},
|
|
223
223
|
disabled: n,
|
|
224
224
|
children: t
|
|
@@ -231,7 +231,7 @@ const ce = d1({
|
|
|
231
231
|
theme: "light"
|
|
232
232
|
});
|
|
233
233
|
ce.Provider;
|
|
234
|
-
const
|
|
234
|
+
const Qe = ({
|
|
235
235
|
width: i = 20,
|
|
236
236
|
height: e = 20,
|
|
237
237
|
color: t = "#001E52",
|
|
@@ -2186,7 +2186,7 @@ const qe = ({
|
|
|
2186
2186
|
)
|
|
2187
2187
|
]
|
|
2188
2188
|
}
|
|
2189
|
-
),
|
|
2189
|
+
), qt = ({
|
|
2190
2190
|
className: i,
|
|
2191
2191
|
color: e = y.GREY_DARK_5,
|
|
2192
2192
|
height: t = 24,
|
|
@@ -2225,7 +2225,7 @@ const qe = ({
|
|
|
2225
2225
|
)
|
|
2226
2226
|
]
|
|
2227
2227
|
}
|
|
2228
|
-
),
|
|
2228
|
+
), Qt = ({
|
|
2229
2229
|
className: i,
|
|
2230
2230
|
color: e = y.GREY_DARK_5,
|
|
2231
2231
|
height: t = 24,
|
|
@@ -2706,13 +2706,13 @@ const qe = ({
|
|
|
2706
2706
|
disabled: o = !1,
|
|
2707
2707
|
onClick: c
|
|
2708
2708
|
}) => {
|
|
2709
|
-
const [a,
|
|
2710
|
-
return
|
|
2709
|
+
const [a, g] = T(n), { theme: d } = r1(ce), l = o ? d && d === "dark" ? y.GREY_LIGHT_4 : y.GREY_DARK_1 : s, h = o ? void 0 : c;
|
|
2710
|
+
return j(() => {
|
|
2711
2711
|
if (n) {
|
|
2712
|
-
h && !o &&
|
|
2712
|
+
h && !o && g(`${n} clickable`);
|
|
2713
2713
|
return;
|
|
2714
2714
|
}
|
|
2715
|
-
h && !o &&
|
|
2715
|
+
h && !o && g("clickable");
|
|
2716
2716
|
}, [h, n, o]), /* @__PURE__ */ r(i1, { children: (() => {
|
|
2717
2717
|
switch (i) {
|
|
2718
2718
|
case "nextIcon":
|
|
@@ -2720,7 +2720,7 @@ const qe = ({
|
|
|
2720
2720
|
case "prevIcon":
|
|
2721
2721
|
return St({ width: e, height: t, color: l, className: a, onClick: h });
|
|
2722
2722
|
case "arrowDown":
|
|
2723
|
-
return
|
|
2723
|
+
return Qe({ width: e, height: t, color: l, className: a, onClick: h });
|
|
2724
2724
|
case "info":
|
|
2725
2725
|
return Xe({ width: e, height: t, color: l, className: a, onClick: h });
|
|
2726
2726
|
case "arrowRight":
|
|
@@ -2870,9 +2870,9 @@ const qe = ({
|
|
|
2870
2870
|
case "resourceManager":
|
|
2871
2871
|
return Jt({ width: e, height: t, color: l, className: a, onClick: h });
|
|
2872
2872
|
case "settings2":
|
|
2873
|
-
return Qt({ width: e, height: t, color: l, className: a, onClick: h });
|
|
2874
|
-
case "image":
|
|
2875
2873
|
return qt({ width: e, height: t, color: l, className: a, onClick: h });
|
|
2874
|
+
case "image":
|
|
2875
|
+
return Qt({ width: e, height: t, color: l, className: a, onClick: h });
|
|
2876
2876
|
case "edit":
|
|
2877
2877
|
return Xt({ width: e, height: t, color: l, className: a, onClick: h });
|
|
2878
2878
|
case "filledArrowRight":
|
|
@@ -2919,24 +2919,38 @@ const qe = ({
|
|
|
2919
2919
|
whiteSpace: c = "normal",
|
|
2920
2920
|
/** This prop allows you to enable tooltip if text size is too big */
|
|
2921
2921
|
trim: a = !1
|
|
2922
|
-
},
|
|
2923
|
-
const
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2922
|
+
}, g) => {
|
|
2923
|
+
const d = q(null);
|
|
2924
|
+
_1(g, () => d.current);
|
|
2925
|
+
const [l, h] = T(!1);
|
|
2926
|
+
j(() => {
|
|
2927
|
+
var k;
|
|
2928
|
+
if (!a) return;
|
|
2929
|
+
const m = () => {
|
|
2930
|
+
d.current && h(d.current.scrollWidth > d.current.clientWidth);
|
|
2931
|
+
};
|
|
2932
|
+
m();
|
|
2933
|
+
const _ = new ResizeObserver(m);
|
|
2934
|
+
return d.current && _.observe(d.current), (k = d.current) != null && k.parentElement && _.observe(d.current.parentElement), () => {
|
|
2935
|
+
_.disconnect();
|
|
2936
|
+
};
|
|
2937
|
+
}, [a]);
|
|
2938
|
+
const u = e === "h1" || e === "h2" || e === "h3" || e === "h4";
|
|
2939
|
+
let p = `snmt-typography snmt-typography-${e}`;
|
|
2940
|
+
i && i !== "inherit" && (p += ` snmt-typography-align-${i}`), o && (p += " collapsed");
|
|
2941
|
+
const w = {
|
|
2942
|
+
className: p,
|
|
2928
2943
|
style: { color: t, whiteSpace: a ? "nowrap" : c, display: a ? "block" : "" },
|
|
2929
2944
|
onClick: n,
|
|
2930
2945
|
ref: d,
|
|
2931
|
-
ellipsis: a ? {
|
|
2946
|
+
ellipsis: a && l ? {
|
|
2932
2947
|
tooltip: {
|
|
2933
2948
|
title: s,
|
|
2934
|
-
arrow: !0,
|
|
2935
2949
|
overlayClassName: "snmt-tooltip"
|
|
2936
2950
|
}
|
|
2937
2951
|
} : void 0
|
|
2938
2952
|
};
|
|
2939
|
-
return
|
|
2953
|
+
return u ? /* @__PURE__ */ r(g2, { level: C2[e], ...w, children: s }) : /* @__PURE__ */ r(u2, { ...w, children: s });
|
|
2940
2954
|
}
|
|
2941
2955
|
);
|
|
2942
2956
|
var E = /* @__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.BLUE_DARK_3 = "var(--blue-dark-3)", 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))(E || {});
|
|
@@ -4201,7 +4215,7 @@ const f2 = ({
|
|
|
4201
4215
|
}
|
|
4202
4216
|
)
|
|
4203
4217
|
}
|
|
4204
|
-
),
|
|
4218
|
+
), q2 = ({
|
|
4205
4219
|
className: i,
|
|
4206
4220
|
color: e = E.GREY_DARK_5,
|
|
4207
4221
|
height: t = 20,
|
|
@@ -4228,7 +4242,7 @@ const f2 = ({
|
|
|
4228
4242
|
}
|
|
4229
4243
|
)
|
|
4230
4244
|
}
|
|
4231
|
-
),
|
|
4245
|
+
), Q2 = ({
|
|
4232
4246
|
className: i,
|
|
4233
4247
|
color: e = E.GREY_DARK_5,
|
|
4234
4248
|
height: t = 5,
|
|
@@ -5420,19 +5434,19 @@ const f2 = ({
|
|
|
5420
5434
|
disabled: o = !1,
|
|
5421
5435
|
onClick: c
|
|
5422
5436
|
}) => {
|
|
5423
|
-
const [a,
|
|
5424
|
-
return
|
|
5437
|
+
const [a, g] = T(n), { theme: d } = r1(de), l = o ? d && d === "dark" ? E.GREY_LIGHT_4 : E.GREY_DARK_1 : s, h = o ? void 0 : c;
|
|
5438
|
+
return j(() => {
|
|
5425
5439
|
if (n) {
|
|
5426
|
-
h && !o &&
|
|
5440
|
+
h && !o && g(`${n} clickable`);
|
|
5427
5441
|
return;
|
|
5428
5442
|
}
|
|
5429
|
-
h && !o &&
|
|
5443
|
+
h && !o && g("clickable");
|
|
5430
5444
|
}, [h, n, o]), /* @__PURE__ */ r(i1, { children: (() => {
|
|
5431
5445
|
switch (i) {
|
|
5432
5446
|
case "nextIcon":
|
|
5433
5447
|
return J2({ width: e, height: t, color: l, className: a, onClick: h });
|
|
5434
5448
|
case "prevIcon":
|
|
5435
|
-
return
|
|
5449
|
+
return q2({ width: e, height: t, color: l, className: a, onClick: h });
|
|
5436
5450
|
case "arrowDown":
|
|
5437
5451
|
return f2({ width: e, height: t, color: l, className: a, onClick: h });
|
|
5438
5452
|
case "info":
|
|
@@ -5552,7 +5566,7 @@ const f2 = ({
|
|
|
5552
5566
|
case "arrowUpFilled":
|
|
5553
5567
|
return X2({ width: e, height: t, color: l, className: a, onClick: h });
|
|
5554
5568
|
case "arrowDownFilled":
|
|
5555
|
-
return
|
|
5569
|
+
return Q2({ width: e, height: t, color: l, className: a, onClick: h });
|
|
5556
5570
|
case "link":
|
|
5557
5571
|
return e5({ width: e, height: t, color: l, className: a, onClick: h });
|
|
5558
5572
|
case "telegram":
|
|
@@ -5678,24 +5692,38 @@ const ge = ({
|
|
|
5678
5692
|
whiteSpace: c = "normal",
|
|
5679
5693
|
/** This prop allows you to enable tooltip if text size is too big */
|
|
5680
5694
|
trim: a = !1
|
|
5681
|
-
},
|
|
5682
|
-
const
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5695
|
+
}, g) => {
|
|
5696
|
+
const d = q(null);
|
|
5697
|
+
_1(g, () => d.current);
|
|
5698
|
+
const [l, h] = T(!1);
|
|
5699
|
+
j(() => {
|
|
5700
|
+
var k;
|
|
5701
|
+
if (!a) return;
|
|
5702
|
+
const m = () => {
|
|
5703
|
+
d.current && h(d.current.scrollWidth > d.current.clientWidth);
|
|
5704
|
+
};
|
|
5705
|
+
m();
|
|
5706
|
+
const _ = new ResizeObserver(m);
|
|
5707
|
+
return d.current && _.observe(d.current), (k = d.current) != null && k.parentElement && _.observe(d.current.parentElement), () => {
|
|
5708
|
+
_.disconnect();
|
|
5709
|
+
};
|
|
5710
|
+
}, [a]);
|
|
5711
|
+
const u = e === "h1" || e === "h2" || e === "h3" || e === "h4";
|
|
5712
|
+
let p = `snmt-typography snmt-typography-${e}`;
|
|
5713
|
+
i && i !== "inherit" && (p += ` snmt-typography-align-${i}`), o && (p += " collapsed");
|
|
5714
|
+
const w = {
|
|
5715
|
+
className: p,
|
|
5687
5716
|
style: { color: t, whiteSpace: a ? "nowrap" : c, display: a ? "block" : "" },
|
|
5688
5717
|
onClick: n,
|
|
5689
5718
|
ref: d,
|
|
5690
|
-
ellipsis: a ? {
|
|
5719
|
+
ellipsis: a && l ? {
|
|
5691
5720
|
tooltip: {
|
|
5692
5721
|
title: s,
|
|
5693
|
-
arrow: !0,
|
|
5694
5722
|
overlayClassName: "snmt-tooltip"
|
|
5695
5723
|
}
|
|
5696
5724
|
} : void 0
|
|
5697
5725
|
};
|
|
5698
|
-
return
|
|
5726
|
+
return u ? /* @__PURE__ */ r(O5, { level: V5[e], ...w, children: s }) : /* @__PURE__ */ r(S5, { ...w, children: s });
|
|
5699
5727
|
}
|
|
5700
5728
|
), T5 = ({
|
|
5701
5729
|
children: i,
|
|
@@ -5705,7 +5733,7 @@ const ge = ({
|
|
|
5705
5733
|
placement: n = "topRight",
|
|
5706
5734
|
noPadding: o = !1
|
|
5707
5735
|
}) => {
|
|
5708
|
-
const [c, a] =
|
|
5736
|
+
const [c, a] = T(!1);
|
|
5709
5737
|
return /* @__PURE__ */ r(
|
|
5710
5738
|
ye,
|
|
5711
5739
|
{
|
|
@@ -5715,8 +5743,8 @@ const ge = ({
|
|
|
5715
5743
|
trigger: "click",
|
|
5716
5744
|
overlayClassName: `snmt-popover ${o ? "" : "padding"}`,
|
|
5717
5745
|
open: t ?? c,
|
|
5718
|
-
onOpenChange: (
|
|
5719
|
-
a(
|
|
5746
|
+
onOpenChange: (g) => {
|
|
5747
|
+
a(g), s == null || s(g);
|
|
5720
5748
|
},
|
|
5721
5749
|
children: /* @__PURE__ */ r("div", { className: "wrapper", children: i })
|
|
5722
5750
|
}
|
|
@@ -5742,14 +5770,14 @@ const D5 = ({
|
|
|
5742
5770
|
options: o,
|
|
5743
5771
|
extraOptions: c
|
|
5744
5772
|
}) => {
|
|
5745
|
-
const { locale: a } = r1(
|
|
5746
|
-
if (
|
|
5773
|
+
const { locale: a } = r1(D1), { t: g } = ze("common", { lng: a }), [d, l] = T(!1);
|
|
5774
|
+
if (j(() => {
|
|
5747
5775
|
i.length || l(!1);
|
|
5748
5776
|
}, [i]), !i.length)
|
|
5749
5777
|
return null;
|
|
5750
5778
|
const h = (u) => {
|
|
5751
|
-
var p,
|
|
5752
|
-
return ((p = o == null ? void 0 : o.find((
|
|
5779
|
+
var p, w;
|
|
5780
|
+
return ((p = o == null ? void 0 : o.find((k) => k.value === u)) == null ? void 0 : p.label) || ((w = c == null ? void 0 : c.find((k) => k.value === u)) == null ? void 0 : w.label) || u;
|
|
5753
5781
|
};
|
|
5754
5782
|
return /* @__PURE__ */ C(
|
|
5755
5783
|
T5,
|
|
@@ -5768,16 +5796,16 @@ const D5 = ({
|
|
|
5768
5796
|
)) }) })
|
|
5769
5797
|
),
|
|
5770
5798
|
placement: "bottomRight",
|
|
5771
|
-
isOpen:
|
|
5799
|
+
isOpen: d,
|
|
5772
5800
|
setIsOpen: l,
|
|
5773
5801
|
children: [
|
|
5774
5802
|
i.length,
|
|
5775
5803
|
" ",
|
|
5776
|
-
|
|
5804
|
+
g("more")
|
|
5777
5805
|
]
|
|
5778
5806
|
}
|
|
5779
5807
|
);
|
|
5780
|
-
},
|
|
5808
|
+
}, K1 = ({ size: i = 30, color: e = "#004ed7" }) => {
|
|
5781
5809
|
const t = `no-repeat linear-gradient(${e}
|
|
5782
5810
|
calc(50% - 10px), #0000 0 calc(50% + 10px), ${e} 0)`, s = {
|
|
5783
5811
|
width: i,
|
|
@@ -5785,7 +5813,7 @@ const D5 = ({
|
|
|
5785
5813
|
backgroundSize: "20% calc(200% + 20px)"
|
|
5786
5814
|
};
|
|
5787
5815
|
return /* @__PURE__ */ r("span", { className: "snmt-loader", style: s });
|
|
5788
|
-
},
|
|
5816
|
+
}, $1 = k1(
|
|
5789
5817
|
({
|
|
5790
5818
|
value: i,
|
|
5791
5819
|
onChange: e,
|
|
@@ -5795,88 +5823,88 @@ const D5 = ({
|
|
|
5795
5823
|
options: o,
|
|
5796
5824
|
width: c,
|
|
5797
5825
|
disabled: a = !1,
|
|
5798
|
-
required:
|
|
5799
|
-
clearable:
|
|
5826
|
+
required: g = !1,
|
|
5827
|
+
clearable: d = !1,
|
|
5800
5828
|
scrollThresholdValue: l = 50,
|
|
5801
5829
|
onSearchChange: h,
|
|
5802
5830
|
onDropdownVisibleChange: u,
|
|
5803
5831
|
onScrollToEnd: p,
|
|
5804
|
-
onPopupScroll:
|
|
5805
|
-
id:
|
|
5832
|
+
onPopupScroll: w,
|
|
5833
|
+
id: k,
|
|
5806
5834
|
extraOptions: m,
|
|
5807
|
-
dropdownRender:
|
|
5835
|
+
dropdownRender: _,
|
|
5808
5836
|
optionRender: M,
|
|
5809
5837
|
isLoading: S,
|
|
5810
5838
|
readOnly: f,
|
|
5811
5839
|
error: N
|
|
5812
5840
|
}, x) => {
|
|
5813
|
-
const [
|
|
5814
|
-
|
|
5841
|
+
const [v, P] = T(!1), [J, F] = T(!1), [H, D] = T(!0), [I, V] = T(i), Z = q(null);
|
|
5842
|
+
j(() => {
|
|
5815
5843
|
V(i);
|
|
5816
5844
|
}, [i]);
|
|
5817
|
-
const
|
|
5818
|
-
P(
|
|
5819
|
-
}, U = (
|
|
5820
|
-
var
|
|
5821
|
-
return !!((
|
|
5822
|
-
},
|
|
5845
|
+
const W = (L) => {
|
|
5846
|
+
P(L), u && u(L);
|
|
5847
|
+
}, U = (L, b) => {
|
|
5848
|
+
var B;
|
|
5849
|
+
return !!((B = b == null ? void 0 : b.label) != null && B.toString().toLowerCase().includes(L.toLowerCase()));
|
|
5850
|
+
}, O = () => {
|
|
5823
5851
|
F(!0);
|
|
5824
5852
|
}, K = () => {
|
|
5825
5853
|
F(!1);
|
|
5826
|
-
},
|
|
5827
|
-
(
|
|
5828
|
-
if (V(
|
|
5829
|
-
const
|
|
5830
|
-
e == null || e(
|
|
5854
|
+
}, G = $(
|
|
5855
|
+
(L) => {
|
|
5856
|
+
if (V(L), s) {
|
|
5857
|
+
const B = L;
|
|
5858
|
+
e == null || e(B);
|
|
5831
5859
|
return;
|
|
5832
5860
|
}
|
|
5833
|
-
const b =
|
|
5861
|
+
const b = L;
|
|
5834
5862
|
e == null || e(b);
|
|
5835
5863
|
},
|
|
5836
5864
|
[s, e]
|
|
5837
5865
|
), e1 = $(() => {
|
|
5838
5866
|
if (!(f || a)) {
|
|
5839
5867
|
if (s) {
|
|
5840
|
-
|
|
5868
|
+
G([]);
|
|
5841
5869
|
return;
|
|
5842
5870
|
}
|
|
5843
|
-
|
|
5871
|
+
G("");
|
|
5844
5872
|
}
|
|
5845
|
-
}, [a,
|
|
5846
|
-
(
|
|
5847
|
-
const b =
|
|
5848
|
-
|
|
5873
|
+
}, [a, G, s, f]), t1 = $(
|
|
5874
|
+
(L) => {
|
|
5875
|
+
const b = I.filter((B) => B !== L);
|
|
5876
|
+
G(b), V(b);
|
|
5849
5877
|
},
|
|
5850
|
-
[
|
|
5878
|
+
[G, I]
|
|
5851
5879
|
), g1 = $(
|
|
5852
|
-
(
|
|
5880
|
+
(L) => (I == null ? void 0 : I.indexOf(L)) === 0 ? (
|
|
5853
5881
|
// if the search input is empty
|
|
5854
5882
|
// then display the placeholder, else do not display it
|
|
5855
|
-
/* @__PURE__ */ r("span", { className: "custom-placeholder", children:
|
|
5883
|
+
/* @__PURE__ */ r("span", { className: "custom-placeholder", children: H ? t : "" })
|
|
5856
5884
|
) : /* @__PURE__ */ r(i1, {}),
|
|
5857
|
-
[
|
|
5858
|
-
), L1 = (
|
|
5859
|
-
|
|
5860
|
-
}, v1 = async (
|
|
5861
|
-
const { target: b } =
|
|
5862
|
-
b.scrollTop + b.offsetHeight >= b.scrollHeight - l && (p == null || p(!0)),
|
|
5885
|
+
[H, I, t]
|
|
5886
|
+
), L1 = (L) => {
|
|
5887
|
+
L.preventDefault(), L.stopPropagation();
|
|
5888
|
+
}, v1 = async (L) => {
|
|
5889
|
+
const { target: b } = L;
|
|
5890
|
+
b.scrollTop + b.offsetHeight >= b.scrollHeight - l && (p == null || p(!0)), w && await w(L);
|
|
5863
5891
|
}, o1 = $(
|
|
5864
|
-
(
|
|
5865
|
-
var b,
|
|
5866
|
-
return ((b = o.find((a1) => a1.value ===
|
|
5867
|
-
(a1) => a1.value ===
|
|
5868
|
-
)) == null ? void 0 :
|
|
5892
|
+
(L) => {
|
|
5893
|
+
var b, B;
|
|
5894
|
+
return ((b = o.find((a1) => a1.value === L)) == null ? void 0 : b.label) || ((B = m == null ? void 0 : m.find(
|
|
5895
|
+
(a1) => a1.value === L
|
|
5896
|
+
)) == null ? void 0 : B.label) || L;
|
|
5869
5897
|
},
|
|
5870
5898
|
[m, o]
|
|
5871
5899
|
), N1 = $(
|
|
5872
|
-
(
|
|
5900
|
+
(L) => {
|
|
5873
5901
|
var b;
|
|
5874
5902
|
return /* @__PURE__ */ r(
|
|
5875
5903
|
D5,
|
|
5876
5904
|
{
|
|
5877
|
-
values:
|
|
5905
|
+
values: L,
|
|
5878
5906
|
onTagClose: t1,
|
|
5879
|
-
maxWidth: ((b =
|
|
5907
|
+
maxWidth: ((b = Z.current) == null ? void 0 : b.clientWidth) || 0,
|
|
5880
5908
|
disabled: a,
|
|
5881
5909
|
closable: !f,
|
|
5882
5910
|
options: o,
|
|
@@ -5886,16 +5914,16 @@ const D5 = ({
|
|
|
5886
5914
|
},
|
|
5887
5915
|
[a, m, t1, o, f]
|
|
5888
5916
|
), A = $(
|
|
5889
|
-
({ label:
|
|
5917
|
+
({ label: L, value: b, mode: B }) => B === "filter" ? g1(b) : /* @__PURE__ */ r("div", { onMouseDown: L1, className: "tag-wrapper", children: /* @__PURE__ */ r(ge, { onClose: () => t1(b), disabled: a, children: typeof L == "object" ? L : o1(b) }) }),
|
|
5890
5918
|
[a, o1, t1, g1]
|
|
5891
|
-
), z = Array.isArray(
|
|
5919
|
+
), z = Array.isArray(I) && I.length > 0 || !!I && typeof I == "string" && I.trim() !== "";
|
|
5892
5920
|
return /* @__PURE__ */ C("div", { className: "snmt-select-container", children: [
|
|
5893
5921
|
/* @__PURE__ */ C(
|
|
5894
5922
|
"div",
|
|
5895
5923
|
{
|
|
5896
5924
|
className: `snmt-select-1-15-6 ${J ? "snmt-select-focused" : ""}
|
|
5897
5925
|
${s ? "" : "snmt-select-single"} ${f ? "snmt-select-read-only" : ""}`,
|
|
5898
|
-
ref:
|
|
5926
|
+
ref: Z,
|
|
5899
5927
|
style: { width: c },
|
|
5900
5928
|
children: [
|
|
5901
5929
|
/* @__PURE__ */ r(
|
|
@@ -5903,33 +5931,33 @@ const D5 = ({
|
|
|
5903
5931
|
{
|
|
5904
5932
|
className: "snmt-select-blank",
|
|
5905
5933
|
popupClassName: f ? "dropdown-read-only" : "",
|
|
5906
|
-
id:
|
|
5934
|
+
id: k,
|
|
5907
5935
|
ref: x,
|
|
5908
5936
|
showSearch: !!n,
|
|
5909
5937
|
filterOption: n && U,
|
|
5910
|
-
onDropdownVisibleChange:
|
|
5938
|
+
onDropdownVisibleChange: W,
|
|
5911
5939
|
disabled: a,
|
|
5912
|
-
value:
|
|
5913
|
-
labelRender: (
|
|
5914
|
-
const b = o1(
|
|
5940
|
+
value: I || void 0,
|
|
5941
|
+
labelRender: (L) => {
|
|
5942
|
+
const b = o1(L.value);
|
|
5915
5943
|
return a ? /* @__PURE__ */ r("span", { style: { color: Q.GREY_DARK_1 }, children: b }) : b;
|
|
5916
5944
|
},
|
|
5917
5945
|
mode: s === "filter" ? "multiple" : s,
|
|
5918
|
-
onChange:
|
|
5919
|
-
onFocus:
|
|
5946
|
+
onChange: G,
|
|
5947
|
+
onFocus: O,
|
|
5920
5948
|
onBlur: K,
|
|
5921
|
-
onSearch: (
|
|
5922
|
-
|
|
5949
|
+
onSearch: (L) => {
|
|
5950
|
+
D(!L), h && h(L);
|
|
5923
5951
|
},
|
|
5924
|
-
onSelect: () =>
|
|
5925
|
-
onDeselect: () =>
|
|
5926
|
-
tagRender: (
|
|
5952
|
+
onSelect: () => D(!0),
|
|
5953
|
+
onDeselect: () => D(!0),
|
|
5954
|
+
tagRender: (L) => A({ ...L, mode: s }),
|
|
5927
5955
|
maxTagCount: "responsive",
|
|
5928
5956
|
maxTagPlaceholder: N1,
|
|
5929
5957
|
onPopupScroll: v1,
|
|
5930
|
-
prefix: S && /* @__PURE__ */ r(
|
|
5958
|
+
prefix: S && /* @__PURE__ */ r(K1, { size: 15 }),
|
|
5931
5959
|
suffixIcon: /* @__PURE__ */ r("div", { className: "wrapper-suffix-icon", children: s !== "filter" && /* @__PURE__ */ C(i1, { children: [
|
|
5932
|
-
|
|
5960
|
+
I && !!I.length && (s || d) && /* @__PURE__ */ r(
|
|
5933
5961
|
"div",
|
|
5934
5962
|
{
|
|
5935
5963
|
onClick: e1,
|
|
@@ -5950,27 +5978,27 @@ const D5 = ({
|
|
|
5950
5978
|
{
|
|
5951
5979
|
name: "selectArrowIcon",
|
|
5952
5980
|
color: a ? Q.GREY_DARK_1 : Q.GREY_DARK_5,
|
|
5953
|
-
className:
|
|
5954
|
-
onClick: () => P(!
|
|
5981
|
+
className: v ? "select-arrow-rotated" : "select-arrow",
|
|
5982
|
+
onClick: () => P(!v)
|
|
5955
5983
|
}
|
|
5956
5984
|
)
|
|
5957
5985
|
] }) }),
|
|
5958
5986
|
removeIcon: /* @__PURE__ */ r(u1, { name: "errorSmall", color: Q.GREY_DARK_1 }),
|
|
5959
5987
|
options: o,
|
|
5960
|
-
optionRender: (
|
|
5988
|
+
optionRender: (L) => M ? M(L.data) : /* @__PURE__ */ C(p1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
|
|
5961
5989
|
/* @__PURE__ */ C(p1, { alignItems: "center", gap: 12, children: [
|
|
5962
5990
|
s && /* @__PURE__ */ r(
|
|
5963
|
-
|
|
5991
|
+
qe,
|
|
5964
5992
|
{
|
|
5965
|
-
checked: !!(
|
|
5993
|
+
checked: !!(I != null && I.includes(L.value))
|
|
5966
5994
|
}
|
|
5967
5995
|
),
|
|
5968
5996
|
/* @__PURE__ */ C(p1, { alignItems: "center", gap: 8, children: [
|
|
5969
|
-
|
|
5970
|
-
/* @__PURE__ */ r("span", { children:
|
|
5997
|
+
L.data.image && /* @__PURE__ */ r(Je, { src: L.data.image, size: 20 }),
|
|
5998
|
+
/* @__PURE__ */ r("span", { children: L.label })
|
|
5971
5999
|
] })
|
|
5972
6000
|
] }),
|
|
5973
|
-
!s &&
|
|
6001
|
+
!s && I === L.value && /* @__PURE__ */ r(
|
|
5974
6002
|
u1,
|
|
5975
6003
|
{
|
|
5976
6004
|
name: "ok",
|
|
@@ -5980,9 +6008,9 @@ const D5 = ({
|
|
|
5980
6008
|
}
|
|
5981
6009
|
)
|
|
5982
6010
|
] }),
|
|
5983
|
-
dropdownRender: (
|
|
5984
|
-
/* @__PURE__ */ r("div", { className: "dropdown-menu", children:
|
|
5985
|
-
S && /* @__PURE__ */ r("div", { className: "loading-overlay", children: /* @__PURE__ */ r(
|
|
6011
|
+
dropdownRender: (L) => /* @__PURE__ */ C("div", { className: "dropdown-container", children: [
|
|
6012
|
+
/* @__PURE__ */ r("div", { className: "dropdown-menu", children: _ ? _(L) : L }),
|
|
6013
|
+
S && /* @__PURE__ */ r("div", { className: "loading-overlay", children: /* @__PURE__ */ r(K1, { size: 28 }) })
|
|
5986
6014
|
] })
|
|
5987
6015
|
}
|
|
5988
6016
|
),
|
|
@@ -5991,14 +6019,14 @@ const D5 = ({
|
|
|
5991
6019
|
"label",
|
|
5992
6020
|
{
|
|
5993
6021
|
className: `${J || z ? "label-floating" : ""} ${a ? "label-disabled" : ""} ${J ? "label-focused" : ""} ${S ? "label-loading" : ""} ${N ? "label-error" : ""}`,
|
|
5994
|
-
children:
|
|
6022
|
+
children: g ? `${t}*` : t
|
|
5995
6023
|
}
|
|
5996
6024
|
),
|
|
5997
6025
|
/* @__PURE__ */ r(
|
|
5998
6026
|
"fieldset",
|
|
5999
6027
|
{
|
|
6000
6028
|
className: `${J ? "fieldset-focused" : ""} ${a ? "fieldset-disabled" : ""} ${z ? "fieldset-filled" : ""} ${N ? "fieldset-error" : ""}`,
|
|
6001
|
-
children: /* @__PURE__ */ r("legend", { children: /* @__PURE__ */ r("span", { children:
|
|
6029
|
+
children: /* @__PURE__ */ r("legend", { children: /* @__PURE__ */ r("span", { children: g ? `${t}*` : t }) })
|
|
6002
6030
|
}
|
|
6003
6031
|
)
|
|
6004
6032
|
] })
|
|
@@ -6021,8 +6049,8 @@ const D5 = ({
|
|
|
6021
6049
|
}
|
|
6022
6050
|
);
|
|
6023
6051
|
function B5(i, e = 500) {
|
|
6024
|
-
const t =
|
|
6025
|
-
return
|
|
6052
|
+
const t = q();
|
|
6053
|
+
return j(() => () => {
|
|
6026
6054
|
t.current && clearTimeout(t.current);
|
|
6027
6055
|
}, []), (...s) => {
|
|
6028
6056
|
const n = setTimeout(() => {
|
|
@@ -6031,15 +6059,15 @@ function B5(i, e = 500) {
|
|
|
6031
6059
|
clearTimeout(t.current), t.current = n;
|
|
6032
6060
|
};
|
|
6033
6061
|
}
|
|
6034
|
-
function
|
|
6035
|
-
const e =
|
|
6036
|
-
return
|
|
6062
|
+
function P1(i) {
|
|
6063
|
+
const e = q(i);
|
|
6064
|
+
return j(() => {
|
|
6037
6065
|
e.current = i;
|
|
6038
6066
|
}, [i]), e.current;
|
|
6039
6067
|
}
|
|
6040
|
-
const
|
|
6068
|
+
const I1 = 100, l1 = {
|
|
6041
6069
|
offset: 0
|
|
6042
|
-
},
|
|
6070
|
+
}, F1 = k1(
|
|
6043
6071
|
({
|
|
6044
6072
|
loadOptions: i,
|
|
6045
6073
|
width: e,
|
|
@@ -6049,37 +6077,37 @@ const H1 = 100, l1 = {
|
|
|
6049
6077
|
disabled: o,
|
|
6050
6078
|
scrollThresholdValue: c,
|
|
6051
6079
|
placeholder: a,
|
|
6052
|
-
mode:
|
|
6053
|
-
loadOnClosedState:
|
|
6080
|
+
mode: g,
|
|
6081
|
+
loadOnClosedState: d,
|
|
6054
6082
|
preloadOptions: l,
|
|
6055
6083
|
extraOptions: h,
|
|
6056
6084
|
onDropdownVisibleChange: u,
|
|
6057
6085
|
optionRender: p,
|
|
6058
|
-
dropdownRender:
|
|
6059
|
-
readOnly:
|
|
6086
|
+
dropdownRender: w,
|
|
6087
|
+
readOnly: k,
|
|
6060
6088
|
clearable: m = !1,
|
|
6061
|
-
required:
|
|
6089
|
+
required: _ = !1,
|
|
6062
6090
|
error: M
|
|
6063
6091
|
}, S) => {
|
|
6064
|
-
const [f, N] =
|
|
6092
|
+
const [f, N] = T(), [x, v] = T(l1), [P, J] = T(!1), [F, H] = T(), [D, I] = T(!1), [V, Z] = T(
|
|
6065
6093
|
h ?? []
|
|
6066
|
-
),
|
|
6094
|
+
), W = P1(x.offset), U = P1(F), [O, K] = T(!1), G = q(!1), e1 = $(
|
|
6067
6095
|
async ({
|
|
6068
|
-
limit: A =
|
|
6096
|
+
limit: A = I1,
|
|
6069
6097
|
offset: z,
|
|
6070
|
-
search:
|
|
6098
|
+
search: L
|
|
6071
6099
|
}) => {
|
|
6072
6100
|
J(!0);
|
|
6073
6101
|
try {
|
|
6074
6102
|
const b = await i({
|
|
6075
6103
|
limit: A,
|
|
6076
6104
|
offset: z,
|
|
6077
|
-
search:
|
|
6105
|
+
search: L
|
|
6078
6106
|
});
|
|
6079
6107
|
N(
|
|
6080
|
-
(
|
|
6081
|
-
),
|
|
6082
|
-
...
|
|
6108
|
+
(B) => z === 0 ? b.options : [...B ?? [], ...b.options]
|
|
6109
|
+
), v((B) => ({
|
|
6110
|
+
...B,
|
|
6083
6111
|
count: b.count
|
|
6084
6112
|
}));
|
|
6085
6113
|
} catch (b) {
|
|
@@ -6090,32 +6118,32 @@ const H1 = 100, l1 = {
|
|
|
6090
6118
|
},
|
|
6091
6119
|
[i]
|
|
6092
6120
|
), t1 = B5((A) => {
|
|
6093
|
-
|
|
6121
|
+
H(A), A || v(l1);
|
|
6094
6122
|
}), g1 = $(
|
|
6095
6123
|
(A) => t1(A),
|
|
6096
6124
|
[t1]
|
|
6097
6125
|
), L1 = $(
|
|
6098
6126
|
async (A) => {
|
|
6099
|
-
P || A && x.count && x.count > ((f == null ? void 0 : f.length) ?? 0) &&
|
|
6127
|
+
P || A && x.count && x.count > ((f == null ? void 0 : f.length) ?? 0) && v((z) => ({
|
|
6100
6128
|
...z,
|
|
6101
|
-
offset: z.offset +
|
|
6129
|
+
offset: z.offset + I1
|
|
6102
6130
|
}));
|
|
6103
6131
|
},
|
|
6104
6132
|
[P, f == null ? void 0 : f.length, x.count]
|
|
6105
6133
|
), v1 = $(
|
|
6106
6134
|
(A) => {
|
|
6107
|
-
|
|
6135
|
+
I(A), !A && F && (H(void 0), v(l1), K(!0)), u == null || u(A);
|
|
6108
6136
|
},
|
|
6109
6137
|
[u, F]
|
|
6110
6138
|
);
|
|
6111
|
-
|
|
6112
|
-
!
|
|
6113
|
-
}, [
|
|
6114
|
-
(
|
|
6115
|
-
}, []),
|
|
6116
|
-
h &&
|
|
6139
|
+
j(() => {
|
|
6140
|
+
!G.current || P || (O || D && (W !== x.offset || U !== F || !f)) && (e1({ offset: x.offset, limit: I1, search: F }), O && K(!1));
|
|
6141
|
+
}, [O, D, x.offset, F, W, U, f, P]), j(() => {
|
|
6142
|
+
(d || l) && e1(l1), G.current = !0;
|
|
6143
|
+
}, []), j(() => {
|
|
6144
|
+
h && Z((A) => {
|
|
6117
6145
|
const z = h.filter(
|
|
6118
|
-
(
|
|
6146
|
+
(L) => !A.some((b) => b.value === L.value)
|
|
6119
6147
|
);
|
|
6120
6148
|
return [...A, ...z];
|
|
6121
6149
|
});
|
|
@@ -6124,23 +6152,23 @@ const H1 = 100, l1 = {
|
|
|
6124
6152
|
(A) => {
|
|
6125
6153
|
t && t(A);
|
|
6126
6154
|
let z = [];
|
|
6127
|
-
if (
|
|
6128
|
-
const
|
|
6129
|
-
(b) => !(V != null && V.some((
|
|
6155
|
+
if (g ? z = Array.isArray(A) ? A : [] : z = A ? [A] : [], F) {
|
|
6156
|
+
const L = z.filter(
|
|
6157
|
+
(b) => !(V != null && V.some((B) => B.value === b))
|
|
6130
6158
|
);
|
|
6131
|
-
|
|
6159
|
+
L.length > 0 && Z((b = []) => [
|
|
6132
6160
|
...b,
|
|
6133
|
-
...
|
|
6134
|
-
const a1 = f == null ? void 0 : f.find((we) => we.value ===
|
|
6161
|
+
...L.map((B) => {
|
|
6162
|
+
const a1 = f == null ? void 0 : f.find((we) => we.value === B);
|
|
6135
6163
|
return {
|
|
6136
|
-
value:
|
|
6137
|
-
label: (a1 == null ? void 0 : a1.label) ??
|
|
6164
|
+
value: B,
|
|
6165
|
+
label: (a1 == null ? void 0 : a1.label) ?? B
|
|
6138
6166
|
};
|
|
6139
6167
|
})
|
|
6140
|
-
]),
|
|
6168
|
+
]), H(void 0), v(l1), K(!0);
|
|
6141
6169
|
}
|
|
6142
6170
|
},
|
|
6143
|
-
[t, F,
|
|
6171
|
+
[t, F, g, f, V]
|
|
6144
6172
|
), N1 = ve(
|
|
6145
6173
|
() => ({
|
|
6146
6174
|
id: n,
|
|
@@ -6159,10 +6187,10 @@ const H1 = 100, l1 = {
|
|
|
6159
6187
|
extraOptions: V,
|
|
6160
6188
|
isLoading: P,
|
|
6161
6189
|
optionRender: p,
|
|
6162
|
-
dropdownRender:
|
|
6163
|
-
readOnly:
|
|
6190
|
+
dropdownRender: w,
|
|
6191
|
+
readOnly: k,
|
|
6164
6192
|
clearable: m,
|
|
6165
|
-
required:
|
|
6193
|
+
required: _,
|
|
6166
6194
|
error: M
|
|
6167
6195
|
}),
|
|
6168
6196
|
[
|
|
@@ -6181,18 +6209,18 @@ const H1 = 100, l1 = {
|
|
|
6181
6209
|
V,
|
|
6182
6210
|
P,
|
|
6183
6211
|
p,
|
|
6212
|
+
w,
|
|
6184
6213
|
k,
|
|
6185
|
-
v,
|
|
6186
6214
|
m,
|
|
6187
|
-
|
|
6215
|
+
_,
|
|
6188
6216
|
M
|
|
6189
6217
|
]
|
|
6190
6218
|
);
|
|
6191
|
-
return
|
|
6219
|
+
return _1(S, () => ({
|
|
6192
6220
|
refetchOptions: async () => {
|
|
6193
|
-
|
|
6221
|
+
v(l1), H(void 0), K(!0);
|
|
6194
6222
|
}
|
|
6195
|
-
})),
|
|
6223
|
+
})), g ? /* @__PURE__ */ r($1, { ...N1, value: s, mode: g }) : /* @__PURE__ */ r("div", { className: "snmt-async-select", children: /* @__PURE__ */ r($1, { ...N1, value: s }) });
|
|
6196
6224
|
}
|
|
6197
6225
|
);
|
|
6198
6226
|
var R1 = /* @__PURE__ */ ((i) => (i.ACTIVE = "Active", i.ARCHIVED = "Archived", i))(R1 || {});
|
|
@@ -6212,11 +6240,11 @@ function W5() {
|
|
|
6212
6240
|
n1(e[0]) && (e[0] = `react-i18next:: ${e[0]}`), console.warn(...e);
|
|
6213
6241
|
}
|
|
6214
6242
|
}
|
|
6215
|
-
const
|
|
6216
|
-
function
|
|
6243
|
+
const Y1 = {};
|
|
6244
|
+
function A1() {
|
|
6217
6245
|
for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
|
|
6218
6246
|
e[t] = arguments[t];
|
|
6219
|
-
n1(e[0]) &&
|
|
6247
|
+
n1(e[0]) && Y1[e[0]] || (n1(e[0]) && (Y1[e[0]] = /* @__PURE__ */ new Date()), W5(...e));
|
|
6220
6248
|
}
|
|
6221
6249
|
const ue = (i, e) => () => {
|
|
6222
6250
|
if (i.isInitialized)
|
|
@@ -6229,9 +6257,9 @@ const ue = (i, e) => () => {
|
|
|
6229
6257
|
};
|
|
6230
6258
|
i.on("initialized", t);
|
|
6231
6259
|
}
|
|
6232
|
-
},
|
|
6260
|
+
}, U1 = (i, e, t) => {
|
|
6233
6261
|
i.loadNamespaces(e, ue(i, t));
|
|
6234
|
-
},
|
|
6262
|
+
}, z1 = (i, e, t, s) => {
|
|
6235
6263
|
n1(t) && (t = [t]), t.forEach((n) => {
|
|
6236
6264
|
i.options.ns.indexOf(n) < 0 && i.options.ns.push(n);
|
|
6237
6265
|
}), i.loadLanguages(e, ue(i, s));
|
|
@@ -6239,14 +6267,14 @@ const ue = (i, e) => () => {
|
|
|
6239
6267
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
6240
6268
|
const s = e.languages[0], n = e.options ? e.options.fallbackLng : !1, o = e.languages[e.languages.length - 1];
|
|
6241
6269
|
if (s.toLowerCase() === "cimode") return !0;
|
|
6242
|
-
const c = (a,
|
|
6243
|
-
const
|
|
6244
|
-
return
|
|
6270
|
+
const c = (a, g) => {
|
|
6271
|
+
const d = e.services.backendConnector.state[`${a}|${g}`];
|
|
6272
|
+
return d === -1 || d === 2;
|
|
6245
6273
|
};
|
|
6246
6274
|
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(o, i)));
|
|
6247
6275
|
}, K5 = function(i, e) {
|
|
6248
6276
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
6249
|
-
return !e.languages || !e.languages.length ? (
|
|
6277
|
+
return !e.languages || !e.languages.length ? (A1("i18n.languages were undefined or empty", e.languages), !0) : e.options.ignoreJSONStructure !== void 0 ? e.hasLoadedNamespace(i, {
|
|
6250
6278
|
lng: t.lng,
|
|
6251
6279
|
precheck: (n, o) => {
|
|
6252
6280
|
if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && n.services.backendConnector.backend && n.isLanguageChangingTo && !o(n.isLanguageChangingTo, i)) return !1;
|
|
@@ -6274,7 +6302,7 @@ const ue = (i, e) => () => {
|
|
|
6274
6302
|
"/": "/",
|
|
6275
6303
|
"/": "/"
|
|
6276
6304
|
}, Y5 = (i) => F5[i], U5 = (i) => i.replace(P5, Y5);
|
|
6277
|
-
let
|
|
6305
|
+
let T1 = {
|
|
6278
6306
|
bindI18n: "languageChanged",
|
|
6279
6307
|
bindI18nStore: "",
|
|
6280
6308
|
transEmptyNodeValue: "",
|
|
@@ -6286,23 +6314,23 @@ let A1 = {
|
|
|
6286
6314
|
};
|
|
6287
6315
|
const z5 = function() {
|
|
6288
6316
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
6289
|
-
|
|
6290
|
-
...
|
|
6317
|
+
T1 = {
|
|
6318
|
+
...T1,
|
|
6291
6319
|
...i
|
|
6292
6320
|
};
|
|
6293
|
-
}, J5 = () =>
|
|
6321
|
+
}, J5 = () => T1;
|
|
6294
6322
|
let Ce;
|
|
6295
|
-
const
|
|
6323
|
+
const q5 = (i) => {
|
|
6296
6324
|
Ce = i;
|
|
6297
|
-
},
|
|
6325
|
+
}, Q5 = () => Ce, X5 = {
|
|
6298
6326
|
type: "3rdParty",
|
|
6299
6327
|
init(i) {
|
|
6300
|
-
z5(i.options.react),
|
|
6328
|
+
z5(i.options.react), q5(i);
|
|
6301
6329
|
}
|
|
6302
6330
|
}, ei = d1();
|
|
6303
6331
|
class ti {
|
|
6304
6332
|
constructor() {
|
|
6305
|
-
|
|
6333
|
+
B1(this, "getUsedNamespaces", () => Object.keys(this.usedNamespaces));
|
|
6306
6334
|
this.usedNamespaces = {};
|
|
6307
6335
|
}
|
|
6308
6336
|
addUsedNamespaces(e) {
|
|
@@ -6312,8 +6340,8 @@ class ti {
|
|
|
6312
6340
|
}
|
|
6313
6341
|
}
|
|
6314
6342
|
const ii = (i, e) => {
|
|
6315
|
-
const t =
|
|
6316
|
-
return
|
|
6343
|
+
const t = q();
|
|
6344
|
+
return j(() => {
|
|
6317
6345
|
t.current = i;
|
|
6318
6346
|
}, [i, e]), t.current;
|
|
6319
6347
|
}, pe = (i, e, t, s) => i.getFixedT(e, t, s), si = (i, e, t, s) => $(pe(i, e, t, s), [i, e, t, s]), ni = function(i) {
|
|
@@ -6323,50 +6351,50 @@ const ii = (i, e) => {
|
|
|
6323
6351
|
} = e, {
|
|
6324
6352
|
i18n: s,
|
|
6325
6353
|
defaultNS: n
|
|
6326
|
-
} = r1(ei) || {}, o = t || s ||
|
|
6354
|
+
} = r1(ei) || {}, o = t || s || Q5();
|
|
6327
6355
|
if (o && !o.reportNamespaces && (o.reportNamespaces = new ti()), !o) {
|
|
6328
|
-
|
|
6329
|
-
const f = (x,
|
|
6356
|
+
A1("You will need to pass in an i18next instance by using initReactI18next");
|
|
6357
|
+
const f = (x, v) => n1(v) ? v : $5(v) && n1(v.defaultValue) ? v.defaultValue : Array.isArray(x) ? x[x.length - 1] : x, N = [f, {}, !1];
|
|
6330
6358
|
return N.t = f, N.i18n = {}, N.ready = !1, N;
|
|
6331
6359
|
}
|
|
6332
|
-
o.options.react && o.options.react.wait !== void 0 &&
|
|
6360
|
+
o.options.react && o.options.react.wait !== void 0 && A1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
6333
6361
|
const c = {
|
|
6334
6362
|
...J5(),
|
|
6335
6363
|
...o.options.react,
|
|
6336
6364
|
...e
|
|
6337
6365
|
}, {
|
|
6338
6366
|
useSuspense: a,
|
|
6339
|
-
keyPrefix:
|
|
6367
|
+
keyPrefix: g
|
|
6340
6368
|
} = c;
|
|
6341
|
-
let
|
|
6342
|
-
|
|
6343
|
-
const l = (o.isInitialized || o.initializedStoreOnce) &&
|
|
6344
|
-
let m =
|
|
6369
|
+
let d = i;
|
|
6370
|
+
d = n1(d) ? [d] : d || ["translation"], o.reportNamespaces.addUsedNamespaces && o.reportNamespaces.addUsedNamespaces(d);
|
|
6371
|
+
const l = (o.isInitialized || o.initializedStoreOnce) && d.every((f) => K5(f, o, c)), h = si(o, e.lng || null, c.nsMode === "fallback" ? d : d[0], g), u = () => h, p = () => pe(o, e.lng || null, c.nsMode === "fallback" ? d : d[0], g), [w, k] = T(u);
|
|
6372
|
+
let m = d.join();
|
|
6345
6373
|
e.lng && (m = `${e.lng}${m}`);
|
|
6346
|
-
const
|
|
6347
|
-
|
|
6374
|
+
const _ = ii(m), M = q(!0);
|
|
6375
|
+
j(() => {
|
|
6348
6376
|
const {
|
|
6349
6377
|
bindI18n: f,
|
|
6350
6378
|
bindI18nStore: N
|
|
6351
6379
|
} = c;
|
|
6352
|
-
M.current = !0, !l && !a && (e.lng ?
|
|
6353
|
-
M.current &&
|
|
6354
|
-
}) :
|
|
6355
|
-
M.current &&
|
|
6356
|
-
})), l &&
|
|
6380
|
+
M.current = !0, !l && !a && (e.lng ? z1(o, e.lng, d, () => {
|
|
6381
|
+
M.current && k(p);
|
|
6382
|
+
}) : U1(o, d, () => {
|
|
6383
|
+
M.current && k(p);
|
|
6384
|
+
})), l && _ && _ !== m && M.current && k(p);
|
|
6357
6385
|
const x = () => {
|
|
6358
|
-
M.current &&
|
|
6386
|
+
M.current && k(p);
|
|
6359
6387
|
};
|
|
6360
6388
|
return f && o && o.on(f, x), N && o && o.store.on(N, x), () => {
|
|
6361
|
-
M.current = !1, f && o && f.split(" ").forEach((
|
|
6389
|
+
M.current = !1, f && o && f.split(" ").forEach((v) => o.off(v, x)), N && o && N.split(" ").forEach((v) => o.store.off(v, x));
|
|
6362
6390
|
};
|
|
6363
|
-
}, [o, m]),
|
|
6364
|
-
M.current && l &&
|
|
6365
|
-
}, [o,
|
|
6366
|
-
const S = [
|
|
6367
|
-
if (S.t =
|
|
6391
|
+
}, [o, m]), j(() => {
|
|
6392
|
+
M.current && l && k(u);
|
|
6393
|
+
}, [o, g, l]);
|
|
6394
|
+
const S = [w, o, l];
|
|
6395
|
+
if (S.t = w, S.i18n = o, S.ready = l, l || !l && !a) return S;
|
|
6368
6396
|
throw new Promise((f) => {
|
|
6369
|
-
e.lng ?
|
|
6397
|
+
e.lng ? z1(o, e.lng, d, () => f()) : U1(o, d, () => f());
|
|
6370
6398
|
});
|
|
6371
6399
|
}, R = (i) => typeof i == "string", C1 = () => {
|
|
6372
6400
|
let i, e;
|
|
@@ -6374,23 +6402,23 @@ const ii = (i, e) => {
|
|
|
6374
6402
|
i = s, e = n;
|
|
6375
6403
|
});
|
|
6376
6404
|
return t.resolve = i, t.reject = e, t;
|
|
6377
|
-
},
|
|
6405
|
+
}, J1 = (i) => i == null ? "" : "" + i, ri = (i, e, t) => {
|
|
6378
6406
|
i.forEach((s) => {
|
|
6379
6407
|
e[s] && (t[s] = e[s]);
|
|
6380
6408
|
});
|
|
6381
|
-
}, oi = /###/g,
|
|
6409
|
+
}, oi = /###/g, q1 = (i) => i && i.indexOf("###") > -1 ? i.replace(oi, ".") : i, Q1 = (i) => !i || R(i), m1 = (i, e, t) => {
|
|
6382
6410
|
const s = R(e) ? e.split(".") : e;
|
|
6383
6411
|
let n = 0;
|
|
6384
6412
|
for (; n < s.length - 1; ) {
|
|
6385
6413
|
if (Q1(i)) return {};
|
|
6386
|
-
const o =
|
|
6414
|
+
const o = q1(s[n]);
|
|
6387
6415
|
!i[o] && t && (i[o] = new t()), Object.prototype.hasOwnProperty.call(i, o) ? i = i[o] : i = {}, ++n;
|
|
6388
6416
|
}
|
|
6389
6417
|
return Q1(i) ? {} : {
|
|
6390
6418
|
obj: i,
|
|
6391
|
-
k:
|
|
6419
|
+
k: q1(s[n])
|
|
6392
6420
|
};
|
|
6393
|
-
},
|
|
6421
|
+
}, X1 = (i, e, t) => {
|
|
6394
6422
|
const {
|
|
6395
6423
|
obj: s,
|
|
6396
6424
|
k: n
|
|
@@ -6456,7 +6484,7 @@ const gi = [" ", ",", "?", "!", ";"], ui = new di(20), Ci = (i, e, t) => {
|
|
|
6456
6484
|
c > 0 && !n.test(i.substring(0, c)) && (o = !0);
|
|
6457
6485
|
}
|
|
6458
6486
|
return o;
|
|
6459
|
-
},
|
|
6487
|
+
}, Z1 = function(i, e) {
|
|
6460
6488
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
|
|
6461
6489
|
if (!i) return;
|
|
6462
6490
|
if (i[e]) return i[e];
|
|
@@ -6466,11 +6494,11 @@ const gi = [" ", ",", "?", "!", ";"], ui = new di(20), Ci = (i, e, t) => {
|
|
|
6466
6494
|
if (!n || typeof n != "object")
|
|
6467
6495
|
return;
|
|
6468
6496
|
let c, a = "";
|
|
6469
|
-
for (let
|
|
6470
|
-
if (
|
|
6471
|
-
if (["string", "number", "boolean"].indexOf(typeof c) > -1 &&
|
|
6497
|
+
for (let g = o; g < s.length; ++g)
|
|
6498
|
+
if (g !== o && (a += t), a += s[g], c = n[a], c !== void 0) {
|
|
6499
|
+
if (["string", "number", "boolean"].indexOf(typeof c) > -1 && g < s.length - 1)
|
|
6472
6500
|
continue;
|
|
6473
|
-
o +=
|
|
6501
|
+
o += g - o + 1;
|
|
6474
6502
|
break;
|
|
6475
6503
|
}
|
|
6476
6504
|
n = c;
|
|
@@ -6533,8 +6561,8 @@ class y1 {
|
|
|
6533
6561
|
return e = e || this.options, e.prefix = e.prefix || this.prefix, new y1(this.logger, e);
|
|
6534
6562
|
}
|
|
6535
6563
|
}
|
|
6536
|
-
var
|
|
6537
|
-
class
|
|
6564
|
+
var X = new y1();
|
|
6565
|
+
class H1 {
|
|
6538
6566
|
constructor() {
|
|
6539
6567
|
this.observers = {};
|
|
6540
6568
|
}
|
|
@@ -6558,17 +6586,17 @@ class _1 {
|
|
|
6558
6586
|
for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
6559
6587
|
s[n - 1] = arguments[n];
|
|
6560
6588
|
this.observers[e] && Array.from(this.observers[e].entries()).forEach((c) => {
|
|
6561
|
-
let [a,
|
|
6562
|
-
for (let
|
|
6589
|
+
let [a, g] = c;
|
|
6590
|
+
for (let d = 0; d < g; d++)
|
|
6563
6591
|
a(...s);
|
|
6564
6592
|
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((c) => {
|
|
6565
|
-
let [a,
|
|
6566
|
-
for (let
|
|
6593
|
+
let [a, g] = c;
|
|
6594
|
+
for (let d = 0; d < g; d++)
|
|
6567
6595
|
a.apply(a, [e, ...s]);
|
|
6568
6596
|
});
|
|
6569
6597
|
}
|
|
6570
6598
|
}
|
|
6571
|
-
class
|
|
6599
|
+
class ee extends H1 {
|
|
6572
6600
|
constructor(e) {
|
|
6573
6601
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
6574
6602
|
ns: ["translation"],
|
|
@@ -6588,8 +6616,8 @@ class X1 extends _1 {
|
|
|
6588
6616
|
const o = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, c = n.ignoreJSONStructure !== void 0 ? n.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
6589
6617
|
let a;
|
|
6590
6618
|
e.indexOf(".") > -1 ? a = e.split(".") : (a = [e, t], s && (Array.isArray(s) ? a.push(...s) : R(s) && o ? a.push(...s.split(o)) : a.push(s)));
|
|
6591
|
-
const
|
|
6592
|
-
return !
|
|
6619
|
+
const g = M1(this.data, a);
|
|
6620
|
+
return !g && !t && !s && e.indexOf(".") > -1 && (e = a[0], t = a[1], s = a.slice(2).join(".")), g || !c || !R(s) ? g : Z1(this.data && this.data[e] && this.data[e][t], s, o);
|
|
6593
6621
|
}
|
|
6594
6622
|
addResource(e, t, s, n) {
|
|
6595
6623
|
let o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
@@ -6597,7 +6625,7 @@ class X1 extends _1 {
|
|
|
6597
6625
|
};
|
|
6598
6626
|
const c = o.keySeparator !== void 0 ? o.keySeparator : this.options.keySeparator;
|
|
6599
6627
|
let a = [e, t];
|
|
6600
|
-
s && (a = a.concat(c ? s.split(c) : s)), e.indexOf(".") > -1 && (a = e.split("."), n = t, t = a[1]), this.addNamespaces(t),
|
|
6628
|
+
s && (a = a.concat(c ? s.split(c) : s)), e.indexOf(".") > -1 && (a = e.split("."), n = t, t = a[1]), this.addNamespaces(t), X1(this.data, a, n), o.silent || this.emit("added", e, t, s, n);
|
|
6601
6629
|
}
|
|
6602
6630
|
addResources(e, t, s) {
|
|
6603
6631
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
|
|
@@ -6615,11 +6643,11 @@ class X1 extends _1 {
|
|
|
6615
6643
|
skipCopy: !1
|
|
6616
6644
|
}, a = [e, t];
|
|
6617
6645
|
e.indexOf(".") > -1 && (a = e.split("."), n = s, s = t, t = a[1]), this.addNamespaces(t);
|
|
6618
|
-
let
|
|
6619
|
-
c.skipCopy || (s = JSON.parse(JSON.stringify(s))), n ? fe(
|
|
6620
|
-
...
|
|
6646
|
+
let g = M1(this.data, a) || {};
|
|
6647
|
+
c.skipCopy || (s = JSON.parse(JSON.stringify(s))), n ? fe(g, s, o) : g = {
|
|
6648
|
+
...g,
|
|
6621
6649
|
...s
|
|
6622
|
-
},
|
|
6650
|
+
}, X1(this.data, a, g), c.silent || this.emit("added", e, t, s);
|
|
6623
6651
|
}
|
|
6624
6652
|
removeResourceBundle(e, t) {
|
|
6625
6653
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -6654,11 +6682,11 @@ var me = {
|
|
|
6654
6682
|
}), e;
|
|
6655
6683
|
}
|
|
6656
6684
|
};
|
|
6657
|
-
const
|
|
6658
|
-
class E1 extends
|
|
6685
|
+
const te = {};
|
|
6686
|
+
class E1 extends H1 {
|
|
6659
6687
|
constructor(e) {
|
|
6660
6688
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6661
|
-
super(), ri(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger =
|
|
6689
|
+
super(), ri(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = X.create("translator");
|
|
6662
6690
|
}
|
|
6663
6691
|
changeLanguage(e) {
|
|
6664
6692
|
e && (this.language = e);
|
|
@@ -6679,14 +6707,14 @@ class E1 extends _1 {
|
|
|
6679
6707
|
let o = t.ns || this.options.defaultNS || [];
|
|
6680
6708
|
const c = s && e.indexOf(s) > -1, a = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ci(e, s, n);
|
|
6681
6709
|
if (c && !a) {
|
|
6682
|
-
const
|
|
6683
|
-
if (
|
|
6710
|
+
const g = e.match(this.interpolator.nestingRegexp);
|
|
6711
|
+
if (g && g.length > 0)
|
|
6684
6712
|
return {
|
|
6685
6713
|
key: e,
|
|
6686
6714
|
namespaces: R(o) ? [o] : o
|
|
6687
6715
|
};
|
|
6688
|
-
const
|
|
6689
|
-
(s !== n || s === n && this.options.ns.indexOf(
|
|
6716
|
+
const d = e.split(s);
|
|
6717
|
+
(s !== n || s === n && this.options.ns.indexOf(d[0]) > -1) && (o = d.shift()), e = d.join(n);
|
|
6690
6718
|
}
|
|
6691
6719
|
return {
|
|
6692
6720
|
key: e,
|
|
@@ -6701,32 +6729,32 @@ class E1 extends _1 {
|
|
|
6701
6729
|
const n = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, o = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
|
|
6702
6730
|
key: c,
|
|
6703
6731
|
namespaces: a
|
|
6704
|
-
} = this.extractFromKey(e[e.length - 1], t),
|
|
6705
|
-
if (
|
|
6732
|
+
} = this.extractFromKey(e[e.length - 1], t), g = a[a.length - 1], d = t.lng || this.language, l = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
6733
|
+
if (d && d.toLowerCase() === "cimode") {
|
|
6706
6734
|
if (l) {
|
|
6707
6735
|
const f = t.nsSeparator || this.options.nsSeparator;
|
|
6708
6736
|
return n ? {
|
|
6709
|
-
res: `${
|
|
6737
|
+
res: `${g}${f}${c}`,
|
|
6710
6738
|
usedKey: c,
|
|
6711
6739
|
exactUsedKey: c,
|
|
6712
|
-
usedLng:
|
|
6713
|
-
usedNS:
|
|
6740
|
+
usedLng: d,
|
|
6741
|
+
usedNS: g,
|
|
6714
6742
|
usedParams: this.getUsedParamsDetails(t)
|
|
6715
|
-
} : `${
|
|
6743
|
+
} : `${g}${f}${c}`;
|
|
6716
6744
|
}
|
|
6717
6745
|
return n ? {
|
|
6718
6746
|
res: c,
|
|
6719
6747
|
usedKey: c,
|
|
6720
6748
|
exactUsedKey: c,
|
|
6721
|
-
usedLng:
|
|
6722
|
-
usedNS:
|
|
6749
|
+
usedLng: d,
|
|
6750
|
+
usedNS: g,
|
|
6723
6751
|
usedParams: this.getUsedParamsDetails(t)
|
|
6724
6752
|
} : c;
|
|
6725
6753
|
}
|
|
6726
6754
|
const h = this.resolve(e, t);
|
|
6727
6755
|
let u = h && h.res;
|
|
6728
|
-
const p = h && h.usedKey || c,
|
|
6729
|
-
if (M && u && S && m.indexOf(
|
|
6756
|
+
const p = h && h.usedKey || c, w = h && h.exactUsedKey || c, k = Object.prototype.toString.apply(u), m = ["[object Number]", "[object Function]", "[object RegExp]"], _ = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, M = !this.i18nFormat || this.i18nFormat.handleAsObject, S = !R(u) && typeof u != "boolean" && typeof u != "number";
|
|
6757
|
+
if (M && u && S && m.indexOf(k) < 0 && !(R(_) && Array.isArray(u))) {
|
|
6730
6758
|
if (!t.returnObjects && !this.options.returnObjects) {
|
|
6731
6759
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
6732
6760
|
const f = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, u, {
|
|
@@ -6736,53 +6764,53 @@ class E1 extends _1 {
|
|
|
6736
6764
|
return n ? (h.res = f, h.usedParams = this.getUsedParamsDetails(t), h) : f;
|
|
6737
6765
|
}
|
|
6738
6766
|
if (o) {
|
|
6739
|
-
const f = Array.isArray(u), N = f ? [] : {}, x = f ?
|
|
6740
|
-
for (const
|
|
6741
|
-
if (Object.prototype.hasOwnProperty.call(u,
|
|
6742
|
-
const P = `${x}${o}${
|
|
6743
|
-
N[
|
|
6767
|
+
const f = Array.isArray(u), N = f ? [] : {}, x = f ? w : p;
|
|
6768
|
+
for (const v in u)
|
|
6769
|
+
if (Object.prototype.hasOwnProperty.call(u, v)) {
|
|
6770
|
+
const P = `${x}${o}${v}`;
|
|
6771
|
+
N[v] = this.translate(P, {
|
|
6744
6772
|
...t,
|
|
6745
6773
|
joinArrays: !1,
|
|
6746
6774
|
ns: a
|
|
6747
|
-
}), N[
|
|
6775
|
+
}), N[v] === P && (N[v] = u[v]);
|
|
6748
6776
|
}
|
|
6749
6777
|
u = N;
|
|
6750
6778
|
}
|
|
6751
|
-
} else if (M && R(
|
|
6752
|
-
u = u.join(
|
|
6779
|
+
} else if (M && R(_) && Array.isArray(u))
|
|
6780
|
+
u = u.join(_), u && (u = this.extendTranslation(u, e, t, s));
|
|
6753
6781
|
else {
|
|
6754
6782
|
let f = !1, N = !1;
|
|
6755
|
-
const x = t.count !== void 0 && !R(t.count),
|
|
6783
|
+
const x = t.count !== void 0 && !R(t.count), v = E1.hasDefaultValue(t), P = x ? this.pluralResolver.getSuffix(d, t.count, t) : "", J = t.ordinal && x ? this.pluralResolver.getSuffix(d, t.count, {
|
|
6756
6784
|
ordinal: !1
|
|
6757
|
-
}) : "", F = x && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(),
|
|
6758
|
-
!this.isValidLookup(u) &&
|
|
6759
|
-
const
|
|
6785
|
+
}) : "", F = x && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), H = F && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${P}`] || t[`defaultValue${J}`] || t.defaultValue;
|
|
6786
|
+
!this.isValidLookup(u) && v && (f = !0, u = H), this.isValidLookup(u) || (N = !0, u = c);
|
|
6787
|
+
const I = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && N ? void 0 : u, V = v && H !== u && this.options.updateMissing;
|
|
6760
6788
|
if (N || f || V) {
|
|
6761
|
-
if (this.logger.log(V ? "updateKey" : "missingKey",
|
|
6762
|
-
const
|
|
6789
|
+
if (this.logger.log(V ? "updateKey" : "missingKey", d, g, c, V ? H : u), o) {
|
|
6790
|
+
const O = this.resolve(c, {
|
|
6763
6791
|
...t,
|
|
6764
6792
|
keySeparator: !1
|
|
6765
6793
|
});
|
|
6766
|
-
|
|
6767
|
-
}
|
|
6768
|
-
let
|
|
6769
|
-
const
|
|
6770
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
6771
|
-
for (let
|
|
6772
|
-
|
|
6773
|
-
else this.options.saveMissingTo === "all" ?
|
|
6774
|
-
const U = (
|
|
6775
|
-
const e1 =
|
|
6776
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(
|
|
6794
|
+
O && O.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.");
|
|
6795
|
+
}
|
|
6796
|
+
let Z = [];
|
|
6797
|
+
const W = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
|
6798
|
+
if (this.options.saveMissingTo === "fallback" && W && W[0])
|
|
6799
|
+
for (let O = 0; O < W.length; O++)
|
|
6800
|
+
Z.push(W[O]);
|
|
6801
|
+
else this.options.saveMissingTo === "all" ? Z = this.languageUtils.toResolveHierarchy(t.lng || this.language) : Z.push(t.lng || this.language);
|
|
6802
|
+
const U = (O, K, G) => {
|
|
6803
|
+
const e1 = v && G !== u ? G : I;
|
|
6804
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(O, g, K, e1, V, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(O, g, K, e1, V, t), this.emit("missingKey", O, g, K, u);
|
|
6777
6805
|
};
|
|
6778
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && x ?
|
|
6779
|
-
const K = this.pluralResolver.getSuffixes(
|
|
6780
|
-
F && t[`defaultValue${this.options.pluralSeparator}zero`] && K.indexOf(`${this.options.pluralSeparator}zero`) < 0 && K.push(`${this.options.pluralSeparator}zero`), K.forEach((
|
|
6781
|
-
U([
|
|
6806
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && x ? Z.forEach((O) => {
|
|
6807
|
+
const K = this.pluralResolver.getSuffixes(O, t);
|
|
6808
|
+
F && t[`defaultValue${this.options.pluralSeparator}zero`] && K.indexOf(`${this.options.pluralSeparator}zero`) < 0 && K.push(`${this.options.pluralSeparator}zero`), K.forEach((G) => {
|
|
6809
|
+
U([O], c + G, t[`defaultValue${G}`] || H);
|
|
6782
6810
|
});
|
|
6783
|
-
}) : U(
|
|
6811
|
+
}) : U(Z, c, H));
|
|
6784
6812
|
}
|
|
6785
|
-
u = this.extendTranslation(u, e, t, h, s), N && u === c && this.options.appendNamespaceToMissingKey && (u = `${
|
|
6813
|
+
u = this.extendTranslation(u, e, t, h, s), N && u === c && this.options.appendNamespaceToMissingKey && (u = `${g}:${c}`), (N || f) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? u = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${g}:${c}` : c, f ? u : void 0) : u = this.options.parseMissingKeyHandler(u));
|
|
6786
6814
|
}
|
|
6787
6815
|
return n ? (h.res = u, h.usedParams = this.getUsedParamsDetails(t), h) : u;
|
|
6788
6816
|
}
|
|
@@ -6803,9 +6831,9 @@ class E1 extends _1 {
|
|
|
6803
6831
|
...s.interpolation
|
|
6804
6832
|
}
|
|
6805
6833
|
});
|
|
6806
|
-
const
|
|
6834
|
+
const d = R(e) && (s && s.interpolation && s.interpolation.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
6807
6835
|
let l;
|
|
6808
|
-
if (
|
|
6836
|
+
if (d) {
|
|
6809
6837
|
const u = e.match(this.interpolator.nestingRegexp);
|
|
6810
6838
|
l = u && u.length;
|
|
6811
6839
|
}
|
|
@@ -6813,18 +6841,18 @@ class E1 extends _1 {
|
|
|
6813
6841
|
if (this.options.interpolation.defaultVariables && (h = {
|
|
6814
6842
|
...this.options.interpolation.defaultVariables,
|
|
6815
6843
|
...h
|
|
6816
|
-
}), e = this.interpolator.interpolate(e, h, s.lng || this.language || n.usedLng, s),
|
|
6844
|
+
}), e = this.interpolator.interpolate(e, h, s.lng || this.language || n.usedLng, s), d) {
|
|
6817
6845
|
const u = e.match(this.interpolator.nestingRegexp), p = u && u.length;
|
|
6818
6846
|
l < p && (s.nest = !1);
|
|
6819
6847
|
}
|
|
6820
6848
|
!s.lng && this.options.compatibilityAPI !== "v1" && n && n.res && (s.lng = this.language || n.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, function() {
|
|
6821
|
-
for (var u = arguments.length, p = new Array(u),
|
|
6822
|
-
p[
|
|
6849
|
+
for (var u = arguments.length, p = new Array(u), w = 0; w < u; w++)
|
|
6850
|
+
p[w] = arguments[w];
|
|
6823
6851
|
return o && o[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);
|
|
6824
6852
|
}, s)), s.interpolation && this.interpolator.reset();
|
|
6825
6853
|
}
|
|
6826
|
-
const a = s.postProcess || this.options.postProcess,
|
|
6827
|
-
return e != null &&
|
|
6854
|
+
const a = s.postProcess || this.options.postProcess, g = R(a) ? [a] : a;
|
|
6855
|
+
return e != null && g && g.length && s.applyPostProcessor !== !1 && (e = me.handle(g, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
6828
6856
|
i18nResolved: {
|
|
6829
6857
|
...n,
|
|
6830
6858
|
usedParams: this.getUsedParamsDetails(s)
|
|
@@ -6834,32 +6862,32 @@ class E1 extends _1 {
|
|
|
6834
6862
|
}
|
|
6835
6863
|
resolve(e) {
|
|
6836
6864
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, n, o, c, a;
|
|
6837
|
-
return R(e) && (e = [e]), e.forEach((
|
|
6865
|
+
return R(e) && (e = [e]), e.forEach((g) => {
|
|
6838
6866
|
if (this.isValidLookup(s)) return;
|
|
6839
|
-
const
|
|
6867
|
+
const d = this.extractFromKey(g, t), l = d.key;
|
|
6840
6868
|
n = l;
|
|
6841
|
-
let h =
|
|
6869
|
+
let h = d.namespaces;
|
|
6842
6870
|
this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
|
|
6843
|
-
const u = t.count !== void 0 && !R(t.count), p = u && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(),
|
|
6871
|
+
const u = t.count !== void 0 && !R(t.count), p = u && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), w = t.context !== void 0 && (R(t.context) || typeof t.context == "number") && t.context !== "", k = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
6844
6872
|
h.forEach((m) => {
|
|
6845
|
-
this.isValidLookup(s) || (a = m, !
|
|
6873
|
+
this.isValidLookup(s) || (a = m, !te[`${k[0]}-${m}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(a) && (te[`${k[0]}-${m}`] = !0, this.logger.warn(`key "${n}" for languages "${k.join(", ")}" won't get resolved as namespace "${a}" 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!!!")), k.forEach((_) => {
|
|
6846
6874
|
if (this.isValidLookup(s)) return;
|
|
6847
|
-
c =
|
|
6875
|
+
c = _;
|
|
6848
6876
|
const M = [l];
|
|
6849
6877
|
if (this.i18nFormat && this.i18nFormat.addLookupKeys)
|
|
6850
|
-
this.i18nFormat.addLookupKeys(M, l,
|
|
6878
|
+
this.i18nFormat.addLookupKeys(M, l, _, m, t);
|
|
6851
6879
|
else {
|
|
6852
6880
|
let f;
|
|
6853
|
-
u && (f = this.pluralResolver.getSuffix(
|
|
6881
|
+
u && (f = this.pluralResolver.getSuffix(_, t.count, t));
|
|
6854
6882
|
const N = `${this.options.pluralSeparator}zero`, x = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
6855
|
-
if (u && (M.push(l + f), t.ordinal && f.indexOf(x) === 0 && M.push(l + f.replace(x, this.options.pluralSeparator)), p && M.push(l + N)),
|
|
6856
|
-
const
|
|
6857
|
-
M.push(
|
|
6883
|
+
if (u && (M.push(l + f), t.ordinal && f.indexOf(x) === 0 && M.push(l + f.replace(x, this.options.pluralSeparator)), p && M.push(l + N)), w) {
|
|
6884
|
+
const v = `${l}${this.options.contextSeparator}${t.context}`;
|
|
6885
|
+
M.push(v), u && (M.push(v + f), t.ordinal && f.indexOf(x) === 0 && M.push(v + f.replace(x, this.options.pluralSeparator)), p && M.push(v + N));
|
|
6858
6886
|
}
|
|
6859
6887
|
}
|
|
6860
6888
|
let S;
|
|
6861
6889
|
for (; S = M.pop(); )
|
|
6862
|
-
this.isValidLookup(s) || (o = S, s = this.getResource(
|
|
6890
|
+
this.isValidLookup(s) || (o = S, s = this.getResource(_, m, S, t));
|
|
6863
6891
|
}));
|
|
6864
6892
|
});
|
|
6865
6893
|
}), {
|
|
@@ -6901,10 +6929,10 @@ class E1 extends _1 {
|
|
|
6901
6929
|
return !1;
|
|
6902
6930
|
}
|
|
6903
6931
|
}
|
|
6904
|
-
const
|
|
6905
|
-
class
|
|
6932
|
+
const O1 = (i) => i.charAt(0).toUpperCase() + i.slice(1);
|
|
6933
|
+
class ie {
|
|
6906
6934
|
constructor(e) {
|
|
6907
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
|
6935
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = X.create("languageUtils");
|
|
6908
6936
|
}
|
|
6909
6937
|
getScriptPartFromCode(e) {
|
|
6910
6938
|
if (e = b1(e), !e || e.indexOf("-") < 0) return null;
|
|
@@ -6926,7 +6954,7 @@ class te {
|
|
|
6926
6954
|
}
|
|
6927
6955
|
const t = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
|
|
6928
6956
|
let s = e.split("-");
|
|
6929
|
-
return this.options.lowerCaseLng ? s = s.map((n) => n.toLowerCase()) : s.length === 2 ? (s[0] = s[0].toLowerCase(), s[1] = s[1].toUpperCase(), t.indexOf(s[1].toLowerCase()) > -1 && (s[1] =
|
|
6957
|
+
return this.options.lowerCaseLng ? s = s.map((n) => n.toLowerCase()) : s.length === 2 ? (s[0] = s[0].toLowerCase(), s[1] = s[1].toUpperCase(), t.indexOf(s[1].toLowerCase()) > -1 && (s[1] = O1(s[1].toLowerCase()))) : s.length === 3 && (s[0] = s[0].toLowerCase(), s[1].length === 2 && (s[1] = s[1].toUpperCase()), s[0] !== "sgn" && s[2].length === 2 && (s[2] = s[2].toUpperCase()), t.indexOf(s[1].toLowerCase()) > -1 && (s[1] = O1(s[1].toLowerCase())), t.indexOf(s[2].toLowerCase()) > -1 && (s[2] = O1(s[2].toLowerCase()))), s.join("-");
|
|
6930
6958
|
}
|
|
6931
6959
|
return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
|
|
6932
6960
|
}
|
|
@@ -7083,7 +7111,7 @@ let fi = [{
|
|
|
7083
7111
|
21: (i) => i % 100 == 1 ? 1 : i % 100 == 2 ? 2 : i % 100 == 3 || i % 100 == 4 ? 3 : 0,
|
|
7084
7112
|
22: (i) => i == 1 ? 0 : i == 2 ? 1 : (i < 0 || i > 10) && i % 10 == 0 ? 2 : 3
|
|
7085
7113
|
};
|
|
7086
|
-
const wi = ["v1", "v2", "v3"], ki = ["v4"],
|
|
7114
|
+
const wi = ["v1", "v2", "v3"], ki = ["v4"], se = {
|
|
7087
7115
|
zero: 0,
|
|
7088
7116
|
one: 1,
|
|
7089
7117
|
two: 2,
|
|
@@ -7104,7 +7132,7 @@ const wi = ["v1", "v2", "v3"], ki = ["v4"], ie = {
|
|
|
7104
7132
|
class vi {
|
|
7105
7133
|
constructor(e) {
|
|
7106
7134
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
7107
|
-
this.languageUtils = e, this.options = t, this.logger =
|
|
7135
|
+
this.languageUtils = e, this.options = t, this.logger = X.create("pluralResolver"), (!this.options.compatibilityJSON || ki.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 = Li(), this.pluralRulesCache = {};
|
|
7108
7136
|
}
|
|
7109
7137
|
addRule(e, t) {
|
|
7110
7138
|
this.rules[e] = t;
|
|
@@ -7128,8 +7156,8 @@ class vi {
|
|
|
7128
7156
|
});
|
|
7129
7157
|
} catch {
|
|
7130
7158
|
if (!e.match(/-|_/)) return;
|
|
7131
|
-
const
|
|
7132
|
-
c = this.getRule(
|
|
7159
|
+
const g = this.languageUtils.getLanguagePartFromCode(e);
|
|
7160
|
+
c = this.getRule(g, t);
|
|
7133
7161
|
}
|
|
7134
7162
|
return this.pluralRulesCache[o] = c, c;
|
|
7135
7163
|
}
|
|
@@ -7147,7 +7175,7 @@ class vi {
|
|
|
7147
7175
|
getSuffixes(e) {
|
|
7148
7176
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
7149
7177
|
const s = this.getRule(e, t);
|
|
7150
|
-
return s ? this.shouldUseIntlApi() ? s.resolvedOptions().pluralCategories.sort((n, o) =>
|
|
7178
|
+
return s ? this.shouldUseIntlApi() ? s.resolvedOptions().pluralCategories.sort((n, o) => se[n] - se[o]).map((n) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${n}`) : s.numbers.map((n) => this.getSuffix(e, n, t)) : [];
|
|
7151
7179
|
}
|
|
7152
7180
|
getSuffix(e, t) {
|
|
7153
7181
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
@@ -7165,14 +7193,14 @@ class vi {
|
|
|
7165
7193
|
return !wi.includes(this.options.compatibilityJSON);
|
|
7166
7194
|
}
|
|
7167
7195
|
}
|
|
7168
|
-
const
|
|
7196
|
+
const ne = function(i, e, t) {
|
|
7169
7197
|
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, o = li(i, e, t);
|
|
7170
|
-
return !o && n && R(t) && (o =
|
|
7171
|
-
},
|
|
7198
|
+
return !o && n && R(t) && (o = Z1(i, t, s), o === void 0 && (o = Z1(e, t, s))), o;
|
|
7199
|
+
}, S1 = (i) => i.replace(/\$/g, "$$$$");
|
|
7172
7200
|
class Ni {
|
|
7173
7201
|
constructor() {
|
|
7174
7202
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
7175
|
-
this.logger =
|
|
7203
|
+
this.logger = X.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
|
|
7176
7204
|
}
|
|
7177
7205
|
init() {
|
|
7178
7206
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -7186,19 +7214,19 @@ class Ni {
|
|
|
7186
7214
|
prefix: o,
|
|
7187
7215
|
prefixEscaped: c,
|
|
7188
7216
|
suffix: a,
|
|
7189
|
-
suffixEscaped:
|
|
7190
|
-
formatSeparator:
|
|
7217
|
+
suffixEscaped: g,
|
|
7218
|
+
formatSeparator: d,
|
|
7191
7219
|
unescapeSuffix: l,
|
|
7192
7220
|
unescapePrefix: h,
|
|
7193
7221
|
nestingPrefix: u,
|
|
7194
7222
|
nestingPrefixEscaped: p,
|
|
7195
|
-
nestingSuffix:
|
|
7196
|
-
nestingSuffixEscaped:
|
|
7223
|
+
nestingSuffix: w,
|
|
7224
|
+
nestingSuffixEscaped: k,
|
|
7197
7225
|
nestingOptionsSeparator: m,
|
|
7198
|
-
maxReplaces:
|
|
7226
|
+
maxReplaces: _,
|
|
7199
7227
|
alwaysFormat: M
|
|
7200
7228
|
} = e.interpolation;
|
|
7201
|
-
this.escape = t !== void 0 ? t : ci, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = o ? h1(o) : c || "{{", this.suffix = a ? h1(a) :
|
|
7229
|
+
this.escape = t !== void 0 ? t : ci, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = o ? h1(o) : c || "{{", this.suffix = a ? h1(a) : g || "}}", this.formatSeparator = d || ",", this.unescapePrefix = l ? "" : h || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = u ? h1(u) : p || h1("$t("), this.nestingSuffix = w ? h1(w) : k || h1(")"), this.nestingOptionsSeparator = m || ",", this.maxReplaces = _ || 1e3, this.alwaysFormat = M !== void 0 ? M : !1, this.resetRegExp();
|
|
7202
7230
|
}
|
|
7203
7231
|
reset() {
|
|
7204
7232
|
this.options && this.init(this.options);
|
|
@@ -7209,83 +7237,83 @@ class Ni {
|
|
|
7209
7237
|
}
|
|
7210
7238
|
interpolate(e, t, s, n) {
|
|
7211
7239
|
let o, c, a;
|
|
7212
|
-
const
|
|
7240
|
+
const g = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, d = (p) => {
|
|
7213
7241
|
if (p.indexOf(this.formatSeparator) < 0) {
|
|
7214
|
-
const
|
|
7215
|
-
return this.alwaysFormat ? this.format(
|
|
7242
|
+
const _ = ne(t, g, p, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
7243
|
+
return this.alwaysFormat ? this.format(_, void 0, s, {
|
|
7216
7244
|
...n,
|
|
7217
7245
|
...t,
|
|
7218
7246
|
interpolationkey: p
|
|
7219
|
-
}) :
|
|
7247
|
+
}) : _;
|
|
7220
7248
|
}
|
|
7221
|
-
const
|
|
7222
|
-
return this.format(
|
|
7249
|
+
const w = p.split(this.formatSeparator), k = w.shift().trim(), m = w.join(this.formatSeparator).trim();
|
|
7250
|
+
return this.format(ne(t, g, k, this.options.keySeparator, this.options.ignoreJSONStructure), m, s, {
|
|
7223
7251
|
...n,
|
|
7224
7252
|
...t,
|
|
7225
|
-
interpolationkey:
|
|
7253
|
+
interpolationkey: k
|
|
7226
7254
|
});
|
|
7227
7255
|
};
|
|
7228
7256
|
this.resetRegExp();
|
|
7229
7257
|
const l = n && n.missingInterpolationHandler || this.options.missingInterpolationHandler, h = n && n.interpolation && n.interpolation.skipOnVariables !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
7230
7258
|
return [{
|
|
7231
7259
|
regex: this.regexpUnescape,
|
|
7232
|
-
safeValue: (p) =>
|
|
7260
|
+
safeValue: (p) => S1(p)
|
|
7233
7261
|
}, {
|
|
7234
7262
|
regex: this.regexp,
|
|
7235
|
-
safeValue: (p) => this.escapeValue ?
|
|
7263
|
+
safeValue: (p) => this.escapeValue ? S1(this.escape(p)) : S1(p)
|
|
7236
7264
|
}].forEach((p) => {
|
|
7237
7265
|
for (a = 0; o = p.regex.exec(e); ) {
|
|
7238
|
-
const
|
|
7239
|
-
if (c =
|
|
7266
|
+
const w = o[1].trim();
|
|
7267
|
+
if (c = d(w), c === void 0)
|
|
7240
7268
|
if (typeof l == "function") {
|
|
7241
7269
|
const m = l(e, o, n);
|
|
7242
7270
|
c = R(m) ? m : "";
|
|
7243
|
-
} else if (n && Object.prototype.hasOwnProperty.call(n,
|
|
7271
|
+
} else if (n && Object.prototype.hasOwnProperty.call(n, w))
|
|
7244
7272
|
c = "";
|
|
7245
7273
|
else if (h) {
|
|
7246
7274
|
c = o[0];
|
|
7247
7275
|
continue;
|
|
7248
7276
|
} else
|
|
7249
|
-
this.logger.warn(`missed to pass in variable ${
|
|
7250
|
-
else !R(c) && !this.useRawValueToEscape && (c =
|
|
7251
|
-
const
|
|
7252
|
-
if (e = e.replace(o[0],
|
|
7277
|
+
this.logger.warn(`missed to pass in variable ${w} for interpolating ${e}`), c = "";
|
|
7278
|
+
else !R(c) && !this.useRawValueToEscape && (c = J1(c));
|
|
7279
|
+
const k = p.safeValue(c);
|
|
7280
|
+
if (e = e.replace(o[0], k), h ? (p.regex.lastIndex += c.length, p.regex.lastIndex -= o[0].length) : p.regex.lastIndex = 0, a++, a >= this.maxReplaces)
|
|
7253
7281
|
break;
|
|
7254
7282
|
}
|
|
7255
7283
|
}), e;
|
|
7256
7284
|
}
|
|
7257
7285
|
nest(e, t) {
|
|
7258
7286
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n, o, c;
|
|
7259
|
-
const a = (
|
|
7287
|
+
const a = (g, d) => {
|
|
7260
7288
|
const l = this.nestingOptionsSeparator;
|
|
7261
|
-
if (
|
|
7262
|
-
const h =
|
|
7289
|
+
if (g.indexOf(l) < 0) return g;
|
|
7290
|
+
const h = g.split(new RegExp(`${l}[ ]*{`));
|
|
7263
7291
|
let u = `{${h[1]}`;
|
|
7264
|
-
|
|
7265
|
-
const p = u.match(/'/g),
|
|
7266
|
-
(p && p.length % 2 === 0 && !
|
|
7292
|
+
g = h[0], u = this.interpolate(u, c);
|
|
7293
|
+
const p = u.match(/'/g), w = u.match(/"/g);
|
|
7294
|
+
(p && p.length % 2 === 0 && !w || w.length % 2 !== 0) && (u = u.replace(/'/g, '"'));
|
|
7267
7295
|
try {
|
|
7268
|
-
c = JSON.parse(u),
|
|
7269
|
-
...
|
|
7296
|
+
c = JSON.parse(u), d && (c = {
|
|
7297
|
+
...d,
|
|
7270
7298
|
...c
|
|
7271
7299
|
});
|
|
7272
|
-
} catch (
|
|
7273
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${
|
|
7300
|
+
} catch (k) {
|
|
7301
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${g}`, k), `${g}${l}${u}`;
|
|
7274
7302
|
}
|
|
7275
|
-
return c.defaultValue && c.defaultValue.indexOf(this.prefix) > -1 && delete c.defaultValue,
|
|
7303
|
+
return c.defaultValue && c.defaultValue.indexOf(this.prefix) > -1 && delete c.defaultValue, g;
|
|
7276
7304
|
};
|
|
7277
7305
|
for (; n = this.nestingRegexp.exec(e); ) {
|
|
7278
|
-
let
|
|
7306
|
+
let g = [];
|
|
7279
7307
|
c = {
|
|
7280
7308
|
...s
|
|
7281
7309
|
}, c = c.replace && !R(c.replace) ? c.replace : c, c.applyPostProcessor = !1, delete c.defaultValue;
|
|
7282
|
-
let
|
|
7310
|
+
let d = !1;
|
|
7283
7311
|
if (n[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(n[1])) {
|
|
7284
7312
|
const l = n[1].split(this.formatSeparator).map((h) => h.trim());
|
|
7285
|
-
n[1] = l.shift(),
|
|
7313
|
+
n[1] = l.shift(), g = l, d = !0;
|
|
7286
7314
|
}
|
|
7287
7315
|
if (o = t(a.call(this, n[1].trim(), c), c), o && n[0] === e && !R(o)) return o;
|
|
7288
|
-
R(o) || (o =
|
|
7316
|
+
R(o) || (o = J1(o)), o || (this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`), o = ""), d && (o = g.reduce((l, h) => this.format(l, h, s.lng, {
|
|
7289
7317
|
...s,
|
|
7290
7318
|
interpolationkey: n[1].trim()
|
|
7291
7319
|
}), o.trim())), e = e.replace(n[0], o), this.regexp.lastIndex = 0;
|
|
@@ -7302,8 +7330,8 @@ const xi = (i) => {
|
|
|
7302
7330
|
const n = s[1].substring(0, s[1].length - 1);
|
|
7303
7331
|
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) => {
|
|
7304
7332
|
if (c) {
|
|
7305
|
-
const [a, ...
|
|
7306
|
-
t[l] || (t[l] =
|
|
7333
|
+
const [a, ...g] = c.split(":"), d = g.join(":").trim().replace(/^'+|'+$/g, ""), l = a.trim();
|
|
7334
|
+
t[l] || (t[l] = d), d === "false" && (t[l] = !1), d === "true" && (t[l] = !0), isNaN(d) || (t[l] = parseInt(d, 10));
|
|
7307
7335
|
}
|
|
7308
7336
|
});
|
|
7309
7337
|
}
|
|
@@ -7327,7 +7355,7 @@ const xi = (i) => {
|
|
|
7327
7355
|
class Ri {
|
|
7328
7356
|
constructor() {
|
|
7329
7357
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
7330
|
-
this.logger =
|
|
7358
|
+
this.logger = X.create("formatter"), this.options = e, this.formats = {
|
|
7331
7359
|
number: c1((t, s) => {
|
|
7332
7360
|
const n = new Intl.NumberFormat(t, {
|
|
7333
7361
|
...s
|
|
@@ -7377,19 +7405,19 @@ class Ri {
|
|
|
7377
7405
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
7378
7406
|
const o = t.split(this.formatSeparator);
|
|
7379
7407
|
if (o.length > 1 && o[0].indexOf("(") > 1 && o[0].indexOf(")") < 0 && o.find((a) => a.indexOf(")") > -1)) {
|
|
7380
|
-
const a = o.findIndex((
|
|
7408
|
+
const a = o.findIndex((g) => g.indexOf(")") > -1);
|
|
7381
7409
|
o[0] = [o[0], ...o.splice(1, a)].join(this.formatSeparator);
|
|
7382
7410
|
}
|
|
7383
|
-
return o.reduce((a,
|
|
7411
|
+
return o.reduce((a, g) => {
|
|
7384
7412
|
const {
|
|
7385
|
-
formatName:
|
|
7413
|
+
formatName: d,
|
|
7386
7414
|
formatOptions: l
|
|
7387
|
-
} = xi(
|
|
7388
|
-
if (this.formats[
|
|
7415
|
+
} = xi(g);
|
|
7416
|
+
if (this.formats[d]) {
|
|
7389
7417
|
let h = a;
|
|
7390
7418
|
try {
|
|
7391
7419
|
const u = n && n.formatParams && n.formatParams[n.interpolationkey] || {}, p = u.locale || u.lng || n.locale || n.lng || s;
|
|
7392
|
-
h = this.formats[
|
|
7420
|
+
h = this.formats[d](a, p, {
|
|
7393
7421
|
...l,
|
|
7394
7422
|
...n,
|
|
7395
7423
|
...u
|
|
@@ -7399,7 +7427,7 @@ class Ri {
|
|
|
7399
7427
|
}
|
|
7400
7428
|
return h;
|
|
7401
7429
|
} else
|
|
7402
|
-
this.logger.warn(`there was no format function for ${
|
|
7430
|
+
this.logger.warn(`there was no format function for ${d}`);
|
|
7403
7431
|
return a;
|
|
7404
7432
|
}, e);
|
|
7405
7433
|
}
|
|
@@ -7407,19 +7435,19 @@ class Ri {
|
|
|
7407
7435
|
const Mi = (i, e) => {
|
|
7408
7436
|
i.pending[e] !== void 0 && (delete i.pending[e], i.pendingCount--);
|
|
7409
7437
|
};
|
|
7410
|
-
class bi extends
|
|
7438
|
+
class bi extends H1 {
|
|
7411
7439
|
constructor(e, t, s) {
|
|
7412
7440
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
7413
|
-
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger =
|
|
7441
|
+
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = X.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);
|
|
7414
7442
|
}
|
|
7415
7443
|
queueLoad(e, t, s, n) {
|
|
7416
|
-
const o = {}, c = {}, a = {},
|
|
7417
|
-
return e.forEach((
|
|
7444
|
+
const o = {}, c = {}, a = {}, g = {};
|
|
7445
|
+
return e.forEach((d) => {
|
|
7418
7446
|
let l = !0;
|
|
7419
7447
|
t.forEach((h) => {
|
|
7420
|
-
const u = `${
|
|
7421
|
-
!s.reload && this.store.hasResourceBundle(
|
|
7422
|
-
}), l || (a[
|
|
7448
|
+
const u = `${d}|${h}`;
|
|
7449
|
+
!s.reload && this.store.hasResourceBundle(d, h) ? this.state[u] = 2 : this.state[u] < 0 || (this.state[u] === 1 ? c[u] === void 0 && (c[u] = !0) : (this.state[u] = 1, l = !1, c[u] === void 0 && (c[u] = !0), o[u] === void 0 && (o[u] = !0), g[h] === void 0 && (g[h] = !0)));
|
|
7450
|
+
}), l || (a[d] = !0);
|
|
7423
7451
|
}), (Object.keys(o).length || Object.keys(c).length) && this.queue.push({
|
|
7424
7452
|
pending: c,
|
|
7425
7453
|
pendingCount: Object.keys(c).length,
|
|
@@ -7430,7 +7458,7 @@ class bi extends _1 {
|
|
|
7430
7458
|
toLoad: Object.keys(o),
|
|
7431
7459
|
pending: Object.keys(c),
|
|
7432
7460
|
toLoadLanguages: Object.keys(a),
|
|
7433
|
-
toLoadNamespaces: Object.keys(
|
|
7461
|
+
toLoadNamespaces: Object.keys(g)
|
|
7434
7462
|
};
|
|
7435
7463
|
}
|
|
7436
7464
|
loaded(e, t, s) {
|
|
@@ -7439,15 +7467,15 @@ class bi extends _1 {
|
|
|
7439
7467
|
skipCopy: !0
|
|
7440
7468
|
}), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
|
|
7441
7469
|
const a = {};
|
|
7442
|
-
this.queue.forEach((
|
|
7443
|
-
ai(
|
|
7444
|
-
a[
|
|
7445
|
-
const l =
|
|
7470
|
+
this.queue.forEach((g) => {
|
|
7471
|
+
ai(g.loaded, [o], c), Mi(g, e), t && g.errors.push(t), g.pendingCount === 0 && !g.done && (Object.keys(g.loaded).forEach((d) => {
|
|
7472
|
+
a[d] || (a[d] = {});
|
|
7473
|
+
const l = g.loaded[d];
|
|
7446
7474
|
l.length && l.forEach((h) => {
|
|
7447
|
-
a[
|
|
7475
|
+
a[d][h] === void 0 && (a[d][h] = !0);
|
|
7448
7476
|
});
|
|
7449
|
-
}),
|
|
7450
|
-
}), this.emit("loaded", a), this.queue = this.queue.filter((
|
|
7477
|
+
}), g.done = !0, g.errors.length ? g.callback(g.errors) : g.callback());
|
|
7478
|
+
}), this.emit("loaded", a), this.queue = this.queue.filter((g) => !g.done);
|
|
7451
7479
|
}
|
|
7452
7480
|
read(e, t, s) {
|
|
7453
7481
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, c = arguments.length > 5 ? arguments[5] : void 0;
|
|
@@ -7464,29 +7492,29 @@ class bi extends _1 {
|
|
|
7464
7492
|
return;
|
|
7465
7493
|
}
|
|
7466
7494
|
this.readingCalls++;
|
|
7467
|
-
const a = (
|
|
7495
|
+
const a = (d, l) => {
|
|
7468
7496
|
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
7469
7497
|
const h = this.waitingReads.shift();
|
|
7470
7498
|
this.read(h.lng, h.ns, h.fcName, h.tried, h.wait, h.callback);
|
|
7471
7499
|
}
|
|
7472
|
-
if (
|
|
7500
|
+
if (d && l && n < this.maxRetries) {
|
|
7473
7501
|
setTimeout(() => {
|
|
7474
7502
|
this.read.call(this, e, t, s, n + 1, o * 2, c);
|
|
7475
7503
|
}, o);
|
|
7476
7504
|
return;
|
|
7477
7505
|
}
|
|
7478
|
-
c(
|
|
7479
|
-
},
|
|
7480
|
-
if (
|
|
7506
|
+
c(d, l);
|
|
7507
|
+
}, g = this.backend[s].bind(this.backend);
|
|
7508
|
+
if (g.length === 2) {
|
|
7481
7509
|
try {
|
|
7482
|
-
const
|
|
7483
|
-
|
|
7484
|
-
} catch (
|
|
7485
|
-
a(
|
|
7510
|
+
const d = g(e, t);
|
|
7511
|
+
d && typeof d.then == "function" ? d.then((l) => a(null, l)).catch(a) : a(null, d);
|
|
7512
|
+
} catch (d) {
|
|
7513
|
+
a(d);
|
|
7486
7514
|
}
|
|
7487
7515
|
return;
|
|
7488
7516
|
}
|
|
7489
|
-
return
|
|
7517
|
+
return g(e, t, a);
|
|
7490
7518
|
}
|
|
7491
7519
|
prepareLoading(e, t) {
|
|
7492
7520
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = arguments.length > 3 ? arguments[3] : void 0;
|
|
@@ -7524,25 +7552,25 @@ class bi extends _1 {
|
|
|
7524
7552
|
}
|
|
7525
7553
|
if (!(s == null || s === "")) {
|
|
7526
7554
|
if (this.backend && this.backend.create) {
|
|
7527
|
-
const
|
|
7555
|
+
const g = {
|
|
7528
7556
|
...c,
|
|
7529
7557
|
isUpdate: o
|
|
7530
|
-
},
|
|
7531
|
-
if (
|
|
7558
|
+
}, d = this.backend.create.bind(this.backend);
|
|
7559
|
+
if (d.length < 6)
|
|
7532
7560
|
try {
|
|
7533
7561
|
let l;
|
|
7534
|
-
|
|
7562
|
+
d.length === 5 ? l = d(e, t, s, n, g) : l = d(e, t, s, n), l && typeof l.then == "function" ? l.then((h) => a(null, h)).catch(a) : a(null, l);
|
|
7535
7563
|
} catch (l) {
|
|
7536
7564
|
a(l);
|
|
7537
7565
|
}
|
|
7538
7566
|
else
|
|
7539
|
-
|
|
7567
|
+
d(e, t, s, n, a, g);
|
|
7540
7568
|
}
|
|
7541
7569
|
!e || !e[0] || this.store.addResource(e[0], t, s, n);
|
|
7542
7570
|
}
|
|
7543
7571
|
}
|
|
7544
7572
|
}
|
|
7545
|
-
const
|
|
7573
|
+
const re = () => ({
|
|
7546
7574
|
debug: !1,
|
|
7547
7575
|
initImmediate: !0,
|
|
7548
7576
|
ns: ["translation"],
|
|
@@ -7598,16 +7626,16 @@ const ne = () => ({
|
|
|
7598
7626
|
maxReplaces: 1e3,
|
|
7599
7627
|
skipOnVariables: !0
|
|
7600
7628
|
}
|
|
7601
|
-
}),
|
|
7629
|
+
}), oe = (i) => (R(i.ns) && (i.ns = [i.ns]), R(i.fallbackLng) && (i.fallbackLng = [i.fallbackLng]), R(i.fallbackNS) && (i.fallbackNS = [i.fallbackNS]), i.supportedLngs && i.supportedLngs.indexOf("cimode") < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), i), x1 = () => {
|
|
7602
7630
|
}, yi = (i) => {
|
|
7603
7631
|
Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
|
|
7604
7632
|
typeof i[t] == "function" && (i[t] = i[t].bind(i));
|
|
7605
7633
|
});
|
|
7606
7634
|
};
|
|
7607
|
-
class w1 extends
|
|
7635
|
+
class w1 extends H1 {
|
|
7608
7636
|
constructor() {
|
|
7609
7637
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
7610
|
-
if (super(), this.options =
|
|
7638
|
+
if (super(), this.options = oe(e), this.services = {}, this.logger = X, this.modules = {
|
|
7611
7639
|
external: []
|
|
7612
7640
|
}, yi(this), t && !this.isInitialized && !e.isClone) {
|
|
7613
7641
|
if (!this.options.initImmediate)
|
|
@@ -7621,37 +7649,37 @@ class w1 extends _1 {
|
|
|
7621
7649
|
var e = this;
|
|
7622
7650
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 ? arguments[1] : void 0;
|
|
7623
7651
|
this.isInitializing = !0, typeof t == "function" && (s = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (R(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
7624
|
-
const n =
|
|
7652
|
+
const n = re();
|
|
7625
7653
|
this.options = {
|
|
7626
7654
|
...n,
|
|
7627
7655
|
...this.options,
|
|
7628
|
-
...
|
|
7656
|
+
...oe(t)
|
|
7629
7657
|
}, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = {
|
|
7630
7658
|
...n.interpolation,
|
|
7631
7659
|
...this.options.interpolation
|
|
7632
7660
|
}), t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
|
|
7633
7661
|
const o = (l) => l ? typeof l == "function" ? new l() : l : null;
|
|
7634
7662
|
if (!this.options.isClone) {
|
|
7635
|
-
this.modules.logger ?
|
|
7663
|
+
this.modules.logger ? X.init(o(this.modules.logger), this.options) : X.init(null, this.options);
|
|
7636
7664
|
let l;
|
|
7637
7665
|
this.modules.formatter ? l = this.modules.formatter : typeof Intl < "u" && (l = Ri);
|
|
7638
|
-
const h = new
|
|
7639
|
-
this.store = new
|
|
7666
|
+
const h = new ie(this.options);
|
|
7667
|
+
this.store = new ee(this.options.resources, this.options);
|
|
7640
7668
|
const u = this.services;
|
|
7641
|
-
u.logger =
|
|
7669
|
+
u.logger = X, u.resourceStore = this.store, u.languageUtils = h, u.pluralResolver = new vi(h, {
|
|
7642
7670
|
prepend: this.options.pluralSeparator,
|
|
7643
7671
|
compatibilityJSON: this.options.compatibilityJSON,
|
|
7644
7672
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
7645
7673
|
}), l && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (u.formatter = o(l), u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new Ni(this.options), u.utils = {
|
|
7646
7674
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
7647
7675
|
}, u.backendConnector = new bi(o(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", function(p) {
|
|
7648
|
-
for (var
|
|
7649
|
-
|
|
7650
|
-
e.emit(p, ...
|
|
7676
|
+
for (var w = arguments.length, k = new Array(w > 1 ? w - 1 : 0), m = 1; m < w; m++)
|
|
7677
|
+
k[m - 1] = arguments[m];
|
|
7678
|
+
e.emit(p, ...k);
|
|
7651
7679
|
}), this.modules.languageDetector && (u.languageDetector = o(this.modules.languageDetector), u.languageDetector.init && u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = o(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new E1(this.services, this.options), this.translator.on("*", function(p) {
|
|
7652
|
-
for (var
|
|
7653
|
-
|
|
7654
|
-
e.emit(p, ...
|
|
7680
|
+
for (var w = arguments.length, k = new Array(w > 1 ? w - 1 : 0), m = 1; m < w; m++)
|
|
7681
|
+
k[m - 1] = arguments[m];
|
|
7682
|
+
e.emit(p, ...k);
|
|
7655
7683
|
}), this.modules.external.forEach((p) => {
|
|
7656
7684
|
p.init && p.init(this);
|
|
7657
7685
|
});
|
|
@@ -7669,14 +7697,14 @@ class w1 extends _1 {
|
|
|
7669
7697
|
return e.store[l](...arguments), e;
|
|
7670
7698
|
};
|
|
7671
7699
|
});
|
|
7672
|
-
const
|
|
7700
|
+
const g = C1(), d = () => {
|
|
7673
7701
|
const l = (h, u) => {
|
|
7674
|
-
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),
|
|
7702
|
+
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), g.resolve(u), s(h, u);
|
|
7675
7703
|
};
|
|
7676
7704
|
if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized) return l(null, this.t.bind(this));
|
|
7677
7705
|
this.changeLanguage(this.options.lng, l);
|
|
7678
7706
|
};
|
|
7679
|
-
return this.options.resources || !this.options.initImmediate ?
|
|
7707
|
+
return this.options.resources || !this.options.initImmediate ? d() : setTimeout(d, 0), g;
|
|
7680
7708
|
}
|
|
7681
7709
|
loadResources(e) {
|
|
7682
7710
|
let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : x1;
|
|
@@ -7685,11 +7713,11 @@ class w1 extends _1 {
|
|
|
7685
7713
|
if (n && n.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
|
|
7686
7714
|
const o = [], c = (a) => {
|
|
7687
7715
|
if (!a || a === "cimode") return;
|
|
7688
|
-
this.services.languageUtils.toResolveHierarchy(a).forEach((
|
|
7689
|
-
|
|
7716
|
+
this.services.languageUtils.toResolveHierarchy(a).forEach((d) => {
|
|
7717
|
+
d !== "cimode" && o.indexOf(d) < 0 && o.push(d);
|
|
7690
7718
|
});
|
|
7691
7719
|
};
|
|
7692
|
-
n ? c(n) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((
|
|
7720
|
+
n ? c(n) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((g) => c(g)), this.options.preload && this.options.preload.forEach((a) => c(a)), this.services.backendConnector.load(o, this.options.ns, (a) => {
|
|
7693
7721
|
!a && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(a);
|
|
7694
7722
|
});
|
|
7695
7723
|
} else
|
|
@@ -7721,19 +7749,19 @@ class w1 extends _1 {
|
|
|
7721
7749
|
this.isLanguageChangingTo = e;
|
|
7722
7750
|
const n = C1();
|
|
7723
7751
|
this.emit("languageChanging", e);
|
|
7724
|
-
const o = (
|
|
7725
|
-
this.language =
|
|
7726
|
-
}, c = (
|
|
7727
|
-
|
|
7752
|
+
const o = (g) => {
|
|
7753
|
+
this.language = g, this.languages = this.services.languageUtils.toResolveHierarchy(g), this.resolvedLanguage = void 0, this.setResolvedLanguage(g);
|
|
7754
|
+
}, c = (g, d) => {
|
|
7755
|
+
d ? (o(d), this.translator.changeLanguage(d), this.isLanguageChangingTo = void 0, this.emit("languageChanged", d), this.logger.log("languageChanged", d)) : this.isLanguageChangingTo = void 0, n.resolve(function() {
|
|
7728
7756
|
return s.t(...arguments);
|
|
7729
|
-
}), t && t(
|
|
7757
|
+
}), t && t(g, function() {
|
|
7730
7758
|
return s.t(...arguments);
|
|
7731
7759
|
});
|
|
7732
|
-
}, a = (
|
|
7733
|
-
!e && !
|
|
7734
|
-
const
|
|
7735
|
-
|
|
7736
|
-
c(l,
|
|
7760
|
+
}, a = (g) => {
|
|
7761
|
+
!e && !g && this.services.languageDetector && (g = []);
|
|
7762
|
+
const d = R(g) ? g : this.services.languageUtils.getBestMatchFromCodes(g);
|
|
7763
|
+
d && (this.language || o(d), this.translator.language || this.translator.changeLanguage(d), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(d)), this.loadResources(d, (l) => {
|
|
7764
|
+
c(l, d);
|
|
7737
7765
|
});
|
|
7738
7766
|
};
|
|
7739
7767
|
return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), n;
|
|
@@ -7741,19 +7769,19 @@ class w1 extends _1 {
|
|
|
7741
7769
|
getFixedT(e, t, s) {
|
|
7742
7770
|
var n = this;
|
|
7743
7771
|
const o = function(c, a) {
|
|
7744
|
-
let
|
|
7772
|
+
let g;
|
|
7745
7773
|
if (typeof a != "object") {
|
|
7746
|
-
for (var
|
|
7774
|
+
for (var d = arguments.length, l = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++)
|
|
7747
7775
|
l[h - 2] = arguments[h];
|
|
7748
|
-
|
|
7776
|
+
g = n.options.overloadTranslationOptionHandler([c, a].concat(l));
|
|
7749
7777
|
} else
|
|
7750
|
-
|
|
7778
|
+
g = {
|
|
7751
7779
|
...a
|
|
7752
7780
|
};
|
|
7753
|
-
|
|
7781
|
+
g.lng = g.lng || o.lng, g.lngs = g.lngs || o.lngs, g.ns = g.ns || o.ns, g.keyPrefix !== "" && (g.keyPrefix = g.keyPrefix || s || o.keyPrefix);
|
|
7754
7782
|
const u = n.options.keySeparator || ".";
|
|
7755
7783
|
let p;
|
|
7756
|
-
return
|
|
7784
|
+
return g.keyPrefix && Array.isArray(c) ? p = c.map((w) => `${g.keyPrefix}${u}${w}`) : p = g.keyPrefix ? `${g.keyPrefix}${u}${c}` : c, n.t(p, g);
|
|
7757
7785
|
};
|
|
7758
7786
|
return R(e) ? o.lng = e : o.lngs = e, o.ns = t, o.keyPrefix = s, o;
|
|
7759
7787
|
}
|
|
@@ -7774,9 +7802,9 @@ class w1 extends _1 {
|
|
|
7774
7802
|
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
7775
7803
|
const s = t.lng || this.resolvedLanguage || this.languages[0], n = this.options ? this.options.fallbackLng : !1, o = this.languages[this.languages.length - 1];
|
|
7776
7804
|
if (s.toLowerCase() === "cimode") return !0;
|
|
7777
|
-
const c = (a,
|
|
7778
|
-
const
|
|
7779
|
-
return
|
|
7805
|
+
const c = (a, g) => {
|
|
7806
|
+
const d = this.services.backendConnector.state[`${a}|${g}`];
|
|
7807
|
+
return d === -1 || d === 0 || d === 2;
|
|
7780
7808
|
};
|
|
7781
7809
|
if (t.precheck) {
|
|
7782
7810
|
const a = t.precheck(this, c);
|
|
@@ -7802,7 +7830,7 @@ class w1 extends _1 {
|
|
|
7802
7830
|
}
|
|
7803
7831
|
dir(e) {
|
|
7804
7832
|
if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
7805
|
-
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], s = this.services && this.services.languageUtils || new
|
|
7833
|
+
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], s = this.services && this.services.languageUtils || new ie(re());
|
|
7806
7834
|
return t.indexOf(s.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
7807
7835
|
}
|
|
7808
7836
|
static createInstance() {
|
|
@@ -7824,10 +7852,10 @@ class w1 extends _1 {
|
|
|
7824
7852
|
...this.services
|
|
7825
7853
|
}, o.services.utils = {
|
|
7826
7854
|
hasLoadedNamespace: o.hasLoadedNamespace.bind(o)
|
|
7827
|
-
}, s && (o.store = new
|
|
7828
|
-
for (var
|
|
7829
|
-
|
|
7830
|
-
o.emit(a, ...
|
|
7855
|
+
}, s && (o.store = new ee(this.store.data, n), o.services.resourceStore = o.store), o.translator = new E1(o.services, n), o.translator.on("*", function(a) {
|
|
7856
|
+
for (var g = arguments.length, d = new Array(g > 1 ? g - 1 : 0), l = 1; l < g; l++)
|
|
7857
|
+
d[l - 1] = arguments[l];
|
|
7858
|
+
o.emit(a, ...d);
|
|
7831
7859
|
}), o.init(n, t), o.translator.options = n, o.translator.backendConnector.services.utils = {
|
|
7832
7860
|
hasLoadedNamespace: o.hasLoadedNamespace.bind(o)
|
|
7833
7861
|
}, o;
|
|
@@ -7887,120 +7915,120 @@ const ji = k1(
|
|
|
7887
7915
|
onChange: o,
|
|
7888
7916
|
onError: c,
|
|
7889
7917
|
allowEmpty: a = !1,
|
|
7890
|
-
showAvatar:
|
|
7891
|
-
clearable:
|
|
7918
|
+
showAvatar: g = !1,
|
|
7919
|
+
clearable: d,
|
|
7892
7920
|
required: l,
|
|
7893
7921
|
error: h
|
|
7894
7922
|
}, u) => {
|
|
7895
|
-
const { axiosPeople: p, locale:
|
|
7896
|
-
if (
|
|
7923
|
+
const { axiosPeople: p, locale: w } = r1(Ee), { t: k } = ni("common", { lng: w }), [m, _] = T([]), [M, S] = T(!0), f = q(m), N = q(null);
|
|
7924
|
+
if (_1(u, () => N.current), !p)
|
|
7897
7925
|
throw new Error(
|
|
7898
7926
|
`UserSelect requires "axiosPeople" to fetch users.
|
|
7899
7927
|
Please provide it via SNMTUiContext.`
|
|
7900
7928
|
);
|
|
7901
7929
|
const x = $(
|
|
7902
|
-
(
|
|
7903
|
-
let
|
|
7904
|
-
return
|
|
7930
|
+
(H) => {
|
|
7931
|
+
let D = "";
|
|
7932
|
+
return H.deletedAt && (D += `[${k("deleted")}] `), H.status === R1.ARCHIVED && (D += `[${k("archived")}] `), `${D}${H.firstName} ${H.lastName}`;
|
|
7905
7933
|
},
|
|
7906
|
-
[
|
|
7907
|
-
),
|
|
7934
|
+
[k]
|
|
7935
|
+
), v = $(
|
|
7908
7936
|
async ({
|
|
7909
|
-
offset:
|
|
7910
|
-
limit:
|
|
7911
|
-
search:
|
|
7937
|
+
offset: H,
|
|
7938
|
+
limit: D,
|
|
7939
|
+
search: I
|
|
7912
7940
|
}) => {
|
|
7913
|
-
var V,
|
|
7941
|
+
var V, Z, W;
|
|
7914
7942
|
try {
|
|
7915
7943
|
const U = await p.post("v1/users/search", {
|
|
7916
|
-
offset:
|
|
7917
|
-
limit:
|
|
7918
|
-
search:
|
|
7944
|
+
offset: H,
|
|
7945
|
+
limit: D,
|
|
7946
|
+
search: I,
|
|
7919
7947
|
...i,
|
|
7920
7948
|
includeCount: !0
|
|
7921
|
-
}), { data:
|
|
7949
|
+
}), { data: O, metadata: K } = U.data;
|
|
7922
7950
|
return {
|
|
7923
|
-
options:
|
|
7924
|
-
value:
|
|
7925
|
-
label: x(
|
|
7926
|
-
image:
|
|
7951
|
+
options: O.map((G) => ({
|
|
7952
|
+
value: G.id,
|
|
7953
|
+
label: x(G),
|
|
7954
|
+
image: g ? G.avatarUrl : void 0
|
|
7927
7955
|
})),
|
|
7928
7956
|
count: K.count
|
|
7929
7957
|
};
|
|
7930
7958
|
} catch (U) {
|
|
7931
7959
|
return c && c({
|
|
7932
7960
|
status: ((V = U.response) == null ? void 0 : V.status) ?? 500,
|
|
7933
|
-
message: ((
|
|
7961
|
+
message: ((W = (Z = U.response) == null ? void 0 : Z.data) == null ? void 0 : W.message) ?? "Error while fetching options"
|
|
7934
7962
|
}), {
|
|
7935
7963
|
options: [],
|
|
7936
7964
|
count: 0
|
|
7937
7965
|
};
|
|
7938
7966
|
}
|
|
7939
7967
|
},
|
|
7940
|
-
[p, i, x,
|
|
7968
|
+
[p, i, x, g, c]
|
|
7941
7969
|
), P = $(
|
|
7942
|
-
async (
|
|
7943
|
-
var
|
|
7970
|
+
async (H) => {
|
|
7971
|
+
var D, I, V;
|
|
7944
7972
|
try {
|
|
7945
|
-
const
|
|
7946
|
-
(
|
|
7973
|
+
const Z = H.filter(
|
|
7974
|
+
(O) => !f.current.some((K) => K.value === O)
|
|
7947
7975
|
);
|
|
7948
|
-
let
|
|
7949
|
-
|
|
7976
|
+
let W = [];
|
|
7977
|
+
Z.length && (W = (await p.post("v1/users/search", {
|
|
7950
7978
|
filters: {
|
|
7951
|
-
id:
|
|
7979
|
+
id: Z,
|
|
7952
7980
|
status: [R1.ACTIVE, R1.ARCHIVED]
|
|
7953
7981
|
}
|
|
7954
7982
|
})).data.data);
|
|
7955
|
-
const U =
|
|
7956
|
-
value:
|
|
7957
|
-
label: x(
|
|
7958
|
-
image:
|
|
7983
|
+
const U = W.map((O) => ({
|
|
7984
|
+
value: O.id,
|
|
7985
|
+
label: x(O),
|
|
7986
|
+
image: g ? O.avatarUrl : void 0
|
|
7959
7987
|
}));
|
|
7960
7988
|
return [...f.current, ...U];
|
|
7961
|
-
} catch (
|
|
7989
|
+
} catch (Z) {
|
|
7962
7990
|
return c && c({
|
|
7963
|
-
status: ((
|
|
7964
|
-
message: ((V = (
|
|
7991
|
+
status: ((D = Z.response) == null ? void 0 : D.status) ?? 500,
|
|
7992
|
+
message: ((V = (I = Z.response) == null ? void 0 : I.data) == null ? void 0 : V.message) ?? "Error while fetching selected items"
|
|
7965
7993
|
}), [];
|
|
7966
7994
|
}
|
|
7967
7995
|
},
|
|
7968
|
-
[p, x, c,
|
|
7996
|
+
[p, x, c, g]
|
|
7969
7997
|
);
|
|
7970
|
-
|
|
7998
|
+
j(() => {
|
|
7971
7999
|
f.current = m;
|
|
7972
|
-
}, [m]),
|
|
7973
|
-
var
|
|
7974
|
-
(
|
|
7975
|
-
}, [i]),
|
|
8000
|
+
}, [m]), j(() => {
|
|
8001
|
+
var H;
|
|
8002
|
+
(H = N.current) == null || H.refetchOptions();
|
|
8003
|
+
}, [i]), j(() => {
|
|
7976
8004
|
if (!n) {
|
|
7977
8005
|
S(!1);
|
|
7978
8006
|
return;
|
|
7979
8007
|
}
|
|
7980
8008
|
(async () => {
|
|
7981
|
-
const
|
|
7982
|
-
|
|
8009
|
+
const D = Array.isArray(n) ? n : [n], I = await P(D);
|
|
8010
|
+
_(I), S(!1);
|
|
7983
8011
|
})();
|
|
7984
8012
|
}, [P, n]);
|
|
7985
8013
|
const J = $(
|
|
7986
8014
|
async ({
|
|
7987
|
-
limit:
|
|
7988
|
-
offset:
|
|
7989
|
-
search:
|
|
8015
|
+
limit: H,
|
|
8016
|
+
offset: D,
|
|
8017
|
+
search: I
|
|
7990
8018
|
}) => {
|
|
7991
|
-
const { count: V, ...
|
|
7992
|
-
offset:
|
|
7993
|
-
limit:
|
|
7994
|
-
search:
|
|
8019
|
+
const { count: V, ...Z } = await v({
|
|
8020
|
+
offset: D,
|
|
8021
|
+
limit: H,
|
|
8022
|
+
search: I
|
|
7995
8023
|
});
|
|
7996
|
-
let
|
|
7997
|
-
return a &&
|
|
7998
|
-
options:
|
|
8024
|
+
let W = Z.options;
|
|
8025
|
+
return a && D === 0 && (W = [{ value: null, label: "None" }, ...W]), {
|
|
8026
|
+
options: W,
|
|
7999
8027
|
count: V,
|
|
8000
|
-
limit:
|
|
8028
|
+
limit: H
|
|
8001
8029
|
};
|
|
8002
8030
|
},
|
|
8003
|
-
[a,
|
|
8031
|
+
[a, v]
|
|
8004
8032
|
);
|
|
8005
8033
|
if (M)
|
|
8006
8034
|
return /* @__PURE__ */ r(j5, {});
|
|
@@ -8008,12 +8036,12 @@ const ji = k1(
|
|
|
8008
8036
|
ref: N,
|
|
8009
8037
|
placeholder: t,
|
|
8010
8038
|
disabled: s,
|
|
8011
|
-
clearable:
|
|
8039
|
+
clearable: d,
|
|
8012
8040
|
required: l,
|
|
8013
8041
|
error: h
|
|
8014
8042
|
};
|
|
8015
8043
|
return e ? /* @__PURE__ */ r(
|
|
8016
|
-
|
|
8044
|
+
F1,
|
|
8017
8045
|
{
|
|
8018
8046
|
...F,
|
|
8019
8047
|
mode: e,
|
|
@@ -8024,7 +8052,7 @@ const ji = k1(
|
|
|
8024
8052
|
extraOptions: m
|
|
8025
8053
|
}
|
|
8026
8054
|
) : /* @__PURE__ */ r(
|
|
8027
|
-
|
|
8055
|
+
F1,
|
|
8028
8056
|
{
|
|
8029
8057
|
...F,
|
|
8030
8058
|
value: n,
|