gc_i18n 1.6.0 → 1.6.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/lib/gc_i18n.es.js +1025 -910
- package/lib/gc_i18n.umd.js +38 -38
- package/package.json +2 -2
- package/packages/libs/i18nUtils.ts +198 -19
package/lib/gc_i18n.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './gc_i18n.css';
|
|
2
|
-
import
|
|
3
|
-
import { h as ve, ref as ne, computed as
|
|
4
|
-
import
|
|
2
|
+
import mt from "keyboardjs";
|
|
3
|
+
import { h as ve, ref as ne, computed as Re, onMounted as jn, nextTick as bt, Vue as Ce } from "vue-demi";
|
|
4
|
+
import Qe from "axios";
|
|
5
5
|
import x from "store2";
|
|
6
6
|
import A from "lodash-es";
|
|
7
|
-
import { jws as
|
|
8
|
-
const
|
|
7
|
+
import { jws as Un } from "jsrsasign";
|
|
8
|
+
const Rn = [
|
|
9
9
|
"ar-SA",
|
|
10
10
|
// 阿拉伯语(沙特阿拉伯)
|
|
11
11
|
"ar-EG",
|
|
@@ -14,22 +14,22 @@ const On = [
|
|
|
14
14
|
// 波斯语(伊朗)
|
|
15
15
|
], ke = (t) => {
|
|
16
16
|
if (!t || typeof t != "string") return !1;
|
|
17
|
-
if (
|
|
17
|
+
if (Rn.includes(t)) return !0;
|
|
18
18
|
const e = t.split("-")[0].toLowerCase();
|
|
19
19
|
return ["ar", "fa"].includes(e);
|
|
20
|
-
},
|
|
20
|
+
}, Hn = (t) => {
|
|
21
21
|
const e = {};
|
|
22
22
|
for (const n of t)
|
|
23
23
|
e[n.key] = n.value;
|
|
24
24
|
return e;
|
|
25
|
-
},
|
|
25
|
+
}, Vn = (t, e, n) => (e.forEach((o) => {
|
|
26
26
|
const s = o.key.split(".");
|
|
27
27
|
s[0] === "common" && A.find(t, { key: `${n}.${s[1]}` }) && A.remove(t, { key: `${n}.${s[1]}` });
|
|
28
28
|
const r = A.find(t, { key: o.key });
|
|
29
29
|
r ? A.merge(r, o) : t.push(o);
|
|
30
|
-
}), t), ie =
|
|
30
|
+
}), t), ie = Qe.create({
|
|
31
31
|
timeout: 8e3
|
|
32
|
-
}), xe = /* @__PURE__ */ new Map(),
|
|
32
|
+
}), xe = /* @__PURE__ */ new Map(), Ke = (t) => String(t || "guest").replace(/[^\w-]/g, "_"), Nt = async ({
|
|
33
33
|
baseUrl: t,
|
|
34
34
|
token: e,
|
|
35
35
|
appCode: n,
|
|
@@ -51,24 +51,24 @@ const On = [
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
if (r.data && r.data.result === 0) {
|
|
54
|
-
const
|
|
54
|
+
const a = A.get(r.data, "retVal", []), c = a.map((i) => ({
|
|
55
55
|
langCode: i.language || i.langCode || i,
|
|
56
56
|
langName: i.langName || i.language || i
|
|
57
57
|
}));
|
|
58
|
-
return x.set("I18N_LANGUAGES",
|
|
58
|
+
return x.set("I18N_LANGUAGES", a), c;
|
|
59
59
|
}
|
|
60
60
|
} catch (r) {
|
|
61
61
|
console.error("获取语言列表失败:", r);
|
|
62
62
|
}
|
|
63
63
|
return [];
|
|
64
|
-
},
|
|
64
|
+
}, Fn = async ({ baseUrl: t, token: e, appCode: n }) => ie.get(
|
|
65
65
|
t + "/i18n-web/app/getsupportedlangs?appCode=" + n,
|
|
66
66
|
{
|
|
67
67
|
headers: {
|
|
68
68
|
Authorization: e
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
),
|
|
71
|
+
), yt = async ({
|
|
72
72
|
appCode: t,
|
|
73
73
|
language: e = "zh-CN",
|
|
74
74
|
lastPullDate: n,
|
|
@@ -76,8 +76,8 @@ const On = [
|
|
|
76
76
|
token: s
|
|
77
77
|
}) => {
|
|
78
78
|
try {
|
|
79
|
-
const r = o + "/i18n-web/kv_translate/kv_translates",
|
|
80
|
-
url:
|
|
79
|
+
const r = o + "/i18n-web/kv_translate/kv_translates", a = n ? r + "?lastPullDate=" + n : r, c = await ie({
|
|
80
|
+
url: a,
|
|
81
81
|
method: "GET",
|
|
82
82
|
headers: {
|
|
83
83
|
appCode: t,
|
|
@@ -89,27 +89,27 @@ const On = [
|
|
|
89
89
|
} catch (r) {
|
|
90
90
|
return console.error("获取翻译数据失败:", r), null;
|
|
91
91
|
}
|
|
92
|
-
},
|
|
92
|
+
}, qn = async ({ data: t, token: e, baseUrl: n }) => ie({
|
|
93
93
|
url: n + "/i18n-web/kv_translate/userDicts",
|
|
94
94
|
method: "POST",
|
|
95
95
|
headers: {
|
|
96
96
|
Authorization: e
|
|
97
97
|
},
|
|
98
98
|
data: t
|
|
99
|
-
}),
|
|
99
|
+
}), Kn = async ({ data: t, token: e, baseUrl: n }) => ie({
|
|
100
100
|
url: n + "/i18n-web/kv_translate/batch",
|
|
101
101
|
method: "POST",
|
|
102
102
|
data: t,
|
|
103
103
|
headers: {
|
|
104
104
|
Authorization: e
|
|
105
105
|
}
|
|
106
|
-
}),
|
|
106
|
+
}), vt = (t) => {
|
|
107
107
|
if (typeof t == "string") {
|
|
108
108
|
const e = t.trim();
|
|
109
109
|
return !e || /^<!doctype/i.test(e) || /^<html/i.test(e) ? (console.warn("i18n_token 接口未返回有效 token,请检查业务项目接口"), "") : e;
|
|
110
110
|
}
|
|
111
111
|
return A.get(t, "retVal.i18n_token") || A.get(t, "retVal.token") || A.get(t, "i18n_token") || A.get(t, "token") || "";
|
|
112
|
-
},
|
|
112
|
+
}, Gn = async ({
|
|
113
113
|
request: t,
|
|
114
114
|
appCode: e,
|
|
115
115
|
orgCode: n,
|
|
@@ -117,13 +117,13 @@ const On = [
|
|
|
117
117
|
token: s
|
|
118
118
|
}) => {
|
|
119
119
|
if (typeof t == "function") {
|
|
120
|
-
const
|
|
120
|
+
const a = await t({
|
|
121
121
|
appCode: e,
|
|
122
122
|
orgCode: n,
|
|
123
123
|
userCode: o,
|
|
124
124
|
token: s
|
|
125
125
|
});
|
|
126
|
-
return
|
|
126
|
+
return vt((a == null ? void 0 : a.data) ?? a);
|
|
127
127
|
}
|
|
128
128
|
const r = await ie({
|
|
129
129
|
url: "/i18n_token",
|
|
@@ -140,8 +140,8 @@ const On = [
|
|
|
140
140
|
userCode: o
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
|
-
return
|
|
144
|
-
},
|
|
143
|
+
return vt(r == null ? void 0 : r.data);
|
|
144
|
+
}, Wn = async ({
|
|
145
145
|
baseUrl: t,
|
|
146
146
|
appCode: e,
|
|
147
147
|
language: n = "zh-CN",
|
|
@@ -150,54 +150,54 @@ const On = [
|
|
|
150
150
|
cacheScope: r = "guest"
|
|
151
151
|
}) => {
|
|
152
152
|
try {
|
|
153
|
-
const
|
|
153
|
+
const a = Ke(r), c = `I18N_${A.toUpper(e)}_${a}`, i = x.namespace(c), u = {
|
|
154
154
|
baseUrl: t,
|
|
155
155
|
appCode: e,
|
|
156
156
|
language: n,
|
|
157
157
|
token: o
|
|
158
|
-
},
|
|
158
|
+
}, d = i.get(n), h = [
|
|
159
159
|
t || "",
|
|
160
160
|
e || "",
|
|
161
161
|
n || "",
|
|
162
|
-
|
|
162
|
+
a,
|
|
163
163
|
o || "",
|
|
164
|
-
A.get(
|
|
164
|
+
A.get(d, "lastPullDate", "")
|
|
165
165
|
].join("|");
|
|
166
166
|
if (xe.has(h))
|
|
167
167
|
return xe.get(h);
|
|
168
168
|
const w = (async () => {
|
|
169
|
-
if (!
|
|
170
|
-
const
|
|
171
|
-
return
|
|
169
|
+
if (!d || !d.lastPullDate) {
|
|
170
|
+
const $ = await yt(u);
|
|
171
|
+
return $ ? (i.set(n, $), A.get($, "translatesDTOs", [])) : A.get(d, "translatesDTOs", []);
|
|
172
172
|
}
|
|
173
|
-
const { lastPullDate: k } =
|
|
174
|
-
...
|
|
173
|
+
const { lastPullDate: k } = d, T = await yt({
|
|
174
|
+
...u,
|
|
175
175
|
lastPullDate: k
|
|
176
176
|
});
|
|
177
|
-
if (!
|
|
178
|
-
return A.get(
|
|
179
|
-
const _ = A.get(
|
|
180
|
-
if (!A.isEmpty(
|
|
181
|
-
const
|
|
182
|
-
lastPullDate:
|
|
183
|
-
translatesDTOs:
|
|
177
|
+
if (!T)
|
|
178
|
+
return A.get(d, "translatesDTOs", []);
|
|
179
|
+
const _ = A.get(d, "translatesDTOs", []);
|
|
180
|
+
if (!A.isEmpty(T.translatesDTOs)) {
|
|
181
|
+
const $ = Vn(_, T.translatesDTOs, s), E = {
|
|
182
|
+
lastPullDate: T.lastPullDate,
|
|
183
|
+
translatesDTOs: $
|
|
184
184
|
};
|
|
185
|
-
return i.set(n, E, ":"),
|
|
185
|
+
return i.set(n, E, ":"), $;
|
|
186
186
|
}
|
|
187
187
|
return _;
|
|
188
188
|
})();
|
|
189
189
|
return xe.set(h, w), w.finally(() => {
|
|
190
190
|
xe.delete(h);
|
|
191
191
|
}), w;
|
|
192
|
-
} catch (
|
|
193
|
-
console.error("处理翻译数据失败:",
|
|
194
|
-
const c =
|
|
192
|
+
} catch (a) {
|
|
193
|
+
console.error("处理翻译数据失败:", a);
|
|
194
|
+
const c = Ke(r), i = x.namespace(`I18N_${A.toUpper(e)}_${c}`);
|
|
195
195
|
return A.get(i.get(n), "translatesDTOs", []);
|
|
196
196
|
}
|
|
197
|
-
},
|
|
197
|
+
}, Yn = ({ appCode: t, cacheScope: e } = {}) => {
|
|
198
198
|
if (t) {
|
|
199
199
|
if (e) {
|
|
200
|
-
x.namespace(`I18N_${A.toUpper(t)}_${
|
|
200
|
+
x.namespace(`I18N_${A.toUpper(t)}_${Ke(e)}`).clearAll();
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
x.namespace(`I18N_${A.toUpper(t)}`).clearAll();
|
|
@@ -207,60 +207,60 @@ const On = [
|
|
|
207
207
|
* sweetalert2 v11.26.18
|
|
208
208
|
* Released under the MIT License.
|
|
209
209
|
*/
|
|
210
|
-
function
|
|
210
|
+
function zt(t, e, n) {
|
|
211
211
|
if (typeof t == "function" ? t === e : t.has(e)) return arguments.length < 3 ? e : n;
|
|
212
212
|
throw new TypeError("Private element is not present on this object");
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Zn(t, e) {
|
|
215
215
|
if (e.has(t)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
return t.get(
|
|
217
|
+
function Ct(t, e) {
|
|
218
|
+
return t.get(zt(t, e));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
220
|
+
function Xn(t, e, n) {
|
|
221
|
+
Zn(t, e), e.set(t, n);
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
return t.set(
|
|
223
|
+
function Jn(t, e, n) {
|
|
224
|
+
return t.set(zt(t, e), n), n;
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const Qn = 100, p = {}, eo = () => {
|
|
227
227
|
p.previousActiveElement instanceof HTMLElement ? (p.previousActiveElement.focus(), p.previousActiveElement = null) : document.body && document.body.focus();
|
|
228
|
-
},
|
|
228
|
+
}, to = (t) => new Promise((e) => {
|
|
229
229
|
if (!t)
|
|
230
230
|
return e();
|
|
231
231
|
const n = window.scrollX, o = window.scrollY;
|
|
232
232
|
p.restoreFocusTimeout = setTimeout(() => {
|
|
233
|
-
|
|
234
|
-
},
|
|
235
|
-
}),
|
|
236
|
-
(t, e) => (t[e] =
|
|
233
|
+
eo(), e();
|
|
234
|
+
}, Qn), window.scrollTo(n, o);
|
|
235
|
+
}), Dt = "swal2-", no = ["container", "shown", "height-auto", "iosfix", "popup", "modal", "no-backdrop", "no-transition", "toast", "toast-shown", "show", "hide", "close", "title", "html-container", "actions", "confirm", "deny", "cancel", "footer", "icon", "icon-content", "image", "input", "file", "range", "select", "radio", "checkbox", "label", "textarea", "inputerror", "input-label", "validation-message", "progress-steps", "active-progress-step", "progress-step", "progress-step-line", "loader", "loading", "styled", "top", "top-start", "top-end", "top-left", "top-right", "center", "center-start", "center-end", "center-left", "center-right", "bottom", "bottom-start", "bottom-end", "bottom-left", "bottom-right", "grow-row", "grow-column", "grow-fullscreen", "rtl", "timer-progress-bar", "timer-progress-bar-container", "scrollbar-measure", "icon-success", "icon-warning", "icon-info", "icon-question", "icon-error", "draggable", "dragging"], l = no.reduce(
|
|
236
|
+
(t, e) => (t[e] = Dt + e, t),
|
|
237
237
|
/** @type {SwalClasses} */
|
|
238
238
|
{}
|
|
239
|
-
),
|
|
240
|
-
(t, e) => (t[e] =
|
|
239
|
+
), oo = ["success", "warning", "info", "question", "error"], Le = oo.reduce(
|
|
240
|
+
(t, e) => (t[e] = Dt + e, t),
|
|
241
241
|
/** @type {SwalIcons} */
|
|
242
242
|
{}
|
|
243
|
-
),
|
|
244
|
-
console.warn(`${
|
|
243
|
+
), jt = "SweetAlert2:", et = (t) => t.charAt(0).toUpperCase() + t.slice(1), z = (t) => {
|
|
244
|
+
console.warn(`${jt} ${typeof t == "object" ? t.join(" ") : t}`);
|
|
245
245
|
}, ee = (t) => {
|
|
246
|
-
console.error(`${
|
|
247
|
-
},
|
|
248
|
-
|
|
249
|
-
},
|
|
250
|
-
|
|
251
|
-
}, Oe = (t) => typeof t == "function" ? t() : t,
|
|
252
|
-
const e =
|
|
246
|
+
console.error(`${jt} ${t}`);
|
|
247
|
+
}, kt = [], so = (t) => {
|
|
248
|
+
kt.includes(t) || (kt.push(t), z(t));
|
|
249
|
+
}, Ut = (t, e = null) => {
|
|
250
|
+
so(`"${t}" is deprecated and will be removed in the next major release.${e ? ` Use "${e}" instead.` : ""}`);
|
|
251
|
+
}, Oe = (t) => typeof t == "function" ? t() : t, tt = (t) => t && typeof t.toPromise == "function", fe = (t) => tt(t) ? t.toPromise() : Promise.resolve(t), nt = (t) => t && Promise.resolve(t) === t, D = () => document.body.querySelector(`.${l.container}`), pe = (t) => {
|
|
252
|
+
const e = D();
|
|
253
253
|
return e ? e.querySelector(t) : null;
|
|
254
|
-
}, R = (t) => pe(`.${t}`),
|
|
254
|
+
}, R = (t) => pe(`.${t}`), S = () => R(l.popup), ae = () => R(l.icon), ro = () => R(l["icon-content"]), Rt = () => R(l.title), ot = () => R(l["html-container"]), Ht = () => R(l.image), st = () => R(l["progress-steps"]), Ne = () => R(l["validation-message"]), q = () => (
|
|
255
255
|
/** @type {HTMLButtonElement} */
|
|
256
|
-
pe(`.${
|
|
256
|
+
pe(`.${l.actions} .${l.confirm}`)
|
|
257
257
|
), le = () => (
|
|
258
258
|
/** @type {HTMLButtonElement} */
|
|
259
|
-
pe(`.${
|
|
259
|
+
pe(`.${l.actions} .${l.cancel}`)
|
|
260
260
|
), te = () => (
|
|
261
261
|
/** @type {HTMLButtonElement} */
|
|
262
|
-
pe(`.${
|
|
263
|
-
),
|
|
262
|
+
pe(`.${l.actions} .${l.deny}`)
|
|
263
|
+
), io = () => R(l["input-label"]), ce = () => pe(`.${l.loader}`), ge = () => R(l.actions), Vt = () => R(l.footer), ze = () => R(l["timer-progress-bar"]), rt = () => R(l.close), ao = `
|
|
264
264
|
a[href],
|
|
265
265
|
area[href],
|
|
266
266
|
input:not([disabled]),
|
|
@@ -275,30 +275,30 @@ const Gn = 100, p = {}, Wn = () => {
|
|
|
275
275
|
audio[controls],
|
|
276
276
|
video[controls],
|
|
277
277
|
summary
|
|
278
|
-
`,
|
|
279
|
-
const t =
|
|
278
|
+
`, it = () => {
|
|
279
|
+
const t = S();
|
|
280
280
|
if (!t)
|
|
281
281
|
return [];
|
|
282
|
-
const e = t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'), n = Array.from(e).sort((r,
|
|
283
|
-
const c = parseInt(r.getAttribute("tabindex") || "0"), i = parseInt(
|
|
282
|
+
const e = t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'), n = Array.from(e).sort((r, a) => {
|
|
283
|
+
const c = parseInt(r.getAttribute("tabindex") || "0"), i = parseInt(a.getAttribute("tabindex") || "0");
|
|
284
284
|
return c > i ? 1 : c < i ? -1 : 0;
|
|
285
|
-
}), o = t.querySelectorAll(
|
|
286
|
-
return [...new Set(n.concat(s))].filter((r) =>
|
|
287
|
-
},
|
|
288
|
-
const t =
|
|
289
|
-
return t ? K(t,
|
|
290
|
-
},
|
|
291
|
-
const t =
|
|
285
|
+
}), o = t.querySelectorAll(ao), s = Array.from(o).filter((r) => r.getAttribute("tabindex") !== "-1");
|
|
286
|
+
return [...new Set(n.concat(s))].filter((r) => j(r));
|
|
287
|
+
}, at = () => K(document.body, l.shown) && !K(document.body, l["toast-shown"]) && !K(document.body, l["no-backdrop"]), De = () => {
|
|
288
|
+
const t = S();
|
|
289
|
+
return t ? K(t, l.toast) : !1;
|
|
290
|
+
}, lo = () => {
|
|
291
|
+
const t = S();
|
|
292
292
|
return t ? t.hasAttribute("data-loading") : !1;
|
|
293
293
|
}, H = (t, e) => {
|
|
294
294
|
if (t.textContent = "", e) {
|
|
295
295
|
const o = new DOMParser().parseFromString(e, "text/html"), s = o.querySelector("head");
|
|
296
|
-
s && Array.from(s.childNodes).forEach((
|
|
297
|
-
t.appendChild(
|
|
296
|
+
s && Array.from(s.childNodes).forEach((a) => {
|
|
297
|
+
t.appendChild(a);
|
|
298
298
|
});
|
|
299
299
|
const r = o.querySelector("body");
|
|
300
|
-
r && Array.from(r.childNodes).forEach((
|
|
301
|
-
|
|
300
|
+
r && Array.from(r.childNodes).forEach((a) => {
|
|
301
|
+
a instanceof HTMLVideoElement || a instanceof HTMLAudioElement ? t.appendChild(a.cloneNode(!0)) : t.appendChild(a);
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
}, K = (t, e) => {
|
|
@@ -309,12 +309,12 @@ const Gn = 100, p = {}, Wn = () => {
|
|
|
309
309
|
if (!t.classList.contains(n[o]))
|
|
310
310
|
return !1;
|
|
311
311
|
return !0;
|
|
312
|
-
},
|
|
312
|
+
}, co = (t, e) => {
|
|
313
313
|
Array.from(t.classList).forEach((n) => {
|
|
314
|
-
!Object.values(
|
|
314
|
+
!Object.values(l).includes(n) && !Object.values(Le).includes(n) && !Object.values(e.showClass || {}).includes(n) && t.classList.remove(n);
|
|
315
315
|
});
|
|
316
316
|
}, U = (t, e, n) => {
|
|
317
|
-
if (
|
|
317
|
+
if (co(t, e), !e.customClass)
|
|
318
318
|
return;
|
|
319
319
|
const o = e.customClass[
|
|
320
320
|
/** @type {keyof SweetAlertCustomClass} */
|
|
@@ -327,38 +327,38 @@ const Gn = 100, p = {}, Wn = () => {
|
|
|
327
327
|
}
|
|
328
328
|
L(t, o);
|
|
329
329
|
}
|
|
330
|
-
},
|
|
330
|
+
}, je = (t, e) => {
|
|
331
331
|
if (!e)
|
|
332
332
|
return null;
|
|
333
333
|
switch (e) {
|
|
334
334
|
case "select":
|
|
335
335
|
case "textarea":
|
|
336
336
|
case "file":
|
|
337
|
-
return t.querySelector(`.${
|
|
337
|
+
return t.querySelector(`.${l.popup} > .${l[e]}`);
|
|
338
338
|
case "checkbox":
|
|
339
|
-
return t.querySelector(`.${
|
|
339
|
+
return t.querySelector(`.${l.popup} > .${l.checkbox} input`);
|
|
340
340
|
case "radio":
|
|
341
|
-
return t.querySelector(`.${
|
|
341
|
+
return t.querySelector(`.${l.popup} > .${l.radio} input:checked`) || t.querySelector(`.${l.popup} > .${l.radio} input:first-child`);
|
|
342
342
|
case "range":
|
|
343
|
-
return t.querySelector(`.${
|
|
343
|
+
return t.querySelector(`.${l.popup} > .${l.range} input`);
|
|
344
344
|
default:
|
|
345
|
-
return t.querySelector(`.${
|
|
345
|
+
return t.querySelector(`.${l.popup} > .${l.input}`);
|
|
346
346
|
}
|
|
347
|
-
},
|
|
347
|
+
}, Ft = (t) => {
|
|
348
348
|
if (t.focus(), t.type !== "file") {
|
|
349
349
|
const e = t.value;
|
|
350
350
|
t.value = "", t.value = e;
|
|
351
351
|
}
|
|
352
|
-
},
|
|
352
|
+
}, qt = (t, e, n) => {
|
|
353
353
|
!t || !e || (typeof e == "string" && (e = e.split(/\s+/).filter(Boolean)), e.forEach((o) => {
|
|
354
354
|
Array.isArray(t) ? t.forEach((s) => {
|
|
355
355
|
n ? s.classList.add(o) : s.classList.remove(o);
|
|
356
356
|
}) : n ? t.classList.add(o) : t.classList.remove(o);
|
|
357
357
|
}));
|
|
358
358
|
}, L = (t, e) => {
|
|
359
|
-
|
|
359
|
+
qt(t, e, !0);
|
|
360
360
|
}, V = (t, e) => {
|
|
361
|
-
|
|
361
|
+
qt(t, e, !1);
|
|
362
362
|
}, G = (t, e) => {
|
|
363
363
|
const n = Array.from(t.children);
|
|
364
364
|
for (let o = 0; o < n.length; o++) {
|
|
@@ -375,38 +375,38 @@ const Gn = 100, p = {}, Wn = () => {
|
|
|
375
375
|
t && (t.style.display = e);
|
|
376
376
|
}, N = (t) => {
|
|
377
377
|
t && (t.style.display = "none");
|
|
378
|
-
},
|
|
378
|
+
}, lt = (t, e = "block") => {
|
|
379
379
|
t && new MutationObserver(() => {
|
|
380
380
|
me(t, t.innerHTML, e);
|
|
381
381
|
}).observe(t, {
|
|
382
382
|
childList: !0,
|
|
383
383
|
subtree: !0
|
|
384
384
|
});
|
|
385
|
-
},
|
|
385
|
+
}, xt = (t, e, n, o) => {
|
|
386
386
|
const s = t.querySelector(e);
|
|
387
387
|
s && s.style.setProperty(n, o);
|
|
388
388
|
}, me = (t, e, n = "flex") => {
|
|
389
389
|
e ? M(t, n) : N(t);
|
|
390
|
-
},
|
|
390
|
+
}, j = (t) => !!(t && (t.offsetWidth || t.offsetHeight || t.getClientRects().length)), uo = () => !j(q()) && !j(te()) && !j(le()), Ge = (t) => t.scrollHeight > t.clientHeight, ho = (t, e) => {
|
|
391
391
|
let n = (
|
|
392
392
|
/** @type {HTMLElement | null} */
|
|
393
393
|
t
|
|
394
394
|
);
|
|
395
395
|
for (; n && n !== e; ) {
|
|
396
|
-
if (
|
|
396
|
+
if (Ge(n))
|
|
397
397
|
return !0;
|
|
398
398
|
n = n.parentElement;
|
|
399
399
|
}
|
|
400
400
|
return !1;
|
|
401
|
-
},
|
|
401
|
+
}, Kt = (t) => {
|
|
402
402
|
const e = window.getComputedStyle(t), n = parseFloat(e.getPropertyValue("animation-duration") || "0"), o = parseFloat(e.getPropertyValue("transition-duration") || "0");
|
|
403
403
|
return n > 0 || o > 0;
|
|
404
|
-
},
|
|
404
|
+
}, ct = (t, e = !1) => {
|
|
405
405
|
const n = ze();
|
|
406
|
-
n &&
|
|
406
|
+
n && j(n) && (e && (n.style.transition = "none", n.style.width = "100%"), setTimeout(() => {
|
|
407
407
|
n.style.transition = `width ${t / 1e3}s linear`, n.style.width = "0%";
|
|
408
408
|
}, 10));
|
|
409
|
-
},
|
|
409
|
+
}, wo = () => {
|
|
410
410
|
const t = ze();
|
|
411
411
|
if (!t)
|
|
412
412
|
return;
|
|
@@ -414,60 +414,60 @@ const Gn = 100, p = {}, Wn = () => {
|
|
|
414
414
|
t.style.removeProperty("transition"), t.style.width = "100%";
|
|
415
415
|
const n = parseInt(window.getComputedStyle(t).width), o = e / n * 100;
|
|
416
416
|
t.style.width = `${o}%`;
|
|
417
|
-
},
|
|
418
|
-
<div aria-labelledby="${
|
|
419
|
-
<button type="button" class="${
|
|
420
|
-
<ul class="${
|
|
421
|
-
<div class="${
|
|
422
|
-
<img class="${
|
|
423
|
-
<h2 class="${
|
|
424
|
-
<div class="${
|
|
425
|
-
<input class="${
|
|
426
|
-
<input type="file" class="${
|
|
427
|
-
<div class="${
|
|
417
|
+
}, fo = () => typeof window > "u" || typeof document > "u", po = `
|
|
418
|
+
<div aria-labelledby="${l.title}" aria-describedby="${l["html-container"]}" class="${l.popup}" tabindex="-1">
|
|
419
|
+
<button type="button" class="${l.close}"></button>
|
|
420
|
+
<ul class="${l["progress-steps"]}"></ul>
|
|
421
|
+
<div class="${l.icon}"></div>
|
|
422
|
+
<img class="${l.image}" />
|
|
423
|
+
<h2 class="${l.title}" id="${l.title}"></h2>
|
|
424
|
+
<div class="${l["html-container"]}" id="${l["html-container"]}"></div>
|
|
425
|
+
<input class="${l.input}" id="${l.input}" />
|
|
426
|
+
<input type="file" class="${l.file}" />
|
|
427
|
+
<div class="${l.range}">
|
|
428
428
|
<input type="range" />
|
|
429
429
|
<output></output>
|
|
430
430
|
</div>
|
|
431
|
-
<select class="${
|
|
432
|
-
<div class="${
|
|
433
|
-
<label class="${
|
|
434
|
-
<input type="checkbox" id="${
|
|
435
|
-
<span class="${
|
|
431
|
+
<select class="${l.select}" id="${l.select}"></select>
|
|
432
|
+
<div class="${l.radio}"></div>
|
|
433
|
+
<label class="${l.checkbox}">
|
|
434
|
+
<input type="checkbox" id="${l.checkbox}" />
|
|
435
|
+
<span class="${l.label}"></span>
|
|
436
436
|
</label>
|
|
437
|
-
<textarea class="${
|
|
438
|
-
<div class="${
|
|
439
|
-
<div class="${
|
|
440
|
-
<div class="${
|
|
441
|
-
<button type="button" class="${
|
|
442
|
-
<button type="button" class="${
|
|
443
|
-
<button type="button" class="${
|
|
437
|
+
<textarea class="${l.textarea}" id="${l.textarea}"></textarea>
|
|
438
|
+
<div class="${l["validation-message"]}" id="${l["validation-message"]}"></div>
|
|
439
|
+
<div class="${l.actions}">
|
|
440
|
+
<div class="${l.loader}"></div>
|
|
441
|
+
<button type="button" class="${l.confirm}"></button>
|
|
442
|
+
<button type="button" class="${l.deny}"></button>
|
|
443
|
+
<button type="button" class="${l.cancel}"></button>
|
|
444
444
|
</div>
|
|
445
|
-
<div class="${
|
|
446
|
-
<div class="${
|
|
447
|
-
<div class="${
|
|
445
|
+
<div class="${l.footer}"></div>
|
|
446
|
+
<div class="${l["timer-progress-bar-container"]}">
|
|
447
|
+
<div class="${l["timer-progress-bar"]}"></div>
|
|
448
448
|
</div>
|
|
449
449
|
</div>
|
|
450
|
-
`.replace(/(^|\n)\s*/g, ""),
|
|
451
|
-
const t =
|
|
450
|
+
`.replace(/(^|\n)\s*/g, ""), go = () => {
|
|
451
|
+
const t = D();
|
|
452
452
|
return t ? (t.remove(), V([document.documentElement, document.body], [
|
|
453
|
-
|
|
454
|
-
|
|
453
|
+
l["no-backdrop"],
|
|
454
|
+
l["toast-shown"],
|
|
455
455
|
// @ts-ignore: 'has-column' is not defined in swalClasses but may be set dynamically
|
|
456
|
-
|
|
456
|
+
l["has-column"]
|
|
457
457
|
]), !0) : !1;
|
|
458
458
|
}, Z = () => {
|
|
459
459
|
p.currentInstance && p.currentInstance.resetValidationMessage();
|
|
460
|
-
},
|
|
461
|
-
const t =
|
|
460
|
+
}, mo = () => {
|
|
461
|
+
const t = S();
|
|
462
462
|
if (!t)
|
|
463
463
|
return;
|
|
464
|
-
const e = G(t,
|
|
465
|
-
e && (e.oninput = Z), n && (n.onchange = Z), r && (r.onchange = Z),
|
|
464
|
+
const e = G(t, l.input), n = G(t, l.file), o = t.querySelector(`.${l.range} input`), s = t.querySelector(`.${l.range} output`), r = G(t, l.select), a = t.querySelector(`.${l.checkbox} input`), c = G(t, l.textarea);
|
|
465
|
+
e && (e.oninput = Z), n && (n.onchange = Z), r && (r.onchange = Z), a && (a.onchange = Z), c && (c.oninput = Z), o && s && (o.oninput = () => {
|
|
466
466
|
Z(), s.value = o.value;
|
|
467
467
|
}, o.onchange = () => {
|
|
468
468
|
Z(), s.value = o.value;
|
|
469
469
|
});
|
|
470
|
-
},
|
|
470
|
+
}, bo = (t) => {
|
|
471
471
|
if (typeof t == "string") {
|
|
472
472
|
const e = document.querySelector(t);
|
|
473
473
|
if (!e)
|
|
@@ -478,171 +478,171 @@ const Gn = 100, p = {}, Wn = () => {
|
|
|
478
478
|
);
|
|
479
479
|
}
|
|
480
480
|
return t;
|
|
481
|
-
},
|
|
482
|
-
const e =
|
|
481
|
+
}, yo = (t) => {
|
|
482
|
+
const e = S();
|
|
483
483
|
e && (e.setAttribute("role", t.toast ? "alert" : "dialog"), e.setAttribute("aria-live", t.toast ? "polite" : "assertive"), t.toast || e.setAttribute("aria-modal", "true"));
|
|
484
|
-
},
|
|
485
|
-
window.getComputedStyle(t).direction === "rtl" && (L(
|
|
486
|
-
},
|
|
487
|
-
const e =
|
|
488
|
-
if (
|
|
484
|
+
}, vo = (t) => {
|
|
485
|
+
window.getComputedStyle(t).direction === "rtl" && (L(D(), l.rtl), p.isRTL = !0);
|
|
486
|
+
}, Co = (t) => {
|
|
487
|
+
const e = go();
|
|
488
|
+
if (fo()) {
|
|
489
489
|
ee("SweetAlert2 requires document to initialize");
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
492
|
const n = document.createElement("div");
|
|
493
|
-
n.className =
|
|
494
|
-
const o =
|
|
495
|
-
o.appendChild(n), t.topLayer && (n.setAttribute("popover", ""), n.showPopover()),
|
|
496
|
-
},
|
|
497
|
-
t instanceof HTMLElement ? e.appendChild(t) : typeof t == "object" ?
|
|
498
|
-
},
|
|
499
|
-
"jquery" in t ?
|
|
500
|
-
},
|
|
493
|
+
n.className = l.container, e && L(n, l["no-transition"]), H(n, po), n.dataset.swal2Theme = t.theme;
|
|
494
|
+
const o = bo(t.target || "body");
|
|
495
|
+
o.appendChild(n), t.topLayer && (n.setAttribute("popover", ""), n.showPopover()), yo(t), vo(o), mo();
|
|
496
|
+
}, ut = (t, e) => {
|
|
497
|
+
t instanceof HTMLElement ? e.appendChild(t) : typeof t == "object" ? ko(t, e) : t && H(e, t);
|
|
498
|
+
}, ko = (t, e) => {
|
|
499
|
+
"jquery" in t ? xo(e, t) : H(e, t.toString());
|
|
500
|
+
}, xo = (t, e) => {
|
|
501
501
|
if (t.textContent = "", 0 in e)
|
|
502
502
|
for (let n = 0; n in e; n++)
|
|
503
503
|
t.appendChild(e[n].cloneNode(!0));
|
|
504
504
|
else
|
|
505
505
|
t.appendChild(e.cloneNode(!0));
|
|
506
|
-
},
|
|
506
|
+
}, Ao = (t, e) => {
|
|
507
507
|
const n = ge(), o = ce();
|
|
508
|
-
!n || !o || (!e.showConfirmButton && !e.showDenyButton && !e.showCancelButton ? N(n) : M(n), U(n, e, "actions"),
|
|
508
|
+
!n || !o || (!e.showConfirmButton && !e.showDenyButton && !e.showCancelButton ? N(n) : M(n), U(n, e, "actions"), Eo(n, o, e), H(o, e.loaderHtml || ""), U(o, e, "loader"));
|
|
509
509
|
};
|
|
510
|
-
function
|
|
510
|
+
function Eo(t, e, n) {
|
|
511
511
|
const o = q(), s = te(), r = le();
|
|
512
|
-
!o || !s || !r || (
|
|
512
|
+
!o || !s || !r || (Ve(o, "confirm", n), Ve(s, "deny", n), Ve(r, "cancel", n), Lo(o, s, r, n), n.reverseButtons && (n.toast ? (t.insertBefore(r, o), t.insertBefore(s, o)) : (t.insertBefore(r, e), t.insertBefore(s, e), t.insertBefore(o, e))));
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function Lo(t, e, n, o) {
|
|
515
515
|
if (!o.buttonsStyling) {
|
|
516
|
-
V([t, e, n],
|
|
516
|
+
V([t, e, n], l.styled);
|
|
517
517
|
return;
|
|
518
518
|
}
|
|
519
|
-
L([t, e, n],
|
|
519
|
+
L([t, e, n], l.styled), o.confirmButtonColor && t.style.setProperty("--swal2-confirm-button-background-color", o.confirmButtonColor), o.denyButtonColor && e.style.setProperty("--swal2-deny-button-background-color", o.denyButtonColor), o.cancelButtonColor && n.style.setProperty("--swal2-cancel-button-background-color", o.cancelButtonColor), He(t), He(e), He(n);
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function He(t) {
|
|
522
522
|
const e = window.getComputedStyle(t);
|
|
523
523
|
if (e.getPropertyValue("--swal2-action-button-focus-box-shadow"))
|
|
524
524
|
return;
|
|
525
525
|
const n = e.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/, "rgba($1, $2, $3, 0.5)");
|
|
526
526
|
t.style.setProperty("--swal2-action-button-focus-box-shadow", e.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/, ` ${n}`));
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Ve(t, e, n) {
|
|
529
529
|
const o = (
|
|
530
530
|
/** @type {'Confirm' | 'Deny' | 'Cancel'} */
|
|
531
|
-
|
|
531
|
+
et(e)
|
|
532
532
|
);
|
|
533
|
-
me(t, n[`show${o}Button`], "inline-block"), H(t, n[`${e}ButtonText`] || ""), t.setAttribute("aria-label", n[`${e}ButtonAriaLabel`] || ""), t.className =
|
|
533
|
+
me(t, n[`show${o}Button`], "inline-block"), H(t, n[`${e}ButtonText`] || ""), t.setAttribute("aria-label", n[`${e}ButtonAriaLabel`] || ""), t.className = l[e], U(t, n, `${e}Button`);
|
|
534
534
|
}
|
|
535
|
-
const
|
|
536
|
-
const n =
|
|
535
|
+
const So = (t, e) => {
|
|
536
|
+
const n = rt();
|
|
537
537
|
n && (H(n, e.closeButtonHtml || ""), U(n, e, "closeButton"), me(n, e.showCloseButton), n.setAttribute("aria-label", e.closeButtonAriaLabel || ""));
|
|
538
|
-
},
|
|
539
|
-
const n =
|
|
540
|
-
n && (
|
|
538
|
+
}, To = (t, e) => {
|
|
539
|
+
const n = D();
|
|
540
|
+
n && (_o(n, e.backdrop), Io(n, e.position), $o(n, e.grow), U(n, e, "container"));
|
|
541
541
|
};
|
|
542
|
-
function
|
|
543
|
-
typeof e == "string" ? t.style.background = e : e || L([document.documentElement, document.body],
|
|
542
|
+
function _o(t, e) {
|
|
543
|
+
typeof e == "string" ? t.style.background = e : e || L([document.documentElement, document.body], l["no-backdrop"]);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
e && (e in
|
|
545
|
+
function Io(t, e) {
|
|
546
|
+
e && (e in l ? L(t, l[e]) : (z('The "position" parameter is not valid, defaulting to "center"'), L(t, l.center)));
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
e && L(t,
|
|
548
|
+
function $o(t, e) {
|
|
549
|
+
e && L(t, l[`grow-${e}`]);
|
|
550
550
|
}
|
|
551
|
-
var
|
|
551
|
+
var I = {
|
|
552
552
|
innerParams: /* @__PURE__ */ new WeakMap(),
|
|
553
553
|
domCache: /* @__PURE__ */ new WeakMap()
|
|
554
554
|
};
|
|
555
|
-
const
|
|
556
|
-
const n =
|
|
555
|
+
const Bo = ["input", "file", "range", "select", "radio", "checkbox", "textarea"], Po = (t, e) => {
|
|
556
|
+
const n = S();
|
|
557
557
|
if (!n)
|
|
558
558
|
return;
|
|
559
|
-
const o =
|
|
560
|
-
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
}), e.input && (s &&
|
|
564
|
-
},
|
|
559
|
+
const o = I.innerParams.get(t), s = !o || e.input !== o.input;
|
|
560
|
+
Bo.forEach((r) => {
|
|
561
|
+
const a = G(n, l[r]);
|
|
562
|
+
a && (No(r, e.inputAttributes), a.className = l[r], s && N(a));
|
|
563
|
+
}), e.input && (s && Mo(e), zo(e));
|
|
564
|
+
}, Mo = (t) => {
|
|
565
565
|
if (!t.input)
|
|
566
566
|
return;
|
|
567
|
-
if (!
|
|
568
|
-
ee(`Unexpected type of input! Expected ${Object.keys(
|
|
567
|
+
if (!B[t.input]) {
|
|
568
|
+
ee(`Unexpected type of input! Expected ${Object.keys(B).join(" | ")}, got "${t.input}"`);
|
|
569
569
|
return;
|
|
570
570
|
}
|
|
571
|
-
const e =
|
|
571
|
+
const e = Gt(t.input);
|
|
572
572
|
if (!e)
|
|
573
573
|
return;
|
|
574
|
-
const n =
|
|
574
|
+
const n = B[t.input](e, t);
|
|
575
575
|
M(e), t.inputAutoFocus && setTimeout(() => {
|
|
576
|
-
|
|
576
|
+
Ft(n);
|
|
577
577
|
});
|
|
578
|
-
},
|
|
578
|
+
}, Oo = (t) => {
|
|
579
579
|
for (let e = 0; e < t.attributes.length; e++) {
|
|
580
580
|
const n = t.attributes[e].name;
|
|
581
581
|
["id", "type", "value", "style"].includes(n) || t.removeAttribute(n);
|
|
582
582
|
}
|
|
583
|
-
},
|
|
584
|
-
const n =
|
|
583
|
+
}, No = (t, e) => {
|
|
584
|
+
const n = S();
|
|
585
585
|
if (!n)
|
|
586
586
|
return;
|
|
587
|
-
const o =
|
|
587
|
+
const o = je(n, t);
|
|
588
588
|
if (o) {
|
|
589
|
-
|
|
589
|
+
Oo(o);
|
|
590
590
|
for (const s in e)
|
|
591
591
|
o.setAttribute(s, e[s]);
|
|
592
592
|
}
|
|
593
|
-
},
|
|
593
|
+
}, zo = (t) => {
|
|
594
594
|
if (!t.input)
|
|
595
595
|
return;
|
|
596
|
-
const e =
|
|
596
|
+
const e = Gt(t.input);
|
|
597
597
|
e && U(e, t, "input");
|
|
598
|
-
},
|
|
598
|
+
}, dt = (t, e) => {
|
|
599
599
|
!t.placeholder && e.inputPlaceholder && (t.placeholder = e.inputPlaceholder);
|
|
600
600
|
}, be = (t, e, n) => {
|
|
601
601
|
if (n.inputLabel) {
|
|
602
|
-
const o = document.createElement("label"), s =
|
|
602
|
+
const o = document.createElement("label"), s = l["input-label"];
|
|
603
603
|
o.setAttribute("for", t.id), o.className = s, typeof n.customClass == "object" && L(o, n.customClass.inputLabel), o.innerText = n.inputLabel, e.insertAdjacentElement("beforebegin", o);
|
|
604
604
|
}
|
|
605
|
-
},
|
|
606
|
-
const e =
|
|
605
|
+
}, Gt = (t) => {
|
|
606
|
+
const e = S();
|
|
607
607
|
if (e)
|
|
608
|
-
return G(e,
|
|
608
|
+
return G(e, l[
|
|
609
609
|
/** @type {SwalClass} */
|
|
610
610
|
t
|
|
611
|
-
] ||
|
|
612
|
-
},
|
|
613
|
-
["string", "number"].includes(typeof e) ? t.value = `${e}` :
|
|
614
|
-
},
|
|
615
|
-
|
|
611
|
+
] || l.input);
|
|
612
|
+
}, Se = (t, e) => {
|
|
613
|
+
["string", "number"].includes(typeof e) ? t.value = `${e}` : nt(e) || z(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof e}"`);
|
|
614
|
+
}, B = {};
|
|
615
|
+
B.text = B.email = B.password = B.number = B.tel = B.url = B.search = B.date = B["datetime-local"] = B.time = B.week = B.month = /** @type {(input: Input | HTMLElement, params: SweetAlertOptions) => Input} */
|
|
616
616
|
(t, e) => {
|
|
617
617
|
const n = (
|
|
618
618
|
/** @type {HTMLInputElement} */
|
|
619
619
|
t
|
|
620
620
|
);
|
|
621
|
-
return
|
|
621
|
+
return Se(n, e.inputValue), be(n, n, e), dt(n, e), n.type = /** @type {string} */
|
|
622
622
|
e.input, n;
|
|
623
623
|
};
|
|
624
|
-
|
|
624
|
+
B.file = (t, e) => {
|
|
625
625
|
const n = (
|
|
626
626
|
/** @type {HTMLInputElement} */
|
|
627
627
|
t
|
|
628
628
|
);
|
|
629
|
-
return be(n, n, e),
|
|
629
|
+
return be(n, n, e), dt(n, e), n;
|
|
630
630
|
};
|
|
631
|
-
|
|
631
|
+
B.range = (t, e) => {
|
|
632
632
|
const n = (
|
|
633
633
|
/** @type {HTMLElement} */
|
|
634
634
|
t
|
|
635
635
|
), o = n.querySelector("input"), s = n.querySelector("output");
|
|
636
|
-
return o && (
|
|
636
|
+
return o && (Se(o, e.inputValue), o.type = /** @type {string} */
|
|
637
637
|
e.input, be(
|
|
638
638
|
o,
|
|
639
639
|
/** @type {Input} */
|
|
640
640
|
t,
|
|
641
641
|
e
|
|
642
|
-
)), s &&
|
|
642
|
+
)), s && Se(s, e.inputValue), /** @type {Input} */
|
|
643
643
|
t;
|
|
644
644
|
};
|
|
645
|
-
|
|
645
|
+
B.select = (t, e) => {
|
|
646
646
|
const n = (
|
|
647
647
|
/** @type {HTMLSelectElement} */
|
|
648
648
|
t
|
|
@@ -653,7 +653,7 @@ I.select = (t, e) => {
|
|
|
653
653
|
}
|
|
654
654
|
return be(n, n, e), n;
|
|
655
655
|
};
|
|
656
|
-
|
|
656
|
+
B.radio = (t) => {
|
|
657
657
|
const e = (
|
|
658
658
|
/** @type {HTMLElement} */
|
|
659
659
|
t
|
|
@@ -661,58 +661,58 @@ I.radio = (t) => {
|
|
|
661
661
|
return e.textContent = "", /** @type {Input} */
|
|
662
662
|
t;
|
|
663
663
|
};
|
|
664
|
-
|
|
665
|
-
const n =
|
|
664
|
+
B.checkbox = (t, e) => {
|
|
665
|
+
const n = S();
|
|
666
666
|
if (!n)
|
|
667
667
|
throw new Error("Popup not found");
|
|
668
|
-
const o =
|
|
668
|
+
const o = je(n, "checkbox");
|
|
669
669
|
if (!o)
|
|
670
670
|
throw new Error("Checkbox input not found");
|
|
671
671
|
o.value = "1", o.checked = !!e.inputValue;
|
|
672
672
|
const r = /** @type {HTMLElement} */ t.querySelector("span");
|
|
673
673
|
if (r) {
|
|
674
|
-
const
|
|
675
|
-
|
|
674
|
+
const a = e.inputPlaceholder || e.inputLabel;
|
|
675
|
+
a && H(r, a);
|
|
676
676
|
}
|
|
677
677
|
return o;
|
|
678
678
|
};
|
|
679
|
-
|
|
679
|
+
B.textarea = (t, e) => {
|
|
680
680
|
const n = (
|
|
681
681
|
/** @type {HTMLTextAreaElement} */
|
|
682
682
|
t
|
|
683
683
|
);
|
|
684
|
-
|
|
684
|
+
Se(n, e.inputValue), dt(n, e), be(n, n, e);
|
|
685
685
|
const o = (s) => parseInt(window.getComputedStyle(s).marginLeft) + parseInt(window.getComputedStyle(s).marginRight);
|
|
686
686
|
return setTimeout(() => {
|
|
687
687
|
if ("MutationObserver" in window) {
|
|
688
|
-
const s =
|
|
688
|
+
const s = S();
|
|
689
689
|
if (!s)
|
|
690
690
|
return;
|
|
691
|
-
const r = parseInt(window.getComputedStyle(s).width),
|
|
691
|
+
const r = parseInt(window.getComputedStyle(s).width), a = () => {
|
|
692
692
|
if (!document.body.contains(n))
|
|
693
693
|
return;
|
|
694
|
-
const c = n.offsetWidth + o(n), i =
|
|
694
|
+
const c = n.offsetWidth + o(n), i = S();
|
|
695
695
|
i && (c > r ? i.style.width = `${c}px` : J(i, "width", e.width));
|
|
696
696
|
};
|
|
697
|
-
new MutationObserver(
|
|
697
|
+
new MutationObserver(a).observe(n, {
|
|
698
698
|
attributes: !0,
|
|
699
699
|
attributeFilter: ["style"]
|
|
700
700
|
});
|
|
701
701
|
}
|
|
702
702
|
}), n;
|
|
703
703
|
};
|
|
704
|
-
const
|
|
705
|
-
const n =
|
|
706
|
-
n && (
|
|
707
|
-
},
|
|
708
|
-
const n =
|
|
709
|
-
n && (
|
|
710
|
-
},
|
|
711
|
-
const n =
|
|
704
|
+
const Do = (t, e) => {
|
|
705
|
+
const n = ot();
|
|
706
|
+
n && (lt(n), U(n, e, "htmlContainer"), e.html ? (ut(e.html, n), M(n, "block")) : e.text ? (n.textContent = e.text, M(n, "block")) : N(n), Po(t, e));
|
|
707
|
+
}, jo = (t, e) => {
|
|
708
|
+
const n = Vt();
|
|
709
|
+
n && (lt(n), me(n, !!e.footer, "block"), e.footer && ut(e.footer, n), U(n, e, "footer"));
|
|
710
|
+
}, Uo = (t, e) => {
|
|
711
|
+
const n = I.innerParams.get(t), o = ae();
|
|
712
712
|
if (!o)
|
|
713
713
|
return;
|
|
714
714
|
if (n && e.icon === n.icon) {
|
|
715
|
-
|
|
715
|
+
Et(o, e), At(o, e);
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
718
|
if (!e.icon && !e.iconHtml) {
|
|
@@ -723,62 +723,62 @@ const Io = (t, e) => {
|
|
|
723
723
|
ee(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${e.icon}"`), N(o);
|
|
724
724
|
return;
|
|
725
725
|
}
|
|
726
|
-
M(o),
|
|
727
|
-
},
|
|
726
|
+
M(o), Et(o, e), At(o, e), L(o, e.showClass && e.showClass.icon), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", Wt);
|
|
727
|
+
}, At = (t, e) => {
|
|
728
728
|
for (const [n, o] of Object.entries(Le))
|
|
729
729
|
e.icon !== n && V(t, o);
|
|
730
|
-
L(t, e.icon && Le[e.icon]),
|
|
731
|
-
},
|
|
732
|
-
const t =
|
|
730
|
+
L(t, e.icon && Le[e.icon]), Vo(t, e), Wt(), U(t, e, "icon");
|
|
731
|
+
}, Wt = () => {
|
|
732
|
+
const t = S();
|
|
733
733
|
if (!t)
|
|
734
734
|
return;
|
|
735
735
|
const e = window.getComputedStyle(t).getPropertyValue("background-color"), n = t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");
|
|
736
736
|
for (let o = 0; o < n.length; o++)
|
|
737
737
|
n[o].style.backgroundColor = e;
|
|
738
|
-
},
|
|
738
|
+
}, Ro = (t) => `
|
|
739
739
|
${t.animation ? '<div class="swal2-success-circular-line-left"></div>' : ""}
|
|
740
740
|
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
741
741
|
<div class="swal2-success-ring"></div>
|
|
742
742
|
${t.animation ? '<div class="swal2-success-fix"></div>' : ""}
|
|
743
743
|
${t.animation ? '<div class="swal2-success-circular-line-right"></div>' : ""}
|
|
744
|
-
`,
|
|
744
|
+
`, Ho = `
|
|
745
745
|
<span class="swal2-x-mark">
|
|
746
746
|
<span class="swal2-x-mark-line-left"></span>
|
|
747
747
|
<span class="swal2-x-mark-line-right"></span>
|
|
748
748
|
</span>
|
|
749
|
-
`,
|
|
749
|
+
`, Et = (t, e) => {
|
|
750
750
|
if (!e.icon && !e.iconHtml)
|
|
751
751
|
return;
|
|
752
752
|
let n = t.innerHTML, o = "";
|
|
753
|
-
e.iconHtml ? o =
|
|
753
|
+
e.iconHtml ? o = Lt(e.iconHtml) : e.icon === "success" ? (o = Ro(e), n = n.replace(/ style=".*?"/g, "")) : e.icon === "error" ? o = Ho : e.icon && (o = Lt({
|
|
754
754
|
question: "?",
|
|
755
755
|
warning: "!",
|
|
756
756
|
info: "i"
|
|
757
757
|
}[e.icon])), n.trim() !== o.trim() && H(t, o);
|
|
758
|
-
},
|
|
758
|
+
}, Vo = (t, e) => {
|
|
759
759
|
if (e.iconColor) {
|
|
760
760
|
t.style.color = e.iconColor, t.style.borderColor = e.iconColor;
|
|
761
761
|
for (const n of [".swal2-success-line-tip", ".swal2-success-line-long", ".swal2-x-mark-line-left", ".swal2-x-mark-line-right"])
|
|
762
|
-
|
|
763
|
-
|
|
762
|
+
xt(t, n, "background-color", e.iconColor);
|
|
763
|
+
xt(t, ".swal2-success-ring", "border-color", e.iconColor);
|
|
764
764
|
}
|
|
765
|
-
},
|
|
766
|
-
const n =
|
|
765
|
+
}, Lt = (t) => `<div class="${l["icon-content"]}">${t}</div>`, Fo = (t, e) => {
|
|
766
|
+
const n = Ht();
|
|
767
767
|
if (n) {
|
|
768
768
|
if (!e.imageUrl) {
|
|
769
769
|
N(n);
|
|
770
770
|
return;
|
|
771
771
|
}
|
|
772
|
-
M(n, ""), n.setAttribute("src", e.imageUrl), n.setAttribute("alt", e.imageAlt || ""), J(n, "width", e.imageWidth), J(n, "height", e.imageHeight), n.className =
|
|
772
|
+
M(n, ""), n.setAttribute("src", e.imageUrl), n.setAttribute("alt", e.imageAlt || ""), J(n, "width", e.imageWidth), J(n, "height", e.imageHeight), n.className = l.image, U(n, e, "image");
|
|
773
773
|
}
|
|
774
774
|
};
|
|
775
|
-
let
|
|
776
|
-
const
|
|
777
|
-
t.addEventListener("mousedown",
|
|
778
|
-
},
|
|
779
|
-
t.removeEventListener("mousedown",
|
|
780
|
-
},
|
|
781
|
-
const e =
|
|
775
|
+
let ht = !1, Yt = 0, Zt = 0, Xt = 0, Jt = 0;
|
|
776
|
+
const qo = (t) => {
|
|
777
|
+
t.addEventListener("mousedown", Te), document.body.addEventListener("mousemove", _e), t.addEventListener("mouseup", Ie), t.addEventListener("touchstart", Te), document.body.addEventListener("touchmove", _e), t.addEventListener("touchend", Ie);
|
|
778
|
+
}, Ko = (t) => {
|
|
779
|
+
t.removeEventListener("mousedown", Te), document.body.removeEventListener("mousemove", _e), t.removeEventListener("mouseup", Ie), t.removeEventListener("touchstart", Te), document.body.removeEventListener("touchmove", _e), t.removeEventListener("touchend", Ie);
|
|
780
|
+
}, Te = (t) => {
|
|
781
|
+
const e = S();
|
|
782
782
|
if (!e)
|
|
783
783
|
return;
|
|
784
784
|
const n = ae();
|
|
@@ -786,24 +786,24 @@ const Do = (t) => {
|
|
|
786
786
|
/** @type {HTMLElement} */
|
|
787
787
|
t.target
|
|
788
788
|
)) {
|
|
789
|
-
|
|
790
|
-
const o =
|
|
791
|
-
|
|
789
|
+
ht = !0;
|
|
790
|
+
const o = Qt(t);
|
|
791
|
+
Yt = o.clientX, Zt = o.clientY, Xt = parseInt(e.style.insetInlineStart) || 0, Jt = parseInt(e.style.insetBlockStart) || 0, L(e, "swal2-dragging");
|
|
792
792
|
}
|
|
793
793
|
}, _e = (t) => {
|
|
794
|
-
const e =
|
|
795
|
-
if (e &&
|
|
794
|
+
const e = S();
|
|
795
|
+
if (e && ht) {
|
|
796
796
|
let {
|
|
797
797
|
clientX: n,
|
|
798
798
|
clientY: o
|
|
799
|
-
} =
|
|
800
|
-
const s = n -
|
|
801
|
-
e.style.insetInlineStart = `${
|
|
802
|
-
}
|
|
803
|
-
},
|
|
804
|
-
const t =
|
|
805
|
-
|
|
806
|
-
},
|
|
799
|
+
} = Qt(t);
|
|
800
|
+
const s = n - Yt;
|
|
801
|
+
e.style.insetInlineStart = `${Xt + (p.isRTL ? -s : s)}px`, e.style.insetBlockStart = `${Jt + (o - Zt)}px`;
|
|
802
|
+
}
|
|
803
|
+
}, Ie = () => {
|
|
804
|
+
const t = S();
|
|
805
|
+
ht = !1, V(t, "swal2-dragging");
|
|
806
|
+
}, Qt = (t) => {
|
|
807
807
|
let e = 0, n = 0;
|
|
808
808
|
return t.type.startsWith("mouse") ? (e = /** @type {MouseEvent} */
|
|
809
809
|
t.clientX, n = /** @type {MouseEvent} */
|
|
@@ -813,8 +813,8 @@ const Do = (t) => {
|
|
|
813
813
|
clientX: e,
|
|
814
814
|
clientY: n
|
|
815
815
|
};
|
|
816
|
-
},
|
|
817
|
-
const n =
|
|
816
|
+
}, Go = (t, e) => {
|
|
817
|
+
const n = D(), o = S();
|
|
818
818
|
if (!(!n || !o)) {
|
|
819
819
|
if (e.toast) {
|
|
820
820
|
J(n, "width", e.width), o.style.width = "100%";
|
|
@@ -822,13 +822,13 @@ const Do = (t) => {
|
|
|
822
822
|
s && o.insertBefore(s, ae());
|
|
823
823
|
} else
|
|
824
824
|
J(o, "width", e.width);
|
|
825
|
-
J(o, "padding", e.padding), e.color && (o.style.color = e.color), e.background && (o.style.background = e.background), N(Ne()),
|
|
825
|
+
J(o, "padding", e.padding), e.color && (o.style.color = e.color), e.background && (o.style.background = e.background), N(Ne()), Wo(o, e), e.draggable && !e.toast ? (L(o, l.draggable), qo(o)) : (V(o, l.draggable), Ko(o));
|
|
826
826
|
}
|
|
827
|
-
},
|
|
827
|
+
}, Wo = (t, e) => {
|
|
828
828
|
const n = e.showClass || {};
|
|
829
|
-
t.className = `${
|
|
830
|
-
},
|
|
831
|
-
const n =
|
|
829
|
+
t.className = `${l.popup} ${j(t) ? n.popup : ""}`, e.toast ? (L([document.documentElement, document.body], l["toast-shown"]), L(t, l.toast)) : L(t, l.modal), U(t, e, "popup"), typeof e.customClass == "string" && L(t, e.customClass), e.icon && L(t, l[`icon-${e.icon}`]);
|
|
830
|
+
}, Yo = (t, e) => {
|
|
831
|
+
const n = st();
|
|
832
832
|
if (!n)
|
|
833
833
|
return;
|
|
834
834
|
const {
|
|
@@ -839,43 +839,43 @@ const Do = (t) => {
|
|
|
839
839
|
N(n);
|
|
840
840
|
return;
|
|
841
841
|
}
|
|
842
|
-
M(n), n.textContent = "", s >= o.length && z("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"), o.forEach((r,
|
|
843
|
-
const c =
|
|
844
|
-
if (n.appendChild(c),
|
|
845
|
-
const i =
|
|
842
|
+
M(n), n.textContent = "", s >= o.length && z("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"), o.forEach((r, a) => {
|
|
843
|
+
const c = Zo(r);
|
|
844
|
+
if (n.appendChild(c), a === s && L(c, l["active-progress-step"]), a !== o.length - 1) {
|
|
845
|
+
const i = Xo(e);
|
|
846
846
|
n.appendChild(i);
|
|
847
847
|
}
|
|
848
848
|
});
|
|
849
|
-
},
|
|
849
|
+
}, Zo = (t) => {
|
|
850
850
|
const e = document.createElement("li");
|
|
851
|
-
return L(e,
|
|
852
|
-
},
|
|
851
|
+
return L(e, l["progress-step"]), H(e, t), e;
|
|
852
|
+
}, Xo = (t) => {
|
|
853
853
|
const e = document.createElement("li");
|
|
854
|
-
return L(e,
|
|
855
|
-
},
|
|
856
|
-
const n =
|
|
857
|
-
n && (
|
|
858
|
-
},
|
|
854
|
+
return L(e, l["progress-step-line"]), t.progressStepsDistance && J(e, "width", t.progressStepsDistance), e;
|
|
855
|
+
}, Jo = (t, e) => {
|
|
856
|
+
const n = Rt();
|
|
857
|
+
n && (lt(n), me(n, !!(e.title || e.titleText), "block"), e.title && ut(e.title, n), e.titleText && (n.innerText = e.titleText), U(n, e, "title"));
|
|
858
|
+
}, en = (t, e) => {
|
|
859
859
|
var n;
|
|
860
|
-
|
|
861
|
-
const o =
|
|
860
|
+
Go(t, e), To(t, e), Yo(t, e), Uo(t, e), Fo(t, e), Jo(t, e), So(t, e), Do(t, e), Ao(t, e), jo(t, e);
|
|
861
|
+
const o = S();
|
|
862
862
|
typeof e.didRender == "function" && o && e.didRender(o), (n = p.eventEmitter) === null || n === void 0 || n.emit("didRender", o);
|
|
863
|
-
},
|
|
863
|
+
}, Qo = () => j(S()), tn = () => {
|
|
864
864
|
var t;
|
|
865
865
|
return (t = q()) === null || t === void 0 ? void 0 : t.click();
|
|
866
|
-
},
|
|
866
|
+
}, es = () => {
|
|
867
867
|
var t;
|
|
868
868
|
return (t = te()) === null || t === void 0 ? void 0 : t.click();
|
|
869
|
-
},
|
|
869
|
+
}, ts = () => {
|
|
870
870
|
var t;
|
|
871
871
|
return (t = le()) === null || t === void 0 ? void 0 : t.click();
|
|
872
|
-
},
|
|
872
|
+
}, ue = Object.freeze({
|
|
873
873
|
cancel: "cancel",
|
|
874
874
|
backdrop: "backdrop",
|
|
875
875
|
close: "close",
|
|
876
876
|
esc: "esc",
|
|
877
877
|
timer: "timer"
|
|
878
|
-
}),
|
|
878
|
+
}), nn = (t) => {
|
|
879
879
|
if (t.keydownTarget && t.keydownHandlerAdded && t.keydownHandler) {
|
|
880
880
|
const e = (
|
|
881
881
|
/** @type {EventListenerOrEventListenerObject} */
|
|
@@ -886,11 +886,11 @@ const Do = (t) => {
|
|
|
886
886
|
capture: t.keydownListenerCapture
|
|
887
887
|
}), t.keydownHandlerAdded = !1;
|
|
888
888
|
}
|
|
889
|
-
},
|
|
890
|
-
if (
|
|
891
|
-
const o = (r) =>
|
|
889
|
+
}, ns = (t, e, n) => {
|
|
890
|
+
if (nn(t), !e.toast) {
|
|
891
|
+
const o = (r) => ss(e, r, n);
|
|
892
892
|
t.keydownHandler = o;
|
|
893
|
-
const s = e.keydownListenerCapture ? window :
|
|
893
|
+
const s = e.keydownListenerCapture ? window : S();
|
|
894
894
|
if (s) {
|
|
895
895
|
t.keydownTarget = s, t.keydownListenerCapture = e.keydownListenerCapture;
|
|
896
896
|
const r = (
|
|
@@ -903,140 +903,140 @@ const Do = (t) => {
|
|
|
903
903
|
}), t.keydownHandlerAdded = !0;
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
-
},
|
|
906
|
+
}, We = (t, e) => {
|
|
907
907
|
var n;
|
|
908
|
-
const o =
|
|
908
|
+
const o = it();
|
|
909
909
|
if (o.length) {
|
|
910
910
|
t = t + e, t === -2 && (t = o.length - 1), t === o.length ? t = 0 : t === -1 && (t = o.length - 1), o[t].focus();
|
|
911
911
|
return;
|
|
912
912
|
}
|
|
913
|
-
(n =
|
|
914
|
-
},
|
|
915
|
-
t && (e.isComposing || e.keyCode === 229 || (t.stopKeydownPropagation && e.stopPropagation(), e.key === "Enter" ?
|
|
916
|
-
},
|
|
913
|
+
(n = S()) === null || n === void 0 || n.focus();
|
|
914
|
+
}, on = ["ArrowRight", "ArrowDown"], os = ["ArrowLeft", "ArrowUp"], ss = (t, e, n) => {
|
|
915
|
+
t && (e.isComposing || e.keyCode === 229 || (t.stopKeydownPropagation && e.stopPropagation(), e.key === "Enter" ? rs(e, t) : e.key === "Tab" ? is(e) : [...on, ...os].includes(e.key) ? as(e.key) : e.key === "Escape" && ls(e, t, n)));
|
|
916
|
+
}, rs = (t, e) => {
|
|
917
917
|
if (!Oe(e.allowEnterKey))
|
|
918
918
|
return;
|
|
919
|
-
const n =
|
|
919
|
+
const n = S();
|
|
920
920
|
if (!n || !e.input)
|
|
921
921
|
return;
|
|
922
|
-
const o =
|
|
922
|
+
const o = je(n, e.input);
|
|
923
923
|
if (t.target && o && t.target instanceof HTMLElement && t.target.outerHTML === o.outerHTML) {
|
|
924
924
|
if (["textarea", "file"].includes(e.input))
|
|
925
925
|
return;
|
|
926
|
-
|
|
926
|
+
tn(), t.preventDefault();
|
|
927
927
|
}
|
|
928
|
-
},
|
|
929
|
-
const e = t.target, n =
|
|
928
|
+
}, is = (t) => {
|
|
929
|
+
const e = t.target, n = it();
|
|
930
930
|
let o = -1;
|
|
931
931
|
for (let s = 0; s < n.length; s++)
|
|
932
932
|
if (e === n[s]) {
|
|
933
933
|
o = s;
|
|
934
934
|
break;
|
|
935
935
|
}
|
|
936
|
-
t.shiftKey ?
|
|
937
|
-
},
|
|
936
|
+
t.shiftKey ? We(o, -1) : We(o, 1), t.stopPropagation(), t.preventDefault();
|
|
937
|
+
}, as = (t) => {
|
|
938
938
|
const e = ge(), n = q(), o = te(), s = le();
|
|
939
939
|
if (!e || !n || !o || !s)
|
|
940
940
|
return;
|
|
941
941
|
const r = [n, o, s];
|
|
942
942
|
if (document.activeElement instanceof HTMLElement && !r.includes(document.activeElement))
|
|
943
943
|
return;
|
|
944
|
-
const
|
|
944
|
+
const a = on.includes(t) ? "nextElementSibling" : "previousElementSibling";
|
|
945
945
|
let c = document.activeElement;
|
|
946
946
|
if (c) {
|
|
947
947
|
for (let i = 0; i < e.children.length; i++) {
|
|
948
|
-
if (c = c[
|
|
948
|
+
if (c = c[a], !c)
|
|
949
949
|
return;
|
|
950
|
-
if (c instanceof HTMLButtonElement &&
|
|
950
|
+
if (c instanceof HTMLButtonElement && j(c))
|
|
951
951
|
break;
|
|
952
952
|
}
|
|
953
953
|
c instanceof HTMLButtonElement && c.focus();
|
|
954
954
|
}
|
|
955
|
-
},
|
|
956
|
-
t.preventDefault(), Oe(e.allowEscapeKey) && n(
|
|
955
|
+
}, ls = (t, e, n) => {
|
|
956
|
+
t.preventDefault(), Oe(e.allowEscapeKey) && n(ue.esc);
|
|
957
957
|
};
|
|
958
958
|
var se = {
|
|
959
959
|
swalPromiseResolve: /* @__PURE__ */ new WeakMap(),
|
|
960
960
|
swalPromiseReject: /* @__PURE__ */ new WeakMap()
|
|
961
961
|
};
|
|
962
|
-
const
|
|
963
|
-
const t =
|
|
962
|
+
const cs = () => {
|
|
963
|
+
const t = D();
|
|
964
964
|
Array.from(document.body.children).forEach((n) => {
|
|
965
965
|
n.contains(t) || (n.hasAttribute("aria-hidden") && n.setAttribute("data-previous-aria-hidden", n.getAttribute("aria-hidden") || ""), n.setAttribute("aria-hidden", "true"));
|
|
966
966
|
});
|
|
967
|
-
},
|
|
967
|
+
}, sn = () => {
|
|
968
968
|
Array.from(document.body.children).forEach((e) => {
|
|
969
969
|
e.hasAttribute("data-previous-aria-hidden") ? (e.setAttribute("aria-hidden", e.getAttribute("data-previous-aria-hidden") || ""), e.removeAttribute("data-previous-aria-hidden")) : e.removeAttribute("aria-hidden");
|
|
970
970
|
});
|
|
971
|
-
},
|
|
972
|
-
if (
|
|
971
|
+
}, rn = typeof window < "u" && !!window.GestureEvent, us = () => {
|
|
972
|
+
if (rn && !K(document.body, l.iosfix)) {
|
|
973
973
|
const t = document.body.scrollTop;
|
|
974
|
-
document.body.style.top = `${t * -1}px`, L(document.body,
|
|
974
|
+
document.body.style.top = `${t * -1}px`, L(document.body, l.iosfix), ds();
|
|
975
975
|
}
|
|
976
|
-
},
|
|
977
|
-
const t =
|
|
976
|
+
}, ds = () => {
|
|
977
|
+
const t = D();
|
|
978
978
|
if (!t)
|
|
979
979
|
return;
|
|
980
980
|
let e;
|
|
981
981
|
t.ontouchstart = (n) => {
|
|
982
|
-
e =
|
|
982
|
+
e = hs(n);
|
|
983
983
|
}, t.ontouchmove = (n) => {
|
|
984
984
|
e && (n.preventDefault(), n.stopPropagation());
|
|
985
985
|
};
|
|
986
|
-
},
|
|
987
|
-
const e = t.target, n =
|
|
988
|
-
return !n || !o ||
|
|
986
|
+
}, hs = (t) => {
|
|
987
|
+
const e = t.target, n = D(), o = ot();
|
|
988
|
+
return !n || !o || ws(t) || fs(t) ? !1 : e === n || !Ge(n) && e instanceof HTMLElement && !ho(e, o) && // #2823
|
|
989
989
|
e.tagName !== "INPUT" && // #1603
|
|
990
990
|
e.tagName !== "TEXTAREA" && // #2266
|
|
991
|
-
!(
|
|
991
|
+
!(Ge(o) && // #1944
|
|
992
992
|
o.contains(e));
|
|
993
|
-
},
|
|
994
|
-
t.touches[0].touchType === "stylus"),
|
|
995
|
-
if (K(document.body,
|
|
993
|
+
}, ws = (t) => !!(t.touches && t.touches.length && // @ts-ignore - touchType is not a standard property
|
|
994
|
+
t.touches[0].touchType === "stylus"), fs = (t) => t.touches && t.touches.length > 1, ps = () => {
|
|
995
|
+
if (K(document.body, l.iosfix)) {
|
|
996
996
|
const t = parseInt(document.body.style.top, 10);
|
|
997
|
-
V(document.body,
|
|
997
|
+
V(document.body, l.iosfix), document.body.style.top = "", document.body.scrollTop = t * -1;
|
|
998
998
|
}
|
|
999
|
-
},
|
|
999
|
+
}, gs = () => {
|
|
1000
1000
|
const t = document.createElement("div");
|
|
1001
|
-
t.className =
|
|
1001
|
+
t.className = l["scrollbar-measure"], document.body.appendChild(t);
|
|
1002
1002
|
const e = t.getBoundingClientRect().width - t.clientWidth;
|
|
1003
1003
|
return document.body.removeChild(t), e;
|
|
1004
1004
|
};
|
|
1005
1005
|
let oe = null;
|
|
1006
|
-
const
|
|
1007
|
-
oe === null && (document.body.scrollHeight > window.innerHeight || t === "scroll") && (oe = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = `${oe +
|
|
1008
|
-
},
|
|
1006
|
+
const ms = (t) => {
|
|
1007
|
+
oe === null && (document.body.scrollHeight > window.innerHeight || t === "scroll") && (oe = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = `${oe + gs()}px`);
|
|
1008
|
+
}, bs = () => {
|
|
1009
1009
|
oe !== null && (document.body.style.paddingRight = `${oe}px`, oe = null);
|
|
1010
1010
|
};
|
|
1011
|
-
function
|
|
1012
|
-
|
|
1011
|
+
function an(t, e, n, o) {
|
|
1012
|
+
De() ? St(t, o) : (to(n).then(() => St(t, o)), nn(p)), rn ? (e.setAttribute("style", "display:none !important"), e.removeAttribute("class"), e.innerHTML = "") : e.remove(), at() && (bs(), ps(), sn()), ys();
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1015
|
-
V([document.documentElement, document.body], [
|
|
1014
|
+
function ys() {
|
|
1015
|
+
V([document.documentElement, document.body], [l.shown, l["height-auto"], l["no-backdrop"], l["toast-shown"]]);
|
|
1016
1016
|
}
|
|
1017
1017
|
function W(t) {
|
|
1018
|
-
t =
|
|
1019
|
-
const e = se.swalPromiseResolve.get(this), n =
|
|
1018
|
+
t = Cs(t);
|
|
1019
|
+
const e = se.swalPromiseResolve.get(this), n = vs(this);
|
|
1020
1020
|
this.isAwaitingPromise ? t.isDismissed || (ye(this), e(t)) : n && e(t);
|
|
1021
1021
|
}
|
|
1022
|
-
const
|
|
1023
|
-
const e =
|
|
1022
|
+
const vs = (t) => {
|
|
1023
|
+
const e = S();
|
|
1024
1024
|
if (!e)
|
|
1025
1025
|
return !1;
|
|
1026
|
-
const n =
|
|
1026
|
+
const n = I.innerParams.get(t);
|
|
1027
1027
|
if (!n || K(e, n.hideClass.popup))
|
|
1028
1028
|
return !1;
|
|
1029
1029
|
V(e, n.showClass.popup), L(e, n.hideClass.popup);
|
|
1030
|
-
const o =
|
|
1031
|
-
return V(o, n.showClass.backdrop), L(o, n.hideClass.backdrop),
|
|
1030
|
+
const o = D();
|
|
1031
|
+
return V(o, n.showClass.backdrop), L(o, n.hideClass.backdrop), ks(t, e, n), !0;
|
|
1032
1032
|
};
|
|
1033
|
-
function
|
|
1033
|
+
function ln(t) {
|
|
1034
1034
|
const e = se.swalPromiseReject.get(this);
|
|
1035
1035
|
ye(this), e && e(t);
|
|
1036
1036
|
}
|
|
1037
1037
|
const ye = (t) => {
|
|
1038
|
-
t.isAwaitingPromise && (delete t.isAwaitingPromise,
|
|
1039
|
-
},
|
|
1038
|
+
t.isAwaitingPromise && (delete t.isAwaitingPromise, I.innerParams.get(t) || t._destroy());
|
|
1039
|
+
}, Cs = (t) => typeof t > "u" ? {
|
|
1040
1040
|
isConfirmed: !1,
|
|
1041
1041
|
isDenied: !1,
|
|
1042
1042
|
isDismissed: !0
|
|
@@ -1044,60 +1044,60 @@ const ye = (t) => {
|
|
|
1044
1044
|
isConfirmed: !1,
|
|
1045
1045
|
isDenied: !1,
|
|
1046
1046
|
isDismissed: !1
|
|
1047
|
-
}, t),
|
|
1047
|
+
}, t), ks = (t, e, n) => {
|
|
1048
1048
|
var o;
|
|
1049
|
-
const s =
|
|
1050
|
-
typeof n.willClose == "function" && n.willClose(e), (o = p.eventEmitter) === null || o === void 0 || o.emit("willClose", e), r && s ?
|
|
1051
|
-
},
|
|
1052
|
-
p.swalCloseEventFinishedCallback =
|
|
1053
|
-
const r = function(
|
|
1054
|
-
if (
|
|
1049
|
+
const s = D(), r = Kt(e);
|
|
1050
|
+
typeof n.willClose == "function" && n.willClose(e), (o = p.eventEmitter) === null || o === void 0 || o.emit("willClose", e), r && s ? xs(t, e, s, !!n.returnFocus, n.didClose) : s && an(t, s, !!n.returnFocus, n.didClose);
|
|
1051
|
+
}, xs = (t, e, n, o, s) => {
|
|
1052
|
+
p.swalCloseEventFinishedCallback = an.bind(null, t, n, o, s);
|
|
1053
|
+
const r = function(a) {
|
|
1054
|
+
if (a.target === e) {
|
|
1055
1055
|
var c;
|
|
1056
1056
|
(c = p.swalCloseEventFinishedCallback) === null || c === void 0 || c.call(p), delete p.swalCloseEventFinishedCallback, e.removeEventListener("animationend", r), e.removeEventListener("transitionend", r);
|
|
1057
1057
|
}
|
|
1058
1058
|
};
|
|
1059
1059
|
e.addEventListener("animationend", r), e.addEventListener("transitionend", r);
|
|
1060
|
-
},
|
|
1060
|
+
}, St = (t, e) => {
|
|
1061
1061
|
setTimeout(() => {
|
|
1062
1062
|
var n;
|
|
1063
1063
|
typeof e == "function" && e.bind(t.params)(), (n = p.eventEmitter) === null || n === void 0 || n.emit("didClose"), t._destroy && t._destroy();
|
|
1064
1064
|
});
|
|
1065
1065
|
}, re = (t) => {
|
|
1066
|
-
let e =
|
|
1067
|
-
if (e || new O(), e =
|
|
1066
|
+
let e = S();
|
|
1067
|
+
if (e || new O(), e = S(), !e)
|
|
1068
1068
|
return;
|
|
1069
1069
|
const n = ce();
|
|
1070
|
-
|
|
1071
|
-
},
|
|
1070
|
+
De() ? N(ae()) : As(e, t), M(n), e.setAttribute("data-loading", "true"), e.setAttribute("aria-busy", "true"), e.focus();
|
|
1071
|
+
}, As = (t, e) => {
|
|
1072
1072
|
const n = ge(), o = ce();
|
|
1073
|
-
!n || !o || (!e &&
|
|
1074
|
-
},
|
|
1075
|
-
e.input === "select" || e.input === "radio" ?
|
|
1076
|
-
},
|
|
1073
|
+
!n || !o || (!e && j(q()) && (e = q()), M(n), e && (N(e), o.setAttribute("data-button-to-replace", e.className), n.insertBefore(o, e)), L([t, n], l.loading));
|
|
1074
|
+
}, Es = (t, e) => {
|
|
1075
|
+
e.input === "select" || e.input === "radio" ? Is(t, e) : ["text", "email", "number", "tel", "textarea"].some((n) => n === e.input) && (tt(e.inputValue) || nt(e.inputValue)) && (re(q()), $s(t, e));
|
|
1076
|
+
}, Ls = (t, e) => {
|
|
1077
1077
|
const n = t.getInput();
|
|
1078
1078
|
if (!n)
|
|
1079
1079
|
return null;
|
|
1080
1080
|
switch (e.input) {
|
|
1081
1081
|
case "checkbox":
|
|
1082
|
-
return
|
|
1082
|
+
return Ss(n);
|
|
1083
1083
|
case "radio":
|
|
1084
|
-
return
|
|
1084
|
+
return Ts(n);
|
|
1085
1085
|
case "file":
|
|
1086
|
-
return
|
|
1086
|
+
return _s(n);
|
|
1087
1087
|
default:
|
|
1088
1088
|
return e.inputAutoTrim ? n.value.trim() : n.value;
|
|
1089
1089
|
}
|
|
1090
|
-
},
|
|
1091
|
-
const n =
|
|
1090
|
+
}, Ss = (t) => t.checked ? 1 : 0, Ts = (t) => t.checked ? t.value : null, _s = (t) => t.files && t.files.length ? t.getAttribute("multiple") !== null ? t.files : t.files[0] : null, Is = (t, e) => {
|
|
1091
|
+
const n = S();
|
|
1092
1092
|
if (!n)
|
|
1093
1093
|
return;
|
|
1094
1094
|
const o = (s) => {
|
|
1095
|
-
e.input === "select" ?
|
|
1095
|
+
e.input === "select" ? Bs(n, $e(s), e) : e.input === "radio" && Ps(n, $e(s), e);
|
|
1096
1096
|
};
|
|
1097
|
-
|
|
1097
|
+
tt(e.inputOptions) || nt(e.inputOptions) ? (re(q()), fe(e.inputOptions).then((s) => {
|
|
1098
1098
|
t.hideLoading(), o(s);
|
|
1099
1099
|
})) : typeof e.inputOptions == "object" ? o(e.inputOptions) : ee(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`);
|
|
1100
|
-
},
|
|
1100
|
+
}, $s = (t, e) => {
|
|
1101
1101
|
const n = t.getInput();
|
|
1102
1102
|
n && (N(n), fe(e.inputValue).then((o) => {
|
|
1103
1103
|
n.value = e.input === "number" ? `${parseFloat(o) || 0}` : `${o}`, M(n), n.focus(), t.hideLoading();
|
|
@@ -1105,68 +1105,68 @@ const ye = (t) => {
|
|
|
1105
1105
|
ee(`Error in inputValue promise: ${o}`), n.value = "", M(n), n.focus(), t.hideLoading();
|
|
1106
1106
|
}));
|
|
1107
1107
|
};
|
|
1108
|
-
function
|
|
1109
|
-
const o = G(t,
|
|
1108
|
+
function Bs(t, e, n) {
|
|
1109
|
+
const o = G(t, l.select);
|
|
1110
1110
|
if (!o)
|
|
1111
1111
|
return;
|
|
1112
|
-
const s = (r,
|
|
1112
|
+
const s = (r, a, c) => {
|
|
1113
1113
|
const i = document.createElement("option");
|
|
1114
|
-
i.value = c, H(i,
|
|
1114
|
+
i.value = c, H(i, a), i.selected = cn(c, n.inputValue), r.appendChild(i);
|
|
1115
1115
|
};
|
|
1116
1116
|
e.forEach((r) => {
|
|
1117
|
-
const
|
|
1117
|
+
const a = r[0], c = r[1];
|
|
1118
1118
|
if (Array.isArray(c)) {
|
|
1119
1119
|
const i = document.createElement("optgroup");
|
|
1120
|
-
i.label =
|
|
1120
|
+
i.label = a, i.disabled = !1, o.appendChild(i), c.forEach((u) => s(i, u[1], u[0]));
|
|
1121
1121
|
} else
|
|
1122
|
-
s(o, c,
|
|
1122
|
+
s(o, c, a);
|
|
1123
1123
|
}), o.focus();
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1126
|
-
const o = G(t,
|
|
1125
|
+
function Ps(t, e, n) {
|
|
1126
|
+
const o = G(t, l.radio);
|
|
1127
1127
|
if (!o)
|
|
1128
1128
|
return;
|
|
1129
1129
|
e.forEach((r) => {
|
|
1130
|
-
const
|
|
1131
|
-
i.type = "radio", i.name =
|
|
1132
|
-
const
|
|
1133
|
-
H(
|
|
1130
|
+
const a = r[0], c = r[1], i = document.createElement("input"), u = document.createElement("label");
|
|
1131
|
+
i.type = "radio", i.name = l.radio, i.value = a, cn(a, n.inputValue) && (i.checked = !0);
|
|
1132
|
+
const d = document.createElement("span");
|
|
1133
|
+
H(d, c), d.className = l.label, u.appendChild(i), u.appendChild(d), o.appendChild(u);
|
|
1134
1134
|
});
|
|
1135
1135
|
const s = o.querySelectorAll("input");
|
|
1136
1136
|
s.length && s[0].focus();
|
|
1137
1137
|
}
|
|
1138
|
-
const
|
|
1138
|
+
const $e = (t) => {
|
|
1139
1139
|
const e = [];
|
|
1140
1140
|
return t instanceof Map ? t.forEach((n, o) => {
|
|
1141
1141
|
let s = n;
|
|
1142
|
-
typeof s == "object" && (s =
|
|
1142
|
+
typeof s == "object" && (s = $e(s)), e.push([o, s]);
|
|
1143
1143
|
}) : Object.keys(t).forEach((n) => {
|
|
1144
1144
|
let o = t[n];
|
|
1145
|
-
typeof o == "object" && (o =
|
|
1145
|
+
typeof o == "object" && (o = $e(o)), e.push([n, o]);
|
|
1146
1146
|
}), e;
|
|
1147
|
-
},
|
|
1148
|
-
const e =
|
|
1149
|
-
t.disableButtons(), e.input ?
|
|
1150
|
-
},
|
|
1151
|
-
const e =
|
|
1152
|
-
t.disableButtons(), e.returnInputValueOnDeny ?
|
|
1153
|
-
},
|
|
1154
|
-
t.disableButtons(), e(
|
|
1155
|
-
},
|
|
1156
|
-
const n =
|
|
1147
|
+
}, cn = (t, e) => !!e && e !== null && e !== void 0 && e.toString() === t.toString(), Ms = (t) => {
|
|
1148
|
+
const e = I.innerParams.get(t);
|
|
1149
|
+
t.disableButtons(), e.input ? un(t, "confirm") : ft(t, !0);
|
|
1150
|
+
}, Os = (t) => {
|
|
1151
|
+
const e = I.innerParams.get(t);
|
|
1152
|
+
t.disableButtons(), e.returnInputValueOnDeny ? un(t, "deny") : wt(t, !1);
|
|
1153
|
+
}, Ns = (t, e) => {
|
|
1154
|
+
t.disableButtons(), e(ue.cancel);
|
|
1155
|
+
}, un = (t, e) => {
|
|
1156
|
+
const n = I.innerParams.get(t);
|
|
1157
1157
|
if (!n.input) {
|
|
1158
|
-
ee(`The "input" parameter is needed to be set when using returnInputValueOn${
|
|
1158
|
+
ee(`The "input" parameter is needed to be set when using returnInputValueOn${et(e)}`);
|
|
1159
1159
|
return;
|
|
1160
1160
|
}
|
|
1161
|
-
const o = t.getInput(), s =
|
|
1162
|
-
n.inputValidator ?
|
|
1163
|
-
},
|
|
1164
|
-
const o =
|
|
1161
|
+
const o = t.getInput(), s = Ls(t, n);
|
|
1162
|
+
n.inputValidator ? zs(t, s, e) : o && !o.checkValidity() ? (t.enableButtons(), t.showValidationMessage(n.validationMessage || o.validationMessage)) : e === "deny" ? wt(t, s) : ft(t, s);
|
|
1163
|
+
}, zs = (t, e, n) => {
|
|
1164
|
+
const o = I.innerParams.get(t);
|
|
1165
1165
|
t.disableInput(), Promise.resolve().then(() => fe(o.inputValidator(e, o.validationMessage))).then((r) => {
|
|
1166
|
-
t.enableButtons(), t.enableInput(), r ? t.showValidationMessage(r) : n === "deny" ?
|
|
1166
|
+
t.enableButtons(), t.enableInput(), r ? t.showValidationMessage(r) : n === "deny" ? wt(t, e) : ft(t, e);
|
|
1167
1167
|
});
|
|
1168
|
-
},
|
|
1169
|
-
const n =
|
|
1168
|
+
}, wt = (t, e) => {
|
|
1169
|
+
const n = I.innerParams.get(t);
|
|
1170
1170
|
n.showLoaderOnDeny && re(te()), n.preDeny ? (t.isAwaitingPromise = !0, Promise.resolve().then(() => fe(n.preDeny(e, n.validationMessage))).then((s) => {
|
|
1171
1171
|
s === !1 ? (t.hideLoading(), ye(t)) : t.close(
|
|
1172
1172
|
/** @type SweetAlertResult */
|
|
@@ -1175,14 +1175,14 @@ const Be = (t) => {
|
|
|
1175
1175
|
value: typeof s > "u" ? e : s
|
|
1176
1176
|
}
|
|
1177
1177
|
);
|
|
1178
|
-
}).catch((s) =>
|
|
1178
|
+
}).catch((s) => dn(t, s))) : t.close(
|
|
1179
1179
|
/** @type SweetAlertResult */
|
|
1180
1180
|
{
|
|
1181
1181
|
isDenied: !0,
|
|
1182
1182
|
value: e
|
|
1183
1183
|
}
|
|
1184
1184
|
);
|
|
1185
|
-
},
|
|
1185
|
+
}, Tt = (t, e) => {
|
|
1186
1186
|
t.close(
|
|
1187
1187
|
/** @type SweetAlertResult */
|
|
1188
1188
|
{
|
|
@@ -1190,72 +1190,72 @@ const Be = (t) => {
|
|
|
1190
1190
|
value: e
|
|
1191
1191
|
}
|
|
1192
1192
|
);
|
|
1193
|
-
},
|
|
1193
|
+
}, dn = (t, e) => {
|
|
1194
1194
|
t.rejectPromise(e);
|
|
1195
|
-
},
|
|
1196
|
-
const n =
|
|
1195
|
+
}, ft = (t, e) => {
|
|
1196
|
+
const n = I.innerParams.get(t);
|
|
1197
1197
|
n.showLoaderOnConfirm && re(), n.preConfirm ? (t.resetValidationMessage(), t.isAwaitingPromise = !0, Promise.resolve().then(() => fe(n.preConfirm(e, n.validationMessage))).then((s) => {
|
|
1198
|
-
|
|
1199
|
-
}).catch((s) =>
|
|
1198
|
+
j(Ne()) || s === !1 ? (t.hideLoading(), ye(t)) : Tt(t, typeof s > "u" ? e : s);
|
|
1199
|
+
}).catch((s) => dn(t, s))) : Tt(t, e);
|
|
1200
1200
|
};
|
|
1201
|
-
function
|
|
1202
|
-
const t =
|
|
1201
|
+
function Be() {
|
|
1202
|
+
const t = I.innerParams.get(this);
|
|
1203
1203
|
if (!t)
|
|
1204
1204
|
return;
|
|
1205
|
-
const e =
|
|
1206
|
-
N(e.loader),
|
|
1205
|
+
const e = I.domCache.get(this);
|
|
1206
|
+
N(e.loader), De() ? t.icon && M(ae()) : Ds(e), V([e.popup, e.actions], l.loading), e.popup.removeAttribute("aria-busy"), e.popup.removeAttribute("data-loading"), e.confirmButton.disabled = !1, e.denyButton.disabled = !1, e.cancelButton.disabled = !1;
|
|
1207
1207
|
}
|
|
1208
|
-
const
|
|
1208
|
+
const Ds = (t) => {
|
|
1209
1209
|
const e = t.loader.getAttribute("data-button-to-replace"), n = e ? t.popup.getElementsByClassName(e) : [];
|
|
1210
1210
|
n.length ? M(
|
|
1211
1211
|
/** @type {HTMLElement} */
|
|
1212
1212
|
n[0],
|
|
1213
1213
|
"inline-block"
|
|
1214
|
-
) :
|
|
1214
|
+
) : uo() && N(t.actions);
|
|
1215
1215
|
};
|
|
1216
|
-
function
|
|
1217
|
-
const t =
|
|
1218
|
-
return e ?
|
|
1216
|
+
function hn() {
|
|
1217
|
+
const t = I.innerParams.get(this), e = I.domCache.get(this);
|
|
1218
|
+
return e ? je(e.popup, t.input) : null;
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1221
|
-
const o =
|
|
1220
|
+
function wn(t, e, n) {
|
|
1221
|
+
const o = I.domCache.get(t);
|
|
1222
1222
|
e.forEach((s) => {
|
|
1223
1223
|
o[s].disabled = n;
|
|
1224
1224
|
});
|
|
1225
1225
|
}
|
|
1226
|
-
function
|
|
1227
|
-
const n =
|
|
1226
|
+
function fn(t, e) {
|
|
1227
|
+
const n = S();
|
|
1228
1228
|
if (!(!n || !t))
|
|
1229
1229
|
if (t.type === "radio") {
|
|
1230
|
-
const o = n.querySelectorAll(`[name="${
|
|
1230
|
+
const o = n.querySelectorAll(`[name="${l.radio}"]`);
|
|
1231
1231
|
for (let s = 0; s < o.length; s++)
|
|
1232
1232
|
o[s].disabled = e;
|
|
1233
1233
|
} else
|
|
1234
1234
|
t.disabled = e;
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1237
|
-
|
|
1236
|
+
function pn() {
|
|
1237
|
+
wn(this, ["confirmButton", "denyButton", "cancelButton"], !1);
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1240
|
-
|
|
1239
|
+
function gn() {
|
|
1240
|
+
wn(this, ["confirmButton", "denyButton", "cancelButton"], !0);
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1243
|
-
|
|
1242
|
+
function mn() {
|
|
1243
|
+
fn(this.getInput(), !1);
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1246
|
-
|
|
1245
|
+
function bn() {
|
|
1246
|
+
fn(this.getInput(), !0);
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1249
|
-
const e =
|
|
1250
|
-
H(e.validationMessage, t), e.validationMessage.className =
|
|
1248
|
+
function yn(t) {
|
|
1249
|
+
const e = I.domCache.get(this), n = I.innerParams.get(this);
|
|
1250
|
+
H(e.validationMessage, t), e.validationMessage.className = l["validation-message"], n.customClass && n.customClass.validationMessage && L(e.validationMessage, n.customClass.validationMessage), M(e.validationMessage);
|
|
1251
1251
|
const o = this.getInput();
|
|
1252
|
-
o && (o.setAttribute("aria-invalid", "true"), o.setAttribute("aria-describedby",
|
|
1252
|
+
o && (o.setAttribute("aria-invalid", "true"), o.setAttribute("aria-describedby", l["validation-message"]), Ft(o), L(o, l.inputerror));
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1255
|
-
const t =
|
|
1254
|
+
function vn() {
|
|
1255
|
+
const t = I.domCache.get(this);
|
|
1256
1256
|
t.validationMessage && N(t.validationMessage);
|
|
1257
1257
|
const e = this.getInput();
|
|
1258
|
-
e && (e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"), V(e,
|
|
1258
|
+
e && (e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"), V(e, l.inputerror));
|
|
1259
1259
|
}
|
|
1260
1260
|
const Y = {
|
|
1261
1261
|
title: "",
|
|
@@ -1350,28 +1350,28 @@ const Y = {
|
|
|
1350
1350
|
didDestroy: void 0,
|
|
1351
1351
|
scrollbarPadding: !0,
|
|
1352
1352
|
topLayer: !1
|
|
1353
|
-
},
|
|
1353
|
+
}, js = ["allowEscapeKey", "allowOutsideClick", "background", "buttonsStyling", "cancelButtonAriaLabel", "cancelButtonColor", "cancelButtonText", "closeButtonAriaLabel", "closeButtonHtml", "color", "confirmButtonAriaLabel", "confirmButtonColor", "confirmButtonText", "currentProgressStep", "customClass", "denyButtonAriaLabel", "denyButtonColor", "denyButtonText", "didClose", "didDestroy", "draggable", "footer", "hideClass", "html", "icon", "iconColor", "iconHtml", "imageAlt", "imageHeight", "imageUrl", "imageWidth", "preConfirm", "preDeny", "progressSteps", "returnFocus", "reverseButtons", "showCancelButton", "showCloseButton", "showConfirmButton", "showDenyButton", "text", "title", "titleText", "theme", "willClose"], Us = {
|
|
1354
1354
|
allowEnterKey: void 0
|
|
1355
|
-
},
|
|
1356
|
-
|
|
1357
|
-
},
|
|
1358
|
-
|
|
1359
|
-
},
|
|
1360
|
-
const e =
|
|
1361
|
-
e &&
|
|
1362
|
-
},
|
|
1355
|
+
}, Rs = ["allowOutsideClick", "allowEnterKey", "backdrop", "draggable", "focusConfirm", "focusDeny", "focusCancel", "returnFocus", "heightAuto", "keydownListenerCapture"], Cn = (t) => Object.prototype.hasOwnProperty.call(Y, t), kn = (t) => js.indexOf(t) !== -1, xn = (t) => Us[t], Hs = (t) => {
|
|
1356
|
+
Cn(t) || z(`Unknown parameter "${t}"`);
|
|
1357
|
+
}, Vs = (t) => {
|
|
1358
|
+
Rs.includes(t) && z(`The parameter "${t}" is incompatible with toasts`);
|
|
1359
|
+
}, Fs = (t) => {
|
|
1360
|
+
const e = xn(t);
|
|
1361
|
+
e && Ut(t, e);
|
|
1362
|
+
}, An = (t) => {
|
|
1363
1363
|
t.backdrop === !1 && t.allowOutsideClick && z('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'), t.theme && !["light", "dark", "auto", "minimal", "borderless", "bootstrap-4", "bootstrap-4-light", "bootstrap-4-dark", "bootstrap-5", "bootstrap-5-light", "bootstrap-5-dark", "material-ui", "material-ui-light", "material-ui-dark", "embed-iframe", "bulma", "bulma-light", "bulma-dark"].includes(t.theme) && z(`Invalid theme "${t.theme}"`);
|
|
1364
1364
|
for (const e in t)
|
|
1365
|
-
|
|
1365
|
+
Hs(e), t.toast && Vs(e), Fs(e);
|
|
1366
1366
|
};
|
|
1367
|
-
function
|
|
1368
|
-
const e =
|
|
1367
|
+
function En(t) {
|
|
1368
|
+
const e = D(), n = S(), o = I.innerParams.get(this);
|
|
1369
1369
|
if (!n || K(n, o.hideClass.popup)) {
|
|
1370
1370
|
z("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");
|
|
1371
1371
|
return;
|
|
1372
1372
|
}
|
|
1373
|
-
const s =
|
|
1374
|
-
|
|
1373
|
+
const s = qs(t), r = Object.assign({}, o, s);
|
|
1374
|
+
An(r), e && (e.dataset.swal2Theme = r.theme), en(this, r), I.innerParams.set(this, r), Object.defineProperties(this, {
|
|
1375
1375
|
params: {
|
|
1376
1376
|
value: Object.assign({}, this.params, t),
|
|
1377
1377
|
writable: !1,
|
|
@@ -1379,10 +1379,10 @@ function kn(t) {
|
|
|
1379
1379
|
}
|
|
1380
1380
|
});
|
|
1381
1381
|
}
|
|
1382
|
-
const
|
|
1382
|
+
const qs = (t) => {
|
|
1383
1383
|
const e = {};
|
|
1384
1384
|
return Object.keys(t).forEach((n) => {
|
|
1385
|
-
if (
|
|
1385
|
+
if (kn(n)) {
|
|
1386
1386
|
const o = (
|
|
1387
1387
|
/** @type {Record<string, any>} */
|
|
1388
1388
|
t
|
|
@@ -1392,85 +1392,85 @@ const Ds = (t) => {
|
|
|
1392
1392
|
z(`Invalid parameter to update: ${n}`);
|
|
1393
1393
|
}), e;
|
|
1394
1394
|
};
|
|
1395
|
-
function
|
|
1395
|
+
function Ln() {
|
|
1396
1396
|
var t;
|
|
1397
|
-
const e =
|
|
1397
|
+
const e = I.domCache.get(this), n = I.innerParams.get(this);
|
|
1398
1398
|
if (!n) {
|
|
1399
|
-
|
|
1399
|
+
Sn(this);
|
|
1400
1400
|
return;
|
|
1401
1401
|
}
|
|
1402
|
-
e.popup && p.swalCloseEventFinishedCallback && (p.swalCloseEventFinishedCallback(), delete p.swalCloseEventFinishedCallback), typeof n.didDestroy == "function" && n.didDestroy(), (t = p.eventEmitter) === null || t === void 0 || t.emit("didDestroy"),
|
|
1402
|
+
e.popup && p.swalCloseEventFinishedCallback && (p.swalCloseEventFinishedCallback(), delete p.swalCloseEventFinishedCallback), typeof n.didDestroy == "function" && n.didDestroy(), (t = p.eventEmitter) === null || t === void 0 || t.emit("didDestroy"), Ks(this);
|
|
1403
1403
|
}
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1406
|
-
},
|
|
1407
|
-
t.isAwaitingPromise ? (
|
|
1408
|
-
},
|
|
1404
|
+
const Ks = (t) => {
|
|
1405
|
+
Sn(t), delete t.params, delete p.keydownHandler, delete p.keydownTarget, delete p.currentInstance;
|
|
1406
|
+
}, Sn = (t) => {
|
|
1407
|
+
t.isAwaitingPromise ? (Fe(I, t), t.isAwaitingPromise = !0) : (Fe(se, t), Fe(I, t), delete t.isAwaitingPromise, delete t.disableButtons, delete t.enableButtons, delete t.getInput, delete t.disableInput, delete t.enableInput, delete t.hideLoading, delete t.disableLoading, delete t.showValidationMessage, delete t.resetValidationMessage, delete t.close, delete t.closePopup, delete t.closeModal, delete t.closeToast, delete t.rejectPromise, delete t.update, delete t._destroy);
|
|
1408
|
+
}, Fe = (t, e) => {
|
|
1409
1409
|
for (const n in t)
|
|
1410
1410
|
t[n].delete(e);
|
|
1411
1411
|
};
|
|
1412
|
-
var
|
|
1412
|
+
var Gs = /* @__PURE__ */ Object.freeze({
|
|
1413
1413
|
__proto__: null,
|
|
1414
|
-
_destroy:
|
|
1414
|
+
_destroy: Ln,
|
|
1415
1415
|
close: W,
|
|
1416
1416
|
closeModal: W,
|
|
1417
1417
|
closePopup: W,
|
|
1418
1418
|
closeToast: W,
|
|
1419
|
-
disableButtons:
|
|
1420
|
-
disableInput:
|
|
1421
|
-
disableLoading:
|
|
1422
|
-
enableButtons:
|
|
1423
|
-
enableInput:
|
|
1424
|
-
getInput:
|
|
1419
|
+
disableButtons: gn,
|
|
1420
|
+
disableInput: bn,
|
|
1421
|
+
disableLoading: Be,
|
|
1422
|
+
enableButtons: pn,
|
|
1423
|
+
enableInput: mn,
|
|
1424
|
+
getInput: hn,
|
|
1425
1425
|
handleAwaitingPromise: ye,
|
|
1426
|
-
hideLoading:
|
|
1427
|
-
rejectPromise:
|
|
1428
|
-
resetValidationMessage:
|
|
1429
|
-
showValidationMessage:
|
|
1430
|
-
update:
|
|
1426
|
+
hideLoading: Be,
|
|
1427
|
+
rejectPromise: ln,
|
|
1428
|
+
resetValidationMessage: vn,
|
|
1429
|
+
showValidationMessage: yn,
|
|
1430
|
+
update: En
|
|
1431
1431
|
});
|
|
1432
|
-
const
|
|
1433
|
-
t.toast ?
|
|
1434
|
-
},
|
|
1432
|
+
const Ws = (t, e, n) => {
|
|
1433
|
+
t.toast ? Ys(t, e, n) : (Xs(e), Js(e), Qs(t, e, n));
|
|
1434
|
+
}, Ys = (t, e, n) => {
|
|
1435
1435
|
e.popup.onclick = () => {
|
|
1436
|
-
t && (
|
|
1436
|
+
t && (Zs(t) || t.timer || t.input) || n(ue.close);
|
|
1437
1437
|
};
|
|
1438
|
-
},
|
|
1438
|
+
}, Zs = (t) => !!(t.showConfirmButton || t.showDenyButton || t.showCancelButton || t.showCloseButton);
|
|
1439
1439
|
let Pe = !1;
|
|
1440
|
-
const
|
|
1440
|
+
const Xs = (t) => {
|
|
1441
1441
|
t.popup.onmousedown = () => {
|
|
1442
1442
|
t.container.onmouseup = function(e) {
|
|
1443
1443
|
t.container.onmouseup = () => {
|
|
1444
1444
|
}, e.target === t.container && (Pe = !0);
|
|
1445
1445
|
};
|
|
1446
1446
|
};
|
|
1447
|
-
},
|
|
1447
|
+
}, Js = (t) => {
|
|
1448
1448
|
t.container.onmousedown = (e) => {
|
|
1449
1449
|
e.target === t.container && e.preventDefault(), t.popup.onmouseup = function(n) {
|
|
1450
1450
|
t.popup.onmouseup = () => {
|
|
1451
1451
|
}, (n.target === t.popup || n.target instanceof HTMLElement && t.popup.contains(n.target)) && (Pe = !0);
|
|
1452
1452
|
};
|
|
1453
1453
|
};
|
|
1454
|
-
},
|
|
1454
|
+
}, Qs = (t, e, n) => {
|
|
1455
1455
|
e.container.onclick = (o) => {
|
|
1456
1456
|
if (Pe) {
|
|
1457
1457
|
Pe = !1;
|
|
1458
1458
|
return;
|
|
1459
1459
|
}
|
|
1460
|
-
o.target === e.container && Oe(t.allowOutsideClick) && n(
|
|
1460
|
+
o.target === e.container && Oe(t.allowOutsideClick) && n(ue.backdrop);
|
|
1461
1461
|
};
|
|
1462
|
-
},
|
|
1462
|
+
}, er = (t) => typeof t == "object" && t !== null && "jquery" in t, _t = (t) => t instanceof Element || er(t), tr = (t) => {
|
|
1463
1463
|
const e = {};
|
|
1464
|
-
return typeof t[0] == "object" && !
|
|
1464
|
+
return typeof t[0] == "object" && !_t(t[0]) ? Object.assign(e, t[0]) : ["title", "html", "icon"].forEach((n, o) => {
|
|
1465
1465
|
const s = t[o];
|
|
1466
|
-
typeof s == "string" ||
|
|
1466
|
+
typeof s == "string" || _t(s) ? e[n] = s : s !== void 0 && ee(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof s}`);
|
|
1467
1467
|
}), /** @type {SweetAlertOptions} */
|
|
1468
1468
|
e;
|
|
1469
1469
|
};
|
|
1470
|
-
function
|
|
1470
|
+
function nr(...t) {
|
|
1471
1471
|
return new this(...t);
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1473
|
+
function or(t) {
|
|
1474
1474
|
class e extends this {
|
|
1475
1475
|
/**
|
|
1476
1476
|
* @param {any} params
|
|
@@ -1482,44 +1482,44 @@ function Xs(t) {
|
|
|
1482
1482
|
}
|
|
1483
1483
|
return e;
|
|
1484
1484
|
}
|
|
1485
|
-
const
|
|
1485
|
+
const sr = () => p.timeout && p.timeout.getTimerLeft(), Tn = () => {
|
|
1486
1486
|
if (p.timeout)
|
|
1487
|
-
return
|
|
1488
|
-
},
|
|
1487
|
+
return wo(), p.timeout.stop();
|
|
1488
|
+
}, _n = () => {
|
|
1489
1489
|
if (p.timeout) {
|
|
1490
1490
|
const t = p.timeout.start();
|
|
1491
|
-
return
|
|
1491
|
+
return ct(t), t;
|
|
1492
1492
|
}
|
|
1493
|
-
},
|
|
1493
|
+
}, rr = () => {
|
|
1494
1494
|
const t = p.timeout;
|
|
1495
|
-
return t && (t.running ?
|
|
1496
|
-
},
|
|
1495
|
+
return t && (t.running ? Tn() : _n());
|
|
1496
|
+
}, ir = (t) => {
|
|
1497
1497
|
if (p.timeout) {
|
|
1498
1498
|
const e = p.timeout.increase(t);
|
|
1499
|
-
return
|
|
1499
|
+
return ct(e, !0), e;
|
|
1500
1500
|
}
|
|
1501
|
-
},
|
|
1502
|
-
let
|
|
1503
|
-
const
|
|
1504
|
-
function
|
|
1505
|
-
|
|
1501
|
+
}, ar = () => !!(p.timeout && p.timeout.isRunning());
|
|
1502
|
+
let It = !1;
|
|
1503
|
+
const Ye = {};
|
|
1504
|
+
function lr(t = "data-swal-template") {
|
|
1505
|
+
Ye[t] = this, It || (document.body.addEventListener("click", cr), It = !0);
|
|
1506
1506
|
}
|
|
1507
|
-
const
|
|
1507
|
+
const cr = (t) => {
|
|
1508
1508
|
for (let e = (
|
|
1509
1509
|
/** @type {any} */
|
|
1510
1510
|
t.target
|
|
1511
1511
|
); e && e !== document; e = e.parentNode)
|
|
1512
|
-
for (const n in
|
|
1512
|
+
for (const n in Ye) {
|
|
1513
1513
|
const o = e.getAttribute && e.getAttribute(n);
|
|
1514
1514
|
if (o) {
|
|
1515
|
-
|
|
1515
|
+
Ye[n].fire({
|
|
1516
1516
|
template: o
|
|
1517
1517
|
});
|
|
1518
1518
|
return;
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
1521
|
};
|
|
1522
|
-
class
|
|
1522
|
+
class ur {
|
|
1523
1523
|
constructor() {
|
|
1524
1524
|
this.events = {};
|
|
1525
1525
|
}
|
|
@@ -1584,12 +1584,12 @@ class sr {
|
|
|
1584
1584
|
this.events = {};
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
|
-
p.eventEmitter = new
|
|
1588
|
-
const
|
|
1587
|
+
p.eventEmitter = new ur();
|
|
1588
|
+
const dr = (t, e) => {
|
|
1589
1589
|
p.eventEmitter && p.eventEmitter.on(t, e);
|
|
1590
|
-
},
|
|
1590
|
+
}, hr = (t, e) => {
|
|
1591
1591
|
p.eventEmitter && p.eventEmitter.once(t, e);
|
|
1592
|
-
},
|
|
1592
|
+
}, wr = (t, e) => {
|
|
1593
1593
|
if (p.eventEmitter) {
|
|
1594
1594
|
if (!t) {
|
|
1595
1595
|
p.eventEmitter.reset();
|
|
@@ -1598,52 +1598,52 @@ const rr = (t, e) => {
|
|
|
1598
1598
|
e ? p.eventEmitter.removeListener(t, e) : p.eventEmitter.removeAllListeners(t);
|
|
1599
1599
|
}
|
|
1600
1600
|
};
|
|
1601
|
-
var
|
|
1601
|
+
var fr = /* @__PURE__ */ Object.freeze({
|
|
1602
1602
|
__proto__: null,
|
|
1603
|
-
argsToParams:
|
|
1604
|
-
bindClickHandler:
|
|
1605
|
-
clickCancel:
|
|
1606
|
-
clickConfirm:
|
|
1607
|
-
clickDeny:
|
|
1603
|
+
argsToParams: tr,
|
|
1604
|
+
bindClickHandler: lr,
|
|
1605
|
+
clickCancel: ts,
|
|
1606
|
+
clickConfirm: tn,
|
|
1607
|
+
clickDeny: es,
|
|
1608
1608
|
enableLoading: re,
|
|
1609
|
-
fire:
|
|
1609
|
+
fire: nr,
|
|
1610
1610
|
getActions: ge,
|
|
1611
1611
|
getCancelButton: le,
|
|
1612
|
-
getCloseButton:
|
|
1612
|
+
getCloseButton: rt,
|
|
1613
1613
|
getConfirmButton: q,
|
|
1614
|
-
getContainer:
|
|
1614
|
+
getContainer: D,
|
|
1615
1615
|
getDenyButton: te,
|
|
1616
|
-
getFocusableElements:
|
|
1617
|
-
getFooter:
|
|
1618
|
-
getHtmlContainer:
|
|
1616
|
+
getFocusableElements: it,
|
|
1617
|
+
getFooter: Vt,
|
|
1618
|
+
getHtmlContainer: ot,
|
|
1619
1619
|
getIcon: ae,
|
|
1620
|
-
getIconContent:
|
|
1621
|
-
getImage:
|
|
1622
|
-
getInputLabel:
|
|
1620
|
+
getIconContent: ro,
|
|
1621
|
+
getImage: Ht,
|
|
1622
|
+
getInputLabel: io,
|
|
1623
1623
|
getLoader: ce,
|
|
1624
|
-
getPopup:
|
|
1625
|
-
getProgressSteps:
|
|
1626
|
-
getTimerLeft:
|
|
1624
|
+
getPopup: S,
|
|
1625
|
+
getProgressSteps: st,
|
|
1626
|
+
getTimerLeft: sr,
|
|
1627
1627
|
getTimerProgressBar: ze,
|
|
1628
|
-
getTitle:
|
|
1628
|
+
getTitle: Rt,
|
|
1629
1629
|
getValidationMessage: Ne,
|
|
1630
|
-
increaseTimer:
|
|
1631
|
-
isDeprecatedParameter:
|
|
1632
|
-
isLoading:
|
|
1633
|
-
isTimerRunning:
|
|
1634
|
-
isUpdatableParameter:
|
|
1635
|
-
isValidParameter:
|
|
1636
|
-
isVisible:
|
|
1637
|
-
mixin:
|
|
1638
|
-
off:
|
|
1639
|
-
on:
|
|
1640
|
-
once:
|
|
1641
|
-
resumeTimer:
|
|
1630
|
+
increaseTimer: ir,
|
|
1631
|
+
isDeprecatedParameter: xn,
|
|
1632
|
+
isLoading: lo,
|
|
1633
|
+
isTimerRunning: ar,
|
|
1634
|
+
isUpdatableParameter: kn,
|
|
1635
|
+
isValidParameter: Cn,
|
|
1636
|
+
isVisible: Qo,
|
|
1637
|
+
mixin: or,
|
|
1638
|
+
off: wr,
|
|
1639
|
+
on: dr,
|
|
1640
|
+
once: hr,
|
|
1641
|
+
resumeTimer: _n,
|
|
1642
1642
|
showLoading: re,
|
|
1643
|
-
stopTimer:
|
|
1644
|
-
toggleTimer:
|
|
1643
|
+
stopTimer: Tn,
|
|
1644
|
+
toggleTimer: rr
|
|
1645
1645
|
});
|
|
1646
|
-
class
|
|
1646
|
+
class pr {
|
|
1647
1647
|
/**
|
|
1648
1648
|
* @param {() => void} callback
|
|
1649
1649
|
* @param {number} delay
|
|
@@ -1684,7 +1684,7 @@ class cr {
|
|
|
1684
1684
|
return this.running;
|
|
1685
1685
|
}
|
|
1686
1686
|
}
|
|
1687
|
-
const
|
|
1687
|
+
const In = ["swal-title", "swal-html", "swal-footer"], gr = (t) => {
|
|
1688
1688
|
const e = typeof t.template == "string" ? (
|
|
1689
1689
|
/** @type {HTMLTemplateElement} */
|
|
1690
1690
|
document.querySelector(t.template)
|
|
@@ -1692,8 +1692,8 @@ const Tn = ["swal-title", "swal-html", "swal-footer"], dr = (t) => {
|
|
|
1692
1692
|
if (!e)
|
|
1693
1693
|
return {};
|
|
1694
1694
|
const n = e.content;
|
|
1695
|
-
return
|
|
1696
|
-
},
|
|
1695
|
+
return Ar(n), Object.assign(mr(n), br(n), yr(n), vr(n), Cr(n), kr(n), xr(n, In));
|
|
1696
|
+
}, mr = (t) => {
|
|
1697
1697
|
const e = {};
|
|
1698
1698
|
return Array.from(t.querySelectorAll("swal-param")).forEach((o) => {
|
|
1699
1699
|
Q(o, ["name", "value"]);
|
|
@@ -1709,7 +1709,7 @@ const Tn = ["swal-title", "swal-html", "swal-footer"], dr = (t) => {
|
|
|
1709
1709
|
s
|
|
1710
1710
|
] == "object" ? e[s] = JSON.parse(r) : e[s] = r);
|
|
1711
1711
|
}), e;
|
|
1712
|
-
},
|
|
1712
|
+
}, br = (t) => {
|
|
1713
1713
|
const e = {};
|
|
1714
1714
|
return Array.from(t.querySelectorAll("swal-function-param")).forEach((o) => {
|
|
1715
1715
|
const s = (
|
|
@@ -1718,13 +1718,13 @@ const Tn = ["swal-title", "swal-html", "swal-footer"], dr = (t) => {
|
|
|
1718
1718
|
), r = o.getAttribute("value");
|
|
1719
1719
|
!s || !r || (e[s] = new Function(`return ${r}`)());
|
|
1720
1720
|
}), e;
|
|
1721
|
-
},
|
|
1721
|
+
}, yr = (t) => {
|
|
1722
1722
|
const e = {};
|
|
1723
1723
|
return Array.from(t.querySelectorAll("swal-button")).forEach((o) => {
|
|
1724
1724
|
Q(o, ["type", "color", "aria-label"]);
|
|
1725
1725
|
const s = o.getAttribute("type");
|
|
1726
1726
|
if (!(!s || !["confirm", "cancel", "deny"].includes(s))) {
|
|
1727
|
-
if (e[`${s}ButtonText`] = o.innerHTML, e[`show${
|
|
1727
|
+
if (e[`${s}ButtonText`] = o.innerHTML, e[`show${et(s)}Button`] = !0, o.hasAttribute("color")) {
|
|
1728
1728
|
const r = o.getAttribute("color");
|
|
1729
1729
|
r !== null && (e[`${s}ButtonColor`] = r);
|
|
1730
1730
|
}
|
|
@@ -1734,13 +1734,13 @@ const Tn = ["swal-title", "swal-html", "swal-footer"], dr = (t) => {
|
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
1736
|
}), e;
|
|
1737
|
-
},
|
|
1737
|
+
}, vr = (t) => {
|
|
1738
1738
|
const e = {}, n = t.querySelector("swal-image");
|
|
1739
1739
|
return n && (Q(n, ["src", "width", "height", "alt"]), n.hasAttribute("src") && (e.imageUrl = n.getAttribute("src") || void 0), n.hasAttribute("width") && (e.imageWidth = n.getAttribute("width") || void 0), n.hasAttribute("height") && (e.imageHeight = n.getAttribute("height") || void 0), n.hasAttribute("alt") && (e.imageAlt = n.getAttribute("alt") || void 0)), e;
|
|
1740
|
-
},
|
|
1740
|
+
}, Cr = (t) => {
|
|
1741
1741
|
const e = {}, n = t.querySelector("swal-icon");
|
|
1742
1742
|
return n && (Q(n, ["type", "color"]), n.hasAttribute("type") && (e.icon = n.getAttribute("type")), n.hasAttribute("color") && (e.iconColor = n.getAttribute("color")), e.iconHtml = n.innerHTML), e;
|
|
1743
|
-
},
|
|
1743
|
+
}, kr = (t) => {
|
|
1744
1744
|
const e = {}, n = t.querySelector("swal-input");
|
|
1745
1745
|
n && (Q(n, ["type", "label", "placeholder", "value"]), e.input = n.getAttribute("type") || "text", n.hasAttribute("label") && (e.inputLabel = n.getAttribute("label")), n.hasAttribute("placeholder") && (e.inputPlaceholder = n.getAttribute("placeholder")), n.hasAttribute("value") && (e.inputValue = n.getAttribute("value")));
|
|
1746
1746
|
const o = Array.from(t.querySelectorAll("swal-input-option"));
|
|
@@ -1749,18 +1749,18 @@ const Tn = ["swal-title", "swal-html", "swal-footer"], dr = (t) => {
|
|
|
1749
1749
|
const r = s.getAttribute("value");
|
|
1750
1750
|
if (!r)
|
|
1751
1751
|
return;
|
|
1752
|
-
const
|
|
1753
|
-
e.inputOptions[r] =
|
|
1752
|
+
const a = s.innerHTML;
|
|
1753
|
+
e.inputOptions[r] = a;
|
|
1754
1754
|
})), e;
|
|
1755
|
-
},
|
|
1755
|
+
}, xr = (t, e) => {
|
|
1756
1756
|
const n = {};
|
|
1757
1757
|
for (const o in e) {
|
|
1758
1758
|
const s = e[o], r = t.querySelector(s);
|
|
1759
1759
|
r && (Q(r, []), n[s.replace(/^swal-/, "")] = r.innerHTML.trim());
|
|
1760
1760
|
}
|
|
1761
1761
|
return n;
|
|
1762
|
-
},
|
|
1763
|
-
const e =
|
|
1762
|
+
}, Ar = (t) => {
|
|
1763
|
+
const e = In.concat(["swal-param", "swal-function-param", "swal-button", "swal-image", "swal-icon", "swal-input", "swal-input-option"]);
|
|
1764
1764
|
Array.from(t.children).forEach((n) => {
|
|
1765
1765
|
const o = n.tagName.toLowerCase();
|
|
1766
1766
|
e.includes(o) || z(`Unrecognized element <${o}>`);
|
|
@@ -1769,40 +1769,40 @@ const Tn = ["swal-title", "swal-html", "swal-footer"], dr = (t) => {
|
|
|
1769
1769
|
Array.from(t.attributes).forEach((n) => {
|
|
1770
1770
|
e.indexOf(n.name) === -1 && z([`Unrecognized attribute "${n.name}" on <${t.tagName.toLowerCase()}>.`, `${e.length ? `Allowed attributes are: ${e.join(", ")}` : "To set the value, use HTML within the element."}`]);
|
|
1771
1771
|
});
|
|
1772
|
-
},
|
|
1772
|
+
}, $n = 10, Er = (t) => {
|
|
1773
1773
|
var e, n;
|
|
1774
|
-
const o =
|
|
1774
|
+
const o = D(), s = S();
|
|
1775
1775
|
if (!o || !s)
|
|
1776
1776
|
return;
|
|
1777
1777
|
typeof t.willOpen == "function" && t.willOpen(s), (e = p.eventEmitter) === null || e === void 0 || e.emit("willOpen", s);
|
|
1778
|
-
const
|
|
1779
|
-
if (
|
|
1780
|
-
|
|
1781
|
-
},
|
|
1778
|
+
const a = window.getComputedStyle(document.body).overflowY;
|
|
1779
|
+
if (Tr(o, s, t), setTimeout(() => {
|
|
1780
|
+
Lr(o, s);
|
|
1781
|
+
}, $n), at() && (Sr(o, t.scrollbarPadding !== void 0 ? t.scrollbarPadding : !1, a), cs()), !De() && !p.previousActiveElement && (p.previousActiveElement = document.activeElement), typeof t.didOpen == "function") {
|
|
1782
1782
|
const c = t.didOpen;
|
|
1783
1783
|
setTimeout(() => c(s));
|
|
1784
1784
|
}
|
|
1785
1785
|
(n = p.eventEmitter) === null || n === void 0 || n.emit("didOpen", s);
|
|
1786
1786
|
}, Me = (t) => {
|
|
1787
|
-
const e =
|
|
1787
|
+
const e = S();
|
|
1788
1788
|
if (!e || t.target !== e)
|
|
1789
1789
|
return;
|
|
1790
|
-
const n =
|
|
1791
|
-
n && (e.removeEventListener("animationend", Me), e.removeEventListener("transitionend", Me), n.style.overflowY = "auto", V(n,
|
|
1792
|
-
},
|
|
1793
|
-
|
|
1794
|
-
},
|
|
1795
|
-
|
|
1790
|
+
const n = D();
|
|
1791
|
+
n && (e.removeEventListener("animationend", Me), e.removeEventListener("transitionend", Me), n.style.overflowY = "auto", V(n, l["no-transition"]));
|
|
1792
|
+
}, Lr = (t, e) => {
|
|
1793
|
+
Kt(e) ? (t.style.overflowY = "hidden", e.addEventListener("animationend", Me), e.addEventListener("transitionend", Me)) : t.style.overflowY = "auto";
|
|
1794
|
+
}, Sr = (t, e, n) => {
|
|
1795
|
+
us(), e && n !== "hidden" && ms(n), setTimeout(() => {
|
|
1796
1796
|
t.scrollTop = 0;
|
|
1797
1797
|
});
|
|
1798
|
-
},
|
|
1798
|
+
}, Tr = (t, e, n) => {
|
|
1799
1799
|
var o;
|
|
1800
1800
|
(o = n.showClass) !== null && o !== void 0 && o.backdrop && L(t, n.showClass.backdrop), n.animation ? (e.style.setProperty("opacity", "0", "important"), M(e, "grid"), setTimeout(() => {
|
|
1801
1801
|
var s;
|
|
1802
1802
|
(s = n.showClass) !== null && s !== void 0 && s.popup && L(e, n.showClass.popup), e.style.removeProperty("opacity");
|
|
1803
|
-
},
|
|
1803
|
+
}, $n)) : M(e, "grid"), L([document.documentElement, document.body], l.shown), n.heightAuto && n.backdrop && !n.toast && L([document.documentElement, document.body], l["height-auto"]);
|
|
1804
1804
|
};
|
|
1805
|
-
var
|
|
1805
|
+
var $t = {
|
|
1806
1806
|
/**
|
|
1807
1807
|
* @param {string} string
|
|
1808
1808
|
* @param {string} [validationMessage]
|
|
@@ -1816,17 +1816,17 @@ var St = {
|
|
|
1816
1816
|
*/
|
|
1817
1817
|
url: (t, e) => /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t) ? Promise.resolve() : Promise.resolve(e || "Invalid URL")
|
|
1818
1818
|
};
|
|
1819
|
-
function
|
|
1820
|
-
t.inputValidator || (t.input === "email" && (t.inputValidator =
|
|
1819
|
+
function _r(t) {
|
|
1820
|
+
t.inputValidator || (t.input === "email" && (t.inputValidator = $t.email), t.input === "url" && (t.inputValidator = $t.url));
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1822
|
+
function Ir(t) {
|
|
1823
1823
|
(!t.target || typeof t.target == "string" && !document.querySelector(t.target) || typeof t.target != "string" && !t.target.appendChild) && (z('Target parameter is not valid, defaulting to "body"'), t.target = "body");
|
|
1824
1824
|
}
|
|
1825
|
-
function
|
|
1826
|
-
|
|
1825
|
+
function $r(t) {
|
|
1826
|
+
_r(t), t.showLoaderOnConfirm && !t.preConfirm && z(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
1827
1827
|
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
1828
|
-
https://sweetalert2.github.io/#ajax-request`),
|
|
1829
|
-
`).join("<br />")),
|
|
1828
|
+
https://sweetalert2.github.io/#ajax-request`), Ir(t), typeof t.title == "string" && (t.title = t.title.split(`
|
|
1829
|
+
`).join("<br />")), Co(t);
|
|
1830
1830
|
}
|
|
1831
1831
|
let F;
|
|
1832
1832
|
var Ae = /* @__PURE__ */ new WeakMap();
|
|
@@ -1836,7 +1836,7 @@ class P {
|
|
|
1836
1836
|
* @this {SweetAlert}
|
|
1837
1837
|
*/
|
|
1838
1838
|
constructor(...e) {
|
|
1839
|
-
if (
|
|
1839
|
+
if (Xn(
|
|
1840
1840
|
this,
|
|
1841
1841
|
Ae,
|
|
1842
1842
|
/** @type {Promise<SweetAlertResult>} */
|
|
@@ -1849,77 +1849,77 @@ class P {
|
|
|
1849
1849
|
return;
|
|
1850
1850
|
F = this;
|
|
1851
1851
|
const n = Object.freeze(this.constructor.argsToParams(e));
|
|
1852
|
-
this.params = n, this.isAwaitingPromise = !1,
|
|
1852
|
+
this.params = n, this.isAwaitingPromise = !1, Jn(Ae, this, this._main(F.params));
|
|
1853
1853
|
}
|
|
1854
1854
|
/**
|
|
1855
1855
|
* @param {any} userParams
|
|
1856
1856
|
* @param {any} mixinParams
|
|
1857
1857
|
*/
|
|
1858
1858
|
_main(e, n = {}) {
|
|
1859
|
-
if (
|
|
1859
|
+
if (An(Object.assign({}, n, e)), p.currentInstance) {
|
|
1860
1860
|
const r = se.swalPromiseResolve.get(p.currentInstance), {
|
|
1861
|
-
isAwaitingPromise:
|
|
1861
|
+
isAwaitingPromise: a
|
|
1862
1862
|
} = p.currentInstance;
|
|
1863
|
-
p.currentInstance._destroy(),
|
|
1863
|
+
p.currentInstance._destroy(), a || r({
|
|
1864
1864
|
isDismissed: !0
|
|
1865
|
-
}),
|
|
1865
|
+
}), at() && sn();
|
|
1866
1866
|
}
|
|
1867
1867
|
p.currentInstance = F;
|
|
1868
|
-
const o =
|
|
1869
|
-
|
|
1870
|
-
const s =
|
|
1871
|
-
return
|
|
1868
|
+
const o = Pr(e, n);
|
|
1869
|
+
$r(o), Object.freeze(o), p.timeout && (p.timeout.stop(), delete p.timeout), clearTimeout(p.restoreFocusTimeout);
|
|
1870
|
+
const s = Mr(F);
|
|
1871
|
+
return en(F, o), I.innerParams.set(F, o), Br(F, s, o);
|
|
1872
1872
|
}
|
|
1873
1873
|
// `catch` cannot be the name of a module export, so we define our thenable methods here instead
|
|
1874
1874
|
/**
|
|
1875
1875
|
* @param {any} onFulfilled
|
|
1876
1876
|
*/
|
|
1877
1877
|
then(e) {
|
|
1878
|
-
return
|
|
1878
|
+
return Ct(Ae, this).then(e);
|
|
1879
1879
|
}
|
|
1880
1880
|
/**
|
|
1881
1881
|
* @param {any} onFinally
|
|
1882
1882
|
*/
|
|
1883
1883
|
finally(e) {
|
|
1884
|
-
return
|
|
1884
|
+
return Ct(Ae, this).finally(e);
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
|
-
const
|
|
1888
|
-
const r = (
|
|
1887
|
+
const Br = (t, e, n) => new Promise((o, s) => {
|
|
1888
|
+
const r = (a) => {
|
|
1889
1889
|
t.close({
|
|
1890
1890
|
isDismissed: !0,
|
|
1891
|
-
dismiss:
|
|
1891
|
+
dismiss: a,
|
|
1892
1892
|
isConfirmed: !1,
|
|
1893
1893
|
isDenied: !1
|
|
1894
1894
|
});
|
|
1895
1895
|
};
|
|
1896
1896
|
se.swalPromiseResolve.set(t, o), se.swalPromiseReject.set(t, s), e.confirmButton.onclick = () => {
|
|
1897
|
-
|
|
1897
|
+
Ms(t);
|
|
1898
1898
|
}, e.denyButton.onclick = () => {
|
|
1899
|
-
|
|
1899
|
+
Os(t);
|
|
1900
1900
|
}, e.cancelButton.onclick = () => {
|
|
1901
|
-
|
|
1901
|
+
Ns(t, r);
|
|
1902
1902
|
}, e.closeButton.onclick = () => {
|
|
1903
|
-
r(
|
|
1904
|
-
},
|
|
1903
|
+
r(ue.close);
|
|
1904
|
+
}, Ws(n, e, r), ns(p, n, r), Es(t, n), Er(n), Or(p, n, r), Nr(e, n), setTimeout(() => {
|
|
1905
1905
|
e.container.scrollTop = 0;
|
|
1906
1906
|
});
|
|
1907
|
-
}),
|
|
1908
|
-
const n =
|
|
1907
|
+
}), Pr = (t, e) => {
|
|
1908
|
+
const n = gr(t), o = Object.assign({}, Y, e, n, t);
|
|
1909
1909
|
return o.showClass = Object.assign({}, Y.showClass, o.showClass), o.hideClass = Object.assign({}, Y.hideClass, o.hideClass), o.animation === !1 && (o.showClass = {
|
|
1910
1910
|
backdrop: "swal2-noanimation"
|
|
1911
1911
|
}, o.hideClass = {}), o;
|
|
1912
|
-
},
|
|
1912
|
+
}, Mr = (t) => {
|
|
1913
1913
|
const e = (
|
|
1914
1914
|
/** @type {DomCache} */
|
|
1915
1915
|
{
|
|
1916
1916
|
popup: (
|
|
1917
1917
|
/** @type {HTMLElement} */
|
|
1918
|
-
|
|
1918
|
+
S()
|
|
1919
1919
|
),
|
|
1920
1920
|
container: (
|
|
1921
1921
|
/** @type {HTMLElement} */
|
|
1922
|
-
|
|
1922
|
+
D()
|
|
1923
1923
|
),
|
|
1924
1924
|
actions: (
|
|
1925
1925
|
/** @type {HTMLElement} */
|
|
@@ -1943,7 +1943,7 @@ const Lr = (t, e, n) => new Promise((o, s) => {
|
|
|
1943
1943
|
),
|
|
1944
1944
|
closeButton: (
|
|
1945
1945
|
/** @type {HTMLElement} */
|
|
1946
|
-
|
|
1946
|
+
rt()
|
|
1947
1947
|
),
|
|
1948
1948
|
validationMessage: (
|
|
1949
1949
|
/** @type {HTMLElement} */
|
|
@@ -1951,62 +1951,62 @@ const Lr = (t, e, n) => new Promise((o, s) => {
|
|
|
1951
1951
|
),
|
|
1952
1952
|
progressSteps: (
|
|
1953
1953
|
/** @type {HTMLElement} */
|
|
1954
|
-
|
|
1954
|
+
st()
|
|
1955
1955
|
)
|
|
1956
1956
|
}
|
|
1957
1957
|
);
|
|
1958
|
-
return
|
|
1959
|
-
},
|
|
1958
|
+
return I.domCache.set(t, e), e;
|
|
1959
|
+
}, Or = (t, e, n) => {
|
|
1960
1960
|
const o = ze();
|
|
1961
|
-
N(o), e.timer && (t.timeout = new
|
|
1961
|
+
N(o), e.timer && (t.timeout = new pr(() => {
|
|
1962
1962
|
n("timer"), delete t.timeout;
|
|
1963
1963
|
}, e.timer), e.timerProgressBar && o && (M(o), U(o, e, "timerProgressBar"), setTimeout(() => {
|
|
1964
|
-
t.timeout && t.timeout.running &&
|
|
1964
|
+
t.timeout && t.timeout.running && ct(
|
|
1965
1965
|
/** @type {number} */
|
|
1966
1966
|
e.timer
|
|
1967
1967
|
);
|
|
1968
1968
|
})));
|
|
1969
|
-
},
|
|
1969
|
+
}, Nr = (t, e) => {
|
|
1970
1970
|
if (!e.toast) {
|
|
1971
1971
|
if (!Oe(e.allowEnterKey)) {
|
|
1972
|
-
|
|
1972
|
+
Ut("allowEnterKey"), jr();
|
|
1973
1973
|
return;
|
|
1974
1974
|
}
|
|
1975
|
-
|
|
1975
|
+
zr(t) || Dr(t, e) || We(-1, 1);
|
|
1976
1976
|
}
|
|
1977
|
-
},
|
|
1977
|
+
}, zr = (t) => {
|
|
1978
1978
|
const e = Array.from(t.popup.querySelectorAll("[autofocus]"));
|
|
1979
1979
|
for (const n of e)
|
|
1980
|
-
if (n instanceof HTMLElement &&
|
|
1980
|
+
if (n instanceof HTMLElement && j(n))
|
|
1981
1981
|
return n.focus(), !0;
|
|
1982
1982
|
return !1;
|
|
1983
|
-
},
|
|
1983
|
+
}, Dr = (t, e) => e.focusDeny && j(t.denyButton) ? (t.denyButton.focus(), !0) : e.focusCancel && j(t.cancelButton) ? (t.cancelButton.focus(), !0) : e.focusConfirm && j(t.confirmButton) ? (t.confirmButton.focus(), !0) : !1, jr = () => {
|
|
1984
1984
|
document.activeElement instanceof HTMLElement && typeof document.activeElement.blur == "function" && document.activeElement.blur();
|
|
1985
1985
|
};
|
|
1986
|
-
P.prototype.disableButtons =
|
|
1987
|
-
P.prototype.enableButtons =
|
|
1988
|
-
P.prototype.getInput =
|
|
1989
|
-
P.prototype.disableInput =
|
|
1990
|
-
P.prototype.enableInput =
|
|
1991
|
-
P.prototype.hideLoading =
|
|
1992
|
-
P.prototype.disableLoading =
|
|
1993
|
-
P.prototype.showValidationMessage =
|
|
1994
|
-
P.prototype.resetValidationMessage =
|
|
1986
|
+
P.prototype.disableButtons = gn;
|
|
1987
|
+
P.prototype.enableButtons = pn;
|
|
1988
|
+
P.prototype.getInput = hn;
|
|
1989
|
+
P.prototype.disableInput = bn;
|
|
1990
|
+
P.prototype.enableInput = mn;
|
|
1991
|
+
P.prototype.hideLoading = Be;
|
|
1992
|
+
P.prototype.disableLoading = Be;
|
|
1993
|
+
P.prototype.showValidationMessage = yn;
|
|
1994
|
+
P.prototype.resetValidationMessage = vn;
|
|
1995
1995
|
P.prototype.close = W;
|
|
1996
1996
|
P.prototype.closePopup = W;
|
|
1997
1997
|
P.prototype.closeModal = W;
|
|
1998
1998
|
P.prototype.closeToast = W;
|
|
1999
|
-
P.prototype.rejectPromise =
|
|
2000
|
-
P.prototype.update =
|
|
2001
|
-
P.prototype._destroy =
|
|
2002
|
-
Object.assign(P,
|
|
2003
|
-
Object.keys(
|
|
1999
|
+
P.prototype.rejectPromise = ln;
|
|
2000
|
+
P.prototype.update = En;
|
|
2001
|
+
P.prototype._destroy = Ln;
|
|
2002
|
+
Object.assign(P, fr);
|
|
2003
|
+
Object.keys(Gs).forEach((t) => {
|
|
2004
2004
|
P[t] = function(...e) {
|
|
2005
2005
|
if (F && F[t])
|
|
2006
2006
|
return F[t](...e);
|
|
2007
2007
|
};
|
|
2008
2008
|
});
|
|
2009
|
-
P.DismissReason =
|
|
2009
|
+
P.DismissReason = ue;
|
|
2010
2010
|
P.version = "11.26.18";
|
|
2011
2011
|
const O = P;
|
|
2012
2012
|
O.default = O;
|
|
@@ -2019,8 +2019,8 @@ typeof document < "u" && (function(t, e) {
|
|
|
2019
2019
|
n.innerText = e;
|
|
2020
2020
|
}
|
|
2021
2021
|
})(document, ':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem;container-name:swal2-popup}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}@container swal2-popup style(--swal2-icon-animations:true){.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}');
|
|
2022
|
-
|
|
2023
|
-
class
|
|
2022
|
+
Qe.create();
|
|
2023
|
+
class Ur {
|
|
2024
2024
|
constructor() {
|
|
2025
2025
|
this.isActive = !1, this.baseUrl = "", this.appCode = "", this.token = "", this.currentLocale = "zh-CN", this.languages = [], this.wrappedElements = /* @__PURE__ */ new Set(), this.clickHandler = this.handleElementClick.bind(this);
|
|
2026
2026
|
}
|
|
@@ -2045,7 +2045,7 @@ class Mr {
|
|
|
2045
2045
|
return;
|
|
2046
2046
|
}
|
|
2047
2047
|
try {
|
|
2048
|
-
const n = await
|
|
2048
|
+
const n = await Fn({
|
|
2049
2049
|
baseUrl: this.baseUrl,
|
|
2050
2050
|
appCode: this.appCode,
|
|
2051
2051
|
token: this.token
|
|
@@ -2107,9 +2107,9 @@ class Mr {
|
|
|
2107
2107
|
for (; s = n.nextNode(); )
|
|
2108
2108
|
o.push(s);
|
|
2109
2109
|
o.forEach((r) => {
|
|
2110
|
-
const
|
|
2111
|
-
if (!
|
|
2112
|
-
const c = this.findKeyByValue(
|
|
2110
|
+
const a = r.textContent;
|
|
2111
|
+
if (!a || !a.trim()) return;
|
|
2112
|
+
const c = this.findKeyByValue(a.trim());
|
|
2113
2113
|
c ? this.wrapTextNode(r, c) : this.wrapPartialTextNode(r);
|
|
2114
2114
|
});
|
|
2115
2115
|
}
|
|
@@ -2140,17 +2140,17 @@ class Mr {
|
|
|
2140
2140
|
if (!o || o.tagName === "SCRIPT" || o.tagName === "STYLE" || o.tagName === "IFRAME" || o.classList.contains("i18n-editable-text") || o.classList.contains("i18n-text-overlay") || o.closest(".swal2-container"))
|
|
2141
2141
|
return;
|
|
2142
2142
|
const s = e.textContent, r = document.createDocumentFragment();
|
|
2143
|
-
let
|
|
2143
|
+
let a = 0;
|
|
2144
2144
|
if (n.forEach((c) => {
|
|
2145
|
-
const { translatedValue: i, key:
|
|
2146
|
-
if (
|
|
2147
|
-
const w = s.substring(
|
|
2145
|
+
const { translatedValue: i, key: u, index: d } = c;
|
|
2146
|
+
if (d > a) {
|
|
2147
|
+
const w = s.substring(a, d);
|
|
2148
2148
|
r.appendChild(document.createTextNode(w));
|
|
2149
2149
|
}
|
|
2150
2150
|
const h = document.createElement("span");
|
|
2151
|
-
h.className = "i18n-editable-text i18n-text-overlay", h.setAttribute("data-i18n-key",
|
|
2152
|
-
}),
|
|
2153
|
-
const c = s.substring(
|
|
2151
|
+
h.className = "i18n-editable-text i18n-text-overlay", h.setAttribute("data-i18n-key", u), h.textContent = i, r.appendChild(h), this.wrappedElements.add(h), a = d + i.length;
|
|
2152
|
+
}), a < s.length) {
|
|
2153
|
+
const c = s.substring(a);
|
|
2154
2154
|
r.appendChild(document.createTextNode(c));
|
|
2155
2155
|
}
|
|
2156
2156
|
o.replaceChild(r, e);
|
|
@@ -2164,12 +2164,12 @@ class Mr {
|
|
|
2164
2164
|
if (globalThis.__I18N_KEY_VALUE_MAP__ && globalThis.__I18N_KEY_VALUE_MAP__[e])
|
|
2165
2165
|
return globalThis.__I18N_KEY_VALUE_MAP__[e];
|
|
2166
2166
|
const s = `I18N_MESSAGES_COMMON_${(x.get("I18N_CONFIG") || {}).locale || "zh-CN"}`, r = x.get(s) || {};
|
|
2167
|
-
for (const [i,
|
|
2168
|
-
if (
|
|
2167
|
+
for (const [i, u] of Object.entries(r))
|
|
2168
|
+
if (u === e)
|
|
2169
2169
|
return i;
|
|
2170
|
-
const
|
|
2171
|
-
for (const [i,
|
|
2172
|
-
if (
|
|
2170
|
+
const a = `I18N_MESSAGES_${this.currentLocale}`, c = x.get(a) || {};
|
|
2171
|
+
for (const [i, u] of Object.entries(c))
|
|
2172
|
+
if (u === e)
|
|
2173
2173
|
return i;
|
|
2174
2174
|
return null;
|
|
2175
2175
|
}
|
|
@@ -2251,7 +2251,7 @@ class Mr {
|
|
|
2251
2251
|
/>
|
|
2252
2252
|
</div>
|
|
2253
2253
|
`
|
|
2254
|
-
).join(""), { value: r, isConfirmed:
|
|
2254
|
+
).join(""), { value: r, isConfirmed: a } = await O.fire({
|
|
2255
2255
|
title: `原值参考:${o["zh-CN_raw"]}`,
|
|
2256
2256
|
html: `
|
|
2257
2257
|
<div class="i18n-edit-form">
|
|
@@ -2271,19 +2271,19 @@ class Mr {
|
|
|
2271
2271
|
},
|
|
2272
2272
|
preConfirm: async () => {
|
|
2273
2273
|
const c = document.querySelectorAll(".i18n-edit-input"), i = {};
|
|
2274
|
-
c.forEach((
|
|
2275
|
-
i[
|
|
2274
|
+
c.forEach((d) => {
|
|
2275
|
+
i[d.getAttribute("data-lang")] = d.value;
|
|
2276
2276
|
});
|
|
2277
|
-
const
|
|
2278
|
-
|
|
2277
|
+
const u = document.getElementById("i18n-save-error");
|
|
2278
|
+
u && (u.style.display = "none", u.textContent = "");
|
|
2279
2279
|
try {
|
|
2280
2280
|
return await this.saveTranslations(e, i, n), i;
|
|
2281
|
-
} catch (
|
|
2282
|
-
return
|
|
2281
|
+
} catch (d) {
|
|
2282
|
+
return u && (u.textContent = d.message || "保存失败,请检查网络连接或权限", u.style.display = "block"), !1;
|
|
2283
2283
|
}
|
|
2284
2284
|
}
|
|
2285
2285
|
});
|
|
2286
|
-
|
|
2286
|
+
a && r && (this.notifyLanguageUpdate(), O.fire({
|
|
2287
2287
|
text: "保存成功",
|
|
2288
2288
|
icon: "success",
|
|
2289
2289
|
timer: 1500,
|
|
@@ -2306,7 +2306,7 @@ class Mr {
|
|
|
2306
2306
|
if (!this.appCode)
|
|
2307
2307
|
return [];
|
|
2308
2308
|
try {
|
|
2309
|
-
const o = (x.get("I18N_CONFIG") || {}).routerName || "", s = await
|
|
2309
|
+
const o = (x.get("I18N_CONFIG") || {}).routerName || "", s = await qn({
|
|
2310
2310
|
baseUrl: this.baseUrl,
|
|
2311
2311
|
data: {
|
|
2312
2312
|
appCode: this.appCode,
|
|
@@ -2332,20 +2332,20 @@ class Mr {
|
|
|
2332
2332
|
var i;
|
|
2333
2333
|
const s = o[0], { page: r } = s;
|
|
2334
2334
|
console.log(n);
|
|
2335
|
-
const
|
|
2336
|
-
A.map(n, (
|
|
2337
|
-
|
|
2335
|
+
const a = [];
|
|
2336
|
+
A.map(n, (u, d) => {
|
|
2337
|
+
a.push({
|
|
2338
2338
|
appCode: this.appCode,
|
|
2339
2339
|
page: r,
|
|
2340
2340
|
key: e,
|
|
2341
2341
|
unitCode: this.unitCode,
|
|
2342
|
-
lang:
|
|
2343
|
-
value:
|
|
2342
|
+
lang: d,
|
|
2343
|
+
value: u,
|
|
2344
2344
|
fromAi: "F"
|
|
2345
2345
|
});
|
|
2346
2346
|
});
|
|
2347
|
-
const c = await
|
|
2348
|
-
data: { data:
|
|
2347
|
+
const c = await Kn({
|
|
2348
|
+
data: { data: a, isLocal: "F" },
|
|
2349
2349
|
token: this.token,
|
|
2350
2350
|
baseUrl: this.baseUrl
|
|
2351
2351
|
});
|
|
@@ -2380,198 +2380,198 @@ class Mr {
|
|
|
2380
2380
|
});
|
|
2381
2381
|
}
|
|
2382
2382
|
}
|
|
2383
|
-
const
|
|
2384
|
-
function
|
|
2383
|
+
const Rr = new Ur();
|
|
2384
|
+
function Hr(t) {
|
|
2385
2385
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
2386
2386
|
}
|
|
2387
|
-
var
|
|
2388
|
-
function
|
|
2389
|
-
return
|
|
2387
|
+
var qe = { exports: {} }, Bt;
|
|
2388
|
+
function Vr() {
|
|
2389
|
+
return Bt || (Bt = 1, (function(t) {
|
|
2390
2390
|
var e = (function() {
|
|
2391
2391
|
var n = String.fromCharCode, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$", r = {};
|
|
2392
|
-
function
|
|
2392
|
+
function a(i, u) {
|
|
2393
2393
|
if (!r[i]) {
|
|
2394
2394
|
r[i] = {};
|
|
2395
|
-
for (var
|
|
2396
|
-
r[i][i.charAt(
|
|
2395
|
+
for (var d = 0; d < i.length; d++)
|
|
2396
|
+
r[i][i.charAt(d)] = d;
|
|
2397
2397
|
}
|
|
2398
|
-
return r[i][
|
|
2398
|
+
return r[i][u];
|
|
2399
2399
|
}
|
|
2400
2400
|
var c = {
|
|
2401
2401
|
compressToBase64: function(i) {
|
|
2402
2402
|
if (i == null) return "";
|
|
2403
|
-
var
|
|
2404
|
-
return o.charAt(
|
|
2403
|
+
var u = c._compress(i, 6, function(d) {
|
|
2404
|
+
return o.charAt(d);
|
|
2405
2405
|
});
|
|
2406
|
-
switch (
|
|
2406
|
+
switch (u.length % 4) {
|
|
2407
2407
|
// To produce valid Base64
|
|
2408
2408
|
default:
|
|
2409
2409
|
// When could this happen ?
|
|
2410
2410
|
case 0:
|
|
2411
|
-
return
|
|
2411
|
+
return u;
|
|
2412
2412
|
case 1:
|
|
2413
|
-
return
|
|
2413
|
+
return u + "===";
|
|
2414
2414
|
case 2:
|
|
2415
|
-
return
|
|
2415
|
+
return u + "==";
|
|
2416
2416
|
case 3:
|
|
2417
|
-
return
|
|
2417
|
+
return u + "=";
|
|
2418
2418
|
}
|
|
2419
2419
|
},
|
|
2420
2420
|
decompressFromBase64: function(i) {
|
|
2421
|
-
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32, function(
|
|
2422
|
-
return
|
|
2421
|
+
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32, function(u) {
|
|
2422
|
+
return a(o, i.charAt(u));
|
|
2423
2423
|
});
|
|
2424
2424
|
},
|
|
2425
2425
|
compressToUTF16: function(i) {
|
|
2426
|
-
return i == null ? "" : c._compress(i, 15, function(
|
|
2427
|
-
return n(
|
|
2426
|
+
return i == null ? "" : c._compress(i, 15, function(u) {
|
|
2427
|
+
return n(u + 32);
|
|
2428
2428
|
}) + " ";
|
|
2429
2429
|
},
|
|
2430
2430
|
decompressFromUTF16: function(i) {
|
|
2431
|
-
return i == null ? "" : i == "" ? null : c._decompress(i.length, 16384, function(
|
|
2432
|
-
return i.charCodeAt(
|
|
2431
|
+
return i == null ? "" : i == "" ? null : c._decompress(i.length, 16384, function(u) {
|
|
2432
|
+
return i.charCodeAt(u) - 32;
|
|
2433
2433
|
});
|
|
2434
2434
|
},
|
|
2435
2435
|
//compress into uint8array (UCS-2 big endian format)
|
|
2436
2436
|
compressToUint8Array: function(i) {
|
|
2437
|
-
for (var
|
|
2438
|
-
var k =
|
|
2439
|
-
|
|
2437
|
+
for (var u = c.compress(i), d = new Uint8Array(u.length * 2), h = 0, w = u.length; h < w; h++) {
|
|
2438
|
+
var k = u.charCodeAt(h);
|
|
2439
|
+
d[h * 2] = k >>> 8, d[h * 2 + 1] = k % 256;
|
|
2440
2440
|
}
|
|
2441
|
-
return
|
|
2441
|
+
return d;
|
|
2442
2442
|
},
|
|
2443
2443
|
//decompress from uint8array (UCS-2 big endian format)
|
|
2444
2444
|
decompressFromUint8Array: function(i) {
|
|
2445
2445
|
if (i == null)
|
|
2446
2446
|
return c.decompress(i);
|
|
2447
|
-
for (var
|
|
2448
|
-
d
|
|
2447
|
+
for (var u = new Array(i.length / 2), d = 0, h = u.length; d < h; d++)
|
|
2448
|
+
u[d] = i[d * 2] * 256 + i[d * 2 + 1];
|
|
2449
2449
|
var w = [];
|
|
2450
|
-
return
|
|
2450
|
+
return u.forEach(function(k) {
|
|
2451
2451
|
w.push(n(k));
|
|
2452
2452
|
}), c.decompress(w.join(""));
|
|
2453
2453
|
},
|
|
2454
2454
|
//compress into a string that is already URI encoded
|
|
2455
2455
|
compressToEncodedURIComponent: function(i) {
|
|
2456
|
-
return i == null ? "" : c._compress(i, 6, function(
|
|
2457
|
-
return s.charAt(
|
|
2456
|
+
return i == null ? "" : c._compress(i, 6, function(u) {
|
|
2457
|
+
return s.charAt(u);
|
|
2458
2458
|
});
|
|
2459
2459
|
},
|
|
2460
2460
|
//decompress from an output of compressToEncodedURIComponent
|
|
2461
2461
|
decompressFromEncodedURIComponent: function(i) {
|
|
2462
|
-
return i == null ? "" : i == "" ? null : (i = i.replace(/ /g, "+"), c._decompress(i.length, 32, function(
|
|
2463
|
-
return
|
|
2462
|
+
return i == null ? "" : i == "" ? null : (i = i.replace(/ /g, "+"), c._decompress(i.length, 32, function(u) {
|
|
2463
|
+
return a(s, i.charAt(u));
|
|
2464
2464
|
}));
|
|
2465
2465
|
},
|
|
2466
2466
|
compress: function(i) {
|
|
2467
|
-
return c._compress(i, 16, function(
|
|
2468
|
-
return n(
|
|
2467
|
+
return c._compress(i, 16, function(u) {
|
|
2468
|
+
return n(u);
|
|
2469
2469
|
});
|
|
2470
2470
|
},
|
|
2471
|
-
_compress: function(i,
|
|
2471
|
+
_compress: function(i, u, d) {
|
|
2472
2472
|
if (i == null) return "";
|
|
2473
|
-
var h, w, k = {},
|
|
2473
|
+
var h, w, k = {}, T = {}, _ = "", $ = "", E = "", g = 2, y = 3, v = 2, C = [], f = 0, m = 0, b;
|
|
2474
2474
|
for (b = 0; b < i.length; b += 1)
|
|
2475
|
-
if (_ = i.charAt(b), Object.prototype.hasOwnProperty.call(k, _) || (k[_] = y++,
|
|
2476
|
-
E =
|
|
2475
|
+
if (_ = i.charAt(b), Object.prototype.hasOwnProperty.call(k, _) || (k[_] = y++, T[_] = !0), $ = E + _, Object.prototype.hasOwnProperty.call(k, $))
|
|
2476
|
+
E = $;
|
|
2477
2477
|
else {
|
|
2478
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2478
|
+
if (Object.prototype.hasOwnProperty.call(T, E)) {
|
|
2479
2479
|
if (E.charCodeAt(0) < 256) {
|
|
2480
2480
|
for (h = 0; h < v; h++)
|
|
2481
|
-
f = f << 1, m ==
|
|
2481
|
+
f = f << 1, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++;
|
|
2482
2482
|
for (w = E.charCodeAt(0), h = 0; h < 8; h++)
|
|
2483
|
-
f = f << 1 | w & 1, m ==
|
|
2483
|
+
f = f << 1 | w & 1, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++, w = w >> 1;
|
|
2484
2484
|
} else {
|
|
2485
2485
|
for (w = 1, h = 0; h < v; h++)
|
|
2486
|
-
f = f << 1 | w, m ==
|
|
2486
|
+
f = f << 1 | w, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++, w = 0;
|
|
2487
2487
|
for (w = E.charCodeAt(0), h = 0; h < 16; h++)
|
|
2488
|
-
f = f << 1 | w & 1, m ==
|
|
2488
|
+
f = f << 1 | w & 1, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++, w = w >> 1;
|
|
2489
2489
|
}
|
|
2490
|
-
g--, g == 0 && (g = Math.pow(2, v), v++), delete
|
|
2490
|
+
g--, g == 0 && (g = Math.pow(2, v), v++), delete T[E];
|
|
2491
2491
|
} else
|
|
2492
2492
|
for (w = k[E], h = 0; h < v; h++)
|
|
2493
|
-
f = f << 1 | w & 1, m ==
|
|
2494
|
-
g--, g == 0 && (g = Math.pow(2, v), v++), k[
|
|
2493
|
+
f = f << 1 | w & 1, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++, w = w >> 1;
|
|
2494
|
+
g--, g == 0 && (g = Math.pow(2, v), v++), k[$] = y++, E = String(_);
|
|
2495
2495
|
}
|
|
2496
2496
|
if (E !== "") {
|
|
2497
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2497
|
+
if (Object.prototype.hasOwnProperty.call(T, E)) {
|
|
2498
2498
|
if (E.charCodeAt(0) < 256) {
|
|
2499
2499
|
for (h = 0; h < v; h++)
|
|
2500
|
-
f = f << 1, m ==
|
|
2500
|
+
f = f << 1, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++;
|
|
2501
2501
|
for (w = E.charCodeAt(0), h = 0; h < 8; h++)
|
|
2502
|
-
f = f << 1 | w & 1, m ==
|
|
2502
|
+
f = f << 1 | w & 1, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++, w = w >> 1;
|
|
2503
2503
|
} else {
|
|
2504
2504
|
for (w = 1, h = 0; h < v; h++)
|
|
2505
|
-
f = f << 1 | w, m ==
|
|
2505
|
+
f = f << 1 | w, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++, w = 0;
|
|
2506
2506
|
for (w = E.charCodeAt(0), h = 0; h < 16; h++)
|
|
2507
|
-
f = f << 1 | w & 1, m ==
|
|
2507
|
+
f = f << 1 | w & 1, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++, w = w >> 1;
|
|
2508
2508
|
}
|
|
2509
|
-
g--, g == 0 && (g = Math.pow(2, v), v++), delete
|
|
2509
|
+
g--, g == 0 && (g = Math.pow(2, v), v++), delete T[E];
|
|
2510
2510
|
} else
|
|
2511
2511
|
for (w = k[E], h = 0; h < v; h++)
|
|
2512
|
-
f = f << 1 | w & 1, m ==
|
|
2512
|
+
f = f << 1 | w & 1, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++, w = w >> 1;
|
|
2513
2513
|
g--, g == 0 && (g = Math.pow(2, v), v++);
|
|
2514
2514
|
}
|
|
2515
2515
|
for (w = 2, h = 0; h < v; h++)
|
|
2516
|
-
f = f << 1 | w & 1, m ==
|
|
2516
|
+
f = f << 1 | w & 1, m == u - 1 ? (m = 0, C.push(d(f)), f = 0) : m++, w = w >> 1;
|
|
2517
2517
|
for (; ; )
|
|
2518
|
-
if (f = f << 1, m ==
|
|
2519
|
-
C.push(
|
|
2518
|
+
if (f = f << 1, m == u - 1) {
|
|
2519
|
+
C.push(d(f));
|
|
2520
2520
|
break;
|
|
2521
2521
|
} else m++;
|
|
2522
2522
|
return C.join("");
|
|
2523
2523
|
},
|
|
2524
2524
|
decompress: function(i) {
|
|
2525
|
-
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32768, function(
|
|
2526
|
-
return i.charCodeAt(
|
|
2525
|
+
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32768, function(u) {
|
|
2526
|
+
return i.charCodeAt(u);
|
|
2527
2527
|
});
|
|
2528
2528
|
},
|
|
2529
|
-
_decompress: function(i,
|
|
2530
|
-
var h = [], w = 4, k = 4,
|
|
2529
|
+
_decompress: function(i, u, d) {
|
|
2530
|
+
var h = [], w = 4, k = 4, T = 3, _ = "", $ = [], E, g, y, v, C, f, m, b = { val: d(0), position: u, index: 1 };
|
|
2531
2531
|
for (E = 0; E < 3; E += 1)
|
|
2532
2532
|
h[E] = E;
|
|
2533
2533
|
for (y = 0, C = Math.pow(2, 2), f = 1; f != C; )
|
|
2534
|
-
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position =
|
|
2534
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = u, b.val = d(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2535
2535
|
switch (y) {
|
|
2536
2536
|
case 0:
|
|
2537
2537
|
for (y = 0, C = Math.pow(2, 8), f = 1; f != C; )
|
|
2538
|
-
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position =
|
|
2538
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = u, b.val = d(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2539
2539
|
m = n(y);
|
|
2540
2540
|
break;
|
|
2541
2541
|
case 1:
|
|
2542
2542
|
for (y = 0, C = Math.pow(2, 16), f = 1; f != C; )
|
|
2543
|
-
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position =
|
|
2543
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = u, b.val = d(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2544
2544
|
m = n(y);
|
|
2545
2545
|
break;
|
|
2546
2546
|
case 2:
|
|
2547
2547
|
return "";
|
|
2548
2548
|
}
|
|
2549
|
-
for (h[3] = m, g = m,
|
|
2549
|
+
for (h[3] = m, g = m, $.push(m); ; ) {
|
|
2550
2550
|
if (b.index > i)
|
|
2551
2551
|
return "";
|
|
2552
|
-
for (y = 0, C = Math.pow(2,
|
|
2553
|
-
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position =
|
|
2552
|
+
for (y = 0, C = Math.pow(2, T), f = 1; f != C; )
|
|
2553
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = u, b.val = d(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2554
2554
|
switch (m = y) {
|
|
2555
2555
|
case 0:
|
|
2556
2556
|
for (y = 0, C = Math.pow(2, 8), f = 1; f != C; )
|
|
2557
|
-
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position =
|
|
2557
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = u, b.val = d(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2558
2558
|
h[k++] = n(y), m = k - 1, w--;
|
|
2559
2559
|
break;
|
|
2560
2560
|
case 1:
|
|
2561
2561
|
for (y = 0, C = Math.pow(2, 16), f = 1; f != C; )
|
|
2562
|
-
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position =
|
|
2562
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = u, b.val = d(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2563
2563
|
h[k++] = n(y), m = k - 1, w--;
|
|
2564
2564
|
break;
|
|
2565
2565
|
case 2:
|
|
2566
|
-
return
|
|
2566
|
+
return $.join("");
|
|
2567
2567
|
}
|
|
2568
|
-
if (w == 0 && (w = Math.pow(2,
|
|
2568
|
+
if (w == 0 && (w = Math.pow(2, T), T++), h[m])
|
|
2569
2569
|
_ = h[m];
|
|
2570
2570
|
else if (m === k)
|
|
2571
2571
|
_ = g + g.charAt(0);
|
|
2572
2572
|
else
|
|
2573
2573
|
return null;
|
|
2574
|
-
|
|
2574
|
+
$.push(_), h[k++] = g + _.charAt(0), w--, g = _, w == 0 && (w = Math.pow(2, T), T++);
|
|
2575
2575
|
}
|
|
2576
2576
|
}
|
|
2577
2577
|
};
|
|
@@ -2580,44 +2580,159 @@ function zr() {
|
|
|
2580
2580
|
t != null ? t.exports = e : typeof angular < "u" && angular != null && angular.module("LZString", []).factory("LZString", function() {
|
|
2581
2581
|
return e;
|
|
2582
2582
|
});
|
|
2583
|
-
})(
|
|
2584
|
-
}
|
|
2585
|
-
var
|
|
2586
|
-
const Ee = /* @__PURE__ */
|
|
2587
|
-
function
|
|
2588
|
-
const e = [], n =
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
e.push(o[2]);
|
|
2593
|
-
}
|
|
2594
|
-
if (t.render) {
|
|
2583
|
+
})(qe)), qe.exports;
|
|
2584
|
+
}
|
|
2585
|
+
var Fr = Vr();
|
|
2586
|
+
const Ee = /* @__PURE__ */ Hr(Fr);
|
|
2587
|
+
function Ze(t) {
|
|
2588
|
+
const e = [], n = (o) => {
|
|
2589
|
+
e.push(...qr(o));
|
|
2590
|
+
};
|
|
2591
|
+
if (t.template && n(t.template), t.render) {
|
|
2595
2592
|
const o = t.render.toString();
|
|
2596
|
-
|
|
2597
|
-
for (; (s = n.exec(o)) !== null; )
|
|
2598
|
-
e.push(s[2]);
|
|
2593
|
+
n(o);
|
|
2599
2594
|
}
|
|
2600
2595
|
if (t.setup) {
|
|
2601
2596
|
const o = t.setup.toString();
|
|
2602
|
-
|
|
2603
|
-
for (; (s = n.exec(o)) !== null; )
|
|
2604
|
-
e.push(s[2]);
|
|
2597
|
+
n(o);
|
|
2605
2598
|
}
|
|
2606
2599
|
if (t.methods)
|
|
2607
2600
|
for (const o in t.methods) {
|
|
2608
2601
|
const s = t.methods[o].toString();
|
|
2609
|
-
|
|
2610
|
-
for (; (r = n.exec(s)) !== null; )
|
|
2611
|
-
e.push(r[2]);
|
|
2602
|
+
n(s);
|
|
2612
2603
|
}
|
|
2613
2604
|
if (t.components)
|
|
2614
2605
|
for (const o in t.components) {
|
|
2615
2606
|
const s = t.components[o];
|
|
2616
|
-
e.push(...
|
|
2607
|
+
e.push(...Ze(s));
|
|
2617
2608
|
}
|
|
2618
2609
|
return [...new Set(e)];
|
|
2619
2610
|
}
|
|
2620
|
-
|
|
2611
|
+
function qr(t) {
|
|
2612
|
+
const e = [], n = /(?:\$t|(?:this|_vm|_ctx|\$setup|ctx|globalThis)\.\$t)\s*\(/g;
|
|
2613
|
+
for (; n.exec(t) !== null; ) {
|
|
2614
|
+
const o = n.lastIndex - 1, s = Bn(t, o);
|
|
2615
|
+
if (s === -1) continue;
|
|
2616
|
+
const r = t.slice(o + 1, s), a = Kr(r);
|
|
2617
|
+
e.push(...Xe(a)), n.lastIndex = s + 1;
|
|
2618
|
+
}
|
|
2619
|
+
return e;
|
|
2620
|
+
}
|
|
2621
|
+
function Xe(t) {
|
|
2622
|
+
const e = Yr(t.trim()), n = Zr(e);
|
|
2623
|
+
if (n !== null) return [n];
|
|
2624
|
+
const o = Gr(e);
|
|
2625
|
+
return o ? [
|
|
2626
|
+
...Xe(o.consequent),
|
|
2627
|
+
...Xe(o.alternate)
|
|
2628
|
+
] : [];
|
|
2629
|
+
}
|
|
2630
|
+
function Kr(t) {
|
|
2631
|
+
const e = Pn(t, ",");
|
|
2632
|
+
return e === -1 ? t : t.slice(0, e);
|
|
2633
|
+
}
|
|
2634
|
+
function Gr(t) {
|
|
2635
|
+
const e = Pn(t, "?");
|
|
2636
|
+
if (e === -1) return null;
|
|
2637
|
+
const n = Wr(t, e + 1);
|
|
2638
|
+
return n === -1 ? null : {
|
|
2639
|
+
consequent: t.slice(e + 1, n),
|
|
2640
|
+
alternate: t.slice(n + 1)
|
|
2641
|
+
};
|
|
2642
|
+
}
|
|
2643
|
+
function Bn(t, e) {
|
|
2644
|
+
let n = 0;
|
|
2645
|
+
for (let o = e; o < t.length; o++) {
|
|
2646
|
+
const s = t[o];
|
|
2647
|
+
if (Ue(s)) {
|
|
2648
|
+
o = pt(t, o);
|
|
2649
|
+
continue;
|
|
2650
|
+
}
|
|
2651
|
+
if (s === "(" && n++, s === ")" && (n--, n === 0))
|
|
2652
|
+
return o;
|
|
2653
|
+
}
|
|
2654
|
+
return -1;
|
|
2655
|
+
}
|
|
2656
|
+
function Pn(t, e) {
|
|
2657
|
+
let n = 0, o = 0, s = 0;
|
|
2658
|
+
for (let r = 0; r < t.length; r++) {
|
|
2659
|
+
const a = t[r];
|
|
2660
|
+
if (Ue(a)) {
|
|
2661
|
+
r = pt(t, r);
|
|
2662
|
+
continue;
|
|
2663
|
+
}
|
|
2664
|
+
if (a === "(") n++;
|
|
2665
|
+
else if (a === ")") n--;
|
|
2666
|
+
else if (a === "[") o++;
|
|
2667
|
+
else if (a === "]") o--;
|
|
2668
|
+
else if (a === "{") s++;
|
|
2669
|
+
else if (a === "}") s--;
|
|
2670
|
+
else if (a === e && !Mn(t, r, e) && n === 0 && o === 0 && s === 0)
|
|
2671
|
+
return r;
|
|
2672
|
+
}
|
|
2673
|
+
return -1;
|
|
2674
|
+
}
|
|
2675
|
+
function Wr(t, e) {
|
|
2676
|
+
let n = 0, o = 0, s = 0, r = 0;
|
|
2677
|
+
for (let a = e; a < t.length; a++) {
|
|
2678
|
+
const c = t[a];
|
|
2679
|
+
if (Ue(c)) {
|
|
2680
|
+
a = pt(t, a);
|
|
2681
|
+
continue;
|
|
2682
|
+
}
|
|
2683
|
+
if (c === "(") o++;
|
|
2684
|
+
else if (c === ")") o--;
|
|
2685
|
+
else if (c === "[") s++;
|
|
2686
|
+
else if (c === "]") s--;
|
|
2687
|
+
else if (c === "{") r++;
|
|
2688
|
+
else if (c === "}") r--;
|
|
2689
|
+
else if (o === 0 && s === 0 && r === 0 && (c === "?" && !Mn(t, a, "?") && n++, c === ":")) {
|
|
2690
|
+
if (n === 0) return a;
|
|
2691
|
+
n--;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
return -1;
|
|
2695
|
+
}
|
|
2696
|
+
function Yr(t) {
|
|
2697
|
+
let e = t;
|
|
2698
|
+
for (; e.startsWith("(") && Bn(e, 0) === e.length - 1; )
|
|
2699
|
+
e = e.slice(1, -1).trim();
|
|
2700
|
+
return e;
|
|
2701
|
+
}
|
|
2702
|
+
function Zr(t) {
|
|
2703
|
+
if (!t || !Ue(t[0])) return null;
|
|
2704
|
+
const e = t[0];
|
|
2705
|
+
let n = "";
|
|
2706
|
+
for (let o = 1; o < t.length; o++) {
|
|
2707
|
+
const s = t[o];
|
|
2708
|
+
if (s === "\\") {
|
|
2709
|
+
n += t[o + 1] || "", o++;
|
|
2710
|
+
continue;
|
|
2711
|
+
}
|
|
2712
|
+
if (s === e)
|
|
2713
|
+
return e === "`" && n.includes("${") || t.slice(o + 1).trim() ? null : n;
|
|
2714
|
+
n += s;
|
|
2715
|
+
}
|
|
2716
|
+
return null;
|
|
2717
|
+
}
|
|
2718
|
+
function pt(t, e) {
|
|
2719
|
+
const n = t[e];
|
|
2720
|
+
for (let o = e + 1; o < t.length; o++) {
|
|
2721
|
+
if (t[o] === "\\") {
|
|
2722
|
+
o++;
|
|
2723
|
+
continue;
|
|
2724
|
+
}
|
|
2725
|
+
if (t[o] === n) return o;
|
|
2726
|
+
}
|
|
2727
|
+
return t.length - 1;
|
|
2728
|
+
}
|
|
2729
|
+
function Ue(t) {
|
|
2730
|
+
return t === "'" || t === '"' || t === "`";
|
|
2731
|
+
}
|
|
2732
|
+
function Mn(t, e, n) {
|
|
2733
|
+
return n === "?" && (t[e + 1] === "." || t[e + 1] === "?");
|
|
2734
|
+
}
|
|
2735
|
+
const Pt = {
|
|
2621
2736
|
name: "Earth",
|
|
2622
2737
|
props: {
|
|
2623
2738
|
editable: {
|
|
@@ -2657,7 +2772,7 @@ const $t = {
|
|
|
2657
2772
|
},
|
|
2658
2773
|
emits: ["update:modelValue"],
|
|
2659
2774
|
setup(t, { emit: e }) {
|
|
2660
|
-
const n = ne("zh-CN"), o = ne(""), s = ne(""), r = ne([]),
|
|
2775
|
+
const n = ne("zh-CN"), o = ne(""), s = ne(""), r = ne([]), a = () => {
|
|
2661
2776
|
const g = x.get("I18N_CONFIG") || {};
|
|
2662
2777
|
o.value = g.appCode || "", s.value = g.token || (x.get("I18N_CONFIG") || {}).token || "", n.value = x.get("I18N_LANGUAGE") || g.locale || "zh-CN";
|
|
2663
2778
|
}, c = async () => {
|
|
@@ -2665,20 +2780,20 @@ const $t = {
|
|
|
2665
2780
|
r.value = t.languages;
|
|
2666
2781
|
return;
|
|
2667
2782
|
}
|
|
2668
|
-
const g = await
|
|
2783
|
+
const g = await Nt({
|
|
2669
2784
|
baseUrl: t.baseUrl,
|
|
2670
2785
|
token: s.value,
|
|
2671
2786
|
appCode: o.value
|
|
2672
2787
|
});
|
|
2673
2788
|
r.value = g;
|
|
2674
|
-
}, i =
|
|
2789
|
+
}, i = Re(() => {
|
|
2675
2790
|
const g = {};
|
|
2676
2791
|
return !t.modelValue || !Array.isArray(t.modelValue) || t.modelValue.forEach((y) => {
|
|
2677
2792
|
y && typeof y == "object" && Object.keys(y).forEach((v) => {
|
|
2678
2793
|
g[v] = y[v];
|
|
2679
2794
|
});
|
|
2680
2795
|
}), g;
|
|
2681
|
-
}),
|
|
2796
|
+
}), u = Re(() => i.value[n.value] || ""), d = Re(() => Object.keys(i.value).filter((y) => y !== n.value).map((y) => ({
|
|
2682
2797
|
lang: y,
|
|
2683
2798
|
value: i.value[y]
|
|
2684
2799
|
}))), h = (g) => {
|
|
@@ -2701,7 +2816,7 @@ const $t = {
|
|
|
2701
2816
|
Array.from(new Set(v)).forEach((C) => {
|
|
2702
2817
|
C.postMessage(g, y);
|
|
2703
2818
|
});
|
|
2704
|
-
},
|
|
2819
|
+
}, T = () => {
|
|
2705
2820
|
window.addEventListener("storage", (g) => {
|
|
2706
2821
|
g.key === "I18N_LANGUAGE" && (n.value = g.newValue || "zh-CN");
|
|
2707
2822
|
});
|
|
@@ -2766,8 +2881,8 @@ const $t = {
|
|
|
2766
2881
|
toast: !0
|
|
2767
2882
|
});
|
|
2768
2883
|
}
|
|
2769
|
-
},
|
|
2770
|
-
const g =
|
|
2884
|
+
}, $ = () => {
|
|
2885
|
+
const g = d.value;
|
|
2771
2886
|
if (g.length === 0) {
|
|
2772
2887
|
O.fire({
|
|
2773
2888
|
title: "多语言翻译",
|
|
@@ -2789,7 +2904,7 @@ const $t = {
|
|
|
2789
2904
|
<div class="i18n-modal-content">
|
|
2790
2905
|
<div class="i18n-current-lang">
|
|
2791
2906
|
<strong>当前语言 (${n.value}):</strong>
|
|
2792
|
-
<span>${
|
|
2907
|
+
<span>${u.value || "-"}</span>
|
|
2793
2908
|
</div>
|
|
2794
2909
|
<div class="i18n-other-langs">
|
|
2795
2910
|
<strong>其他语言:</strong>
|
|
@@ -2808,12 +2923,12 @@ const $t = {
|
|
|
2808
2923
|
}
|
|
2809
2924
|
});
|
|
2810
2925
|
}, E = () => {
|
|
2811
|
-
t.request && typeof t.request == "function" ? _() :
|
|
2926
|
+
t.request && typeof t.request == "function" ? _() : $();
|
|
2812
2927
|
};
|
|
2813
|
-
return
|
|
2814
|
-
|
|
2928
|
+
return jn(() => {
|
|
2929
|
+
a(), c(), window.addEventListener("message", w), T();
|
|
2815
2930
|
}), {
|
|
2816
|
-
currentValue:
|
|
2931
|
+
currentValue: u,
|
|
2817
2932
|
openModal: E
|
|
2818
2933
|
};
|
|
2819
2934
|
},
|
|
@@ -2859,14 +2974,14 @@ function we(t) {
|
|
|
2859
2974
|
"en-us": "en-US"
|
|
2860
2975
|
}[e] || t;
|
|
2861
2976
|
}
|
|
2862
|
-
function
|
|
2977
|
+
function On(t = {}) {
|
|
2863
2978
|
const e = Object.entries(t || {});
|
|
2864
|
-
return e.some(([, o]) => o && typeof o == "object" && !Array.isArray(o) && Object.keys(o).some((s) => s.includes("-"))) ? e.reduce((o, [s, r]) => (!r || typeof r != "object" || Array.isArray(r) || Object.entries(r).forEach(([
|
|
2865
|
-
const i = we(
|
|
2979
|
+
return e.some(([, o]) => o && typeof o == "object" && !Array.isArray(o) && Object.keys(o).some((s) => s.includes("-"))) ? e.reduce((o, [s, r]) => (!r || typeof r != "object" || Array.isArray(r) || Object.entries(r).forEach(([a, c]) => {
|
|
2980
|
+
const i = we(a);
|
|
2866
2981
|
o[i] = o[i] || {}, o[i][s] = c;
|
|
2867
2982
|
}), o), {}) : e.reduce((o, [s, r]) => (o[we(s)] = r, o), {});
|
|
2868
2983
|
}
|
|
2869
|
-
function
|
|
2984
|
+
function Mt(t, e) {
|
|
2870
2985
|
return t[e] || t[we(e)] || t[String(e || "").toLowerCase()] || {};
|
|
2871
2986
|
}
|
|
2872
2987
|
function he(t, e) {
|
|
@@ -2874,14 +2989,14 @@ function he(t, e) {
|
|
|
2874
2989
|
return t;
|
|
2875
2990
|
const n = Object.entries(e);
|
|
2876
2991
|
return t.replace(/\\?\$\{\s*([^}]+?)\s*\}/g, (o, s) => {
|
|
2877
|
-
const r = String(s || "").trim(),
|
|
2878
|
-
if (!
|
|
2992
|
+
const r = String(s || "").trim(), a = n.find(([i]) => i === r || r === "this." + i || r === "_vm." + i || r === "_ctx." + i || r === "$setup." + i || i === r.replace(/^(?:this|_vm|_ctx|\$setup)\./, ""));
|
|
2993
|
+
if (!a)
|
|
2879
2994
|
return o;
|
|
2880
|
-
const c =
|
|
2995
|
+
const c = a[1];
|
|
2881
2996
|
return c != null ? String(c) : o;
|
|
2882
2997
|
});
|
|
2883
2998
|
}
|
|
2884
|
-
function
|
|
2999
|
+
function Nn(t, e) {
|
|
2885
3000
|
return e === void 0 && t && typeof t == "object" && !Array.isArray(t) ? {
|
|
2886
3001
|
defaultValue: void 0,
|
|
2887
3002
|
values: t
|
|
@@ -2890,13 +3005,13 @@ function $n(t, e) {
|
|
|
2890
3005
|
values: e
|
|
2891
3006
|
};
|
|
2892
3007
|
}
|
|
2893
|
-
function
|
|
2894
|
-
const { locale: e = "zh-CN", messages: n = {} } = t, o =
|
|
3008
|
+
function Xr(t) {
|
|
3009
|
+
const { locale: e = "zh-CN", messages: n = {} } = t, o = On(n), s = ne(e), r = ne(0), a = gt(), c = Je() && a && typeof a.observable == "function" ? a.observable({
|
|
2895
3010
|
locale: e,
|
|
2896
3011
|
messageVersion: 0
|
|
2897
|
-
}) : null, i = () => c ? c.locale : s.value,
|
|
3012
|
+
}) : null, i = () => c ? c.locale : s.value, u = (w) => {
|
|
2898
3013
|
s.value = w, c && (c.locale = w);
|
|
2899
|
-
},
|
|
3014
|
+
}, d = () => {
|
|
2900
3015
|
r.value += 1, c && (c.messageVersion += 1);
|
|
2901
3016
|
}, h = {
|
|
2902
3017
|
// 当前语言 (兼容 Vue 3 的 .value 访问)
|
|
@@ -2905,46 +3020,46 @@ function Dr(t) {
|
|
|
2905
3020
|
return i();
|
|
2906
3021
|
},
|
|
2907
3022
|
set value(w) {
|
|
2908
|
-
|
|
3023
|
+
u(w);
|
|
2909
3024
|
}
|
|
2910
3025
|
},
|
|
2911
3026
|
// 翻译函数(支持嵌套 key 的点号访问)
|
|
2912
|
-
t(w, k,
|
|
2913
|
-
const _ =
|
|
2914
|
-
k = _.defaultValue,
|
|
2915
|
-
const
|
|
2916
|
-
if (
|
|
2917
|
-
return he(k || w,
|
|
2918
|
-
const E =
|
|
3027
|
+
t(w, k, T) {
|
|
3028
|
+
const _ = Nn(k, T);
|
|
3029
|
+
k = _.defaultValue, T = _.values, r.value, c && c.messageVersion;
|
|
3030
|
+
const $ = i();
|
|
3031
|
+
if ($ === "zh-CN" && !w.startsWith("i.") && !w.startsWith("pro."))
|
|
3032
|
+
return he(k || w, T);
|
|
3033
|
+
const E = Mt(o, $);
|
|
2919
3034
|
let g = E[w];
|
|
2920
|
-
return g === void 0 && w.includes(".") && (g = w.split(".").reduce((v, C) => v && typeof v == "object" ? v[C] : void 0, E)), he(g && typeof g == "string" && g !== w ? g : k || w,
|
|
3035
|
+
return g === void 0 && w.includes(".") && (g = w.split(".").reduce((v, C) => v && typeof v == "object" ? v[C] : void 0, E)), he(g && typeof g == "string" && g !== w ? g : k || w, T);
|
|
2921
3036
|
},
|
|
2922
3037
|
// 设置某个语言的所有消息
|
|
2923
3038
|
setLocaleMessage(w, k) {
|
|
2924
|
-
return o[we(w)] = { ...k },
|
|
3039
|
+
return o[we(w)] = { ...k }, d(), o[we(w)];
|
|
2925
3040
|
},
|
|
2926
3041
|
// 获取某个语言的消息
|
|
2927
3042
|
getLocaleMessage(w) {
|
|
2928
|
-
return
|
|
3043
|
+
return Mt(o, w);
|
|
2929
3044
|
}
|
|
2930
3045
|
};
|
|
2931
3046
|
return h.global = h, h;
|
|
2932
3047
|
}
|
|
2933
|
-
const
|
|
3048
|
+
const zn = Qe.create({
|
|
2934
3049
|
timeout: 8e3
|
|
2935
3050
|
});
|
|
2936
|
-
|
|
3051
|
+
zn.interceptors.request.use((t) => {
|
|
2937
3052
|
const n = (x.get("I18N_CONFIG") || {}).token;
|
|
2938
3053
|
return n && (t.headers.Authorization = `Bearer ${n}`), t;
|
|
2939
3054
|
});
|
|
2940
|
-
function
|
|
3055
|
+
function Jr(t = {}) {
|
|
2941
3056
|
const n = JSON.stringify({
|
|
2942
3057
|
alg: "HS512"
|
|
2943
3058
|
// 算法
|
|
2944
3059
|
}), o = JSON.stringify(t);
|
|
2945
|
-
return
|
|
3060
|
+
return Un.JWS.sign("HS512", n, o, "");
|
|
2946
3061
|
}
|
|
2947
|
-
function
|
|
3062
|
+
function Qr(t) {
|
|
2948
3063
|
if (!t || typeof t != "string") return "";
|
|
2949
3064
|
const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = e.padEnd(
|
|
2950
3065
|
e.length + (4 - e.length % 4) % 4,
|
|
@@ -2959,21 +3074,21 @@ function Rr(t) {
|
|
|
2959
3074
|
}
|
|
2960
3075
|
return "";
|
|
2961
3076
|
}
|
|
2962
|
-
function
|
|
3077
|
+
function ei(t) {
|
|
2963
3078
|
if (!t || typeof t != "string") return null;
|
|
2964
3079
|
const e = t.split(".");
|
|
2965
3080
|
if (e.length !== 3) return null;
|
|
2966
3081
|
try {
|
|
2967
|
-
return JSON.parse(
|
|
3082
|
+
return JSON.parse(Qr(e[1]));
|
|
2968
3083
|
} catch {
|
|
2969
3084
|
return null;
|
|
2970
3085
|
}
|
|
2971
3086
|
}
|
|
2972
|
-
function
|
|
2973
|
-
const e =
|
|
3087
|
+
function ti(t) {
|
|
3088
|
+
const e = ei(t);
|
|
2974
3089
|
return !!(e && (e.mainAppCode && e.userCode && e.deviceType || e.appCode && e.orgCode && e.userCode && e.i18n_token));
|
|
2975
3090
|
}
|
|
2976
|
-
function
|
|
3091
|
+
function Ot(t) {
|
|
2977
3092
|
if (!t) return "";
|
|
2978
3093
|
const e = String(t);
|
|
2979
3094
|
let n = 0;
|
|
@@ -2981,22 +3096,22 @@ function It(t) {
|
|
|
2981
3096
|
n = (n << 5) - n + e.charCodeAt(o), n |= 0;
|
|
2982
3097
|
return `user_${Math.abs(n)}`;
|
|
2983
3098
|
}
|
|
2984
|
-
function
|
|
3099
|
+
function de(t, ...e) {
|
|
2985
3100
|
if (typeof t == "function")
|
|
2986
3101
|
return t(...e);
|
|
2987
3102
|
}
|
|
2988
|
-
function
|
|
3103
|
+
function gt(t) {
|
|
2989
3104
|
return t && (t.version || t.prototype || t.config) ? t : Ce && Ce.version ? Ce : Ce;
|
|
2990
3105
|
}
|
|
2991
|
-
function
|
|
3106
|
+
function Je(t) {
|
|
2992
3107
|
if (t && t.config && t.config.globalProperties)
|
|
2993
3108
|
return !1;
|
|
2994
|
-
const e =
|
|
3109
|
+
const e = gt(t), n = e && e.version;
|
|
2995
3110
|
return typeof n == "string" ? n.split(".")[0] === "2" : !!(e && e.prototype);
|
|
2996
3111
|
}
|
|
2997
|
-
function
|
|
3112
|
+
function Dn(t, e = /* @__PURE__ */ new Set()) {
|
|
2998
3113
|
if (!t || e.has(t)) return;
|
|
2999
|
-
e.add(t), typeof t.$forceUpdate == "function" && t.$forceUpdate(), (t.$children || []).forEach((o) =>
|
|
3114
|
+
e.add(t), typeof t.$forceUpdate == "function" && t.$forceUpdate(), (t.$children || []).forEach((o) => Dn(o, e));
|
|
3000
3115
|
}
|
|
3001
3116
|
class X {
|
|
3002
3117
|
constructor(e = {}) {
|
|
@@ -3005,27 +3120,27 @@ class X {
|
|
|
3005
3120
|
appCode: o,
|
|
3006
3121
|
messages: s,
|
|
3007
3122
|
token: r,
|
|
3008
|
-
orgCode:
|
|
3123
|
+
orgCode: a,
|
|
3009
3124
|
loginRouteName: c,
|
|
3010
3125
|
login: i,
|
|
3011
|
-
keyboard:
|
|
3012
|
-
locale:
|
|
3126
|
+
keyboard: u,
|
|
3127
|
+
locale: d,
|
|
3013
3128
|
env: h,
|
|
3014
3129
|
dev: w,
|
|
3015
3130
|
i18nTokenRequest: k,
|
|
3016
|
-
auth:
|
|
3131
|
+
auth: T
|
|
3017
3132
|
} = e;
|
|
3018
|
-
this.env = h || "local", this.baseUrl = h === "dev" || w === !0 ? "https://test.ihotel.cn" : !h || h === "local" ? "" : "https://trans.ihotel.cn", this.i18nTokenRequest = k || null, this.baseToken = r || (x.get("I18N_CONFIG") || {}).token || x.get("token"), this.token = this.baseToken, this.auth =
|
|
3133
|
+
this.env = h || "local", this.baseUrl = h === "dev" || w === !0 ? "https://test.ihotel.cn" : !h || h === "local" ? "" : "https://trans.ihotel.cn", this.i18nTokenRequest = k || null, this.baseToken = r || (x.get("I18N_CONFIG") || {}).token || x.get("token"), this.token = this.baseToken, this.auth = T || null, this.authInfo = {
|
|
3019
3134
|
appCode: o,
|
|
3020
|
-
orgCode:
|
|
3135
|
+
orgCode: a || "",
|
|
3021
3136
|
userCode: ""
|
|
3022
|
-
}, this.tokenResolveVersion = 0, this.manualAuthScope =
|
|
3023
|
-
|
|
3024
|
-
), this._isRTL = ke(this.locale), this.persistI18nConfig(), this.name = "", this.messages =
|
|
3137
|
+
}, this.tokenResolveVersion = 0, this.manualAuthScope = a || (r ? Ot(r) : ""), this.authUnsubscribe = null, this.authVersion = 0, this.languageVersion = 0, this.activeCacheScope = this.manualAuthScope || "guest", this.loadI18n = !0, this.appCode = o, this.router = n, this.locale = this.normalizeLocale(
|
|
3138
|
+
d || x.get("I18N_LANGUAGE") || navigator.language || "zh-CN"
|
|
3139
|
+
), this._isRTL = ke(this.locale), this.persistI18nConfig(), this.name = "", this.messages = On(s || {}), this.translationKeys = [], this.translationKeySet = /* @__PURE__ */ new Set(), this.loginRouteName = c || "login", this.login = i, this.loginTranslationKeys = [], this.keyboard = u || "ctrl+shift+l", this.vueInstances = /* @__PURE__ */ new Set(), this.editKeyboard = e.editKeyboard || "ctrl+shift+e", this.applyAuthState(this.resolveAuthState(), { silent: !0 }), this.initI18n(e), this.router && this.initRouterGuards(), mt.bind(this.keyboard, (_) => {
|
|
3025
3140
|
_.preventDefault();
|
|
3026
|
-
const
|
|
3141
|
+
const $ = Array.from(this.translationKeySet);
|
|
3027
3142
|
this.translationKeys = Array.from(
|
|
3028
|
-
/* @__PURE__ */ new Set([...this.translationKeys || [],
|
|
3143
|
+
/* @__PURE__ */ new Set([...this.translationKeys || [], ...$])
|
|
3029
3144
|
);
|
|
3030
3145
|
const E = {
|
|
3031
3146
|
name: this.name,
|
|
@@ -3051,8 +3166,8 @@ class X {
|
|
|
3051
3166
|
},
|
|
3052
3167
|
html: `<iframe src="${y}" style="width: 100%; height: 100%;border: none;min-height: 480px;"></iframe>`
|
|
3053
3168
|
});
|
|
3054
|
-
}),
|
|
3055
|
-
_.preventDefault(),
|
|
3169
|
+
}), mt.bind(this.editKeyboard, (_) => {
|
|
3170
|
+
_.preventDefault(), Rr.toggle();
|
|
3056
3171
|
}), this.setupLanguageChangeListener(), this.setupAuthListener(), this.setupMessageListener();
|
|
3057
3172
|
}
|
|
3058
3173
|
/**
|
|
@@ -3074,15 +3189,15 @@ class X {
|
|
|
3074
3189
|
});
|
|
3075
3190
|
}
|
|
3076
3191
|
resolveAuthState() {
|
|
3077
|
-
const e = this.auth || {}, n =
|
|
3078
|
-
o ||
|
|
3192
|
+
const e = this.auth || {}, n = de(e.getToken) ?? "", o = de(e.getScope) ?? de(e.getUserScope) ?? "", s = de(e.getOrgCode) ?? "", r = de(e.getUserCode) ?? "", a = typeof e.isAuthenticated == "function" ? !!e.isAuthenticated() : !!n, c = a ? String(
|
|
3193
|
+
o || Ot(n) || this.manualAuthScope || "user"
|
|
3079
3194
|
) : "guest";
|
|
3080
3195
|
return {
|
|
3081
3196
|
token: n,
|
|
3082
3197
|
scope: c,
|
|
3083
3198
|
orgCode: s,
|
|
3084
3199
|
userCode: r,
|
|
3085
|
-
isAuthenticated:
|
|
3200
|
+
isAuthenticated: a
|
|
3086
3201
|
};
|
|
3087
3202
|
}
|
|
3088
3203
|
normalizeAuthInfo(e = {}) {
|
|
@@ -3107,7 +3222,7 @@ class X {
|
|
|
3107
3222
|
}
|
|
3108
3223
|
async createI18nToken(e, n = {}) {
|
|
3109
3224
|
if (!e) return "";
|
|
3110
|
-
if (
|
|
3225
|
+
if (ti(e))
|
|
3111
3226
|
return e;
|
|
3112
3227
|
const o = {
|
|
3113
3228
|
appCode: n.appCode || this.appCode,
|
|
@@ -3119,14 +3234,14 @@ class X {
|
|
|
3119
3234
|
"非 JWT token 需要通过 setToken(token, { orgCode, userCode }) 提供鉴权信息"
|
|
3120
3235
|
), e;
|
|
3121
3236
|
try {
|
|
3122
|
-
const s = await
|
|
3237
|
+
const s = await Gn({
|
|
3123
3238
|
request: this.i18nTokenRequest,
|
|
3124
3239
|
appCode: o.appCode || this.appCode,
|
|
3125
3240
|
orgCode: o.orgCode,
|
|
3126
3241
|
userCode: o.userCode,
|
|
3127
3242
|
token: e
|
|
3128
3243
|
});
|
|
3129
|
-
return s ?
|
|
3244
|
+
return s ? Jr({
|
|
3130
3245
|
appCode: o.appCode || this.appCode,
|
|
3131
3246
|
orgCode: o.orgCode,
|
|
3132
3247
|
userCode: o.userCode,
|
|
@@ -3141,13 +3256,13 @@ class X {
|
|
|
3141
3256
|
return this.createI18nToken(e, n).then((r) => {
|
|
3142
3257
|
if (s !== this.tokenResolveVersion || !r)
|
|
3143
3258
|
return !1;
|
|
3144
|
-
const
|
|
3145
|
-
return this.token = r, x.set("I18N_TOKEN", this.token), this.persistI18nConfig(),
|
|
3259
|
+
const a = this.token !== r;
|
|
3260
|
+
return this.token = r, x.set("I18N_TOKEN", this.token), this.persistI18nConfig(), a && o ? this.refreshLanguageForCurrentAuth() : a;
|
|
3146
3261
|
});
|
|
3147
3262
|
}
|
|
3148
3263
|
applyAuthState(e = {}, { silent: n = !1 } = {}) {
|
|
3149
|
-
const o = this.token, s = this.activeCacheScope, r = e.token ?? "",
|
|
3150
|
-
return this.userToken = r, this.token = e.isAuthenticated ? r || this.baseToken : this.baseToken, this.activeCacheScope =
|
|
3264
|
+
const o = this.token, s = this.activeCacheScope, r = e.token ?? "", a = e.isAuthenticated ? e.scope || "user" : "guest";
|
|
3265
|
+
return this.userToken = r, this.token = e.isAuthenticated ? r || this.baseToken : this.baseToken, this.activeCacheScope = a, x.set("I18N_TOKEN", this.token), this.persistI18nConfig(), n ? !1 : o !== this.token || s !== this.activeCacheScope;
|
|
3151
3266
|
}
|
|
3152
3267
|
async refreshLanguageForCurrentAuth() {
|
|
3153
3268
|
const e = ++this.authVersion, n = this.locale, o = this.activeCacheScope || "guest";
|
|
@@ -3211,47 +3326,47 @@ class X {
|
|
|
3211
3326
|
await this.setLanguage(s || this.locale, {
|
|
3212
3327
|
cacheScope: this.activeCacheScope
|
|
3213
3328
|
});
|
|
3214
|
-
} catch (
|
|
3215
|
-
console.error("初始化语言失败,已跳过阻塞:",
|
|
3329
|
+
} catch (u) {
|
|
3330
|
+
console.error("初始化语言失败,已跳过阻塞:", u);
|
|
3216
3331
|
}
|
|
3217
3332
|
this.loadI18n = !1;
|
|
3218
|
-
const
|
|
3219
|
-
if (
|
|
3220
|
-
let
|
|
3221
|
-
if (typeof
|
|
3333
|
+
const a = this.router.getRoutes().find((u) => u.name === this.loginRouteName || u.path === `/${this.loginRouteName}`);
|
|
3334
|
+
if (a && a.components) {
|
|
3335
|
+
let u = (c = a.components) == null ? void 0 : c.default;
|
|
3336
|
+
if (typeof u == "function" && u.toString().includes("import("))
|
|
3222
3337
|
try {
|
|
3223
|
-
|
|
3338
|
+
u = await u(), u = u.default;
|
|
3224
3339
|
} catch (h) {
|
|
3225
3340
|
console.error("加载异步组件时出错:", h), o();
|
|
3226
3341
|
return;
|
|
3227
3342
|
}
|
|
3228
|
-
const
|
|
3229
|
-
this.loginTranslationKeys =
|
|
3343
|
+
const d = Ze(u);
|
|
3344
|
+
this.loginTranslationKeys = d;
|
|
3230
3345
|
}
|
|
3231
3346
|
if (e.matched.length > 0)
|
|
3232
3347
|
try {
|
|
3233
|
-
const
|
|
3234
|
-
for (const
|
|
3235
|
-
let h = (i =
|
|
3348
|
+
const u = [];
|
|
3349
|
+
for (const d of e.matched) {
|
|
3350
|
+
let h = (i = d.components) == null ? void 0 : i.default;
|
|
3236
3351
|
if (typeof h == "function" && h.toString().includes("import(") && (h = await h(), h = h.default), h) {
|
|
3237
|
-
const w =
|
|
3238
|
-
|
|
3352
|
+
const w = Ze(h);
|
|
3353
|
+
u.push(...w);
|
|
3239
3354
|
}
|
|
3240
3355
|
}
|
|
3241
|
-
this.translationKeys =
|
|
3242
|
-
} catch (
|
|
3243
|
-
console.error("加载异步组件时出错:",
|
|
3356
|
+
this.translationKeys = u;
|
|
3357
|
+
} catch (u) {
|
|
3358
|
+
console.error("加载异步组件时出错:", u), o();
|
|
3244
3359
|
return;
|
|
3245
3360
|
}
|
|
3246
3361
|
o();
|
|
3247
3362
|
}), X._afterEachGuardRegistered || (X._afterEachGuardRegistered = !0, this.router.afterEach(async () => {
|
|
3248
|
-
var r,
|
|
3249
|
-
await
|
|
3363
|
+
var r, a;
|
|
3364
|
+
await bt();
|
|
3250
3365
|
const e = Array.from(this.translationKeySet), n = Array.from(
|
|
3251
3366
|
/* @__PURE__ */ new Set([...this.translationKeys || [], ...e])
|
|
3252
3367
|
);
|
|
3253
3368
|
this.translationKeys = n;
|
|
3254
|
-
const o = (r = this.router) == null ? void 0 : r.currentRoute, s = (
|
|
3369
|
+
const o = (r = this.router) == null ? void 0 : r.currentRoute, s = (a = (o == null ? void 0 : o.value) ?? o) == null ? void 0 : a.name;
|
|
3255
3370
|
if (s === this.loginRouteName && (this.loginTranslationKeys = n), s) {
|
|
3256
3371
|
this.name = s;
|
|
3257
3372
|
const c = x.get("I18N_CONFIG") || {};
|
|
@@ -3264,33 +3379,33 @@ class X {
|
|
|
3264
3379
|
}
|
|
3265
3380
|
// 初始化 i18n 实例
|
|
3266
3381
|
initI18n(e) {
|
|
3267
|
-
this.i18n =
|
|
3382
|
+
this.i18n = Xr({
|
|
3268
3383
|
locale: this.locale,
|
|
3269
3384
|
messages: e.messages || {}
|
|
3270
3385
|
}), this.keyValueMap = {}, globalThis.__I18N_ALL_KEYS__ = /* @__PURE__ */ new Set();
|
|
3271
3386
|
const n = this;
|
|
3272
3387
|
globalThis.$t = (o, s, r) => {
|
|
3273
3388
|
var h, w;
|
|
3274
|
-
const
|
|
3275
|
-
if (s =
|
|
3389
|
+
const a = Nn(s, r);
|
|
3390
|
+
if (s = a.defaultValue, r = a.values, typeof o == "string" && (n.translationKeySet.add(o), globalThis.__I18N_ALL_KEYS__ && globalThis.__I18N_ALL_KEYS__.add(o)), n.i18n.global.locale.value === "zh-CN" && typeof o == "string" && !o.startsWith("i.") && !o.startsWith("pro."))
|
|
3276
3391
|
return he(s || o, r);
|
|
3277
|
-
const i = (h = n.router) == null ? void 0 : h.currentRoute,
|
|
3278
|
-
let
|
|
3279
|
-
if (
|
|
3280
|
-
const k = `${
|
|
3281
|
-
if (
|
|
3282
|
-
|
|
3392
|
+
const i = (h = n.router) == null ? void 0 : h.currentRoute, u = (w = (i == null ? void 0 : i.value) ?? i) == null ? void 0 : w.name;
|
|
3393
|
+
let d;
|
|
3394
|
+
if (u) {
|
|
3395
|
+
const k = `${u}.${o}`, T = n.i18n.t(k, void 0, r);
|
|
3396
|
+
if (T !== k && !A.isEmpty(T))
|
|
3397
|
+
d = T;
|
|
3283
3398
|
else {
|
|
3284
|
-
const _ = `common.${o}`,
|
|
3285
|
-
|
|
3399
|
+
const _ = `common.${o}`, $ = n.i18n.t(_, void 0, r);
|
|
3400
|
+
$ !== _ ? d = $ : d = n.i18n.t(o, void 0, r);
|
|
3286
3401
|
}
|
|
3287
3402
|
} else
|
|
3288
|
-
|
|
3289
|
-
return
|
|
3403
|
+
d = n.i18n.t(o, void 0, r);
|
|
3404
|
+
return d === o && typeof s == "string" && s && (d = s), d = he(d, r), typeof o == "string" && typeof d == "string" && (n.keyValueMap[d] = o, globalThis.__I18N_KEY_VALUE_MAP__ || (globalThis.__I18N_KEY_VALUE_MAP__ = {}), globalThis.__I18N_KEY_VALUE_MAP__[d] = o), d;
|
|
3290
3405
|
}, this.t = globalThis.$t, globalThis.$deepScan = function(o) {
|
|
3291
3406
|
return o;
|
|
3292
3407
|
}, globalThis.$clearI18n = this.clearI18n = () => {
|
|
3293
|
-
|
|
3408
|
+
Yn({
|
|
3294
3409
|
appCode: this.appCode,
|
|
3295
3410
|
cacheScope: this.activeCacheScope
|
|
3296
3411
|
});
|
|
@@ -3370,9 +3485,9 @@ class X {
|
|
|
3370
3485
|
typeof document < "u" && (document.documentElement.dir = this._isRTL ? "rtl" : "ltr", document.documentElement.lang = this.locale);
|
|
3371
3486
|
}
|
|
3372
3487
|
notifyLanguageChanged(e, n) {
|
|
3373
|
-
|
|
3488
|
+
Je() && this.vueInstances && this.vueInstances.size > 0 && bt(() => {
|
|
3374
3489
|
this.vueInstances.forEach((o) => {
|
|
3375
|
-
|
|
3490
|
+
Dn(o);
|
|
3376
3491
|
});
|
|
3377
3492
|
}), typeof window < "u" && typeof CustomEvent == "function" && window.dispatchEvent(
|
|
3378
3493
|
new CustomEvent("gc-i18n-language-changed", {
|
|
@@ -3388,7 +3503,7 @@ class X {
|
|
|
3388
3503
|
return this.baseToken = e || "", this.token = this.baseToken, x.set("I18N_TOKEN", this.token), this.persistI18nConfig(), this.resolveAndApplyI18nToken(this.baseToken, o);
|
|
3389
3504
|
}
|
|
3390
3505
|
async getLanguages(e = !1) {
|
|
3391
|
-
return await
|
|
3506
|
+
return await Nt({
|
|
3392
3507
|
baseUrl: this.baseUrl,
|
|
3393
3508
|
token: this.token,
|
|
3394
3509
|
appCode: this.appCode,
|
|
@@ -3397,16 +3512,16 @@ class X {
|
|
|
3397
3512
|
}
|
|
3398
3513
|
async setLanguage(e = "zh-CN", n = {}) {
|
|
3399
3514
|
e = this.normalizeLocale(e);
|
|
3400
|
-
const o = n.cacheScope || this.activeCacheScope || "guest", s = n.authVersion || this.authVersion, r = ++this.languageVersion,
|
|
3401
|
-
let c = x.get(
|
|
3515
|
+
const o = n.cacheScope || this.activeCacheScope || "guest", s = n.authVersion || this.authVersion, r = ++this.languageVersion, a = "I18N_MESSAGES_COMMON_" + e;
|
|
3516
|
+
let c = x.get(a);
|
|
3402
3517
|
if (A.isEmpty(c))
|
|
3403
3518
|
try {
|
|
3404
|
-
const i = await
|
|
3519
|
+
const i = await zn.get(
|
|
3405
3520
|
`https://cdn.ihotel.cn/i18n_messages/${e}.json`
|
|
3406
3521
|
);
|
|
3407
3522
|
if (i) {
|
|
3408
|
-
const { data:
|
|
3409
|
-
c =
|
|
3523
|
+
const { data: u } = i;
|
|
3524
|
+
c = u, x.set(a, u);
|
|
3410
3525
|
}
|
|
3411
3526
|
} catch (i) {
|
|
3412
3527
|
console.warn(
|
|
@@ -3415,7 +3530,7 @@ class X {
|
|
|
3415
3530
|
), c = {};
|
|
3416
3531
|
}
|
|
3417
3532
|
try {
|
|
3418
|
-
const i = await
|
|
3533
|
+
const i = await Wn({
|
|
3419
3534
|
baseUrl: this.baseUrl,
|
|
3420
3535
|
appCode: this.appCode,
|
|
3421
3536
|
language: e || this.locale,
|
|
@@ -3426,36 +3541,36 @@ class X {
|
|
|
3426
3541
|
if (s !== this.authVersion || r !== this.languageVersion)
|
|
3427
3542
|
return !1;
|
|
3428
3543
|
if (i && Array.isArray(i)) {
|
|
3429
|
-
const
|
|
3544
|
+
const u = Hn(i), d = A.assign(
|
|
3430
3545
|
{},
|
|
3431
3546
|
c,
|
|
3432
3547
|
A.get(this.messages, e),
|
|
3433
|
-
|
|
3548
|
+
u
|
|
3434
3549
|
);
|
|
3435
|
-
this.i18n.global.setLocaleMessage(e,
|
|
3550
|
+
this.i18n.global.setLocaleMessage(e, d);
|
|
3436
3551
|
} else {
|
|
3437
|
-
const
|
|
3552
|
+
const u = A.assign(
|
|
3438
3553
|
{},
|
|
3439
3554
|
c,
|
|
3440
3555
|
A.get(this.messages, e)
|
|
3441
3556
|
);
|
|
3442
|
-
this.i18n.global.setLocaleMessage(e,
|
|
3557
|
+
this.i18n.global.setLocaleMessage(e, u);
|
|
3443
3558
|
}
|
|
3444
3559
|
return this.locale = e, this._isRTL = ke(e), this.i18n.global.locale.value = e, x.set("I18N_LANGUAGE", e), this.updateDocumentDir(), this.notifyLanguageChanged(e, !0), !0;
|
|
3445
3560
|
} catch (i) {
|
|
3446
3561
|
if (console.error(`设置语言 ${e} 失败,使用本地消息继续运行:`, i), s !== this.authVersion || r !== this.languageVersion)
|
|
3447
3562
|
return !1;
|
|
3448
|
-
const
|
|
3563
|
+
const u = A.assign(
|
|
3449
3564
|
{},
|
|
3450
3565
|
c,
|
|
3451
3566
|
A.get(this.messages, e)
|
|
3452
3567
|
);
|
|
3453
|
-
return this.i18n.global.setLocaleMessage(e,
|
|
3568
|
+
return this.i18n.global.setLocaleMessage(e, u), this.locale = e, this._isRTL = ke(e), this.i18n.global.locale.value = e, x.set("I18N_LANGUAGE", e), this.updateDocumentDir(), this.notifyLanguageChanged(e, !1), !1;
|
|
3454
3569
|
}
|
|
3455
3570
|
}
|
|
3456
3571
|
install(e, n = {}) {
|
|
3457
|
-
if (
|
|
3458
|
-
const o =
|
|
3572
|
+
if (Je(e)) {
|
|
3573
|
+
const o = gt(e);
|
|
3459
3574
|
if (o.prototype.$t = this.t || globalThis.$t, o.prototype.$i18n = this.i18n, !X._vue2UpdateMixinRegistered && o.mixin) {
|
|
3460
3575
|
X._vue2UpdateMixinRegistered = !0;
|
|
3461
3576
|
const s = this;
|
|
@@ -3471,9 +3586,9 @@ class X {
|
|
|
3471
3586
|
} else
|
|
3472
3587
|
e.config.globalProperties.$t = this.t || globalThis.$t, e.config.globalProperties.$i18n = this.i18n;
|
|
3473
3588
|
e.component("i18n-earth", {
|
|
3474
|
-
|
|
3589
|
+
...Pt,
|
|
3475
3590
|
props: {
|
|
3476
|
-
|
|
3591
|
+
...Pt.props,
|
|
3477
3592
|
baseUrl: {
|
|
3478
3593
|
type: String,
|
|
3479
3594
|
default: this.baseUrl
|